erikb

TECH (67):
  1. Mac mini disk and memory upgrade
  2. Chrome Experiments - not your mother's JavaScript.
  3. If programming languages were religions...
  4. Toasters that lie
  5. New mobile phone messes up calendar (again)
  6. Tip: make a backup copy of your Google Calendar
  7. Call Graph Visualisation with AspectJ and Dot
  8. Building a new computer, part 2 (2008)
  9. Hi, my name is Erik and I'm an e-mail addict
  10. Building a new computer (2008)
  11. 13 reasons why Ruby, Python and the gang will push Java to die… of old age
  12. How to make a Sawed-off USB Key
  13. Get Back your Screen Space: Maximize Firefox Viewing Area
  14. Dropbox
  15. AKG K141 headphones
  16. Help me keep the shell people alive
  17. The Mythical 5% by Bruce Eckel
  18. Puppets Do JRuby
  19. Plasma vs lcd: Experterna lurade i blindtest (in Swedish only)
  20. Android - An Open Handset Alliance, SDK available
  21. He has never met a smartphone he hasn't bought
  22. The future of file systems
  23. Solid State Disk Drives
  24. Easiest setup ever? The AirPort Express
  25. Will it blend?
  26. Hans Reiser interviewed in jail
  27. PowerPoint Turns 20
  28. A real-world take on life in Second Life
  29. New digital camera sensor
  30. Just how much does the internet actually weigh?
  31. 10 Years of Cascading Style Sheets
  32. Calculate the number of days between two dates in PHP
  33. Canon Ixus 850 IS
  34. Good Agile
  35. Amazing R/C airplane demo
  36. Varning för vägkameror (Swedish only)
  37. Mobile companies and software (=sucks)
  38. Case mods
  39. Gaming now and then
  40. Yesterday in 21 seconds
  41. Songbird flies
  42. Building a new computer, part 8 (same benchmark, new setting)
  43. Fans of Joshua Schachter
  44. Building a new computer, part 7 (another benchmark)
  45. Building a new computer, part 6 (the after status)
  46. Building a new computer, part 5 (power supply trouble)
  47. Building a new computer, part 4 (everything connected)
  48. Building a new computer, part 3 (assembly)
  49. Building a new computer, part 2 (the before status)
  50. Building a new computer, part 1 (the shopping list)
  51. Why you need a new digital camera
  52. No fun Java jokes
  53. RFE: add your own CA in mobile phones
  54. SMS warning on low file quote
  55. Laptops, no so useless anymore
  56. Alan Kay does not like Java
  57. Aluminum Foil Deflector Beanie
  58. Webcams, a lot of work...
  59. Caching vs. parsing XML, 4/1 in speed
  60. Review: Juvenile felis catus
  61. Java: checking Swing thread calls
  62. MP3 blog
  63. Audio-Tronic CM3
  64. Convert newlines to paragraphs in PHP
  65. New site
  66. Spam visualization
  67. Email subject line
Mac mini disk and memory upgrade this [2009-06-14]

The Mac mini is an excellent computer for basic use at home - it starts (from sleep mode) in seconds, it's small and quiet. I now bought the latest mini but refused to pay Apple's price for the large disk and 4GB of memory. Doing the upgrade yourself is not that hard if you have some experience doing things like that. The OWC video showing the steps is a must of course. Without that video you would be quite lost.

Chrome Experiments - not your mother's JavaScript. this [2009-03-19]

Google loves JavaScript. Here's a pretty amazing collection of js experiments.

If programming languages were religions... this [2008-12-17]

C would be Judaism - it's old and restrictive, but most of the world is familiar with its laws and respects them. The catch is, you can't convert into it - you're either into it from the start, or you will think that it's insanity. Read the whole list at Aegisub...

Toasters that lie this [2008-11-03]

How true - usability explained in another way. The Encore on Computers is also good.

New mobile phone messes up calendar (again) this [2008-10-27]

Last week upgraded my 3 year old SonyEricson W800 to a brand new W902. I didn't expect it to be more difficult to use...

It's mostly been the clock and calendar that messes up. It turns out if Daylight Savings Time change, then the calendar is a mess (1 hour mismatch). I use goosync to synchronize and the company says it's the phone's fault ("clocks on these devices may change correctly for the DST change but the calendar events will not be changed") and that all you can do is reset everything and start over. You should be careful though to do it the correct way - read the instructions carefully!

Tip: make a backup copy of your Google Calendar this [2008-10-19]

I bought a new mobile phone this week. I installed synchronization of the phone's calendar with my Google calendar. I use Goosync for this - a nice and free utility that works just fine.

In step 2 I synced my mobile with my contacts in Outlook. I use Outlook only for contacts, no email, no tasks, no calendar. What I didn't realize was that when the phone did this sync with Outlook it made a reset of the calendar (since the Outlook calendar was empty, of course).

In step 3 (a bit later) I did a sync of my phone using Goosync. I think you can see what this lead to: all of my Google Calendar was reset. For the sync service it looked like I had cancelled all my appointments in my mobile phone calendar and now wanted to update that fact to the main calendar. Oh man... there is no undo in Goosync, the phone or Google I can tell you.

Many ugly words later I sat down and made a small script that downloads my Google Calendar to my computer and rotates a log of old backups. Use it if you like. If you use an online calendar as your only calendar you do need some kind of backup. There are more ways than I described to loose your calendar entries.

For this script to work you need access to (unix) shell commands and the wget command. If you use Linux everything is probably already there. If you use Windows you might look into installing Cygwin. I scheduled this script to run each morning using crontab. The same can be done on Windows using the builtin scheduler.

#!/bin/bash
# make sure wget is on your path
PATH=$PATH:/it/sw/gnu/bin/

# EDIT: how many previous versions to keep
NUMBACKUP=9
# EDIT: the backup files are saved in this folder
DIR=/home/erikb/private/cal
# EDIT: URL to your calendar (ICS version), look in your settings at Google
URL=http://www.google.com/calendar/ical/USERNAME%40gmail.com/public/basic.ics
# name of file when downloaded, given by the URL above
TMP=basic.ics
# filename for saved backups
PRE=gcal.ics

### Enough settings, do the backup thing now

# goto backup folder
cd $DIR
# clean up old stuff, just in case
rm -f $TMP
# shift backups
COUNTER=$NUMBACKUP
while [  $COUNTER -gt 0 ]; do
    let i=$COUNTER-1
    mv -f $i.$PRE $COUNTER.$PRE 
    echo "mv -f $i.$PRE $COUNTER.$PRE"
    let COUNTER=COUNTER-1 
done

# download calendar
wget $URL
# rename file
mv -f $TMP 0.$PRE
# clean up, just in case
rm -f $TMP
Call Graph Visualisation with AspectJ and Dot this [2008-10-02]

Nice way to visualize methods calls in code. Impressive graphs.

Building a new computer, part 2 (2008) this [2008-08-11]

This is just a short post about the first experiences with my new computer. My benchmark post concluded the new system is twice as fast as my previous build.

Step 1: as always, it is recommended to put most components together outside the box. At least the CPU, cooler and memory need to be installed this way.
New computer 2008

Step 2: change case fans to someting really silent. I use the beige "NOCTUA NF-S12-800 SILENT CASE FAN 120MM", even if the default fan in the Antec Sonata Designer 500 is pretty ok as it is. This fan, and the cpu cooler, is what will create most of the noise so it is important to spend some money on quiet quality componets. Noctua isn't cheap.
New computer 2008

Step 3: I added two front fans, so that the flow through the case would be improved. They suck in air right over the hard drives and onto the passive graphics card. I use power adapters to clock down the fan rotation by 50% (included from Noctua). You cannot hear these fans at all at this slow speed. Again Noctua, 2 x 92 mm.
New computer 2008

Step 4: the drives go in. Even if the rubber band mounts have beed improved from previous case versions, I don't quite trust them. I used the screws with rubber pads.
New computer 2008

Step 5: most things are in place. A graphics card and some cabling remains. I wish I had known about the Asus EN3650 Silent Graphics Card - it seems to have the right mix of performance and cooling. It has passive cooling (a must) and has 2 DVI connectors - it's easy to find passive cards with DVI+VGA but 2xDVI are still a bit rare. I now use the similar "ASUS EN8600GT" but it's rather old and gets a bit hot.
New computer 2008

Final step: OS installation and then finalize all cabling.New computer 2008

The system is very quiet and (so far) is running just fine. My shopping list was:

Case: Antec Sonata Designer 500 
Motherboard: ASUS P5E3 Deluxe - ATX - iX38
CPU: Intel Core 2 Duo E8400 / 3 GHz
CPU fan: ARCTIC COOLING - FREEZER 7 PRO 
Disc: 2 x Samsung SpinPoint T166 - 500 GB
Graphics: ASUS EN8600GT SILENT/HTDP - GF 8600 GT
DVD: Samsung Super-WriteMaster SH-S203P - DVD±RW
Fans: NOCTUA NF-S12-800 SILENT CASE FAN 120MM + 2x NOCTUA NF-B9 SILENT CASE FAN 92MM  
Hi, my name is Erik and I'm an e-mail addict this [2008-06-23]

A nytimes article on the growing fight against information overload, especially email addiction. I like the solution with Google's E-Mail Addict - "an experimental feature for the company's e-mail service that lets people cut themselves off from their in-boxes for 15 minutes."

"There's a competitive advantage of figuring out how to address this problem," Mr. Tang said. He said that there was "a certain amount of irony" in the fact that the solutions are coming from the very companies that built the digital systems in the first place.

Building a new computer (2008) this [2008-06-13]

A new CPU, a new java version: almost exactly twice as fast as the old benchmark from two years ago.

> java -server -cp . jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 894.2564204678547
FFT (1024): 592.4730423267126
SOR (100x100):   1180.732257373216
Monte Carlo : 327.4601432249603
Sparse matmult (N=1000, nz=5000): 577.6641556409897
LU (100x100): 1792.9525037733952

java.vendor: Sun Microsystems Inc.
java.version: 1.6.0_10-beta
os.arch: x86
os.name: Windows Vista
os.version: 6.0

Benchmark number 2: ripping a CD. Exactly the same CD as before. I used Incognito's album "Eleven", CDex ripper with quality=2 (high) and 256 kbps setting.

Almost no change at all. The CPU is not the slowest component it turns out.

2008: Intel Core2Duo E8400, 3.0 GHz, 2:25 minutes.
2006: AMD Athlon 64 X2, dual core 4200+: 02:55 minutes. 
2005: Intel P4, 2.26 GHz: 08:26 minutes.
13 reasons why Ruby, Python and the gang will push Java to die… of old age this [2008-05-30]
How to make a Sawed-off USB Key this [2008-04-18]

Tech humor...

USB key

Get Back your Screen Space: Maximize Firefox Viewing Area this [2008-03-17]

With a couple of plugins in the browser you easily waste screen estate. Here's a few tips on how to get that space back. Note that you have to configure the new menu to include (some of) the buttons from the old navigation menu.

makeuseof.com

Dropbox this [2008-03-12]

A beautiful solution for sharing files online, with a group, between computers or whatever your need is. (via fosfor.se)

http://www.getdropbox.com/

AKG K141 headphones this [2008-02-11]

akg 141I used to have these old classic K141 headphones along time ago. Solid construction - but more important - they sound good even at very high volume levels. I used to really put them to the test, and nothing... in the end they wore out mechanically. I now bought the updated Studio version (55 ohms). It's easier to use with mp3 players and at work (computer output). The result: many albums got a whole new life and sound - I'm very pleased.

The sound is close to neutral. Bass is better compared to the more common ear plugs that many use. It's on a whole different level really. I now see (damn) AKG just released the MK II version.

Help me keep the shell people alive this [2008-01-21]

I guess you have to be a bit of a nerd to find this funny.

"I need a woman (obviously) who is willing to raise a child with me in the method of Unix."

The slashdot take on this wanted ad was:

ohtani@darkstar:~$ man woman
Segmentation fault (core dumped)
The Mythical 5% by Bruce Eckel this [2008-01-02]

"Bad software usually just annoys people but bad engineering can kill. An even more fascinating metric is this: 5% of programmers are 20x more productive than the other 95%. If this were a science, like it claims, we could figure out how to get everyone to the same level."

The Mythical 5%

Puppets Do JRuby this [2007-12-10]

I'm not sure what Bruce Eckel is trying to say? Thay JRuby is strange? The feedback return values are fantastic. False is good, nil is not an exception and therefore a good thing...

Plasma vs lcd: Experterna lurade i blindtest (in Swedish only) this [2007-11-29]

IDG testar tv: "Efter att ha hårdgranskat skillnaderna mellan plasma och lcd i en vecka var det dags för blindtest. Vilken typ av tv ger bäst bild, och hur viktig är upplösningen för upplevelsen? Efter vårt test blev det tydligt att inte ens experterna ser skillnad mellan hd och full-hd på riktigt nära håll."

Android - An Open Handset Alliance, SDK available this [2007-11-13]

For those that don't follow the Google news: Android is a software stack for mobile devices that includes an operating system, middleware and key applications.

I didn't expect it to be available for download so soon.

He has never met a smartphone he hasn't bought this [2007-11-01]

Welcome to dork talk with Stephen Fry.

Stephen Fry and gadget

The future of file systems this [2007-10-18]

ACM Queue speaks with two Sun engineers: Jeff Bonwick and Bill Moore. They developed ZFS to address many of the problems they saw with current file systems, such as data integrity, scalability, and administration.

Solid State Disk Drives this [2007-10-15]

Tom's Hardware has a piece on a new type of storage. Solid-state drives (SSD) seems the way to go. What I miss from the review is a more subjective opinion on how it affects normal use; Tom's reviews tends to focus only on the numbers. All aspects except random write seems better with SSD.

SanDish SSD

More about the disks at SanDisk. Their whitepapers are not fantastic reading (just a bit biased you could say), but still something with more detail. Tom says a SSD with 32 GB will cost about $400 at the moment.

Easiest setup ever? The AirPort Express this [2007-10-02]

I bought an AirPort Express more than a year ago. It's been sitting next to my Mac Mini, in its original box. I'm ok with connecting to the Internet using cable so I don't really know why I got this device.

AirPort Express

I remember my old D-Link Base Station and the hard work it was to make it do anything. Without a manual you couldn't do anything. With a manual you could cause a big mess. That was it, more or less.

This Sunday, I plugged the AirPort into a socket in my living room, connected it to AUX on my stereo (that is, no internet cable attached to the AirPort), then turned on the Mac Mini. It connected to the AirPort and said there was new version of the firmware available - "Should I get it?". I clicked yes, waited while the Mini downloaded it, installed it wirelessly, rebooted the AirPort and then said "all done". A few more clicks and the connection was running encrypted (WPA2). This took less than 3 minutes.

Now I can use iTunes to play music through my stereo wirelessly. It's not often you find computer devices with this kind of usability.

Will it blend? this [2007-08-30]

Everybody knows that the iPhone can make phone calls, play movies & music, surf the web, and a lot more. But, Will It Blend? That is the question.

See willitblend.com for more things (not) to blend.

Hans Reiser interviewed in jail this [2007-06-27]

As most Linux users I've read about ReiserFS. The wiki page about the file system is.. laconic?:

"ReiserFS was the default file system in Novell's SUSE Linux Enterprise until Novell decided to move to ext3 on October 12, 2006, two days after principal author Hans Reiser was charged with the murder of his wife."

In short: Reiser denies killing his wife, her body has not been found, the trial is set to begin in July.

Wired's Joshua Davis met him in jail. It's a strange, strange read - a mix of low-tech implementation facts and the murder case, filled with details about a bizarre life. Hans Reiser: Once a Linux Visionary, Now Accused of Murder

PowerPoint Turns 20 this [2007-06-25]

Wall Street Journal has the info.

A real-world take on life in Second Life this [2007-06-25]

I love that people have the time and energy to do these kinds of things.

Want more? The get a first life page is pretty funny.

New digital camera sensor this [2007-06-14]

When you look at how digital cameras produce images it is a wonder they look like the real thing. There are so many strange things about how images are constructed; twice as many green sensors, interpolation of colors and the whole filtering issue. There's a good tutorial about sensors by Sean McHugh.

Now Kodak says they have something dramatically better. Looks impressive.

Just how much does the internet actually weigh? this [2007-06-11]

The Guardian says 60 grams!

10 Years of Cascading Style Sheets this [2006-12-20]

Has it really been that long? See W3C's history and highlights from 10 years with style.

Calculate the number of days between two dates in PHP this [2006-10-17]

Not exactly wizard code, but why not publish it anyway... I googled for an example like this myself but had trouble finding a good match. Maybe it was more a question of finding the right keywords to search for.

I use this code on the Swedish site for the World Usability Day.

function daystogo() {
  // my target date is November 14th 2006
  $then = mktime(0, 0, 0, 11, 14, 2006);
  // calculate difference between now and then
  $now = time();
  $diff = $then - $now;
  // second, minute, hour
  $days = round(0.5 + $diff / 60 / 60 / 24);
  // make sure we do not return negative zeros
  if ($days == -0) $days = 0;

  return $days;
}
  // somewhere later in the code... 
  $days = daystogo();
  // if ($days > 0) ...
      
Canon Ixus 850 IS this [2006-10-02]

I upgraded from my old Ixus 50 to the brand new Ixus 850. The 850 has image stabilization (IS) which was my main reason for the switch.

I took a shot of my office, made a crop of the air condition switch and part of the whiteboard. It's quite a big difference, not only because of the higher resolution but also in quality.

office view

Ixus 50, crop 100%
old ixus

Ixus 850, crop 100%
new ixus

Ixus 50, crop+resize
old ixus

Ixus 850, crop+resize
new ixus

The image quality is a lot better on the 850. The display on the back is also more usable. The old camera had a better casing though - solid metal, and really tight and compact. The new 850 has a plastic feeling and is clumpsier.

Good Agile this [2006-09-29]

Steve Yegge, a developer at Google, writes about software life at Google. Steve lays out some of the software development practices (Agile) that make Google work. A good read.

Amazing R/C airplane demo this [2006-06-11]

Come on... it has to be a fake! Nobody can fly like that. The plane seems to hover in air, by itself. If this is true, birds will be jealous of this pilot.

Varning för vägkameror (Swedish only) this [2006-05-22]

Jag skulle nog kunna tänka mig en låda ActiveGPS, för att bli informerad om kommande vägkameror. Lådan kanske kan få en att bättre hålla fartbegränsningarna? Företaget borde i alla fall göra om lådan även för ett mer seriöst syfte, inte enbart som en pryl för att slippa fortkörningsböter.

Den skulle kunna varna när man kör mer än, säg, 10 km/h för fort. Jag ser inte riktigt att den skulle hjälpa mot dålig körning, som de själva illustrerar med denna bild. Svarta streck innan en vägkamera - genom deras box så bromsar man alltså i god tid, men har i övrigt lika dålig trafikmoral, eller?

bromsa

Mobile companies and software (=sucks) this [2006-05-19]

I tried to update the software on my mobile phone, a Sony Ericsson w800i. There's a handy tool for that, called Update Service, that you can download from Sony Ericson. I like that you can do that yourself - without having to go to the phone resellers (and even have to pay for it). Of course the update software didn't work. I would have been surprised if it did, actually. My experience is that companies like this do not care about customer software. If they did we would not have projects like floAt's Mobile Agent. Exactly the same goes for many other tech companies, like Philips and Creative.

When trying to run the update, I got this window.

error msg

Of course I updated my Macromedia software. Who knows what version it expects... why it (at all) required Macromedia to flash the phone bios I don't understand.

It turns out that Internet Explorer needs the latest version of the Flash plug-in - not something a Firefox user really cares about. Ok, so that is now done and it is working.

When you update the phone, it says to remove the SIM card, press "c" and insert USB cable. Did this, but didn't realize to hold "c" pressed for maybe 10 seconds, until a new window pops up, saying "Let go of c". Oh man...

Case mods this [2006-03-28]

A pretty complete list of case mods.

My favourite is the Hypercube.

Gaming now and then this [2006-03-24]

A comparison of how video games look now and 20 years ago. Computer graphics really have moved on...!

Gaming now and then. (fosfor gadgets)

Yesterday in 21 seconds this [2006-03-20]

I have an office webcam - a camera that sucks big time when it comes to the bundled software. All scripts and grabbers have to be written by the buyer, basically. It shows the view from my office. Not a very interesting view, but at least it's there and it's free.

I grab and publish a new image a couple of times per hour. Today I wrote some scripts that combine all those daily images into a small video clip. The clip is 21 seconds long, starting at 00:00 and ending before midnight. The clip is automatically updated every day. Check it out over here.

My plan is to make a clip of the whole year.

Songbird flies this [2006-02-21]

Songbird is a Web player built from Firefox's browser engine. Songbird is open source. Beautiful and technically interesting. Quite impressive. The music even sounds better...

Songbird

Building a new computer, part 8 (same benchmark, new setting) this [2006-02-14]

I repeated the same old Scimark 2.0 benchmark, but now with a server setting for the jvm. The benchmark now runs 165 percent faster! Incredible.

> java -server -cp . jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 449.17374212032354
FFT (1024): 360.08271871383903
SOR (100x100):   708.6998662588823
Monte Carlo : 62.282009179537155
Sparse matmult (N=1000, nz=5000): 320.3128048768835
LU (100x100): 794.491311572476

java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_06
os.arch: x86
os.name: Windows XP
os.version: 5.1
Fans of Joshua Schachter this [2006-02-09]

What can you say about someone who is the creator of Del.icio.us, convinced Flickr to start using tags, and was involved in GeoURL... At 31!

Interview in the Guardian.

Building a new computer, part 7 (another benchmark) this [2006-01-29]

I made another benchmark test, by ripping a CD to MP3.

I used Incognito's latest album "Eleven", CDex ripper with quality=2 (high) and 256 kbps setting.

P4 2.26 GHz: 08:26 minutes.
AMD Athlon 64 X2, dual core 4200+: 02:55 minutes.

For ripping the new computer is 2.9 times faster. I'm quite happy about that.

Building a new computer, part 6 (the after status) this [2006-01-29]

I got the replacement power supply from my distributor and it solved the problem. The only obstacle was that I had to remove the motherboard to replace the power supply - not the best of solutions. It should be an easy fix for Antec to build the left side of the tower so that it is possible to slide the power amp out without having to rebuild the entire computer.

I ran the scimark2 benchmark again.

Composite Score: 271.17860249249054
FFT (1024): 109.01504
SOR (100x100):   509.6416128038548
Monte Carlo : 41.09544600963967
Sparse matmult (N=1000, nz=5000): 241.0298025378471
LU (100x100): 455.1111111111111

java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_06
os.arch: x86
os.name: Windows XP
os.version: 5.1

So, the new machine is 1.7 times faster than the previous score.

Building a new computer, part 5 (power supply trouble) this [2006-01-25]

It turns out the are (in-)compatibility issues between ASUS motherboards and Neo HE power supplies. This means there's no progress at all. To make it even worse, Antec has failed to label the upgraded power supplies with a tag so my reseller doesn't know if the shipped replacement supply will fix the problem. I'm guessing I will get another supply with the same old compatibility problem... This project is already one month long!

Building a new computer, part 4 (everything connected) this [2006-01-23]

It's close now. Everything is connected. Some cables still require some work. Some of the cables are almost impossible to hide.
all the parts

The left side panel is removable, and you can hide some cables through here. Good solution. Note the thumb screws on the front side fan intake.
memory

It's not that visible (click to see a large image) but the CPU fan is in the way of the memory. You must use this first memory slot if you have two memory chips. I had to remove the fan from the cooler, mount the memory and put the fan back. I hope it will work.
cpu

Rubber mounting the drives. They kind of hang in the air. Not recommended for transport.
cpu

Building a new computer, part 3 (assembly) this [2006-01-23]

Start of the process. The hardest thing is to read all the manuals - boring but it does help in the long run.
all the parts

Memory
memory

CPU and fan
cpu
CPU fan

DVD
DVD

Harddrives
Harddrives

Building a new computer, part 2 (the before status) this [2006-01-23]

In order to know if the new computer is any faster I clocked my current machine. There are quite many ways to do this. For me, development in Java is one of the few performance-critical tasks (and ripping of CDs).

I used the straightforward Scimark 2.0 benchmark. My result is not very impressive. I ran the benchmark while all my normal apps were running (such as web, email, winamp, etc). That's close to 50 processes, almost all idle but still... CPU was at around 4% when idle.

I use a Dell Optiplex GX260: Pentium4 2.26 GHz. 640 MB of RAM.

> java -cp . jnt.scimark2.commandline

SciMark 2.0a

Composite Score: 161.214980498726
FFT (1024): 64.60150518518519
SOR (100x100):   314.6562679937868
Monte Carlo : 17.748972704108535
Sparse matmult (N=1000, nz=5000): 117.82812366457514
LU (100x100): 291.24003294597435

java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_06
os.arch: x86
os.name: Windows XP
os.version: 5.1

> java -cp . jnt.scimark2.commandline -large

SciMark 2.0a

Composite Score: 121.90855699535048
FFT (1048576): 18.205057702127657
SOR (1000x1000):   299.16657188068535
Monte Carlo : 16.777216
Sparse matmult (N=100000, nz=1000000): 113.77777777777777
LU (1000x1000): 161.6161616161616
Building a new computer, part 1 (the shopping list) this [2006-01-20]

My 3 year old Dell feels slower each day. It's not good-looking at all. It makes noise. Time has come to upgrade. Just for fun, I will put together my new computer from scratch. I will document the whole process here, with photos.

Step one is buying the right components. Here's my shopping list:

Antec Miditower P150 430w Silver
The best case I've seen, from a functional point of view. Excellent power supply (low heat), USB/audio/firewire connectors available on the front, looks ok, rubber-band mounting of hard drives, etc. Good review at Silent PC review.
AMD Athlon 64 X2, dual core 4200+
A difficult decision to make. I like the cooling (throttling) solution, and the dual core. AMD is not that cheap any longer, so chosing between AMD and Intel is not that easy. For me, the heating problems with most Intels was the key.
I chose the AMD Manchester core, with 2 x 512 kB cache. The newer Toledo core had doubled the cache size. However, Manchester consumes a maximum of 89 W, while Toledo max out at 100 W. There's a quite long article on this matter at Tom's hardware.
Freezer 64 Pro
A silent CPU cooler. Heat pipe and low weight. I'm a bit scared of the Zalman coolers that weigh close to a kilo of pure copper. More info at the Arctic Cooling site.
ASUS A8N32-SLI DELUXE
I've always bought ASUS motherboards, when I had the choise. Cannot change now. The bridge is cooled by heat pipe, no fan.
CORSAIR 2GB DDR PC3500 437MHZ XMS PRO LED
Expensive like no other...! I hope this investment will pay off in speed.
2 x Samsung SpinPoint P120 SP2504C, 250 GB
Large means fast. Sound and temperature are more important.
ASUS Extreme N6600 Top Silencer 256MB
I wanted a silent card with dual DVI connectors - I always use a dual screen setup at work. Today I use a Matrox P650 and it's excellent, but lacks in performance and 3D-acceleration. This ASUS is also passive (large copper cooler, no fan) but has one DVI and one VGA connector. Close enough. I didn't find a passive one with dual DVI connectors at all.
Plextor PX-716SA - DVD±RW
Why are almost all CD and DVD players sold with IDE connectors? I thought we all wanted something else than the messy IDE cables. This one is S-ATA. In Europe Plextor has the reputation of being a premium brand. I don't know about that, but all my Plextor models have worked just fine.
Why you need a new digital camera this [2006-01-11]

The fosfor gadget blog tries it's best at convincing us - you need a new and better camera. Something like 39 megapixels per shot. That should do it. Then you will be able to fill your monthly Flickr quota with just about 50 photos or so... or just one (1) photo is you are on the non-pro account!

Hasselblad H2D-39

No fun Java jokes this [2005-10-19]

Turns out there are no fun tech jokes on Java. From Chet Haase's blog. Dry.

Two items walk into a ToolBar.
The bartender says, "Can I get you a menu?"
"No thanks, we're looking for a little action."

RFE: add your own CA in mobile phones this [2005-10-14]

I tried to activate email in my brand new w800i but failed on the encryption part - "TLS/SSL unknown certificate authority". My email provider regards itself big enough to have their own certificate infrastructure (the Swedish Universities act as their own CA) and, of course, the phone does not know about this. Sadly, there is no way to enter or enable a new CA in the phone. Conclusion: no email for me.

SonyEricsson, please look into this...

Update: I spoke to SonyEricsson Support, and they said they already had made a request for self-signed certificates, but don't know if/when that will be added. A bit sad, as this will hinder quite a lot of services. In theory, this will prevent all Swedish University staff from using secure services.

SMS warning on low file quote this [2005-03-23]

This piece of code is mainly intended for our department staff. We have a free (as in free beer) SMS gateway which allows us to email our mobile phones. The email is converted to a SMS message of course. I think many operators have this kind of gateway even if they don't always like to inform customers of it.

This code is meant to run regularly, using your WinXP scheduler or unix cron. You or your sysadmin needs to install the perl package Quota first.

#!/it/sw/gnu/bin/perl
use warnings;
# see http://search.cpan.org/dist/Quota/
use Quota;

$debug = 0;

# what quota to check, change this to your home directory
$path = "/home/USERNAME";

# lower than this and a warning is sent, in kB
$limit = 50000;

# who to notify, using your cell phone SMS gateway
# UU/IT staff, see: http://www.its.uu.se/tjanster/minicall.html
$to = "0123456789\@sms.OPERATOR.COM";

# mailer
$mailprog = '/usr/lib/sendmail';

# must call with arg "check"
if (@ARGV > 0 && $ARGV[0] eq "check") {
  $space = &checkquota();
  if ($debug) { print STDOUT "quota left is $space\n"; }

  if ($space < $limit) {
    &notify($space);
  } else {
    if ($debug) { print STDOUT "safe quota\n"; }
  }
}

sub checkquota() {
  $dev = Quota::getqcarg($path);
  ($bc,$bs,$bh,$bt,$ic,$is,$ih,$it) = Quota::query($dev);
  if ($debug) { print STDOUT "$bc,$bs,$bh,$bt,$ic,$is,$ih,$it"; }

  return ($bs-$bc);
}

sub notify {
  my ($str) = shift (@_);

  open (MAIL, "|$mailprog $to") || die "Can't open $mailprog!\n";
  print MAIL "Subject: $path quota $str\n";
  close (MAIL);
}

Laptops, no so useless anymore this [2005-03-21]

I'm not a big fan of laptops since I prefer to work at... work. This meaning a stationary computer.
Here's a simple device built-in in new PowerBooks. I saw this kind of technology used in early prototypes on an iPaq. The Digital guys used the motion control to navigate in games - Doom or Quake I think it was.

Having the same possibility in mobile phones would also make sense I guess.

The Apple Motion Sensor As A Human Interface Device

Alan Kay does not like Java this [2005-02-10]

Not really a surprise, but one of the great in Computer Science, Alan Kay, does not like Java. ACM Queue has an interview with him. Not for newbies.

Aluminum Foil Deflector Beanie this [2004-12-06]

There are strange people out there. Really strange.

improper use
ABBA showing improper foil use.

proper use
Hurley showing proper foil use, and accessorization.

An Effective, Low-Cost Solution To Combating Mind-Control

Webcams, a lot of work... this [2004-11-09]

creative nx ultraI recently bought a webcam. It was a cheap Philips ToUCam, a real entry level model. This turned out to be a complete waste of money - you could only capture images using the boundled software. The software was extremely limited and of no use at all.
Today I bought a Creative NX Ultra. This is, I guess, a middle range model in the webcam domain. The camera itself is ok, image quality is acceptable and so on. My main problem is with the software. I couldn't even imagine it would be so difficult to perform the most basic webcam tasks: (i) schedule image captures and (ii) transfer the images to a web server.

The second thing that could be improved is the USB cord. I wish it was detachable (from the camera) so I could replace it with a longer one. USB extensions are not so fun to mess with.

Image capture scheduling is a real pain. You can (rather, have to) schedule them using the supplied software but the scheduling is awkward and not easy to get working. The scheduling does not show up as a normal scheduled task in Windows. What I would like to see instead is a command line tool that captures images according to supplied arguments. Then one could schedule the capture task the same way all tasks are scheduled in Windows. Something like this:

twaincam.exe -capture -quality high -folder C:\images -name foo.jpg

I know of TWAINCommander but I won't pay $199 for this.

The Creative developers included in the software a way to transfer images using ftp. ftp? Is anyone using that, still? I cannot even try that since most security-aware departments block incoming ftp. Bad as the ftp solution is, there is no way to name the image file so even if the transfer was working it would be of no use...

So, script writing again... I think I've got the capture thing working at last, so the webcam software now dumps images named like Img-20041109-11898198918.jpg into a specified folder. From that point on a script can rename and transfer the image.

:: capture.bat, rename webcam images + transfer to server
::
@echo off
:: webcam will dump images here
set from=C:\capture
:: path to our server
set dest=K:\some\where\on\a\server
:: name of image
set name="capture.jpg"

:: Rename the most recent file in directory to another name
:: go to destination directory
pushd %from%
:: find the newest file, should be my latest captured image
for /f %%i in ('dir /a:-d/b/o:d "*" ') do set file=%%i
:: must use "move", as "ren" cannot handle collisions
move /y "%file%" %name%
:: return to original directory
popd

:: Copy image to server
:: c  ignore errors
:: q  quiet
:: y  supress promting to overwrite
:: i  dest is dir
xcopy %from%\%name% %dest% /q /c /y /i

This script is easy to schedule using XP's builtin scheduler. All I need now is to find a way to transfer the file using some better protocol than smb/xcopy.

And here is the webcam. I know, it pointing nowhere useful at the moment.

Caching vs. parsing XML, 4/1 in speed this [2004-10-24]

This web page is generated for each access, by parsing an XML file and transforming the XML contents into HTML. All parsing and transformation is done in PHP. This is really nice from a functional point of view. Changes to the look and layout are very easy to do. The strong separation between content (the XML file) and the view (this HTML page) is valuable because it means the two formats are very loosely coupled - I can make changes to the content or view without affecting the other. The parsing and transformation code (the controller) forms the glue between the two formats. MVC for you programmers.

Parsing the XML data for each access is no problem if you have a fast computer. Today almost all computers are fast enough for such a tiny task. Sadly, the server I run on is busy doing a lot of other things - and sometimes you want to have a sound solution that also cares about practical issues and not just the functional ones. So, I decided to test if a cache of the XML contents would be possible. It turns out it was, and easier than expected too.

The functional solution, with parsing of the XML, is able to produce something like 3-4 pages per second. With the cache, the server now is able to do about 12 pages per second. Not too bad, especially considering it only took 15 lines of PHP code and there's no loss of functionality (no manual generation of the cache).

define("CACHE", "/some/path/web/cache"); // must be server writable

function parse($filename) {
  if (file_exists(CACHE)) {
    $origchange = filectime($filename); // when source content was changed
    $cachechange = filectime(CACHE);    // when cache was generated

    if ($origchange < $cachechange) {  // cache is newer than source
      $file = fopen(CACHE, 'r'); 
      $contents = fread($file, filesize(CACHE));
      fclose($file);      
      return unserialize($contents); // return contents of cache
    }
  }
  // we do not use the cache for this lookup
  $data = parsefromfile($filename); // read original data from xml, the old way
  
  $file = fopen(CACHE, 'w');
  fwrite($file, serialize($data)); // save to cache
  fclose($file); 
 
  return $data;
}

With this solution the cache is constructed by a simple serialization of the PHP data structure. For each access, if the cache exists and is newer than the XML contents, I read and unserialize the cache. If I make an update to the contents (the XML file) the cache is automatically re-generated (because it has an older timestamp) and I need not worry about the cache at all. Works out nicely I think.

This unserialization is almost 4 times faster compared to the XML parser. In reality, the unserialization is a lot faster but with all the overhead (generation of HTML etc) this is what I get when I look at the whole process of making this page. If you only compare the cache vs. parsing you would get a factor 10, if not more.

Review: Juvenile felis catus this [2004-10-10]

I filed this review under "tech" because it is a tech review. From one of the links in the review: "Notice how infra red transforms your average household moggie into the Beast of Satan!"

a warm cat

Review: Juvenile felis catus

Java: checking Swing thread calls this [2004-08-26]

This repaint manager will make sure you call swing repaint operations from the right thread (the event dispatching thread).

From ClientJava: Easily Find Swing Threading Misakes

Not a bad idea, simple and easy to modify for your own needs.

//
RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager());
//
public class ThreadCheckingRepaintManager extends RepaintManager {
  public synchronized void addInvalidComponent(JComponent jComponent) {
    checkThread(jComponent);
    super.addInvalidComponent(jComponent);
  }

  private void checkThread(JComponent c) {
    if (!SwingUtilities.isEventDispatchThread() && c.isShowing()) {
      System.out.println("Wrong Thread");
      Thread.dumpStack();
    }
  }

  public synchronized void addDirtyRegion(JComponent jComponent, 
                                          int i, int i1, int i2, int i3) {
    checkThread(jComponent);
    super.addDirtyRegion(jComponent, i, i1, i2, i3);
  }
}
MP3 blog this [2004-08-17]

I liked Mark's mp3 blog idea, and made a variation on the same idea using the (free) tools mp3splt and mp3wrap. This utility can capture snippets from a collection of mp3 files and then paste them together into one "preview". I did this via a simple shell script. Ok, I know the script is not very pretty... I use Cygwin under WinXP by the way.

#! /bin/bash

# path to the mp3 utilities; see http://mp3splt.sourceforge.net/
SPLIT=mp3splt.exe 
WRAP=mp3wrap.exe 

# temp dir to put files in
dir="split"

# remove any old mp3 file
echo -n "Clean old comp.mp3..."
rm -f "comp.mp3" ; echo "done"

echo -n "Clean temp dir..."
rm -fr $dir ; echo "done"
mkdir $dir

# arg1 is a folder with mp3 files we want to process
folder="$1"

# Capture 20 seconds of music, put result in $dir.
# The loop is written this way to be able to handle files with spaces
# in the filename; quotes around $file is also needed because of this.
ls $folder | while read file; do
    cd $folder; $SPLIT -q -n "$file" 02.10 02.30 -d ../$dir ; cd ..
done

# append all files in $dir into one file comp.mp3
echo -n "Wrapping..."
cd $dir ; $WRAP ../comp.mp3 *.mp3 ; cd .. ; echo "done"

# remove added tag in filename? mp3wrap always adds this tag...
mv "comp_MP3WRAP.mp3" comp.mp3

echo -n "Remove temp dir..."
rm -fr $dir ; echo "done"

I took 20 seconds (02:10 - 02.30) of each song from my latest compilation and put them into this MP3 sound bite (5 MB). See playlist below.

playlist

Audio-Tronic CM3 this [2004-07-22]

I used to be a bit of a hifi nerd, buying and selling audio equipment for fun, looking for 180 gram vinyl pressings, reading really, really, cheesy hifi mags. Luckily those days are over. Today, I cannot stand reading hifi magazines, as they mostly are full of subjective nonsense. I switched over to the computer nerd group instead and have been happy ever since...

In my town (Uppsala) there used to live a guy called Bo Bengtsson. He was, and still is, the best swedish speaker designer ever (maybe in competition with Stig Carlsson). I think he now lives in the US? I know he used to design speakers for Cello, and later on for Red Rose Music (for Mr. Mark Levinsson). Bengtsson is now working on new speaker technology in his own company Transmission Audio. I wish I could afford one of those speakers.

I own speakers made by Bo Bengtsson's former company Audio-Tronic, model CM3. I scanned an old Audio-Tronic advert, available here as PNG. I had to scan with 300dpi in order to make it readable. It's about 2MB large. Especially note Bo standing beside the huge Megatrend speakers!
CM3

Maybe it's time to form a fan club, "Audio-Tronic Sweden"?

Convert newlines to paragraphs in PHP this [2004-07-19]

"autop" is quite a handy (PHP) utility to convert newlines into a valid (html-)paragraph. This is way beyond my own skills in PHP...

The photo matt site is impressive, in both functionality and design. Good use of CSS too.

New site this [2004-07-13]

So I made this new site, using only PHP and XML. I was not so happy with the blog software out there - I don't want to install a database and lots of other tools just for this pupose. Where is the simplicity in those systems? You so easily get stuck with some tool that you have to use and support forever.

My solution is one single XML file that PHP transforms into this HTML code. It's fast enough (not exactly slashdot speed though), it's simple to modify and maintain, and I can easily edit the contents with an XML or text editor. If you need to have something similar, contact me and I will send you the code. You, of course, need a server (I run on Apache) with PHP4, and at least the php module domxml. This should be pretty basic stuff for any web server I think.

The pages are still a bit rough and not very pretty. I'm working on it...

Spam visualization this [2003-05-11]

Although we are just a small part (about 25 staff members) of a department we still get quite a bit of spam. The spam fills up our mailboxes and our log files.

As postmaster for our domain I find the reading of the mail logs difficult and boring. Simply put, it never happens...

Each night, I automatically filter the mail log files into a readable text summary. That works ok but it can still be improved. In the next stage I transform the text summary into a periodic spam table for the last days. The transformation into a periodic spam table is done dynamically, per request.

Here's how to read the entries in the table:

spams

I also extract some extra information, about days with the higest and lowest ratio of spams in relation to non-spam. See the table below.

4 days ago 3 days ago 2 days ago yesterday
The day with most spam in relation to non-spam The day with least spam in relation to non-spam The day with higest number of spam

The color coding is just a classification of the spam ratio.

See the result.

Email subject line this [2003-05-11]

We all get a lot of email through a number of aliases. It would be convenient to see what alias the mail was sent to in the list of new mails. This way you don't have to open the mail to find out exactly what alias the mail was sent to.

Many mailing lists do exactly this. They append the name of the list on the subject line, so that it is easy to do filtering or just recognize that some email comes from a certain list.

I want to do this for a number of aliases, such as "webmaster", "abuse" or whatever. These are aliases that are important and I want to highlight those mails. Also, I don't want to mess with per-user .procmailrc files because that is more difficult and might interfere with the delivery of mails. It is also difficult to setup for someone not familiar with procmail. Instead, I want to do this processing in one single central place, for all users.

The image below shows what I want: some mails have a tag first on the subject line. This way I can, for example, see that someone sent a message to the abuse alias.
mail reader

I run sendmail 8.12.X on RedHat, right out of the box. No modification of sendmail at all.
You'll also need procmail and formail. I think they are installed in most UNIX systems.

In my definition of aliases (in /etc/mail/aliases) I wrote:

abuse:   "| /usr/bin/procmail -m /etc/procmailrcs/tag.rc [abuse] abusereal"
abusereal: postmaster, kenny, "| /path/to/archiver abuse"      

Here I define the desired public alias "abuse", and forward the email to procmail to be processed. -m means procmail runs as a mail filter. Then follows the path to the procmail instructions, plus two arguments.

The file /etc/procmailrcs/tag.rc is my way to rewrite the subject line and resend the mail. It needs 2 arguments:

  1. the text to put on the subject line, [abuse] in the above example,
  2. where to resend the mail, abusereal in the example.

Note that I resend to another alias, which is the next line in the aliases file. This way I can define almost all behaviour in this single file (the aliases file) instead of having this information all over the place. It also enables further processing should that be desired.

This resource file for procmail looks like this:

# ----- tag.rc -----
# Rewrite subject line of the mail and resend:
#   arg1 is text to pre-pend to the subject line,
#   arg2 is the address to re-send the mail to
#
# get the text to prepend to the subject line 
TAG=$1 
 
# find out who to forward this email to 
FORWARD=$2 
 
# extract the original subject (this also eliminates leading whitespace) 
:0 
* ^Subject:[    ]*\/[^  ].* 
{ 
         SUBJECT=$MATCH 
} 
 
# create the new subject token 
SUBJECT="$TAG $MATCH" 
 
# insert it into the headers 
:0hf 
| formail -I "Subject: $SUBJECT" 
 
# and forward 
:0 
! $FORWARD 
# ----- END tag.rc -----