## Posts

Showing posts from February, 2009

### Shredded tires to cover landfills (link)

I like simple, cheap (=energy efficient), realistically implementable (feasible) and proven eco-friendly methods such as the following: edit of 2014: sorry for the broken link, here are some fresh ones: SHREDDED TIRES A CHEAP, ENVIRONMENTALLY FRIENDLY WAY TO COVER LANDFILLS (James E. Kloeppel, Physical Sciences Editor) Shredded tires a cheap, environmentally friendly way to cover landfills (phys.org)

### Binary numbers toy in Erlang GS graphics

Because of popular demand, I have ported the previous example to Erlang using it's built-in GS package. Enjoy! :-D All code and text in this post is Copyright (c) bkil.hu [also known as bkil], 2009; and is licensed under the GNU GPL v2. Refer to the standard license texts from June 1991 for exact conditions. Here is an example link: http://www.gnu.org/licenses/gpl-2.0.html Here's the core (simbins.erl): -module(simbins). -export([radix/3, binaries/2, simbins/1]). %% Radix conversion with LSB output. radix(_,0,_) -> []; radix(R,W,N) -> [N rem R | radix(R, (W-1), (N div R))]. %% A full-matrix transpose stub. transpose([H|T]) when is_list(H) -> Append = fun(V, M) -> lists:zipwith(fun(E,L) -> [E|L] end, V, M) end, Vector = fun(L) -> lists:map(fun(E) -> [E] end, L) end, [RH|RT] = lists:reverse([H|T]), lists:foldl(Append, Vector(RH), RT). %% 'binaries' is a solution to Paul R. Potts's idea. %% Prepend lists:reverse(  to get

### Binary numbers toy in Haskell SOE graphics

I've been browsing Mr. Paul R. Potts's blog when I stumbled across a simple, yet neat idea. I was not quite satisfied with the lengthy solution given, so I decided to construct something similar looking from scratch. I'm using the Hugs and GHC built-in HGL/Graphics.SOE package. See the result below. Expect to see more later. All code, text and the 5 images in this post are Copyright (c) bkil.hu [also known as bkil], 2009. I place the images in the public domain. The code and text are licensed under the GNU GPL v2. Refer to the standard license texts from June 1991 for exact conditions. Here is an example link: http://www.gnu.org/licenses/gpl-2.0.html Here's the core (Simbins.hs): module Simbins where import Data.List(transpose) -- Radix conversion with LSB output. radix _ 0 _ = [] radix r w n = (n mod r : radix r (w-1) (n div r)) -- 'binaries' is a solution to Paul R. Potts's idea. -- Prepend reverse .  to get MSB. binaries w = transpose .

### Problems with Debian Lenny

If you followed this blog, you would know that I have been testing this distribution for some time now. It's still yet to be released, but I am generally satisfied with it's quality. Etch was also nice and I still have it installed and updated. However, I needed newer versions of a few applications badly (Erlang, Emacs, Epiphany) and libraries (glib 2.10). It also has some annoying bugs lurking around (like sometimes Xorg fails to resume after waking from hibernate-disk). Most issues I list below about Lenny are either notorious upstream bugs, or are related to my aging hardware, so they shouldn't be taken too seriously. hibernate-disk (1.99-1)+MPD [0.13.2]+via686a [Linux-image-686/2.6.26+17]: sound output doesn't resume after hibernation, and MPD seems to hang with 100% CPU usage until either it is killed or some other application does proper sound output. Fix: either killall mpd&&{sleep 5;mpd;} or aplay/dd something (perhaps even patch mpd). Workaround: put t

### My luck with google on Valentine's day (UNIX Epoch 1234567890)

The day before yesterday, something remarkable happened. I was preparing to go to sleep and turn my computer off. I have closed all applications and almost hit the power button when something flashed into my mind. I forgot to check something important: I wanted to do a web search, so I fired up Google. And to my great surprise the standard Google logo was replaced with a very interesting one. It said the following: Google \$ date +%s 1234567890 I have understood that immediately, but I hesitated for a few seconds because of the surprise. When I typed it in a terminal, the output was as expected: 1234567897 (because of the overall reaction time). I clicked on the logo to see the background story. I wonder for how long that logo was enabled. Was it there for only a second? Am I really so lucky to have snitched the exact second of that happening?! Add to the fact that it was Friday the 13th in UTC (but already Valentine's day in CET). It's a pretty odd event anyway if you

### Enumerating all subsequences for password recovery v0.1

I needed to write this trivial Haskell sample for a script of mine to crack one of my passwords! :) You see, I do keep some of my passwords written down on paper. But it's not any ordinary piece of paper: it's a paper full of random characters! :-D It does help a lot against nosy audience. I also keep it with me next to high value banknotes, so I would say it's well protected. I eventually memorize most passwords this way, but until then, I only keep the position of it in mind. It's a bad habit of mine, and I haven't been doing this before. I have only recently found myself in a need for replacing a lot of my old passwords. If I could be sure in that every workstation I sit at will have md5sum installed at the very least then a single master password would suit my needs. Come to think of it, I could put my little Psion computers in order just for this very purpose! :) You have probably heard of (cryptographically secure-) hashed password generation before. So let&