Archive for February, 2010
I like this feature
By chys on February 12th, 2010It’s in the newly released KDE SC 4.4*. We can now “group” windows into one tabbed interface.
* It seems they have recently decided their product has grown from a “desktop environment” to a “software compilation”… It also seems they have decided that “KDE,” previously standing for “K Desktop Environment,” is now a name in its own right?
Tags: KDE
The Tuesday following the first Monday in November
By chys on February 6th, 2010Martin Luther King Day falls the third Monday of January; Daylight Saving Time begins on the second Sunday of March; Father’s Day falls on the third Sunday in June; …
To represent these dates in a program, the intuitive method is to use tuples (3,1,1), (2,0,3), (3,0,6), respectively. But probably this is not the best idea. The number of representable observations is limited. For instance, we cannot represent Election Day (Tuesday following the first Monday of November) or Memorial Day (last Monday of May).
Nevertheless, it is still possible to represent all the above in three small integers, by replacing the first integer in the tuple with the earliest possible day of month. For instance,
Martin Luther King Day = the Monday between January 15 and 21, represented by (15,1,1)
Election Day = the Tuesday between November 2 and 8, represented by (2,2,11)
Thanksgiving (before 1939) = last Thursday of November = the Thursday between November 24 and 30, represented by (24,4,11)
Thanksgiving (modern) = fourth Thursday of November = the Thursday between November 22 and 28, represented by (22,4,11)
Tags: dev
Extract Deb files from command line
By chys on February 2nd, 2010Debian and its derivatives use the .deb format to distribute their packages. To extract them, use ar – Yes, the very program we programmers use to make static libraries.
ar x sudo_1.6.9p17-2_i386.deb
Or we can directly extract things from data.tar.gz contained in the .deb file:
ar p sudo_1.6.9p17-2_i386.deb data.tar.gz | tar -xzf -
No longer a user of Debian GNU/Linux, I still have to remember how to extract .deb files. I frequently need to cross-compile a 64-bit version of my program on a 32-bit system, and vice versa; but I don’t want to cross-compile by myself so many libraries on which my program depends. Instead, I find it a good idea to download a right .deb file from the Debian Packages Repository and pick out the .so files.
Tags: compression, Debian, Gentoo, Linux

