April 1, 2012

[updated] Functional programming language for C programmers and friends

Just for you: module main { import std (range); import std.io (printf, IO); /* print the Fahrenheit-Celcius table for fahr = 0, 20, ..., 300 */ function main(mutable IO io) { Int lower = 0; // lower bound Int upper = 300; // upper bound Int step = 20; // step for (Int fahr in range(lower, upper, step)) { Double celcius = 5 * (fahr - 32) / 9; std.io.printf(io, "%3d\t%6. ... Read more

March 3, 2012

hardlink 0.2 RC1 released

I have just released version 0.2 RC1 of my hardlink program. Compared to the 0.1.X series, the program has been rewritten in C, as Python was to memory-hungry for people with millions of files. The new program uses almost the same algorithm and has almost completely the same bugs as the old version. The code should be portable to all UNIX-like platforms supporting nftw(). I have tested the code on Debian, FreeBSD 9, and Minix 3. ... Read more

January 24, 2012

Managing system package selections using custom meta packages

Over the last years, I have developed a variety of metapackages for managing the package selections of the systems I administrate. The meta packages are organized like this: jak-standard Standard packages for all systems jak-desktop Standard packages for all desktop systems (GNOME 3 if possible, otherwise GNOME 2) jak-printing Print support jak-devel Development packages jak-machine-<X> The meta package defining the computer X Each computer has a jak-machine-X package installed. ... Read more

December 9, 2011

Combining ikiwiki and Twitter's bootstrap

Just because Julien did it, I moved my website to almost the same design now. Still using ikiwiki, of course. I’m still missing a few things, such as marking the currently active page in the menu, but I hope to get that done as well soon. Go to http://jak-linux.org/ to see it.

August 11, 2011

World, Space, and Licenses

Common licenses for software include the term “worldwide”. Now, what does worldwide mean? The problem with the term worldwide is that it is ambigous and depending on it’s interpretation, violates against DFSG 6 which states: “No Discrimination Against Fields of Endeavor”. The reason: Space travel. If we take the term worldwide to mean “everywhere on earth”, the license becomes non-free, as it prohibits the use outside of this planet. Affected by this problem are the patent section of GPL-3, the Apache 2. ... Read more

May 30, 2011

0x15 + 1/365

Yesterday was my 21st birthday, and I received all “Hitchhiker’s Guide to the Galaxy” novels, the five ones in one book, and the sixth one written by Eoin Colfer in another book. Needless to say, the first book weights more than an N900. I did not read them yet, so now is the perfect chance to do so. Yes, I did not know that 25th is towel day, sorry for that. ... Read more

May 11, 2011

underscores and undefined behavior

As everyone should know, underscores in C are not cool, as they cause undefined behavior per 7.1.3: Yet, they are widely used everywhere. Here are some examples: * inclusion guards in GLib: ` __G_VARIANT_H__` * internal Python functions: `_PyUnicode_AsString` * various macros in APT: `__deprecated`, `__hot` All of this triggers undefined behavior and is thus uncool. Of course in APT, it’s most stupid, as we do not have any namespace and could thus end up redefining things we should not much more likely then the other two. ... Read more

October 26, 2010

simple code - clang creates 1600x faster executable than gcc

The following program, compiled with clang 1.1, runs 500 times faster than the gcc4.5-compiled code (in both cases with -O2): <span style="color:#008200;">#include <stdio.h></span> <span style="color:#008200;">#define len 1000000000L</span> <span style="color:#830000;">unsigned long</span> <span style="color:#010181;">f</span><span style="color:#000000;">(</span><span style="color:#830000;">unsigned long</span> a<span style="color:#000000;">,</span> <span style="color:#830000;">unsigned long</span> b<span style="color:#000000;">)</span> <span style="color:#010181;">__attribute__</span><span style="color:#000000;">((</span>noinline<span style="color:#000000;">));</span> <span style="color:#830000;">int</span> <span style="color:#010181;">main</span><span style="color:#000000;">()</span> <span style="color:#000000;">{</span> <span style="color:#010181;">printf</span><span style="color:#000000;">(</span><span style="color:#ff0000;">"%lu</span><span style="color:#ff00ff;">\n</span><span style="color:#ff0000;">"</span><span style="color:#000000;">,</span> <span style="color:#010181;">f</span><span style="color:#000000;">(</span><span style="color:#2928ff;">0</span><span style="color:#000000;">,</span> <span style="color:#2928ff;">2</span><span style="color:#000000;">*</span>len<span style="color:#000000;">));</span> <span style="color:#000000;font-weight:bold;">return</span> <span style="color:#2928ff;">0</span><span style="color:#000000;">;</span> <span style="color:#000000;">}</span> <span style="color:#830000;">unsigned long</span> <span style="color:#010181;">f</span><span style="color:#000000;">(</span><span style="color:#830000;">unsigned long</span> a<span style="color:#000000;">,</span> <span style="color:#830000;">unsigned long</span> b<span style="color:#000000;">)</span> <span style="color:#000000;">{</span> <span style="color:#830000;">unsigned long</span> sum <span style="color:#000000;">=</span> <span style="color:#2928ff;">0</span><span style="color:#000000;">;</span> <span style="color:#000000;font-weight:bold;">for</span> <span style="color:#000000;">(;</span> a <span style="color:#000000;"><</span> b<span style="color:#000000;">;</span> a<span style="color:#000000;">++)</span> sum <span style="color:#000000;">+=</span> a<span style="color:#000000;">;</span> <span style="color:#000000;font-weight:bold;">return</span> sum<span style="color:#000000;">;</span> <span style="color:#000000;">}</span> Now, I would be interested to see what’s happening here. ... Read more

October 20, 2010

The Three Levels of Package Management

In today’s Linux distributions, there are usually two to three levels of package management. In this blog post, I will explain the three levels of package management. 1. Local (dpkg, rpm) The first level of package management is the ‘local’ level. This level consists of package management tools that install and/or remove packages via package archives such as .deb or .rpm files and a database of the local’s system state. ... Read more

August 30, 2010

Google Public DNS blocks wikileaks.org (Update: No, they don't)

It seems that Google is blocking wikileaks.org in its ‘Public DNS’ servers (8.8.8.8 and 8.8.4.4): <div id="_mcePaste">; <<>> DiG 9.7.1-P2 <<>> @8.8.8.8 wikileaks.org ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 50227 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;wikileaks.org. IN A ;; Query time: 2457 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Fri Aug 27 18:10:43 2010 ;; MSG SIZE rcvd: 31</div> Update: Sorry Google, for me doubting you. ... Read more

Copyright © 2018-2020 Julian Andres Klode, articles licensed under CC BY-SA 4.0.
Comments are provided by Mastodon and copyright of their authors.

This website does not store any personally identifiable information. As part of standard web server access_log logging, it stores requests and the user agents and shortened IP addresses used to make them. It does, however, load some avatars from mastodon.

Powered by Hugo, and the Ernest theme.