PHP’s flexible variable typing makes determining a value to be empty… well, see for yourself. Check out this diff for the NotEmpty validator in Zend Framework.
That can’t be right, surely!
Update: the unit tests reveal the intent behind the odd-looking code change. Now the validator can optionally be very specific about what is considered empty.
Posted by Libertus on January 16, 2010 at 12:48 pm under Coding, Hmmmm..., PHP.
Comment on this post.
Who’da thought that a single Tweet would have such impact?
During an IM chat with Daniel White he showed me his astonishing 3D Mandelbulb work. I asked if I could tweet about it and he agreed. Little did he know that this would lead to his website being Slashdotted and his work picked up by New Scientist!
Well deserved recognition for a true genius and nice guy.
Posted by Libertus on November 26, 2009 at 1:36 pm under Hmmmm..., Publicity.
Comment on this post.
How many users on Twitter have all “u”s as a username?
require 'net/http'
Net::HTTP.start( 'twitter.com' ) { |http|
us=0
us+=1 until Net::HTTPNotFound==http.request_head('/'+'u'*us).class
puts us
}
# 15
Posted by Libertus on July 12, 2009 at 4:48 pm under Uncategorized.
Comment on this post.
Last Sunday, after getting bored implementing error handling in the Ruby version of the food journal, I decided to take a stab at the ICFP 2009 Programming Contest. Although already finished, the problem is so intense and interesting that I had to try. My solution is written in the lovely functional language Haskell.
Today, I achieved a milestone. My program can load and execute the Orbit virtual machine, run a sequence of frames and reports a score of -1.0 when the controlled satellite’s fuel is exhausted.
Browse the code on GitHub. Remember, I’m still learning, so don’t expect anything miraculous!
Continue reading ‘Controlling Satellites With Haskell’ »
Posted by Libertus on July 11, 2009 at 4:03 pm under Coding, Education, Haskell.
Comment on this post.
I’m not by any stretch of the imagination an early adopter of technology. Nor am I (mostly) an old stick-in-the-mud who thinks that all programming should be done in COBOL. I love new technology but prefer other people to work out the bugs and niggles before I can use them reliably as tools.
So it is with some pleasure that I’ve decided to take the plunge and begin studying the Ruby programming language. Ruby has been around for 15 years now so the foundations are solid. Many rave about its simplicity, utility and natural-looking syntax.
My goal is to learn the lanugage by porting an existing application (the food journal written in PHP that I recently used to play with Zend Framework) first to the Ruby language, then to the web application framework Rails.
As usual, I embark on this project by reading a manual!
Update 12-Jul-2009: Browse the code on Github
Continue reading ‘Playing With Ruby’ »
Posted by Libertus on June 14, 2009 at 12:14 pm under Education, Ruby.
Comment on this post.
The Zend Framework is a long-established and well-respected set of libraries for building PHP web applications. I’ve not used it before and I’ve recently become interested in learning more about it so I’ve decided to have a play. Rather than start entirely from scratch, I’m going to re-use the database schema of a famous dive-logging web application and see how much effort is involved in re-implementing the basics; logging in and displaying a page of dives.
More importantly, how much fun is it to work with?
Update 12-Jul-2009: Browse the code on Github
Continue reading ‘Playing with Zend Framework’ »
Posted by Libertus on March 11, 2009 at 8:56 pm under Coding, Education.
2 Comments.
I eventually got off my ass and recovered the previous blog’s posts using the Wordpress export/import mechanism. It seems to be ok after a brief eyes-over, the only issue so far being the (all too usual) UTF/ISO character encoding screw-ups, which I’ll correct manually over time. I’ve not yet re-enabled my plug-ins or theme as they were heavily customised for a previous version of Wordpress and I can’t be arsed to rework them right now. Only Outreach will be missed, I reckon.
There’s not been that much going on to blog about. I’ve been learning the beautiful programming language Haskell but I’ve not really done much with it as I’m going through an inspirational downturn. I’m still working for an ISP in Sheffield. My Rock Band skills have peaked at expert guitar and hard drums.
Posted by Libertus on February 28, 2009 at 8:07 pm under Life.
1 Comment.
The database for my old blog got corrupted, so I’m going to rebuild it on the latest Wordpress. It’ll probably take a while and lots of links could be broken. Apologies for any inconvenience
Posted by Libertus on December 13, 2008 at 3:10 pm under Uncategorized.
Comment on this post.
Been in Western Australia for the last week at a major family do. Lots of fun and lots of alcohol so it’s been a fair test of stamina! The weather has been cool with the occasional day of rain, which is normal for us but a complete delight to the folks from the east who don’t see rain all that often.
Places visited so far; Perth (the capital), Margaret River (wine region) and Pemberton (for the family event). Next stop Fremantle maybe for diving.
Posted by Libertus on October 6, 2008 at 6:00 pm under Australia, Travel.
Comment on this post.
Oh dear. Scarcity doesn’t imply quality.
It was ages before I found Mariokart Wii in a shop. I remembered being a fan of the previous versions of the game on the SNES and N64 so had no reservations about buying it for the Wii. I wish I hadn’t.
Continue reading ‘Mariokart Wii’ »
Posted by Libertus on July 27, 2008 at 9:54 am under Reviews, Software, Wii.
Comment on this post.