Friday, April 14, 2006

Mutually exclusive RadioButton in INamingContainer redux

Some time back I'd posted about the bug with mutually excusive radiobuttons in repeater controls for VB.Net and hacking my way around the bug. Well, since some time I'd been thinking of posting how I actually did it for the benefit of others and today is the day! As they say, better late than never. Here's the CustomRadioButton.vb class:



Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Globalization
Imports System.Collections.Specialized

Public Class CustomRadioButtonControl
Inherits WebControl
Implements IPostBackDataHandler

Shared Sub New()
CustomRadioButtonControl.EventCheckedChanged = New Object
End Sub

Public Sub New()
MyBase.New(HtmlTextWriterTag.Input)
End Sub
#Region "Properties"

Public Event CheckedChanged As EventHandler
Private Shared ReadOnly EventCheckedChanged As Object

Private ReadOnly Property UniqueGroupName() As String
Get
Dim grpName As String = Me.GroupName
Dim unqId As String = Me.UniqueID
Dim num As Integer = unqId.LastIndexOf(":"c)
If (num >= 0) Then
grpName = (unqId.Substring(0, (num + 1)) & grpName)
End If
Return grpName
End Get
End Property


Public Overridable Property GroupName() As String
Get
Dim grpName As String = CType(Me.ViewState.Item("GroupName"), String)
If (Not grpName Is Nothing) Then
Return grpName
End If
Return String.Empty
End Get
Set(ByVal value As String)
Me.ViewState.Item("GroupName") = value
End Set
End Property

Public Overridable Property Checked() As Boolean
Get
Dim grpChecked As Object = Me.ViewState.Item("Checked")
If (Not grpChecked Is Nothing) Then
Return CType(grpChecked, Boolean)
End If
Return False
End Get
Set(ByVal value As Boolean)
Me.ViewState.Item("Checked") = value
End Set
End Property

Private ReadOnly Property SaveCheckedViewState() As Boolean
Get
If ((Not MyBase.Events.Item(Me.EventCheckedChanged) Is Nothing) OrElse Not Me.Enabled) Then
Return True
End If
Dim baseType As Type = MyBase.GetType
If ((Not baseType Is GetType(CheckBox)) AndAlso (Not baseType Is GetType(RadioButton))) Then
Return True
End If
Return False
End Get
End Property

Public Overridable Property AutoPostBack() As Boolean
Get
Dim doAutoPostBack As Object = Me.ViewState.Item("AutoPostBack")
If (Not doAutoPostBack Is Nothing) Then
Return CType(doAutoPostBack, Boolean)
End If
Return False
End Get
Set(ByVal value As Boolean)
Me.ViewState.Item("AutoPostBack") = value
End Set
End Property


Private ReadOnly Property Value() As String
Get
Dim val As String = Attributes("value")
If (val Is Nothing) Then
val = UniqueID
End If
Return val
End Get
End Property

Public Overridable Property [Text]() As String
Get
Dim grpText As String = CType(Me.ViewState.Item("Text"), String)
If (Not grpText Is Nothing) Then
Return grpText
End If
Return String.Empty
End Get
Set(ByVal value As String)
Me.ViewState.Item("Text") = value
End Set
End Property

Public Overridable Property TextAlign() As TextAlign
Get
Dim align As Object = Me.ViewState.Item("TextAlign")
If (Not align Is Nothing) Then
Return CType(align, TextAlign)
End If
Return TextAlign.Right
End Get
Set(ByVal value As TextAlign)
If ((value < TextAlign.Left) OrElse (value > TextAlign.Right)) Then
Throw New ArgumentOutOfRangeException("value")
End If
Me.ViewState.Item("TextAlign") = value
End Set
End Property

#End Region

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
If (Not Me.Page Is Nothing) Then
Me.Page.VerifyRenderingInServerForm(Me)
End If
Dim doRender As Boolean = False

If Not Me.Enabled Then
writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled")
doRender = True
End If
Dim tip As String = Me.ToolTip
If (tip.Length > 0) Then
writer.AddAttribute(HtmlTextWriterAttribute.Title, tip)
doRender = True
End If
Dim _onClick As String = Nothing
Dim _attributes As AttributeCollection = MyBase.Attributes
Dim _value As String = _attributes.Item("value")
If (Not _value Is Nothing) Then
_attributes.Remove("value")
End If
_onClick = _attributes.Item("onclick")
If (Not _onClick Is Nothing) Then
_attributes.Remove("onclick")
End If
If (_attributes.Count <> 0) Then
_attributes.AddAttributes(writer)
doRender = True
End If
If (Not _value Is Nothing) Then
_attributes.Item("value") = _value
End If
If doRender Then
writer.RenderBeginTag(HtmlTextWriterTag.Span)
End If
Dim _text As String = Me.Text
Dim _clientId As String = Me.ClientID
If (_text.Length <> 0) Then
If (Me.TextAlign = TextAlign.Left) Then
Me.RenderLabel(writer, _text, _clientId)
Me.RenderInputTag(writer, _clientId, _onClick)
Else
Me.RenderInputTag(writer, _clientId, _onClick)
Me.RenderLabel(writer, _text, _clientId)
End If
Else
Me.RenderInputTag(writer, _clientId, _onClick)
End If
If doRender Then
writer.RenderEndTag()
End If

End Sub

Private Sub RenderLabel(ByVal writer As HtmlTextWriter, ByVal [text] As String, ByVal clientID As String)
writer.AddAttribute(HtmlTextWriterAttribute.For, clientID)
writer.RenderBeginTag(HtmlTextWriterTag.Label)
writer.Write(text)
writer.RenderEndTag()
End Sub


#Region "Rendering"

Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
If ((Not Me.Page Is Nothing) AndAlso Me.Enabled) Then
Me.Page.RegisterRequiresPostBack(Me)
End If
If Not Me.SaveCheckedViewState Then
Me.ViewState.SetItemDirty("Checked", False)
End If

If (((Not Me.Page Is Nothing) AndAlso Not Me.Checked) AndAlso Me.Enabled) Then
Me.Page.RegisterRequiresPostBack(Me)
End If
If (Me.GroupName.Length = 0) Then
Me.GroupName = Me.UniqueID
End If
End Sub

Friend Sub RenderInputTag(ByVal writer As HtmlTextWriter, ByVal clientID As String, ByVal onClick As String)
writer.AddAttribute(HtmlTextWriterAttribute.Id, clientID)
writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio")
writer.AddAttribute(HtmlTextWriterAttribute.Name, Me.GroupName)
writer.AddAttribute(HtmlTextWriterAttribute.Value, Me.Value)
If Me.Checked Then
writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked")
End If
If Not Me.Enabled Then
writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled")
End If
If Me.AutoPostBack Then
If (Not onClick Is Nothing) Then
onClick = (onClick & Me.Page.GetPostBackClientEvent(Me, ""))
Else
onClick = Me.Page.GetPostBackClientEvent(Me, "")
End If
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick)
writer.AddAttribute("language", "javascript")
Else
If (Not onClick Is Nothing) Then
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, onClick)
End If
End If
If (Me.AccessKey.Length > 0) Then
writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, Me.AccessKey)
End If
If (Me.TabIndex <> 0) Then
writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, Me.TabIndex.ToString(NumberFormatInfo.InvariantInfo))
End If
writer.RenderBeginTag(HtmlTextWriterTag.Input)
writer.RenderEndTag()
End Sub

Protected Overridable Sub OnCheckedChanged(ByVal e As EventArgs)
Dim handler As EventHandler = CType(MyBase.Events.Item(CustomRadioButtonControl.EventCheckedChanged), EventHandler)
If (Not handler Is Nothing) Then
handler.Invoke(Me, e)
End If
End Sub

#End Region

#Region "IPostBackDataHandler Members"

Public Overridable Shadows Sub RaisePostDataChangedEvent() Implements IPostBackDataHandler.RaisePostDataChangedEvent
OnCheckedChanged(EventArgs.Empty)
End Sub

Private Function LoadPostData(ByVal postDataKey As String, ByVal postCollection As NameValueCollection) As Boolean Implements IPostBackDataHandler.LoadPostData
Dim grpName As String = postCollection.Item(Me.GroupName)
Dim flag As Boolean = False
If ((Not grpName Is Nothing) AndAlso grpName.Equals(Me.Value)) Then
If Not Me.Checked Then
Me.Checked = True
flag = True
End If
Return flag
End If
If Me.Checked Then
Me.Checked = False
End If
Return flag
End Function

#End Region
End Class

Embedding the control in your aspx page is simple, just register the tag prefix using:
<%@ Register TagPrefix="ucl" Namespace="XYZ.Website" Assembly="XYZ.Website"%>

PS: forget about how to showing the code snippet to embed it aspx page, blogger really sucks when you want to include html tags as is within your post. Basically you set the groupName property and the id property!

Saturday, April 08, 2006

Only yesterday

Recently, I received a mail from dialpad that my account would be cancelled as they are now part of Yahoo!. I used to use dialpad extensively 2 years back with an average of 2 hours per day coupled with like 1 hour on yahoo voice chat. I sure miss those days and it seems like as if it all happened only yesterday, either my life has stagnated since then or somethings are just impossible to forget about.

Thursday, April 06, 2006

Comment of the day

Today Harvinder Pal Singh (aka Kishi) from MS posted his first blog entry on Port25 (MS Linux lab), the post was nothing great but the comment#2 by "Santa Singh" made me laugh & remember the good ol' Santa & Banta jokes :)
"re: Welcome to Kishi's Korner
Thursday, April 06, 2006 8:48 AM by Santa Singh
Paaji,

Oye....welcome to the netta!"

Wednesday, April 05, 2006

Anonymous blogging in corporate world?

The title of the post might sound paradoxical & I just want to touch on the same topic, should you be anonymously blogging about your job/company? NO! don't even think about it, if your company encourages blogging then blog publicly i.e. let your PR dept. know, or don't blog anything specific related to your company (remember a blog is just another website waiting to be discovered). I, for instance blog anonymously, that is no where on my profile or on my blogs you would find any explicity reference to the company I work for, the reason being most of the times I blog about my personal life and how much it sucks with some technical posts thrown in between, and I don't want my private life being discussed at work! You would never find any post on my blog which says how much my work sucks or how I waste away my time in the office by pretending that I'm working (PR dept.: if by any chance you're reading this post then don't take it literally, I am the most sincerest employee you could have ever imagined to find..hee hee). Secondly, there're are very few close friends/family members who even know that I blog (different story if they stumbled on it) and if you're one of those "acquaintances" who just stumbled on it, I would very much appreciate if you keep it to yourself.

Tuesday, April 04, 2006

Latest iTunes additions

This weekend I downloaded few songs from iTunes, here they are with my ratings:
1) Glasses by Slizzy Bob (6/10)
2) Since I don't Have You by Guns n' Roses from the album The Spaghetti Incident (6/10)
3) La Luna by Belinda Carlisle from Runaway Horses (7/10)
4) Heartbeat by Wham! from Make it Big (6.5/10)
5) Skies the limit by Fleetwood Mac from Behind the Mask (7/10)
6) The World I know by Collective Soul from The Absolute Hits (7/10)
7) Afterglow by INXS from Switch (9/10)

All these songs I have listened to long before apart from the exception of Afterglow which just couple of days back I first listened on the MusicMatch Jukebox radio (I was playing Cyndi Lauper and "related artists").

Monday, April 03, 2006

Afterglow

I've absolutely fallen in love with "Afterglow" by INXS from their album Switch , the lyrics are really profound about dealing with a sense of loss in a postive way and remembering someone forever. I also love the background chanting that is there in the song, it just adds to the profoundness. And yes, I never even felt that it's not Michael Hutchence singing, which by itself speaks of their new found lead singer.
Update: Just finished watching the video on Yahoo! Launch (warning, works only in IE), the video isn't anything great but goes pretty well with the lyrics and the mood of the song.
Touch me and I will follow in your afterglow
Heal me from all this sorrow...

Saturday, April 01, 2006

bloglines down?

Is it just me who's experiencing issues with bloglines or is it universal? For most part of the day, bloglines hasn't shown me any new items at all, when I know for sure almost most have been updated. Oh, in case you're wondering what kinda feeds I subscribe to, you can view my blogroll here.

Moving on...

After a long and hard thought, I've decided to switch my job & I'll be joining KSC (Kuwait Oil Company) starting 15th of this month as a Technical Evangelist. I'll be moving to Ahmadi sometime end of this week subject to availability of tickets on Kuwait Airlines, what I really like about KSC is that they have a very open culture and they've got some real cool geeks working for them like Al Bashar Ul-Hussein, the father of CXA (Componentized Xml Architecture) and others. I got a mail from their HR on the 29th of Feb. and since then had 3 technical, 1 HR and 1 religious interview round (the religious round was more or less to ascertain whether you can survive in a Islamic country or not). My primary responisbility would be to help architecting & building the automation framework, which would automate the entire process of extracting oil from the wells to finally shipping them. Given that the TL on this project is Bashar himself, I am really excited to be part of such a team. Hopefully, my next post would be from Ahmadi itself....kuwait am coming!!

Sake and Sushi time

Today was my first attempt at Sake and Sushi and well I feel both of them are passable! I tried a hot kurosawa and a cold Mu with Salmon sushi on the sides, the Mu for sure reminded me of some sweet coconut water that I used to have once in a while when I was a kid. I'll have a Pinot Grigio over these anytime. Aside, if you haven't tried Ethiopian cuisine and are in vicinty of Washington D.C., you should give Zed's a shot, it's simply worth it.

Tuesday, March 28, 2006

ExecuteXmlReader woes

These days I get problems which by no means are "funny" (I brand a problem as funny which is quite challenging and still fun to work on). So the problem is this: given a one-to-many relationship between two tables in Sql Server, generate a one-time report in excel which linearizes (I don't know whether it's the correct term) the entire data in one row for a given main entity. Confused? so was I when I got this requirement, let me try to explain the problem (often times knowing the problem itself means you're half way there!) by giving an e.g. consider two tables Orders and OrderLines, Order table contains the data about the order (let's say the customer name, date entered etc.) and the OrderDetails contains data about the line items in a single order (let's say the product information abt the data that was ordered etc.). Here's a snippet of a highly denormalized (it works for the e.g. that I'm abt to give) design of these two tables in db:
Order:
OrderId int pk,
CustomerName varchar(100)

OrderLines:
OrderId int not null fk_refers_to_Order
ProductName varchar(100).
Here's a sample set of data:
Order Table:

OrderIdCustomerName
1Tada
2Wada

Order Details Table:


OrderIdProductName
1Prod1
1Prod2
2Prod1
2Prod3

The generated report should have output in this format:


OrderIdProduct 1Product 2
1Prod1Prod2
2Prod1Prod3

So how do you solve it, well here's what I did...loaded the data using for xml explicit so that the OrderLines data is rolled up and added to Order node as children. Wrote an Xsl to iterate through the nodes and print them in a csv format and loaded the csv in xls. Different story that I faced quite a few issues with this approach! Firstly, for xml explicity returns the resultset as a fragment (i.e. there is no root node), during ASP/VB days I could add a dummy root node quite easily in the xml template but I couldn't any easy way of achieving it in ADO.Net! The only approach that I found was on serverside.net which added the dummy root node in the for xml query itself. Once I got the XmlTextReader, I loaded it into a dataset with XmlReadMode.InferSchema and used dataset.WriteXml to write the entire xml to a file (I had to follow this approach just to get the entire xml from "for xml" query, the query analyzer always truncates the results if it exceeds certain characters). With the xml file in hand I wrote some quick n dirty (this operation was one time only and hence there was no need to automate the entire process) xsl in cooktop which would save the generate a csv output.
The relevant snippets of code and xsl are below:

XmlTextReader r = (XmlTextReader)cmd.ExecuteXmlReader();
myDataSet1.ReadXml(r,XmlReadMode.InferSchema);
myDataSet1.WriteXml("data1.xml");

Update: Had to remove the xsl listing as it was randomly blewing up my feed! Will put it back on once I figure it out.

Friday, March 24, 2006

Google maps prototype live again

Some time back my free hosted website was auto-deleted by somee.com due to "cpu overuse", now given that I don't have many high-end background procceses running on my site; it was quite a surprise but as they say you get what you pay for! Nevertheless, I've got the site back up and running and reuploading the entire chunk took me some time to figure out as I would get real bizarre configuration errors on the live site.
The Fx page transition e.g. is also back where it originally was and so is the Google Maps prototype, by the way I'd updated the prototype long time back to integrate it with MapPoint, Flickr and Fotolia...and yes, please don't use way too much bandwidth while checking them out :)

Wednesday, March 22, 2006

My tryst with Linux


It's been nearly 6 months that I installed Linux on my laptop, and since off-late I've started booting into it more regularly I think it's a time to post my experiences around Linux (primarily Ubuntu; that's what I've installed).
  • Prep: I used PartitionMagic to create partitions as I've had bad experience with using Linux based partition apps, even though those were the days when Linux had just started way back in 1999 it's always better to be careful: as they say; once bitten twice shy. I resized my ntfs partition & created a physical Ex3 partition and that's where I sc***ed up! I didn't make any FAT partition making it impossible to create a local read/write share between the two OSes (XP and Linux). Moral of the story: Measure twice, cut err partition once!
  • Installation: Went like a charm, almost everything was auto-detected including my WIFI card, as a Windows user you might think what's the big deal, but believe me getting all of the piece of hardware detected and auto-configured is really a big deal in Linux (ask my friends who still are having problems with their wireless card being detected by Fedora and Red Hat). Another thing that I did was to install Grub (a boot loader) onto MBR.
  • First Impression: Ubuntu is gnome based rather than KDE based like it's sibling Kubuntu, hence I didn't get that Windows kinda looks but I've to admit that apart from gnome-panels which look very very dated, I like the look-n-feel of gnome.
  • Applications: Ubuntu comes pre-installed with most of the stuff that you would need on day to day basis like Firefox as web browser, OpenOffice as office suite, Gaim (IM client), xpdf for pdf viewing, gimp for image manipulation etc. so you are almost set once you log in.
  • eXtras: The main reason to install Linux distro was to try out Mono, so I installed Mono and MonoDevelop (IDE for mono) and created a small ASP.Net web page in MonoDevelop. Mono comes with a lightweight web browser (much like Cassini) called xsp and voila the web page ran without any hitches, the only thing is MonoDevelop is still under development (well, so is mono) so you don't get support for code-behind pages yet.



monodevelop

HelloWorld in MonoDevelop


xsp and mono

Xsp and helloworld.aspx


  • Verdict: All in all a cool "geeky" OS but still not user-friendly enough for Average Joe to really give a scare to Windows.

Saturday, March 18, 2006

Url Checker with HttpWebRequest

Recently one of my colleagues came with a problem, where he wanted to check the validity of a url submitted by the user for some reporting tool that he was writing. Since I've had some experience with HttpWebRequest, I asked him to use it to get the response and then check the StatusCode returned, everything was hunky-dory till people started entering Urls for huge pdfs and doc files et al, since the UrlChecker would make a Http-Get call to the Url, it meant getting the entire document from the Url which was putting some unnecessary load on our server. Well, if you just need to check for the validity of a url (i.e. if it's alive or not) you can use Http-Head method to only return the header information. This is how I did it:


    private bool IsValid(string url)

    {

        HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);

        wr.Method = "HEAD";

        HttpWebResponse ws = null;

        try

        {

            ws = (HttpWebResponse)wr.GetResponse();

            switch (ws.StatusCode)

            {

                case HttpStatusCode.OK:

                case HttpStatusCode.Accepted:

                    return true;

                    break;

            }

        }

        catch (HttpException e)

        {

            if (ws != null)

            {

                switch (ws.StatusCode)

                {

                    case HttpStatusCode.Forbidden:

                    case HttpStatusCode.NotFound:

                        return false;

                }

            }

        }

        finally

        {

            if (ws != null)

                ws.Close();

        }

        //dummy return

        return false;

    }

Friday, March 10, 2006

Cooking is not for men

Today while chopping onions for the dinner I chopped my thumb along with it, this is the second time in this week when I have tested the sharpness of knife on my fingers and hence I have come to the conclusion that cooking is indeed not for men, atleast not for me. But given the fact that I don't have anyone else to cook food for me, guess I'll have to keep on trying the knife on my fingers for more time to come in the future.

Wednesday, March 08, 2006

Unstrung words

There are things in life that happen by themselves and then there are things in life that make us strive hard, bend and at times look like a fool. In my experience the things that don't matter to us are the things that happen by themselves but the things that we care about make us go out and achieve them, why is that so? It's because the fears, the doubts and the negative feelings that come along with the things that we care for, because they matter to us we desparately want them to happen: the more you care, the more you fall. And then there are people who appear from nowhere when you're down: good friends, people who are always there to give you free advices, people whom you care about and who care about you....so do you follow your own instincts even if all and sundry think otherwise or do you listen to them and do what they say? well, it's your life and not theirs..you have to know what you want/need and think/act accordingly...I don't need somebody else to screw my life (by following their advices), no thanks..I can pretty much do it myself and be better at it too!
And yes today is the "Women's Day" (not that I care) so wishes to all the women born today and more so to the woman who for me, defines the real meaning of being a woman..happy birthday!

Saturday, March 04, 2006

Google, Yahoo and MSN Search

If you're using Firefox and have HTML Validator extension installed have you noticed that the MSN search results page renders without any error or warnings, whereas Yahoo! is rendered with Warnings (were like 126 for the query that I tried) and Google's got errors as well as warnings? Not that it matters much cause the pages are rendered without any glitches but I feel MSN Search team deserves a pat on their back for generating an error and warning free results page (which as a techie myself, I know is not the easiest to achieve).

bad times are good times...

"bad times are good times to prepare for the better times!"
One of my IM contacts had this one liner as her status message, I absolutely fell in love with it...well off-late, I've been having way too much prep time to my comfort!

Wednesday, March 01, 2006

Web 2.0 Paradigm

Almost every one is jumping on the a.k.a. "The Return of the .coms" bandwangon, basically web 2.0 is all about social networking and thick web clients using some or the other Ajaxian techniques. Given the previous trackrecords of .coms (2000ish, when it went bust), one really has to think the business model behind this all, I was recently reading pretty insightful Russel Beatties' post around the same (aptly titled WTF 2.0) where he raises the same questions which I've been having since long...what's the business model of all these web 2.0 .coms which have mushroomed out of nowhere all of a sudden?

First things first, let's see how web 2.0 differs from web 1.0 (portals was the buzzword then) sites, I see two major differences:
  1. The internet penetration: the majority of people now have faster internet connections like cable or dsl (think abt dialups then), so an Average Joe spends more of his time online.
  2. Social networking: almost all the portals had very little or close to nothing end-user involvement, all the end-user was able to do was read through myriad of information and hence the end-user retention rate used to be pretty low and it wasn't attractive enough for the new user to create an account. Think web 2.0, be it del.icio.us or digg it's the end-user(s) that control the content: I like a news and want others to read, I digg it, liked a website? bookmark it at del.icio.us. Now it's all about sharing your(i.e. the end-user) knowledge, interests etc with the world, the current web apps just aid in orchestrating the information.
  3. Mindset shift: Another differentiating factor is that the Average Joe is more comfortable now in managing a good chunk of his life and time online, for e.g. earlier a lotsa people used to be sceptical abt buying anything online but that number has come down drastically (think iTunes etc.).


Now to the main point, yes web 2.0 have a better user-retention model than web 1.0 portals but where's the cash inflow? Given that the domains and shared hosting is dirt cheap nowadays almost anyone from a college going kid to a homely mother of 5 can start a web 2.0 out of his/her pocket, no problems here, the problem comes when you get popular as Russell points out in his post. You've more requests & users than your shared host can handle, so now either you shut your shop or you invest some chunk of your money into getting a better infrastructure for site. So now we do have a pretty high TCO (good cash outflow without any inflow), so let's try to think of the ways of generating revenue, I can only think of 3 ways that you can generate revenue online and be profitable (not taking into a/c conning a VC to invest), listed below in order of profitability:
  1. An Ad-Free and really free website: See point 4. Examples: 43things, technorati, del.icio.us etc.
  2. Contextual Ads: Sign up for Google Ads or Yahoo! Ads or whatever and hope Average Joe's gonna be enticed enough to click on the ads enough number of times for you to make some good moolah (this might work if you're still on a shared hosting and the investment that you've made is pretty low). Examples: Digg uses this model by the way, this can't be their only revenue model, given that Alexa rates it among the top 500 websites they gotta have more than 1000....(fill in the remaining 0s) users which can't be supported on a shared hosting.
  3. Sell something: Needn't be a physical product like amazon or ebay sells, could be some advanced features or goodies of your website. Example(s): flickr.
  4. Wait for a bigger fish to swallow you: Given that some bigger fishes like Yahoo! are buying almost everything under the .com sun, build something niche (actually needn't be that niche either), get a good user base to boast off and start approaching bigger fishes whom you think might be interested in your thingie. There are few caveats with this though: first define the exit criteria pretty clearly, what if no fish takes the bait? then either be prepared to wait and shell out more from your pocket or shut your shop quietly (online users generally have a short memory span, they'd forget you and move on). Generally, the bigger fish would be more interested in buying "a company" which can exist on it's own than buying just the idea (ie your website & perhaps you), so point 4. is indeed your exit strategy then you might indeed have to look at conning VCs ;-). Think off the bigger fishes which might be interested in your kinda app upfront and define the technology platform based on that for e.g. it would be tough to sell a Java/Apache/PHP/Linux based web 2.0 app to Microsoft and equally tough to sell ASP/.Net/SQL Server based website to Yahoo! or Google. Examples: flickr, webjay, upcoming.org, orkut etc etc etc.

The straw that broke the camel's back...

Ever since 2002 or so I've been having some pain or the other in my back, earlier it used to affect my lower back but since past one year it has happily shifted to my upper back (I don't how that works but the lower back is pretty much alright these days but the pain in the upper back has increased multi-folds to a point where sometimes it's just way too much to handle). I think the pain can be attributed to wrong (and long) sitting postures, esp. now that I work primarily on a laptop which means your head is not in line with the screen and you have to bend down to view the screen properly...that's why I feel it's imperative that you should use an external monitor and/or keyboard with the laptop to make sure the alignment of the head & the screen is pretty much in the same straight line and hence avoiding the bending down business all together. Recently, a friend of mine underwent a keyhole surgery on his back for perhaps the same issue which has got me to think seriously about visiting a doctor too. Given how much I "love" visiting doctors and taking pills, it's quite obvious why I had been avoiding it for so long, I am hoping that just like the pain shifted from lower to upper portion, one fine day it would just shift further up to a point which doesn't affect my body any longer.

Friday, February 24, 2006

Estranged

The first time when I heard Guns n' Roses' Estranged, the following piece of lyrics caught my mind:
old at heart but I'm only 28,
& much too young to love break my heart.
young at heart but it's getting much too late,
to find ourselves so far apart.

I was in my early 20s when I first heard this song & for some reasons I always remembered these lines. Now that I'm 28 (brand new year, same old life!), I wonder if there was any reason why I remembered them for so long...and it seems to be quite obvious.

Saturday, February 04, 2006

the art of communication

Communication is a very funny thing and it can make or break almost anything, be it a sales pitch, a job interview or a relationship. It's not just about what you say but also how you say it and most of the times it really doesn't matter what you infact implied but how the "other person" understood it. Think about this statement: I want you to atleast meet me once before you go. What do you get from this statement? when I wrote it I meant that of all the things that I expect you to do before you go, meeting me once is one of them. Now let's rephrase the statement a little bit by playing around with the placement of the word "atleast", here's the reordered statement: I want you to meet me before you go atleast once. Whoa! the entire meaning of the statement changes dramatically, now it's like I want to meet you atleast once (or more) before you go : atleast that's what I meant before I wrote those statements.
Given that talking over the phone is one of the most prevalent forms of communication, where all you are spoken words to put your point across, it gives even more chance for the other person to read between the lines and make a completely other judgment. Perhaps this hazard is not so much in chat, e-mail where you have time to think twice and mostly words don't have to be im-promptu and also not so much of an issue when you are talking face to face where the other person & even you have the luxury of reading each other's facial expression. I feel it's imperative that while talking we don't hold back our doubts and try to get them cleared up by asking upright honest questions if we feel there is any scope for misunderstanding...most of the talks fall out more due to misunderstandings than all other reasons combined together.
I still remember what my brother used to told me long time back: communication is not what you say, it's what the other person makes out of it.

Friday, January 27, 2006

Implementing page transitions in Firefox using AJAX and CSS

Page is a feature in IE which allows you to add visual effects on your site using filters when a user enters or exits a page, the problem is that filters are IE-only. What if you want to add same transitions on your site for users who are visiting on Fx? You can emulate some filters of IE by using and CSS on to achieve the same results, here is a simple way to achieve fade-in transition in Fx for page exit:
Instead of redirecting user to second page directly (using links or JS:location.href), retrieve the second page contents using XmlHttpRequest, once the httpRequest has retrieved the contents of page 2, add a timeout function where in you reduce the opacity of the page by steps. Once the opacity falls below a certain value, do a document.write of page 2's response text. Here is the piece of JS code:

var xmlhttp;
var timerId = 0;
var op = 1;
function getPageFx()
{
url = "/transpage2.html";
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
xmlhttp.onreadystatechange=xmlhttpChange
xmlhttp.open("GET",url,true)
xmlhttp.send(null)
}
else
getPageIE();
}

function xmlhttpChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
{
// if "OK"
if (xmlhttp.status==200)
{
if(timerId!=0)
window.clearTimeout(timerId);
timerId = window.setTimeout("trans();",100);
}
else
{
alert(xmlhttp.status)
}
}
}

function trans(){
op -= .1;
document.body.style.opacity = op;
if(op<.4){ window.clearTimeout(timerId); timerId = 0; document.body.style.opacity = 1; document.open(); document.write(xmlhttp.responseText); document.close(); return; } timerId = window.setTimeout("trans();",100); } function getPageIE(){ window.location.href = "transpage2.html"; }

You can see this code in action here.

Monday, January 23, 2006

Code sample: success algorithm

a c# snippet:
//initialize the variables, experience effect is generally the same
int const experience = 1;
int success = int.MinValue();

while(success!=100){
//the chance factor is best left unhandled, also includes the time
int chance = Random.Next(1,100);
try{
effort = 99 - chance; //reduce the effort effect based on the chance factor
//experience can at times help you, at times go against you and times doesn't help at all!
success = effort + chance + Random.Next(1,-1)*experience;
}
catch{
//oops we blew up somewhere..try again
}
}
//we are done yippie, time to introspect...
wasItWorthIt();


so basically either you finally hit the wasItWorthIt stage or you hit a stack overflow exception, good luck :-)

Saturday, January 14, 2006

few things about firefox you didn't know

I really like , apart from it being a really memory hungry beast it's almost perfect with everything that it does...but the documentation of Fx is something which I would say is far from being comprehensive so mostly you have to find stuff on your own. few things that I've found are:
a) Many a times you want to search using the search box without leaving the current page, well go to search box (ctrl-k), type in your query and hit Alt-Enter & viola the results open in a new tab. You can also pick the search engine by using the keyboard (press Ctrl-Down/Up Arrow key). There are tons of search engines to choose from in case you are not satisfied, try http://mycroft.mozdev.org.
b) How do you open a Url on a page if it is not hyperlinked for e.g. the mycroft link above, you don't have to copy the Url, open a new tab & paste the link, just select the link with the mouse and drag it to the tab-bar or to one of the opened tab.
c) File-Exit, is different from Alt-F4 or Close Window. It exits Firefox completely including all open Fx windows (download manager, other Fx open windows included).
d) How many times you would wish that Fx would automatically authenticate you against a given server much like the way IE does? Don't fret there is way for that too, in the location bar type in about:config , in the filters type ntlm and dbl click network.automatic-ntlm-auth.trusted-uris, type in the name of servers for which you want to be automatically authenticated separated by comma and you're done.
e) [01/17] With Fx 1.5 the javascript console started showing CSS errors as well, though this is a great debugging feature at times I would find it cluttering my console when I wanted to see what js is blowing up my code well any one else who always felt the need to be able to filter the console errors/messages by type (like JS, Css, Xml etc) there is this real nice extension, try it out:
https://addons.mozilla.org/extensions/moreinfo.php?id=1815&application=firefox

later...

Sunday, January 01, 2006

2006

another new year...building new hopes, new dreams and making older dreams come to life...by the way there is no such thing as false hope/dream....hope and dreams are good things infact they are the best things & good things in life never die...a beautiful Richard Bach line comes to the mind from his book Illusions: "You are never given a wish without also being given the powers to make it to come true"...you might have to work for it though.
Anywez wishing you all a happy new year, hope 2006 gets you one more step closer to your destination.

Friday, November 25, 2005

My player's fav songs

today I just put my IRiver on shuffle mode and the first 10 songs that it picked were:
  1. Hunting High & Low - a-ha : This is my these days favourite song, earlier I used to rate this song as one of a-ha's not so great songs but after paying attention to its lyrics I guess I've been wrong all these years.
  2. Always on my mind - Pet Shop Boys: I've very fond memories of this song, perhaps this being the very first english song that I loved when I started listening to english music way back in late 80s.
  3. Hysteria - Def Leppard: I really like the guitar riff in the song and Elliott's husky voice.
  4. Scarborough Fair - Simon & Garfunkel: Amazing ending bit: "generals order their soldiers to kill & to fight for the cause they've long ago forgotten...", do I need to say more?
  5. I Remember Mary - Bad Boys Blue: Used to like this song once, pretty techno types..
  6. Carrie - Europe: Another one abt which I've pretty fond memories, imo this is Europe's best number by far, even better than "Final Countdown".
  7. Strangers of the heart - Heart: Heart at their best, Heart is def. one of the best female rock bands of all times in my book.
  8. Private Universe - Crowded House: If you haven't heard this song, you are missing something."it's a tight squeeze but I won't let go..."
  9. You & Me - Modern Talking: nice romantic number, recommended for any 80s lover.
  10. Brown Eyed Girl - Van Morrison: nice fun song with cool guitaring.
Surprised that my player didn't find Moody Blues good enough, not even a single song by them in the first 20 song that it has played so far....

Wednesday, November 16, 2005

difficult choice?

Sometimes in life we come across a stage where we have to choose between two paths and we see walls in front of both of them!
Beyond one wall we see (what we see might not be what is reality) a world that we want to live in & beyond the other we see a world which doesnt really matter to us...So which one would you rather break your head against?

Saturday, November 12, 2005

the power of rss/atom

few days back I'd posted about various online rss aggregators that I use or have used, today just stumbled upon one more: Netvibes, have to admit that it's the best one that I've come across till date! They have nice integration with GMail and surprisingly even have Hindi as one of the languages. I generally use rss aggregators to get all the news that I'm interested in at one central place, below is the (partial) list of feeds that I have on my start.com page, feeds that I would recommend most:
1) Endgadget: News about latest gadgets and gizmos.
2) BBC Front Page
3) Boing Boing
4) Slashdot: News for the nerds, one of my favorites!
5) Daily Dilbert: I always liked Dilbert comics.
6) Quote of the Day
7) Some feeds from rediff.com to get local news.
8) Eric Gunnerson's C# Compendium
9) Google blog
10) Yahoo! search blog
11) Weather news
12) "How To" of the day
some blog feeds from my friends and family members + lotsa more...

Thursday, November 10, 2005

DRM and Sony (suck)

For guys who are preachers of buying only "legal" music (including me) here's an interesting story about the DRM (Digital Rights Management) gone way too far, Sony-BMG have been marketing "Digitally Protected" CDs which restrict the number of times the CD can be ripped (ability to convert into mp3s or other digital format), though the fact that a CD is digitally protected is made evident on the jewel case, what they don't tell you is that putting the CD into the drive would also install a root-kit (a special kinda malware which uses some cloaking technique to hide itself from being listed in tools like task-explorer and windows explorer), not going into the nuances of what does that mean for the end-user it basically is one of the crappiest thing that could be done to a customer (if you are really interested in the nuances, check this link).
This particular action by Sony has made me lose all respect that I once had for Sony as being the "nice" company & from now on will definitely think twice before going for a Sony product!
Also, I feel DRM in it's current form itself has lot to improve on, if I am paying for some music I should be able to play it on all the devices that I have including my CD Player, computer(s), pocket pc, portable player and whereever else I want to play it as long as I am not illegally distributing it to others. Think about it this way the guys who use P2P clients to download music don't have any restrictions on copying the files around and generally get a much better bitrate (read audio quality) whereas people who use iTunes or any other DRM protected website to download music legally or pay for these new "Digitally-protected" CDs end up having to deal with all these restrictions. So to me it looks like the RIAA itself wants the music lover to use the P2P clients and other pirated way of getting music rather than going the legal channel and having malware installed on the system which can't even be removed!

Monday, November 07, 2005

growing old

just today discovered a grey hair on my head which reminded me that I am 27 years (nearly 28) old and still clueless about where life is headed!

Sunday, October 30, 2005

contradictions

I've always wondered about the inherent contradictions between two old sayings about using our past's experiences to make a present decision. One says that we should learn from our past experiences and mistakes whereas other one says: "don't let your past experiences and fears come in your way". I still don't know which is correct but second saying seems to be tougher one to follow. I feel it is nearly impossible to decide without thinking about the past and even more so if the present situation seems so close to a situation we've already been before. But isn't that what life is all about? full of contradictions, full of unexpected events and people whom we thought would never do things they did?

Thursday, October 27, 2005

My Yahoo or Google Home or start.com?

I've been using My Yahoo! since long to aggregate the information from the web on one personalized page and if am not wrong about 2 years back it was one of the very few sites which would allow you to aggregate content (then it was only limited to information from various Y! modules). With the advent of RSS/Atom it has further improved it's aggregation by allowing you to add rss feeds too & given the popularity of RSS feeds even other companies have jumped on the bandwagon including Google and Microsoft, MSN even has a nice screen screensaver which shows you the feed titles with post entry as tooltip in a screensaver. I've tried these 3 and honestly speaking for change MS' start.com is an outright winner, with Google perhaps second and My Yahoo! being at the bottom. So what makes start.com so good? well it's something that Google brought back from hibernation: AJAX. start.com has got one of the best implementations of AJAX, allowing you to even view the entire feed without having to leave the start.com site something which both My Yahoo! & Google lack, one good thing about Google & My Yahoo! though is it shows you your email information which I find to be pretty helpful given that I have yahoo! & gmail accounts. If you are really looking for a nice web aggregator and have a newer version of IE or FF then you would never regret having start.com as your home page.

Wednesday, October 26, 2005

Bless thy rings...

Few days back my ex-colleague and friend Avinash got married to Chaitra, having known him since 2 years I am certain it would be a pure joy for anyone to have him as her life partner. I wish the newly weds a happy and memorable journey together.

Saturday, October 22, 2005

wrong decision?

sometime back I had written a post in which I said there are absolutely no right or wrong decisions, a decision is a decision nothing less, nothing more. So then why do at times decisions which seem to be correct give undesired results? and should we never put any thought process before making a decision? well, a decision is still a decision but we need to see what prompted us to take that decision, what was the situation which made us take that decision. What does all this mean? Let me give one example: If I decide today to jump from 13th floor, I don't think it would be a wrong decision but if I decided to jump believing that somebody would break my fall then yes the pre-cursor was totally wrong and this case the decision that was made would give wrong & painful results. The only problem is most of the times pre-curors to a decision are not so obvious as the one that I gave in my e.g. and add to that our egos and emotions and you've got some real snarls to deal with. Remember, every event and person in our lives is not what it is, it's what we perceive it as, we always see everyone/everything through the lense of our egos & feelings and always try to project ourselves onto that person or thing subconsciously. coming back to the decisions, we always want to believe that our decision is the right one and we try convincing ourselves that that is the case, by perhaps asking people who are close to us for their opinions. here again, remember any person no matter how close he is to you, will give advice based on his perception, egos and priorities which might not be your perception and/or priorities....so the bottom line is to think about the pre-cursors before making a decision based on your priorities & perceptions and then have no regrets...remember there is nothing by luck, nothing by chance.

Google Maps Prototype

Nikhil Kothari's prototype of Virtual Earth got me interested into trying something similar on Google Maps. Using Google Map APIs is not at all tough once you get a hang of it, the only issue is with writing javascript, css which is cross-browser specific. As of now my prototype doesn't use any server side code. Everything is done on the client browser including xsl transformation..learnt it the hard way that xsl transform is handled in a different way in Ff(better) than in IE (crappy)! My first stab at Google Map can be seen at http://sachiniscool.somee.com/default.html..right now I have posted some pictures of Atlantic City, DC and Louisville that I took after downsizing them...comments/complaints are welcome.

Sunday, August 14, 2005

away from here...

Like the rose that blooms in the wintertime,
as it reaches up through the snow.
The more life keeps us apart,
the more love will grow.
Like the seed that grows in the darkness,
as it reaches up to the sun.
I will always reach out for you,
cause you are the one.

As I cross the bridge by the waterfall,
as I make my way by the stars.
There's a shadow walking beside me,
here in my heart.
Like the restless wind in the tree tops,
like a whispered voice in my ear.
I will always be there for you,
I'll always be.

In a far off wonderland;
that flashes past my eyes,
the kiss of inspiration that was mine.
The dust of many centuries;
has blown across this land,
but love will not be scattered like the sand.

Like the sunrise over the mountainside,
like the bird that has to be free.
There's a part of you that will always be
part of me.

I bless the wings that bring you
back across the shore.
If I could touch you now my darling
And love you just once more,
If I could hold you...
I know you'd understand,
I know you'd understand,
I know you'd understand.

Monday, August 01, 2005

one and one still is one

Haven't blogged for a while so thought I should be writing a small post about my life and it's whereabouts (i.e. the direction), basically life is going a little here, a little there and net net nowhere & I don't see any light at the end of the tunnel either. Everything except life (which leaves nothing in the "except" list) is going on pretty darn (just recently got hooked on to this word) well...very very upset, bugged, crossed.....(fill in the adjectives) with myself!

Saturday, July 09, 2005

Firefox vs IE


I made a switch to FireFox as my main browser long time back due to IE's vulnerabilities which installed spyware on my Win 2000 system without my knowledge. FireFox has generated quite a stir among people who were long waiting for an alternative to IE and it is quite impressive with Tabbed-browsing, live RSS reader, search toolbar and loads of extensions which make it quite slick. MS made a lotsa changes/upgrades to IE with Win XP SP 2 to make it more secure with built in popup blocker and an Add-ons manager which allows you to view Add-ons installed in IE. Judging by people's reaction on the net on FireFox v.s. IE, I feel most of them are totally biased towards FireFox cause it's a non-MS product and competing (more than 69,535,583 downloads till date) in a area where MS long held monopoly. FireFox is considered to be more stable and more secure than IE which I agree to somewhat but saying that FireFox is more secure and stable than IE (with Win XP SP2) by leaps & bounds is a mere exaggeration. Stabillty: My FireFox has crashed more often than IE over past few days (those who don't believe me should try http://games.yahoo.com or http://193.151.73.87/games/lemmings/index.html). I know Yahoo Games is more of an issue with JRE rather than FireFox but still for a not so tech-savvy end-user, it's FireFox which crashes whereas IE renders the page without any problem. The DHTML Lemmings game also loads perfectly in IE whereas it freezes Firefox(1.0.4).
Security: I think Firefox is 100% secure is again not correct, no browser is 100% secure, Secunia (www.secunia.com) published 3 vulnerabilities for FireFox (2 of them were across all browsers includng IE). It's just that FireFox is relatively new and hence hasn't attracted the Hacker's attention yet.
Also one has to keep in mind from end-user's perspective is that there are lots of sites which rely on features only supported by IE like ActiveX controls (www.dell.com is one such site apart from MS own site).
Verdict: If you don't have Win XP 2 installed I would suggest FireFox is definitely more secure choice, on Win XP 2 I don't think there is much difference between the two browsers in terms of security and stability, make a switch to FireFox if you can't live without tabbed browsing and live RSS reader and some cool extensions like AdBlock.
Food for thought: Would FireFox have received such rave reviews from the community had it been a MS product? I guess not...

Sunday, July 03, 2005

Wish you were here..

I've always wanted to see a live concert of one of my favorite bands/singer but somehow or the other always have missed on the opportunities: last year in May end The Moody Blues performed at Louisville and my flight tickets to India were booked for a week before that, then this year Mark Knopfler performed in Bangalore and I again had to leave a day before to Hyderabad. But the grand-daddy of them all Pink Floyd (not just David Gilmour but Gilmour, Roger Waters, Nick Mason and Rick Wright) performed Wish You were here today for the LIVE 8 show in London (well I would have never made it there) which while surfing channels on TV, I somehow stumbled upon and man were they awesome? you bet they were! Gimour and Water are like cult figures when it comes to rock music and I really envy the people who had a chance to see them perform live after so many years.
Hopefully one fine day I too would get a chance to see either The Moody Blues or Pink Floyd or MK live in concert.

Tuesday, June 28, 2005

Year passes by..

yeah I know it's still mid of 2005 but today would mark exactly one year since I met someone for the last time...seems to be long time huh? believe me it seems way too long than one year.

Sunday, June 19, 2005

Waltzing Matilda

Guess I got up on the wrong side of the bed this morning and have been feeling pretty low; not that I've been feeling great off-late but since feeling low is also relative, today has been particularly a bad day. Did nothing today except watch one Adam Sandler's movie: Happy Gilmore, listen to some music(80's stuff) and cook lunch for myself (made egg-korma, the easiest and the safest thing to cook: not much scope of spoiling it, the only thing that perhaps you can get wrong is salt. Ate bread-toast for dinner as had no mood to cook). Happy Gilmore is a no-brainer light movie abt a hopeful Hockey Player who turns a pro Golfer to save his Grandma from being evicted, something that Adam Sandler marvels at, his other 3 movies which I saw off-late: The Wedding Singer (with Drew Barrymore) and Anger Management (with Al Pacino), were also more or less the same with Sandler at his comic best.

Apart from that the day for me has been pretty much murky, I know a lot of people have told me that I cling to the past for too long and don't move on along with time..I really don't understand what they mean by moving on, does it mean stop thinking, stop feeling, stop dreaming, stop hoping, stop doing what matters to you most? If that what moving on means then yes I would never move on with life, I would never stop dreaming, never stop feeling and having lived my life for 27 years I really don't think it's possible for me to change now anyway.

Tuesday, June 14, 2005

Bharwan Bhindi

Bharwan (hindi): Stuffed
Bhindi (hindi): Lady's Finger or for the ppl. with "Americonish" accent- Okra!
Bharwan Bhindi: Stuffed Lady's Finger/Okra.
People who know me well know that I just love bhindi in any form: even half cooked bhindi seems pretty good to me. So today I thought of trying out my oh-not-so-great culinary skills and decided to prepare my version of Bharwan Bhindi. The recipe was more or less mine & knowing how good I am taking shortcuts I didn't stuff the bhindi with masala that I prepared but added it along with the bhindi. In the end it came out pretty fine though turmeric and chilli powder were a little on the higher side...anywez I was pretty much pleased with my preparation & hopefuly one day would make it for someone special (no prizes for guessing who!).

Saturday, June 11, 2005

I've got a secret....

http://postsecret.blogspot.com ...what's your secret?

Thursday, June 09, 2005

Open source

On my system I decided not to install any "pirated" stuff, so thought I should give some open source/free softwares a try, here's what I have on my system : -
  • OS: Windows XP Professional (I am very tempted to install Debian Linux also; just pushing it back as I only have 40GB HDD, perhaps I should look at installing Linux on External Hard Disk).
  • Web Browser: Mozilla Firefox, firefox wins over IE in leaps & bounds. It's more lightweight (only 4.7MB installer), more stable, and above all keeps spywares and those annoying pop-ups away (more so with Adblock extension installed). I was very very flustered with IE after getting idiotic pop-ups even after installing Google/Yahoo pop-up blocker (servustats.com is one such site for instance on which the Google/Yahoo pop-up blocker fails) . I think the other reason why lotsa users are switching to Firefox from IE apart from the above features is due to the fact that Firefox's look & feel and keyboard shortcuts are more or less similar to IE which makes transition pretty simple.
  • Development Tool(s): MS C# 2005 Express Edition CTP, Web Developer Express Edition CTP. I love .net and all those folks who think Java is better than .net, I think both are good in their own way. (aside: I would love to install Mone once I get Linux installed, it sure seems promising!)
  • Database: Sql Server 2005 Express Edition CTP (new avatar of MSDE).
  • Office suite: Open Office 2.0 Beta, another cool open source app with backing from Sun. I have been able to open all MS Word/Excel 200x documents in Open Office w.o. any loss of formatting. The only drawback is that even though OO Base opens MS Access files, it doesn't allow you to save it back, you can only save it in Oasis format (some open source frmt). Also the look and feel of Open Office is very much like MS Office making it pretty easy to use for MS Office users.
  • Email Client: No prizes for guessing, has to be Mozilla Thunderbird with Calendar extension installed :-). It has pretty strong Junk/Spam filter which you can make better by training it. The biggest drawback is that the keyboard shortcuts don't map to Outlook or Outlook Express so Outlook users have to search for Keyboard shortcuts! Though it does a good job in synch-ing Tasks/Events from Outlook (which I use in the Office).
  • Anti Spyware: MS AntiSpyware, guess it's the best though I would also recommend Lavasoft.
  • MP3 Player: MusicMatch Jukebox basic with DFX installed.

Monday, June 06, 2005

Isn't life strange?

sometimes life just goes in one direction and the harder you try to change it the further it goes in that direction. Off-late I've learnt that at times not doing anything is better than trying to do something to change things. I guess it's alright to let life drift sometimes and let it go where it has to go. Last one year has been really crazy and today was the day which started it all.

Friday, June 03, 2005

Life, what is it but a dream?

Even if you don't believe in astrology you have to read this article by Kevin Burk on Neptune being retrograde, it's got the mix of astrology, metaphysics, quantum physics and a bit of philosophy et al. Didn't you have a sense of deja-vu?

Tuesday, May 31, 2005

Fate or Luck?

Isn't it funny that everytime something bad happens in life it's fate & everytime something good happens it's luck? Isn't anything supposed to happen good in life by fate?

Thursday, May 26, 2005

Time

One of the funny things that I find about life is whenever you are doing something "trivial" (trivial things vary person by person: for some watching TV might be trivial whereas for someone online chatting might be) you get the guilt feeling that you're wasting away your time and perhaps you should be doing something worthwhile, the problem atleast with me is if am not doing the "trivial" stuff I dont even know how to kill time. Anywez all the gyaan apart here are few things that I do to kill time when I'm not working these days:
a. Read books (I don't consider this to be at all immaterial, I *think* reading opens your mind).
b. Play minesweeper (I owe this to Subbu who got me hooked on to this crap).
c. Play TextTwist on Yahoo! Games : This is my new found interest.
d. Listen to music: I love music.
e. Aimlessly watch TV.

More or less that's how I kill my free time, I am still trying to figure out though who is killing who!

Friday, May 20, 2005

and when all the wars are done...

Sumit wrote this excellent review on Ruskin Bond's "Time Stops at Shamli" at mouthshut.com (http://www.mouthshut.com/review/Time_Stops_at_Shamli_and_Other_Stories_-_Ruskin_Bond-70645-1.html). Very very recommended if you haven't read Ruskin Bond's work yet.

Thursday, May 12, 2005

Unit Testing with nUnit

In case you're into unit testing: TestDriven .Net(www.testdriven.net) is an addin for VS.Net which allows running of nUnit test cases from within the IDE without having to run the nUnit GUI. A nice tool which saves you a lot of debugging time along with nUnit. Another add-in which is a must have atleast for VS.Net 2003 and below is Resharper (http://www.jetbrains.com/resharper/), makes refactoring a lot more easier.

Dot Net (.Net)? Not Yet

UPDATE: I've posted the VB.Net code sample in another post.

Off-late I've learning quite a few things about .net (mostly asp.net) the hard way (actually that is true as of now for almost everything in life). Anywez here are few more things that I found out.....
One of the requirement in this project is to show a list of RadioButtons within a DataGrid (could be a DataList or Repeater for that matter). Now the user gets to see the list of conferences in a grid and he can choose one (only one) from that list. So basically all I had to do was define a templatecolumn in the grid, include a RadioButton within the template and give it a groupname (the groupname ensures that the radiobuttons rendered are mutually exclusive). Seems to be a 5 mins job but guess what? I did exactly the same and when I ran the code, I could select all of the radio buttons within the grid at the same time. I checked the source html and found out that all the radio buttons rendered had unique names, thought I did something wrong so I debugged and debugged but couldn't figure out what was wrong so I resorted to my ol' faithfull friend: Google and voila MS has confirmed it to be a bug (http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316495)! (aside: while typing I sowehow lost the entire content after this so have to type in everything again!!, very very bugged!). Googling further I found a workaround on CodeProject, the code basically creates a custom RadioButton which derives from the RadioButton and overrides Render method to ensure that same html name is rendered (using the GroupName property) and implements IPostBackDataHandler to persist the state of attributes on postback. The only problem was that the code was in C# and my current project is on VB.Net, converting C# code to VB.Net or vice-versa is a pretty trivial matter and generally does not take more than a minute per line of code or so I thought! this is where I learn another subtle but very big difference between C# and VB.Net, though C# allows you to re-implement an interface(in my case IPostBackDataHandler) already implemented in the base class (RadioButton), VB.Net does not and generates compile time errors!
(end aside) I really don't understand why such a feature would be only supported in one language and not another when MS is pushing both the languages equally now!! So this option was also ruled out but not to be deterred I thought of inheriting the custom control from one level up than RadioButton and then perhaps I could re-implement the IPostBackDataHandler well no luck, cause RadioButton inherits from CheckBox which actually implemnts the interface, so had to go one more level up: WebControl..now creating a RadioButton by inheriting from WebControl is no trivial matter..that's when suddenly a tool amazing tool called Reflector(www.aisto.com/roeder/dotnet/) came to my mind, basically Reflector allows you to reverse-engineer .Net Assemblies. Downloaded it and installed it and reverse engineered the code for radiobutton and checkbox and with few tweakings here and there, I had my custom radiobutton control ready which were mutually exclusive when placed within the grid or for that matter any container which implements INamingContainer in VB.Net! And am I pleased about my feat, you bet.

Saturday, May 07, 2005

A tech post at last!

ASP.Net 1.x flames:
I've been working on a asp.net web-site project which has to be cross browser compatible (it is supposed to support IE 5.x+ and Netscape 6.x+) and it is something which I never had chance of working on before on .net. Few things that I found out, the client side validation for asp.net validation controls don't work on Netscape or for that matter on any other browser except IE! (including Mozilla & FireFox) not that these "new" versions of mozilla based browsers don't support the latest Javascript standards but it's due to the way these validation controls spit out Javascript which is very very IE specific (and that btw doesn't follow any standard!). First of all the client script by these controls is only thrown if the browser is listed in Machine.config as a "supported" browser (even though mozilla based browser do support latest JS standards, the config file only has IE listed). Second problem is the way WebUIValidation.js is written which uses document.all (a feature only supported by IE, the standard is to use document.getElementById) to find a control on the form. Fixing these two is easy but that doesn't make the client script validation run on mozilla based browsers! the biggest problem is the little script block that is emitted by the base validator control (all the validation control extend it) on the OnRender event, which again uses document.all! So basically it's impossible to add client side validation for non IE browsers unless you're willing to extend the base validator control, override its OnRender method and write validation controls which extend from the custom validation control!
Second thing that I hate about ASP.Net 1.x is the Postback feature, I think GMail revolutionized the way postbacks are handled by using remote scripting. It's really illogical for the entire page/form to post itself back if the user changes a value in a dropdown list (can you believe it ASP.Net also has a server event for TextBox.Text_Changed, imagine the user typing a character and the page posts back, nice way of making sure that the users don't visit your site ever!!!). The good news is that MS has finally woken up with ASP.Net 2.0 and most of the control support remote script callbacks for e.g. the GridView (successor of DataGrid in 1.x) uses remote scripting to refresh the grid for sorting/paging. ASP.Net 2.0 uses XmlHTTP for remote scripting and the irony is all Mozilla based browsers have XmlHTTP built in whereas in IE 6.0 you have to use an ActiveX control. Hopefully IE 7 would have XmlHTTP implemented w.o having to use ActiveX and praying users would lower their security settings to allow ActiveX controls so that the page can function properly....MS are you listening?
Apart from the flames read a nice article on Google vs MS (http://www.fortune.com/fortune/technology/articles/0,15114,1050065-2,00.html) and the popularity of GDS, infact I myself am trying to build a plug-in for Yahoo!IM Archive: more or less there just have few frills to add..hope to have it rolled out at Sourceforge by next week some time.
PS: When would google wake up and add Category support for blogger?

Friday, April 29, 2005

Thunder Over Louisville

April 23rd was Thunder Over Louisville, I remember the last year when I was there with Chhavi. Had some amazing time over that weekend (thanks to Debbie, btw talked to her couple of days back, was a nice feeling). Just went down memory lane today thinking about the event and that weekend...
Posted by Hello

Sixth Sense

Recently watched the TV show "The Mysterious world of Alain Nu", Alain Nu (www.alainnu.com) is a mentalist with very strong ESP. Some of the things that he performed on the show were: (a) He hands out a deck of cards to a volunteer, who shuffles and re-shuffles and re-shuffles, Alain takes 15 seconds to "read" the ordering of the cards by looking at them and then tells the cards in exactly the same order as they were stacked first from top to bottom and then from bottom to top! Atleast I can't memorize 52 cards' order in 15 seconds. (b) He hands over a deck of cards to a volunteer and him to call any two digit number (volunteer calls 22), asks another volunteer to calls any card (the volunteer calls 9 of clubs) and voila the 22nd card turns out to be indeed 8 of clubs (he doesn't touch the cards after the volunteers have made their choices). (d) He bends metal spoons w.o. even touching them by just moving his hands around the palms of the volunteer who has the spoon within them (c) Another one: He has 2 clean slates and a piece of chalk, he sandwiches the piece of chalk between the two slates and asks a volunteer to think of the name of a person and behold the name was written by an invisible hand even though the volunteer never said it aloud! There were quite a lotsa feats which were quite unexplainable by using "normal" logic and laws of physics. Almost all the feats that Nu performed were mentioned in Brunton's book "A Search In Secret India".
I know the first thing that comes to the mind after watching such "magic" feats is that it's just a magician's trick or an illusion. Is it really an illusion or the fact that since childhood we've been taught to use only 5 senses and anything which cannot be felt by one of these sense makes us call it as an illusion, just because we can't feel these things doesn't mean that they don't exist. Why do we have at times such a strong sense of deja vu? Why do we at times feel positive vibes when we meet someone for the first time and sometimes vice-versa? I think at times it's good to put aside the laws of physics and "normal" logic to understand certain things and events that happen in our lives, remember that all laws of physics are based on assumptions!

Thursday, April 14, 2005

One year with Blogger.com

It's been one year since I've been blogging at blogger (seems to be a long time!) and am more or less pleased with the service that they provide..yeah it's a little lame when compared to other blogging site like weblogs but blogger.com is actually meant for not so tech-savvy bloggers. Few things sure need revamp: features like category support, a calendar with links to the dates you've blogged (I really like this thing in MovableTypes/weblogs), better commenting system etc. apart from that the interface is pretty decent and you can change the look n feel of your blogs with skins and has now pretty nice support for posting your pictures using Picasa. Life has changed a lot over the past one year since I started blogging which I think is reflected in my blogs over the time; they have been less tech-centric and more focused around my personal life not that nothing is happening in my professional life it's just that it doesn't matter to me any longer.
Started reading An Ordinary Person's Guide To The Empire by Arundhati Roy, hits you right between the eyes kinda book, should be able to finish tonight.

Monday, April 11, 2005

Good decisions, bad decisions

Off-late something has got me thinking: what is classified as a bad decision and what is classified as a right decision? Is it that if the outcome is good then it is a good decision and if it is not then a bad decision? or is it that if you do what others would have done then it is a right decision else if you decide to back your own instincts and do what you feel is correct then it is a bad decision? Well, according to me no decision is right or wrong at its face value, we generally tag a decision as bad or good based on the results, since results are the future events while you are about to make a decision how can you know the result? so I feel that no decision is right or wrong, yes you can perhaps make more "sensible" decision by following what "others" who were already in the same situation did. I've a problem with following "others" too, everyone has a different set of priorities in life, everyone has different endurance levels and everyone has his own unique circumstances to deal with...to me a good decision is a decision which is made by the person keeping in mind his circumstances, endurance levels and above all his priorities or things that matter to him & things that don't, irrespective of the outcome.
I took a decision some time back to move to US which some feel (no prizes for guessing) is not the most correct decision. They feel that it's gonna "screw up" my life, well according to me you can't screw up a life which is already screwed up! worst come worst I might have to write off the year(s) that I would be in the US but hey what if things work out? Doesn't it then seem to be a sensible decision? I know a lotsa people would have given up hope at this stage but as I said everyone has his own endurance level and everyone's got his own priorities and to me this is the thing that really matters something for which I don't even mind writing off my entire life forget about few years. So just keeping my fingers crossed and hoping that one day things would be back on track just like they used to be nearly an year ago (seems to be long time!).
By the way read a book called The Monk who sold his Ferrari by Robin Sharma, how is it? who knows, who cares.

Friday, April 08, 2005

a new old friend..

It's been long since I blogged had too many things to take care of, I quit my job in Hyderabad and joined a company which got me shipped to New Jersey, anyone who knows what's been happening in my life would know why I joined them. Many people asked me to re-think about my decision but I knew what I was doing and why. I have no liking for my current place or the work apart from the fact that they are pretty decent folks, I joined them for totally other reasons which cannot be termed as professional. I joined them because I wanted to be close to Chhavi, we were (were? I for sure am still just as much in love with her and I hope it's same with her too) madly in love with each other and the best thing was that we were not just blindly in love but would see fault in each other too and try to learn from one another. I have never in my life felt the same sort of comfort while talking to anyone else even the ones who were very close to me. we would talk for hours everyday and still feel like talking more...we would be with each other over the weekends (every weekend except 2 out of the 12 weeks that I stayed there) when I was in Louisville and still feel like being with each other every day. I have never met a person who was so much giving, so caring & still being so receptive to new thoughts/ideas (I know these qualities are pretty much still in her) as her, circumstances or twist of fate or whatever else it was (I don't blame her for anything) we stopped talking and according to her she moved on with her life and that's what she told me even after 10 months since the date we stopped talking. So why am I still trying when it's been more than 10 months? why am I still hoping that we would be together back to same old days when perhaps everyone else would have written us off? am I being impractical? or am I being overly hopeful? I don't know yet what is the right thing to do but I would do just anything to have her back in my life. I don't want her to come back just for my sake but because she also hopefully feels the same way. ..
I am,
You are.
& nothing else matters
in our private universe!
I am waiting for the day and I would see her smiling at me again & waiting with open arms..is it too much to ask for?
I will end this blog with my favorite lines from Ghalib (chubby also loves it): -
hazaron khwaishen aisi,
ki har khwaish pe dum nikle.
bahut nikle mere armaan,
lekin fir bhi kam nikle.

Tuesday, March 15, 2005

Bye bye Hyderabad

12th of March was my last day in Hyderabad, I moved out of Bangalore in february and joined a company based out of hyd. I stayed in the co. for little over than a year though even before joining the co. I knew it wasn't the place where I can survive for long. I still find it tough to understand how can some company be so unprofessional in the way they do their business: starting from managing clients, to managing its own people! but well they're a 10 mln $ company so perhaps that's why no one is complaining. Met few nice guys in this company, no technical studs though: Satish, Amudhan, Sai, and Rao to name a few, hope will meet some of them again in future...even though the work wasn't at all great in the company I got what I joined them for so am not complaining at all and job satisfaction was not one of them. Anyway, I know someone would be unhappy over the fact that my next job is not in bangalore but well that's the way it goes, let's see where life is heading next.

Tuesday, March 08, 2005

8th of March

People born on 8th of March have their sun in Pisces: which means the person is a dreamer, very compassionate & self-sacrificing: so is it true for every piscean or is it a generalization? Well, I don't know about other pisceans but since past two years(ok not just past two years, I'd first met her around 15 years back). I've been knowing a piscean born on this day and I see all the above qualities in her plus a lot more (no prizes for guessing who she is).
8th of March is not just significant because it's her birthday but also it was the day when we met again after 13 years: still remember standing in front of Laxmi-Narayan temple in delhi at 7 o' clock in the morning & waiting for her to come to meet me....also last year we were together on this day in chicago, so this is the first time in past 3 years that we haven't been together on this day & sure it doesn't feel that great but as they say it's not if it's when!
Very Happy b'day wishes to a person whom I have the privilege to know and be with, wish you good luck & lotsa happiness and sunshine and hope to be with you on 8th of march, 2006 and all the 8th of marchs then after.

Saturday, February 26, 2005

Love is on the run

February 24th was anniversary of two people both of whom are very close to me. They came together 2 years back and have been lost in love & each other since, but twist of fate, circumstances or whatever else you wanna call it, they haven't been together off-late. Knowing them I know they still feel just the same for each other & would love to be together again. I wish them luck and hope they'll come out of their hard times pretty soon even stronger, I see them walking hand in hand in near future, do you?

Wednesday, February 09, 2005

Why Do I Blog?

(Aside: tried posting this blog via the email that blogger provides, more than 1 hr. and the entry has still not shown, guess it's better to post it via the web interface only!)
Read Eric’s post (http://blogs.msdn.com/ericgu/archive/2005/02/08/369506.aspx) about the hazards of writing blogs which is open to public. I’d been thinking about the same thing off-late: why do I blog, do I blog and hope that the “world” would read it or do I blog just for myself as that way I can maintain a web diary and scribble down everything and anything that comes to my mind? Well, I blog for myself and yes though I know that my “diary” is public and can be read by all and sundry I still blog just for myself. If people read it and leave a comment fine, if they don’t still fine with me. I have shared my blog address with very few people whom I know (as of now I can only think of only 3 who are pretty close to me) though a lots of my acquaintances know that I blog.
The one problem that I face while blogging is that at times there is something which is personal enough to be not shared among all the acquaintances, generally in those cases I blog about it obliquely, the ones who know about it understand what I actually meant, and the ones who don’t are free to draw their own conclusions. So why do you blog and what you do in cases where you don’t want all your acquaintances to know about something?

Monday, February 07, 2005

Who is John Galt?

[Update (2/14): Got author of Celestine Prophecy all messed up, it's James Redfield and not Robert Redford as I mentioned in my post!]
Read two books off-late: Atlas Shrugged by Ayn Rand & Celestine Prophecy by James Redfield. Both books more or less have a philosophical tinge, Atlas Shrugged is about the "movers" of the world and why they fight their biggest & hardest battle against the people whom they love, Atlas is the greek mythological God on whose shoulder the entire earth's weight rests. Atlas carries the burden of the world unselfishly and the world in return just keeps on adding to the weight. In this book, Ayn Rand suggests that Atlas should shrug the world off his shoulders. Book is pretty crisp in the beginning but meanders a lil' towards the end and gets more or less Bollywood style ending! Net net I would rate this book above average but not something amazing.
Celestine Prophecy is a parable which gives you 9 insights into the life, some of the insights being: Co-incidences don't exist, everyone you meet has a message for you etc. etc. The books draws metaphors from physics and relates our lives to relativity and kinetic model i.e there is no static amt. of energy within this universe, based on our energy level the energy around us also increases or decreases. This book is more or less like Alchemist though Redfield lacks Coehlo's style of writing...again something which I would rate slight better than average.
By the way for those who are wondering, Who is John Galt? is a slang used very often in Atlas Shrugged & is used in situations about which ppl. are helpless or want an alibi.

Thursday, February 03, 2005

[No Title]

Have been trying today to change the look and feel of my blog, haven't made any progress yet but found that www.blogskins.com has some nice skins for both Blogger and MovableType. I picked up one template and tried making one on my own but guess don't have any patience/time to do it, so another one goes in my pending list.
What else? everything else is same old, same old: have to stay in the office late these days due to almost daily conference call with the client, it's one of the things that I really hate about Onsite-offshore model, other thing that I hate is the communication gap that can arise due to not having a face to face interaction. IMO face to face conversation is far more better than talkin over phone or chatting over IM or just exchanging mails back and forth. One of my teammate over here is planning to move on, got an offer from a big company (A..) The work seems to be nice and hopefully he will learn a lot more than wasting his time over here. Good luck to him in future! it was sure nice working with him.
Finally got myself a birthday present: it's a Fossil leather strap watch, looks nice I guess though I keep on forgetting to put it on as am not used to wearing a watch.

Tuesday, February 01, 2005

Days of future passed

Haven't been feeling great for some reason today, nothing has changed; things are just as I expected them perhaps that is what is making me feel a little low: that things haven't changed off-late and going on in the same direction where they've been going since past few months which is basically going nowhere. Work life is nearly non-existent, I can't make myself to work these days, if I get some work I fret and try to push it back as much as I can: something which I never did before, maybe it's because I don't like the job that I am into or maybe it's because I don't want to work! I don't know what is the reason but it's screwing me no doubt. After-work life is also non-existent perhaps even more than the work life: in office I feel like going home and when I reach there, I feel like coming back to office.
Looking back at the last one year from 1st Feb to 1st Feb, life has changed so much, perhaps way too much for me to handle. Feb, Mar, Apr, and May were the best months and since then life has been going downhill and even though it's going down consistently but at times thigns have happened way too unexpectantly, the worst of months being June and Dec. and the way Feb 1st has been, perhaps even Feb. Don't know how to handle things maybe I need to stop expecting from people, maybe I need to do some introspection and see what I've been doing wrong, or maybe I just need to shut my mind and stop thinking all together!