Archive for January, 2006

Happy Birthday Riya

Friday, January 20th, 2006
Riya's birthday cakeI know its a little too late, 2 months late actually, but as they say “better late than never”. Everyone in my family had been reminding me that I had not uploaded Riya’s birthday pictures. After all it was her first birthday. Finally I got around to uploading the pictures onto flickr. This is the first time I am uploading pictures onto flickr, I used webshots and Yahoo photos earlier.

Having been so busy the last year, time just flew by. It just seems like yesterday that I held Riya in my hands for the first time. It was one of the most incredible moments of my life. And here she is now, one year later, running around the house, playing, shouting, crying, laughing and breaking things :).

Lets hope next year I can put up the pictures in time. You can see more of Riya’s pictures here.

Custom XUL titlebar that responds to events (almost)

Thursday, January 19th, 2006

<titlebar> tag does not have the standarf minimise, maximise or close buttons and the reference says “Any elements inside the titlebar do not receive events.” so what do you do if you want a custom titlebar with the standard buttons?

After some hair pulling Shyamal came up with a nice simple idea (which looks so obvious now :) )

<hbox>

<image id=”logo” />

<menuseparator />

<titlebar id=”myPersonalTitleBar”/>
<menuseparator />

<image id=”closeImg”/>

</hbox >

Simple huh!!

Extending FireFox menu bar

Thursday, January 19th, 2006

You can easily find information on how to create a new toolbar but if you want to add to an existing toolbar looking at the browser code was the best resource I could find. This is what it takes to add your controls on FireFox’s menu bar.

Browser.xul uses following tag hierarchy for toolbar.

<toolbox id=”">

<toolbar id=”">

<toolbaritem id=”">

Rest of the tags

</toolbaritem>

</toolbar>

</toolbox>

So if you want to extend an existing toolbar you just need to know its “id” and write your own xul. For example to append  to the menubar I would write:

<toolbar id=”toolbar-menubar”>

<toolbaritem id=”">

my stuff

</toolbaritem>

</toolbar>

Following are the ids used in firefox, names are pretty self-explanatory

  • toolbar-menubar
  • nav-bar
  • PersonalToolbar
  • status-bar

By the way, in case you want to right align your additions <toolbarspring/> will come handy.

Show me the money

Thursday, January 19th, 2006

dollars

Web 2.0 is the center of all internet activity nowadays. More and more people are joining the race to get a share of the pie by launching a web 2.0 service. And social networking is the theme most of these services revolve around. Apart from a few services like flickr that have a strong revenue model by offering paid services, most of the other services are free. And that has to be the case since most people would not pay for these services. So the wealth they generate is mostly in terms of the number of unique visitors they get.

Now, how do they monetize and capitalize on the traffic that they accumulate? The immediate thought that comes to mind is that they generate revenues by advertisements. True, that can make money, but I doubt it would make enough money to cover all their investments and ongoing costs. I was talking about this with a friend, and he casually mentioned that having a large existing and loyal user base instantly makes them eligible for acquisition by one of the GYM gang members. Does it? Do most of the web 2.0 startups that do not have a strong revenue model hope to be acquired by one of the bigger players who has the muscle to buy them out?

But does it make sense to create a service whose only hope of survival is to get acquired by someone who has enough cash reserves to keep it rolling? No, it doesn’t. I don’t think these bright people out there providing great services start out on the premise of selling their companies at some point of time, or do they?

Phil suggets there are 3 models of generating revenue for the web 2.0 companies. But do all the services qualify for them? Most of the social networking sites cannot afford to ask their users for subscriptions or commisions. So while I myself am a user of these services, it really puzzles me if and how they are making any money.

Identifying and displaying hyperlinks in XUL

Thursday, January 12th, 2006

The other day I needed to identify URLs within a block of text and create hyperlinks out of them to be displayed in a XUL description element. First I looked for any XUL control that could do this for me. But there was none. So I turned to javascript to identify the URLs in the block of text while I decided to use the HTML namespace to add HTML tags in the XUL.

To identify URLs, I used a regular expression from the book Mastering Regular Expressions by Jeffrey Friedl. I split the block of text on spaces, parenthesis and hypens and used the regular expression to check if each token is a URL. While finalizing the regular expression, I also took help from this entry by Mark Szlazak. Co-incidentaly, it also refers to the book Mastering Regular Expressions. With this done, I was able to evaluate if each token was a URL.

Now I had to convert these URLs into hyperlinks and make them clickable in XUL. I was using a description element for showing the whole text. Since the text could be long and should wrap to multiple lines, I chose not to use the value attribute but rather add the text as value of the description tag. To do so dynamically, here’s what I did:

  • First I added the correct html namespace by including the following attribute to the window element:

xmlns:html=”http://www.w3.org/1999/xhtml”

  • Then I added the description element:

var descNode = document.createElement(”description”);

  • Subsequently add the block of text (remember I split it into tokens) one token at a time

var txtNode = document.createTextNode(token);
descNode.appendChild(txtNode);

  • The above works for adding plain text. Now to add a hyper link, the following code snippet was used to add tokens that were identified as hyperlinks:

var linkNode = document.createElementNS(”http://www.w3.org/1999/xhtml”,”a”);
linkNode.setAttribute(”href”, token);
linkNode.setAttribute(”target”, “_blank”);
link.setAttribute(”style”, “color: rgb(0,0,255); text-decoration:underline”);
var txtNode = document.createTextNode(token);
linkNode.appendChild(token);
descNode.appendChild(linkNode);

And here is how it looks:

Hyperlinks

If we were to print the XUL DOM tree, it would look like:

<vbox id=”box_id_1″ flex=”1″ style=”overflow: auto”>
<description>
This is normal text, but this link: <html:a xhref=http://www.example.com/>http://www.example.com/</html:a>
is a URL that would be converted to a hyper link.
</description>
</vbox>

Is an idea necessary?

Monday, January 9th, 2006

When we started TechJini, we did not have any particular killer-app in our mind. Of course, we had several ideas that seemed to be promising but we had not decided which one to pursue. When I was talking with my managers and other colleagues (from my previous job), everyone was surprised that we did not have a product idea to start with leave alone a demo/beta version.

We had simply founded the company based on our determination to make a difference to the technology industry in particular and the world in general. However, we did not have the next big idea to start with. We based the company on a common set of values, mission, goals and few contacts who could give us work :). One of the goals, indeed, is to have an innovative offering (or the big idea if you may) ready by some date. But we decided to go ahead and leave our jobs and to brainstorm over the first few months of operations for that killer app.

Since TechJini is just a few months old, we cannot yet ascertain our success or failure. Only time will tell.

But, I do firmly believe that an idea is not central to creating a startup. It definitely gives a big boost but is not necessary. Over the last few months as we learned that really good ideas are hard to come by and also difficult to recognize, it seems we did the right thing since waiting for figuring out that killer app could have taken too long.