Postagens

Mostrando postagens de abril, 2010

Understanding Visitor Pattern

Imagem
In Object Oriented Design, the visitor patter is one of the obscure pattern yet powerful enough to solve many complex OO scenarios. Visitor Pattern is also not really easy to understand at the first glance but you need to dig it around with practical examples. (I guess it’s not just for Visitor pattern but also for all the other patterns) I would like to give a clean and simple introduction to visitor pattern with this post. So let’s start with a simple example ofthe usage of Visitor pattern. Visitor Pattern is often useful when there are fair numbers of related classes. One of the common examples of such a scenario is ‘drawing different shapes’. In this case we have a set of related classes; Circle, Trangle, Rectangle etc. Now, if we are going to implement a draw() function for all these classes i.e. circle::draw(), trangle::draw().. etc we may be drawing different shapes but we are replicating a fair amount of code in all the classes. (Because the underlying methods, that we use to d...

Image transferring on Ubuntu 9.10 - gPhoto2 as Nikon Transfer

Imagem
When dealing with multimedia devices Ubuntu becomes a nightmare as most of the devices does not offer you the Ubuntu compatibility. The story was the same for my Nikon Digital Camera transfer tools. I badly wanted to transfer images from my camera to my computer and found out that Ubuntu doesn't allow me to transfer the images. Finally gPhoto2 came to save me and it is a nice tool that allows you to transfer all your images from your cam to pc. This is what I did. Install gphoto2. (simply use the package manager) Unmount the device(camera) if mounted automatically. Open a terminal and go to the location that you want to store the images. Then do : gphoto2 --get-all-files For more information do : gphoto2 --usage That's all. By the way.. I know this is not a very user friendly way but after all as an Ubuntu user.. this is not an alien thing to use command line to transfer images :).

iTunes on Ubuntu - Songbird 1.4.3

Imagem
Missing iTunes on Ubuntu ? I have completely moved from Windows to Ubuntu 9.10 during last 3-4 months, and now I have alternatives for almost all the application I used to run on Windows. However, I'm missing iTunes so badly and couldn't find an attractive media player for Ubuntu till I came across Songbird . A few days back I downloaded their latest release( Songbird 1.4.3, Build 1438) and really feel happy about the user interface and the features. I feel like I'm using iTunes on Ubuntu.(apparently the Songbird plugin for iPod support seems broken so I have to user gtkpod for manage iPod on Ubuntu ) For those who are new to Songbird, it is a free and open source software audio player (and web browser too) which was founded by Rob Lord. Songbird utilizes the cross-platform frameworks, Mozilla's XULRunner and GStreamer media framework, and capable of running on Microsoft Windows, Mac OS X, and various Linux flavors(Ubuntu, Fedora). When we compare Songbird 1.4.3 with...