Saturday 12 December 2009

Dodgy ram

After effects of running a computer with some seriously broken RAM sticks:

Thursday 19 November 2009

R and Datetimes and stuff

You may have figured out at this point that these posts' primary purpose is so I don't have to figure out this stuff again if I stop using R for 6 months.

Anyway, if you've got some strings and you want dates, use

But if you want datetimes (i.e. don't want to lose the time component), use

Also, subset is nice:
subset(dat1, (t > '2009-01-01') & (t < '2009-01-05'))

Create a frame:
#make up some data
x = seq(-2*pi, 2*pi, by = 0.05)
#create the frame
datx = data.frame(x=x)
#add another column
datx$sinx = sin(datx$x)
#show the columns
#gives: [1] "x" "sinx"

See also for a nice brief intro to R's different structures.

ggplot2 is awesome

I like R, but R+ggplot2 is awesome.

x = seq(-2*pi, 2*pi, by = 0.05)
x1 = x + rnorm(length(x))/10
qplot(x, sin(x1), color=rgb(abs(sin(x)),0,1), geom = c("point", "smooth"))

Requires that you
ggplot2, of course.

I'm currently working through Getting started with qplot (pdf).

Wednesday 18 November 2009

The R Project for Statistical Computing

I've been playing with The R Project for Statistical Computing. I quite like it.

Here's a few of the first things I did, just playing around:

x = seq(-pi, pi, by = 0.01)
plot(sin(x), col = rgb(abs(sin(x*3)), 0, 0), cex=.2+3*abs(sin(x)), pch=16)
points(cos(x), pch=16, cex=.5, col = rainbow(length(x)))

n = 10000
breaks = 100
plot_count = 5
cols = rainbow(plot_count)

plot(x = c(), xlim=c(-0,1), ylim=c(0,3), main = "distribution of random sums", xlab = "Sum of N random numbers between 0 and 1/N", ylab = "density")

runifrep = function(n, reps) {
tot = 0;
for (i in 1:reps) {
tot = tot + runif(n)
for (i in 1:plot_count) {
a = hist(runifrep(n, i), breaks=breaks, plot=0)
lines(y = a$density, x = a$mids, col = cols[i], pch=3, cex = .1, xlim=c(-4,4), lwd = 3)

Note that cex is symbol size, pch is symbol and lwd is line width. has a nice list of symbols.

Monday 19 October 2009 registration prices

I just spent half an hour looking at every auDA Accredited Registrar's website, looking at how much it costs to register a domain.

Sometimes they actually listed prices, but often the easiest way was to just search for a random domain and wait for them to tell me what it would cost. It's just a quick survey, and it's quite possible that I got some of them wrong. All the prices should be for 2 years, but I didn't read the fine print too carefully. I expect some of the URLs won't work without the POST data, but they're really only there as hints for the auDA list.
login before price
TOC before price

Tuesday 14 July 2009

Windows Mobile Emulators

I was looking for a touchscreen mobile emulator to test using Lazarus to compile for my mobile. Microsoft's Windows Mobile 6.1.4 Professional Images (USA).msi seems to fit the bill. Note that for some reason "Professional" means "Touchscreen" and "Standard" means "Keypad".

This post, Installing and running Windows Mobile emulators, was useful for setting up networking.

And, of course, the Windows CE Interface page on the Lazarus wiki was useful.

Sunday 5 July 2009

Pavement Marking Trial

I saw this odd road marking on the way to work. Guess what it means (explanation after the break):

Accessing your Drupal website after banning your own IP

Warning: This solution was derived by guessing, not by reading manuals. But it worked for me. It also assumes some familiarity with SQL.

in short: Connect to your drupal DB and edit the `access` table.

The command I used was:

mysql> insert into access values (0, "", "host", 1);
Query OK, 1 row affected (0.00 sec)

where "" was the IP in the "Sorry, has been banned" message.

Tags in Drupal blog

I just figured out how to enable tags in this Drupal blog - it's not a blog setting, it's controlled by the taxonomy module - Home � Administer � Content management > Taxonomy.

Created a taxonomy, called "tags" with the tag flag set which I've applied to everything (including blog posts). Now I get a "Tags" field when creating blog posts. Oh, and note that tags need to be comma separated - space separation looks like it's working but actually just generates a single tag for all the words.

Sunday 21 June 2009

Chocolate and Turkish Delight Dessert Pizza

1 small pizza base
2 tbls strawberry jam
100g cooking chocolate
100g turkish delight

1. blind bake the pizza base if it isn't already cooked
2. spread the jam on the base
3. break up the chocolate and turkish delight and spread over base
4. cook in a 200degC oven for about 5mins to melt the toppings. warning - moltern sugar is hot.

It works, but the result is nothing spectacular. Someone suggested coconut might help tone down the overwhelming sugariness - I might try that next time.

Monday 15 June 2009

HDD Data Recovery in Australia

Someone asked me to look at how much it would cost to recover the data on a broken laptop drive. Here are the results of my quick phone survey (they don't put the prices online, of course).
logical $400-$1400
electrical $1000-$2000
$300 - $2500
up to $2000