Ayende @ Rahien

Refunds available at head office

SharpDevelop Cool Features...

I'm currently using version 1.1.1799 and I'm discovering some very nice stuff about it.

  • Project > Export to HTML...
    This allows you to output the entire content of the project / combine (solution in SD's dialect) as HTML, including line numbers & highlighting.
  • Intergrated Assembly Analyzer which is either FxCop or a direct copy.
  • Integrated unit testing and NAnt support
  • Much better support for Boo, even though I didn't upgrade my BooBinding, just linked them to the new version.
  • Slicker, better look.

Really nice experiance.

Sharp Develop annoyance

The best thing that I can say about #Develop is that it's easy to integrate new languages to it, and that it provide a very good user eperiance for C#.

The bad thing is that I began to encounter a strange bug in the text drawing on version 1.0.3.1768 (the latest right now).

You can see the problem here, this doesn't happens always, and not just for Boo code, but when it does happen (and I wasn't able to track why) it happens consistently, and nothing I can do (including setting double buffering off, which seems to fix it, but then render it unusable for other reasons, restarting the application, etc) didn't help.

Argh!

Update: I found the cause just 20 seconds from posting this article! I knew I'd a reason to blog :-)

The problem seems to be that I sometimes move one of my monitors to portrait mode, and SD doesn't seem to be able to handle this gracefully.

Moving to the second monitor in landscape mode fix this. And changing the first monitor to landscape mode will fix this as well.

I can't recommend portraint mode highly enough if you are going to be reading, especially if you are going to read code. There is so much more that you can see in portrait mode.

It isn't as good for writing code, mind you. This is mainly because all the sidebars (yes, I know I can move them) that takes up horizonal space and don't leave much room for the code.

Nhibernate Query Analyzer 0.6.2

You can find the new version here:

New features:

  • Offers dynamic loading from anywhere your system, and not just from the application base path.
  • Performance measurements.
    Pay attention!
    This is not something you can rely on, this is one time data, and it can be skewed by network latencies, file I/O, the phase of the moon and just random wierdness. It does provide some base line, but you need to do real profiling before you can go ahead and change your code

http://developer.berlios.de/projects/nqa/

Get out of jail free canine card

I got my dog out of jail today, he was "arrested" for jaywalking. Apperantly there was some bitch (that is the technical term) in heat and he and two others were crowding the poor owners.

I actually had to pay bail for him, and not a small amount either.

Do I spend enough time as it is in prisons?

Interesting article about OSS, IP, Patents, and lawsuits

Do read "When are you going to sue your customers?", it's a very good read.

I can think about one company that sues its customers, Apple :-)

"CChheecckk yyoouurr dduupplleexx sswwiittcchh.." -- Tech Support Slogan

"Breakthrough: It finally booted on the first try." -- Tech Support Slogan

"The steady state of disks is full." -- Ken Thompson

[Listening to: Who Do You Want - Gidi Gov - Who Do You Want CDS(03:49)]
Tags:

Published at

First google search!

I just got a referral from google that search for me by name!

This is the first time in living memory...

Whoppe :-)

Evil

I am 39% evil.

I could go either way. I have sinned quite a bit but I still have a bit of room for error. My life is a tug of war between good and evil.

Are you evil? find out at Hilowitz.com

Boo - half way through summary

Do I get a little obsessive about Boo? What do you think?

What I like in Boo1:

  • Anonymous methods now, so you can things like:

    (

    new Thread({print "Hello"}).Start()
  • No punctionation for control flow, this mean that you can do things like this:

    if

    not scanned:
     
    Scan()
    Instead of C#'s way, that often caused me to ignore the '!'

    if(!scanned) 
       Scan()

    There is a solution that is worse then the problem in C# - this one hurts my eyes:
    if(scanned==false)
      Scan()
  • The syntax support things like this one, which is cleaner then the C# way.

    logger.Debug(string.Format("Scanning {0}", entry.Key )) if (logger.IsDebugEnabled)

  • Many things that feels natural to me (from C# background) works the same in Boo. - Yes, it's a duplicate of what I don't like.
  • Has a natural property syntax, so you can do things like to avoid al the tedious get/set:

    [

    property(BaseDirectory)]
    baseDir as string = Environment.CurrentDirectory
    Moreover, do you recall how many times you created code that like this:

    string baseDir = Environment.CurrentDirectory;
    public
     string BaseDirectory
    {
      get
      {
          return baseDir;
      }
      set 
     

          baseDir = value; 
       }
    }

    This translate to this code in Boo which no ammount of IDE-Magic can beat.

    [

    property(BaseDirectory)]
    baseDir as string = Environment.CurrentDirectory
  • Allows you to define your own language constructs, using, with, transaction, lock, are not compiler magic, but code that you can modify or create new things. Wants to use your favoriate language feature? Just code it and it's there. This is the first time that I encountered a user-extensiable compiler. The potential for use is wonderful, the potential for abuse is... Well, let's just hope that it's a complex enough feature that the clueless won't get their hands on it.

What I don't like1:

  • No good IDE - sorry, SharpDevelop doesn't cut it, I've numerous bugs {using 1.0.3.1768} that caused data loss, and it frequently lock itself up, requiring killing the process
  • No Resharper - This is the killer for me
  • No visibility checking for now, so you can call a private method and that would cause a runtime error instead of compile time error.
  • Debugging through DbgClr, which does the job, but... it isn't the same experiance.
  • The compiler's error messages (which I get a lot of right now) aren't as good as C#'s. That is probably because the C# compiler bends over backward to gives you meaningful messages.
  • No characters literals, you have to do things like 'a'[0] to get a character - yet.
  • Many things that feels natural to me (from C# background) works differently in Boo. - Yes, it's a duplicate of what I like.
  • The language is still in beta.
  • It uses idention for control flow :-(
  • I keep making mistakes because my fingers & eyes think that I program in C#, so I usually code variables as string bar = "foo" instead of bar = "foo"
  • No literal strings ( @"C:\This\Is\A\Bummer" ), which is a real problem when you're trying to write regex-es that write regex-es, I've parts that makes my head spin.
    For example: regex.Replace("C:\\*\\ayende?","\\\\","\\\\") - Without running it, what is the result? (Here is doesn't matter whatever the code is C# or Boo.
  • A really nice way to select multiply cases, but it's not implemented yet!

    given

    Path.GetExtension(path).ToLower():
          when ".resx", ".resource":

1 In no particular order

Tags:

Published at

Regex riddle

I'm building regex-es that build regex-es here, which makes my head spin

Here is a riddle for your:
regex.Replace("C:\\*\\ayende?","\\\\","\\\\")
Without running it, what is the result? (Here is doesn't matter whatever the code is C# or Boo.

Tags:

Published at

Damn, Damn and double damn

I'm currently investigating a sweet little language call Boo. I've been totally blown away by it's abilities. It's so cool that I just can't belive that I didn't know that such a thing exist. It totally blows away C# in terms of ease-of-use.

There are some cavats currently, mainly due to the fact that the language is still in beta, but already it has some great potential.

The double damn is that I just spent three or four hours coding, and lost it all just as I was about to finish because of #Develop.

Tags:

Published at

Boo!

I'm interested in learning dynamic languages, but I don't want to leave the CLI, so I decided to investigate IronPython. I started reading about it, then I got (somehow, no idea how) to Boo.

Read the manifest.

After reading this, and considerring that this is the first non C-derived language that I'm planning to learn (VB & Pascal aren't really that different. Different syntax, same way of thinking) it looks way cool.

 

"Stewardesses is the longest word typed with only the left hand." -- Fact of lifes

"Boat: A hole in the water surrounded by wood into which one pours money" -- Definate Facts

"The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed." -- Albert Einstein

[Listening to: רגעים - ברי סחרוף - סימנים של חולשה(03:48)]

 

Tags:

Published at

Getting Started: NHibernate Query Analyzer

Here is a five minute guides to using NQA:

  • Open the application, there shouldn't be any setup neccecary. Just unzip it anywhere and let it start running.
    NQA saves its settings to a file at "%APPDATA%\NHibernate Query Analyzer\Data.sqlite.db" and this should be completely transperant to the user.
  • Go to Project>Add Files and choose an assembly.
    The assembly must be in NQA BasePath (best thing to do would be to copy it to the same directory as NQA's executable). If the assembly contain "*.hbm.xml" resources then the mapping would be loaded into NHibernate. If the assembly contain a "*.cfg.xml" resource then the setup is done. If the assembly doesn't contain "*.hbm.xml" or "*.cfg.xml" then you will need to add those manually. If your application uses App.config, you can add it directly.
  • When you added all required information then the HQL Query text box should become enable and you should be able to execute HQL Queries.
    An assembly with the classes, a configuration file {either App.config or "*.cfg.xml"}, and the mapping files "*.hbm.xml" - Those can be embedded in the assembly or added seperatedly.
  • Any HQL query is a valid and would result in the following actions being taken:
    • Executing the HQL query and displaying the returned object graph.
    • Executing the resulting SQL and displaying the raw results from the database.
    • If an exception occured, the Error Log tab would be displayed, with it's details.
  • If you want to explore the sample project, you need to add two files, "Ayende.NHibernateQueryAnalyzer.SampleDb.dll" and "Ayende.NHibernateQueryAnalyzer.SampleDb.dll.config" to the project, at this point NQA will allows you to execute queries on the database.
    You can see the mapped classes in the Configuration tab, under Class Mapping

Book Review: Alta

Alta is the second of book by Mercedes Lackey, following Joust. It's a fantasy novel about dragons, and intrigue, and friendships, and some more dragons.

I read it in one seating (432 pages), and immnesly enjoyed it, just as I enjoyed Joust.

Highly recommended.

Tags:

Published at

Word Choice May Haunt Your Blog

 [via you've been HAACKED[Via Scoble]

http://www.molly.com/2005/01/15/the-accidental-blogger/ THE ACCIDENTAL BLOGGER is what I'm going to call what happens when a blogger writes a post that accidentally becomes far more important to their site than ever intended. I certainly never intended that racing frogs and the death test would be among my more popular threads, but there you ...

I am not a native English speaker (in fact, I don't get to speak much English. Only when the ICRC comes to visit) so I make a lot of spelling mistakes (and I hate spell checking).

Because of this, I made some pretty horrible typing mistakes, and appernatly they are generating the most views from google searches:

The Incridibiles

Read Habbits

Laptob

Book Review: Coding Slave

I bought this book because I was certain that it was dilbert-in-a-book. The book is supposed to be about an ERP implementation in a company, and the start was really promsing.

The problem is with the rest of the book, which then digress to the characters acting in totally unbelievable ways (whatever-it-takes-to-please-the-client, for example) and the book stops being fun.

The worst part of it that the book is trying to sell you the author's point of view regarding the way we should develop software. I'm not saying that it would be a good way to do so, but somehow I felt like reading some of  Karl Marx's works.

All in all, I didn't like it very much.

Tags:

Published at

NHibernate Query Analyzer Subversion Repository

 Well, it seems like a made a really stupid goof and logged to the wrong server trying to do this.

The Subversion repository is now open and can be anonymously accessed at: svn://svn.berlios.de

Just execute  svn checkout svn://svn.berlios.de/nqa 1

1 It may take a few hours for the site to display this, by the time you'll read this, it should already be online and working.

NHibernate Query Analyzer 0.6

Well, I've fixed some bugs (mainly UI ones, and one regarding a mistake I made writing the mapping files).

New stuff:

  • Now using NHibernate 0.6
  • Got rid of the TreeListView and wrote a custom control to display object graphs
  • Many bug fixes

I opened a project at BerliOS Developer Logo for NHibernate Query Analyzer, the adress is: http://developer.berlios.de/projects/nqa/

I choose berlios.de over SourceForge.net because berlios.de offer Subversion access with all the features of SourceForge1.

1 Update: The Subversion repository is now open and can be anonymously accessed at: svn://svn.berlios.de

Just execute svn checkout svn://svn.berlios.de/nqa.

Tags:

Published at

Movie review: The Grudge

I don't usually go to horror movies, and after seeing this one, I know why.
It's a good movie in the sense that I jumped in all the right places, and I was really tense most of the movie. And now that I'm out of there I don't think I'll have trouble sleeping etc.

However, I don't think that I'll be able to see someone sticking out their tongue and not shudder for the next few days.

Book Review: Hibernate In Action

The book is directed at Java developers interested in learning Hibernate, but considerring the similarities between Hibernate and NHibernate, it just as useful for .Net developers who wants to learn how to use NHibernate.

The concepts transfer very easily from one framework to the other, and I've only found two places where NHibernate differed from Hibernate (and one of them got fixed since then :-D)

The book starts with a general view on O/R mappers and the advantages of using them, then moves on to the history of Hibernate (which wasn't quite of interest to me). Then it gets to the fun stuff, starting from a simple exmaple, the books shows you the basics of mapping classes to database, working with persistant objects, transaction, concurrency and caching.

After that, you get advance mapping concets and a discussion about efficency which I found quite useful.

The most interesting part of the book, and the most disappointing for me, was the chapter that talked about how to write applications. Most of Java application are targeted for the web, so the discussion centered around patterns for the web. And far less on local applications. Personally, I develop WinForms applications, and rarely ASP.Net applications, other people experiance vary, of course.

Over all, a really good book.

Creating demos

I just spent the last five hours evaluating all sorts of application to produce flash demos.

{Interestingly, there is no free software on this front, only expansive one :-})

I couldn't find a single one that would allow me to do a flash demo easily. Most of them created the content easily enough, but editing it was pure hell.

Macromedia Captivate is so close to what I need, but for some strange reason is didn't track my mouse, making it totally impossible to work with.

Anyone can recommend on a good solution?

NHibernate Query Analyzer 0.5

Well, I'm ready to show you what I've done so far.

It's an alpha version, so it has many some problems.

Features:

  • Support NHibernate 0.5
  • Support on-the-fly translating from HQL to SQL including error reporting.
  • Support viewing the returned object graph
  • Support viewing the returned data base results
  • There is no save button - see Tog
  • Support configuring from multiply resources (*.cfg.xml, *.config, *.exe,*.dll, *.hbm.xml)

Known problems:

  • You must put your assemblies in the same directory as NQA - this is related to .Net loading non-GAC assemblies. There are solutions out there, I haven't the time to look at them.
  • The TreeListview that I'm using currently as my object viewer is very buggy if you try to do uncommon things such as double clicking on a column to auto expand it. I'll replace it as soon as I'll find a new one that I can use.
  • Code highlighting is not working due to my inability to use an of the free offerring and lack of time to create my own. There is some highly inefficent highlighting on the SQL results windows, but even that is not good enough.
  • Sometime there is a problem if you configure from several resource that contain the same information. NHibernate throws an exception on that, I've not decided what I should do about it. Options are:
    • Leave as is - what I'm doing now, let the user know that they made a mistake, leave it up to him to fix it.
    • Silently ignore - Means that the configuration may not be what the user expected.
    • Silently succedd - The "last one in - wins" scenario.
    • Something else I didn't think about... ?
  • The sample DB is MS Access "grocertogo.mdb" (the only thing that I'd on my computer during development :-)

Planned features:

  • Generating code/mapping/table schema base on supplied files or some GUI editor - for this I would have to have a code editor, so if you know one that I can use, or just can help me with making  ScintillaNET usable to me, I would be very grateful.
  • Some UI modifications, I'm not sure that I like the current UI, it seems a bit clumsy to me.
  • Moving to NHibernate 0.6
  • Add timing so you can see how inefficent your code really is :-)
  • Viewing the log4net output from NHibernate
  • Add a menu to the tree, so you can remove files more easily (right now you need to press "Delete")
  • Refactor the code :-)

Usual warnings apply, alpha code, use at your own risk, all your bases belog to us, etc.
Feature requests, bug reports are welcome if I manage to find a winforms bug tracking software that doesn't use MS Sql :-)

[Update: You can get the files at the project site: http://developer.berlios.de/projects/nqa/ ]

Enjoy. ;-)