Category: Tech

  • Regex to split “){” to two lines, retaining indenting

    I was quite proud to come up with this, so here’s my first blog post for a while:

    Search:
    ^([^\S\n]*)(.+))\s*{

    Replace:
    $1$2)\n$1{

    and as a bonus:
    ^([^\S\n]*)}\s*else\s*{
    $1}\n$1else\n$1{

    NB (2013-09): it seems that the escaping slashes in this post were lost  at some point, I’ve put them back, but not tested!

  • CSS3: Rounded Table Corners (No images)

    You cannot give a whole table (<table>) rounded corners using CSS, browsers will ignore it, you must round the corners of the cells (<td>) inside.

    The following uses CSS2 selectors (:first-child etc) and CSS3’s corner-rounding border-radius to selectively round the outer corners of the cells in the corners.
    This will work for any size table.

    table.rounded-corners tr:first-child td:first-child {
    	border-top-left-radius: 5px;
    }
    table.rounded-corners tr:first-child td:last-child {
    	border-top-right-radius: 5px;
    }
    table.rounded-corners tr:last-child td:first-child {
    	border-bottom-left-radius: 5px;
    }
    table.rounded-corners tr:last-child td:last-child {
    	border-bottom-right-radius: 5px;
    }
  • PHP Bug: json_encode() misleading warning on object with private properties

    I have found a peculiar issue with PHP’s json_encode() function.

    If you have an instance object with private properties and use json_encode() it will give you a very misleading warning.

    class ExampleObject {
        private $privateProperty;
        ...
    }
    $obj = new ExampleObject();
    json_encode($obj);

    results in

    Warning: json_encode() … recursion detected …

    There are two workarounds in the comments for the function at php.net but this is simply a PHP bug as far as I am concerned.

  • 10/GUI


    10gui.com

    This is as much an HCI concept as it is about the GUI.

    I think a multitouch pad would be great.
    5 fingers, i.e. one hand, would be plenty though, and having one hand remaining on the keyboard allows for faster resumption of typing long text.

    My HTPC keyboard already has a simple multi-touch action, two finger to scroll, and I’m sure moving up to five fingers would be perfectly achievable by most users. In fact, in the video above there were only s few times when you’d have to use more than two or three fingers.

    I think this is all fantastically interesting, and discussing the subject with people who won’t just shoot down the unknown/unfamiliar will lead to some great things.

    I wish I could be more involved with this area of research and development.

  • Firefox still has memory leak issue?

    I had to kill Firefox earlier today after noticing that it was using around 750MB of memory!

    It hung when I tried to close it normally, but perhaps I was just impatient.

    This time I’m going to give it the benefit of doubt and blame some crappy Flash advert or something.

  • BT (Bastards Telepunish) Woes

    My ISP, BT, have got my goat again.

    They’re punishing me by crippling my (already joke-worthy) download speeds, because I used a lot last week.
    So they’ll probably charge me for that (fair enough, I suppose).

    I understand that they need to provide a fair service to all their customers, but why does that have to mean reducing my speed when I’m not even trying to download excessive amounts? Surely they should simply cap my speed?

    A double punishment.
    I can’t even call to complain or plead my case because the relevant department is only open 9-5 Mon-Fri. Isn’t that absurd? They have the power to make their service even worse, on purpose, and don’t even have the guts to be around to answer for it.

  • Firefox 3 to break Zoom (Edit: I’m mistaken)

    Mozilla is about the make a big mistake, the same as that made by IE7.

    Zooming the whole page is not a good idea.

    Browser Zoom Method Comparison

    Current Firefox text-only zoom on the left, IE7 on the right.

    Using the current Fx way you can easily read the text without having to scroll sideways, but the new way (which is how IE7 works) means you have to scroll right for each line of text, then back to the left, and so on.

    I simply cannot fathom how they thought this was the right move.

  • Automatically Added Start Menu / Desktop Icons

    I have just allowed Adobe (Acrobat) Reader to update itself, fair enough, though it is still remarkably slow to load on first use.

    I keep a clean desktop, with shortcuts only for the things I use on a regular basis (at least daily).
    I keep my Start Menu under control (am still using XP).

    I think I might have computer-specific OCD, but that’s not my point.

    My point is that Adobe have decided to re-add a shortcut to a programme which is never run directly.
    If I ever have to use Adobe Reader, it’s to read a file, so it’s a (link to a) file that I open.

    The updater also added a shortcut to my Start Menu, despite the fact that there’s one there already, in a folder I created.
    This in turn caused Windows to inform me that a new programme had been installed.

    Are they trying to get me to use the programme more often? If so, why? It’s a free programme anyway!

  • You get what you pay for…

    PC World, TechGuys (PC Service Call), Parceline – One of them screwed up.

    The fianceé’s laptop died on a Thursday. It would POST, but it would simply restart itself before Windows started loading.

    It’s a Vista machine so I tried to use its self-repair options, but to no avail.
    I took it to work to see if my colleague the IT support guy had any further ideas but alas.

    It was less than a year old so I was able to take it to PC World (where it was bought originally).

    So I take it to the shop after work.
    The guy at the desk clearly can’t be bothered trying to help and insists that I have to call a support number to get a code before they’ll take it from me.
    Can I use their phone? “No, that only makes internal calls.” (*cough*bollocks*cough*).

    I give in, take it home and call from there. I’m taken through the same repair process that I’d already attempted multiple times by a friendly but non-technical call centre employee. At the end of the call I explain that I’d like to complain that I couldn’t make the call in the shop. He’s surprised I’ve been told this since he has himself taken calls from PC World employees.

    I arrange a collection and am given a code.
    Monday morning it’s collected by Parceline, and am told that they usually don’t take very long to return.
    Next morning I get a call from the post room saying that they’ve got a laptop for me. That was quick.
    Talking to the courier we agree that it’s probably a mistake. Unfortunately, he can’t take it back since he doesn’t have the correct paperwork. Fair enough, insurance etc.

    I call the TechGuys and explain the situation, that I’m irked and that I’d like some kind of express service to compensate.
    The call centre kid appears to take it personally and puts me on hold for about five minutes before the call gets disconnected.
    I call again and am told that I will have to wait for more than 24 hours before it gets picked up. I have no choice so I agree.

    It’s collected on the Wednesday morning as arranged, and returned fixed on the following Monday (10 days after I first reported the problem).

    ‘Fixed’ I called it. Actually, all they did was replace the hard-drive, something I could easily have done myself.
    Fortunately they installed the correct version of Windows.
    What of the files? All gone.
    What of the broken hard-drive itself? Not returned to me. (I may have wanted to send it to a hard-drive recovery centre.)

    Communication from any of the parties involved? None, apart from the ripped proforma which accompanied the fixed laptop, with 5 ticks and the scribble regarding the replaced hard-drive.

    I’m glad I’m not having to try and get any money back.

  • NatWest Anti-Fraud Team: Impressive

    Despite my reservations regarding NatWest’s Card Reader, I wish to voice how impressed I was with their Anti-Fraud Team.

    DreamHost’s incredible billing blunder resulted in some peculiar charges to my card.
    So when I was trying to pay what I actually owed, it was denied by the issuer.

    I tried a few times (just in case), but then my mobile rings. It’s NatWest asking if it’s me attempting to make these payments.

    That’s joined-up thinking. Some automated system has obviously spotted the unusual activity and gets a human to check it out. They have my number, call me, I explain. They then inform me that I should wait a short while and try again.

    Bit of a pointless post I guess, but I thought they should get some credit.