Monday, 8 February 2010

Drupal, Zen, Nice Menus

If you're using trying to use Nice Menus to make a Zen subtheme for Drupal, you might need to remove the "overflow: hidden" from the navbar block in layout.css if you're having trouble with your menus not working or only partly showing up.

Here's a quote from layout.css (the comment is not mine):

#navbar
{
overflow: hidden;
/* May need to be removed if using
a dynamic drop-down menu */
}


Monday, 1 February 2010

Fragments of CSS


a:hover {color: green; text-shadow: #FF0000 1px 1px 3px}


Sunday, 17 January 2010

Adding navigation links to drupal

The menu item I was looking for is Home � Administer � Site building � Menus >Primary links

Friday, 8 January 2010

Opera Mobile 9.5 Tab Limit

Opera on my mobile limits me to two tabs.

The trick to fix this is go to opera:config and search for 'tab'. Then change the value, save and restart.

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