Memi.Reflection

Private members of memi's thoughts
Design Time Directory in VS 2005

I'm currently working on some design time editors, which need to read configuration settings from the web.config / app.config files, located in the main project folder.

The main problem is to find the directory of the project. There are some good posts about it, like here and here, but alas, they are all good only for VS 2003. I couldn't find any info about implementing such a functionality in VS 2005.

Do you know of any source available regarding this issue?

Posted: Mar 20 2005, 09:24 PM by memi | with 16 comment(s)
Filed under:
Distributed Developer

This is how I feel these days.

I'm currently involved in four projects, which are based on the following technologies:

1. ASP.NET v1.1

2. WinForms V2.0 (Beta 1)

3. J2EE (With some parts in VSTO2)

4. And.... VB6

I'm looking for some COBOL projects, to complete the list.

So whoever wondered about my long silence - that's the explanation.

XSL Transform performance

I came across few posts regarding the performance of XSL transformation in .NET 1.x, but only yesterday I came across a situation which made that quite clear.

We had an XML file of 1.2MB size, and a quite complicated XSL file (based on WordsheetML) to transform it.

Using the XslTransform object, it took about 10 secs.

Using MSXML4, including all the interop overhead, it took less than a second.

Is that reasonable? Are those the performance I should expect in the following scenarions? Did anybody find a good solution to this problem?

Division by Zero

Is it possible? I didn't think so either. But read this.

I'm working now on a presentation regarding J2EE and .NET. For the sake of the presentation, I wanted to create error on one of the ASP.NET pages (yes, sometimes we do it just for fun. It's not a Bug, it's a Feature, you know...).

So, what is the easiest way to create an exception, I thought to myself? And immediately added the following code to the Page_Load event:

Response.write(1/0)

and executed the code. To my great surprise there was no exception! The page looked just normal. But while examining it more thoroughly, I found the following text on the upper left corner:

אינסוף חיובי

To those of you who can't read Hebrew (and I guess there are a handful of you), the meaning of those words are: Positive infinity.

WHAT? WTF? But wait - that's not all! When I modified the code to:

Response.write(-3/0)

The result was:

אינסוף שלילי

Which is:

Negative infinity.

Now, this is really strange:

First, since when a division by zero results in an infinity? I don't know much about math, but I asked my mother in law, who has a PhD in Mathematics, and she said that an expression like this is undefined, and definitely not infinity.

Second - localized math result? I liked that!

Anyway, here is an article which discusses this issue, but still does not explain when a division by zero is infinity. On the other side, in this article there is a good explanation why <Quote>division by zero is not defined for reals</Quote>, and when it is defined. Well worth reading.

So, does anybody know why division by zero is allowed in .NET?

.NET Deep Dive

Long time no post...

It was a very long silence, but I guess that's what happens when there is so much work that one can't find enough time even to blog a little...

Anyway, a week ago we had the .NET Deep Dive event in Israel. I gave one lecture, about Design Time programming. I think it went pretty well. One of my indicators for a good lecture is the questions you are asked after it. I had tens of questions, face to face and by Email.

BTW, if you would like to express you mind about the event, click here. You'll find here a quick survey regarding this event. Please take your time and fill it. I think it is very important to hear as many as possible opinions about events like this, so we can always improve.

Productivity Killers

A few days ago the Middleware Company released a research comparing .NET and IBM tools for java.

I guess most of you read this research (and if you didn't - you better do it), but I wanted to add my 2 cents about it.

One of the big problems in java, which is not part of the .NET (thanks god), is its over-complexity. This complexity may be logical for huge systems, with loads of servers and thousands of users, but for most systems - this is simply overkill.

Take, for example, the following scenario: you are developing a business logic component, and whie debugging you found some minor bug (say - add 1 to a variable). What would you do?

In .NET- stop the debugging, change the code, press F5 and check again.

In WSAD (IBM's IDE for Java), this is what may happen:

1. Stop the debugging (~10 secs)

2. Change the code (~ 2 secs)

3. Build the project (~0.5 mins)

4. Oops - hot code replace not working! Restart server (~ 10 mins) (For those who have no idea what I'm talking about - you have to have an active server to work on. The closest thing to this in .NET would be the CLR, however you can't restart the CLR. To do that you would have to start the whole OS, and how many times did you have to do that?)

5. Mmmmm... where did this additional server come from? You can't really debug like that. Restart WSAD (~ 10 mins)

6. Wait for the ClearCase to load its data (~5 mins) 

7. Start the server (~5 mins)

8. Now go for it, and make sure you fixed that goddam bug!

So - in .NET the bug was fixed and tested in less than 10 secs. In WSAD - more than half an hour to add "+1".

To make things clear: Our Java project is not a small one. It has hundreds of files. However, we also have large .NET projects as well, and we didn't experience those horrible times.

Now, I'm sure there are some lighter Java tools, and maybe our architecture is not perfect, but hey - under no circumstances should an IDE take more than 5 minutes just to start up!

It's a Boy!

We have added 20% to our family!

Our 4th kid, a cute boy, joined our team yesterday, at 4:30AM (in the middle of Yom Kippur, the Jewish most important day of the year). He and my wife feels very well, and I'm going to be quite busy in the next couple of days preparing the bed, the safety chair and the celebration for our newcomer.

We haven't choose a name yet, and you are more than  welcome the send in your suggestions.Unfortunately, "Version 2.0" already caught.

The decision will be made by the family's court, cosisted of Aluma (7), Ofek (5) and Arava (2.5). We, the parents, have no Veto rights whatsoever.

 

VS 2005 - The road to the (Dark | Client) Side

While toying around with Beta 1 of the VS 2005, I found myself get intrigued more about the client side apps new features, rather than the new web features.

Specifically - I really don't find the new Datasource controls of much help. Since no one (I hope) is going to put an SQL DataSource on an ASPX page, and the Object DataSource is simply thin layer of coupling form fields and object properties (a feature which was developed by almost every IT shop using .NET), and since most of the new server controls can be found as third party controls, usually with better features, for more than two years, I really couldn't make myself excited about this.

BUT - the new Visual Studio Tools for Office definitely caught me. The first version of VSTO was, IMHO, wrong step in the right direction. I mean - common, why do I need to implement 26(!) methods in an applet-like fashion just to display a single button in the task pane? But the new version is really good. To have the word designer integrated directly into the VS designer - yes, this is how things should be done! A real masterpiece.

Furthermore - the ClickOnce mechanism is another revelation. Now there is really no real reason to develop a web inter-organization application.

I guess my focus will have to shift from web based to (office | winforms) based application in the near future.

Good thing we still have Java, which has no any other viable alternative to the web...

Posted: Sep 18 2004, 08:43 PM by memi | with 4 comment(s)
Filed under:
IIS on XP Home

Yep, that's possible.

 

My machine had crashed yesterday, and is in the lab right now. Looks like the vent has gone crazy.

As usual, I had a really urgent .NET thingy to finish, so I wanted to use my wife's laptop (IBM R40, cute little machine) for this.

There was no problem installng the VS.NET. Since it went so well, I though to myself: "Well, why won't we try to install a web server?".

I started with Cassini, but the VS.NET didn't get used to it.

I then found this article, and voila! after 15 mins I had IIS on my wife's machine up and running.

I'm sure she is very happy about it.

Posted: Aug 24 2004, 01:25 AM by memi | with 1 comment(s)
Filed under:
[OT] Cute easter egg for VB6

I may be the last one to hear about it, but in case there is someone who didn't know that:

1. From VB's View Menu, select toolbar, then customize......

2. In the resulting dialog, click on the command tab.

3. In the Categories List, select Help.

4. Select "About Microsoft Visual Basic" in the Command List, and drag it to any
menu or the toolbar.

5. Right-click on the item you just dragged and rename it to "Show VB Credits"
(without quotes).

6. Then close the "Customize" dialog and click on the "Show VB Credits" item

found here.

More Posts Next page »