Thursday, December 29, 2011

Bing 2.0 API is useless

Bing's 2.0 Search API is basically useless. The results dosen't match up with the Bing.com website and so testing is almost impossible.

And worse the results returned by the API are mostly irrelevant. I think Microsoft needs to seriously look at what are they targeting the Bing API for. Because as a developer i won't want to use it.

But there is a lack of freely available search apis out there.
Google Custom search requires you to search only specific websites that you specify and not google itself.
Yahoo BOSS requires payment so its out for me.

Anyone knows of what other options are out there?

Links to the issue:
Stack Overflow
Bing Community 

Wednesday, December 14, 2011

Sheevaplug Debian Install

Upgraded from the default Ubuntu install to Debian today, mainly followed the instruction by Martin Michlmayr. Mostly worked but the instructions for after installation of Debian to the MMC card was slightly different for mine.

These are the ones that worked for me.

setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0:1 0x00800000 /uImage; ext2load mmc 0:1 0x01100000 /uInitrd'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0x01100000'
saveenv

The main difference is the mmcinit command, on my uboot it was "mmcinit" together, for the instructions that Martin gave was "mmc init" with a space.

Monday, July 25, 2011

Product Owner's Guide - Breaking down estimates



Overhead this while at work.


"The Product Owner wants us to break down our inital estimate on the development effort into parts like analysis, design and coding ...".


That sounds to me like the Product Owner(PO) thinks that whatever estimate that the team came up with is too long and wants to cut the estimate. If the team gives such such a breakdown, then be prepared for the negotiation about the time needed for the project to be discussed.


But how is the team going to come up with such a figure anyway? I always found the statement like "Most of the time is spent in design but little in coding", or using the 80-20 rule that 80% is spent in design and 20% in coding. Is that statement still relavant today? In the past (I mean way way past), people do spent a lot of time in design because computers process ur programs in batches and you better get it right the first time if not you wait a day for the next run.


Fast forward to today, where we have powerful ides, programs run almost instantly, where you can code a little, test a little, you are more likely to try a program a vertical slice and then build up your system from there, with refactoring tools so powerful, changing methods, implementing interfaces no longer is such a chore.


 Now back to the story, not matter what the project team tries to justify their number the PO will just try to cut it. The problem with most people is that they have some prenotion of when the project will end, but they do not realised that an estimate is just that, an estimate, it's a educated guess base on whatever information you have. An estimate is not an accurate prediction of the future and couple with the fact that software estimates are usually wrong. Steve McConnell says it well in his book Software Estimatation.

"Estimation should be treated as an unbiased, analytical process;
planning should be treated as a biased, goal-seeking process"

So if you ask someone for an estimate, you are asking for his opinion on how long it will take, and you shouldn't try to cut his estimate down.

More likely is the product owner is trying to get a plan from the team not an estimate, and the team's estimate isn't matching his plan. His plan can be anything, could be trying to meet some timeline for marketing, or some trade show demo.


  Product Owners please just tell the team what is your plan, it may be because of marketing, budget and other reasons that you need to slim it down. But please tell the real reason and not by trying to get the estimate within your plan.


  For the development team, try to find out the underlying reason for doing such an exercise, buy a copy of Steve McConnell Estimation book and give it to him. Negatiate on the scope, not all features need to be a mercedes, sometimes a vespa is good enough.


  The only thing that can be reliably cut down to meet the target is actually the scope of the project. Does the Product Owner need 100% of all the features of the software to be done to be really useful? More likely than not something like 50-70% will probably be good enough.


Main takeaway - Estimation and Planning are 2 different things, try to make sure what is it you are talking about.


   

Thursday, April 28, 2011

Expanding your toolbox - Picking a new language to learn.

Image: graur razvan ionut / FreeDigitalPhotos.net
One day a developer on my team came up to me and asked, what should he programming language should he learn next to be marketable (and by the way he also thinks that Java is slowly dying).

Well as to whether Java is dying a not, I don't think so, a quick check with TIOBE shows that Java is still ranked among the top few languages and lots of places still runs Java. So i do have a job for the next few years.

But the thought came to me, it is worth learning things that are marketable or should you learn things that broaden your knowledge? What's your take on it? Should you expand your toolbox or have more of the same tools?

Steamhead takes the languages from Seven Languages in Seven weeks and puts it into a nice flow chart. I think all should go check that out and pick something out from that list. After doing quite a lot in Java I begin to appreciate the simplicity of using interpreted languages like  python and php, and the fact that their frameworks are usually simple as compared to Java ones where sometimes we descend into XML configuration hell.

Steve Yegge has a interesting way of categorizing the various languages, he breaks them down into Nouns (Java, C# or OO languages), Verbs (LISP, Clojure or Functional Programming) and Verbs and Nouns (Scala, Ruby, Python, C++ or a Mixture of both).

Well for me I am more for the expand your toolbox model, go learn something that makes you have a new way of looking at things. A lot of people learn languages but they don't really learn design, think stuff like design patterns (Gang of Four, Java EE Design ...), SOLID principles, OO Metrics. Even if you know the syntax, you simply can't write maintainable programs and all you write lacks a certain craftsmanship to it.

By learning a different language and looking at the api, you can have a different idea about how to design your programs. An example will be like in Java. You have Math.abs a static function to get the absolute value of a number, have you ever wonder why its so "un OO" like? Compare with Ruby its just number.abs(), simple and elegant and fits into the OO paradigm.

In short

If you know Java, C# go learn Lisp Dialects (Common Lisp, Clojure), Haskell, Ruby, Python...

If you know Python, Ruby, you are pretty much there, since you straddle the limits between the 2 kingdoms.

If you know Common Lisp, Clojure, dont bother learning any other thing since you will think why in the world Java, C# programmers are typing so much code and configuring so much XML.

If in doubt just learn PHP to be marketable :)





Wednesday, February 2, 2011

One hour early a day...

My latest read is Robin Sharma's book (The Leader who had no title), interesting read. But one statement struck me (I more or less paraphrase it)

"If you wake up one hour early each day for a month, in 30 days you will have almost one weeks worth of working time, think of the things you could do"

When i told this to some of my colleagues/friends they say wha sleep less one hour how ? Not enough time to sleep already.

"You have enough time to sleep when you are dead" 

I guess this is the difference between people who do impressive/great things (physically fit, be it in doing voluntary work, open source projects, making lots of money, hobbies, making a difference, side business, execise often) and the rest of us. They spent the time not just dreaming and talking about it but actually doing it. I am not actually saying that you forgo sleep altogether but think of the possibilities that could happen if you think about how to spend your time wisely.

At the end of our life, lets not spend time regretting what it might have been, or what we might have done better.

Remember the saying that you need 10,000 hours to become good at what u do, maybe i should start doing things instead of writing things on my blog :)

Wednesday, January 26, 2011

Ebooks from top StackOverflow answers

Have you tried StackOverflow, if you are a developer its probably one of the best resource for asking questions.
Its a great site, what is even greater is that someone converted the best answers into an Ebook format.

Great for bring around, the link is here http://hewgill.com/~greg/stackoverflow/ebooks/. Whats nice is that it is broken up nicely into the different subject like ajax, python, c#.

Tuesday, January 25, 2011

Posting data with Node.js

Recently i needed to post data using node.js, I was not trying to post a long string of data but rather parameters from a form. But the Node.js help page isn't too helpful, it just say use request.write() to write data to the stream

  This is the first interation i got.

 

var http=require('http'); var post=http.createClient(80,'localhost'); var request=post.request('POST',/test.php'.{'host':'localhost'}); request.write('test=10'); request.end(); request.on('response',function(response){ response.setEncoding('utf8'); reponse.on('data',function(chunk){ console.log(chunk); } });
 
test.php is a simple php script that prints out the parameter value.

  I got nothing... nothing was printed out. What was wrong?

  Using curl and Fiddler, i did a little investigating about what went wrong, what was missing was the Content-Length and the Content-Type which needs to be application/x-www-form-urlencoded.

  Adding these 2 parameters to the script

var http=require('http'); var post=http.createClient(80,'localhost'); var request=post.request('POST',/test.php'.{'host':'localhost','Content-Length':'7','Content-Type':'application/x-www-form-urlencoded'}); request.write('test=10'); request.end(); request.on('response',function(response){ response.setEncoding('utf8'); reponse.on('data',function(chunk){ console.log(chunk); } });
 
And yeah ! It works !

Tuesday, January 11, 2011

JRex, Embedding Gecko (Firefox) in eclipse

Jrex is a Java component that embeds Mozila Gecko in your application. The project has been dead for some time since 2008 from what the mozdev.org page. So the version of Gecko may not be the latest but should be good enough for whatever you would like to try out.

 However looking at the code from Vijay (http://www.vijaykiran.com/2006/09/05/using-jrex-in-eclipse-rcp/
), i got it working and it seems to work fine, but Vijay dosen't really go into how to setup the project like where to download the jars and where to put the dll and so on, and I did have some hard time trying to find out where to find the jars.

 Downloads
1. At first i took apart the jnlp file on jrex.mozdev.org to find out what are the dependencies, but after looking around the mozdev site, i finally found the downloads for the jars, source and docs in here (http://www.mozdev.org/source/browse/jrex/downloads/#dirlist).

 2. But it dosen't include the jrex_gre files that are in the jnlp, those you can get them here (http://www.mozdev.org/source/browse/jrex/www/releases/jrex-1.0b1_dom3/). Look for the jrex_gre.jar

 Setting up your eclipse.
Put the jrex.dll in your eclipse directory, if not you will get a UnsatisfiedLinkError when you try to run the view. Put the jrex.jar in your lib folder of your project.

 Unzip the jrex_gre.jar contents to a nice location you can remember.  You will see in Vijay's code a place that you will need to supply the path to the file in org/mozilla/jrex/jrex_gre files.

 That should fill up the missing pieces in Vijay's writeup.

I will try to package the source code into github at some later time.
&n bsp;

Thursday, January 6, 2011

Fedora 14 - Using the DVD as a software repository

Installed Fedora today at office in order to try out some web acceleration stuff lile squid and varnish. I used the DVD iso version, so that i can have most of the essential software already.

  When i rebooted i found that the dvd is not recongnised as a software repository, because there is no entry in /etc/yum.repos.d/.

No biggie, just mount the dvd, in the root of the dvd there is a file media.repo, jus copy the file to /etc/yum.repos.d/ as packagekit-media.repo and you are all set, your dvd becomes a software repository.

Wednesday, January 5, 2011

Resolutions 2011

My resolutions for 2011.

For the personal geek in me (Probably have little to do with work)

I declare this to be the year of functional programming for me!

Common Lisp 
Begin by first completing Practical Common Lisp and Land of Lisp, and the little pet project that i do when i have free time, the idea of closures and high order functions really appeal to me.

Another Functional Language that I hopefully have time for this year. Invented by Ericsson for using in telephony applications, it has some interesting properties like fault tolerant and hot swapping. Since it's designed for telephony (which has something like 9 9's of availability) you can actually swap in code while the system is running which i think its pretty cool.

Hadoop/Map Reduce
Always heard about MapReduce and Hadoop, I shall attempt to read google's paper on it and hopefully setup a working instance.

NoSQL
NoSQL is getting big nowadays with Twitter and Facebook all moving/developing part of their infrastructure on top of NoSQL type of storage.
Learn at least one implementation and see how it can be worked into a project.

For the bookworm in me
Read The Elements of Style, one of the great books on the writing for the English language. Time to get better at my writing, better written communication is essential as you go along ur working life.

Read more "management" style books especially in the realm of making people happy at work, I am quite interested in how great organizations retain their people and keep them happy.
So far i have FISH! tales, Why work sucks from the library here with me.

For the not so fit me
Finish taking my IPPT before June and pass it.
Run at least once a week at least 2.4km.
Attempt to run a half marathon by then end of the year. (Haha this will the hardest one in my list)

For the bad habits in me
Second guessing or interrupting people midway
I don't know if people noticed but i do have a bad habit of either completing other people's sentence or second guessing what they will say. I will let others finish what they want to say before I start, I will try to follow the rule of One Conversation at a time.

Procrastination
I have a habit of procrastinating, enuff said.

For the father and husband in me
Vacation
Hopefully I will have time to go for a vacation, hopefully it will be the first time that I am bringing Chloe overseas.

Better Father/husband
Its quite hard trying to be specific as to what makes a better father, could be a variety of factors but i sorta like this one that I got from FISH! Tales book, "Love for child. is simply being there".

Lets look back again in 2012.