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
as.Date(x)


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


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
names(datx)
#gives: [1] "x" "sinx"

See also http://www.statmethods.net/input/datatypes.html for a nice brief intro to R's different structures.

ggplot2 is awesome

I like R, but R+ggplot2 is awesome.



library("ggplot2")
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
install.packages()
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)
}
tot/reps;
}
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. http://www.harding.edu/fmccown/R/#misc has a nice list of symbols.

Monday, 19 October 2009

.com.au 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 .com.au 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.


http://www.aussiehq.com.au/business/domains/
$59

https://manage.planetdomain.com/order/execute/multiDomainSearch?domainName=asdgasdfasdf&tlds=.com&tlds=.net&tlds=.org&tlds=.mobi&tlds=.asia&tlds=.biz&tlds=.info&tlds=.com.au&tlds=.net.au&tlds=.co.uk&tlds=.org.uk&tlds=.us.com&tlds=.us&tlds=.ca
$33

http://www.clickngo.com.au/domains-pricing.html
$59

http://www.webaccess.com.au/domain_names/home.html
$49.50

http://www.ddns.com.au/prices.php
$65

http://intaserve.com/
$27.95

http://www.domaincandy.com.au/pricing.asp
$99

http://www.domainregistration.com.au/
$127

http://theconsole.netregistry.com.au/order/execute/domainSearch
$26.97

http://www.mdwebhosting.com.au/myaccount/domainchecker.php
$18

https://secure.westnethosting.com.au/signup/stage2.aspx
$88

http://www.austdomains.com.au/pricing.html
$69

http://www.domaincentral.com.au/
$37.95

http://www.namescout.com/dot_au.asp
$27.45

http://www.melbourneit.com.au/cc/order/vieworder?&action=addtobasket&d-asdasdfasdf.net.au=asdasdfasdf.net.au&recheck=true&d-asdasdfasdf.com.au=asdasdfasdf.com.au&added_catalog=1895165,1895166,1895167,1895168
$140

http://www.domainbandit.com.au/site/domain_search.cfm
$66

http://www.tppinternet.com.au/domains/search-results.php
$99

http://www.safenames.net/DomainNames/DomainRegistration.aspx
?

https://ssl.smartyhost.com.au/signup
$40

http://www.cheaperdomains.com.au/hspc/index.php
$35

http://www.bottledomains.com.au/
$99

https://www.enetica.com.au/register.cgi?action=lookup&ludomain=asdfasdf&x=79&y=11&domaintype=.com.au&domaintype=.com&domaintype=.net.au
$69

http://www.domain8.com.au/
auction

https://www.instra.com/en/domain-application/login/step-01
login before price

https://www.anchor.com.au/domain-name-registration/domain_order.py
$69

http://www.explorer.net.au/show.php?f=pricing
$99

http://www.godomains.com.au/welcome/
$98

http://www.connectwest.net.au/termsconditions/tc.cgi?domainName=asdgasdgasdfg&tld=com.au
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, "172.16.17.18", "host", 1);
Query OK, 1 row affected (0.00 sec)

where "172.16.17.18" was the IP in the "Sorry, 172.16.17.18 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

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

Method
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.

Result
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).

http://www.cbltech.com.au/
logical $400-$1400
electrical $1000-$2000

http://www.technetics.com.au/data_solutions/data_recovery/index.htm
$300 - $2500

http://www.datarecovery.com.au/html/Hardware%20Recovery.htm
up to $2000