Stuff I've found interesting in the past month - 23/09/2010

Segway Olympics - prototype run Segway Olympics - prototype run European Parliament All But Rejects ACTA My First Place On HGTV: How to Spend Your Next Thirty Years House Poor BugMeNot Lite Now Provides Anonymous Login Credentials in Chrome [Downloads] 10 fresh and lite jquery content sliders for web applications EEVblog #108 – Amazon Kindle 3 3G/WiFi Review Cyber-Offence is the New Cyber-Defense SweetSearch Finds Credible Research Sources for Students [Research] ...

September 23, 2010 · Andrew Bolster

Installing and Configuring NS-3 on a Ubuntu System

** NS-3 Appears to have a staggeringly steep learning curve so I hope these posts help out someone else (or me, when i forget all this in a month). Running off a virtualised Ubuntu 9.10 system, the prerequisites I installed were all the ones listed here. (And i removed some out of date packages) sudo apt-get install bison bzr dia doxygen flex g++ gcc gdb graphviz imagemagick libgoocanvas-dev libgtk2.0-0 libgtk2.0-dev libsqlite3-dev libxml2 libxml2-dev mercurial python python-dev python-kiwi python-pygoocanvas python-pygraphviz sqlite sqlite3 tcpdump texi2html texinfo texlive texlive-extra-utils valgrind ...

March 14, 2010 · Andrew Bolster

Change Of Plans.....

My attention span isnt really that great with projects, so the thought of doing the entire Project Euler in several different languages was never realistically getting off the ground. (FYI Problems All On One Page ) So, modification and extension to the previous idea; Take one random number generator (java.util.random) and a list of languages I think I should have at least a cursory knowledge of. Each time I finish one problem, push a button and it tells me what language to use for the next one. ...

June 28, 2009 · Andrew Bolster

Data Wrangling for UK Internet Usage

This post is a little different from my usual fare; Basically, there was a tweet from MATRIX NI that caught my eye; the latest Office of National Statistics report on Internet Use in the UK. @MATRIX_NI @ONS And the tables show Northern Ireland being around 7% behind the Avg and 2% behind the next-worst-region... — Andrew Bolster (@Bolster) May 22, 2015 Basically, NI “lost”. So I thought it was a good opportunity to play around with the data a little bit instead of my usual stuff. ...

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

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

Review: Learning Cython Programming

About 6 months ago now, I had the pleasure of getting Phil Herron to talk at the Farset Labs PyBelfast group about his work in GCC/Cython fron end optimisation work, which was simultaneously waaaaay over my head and really interesting. I’ve been a ‘Python Primary’ software engineer now for about 5 years, in web-dev, infrastructure monitoring, data analysis, and scientific computing, with some esoteric stuff involving small-vector linear algebra optimisation on GPU CUDA, Matlab bridging with Octave / Oct2Py, and distributed state systems. But somehow, I’ve managed to dodge hardcore Cython. ...

Andrew Bolster