Friday, August 31, 2012

Eclipse feature patch not getting installed

Recently i was trying to modify an existing eclipse plugin to make it work with JUNO. The orginal plugin was installed without problem in JUNO but when trying it fails to find some classes since there are API changes in the platform.

So i patch the original plugin with the new API and ran the plugin using eclipse and it works successfully. Now it was time to make it a package so i can install the patch without modifying jar files manually. So i read about how to create a eclipse feature patch which was exactly what i was looking for. So i created the patch and when i try to install it i was getting the following error:
              [patch name] is not applicable to the current configuration and will not be installed.

So what i though was that some thing wrong with the plugins that contained in the feature patch. So i first tried by replacing the new classes in the original plugin jar and changed the manifest to include the new API dependency. And it worked. So now i was sured that my plugin code was not the problem. So i them replaces the original plugin jar with my patched plugin jar and this cause the plugin to disappear. So now it seems some thing wrong with my manifest of my patched jar.
So i went through the manifest of my patched plugin once again and i saw that i have messed with a dependency. The problem was a dependency plugin version was mentioned with a qualifier which actually didn't included in my feature patch. So my patched plugin fails to load because that version cannot be found at runtime. But when i run through eclipse that it works because the dependency plugin project is there in my workspace. Fixing the version solved the problem with the installation and the feature patch was successfully installed.

So for starters with eclipse platform plugin development like me, if you get the above error check you plugin manifest whether it is correct for the target runtime environment.

Thursday, July 5, 2012

Should we unit test legacy code?

This is a more frequent question I hear from my colleagues. Well my answer yes provided that the code will not thrown out tomorrow and the cost of writing will not eat up your budget.

Well there are some challenges to this especially with legacy code.  Well you need to refactore your code so it's mockable in areas you need to mock. I know there are people who says "Don't touch that code if its working." Well aren't you already touching it. What harm it will do if I do bit more changes and refactor the code so that's testable and I can test it and make sure I don't break any thing. Do we need to live with that stinking code forever. The more you modify the more it will stink if you don't clean it today.

Well personally I don't agree with it. If the cost you put today will have good ROI then we should do it. This will secure your legacy code from future modification too.

Well we should consider unit testing as tool that you will use to verify your code you just wrote. if you are following TDD this really easy.

So I wish some day the people who say no to unit testing or people who thinks its a wast of time will find its advantages and power :)

Sunday, April 22, 2012

Updating Nokia E66 on VirtualBox

Well i wanted to update my wife's phone software which is a Nokia E66. I don't have a separate windows installation on my pc since i'm using Ubuntu. So i normally keep a window installation in a VirtualBox vm for emergency cases like this.

Well when i tried to start to update in the Nokia Suite it just switch of the phone which will be in kind of like sleep mode. After some time the Nokia Suite reports the connection is interrupted. Well first i though its some thing to do with the phone. Well then again i though may be i should look at the usb connections available. Because in the Nokia Suite massage it says to restart the phone to try to run the update process again. So that means the phone is not switched off, its in a mode which the user interactions are disabled.

So what i did was, i created a empty filter criteria in the vm usb settings and then start the update operation again. So as soon as the phone screen switch off  for my surprise when i look at the usb device connections i saw some thing like "Nokia ROM .....". So i selected that. This cause the Nokia Suite to show some progress in the progress bar. The easiest way to find out whether your phone is switched it's mode is the usb activity indicator in the VM status bar. If its idle that means the phone has switched it's mode.

So for this phone it switches in the three modes before it restarts the phone. After the restart the phone had the new version of the software and the feature that is stated in the update information. Hope this will be help full for some one who is primarily not running windows but on a OS which can run VirtualBox.

Friday, March 23, 2012

My Git-SVN Experience

Well some time back i started to use Git at my work place so i can share the code with my fellow developers when doing parallel development. The main reason for this is that the code was not ready to be push to our central repo.

Well then i though of giving a try with git-svn so i can create topic branch and work on it, share it and then when things ready, commit it to central repo. But the first thing i saw from my fellow developers was a unhappy face :(.

Well there is a reason for this. Because git have lot of advance functionality which make you possible to do things that you even don't think of. And their alternative commands for same task which make most of people confuse (including me some time back) and using those in wrong places will put you in trouble.

Well i tried git-svn for first time and the cloning of the repo was fine. But it was fine on command line not in the tortiseGit UI. And before committing back to central repo i was force to svn rebase (even though there was no changes in the central repo after i cloned) and dcommit which i guess is bit confusing for some users. It also took a long time to commit a change with few local revisions which got success after retrying for the second time. Even though it was OK with me, but we need some thing more simpler which gets the job done quickly with out the need for going through manuals to find out descriptions of various commands.

So i though to give a try to bzr which also have a svn integration. But that will be in another post :).

Saturday, October 22, 2011

Installing Avidemux on Ubuntu 11.10

Well for Ubuntu 11.10 the video editor (converter for me :) ) avidemux is not yet ready. So i though of finding a way to install this may be from an older release of Ubuntu to give it a try.

I chose natty since its more close to oneiric even though oneiric is based on Gnome3 and Natty is based on Gnome2. So i downloaded the debs from  https://launchpad.net/ubuntu/+source/avidemux/1:2.5.4-0ubuntu6/+build/2158020
. Well when i tried to install the debs i got a error saying it cannot continue because avidemux-plugins-common_2.5.4-0ubuntu6_i386 is looking for libx264-106. But oneiric comes with libx264-116. So though to give a another try by changing the dependency version in the deb. To edit the deb file i used the  scripts at http://ubuntuforums.org/showthread.php?t=636724 thanks to the guys up there who post the bash scripts. I change the libx264-106 to libx264-116 and save the deb.

Well then i again try to install and this time it works, and i open up avidemux and try to convert a video for my droid and it worked great. So i hope this post will help you if your looking for avidemux on oneiric.



Thursday, October 20, 2011

Terminal launcher with drag and drop location for Unity

The following launcher configuration will allow you to add a Gnome Terminal launcher into your unity launcher bar. This has the ability of opening the terminal for a given folder which. To do that you can simply drag the folder onto the launcher shortcut which will open the terminal in the dropped folder. The motivation behind this effort was that the open terminal nautilus extension is not working properly with nautilus 3.2 right now on my Ubuntu 11.10.


[Desktop Entry]
Version=1.0
Name=Gnome Terminal
Comment=Drag and drop a folder to open in.
GenericName=youtube uploader
Exec=gnome-terminal --working-directory=%u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=gnome-terminal
Categories=GTK;Graphics;
MimeType=inode/directory;
StartupNotify=false
TargetEnvironment=Unity
X-Ayatana-Desktop-Shortcuts=NewTerminal
[NewTerminal Shortcut Group]
Name=New Terminal
Exec=gnome-terminal
TargetEnvironment=Unity

Thursday, October 6, 2011

My experience with Screenlets and Conky

Last few days I looking for some thing new for natty desktop after sysmonitor screenlet gave up on me. Well my options were
1. Running plasma under gnome.
2. Conky.
3. Continue with screenlets.

Well the first option I gave up soon as I saw how to get it running. Damn I'm not ready to give up Nautilus desktop to plasma :D. So next option was to try out was conky. Well it was not quit good experience to get it up and running. Since it didn't had a GUI to manage the widgets it was bit hard at first. Then I thought to give it up and update the existing screenlet installation using the PPA. Well again I though why I should I sacrifice my memory (since screenlet took nearly 9mb per each widget) I gave a another try on lovely conky. Well I must admit that I was enchanted by the lovely widget which was there on OMG and Davianart. It took less memory as well (around 2mb). Well going through the manual helped me alot. And nice thing is the concky script syntax was really easy to catch-up when compared to learning python :). It turned out to really nice once I did some changes in widget and ran it to see how it looks like. And chaging the script cause the widget takes changes instantly which is really great.
So I think I'll let go screenlets and stick with conky :)