From Wadler's Blog, What does logic have to do with Java? (wait for the gimmick at the very end):
Tuesday, April 21, 2009
Thursday, April 16, 2009
Remove Unwanted Icons (Windows)
In Windows, there are icons that cannot be deleted by right clicking, dragging to the recycle bin, or hitting the delete key. To get rid of these pesky, unwanted icons:
- Right click on the Desktop and select Properties.
- Select the Desktop tab.
- Click the Customize Desktop button.
- Click the Clean Desktop Now button.
- Check the checkboxes for any icons you do not want.
- Click the Apply button.
- Now the icons you despise are in a folder on the Desktop. Delete that folder.
Tuesday, April 14, 2009
xdotool
xdotool is an awesome command that enables programmatic control of X events, e.g. pressing keys, moving or clicking the mouse, resizing windows, etc. It is a great response to this xkcd:
You can even make the mouse infinitely loop:
You can even make the mouse infinitely loop:
#!/usr/bin/env bash
OFF=300
RAD=300
C=$(expr $OFF + $RAD)
function x {
echo "$RAD * c($1)" \
| bc -l \
| awk '{print int($1 + 0.5)}' \
| xargs expr $C +
}
function y {
echo "$RAD * s($1)" \
| bc -l \
| awk '{print int($1 + 0.5)}' \
| xargs expr $C +
}
t=0
d=0.02
while true; do
xdotool mousemove $(x $t) $(y $t)
d=$(echo "$d * 1.001" | bc -l)
t=$(echo "$t + $d" | bc -l)
done
Watch this for a few minutes; it eventually starts doing some crazy things.
The script also contains several tricks for rounding, etc. that could be more generally useful.
Sunday, April 12, 2009
Twitter on Scala
Here is a nice interview with Twitter developers about replacing an enterprise Ruby backend with Scala. Interesting topics include: flexibility, correctness, concurrency, and fun programming.
Best excerpt:
Best excerpt:
I think it may just be a property of large systems in dynamic languages, that eventually you end up rewriting your own type system, and you sort of do it badly.
Sunday, April 5, 2009
Media Subversion
Peace, Propaganda, and the Promised Land is a fairly well-made documentary available for free download. A first approximation of its theme could be:
The film provides very interesting examples of how the media's language has been controlled; the effects are dramatic. The whole situation seems quite Orwellian.
Take-home point: Supplement your news intake with sources from outside your home country.
Coverage of the Israeli occupation of Palestine from a
perspective absent in US news sources.
but the real point of the film is that:
US news organizations have been subverted.
Evidence of journalistic infidelity is provided by comparing US and British reports on identical events. The differences are disturbing. Of course, this comparison alone only shows someone got it wrong, not necessarily the US. The documentary also covers history, motivation, and influence for the players involved in both the conflict and its media coverage. These factors suggest that the BBC's version of events is more reliable.
The film provides very interesting examples of how the media's language has been controlled; the effects are dramatic. The whole situation seems quite Orwellian.
Take-home point: Supplement your news intake with sources from outside your home country.
Saturday, April 4, 2009
OCaml Documentation in Vim
To have vim open a firefox tab to the documentation for a standard OCaml module:
To use, simply:
Similar coverage of vim's keywordprog in a past thesaurus in vim post and from a post over at Daily Vim : Making K Useful.
- Place this script :
#!/bin/bash firefox http://caml.inria.fr/pub/docs/manual-ocaml/libref/${1}.htmlin ~/bin/ocaml_lkup_module. - $ chmod +x ~/bin/ocaml_lkup_module
- Add this line :
" lookup modules in OCaml online documentation au BufRead,BufNewFile *.ml set keywordprg=~/bin/ocaml_lkup_moduleto your ~/.vimrc.
To use, simply:
- Open up an OCaml source in vim.
- In command mode, move the cursor onto a standard library module name.
- Press 'K'.
- Tah dah! The documentation for that module is open in a new firefox tab.
Similar coverage of vim's keywordprog in a past thesaurus in vim post and from a post over at Daily Vim : Making K Useful.
Thursday, April 2, 2009
Dynamically Resive Font in URxvt
This script allows you to dynamically change the URxvt font size:
I have no idea what the control characters mean or what they will do to other terminal emulators. I found this script on a very helpful Arch Linux forum.
#!/usr/bin/env bash
printf '\33]50;%s%d\007' "xft:Monospace:pixelsize=" $1
So to change to a 16 pixel font:
$ fontsize 16
I have no idea what the control characters mean or what they will do to other terminal emulators. I found this script on a very helpful Arch Linux forum.
Subscribe to:
Posts (Atom)