What's hot ? (and I mean really ...) - scroll down for more
1).  Code Templating - advanced usage of delegates & generics: my slides & demos are available for download! CodeProject article is also available.

2).  My series "TDD in the eyes of a simpleminded" is in progress(including code!): preface, part1, part2, Q&A 1, Manual Stub .vs. Mock Stub

3).  TDD Workshop: SeeCompass v0.1 and v0.2 are out.
# Saturday, November 12, 2005

The title got me your attention right? good, because this task - unit testing our WebService in one of our project - seemed to be a frazzled mission at first, but it's amazing how good tools and healthy thinking able you to think about new ways to "assign" the redundant work to the one(and only) dude that never complains (though it makes noises here and there) - the computer !

Let me take a step back and explain a little bit about our WebService and the unit tests it was required:
We currently finished develop another application in our department and this application was required to expose an interface for "CRUD"ing(Create,Read,Update,Delete) several "System Tables"("cities","countries","languages" etc) in the application. Eran(my teammate) was assigned for the job and he did a great job by well designing a general (XML)protocols for "talking" with the WS and by implementing the WS itself. After building the WebService and manually testing it he told me that his work was done and he's ready for his code review. I still have the image burned in my mind about how happy he was thinking about the required protocols, learning about WSE 2.0 (for WS security), implementing the WS itself to be extendable and maintainable, that it was almost tragic to see his face after I've told him that we should write an extensive unit tests for this WS due to his importance and it's extensive usage by our 3rd party softwares. The WebService had 5 methods and it handled 18 tables in our application so I thought about testing 3 different cases for each method, for each table:

  1. 1 valid xml which should return the expected valid data from the WS.
  2. invalid structure xml which should return an error from the WS.
  3. 1 invalid data xml which should return an error from the WS.

The math was simple:

3 xml files * 5 methods * 18 tables = 270 unit tests !

Eran started to plan the following 2 months for this taks but I had something else in mind - let's generate those unit test and hack, while we're in the middle of it, let's generate the XMLs as well !

I started writing the templates(while Eran was looking and learning the required basics) via CodeSmith (did I mentioned that this tool rocks? I'm sure I did, but again - Eric, great job) and after 2 hours we had all the xml files generated. Eran continued the job and written the classes (which holds the unit test methods) and checked that everything integrated properly. After a total of about 6 hours we had 270 unit tests, but more important, we managed to avoid a lot of dirty work and in case we need to support a new table, the unit tests for it will be only 2 clicks job; This is quite extendable, doesn't it ?

Posted by Oren Ellenbogen 
12/11/2005 05:35, Israel time UTC+02:00,     Comments [2]  | 

Pasha sent me a great presentation about Identity 2.0, presented by Dick Hardt, which all of you presenters out there ought to see !

Even if you don't understand what's the presentation is all about, you must listen to the presenter and check his style - he's amazing speaker and a great performer.

Here it is:

http://www.identity20.com/media/OSCON2005/

Posted by Oren Ellenbogen 
12/11/2005 04:59, Israel time UTC+02:00,     Comments [1]  | 

Like every good Jew, I like to listen\read what other's has to say about me; So, a few days ago I've got a referrer and I went to see who's mentioning me and why ? After reading the all post there I've seen this paragraph:

"After my PC got fixed, I found this:

http://www.lnbogen.com/ChangingMicrosoftsTabStripDisabledPropertyViaJavascript.aspx

One step closer to salvation. However, it didn't work either:

Oren Ellenbogen (?!!?!? is this a real name!? To my native Dutch ears this sounds like "Ears Elbows".) "
... [the rest is irrelevant]

Man, I laughed about it (with myself) for about an hour ! I know, "Ellenbogen" in Dutch is "Elbow" but "Oren" is "Ear" ?!

Well, I guess there is no such thing as bad publicity... ;-)

Posted by Oren Ellenbogen 
12/11/2005 04:52, Israel time UTC+02:00,     Comments [0]  | 
# Friday, November 04, 2005

I've worked on a new post for about an hour and by simply clicking the Ctrl+R instead of Windows+R my entire post has been thrown to garbage ! I can't express how frustrated I am right now about the "Add Entry" in dasBlog, It's not the first time I lost a post (sometimes my Avant stuck and this also makes me rewrite the entire post).

Anyone have good (FREE) suggestions ?

p.s - I'll write the original post (again) tomorrow.

Posted by Oren Ellenbogen 
04/11/2005 08:33, Israel time UTC+02:00,     Comments [6]  | 
# Friday, October 28, 2005

Yesterday the Israeli .NET architect group met at HP(Raanana) for a lecture about GAT and LINQ which was presented by Roy Osherove.

If you haven't heard about GAT & LINQ before, here is a (really) terse summary about them and my comments about the presentations:

  1. Guidance Automation Toolkit (aka GAT): this is Microsoft way to take a piece from the "automation" utilities cake. See, MS finally got the idea that there are too many folks out there using CodeSmith, O/R Mappers, RapTier etc; Now they're integrating a tool in the Visual Studio which will able us to automate everything directly through the studio itself. With GAT, you can build packages, or as I like to call them - "well defined and well presented(GUI) processes", to automate for example a build of an entity(\data) class based on a given table in the DB, just like you can do it today with 3rd party softwares. But you can do much more with this tool basically because it's so well integrated with the studio. Now, creating full controlled wizards straight out from the VS.NET which will able you to automate creating VS.NET solutions\projects\items is even easier than developing an Add-in for the VS.NET 2005. The main reason I don't think this will take off immediately is the GAT lack of easy configuration, but this will be fixed in the following year, and then, man, I think that the current Code Generators and O\R Mappers softwares will have to really take the next step and start running after MS (like we used to). Roy's presentation was nice, but I think he made a mistake by given us some general info & demos without really pointing the real deal - integration, integration, integration and Microsoft money & time = something we'll use later on, one way or another.
    Presentation TIP: IMHO, the first slide in every technical presentation should contain the phrase:
    "At the end of my presentation you will all know ____" or something like it.
    I would start with something like: "hey folks, we're going to talk about GAT, and before I'll begin, let me assure you, each and every one of you will use this tool one way or another, not tomorrow, but in the next 6-10 months so pay attention to MS new baby; Good, now that I have your attention, this tool is not quite ready for immediate use, and that's why I've told you 6-10 months, BUT, let me give you some general info about the new product and some demos, (after all, every presenter must challenge the "god of demos") and at the end of my presentation I promise you'll all understand the big step Microsoft did to ease our life's as architects. Please keep in mind that this is only a 1 hour presentation so I rather show you the big picture and the why-you-should-use-it instead of getting deeper into the code, does it sound right to you ? (everybody will node anyway)"
    After that said, I would concentrate more on the amazing integration with the VS.NET, the ability to use wizards to build wizards, the ability to control everything you need in the studio while using the studio itself rather than talking about the recipes\actions and "deep level" demos. If In 1 hour presentation you can't really teach me how to create a working Guidance Automation wizard, don't start to and stop in the middle after you see the material is to complex for such a short time limit, concentrate on the big picture and give me a list of links to read later on. The most important thing is to let the audience know the main goal of your lecture and what will they gain from it straight from the beginning, so at the end of it, they'll be really able to tell you if you did a good job.
  2. Language Integrated Query (aka LINQ): This is one of the coolest shit you'll ever see, I promise you that, but it will be released only with C# 3.0 so I won't elaborate much on it now and just say that this technology ables you to run queries on collection. I won't even give samples, there are plenty right here. This presentation by Roy was much better because it was clearly understood that the presentation will be focused on the new abilities LINQ will give us - pure "introduction" presentation (and to extract some "wowwww","aaahh", "hhooo" comments which is great to have in any presentation ;-)).

So, it was a nice meeting and I even got the chance to see some folks from the army I haven't seen for a lot of time (Effie, Gabi and the rest of the team) so I'm glad I went.

Oh, Two things before I'm out of here -

  1. I've registered to Microsoft Sql Server 2005 convention in November, will I see you there ?
  2. A very good friend of mine, Amir Markowitz, has turned 32 yesterday (sorry for the late post Markowitz!) so happy birthday dude !
OK, time for me to go, until next post.
Posted by Oren Ellenbogen 
28/10/2005 09:20, Israel time UTC+02:00,     Comments [4]  | 
# Tuesday, October 25, 2005

Hey folks,

You can now receive my new posts directly to your email via FeedBlitz service!

All you have to do is click here and insert your email.

Posted by Oren Ellenbogen 
25/10/2005 09:08, Israel time UTC+02:00,     Comments [0]  | 
# Thursday, October 20, 2005

This task can be a little tricky, so after messing with it's HTC (TabStrip.htc) here is how you do it:

To enable tab:

document.all.tags("TabStrip")[0].getTab(0).setAttribute("disabled", false);

To disable tab:

document.all.tags("TabStrip")[0].getTab(0).setAttribute("disabled", true);

* You can select other tabs of course or loop over them to disable\enable all of them at once (as needed).

Maybe it can save someone else the time I've wasted on it.

Back to code...

Posted by Oren Ellenbogen 
20/10/2005 08:55, Israel time UTC+02:00,     Comments [3]  | 
# Monday, October 10, 2005

Our team use Microsoft's Membership Management Component Prototype for our users management in our application. We've wanted to add "forgot my password" screen, and our new member in our team, Dror(pay his blog a visit) was assigned for the mission. While trying to configure the MemberRoles component (in the web.config) to allow password retrieval, we've got a strange "bug"(\behavior); When we've tried to write this code:

<add name="AspNetSqlProvider" type="Microsoft.ScalableHosting.Security.SqlMembershipProvider, MemberRole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b7c773fb104e7562" connectionStringName="wsha" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" passwordFormat="Hashed" applicationName="test" description="Stores and retrieves membership data from the local Microsoft SQL Server database" />

We've got a strange error "Configuration Error" (with unknown exception and other "helpful" details), and to make it even stranger, if you set the enablePasswordRetrieval to false, everything works well. So, like always, the first thing I do after I smack the keyboard (It works on my TV at home, why not here ?), I googled for solution (and publish it here, for higher PR ;-)) BUT this time - NO LUCK, I didn't manage to find something helpful. I couldn't thought about a better solution than to look at the source via Lutz Reflector so I've opened the dll there and checked MemberShipConfigHandler.Create(..) method; There I saw that this method creates an instance of SqlMembershipProvider and call it's Initialize method with all the data from the web.config. There I found the answer:

if ((this.PasswordFormat == MembershipPasswordFormat.Hashed) && this.EnablePasswordRetrieval)
{
   throw new Exception("Configured settings are invalid: Hashed passwords can not be retrieved. 
       
Either set the password format to different type, or set supportsPasswordRetrieval to false.");
}

So, the error was that we've used passwordFormat="Hashed" instead of "Clear" or "Encrypted". Well, That's making a lot of sense because the "Hashed" algorithm is implemented via SHA1, which is one-way encryption so obviously I can't retrieve the user's original password.

The real problem(and that's why I've called this behavior a "bug") is that somewhere in the way, the original helpful exception was caught and replaced with a really bad exception which doesn't allow the programmer to understand what have he done wrong. This is a very good example of why it's so important to keep the exception stack with you all the way up.

Back to code...

Posted by Oren Ellenbogen 
10/10/2005 02:10, Israel time UTC+02:00,     Comments [0]  | 
# Saturday, October 08, 2005

If you haven't seen this before, pay this link a visit;
It contains a list of useful things you can use via google search engine in order to optimize your searches.
Posted by Oren Ellenbogen 
08/10/2005 01:06, Israel time UTC+02:00,     Comments [1]  | 
# Friday, October 07, 2005

I've just landed this morning in our too-big-too-much-to-walk Ben-Gurion airport from my one week vacation at the beautiful Paris. To be honest, I really needed this vacation, I had too much on my mind during the last couple of months - University planning, work (and lots of it) and some universal (we called it "in-romo-shel-olam" in Hebrew) decisions to think about like my near future goals which I love to think about every new year. Meeting my great family, having some 20 folks dinner with amazing food and lots of good wine can do wonders to your mind and body so I come back with some new powers which I'm sure I'll need in order to progress during this new year.

I picked some insights during this week, some of them I would like to share with you -

Controlling the arm rest in the airplane as a life story.
On my way back, I flew with Arkia Boeing 757, meaning 3 seats in each side of the airplane; Guess what, I had to sit in the middle, between my father and another problematic guy. Why problematic ? I knew you'll ask it, well that's because he always tried to take over my arm rest and kept me awake for 4 damn hours and 5 minutes ! You can't blame me that I haven't tried, I tried to push, to take only the bottom side of the arm rest, only the upper side of the arm rest, to stretch while trying to take over, EVERYTHING ! this guy was persistent ! Well, I'm sometimes more stubborn than necessary, but I saw that this battle wasn't for me to win so I took the battle into a field I knew I can win - the arm rest near my dad. Don't give me that poor smile and nodding, if you try to move the man while he's a sleep, you must come with some heavy armor. The problem was that he was sleeping(\reading, he turned the pages in his book every 2-10 minutes) and I didn't want to move his hand. But... every child knows his parents' weak points and in my father's case it's me. Moving a little bit in my chair and showing him I'm a little bit tired (=unhappy) gave us both a great idea. In a sweep move, my father asked the fellow beside me to get up as he needed to go to the toilet. I had to get up too, but it's LIFO(last in, first out) style, so I had the position before him; Man, I love good tactics. So after 4 hours and 5 minutes, we had left only 10 minutes in the air so my trick was a little bit useless and I couldn't sleep at all, but I think I've learned a lot from it, don't you ?

Arm rests should come in couples for the chair in the middle in 3 sits airplanes.
See the section above. I think I should write a patent on this one, this is gold.

Take yourself some time to think about your goals in the near future, new year holiday is good time IMHO.
This year will be an important year for me, like any other year in our short life but maybe just a little bit more. This year I hope to start on the right foot (and hand, for that manner) my academic course and to step up in my work. In addition I'm planing to release a mini "product" out to the world and to see(and learn) how it goes. Well, you're all familiar with those subjects (work, studies) but they are too big to think over without decomposing them into more feasible tasks. I started my thinking during the vacation and I promised myself to finish up (and "refactor") during the next week.  So, I tried to decompose my "I want to improve at my work" task into smaller tasks like (just a small part from my tasks list):

  1. I want to improve my management skills
    1. I want to learn some time-management tools (so I'll be able to complete the next section).
    2. I want to build my teammates schedules.
    3. I want to follow it with them so I would be able to understand better where do they "waste" time so I can avoid it or think about ways to improve it. I want to be able to detect good progress and good work so I could praise them and make sure that this good phases(\methods) will be longer on their next assignments.
    4. I want to be able to teach my teammates - I really believe that good workers(and human beings for that manner) are those that aren't afraid to say that they want to learn new things every day even if that means they'll have to change their work every X years. I want to be able to teach my teammates a thing or two, direct them to other resources so they'll be able to learn, or any other media so they'll be happy to come to work every morning.
  2. I want to be taught - I'm trying to be a good worker, so section 1.4 must apply to me also. In order to do that I must think about ways to learn and set my mind about the subjects that interesting me; Finally, I have to sit with the people in my company(or surroundings) which I think has the capabilities to teach me and think how can I convince them that teaching me will be beneficial for them as well.
  3. I want to improve my software analyzing capabilities - I want to think and participate in the design of 2 huge softwares we're about the develop.
  4. I want to improve my selling skills - I'm thinking about releasing a small software with a friend of mine and in the last couple of days I'm thinking more and more if to release it as open-source or maybe trying to sell it as a product. I want to insert new technologies(.net 2, sql server 2005 and more) to my company, I must figure a good plan in order to do this smoothly and to justify any changes in our development phases so the management could be relaxed and fully understand why this changes will result "win-win" situation.
  5. I want to finish this year university courses with good success (85+ avg.) - The degree is important and I don't want to let it go just because I'm working, and I can plan my time better so I would be able to work and study at the same time without neglected any one of them, it's up to me, like always.
This is just the tip of the iceberg from my original list, but I think you get the idea. I'm planing to build this kind of list in my office so my teammates would be able to tell me their work expectations for this year and I would be able to think about ways which I can help them to achieve it.

Don't be afraid to let the world know - "I want" to do this, this and that !
Almost all the people I know want to be rich for many well known reasons. The problem in my opinion is not the "rich dad, poor dad" issues of "we're been taught to be humble about our desires, to be satisfied with our average paycheck" etc. It's the lack of preparation from our side that keeps us from being successful. One of the biggest sections in my list is how to learn more about the subjects which will able me to add just a little bit to my regular work paycheck and how can I use the industry I understand the "best" (computers) for making me more money. Being "rich" can be comprehend also as being smarter or becoming a better person, It's all depends on the list you're making. Keep this list updated, this is the hard trick you'll have to master; This will able you to monitor your progression and find new dreams. I have an uncle that good planing and a lot of self confidence got him the job of the president of a universal company and a lot of wealth for his good investments. He was never sorry for demanding more, and this is a lesson I will not forget. The bottom line is, be the best you can be, just be smart about it as we're not living alone and I DO think that being a good person is much more important than being successful, I just say you CAN be BOTH.


I would finish with happy new (Hebrew) year to all of you, may you get a little closer to fulfilling your dreams.
SHANA TOVA !

Posted by Oren Ellenbogen 
07/10/2005 10:55, Israel time UTC+02:00,     Comments [2]  |