Journey's End

Sep 12
2014

Sep 12
2014

Adventures in Python Optimisation

Recently I found myself looking at the following piece of code and trying to optimise it:

from __future__ import division

import numpy as np

MagneticPermeability = 4*np.pi*1e-7
MagneticPermeabilityOver4Pi = MagneticPermeability / (4*np.pi)

def fieldfunc_py(p, q, moment):
  r = p - q 
  rmag = np.sqrt(r.dot(r))

  rdash3 = rmag …
ts=14:41 tags=[python,c,code,software]

Aug 26
2014

From Lyx/Latex to Word

This is sort of a placeholder post. Busy meeting a deadline, but this should help future Steve and anyone else when you need to turn your Lyx document into a Word document while keeping the format mostly sane. Broken, but sane.

  1. Export as Latex (plain).
  2. Run

    • latex <name of tex …

Nov 06
2013

Oct 16
2012

Sep 14
2012

Notes On Running Calibre On A Server

Calibre is a great tool, especially for converting between ebook formats. Here are some notes for getting it to run on a headless server.

  • The binary installer off the website works fine — ignore warnings about completion and desktop integration failing.
  • The installer will always pollute /usr/bin regardless of the …
ts=09:50 tags=[software,oss,linux]

Sep 14
2012

Acorn vs Pixelmator

Pixelmator wins hands down. Compared to Pixelmator Acorn is anaemic in terms of features and costs more than twice as much.

Disclosure:  I originally got Acorn as part of MacHeist, so I didn't pay full price for it. I did pay full price for Pixelmator.

Cheers,
Steve

ts=08:20 tags=[rant,software,osx]

Aug 23
2012

Jumpcut is dead. Long live Jumpcut

I used to use Jumpcut a long time ago, and was a big fan of it. At some point, I think around 10.5, it stopped working, and I let it go -- too busy at the time to poke at it.

Recently however my interest in it was piqued again …

ts=07:57 tags=[software,osx,oss]

Aug 19
2012

Jul 22
2012

2012-07-22

Over this weekend I have been working on faerii, a USB controlled RGB LED based around the ATtiny85.

Here is a picture of the breadboard prototype

faerii breadboard prototype
The ATtiny85 is mid centre, and immediately above it is the ISP header. To the left of the ISP header, near …

Jul 21
2012

Jul 21
2012

GNU readline with System Python (OS X 10.7)

By default system python loads "fake" readline (fake because it actually uses libedit) from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so. Even if you install readline (which goes into /Library/Python/2.7/site-packages), it will still load it, even if you fiddle …

ts=01:46 tags=[python,software,osx]

Apr 28
2012

PSA: Using Lyx With Native OS X Spellchecker

Lyx 2.0 and onwards on OS X will use spellchecker provided by the OS X. Note however that the language it will use for spellchecking is determined by the document's language setting, not your system language setting.

Furthermore, in version 2.0.3, if you change your document's language …

ts=11:48 tags=[lyx,software,oss,PSA]

Nov 15
2011

May 29
2011

git with multiple svn-remotes

Use git init to create an empty git repository, then edit .git/config to add the svn remotes:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[svn-remote "svn"]
url = file:///home/steve/code/svn-repos/foo
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
tags = tags/*:refs …

ts=00:15 tags=[svn,git,software]

May 18
2011

May 08
2011

Firehol and mDNS

Here is my firehol.conf that allows multicast mDNS packets through:

# define mdns so we will accept it
server_mdns_ports="udp/5353"
client_mdns_ports="5353"


interface eth+ multi
   policy return
   server mdns accept
   server multicast accept                                                                                                        


interface eth+ home src "\${home_ips}"
    server  all         accept
    client  all         accept

Initially I had the server …

ts=03:05 tags=[software,code]

Apr 17
2011

TIL: const, NSError, NSApplicationsupportDirectory

  • const char *foo; is not the same as char * const foo; The former declares a pointer to constant char, while the latter declares a constant pointer to char.
  • - [NSError localizedDescription] returns the object for key NSLocalizedDescriptionKey in the error's userInfo dictionary. I always wondered how to set it since there …
ts=15:34 tags=[software,code]

Apr 15
2011

ICBM: iOS OTA Distribution Webapp

Finding myself in the position of needing to distribute several apps OTA and unable to use the more well known OTA services like testflightapp.com due to client concerns, I made my own, ICBM.

ICBM is a small python webapp built using my favourite webapp framework,  bottle. You just put …

ts=12:44 tags=[software]

Mar 26
2011

Broken OS X Installers and How to Fix Them

The installers Ralink provides for some of their chipsets, like the RT2770 does something retarded: they attempt to unload a kext in a pre-install script, and when it fails the script fails and the entire install fails.

This means on a new machine, or one that never had the kext …

← Previous Next → Page 2 of 4