Friday, October 12, 2007

Ubuntu: Getting faster internet

All computers on the internet have a unique IP-address. That address we use for connecting to other computers, reading the files they put in there shared map. Yes, I'm talking about surfing. Each time we visit a website there are several things that are done automatically. For example you want to surf to the domain name google.com, your computer sends a request to a dns-server and ask what the IP-address is of google.com. The dns-server replies friendly with that IP-address and your computer knows where to find the google-server. Now your computer can access the google-server.

So every time you look for a website, you automatically go to a dns-server and ask him the IP-adress you need. Globally you're just accessing 2 servers before you are at the right place. How can we make that faster? If we can make a dsn-cache on your own computer. Then every time you look after an domain name, it would first look if the domain name isn't listed on your computer. If not, it would search the IP in a real dns-server and put the lookup into the locally cache. If it is listed in your computer cache, he just skip the dns-server and uses the local cache for knowing the IP-address of the site you search.

But how can we accomplish that on a ubuntu computer?
Open your synaptic manager:
- system -> administration -> synaptic package manager
Install DNS-cache (dnsmasq)
- search after dnsmasq
- mark dnsmasq for installation
- press 'Apply' for install the new program
Configuring Ubuntu
- system -> administration -> network (or networking)
- goto the DNS tab
- add a new DNS Server with adress 127.0.0.1
- drag the 127.0.0.1 to the top of the list
- close

Voila your computer will make a locally DNS cache and skip the domain lookup.

Sunday, October 07, 2007

Nice algorithm: Content-Based Image Retargeting

Recently I discovered there is a very useful algorithm to resize images. It can be very handy if you want to shrink or resize the image. It's called Content-Based Image Retargeting or short retargeting, others calls it also Seam carving. So what is it? If you want to resize a picture you always need to be sure that the ratio is good or else the image will look stretched. Now this new algorithm is able to scale an image out of ratio and still deliver a nice looking picture. Now if you don't believe me or if you think that's not possible or you just don't understand what I'm talking about, look to this video about it. It's a presentation that Dr Shai Avidan and Dr Ariel Shamir put online in support of their paper on Seam Carving for Content-Aware Image Resizing



Now, if you don't believe in videos, you can always try it yourself:

- There is already a plugin for GIMP to use it. It's called Liquid Rescale GIMP plug-in. It isn't advanced and you can only choose the width and the height you want. After installation you can find the rescale dialog in Layer -> Liquid rescale.
site: http://liquidrescale.wikidot.com/
download: http://liquidrescale.wikidot.com/download-page

- There is already an AS-class to use this in your own Flash movie and even a Java implentation.
More information: http://www.zeropointnine.com/blog/seam-carving-in-as3-with-source

- Liquid Resize is a program dedicating to do this job. It's nothing more or less than a resizing program even with advanced options using this algorithm.

site: http://www.thegedanken.com/retarget/