Ayende @ Rahien

Refunds available at head office

Great UI kit

What do you look for when you are seeing new software on the web?

Me, I read what it does, and then I take a look at a screen shot (if available, and it'd better be). A polished UI doesn't neccecarily means a polished application, but it helps :-)

It's much nicer to work on a good looking interface than on plain one, and the amount of work invested on the UI is usually 100% user-visible, while that bug that happen only on 2:00AM every third wendsday usually isn't.

That was why I was so happy to find the DockPanel Suite1 by Weifen Luo. It is very nice, and the demo application does a very good imatation of VS.Net, so I'm very excited to try it out.

1 For such a snappy UI, it sure has a plain web page :-)

Published at

Simple things aren't

What he's doing there might give you nightmares.

Raymond Chen blogs about the simple act of getting the size of a directory, not so simple after all, if you take into account all sorts of obscure stuff like reprase points, hard links, sparse files, compressed files and file streams.

It remind me an article about file copying by Joel from some time ago.

"CCITT" -- Can't Conceive Intelligent Thoughts Today

"Yes, it's tough, but not as tough as doing comedy." -- Final words of Edmund Gwenn, actor, d. September 6, 1959 (When asked if he thought dying was tough.)

[Listening to: Sealed with A Kiss - Agnetha Faltskog - My Colouring Book(02:35)]

Favoraite song

I'm on vacation and I'm currently hearing my favoraite song, and the volume is so loud that I can feel it in my bones.
Life is good... :-)

[Listening to: 17 - The Show Must Go On - Queen - Classic Queen(04:12)]
 
Update: Just as I was going to post this I got a phone from work about some problem there. My one wish for the new year? Abolish mobile phones! (Except for my girlfriend, of course).
 
"What is the Origin of 'Foo': Of course, it also comes from the same WWII genesis as SNAFU." -- Tech Support Slogan
 
"Great spirits have always encountered violent opposition from mediocre minds." -- Albert Einstein
 
 

Published at

Words to write code by...

Adam Bosworth write about a talk he gave in ICSOC04.

The subject? Keep It Simple, Stupid!

"The engineering is hard, but the user model is simple and sloppy."

"A moving object appears to shrink in the direction of motion as seend by a stationary observer." -- Albert Einstein

"If it was easy, the hardware people would take care of it." -- Tech Support Slogan

[Listening to: Linda Ronstadt - Heat Wave - - (02:46)]

Published at

Lambada in C#

Sriram Krishnan attempts to create lambada in C#, and James Robertson sneers at the attempt.
Peronally, I don't understand why she took the string approach even if she wanted to remain general. Delegates are perfectly possible to move a delegate around in a type-safe manner.

Here is a possible solution1, it works for both static and instance methods.

     1: using System;
     2: using System.Collections;
     3:  
     4: namespace Lambada
     5: {
     6:     class Mai2n
     7:     {
     8:         private static string[] words = {"dog","cat","mink"};
     9:         delegate void StringDelegate(string args);
    10:         delegate string RetStringDelegate(string args);
    11:         delegate void IntegerDelegate(int i);
    12:  
    13:         private static void PrintInt(int i)
    14:         {
    15:             Console.WriteLine("Integer: " +i);
    16:         }
    17:  
    18:         private static void PrintStr(string str)
    19:         {
    20:             Console.WriteLine(str);
    21:         }
    22:  
    23:         private static string Capitalize(string str)
    24:         {
    25:             if(!Char.IsUpper(str,0))
    26:                 str = Char.ToUpper(str[0])+str.Substring(1);
    27:             return str;
    28:         }
    29:  
    30:         private int multiplyBy;
    31:         public void Multiply(int i)
    32:         {
    33:             Console.WriteLine("Multiply by "
+ multiplyBy +": " + i*multiplyBy);
    34:         }
    35:  
    36:         public static void Main(string[] args)
    37:         {
    38:             Mai2n m = new Mai2n();
    39:             m.multiplyBy = 2;
    40:             Map(new StringDelegate(PrintStr),words);
    41:             Map(new IntegerDelegate(PrintInt),new int[]
{1,3,5,7,11,13});
    42:             Map(new StringDelegate(PrintStr),
    43:                 ReturningMap(new RetStringDelegate(Capitalize)
                         ,words));
    44:             Map(new IntegerDelegate(m.Multiply),new int[]
                             {2,4,6,8,10});
    45:         }
    46:  
    47:         public static void Map(Delegate d, IList list)
    48:         {
    49:             foreach (object o in list)
    50:             {
    51:                 d.DynamicInvoke(new object[]{o});
    52:             }
    53:         }
    54:  
    55:         public static IList ReturningMap(Delegate d, IList list)
    56:         {
    57:             ArrayList al = new ArrayList(list.Count);
    58:             object ret;
    59:             foreach(object o in list)
    60:             {
    61:                 ret = d.DynamicInvoke(new object[]{o});
    62:                 if(ret!=null)
    63:                     al.Add(ret);
    64:             }
    65:             return al;
    66:         }
    67:     }
    68: }

Here is the output of the above program:

dog
cat
mink
Integer: 1
Integer: 3
Integer: 5
Integer: 7
Integer: 11
Integer: 13
Dog
Cat
Mink
Multiply by 2: 4
Multiply by 2: 8
Multiply by 2: 12
Multiply by 2: 16
Multiply by 2: 20

 

1 Possible restrictions about no error checking, validation etc apply :-)

 

"A coat hanger is 44 inches long when straightened." -- Fact of lifes

"Quality assurance: A way to ensure you never deliver shoddy goods accidentally." -- Tech Support Slogan

"If you yelled for 8 years, 7 months and 6 days, you would have produced enough sound energy to heat one cup of coffee." -- Fact of lifes

[Listening to: Better Than Ezra - One More Murder - - (04:39)]

Long bets - Israel & the Palestinians

Brad Abrams asks about a site for long bets, and get an answer in a comment that the site is call Longbets.org.

The curious thing about it that I run a cursory search and, naturally, there is a long running bet for a peace between Israel and the Palestinians because of some improvements in water technologies (didn't investigate the spesific technology).

Registerring isn't free, so I answer this arguement here:

The reasons for Israel & the Palestinians conflict1 are much deeper than water conflict. The issue is deeply embedded within the culture of both people. The conflict is about land, and religion, a way of life and a culture. We live within two steps of one another, but we are very different.

To think that solving the water supply would end the conflict is to be hopelessly naive.

My bet?
There will be no resolution2 to the Israel - Palestinians conflict in the next five years3.

1 I'm using very neutral language here.

2 Resolution defined as:

  • Israel formally acknowledge a Palestinian state.
  • Israel trasfer full responsability for the internal affairs of this Palestinian state, including in security matters.
  • The Palestinians formally renounce the Right to Return
  • The Palestinians stop the propoganda against Israel in all goverment controled media and in the schools.

3 By God, I so hope that I'll have to swallow those words.

Published at

Wanted: Explanation about Word

Can someone explain me what is the purpose of the little thingie? I don't even know how to call it.

Published at

Reading

I'm currently reading Hibernate In Action, since there is no docmentation whatsoever (or nearly so) for NHibernate itself.

 Hibernate in Action (In Action series)

 "Life's A Witch And Then You Fly" -- Bumper Sticker
"On a clear disk you can seek forever." -- Computerworld Button
[Listening to: עידן רייכל - ממעמקים - עידן רייכל - (04:23)]
Tags:

Published at

The one reason I want .Net 2.0 now

It's not generics, and it's not SQL Server Express, or anonymous delegates.

It's VS.Net 2005 ability to show me the content of unhandled exceptions that while debugging. VS.Net 2003 just show me an ugly dialog, with 2K5, I can check what the problem is, and in 99% it's just one second change.

I'm currently exploring NHibernate and I'm getting a lot of those exceptions, and it's annoying to stop debuggin, put try/catch blocks, read the exception message, explore inner exceptions and then make a single change, and then it works.

It makes a short task much longer than neccecary. Anyone knows about an add-in for VS 2K3 that does this? I would move to VS 2K5, but it doesn't support Resharper, and I'm addicted to it.

Tags:

Published at

Here be Bugs

Perhaps I shouldn't be a developer, I seem to have much better future as a tester, I find so many bugs when I try to program.

My most recent experiment was with NHibernate. I'm not asking for much, all I want is a bug tracking database that I can put to use on my personal projects. Unfortantely, BugZilla and I didn't get along and I finally removed it.

I can't get Sql Server or MSDE to install on this computer, probably because I install/uninstalled so many times (including SQL Server Express betas) that now I get an install that seems to work, but leave me with a server (probably) but no way to access it (which is why I'm not sure that I've the server).

I couldn't find a bug tracking software that work with MySql/SqlLite/Access/Files that I would like. Meaning that it was free, easy to install (read: didn't require me to jump throught hops) and optionally offer smart client features (IE, windows application).

There are  all sorts  of  bug  tracking  software  that  I tested, but nearly all of them either require Ms Sql Server or were ports from linux that required me to install strange stuff on my computer just to test them. Considerring the amount of works that it takes, I wasn't willing to make the effort.

I'm reading a lot about O/R Mappers so I decided to try NHibernate due to the excellent review by Scott Bellware.

As I mentioned, I want a bug tracking software, so I decided to try a proof-of-concept bug tracking with NHibernate. I installed MySql and was very surprised by the quality of the tools (There is a reason why I insist on using only .Net tools when possible, the UI is usually better.) I wish that I'd something similar to use on Sql Server Express (and no, the Express Manaager doesn't come close.)

NHibernate is a port of Hibernate, so it's pretty mature design-wise (still learning it, can't comment on the quality of the code) but it has one big problem, and that is its documentation. I only now got it to work on my machine, and I've been trying for over a day to just pull a value from MySql Server and then print it to the screen. I'm happy to confirm that I finally managed it.

The second problem that NHibernate has is poor error reporting, the main problem was that I didn't reference MySql.Data.dll assembly, so it couldn't connect to MySql, but the error I got was "problem in find" with an inner exception complaining about NullArgumentException in Activator.CreateInstance().

Usually I'm very relucant to debug other people code, especially when it's such a big undertaking. You need to learn the code to debug it, and that usually take quite some time. But I was angry, it was at friday morning and it's raining outside, so I didn't care. Eventually I found out the problem, and right there in the comments it tells me that I need to reference MySql.Data.dll and then it silently fail if I don't.

This is a case where a single assertion would've saved a lot of trouble.

Anyway, it's working now, so I'm going to continue to experiment.

I'll post my results soon.

Tags:

Published at

The Graphing Calculator Story

I found it through Slashdot, hilarious.

The part I like the most: " We wanted to release a Windows version as part of Windows 98, but sadly, Microsoft has effective building security."

FireFox Security debate

Frans Bouma talks about Peter Torr post regarding firefox security, his conclustion is that Peter is somehow in denial.

Personally, I find that Peter was right on the mark. Yes, Firefox is more secured than IE (for the time being) but what Peter was talking about were flaws in the way Firefox handle it security UI now. And saying that IE does worse (and in those spesific case, it doens't) help no one.

Those problems are real one, and they won't go away with finger pointing.

Published at

Firefox trust

I've been a loyal Firefox user for quite a bit, but I completely agree with Peter Torr when he criticize Firefox secuirty problems.
He sums it up very nicely:

·Installing Firefox requires downloading an unsigned binary from a random web server

·Installing unsigned extensions is the default action in the Extensions dialog

·There is no way to check the signature on downloaded program files

·There is no obvious way to turn off plug-ins once they are installed

·There is an easy way to bypass the "This might be a virus" dialog

Published at

Desktop search engines

Scoble talks about trust and desktop search engines, but I don't like the way it's presented.

Scoble isn't an objective party, but even so, I think some of his points were directed too much toward other's flaws rather than their own strengths. Here are my answers:

  1. Indexing cache or history - Reading the browser cache was a mistake, but why shouldn't I be able to search through my history? It's already built in into IE, so there are no privacy issues there. I often need to find some page that I visited, and the alternative to searching my history is searching Google :-)
  2. Sending data back - MSN doesn't phone home if you're not part of customer experiance feedback, but that is the default for MSN DS and you can turn it off easily in both Google DS and MSN DS.
  3. Sharing private data between users - It's nice that MSN DS doesn't do it, but a statement such as "Not sure about others." bring us back to the good ole days of MS FUD. As far as I know, GDS doesn't expose anything that you can't reach as your user, it just make it so much easier to find those things.
  4. Index obfuscation - say what? I'm not sure how this is relevant, and I certainly didn't see an option in MSN DS to point it to another user index file and use that one, not even as admin. Even so, I can't think of many instances where this would be needed. And if so, simply running the software as that user would give me what I want.
  5. Automatic downloads - I agree that GDS shoudln't auto install without asking, but can you really tell me that a security bug in MSN DS wouldn't be on Windows Update (In other words, it would auto-install on MS' recommended settings.) What GDS is doing wrong is that there should be an option (and yes, it should be on by default).

When all is said and done, I'm still using MSN DS rather than GDS because of the much slicker interface.

"There's no government like no government." -- Bumper sticker, seen in Berkeley, CA

"IBM: Impersonal Bellicose Magnate" -- Tech Support Slogan

[Listening to: אולי על שפת הים - היונים ויהורם גאון - אולי על שפת הים(04:02)]

Published at

Reading

Most of what I do with the computer this days is reading books / essays / blogs :-) / web / etc.

For those things, protraint mode is superb, as Scooble often tells us.

I don't have the dough to invest in a Tablet PC  - prices in Israel are outragous, the cheapest model I found costs over 9300 NIS ($2,152.28), while my laptop cost less then 8,000 NIS ($1,851.2) for much better performance.

But I'm digressing, I got myself a LCD monitor some time ago, and the one feature that it has that makes sure that I would never go back to CRT monitor is that it rotate to portait mode.

It's a LG L1800P, and while it may not be the prettiest thing out there, it's wonderful.

For the games, I play HL2 on it and I can't notice any degration in performance then a CRT monitor.

Published at

Birthday

I'm 23 years old today :-D

A lot more people then I thought has called and congratulated me. I didn't know that my birthday was so wide known.

It's good to have friends.

"Everybody needs a little love sometime; stop hacking and fall in love!" -- Tech Support Slogan

Regarding yesterday's posts, I'm listening to Queen's collection and I suddenly heard this song, spooky:

[Listening to: Mustapha - Queen - Jazz(03:01)]

League of hearts oath

"The gentile shall not see us cry, nor hear our mourn and moans,
With bodies sturk with despair and falling to our knees with a groan;
After their pleasure on the blood, they shall not thrive on the tears.
"

This is my attempt to translate a (part of a) poem by Uri Zvi Greenberg (full Hebrew version found here).
Far harder to do it then I thought it would be.

Published at

Am I an axiom of journalism?

I've been searching up on the net about the Israel vs. Palestinians conflicts. Found quite a bit of opinions, a lot of hot heads some opinions that I've not seen before, both pro and against Israel. It has been an interesting, if sometimes infuriating read.

I've finally found a New York Times article from Feb 26 1990 that relates very strongly to current events in the Middle East, it's called "Judging Israel". I've been taught about it, but this was the first time that I actually read it. Very good read, even fourteen years after it was first published.

Here are some selective quotes:

"Milan Kundera once defined a small nation as "one whose very existence may be put in question at any moment; a small nation can disappear and knows it." Czechoslovakia is a small nation. Judea was.
Israel is.
THe U.S. is not.
"

"That is a double standard. What does a double standard mean? To call it a high standard is simply a euphemism. That makes it sound like a compliment. In fact, it is a weapon. If I hold you to a higher standard of morality than others, I am saying that I am prepared to denounce you for things I would never denounce anyone else for."

"The conscious deployment of a double standard directed at the Jewish state and at no other state in the world, the willingness systematically to condemn the Jewish state for things others are not condemned for - this is not a higher standard. It is a discriminatory standard. And discrimination against Jews has a name too. The word for it is anti-Semitism."

As a person who is constantly in touch with Palestinians terrorists (in the most literal sense of the word, several of them has blood on their hands) I cannot disagree with the sense of this double standard, and I acutely feel how much this double standard is harming Israel. I'm by no mean an objective on this subject, but it's just so frustrating sometimes.

Published at

MSN Search & Viruses

I turned on the monitor a few moments ago and discovered a huge red warning dialog about viruses in MSN Search's directories. I couldn't understand what was happenning until I checked my junk mail, and then I saw several files that most propaply contain viruses. (You know, those email with a "re:" as a subject and a .cpl file).

I'm getting quite a bunch of those, but Outlook is very nice and just block them, and my filters automatically flag them and throw them in the junk. But MSN Search found it and copied the files to its temp directory, where my anti virus found it.

Any ideas how to solve it?

"Dreams are free, but you get soaked on the connect time." -- Tech Support Slogan

"You think Mercedes Lackey should be a cultural icon." -- Unknown

[Listening to: Prince - Vanessa Carlton - Be Not Nobody(04:10)]

TestDriven.Net

TestDriven.NET

"Windows 3.1" -- The best $89 solitaire game you can buy

"Truth is the enemy of power, now and always." -- Unknown

[Listening to: Ordinary Day - Vanessa Carlton - Be Not Nobody(03:58)]

Published at

WB Editor version 2.0

I posted before about WB Editor, my biog posting client. Now I've got their 2.0 version, and it has much improved interface.

I like it, and I finally gotten around to install the Quote Inserter plug in. They fixed the problems it had regarding losing post content if you tried to open / write a new post.

[Listening to: סיפור מכור - מאיה בוסקילה - (04:28)]
 
All in all, a good 20$."Me and my two friends... GIF and Wesson." -- Tech Support Slogan

"You know that you are more likely to be killed by a champagne cork than by a poisonous spider." -- Fact of life

Published at

WB Editor version 2.0

I posted before about WB Editor, my biog posting client. Now I've got their 2.0 version, and it has much improved interface.

I like it, and I finally gotten around to install the Quote Inserter plug in. They fixed the problems it had regarding losing post content if you tried to open / write a new post.

[Listening to: סיפור מכור - מאיה בוסקילה - (04:28)]
 
All in all, a good 20$."Me and my two friends... GIF and Wesson." -- Tech Support Slogan

"You know that you are more likely to be killed by a champagne cork than by a poisonous spider." -- Fact of life

Published at

On lanagues again

Joel complained about translating from Hebrew to English, I now have the reverse problem.

How do you (succinctly) say "Do (only) good" in Hebrew?

Gmail invites to anyone that makes it, I can't think of a pharse that fits.

Published at