domingo, septiembre 26, 2004

Mono Days

Last thursday I met Miguel de Icaza at Mexico city, where he gave a conference about the advantges of the use of Linux (and particularly the Novell version) over the use of other OS.

His conference was part of a small Novell and Hp event surrounding Linux, and the mentioned event took place at a luxurious hotel where a lot of people had chance to talk to Miguel not only about computers, but abou politics and economics.

After the event we had lunch and I could met also Mancha, Cesar Octavio López Nataren ( the Mono JScript guy) and other Miguel's friends.

Just as always, I must say that I admire Miguel a lot and I'm happy to being working in the same project with him.

Properties Access Modifiers
Currently I'm implementing a new feature that is part of the C# 2.0 specs is the posibility to have your properties accessors with different access scopes. Today, a property is declared as follows:

public int Property {
get {
return val;
}
set {
val = value;
}
}

This generates two methods, set_Property and also get_Property, that work very smoothly. It is important to note that both methods will inherit all the acess modifiers indicated in th Property declaration, so in the previous example the methods would be described as:

public int get_Property ( );
public void set_Property (int value);


However, sometimes it would be great if the methods need to have different acess modifiers each one. For example, when you have an abstract class that exposes both get and set accessors, but want to declare the get as public, and the set as protected (thus reserved to the subclasses), wou will have to avoid declaring the set accessor and expose it in another way.

With this new feature found int C# 2.0, no more problems of this kind. Now is possible to declared one of the two accessors with different access modifier than the Property itself:

public int Property {
get {
return val;
}
protected set {
val = value;
}
}

Finally, the accessors methods would be described then as:

public int get_Property ( );
protected void set_Property (int value);

Which will be clearer and prettier than before.

lunes, septiembre 06, 2004

The Geek cliché

I was reading a blog from a guy who is a geek (almost everybody blogging can be considered a geek), and then found little details that have helped to build the geek cliché, this is, all the things that all the people think a geek does. So I here enumerate them:


  • Read a lot of trash in the web

  • A huge huge huge huge ego

  • Dislike about the stupid society

  • Have an open source hero ...

  • ... talk tooooooo much about that hero

  • Talk about the online communities they are in

  • Hatting trolls but they themselves are trolls

  • Doing nothing for the community



* Fortunately I hadn't to see him in person, when he missed a Linux event in which I was.

Of course these are only the *features* a geek has while he's online. Is that a lie or not?

sábado, septiembre 04, 2004

System Tune

Hell! I was preparing me to go to Xalapa today but ... yes, I forgot I had no money, and also that I'm in conflicts with my parents, so go figure out. Shit.

And trying to improve the performance on my almos dead pc (Celereon 500, 256 ram, 40 gb hd), I has to compile-the-linux-kernel, which took me almost 3 hours. And the system is just as slow as before. After checking the system performance, I saw that xmms was using almost 10% of the cpu! And that's just the mp3 player, that is a small application. Now think in Evolution, in Epiphany (because God, I don't use Mozilla), in all the open Terminals, in Gaim, in Xchat ...

The worst is that I could see that alsa is not as slow as before (when it was not included in the linux kernel officially), but it still is toooooo slow. Check the part of the report:

  

NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
0 63316 7500 11m S 10.3 3.3 3:15.13 xmms
0 1820 816 1620 R 8.6 0.4 0:00.11 top
0 96076 27m 72m R 6.9 12.3 5:09.98 X



My God, I need a new pc.

Excuses for Federico
I know this is the second time I'm not able to go to Xalapa, and I must confess to be embarrased. I promise to send you the C# book with Mauricio (I know I will see you at irc, but just wanted to make clear that I'm very sorry about this situation).

miércoles, septiembre 01, 2004

Officially a Hacker

Today I commited System.Collections.Generic.Collection class, which is part of the generics support for Parametric Polymorphism in Mono. So, I can say that after sending some small patches, and now this class, I'm a Mono hacker. Now, it's time to go beyond and work on the left classes and then work at the Generational garbage collection support.

Little sample:

using System;
using System.Collections.Generic;

public class Test {
public static void Main ()
{
Collection <int> c = new Collection <int> ();
c.Add (3);
c.Add (5);
c.Add (11);

// Note that unboxing is not neccessary
int sum = 0;
for (int i = 0; i < c.Count; i++)
sum += c [i];

Console.WriteLine (sum);

}
}



Compile with gmcs. Enjoy.