Author: Moazzam

  • Testing multiple browsers with Selenium2 in PHPUnit

    You used to be able to run test on multiple browsers with PHPUnit Selenium test class by specifying a $browsers property. You can still do the same with PHPUnit’s Selenium 2 class made for web driver. Here is how you do it: class SomeTest extends PHPUnit_Extensions_Selenium2TestCase { /** * Variable to specify which browsers to…

  • Fastest way to traverse an associative array

    PHP has array_walk() which can be used to traverse an array and modify it in place. I wanted to find out if array_walk() would be faster than a loop written in PHP (for, foreach). I mean, PHP’s code is written in C/C++ and traversing anything has to be faster in C than in PHP. So,…

  • OSX Mavericks upgrade and PhpStorm problems

    I upgraded my work laptop’s OS to Mavericks (finally). Started the upgrade yesterday when going home and when I went back to work today, PhpStorm stopped working. I got no errors, no warnings, nothing. It didn’t even give me an indication stating that it was trying to open PhpStorm. So, like any sensible person I…

  • Is OSX the best Linux

    Someone I know mentioned in passing that OSX is the best Linux out there and I have been thinking about it ever since. A lot of developers I know get MacBooks to work on (and not Linux desktops or laptops) for multiple reasons. The business has a point of support they can pester if anything…

  • Dota 2 on Linux (again)

    So, I had to reboot my computer and it booted into my Linux partition. I thought I would give Dota 2 another try. Maybe there is something I can do to improve the performance and I came across this forum in which a Valve developer said they made performance improvements to Dota 2. So, like…

  • Convert an array to XML in PHP

    I haven’t benchmarked the memory consumption of this method versus just traversing the array yourself and writing XML but I can’t see anything else being more efficient than this. $testArray = [ ‘key1’ => ‘val1’, ‘key2’ => [ ‘key3’ => ‘hello’ ] ]; $xml = new SimpleXMLElement(‘<root/>’); array_walk_recursive($testArray, array ($xml, ‘addChild’)); print $xml->asXML();

  • My experience with Dota 2 on Linux

    I love Linux. I love developing on it and the powerful command line that Linux has is really great. When I heard that Dota 2 had been released for Linux I was excited. I didn’t have to be on Windows just so I could play games. I installed 2 days ago and installed Steam and…

  • Sketchbook app for Android

    I have a Samsung Galaxy Note II. As you may already know, it has a big screen and the fact that it comes with a note taking app made by Samsung (I think) makes it very useful to jot down ideas, doodle, etc. I, however, wondered if there was an app that would facilitate doodling…

  • MariaDB – A better replacement for MySQL?

    A friend of mine mentioned that Suse and another Linux distribution were going to switch from MySQL to MariaDB. So I got curious and looked at it. According to their website, it is a drop-in replacement for MySQL. You can uninstall MySQL, install MariaDB and things will just work. No need to change any code.…

  • The new light sensor

    In my last post, I spoke about creating a light sensing “widget” that I could attach to my projects. I used a 10k resistor and was reading the light readings off of the analog pin on Arduino. However, I noticed that attaching an LED to the circuit was throwing the readings way off. so, I…