# Friday, March 24, 2006

" Today, a real experience is much more important than a degree, well, unless you're looking for a government position. The problem in our industry is that students decide to study for the degree on the way, while trying to work in 120% job. In my opinion, if you want to give a student a chance at the real world while he can stay focus on his degree (and event enjoy it) you must assist him by finding him a position as an intern for at least a few months so later on he could apply to any position he'll be suited for. "

Well, that quote was mine(during launch time at my company). I'm one of those folks who tries to get my degree while trying to work my ass of. Sadly, I suffer 80% of the time as I struggle finish my papers for the universty on time and still enjoying my job(100% of joy). 
If internship was a part of the degree, I believe that the a lot of us programmers out there could enjoy the learning process without damaging our career and hack, maybe it will produce better programmers in our industry. 

In the USA (and in France too, as my cousin told me), this dream is a plain reality - you can see the internship project Joel Spolsky started here.

   

Posted by Oren Ellenbogen 
24/03/2006 10:02, Israel time UTC-07:00,     Comments [0]  | 
# Wednesday, March 01, 2006

I've fixed some wrong methods signatures in my article (thanks Ken) and uploded a demo which, I hope, ease the understanding of the entire article.

Go ahead and download.

   

Posted by Oren Ellenbogen 
01/03/2006 09:55, Israel time UTC-07:00,     Comments [0]  | 
# Monday, February 20, 2006

You remember my last post about templating via .Net 2.0 Generics and delegates. Well, after getting some good feedback from all of you, I thought to publish it at codeproject so I'll get some more feedbacks, grades and most important - additional comments.

Feel free to grade the article ;-)

 

   

Posted by Oren Ellenbogen 
20/02/2006 10:36, Israel time UTC-07:00,     Comments [2]  | 

For all of you programmers out there, who develop for asp.net 1.1 and asp.net 2.0 on the same machine - this trick can be quite useful for you !

If you're still using IIS, you'll want to create a VD(Virtual Directory) which support asp.net 2.0 for those application developed for that version, and still use VD which support asp.net 1.1 for your older application. Running an asp.net 2.0 application with VD of 1.1 (and vice versa, of course) will not work.
Where's the catch you may ask ?
Well, if you add a new virtual directory, you may notice that the chosen (default) version is the one you have in the Default Web Site. This can cause some annoying problems as some of your developers(or your server(s) administrator(s)) will define asp.net 2.0 as their default while the others will define asp.net 1.1 as their default. Just mentioning "define a new Virtual Directory for the application X" won't be enough.

The trick is to create a new Virtual Directory in the old fashion way, and just after it - call

%windir%\Microsoft.Net\Framework\[wanted version]\aspnet_regiis.exe -s w3svc/1/root [your Vitual directory name]

But hack, why do you need to remember all of this ?

Use the new(here is the old, without asp.net 2.0 support), improved, stylish, with asp.net 2.0 support - VDCreator:

VDCreator bin(EXE & Config only) (4.81 KB)

VDCreator Source (39.56 KB)


last but not least 
-
Ken helped me on this one so thanks mate !

   

Posted by Oren Ellenbogen 
20/02/2006 11:30, Israel time UTC-07:00,     Comments [0]  | 
# Thursday, February 16, 2006

It took me some time to understand the real power behind .Net 2.0 Generics. I think that the lack of usage with delegates hold me back from developing some elegant template-based code. After practicing a little, I managed to pull something off and I thought to share it with you. My goal - create a template for executing an IDbCommand object as a Reader, NonQuery, Scalar etc...
   

Posted by Oren Ellenbogen 
16/02/2006 10:16, Israel time UTC-07:00,     Comments [7]  | 

I wasn't aware of it, until now anyway...       

using (SqlConnection conn = new SqlConnection("your-connection-string"))
{
   string query = "SELECT * FROM T1; SELECT * FROM T2;";
   SqlCommand cmd = new SqlCommand(query, conn);
   
   conn.Open();
   SqlDataReader reader = cmd.ExecuteReader();
   do
   {
      while(reader.Read())
      {
         // read each row in the statement results.
      }
   }
   while(reader.NextResult()); // jump to the next statement results.
}

   

Posted by Oren Ellenbogen 
16/02/2006 08:21, Israel time UTC-07:00,     Comments [1]  | 

Level:

3/10 at Ellenbogen's scale.

Preface:

You have the following code:

try
{
   // Some code which can throw any kind of exception
}
catch(Exception e)
{
   // If e is from DataGatewayException type – throw the original exception;
   // Otherwise, wrap the exception with DataGatewayException and throw it.
   // In any case - this "block" will throw only DataGatewayException.
   if (!(e is DataGatewayException))
      throw WrapAndPublishException(e); // *
   else
      throw;
}


* WrapAndPublishException method returns a new object from DataGatewayException type (which wraps the original exception).

The Challenge:

Refactor the code above so it will be more readable and extendable(in case we want to re-throw other exception types as well).
Use your imagination.

   

Posted by Oren Ellenbogen 
16/02/2006 08:01, Israel time UTC-07:00,     Comments [5]  | 
# Tuesday, February 07, 2006

For some strange reason, I can't seem to debug my .Net 2.0 application via VS.NET 2005 debugger. I call Debug.Fail("...") in my code and run it via Ctrl+F5 - this is the screen I get:

no2005debugger.jpg

Where the hack is my VS.NET 2005 debugger ?!
If anyone found my lost debugger, please send it back to this address (via comment).

Thanks!

btw - debugging with F5 works fine; That makes me wonder how can I control the items in the box (at the picture), maybe registry magic is required. I'll update if I'll manage to find my debugger ...

 

   

Posted by Oren Ellenbogen 
07/02/2006 12:21, Israel time UTC-07:00,     Comments [2]  | 
# Monday, February 06, 2006

I'm trying to give some good PR to the Israeli MCPD study group, arranged by Justin Angel (Hebrew).
So if Hebrew is native for you and you'd like to hear some good(hopefully) presentations about .Net 2.0 - leave a comment in this post. It's important to get some early feedback as Justin tries to get a classroom (& some food) from Microsoft so they'll  sponsor the event.

See you there...

   

Posted by Oren Ellenbogen 
06/02/2006 02:00, Israel time UTC-07:00,     Comments [0]  | 
# Sunday, February 05, 2006

I just found a bug in the new version of SchemaExplorer (3.2.4.797) at MemberColumnSchemaCollection.Contains(CoolumnSchema value) method.
   

Posted by Oren Ellenbogen 
05/02/2006 02:25, Israel time UTC-07:00,     Comments [1]  | 
# Saturday, February 04, 2006

Roy did a great interview with Kent Beck, an author of several books about XP\Agile development and one of the most influence figures in that industry. I tried to think about the answers I would give Roy if he asked me some of those question, so here are my answers and some short feedback about the interview itself:

Push yourself to your extreme.
I'm one of the folks Roy mentioned that tries to get better by testing new methodologies\practices like Pair Programming, Unit-Test-first code-after, daily build process (etc) when I have the chance of doing so. By saying that some of the techniques such as Pair Programming just couldn't work here in Israel due to our complex nature(intolerance and straight-hard-to-your-face-comments) is somewhat rude (see - I'm a good Israeli, no problem saying "hard comments" ;-)) as the term "Pair Programming", IMHO anyway, doesn't necessarily mean working on the same code at the same time; It's about thinking and discussing about the same context and move toward the solution at the same time - something which I enjoy doing on my every day work and I'm familiar with many more programmers out there that practice this technique in their every day work.
I think that Kent gave a good answer: those methods DO work(even in Israel) - the context or definition of "success" is debatable and can go either way, but those methods serve a better all as our main goal is to be the best we can be, and XP\Agile techniques are just some more tools and ideas for us to become so. That attitude, the "extreme achiever-wannabe", is the one I'm searching of at people, and this is what I'm working hard on in order to inspire others.
 
The cold hard truth - one man can't(?) change an entire organization.
Every once in a while I hear(while someone just throws it at my face) the sentence "you're still young and naive, you can't change this\that\him\her" or "you've been lucky to work with those people; with my teammates you couldn't done it..."; I guess that I'm just one of those optimistic people which think that by doing your best and influence others by your positive nature will work (to some extent, as I mentioned earlier) in any given group of people unless this group is doomed for failure and are willingly accept it. Can one man can change the world? I guess not, but I would like keep thinking so as I know that this will give me the inspiration and motivation I need. The definition of success is bound to the "ribbon" you're attached to. As a programmer, your world is pretty small but you can definitely make it spin in the reverse direction if you push hard enough. It would be much more difficult to change the world of other team in your department, I just think that this shouldn't stop you.
 
"People want some hard answers which will inspire them to get better"
Roy - I can't agree more, and at the same breath, I can't disagree more on this phrase. You see, most of us want hard answers as we wish to believe that by applying other methodologies\actions\thoughts we're improving our-selfs and raising our bar just one inch higher in the path of becoming better; So I definitely think that hard answers for complicated question, in some of the cases(case = person&context), will create the wanted effect.
On the other hand, the more creative you are, the more "self-succeeder" you want to become - the less it will apply to you. Meaning, I don't want to get straight answers about "What is the right way to develop a 6 months project with 3 programmers and one team leader" and the reason is simple - any answer you'll give will be wrong, but at the same time it will be also right so I'm still at step one. As you get older you realize that there is no right answer, so reading a book, or asking Kent for his opinion is just another (great)source\idea\tool to add to you tool-box, nothing more. Showing your attentions and discuss about those hard questions with other co-workers can cause the required inspiration that people are so eagerly searching for.
 
General feedback:
Roy - I think that you did a great job "pinning" Kent to the corner and ask the really hard questions about XP\Agile development which can seem like empty buzzwords instead of real solutions to specific organization\projects\teams\context in the eye of the intermediate programmer. I can't say that I've learned something entirely new, but It sure made feel better about my grasp of software development and people management.
Kudos for your not-so-Israeli accent(:-)) and for your time !
   

Posted by Oren Ellenbogen 
04/02/2006 02:19, Israel time UTC-07:00,     Comments [1]  | 
# Wednesday, February 01, 2006

I'm using dasBlog "Insert Code" feature in order to insert some code to the post(strange, but true). Until now, my code was nicely highlighted but it was lacking of background color and some border to give it the proper attention it was required. After digging for couple of seconds in the dasBlog directory I found out that the page ftb.insertcode.aspx (under ftb directory) is in charge of highlighting the code. Here are the important lines (Notice the background color & border ! :-)):

void parseButton_Click(object sender, EventArgs e)
{
   AylarSolutions.Highlight.Highlighter h = new AylarSolutions.Highlight.Highlighter();
   h.ConfigurationFile = Server.MapPath("CodeHighlightDefinitions.xml");
   h.OutputType = AylarSolutions.Highlight.OutputType.Html;
   string result = h.Highlight(sourceTextBox.Text, languageDropDown.SelectedValue);
   result = result.Replace("\t", "    ");
   result = result.Replace(Environment.NewLine, "<br>");
   resultLabel.Text = result;
   codeText.Text = "<p>" + result + "</p>";
}

All you have to do is replace the line:

codeText.Text = "<p>" + result + "</p>";

With this:

codeText.Text = "<p class='HighlightedCode'>" + result + "</p>";

Now add the class into your template css and that's it!

* I'm using:

.HighlightedCode
{
    border-style: dashed;
    border: 1px Silver;
    background-color: White;
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 4px;
    padding-top: 4px;
}

Sweeeeet !
   

Posted by Oren Ellenbogen 
01/02/2006 05:18, Israel time UTC-07:00,     Comments [0]  | 

I've just upgraded my CodeSmith version to 3.2; It went pretty well just until I've opened the CodeSmith Studio and tried to compile my template. I got a strange NullReferenceException in the CodeSmith.Engine.CodeTemplate constructor.
I thought about 2 reasons which can cause this behavior:

  1. Maybe the CodeSmith Studio works with an old version of one of the dlls, for some unknown reason (unlikely).
  2. I'm using a compiled dll as my CodeTemplate base class, maybe I need to recompile it again and then try to compile the template (more likely).

So I compiled my DLL (and did a quick restart to my computer, just to be safe) - now it works...

   

Posted by Oren Ellenbogen 
01/02/2006 10:25, Israel time UTC-07:00,     Comments [0]  | 
# Saturday, January 28, 2006

After a long meeting with Ken and Roee about our(SQLink R&D department) architecture, I decided to put it out on the table - maybe you can give us some better insights about some questions we brought up during our session. I'll start from the end of our session - this is the architecture design we thought about:

layers_small.jpg

   

Posted by Oren Ellenbogen 
28/01/2006 03:22, Israel time UTC-07:00,     Comments [4]  | 

I'm using the Captcha anti-comment-spamming-engine in my blog:

captcha.jpg

Some of you complained that after posting a comment you can't see it afterwards. This is caused due to a time mechanism plugged in the Captcha engine - after X seconds, the code becomes invalid and you have to insert a new one. In case that the Captcha will have code timeout - it will make you enter a new generated code simply by leaving you on the same page. So please make sure that after hitting the "Save Comment" you're on the main page and you don't have your comment at the bottom of the page, if so - enter the new code and click the "Save Comment".

Thanks.

   

Posted by Oren Ellenbogen 
28/01/2006 02:04, Israel time UTC-07:00,     Comments [1]  |