Far Away Developer

Sebastien Lachance

Archive for July, 2007

Windows Forms : Owner and Owned Forms

Posted by Sebastien Lachance on July 31, 2007

Since I’m pretty new to Windows Forms I learn a lot this days (I have done mainly ASP.NET development). I came across this feature and find it really interesting, Owner and Owned Forms. We can say that for the user it’s the same thing as the ShowDialog() method (grayed parent form, etc…). However, with ShowDialog there is no built-in way to make a link between the parent and the child form.

There is 2 way we can make this relation :

1. As a parameter in the Show() method

Form1 childForm = new Form1();
childForm.Show(this); //this is the parent form

2. Using the properties

Form1 childForm = new Form1();
childForm.Owner = this; //this is the parent form

And you can iterate through the child forms of the parent form with the OwnedForms property.

Posted in .NET, Windows Forms | 1 Comment »

ScummVM

Posted by Sebastien Lachance on July 31, 2007

Do you remember Sam & Max, Full Throttle and Day of the Tentacle (Dott!)? ScummVM allow you to replay these kind of point and click adventure games. You only need to have the data file for them and you are ready to go. There are also different port: Nintendo DS, Dreamcast, PlayStation 2, etc… I think I’m gonna give it a try on the DS as soon as I have all the component. I would really like to play Monkey Island on the bus.

ScummVM is the winner of the Best Project for Gamers award on the SourceForge 2007 Community Choice Awards.

Posted in Fun | 1 Comment »

30 Day Trial : Push-Up (Day 1)

Posted by Sebastien Lachance on July 31, 2007

Good news, I will see progress! Since I was not able to do a full one. I will probably do them on my knees for the next couple of days. I forgot to mention how much I will do each time. It’s simple, 3 series of the maximum I can do. I hope to be able to do at least 20 at the end of the trial.

Posted in Fun, General | No Comments »

30 Day Trial : Push-Up!

Posted by Sebastien Lachance on July 30, 2007

Following the idea of a 30 day trial from Steve Pavlina’s blog to start a new habit, I have decided to give it a try with something I wanted to do for a long time, improving my health. The trial I want to do is doing push up everyday for 30 day without any days off. It does not seem too hard and will be a good candidate to this test.

So tomorrow will the first day and I have put a widget in the side bar to keep you informed of my progress.

But if you want to know why I do this commitment on my blog, you need to check this Web Worker Daily post which is all about being more productive with a blog.

How will I do my push-up ?

As shown on eHow : How to do a proper push-up.

Posted in Fun, General | 2 Comments »

Kooza !!!!

Posted by Sebastien Lachance on July 28, 2007

The Cirque Du Soleil has just launched a new show : Kooza. If you’ve never seen them before, this is the one who will make you purchase another ticket.

It was fantastic!! Unbelievable! You can’t just imagine how it was. You can’t imagine just in seeing the video. You need to be there. And if you happen to have seen it, yes it’s arranged (you know what I mean).

Posted in Fun | 2 Comments »

First experience with Visual Studio 2008

Posted by Sebastien Lachance on July 28, 2007

Yesterday I downloaded the Beta 2 of Visual Studio 2008 and .NET 3.5. And I decided to start writing a little journal application. During the first hour I had not seen anything new and was wondering what are the advantages of migrating to 2008 if you are not doing Web Application (new features concerning CSS, JavaScript, debugging, etc..). I decided to do a quick search on Google, and found the ScottGu’s Blog (highly recommended) which was enumerating some new features. And found 2 that was directly applicable now to my application : Automatic Properties and Query Syntax.

Automatic Properties

Suppose you are writing properties for a class. Don’t you find that you are creating private field for nothing. Wouldn’t it be simpler that the compiler generate it automatically for you. Check this out :

public DateTime? EntryDate
{
   get { return _entryDate; }
   set { _entryDate = value; }
}

become

public DateTime? EntryDate { get; set; }

Less code means more time to do something else, so I’m happy!

Query Syntax

I had a collection of JournalEntry instance and wanted to find the one containing the date the user selected. The way I had done it at first was to iterate through the collection and check if the date was the same (I could have done it with predicate too). But the way LINQ handle it was too cool not to try it.

P.S One advice before you try this. Make sure the project is compiled using .NET 3.5 and you reference System.Core.

My little loop has became this :

IEnumerable<JournalEntry> results = from j in Journal
                                    where j.EntryDate == selectedDate
                                    select j;

Posted in .NET, Visual Studio | 1 Comment »

Tower Defense games Collection

Posted by Sebastien Lachance on July 22, 2007

Here is a collection of all tower defense games on the Internet. Be advised that your day will be lost if you take a look at this site.

towerdefence.net

Posted in Fun | 5 Comments »

wikidot.com Personal knowledge base

Posted by Sebastien Lachance on July 20, 2007

For a long time I wanted to have a personal knowledge base that I will use to keep all the code snippet frequently used. I was also needing a place to keep all my todo and useful text. After reading the LifeHacker book (which is excellent by the way) I have decided to do a quick search for online wiki. After some research, WikiDot.com was the one that fit most of my criteria. I needed it to be private so nobody can see my personal stuff and most importantly, be free.

There is also WikiSpaces which is free, but if you want a private wiki, you will have to pay.

Posted in Fun, General | 1 Comment »

SourceSafe on VPN

Posted by Sebastien Lachance on July 20, 2007

First thing : it’s slow. You can’t imagine how it is slow. There is nothing to do, it will stay slow if you access it with the LAN mode. But there is a solution that will help SourceSafe to be a little faster. You need to use Remote Web Access over Http. The time to check-in a single file in my case, has gone from 1 minute to 5 seconds.

Here is some link that will help you setup your environment:

How to: Enable the Internet Service for Remote Access

Alin Constantin : Installing and configuring Microsoft Visual SourceSafe for Internet (Remote) access

Posted in General, Programming | 1 Comment »

Photosynth and Seadragon

Posted by Sebastien Lachance on July 19, 2007

In case you have not seen this very cool presentation done at the TED conference, check this out there : Photosynth. This is a project I would do anything to work on it. They are reconstructing the Notre-Dame Cathedral with image from flicker. Can you imagine that! Unbelievable!

If you still have time to check another video, check the Tony Robbins presentation. I have read his book some years ago (his name in the french book is Anthony Robbins, translator have this crazy idea that name can be translated, by example : Buster in the Mythbuster show is called Jimmy) and he had help me a lot finding what I wanted to do in life. He is very entertaining and motivating.

Posted in Fun, General | No Comments »

Rise of the Ruby

Posted by Sebastien Lachance on July 17, 2007

2 years ago, someone told me Ruby will be the “next big thing”. I told him “no way”. C# will gain more and more popularity and ASP.NET 2.0 will totally rules. God, I was wrong. After 2 months of Ruby On Rails, I must admit it’s here to stay. The ease of use of the Rails framework is impressive. In 30 minutes I have managed to create a little web application to keep track of my weight with complete support for creating/editing/deleting as well as listing all items. This was the first minute, the remaining 29 minutes was modifying the design and doing some CSS.

If you have never seen the coding of a blog engine by a ruby on rails programmer, then you must absolutely check this screencast.

There is a lot more screencasts that will encourage you to go further on the Ruby On Rails website.

And a bonus for all of you who are already into ruby : RailsCasts

Posted in Ruby | 2 Comments »

Windows Live Writer

Posted by Sebastien Lachance on July 16, 2007

Some months ago (when I was blogging on WDevs) I was using Windows Live Writer a lot. The only problem I had, was to configure it to actually see my blog. And today I have decided to give it a second try. And, wow, no problem at all. Everything is working perfectly. There is also some interesting plug-in that will enhance my experience (ex : Syntax Highlighting and Flicker4Writer).

This, has made my day. :)

Windows Live Writer

Posted in Blogging | No Comments »

Getting rid of intellisense addiction

Posted by Sebastien Lachance on July 16, 2007

For a month now, I trying to learn ruby and the Ruby On Rails framework. The biggest difficulty so far was programming without intellisense. Honestly, I’m loving this difficulty. I reading a lot more the documentation that before and find this really helpful for my learning. But the coding is a lot more slower and by chance, this is a personal project and I have no deadline (and you can get a project done really quick with Rails, believe me !).

Now, if only I can get rid of the mouse …

Posted in Programming | 2 Comments »

My first continuous integration server is complete !

Posted by Sebastien Lachance on July 12, 2007

I have completed configuring my first continuous integration server for an ASP.NET Web Application.

Here is the workflow:

  1. Get the latest source from SourceSafe.
  2. Compile of course. The first compilation is done with MSBuild.
  3. Second compilation with devenv.exe (Visual Studio). For some reason, MSBuild does not compile deployment and Setup project.
  4. Run unit test with MSTest.
  5. Run Simian to detect code duplication.
  6. Delete previous log file.
  7. Deploy the web application.
  8. Copy Web.Config to the web application folder.
  9. Create database and execute all the database scripts.
  10. Start Selenium Remote Control and execute all functional tests.

The tools used are:

  • CruiseControl.NET
  • sqlcmd
  • NAnt
  • Visual Studio 2005
  • Selenium Remote Control
  • MSBuild
  • MSTest
  • Simian

I have been through a lot of problem during the setup, but how fascinating it was! I was in constant learning.

Posted in Agile, Continuous Integration | No Comments »

Getting started with Selenium IDE - Part 1

Posted by Sebastien Lachance on July 11, 2007

As promised, I will return back everything I have learned about Selenium. I invite you to go the OpenQA web site for additional information.

If you stick with me for this series of article, you will get a great quick start to create good acceptances tests.

Selenium IDE (Integrated Development Environment) is a Firefox extension that records your actions on a page. Then you can execute them back with the IDE or with other version of Selenium (Selenium Remote Control is one of them).

First step : Download Firefox

Second step: Install Selenium IDE extension on your browser

(If , for some reason, the Selenium IDE can’t replay your test, switch to a previous version.)

Third step : Record your first test

  • In Firefox, go to Tools\Selenium IDE.
  • Make sure the record button is pressed.
  • Navigate on the web application.
  • Press the green arrow (start button).
  • Your first test is done.

Now, maybe the replay has not worked and you got some errors. This will be covered in the next post when I will show you how to add others commands to your Selenium test.

Here is some features found in the interface:

  • There is the baseURL text field. Suppose you have two times the same web site, you want to have this attribute because you will avoid hard coding the path in the test. Simply specific another baseURL and the test will be performed on it.
  • Run/Walk/Step. This is basically the speed at witch the test will be executed. However, Step will require you to press the “Step” button to go line by line. Very useful.
  • Of course you can save the test, juste press Ctrl-S or go to File/Save Test.
  • Table/Source tabs. Basically, a test is just an html file (not entirely true, you will see later), composed of a table element, and 3 columns (each one has a specific purpose).
  • Play with Selenium Test Runner. This will launch a test runner for your test (will be covered later).

A lot more is possible and this is only the beginning.

If you find missing information, just leave a comment, and I will update the post.

Selenium IDE Getting Started Series

Posted in Tests | 4 Comments »