jump to navigation

Small fixes January 15, 2010

Posted by Elfi in Computers.
add a comment
  • The live-coding environment Fluxus did not compile on my Arch box, but it was quick to fix it. Compiling fluxus 0.16rc3 against drscheme 4.2.3 and g++ 4.4.2 goes on as follows:
    1. Grab the latest source fluxus-0.16rc3.tar.gz,
      dive into the directory
      and add the line
      #include <stdio.h>
      to these files:

      • OBJPrimitiveIO.cpp
      • SkinningPrimFunc.cpp
      • SkinWeightsToVertColsPrimFunc.cpp
      • GenSkinWeightsPrimFunc.cpp
      • GLSLShader.cpp
      • PolyPrimitive.cpp
    2. makepkg -e
    3. pacman -U fluxus-0.16rc3-1-i686.pkg.tar.gz
  • Easy backup of regular files I have created/modified during last few days. The sample shows how to limit the size and exclude on the hidden files and/or an EXCLUDE pattern.

    find /home/elf \
      \( ! -regex ".*/$EXCLUDE/.*" \) \
      \( ! -regex '.*/\..*' \) \
      -type f \
      -mtime -$DAYS \
      -size -$SIZE \
      -exec cp {} //media/usbstick/daily-backups/$DAYDIR/ \;

    .. and just in case, a list of those files and their respective and total size

    find /home/elf \
      \( ! -regex ".*/$EXCLUDE/.*" \) \
      \( ! -regex '.*/\..*' \) \
      -type f \
      -mtime -$DAYS \
      -size -$SIZE \
    | tr '\n' '\0' \
    | xargs -0 du -ch

Random links November 9, 2009

Posted by Elfi in Computers, Life and everything.
add a comment

September 2009

Publishers of all types, from news to music, are unhappy that consumers won’t pay for content anymore. At least, that’s how they see it.

In fact consumers never really were paying for content, and publishers weren’t really selling it either. If the content was what they were selling, why has the price of books or music or movies always depended mostly on the format? Why didn’t better content cost more?

Paul Graham

June 2009

Code and program are the same; any fragment of code may be used interactively. Complex programs are just compositions of simpler ones, and composition of programs is a fundamental concept to both users and programmers. Thus power users cannot help but to be programmers.

Computer science has become a strict subfield of applied mathematics. Creating complex software is primarily modeling: the fundamental task in software development is to create a mathematical model of your problem. The model is encoded directly, and then software scaffolding is built around it, verified to the model. Reasonable shops do not dare ship code that hasn’t been verified to correspond to their model.

Luke Palmer

May 2009

Someone claimed that OOP made it easier for programmers to develop large applications from components. I have been thinking about this claim for the last several weeks. There are two parts to this claim. One is that programmers began to develop large applications more easily from components at the time OOP became popular. Two is that OOP was the what allowed ease of development.

I am not certain either claim is true. I did find it hard to believe that OOP could be responsible for improving productivity. When I think of OOP what comes to my mind is virtual method specialization/dynamic dispatch.

Dynamic dispatch is a scary programming technique. When you call a virtual method, you never know what might happen. This makes it difficult to reason about such code, and code that is hard to reason about is hard to maintain. Dynamic dispatch has its uses, but they are relatively limited. I feel that OOP style encourages this dangerous technique, and it ends up being abused. How could a programing technique that is so dangerous be responsible for improving programmer productivity?

Russell O’Connor

January 2004

Have you ever seen an old photo of yourself and been embarrassed at the way you looked? Did we actually dress like that? We did. And we had no idea how silly we looked. It’s the nature of fashion to be invisible, in the same way the movement of the earth is invisible to all of us riding on it.

What scares me is that there are moral fashions too. They’re just as arbitrary, and just as invisible to most people. But they’re much more dangerous. Fashion is mistaken for good design; moral fashion is mistaken for good. Dressing oddly gets you laughed at. Violating moral fashions can get you fired, ostracized, imprisoned, or even killed.

Paul Graham

Running Arch Linux November 8, 2009

Posted by Elfi in Computers.
add a comment

I have been a Linux/GNU user for about 10+ years now. My first distribution was Red Hat Linux and it did not last long. After a couple of days I was tired of troublesome circular dependences between packages and it was time to check the market more carefully.

Strahov Campus, Prague, Czech Republic. Around 2003.

StrahovPhoto: Miroslav Dobšíček

One evening, after a particularly bright day at Strahov Campus,
I commended to a friend of mine, Karel, who at that time was a guru – only a guru could run Red Hat for more than about two weeks without loosing his mind (he only stopped smoking, drinking and failed few exams later on) – and he told me “Elfi, look, install Debian and you will become a real bushranger”. Of course, he was ironical, smiling and what he really meant was that only a village feeble-mind would leave Red Hat behind. So I did 🙂

Debian proved to be an excellent choice and still it is. I never had to reinstall anything, no single unexplainable failure.  However, as time passed by, a robust and well rounded distribution such as Debian was becoming slower and slower on my laptop with new upgrades. At some point, when the hard drive stopped working to be more precise (read: when I lost a lot of data being laggard to pursue a back-up hard drive instead of an occasional  DVD burn), it was time to give a try to Arch Linux.

Installation was not so straithforward as with Debian since from the time of Lenny “a chicken could install Debian if you put enough grain on any key”, but nevertheless it worked quite well.  It would have been nice to distribute “how-to” documents along with the installation image. Having problems with the X Window System I had to navigate Links to the http://www.archlinux.org site which kind of slowed the installation down. Especially, if the very first issue you have to deal with is a non-working wireless network interface.

Now, I am running Arch Linux for about a month and so far I can only say that it rocks! I gained a lot in terms of speed and the distribution stands to its slogan “simple and lightweight”. Time will show how stable it actually is since new packages are provided daily in a rolling style. Right now, I worry a little bit every time there is a new Linux kernel or X.Org delivery. Things are radically different from Debian stable releases.

A screen shot of my Xmonad session running unicode-rxvt terminal, VIM text editor and Firefox 3.5.

xmonad-screenshotClick to enlarge


Some of my current settings:  

xsetroot -cursor_name left_ptr
exec ck-launch-session xmonad


URxvt.buffered: true
URxvt.background: white
URxvt.foreground: black
URxvt.underlineColor: yellow
URxvt.font: xft:DejaVu Sans Mono:pixelsize=12
URxvt.boldFont: xft:DejaVu Sans Mono:pixelsize=12
URxvt.perl-ext-common: default
URxvt.title: urxvt


import XMonad
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.DynamicLog
main = xmonad =<< xmobar defaultConfig
{ terminal = "urxvt"
, manageHook = manageHook defaultConfig <+> manageDocks


set linebreak
set showmode
set showcmd
set smartindent
"set background=dark
"colorscheme torte
highlight Statement ctermfg=Yellow
set mouse=v
set wrap
set nopaste
set ruler
set viminfo='50,\"500
set history=50
set wildchar=
set wildmenu
set wildmode=longest:full,full
set display=lastline
set showmatch
let g:calendar_monday = 1
let g:Tex_DefaultTargetFormat='pdf'
let maplocalleader = ",,"
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
syntax on
filetype plugin on
filetype indent on
set fileencodings=utf-8
:map :set hls!^M
:map :set paste!^M
:map gq}{