blog dds

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"

2011.05.29

Ten Lessons I Learned from Fixing my Laptop's Motherboard

A month ago I managed to break my laptop, by reversing the polarity of a universal power supply. The repair shop diagnosed the problem as a failed motherboard, and asked for €659 to replace it. I found the price preposterous and the notion of throwing away a motherboard for a single failed component ecologically unsound. Here is how I fixed the laptop on my own, and what I learned in the process.

Continue reading "Ten Lessons I Learned from Fixing my Laptop's Motherboard"

2010.08.04

Batch Files as Shell Scripts Revisited

Four years ago I wrote about a method that could be used to have the Unix Bourne shell interpret Windows batch files. I'm using this trick a lot, because programming using the Windows/DOS batch files facilities is decidedly painful, whereas the Bourne shell remains a classy programming environment. There are still many cases where the style of Unix shell programming outshines and outperforms even modern scripting languages.

Continue reading "Batch Files as Shell Scripts Revisited"

2010.01.12

Useful Polyglot Code

Four years ago I blogged about an incantation that would allow the Windows command interpreter (cmd) to execute Unix shell scripts written inside plain batch files. Time for an update.

Continue reading "Useful Polyglot Code"

2009.08.20

HP-200LX Remote Control Hacks

All my friends know that for the past 15 years I've been semi-attached to an HP 100LX palmtop PC (recently updated to a 200LX) for my personal information management and many other tasks. The device is extremely versatile, sturdy, and flexible. Amazingly, after so many years of hard daily use, I still find new applications for it.

Continue reading "HP-200LX Remote Control Hacks"

2009.08.05

How to Create a Self-Referential Tweet

Yesterday Mark Reid posted on Twitter a challenge: create a self-referential tweet (one that links to itself). He later clarified that the tweet should contain in its text its own identifier (the number after "/status/" bit should be its own URL). I decided to take up the challenge ("in order to learn a bit about the Twitter API" was my excuse), and a few hours later I won the game by posting the first self-referential tweet. Here is how I did it.

Continue reading "How to Create a Self-Referential Tweet"

2009.03.28

Earth Hour: A Geek's View

What happens to the power grid when millions of people turn of their lights? I had a chance to study this during tonight's Earth Hour: an international event organised by the WWF, which asks households and businesses to turn off their non-essential lights and electrical appliances for one hour to raise awareness towards the need to take action on climate change.

Continue reading "Earth Hour: A Geek's View"

2009.02.10

Visualizing Revision Logs with a UML Sequence Diagram

How can you visualize the developers' contributions in a collaborative project? One way involves drawing timelines adorned with marks indicating each developer's contribution. This is a simple UML sequence diagram, a diagram that allows you to see the interactions of objects, but in this case the objects are the actual developers and the interactions are their contributions.

Continue reading "Visualizing Revision Logs with a UML Sequence Diagram"

2007.06.06

Palindromic Palindrome Checking

Stan Kelly-Bootle's column in the April 2007 ACM Queue, titled Ode or Code? — Programmers Be Mused!, was as always very enjoyable. However, I found its ending, a C function that returns true when given a palindromic string (e.g. ABCCBA), anticlimactic. The function given is recursive; I was expecting it to be palindromic. How difficult can it be to write such a function?

Continue reading "Palindromic Palindrome Checking"

2007.03.06

The Power of Reusable GUI Elements

One can manipulate any graphical element of the Squeak environment by bringing up its halo: a rectangular set of icons representing actions that one can perform on any object. At first I found it cumbersome to have to go through the halo in order to perform any action, like recoloring an object or changing its name. Later I saw that this method is incredibly powerful.

Continue reading "The Power of Reusable GUI Elements"

2006.12.01

(Not) Hacking the Digipass Go 3 OTP Dongle

My bank moved to two factor authentication solution, and thus required me to purchase from them a Digipass Go 3 dongle in order to authenticate my transactions. To register my dongle I keyed-in a five-digit code they gave me, and also the key's serial number appearing on its back. Given that Go 3 utilizes an open authentication framework, and a published algorithm for generating the one time password (OTP), could I utilize the key and the numbers I keyed in, for using the key in my own applications, of for cloning the dongle in my mobile phone or palmtop?

Continue reading "(Not) Hacking the Digipass Go 3 OTP Dongle"

2006.11.15

White Noise Calms Babies

A week ago I told my colleague Damianos Chatziantoniou that drying the body of a newborn baby with a hair drier keeps it consistently dry avoiding rashes, and also calms the baby down. Today he told me the advice worked wonders. Many parents have discovered that sources of white noise, like the sound of a vacuum cleaner or a hair drier, seem to calm down a baby's crying spell.

Continue reading "White Noise Calms Babies"

2006.11.08

Converting RIS to BibTeX

Digital libraries increasingly provide an option to export bibliographic data. Unfortunately, many, like IEEE Xplore, SpringerLink, and Scopus don't support the BibTeX format I use for storing my bibliographies. (To its credit the ACM Portal offers a BibTeX export option. On the other hand, Elsevier's ScienceDirect and JSTOR don't offer any export facility.)

Continue reading "Converting RIS to BibTeX"

2006.10.11

Web Page Hits, Amazon.com's Sales Rank, and Actual Sales

Over the past three years I've been collecting the amazon.com Sales Rank for my book Code Reading: The Open Source Perspective, and (lately) also for its sequel Code Quality: The Open Source Perspective. Yesterday I mapped the sales rank to actual sales, and correlated those with significant events and hits on the book's web page.

Continue reading "Web Page Hits, Amazon.com's Sales Rank, and Actual Sales"

2006.06.16

Batch Files as Shell Scripts

Although the Unix Bourne shell offers a superb environment for combining existing commands into sophisticated programs, using a Unix shell as an interactive command environment under Windows can be painful.

Continue reading "Batch Files as Shell Scripts"

2006.01.30

A General-Purpose Swap Macro

A couple of days ago I came up with a general-purpose macro for swapping values in C programs. My colleague Panagiotis Louridas suggested an improvement, and this prompted me to see the two macros got compiled.

Continue reading "A General-Purpose Swap Macro"

2005.11.17

How to Sort Three Numbers

Quick: how do you sort three numbers in ascending order?

Continue reading "How to Sort Three Numbers"

2005.11.14

Supporting Java's Foreach Construct

Java 1.5 supports a new foreach construct for iterating over collections. The construct can be used on arrays and on all classes in Java's Collection framework. I searched the internet for an example on how to make my own classes iterable with this construct, but could not find an example.

Continue reading "Supporting Java's Foreach Construct"

2005.04.27

Solving Singh's Substitution Cipher

Many of us enjoy playing with encryption algorithms. Simon Singh, before a book promotion trip to Greece, published a "substitution cipher with a twist". I would consider solving a substitution cipher aimed at the general public unfair, but the "twist" made me curious.

Continue reading "Solving Singh's Substitution Cipher"

2005.04.13

A Pipe Namespace in the Portal Filesystem

The portal filesystem allows a daemon running as a userland program to pass descriptors to processes that open files belonging to its namespace. It has been part of the *BSD operating systems since 4.4 BSD. I recently added a pipe namespace to its FreeBSD implementation. This allows us to perform scatter gather operations without using temporary files, create non-linear pipelines, and implement file views using symbolic links.

Continue reading "A Pipe Namespace in the Portal Filesystem"

2005.02.07

Macro-based Substitutions in Source Code

A friends asks: "How can one easily replace a method call (which can contain arguments with brackets in its invocation code) with a simple field access?

Continue reading "Macro-based Substitutions in Source Code"

2004.12.11

Measuring the Effect of Shared Objects

For the Code Quality book I am writing I wanted to measure the memory savings of shared libraries. On a lightly loaded web server these amounted to 80MB, on a more heavilly loaded shell access machine these ammounted to 300MB.

Continue reading "Measuring the Effect of Shared Objects"

2004.09.01

Digital Data Makes Anything Possible

Once data becomes digital anything and everything becomes possible. Consider arranging the books on your bookshelf by the color of their bookcover.

Continue reading "Digital Data Makes Anything Possible"

2004.03.19

Binary File Similarity Checking

How can one determine whether two binary files (for example, executable images) are somehow similar? I started writing a program to perform this task. Such a program could be useful for determing whether a vendor had included GNU Public License (GPL) code in a propriatary product, violating the GPL license. After writing about 20 lines, I realized that I needed an accurate definition of similarity than the vague "the two files contain a number of identical subsequences" I had in mind.

Continue reading "Binary File Similarity Checking"

2003.10.25

A Unix-based Logic Analyzer

A circuit I was designing was behaving in unexpected ways: the output of a wireless serial receiver based on Infineon's TDA5200 was refusing to drive an LS TTL load. To debug the problem I needed an oscilloscope or a logic analyzer, but I had none. I searched the web and located software to convert the PC's parallel port to a logic analyzer. I downloaded the 900K program, but that was not the end. Unfortunately the design of Windows 2000 does not allow direct access to the I/O ports, so I also downloaded a parallel port device driver and a program to give the appropriate privileges to other programs. Finally, I also downloaded from a third site the Borland runtime libraries required by the logic analyzer. Needless to say that the combination refused to work.

Continue reading "A Unix-based Logic Analyzer"


Creative Commons License Last update: Thursday, September 22, 2016 9:56 am
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.