September 8th, 2011
Well, I doubt many people have this problem. For some reason, on a server I use the installed Emacs version is Emacs 22, not the current Emacs 23, and I ran into the problem that I was expecting transient-mark-mode when it was in persistent-mark-mode, as I figured out here. However, it’s the kind of solution you don’t easily find when you don’t know Emacs terminology (mark, point, region, active), so an attempt to make this more googleable especially for Emacs newbies:
The symptom was that in an Emacs buffer, after hitting Ctrl and the spacebar (C-space) and then moving the cursor, I was expecting the text in between (between mark and point) to be highlighted (indicating an active region), but the region was not highlighted and not active. Accordingly, then doing a replace-string and expecting it to replace text in the region that is “normally” (in Emacs 23) highlighted did not replace anything. (I was, however, able to cut and paste (kill and yank) the same region. In Emacs-speak, the region was not active. Another symptom: after M-x replace-string where I normally see “Replace string in region” in the minibuffer, it now only said “Replace string”.
The solution:
M-x transient-mark-mode
to enable transient-mark-mode and get the expected behaviour (this command toggles it on and off).
Posted in Emacs | No Comments »
August 30th, 2011
I followed these instructions (I did not get any errors).
sudo aptitude install likewise-open5
Connect:
sudo domainjoin-cli join kclad.ds.kcl.ac.uk LOGIN
Reboot.
Add the line winbind use default domain = yes to the file /etc/samba/lwiauthd.conf
Reboot.
Check if you are connected:
sudo domainjoin-cli query
I now seem to be connected whenever I am on the KCL network.
Leave:
sudo domainjoin-cli leave
(I don’t explicitly leave. It disconnects when I disconnect from the network.)
Posted in Linux | No Comments »
August 19th, 2011
Some of the network printers at work do not show up when I try to find them via the Ubuntu GUI System -> Administration -> Printing but I can find them via the command hp-probe. Here at work the list returned by hp-probe is long and I know the names I’m looking for start with “printer0″ so I do
hp-probe -bnet | grep printer0
This returns lines that contain a URI like this
hp:/net/HP_LaserJet_P3005?ip=159.92.99.39
Copy that and go back to the GUI where you paste it under “Enter device URI”
Posted in Linux | No Comments »
August 8th, 2011
I had a longish ggplot command and kept getting the error:
invalid argument to unary operator
It happened when I was specifying custom labels with scale_y_continuous but it turns out this was irrelevant and it hinged on a line break. It turnsout (at least when stepping through the code with ESS in Emacs using C-c C-c, bound to ess-eval-function-or-paragraph-and-step, you need to have the + of tying different ggplot bits together on the end of the preceding line.
This won’t work:
ggplot(longdata, aes(x=x, y = y))
+ geom_jitter(alpha = 0.6)
This will:
ggplot(longdata, aes(x=x, y = y)) +
geom_jitter(alpha = 0.6)
(Or, put it all on one line).
Posted in R | No Comments »
December 14th, 2010
I came across flexSURVEY, which looks similar in idea to my Template 2.0 for web experiments, except flexSURVEY uses PHP (Template 2.0 is pure JavaScript up to the point of data submission at the end).
I haven’t tried it, but it looks like it could be a nice way to do some speedy PHP-based questionnaires.
Posted in Uncategorized | No Comments »