Nemerle Offers Courses OnLine

by Miguel de Icaza

The Nemerle folks are going to teach some courses online to expose their language to more people.

Posted on 03 Oct 2005

Using FireBird.NET with Mono

by Miguel de Icaza

Today I tried out the Firebird database as we just integrated Carlos' bindings for it into the Mono release. Firebird has two modes of operation, it can be used as a server that clients connect to or it can be used as an embedded database, just like SQLite.

The traditional server/client setup works as expected, but I was more interested in using it as an embedded database, This mode is not very well documented. This blog entry tries to document the steps necessary to embed the database and use it with the managed API.

I installed the "FireBird Classic" configuration as an RPM, which is available here. Other downloads are available here.

These instructions are based on the data I found here and here.

Then you must create a mini-firebird environment for your embedded database, the following commands must be done as root:

	# mkdir /home/miguel/minibird
	# mkdir /home/miguel/minibird/bin
	# cd /home/miguel/minibird
	# cp /opt/firebird/firebird.conf .
	# cp /opt/firebird/firebird.msg .
	# cp /opt/firebird/security.fdb .
	# cp /opt/firebird/bin/fb_lock_mgr bin
	# chmod +rx bin/fb_lock_mgr
	# FIREBIRD=`pwd` /opt/firebird/bin/gsec
	GSEC> add miguel -pw pwd
	GSEC> quit
	# chown -R miguel *

Edit the firebird.conf file and add (or edit the commented line) the following line:

	RootDirectory = /home/miguel/minibird

That will create the mini-root and create an account "miguel" with the password "pwd" and set the permissions for all the necessary files.

You can now create a database:

	$ /opt/firebird/bin/isql
	SQL> create database "hola.gdb";
	SQL> create table developers (name varchar (40), email varchar(40) not null);
	SQL> insert into developers (name, email) values ('miguel', '');
	SQL> insert into developers (name, email) values ('duncan', '');
	SQL> commit;
	SQL> exit;

The C# program to access it is fairly simple:

    using System; 
    using System.Data; 
    using FirebirdSql.Data.Firebird;
    public class Test {
            public static void Main(string[] args) {
                    string connectionString = 
                    IDbConnection dbcon = new FbConnection(connectionString); 
                    IDbCommand dbcmd = dbcon.CreateCommand(); 
                    string sql = "SELECT * FROM developers"; 
                    dbcmd.CommandText = sql; 
                    IDataReader reader = dbcmd.ExecuteReader(); 
                    while(reader.Read()) {
                            object dataValue = reader.GetValue(0); 
                            string sValue = dataValue.ToString(); 
                            Console.WriteLine("Value: " + sValue);
                    // clean up 
                    reader = null; 
                    dbcmd = null; 
                    dbcon = null;

Build your program:

	$ mcs sample.cs -r:FirebirdSql.Data.Firebird -r:System.Data

To run this program you must set the FIREBIRD environment variable to point to the mini-firebird directory:

	$ FIREBIRD=/home/miguel/minibird mono sample.exe
	Value: miguel
	Value: duncan

Posted on 30 Sep 2005

World Wind Software on Linux

by Miguel de Icaza

WW2D now runs on Linux using Mono:

World Wind on Linux.

[WW2D] [..] is cross-platform, free and open-source version of NASA World Wind software, see for details. WW2D allows you to explore Earth using satellite imagery, topographic maps and image from other data sources also providing large placenames and boundaries database and allowing you to install community-made add-ons for even more information about our planet.

In basic configuration WW2D uses images from Blue Marble (1 km/pixel), LandSat7 (15 m/pixel), USGS Topo Maps, USGS Digital Ortho imagery, USGS Urban Area imagery.

WW2D is designed to dynamically download needed data from internet, however you can download data you want for faster access and offline usage.

This is not the original NASA software, but a new implementation sharing some of the data. To render they use Tao.OpenGL and a little bit of native code.

The new version is available here to run make sure you have libgdiplus+ installed and then do this:

	$ cd demo-linux
	$ mono WW2D.Frontend.exe

Posted on 30 Sep 2005

SharpMusique 1.0

by Miguel de Icaza

Jon Lech Johansen has released version 1.0 of his SharpMusique client to iTunes Music Store, in 1.0 he supports:

  • Preview songs
  • Signup for an account
  • Buy songs and albums
  • Redownload songs that you bought with SharpMusique
  • Redeem Pepsi caps
  • Redeem gift certificates

SharpMusique uses Gtk# and runs on Microsoft.NET or Mono.

Posted on 30 Sep 2005

Second Life

by Miguel de Icaza

I just learned that the folks at Second Life are using Mono for their 3D Digital Online World:

Monoorientationisland Orientation Island with all 700+ LSL scripts compiled to CIL, assembled in to CLR assemblies and running in the Mono VM embedded in the Second Life simulator. The Mono scripted birds sing and the Mono scripted hands spin and go "bing" when you touch them. There's still lots of bug fixing, optimisation and integration to be done, but it's looking good.

By doing this their existing LSL code will be JITed and optimized by the Mono engine and run at native speeds while giving their developers the flexibility that they need in using the LSL language. This also opens the doors to the Second Life developers to use other CLI languages like C#, Boo, Python or JavaScript side-by-side.

A couple of weeks later they posted an update with more screenshots:

Monobiplane1Monobiplane2_1Monobiplane3Flying a mono biplane through a mono scripted Abbotts Aerodrome (in monochrome). All 2700+ LSL Abbotts scripts compile to CIL, assemble in to CLR assemblies and run in the Mono VM embedded in the Second Life simulator. Note that no source code was changed to make this work, the LSL source was just recompiled to run on the Mono VM.

This is pretty exciting. Am looking forward to help the SecondLife guys have a successful migration to Mono and assist them in exploiting the features of the Mono VM for their software.

Posted on 27 Sep 2005

Kurt Vonnegut's New Book.

by Miguel de Icaza

I enjoyed tremendously reading Kurt Vonnegut's latest book "A Man Without a Country" which recently came out.

The theme is very personal, Vonnegut's view on the current state of affairs on the world. Unlike his fiction books on "A Man Without a Country" Vonnegut explicitly states what he believes is wrong, what must be fixed and identifies the crookitude by name.

Posted on 27 Sep 2005

Viggo Mortensen

by Miguel de Icaza

Crooks and Liars has the video of Viggo Mortensen amazing interview on Charlie Rose's show.

I admire the man. He shows up with a gift for the host, a copy of Howard Zinn's Voices of A People's History of the United States. One of my favorite books and is followed by a brilliant presentation on the state of the country in a calm and articulate way.

And on his web site I find a quote from another favorite author of mine, Gore Vidal and plenty of articles from authors that I like.

Posted on 25 Sep 2005

C# 3.0 Q&A

by Miguel de Icaza

A C# 3.0 Q&A, a lot of folks have been asking about these and other questions. Find it here

People have been asking me when are we going to support C# 3.0.

Our current focus is on delivering a very stable platform, so we are trying to fix the bugs that people are reporting and give developers a great experience with their existing code base. This is just a basic Joel principle: fix bugs before you write new code.

Considering that C# 3.0 is still a year or two away from shipping and the specification will likely change it is best for us to polish our C# 2.0 compiler and our runtime classes than to start work on C# 3.0 right now.

The good news is that all of the new C# 3.0 features are relatively simple and it builds on existing C# 2.0 features. The specification so far is 26 pages long. It is probably one third of the effort that it took to implement generics on the compiler and the runtime.

We are as excited as everyone else about the language and can not wait to try to implement some of those features and provide feedback about it to the language architects, but this work will have to wait a few months. This is definitely not part of our Mono 1.2 release needs (that being said, if one of the contributors sends code for it, we will very likely integrate it).


In the meantime, Atsushi has checked some early work on XLinq to our repository. It has only enough code to run Microsoft's XlinqIntro sample.

Posted on 25 Sep 2005

Mono on ARM

by Miguel de Icaza

Mono 1.1.9 shipped with a port of the JIT engine to the ARM processor and it currently supports the Linux operating system. A few days ago Paolo received his Nokia 770 which is a Linux/Gtk-based PDA. Mono and Gtk# work out of the box on it.

Paolo reports:

After the Mono JIT port was done using a desktop little-endian ARM computer, Geoff just recompiled it and run it on a Linksys NSLU2 (which runs a ARM processor in big-endian mode). That was pretty cool. I wonder if it is as cool as running mono on a Nokia 770 (no recompilation necessary, just copied the binary from my Debian box). Here it is running our hello world app. Many thanks to the fine folks at Nokia for sending me a prototype so quickly.


I made tarballs of binaries for use on Linux/ARM systems, including the Nokia 770. And, yes, Gtk# apps work fine on it:-). Happy hacking, you'll find them here.

I added a few links and updated some on the quoted text above.

In addition Paolo made a small video of Gtk# starting up on the Nokia, notice that it starts up very fast.

The NSLU2 has an ARM processor running at 130Mhz. At USD 78.84 it is probably the cheapest machine to run Mono. Geoff boostrapped Mono in about 10 hours on this little machine.

Update: Geoff reports that he un-underclocked his Linksys machine so instead of being a running at 133Mhz he is running it at 266Mhz.

With the machine at 266Mhz compiling Mono 1.1.9 (which includes building the C runtime with gcc and compiling the C# code for the 1.x and 2.x profiles) takes about 9 hours.

Posted on 20 Sep 2005

Must-own book

by Miguel de Icaza

The new book from Brad Abrams and Krzysztof Cwalina: Framework Design Guidelines : Conventions, Idioms, and Patterns for Reusable .NET Libraries is a must-have book for anyone writing .NET and Mono code.

I got my copy at the PDC this week and it is a wonderful book. The book includes many of the design guidelines that Brad's blog is famous for. The book is not just a collection of rules, but it also includes the rationale for some of the design decisions and what really makes the book interesting are the commentaries from other developers and architects involved in .NET.

This book is packed with gems. I hope we can start using these more in our own code

Oh, and I also got my copy autographed by Brad himself.

There are slides from his session posted here. Another set of must-read slides for any developer.

More PDC

Am working on a larger post with all-things PDC and the Mono meeting, but it is taking me some time to digest everything I learned this week.

Posted on 18 Sep 2005

« Newer entries | Older entries »