Monday, August 07, 2006

Switching blog host

As you might have noticed, I switched from Blogger to WordPress. WordPress is one of the best blogging engine without a doubt. But some fundamental features are not included in the version hosted on wordpress.com like Markdown and Textile support.

Importing posts from Blogger to WordPress was a breeze. And setting up my new blog was equally delicious.

I now can blog from TextMate which make up a bit from the lack of markup support, plus I can add pages, widgets and stuff but not customize the templates... So I guess that when I'll have enough time I'll switch again to Typo on a free Rails host.

My new blog is located at http://macournoyer.wordpress.com/

Sunday, August 06, 2006

Live coding with MonoRail

In my constant quest to bring Castle MonoRail closer to Ruby on Rails development style, one of the thing that kept me from choosing MonoRail over Rails for fun and pleasure was the code-compile-refresh process. Because we're working in the static compiled world, a usual scenario looks like this.

  1. Add or remove some code

  2. Compile from the IDE or run NAnt

  3. Restart the web server (under *nix XSP needs to be restarted to load the new assembly)

  4. Refresh the browser (and wait for the app to restart AR and all other services)


This is painful! Why can't we just code and refresh like with scripting languages?

While reading an article on reddit about Live coding, I had a idea...

# Rebuilds the project periodically and restarts the web server on success

import System
import System.IO
import System.Threading
import System.Diagnostics

SERVER_CMD = 'xsp2'
SERVER_ARGUMENTS = '--root public'
NANT_ARGUMENTS = 'build -nologo -q'
PROJECT_ASSEMBLY = 'public/bin/MyBlog.dll'
REBUILD_DELAY = 1000 #ms

serverProcess as Process
lastWriteTime as DateTime

print "Starting runner process, hit CTRL+C to stop"
while (true):
buildProcess = shellp('nant', NANT_ARGUMENTS)
buildProcess.WaitForExit()

if buildProcess.ExitCode == 0:
if FileInfo(PROJECT_ASSEMBLY).LastWriteTime > lastWriteTime:
print "Project recompiled, restarting the server"
if serverProcess != null:
try:
# Stops the server
serverProcess.Kill()
except e:
pass
serverProcess.WaitForExit()
serverProcess = null
serverProcess = shellp(SERVER_CMD, SERVER_ARGUMENTS)
lastWriteTime = FileInfo(PROJECT_ASSEMBLY).LastWriteTime
else:
print buildProcess.StandardOutput.ReadToEnd()

# Waits a couple of seconds
Thread.CurrentThread.Sleep(REBUILD_DELAY)


If you can't see what this is about...


The other thing that keep me from dropping Rails for MonoRail is C# extra verbose and lack of fun and style. But I can't do nothing about that, except use Boo whenever I can.

Note that this script will soon be integrated in the Generator so when you generate a new MonoRail project, the server script while run something like this.

Monday, July 31, 2006

NProject featured on Miguel de Icaza's blog

I've received a couple of e-mails from people about NProject telling they found about it on Miguel de Icaza's blog... ok well, thanks Miguel, who ever this is...

Thursday, July 27, 2006

NProject featured in the Daily Grind

It seems that NProject is getting more and more exposure too. I just found out it was in the daily grind a couple of days ago. I can't beleive it! Wow!

Also, if you'd like to contribute to the project in anyway please contact me! Their's still plenty of things to be done. If you've got some experience with Castle MonoRail and ActiveRecord and got some crazy ideas about NProject, send me an e-mail.

I'm currently finishing my final session at ETS in software engeneering and then I'll be able to pursue NProject developement. Check NProject development site (and test site as their's more junk in there then usefull information...)

Wednesday, July 26, 2006

Generator project moved to Castle

Thanks to hammett, my code generator project has been accepted as a Castle contrib project. Everything is still the same but you now have to checkout the code from http://svn.castleproject.org/svn/castlecontrib/generator/trunk/.

By the way I'd like to say thanks to Carlos, Tanner, Peter and Kevin for their help and support.

Monday, July 24, 2006

Getting MonoRail closer to Rails again

In a previous post I've bloged about the scaffold generator for Castle MonoRail. And now it's time for the fully-packed-turbo-ultra-cool MonoRail project generator. Just type generate project MyProject (or make a link for monorail like in the vid).

Some people won't like the directory structure I've used, which is inspired by Rails ratter then by Visual Studio. I find it more secure, more structured and more fun. If you want to argue on this, please do in this post comments! this is a work in progress and I'm pretty open to constructive suggestions and comments.

As usual : watch it live!!!


This work is not complete! If you intend to use it, you understand that this is an alpha release. The source is at http://svn.castleproject.org/svn/castlecontrib/generator/trunk.

If someone is interested in adding Visual Studio support just contact me by email.

Monday, July 17, 2006

Switching to Mac


A couple of weeks ago, I bought a cool white 2 Ghz MacBook. It's actually the first time I really use a Mac and I got to say that I'm pleased and surprised! I switched for 3 main reasons:

1. It looks cool
2. It's unix based (darwin)
3. It just works

I think that only people with bad taste can argue that a MacBook doesn't look good. The only problem is that I'm starting to get those yellow discoloration on the bottom plus an ugly stain that wont go away is parked on the right side. But I called Apple and they'll replace the case without arguing to much. Other then that, it's true that it get a little bit hot sometimes (up to 80 C on full processor usage). But I still love it! The keyboard feels so good you just want to type all day.

Another stupid reason I bought a Mac was to use TextMate. At first I tough I'd miss auto-completion and things like that but I found snippets and commands functionalities much more powerful. Plus, TextMate is fully scriptable in bash, ruby, python, etc.

I got to admit that I was largely influenced by other geek around the net, but hey! Why should they have all the fun ? And what are you waiting for ? Go buy yourself Mac !