Packaging Day ][
So if you're interested in having your favorite program available for openSUSE, please do join in!
Fines and NGOs
However, the move is turning a bit irritating because it has coincided with the Q1 timeline of our project and I'm becoming crazy trying to give my best with both things. This move was planned even before I joined Novell; if I had joined before, maybe I would have preferred to stay in the previous place because now it's very likely that I move to Cambridge (MA) on October of this year.
It happened also that in the last step of our brand new Bridge (let's call it proof of concept for now), we had a very strange crash (you need GLib# and ATK# from SVN to build the testcase) just because we referenced in the last moment to the SWF library. Sandy did a wonderful work debugging it thanks to the help of Sebastien and Geoff, and we now are certainly sure that this problem comes from the fact that SWF happens to depend on GTK for a very specific feature related to colours.
We have for now two alternatives to fix this:
- Drop this dependency (Jonathan Pobst pointed out he would be glad to find a way of making the colours functionality not depend on GTK).
- Change GTK+ initialization in order to detect the existance of another library for managing ATK (very similar to Gail).
The latter will be the one I'll look at (because it seems easier, but a bit more less comfortable regarding packaging, because we would depend on GTK from SVN), so if you happen to think of another one, we will be happy to listen to your suggestion.
Well, now you would ask: why the title of this blog entry. Well, it turned out that yesterday when I came back from another trip for carrying furniture, as I was very concerned with this issue, I turned on the laptop to keep on working on it (that was when we figured out the cause of the issue, discussing it on #monodev and #mono-a11y channels), and I went to sleep at 2 AM, forgetting completely that I had my car badly parked (in order to take out the sofas in the closest place to the building), so this morning has happened to be a pain in the ass because the police has put me a fine.
And then I had a fantastic idea about fines that I didn't want to forget, which would be awesome if the government approved it because:
- It would avoid the fact that many people claim: the city's councils are lately having an overwhelming increase of traffic fines, just with the sole reason of collecting more money, making the police busy with this instead of tracking real crimes.
- It would allow the people not to feel so bad about having to pay such a high penalty, without loosing the real motivation of penalties: education.
Of course I don't want to pretend that I should not pay the fine, but my suggestion is: what if this money was given to the NGO of your choice? Recently I got contacted by some people from the WWF organization and was still wondering if subscribing to this one or to GreenPeace (I would also support Obama, but I think I can't because I'm not american ;) ). And now I realise I will pay for a fine more money that I would give for a one-year subcription to a NGO like these ones...
And now two questions to the readers (wow, I admire you if you have read until here):
- Does anyone recommend me a specific NGO that is worth being a member of?
- Does anyone recommend me a way to send this suggestion to the politicians? Do they have a bugzilla.congress.gov?
Update 21-JUL-2008: I'm a bit worried about these Obama's statements.
Update 16-SEP-2010: Talking again about fines, compare what other governments do to what the Danish government does (sorry, link in Spanish).
Sles 10 Training
Two new entries in my life
Last week two new entries entered my life.A shiny brand-new _Macbook pro _arrived on Thursday. I’ve always dreamed of one of this wonderful laptops (I’ve been an happy iBook user for a long time). Two weeks ago I finally surrendered (I’ve always been scared of the high price) and I’ve ordered this new toy. Now, after one week of usage I’m really happy about it.
Currently I’m using Linux as primary Os, but I’ll give a try also to KDE4 on Mac ;)
The other new entry is Baguette, a three-months old dachshund. She’s really lovely, running around the house eating random things like shoes (I think it’s a must for all pets) and usb cables (she’s already a geek-dog).
I think I’ll have to keep an eye on Baguette, otherwise I’ll find another bite on my Macbook pro apple ;)
Unmanaged documentation hard to manage
One of the things I hate more is not having the excellent refactoring options that the modern IDE's nowadays can provide. For example, how do I know where is some element defined (in my code? in a reference? in which reference?)? Sometimes I find myself copy-pasting a function into another empty test project and start adding references to it until it compiles. Someone would say: hey but there's a lot of documentation out there! Really? Take this example:
Function: g_type_class_ref
- It smells like a Glib/Gobject function.
- Surprisingly, calling it in a test project that has a reference to glib doesn't work.
- More surprisingly, calling it in a test project that has a reference to glib and atk works.
- Mmmm, but it doesn't smell like an ATK component, right? Maybe atk ref already depends on the lib I'm looking for...
- Let's google it...
- WTF! the majority of links provided are forums, not docs.
- Finally got one from the LinuxFoundation, which tells me something about a libgobject-2.0 thingy... but that lib is not in my system.
- Anyway, the page redirects me to the "Gobject 2.6.2 Reference Manual"...
- But! it's a broken link which ends on main gtk.org doc page.
- Well, then, let's look for "site:gtk.org g_type_class_ref"... No results!
Ok ok, this is not C language fault, but how do you guys get to know these type of things? I hope you don't download all the source code of all these libs and grep for the word you're looking for... :D
Please make me feel dumb if you want to reply, and I will learn one more interesting thing today :)
In managed code with an IDE, you just have to right-click on the method and select "Go to definition" and if the method is found in a binary reference, there are different behaviours depending on the IDE you use, if you use VS2005 or later, you get an Object Browser that shows you the API of the library, and with MonoDevelop it tries to use the debugging symbols for showing the source code or otherwise it shows a minibug.
SOLUTION of the QUIZ: I had to look for the library 'gobject-2.0', not libgobject-2.0. Of course, Mike Gorse was the unmanaged expert that made me feel dumb! :D
SOLUTION to avoid the QUIZ to other people in the future: bug 369927. Mmmm, it has been closed as WONTFIX, maybe the unmanaged side of things should not get easier :)
Another mini-quiz that I solved also recently comes from the managed world. Do you know how static constructors work? They get called automatically whenever the code flow comes in the type where they lay. Example:
public static class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("begin");
new StaticCtorTest(1);
new StaticCtorTest(2);
Console.WriteLine("end");
}
}
public class StaticCtorTest
{
public StaticCtorTest(int initValue)
{
Console.WriteLine("Normal ctor");
this.initValue = initValue;
}
static StaticCtorTest()
{
Console.WriteLine("Static ctor");
}
private int initValue;
}
What's the output of this test? This:
begin
Static ctor
Normal ctor
Normal ctor
end
Now, what happens if we drop the custom constructor? We can still create objects from our class, but using the implicit empty constructor:
public static class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("begin");
new StaticCtorTest();
new StaticCtorTest();
Console.WriteLine("end");
}
}
public class StaticCtorTest
{
static StaticCtorTest()
{
Console.WriteLine("Static ctor");
}
private int initValue;
}
Output:
begin
Static ctor
end
This constructor can only be called when no other constructors have been defined. Example: the following code will give a compiler error:
public static class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("begin");
new StaticCtorTest(); //The type `StaticCtorTest' does not contain a constructor that takes `0' arguments(CS1729)
Console.WriteLine("end");
}
}
public class StaticCtorTest
{
public StaticCtorTest(int initValue)
{
Console.WriteLine("Normal ctor");
this.initValue = initValue;
}
static StaticCtorTest()
{
Console.WriteLine("Static ctor");
}
private int initValue;
}
Ok, but here comes the surprise. What happens if, instead of using a class, you use a struct?
public static class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("begin");
new StaticCtorTest();
Console.WriteLine("end");
}
}
public struct StaticCtorTest
{
public StaticCtorTest(int initValue)
{
Console.WriteLine("Normal ctor");
this.initValue = initValue;
}
static StaticCtorTest()
{
Console.WriteLine("Static ctor");
}
private int initValue;
}
What happens is that you don't receive any compiler error, and thus you may think that the static constructor is being called, however, the output:
begin
end
WTF! This stupid thing made mkestner and me feel like crazy, wondering if any JIT optimization would kill our call in the GLibSharp bindings.
Fortunately, with this little research and his help, all was solved and I can keep on concentrating on how to complete Atk# in order to get my toplevel-with-n-children sample to work, and finishing the documentation that is still in a draft stage.
Installing Edimax EW-7128G Wireless Lan PCI Adapter on OpenSUSE 10.3
As you saw in my previous post, I have this wireless card, so let see what I did to have the wireless connection working on my OpenSUSE box.
The card is coming with some drivers for linux, on the box is mentioned that it has support for Mac OS, Windows x64 Edition, Linux Debian, Fedora, Redhat and Suse.. I was not able to install their drivers on my computer, I have the feeling that something is wrong with their default drivers and I decided to use the drivers which you can download here.
"rt2x00 Project" is a development effort to provide free, stable and feature rich Linux drivers for wireless 802.11b/g/i cards based on the following Ralink chipsets: rt2400, rt2500, rt2570, rt61 and rt73.
So, the steps are here:
1. prepare the kernel first:
# cd /usr/src/linux # make mrproper # make cloneconfig # make modules_prepare
2. Unpack the archive which you just download it somewhere on your hdd:
# tar -zxvf rt61-cvs-daily.tar.gz
3. change the current directory:
# cd rt61-cvs-2008032308/Module
4. compile and install the module:
# make # make install
Now if everything is fine, you can see if you have the drivers installed:
# ifconfig -a # iwconfig
lo no wireless extensions. eth0 no wireless extensions. vmnet1 no wireless extensions. vmnet8 no wireless extensions.
For the last two commands you have to look after wlan0 or ra0 device. If you still don't have them (like in my case) try:
# modprobe rt61
If you run again the command iwconfig you will see now the device:
# iwconfig
lo no wireless extensions. eth0 no wireless extensions. vmnet1 no wireless extensions. vmnet8 no wireless extensions.
wlan0 RT61 Wireless ESSID:"" Nickname:""
Mode:Managed Frequency:2.412 GHz Bit Rate=54 Mb/s
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=0/100 Signal level:-121 dBm Noise level:-143 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Now you are ready to configure your wi-fi card with yast, so type
**yast2** at the command prompt, and configure it.
At this point the card will work only (in my case it did) if I disable the SECURITY on my router and if I will set NO-Encryption for Autentification Mode in Yast. I don't like this, I want to use WPA, so here is a nice and small script which will do the work:
#!/bin/sh # # Script to configure Edimax EW-7128G Wireless Lan PCI Adapter # to work with WPA mode
iwconfig wlan0 mode managed
iwpriv wlan0 set AuthMode=WPAPSK
iwpriv wlan0 set EncrypType="TKIP"
iwconfig wlan0 essid "YOUR\_ESSID" \# change here
iwpriv wlan0 set WPAPSK="YOUR\_PASSPHRASE" \# change here
Now everything is working, I hope that this small howto is useful also for you, so please let a comment if it is working or if you have some problems with it.
Set up a wireless network in the new house
As you read in my previous post , we arrived in UK already. I have internet connection at work, but I need also at home internet, because during the evening I am reading news, emails, messenger, .... I prefer now, to set up a wirelesss network for my home, because I don't like to have cables in the house.
My computers are here. For Amilo notebook I had already a PCMCIA card "Netgear WG511T" which is working fine on Windows XP, FreeBSD and Linux, Vaio notebook come with an integrated wifi card, I have installed on it Vista and I don't have problems with the wireless card, so what I needed it was a PCI/USB wireless card for the desktop computer which has to work with Linux, Windows and also *BSD operating system and also a wireless router.
Surfing on the internet, reading opinions and different forums, I decided to buy a Linksys WRT54G wireless broadband router, maybe in the future I will try to install linux on it (openwrt or something similar), and as PCI card I took Edimax EW-7128G wireless adapter which it seems that is working fine with Linux, Windows and FreeBSD/OpenBSD.
The router was very easy to set up and is working fine. I had some problems in installing the PCI wireless card on my Opensuse 10.3 box, finally it is working, I will write here a short tutorial in the next post.
I am really happy with my new wireless network.
Waiting for UBahn in Berlin
If you are wainting for UBahn and you are tired, please take a sit ...

YaST2 network, driver options
This is feature I don't really use, but some of openSUSE or SLES users does. Maybe I'll need it when I will play more with bonding devices.

Hm, feature ...
In fact it brings back functionality that there was already there. But it was done in "hwcfg" files - deprecated configuration files for hardware devices. Now that configuration is stored in /etc/modprobe.d/network. But it's probably not final solution.
Why? because all that options are stored "on one place" but options packaged by driver rpms are stored in /etc/modprobe.d/$driver_name.
Maybe in future I'll change that place or enhance functionality to work on whole directory, but I need some feedback or opinions. Are there any?
YaST2 network, bridge devices
this is my first (and very short) blog about YaST2 development.
I put some screenshots here: new features::bridge.
What is bridged network good for? Mostly for network used with virtualisation (Xen, VirtualBox, Vmware, etc.). For this purpose all virtualisation products has their own tools, configurations and scripts.
This (per-virtualisation-application) has some disadvantages:
- possible conflict between sysconfig
- not unified way how to configure
- network configuration can't be clone by AutoYaST
That's why it makes sense to be implemented in YaST
Briefed introduction : when you want for any of your hosted machine to be seen from network, create bridge attached with physical network interface and some tun device. TUN device will be attached into your virtual machine and it makes virtual hosted machine be directly connected to real LAN.
The plan is (together with bridge) to implement also support for tun/tap devices (this should be done in sysconfig first) and Xen networking to confgure all this staff in one place.
Do you like this feature? If you have any feedback, comment or enhancement request - please let me know.