I Think ∴ I Am

Java, Flex, RIA, AJAX, Flash, Life, Food, Kites…

Book review – Art of Innovation

Posted by vipuljhawar on May 18, 2008

Art Of Innovation by Tom Kelley is an excellent book for anyone who wishes to be a man of his own will, looking forward to create new, simple solutions in this world. Why do you need an anti gravity pen when you a have pencil which is damn cheap.

It is an excellent collection of stories and narration about IDEO, America’s leading design firm and how they have managed to make so many things simple and trust we as a lay man would have never imagined that it takes so much creativity to design a toothbrush for kids with broad handles and a rubber grip or a pop up cap for the toothpaste. Product by product description and how different teams at IDEO keep on churning new revolutionary products or make existing things much more fun to use.

It pretty much focuses on the environment which blossoms creativity, which no doubt is essential for any firm today. Consider a mail pop up in your inbox about just another meeting and man you start yawning… but what if you guys never had hierarchical meetings in the company but just brainstorming sessions :-) . Sounds good but i feel it’s applicable too just that we never look forward to changing things too much around us. So, if you are a small company looking to make a big impact i think this ones a must for you guys. Happy reading…

Posted in My review on... | Tagged: , , , | Leave a Comment »

Creating a dynamic tree in flex

Posted by vipuljhawar on March 28, 2008

Tree control is one of the most powerful control in Flex. You must have stumbled upon N number of articles explaining the tree control, where they pick up the data from an XML for the tree, but that does not really happen too often if you have a tree which is to be built dynamically as loading a new XML everytime to build a tree is a costly affair.

So, let’s create a tree in Flex using actionscript objects which may be serialized version of server side objects or you may want to create a tree using some business logic rather than some plain input text. So, we will create a TreeNode class in Actionscript which will represent each and every node in the tree. The advantage of working with node objects is that you can have different types of objects at different levels and also use the inheritance concept pretty nicely. So a basic node may be a Node with variables – id, name, type.  A subclass of this node may be a PersonNode with additional variables – age, sex etc… and you can go on like this creating trees with the apt information and you can display any kind of data just by clicking on the node by fetching that node from the tree.

The top level class will be TreeNode.

public class TreeNode {

     public var id : int;

     public var name : String;

     public var type : int;

     public var children : ArrayCollection;

     public function addChild(node : TreeNode) : void {

      if (this.children == null)

          this.children = new ArrayCollection();

          children.addItem(node);

     }
//Similarly you could have getNode();

}

A sublcass of this could be a DataTreeNode

public class DataTreeNode extends TreeNode {

     public var data : Object;    

}

Now you can simply create a tree in Flex, by creating a RootNode of type DataTreeNode.

var rootNode : DataTreeNode = new DataTreeNode();

rootNode.id = 0;

rootNode.name = “Root”;

rootNode.type = -1;

Now you can keep creating nodes of different types and keep adding to the rootNode. Just assign the rootNode to you tree as a dataProvider and there you are, the flex tree will display automatically. I have found this approach much better and easy as it allows easy extension and also allows me to do much more on when i click a treeNode. Also, this way you don’t solely rely on the Tree api in Flex to do something with your tree, you can manipulate or swift your tree in any manner you want and reap the benefits.

If you have better way of creating dynamic tree in flex do comment, i would be more than pleased to improve or use that for my project, with all the regard definitely :-) .

Posted in Flex, Flex Tree control | Tagged: , , , | 4 Comments »

Comparable datagrid in flex

Posted by vipuljhawar on March 27, 2008

Using a datagrid in Flex seems very easy, but it has the inherent problem as ready to eat meal. It may not allow you to do all the modifications and may not allow you to present it in a view you desire.

A few months back i had a requirement to create a datagrid, which displayed data column wise instead row wise i.e. the datagrid was suppose to be used for comparing and viewing data across columns rather than rows. So, how do we deal with such a problem in Flex. If you are working on HTML, its easy as you can just alter the logic in the for loop printing the rows. The whole point is using multi dimension arrays.

After finding no easy way to do it in Flex, i had to use to the same programming talent to display data column wise.

As datagrid expects the dataprovider to be in the form of an Array or ArrayCollection of objects and then it iterates over these objects to display a property of these objects in each column when you use the dataField property or you can reformat your test using the labelFunction property for the column. I used a combination of programming logic and labelFunction to display the list.

Lets say we intend to display Person objects columnWise, as displayed below.comparable-table.png

Now we would receive person object from the server to the client and there is no way that you can use labelfield property or the lablefunction straight away to create such a table.

The wrokaround is to keep the person array aside and create an array of indexes equal to the number of rows that each column would have or the max. number of rows that a column could have in the whole table. So we will create an array with numbers {1,2,3,4…} each number denoting a particular row in the column. Now, iterate through the person object array and keep on adding DataGridColumn objects to the datagrid for as many Person object. So, the dataprovider to the datagrid is an array of indexes and the number of columns is equal to the number of Person objects. Assign a labelFunction to each column such that

public function getCompareLabel(item : Object, column : DataGridColumn) : String {
var cIndex : int = int(Number(column.dataField)); //this will give you the column for which you have to get data.
if (cIndex == 0)
return getRowLabel(item, column); //Now in getRowLabel just write a switch function which will give label’s for each row, such as “First”, “Last” etc. This gives the first column.
var person : PersonDAO = personArray[cIndex-1] as PersonDAO;
//Now from second column onwards we will get the particular person object from the dataArray and display data for a particular field accordingly.
switch(item) {
case 1 : return getCmpStr(person.firstName);
case 2 : return getCmpStr(person.lastName);
case 3 : return getCmpStr(person.age);
….

…..

}

The output will be a table like above. Strange, isn’t it Flex is suppose to make things easier but i had to swing around the whole place to get this is in place.

Posted in Flex | Tagged: , , | Leave a Comment »

iPhone must have apps

Posted by vipuljhawar on March 15, 2008

It’s time to identify the must have apps on your iPhone. The list would be regularly updated with time as and when you see new apps flowing in but as of now i find the following worth installing. I am having a satisfactory usage experience on 1.1.3 with these apps.

1. WebSearch  – One stop app for searching Google, Amazon, Dictionary.com, ebay, wikipedia etc.

2. LocateMe – Gives your precise location on the planet. Nice to have if you are stuck in a unknown place sometime but would you be connected to the internet that time :-) . Gotta get Edge activated for that.

3.  SysInfo – Meta info about your iPhone.

4. Finder – Nice app to browse the filesystem and manage files and directories.

5. weDict – dictionaries on your iPhone.

6. Tris – Tetris for iPhone. One of my favourites, i love Tetris game and install it wherever possible. I even have it on IDE – IntelliJ :-) .

7. CameraPro – iPhone camera software sucks. This is a nice substitute.

8. MxTube – WOW, you can download youtube videos and persist them on your iPhone forever. It’s beta now but i think once the final release is out this is going to be one of the most hpt iPhone apps. Job’s would lose his cents as people wouldn’t buy videos from iTunes store.

9. FTP daemon – This is required if you wanna access your iPhone via FTP. One you have installed this, you can FTP files to your iPhone by using any FTP client on any remote machine.

10. Unix Subsystem – This is required by many apps as a base app.

11. Open SSH – SSH to your iPhone using Putty if you are using Windows on your PC.

So keep installing and enjoying, if you find another interesting app, do leave a comment.

Posted in Baby Steps to iPhone | Tagged: , , , , | Leave a Comment »

iPhone review, my first thoughts

Posted by vipuljhawar on March 14, 2008

iPhone

Ok It’s time to start tapping the iPhone icons. Mine is a factory made 1.1.3 16 GB :-) , no upgrades till date. The first things you should not miss on iPhone are the built in apps.Like a gentleman apple expects you to use these apps, and not any other from the so called untrusted sources:-

1. Youtube – Aaah!!! who didnt want youtube on their phone, i wish we had wi-fi everywhere i went in India.

2. iPod – This is great, I guess now it’s time for me to get the FM transmitter/adapter for iPhone so that i can use the iPod in my car/home over any speakers. Will have to get it from US now.

3. Google Maps – Great to see maps of India on your mobile, not pretty precise but considering the mughals never planned Delhi thinking we would tap our phone and use a map, so it’s kinna ok to get a fair idea. I am sure it will be much better in month’s to come. No driving instructions though but you can definitely spot the road in front of your house at least if you are in Delhi. The pin drop is great.

4. Safari – Oh this is killer, but no flash support :-( .

5. Mail – Looks good, but i would prefer this app to be password protected, what if i lose my phone or someone steals it (it happens too often in India), he enjoys my mail too so this is a security issue according to me.

6. Stocks – Good if you are into the bourses. The yahoo finance widget a true copy of the kanfabulator desktop widgets but it’s worth it. By default you see NYSE but can add BSE, NSE scrips too.

7. Photos – ok, not much impressed.

8. Camera – The software looks like as if it was developed before someone even thought of iPhone :-) .

9. Weather – Good, again the yahoo widget, you can add indian cities too.

10. Itunes – I never use it because i fear something may get updated and my phone may be bricked.

Some more default apps but these were worth mentioning.

But one things which sucks is the iTunes sync. This is why i hate it, and where they lock you into the apple world. How can ppl so blindly say that only Microsoft blocks other software and plug-ins, I guess iPhone is one the most locked in products.

The negatives as per initial usage:-

1. The phone charger is horrible, two piece device. Maybe guys using iPod wouldn’t feel so but normal mobile phone user would. It’s so difficult to carry the charger in pieces. Bad design.

2. The battery life isn’t so great, but considering it’s a full fledged mini PC, so there would be battery limitations.

3. The earphones socket is non standard one so you plug any regular male speaker or earphone plugs into the phone, so it becomes useless in your car until i buy a kinna converter now.

4. Ooooops iTunes sync sucks. Steve Job’s expects you to buy everything from videos to ringtones :-) on the iTunes store.

5. Using the speaker phone is an issue because of the volume.

But, still i must say i am impressed.

Trust me if iPhone could read and write vis-a-vis USB drive, it would have been a hit among the females too :-) (Am i doubting their geek quotient, nope). I mean iTunes really blocks it’s use as an external hard disk or USB drive but we will use it that way through FTP, SSH or something else.

Now it’s time to load the real apps which make this phone rock, yup the servers, the clients, the games and the etc’s. It wouldn’t a be mobile anymore now.

Posted in Baby Steps to iPhone | Tagged: , , , | Leave a Comment »

Ha ha I am a geek, i got an iphone :-)

Posted by vipuljhawar on March 14, 2008

Hey Hey !!! That’s what you feel when you own and use an iPhone in India. Yup, becuae you need to buy it in GREY market or get a friend or contact of your’s to get it from US. Then you get it jailbroken, unlocked and wait for the ringer to ring and whooooooosh… it rings.

Wow man the hacker inside you is satisfied when you see all this happening in front of you. My experience was amazing. Once i opened the box and held the 16 GB phone iPhone in hand, i was like wow !!!. I headed straight to Bhuvan at my opposite cubicle and it was plugged into his mac. You load ziPhone and click and click and then suddenly then you see hex characters scrolling on your screen, Man u r about to enter the Matrix :-) and then the beauty restarts. It’s a different feeling to get your mobile working like this out of a hack and then the journey begins. Since, then i have been really hooked to the sexy gadget and will have many more posts on it soon.

Although i don’t consider Job’s or Mac any better than Gates or Windows but Job’s got his hands right on iPhone, it’s worth the price. Let’s see if we really have apps flowing in on iPhone from the open source community rather then the app store where Job’s plans to keep 30 cents from every dollar in his pocket. That’s bad steve.

Posted in Baby Steps to iPhone | Tagged: , , | Leave a Comment »

Internet radio / Online Music

Posted by vipuljhawar on December 27, 2007

CD’s, disks, memory cards full of music but still there is something missing… It’s not dynamic. I usually know what’s in there and what will play next. So, we usually look forward to a countdown or radio. Radio has always been entertaining especially if you are alone for some time of day, week, month or year :-) . Some voices are so so pretty or they at least make you feel so.

My recent passion has been listening to radio or music on the internet and that too for free. I tried Yahoo music (too much ads and pretty heavy), Youtube(but you gotta search) and many more radio stations both underground and overground until i stumbled upon live365.com

Yeah i love www.live365.com – there is always scope for better on earth and there may be one but i have been listening to it for quite sometime and i am pretty satisfied by the mix, the quality and the ads too, they aren’t too intrusive. And for someone like me who is always interested in being connected to US… I don’t know for what? this is the best medium, you hear american voices, ads and some good music :-) . So if you are one those who likes online radio i suggest give live365 a sip, maybe you like it and there is so much in there to listen to. Get Live365, Get Live.

Posted in My review on... | Tagged: , , , , , | 1 Comment »

The Google Story

Posted by vipuljhawar on November 8, 2007

An apt title says it all. So you know what you will end up with, when you finish reading the book – The Google Story. It’s a must read for my generation for whom testing an internet connectivity meant hitting the google page too. Trust me till date I and so many many others are always trying to hit the google homepage when they want to see if they are really connected to the internet or not. What could be a more practical example for a internet company, that the very existence of internet is checked by seeing it. :-)

I wouldn’t say that it’s a great book or the writing style is great, but it’s kinna okay if you are really serious about knowing how google came into being. Although i feel the author has magnified some things at junctures, but all in all it seems to be a fair narration, but i really don’t like the unintentional intent of the author  of weighing Google above Microsoft. Every company which has been successful has been described as great as Google, so it’s nothing new, and that’s the way America runs.

So, if you are really curious as to where Larry and Sergey came from, how they started it, how they were just focussed on search and not on earning money at all (I felt this was echoed too much), how a company hired a Chef to have custom food prepared everyday for it’s employees and how the Google guys got into the habit of doing everything differently from the name to fame, to the doodle on the homepage, the IPO etc, then you should read it.

It’s interesting really, if you wanna own a company and hire some employees, you will get some nice ideas and phrases to talk to those prospective employees. :-)

Posted in My review on... | Tagged: , | Leave a Comment »

Why no iPhone in India ?

Posted by vipuljhawar on November 6, 2007

iPhone – Did any mobile ever seduce so many people on earth at a time? Yeah, it does looks pretty. You see it and and you turn back to see it. It’s like you’ve just  spot a new model in a TV ad. And it’s an iPOD too, wow. Apple seems to be the branded tag for some time now, unleashing sleek gadgets that redefine lifestyle.  They do it through technology, marketing, pricing and what not and everything seems to go in their favor because Apple is earning more. Apple seems to be a cult not a company.

Although the iPhone is not sold in India by Apple but it seems to be popping out of pockets now. Almost 10 guys in my office own an iPhone and none of them bought it from the grey market. But, why is it that Apple is not launching it in India, they think they will be too smart doing that. All MBA’s in Apple will devise models and strategies for an India launch sometime next year. Jesus, i can’t stop laughing at them.  Wish there were some Indian guys up the ladder there. This is the time, guys trust me… we are buying and by the time you launch in India, almost all of us who want to own it would have almost used it for an year.
iPhone costing 440$ with taxes i suppose is not a big deal for any Indian, A 300$ phone is a middle class purchase in India now. So I think if I am gonna buy an iPhone and I am getting pretty close to it… I am gonna buy it straight from the US and have one my friends carry it over to India and enjoy it. If Apple does not launch it soon, it will face the same history that iPOD did in India. Everyone who could, bought an iPOD long before Apple launched it in India. I don’t even remember when they launched it in India. Every damn Indian owns a mobile, they wouldn’t know how to put their signatures on paper, but they all know what Nokia stands for. Apple is not known that well in India but they could be the most visible company with iPhone but i think they think otherwise. So, while they keep thinking and get paid to do their homework for an India launch next year, i am thinking of owning it now seriously. Apple could be a cult in India too with iPhone but now.

Posted in My review on... | Tagged: , , | Leave a Comment »

More Gandhi’s or Abdul Kalams, Ambanis, Chidambarams, Praful Patels, Murthys, Premjis

Posted by vipuljhawar on October 21, 2007

Ricky ponting, the australian captain spins a charkha in Mumbai, Times of India a leading Indian newspaper puts a quarter page photograph to inform about T20 match between India and Australia. They applied a Gandhi touch and have always been doing this, and they are running a Lead India campaign to find a future leader for India. :-) I can only smile at them… because i really doubt their intention. It’s not their fault, but Mahatma Gandhi is deeply rooted in here, why? Trust me every aspiring leader is asked about his Mahatma Gandhi thoughts and rated on Mahatma Gandhi IQ . Why?

Trust me I am not from Hindustan Times :-) and they not much different too, I buy both the newspapers but it’s been long since I have been seeing a charkha , I would love to see a laptop or a mobile or a satellite or a tall building or another picture on the Indian currency note.

India has been growing rapidly and hopefully for the good. Everything is changing dramatically from roads, airports to buildings. All jazzy car makers lining up in India to sell their latest models in India. Monorails, Subways or Metros in each and every city for public transport. All notable fashion brands, broadband internet, latest mobile phones you name it and you have it. High paying jobs, increased awareness among the people, a more powerful middle class, higher literacy rate, airlines to every nook and corner, indian satellites in space and people all over the world learning new definitions of the word – Indian. So what is it that has changed India suddenly in the last 5 years, “Gandhi”.

Majority of my leaders and countrymen would still say, we are here because of Gandhi, Nehru etc. But do they have any statistical data to prove this? So, why is it that we still hear so much about our so called great leaders, politicians still spread their ideologies, address the UN to remember them and prescribe the ‘Gandhi antibiotic’ for the worldly diseases. Do they have any statistical data to support as to what benefit we would derive from Gandhi’s ideology in each and every aspect of life, now? My memory and political knowledge is short but brand India is created and respected only NOW all over the world because we now have millions of IT workers working for almost every company in the world, we have airlines based out of India flying to different skies in the world, our business leaders are buying companies in the east, west, The Indian oil major’s are buying oil fields in every part of the world. We are launching satellites in the space and are one fastest growing economies of the world. We have changed from a country of plain white cloth men spinning the wheel to a demand driven, retail hungry, infrastructure building, dollar aggregating, business sensitive country. We have ourselves bought a chair for us on the World dining table, we were not invited because we had Gandhi. So, why is that we need to see the khadi or charkha ads and a conscious attempt by everyone to put a layer of Gandhi and Nehru sauce over the fresh and tasty sandwiches that Indians are preparing all over the world sixty years down the line.

I am tired of seeing Gandhi on the Indian currency since my childhood, I need a change. Gandhi was good, played a key role but it’s been 60 years, we need to check out other guys. He needs to be promoted from father of the nation to fore father of the nation and create space below to let other people be crowned for the glory. Gandhi has been like the end of file header for the last sixty years, and nothing else follows it. It has been like a stamp which when applied to any work, speech or action earns a license of being a fair practice no matter what the result would be. Do you think that Gandhi ever wanted this ? I don’t think so.

We need more Kalam’s, Patel’s, Murthy’s, Premji’s, Ambani’s who are hungry to bring the best to India because that way they earn money, power and fame. I know some businesses do bribe government, kill some traditional pockets of employment but if you see the bigger picture we do need them but for sure not another Gandhi or Nehru clone. We need to get out of the “Certified to Gandhi Standards System” stamp from our lives because deep within, we really don’t follow it anymore and nor does it apply any more. All we need is people with an intent of doing good for the people and the masses, not the way our so called “Father of the nation” asked us to. It’s time to realize that the word India in the dictionary needs a meaning, synonym more than Gandhi, Nehru. We need to add commas and print more definitions to it.

My thanks to Gandhi for the best he did to India, I love him for that. By writing all this I am not insulting or shadowing his efforts. One quality about great men is their names transform from a proper noun to an adjective, and that applies to Gandhi too. I think he never asked us to pray him, so maybe he is not the one to blame for this, but it’s for us to realize that India needs another way of thinking. It’s time to drop the word like, Don’t be like Gandhi, be someone parallel to him or above him. If ever I would be called great, I would always want to be known by my name only my name and not because I am like Gandhi or only followed Gandhi. Some people i have mentioned above have done this in their own style, but then most of them would humbly thank and say our vision, policies etc were always based on Gandhi’s ideology. :-) Give me break. That’s the problem, the brand Gandhi does not need any more free promotion. I am not against him, but I am against a superficial effort by everyone in branding or sub branding everything in India as Gandhi or Sub Gandhi because they feel you have a good public image if you put a tag Gandhi on your shirt. The day the public perception changes, we would see more parallel tags, brands and definitions in India and may be someone who would be eligible to be another father of the nation not because he is Gandhi because he his him. I think that is what Gandhi truly wanted.

Posted in Uncategorized | Tagged: , , , , , | Leave a Comment »