Archive for May, 2007

Toshiba Satallite screen brightness

I’m having some battery power issues with my notebook, and being able to adjust screen brightness would be nice too.

It’s a phoenix bios model


Issue discussed on ubuntu forums

Advertisements

Comments (1)

Octave

Load data from a tab delimited file (octave sizes the array for you). The semicolon supresses the console output:

a = load sphstate.00001;

Copy just the first column into another matrix. The two arguments in the brackets are row,column ranges. E.g. (1:5,1:5) is a slice with the first five rows and first five columns.

b = a(:,1)

Plot the first two columns against each other:

plot( a(:,1), a(:,2), ‘@’)

The @ specifies point style.

Plot a 3D surface:
[rho,p] = meshgrid(0:0.05:2,0:0.05:1);
t=zeros(size(rho)(2),size(p)(2));
t = (1./rho) .* (1 .- (rho ./2)) .* (p .+ (2 .* (rho .** 2)));
mesh(rho,p,t[0:2])

Leave a Comment

Scary potential HD issue

This one has me a little worried about the potential early failure of my notebook’s HD.

http://www.thinkwiki.org/wiki/Problem_with_hard_drive_clicking
http://paul.luon.net/journal/hacking/BrokenHDDs.html
https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695

I expect it will be covered by warranty regardless, but I could do with avoiding the inconvenience of warranty claims and replacement downtime.

I’m trying the least aggressive power management setting:

hdparm -B 254 /dev/sda

Leave a Comment

Installing Maple on Ubuntu

I have nothing to add to this excellent fix at:

http://ubuntuforums.org/showthread.php?t=283473

Leave a Comment

Perl

I’ve decided to dump Perl for intermediate data analysis and random scripty jobs in favour of python. Python just seems more polished, a little more structured (which is good for me, because I don’t want to have to be an expert), and much better support for numerical work.

For numerical work, Perl Data Language (PDL) looked pretty much essential, but the syntax was alien to me, and the benefit not particularly clear.

Anyhow, here are my, possibly completely useless, perl notes.

What version of perl is installed?
perl -v
A single unit of data in perl is the scalar. A list is an ordered group of scalars, a hash is an unorderd, indexed group of scalars.

A scalar is a single piece of data, of no specific type. A scalar starts with the character $.
Assignment is indentical to other modern languages.

Single and double quoted strings are treated differently wrt to what needs to be escaped. Strings need to be enclosed in quotes to be assigned to variables.

Concatenation of arithmetic with text is performed as follows: print "product is" . ($number1 * $number2) ."\n";

. is the concatenation operator.

It appears declarations must take place before executable statements.

Array indices start at zero. Arrays (lists) start with the & character. Arrays do not have to contain the same types (you can mix strings and numbers in a list!). Access arrays with c-like syntax $name[index]. The $ sign needs to be added to indicate you are accessing a single variable.

Operations can be performed inside an assignment:

@number = (2*2, 3*3, 4*4);

A hash is indicated by the % symbol. Elements in a hash are name-value pairs. E.g. name,bob,phone,9397890, etc..

Hash initialisation:
%particle = (
‘index’ => ‘Bob’,
‘speed’ => 89,
‘test2’ => 76,
‘test3’ => 0);

references:
http://perl.about.com/od/gettingstartedwithperl/a/datatypes.htm

Leave a Comment

Python, CFD and SPH variants

I found a paper about python for CFD at http://datamining.anu.edu.au/~ole/pypar/pr_scipy04.pdf

The python material was interesting, but what is more interesting is that they are using a “vortex” method, which has some uncanny similarities to SPH. Interesting to follow this up and see whether this branched off from the ‘mainstream’ SPH, or is another case of independent development.

Leave a Comment