My Phone Won’t Load SMS Conversations

I posted this on Google+, but I’m not sure it’s quite the right venue for troubleshoorint queries.

I have an #android #troubleshooting query. I have an HTC Desire HD through 3 in the UK. When I go to open messages using the stock message application, it gives a “loading” spinner but never shows the messages. Inbox and notifications of new messages work fine, but I can’t load conversations. Example attached.

I found a thread from January with what appears to be the same issue, but the suggested solution is “wipe and re-import your messages”, which I’d prefer not to do (http://www.htcdesirehdforum.com/htc-desire-hd-troubleshooting/text-messages-won%27t-load/).

Any thoughts?

Loading image

Virtual Multiblog and .htaccess

TLDR: RTFM (http://striderweb.com/wp-content/multiblog/multiblog-readme.htm#permalinks)

I had problems with permalinks and Virtual Multiblog (yet another linky), basically that for every wordpress instance I added I would have to add another set of permalink-related Apache Rewrite rules to prevent individual entries 404-ing. This was fragile and prone to failure. Fortunately, there is a Proper Way To Do It:

RewriteEngine On
RewriteCond %{REQUESTURI} (/blog|/news)?/
RewriteCond %{REQUEST
FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . %1/index.php [L]

 

From the readme. Lovely.

[Solved] Could not create java implementation loader / No JRE Found

After installing LibreOffice Portable (from here), I tried to install the Google Docs Sync extension, ooo2gd. However, installation failed with the error message “Could not create java implementation loader”. There are many posts about this, most of which suggest either

  1. disabling, then re-enabling “Use a Java runtime environment” on the Tools > Options > LibreOffice > Java menu page
  2. Deleting a user profile

That didn’t work in my case because that menu page had no JRE listed, in spite of me installing the latest JRE from oracle.com (at time of writing JRE 7). What sorted it was installing the last version, which is confusingly also called the latest, recommended version (Version 6 Update 27 at time of writing). I got it from here: http://www.java.com/en/download/manual.jsp. After installing it appeared in the JRE list on the Java options page in LibreOffice and oo2gd installed correctly.

TF2 Connection Problems Persist

Team Fortress 2 has recently gone free to play, which I am guessing has resulted in a big spike in players (it is currently the most played game on Steam, with a peak of nearly 100 000 players today – no doubt it was busier at the weekend). As a result, my old post on fixing the “lost connection to server” issue has been very popular in the last few days.

I find it surprising this problem has persisted for over three years without apparent resolution. The fix that worked for me on my old BeBox was to forward to following ports to my PC:

TCP 27030 – 27039
UDP 1200
UDP 27000 – 27015

If this doesn’t fix the problem, there may be complicating factors. I’ve seen suggestions that the TCP timeout on a router may be set too low. I have a feeling that this may be what is causing connection problems a friend of mine is having, but since it does not affect me I haven’t investigated further. Wireshark would probably be useful if you wanted to probe further.

You can also take a look at my old post if you want more information.

Sort a List By Length and Alphabetically Using jQuery

A fairly common problem in jQuery is to sort a set of elements eg a list of <li>, and most examples I came across seemed to offer pretty decent solutions – provided you want to sort alphabetically. If you want to do this in a number of ways, then tinysort is a great way of doing it.

I wanted to sort a list of links by length for aesthetic purposes, eg

sort by length | sort alphabetically

It turns out there isn’t an iron-cast way of doing this. If you go by length of the text of each <li>, you potentially run into problems with variable-width text, where links with more letters appear shorter than links with fewer but wider letters. I then tried the width of the <li> elements, but being block elements (in my case) they all had the same width. The solution that eventually worked for me was to compare the widths of the <a> child element of each <li>. This took a little bit of experimentation with the selectors and iterator functions as I’m not that familiar with either jQuery or javascript. I based my code off code for sorting a list by Dan Sargeant of one more take, so thanks Dan!

I packaged my code up into a function (well two, as I used the alphabetical sort too) which takes one argument – the selector object representing the parent <ul> or <ol> that is to be sorted. Please adapt the code to your own needs, as it may well not work as is! (ie works for me, YMMV, etc)

function sortbylength($elements) {
        var listitems = $elements.children('li').get();
        listitems.sort(function(a, b) {
                var compA = $(a).children('a').width();
                var compB = $(b).children('a').width();
                return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
        })
        $.each(listitems, function(idx, itm) { $elements.append(itm); });
}

function sortbyalpha($elements) {
        var listitems = $elements.children('li').get();
        listitems.sort(function(a, b) {
                var compA = $(a).text().toUpperCase();
                var compB = $(b).text().toUpperCase();
                return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
        })
        $.each(listitems, function(idx, itm) { $elements.append(itm); });
}

Show Progress Bar During dd Copy

There are a number of ways of showing the progress of a dd copy. The easiest is sending the USER1 signal to the dd process, like:

dd if=FILE1 of=FILE2
pkill -USER1 dd

But that only gives a current status – eg 12345678 bytes transferred (11.77MB) … [8.56MB/s]. Not that helpful if you want an ongoing update. You can make it periodic by using the watch command:

watch -n 10 pkill -USR1 dd

Still not perfect. If you want a progress bar, ETA and so forth, you’re best off using pv, a utility that measures the speed of a file through a pipe. If you don’t know what that means, I’d recommend reading up on the UNIX philosophy and pipes, but basically it means you can tell what dd is doing. Use it like so:

pv FILE1 | dd of=FILE2

For my use, backing up a 500GB hard drive that I use with a NAS (an NSLU2 I’ve probably mentioned before), I used the following command:

sudo pv /dev/sde3 |dd of=~/tera/nslu2.img

/dev/de3 is the data partition on the drive
~/tera/nslu2.img is the image file I want written to a terabyte-sized hard drive, mounted at ~/tera/.

As a post-script, the reason I’m backing this drive up is my nslu2 is failing weirdly. It was running without a hitch for years, then it without apparent warning dismounted the drive in slot1 and reverted to running from flash. I only figured that out as I had to log in with an old password. Trying to start it up results in it beeping once every minute or so, with the ready status lamp flashing orange. It seems to go through a loop. I thought it was a temporary glitch, as when I plugged the drive into my desktop to check the thing was intact the partitions showed up, then when I plugged it back into the nslu2 and turned it on it worked fine.

That was 3 nights ago. This evening it’s done the same thing, except repeating the steps didn’t sort it out. Running the drive through some brief SMART diagnostics and a partition check shows up no problems, so I’m inclined to believe the problem lies in the nslu2. I’ll post again if I can sort it, but at this stage I think a re-flashing is in order. Only problem is I can’t remember what firmware I flashed onto the nslu2 in the first place. D’oh!

Polish Demotivational Posters

I have some images up on this blog, images that are sometimes linked to. I occasionally check out who is checking out what, and found out that one of the mosaics I generated a few years ago is being used in what appears to be a demotivational poster.

You can see it at http://demotywatory.pl/2483873/Jestesmy-tym-wszystkim.

Google translate translates the Polish to English:

Jesteśmy tym wszystkim
Co pozornie w niczym nas do siebie nie przypomina

We are all
What is apparently the way we do not like each other

Which isn’t much help in making sense of the thing. Funny though. Also, Google Translate is pretty awesome: real-time translation, spelling corrections, and a doodad to hear what it sounds like.

(image included below in case the original disappears)

Demotywatory
Demotywatory

Nostalgia is Playing Wipeout 2097 Again

Let me paint a picture for you. It’s 1996. Clinton is in power in the US and can do no wrong, while on this side of the pond John Major’s grip on power is weakening. One bright grey afternoon at my sister and brother-in-law’s flat my sister pointed out a new device on the floor of their living room. “Do you see what we’ve got?”. Not being familiar with the device in question, I asked “A Nintendo 64?”. The reply came smugly: “No… a PlayStation.”. Ace! I’d heard of that! It was supposed to be really cool. “Can I see?”.

So in due course Wipeout 2097 was loaded (I should say wipE’out” 2097, or Wipeout XL for our American friends) and I gazed in awe at the marvellous 3d graphics and smooth gameplay. Soon enough I was playing it myself, even more in awe of the power of this new machine.

So I took a trip down memory lane today and relived my first PSX moment. Despite being very rusty I breezed through the first four levels, but on the final two my lack of practice started to show:

It’s still a really good game, in my opinion. And while the music wouldn’t be my first choice for a lazy Sunday afternoon, it definitely complements the game.

Plain Sight Dedicated Server Crash Fix

Plain Sight was on sale for the staggeringly low £1.60 / £1.20, so I decided to get a copy. It is a very fun, fast-paced game, with lots of great moments – where you pull off an attack a split second before an opponent does the same, or when you detonate just as three people come gunning for you. However, it is not without issues. I am writing this post as I wait for the master server to let me log in and play, and matches will occasionally crash half of the people on the server to the desktop with what looks like an array out-of-bounds exception.

Frustratingly, the dedicated server software itself has problems. One problem occurs even before running – where do you get it from? It is not well-signposted on any of Beatnik Games’ websites. As it stands, you have to go to the members’ area of plainsightgame.com (http://accounts.plainsightgame.com/), where you can download both the server and the client.

(The TLDR version: If you have Steam, use the dedicated server included with that. Strip out whitespace and comments (//) from the example dediconfig.txt on the wiki. If you don’t have Steam or don’t want to faff about, use this zip.)

Now, it is good practice to have an example / default config file available for those that want to just run the server… which the dedicated server zip doesn’t have. So if you run it, it complains about not being able to find the config file and then crashes. Right, no problem, just copy from the wiki page on setting up a dedicated server and paste into the new file dediconfig.txt. Ah, hang on, that crashes the server on launch with a System.FormatException.

Show »

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: plainsightserver.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4bc74e1c
Problem Signature 04: mscorlib
Problem Signature 05: 2.0.0.0
Problem Signature 06: 4a275af7
Problem Signature 07: c43
Problem Signature 08: 59
Problem Signature 09: System.FormatException
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 2057

Stripping out the whitespace and comments lets the server run. I would be more specific, but I can’t actually tell what is causing the problem. It disappeared when I got down to two / one comments, and reappeared when I added another. My debugging skills couldn’t detect any commonality though. Anyway, it runs… briefly. Checking the log file (plainsight.log) shows that it is exiting due to not having the “Updater” directory present. eg:

Show »

0 Connecting to master server(s)...
0 New master server connection status: AwaitingChallenge
633 New master server connection status: VersionCheckFailed
633 New master server connection status: NotConnected
633 New master server connection status: AwaitingChallenge
650 Error Updating: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:Gamesplainsightdedicated4UpdatercwRsynccwRsync.cmd'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at PlainSightServer.Program.LaunchUpdater()
650 New master server connection status: NotConnected
650 New master server connection status: AwaitingChallenge

Now, you can get this from the directory in your Steam directory that contains the dedicated server (!), or from this zip file: Updater.zip. Now, if you want to continue down this path that’s grand, but for me it *royally* screwed up permissions on that folder, to where I couldn’t even run the server executable file! It is possibly due to the rsync updater running as System / nobody, but even still I feel it’s a bit harsh! Of course, it might just be a Windows 7 thing. Despite that, even when I (think) I had sorted out the permissions, the game was still crashing with an error in KERNELBASE.dll (see below). Eeep. So, what I did at this stage was to make a copy of the Steam version of the dedicated server, copy over my dediconfig.txt file and run that. Then it ran.

For those of you who don’t have Steam, I have created a zip containing the dedicated server with a working dediconfig.txt file: DedicatedServer.zip

Show »

Problem signature:
Problem Event Name: APPCRASH
Application Name: PlainSightServer.exe
Application Version: 1.2.0.0
Application Timestamp: 4c6e7ef9
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdbdf
Exception Code: e0434f4d
Exception Offset: 0000b727
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 2057