Friday, February 24, 2012

Ever wanted to use the Unix "which" command on Windows?

The which Unix command takes a program name as an argument, and gives you the first matching directory on your path which contains that program. This is useful if, for example, you're trying to uninstall or upgrade software and are trying to figure out why you can still call the program after you thought it'd been deleted.

Unfortunately, there doesn't seem to be any kind of related command for DOS. Happily, a user named Mechanix2Go posted a hackish version which you can save as a batch file. I've made a couple of minor tweaks, to suppress file not found errors and fix the frankly idiotic treatment by DOS of the PATH variable as a set of tokens delimited by spaces. Some horrible hackery was taken from here to partially work around the problem. It will still fall over on weird paths with a ';' in them, and it'll echo double quotes.
Trying to express yourself in DOS batch language is like trying to compose a symphony using only two piano strings.

@echo off & setLocal EnableDelayedExpansion

if %1'==' goto :eof

for %%a in ("%path:;=";"%") do (
  dir /b %%a 2>&1 | findstr /i /b /c:"%1.exe" /c:"%1.bat" /c:"" > nul
  if not errorlevel 1 echo %1 is in %%~a && goto :eof

Tuesday, February 21, 2012

Reporting on reports about bad reports: SMS vs Web messaging

(source: BBC News)
Social messaging applications cost mobile network operators $13.9bn (£8.8bn) in lost SMS revenue last year, a report has claimed.
However, the study did not factor in the extra income networks received from mobile data costs because of increased internet usage resulting from social messaging.
...Then why are you even writing about it? Damnit BBC.

That's like saying "Clondalkin cost Dublin Bus $13.9bn in lost revenue on the 51B bus route last year, a report has claimed. The study did not factor in the extra income received from the 51C bus route which completely replaced the 51B route."
If they lost money on one service because everyone started using a different service that THEY ALSO PROVIDE, then you have to account for that before reporting that they lost money. Sure, sending one message via a phone's internet connection is probably much cheaper than sending an SMS, but without accounting for how much money they've been making from the increased internet usage - in general, not just for sending messages outside of SMS - it's meaningless for people to say things like this:
"I think it's a growing threat which is manageable through the right tariffs and the right costing," Mr Barford added.
Hardly a threat, if they're raking in money from all the data plans people are signing up to nowadays.