FIX:CUDA on Debian Jessie

Hopefully a super quick one (while I’m procrastinating from procrastinating). Debian Jessie is a lovely operating system until you try and do anything with it. Lots of Package deprecations etc etc etc. Anyway, I’ve got a history with GPU stuff and I’ve been playing with integrating it into some of my research, but in a bout of insanity I decided while I’m over in Liverpool (for another 4 hours) to wipe my old workstation and bring it over from Ubuntu 15.04 to Jessie (which I’ve been using on my main laptop for a while now). ...

Andrew Bolster

Generating a unit 3 vector in Python (Uniform Spherical Projection)

Quick one more as a reminder to me than anything else. As part of my PhD work I’m building different behaviours for virtual submarines. I’ll be explaining some parts of my work in a separate post, but basically, I needed to random walk. Random walk in 2 dimensions is easy; pick two random numbers, go that way. Unfortunately doesn’t work that way on a spherical surface So to make things easier, I stole this StackOverflow answer from dmckee and tidied it up a bit for my purposes. (Assuming everyone else is like me and does import numpy as np) ...

Andrew Bolster

Git Split Repository With Commit History

Thesis submitted, Viva cleared (with minor corrections) but this post isn’t about all that… Simple one; how do you go from one monolithic project repository to multiple respositories without losing all that tasty tasty commit history? #! /bin/zsh # # git_split.sh Current_Repo username new_repo {list of files/folders you want to keep} # Copyright (C) 2016 bolster <[email protected]> # # Distributed under terms of the MIT license. # BASEDIR=$1 INITDIR=`pwd` NEWREPO="[email protected]:$2/$3.git" shift 3 FILTER_ARGS=$@ TMPDIR=`mktemp -d -t ${BASEDIR}_XXXXXXXXX` echo $BASEDIR $TMPDIR $FILTER_ARGS cp -ra $BASEDIR/. $TMPDIR cd $TMPDIR git filter-branch --index-filter "git rm --cached -qr --ignore-unmatch -- . && git reset -q \$GIT_COMMIT -- $FILTER_ARGS" --prune-empty -- --all && git repack -a -d -f --depth=250 --window=250 && git remote set-url origin $NEWREPO && git gc && git push -u origin master ls -latrh cd $INITDIR rm -rf $TMPDIR YMMV, IANAGG, No refunds, Safety not guaranteed ...

Andrew Bolster

Hackaday Unconf Dublin Talk: Socially Accessible Computing

Intro As part of the fantastic Hackaday Dublin Unconference in the Project Arts Centre over this past weekend, I got to speak about a project I’ve been gently pushing for several weeks now; boxes of laptops for people and community groups to use rather than cap-ex-ing any more pointless under-scoped under-utilised computer labs for everywhere. Comments/Collaboration/Assistance more than welcome Money even more welcome. Video Presentation Links Presentation Proposal Doc Hackaday.io Project Transcript This is the first time I’ve used a Mac for longer than 30 seconds in… ever so; plugging dongles and things in and the screen not exploding and creating loads of extended desktops all over the place is very very strange. ...

Andrew Bolster

I do not understand credit markets

After 20+ years with Ulster Bank (All hail Henry Hippo), and with countless computer, customer service, overdraft, and credit card problems, I’m jumping ship to Santander on the advice of my friends, colleagues and family. It hasn’t gone so well. Credit Background I’ve been a good boy, when it comes to finance. No loans other than Student No Car No Mortgage No Dependants Reasonable ‘Disposable income’ (even if that income is usually ‘disposed’ in either bars and restaurants or gadgets) Been employed in one form or another since I was 15 A few slip ups on the credit card but always paid back within the next month A few slips over the overdrafts an undergrad, but who didn’t? Currently well out of my overdraft So I called in last week, asked what paperwork I’d need to move my account, was given great assistance and told ‘We’ve got you an appointment next week and we can sort it all out’ ...

Andrew Bolster

Installing Ubuntu Touch on the Nexus 7

I’m always amazed by Canonical. Particularly their documentation. Ubuntu Touch is the grand movement to bring Ubuntu into the mobile domain, and it’s developing fast. Can’t say the same about the documentation; too long and doesn’t really make sense. And for what is actually a fantastically simple process, it deserves better. The phablet-flash folks have done an amazing job. So without further ado, the assumption: If you’re thinking of putting Ubuntu on your device, I’d say it’s reasonable to assume that: ...

Andrew Bolster

IPython Websocket Failure on Chrome

IPython is an amazing tool, and in particular IPython Notebook, which is easily the best ‘python scratch-pad’ I’ve ever used. However, a while ago something strange happened to my set up and I’m not entirely sure when or how but either way, here’s how I ‘fixed’ it. The Problem TL;DR Can’t execute anything at all using Chrome, works fine in other browsers. WebSocket connection failed A WebSocket connection could not be established. You will NOT be able to run code. Check your network connection or notebook server configuration ...

Andrew Bolster

Multiprocessing Niceness in Python

Quick and dirty one that tripped me up. Recently I’ve been doing lots of multiprocessing and joblib-based parallel processing, with loooong simulation times. In an effort to make sure that my machine was still useable during these runs, I changed the ’niceness’ value of the spawned processes… or so I thought. import os ... def thread_mask(args): # Properly Parallel RNG #http://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python myid=current_process()._identity[0] np.random.seed(myid^struct.unpack("<L",os.urandom(4))[0]) os.nice(5) return long_simulation(args) First part is a handy way to make sure that your subprocess simulations actually use different random numbers…. which for Monte Carlo style simulation is pretty damned important… ...

Andrew Bolster

My Basic (Python) Data Science Setup

After last weeks return to posting, I thought it was time to do something vaguely useful (and actually talk about it) so I’m tidying up a few meetup sessions I’ve presented at into a series of Basic Data Science (with Python) posts. This is the first one and covers my Python environment, the Jupyter notebook environments I use for analysis, and some on the Plot.ly graphs and RISE / Reveal.js methods I use to turn those notebooks into presentations. ...

Andrew Bolster

Octave 3.8 on Mint (or Ubuntu)

My work has be flittering between Python and Matlab recently, and lets say I’m not a massive fan of Matlab at the best of time, and VM matlab isn’t the most performant thing in the world. So I was happy to hear that octave, an open source, Matlab compatible analysis framework have started testing their GUI. Package Requirements sudo aptitude -y build-deps octave sudo aptitude -y install gfortran libgfortran3-dbg-arm64-cross liblapack-dev libblas-dev libarpack2-dev llvm-dev libfltk1.3-dev libglu1-mesa-dev libcurl4-gnutls-dev libfreetype6-dev libqt4-dev libfontconfig1-dev libfftw3-dev libqrupdate-dev libqscintilla2-designer texlive Download I used /dev/shm as the build directory as it’s effectivly a RAM disk, but YMMV. ...

Andrew Bolster