Tuesday, July 03, 2007

Sluggish Firefox - and what a hog!

Okay - for the past few days I've been irritated with the browsing experience at home. Pages (google reader, Yahoo mail etc seemed inexplicably slower than before - but they'd load alright - just seemed that teeny weeny bit slower that's enough to leave you suspicious).

I first suspected my ISP (verizon) for frequent dropped connections (saw the DSL modem lights reset a couple of times a day), then my wifi modem (not a high end one), then spyware/malware. So after the usual barrage of tests - wifi interference sources/anti virus/anti spyware/cable tests etc, I still hadn't nailed it.

Finally, used procexp ( you can use plain 'ole Task manager too - this is just flashier) and saw that FF had 330 MB of RAM with 3 or 4 tabs. Also, just plain clicking on a text box was slow, typing into a text field would echo characters after a noticeable delay - so this was definitely a browser problem.

When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.


-- Sherlock Holmes


Ain't that an apt quote??? I love the addons I have and probably I have one too many. This page on problematic addons  was a life-saver - after disabling a bunch of infrequently used addons (stumble upon toolbar, google toolbar, browser sync, adblock filterset g, foxy tunes and some more), I'm back in browsing heaven. The only addons I have now enabled are




  • diigo toolbar

  • all in one gestures

  • Adblock

  • Flashgot

  • Piclens


What a relief!

BTW, addons are also the latest attack vector. So be wary of who you let into your browser!

Thursday, June 28, 2007

Piclens - full screen slideshows with flickr (and others)

discovered Piclens

Its a great addin for firefox - and integrates with Flickr to give you full screen slideshows a'la Picasa slideshows on your machine!! Its a bit tricky to figure out how to get it to work - Just hover any picture on any page  and click on the blue bubbly overlay button that appears

Python, cygwin, TurboGears, mysql hell

Ok - here goes - I've always liked python, though definitely a noob. I was interested in python on the web and after a bit of googling, seems like TurboGears is the way to go.

First things first - decided to use mysql as the database (already have it on my machine and didn't want to install one more database (postgresql/sqlite). Now it turns out that MySQL doesnt have a cygwin package. More googling - mysql server can't run on cygwin due to something to do with pthreads. You can compile the mysql client on cygwin though.

That's what I decided to do - grabbed the Linux tar.gz source from mysql.com, got it into a directory and ran ./configure --without-server, followed by make && make install. All went through fine -other than the fact that it was time consuming and pretty boring (more so since I had to download and install gcc, bintools first in cygwin)

I thought I'd got through the hard part and what remained was to install python-MySQLdb package. Off I went to

easy_install MySQLdb

No luck there - package build failed with missing library -lmysqlclient_r. Turns out that the 'thread-safe' version of mysql client (mysqlclient_r) is preferred but the mysql build doesnt build this by default. What a shame!!!

Anyway, so I wasnt going to redo the whole mysql client library build again - more README files and googling later, grabbed mysql-python-1.2.2 tarball, got it into a folder, edited site.cfg and changed 'threadsafe=false'. The next run on python setup.py build worked properly, with the python mysql linking against the non threadsafe mysqlclient library.

Think troubles are over yet? No way.

Off I went to test - started the python interpreter and did a import MySQLdb, and got a Permission Denied in some 'egg' file!!! What the heck are these egg files anyway. Well, I did'nt have much of a clue and more google later got educated that these are install packages used by the easy install system. The more I looked, the more it seems that the easy install is anything but easy :(. Anyway, this one had me floored - since I couldnt get to the line of source where the error was and had no clue how to view the contents of an 'egg' (they're zips - but I didnt know that and very helpfully there's hardly anyplace where they say that they're zips with the extension of egg!!! Baaah!! - why couldn't they just use .zip?)

More and more hard googling - and this time the info's really sketchy till eventually found a post from a guy who asked the exact same question. Guess what, the easy_install system unzips the eggs to some folder (pointed by PYTHON_EGG_CACHE env var) and there I needed to do a chmod a+x on the _mysql.dll. Well so I did echo $PYTHON_EGG_CACHE and the var isnt set!!! Admittedly at this point, I'm not looking sharp either - what started out as a quick spin has become a quagmire of installation issues - but I'll be damned if I let it sink me!!! Eventually, had the Eureka moment and checked ~/.python-eggs and sure enough found the truant _mysql.dll. Quick chmod a+x and presto - import MySQLdb worked!!! YAHOOOOOOOOOOOOOOOOOOOO!!!!

And now back to where I started - went back to turbogears, did a tg-admin quickstart, setup a mysql database and started with python start-testproject.py. Guess what - no luck yet - turns out that mysql cant client to my windows server with a socket.

More googling - and this time its really desperate - and more enlightenment - the windows mysqld doesnt do unix sockets - how do I force tcp/ip? Simple - use 127.0.0.1 as hostname in the connection settings instead of localhost!! Finally something that was easy to fix. Finally after 8 hours of on and off hacking away at installation issues I'm glad to see a turbogears web page.

Bottomline: Python's great, from the looks of it, turbo gears seems well designed. Mysql is a great database - a cygwin native server would be great - or atleast a client package. But if one has to run through all these hoops just go get a 'quick spin' then adoption's going to be difficult.

I havent tried RoR - but has someone tried a similar thing on cygwin (cygwin, ruby, RoR, mysql)? How does the experience compare - is it any easier to get off the ground?

Thursday, May 24, 2007

Maven Emma plugin - filters dont work

Using v0.5 of the Maven emma plugin. Found that if you specify an include/exclude filter, no classes are instrumented....On digging a little deeper under the covers, it seems that there's a bug with the Maven emma plugin - I've edited the plugin's jelly script and using it here.

Posted the bug and the fix to Maven's sourceforge developer forum. You can find it here

The fixed plugin.jelly's here - Maven emma plugin 0.5 fixed

Friday, May 04, 2007

Building a FC6 server for Java development

It has come upon me to build a FC6 server with a Java build environment that is going to serve as the build machine. This is the first time I'm coming to Fedora - always having used Debian in the past.

  1. OS installation was smooth. I installed with KDE since some folks prefer the GUI.

  2. During the installation, I chose Java Development - and all the gcj components got installed. Then post installation, I downloaded JDK from Sun and installed it too. The (gcj) tomcat of course didnt work very well in this mess. Fixing it was easy - just fired up yum via Add or Remove Programs and removed gcj - which removed all the other gcj tools and libraries too.

  3. Setting the host name - unexpectedly, had trouble doing this - finally used system-config-network.

  4. Environment variables - again a little digging around to figure out how to set environment variables so that they are effective for all users on the system - essentially JAVA_HOME, JRE_HOME, CATALINA_HOME, MAVEN_HOME etc. Finally found that this is best set in /etc/environment where it works for all users.

  5. Downloaded java tools and libraries - housed tomcat and maven under /usr/lib/java/maven-xxx and /usr/lib/java/apache-tomcat-x.xx and created symlinks. Placed symlinks to tomcat's startup.sh and shutdown.sh in /usr/bin. Placing a symlink to maven doesnt work - but an alias works as well. To make it work for all users, simply put it in /etc/profile
    alias maven=/usr/lib/java/maven/bin/maven


  6. Created a group java and added users to the group. Set permissions on the maven installation folder so that java group has write access (this is so that maven plugin:download for additional plugins works properly and can write to the maven plugins folder)


That's all there is to it. Just make sure that you do everything as the 'application' user - dont do it with your account or the root account.

Tuesday, May 01, 2007

Ant - Debugging classpath

Here's a nice tip on debugging classpaths in Ant: http://www.javalobby.org/java/forums/t71033.html

Essentially,
<?xml version="1.0"?>
<project name="project" default="default">
<property name="lib" value="web/WEB-INF/lib"/>
<property name="src" value="src"/>
<property name="dist" value="dist"/>

<path id="classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="default" description="--> description">
<javac srcdir="${src}" destdir="${dist}">
<classpath refid="classpath"/>
</javac>
</target>

</project>

Sunday, April 22, 2007

Cobertura vs EMMA

This is a rant against the Cobertura maven integration - and to a certain extent on Cobertura also - and hopefully an objective one ;). Hopefully this'll help someone select between the two big (open source) coverage tools out there.

We've been using Cobertura at work till now and its done its job nicely - the reports look great and the maven 1.x integration, while not neat, is functional. While we knew that someday we were going to have to merge coverage data and have a single report across multiple test methods (junit, selenium tests and manual), cobertura documentation stated that this was possible and so we weren't really bothered.

Thought I'd give it a whirl and set it up - and that's when the trouble started. Atleast, with the maven integration.

First of all - there's no way to just instrument code. You can generate the report (which will instrument classes and run the tests) but if you just want to instrument classes so that the final deployable contains instrumented classes, its a no go with the maven plugin tools.

Obviously, no point giving it up there - so thought I'd just include the ant tasks and go the ant way in my maven goal. Turns out that there's no 'plugin init' kind of goal that can be called post build:start that will set up dependencies and import the cobertura ant tasks. You have to do it all yourself.  Fine - went that way too - so now my maven.xml uses the cobertura ant tasks and finally I'm able to generate an instrumented build. YIPPPPPPPEEEEEE.... or wait...lets' just make sure that this thing works...

Does it?

Turns out - no - it doesnt - so I dropped the WAR into tomcat and accessed the login page of the application and then shut down tomcat nicely. There's even a cobertura.ser created in the tomcat bin folder and I'm thinking that probably this will all work together finally...

So I go ahead, tweak my Maven.xml further with a coverage task that will merge the data from the junit runs and servlet container runs. Turn the switch on... and lo and behold...Exception reading the merged data file. Back to google and after hunting around for sometime found this Bug while merging reports

So finally I'm ready to give up cobertura and give Emma a try...and it couldnt have been better...

1. Goals are nicely setup

2. You can init the emma system with the emma:init goal and then use ant tasks if you want flexibility for doing things like merging reports.

3. The merging works :))

One sticky issue that I did come up  with was that the for the same source and test cases the coverage reported by cobertura and emma differ widely. With Cobertura, we were at 40% coverage while with EMMA, the number's up to 60% coverage - and while EMMA has some literature on how it does things - I'd be glad if someone did explain why or how the reported numbers could be so different for the same base code and unit test suite?

Tuesday, April 17, 2007

Tulip festival at Skagit county

We visited the Tulip festival at Skagit valley. Its hard to describe in words - and a picture's worth a thousand words - so here's a bunch of pics - let them do the talking :).

Anyway, had a lovely weekend driving up to Mount Vernon with friends and had a memorable weekend.







TulipFestival

Saturday, March 17, 2007

Ninotech Path Copy 4

Ninotech Path Copy 4
Novell Cool Solutions: Cool Tool

Was looking for a shell extension to copy filenames from explorer. Thought there'd be a dime a dozen - and it turns out that
a) they have 20 other things that I dont want.
b) Its trial ware.

Finally after searching high and low, came across this and it's GREAT!


powered by performancing firefox

Thursday, March 15, 2007

Production Eclipse Configuration

Part of the game of getting code out that conforms to coding standards without having to go through the "One Big spring cleaning" exercise is configuring and centralizing the tools.

At a minimum, it helps to have a central Eclipse installation that has all the tools configured and setup - so each person doesn't have to do it. Alternatively, there should be a reference set of plugins and their configuration files available in the source control repository.  Here's my eclipse configuration

Wednesday, March 14, 2007

Tips for using Eclipse

http://www.aspectprogrammer.org/blogs/adrian/2006/02/tips_for_using.html

Great Article - full of very very useful tips!

Firefox - not so obvious search

I discovered this - totally by accident.

In Firefox, you can use / (forward slash) to search for text OR links - and if its a link, then you can follow the link just by clicking Enter!  That is way cool - especially when you're on a laptop and cant/dont have your mouse around. I've always find it a pain to do a "link find"  - ' (single quote) and a text find - ctrl-f separately...Never knew that there was a shortcut that did both and what more - its way natural if you're used to 'less'!!

To complete the keys for Firefox mouseless browsing,

  • space -  page down

  • shift - space - page up

Sunday, February 25, 2007

Performancing and Wordpress - initial imression - very nice!


Performancing | Firefox Add-ons | Mozilla Corporation
Performancing for Firefox is a full featured blog editor that sits right in your Firefox browser and lets you post to your blog easily. You can drag and drop formatted text from the page you happen to be browsing, and take notes as well as post to your blog.


powered by performancing firefox

Saturday, February 24, 2007

Diigo - a hidden gem

If you use del.icio.us for online bookmarking and like google's notepad for online research, then suggest that you take a look at Diigo's offering. It's all those rolled in one and then some.

I've been using it for quite some time now (after trying out del.icio.us and google notepad) and I'm not budging! Recently I was doing a bunch of research online and diigo excelled!

  1. Online bookmarking - will also simultaneously post to your del.icio.account

  2. Firefox toolbar

  3. tagging

  4. Web clipping

  5. Web annotation


Now to "hidden" - I've been on Diigo more than 8 months or so now - and yet I'm still to meet someone who knew about Diigo!!
Diigo rocks!

Imaging the tenth dimension

Amazing flash movie!

Great flash movie explaining dimensions 4 (time), 5, 6 all the way uptil 10. And why they stop after 10!

I've never come across a clearer explanation ever and the great visualization does the trick.

Instant messenger client utopia

GAIM...

I hate running 3 different chat clients (yahoo, msn, gtalk) on my machine - and that's just 3x memory, startup programs and useless adversting too many.

And I hate msn and yahoo's advertising that's built into their clients...esp on MSN which insists on opening a mini page on login...

Use GAIM - and do yourself a favour. Of course that's if you don't need the very specialized features :)).

Installation is a breeze and use plugins you like and avoid the bloat....The best plugins I like are guifications and text replace. Lastly, if you keep moving between machines as much as I do, then its a breeze to retain your settings between all your machines.