Friday, July 20, 2012

What did I miss about modern Linux?

After running Windows alone for a couple of years, I had to install a Linux distro yesterday since the CUDA API in Windows is pretty ridiculous, flat out refusing to work with MinGW (the Windows port of gcc/g++ and pals).

Although I wasted a lot of time trying to get my dumb Medion PC (MS-7358 mainboard) to boot from two different USB keys, eventually a blank CD turned up and Ubuntu 12.04 landed on it. The install was quick, and this time (unlike on the old Acer laptop my kid uses) the Nvidia card was supported better, giving a usable display.

I needed to install some tools first before getting the CUDA API/SDK/drivers on Ubuntu:
The following NEW packages will be installed:
  build-essential dpkg-dev freeglut3-dev g++ g++-4.6 libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libdrm-dev
  libgl1-mesa-dev libglu1-mesa-dev libice-dev libkms1 libpthread-stubs0
  libpthread-stubs0-dev libsm-dev libstdc++6-4.6-dev libtimedate-perl
  libx11-dev libx11-doc libxau-dev libxcb1-dev libxdmcp-dev libxext-dev
  libxi-dev libxmu-dev libxmu-headers libxt-dev mesa-common-dev
  x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev
  xorg-sgml-doctools xtrans-dev
0 upgraded, 36 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.3 MB of archives.
Fetched 15.3 MB in 3s (3,835 kB/s)
Setting up build-essential (11.5ubuntu2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Now I really wish I'd prefixed this with the "time" command, because it took far less than a minute - maybe 15 to 30 seconds to install all of this... the C++ compiler, X11 libraries and a bunch of other stuff.

In contrast, it took a good 5 minutes just to install Visual Studio 2010 on my Windows 7 laptop (a 64-bit box with a better CPU than this desktop) and the library problems cost me a couple of hours of headbanging which was never resolved.

There are still serious driver problems in Linux, but the whole experience has improved so much since I started with a Red Hat install back in 1998.
Being able to install any number of programs and libraries rapidly, with a single command, is so much more relaxing than trying to hack things together in Windows. Try it!

Sunday, June 17, 2012

Terrorist postcards

(from BBC news)
It has been dubbed a "snooper's charter" by civil liberties groups but the Home Office says new powers are needed to keep pace with how criminals and terrorists are using new technology.
Postcards are new technology now? It hardly seems like the most secure and timely way to communicate, though, does it?

Do they really think they can catch terrorists and other criminals by reading people's postcards - or are they just a pack of nosy bastards?

Wednesday, May 30, 2012

Simple Heuristics that Make Windows Dumb

C:\U\O\Documents\c\...\src> .\patch.exe --help
Access is denied.

C:\U\O\Documents\c\...\src> ren patch.exe piss.exe

C:\U\O\Documents\c\...\src> .\piss.exe --help
Usage: .\piss.exe [OPTION]... [ORIGFILE [PATCHFILE]]

...Fuck you very much, Windows.

Tuesday, April 17, 2012

Gluap: not-really-useful-yet PushGP in Lua

After abandoning this for a while, I decided to update my pet project Gluap, a PushGP-based genetic programming library for Lua. While I was at it, I opened a Github account and uploaded the project to a new repo. If you like, try it out, figure out why it's not performing well and improve it! :)

Friday, March 09, 2012

(Recursive) Confirmation bias

Ever heard of confirmation bias?

The worst thing? Being aware of the effect actually increases your susceptibility to it, rather than decreasing it. No need to thank me.

But does awareness of that fact reduce susceptibility? And if so, and you know it, does that itself---

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.