July 2003 - Posts

Kudos to Scott !

Hey i was trying to post something, and when i hit submit, i got an error message. I refreshed the page and guess what ??! DotnetJunkies has been added to Scott's 'Blogs using .Text' menu ! Voila .. The UI started unfolding i was watching it openmouthed ! From the old dotnetjunkies look, this was one major mind blower and that too with everything happening so fast i was ! oh !

I never thought that the look and feel of the site will be this good when i was checking out on how crazy everyone was going in aspnetweblogs ! Like everyone says, i have found myself another reason to keep blogging !

And Donny, thanks for this ! And i noticed that one of my cribs about the category not showing on the post page has been taken care of !

I might have been the last one to appreciate Scott but i really really love it !

Stream inheritance chain .

This is one of my major cribs that i had let settle down for peace of mind a long time back. but then it had risen up when i saw the exact same question in a forum today. Here is the teaser design riddle.

It seems really really odd on seeing the inheritance chain of some of the classes in the System.IO namespace. If you notice, the StreamReader derives from TextReader and StreamWriter from TextWriter. Why is that ?? Typically a stream is a generalised entity and looking from a pure object oriented perspective, the textreader should be the subtype of the streamreader and not the other way around.

Well say that the framework designers had some valid design reason to do that, then why is that the stream serves as the base for all the other streams like FileStream, MemoryStream and BufferedStream ??

hmm .. the major irony is still to come .. Check the XmlTextReader class.. Now according to the synonymity in the name between textreader and xmltextreader, the developer is deceived in assuming that XmlTextReader is the base for XmlReader which is very similar again to the StreamReader ! Well don't hope too much because in reality it is the inverse and the XmlTextReader is the sub type of XmlReader !

I am still grappling to find out the reason for such an implementation ! I have asked in several forums about this but then no one has been able to provide a valid reason ! If someone here or from the microsoft framework design team can enlighten us with the reason then it would be really really helpful !

Link interface 1. (dasBlog)

Hey i don't know how many people have noticed this yet but i checked it out just now. Clement Vasters has been working on an extension of BlogX and the code along with the setup is available here. Has lots of improvements like Trackback, Pingback, Mail notifications, full Blogger/MovableType API support, Comment API support, fully customizable Radio-style templates, Mail-To-Weblog/POP3 with attachment and embedded picture support, web-based DHTML editing, web-based OPML editor, web-based configuration editing, and other goodies.

Definitely a beautiful piece of work !

Conversion to Datetime.

Brad Adams:

public static DateTime Time_T2DateTime(uint time_t)
{
    long win32FileTime = 10000000*(long)time_t + 116444736000000000;
    return
DateTime.FromFileTimeUtc(win32FileTime);
}

Did anyone understand the logic behind this ?? I struggled with it for some time and then lost patience !

His posts on DesignGuidelines are really good. Subscribed.

Collection crib.

I have been trying to create a custom datagrid control which will be able to show hierarchical data with a collapsible format. I have a basic implementation by using the datagrid column as such in a webform but what i am trying out right now is to create a server control which will have the ability to bind hierarchies within it.

I have created one custom column by inheriting from TemplateColumn and have my own properties as to specify how many rows do i need to expand or collapse if a image on the column at a particular row is clicked. This data is bindable too. hmm.. well it seemed straight forward initially but i am having too many issues because there are lots of dependencies that have to taken care in the Databound event of the datagrid.

One of the annoying things is that i have got stuck is not knowing how to convert the datasource into a generic holder of data. We know that for some XYZ object to be a bindable source, the object should implement IList and so i can safely cast the datasource to IList and get a handle. But the problem is that the items in the IList, since they are loosely typed, return only objects ! Since precise knowledge on what type of data is stored in the list is not known, i am not able to get the appropriate data eventhough i know the column name i am dealing with pretty well.

If the datasource is say an DataView then i would do it in the datagrid as

System.Collections.IList source = (System.Collections.IList)this.DataSource ;

HierarchyColumn coln = (HierarchyColumn)this.Columns[num] ;

bool data = (bool)((DataRowView)source[num]).Row[coln.DataField] ;

Well but what if the datasource is just a custom class that implements IList ! hmm.. Ain't that a bummer ? Since IList has a collection of objects and not any type specific instances, the cast cannot be done to any specific type and so there cannot be a standard way to retrieve data from the collection.

Well has anyone faced a situation like this in using collections ??

This is really not fair :(

Languages are abstractions !

I was programming in C previously and then C++ and now in C# and generally playing around with the .NET framework as such when a thought occurred to me that what i am doing is superfluous ! I might write a blog engine, write some e-com application, write a code to print 'hello world' but what is all this ?? The truth is that every system is based on something else and the one thing that interests me the most is the bottom of this dependency, the interface, the connector, who takes care that all data is bound and all interaction happens as per the expectations of the user. That interface is what i want to be working on !!! That's the interesting and the toughest part which makes computers do what they can do ...

When i think about it more, the more i get obsessed with computers ... The truth is that all programming languages are abstractions built over the interface to make it, to flex it the way it is wanted to behave... The ultimate interaction language has always been Assembly ! The ultimate machine code is read from this only ... So basically when Richter sat down to build the unix operating system, he must have met with the challenge that the syntax of the assembly is complex and that all operations are not obvious from the code in first shot ! So he created 'C' which is an abstraction over assembly or the 'interface language' which i will call. C's syntax is much more structured and it gives the reader a good level of understanding of the logic of the code. The abstraction also explains why C is so very powerful for doing any sort of stuff .. All machine related, system related, more powerful, fast and reliable code can be coolly written in C because that is just a small layer of abstraction over our interface language..

C++ built on C and introduced OOPS - Object Oriented Programming ! C++ in itself is not a major level of abstraction because it is as flexible as its predecessor 'C'. System programming can also be done using C++ in a very neat way ... The abstraction happened this time in a different way because all the cluttered spagetti code can now be arranged in real world object encapsulations which is amazing 'coz for a good programmer visualising something perceivable is easier than some unknown variable which doesn't link to its other parts of the code in a neat way ! This was the first major abstraction if you can see it the way i do !

All .NET, Java and other new virtual machines and runtimes along with the languages they brought along are still more higher abstractions over this .. People forget that as abstractions rise, people want to code less and so the abstraction framework is heavy and takes care of all the miscellany to spare the programmer but indirectly giving less functionalities to the user. So there evolved a need for API's to expose the functionalities provided by the lower level languages to the higher abstract ones ..

I love .NET in the way they have maintained consistency in the design of the framework .. There was one beautiful discussion or rather a debate over whether .NET is a platform or a abstraction ... By now i think from what i've said, which side i stand on ! After all it is just an implementation of the CLI right that abstracts out details very specific to the machine (the unmanaged bit ?) wherein PAL kicks in ...

There is nothing to conclude here ... What i have told you are my views and i am sure that it is not far from the abstract truth !

There is also one thought provoking post by Angelika Langer on a Revolutionary Programming Language. Just in case if you haven't checked it out.

Update: Removed the story.

Cool Blog !

This is some site which has to be rated #1 for pushing DHTML and CSS to its limits. Oh yeah and dont forget to go here to look at Jerod Huseman's main site. 

Check out the Foo Desktop too .. One amazing piece of work !

Thanks to scoble for the link !

Excel like Datagrid.

Well for one of the applications that i am trying to create, i wanted to create a datagrid control which will work like an excel worksheet with all the edit, readonly and delete rows functionalities and all the other features provided by the datagrid control ! Where i got stuck was not knowing how to do a visual inheritance of a control or in other words how do i inherit a webcontrol along with its designer functionalities so that i can add more attributes and properties in the webform without adding them explicitly in the codebehind ??!

My question was that if i need to do this, then i know that i have to use the Register directive to register my control and then use it as such with a custom tag or whatever. Then this brings in another question on what is the difference between a webcontrol and a usercontrol in terms of defining it in a webform ? Is it because that both of these controls are sub types of System.Web.UI.Control that you dont have any difference in the jargon of definining it in a webform or is it because of some other reason ?

This has been bugging me and eating away my thoughts for some time now. It seems quite trivial but for me the realisation has not happened or has not sunk in completely. Why ? Why ? Why ? Am searching for the reason . Hopefully will be back with the reason soon ...

Dilbert strip of the day !

Check out this amazing dilbert strip !

My projects !

These are some things that i am working on right now !

1) A Blog Engine

2) Using ASP.NET to access another application in a different AppDomain using .NET Remoting

3) A very flexible and customizable Content Management System

Well i've just started the first 2 of them and am yet to reach somewhere solid ! Will keep posting about the problems and cribs that i keep finding !

There is also one amazing library -> RSS.NET, an open source project written to handle all the RSS related actions ! Well will have to check it out and don't know on how much this will work out amidst all the buzz that's being going on the Echo project.

Will keep posting about my musings, thoughts and other findings in .NET ! Hey whatever i say are the truisms that i have felt and what is felt is far more bigger than what is heard ! If you understand what i am talking about then kudos to you !

There are lots of things that i need to try out and they are all in the wait list ! Wish i had infinite time in my hands or how about the time staying still ?? Either option seems fine for me !

Update : Well after reading Unloading an Assembly, a post by Suzanne Cook about the CLR Loader, i now understand on why Unloading Assemblies from an AppDomain cannot be achieved ! Well but it shall remain in my wish list though !

About me.

hey this is about me ! And this is what i am !

I am from India working as a Software Developer in Dell. I have been working in .NET for around a year now and that is my experience in the software industry as such. I have worked previously in C and C++, pretty much system development and hacking the computer and spoiling its happiness by making it do stuff that it is not supposed to do, render mega heavy graphics and make it crash and other fun stuff like that ! Technology is my passion and that's what keeps me going even if i am from a completely different background ! .NET has been completely absolutely unmentionable fun till now except for a few cribs here and there ..

I constantly read most of the technical blogs and articles that are going on and it feels good to be a part of that community that values technology more than many other things .. Good to be here ..

I am also a member of the Experts exchange and i go under the name Kuzco ! It is a pretty good learning experience and guess what ?! I am learning !

Well will get back on some of the projects that i am working on currently apart from the usual work in the next post !

Part of Blogosphere ..

hmm.. I guess with this post i am becoming a part of the technical blogosphere !

More to come on the technical front !