Month: August 2012

  • Twenty Twelve WordPress theme

    I switched to using the Twenty Twelve WordPress theme a few days ago. I really am liking it although I’m not sure about the header image being below Site Title and Tag Line. That looks a little strange to me.
    Having said that, I think Twenty Twelve looks fantastic on the demo site.
    Currently you have get Twenty Twelve from the WordPress trac repository as as far as I know it is not released yet. They will release it as a stand alone theme soon I believe, so you can try it out before WordPress 3.5 is released.
    I did a git clone of the WordPress code mirror on github, into my home directory. Then I symlinked the ~/wordpress-git/wp-content/themes/twentytwelve directory to my live WordPress install path. That way I can simply do a git pull to update the theme.

  • \(\LaTeX\) Equations in WordPress using MathJax

    I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
    The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
    There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
    To use MathJax simply mark up your equation with \[…\]. If you want to have an equation inline, use \(…\). You can also inline equations in the post title.
    Here are a few examples taken from the MathJax site:

    The Lorenz Equations

    \begin{aligned}
    \dot{x} & = \sigma(y-x) \\
    \dot{y} & = \rho x – y – xz \\
    \dot{z} & = -\beta z + xy
    \end{aligned}

    The Cauchy-Schwarz Inequality

    \[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]

    A Cross Product Formula

    \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
    \mathbf{i} & \mathbf{j} & \mathbf{k} \\
    \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
    \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
    \end{vmatrix}\]

    The probability of getting \(k\) heads when flipping \(n\) coins is

    \[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]

    An Identity of Ramanujan

    \[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
    1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
    {1+\frac{e^{-8\pi}} {1+\ldots} } } }\]

    A Rogers-Ramanujan Identity

    \[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
    \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
    \quad\quad \text{for $|q|<1$}.\]

    Maxwell’s Equations

    \begin{aligned}
    \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
    \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
    \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}

  • \(\LaTeX\) Equations in WordPress using MathJax

    I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
    The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
    There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
    To use MathJax simply mark up your equation with \[…\]. If you want to have an equation inline, use \(…\). You can also inline equations in the post title.
    Here are a few examples taken from the MathJax site:

    The Lorenz Equations

    \begin{aligned}
    \dot{x} & = \sigma(y-x) \\
    \dot{y} & = \rho x – y – xz \\
    \dot{z} & = -\beta z + xy
    \end{aligned}

    The Cauchy-Schwarz Inequality

    \[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]

    A Cross Product Formula

    \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
    \mathbf{i} & \mathbf{j} & \mathbf{k} \\
    \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
    \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
    \end{vmatrix}\]

    The probability of getting \(k\) heads when flipping \(n\) coins is

    \[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]

    An Identity of Ramanujan

    \[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
    1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
    {1+\frac{e^{-8\pi}} {1+\ldots} } } }\]

    A Rogers-Ramanujan Identity

    \[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
    \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
    \quad\quad \text{for $|q|<1$}.\]

    Maxwell’s Equations

    \begin{aligned}
    \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
    \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
    \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}

  • \(\LaTeX\) Equations in WordPress using MathJax

    I came accross this great tool for displaying mathematical equations the other day. MathJax not only supports \(\LaTeX\) syntax but also renders the equations as pure text, so no unsightly images and they scale beautifully. You can also right click on the equation and see it’s \(\LaTeX\) code.
    The code for MathJax is open source, but if you don’t want to go to the bother of installing it yourself, you can use it on their CDN.
    There are a couple of plugins to enable MathJax in WordPress. I’m using the Simple MathJax plugin. I’ve not tried the others.
    To use MathJax simply mark up your equation with \[…\]. If you want to have an equation inline, use \(…\). You can also inline equations in the post title.
    Here are a few examples taken from the MathJax site:

    The Lorenz Equations

    \begin{aligned}
    \dot{x} & = \sigma(y-x) \\
    \dot{y} & = \rho x – y – xz \\
    \dot{z} & = -\beta z + xy
    \end{aligned}

    The Cauchy-Schwarz Inequality

    \[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]

    A Cross Product Formula

    \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
    \mathbf{i} & \mathbf{j} & \mathbf{k} \\
    \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
    \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
    \end{vmatrix}\]

    The probability of getting \(k\) heads when flipping \(n\) coins is

    \[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]

    An Identity of Ramanujan

    \[\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
    1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
    {1+\frac{e^{-8\pi}} {1+\ldots} } } }\]

    A Rogers-Ramanujan Identity

    \[1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
    \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
    \quad\quad \text{for $|q|<1$}.\]

    Maxwell’s Equations

    \begin{aligned}
    \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
    \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
    \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}

  • Event Cinemas’ lousy customer service comes good

    Recently I went to see Dark Knight Rising with my wife. The volume in the cinema was too loud and we didn’t enjoy it because of that. My wife went out to complain to the only person she could find. A security guard who couldn’t be arsed to do anything about it. He said he would “try” but there was no change in the volume that we could detect. I find this trend in increasing volume in cinemas to be disturbing.
    On the plus side, they actually have a ticketing system for complaints.
    On the negative side, at first their response was lousy but after a bit more complaining they improved. Conversation follows:

    Hi,
    on 6/8/2012 at 8:20pm session in cinema 8 i saw Dark Night Rising.
    Right from the start of the movie it was too loud. My wife and I felt uncomfortable at the noise level.
    After a while my wife left the cinema to complain. She spoke to the security guard on the ticket collection stand. He said he would “try to do something” but there was no detectable change in the volume level. it really was too loud during the action scenes and consequently we left the cinema with ringing ears. My ears continued to ring all night long.
    I don’t really like to think I paid good money to have hearing damage. I’m not quite sure what was wrong with your setup but the system failed us on two counts.
    1. it was too loud to begin with. you should have systems in place to ensure it is not too loud.
    2. when we complained about it, your staff did nothing to rectify the situation.
    I might also add that on leaving the cinema, we felt like complaining but the place was deserted except for the same security person who did nothing in the first place.
    This is not the kind of experience I expect from the Event Cinema brand and frankly I doubt I will be attending an Event Cinema again for quite some time.
    Yours, Jason.

    To which they replied with the fairly lack lustre:

    Hi Jason,
    Thank you for contacting us.
    Customer Service is of the upmost priority to us. We do endevour to make the cinema going experience the best for each individual & we can assure you that it is very rare that we receive feedback about our film volume levels. Please know that we do appreciate you bringing this to our attention and will contact the appropriate parties so this doesn’t happen again.
    We hope that you will attend our cinemas again in the near future.
    Kind Regards,
    E Support – Event Cinemas George Street

    This riled me up a little and I sent them this:

    Wow, I’m pretty surpprised that you couldn’t even manage an apology. And not only that, your email aludes to perhaps the issue is my ears rather than your sound configuration.
    In order for me to go to the cinema, I need to organise baby sitting. It’s not easy to get to the cinema, and when we got there, it was uncomfortably loud and your staff couldn’t be bothered to even fix it.
    I’m very disappointed.

    which apparently got their attention:

    Hi Jason,
    Please let me sincerely apologies for the interruption to your movie experience. As a mother of 5 myself I do know how difficult it actually is to get some time out from the kids to attend any outing. If you would like to forward your address to us, we are more than happy to provide you with some passes for you to come back & watch a movie at a time that suits you.
    We will definately speak to our staff & the security company to ensure that any issues like this are looked after appropriately & accordingly.
    Thank you for taking the time out to give us your feedback. It is feedback like this that we take on board seriously & use to better our service.

  • Debugging of Pathfinder Rovers

    Jeff Waugh @jdub tweeted an interesting article about how the previous Mars rovers turned out to have a fairly serious software problem, and how the JPL engineers diagnosed and fixed it.
    Some of the points I found particularly interesting:

    • JPL use a propriety, off the shelf operating system to run the rovers (VxWorks)
    • having a replica of a live system for debugging is very useful
    • leaving debugging tools in the remote system saved the day
    • Finding a way to reproduce the error is critical
    • Don’t ignore strange behaviour thinking it might just go away

    I love reading stories of issues like this and how the engineers fixed them. Well worth reading.

  • Curiosity Rover about to land on Mars

    Brendan sent a reminder that Mars Curiosity Rover is about to land. To get in the spirit you can:

  • Flipping the mouse wheel scroll direction in Windows 7

    I have been getting very confused between the mouse wheel scroll directions in Windows 7 and Mac OS X Lion. As I consider OS X to be the future, I decided to try and flip the mouse wheel scroll direction in Windows.
    Turns out there is a registry setting to do this: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\????\????\Device Parameters
    Set the value of FlipFlopWheel to 1
    You need to find the USB enumeration values (shown above as ????). You can get those by going to the Mouse Control Panel, click on the hardware tab and click Properties. then in the Details tab of the HID-compliant mouse Properties window, look at the Device Instance Path property. It will be something like: HID\VID_046D&PID_C049&MI_00\7&25DD4DC&0&0000

    This is quite well documented on superuser.com and there is even a link to a little .exe that automates the whole process for you. Although I have not tried it so I can’t vouch for it.

  • Using magnets to keep dust out of the cupboard

    We recently bought an old kitchen cabinet that has a fly screen on one of the doors. I have found that it lets dust in over time, and when I go to use the glasses, they often have to be cleaned because they are dusty.

    kitchen cabinet with flyscreen in top panel of door
    Kitchen Cabinet with flyscreen in top panel of door

    I decided to make some sort of clear perspex screen to go behind the door. I noticed that iron nails were used to hold the fly screen in place and I had the idea to use magnets to hold it on.
    fly screen mesh with frame holding it into door, nail heads visible
    A bit of measuring, openscad and ebay later, I had everything I needed.
    rectangular perspex sheet with 14 6mm holes around the edge
    OpenSCAD design of the perspex sheet

    I cut the sheet out of perspex at the hacker space in Sydney. Then I glued the magnets in with super glue. That turned out a bit messy but as the magnets are not visible from the outside it doesn’t really matter.
    placing perspex sheet with magnets onto door
    perspex plate on kitchen cabinet door being held in place with magnets
    I am very happy with the result. It is invisible from the outside, and the magnets hold the perspex sheet on firmly enough that it won’t fall with the normal use of the cabinet door.