Did you ever come across the finding that even if the order of letters in words is changed just slightly you will most likely be able to read the text without much problems? I think that this is so interesting that I invested a considerable amount of time writing a software that reads a text, changes the words and outputs the result. Easier said than done, this post tries to explain what I’ve been working on.
Changing the order of letters in words
February 6th, 2011 — Tech
Building your own Fetch as Googlebot
December 28th, 2009 — Tech
Just recently Google announced a great feature as part of the Webmaster Tools: you can fetch your site with the Googlebot. At first I thought they would reveal what content gets extracted from the site and how they might proceed from there but they just seem to crawl your site, showing you the HTTP header fields and the site’s content.
In this post I’d like to present some Java code using the latest and greatest version of HttpClient that allows you to crawl any site, have a look at the HTTP header fields, the site’s content and measure how long it took to download the site. It’s almost the same what Google’s feature does.
The Eclipse project with the code for this post can be downloaded as tar.gz or zip. You can browse the code online here.
Ideas about clean if statements
December 18th, 2009 — Tech
If you’re reading a lot of code you may get to the point where you’d like it to be clean, so it’s easier for you to read. There’re a lot of resources about the beauty of code around and in this post I’d like to share some ideas about writing concise if statements.
Although these ideas may apply to a lot of different programming languages I chose to give examples written in Java, PHP or Python. There should be no problem to translate this into other, similar languages.
Hot math: twin and sexy prime numbers
December 14th, 2009 — Tech
Just recently I discovered that there’s something called sexy prime numbers. I read about twin primes but hadn’t heard the other term before. The concept is pretty simple: take a prime number and check whether the next prime minus the first one results in a certain number, e.g. 2 for twin primes or 6 for sexy primes. This post presents a simple solution to calculate arbitrary combinations of prime number pairs, triplets, etc.
The Eclipse project with the code for this post can be downloaded as tar.gz or zip. You can browse the code online here.