Wednesday, November 03, 2010

Got published, again!

What? .. "Defining a Coparticipation Network Using Comments on Digg"
Where? .. IEEE Intelligent Systems
Why? .. Because he's a genius.


Tuesday, August 24, 2010

Liferay Performance Tuning

This stuff is really exciting. So I've got a few days to compare a bundled liferay out-of-the-box instance with the one that's enhanced by our company for a certain client. I'll be responsible to analyze the difference in performance statistics by profiling the application. I started off with Grinder and just recently learned about the visually appealing VisualVM.

Apparently, I'll have to collect stats from both of the tools to summarize the overall difference. Ideally, I'd be able to pinpoint the exact methods that must be rewritten to improve the performance. Instrumenting the CPU using VisualVM by limiting it Liferay specific classes seems like a good idea.

Let's see. I'll try to update this post with results, if and when I get them :)

Thursday, July 29, 2010

Struts2 - Adding Properties to the pageContext

In struts2, to access a property inside a JSP that we set in the overridden execute method of Action Interface, we use the following property tag:
<s:property value="results" />
where s is an alias for struts-tags tag library and results is a Collection (can be anything) that we've populated in execute method. Note here that it must be a variable/property in you action handler class with both of its getter and setter methods available. The property tag will call the getResults() getter method.
This is clean. But it should be noted that results is not available in the pageContext of the page being processed currently. So, for example, if you want to use the results collection inside a jsp scriptlet by doing something like
this will not work. You cannot even say something like
Anyways, it's possible and pretty clean too :) All you've to do is to set the pageContext attribute by using another struts tag,
<s:set name="pageResults" value="%{results}" />
This is equivalent to
but the later won't work. The name is what you want to name the results in the pageContext, like a variable name; and the value is its value. So here, Set tag will call getResults() and assign the returned value to a pageContext variable called pageResults.

That's it :)

Friday, June 11, 2010

Grails and MySQL - Enforcing Foreign Key Constraints


Imagine a scenario where you've two Grails domains called Book and BookAuthor (could by anything) with there respective MySQL tables. You've made sure that every time a Book is created, it must be associated to some BookAuthor by adding something like

BookAuthor author

in your Book domain. Also, you don't have to do anything in BookAuthor domain. Now when someone deletes a BookAuthor, Grails should enforce the foreign key constraint and does not allow it to happen. However, it does and the BookAuthor gets deleted. On top of that, the Book domain is now broken, because all the Books with the deleted BookAuthor as their author are now broken.


I was hinted that this can be prevented by using InnoDB as the storage engine for those particular tables. For details, read this, or this. For a quick solution, all you've to do is to add the following in your DataSource.groovy in the dataSource enclosure:

dialect = 'org.hibernate.dialect.MySQL5InnoDBDialect'

I dropped the database and let Grails recreate it because the tables have to be created with InnoDB as the storage engine. Note here that the default storage engine that MySQL uses while creating the tables is MyISAM.

This solved things for me. Now, whenever someone tries to delete a BookAuthor, which is associated to some Book, it is prevented by Grails with this message - "The BookAuthor id1 cannot be deleted" .. that's it :)

Happy coding, thanks!

Wednesday, March 31, 2010

About Sentiment Analysis

I wish I had filed a patent or something :(

It's going to be big. I was able to foresee the potential in sentiment analysis, but never got time to finish it ... anyways, kudos to ubervu - I'll be an spectator :)

Wednesday, March 24, 2010

Feelings poster

I am just loving this!

Saturday, July 25, 2009

Digging Digg: Comment Mining, Popularity Prediction, and Social Network Analysis

Recently, one of my research works got accepted at The 2009 International Conference on Web Information Systems and Mining (WISM' 09). The conference proceedings will be published by IEEE-CS and will be indexed by both EI (Compendex) and ISTP. Following is the abstract:

Using comment information available from Digg we define
a co-participation network between users. We focus on
the analysis of this implicit network, and study the behavioral
characteristics of users. Using an entropy measure,
we infer that users at Digg are not highly focused and
participate across a wide range of topics. We also use the
comment data and social network derived features to predict
the popularity of online content linked at Digg using a
classification and regression framework. We show promising
results for predicting the popularity scores even after limiting
our feature extraction to the first few hours of comment
activity that follows a Digg submission.

I am grateful to my advisor, Dr. Huzefa Rangwala, who pushed me real hard and stayed with me to get it done!

I am trying to move to wordpress and restructure my blog, but till then, I don't have any section to upload my paper. Anyways, it's available through George Mason University's Technical Reports Series for 2009, which can be located here: Also, the paper will soon be available through IEEE.

Thursday, June 04, 2009

The next big thing. [2]

There was a change in plan; following is the configuration of my newest machine:
  • AMD Phenom 2 x4 940 (3.0 ghz, 4 cores)
  • Biostar Ta790gx (amd 790gx chipset, radeon 3300 builtin)
  • GSkills 4 GB RAM (ddr2, 1060mhz)
  • Western Digital 1 Terabyte HDD (32mb cache, 7200 rpm)
  • Antec 300 ATX case and Anter 430w PSU
  • Samsung 23' High Definition LCD Monitor (max. res. 1920 x 1080, 5 ms response time)
I don't know how much I saved, but I am sure that it's atleast $300. I found really good deals. Anyways, adding everything I paid, the sum was $650 for all of the above. I do not plan to overclock it, and I will not use it for gaming. The average CPU temperature is around 30c, which is not bad. I did an Ubuntu 9.04 installation on it (with default options) and following was the first exception:

error 18 selected cylinder exceeds maximum supported by bios

I looked around for workarounds, and found nothing straightforward. A few fellows hinted that the boot partition shouldn't be huge because the location of the kernel must be in the first few gigs of hdd. So, all newbies who'll go with the default ubuntu installations are going to see this error (if they have large hard drives). Here is the simple workaround assuming that it's a new system/build:
  • You'll need to re-install ubuntu.
  • This time, choose manual partitioning option.
  • The problem will be solved if you'll make a separate boot partition (/boot) at the beginning of the disk. It's size can even be 32 mb, but I chose 128mb to be on safe side (this has something to do with ppl who play with kernels)
Following is my new partition table:
  • /boot (128mb, primary partition)
  • / (20gb, primary partition)
  • swap (2gb, logical partition)
  • /home (900+gb, logical partition)


  • I can update my ubuntu installation without messing with my home folder.
  • I don't really need a swap, but I've too much of free space :p
  • Twenty gigs for Root partition (/) is enough for default installation and many softwares.
  • Above all, separating boot partition helped me to get rid of Error 18

My next step - to use some hypervisor and ensure a separation of concern. Primarily, I want to isolate my (future) webserver from everything else I'll be doing on this machine. I know XEN and VMWare ESXI. I am analyzing the comparisons of both; with all I know by now, I might settle down for Xen.

Above all, I am loving it :)

Tuesday, May 26, 2009

The next big thing.

It's going to be an Intel Quad Core based system; I'll get it all within hours. Here is the config:

Processor - Q9400 (6mb cache, 2.66ghz, 4 cores,1333 mhz)
Memory - DDR3 6 GB
Motherboard - Intel DP45SG
HDD - SAMSUNG Spinpoint 1TB F1 HD103UJ 7200 RPM 32MB Cache SATA 3.0Gb/s 3.5" Hard Drive
Power Supply - Coolmax M-500B 500 Watt ATX 12V
Graphics - MSI N95GT-MD512-OC GeForce 9500 GT 512MB 128-bit GDDR2 PCI Express 2.0 x16
Casing - Antec Three Hundred ATX Case

I am building this thing; it's fun. I am getting it all for $615, which is not bad at all! I was almost finalizing the Mac Mini, but within my budget, I was getting nothing better than a refurb core duo, 1 gig box; all crap.. I hope this one lives with me and my needs for atleast an year.

p.s. Why did I buy one? because I hate to shutdown my notebook even once in a month :p

Wednesday, April 08, 2009

Specialization is for Insects

The Origins of the Thesis

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

-Robert A. Heinlein

just a joke, no offense to all my fellows around :)

Sunday, April 05, 2009

The bugs in my life

For over a week now, I've been dealing with numerous errors, exception, time outs, and malfunctions related to the same problem. Few are,
  • Error Code : 2006 - MySQL server has gone away,
  • Exception in thread "main" java.lang.OutOfMemoryError: Java heap space,
  • Error occurred during initialization of VM - Could not reserve enough space for object heap,
  • 100 thousand Null Pointer Exceptions,
  • java.lang.ArrayIndexOutOfBoundsException: Array index out of range ..
  • Error Code : 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ..
  • ssh: connect to host [server] port 22: Connection timed out
  • and many more :p

And in the meantime, I improved my track record of

  • Living with 1 coffee, 1 vitamin water and 1 meal per day..
  • Reworking for the 5th time on the same 400 lines of code and fail for the 5th time..
  • Thinking effectively for a complete solution .. while taking a bath..
  • Staring at random people and realizing the wrong after a bunch of seconds..

Friday, March 27, 2009

Talking about php frameworks

I am thinking of updating my blog. Here is the thing: I can do more productive stuff than searching for good looking blogger templates.. Although I am an advocate of simple looking text oriented blogs, but still, I hate the restricted and limited blogger dashboard whenever I think of tweaking the layout somehow.

Anyways, a geek friend talked about cakePHP. I looked it up and it seems interesting. The last time I worked with PHP, there was no hype of php frameworks, and perhaps the only one I heard about was by Zend. So, anyways, this world of frameworks is ranked here. By having a couple of sneak peaks at Yii-powered sites, I declare it to be boring to try out.. Next, I've got CodeIgnitor, CakePHP, and Akelos.

On the other hand, I've got RubyOnRails!

Now, I've worked with PHP and it's the easiest language I've worked with by far (considering the compiled languages I know). I wouldn't be comfortable to work with a framework that might make the whole process as easy as a cake (from cakePHP) and at the same time I am thinking to stick to php and do more practical things with it instead of trying out something new like Ruby.

So, I'll think :) One stupid way of comparison is the time it takes to make a blog with these frameworks: RoR takes 15 minutes, and CodeIgnitor and Akelos take 20 minutes :p For more intelligent comparative analysis, I'll look around for resources. I am planning to export all my posts from this blog to my new blog (I don't know how this work though) ..

Wednesday, March 25, 2009



Although it’s a neat idea, but I doubt it to be the next big thing in gaming world. It’s only targeting a small niche of gamers: those who have high speed internet connections!

The big question - why do I need it in the first place? If it’s not priced significantly lower than it’s competitor big fishes, then hardcore gamers would surely prefer the ugly big boxes over unexpected interruptions in their gaming performance due to primary dependence on internet connection.

[more about onLive]

Saturday, February 14, 2009

honda student 1999 civic salman sedan jamali google thesis

Few days back, I bought a used car. It's an awesome deal, but still a used car and hence, I am looking for friends who are mechanics :p Anyways, I ran to honda and asked them to inspect my car. They charged me $105 and with a smiling face smashed on my face a bunch of repair recommendations. So I was supposed to prioritize this list and tackle each one by one under a limited, poor-ish and a miserable budget. In the mean time, being a nerd googler, I was able to investigate a lot about the geeky terms of car mechanics and common problems and their solutions. Just today, I realized that I know a lot more than I knew about a car's anatomy, e.g. I can refill my coolant, fuel my car by myself, etc.

following are few of my recent search strings on google:

  • how to check fuse of auxiliary power outlet civic 99
  • cigarette outlet not working civic 99
  • is my coolant leaking? civic 99
  • what is oxygen sensor?
  • what is primary oxygen sensor 02 civic 99
  • how to attach a number plate on front bumper
  • lost my driver's license dmv reporting
  • zune fm transmitter
  • zune car kit
  • best fm transmitter reviews
  • pioneer car cd player deal
  • sony car cd player deal
  • magellon gps deals
  • garmin gps deals
  • garmin vs magellon vs tomtom
  • navteq versus teleatlas maps
  • samsung bluetooth headset deals
  • samsung wep200 vs wep500
  • samsung wep200 vs wep410
  • antifreez coolant autoparts
  • 1999 honda civic mpg
  • 1999 honda civic lx kbb
  • magellon 4210 review cnet
  • progressive insurance
  • what is liability insurance
  • geico
  • mr car wash
  • ..
  • ..

and seems like this list would go on and on.. errr. Anyways, above all, i wish i could drive here the way we used to do it in Pakistan.. :D I don't like it, it's so peaceful here. I notice people actually waiting for the red to be green and literally stopping when it's about to be red! See that's not way, you're wasting fuel, your time and hmm.. some excitement :D We are not supposed to switch lanes with indications and thank people for letting you cross.. it's all right, just show some aggression in your acceleration and they'll stop.. it works always :D

And what's up with these service stations here?! $90 just to check for the problem in the power outlet? $600-$700 to replace timing belt that cost's $40.. I know it's labor, but still.. it's so systematic that you just don't have any cheaper options, or perhaps i'll get to find few eventually.

One more thing, every third mechanic is a Pakistani just like every third software engineer is an Indian and every third human being around is a Chinese :D

To summarize, after 2.5 months of craigslisting, I think I've got a nice deal! :)

tht's it for now, over n out.

Wednesday, February 04, 2009

Tuesday, February 03, 2009

Our jokes, about us.

I came across the following comics.. they all relate to the software development world. Although they might not be funny enough for non-techies, but they justify a lot the source of our hopelessness :p

Suggestion: click on the image for bigger size.

Sunday, February 01, 2009

.. and 694000 songs were downloaded illegally ..

a bunch of mind-blowing facts! But still, I am just wondering how this combinatorial explosion of facilities and ease of staying updated isn't enough for us to seek a few pretty simple reality checks on what's happening around us :p .. instead we rely on a bunch of cute & dumb anchors on the tv! grrr..

Sunday, January 25, 2009

A Green Leaf-Like Bug!

These images are the courtesy of a friend in Pakistan. I didn't try to discover if he loves photography, but I am sure that these are awesome captures. This would definitely amaze anyone like me; anyone living in a place where you waste 2 hours of planning after seeing a couple of dead cockroaches around the kitchen cabinets :p

Anyways, This thing is called Microcentrum retinerve. It sounds something like this; actually, this is how I can recall that it's very common around. Following is it's classification:
  • Class Insecta
  • Order Orthoptera
  • Suborder Ensifera
  • Family Tettigoniidae
  • Species Microcentrum retinerve

[image courtesy: Yawar Abbas]

Sunday, January 11, 2009

How to quantify the frustration of our youth!

Ok. First of all, a disclaimer - I wasn't looking for one of these predicted results!

My query was like "how to know if a timing belt has been changed". After driving a car for 5-6 years back in my country.. all I learned about the technicalities of cars was limited to refueling it, excellent gear shifting, and racing with odd one outs in random traffic. I am also proud of the fact that because of me and my driving skills, a number of human beings thanked God sincerely that He saved them, who knows that might be a turning point in their lives to submission to All-mighty :D

Anyways, I wanted to search for some articles about discovering the last time a timing belt of a car was changed.. there was this civic (yeh still looking for a car), the owner didn't had any related receipt/records, so I thought that there must be someway for a mechanic to get to know this by a brief inspection.. that's it, over and out.

Friday, January 09, 2009

the ridiculous perspective.

Sometimes you want to sit & think, but sometimes you just want to sit. Sometimes you want to plan out things, but sometimes, you just don't want to think about plans. This isn't ridiculous, because I am sure that many a times we miss the 'kid' that we once were. That kid was so natural, free of troubles, and all stuffed up with naive patriotism and the desires to score high in games, only. Yes, I miss him, no shame!

But, above all, no one's to blame here; I know we're supposed to move on. I'll move on, Inshallah, but I have my memories.. so deep-rooted somewhere that no brainwashing detergent can erase their traces. I feel of the recap as a seizure, a malfunction.. but when I recover from it, I always pop out with a lesson, a simple and clean guideline for the incoming tremors. And, I move on.

Still sometimes, I desire a free fall, as in skydiving; but sometimes, I just want to dive and fly away..

Monday, January 05, 2009

My car buying experience

First of all, I still couldn't buy one.. but anyways, I had 3 close encounters of actually wasting up my super duper budget of 3500$ on the following cars (after analyzing 25+ cars):

1 - 1997 civic ex coupe automatic
2 - 1999 civic ex sedan automatic
3 - 2000 civic ex coupe automatic

For 1, we settled for a done deal happily. Later, the carfax tells me that the car has a rollbacked odometer. Amazingly, we couldn't guess it from the extremely humble speech of the seller that he's perhaps being untruthful and that the rollback amounts to 45000 miles!

Exhausted, as well as excited.. I went for 2, perfect history, affordable, I am all ready.. and there you go.. sold-out! [yehh and didn't care to take off the advertisement from the list!]

The biggest blow, number 3. Not affordable, but for the price a great deal. So, I thought I'll drag my budget a little more. I did that. After a bunch of email ins and outs, we decided on a meeting time. I was desperate to just get it for whatever it had, for any extra cost. And once again, I receive an email: "Sorry, sold out!" Perhaps, what’s most disappointing about this one was that the seller listed it for ~4000$ and I wanted to get it for $3600 and he sold it for $3400 !!! Yeh, i know something's wrong.. :(

So, I've 20 days more days to stay patient.. then my carfax account will expire.. and I am not going to think about a car anymore..

Recommendation for craigslist: as soon as an item is sold-out, something should force the seller to close his advertisement.

Recommendation for buyers: as soon as you find out a good deal, don't wait for another good deal, don't push your luck :p

Recommendation for sellers: if you can't negotiate, don't face the buyers ;)

Saturday, December 27, 2008

Tan Le Brings the Force to Life with Mind Control Device

The Entertainment Gathering 2008
Monterey, CA
Dec 12th, 2008

Tan Le, co-founder and president of Emotiv Systems, gives a live demo of a mind control device that uses a person's thoughts to input computer commands.

See demo video here!

PHP - tutorials and resources for all levels of expertise!

I had been planning to revise the things I did in my mere 4 months professional/commerical work experience with PHP & MYSQL (and Apache) over Windows platform. I did a lot.. solved numerous complications, disiciplined my interpreted programming language skills, and incorporated my ideas into the couple of projects..

What helped me the most? the experience and skills of my extraordinarily talented team lead;
What bored me the most? coding the next .php without thinking to innovate more durable and appealing solutions to reccurent problems..
What did I like? Scrum + Agility + Web Development .. exponential success!

But after 1.5 years, all I can recall are some echos and the nightmares of being lost in some opensource OO php code.If I had the mountains of php code and mysql stuff that I wrote in those 4 months, I would have been proud again of my skills in mere 4 days..

Without it, I needed some resources for quick overviews that I could walk through while doing brainstorming for my thesis study 80% of my daily time.. So I found this entry:

25 Resources to Get You Started with PHP from Scratch
Dec 23rd in Web Roundups by Drew Douglass

I liked the smooth transition from overly simple walkthroughs to "Advanced and OOP techniques" stuff. Thanks Drew! This article can definitely forward anyone interested in almost any of PHP related things to the finest resources on the web.. give it a try!

over and out.

Thursday, November 13, 2008

If you can't look him straight in the eye

Following is the poem that Chuck Hagel, Nebraska's senior U.S. Senator read out in his Farewell to the U.S. Senate on 2nd October, 2008. The poem's actual author for some is unknown, but this site claims that it's Peter "Dale" Wimbrow Sr. Anyways, it's so perfectly written that none can just ignore it; yet, we can only wish..

When you get what you want in your struggle for self

And the world makes you king for a day,

Just go to the mirror and look at yourself

And see what that man has to say.

For it isn't your father or mother or wife

Whose judgment upon you must pass.

The fellow whose verdict counts most in your life

Is the one staring back from the glass.

You may be like Jack Horner and chisel a plum

And think you're a wonderful guy.

But the man in the glass says you're only a bum

If you can't look him straight in the eye.

He's the fellow to please--never mind all the rest,

For he's with you clear to the end.

And you've passed your most dangerous, difficult test

If the man in the glass is your friend.

You may fool the whole world down the pathway of years

And get pats on the back as you pass.

But your final reward will be heartache and tears

If you've cheated the man in the glass.