Wednesday, May 21, 2008

World Congress On IT -- WCIT

I went o WCIT 2008 at KL Convention Center as a delegate and had to suffer a few days of "ye old boring diatribe and ego venting" almost all the way through the seminar. I mean, come on!, if you're an avid IT blog reader (and writer) and you read forums such as dzone, zdnet, theserverside, or even slashdot every single day, there is nothing new here. There are a few gems though, the "Future of the Internet" forum was really something else. The WCIT Great Debate (well, it's not much aof a debate since all the debaters agree with each other all the time) was also insightful. The final keynote by Vonton Cerf (the interplanetary internet googler) was also very interesting

My real beef is that most of the presentations touch only the surface of any particular issue and use up all the time given to retouch the same surface over and over again (and desperately hoping that the audiences would get some kind of an orgasm from this). I mean, there wasn't really a session where things are scrutinized to the nearest atom and problems are disected like dead frogs on some 15 year old science students lab table (and yeah those 15 year olds can really disect frogs). Even the CIO breakout sessions (well I attended the FIS session) didn't really go that deep.

Another dispointing thing is that, no technical session was done AT ALL. I mean, come on!. It's World Congress of Information Technology and no "technology related track was done. Couldn't they run a few tracks on some general tech issues. You know things like building next the generation of internet apps or whatever. But nothing at all, rien, nada.
Now before you jump your guns and say, "hey Azrul, this is a business seminar, get over it!" I would like to remind you that they have a PC Fair going on downstairs at the convention center. (Of course WCIT was co sponsored by PICOM whose hammer (read PC Fair) is applied to every single problem they have... What? earthquake in China? let's do a fundraiser... and throw in a PC Fair for good measure). Now, is PC Fair, full of pimple head bloggers wannabe drolling over some MP4 player, is more business related than "Tools and techniques to build the next generation of internet application"? Yeah... of course... NOT!

I was also a bit disappointed by the chief ministers trying to lure investors to their respective states. During their speeches, they were reading from a text... I mean, come on, reading?! Gosh! you guys are politicians for God sake. Use your public speaking skills (how on earth did you guys win the last election anyway?). Throw away the freaking text your secretary made the night before and speak from your heart. What can we expect from you. You track record. Your resources etc. If things are lacking what do you do to improve the situation, and last but not least... give us your phone number and email so that we can contact you. If I want to invest in a company, I want speak to the boss. Not some "account manager" you hired yesterday. The same goes with investing to a state.

Lastly, why the heck did they call WCIT as "the Olympics of IT" anyway? . Well, if the Olympics of IT consist mostly of sitting down, snorring, chatting and eating good food (and the food was good), should one wonder why IT workers are getting fatter?

Wednesday, April 23, 2008

To Mr. Jonathan Schwartz: Please make JavaFX work on plain CLDC

This entry is half an open-letter and half a rant-blog so if I run with it a bit too far, please bear with me.

Last year Sun introduces JavaFX as a rich multimedia platform for Java (Applet 2.0 ?) , at that time I was busy finding a way to run Flash animations on as many mobile phones as possible. Yes I know about Flashlite but the support of Flashlite are not that extensivise, especially if you include low end / old phones that only support MIDP 2.0. I was jumping up and down when they showed how rich multimedia app can actually run "unharmed" on a phone.

To my dismay, I found out later on that JavaFX only works on CDC (read high-end, almost PDA type phones) and totally ignore CLDC - Ok, that's not really true, they do plan cover CLDC (some time in the future?) but the CLDC phone's JVM must support SVG. (OK that's a whole bunch of acronymes but in short, JavaFX only supports the latest greatest phones).

To add salt to injury, I heard (ok this is only rumours - but it still hurts) that Sun is coming up with a design tool much like Abode Flash to help designers use JavaFX.

Now here's a news for Sun, designers don't use Java or JavaFX or any tool related to them. Designers are trained in schools to use Flash and AI and Photoshop. Heck, even Microsoft had a hard time dethroning Adobe as a design tool company. JavaFX only covers high-end newest-latest phones that already has Flashlite runtime: Why do I as a designer wants to create a JavaFX content when I can just run my swf (read flash) files unchanged on these latest phones?

So, here are a few things I think Sun should do instead:

1) Create a CLDC JavaFX runtime but do not insist on any extra JSR/MSA or whatever. Now how do I know that this is doable? Well because tons of rich multimedia games are already created on plain CLDC phones. Couldn't Sun just leverage the game APIs to create a JavaFX runtime? These APIs are already tried and true stuff and have been shown to be flexible enough to run the most complexe of games: let alone JavaFX content.

2) If Sun is itching to create a designer tool then please do so, but please please create an SWF to JavaFX translator. There are tons of Flash based content out there and IF this SWF to JavaFX tool comes along AND these content can run on any CLDC phone THEN JavaFX will make a killing.

Now, some might say, "hey Azrul, Sun is a server company, why the heck would they want to invest fulfilling your little wet dream". Let me answer that with a story of Sara. Sara is a designer living in Kuala Lumpur, Malaysia. She designs content for mobile phones. With the current technology, Sara could create around 4-5 contents per week (enough to pay her rent and to put food on the table). She uses Flash because that is the tool they taught her in designer school and Flash is flexible enough for her to create really cool stuff. But she has a huge problem: most phones does not support Flashlite. She saved some money and buy a software that converts Flash's swf files to 3gp files (mobile video) and send these 3gp files through MMS to her clients. Unfortunately, her MMS provider informed her that Telco's only supports MMS up to 100kb only. She knows about an alternative to MMS which is WAP push, but Sara allows her clients to include their own text in her content and MMS is the only way to do that right now. Because of this limitation on the size of the files, Sara needs to be extra careful on things like, the number of colors she uses and cool stuff like gradients are next to impossible to do.

Now, Mr. Schwartz, CEO of Sun, after reading a blog by some unknown guy, decided to make JavaFX runtime as standard compliant as possible (read independent of any optional JSR or MSA etc.) by leveraging MIDP's game API. Furthermore, Sun has also created an swf to JavaFX converter. Sara was thrilled when she found out that she can now create Flash content, convert it to JavaFx and run it on almost any phone out there. Her programmer boyfriend told her that JavaFX is based on JavaFX script (i.e. text based ) and therefore can be modified easily. He created for her a software to allow her clients to customise her content on the fly. She was very happy, now that customization can be done on the content itself, she doesn't need to use MMS anymore. Her MMS provider also supports WAP push and she can easily move from one delivery mechanism to another. As a bonus, WAP Push is inherently international. So now Sara can sell her content to Singapore, Philippines and the rest of the world.

What really makes Sara a happy girl is that she can now concentrate on being creative instead of having to count how many colors she is using in her content. Instead of creating 4-5 contents per week, she's now creating tens of them. She even hired a few interns to help her out. Together they create a few hundred contents per month.

One fine day she got a call from her server provider saying that her server just couldn't take the load anymore: too many people are downloading her content, then she remembers Mr. Schwartz's company, Sun Microsystem. They make powerful servers with gazilion of cores embedded inside. (Her programmer boyfriend, who is now her fiancee, just couldn't stop talking about how good those servers are). She call her server provider and ask them if they can use a Sun server instead. They inform her that Sun servers are a bit expensive but she has enough money now.

So Sara uses Sun server to serve her JavaFX mobile content and all thanks to Mr. Schwartz and all those nice people at Sun who made it all possible.

And Sara lives happily ever after...

So you see, making JavaFX work CLDC phones without any extra baggage and making swf to javafx transition to be as smooth as possible actually pays off... even for Sun Microsystems, the server company.

Thursday, April 17, 2008

Scenario Driven Testing

Cedric's recent (ok, it's not that recent) blog on ROR prompted me to write this entry. No, I'm not about to become a RORing ROR advocate, instead I'm going to talk about testing. An interesting point raised by CEdric was this: JUnit actually holds back Java testing scenario and therefore Java is stucked with unit testing as the ultimate and unquestionable master of test and anything less (or more) is frowned upon with so much prejudice it makes "think of the children" slogan sounds holy (dramatization is mine).

Ok, unit testing is in and on itself is not evil, but it's not enough. Functional testing, in my opinion is waaayy more important and yet functional test has been like that uncle everyone despises: can't live with him, can't throw him out of the boat while you pretend going fishing with him at 3:00 AM in the morning.

But how do you do functional test?

Here's my take on it:

When you start your software development you would have scenarii (of course unless you're doing Agi-hi-le development where you code as soon as the client opens his mouth -- just joking, I know agile folks have user stories :) ). The scenarios are not and can never be comprehensive but it gives you the ability to cover the usual usage of your software (which is probably 90% of the time - give or take). All you have to do now is to create scripts mimicking the scenarii and that's it.

Scenario driven testing coupled with unit test would be a great tool for developers: unit testing covers the nitty gritty part of your system and scenario driven testing covers the large picture.

Of course, most of the time you will need to do scenario driven testing through an interface so tools like httpunit would help. But what if you need (or forced) to use an interface toolkit that has no testing framework in sight? *cough* woodstock *cough* (BTW, if anyone knows a good interface based woosdtock testing tool, please show me the light) Well, apart from testing manually, I'm still working on a way to automate things a little. So stay tune...

Multiple Auto-complete for Woodstock (Netbeans Visaul Web Pack (VWP))

I have been searching around for multiple autocomplete but couldn't really find one that works seamlessly with Netbeans VWP. There is of course the work of Dimitry [http://blogs.sun.com/dmitry/entry/creating_autocomplete_entry_field_with] but this is limited to a single entry auto-complete (i need a multiple one). So just like any good hacker, I decided to see if I can improve Dimitry's code and come up with my own and le voila:

Basically, the flow of things are exactly like the one used by Dimitry, except that

1) When editing the textfield, not only that I refresh the listbox, but also see if the user is typing a comma, in which case, I will reset the filter in Page1. The filter will only contain words typed after the comma.



//in Page1 setFilter
int index = value.lastIndexOf(',');
if (index >= 0){
this.filter = value.substring(index+1);
}else{
this.filter = value;
}
listbox1DefaultOptions.filter(filter);



2) Also, the user could type the down arrow key while typing in the textfield, this will bring our focus to the listbox.

//in tf's OnKeyUp
var evtobj=event? event : window.event //distinguish between IE's explicit event object (window.event) and Firefox's implicit.
var unicode=evtobj.charCode ? evtobj.charCode : evtobj.keyCode

if (unicode==40){
document.getElementById('form1:listbox1').getSelectElement().focus();
}
document.getElementById('form1:listbox1').refresh('form1:tf');



Just to complete things, the user could also type a comma while browsing the listbox, this will be detected in the OnKeyUp event of the listbox

//OnKeyUp of listbox1
var evtobj=event? event : window.event
var unicode=evtobj.charCode ? evtobj.charCode : evtobj.keyCode
var character=String.fromCharCode(unicode)
if (unicode==44){
var text = document.getElementById('form1:tf').getProps('value').value + ',';
document.getElementById('form1:tf').setProps( {value: text } );
document.getElementById('form1:tf').getInputElement().focus();
}else{
var text = document.getElementById('form1:tf').getProps('value').value + character;
document.getElementById('form1:tf').setProps( {value: text } );
}


Of course if the listbox change, we need to append the listbox selecte entry to the textfield. (Note that We will replace any entry that is after the last comma.)

//OnChange event of listbox
var text = document.getElementById('form1:tf').getProps('value').value;
var index = text.lastIndexOf(',');
if (index >=0){
var stext = text.substring(0,index+1)+document.getElementById('form1:listbox1').getSelectedValue();
document.getElementById('form1:tf').setProps({value: stext});
}else{
var stext = document.getElementById('form1:listbox1').getSelectedValue();
document.getElementById('form1:tf').setProps({value: stext});
}


Please download the complete code here [http://www.mewit.net/codes/autocomplete.zip]

Multiple Auto-complete for Woodstock (Netbeans Visaul Web Pack (VWP))

I have been searching around for multiple autocomplete but couldn't really find one that works seamlessly with Netbeans VWP. There is of course the work of Dimitry [http://blogs.sun.com/dmitry/entry/creating_autocomplete_entry_field_with] but this is limited to a single entry auto-complete (i need a multiple one). So just like any good hacker, I decided to see if I can improve Dimitry's code and come up with my own and le voila:

Basically, the flow of things are exactly like the one used by Dimitry, except that

1) When editing the textfield, not only that I refresh the listbox, but also see if the user is typing a comma, in which case, I will reset the filter in Page1. The filter will only contain words typed after the comma.



//in Page1 setFilter
int index = value.lastIndexOf(',');
if (index >= 0){
this.filter = value.substring(index+1);
}else{
this.filter = value;
}
listbox1DefaultOptions.filter(filter);



2) Also, the user could type the down arrow key while typing in the textfield, this will bring our focus to the listbox.

//in tf's OnKeyUp
var evtobj=event? event : window.event //distinguish between IE's explicit event object (window.event) and Firefox's implicit.
var unicode=evtobj.charCode ? evtobj.charCode : evtobj.keyCode

if (unicode==40){
document.getElementById('form1:listbox1').getSelectElement().focus();
}
document.getElementById('form1:listbox1').refresh('form1:tf');



Just to complete things, the user could also type a comma while browsing the listbox, this will be detected in the OnKeyUp event of the listbox

//OnKeyUp of listbox1
var evtobj=event? event : window.event
var unicode=evtobj.charCode ? evtobj.charCode : evtobj.keyCode
var character=String.fromCharCode(unicode)
if (unicode==44){
var text = document.getElementById('form1:tf').getProps('value').value + ',';
document.getElementById('form1:tf').setProps( {value: text } );
document.getElementById('form1:tf').getInputElement().focus();
}else{
var text = document.getElementById('form1:tf').getProps('value').value + character;
document.getElementById('form1:tf').setProps( {value: text } );
}


Of course if the listbox change, we need to append the listbox selecte entry to the textfield. (Note that We will replace any entry that is after the last comma.)

//OnChange event of listbox
var text = document.getElementById('form1:tf').getProps('value').value;
var index = text.lastIndexOf(',');
if (index >=0){
var stext = text.substring(0,index+1)+document.getElementById('form1:listbox1').getSelectedValue();
document.getElementById('form1:tf').setProps({value: stext});
}else{
var stext = document.getElementById('form1:listbox1').getSelectedValue();
document.getElementById('form1:tf').setProps({value: stext});
}

Monday, April 14, 2008

Should MDeC be writing software

Now if you're a Malaysian, you probably heard of the MSC initiative launched by our previous PM to boost Malaysia into the information age. Well MDeC (formally known as MDC) is the (goverment linked) company tasked as being the steward of MSC. (www.mdec.com.my)

Being a steward of MSC is a blur job description. So MDeC does everything from managing real estates, managing gov. grants, making sure that IT talents are always available etc.

Should MDeC write software? Yes they should!

Ok, I know that all the business folks who make up MDeC's higher echelon is all eyeful and ready to grab their guns and shoot this idea to kingdom come... but please, hear me out.

Whay is Malaysian IT isn't taking off, despite what we do. Every single day, we have more and more Indian nationals working in Cyberjaya instead of the locals. Our IT graduates are not performing and lack way behind in either skills or theory. Our IT enterpreneur are afraid to speak out, our venture capitalist should just be called capitalist since most of them are even worse than banks, our IT shops, diligent and hardworking as they are, have to resort to selling computers since no one is helping them to create and monetize their IPs. We are the third outsourcing destination after India and China and yet we do nothing to at least maintain that or, God forbid, improve our ranking.

I'm matured enough and knowledgable enough to understand that not all these problems are MDeC's fault. The problem is that MDeC is, intentinally or not, blissfully unaware of these problems. Ok, that is not entirely true. A lot of people in MDeC are aware of these problems but the processes put in place to solve these problems are so out of touch with the reality of things its not even funny anymore.

I'm not about to hang MDeC by the neck without offering some way to improve things. How to improve?, why, MDeC should create its own software and "suffer" like we suffer, experience the pain that we experience at every tick of the clock. Now don't just write software, market it, find investors for it, find clients to back it up etc. And MDeC will surely know where to put the dollars of their next budget to.

Now before we dismiss the possibility of this, do know that MDeC is already creating creative contents (www.saladin.tv) and I guess that is why support for creative contents are quite extensive because they did go through the pain of actually creating something. But do know that a lot of MSC companies create software too (heck, by my account, there are a lot more software shops compared to creative content shops).

To MDeC, unless you experience things that we, the Malaysian software industry, had to go through, you will never truely understand the pain. No matter how many dialogs you run, no matter how many face to face, heart to heart meetings you have with the local software shops, experience is and will always be the best teacher.

Sunday, December 30, 2007

Software agent research

I was reading an entry on slashdot [http://slashdot.org/article.pl? sid=07/12/29/0447236&from=rss] and subsequently an old paper [http://agents.umbc.edu/introduction/hn-dn-ker99.pdf] on the state of multi-agent research.

I have to admit that multi-agent technology was one of my pet peeves as I worked on one during my Masters degree industrial project. Heck, I almost proposed multi-agent technology as my PhD research title.

I am in agreement with the research paper and also most of the comments on slashdot that multi-agent research is somewhat "dead". Sure, occasionally you have papers written on multi-agent and stuff but nothing really ground breaking. The same old problem is stil lurking around.

In my opinion, [and this is my opinion only, this does not mean to offend any multi-agent researchers, practioners etc. - some of whom are good friends of mine] the whole problem with multi-agent technology is when researchers start making multi-agent as a software abstraction above objects in which intelligence, "selfishness", high-level semantic communication and other agency characteristics are integrated.

Now, as appealing as this concept is, creating such an abstraction is:

1) Very very difficult -- Finding common ontology alone is a daunting task.
2) Not very useful to software engineers -- Most software engineering challenges reside in creating highly scalable and performant system. Even in systems that need intelligence (such as game), basic concepts such as A* algorithm, decision tree and finite state machine are usually enough.

So, what am I suggesting as a solution?

Quite some time ago, when multi-agent technology was the hype of the century, there were two different school of multi-agent research: One trying to create a software abstraction, the other try to use multi-agent to study the behaviour of and reason about real world agents (one type of such agent is the human being). There were some research (using multi-agent as a model) on animal behaviour under attack from predators, on crowd control and crowd behaviour, on traffic management etc. They show some promising result but alas, researchers tend to be interested more in software agent rather than real-world agents. I suspect the reason behind this is because most multi-agent researchers have their roots grounded in the field of CS or IT and thus their tendency towards creating software abstraction agents instead.

In my opinion, we need to revamp this trend. Multi-agent technology would probably be more useful in the hand of a sociologist than a computer scientist. (Thus highlighting one of the most severe problem in academics today -- single minded research). Modeling human as multi-agents, simulating the behaviour and reasoning about the future actions would be very much useful and this is probably the future of multi-agent research.