This is Funny with a capital F.
For the last two weeks or so, I've a problem with VS.Net that drives me crazy.
VS hangs when I stop debugging, this happens around 30% of the time, on two of my computers, both of then when doing NHiberante Query Analyzer work.
The CPU usage goes to 100% and the whole process just freeze. I'm going to install the new version of Process Explorer and see if I can find what is the offending thread and to what library it belongs. I suspect an add-in, but I can't find which.
Sometimes, being lazy is its own reward. Too many times, when I need to finish a task, I just go ahead and implement it. I usually manage to complete those tasks, but sometimes it's ugly or inefficient. Sometimes, the task seems impossible.
A case in point is trying to build the NHibernate mapping GUI. NHibernate uses xml files for configuring the mapping options, and the mapping schema is over 1000 lines of complex xml.
At first, I just read the docs and tried to implement the UI. That worked, but there were a lot of things that I didn't support or only supported, and any change would cause me great pains.
Then I thought about first doing the model in code and then mapping it to the UI, that would've worked, but it would have required me to rebuild the mapping schema in code and again, any change would've cause pain.
I thought about code generation, and just when I decided that I don't want that because it would be harder to write the code generation code as it would be to write the code once (as I don't suppose that the mapping schema would change very often).
And then I remembered Xsd.exe, this is a tool that takes xml schema and convert them to code that can be XML - Serialized. I tried that, and it seems that I'll only need to write a mapping from the UI to XML serialization and that would be it. Further more, I would probably be able to do that for other schemas as well. I might lose something in the process, because I would lose the knowledge that a class element is more than just a string, but I think that this is a problem that would be much easier to solve than the first one.
Do you know that feeling when you have everything suddenly fall down together just the way it should be? That is how it's feeling now; it's just very natural to code this way.
Now, it's certainly not perfect, and there are several cases where I need to edit by hand, but xsd.exe did 99% of the work.
Apparently NHibernate mapping is complex enough that you cannot use the output from Xsd.exe directly, you would get exceptions from XmlSerializer. I consider this a bug in XmlSerializer, btw. The problem is specifying one element or more, which NHibernate does using this format:
<xs:sequence>
<xs:element ref="column" />
<xs:element ref="column" maxOccurs="unbounded" />
</xs:sequence>
And Xsd.exe translate to:
public column column;
[System.Xml.Serialization.XmlElementAttribute("column")]
public column[] column1;
Then the XmlSerializer complains about 'column' already defined in this scope.
I solved this by removing the column variable, but I don't think that this should be the way to go.
In the meanwhile, I'm going to post it both to Microsoft and NHibernate, and see what come up.
But this is the first approach I've tried that took me so far, so fast.
Robert A. Heinlein wrote a book about it in "Time Enough For Love"
Yes, I finally joined the proud masses of amature photographers. The camera that I got is Canon PowerShot A-95.
Prepare to be attacked with photos (actually, I'll create a photo blog, just as soon as I discover how I can do this easily with my host) in the meantime, here is my dog, with the original name: Sheleg (snow in Hebrew).
I'd managed to remove on of my laptop keys during normal activity (the F), so I thought, what the heck, I'll just put it in, just like I do in normal keyboards.
But it seems to be above me, furthermore, it seems to be above the lab I took the laptop today. I'm going to get a replacement keyboard. Because of one key. On the one hand, I'm never against getting new stuff, OTOH, it seems ridicilous that I would need to change my entire keyboard because neither I nor the lab can put a key back in place.
Furthermore, I know that this is easily possible.
Via Smalltalk TidBits,
I saw this and I couldn't help but thinking, every girl should've one. (As a matter of fact, most girls here does have one sometime during their life, but usually not so... stylish.)
I can't make up my mind about how to create the Hbm Editor. I tried to create a normal data-entry GUI, but that was very complex, both in code and in terms of usablity.
I'm currently thinking about doing a different approach, here are the options:
This is what I've now, I'm not very happy with this though, it's not so clear what is going where, and the code is absymal, to say the least.

This is a mock of the interface that I dream, basically, you get to configure the Hbm file using the tree on the left side (using context menu options) and then you can see it as text on the screen. A natural step would be on-the-fly parsing & displaying on the tree.
What do you think? Which do you prefer? I'm leaning toward the second option, but I want your opinions.
I've a 2.8 HT P4, 1Gb RAM, and sometimes I feel that I'm still on my old P133+16Mb.
The computer is just sloooow. I've long known that the answer it Norton Anti Virus, I can see it doing all sort of IO at all times, slowing the entire system down. Killing navw32.exe and restarting it works wonder for overall system performance.
I've had enough. As of this moment, I've disabled Norton Anti Virus Auto Protect on my computer, I'm behind Firewall & NAT, so I'm not really worried, but I'll try it out and see how it looks.
An interesting post from Mitch Denny:
HOWTO: Scale-out your blog reading.
I'm currently subscribe to ~300 Blogs, and I read them almost exclusively during weakends (it translate to ~500 posts). The main reason I use blogs is to see what is happening in the industry while I'm away. This mean that I read most of those blogs.
Now, I'm interested in a quite a few subjects, but quite a few of the posts aren't really interesting, things like Web Services or SOA bore me because I didn't try them yet, so I skip them.
What I would really want is some sort of bayesian rating system, so I can rate posts 1 to 5, and then just ask my aggerator to show me them in highest ranking order. It would work both for posts and for blogs, a blog with high post rankings will get higher ranking boost even for a message that I wouldn't normally read, and a blog with consistent low ranking would have low ranking even for an "interesting" items.
I think that it should be possible with a plug-in for RSS Bandit. I may pick that project when I'm done with NHibernate Query Analyzer if no one else does.
The Committee to Protect Bloggers has declared February 22nd as Free Mojtaba and Arash Day. The commitee asks that bloggers dedicate their blog to the release of Iranian bloggers Motjaba Saminejad and Arash Sigarchi.
Why not me? I'm in prison for a much longer time then they are, and there is no cry to release me :-)
Anyway, I'm all for freeing prisoners, so let them go!
