Categories
Code Tech Tips

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!

Categories
Code Tech Web

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. […]

Categories
Code Tech Web

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 […]

Categories
Hardware Media Musings Opinion Personal Software Tech Video

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 […]

Categories
Tech Web

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.