# C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

© 2006-2013 Andrew Cooke (site) / post authors (content).

## How I Am 4

From: andrew cooke <andrew@...>

Date: Thu, 5 Dec 2013 08:23:32 -0300

http://www.acooke.org/cute/HowIAm0.html
http://www.acooke.org/cute/HowIAm20.html
http://www.acooke.org/cute/HowIAm30.html

Now 13 months from being diagnosed, 12 months on Betaferon.

Unfortunately, things are currently (1) confused and (2) not as good as they
could be.

About 6 weeks ago I had a night when I couldn't sleep.  This was partly
indigestion from Pizza(!), but also "zaps" in my head every time I was about
to fall off.  At 4am I finally lost consciousness.  But there's a "rule" in MS
- a symptom that doesn't last 48 hours doesn't count - and the next night I
slept fine.  So it seemed to be a random one-off.

Then other weird things seemed to start happening in my head when I tried to
fall asleep - somehow my eyes would drift somewhere and my entire head would
"reset" in a completely undescribable way.  But maybe I was obsessing over
things that are actually pretty normal?  This wasn't a clear physical symptom.

Finally, a month or so after the pizza, I woke at ~3am with a huge jolt in my
head.  That was, finally, enough to get me to the doctor...

...who was as uncertain as I was.  So we got an MRI of my head.  The report
that came with the MRI said that there were new lesions.  That means the MS
hasn't stopped.  So we needed to move to a new drug.  That's NOT good, because
we're moving from the old, tried and tested drugs to newer, more potent
options, with much worse side-effects and risks.

But that's what seemed to be needed.  So off I went to my "other" doctor, who
is connected to the public health service.  Which is when things got
complicated.

She looked at the scans, and couldn't see anything significant (and she showed
me, and I couldn't, either).  So she was not all convinced that changing drugs
was worth the risk.

And that, more or less, is where we are now.  Since then I have had an EEG,
whose results I will pick up on Friday, and the second doctor has talked to an
expert in analysing images, but hasn't, yet, talked to the first doctor.

Oh, and my head is actually much better this week!  I am still getting
twitches, but less zaps and resets.  This isn't s surprising - they appeared
to be small lesions, and the brain has an easier job healing than the spine
(more dimensions to reroute in).

What now?

Well, what *I* want is consensus in my "team".  Either option - changing drugs
or not - has risks.  More importantly, for the long term, I need a way to get
these two doctors to talk.  Unfortunately both are busy and I don't want to
get caught in the middle, playing "he said / she said".  So for the moment I
need to be patient.  I have another appt with the second doctor on Friday when
I will pressure her again.  Then I return to the first doctor on Monday in the
hope he has experience with this and can help.

Otherwise, my symptoms from the first outbreaks continue to progress very
slowly.  My right hand feels slightly better - it's now less "pins and
needles" and more just "slightly asleep and stiff".  My running route just
increased slightly (3.6k at 8m15s per mile) and my legs feel stronger.  The
pins + needles I used to have on the sole of my left foot has gone, but
there's still something in the toes.

My chest doesn't seem to have changed, though - I can still feel a "bar" if I
sleep on my front - and while my back often feels much better the sides below
my arms felt "tight" today.

Hello to future self.  Keep on rockin'

Andrew

## Previous Entries

### Chilean Charity Supporting Women

From: andrew cooke <andrew@...>

Date: Wed, 4 Dec 2013 09:39:49 -0300

This was mentioned in an article in the paper this weekend.  I am out of touch
with such things so when I feel guilty enough about my life to make a donation
to someone I can never remember who to give it to.  These people seem to be
doing decent work.  http://www.fondoalquimia.org

Andrew

### Doing SSH right

From: andrew cooke <andrew@...>

Date: Wed, 4 Dec 2013 09:36:16 -0300

When you use ssh you should really do (at least) two things:

remote .ssh/authorized_keys file).

The first of these makes your life easier because you no longer have to type
passwords.  So I did it long ago.

But the second is a nuisance because you have to type a password (again) every
time that you use ssh.

Of course, there is a solution to this problem.  You can run a program - an
"agent" - that remembers the key for you.  This program is called ssh-agent.

At this point I must admit that I don't understand how to configure ssh-agent
in OpenSuse 13.1.  It doesn't seem to run by defeault, yet after you use it
manually once it does seem to be started by default in future.  And when it
runs automatically it is somehow connected to dbus and X.

Even though I don't understand those details, it's clear why it's connected to
X - that's something that starts once per user on the machine and so is a good
place to start the agent.

Unfortunately, that means that the agent is only visible to sessions running
within X.  Which means that my scripts to do things like manage my blog from
email no longer work.

Fortuately there's an easy fix.  Everything works with environment variables,
so you can dump those to a file when you start X and then load them in
scripts.

Everything is described at
http://www.stderr.nl/Blog/Software/Linux/ScreenAndX.html and it works
beautifully - just place the code that they use at the prompt inside the
script that uses ssh.

Andrew

### Festival of Urban Intervention

From: andrew cooke <andrew@...>

Date: Wed, 4 Dec 2013 08:29:00 -0300

http://www.hechoencasa.cl

Nothing near me (yet) - http://www.hechoencasa.cl/mapa

Andrew

### Neat Idea - Wormholes Provide Entanglement

From: andrew cooke <andrew@...>

Date: Tue, 3 Dec 2013 22:32:57 -0300

Seems like it runs around the idea of action at a distance.  Cute.

Andrew

### Simple Encryption for Python 2.7

From: andrew cooke <andrew@...>

Date: Sun, 1 Dec 2013 20:09:27 -0300

Thanks to https://github.com/d10n the simple-crypt library now works with
Python 2.7 as well as 3.

When I originally wrote simple-crypt, it was intended as a "poor man's
keyczar", which didn't exist for Python 3.  My plan was to retire simple-crypt
when keyczar moved to 3.

But it seems there's a real demand for simple-crypt, as something simpler than
keyczar.  Now, to some extent, I think that's people being lazy.  They
*should* use keyczar, even if it's more work.  But maybe that's not
everything.  And people continue to re-implement this kind of code, getting it
hopelessly wrong (see regular questions on StackOverflow).  So simple-crypt is
staying, and expanding...

Andrew

### Tecnofull (Lenovo Support) Is Fucking Useless

From: andrew cooke <andrew@...>

Date: Sat, 23 Nov 2013 18:16:57 -0300

My X220 died.  A search on the web showed that http://www.tecnofull.cl/ were
authorized support.  And they had offices at the end of my street.  Great.

They diagnosed (after 5 days) the following issues:

* A broken power socket (awful design with X220 and the socket at the read
- every time you pick it up, you put load on that point)

* Dirty and needing new thermal paste (my daily machine for many years
and was overheating)

OK, so far not so bad.  Anyone can forget to check BIOS and the other points
were fine.  So I asked for the first two to be repaied.

A week later, it was ready, so I paid and brought it home.

Is should have said that I left it without disk or battery (less to lose).  So
when I got home I installed the disk.  Or tried to.  I couldn't because some
cables were in the drive bay.

So I took it back.  And they claimed to fix it (I think they just pushed the
cables back and forced the disk in, because there wasn't time to take things
apart, but maybe I am just slow).

When I got it home again, in a more relaxed moment, I realised that the screen
hinges wobbbled.  So I took it back.  And they said that they could tighten
the case screws a little, but that it was normal (and my fault for the machine
being dirty originally, although the logic there missed me).

When I got it home again, it wouldn't power up.  Taking it back to the shop,
the receptionist mashed the power buttong and it worked.  It seems like the
power button is damaged and needs an incredible amount of pressure.  But they
say it's normal.

So I took it home again, and now I've started it again and wifi is dead.

I give up.  I'm not taking it back again.  They're clearly incompetent and do
more damage each time the have the machine.  Instead, I'll rescue data from
the disk, use it on ethernet, and get the X240 1080p when it's released.

But if you don't have money to buy a new machine you might want to avoid these
people.

Andrew

### The Neuroscientist Who Discovered He Was a Psychopath

From: andrew cooke <andrew@...>

Date: Sat, 23 Nov 2013 17:22:25 -0300

This is surprisingly touching, and a convincing argument for the importance of
nurture v nature.

http://blogs.smithsonianmag.com/science/2013/11/the-neuroscientist-who-discovered-he-was-a-psychopath/

Andrew

### Interpolating Polynomials

From: andrew cooke <andrew@...>

Date: Sat, 23 Nov 2013 16:30:08 -0300

I've implemented this by hand so many times for quadratics - for example
finding the peak of a correlation function - but just a month or so ago
someone at work asked what I was doing and apart from deriving it from basics
I had no "go look at this in Wikipedia" response.  Well, here it is -
Neville's Algorithm http://en.wikipedia.org/wiki/Neville's_algorithm

Andrew

From: andrew cooke <andrew@...>

Date: Fri, 22 Nov 2013 00:31:26 -0300

After a series of misunderstandings, mostly on my part, I ended up with a
Bottlehead transformer that I had no use for.  Returning it (from Chile)
seemed like a waste of money, so I bought the kit that went with it.  Which
turned out to be the Crack headphone amplifier.

The kit was great.  A real pleasure to build.  Everything included and
excellent instructions.  I don't think there was a single error in the
instructions, although I would suggest:

* Reading ahead and changing soldering order if it makes things simpler
(nothing critical, perhaps just my taste)

* Measuring wire lengths yourself rather than using the lengths given (you
can't for the twisted pair; the value they give there is very generous)

* Thinking about wire colours yourself.  The colours chose were strangely
inconsistent at times.  This doesn't change the sound, but makes it harder
to "read" and check the circuit.

perfectly.

So I have a valve headphone amp.  Unfortunately it's intended for high
impedance headphones and the highest I have are the not-very-high AKG K701s.
So I tried those.  And actually, they don't sound that bad.  There's
significantly more bass (and low mids) than there should be, but since the
K701s have quite a lean sound that isn't altogether unwelcome.

On a first listen, what struck me most, after the bass, was the stereo
imaging.  I haven't made a direct comparison, but it seemed significantly
better than what I am used to (through either Music Fidelity V-Can or a Roksan
K2).  In fact, I don't normally pay much attention to stereo positioning - I
noticed it here because it "jumped out" (in fact, I was listening to a live
Paul Motian recording and thought someone was talking behind me; very
disturbing)

Next I am thinking of connecting it as a pre-amp.  As far as I can see, if I
feed each channel to a 220 / 22 ohm divider, and take the signal from across
the 22 ohms, it should (1) be about the right level and (2) have about the
right output impedance.  It's kind of a weird way to do things (a lot of extra
work), but since it's there anyway...

Andrew

### Breaking RC5 Without Rotation

From: andrew cooke <andrew@...>

Date: Tue, 19 Nov 2013 00:51:58 -0300

This is the first task in Scheneier's DIY course on block ciphers -
https://www.schneier.com/paper-self-study.html - so presumably it should be
easy.

The task is for 8 rounds.  I managed zero and was stuck at 1.  Then this
evening I had a neat idea for how to do 1 round - you can see the test at
https://github.com/andrewcooke/BlockCipherSelfStudy.jl/blob/master/src/Experiment.jl#L5
- but there is no way I can scale that to 8 rounds.

So I went to bed.  And as soon as my head hit the pillow, I got it (I think /
hope).

The frustrating thing was, without rotation, RC5 is "linear".  Hence it should
be easy.  That's what everyone implies.  But it wasn't clear to me what
"linear" meant.  In particular, RC5 combines addition (mod 2^32) with XOR.
And XOR is addition mod 2.  And so I was thinking - how can I make those work
together?  I imagined my little spinnning clock hands, which is pretty much
the limit of my intuition for modular arithmetic, and it struck me that I can
fit one inside the other!

All that means, really, is that I start with the least significant bit.  That,
I can solve for (I think!).  And with that, I can do the next bit (the carrys

So I am writing this down now so I can go back to bed without worrying I will
forget...

Andrew

PS Maybe I am too optimistic.  Why does he limit it to 8 rounds?  Need to
sleep, must stop thinking...

### Big Balls of Mud

From: andrew cooke <andrew@...>

Date: Sat, 16 Nov 2013 16:49:43 -0300

Readable, pragmatic, wise, useful discussion of practical software development
- http://laputan.org/mud/

Andrew