Faster than light neutrinos

December 4th, 2011

OK so this is probably going to demonstrate how bad I am at physics, and I will probably be flamed for being an idiot, but here are some of my thoughts on the faster than light neutrinos.

  1. Time slows down as you approach the speed of light. Velocity is a derivation of time (speed = distance / time). This can make it difficult to measure, and the time dilation needs to be accounted for.
  2. When measuring things close to the speed of light, the equipment itself has the same limitations. It takes time for a signal to get from one part of the equipment to another.
  3. The Earth itself is moving in the solar system, the solar system is moving in the galaxy, and the galaxy is moving in the universe. The speed of light is an absolute limit, but the measurement of something moving between two points on Earth is a relative measurement. If something was fixed in an absolute position, it would be moving very quickly relative to the Earth.
  4. The speed of light limitation applies to objects with mass. The mass of neutrinos is believed to be non-zero, but is not yet completely known, and objects with energy essentially have more mass, so the mass of it changes as it accelerates. It’s hard to do maths when you don’t have all of the starting variables.

Buyer beware: (low cost) 6 Gbps SATA III cards are a scam.

October 24th, 2011

I recently upgraded to a new SSD, the OCZ Agility 3. It gave really good speeds, but I couldn’t help but feel that I was limiting it by putting it in a motherboard which only had 3 Gbps SATA II ports.

I bought a Lycom PE115 6Gbps SATA III adapter, and put it in a PCIe 2.0 port, but when I benchmarked the drive with CrystalDiskMark, on an idle Windows 7 x64 machine (Dual Xeon E5620, 8GiB ECC-R 1333MHz) the results were very disappointing.

Not only was there no improvement over the port on the motherboard, the dedicated 6Gbps SATA III card was actually significantly slower than the 3 Gbps SATA II port (roughly 64% of the speed).

I tried without and then with the drivers for the card installed, and it made no real difference.

Fill 0

The blue bar is on the motherboard’s SATA 3Gbps.
The red bar is on the PE115′s SATA 6Gbps
The yellow bar is the PE115 with drivers manually installed.
The green bar is back on the motherboard, to confirm it.

The results show that the PE115 consistently performs significantly worse than the motherboard in both fill 0×00 (above) and fill random (below) operations.

Fill Random

All of this was done in CrystalDiskMark 3.0.1 x64.

Windows 8 is the next Vista fail.

September 22nd, 2011

I’m calling it now. First Windows ME, then Vista, next 8. All failures, or soon to be.

There’s nothing new in Windows 8 that warrants replacing Windows 7 so soon but there’s enough changed on the surface to piss people off. People don’t like having changes forced upon them (see also: Facebook). The only people that will be getting Windows 8 will be people who got it pre-installed and had no choice, and I don’t see any businesses upgrading to Windows 8 whatsoever.

Concise glossary of reverse engineering

September 13th, 2011

Debugger
Executes a program, displaying the memory as it runs.

Decompiler
Converts object code to a higher level language, such as C.

Disassembler
Converts object code to assembly.

Stupid
Charging thousands of dollars for software whose target audience primarily use it to crack software rather than paying for it.

Icy backplanes

July 5th, 2011

I just realised that Icy Dock and Icy Box are not the same company.

Stop saying SEQUEL

July 2nd, 2011

SQL is not the same thing as SEQUEL. If you’re a grumpy old DBA, stuck in your ways, who actually used SEQUEL back in the 1970s, that’s fine. For all the new kids just getting into SQL, it’s pronounced es-que-el, not sequel. When you call it sequel, you sound like just as much of an idiot as someone who says lynuks. It’s annoying.

The “SQL” pronunciation is actually defined in the original 1986 specification for SQL and confirmed by common DBMS such as MySQL.

Visual Studio “There was a problem sending the command to the program”

March 25th, 2011

Since moving to Visual Studio 2010 on Windows 7 x64, I’ve been getting this error a lot. Every time I open Visual Studio by opening a file rather than running its executable directly, in fact.

Most of the answers seem to revolve around running Visual Studio as a normal user rather than an administrator, but I was already doing that.

Eventually, a reply to this bug provided an answer.

When I checked the key, I saw

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\DDECache\VisualStudio.10.0\system]
"ProcessName"="devenv.exe"
"WindowName"="Visual Studio Application Management Window"
"WindowClassName"="VisualStudioAppManagement"

Deleting the “system” key then opening a file again worked and replaced the key with working values

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\DDECache\VisualStudio.10.0\system]
"ProcessName"="devenv.exe"
"WindowName"="DDEHandler"
"WindowClassName"="DDEHandler"

When it has the correct values (refresh to make sure that it does) remove “set” permissions from your own user so that it can’t replace them with the bad values, to make the change permanent.

Set default command prompt directory

February 11th, 2011

It’s too difficult to set the default command prompt directory on Windows. I found several methods, none of which worked correctly.

In particular, it is common for people to set a “cd /d path” in their AutoRun key in the registry but this breaks the power toy and Windows 7′s built in hold shift and right click on a directory to open a command prompt there. This can be worked around by adding a /d to the shell extension in the registry.

What doesn’t seem to be mentioned anywhere though is that this AutoRun key also gets run when you double click on a batch file. That means a batch file which assumes its own current directory (a reasonable assumption – more reasonable than using absolute paths) may not be able to find files in the same directory as it.

What I really wanted to do was move my home directory to my D: drive but the command prompt was still opening on the C:

Most people also seem to only change the default directory of their command prompt to match a non-default home directory.

The first mistake I made was to type “cmd” into the start menu and right click on it to pin it there. This calls it “Windows Command Processor” and starts in C:\Windows\System32 (because that’s where cmd.exe lives). Instead, go through the start menu programs list and find “Command Prompt” under “Accessories” and pin that. It will correctly default to your home directory, because the “start in” is set to %HOMEDRIVE%%HOMEPATH%. Note that you could just change this shortcut’s arguments (cmd /k cd “PATH”) or start in but it will only change it for that one shortcut.

Anyway, once you are using “Command Prompt”, set your home directory. I’m using Windows 7 Pro, so I can go to Computer Management and just set the directory for my user in the GUI under “Users and Groups”. This is no longer available in home versions of Windows (they shouldn’t have removed it) but you may still be able to set your home directory by using the command

net user USERNAME /homedir:PATH

where “USERNAME” is your user name and “PATH” is the directory you want to set. You can check this with the command net user.

When I type “cmd” into the run dialogue, it still opens on C: but at least batch files work now. Further suggestions are welcome.

Licensing your libraries

February 8th, 2011

For most spare time projects, licensing can be an afterthought. Personally, I hardly put licences on anything I write. Most of the time this is just because I expect people to use it anyway. I treat licences more as a restriction than a freedom.

Really, if you don’t put a licence on your code then people can’t use it but if anyone asked I would probably let them. A licence should let them know whether they can use it without having to ask you.

However, anything serious that you release needs a licence. Choosing the right licence for your project can be time consuming and involve reading and completely understanding legal documents, which isn’t what most of us want to do. It is very common for people to release code under the GNU General Public Licence (GPL) or Lesser General Public Licence (LGPL).

Terms such as “derived works” and what constitutes these are even more of a problem.

There are a few key points around releasing under these licences. Please bear in mind that I do not have a legal background.

  1. Anyone is free to distribute your work, even if you have sold it to them.
  2. You must provide source code for anything you release.
  3. Anyone is free to modify your work.
  4. If you use code licensed under the GPL in your project, your project must also be licensed under the GPL. This means that for people not releasing under the GPL, your code is essentially useless and to all intents and purposes does not exist.

The first point here makes selling your work difficult. Even if you successfully sell it, anyone who has bought it can just give it away for free.

The second point here makes releasing closed source binaries a problem. Anything you release must be released with accompanying source code. This causes further problems for commercial software, as attempts to safeguard it against piracy can be easily removed, which is also legal by the third point here.

The third point means that people can effectively take what you have done, make slight changes to it and pass it off as their own work.

However, the fourth point here is the biggest problem. When you licence under the GPL, you are not only causing the above problems for yourself (which may be ideal for you), you are also forcing anyone who uses your code to have all the same problems (which probably won’t be ideal for them). If they don’t want these problems in their own work, they can’t use yours. Fortunately there is a solution for this. The LGPL varies from the GPL in that projects don’t have to use the same licence as you in order to use your code. This makes it ideal for freely releasing libraries that anyone can use.

Somewhat worryingly, FSF and GNU are trying to trying to get people to use GPL instead of LGPL and, it seems, the only reason they are doing this is to give “free” software an advantage. I don’t agree with this ethically. For free software to be free, everyone should be able to use it and that includes people who want to use it in commercial projects.

I’ve lost count of how many times I’ve found a nice little snippet of code that does exactly what I want and the author seems to want to release it to the public for everyone, but has released it under the GPL making it unusable in a non-GPL project.

There are many other licences out there to choose from, such as the MIT and BSD licences. So, please choose the licence for your project carefully and think of the consequences for your target audience before blindly slapping a GPL sticker on it.

NTLM authentication on Android

January 5th, 2011

For some reason, none of the main browsers on Android support NTLM authentication. Most just show you a “http 401 unauthorized” page and don’t offer a prompt, or even accept the highly insecure but generally working user names and passwords in the URI (protocol://username:password@location).

This is a huge problem. Corporate users need this to log in to certain websites, and some places like hotels may use it with a captive portal to allow you to access their wifi.

The solution is to install the fennec browser from Mozilla. This is still in early development, but it seems to work OK so far and it actually lets you log in to authenticated websites.

NTLM authentication on fennec