Sunday, December 27, 2009

Finding Build Dependencies

I only just found this:

sudo apt-get build-dep blender

What a great trick.

Sunday, December 20, 2009

Ubuntu, OpenCL and NVIDIA

To be able to compile OpenCL programs on Ubuntu with an nvidia card:

Find a driver with OpenCL support: 195.17 works (but later ones do not). Download it by searching nvidia's site, or try here.

This step is very important: Disable Ubuntu's hardware drivers if you have enabled them. System -> Administration -> Hardware Drivers.

sudo apt-get install build-essential

Now ctrl+alt+F1 to switch to a terminal; sudo stop gdm to kill Xorg; cd ~/Downloads; chmod 700 cudadriver*; sudo ./cudadriver*. Accept all the default options, including installing 32bit libs if you're on a 64bit system and resetting your xorg.conf. I had to copy /usr/lib32/libglut* to /usr/lib. sudo apt-get --reinstall install freeglut3 freeglut3-dev. sudo start gdm. You're all set.

Wednesday, December 02, 2009

Things to do

Lyx needs GUI support for document macros.

I say this because I've seen several times now the need for a user defined paragraph style, such as "Example" or "Exercise" or "Answer". This could potentially be solved by having a style editor? This might turn out to be a considerable amount of work.

Also, however, it needs simple replacement macros. An example I use a lot is \termdef{index item} which makes the index item text bold and adds an index entry. This kind of speed is not available to Lyx users. I suppose this is more of a variation on the noun/emphasis theme - user defined versions of these with custom Tex macros would be sufficient for this usage.

The Next Great Copyright Battle

2010 - Ebook readers become common.
2011 - Book sharing websites become popular.
2011 - Copyright infringement of books skyrockets. Seriously, you haven't seen anything yet.
2012 - Ebook makers build in or software update to automatic copyright protection for non-DRMed books, with phone-home functionality. "Make an example" lawsuits by publishers' associations begin.
2012 - Ebook readers without the ability to phone home enjoy a surge in sales. Crackers teach how to destroy aerials or crack firmware of popular models. Ebook readers stop working unless they can check in with their maker regularly.
2013 - ??? Who will win? Free Culture or Big Business?

Unlike musicians, book authors cannot make a lot of money out of performances. They (and their publishers) currently depend heavily on book sales to earn money.

One way to severely reduce piracy would be to make the books very cheap, like 1/100th of a day's wages. This would make the few minutes spent finding books for free uneconomical. If this was the case, DRM would almost be unnecessary. This doesn't work for smaller-market books like textbooks.

Perhaps a collaborative effort will produce good cc textbooks by then anyway, here's hoping! Actually it looks like there are quite a lot of good texts already, they just need to get noticed!

An alternative model for textbook authors is that used by Sean Carroll. Lecture notes are posted online, and satisfy course requirements; students who want a more complete treatment can buy the expanded textbook. I think this is a good model, but it doesn't work for fiction.

Thursday, November 26, 2009

Thritical Cinking

So. I haven't been able to avoid a few Glen Beck stories in the online media recently. It made me think.

Memes and attitudes are often forced on us, by parents, friends or the things we read. Once we get into a certain point of view, we like and remember things that agree with that point of view - the memes* become self-reinforcing. (Humans like identifying patterns. I'd even go so far as to say it's the main component of intelligence.)

So our point of view often depends on which part of society we come from. Who, then, makes up points of view in the first place? Leaders. Leaders are often strongly biased one way or another by existing points of view and can make (very) bad judgements, or judgements that are good for them in the short term but ultimately very bad for {[many] other people|those around them|themselves|society}. **

All this leads to ideas that are more trouble than they're worth becoming widespread.

The best defence is critical thinking. Analyse ideas yourself, carefully. Check them as much as you can. There doesn't seem to be enough of that going around these days. Internet culture (tl;dr) doesn't encourage it.

Censorship is the antithesis of encouraging critical thinking, and is *very bad*.

* I apologize for using this word repeatedly, but I couldn't think of a better way of putting it.
** The reason for the bad decisions is often extending a previously recognised pattern into a domain where it doesn't apply.

Saturday, November 21, 2009

Picnic Food

So,

I want more picnics. I'm writing things down now so next time I don't have to think up a list of food.

strawberries/other berries/nuts + chocolate dip / yoghurt / hot nutella
dry biscuits / bread + soft cheese / hard cheese / dips
sliced ham / twiggy sticks / cabana sausage
watermelon / sliced apple / sweet oranges
small double-layer sandwiches - mayonnaise egg tuna ham gherkins beetroot
hot chicken / potato salad / sausage rolls

Friday, November 13, 2009

Reminder: agent-based simulation.

Thursday, November 12, 2009

Geant4 and SRIM

So I've spent a while trying to get Geant4 to do ion implantations similar to SRIM. Turns out Example TestEm7 models a particle (can be an ion -- see the included C12 macro) impacting a block of material, and even includes some extra physics to make the "low-energy" ion calculation more accurate (screened nuclear stopping, custom-defined physics list standardNR, by Mendenhall and Weller). It calculates the predicted range of such ions.

Using Geant4.9.3.b01 and the standardNR physics list, my quick accuracy test gave an ion range for P-31 at 10keV (very low energy in Geant4 terms) into NIST-parameterized Si of 15nm versus SRIM-2008's 17nm (monolayer mode). Both give rms values of about 5-6nm.

To get energies and positions of transmitted particles requires some editing of the C++ code.

Why am I doing this? SRIM only does layers of material, I'm trying to model a more complicated geometry.

Thursday, October 01, 2009

X Sharing Screens

Found this in my archive, I dunno where from..

When I pop up with my laptop to discuss with a colleague, after a while I might do on their computer:
xhost +mylaptopname

and on my laptop I do:
x2x thecomputername:0 -west

Then suddenly my mouse can go over the two computers, my keyboard works on both as well, and I can even copy-paste between the two computers. It looks like the two computers got united. In a flash, newbies get a new idea of what means unix and X ;-

but I thought it was worth reposting.

Actually those commands don't quite work. On your laptop, run
sudo apt-get install x2x xhost +desktop-ip
And on the desktop,
ssh laptop-ip -XC x2x -west -to :0.0
Your desktop now controls both screens.

Sunday, September 13, 2009

Ubuntu Jaunty seems to have just updated its wireless network and broke my settings. Had to change the mode from Infrastructure to Ad-Hoc in the connection settings.

Friday, September 04, 2009

Techdirt

This is a bit of an e-vote for TechDirt. I don't agree with everything those guys say, but lately they've had several in-depth articles and they research their stuff well and are honest when they're wrong.

However, I was a bit annoyed at them dissing CSIRO's wifi patent. I mean, fine, the patent system is heavily abused, but the suggestion that CSIRO should have become a wifi device manufacturer instead of licensing out the technology is a bit ridiculous. And they did license it -- the companies involved just tried to weasel out of paying up once they'd learned everything they needed.

Edit: revoked. No longer a fan.

Monday, August 31, 2009

Last Piece Puzzle

So I was away on holiday and I found a puzzle called the Last Piece Puzzle. Basically trying to arrange tetris-like pieces to fill a square with no gaps.

I wrote a program to solve it, which was going to take about thirty years to try every combination. The second attempt found all possible solutions in about 2 minutes.

The difference between the two algorithms is what gets me - it's so subtle. The first algorithm picked a piece and then tried every position on the board for that piece, then once it found a position, it moved on to the next piece. The problem here is that there were often holes left behind that no piece would fit into, so it spent a lot of time trying to solve a board that obviously couldn't be solved.
The second algorithm was only slightly different - instead of trying the pieces in order, try to fill the squares in order. This way there were almost no holes (or the holes were found without too much extra effort) and the algorithm turned out to be hugely faster.

There was a contest to solve it in lisp - the fastest solution there was 0.3 seconds. My second attempt copied the winning algorithm there.

My solution is also floating around.

In total, there are five possible solutions:

Tuesday, July 28, 2009

Atom printing

Just went to the sweetest talk about 0.2A (1A lateral) resolution atomic tomography. Basically kick atoms off a (needle) surface with an electrical pulse or laser and then accelerate them into a position sensing detector. The time-of-flight gives you the mass-to-charge ratio so you can tell element and isotope. As the electric field spreads out almost radially away from the needle you get a lot of magnification and can tell the originating position quite accurately.

Of course, this imaging method destroys the sample.. but wouldn't it be cool if you could do it in reverse to place individual atoms into an object? It would be difficult to say the least, but the result would be awesome. Not only that, but it could be a quite automatic process.

You could have different print heads for different elements. Perhaps even the same thing in reverse, a laser that kicks atoms off the "print head" and then the freed ion travels along the electric field line and hits the "needle". Of course, you would have to ensure that the ion got kicked off with a small velocity or you would have quite bad lateral resolution. This low velocity thing would probably result in the ion just reattaching to the material. So this is probably hard to do, because the whole point of using a needle is presumably so as to get strong electric fields (and thus high acceleration) when the ion is first ionised. Perhaps this is why this technique won't work.

But what if you had two needles? Boot the atoms off one, and attach them to the other. Ensure that only certain atoms land by having a (macro scale) aperture between them and detect when atoms land.

Monday, June 22, 2009

Jaunty

Things to fix for Ubuntu Jaunty install on an M1330 (so far):

Set Source in synaptic to whatever ISP I'm currently using (avoid quota usage)

System->Administration->Hardware Drivers, enable latest

Install packages:
texmaker texlive-math-extra
blender inkscape
idle
compiz-fusion-plugins-extra compizconfig-settings-manager

Audio (crackles instead of proper sound):
change /etc/modprobe.d/alsa.conf
add line
options snd-hda-intel model=3stack
as my laptop has three audio ports
(ref: https://help.ubuntu.com/community/SoundTroubleshooting )

CD/DVD (disks don't mount properly):
add line to /etc/fstab:
/dev/sr0 /media/cdrom0 iso9660,udf user,noauto,exec,utf8 0 0
and make sure the other lines match the order of is09660,udf.
(ref: http://osdir.com/ml/ubuntu-users/2009-05/msg00352.html)

HDD power management (hd spins up/down constantly):
add
/dev/sda {
apm = 255
}
to /etc/hdparm.conf
and change /etc/acpi/resume.d/*hdparm* and /etc/acpi/start.d/*hdparm* :
change all three-digit numbers (128, 254) to 255.
(ref http://www.gatzet.com/fixing-ubuntu-harddisk-power-management-bug.html)

Closing the lid of the laptop should make it sleep:
System->Preferences->Power Management
On AC Power, When Laptop Lid is Closed, Suspend.

Firefox extensions:
flashblock chatzilla

Configure Inkscape to use SVG properly.

Saturday, February 07, 2009

Victoria Electricity Generation Water Usage (part 2)

Just the Hazelwood plant this time:

In 2005 the mine used 1.31 MegaLitres of water for every GigaWatt hour of power generated.
The plant generates a peak of 1.6GigaWatts. There are 8760 hours in a year. If the plant was running at peak capacity this would equate to (1.31ML / GWh) * 8760h = 11475 ML per year. At an average of half capacity this is still 5 GigaLitres per year.

The Thomson dam has a capacity of about 1000 GigaLitres.