Monday, 30 August 2010

iPad post

First time I have used an I pad, someone had left safari running. First thing I did, google "iPad alt tab".
http://noscope.com/journal/2010/01/why-the-ipad-doesnt-have-multi-tasking suggests the home button which seems to be the hw button with the square on it.

Touch typing:
Quality of a netuoy us bot sttauobed.

Hmm, no.

PS: In case it wasn't obvious, I did all that on an iPad. The post is a little unclear because typing was so much work.

Edit: Added PS using a real keyboard, so much nicer.

Tuesday, 24 August 2010

So, I make websites

Hello to everyone visiting because I gave them them this link at OPD today.

So, I make websites as my day job. If you're a celebrant (or any small business) and would like me to give you a quote to build, host and/or maintain your website please don't hesitate email me at work@leetmotif.net.


For the record, "leetmotif" is a play on Leitmotif and Leet.



Celebrant OPD

I just returned from a course of Ongoing Professional Development for Celebrants from Australian Celebrations Training.

Amusingly, during the Social Media part of the presentation the presenter kindly asked if I made websites and let me plug this site. Thanks Beth.

So, I've hurried back to update the site.

Saturday, 24 July 2010

Building VLC on Ubuntu

Exciting apt command:
apt-get build-dep vlc
downloads vlc's dependencies for me. From VLC's UnixComplie page.

Still doesn't compile. OK, new plan:
update-manager -d
alpha FTW.

Wednesday, 9 June 2010

RMySQL and mysql connector odbc 5.1.6

I think installing mysql-connector-odbc-5.1.6-win32.msi upset RMySQL.

In R, running
library("RMySQL")
gave me
... Error in if (utils::file_test("-d", MySQLhome)) break : ...

Setting MYSQL_HOME to C:\PROGRA~1\MySQL\MYSQLS~1.0
fixed the problem (using XP's System, Advanced, Environment Variables, System Variables).

References:
https://stat.ethz.ch/pipermail/r-sig-db/2009q2/000648.html
http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

Edit:
Except that only lets me load the library, connecting doesn't work now. Gave it the mysqllib.dll that comes with HeidiSQL, that'll work until mysql-5.1.47-win32.msi finishes downloading (copied the dll into a dir called "bin", set MYSQL_HOME to dir that bin dir was in).

Thursday, 20 May 2010

Fixing annoying Australia-centric google results: &gl=

Google seems to prefer giving me Australian results to some of my searches. This is often useful, but sometimes it's annoying.

It looks like adding "&gl=" to the request disables this feature.

Judging by my quick experiments (see below) it's using gl=au by default.













http://www.google.com.au/search?q=university australian results
http://www.google.com.au/search?q=university&gl= world results
http://www.google.com.au/search?q=university&gl=au australian results (same as australian results above)
http://www.google.com.au/search?q=university&gl=uk uk results


The following searches, however, seemed to have only minor variations, with no obvious country biases:

http://www.google.com.au/search?q=smtp+server+component
http://www.google.com.au/search?q=smtp+server+component&gl=
http://www.google.com.au/search?q=smtp+server+component&gl=au
http://www.google.com.au/search?q=smtp+server+component&gl=uk


The effects of the GL parameter seem to be different from using the

* The web
* Pages from Australia

options sometimes available on the left of a google search.

Also note, something I've done (I suspect clicking on the "The web" link) has changed the results I'm now getting for the GL-less seaches.

Oh, I found out about the parameter from http://www.searchmasters.co.nz/articles/204/country-bias-in-google-search-results/

Thursday, 6 May 2010

finding <? that aren't <?php

I'm using this pattern (in vim) to find "<?" that aren't "<?php":

\(<?\)\@<=\(php\)\@!

it uses zero-width look behind for the "<?" and zero width negative look ahead for the "php".

And using grep (in perl mode):

grep -P "\<\?(?!php)" -r .


Test cases:

YES <?
NO <?php
YES <?=
YES <? asdf
YES <?adsf
NO asdg



And a quick shell script for fixing a file (I say "quick" because it doesn't always work - e.g. if you have "<?/* comment */?>" it doesn't put in the extra whitespace you need after the "<?php"):

sed 's/<?=/MAGICaaxo3ohW/' | sed 's/<?php/<?/g' | sed 's/<?/<?php/g' | sed 's/MAGICaaxo3ohW/<?php echo/'