Categories
technology

iPod wireless transceivers (only in Japan as yet)

Japanese Ratoc Systems Corp. has a new lineup of wireless audio products called the “REX-Link” series, and some of them are even specifically designed to fit your 3/4G iPod or iPod mini.

rexlink1p.jpg

There are four products in the series—two “receivers” and two “transmitters.” Receivers come in the form of the “CR-RX01” with optical and analog audio outputs or the “REX-WHP1” headphones. For your transmitter, you have two options: the “CR-TXB01” USB transmitter, or “CR-TXB02” USB/analog transmitter (which also attaches to the back of 3/4G/mini iPods). These four products are matched to give three available packages: one with CR-TXB02 analog/USB transmitter and CR-RX01 receiver, one with CR-TBX01 USB transmitter and REX-WHP1 headphones, and one with CR-TXB02 analog/USB transmitter and REX-WHP1 headphones.

Original link from Gizmodo

Categories
technology

Creating shim libraries in Linux

Anybody who’s done a bit of device driver development will know that occasionally system logs just don’t provide enough information about the various problems you’ll encounter and you have to hack up a shim library which sits between a problem library and it’s loader/calling module. Linux Journal has a very nice article this month on creating just such a library for libusb. This could be useful for anybody developing an application or driver which needs to communicate with a USB device. Like writing a synch for a PDA, MP3 player or somesuch..

Categories
technology

Static substitution (Fowler Style)

Martin Fowler has a neat little article on refactoring class statics using instance variables. Most languages can’t support polymorphism for static methods. e.g.

class A{
public void doInitStuff() { /*do stuff necessary for static init of B objects*/};
} ...
}
class B extends A{
public void doInitStuff() { /*do other stuff necessary for static init of B objects*/};
} ...
}
...
A a = new B();
A.doInitStuff(); /* but I'd quite like to polymorphically call B.doStuff(); Actually, could be trouble! */

Martin’s solution is very elegant.

Categories
technology

Which command in DOS

I’ve been told that I should add more of the little programming hints and tips that I used to come up with during my reearch days to this site. Well here’s something I was playing around with today that’s useful for many windows developers. Like many programmers I’m often more comfortable at the command line than using some funky GUI where I have to drag (or learn so many command alias key-strokes that I may aswell be at the console anyway).
I was stuck for a UNIX version of the which command. According to man which this command

Which takes a series of program names, and prints out the
full pathname of the program that the shell would call to
execute it. It does this by simulating the shells search-
ing of the $PATH environment variable.

Replicating this functionality using DOS batch ain’t that bad…

@ECHO OFF
rem Sanity check OS version and arguments.
IF "%OS%"=="Windows_NT" (SETLOCAL) ELSE (GOTO Syntax)
IF "%~1"=="" GOTO Syntax
IF NOT "%~2"=="" GOTO Syntax
ECHO.%1 ¦ FIND /V ":" ¦ FIND /V "\" ¦ FIND /V "*" ¦ FIND /V "?" ¦ FIND /V "," ¦ FIND /V ";" ¦ FIND /V "/" ¦ FIND "%1" >NUL
IF ERRORLEVEL 1 GOTO Syntax


SET Found=
rem Get the short name for the current directory
COMMAND /C REM
rem Search CurrentDir, path and pathext for the file
FOR %%A IN (%CD%;%Path%) DO FOR %%B IN (.;%PathExt%) DO IF EXIST "%%~A.\%~1%%~B" CALL :Found "%%~A.\%~1%%~B"
rem Display the result
ECHO.
IF DEFINED Found (ECHO.%Found%) ELSE (ECHO -None-)
rem Done
GOTO End


:Found
IF DEFINED Found GOTO:EOF
rem Store the first match found
SET Found=%~f1
GOTO:EOF
:Syntax
ECHO.
ECHO WHICH, Version 2.00
ECHO UNIX-like WHICH utility for Windows NT 4 / 2000 / XP
ECHO.
ECHO Usage: WHICH program_name
ECHO.
ECHO Specify program_name with or without
ECHO extension and without a drive or path.
ECHO Just like the UNIX command. (no wildcards please)


:End
IF "%OS%"=="Windows_NT" ENDLOCAL