Published on
March 20, 2010.
The thing I always miss most on Windows is the command line — well and Spotlight, but that’s for another post. And if you look at the cmd.exe, its just extremely badly done. It’s a fixed font, fixed width window with way too small font. I don’t want to go too much into detail, but it’s very lacking. Even the newest and greatest Windows has this bad terminal emulator/shell.
But oh brother, there’s salvation! The mighty god of open-source software development has blessed us with two great pieces of software: “Console2″ and”bash”. “Console2″ offers what any other old terminal emulator already has,holy!, even xterm is better than cmd.exe! Sure you might mention that there’s at least Powershell (Can you think of a cheesier name?), but then you’re still stuck with the terminal emulator cmd. Ok, so Console2 has configurable windows size, variable font, coloring and tabs. And the greatest thing for me is that I can even select text with this extremely modern device called a mouse! I always get so exited when I have the chance copy something by selecting and pasting with the middle mouse button.
And then there’s this other little thingy called bash. Using cygwin you can actually get a hold of this extremely powerful UNIX shell. There’s a whole lot of examples how to write in its little language in comparison to the embarrassed giggles that you receive when you ask somebody if they knew how to use the “Powershell”. Ok, so bash is what you want as a shell, seriously. It’s standard on the mac and virtually all Linux distributions. It also has tab completion how god intended it, because it does not just stumble through all the files in a directory but lists all possible completions if there is no unique one.
Ok, to make this hopeless rant helpful for you here are some tips to get a nice terminal in Windows:
- Install Console2 and Cygwin
- Setup an entry in your explorer context menu to start a shell where ever you want (the inverse direction is even simpler: “explorer.exe ./”
- Familiarize yourself with the command “cygwinstart” (it’s the equivalent of Mac’s open command): it automagically opens the correct application for a specific file extension
- If you’re using Eclipse get the EasyShell(update site) plugin and setup to start a Console2 bash; After this thread, I found a way to specify it:
- add the cygwin/bin directory to your PATH variable
- in your bash startup files (/etc/profile, /etc/bashrc, $HOME/.bashrc, $HOME/.bash_profile) remove any commands that change the directory on startup, suchs as cd $HOME and so on
- in Console define your bash tab configuration to start bash –login -i
- start console2 with a command “
/Console.exe -t “” -d “” (in easyshell this should be {1})
(0)
Published on
January 9, 2010.
I’ve enjoyed the luxury of full-time employment over the last month and I’ve enjoyed the fruits of my work aka cash in the form of shiny new things. One of these is the book “Beautiful code”. In this book a range of well-known and not so well-known computer experts describe what they perceive as beautiful code. I was most intrigued about the description of delta debugging by my former prof Andreas Zeller and there are a lot of other interesting descriptions.
In contrast there’s this article on “Gene sorter”, which I find rather ugly. The author praises his CGI-script in C with comments like because we basically have to be stateless because of CGI limitations, we don’t have to care about memory leaks. That’s quite a statement! Maybe the definitions of beautiful source code vary widely, but praising a limitation, that requires many workarounds as an advantage is a bit much. Another construct he praises is object orientation in C. Yes, it exists. Basically a “C-object” is a struct with function pointers. This has some advantages for programmers, but it can become very ugly, because there’s guarantee that a function pointer is assigned and because there’s no constructor or access control. I’ve had to deal with this kind of problems in the Xen source code. In addition to function pointers each “object” in also has references which are set a wildly different places and it was a nightmare to find out where they were set. I sometimes had to write such ugly code too, but at least I didn’t write a chapter in a book about how nice it is
(3)
Published on
November 17, 2009.
There’s something very appealing about widescreen displays and TVs, the wide ratio just seems more natural to the human eye my father always told me. Maybe it has something to do with our past, in which the prehistorical hunter scanned the savanne for game. Who knows..
The trend in recent years goes more and more in this direction and there are a lot of 16:10 and recently some 16:9 displays have surfaced. But the newest “invention” are “cinema ratio” displays wiht a 21:9 resolution. Apart from the different window behaviour needed for this, there’s another issue to be considered here: lost screen estate.
This applies to the common diagonal length comparison. It seems intuitive that if you keep the diagonal constant and the more you increase the width/height ratio, the smaller the actual screen area gets.
Here’s a small python script that computes the screen area for any given diagonal and the ratio:
def ca(e,ratio_shorter_over_longer):
ratio = ratio_shorter_over_longer
b = math.sqrt(1.0/(ratio**2 + 1)) * e
a = ratio * b
return a*b
def ca(e,ratio_shorter_over_longer):
ratio = ratio_shorter_over_longer
b = math.sqrt(1.0/(ratio**2 + 1)) * e
a = ratio * b
return a*b
I’ll spare you the simple mathematics to simplify this to compare two ratios with each other. The result is:
def cr(r1,r2):
Ar1 = r1/((r1**2) + 1)
Ar2 = r2/((r2**2) + 1)
return Ar1/Ar2
For example cr(10/16.,3/4.) gives 0.93 = 93%. For the other ratios you get:
16:9 vs. 4:3 = 89%
21:9 vs. 4:3 = 75%
(1)
Published on
November 8, 2009.
If you have a simple previous-generation MP3 player there’s a chance that you can vastly improve its functionality by running open-source firmware. An excellent team of independent open-source developers has created an amazing firmware for the following MP3 players:
- Apple: 1st through 5.5th generation iPod, iPod Mini and 1st generation iPod Nano (not the Shuffle, 2nd/3rd/4th gen Nano, Classic or Touch)
- Archos: Jukebox 5000, 6000, Studio, Recorder, FM Recorder, Recorder V2 and Ondio
- Cowon: iAudio X5, X5V, X5L, M5, M5L, M3 and M3L
- iriver: iHP100 series, H100 series, H300 series and H10 series
- Olympus: M:Robe 100
- SanDisk: Sansa c200 series, e200 series and e200R series (not the v2/AMS models)
- Toshiba: Gigabeat X and F series (not the S series)
Since very recently my new Sansa Fuze V1 is also supported and now supports so many features that it would become boring to list them all in a blog post. Some of the highlights are: support for all main codecs (no DRM-protected music though!) and about 40 applications and games like Tetris, Frozen Bubble, calendar, and a stopwatch. You can even play DOOM on it!
This reminds of my first MP3 player the Archos Recorder 20. This player appeared before the first iPods and had a whopping 20GB of hard disk capacity, in comparison to the iPod’s lousy 5GB . Suddenly with the Rockbox firmware the device was much more useful and configurable. Yesterday I had the same revelation with my Sansa Fuze.
(1)
Published on
November 1, 2009.
Since about a year IMAP has become widely available with free email providers. See GMX and gmail. That’s why I decided to abandon my old payed email account at fusemail. Now to backup your emails there a couple of open-source projects that store your emails (archivemail, imapbackup.py and offlineIMAP). I finally settled for offlineIMAP because it has the most interface options and supports incremental backups. Incremental backups were very important to me because the other programs seemed to hang from time to time and had to restart the whole backup process all over again.
This might be due to my flaky Wifi connection; YMMV.
Offlineimap only backups in Maildir format. Unfortunately most GUI email clients like Mail.app or Thunderbird by default only support mbox format for importing mails. I found a small script that converts mails from Maildir to mbox format using the command formail from the projekt procmail.
Using this command the conversion is extremely easy. I’ve written a small script that should be executed from the parent directory of the backed up Maildir folder with maildir2mbox.sh <foldername>:
for i in $1/cur/*;
do formail -I “Status: RO” <”$i” >>$1-mbox;
done
for i in $1/new/*;
do formail -I Status: <”$i” >>$1-mbox;
done
for i in $1/cur/*;
do formail -I “Status: RO” <”$i” >>$1-mbox;
done
for i in $1/new/*;
do formail -I Status: <”$i” >>$1-mbox;
done
The resulting <folder-name>.mbox files can be easily imported into either Thunderbird or Mail.app. Another possiblity for import to Thunderbird.app is the Add-on ImportExportTools. Which recognizes the mails from Offlineimap if you add an .eml extension to their filenames.
There remains the problem that mails for special folders like drafts or templates are imported like normail emails in e.g. Mail.app. A simple solution to this problem is to drag them to the drafts folder in a local POP3 mailbox or on another remote IMAP mailbox.
(0)
Published on
October 22, 2009.
This is howto shows how you can install newsbeuter 2.1 on Mac OS X. First you have install some required libraries using MacPorts, a packet-manager on the Mac. MacPorts is very similar to FreeBSD’s ports system.
- The curses-based widget set Structured Terminal Forms Language/Library (STFL) delivers the graphical frontend for newsbeuter.
sudo port install stfl
- The GNU readline library gives users basic line-editing features as known from simple editors like emacs or vi.
sudo port install readline
- Other dependencies are the embedded database SQLite for storing the blog entries, libcurl for transferring files from the Web and pkg-config for managing installed libraries and compile options.
sudo port install sqlite3 libcurl pkgconfig
- The latest available mac-compatible newsbeuter version can be found here (click on download). It’s dated July 22nd. This thread explains that jperras had to do some minimal modifications to newsbeuter itself to make it compile on osx. If you prefer, you can make the same change to the 2.0 release or current HEAD to get a compiling version for Mac. The necessary change is to the file: src/utils.cpp:
- in line 264:
//#ifndef __linux
// const char * inbufp;
//#else
char * inbufp;
// #endif
Fixed the problem.
5. Have fun!
(0)
Published on
October 15, 2009.
Studies have shown that theachers in the US did not increase their efficiency with the help of of computers: in the double-blind experiments (I ask myself how they did that) the effects were negliegible or evene negative. The bottom line seems to be that a teacher can achieve the same efficiency without any technology.
The university in Waterloo I have see many CS professors that followed this idea and presented using only a white board. Depending on how prepared they were, this approach was successfull. On the other hand most of them had no special presentation training in their career and might not have learned the essential skills for good powerpoint presentations. I’ve only once taught a series of tutorial sessions on a black board and found it extremely hard to keep my line of thought while at the same time writing or drawing something on the board. Additionally I find it very tedious to draw any kind of diagram on a board (think how funny it is, when the lecturer needs 2 minutes to draw a circle). At the same time you have up to 40 eyes staring holes in your back and waiting impatiently for you to finish.
So for me it’s not really an option to learn all the skills necessary to give very good computer-less presentation and I find that I can spend my time much more efficiently honing my powerpoint skills.
(0)
Published on
October 10, 2009.
In this how-to I describe how I installed Windows 7 64bit without a DVD drive on my mac. My SuperDrive stopped working nearly a year ago and I haven’t really missed it that much to pay Apple’s huge repair costs or order a replacement drive and install it myself. Anyways; installing without a DVD drive is possible.
There are a couple of How-to floating around that use Windows on a USB stick as an installation medium, but I found a how-to that only uses a USB stick to be able to change the startup disk’s MBR. In short you’ll need these things:
- An ISO image of Windows 7
- A clone of your Mac partition or a bootable version of the Mac OS X installer on a USB drive
- A computer running Windows with a working DVD drive to get Boot camp drivers
Most of the details are specified in the excellent how-to, but you can just boot from the clone or the installer on the USB drive. To get a clone of your startup disk just use tools like CCC or SuperDuper! to backup to an external hard disk.
Just a caveat: Make sure your Boot camp partition is big enough. It is extremely hard to increase the size of the Bootcamp partition. It normally involves deleting the partition and using the Boot camp assistant again.
To get power management and your apple keyboard to work you will have to install the Boot camp drivers after installing Windows. The Snow Leopard DVD is a dual DVD for PC/mac. When opened on any Windows PC, the DVD contains a setup utility and any drivers for your mac’s hardware. Some of the hardware are actually standard components like the graphics or sound card, but the mac-specific keyboard and power management can only beg used with these drivers.
To get the drivers on your mac, just copy the DVD’s contents on another DVD drive and open it in your newly installed Windows 7. The setup.exe unfortunately fails on 64bit Windows versions, but you can simply execute:
msiexec /i BootCamp64.msi
in the directory “Boot Camp\Drivers\Apple” and the installer will start without any complains. After that you can enjoy your new OS
!
(1)