For us who don’t really like Java and who get annoyed by the fanboys who claim Java is as fast as C, Shawn O. Pearce’s recent write-up on the git mailing list on why the Java implementation (JGit) doesn’t run nearly as fast as the C implementation is minty fresh and with lots of details…
Category Archives: Open Source
Open Source, Free Software, and similar
Mine is More than Yours
So Redhat created and made this very interesting Open Source Activity Map available. It rates 75 countries’ open sourceness based on “Government, Industry, and Community” and how good the countries are at open source. Sort of. The numbers are based on research done by Georgia Institute of Technology.
What does it give?
I’m a Swede who lives in Sweden and I can see that we’re not generally that much into open source, but we’re also a very small population compared to lots of other countries. But no, I cannot see how Finland or Norway are any further than we. What also puzzles me is how they even rate China before Sweden. The numbers that are provided don’t appear to take population into account, or even participation level in open source projects.
Of course I realize I have but one view and my view is deeply skewed by the projects I work in and by the people I meet and I have never even tried to compare different countries’ governments against each other in regards of open source so I figure I can’t make a good comment on these results. What is weird is that there’s simply almost no participants in open source projects from China (and several other Asian countries) and I’ve always thought that’s primarily due to language barriers. Is this map then suggesting that those missing people make up for it in projects within their own language regions?
Or isn’t it so that this map is more a map of comparing legislations and governments against each other, and no so much what actual people from these countries do in various projects? I would otherwise assume that us people in the western world have a small benefit from being close to the English language. Not to mention how those speaking native English can easily jump into most projects without thinking twice about language problems.
I think however that this is a very good idea. It brings issues to the open. What makes a country good for open source? What’s needed to make my country better?
HTTP Status Report
Mark Nottingham held a very interesting one hour talk on the status of HTTP and the work on HTTPbis on a QCon conference recently, and luckily for us HTTP geeks there’s this great video/presentation from that.
curl is mentioned at least twice in the slides, unfortunately it has a wrong fact on the second mention where it says curl uses “Pragma: no-cache” as it isn’t true anymore. It used to do that, but we’ve stopped doing it in curl since a while ago.
I’m a subscriber to the httpbis mailing list and a casual contributor, but nonetheless his summary and overview of the state was refreshing as I’ve not been able to keep up with all the details and I haven’t been tracking that working group from its start either.
Rockbox gsoc2009
So finally it went public that this year Rockbox will be mentoring five students to reach their
individual goals and get their projects turned into realities.
The projects are new codecs, one is a new port, one is USB HID work and finally there’s this “make Rockbox an instrument” project.
Personally I’m admin for Rockbox gsoc effort for the third year, and this year I’m also co-mentoring a student (Robert Keevil) in his project to bring Rockbox to the Sansa View.
Let’s make this a great gsoc year!
C Code Commandments
I’m an old school C programmers guy and I stay true to some of the older and commonly used rules present in many open source and similar projects. Since I sometimes rant about this to people, I thought I’d amuse my surrounding by stating them here for public use/ridicule. Of course heavily inspired by the great and superior The Ten Commandments for C Programmers. My commandments are not necessarily in any prio order.
Thy Code Shall Be Narrow
Only in very rare situations should code be allowed to be wider than 80 columns. I want my two or three windows next to each other horizontally and still see the code fine. Not to mention the occasional loading up in an editor in a 80 columns terminal and that is should be possibly print nicely (for reviews etc). Wide code is also harder to read I think, quite similarly to how very wide texts in web pages etc aren’t kind to your eyes either.
Thou Shall Not Use Long Symbol Names
To be able to keep the code easily readable by human eyes so that you quickly get an overview and understand things, you simply need to keep the function and variable names fairly short. Not to mention that the code gets harder to keep within 80 columns if you use ridiculously long names.
Comments Shall Be Plenty
Yes, this is something we know everyone says and few live up to. In statistical analyzes of my own C code I usually reach around 25-27% comments and I’m usually happy with that amount. Comments should explain what is otherwise not obvious in the code.
No Hiding What’s Really Happening
I’m not a fan of overloaded operators or snazzy macros that do fancy stuff without it being noticeable in the code. It should be clear when reading the code what it does. That’s also one of the reasons you don’t catch me doing a lot of C++ work…
Thou Shalt Hunt Down and Kill Compiler Warnings
Compiler warnings may be significant and in some cases they are not. Either way, it is our duty to silence them at all times. Firstly because it is often simpler to fix the code to not warn than to figure out if the warning is indeed right or not, but perhaps primarily because it makes it harder to see new warnings appearing if the old ones have been left there.
Write Portable Code Unless Forced by Evil
You may first believe that your code will live on forever on this single platform with this single compiler, but soon and very soon you will learn otherwise. Then you will cheer this rule as it makes you consider unaligned memory accesses, assuming byte-order of binary data or the size of your ‘long’ variable type.
Repeat Not, Use Functions
I see a lot of “copy and paste” programming in my daily life and I’ve learned that sooner or later such practices lead to sorrow. If you paste the same code on multiple places it not only makes it repetitive and boring to update it when an API or something changes, more seriously it increases the risk that you address bugs only on one out of many places or that the fix differ etc. It also makes the code larger and thus harder to follow and understand.
Thou Shalt Not Typedef Away Pointers
A really nasty habit to be seen in some source codes is when people use typedefs to define their own types that is simply a pointer to something. Like with ‘typedef struct whatever * whatever_t’. While I’m in general against excessive typedefing, I’m fine with them in many cases but not when used to hide pointers to look like “ordinary” types. It makes code harder to follow.
Defines, no fixed numbers
Code that relies on zero and non-zero can get away without this, but as soon as you start relying on more numbers in the code you must start using #defines or possibly enums to make them appear with names in the code. Using names is more clever than hardcoded numbers since you can avoid having to explain the number in a comment, and of course it’ll be easier to change the actual number in the code at a later point without it being a painful search-and-replace operation.
Blabbing on curl
It’s now been confirmed and set in stone that I will do a 20 minute talk (in Swedish!) on curl and libcurl on April 27th on an event arranged by Dataföreningen Stockholm’s open source network.
My guess is that if you’re interested and involved enough to read this here on my blog, you already know just about everything I can fill my short talk with…!
libssh2 1.1
I’m happy to announce that we now have a version 1.1 of libssh2 released! Noticeable changes this time include:
- Downloads using SCP or SFTP are now significantly faster
- Added a Libtool -export-symbols-regex flag to reduce the number of exported symbols in shared libraries.
- Added a bunch of new man pages and renamed some of the previous ones
- Enhanced download performance
- Made libssh2_scp_recv() and libssh2_scp_send() deal with spaces in filenames
- Fixed the bad randomness and off-by-one in libssh2_channel_x11_req_ex()
- Added libssh2_version()
- Fixed libssh2_channel_direct_tcpip_ex() to not fail when called a second time
- Fixed libssh2_channel_write_ex problems in blocking situations
- ‘make check’ runs fine on cygwin
- Added libssh2_channel_receive_window_adjust2() and deprecated libssh2_channel_receive_window_adjust()
- better socket error handling internally on win32
- libssh2 now always set the socket non-blocking internally and deals with the interface as blocking or non-blocking set by libssh2_session_set_blocking.
The library is rapidly maturing and is getting really usable. I’m happy to see that there’s a community slowly building up around this and I’m also grateful for my sponsor paying for parts of the fixes that contribute to make this release the best ever in libssh2’s history.
libssh2.haxx.se
I’ve played around with a possible new design for the libssh2 web site and I’ve put it up on libssh2.haxx.se for everyone to play around with and comment (on the libssh2-devel list please).
The original and actual home page for the project is still over at www.libssh2.org but I’m not happy with that because of a few things:
The wiki duplicates info that we these days write in man pages and hardly anyone updates the wiki so it lags behind or just contains false or outdated info. I also think having the entire site a wiki a bit problematic for things like menus and generic site layout etc.
I want daily snapshots, web versions of the man pages and mailing list archives to be somewhat integrated in the site to be easier to find.
I already hosted libssh2-related stuff anyway so I’ve just packaged it in a slightly more friendly way. In my view.
What do you think?
HD is the thing
Thomson apparently brought the new mp3hd format for music the other day. “HD” is apparently the thing we need to have included when a new term is announced. Why does the world need another lossless music format?
It seems they’ve introduced a crafty dual-format thing where they stuff MPEG-4 SLS lossless encoded data in a new id3 XHD3 tag within the mp3 and then stuff a “regular” mp3 as the normal data in there. This way it is supposed to still work fine with existing and older mp3 players. Of course the total size of all id3v2 tags is limited to 256MB, which could be a limiting factor for it.
As usual, you can find a thriving discussion on this topic on hydrogenaudio.
Rockbox should of course be possible to at first use the mp3 parts and if this truly is an existing established lossless codec there’s a chance it might be able to play that part in the future.
Rockbox 3.2
The never-ending flow of creativity in the Rockbox project was today turned into a release that we label 3.2. The goodies this time include the things below. The three-months release cycle does prevent the list from growing terribly big…
- Faster text/graphics rendering on colour targets and in the greyscale library, speeding up list scrolling noticeably on ipod Video.
- PictureFlow supports all targets except Archos Player, and can function during playback on all non-Archos targets.
- Add LCD sleep/wakeup for iPod Video (5G, 5.5G) which allows significant increase of battery runtime.
- New game, Goban plugin.
- Battery charging on Sansa e200v1/c200v1.
- PictureFlow resizes cover art on load, and supports greyscale targets.
- Preliminary support for Ipod accessories.
What didn’t get included:
- The ‘natsort’ which sorts files with numbers as the number and not by ascii. This caused quite a lot of discussions and will be sorted out for 3.3
- The Rockbox USB stack. It has been enabled in SVN build for several weeks already, but due to it causing some pretty drastic problems to some users we decided to play it safe and disable it in the release. We really hope it’ll be fine for 3.3.
- Support for any new targets. The Gigabeat S, the Ondas and the AMS sansas aren’t terribly far away, but still not “there”.
A more detailed list can be found in the Release notes for 3.2.