blog dds

2015.12.13

Raspberry Pi vs USB vs Mac Audio

The audio hardware of Raspberry Pi is known to produce relatively poor sound quality. I bought a cheap USB sound card to try as an alternative. Here is what I found.

Continue reading "Raspberry Pi vs USB vs Mac Audio"

2013.06.13

How to make a MacBook Kensington Lock Adapter

Apple, in its infinite wisdom, has not included a Kensington lock slot in the current model of the MacBook Pro computer. Given the computer's price, desirability, and the fact that three people I know have had theirs stolen, I decided to build an improvised adapter that would allow me attach a Kensington lock to the computer. I realize, that the security offered by such a contraption is what my colleague Vassilis Prevelakis calls an "advisory lock", for Kensington locks can be easily picked or pried away. However, I think it might deter a casual thief who would snatch the laptop you've left unattended for a couple of minutes.

Continue reading "How to make a MacBook Kensington Lock Adapter"

2009.09.16

Applied Code Reading: Debugging FreeBSD Regex

When the code we're trying to read is inscrutable, inserting print statements and running various test cases can be two invaluable tools. Earlier today I fixed a tricky problem in the FreeBSD regular expression library. The code, originally written by Henry Spencer in the early 1990s, is by far the most complex I've ever encountered. It implements sophisticated algorithms with minimal commenting. Also, to avoid code repetition and increase efficiency, the 1200 line long main part of the regular expression execution engine is included in the compiled C code three times after modifying various macros to adjust the code's behavior: the first time the code targets small expressions and operates with bit masks on long integers, the second time the code handles larger expressions by storing its data in arrays, and the third time the code is also adjusted to handle multibyte characters. Here is how I used test data and print statements to locate and fix the problem.

Continue reading "Applied Code Reading: Debugging FreeBSD Regex"

2009.07.13

Madplay on an Intel Mac

Numerous MP3 players around my house pull music from a central file server. The hardware I'm using is extremely diverse and many devices can nowadays be politely described as junk: they include 100MHz Pentiums with 16MB RAM, and an ARM-based prototype lacking support for floating point operations. For the sake of simplicity I've standardized the setups around a web server running on each machine to list static HTML pages containing the available music files, and simple shell-based CGI clients that invoke madplay to play the music. When I added an Intel-based Mac to the mix I found that madplay refused to work, producing only a white noise hiss.

Continue reading "Madplay on an Intel Mac"

2009.05.07

Fixing the Orientation of JPEG Photographs

I used to fix the orientation of my photographs through an application that would transpose the compressed JPEG blocks. This had the advantage of avoiding the image degradation of a decompression and a subsequent compression.

Continue reading "Fixing the Orientation of JPEG Photographs"

2006.09.30

Cross Compiling

Cross compiling software on a host platform to run on a different target used to be an exotic stunt to be performed by the brave and desperate. One had first to configure and build the compiler, assembler, archiver, and linker for the different architecture, then cross-build the other architecture's libraries, and finally the software. This week, while preparing a new release of the CScout refactoring browser I realized that what was once a feat is nowadays a routine operation.

Continue reading "Cross Compiling"

2005.08.09

Everything Old is New Again

In 1984 the new kid on the block was Borland's Sidekick. A terminate and stay resident (TSR) program for MS-DOS, it would run in the background, and when it detected the two shift keys being pressed it would overlay the (then character) screen with a calculator, a notepad, a calendar, a dialer or an ASCII table.

Continue reading "Everything Old is New Again"

2005.06.23

XML Abstraction at the Wrong Level

Over the last month I've encountered two applications that use XML at the wrong level of abstraction. Instead of tailoring the schema to their needs, they use a very abstract schema, and encode their elements at a meta level within the XML data. This approach hinders the verification and manipulation of the corresponding XML files.

Continue reading "XML Abstraction at the Wrong Level"

2004.10.06

Apple's Presence in Greece Appears to be a Joke.

Earlier today I tried to buy an Airport Express base station by visiting what appeared to be an Apple store in Stournari street: the road in Athens with the largest physical concentration of computer shops.

Continue reading "Apple's Presence in Greece Appears to be a Joke."


Creative Commons License Last update: Tuesday, April 4, 2017 5:56 pm
Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.