Search This Blog

Showing posts with label Windows 7. Show all posts
Showing posts with label Windows 7. Show all posts

Thursday, 29 November 2012

jQuery Ajax Call Failing

This is a problem I've been having at work for the last week or so.

I am using Apache 2.2 on Windows 7. In my JavaScript I need to read the contents of a text file, so I make this call:

   var fileContent = '';

   jQuery.ajax({
      url: 'myfile.txt',
      dataType: 'text',
      success: function (data) {
         fileContent = data;
      },
   });

which worked fine for months. Then suddenly it began failing, though notably only with large files (> 200K).

The symptoms were one of these:

  1. the Ajax call would fail
  2. the Ajax call would hang
  3. the text that came back was either missing bits or subtly mixed up

In the first case, the browser console would show the message NETWORK_ERR: XMLHttpRequest Exception 101. In case 3 the Apache logs showed a message about No space left on device and Error reading chunk.

The solution was to uninstall a Windows 7 update, namely KB2750841.

I actually experienced this problem back in September, when the update to uninstall was KB2735855. Incredibly I managed to completely forget about that fix, and so had to painfully get to the solution again from scratch. It is my fervent hope that the next time I search for NETWORK_ERR: XMLHttpRequest Exception 101, Google will decide that one of my own blog articles should come top of the search results.

Thursday, 10 November 2011

A Farewell to Windows XP

After nearly a decade of using Windows XP, I've finally moved to a more up to date operating system. I am now the proudish owner of a Lenovo H420 running Windows 7 Home.

The excitement of a new computer is always soon tempered by the realisation of how many programs need installing on it, as well as the long slog of getting all your settings correct, and the other long slog of rooting out all the unwanted rubbish that the manufacturer thought you might like. I bought it on a Saturday, but wasn't happy with it until Sunday the following week. (Not that I spent eight solid days on it, mind.)

Mostly it went very smoothly. In the case of Google Chrome, it was almost effortless: as soon as I enabled Chrome Sync, it transferred all my previous settings, and even installed my chosen set of plug-ins. Python was a less happy experience, when I discovered that the last of my essential libraries wasn't available in 64 bit form, and so had to uninstall all the others and start again with the 32 bit versions. I had similar incompatibilities with 64 bit Eclipse and Java. That, though, wasn't my fault, as the Java download page doesn't offer you a choice, and merrily installs the 32 bit version.

By last Sunday most of my treasured functionality was available again; I just had to add a folder to my $PATH variable. I brought up the System section in the control panel, and got two shocks. Incredibly, the editor for environment variables is still the cramped, rubbishy little box it was in the nineties:

How hard would it be to give us a proper dialog for entering these values? Instead you have to type in a list of semicolon-separated folder names, nearly all of which start with 'C:\Program Files' so you quickly get lost if you try scrolling through it. Unbelievable. Contrast that with the improvements made to the 'Extract All' option for zip files: Windows XP brings up a three pane wizard, while Windows 7 sensibly combines these three into a single screen. I cannot believe nobody at Microsoft finds this editor annoying. Maybe it's legacy code that Steve Ballmer wrote, and everyone's too scared to change it.

That was my first shock. The other came when I happened to glance at the installed memory figure. 2.00GB? The PC I ordered had 4GB. And what's this? A Celeron processor, where I thought I had bought an i3 core. Yes, I had managed to come away from PC World with the wrong computer. I'd reserved a £350 Lenovo H420 on their web site, then gone to collect it. They'd given me the £270 version instead. The receipt was okay though!

The details were there to see on the box, but I'd been too busy opening it. And the Intel Inside sticker on the front of the PC did say 'Celeron'. But I put 'desktop' PCs on the floor, so the sticker ended up conveniently situated at carpet level.

PC World offered to wipe the PC I had and give me the correct model. However, as they'd proved incapable of getting the correct box out of their back room I decided against handing over a computer full of my personal details in the hope that they might remember to clean the disc before they sold it on. Also, after all the work I'd put in getting the PC up and running, I was in no mood to go back to square one. In the end I settled for a refund of the difference in price. The main reason for buying the computer in the first place was to get some more speed, and this machine seems fast enough.

Here's some advice for PC World at Clifton Moor, York: when someone comes to pick up reserved goods, wipe the goods through your barcode scanner, not the reservation paperwork. As to Lenovo, given that a naming system that brings forth such memorable gems as 'H420' allows for 26000 possibilities, maybe you could try not giving two different computers the same model number. As for me, I've learned the importance of reading the label before opening the box.