GStrv vs. char**

Dear people of the world who are interested in developing with GLib. The type GStrv is a typedef for “char **”. I know C purists will think that it’s stupid to do that. The problem with a “char **” however is that it can mean hundreds of things. That it’s therefore not possible to know for a language binding tool how to deal with it (how get thing things out of it, how to free it and how the content of it will look).

With GStrv all that is known. A language binding generation tool will know that it must use g_strfreev to free it and it will know that your blob of C memory will be an array of strings.

A “char**” can also be a a pointer to the pixbuf of a grayscale image. It can be a binary blob or any kind of array of pointers.

To all our library writers, please do this:

GStrv people_bag_get_names (PeopleBag *people);
GdkPixbuf* people_bag_get_thumbnail_of (PeopleBag *bag, gchar *person);

Don’t do this:

gchar **people_bag_get_names (PeopleBag *people);
gchar **people_bag_get_thumbnail_of (PeopleBag *bag, gchar *person);

Replacing your “gchar**”s with “GStrv”s wont create API nor ABI problems, so please do it now and make a new release of your fixed libraries’s APIs. Then at least the array-of-string glue code of language bindings can be fully automated.

If you are returning an array of object instances, please don’t use GList, GPtrArray nor GHashTable. By using those you loose boxing (your array type is a blob of unknown C memory that contains unknown things that happen to be pointers to GObject instances – but a tool can’t know that -) and (more importantly) you don’t offer a generic collection API for your blob of C memory to other languages.

Consider using a collection API. Some people are trying to get this into GLib just like GIO got accepted as a higher abstraction for a IO and Stream API. Let’s see what happens.

Thanks!

ps. & edit: On IRC jdahlin mentioned that GValueArrays have type information, because the items get boxed onto GValues. If return performance is not an issue, you can also use that instead of GStrv.

Sauna!

Yesterday we went to a public sauna where it doesn’t matter too much if they’d throw me out (I don’t often go there).

We decided to pick that one because we wanted to tryout our mint crystals!

“Just put them on the stones” I hear all the Finnish sauna people think. Right, indeed! But at most of the Belgian public saunas you are not allowed to bring your own smells.

In Belgium not everybody has his own sauna. And those who do own one usually have a infrared sauna (because those are often smaller in size). I mean, come on, infrared saunas are not real saunas. You can’t put mint crystals on stones, there are no stones involved! I think it’s much more common for Belgian sauna fans to go to a public one instead.

Although not allowed, it’s not uncommon that somebody brings smells. Usually there’s a guy putting smells incognito on stones. After some time all the real sauna fans recognize him of course. Often it’s the same people, so you get to know who’s into that. Usually I’m just an innocent observer who joins the saunas where custom smells are being thrown on the stones. In fact I’m inexperienced with bringing my own smells.

So we waited until there was nobody left in the sauna we picked, it was Sunday evening and stormy, so not a lot of people. Then we emptied a glass, filled it up with some water, put the mint crystals in it, entered the sauna, we threw the glass over the stones, enjoyed, hoped that they wouldn’t throw us out. We didn’t get caught!

Now, don’t get me wrong. At most of the public saunas in Belgium the owner of the place periodically puts a bunch of smells on the stones for an entire half hour. It’s like some sort of a three-hourly event. When that happens a lot of people join that specific sauna of course. They usually give you some oranges and cubes of ice after ten minutes. They circle with a towel to distribute the air. Etc. It’s not that because you are not allowed to bring your own smells, that it sucks. I guess they don’t want you to ruin their saunas with experimental piece of shit smells that some people would bring.

Anyway. The Turkish mint crystals were awesome. After the second time I was so thirsty that I drank a half liter cola and a half liter fresh orange. It was amazingly cold on my body yet I was sweating like mad.

Refreshing!

Don’t forget

I am not asking your newspaper to support an administration.. But I am asking your help in the tremendous task of informing and alerting the American people..

For I have complete confidence in the response and the dedication of our citizens when they are fully informed.

I not only could not stifle controversy from your readers I welcome it. This administration intends to be candid about its errors. For as a wise man once said, “an error doesn’t become a mistake until you refuse to correct it”.

We intend to accept full responsibility for our errors and we expect you to point them out when we miss them. Without debate without criticism, no administration and no country can succeed. And no republic can survive.

That is why the Athenian law decreed it a crime for any citizen to shrink from controversy. And that is why our press was protected by the first amendment, the only business in America specifically protected by the constitution, not primarily to amuse or entertain, not to emphasize the trivial and sentimental, not to simply give the public what it wants, but to inform, to arouse, and to reflect to state our dangers and our opportunities, to indicate our crises and our choices, to lead, mould, and educate and sometimes even anger public opinion.

ps. This is an extract from a speech by JFK

Don’t forget

We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too.

Upskirt!

This blog item was done for the sole reason of pissing off some people.

Wireless Internet everywhere, not

Another reason why the web fan babies are not getting it is the current price that the vast majority of people today pay for mobile Internet. This is the story of a Belgian who went on vacation for three days in Spain. He bought himself a mobile data formula and I guess he hoped that it wouldn’t be very expensive.

A few weeks after he came home he received an invoice of 18888 euros. The price per megabyte was 10 euros.

This poor guy was lucky because Proximus (the phone network company) settled the invoice for 1400 euros. For 1400 euros it would still have been cheaper to take a plane to Belgium, check your mail at home, and take a plane back to Spain. For 18888 euros … I don’t think it’s possible to schedule as much flights in three days as you could buy with 18888 euros.

I remember I told a few people at GUADEC that it would be cheaper for me to fly home every day to check my mail, than it would be to do this over GPRS in Istanbul. This story seems to verify that.

These are the prices for mobile Internet access in 2008, the year when all the web 2.0 babies started crying that all of the mobile applications should become AJAX websites.

Again the point that I’m trying to make is that instead of completely changing the strategy of products like GNOME Mobile towards webberty web stuff, maybe intelligent people should consider that maybe, just maybe, we just don’t have the wireless connections for that yet. In reality, you see, we don’t have that at all at this moment.

I’m not convinced that within the next decade we will have anything that comes close to reliable wireless Internet connections at the same coverage as GSM. Which still wouldn’t be sufficient. I mean, the connectivity of GSM is really bad if you take into account how often you don’t have a good signal.

The reason is simple: the economic model of a free wireless Internet for everybody everywhere on the entire planet, is probably just not profitable. The research to achieve this without needing a few thousand nuclear power plants and without having to hire thousands of people for maintenance of the wireless routers worldwide, is just not happening.

The political power that you’d get out of having control over this giant wireless network can much more easy be achieved by simply owning all news papers, television networks, schools, etc. What that means is that politicians wont do it either.

Consequences of SMASHED

An innocent developer will now not only be addicted to girly drinks, like Malibu, he and his girlfriend will also become addicted to drinking the same Whisky as one of the SMASHED members brought to GUADEC this year.

Mint crystals in Istanbul

I finally found what I was looking for at the Istanbul Spice Bazaar (Misir Çarsisi): mint crystals.

For the Nokians and other Finnish sauna freaks reading this, this is the stuff that you want to mix with a little bit of water (else your sauna is way to dry, of course) and then put the mixture on the hot stones. Crystalised mint is a very pure form of mint. Mint in a sauna gives a very cold and cool feeling on your body. Meanwhile your sauna is obviously very hot. You basically think that it’s cold, yet it’s very hot.

Well, with crystlized mint you maximize this. Eucalyptus is nothing compared to mint crystals. Chinese mint comes close, though. But not quite.

The aftermath is that you probably don’t want to jump in ice water after your sauna anymore. Not before adapting to normal temperatures for ten minutes. You wouldn’t be the first who passes out. I mean, your body is in a very confused state: it behaves as if it’s cold, but it sweats as if it’s very hot. The one thing you don’t want to do is to make it very cold suddenly. Unless you are a big dangerous looking Finnish dude, maybe.

I mean, I’m not underestimating the Finnish sauna people. I’ve been to a public one in Helsinki. Woah.

Anyway. The store can send the crystals to your home with DHL, the owner told me.

If any of the Nokians or other Finnish sauna pussies want to know what a real sauna experience is, you can mail them at ucuzcular@gmail.com, and try it.

Fantasies of web fan babies

Just like how GNOME developers are only good at serving themselves, development communities and hackers, so do web application developers only make solutions that serve the group of people that act like little crying babies whenever there’s no Internet connection. (well, not really. Both serve other groups too. Of course.)

Truth is, and I’ll take any of those Web fan babies on a trip to reality in any city at any time for at least the next 15 years, that the vast majority of people during the vast majority of their time don’t have something that you could call an Internet connection.

Surprisingly those people also often have sex in the evening. Meanwhile the people crying for Internet connections usually don’t.

Choosing between real sex and an Internet connection is an interesting question for me, being a workaholic software developer. But in the end, my Tinne’s charms always wins the fight against my computer’s shiny Internet connection. Seriously.

I mean that listening music in my car using Last.fm is not an option. Consider this: With good music in my car and my girlfriend sitting next to me, I’m far more likely to please her than I would be in case I’d frustrate her with this “Buffering…” and “Connection lost” crap that would inevitably be the result of a Last.fm player in my car.

Guess what will get us at a cocktail bar leaving us with the right atmosphere? A car with a Last.fm player, or a car with a USB stick? (usually we use bicycles, because we are responsible young drivers, but anyway). A car that 90% of the times has this “Buffering…” thing would make her laugh about her funny nerdy boy the first time. But after ten times, I’m pretty sure my investment in her cocktails will be ruined by that piece of shit music player, in my car.

People who are not into computers don’t even get that first time for free from their female partners. A piece of shit music player is an instant failure. Meaning: they won’t buy it. That’s why you are not seeing Last.fm players for cars.

I mean that using Google Maps for car and truck driving navigation is only something the kind of architect that you want to ban from your software development company would propose. You need to focus on the road while driving. Please don’t focus on the millions of irrelevant accessibility and usability problems a web application like Google Maps introduces.

On top of that, there’s no way all of the highways and cities in Belgium would have reliable Wifi coverage for at least another decade. And Belgium is a wealthy Western country.

We ‘rich boys’ are not the only ones with cellphones. We are probably the only ones with super Internet backbones sticking in our arse, though.

I mean, without any of that Web 2.0 stuff are car GPS devices working just fine the way they work today.

Seriously … to say that all the future of computing belongs to the web, while neglecting the real problems mobile solutions are solving today already, is something only the worst kinds of wannabe architects and morons would say. In my opinion.

You really think I would accept that I can only listen to music with your iLast.fmPod device in the most crowded places of planet earth? Places like inner New York City are probably the only ones where, if you are extremely lucky, you could have a Wifi Internet connection. Even with that connection, Last.fm would still take minutes of buffering per song.

That’s why iPod is a success, and your iLast.fmPod wont be. Well, that’s not the only reason. The other reason is that people buy iPods for the same reasons why grown up people buy swimming pools: to make other people jealous.

Usually, they don’t download a free desktop for the same reason as why they invest in swimming pools. They download it because it’s the only way to make the piece of shit computer perform the things that help them achieve their personal goals.

The point that I’m trying to make is: most Web 2.0 applications suck. They solve one problem (deployment) and they introduce fifty clearly identifiable new ones. On top of that, they are not ‘free’ as in free beer either, right?!

They are the monopolist’s best friends! Microsoft’s monopoly will look like a baby compared to Google’s in a few years.

But don’t confront the Web 2.0 fan babies with those ‘problems’! They’ll just go “la la la”, “not listening”, “Youtube rocks”, “la la la”.

That’s fine, but then go out of the way for the people who will solve the real problems in the next decade.

Web apps work and will work where they work. They might even work great, sometimes. But they wont where they wont.

Privacy in Europe

Obviously, European Youtube users didn’t ask for their youtube usage to be handed over to Viacom Inc.. Who knows what Viacom will do with this highly private data (which contains highly detailed information about people’s interests such as the videos they watch, the various topics they are interested in, and so on)?

I only hope that enough Europeans will formally protest at their country’s privacy agencies and/or at the European institutions. Although, I fear it won’t matter anymore as privacy nowadays has become far less important than Britney Spears or Paris Hilton.

Anyway, please find the contact details for Belgium here.

On reference counting

I made a little bit of documentation on reference counting. It’s not yet really finished, but I’ve let two other developers review it now. I guess that means it’s somewhat ready.

The reason I made it was because as I browsed and contributed to GNOME’s code, I noticed that a lot of developers seem to either ignore reference counting or they use it incorrectly all over their code.

I even saw people removing their valid reference usage because they had a memory leak they wanted to solve. As if introducing a race condition is the right fix for a memory leak! Some people have rather strange ways of fixing bugs.

What people who don’t want to care about it should do, and I agree with them, is to use Vala instead.(Or D, or Python, or C#, or Java, before I get hordes of language fans in my comments again. Oh! Or C++ with smartpointers too! – oeps, I almost forgot about the poor céé plus plus guys -)

Anyway, I’m sure my guidelines are not correct according to some people, as there are probably a lot of opinions on reference counting. In general I do think that whenever you pass an instance to another context (another thread or a callback) that you simply must add a reference. If you do this consistently you’ll have far less problems with one context finalizing while another context is still using it.

It’s a wiki page, I’m subscribed. You can just change the content if you disagree. Being subscribed I’ll notice your changes and I’ll review them that way.

http://live.gnome.org/ReferenceCounting

It’s not the first such item that I wrote down. Here are a few others:

After reviewing this document José Dapena promised me he’s going to make a page about reference count debugging in gdb, like adding watches on the ref_count field of instances. To make sure he keeps to his promise I decided to put a note about that here. <g>