I came across this Stack Overflow question today about replacing radio buttons with images, however the answers there didn't sit quite right with me. They were completely reliant on javascript, which was fine according to the OP, but I feel that javascript enhancements like this, especially when they deal with things which require user input, [...]
Javascript default values
Just a small post here to share a bit of benchmarking I just did. In Javascript, the boolean operators (|| and &&) behave a little differently to how many people expect. In PHP, the result of using || or && is always a boolean:
// PHP:
$x = "hello" || false; // bool(true)
$x = false || 0; [...]
Ubuntu, nooooo!
Starting with version 10.10, coming out in October this year, Ubuntu will be using base 10 units, taking its lead from Apple's move last year which I didn't much like. At least Ubuntu will give users an option to switch back, something Apple is yet to do. (Options? On a mac? ha!)
The great rep recalc of 2010
The Stack Overflow team recently announced that they were changing the question upvotes to only give 5 points instead of 10.
Though I've got plenty more reputation than I could possibly need (that is, I have full user-moderator rights), this has affected my score. A lot. Like -4250. Bummer. I ask a lot of questions [...]
A suggestion for Ford
Breaking with the theme of this blog, but this has been irritating me for some time now.
The "Voice Control" ad for the Ford Mondeo.
If you're going to make an ad touting a new feature such as voice control, it'd probably be a good idea to not highlight how buggy your software is.
jQuery 1.4 released
Despite the risk of joining in the echo chamber that I'm sure will start up very soon, I just wanted to write a little observation.
jQuery 1.4 has been released. Kinda.
It's a little baffling to me, considering the first release candidate was only announced one day ago, yet the dedicated jQuery 1.4 website proudly states "jQuery [...]
Common Mistakes Part 1: SJAX
Here's another common mistake I see on Stack Overflow from time to time. The basic pattern goes like this:
// get the contents from some remote file
$('#myElement').load('lipsum.html');
alert($('#myElement').html());
// wtf, it's still empty?!?
This is something that I struggled with when I started playing with AJAX techniques, too. It's quite understandable how so many people [...]
Anyone have any questions?
So I'm a little addicted to Stack Overflow. I'll admit it. I browse it for fun, even during lunch-breaks and after work. As far as the reputation ranking goes, for the past 12 months or so, I've been sitting at around 30th to 40th place, first hitting the front page back in November 08, when [...]
Common Mistakes Part 0: 83.333% of jQuery
I've decided to start writing a short series of posts highlighting some common mistakes I see in questions and, more importantly, answers on Stack Overflow. I enter this knowing fully well that I am but an amateur who is also learning new things daily. Anyway, the series kicks off with Part Zero, titled 83.333% of [...]
Regex for PHP function declarations
Here's a little snippet of the day for you. A regex to grab the names of functions from a PHP file.
/^\s*(?:(?:public|private|protected|static|abstract|final)\s+)*
function\s+&?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/
Linebreak added for legibility.
If you were wanting to know the functions which exist in a particular class or file for an application or similar, you'd be better off using the PHP Reflection functions which are [...]
Recent Entries
- Image radio buttons
- Javascript default values
- Ubuntu, nooooo!
- The great rep recalc of 2010
- A suggestion for Ford
- jQuery 1.4 released
- Common Mistakes Part 1: SJAX
- Anyone have any questions?
- Common Mistakes Part 0: 83.333% of jQuery
- Regex for PHP function declarations
Recent Comments
- Damo in Image radio buttons
- alex in The great rep recalc of 2010
- Fisher in Anyone have any questions?
- fake in Anyone have any questions?
- alex in Anyone have any questions?
- Fisher in Common Mistakes Part 0: 83.333% of …
- alex in Common Mistakes Part 0: 83.333% of …
- Fisher in Perhaps the most epic Stack Overflo…
- alex in Perhaps the most epic Stack Overflo…
- alex in jQuery is not optimised how you'd t…
Categories
Archives
- June 2010
- May 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- January 2009
- December 2008
- September 2008
- July 2008
- June 2008
- April 2008
- March 2008
- December 2007
- November 2007
- September 2007
- August 2007
- July 2007
- May 2007
- April 2007
- March 2007
Pages
Blogroll
- Chris Dot Spadgos
- Fisher Dot Spadgos
- Furious Steals - Highly destructive UT2004 racing mod
- Marshmallow Duel - The 1996 cult classic and delicious fan remakes
- NB Dot Spadgos
- Pospi Dot Spadgos