technology

Preparing for Bayesian Mathematics in Python

Preparing for Bayesian Mathematics in Python

In which I run through setting up a Python environment on Windows...

I'm going to preface this post by saying I'm not breaking any new ground here. As is often the case, though, a beginner wanting to set-up an environment to do this will have to go to multiple websites to collect this info so I'm going to distil it into one post.

I am going to talk about Python 2.7 as currently it has the most support for libraries. This method should work equally well for Python 3 but I have not tested this.

Fancy Thesis Tables in LaTeX: An Idiots Guide

Fancy Thesis Tables in LaTeX: An Idiots Guide

In which I provide a template for generating fancy, production quality tables for theses...

LaTeX as I've mentioned previously, is a document preparation system well known for its brilliant equations and can also be utilised to make very nice looking diagrams. The tables it generates, however, while neat are a little lacklustre.  This is aimed as a very simple guide to editing tables (regular LaTeX users may find this tutorial very basic).

Word 2010: Footnotes and Mendeley

Word 2010: Footnotes and Mendeley

In which I discuss getting footnotes and Mendeley references to look nice in Word...

I may not have mentioned it before on this blog but I am a Mendeley advisor and a strong advocate of this free reference manager. In fact I cover the pros and cons of it in this video:

Proper Gradients for MetaPost Pulse Sequences

Proper Gradients for MetaPost Pulse Sequences

In which I improve upon the previous post...

In yesterday's post I talked about using MetaPost to generate Pulse Sequence Diagrams for MRI documents. I have been using this to make nice diagrams for my Thesis. There is one problem, however, with the pulse sequence file provided on Mark's website - it generates square gradients.

Pulse Sequence Diagrams Using Metapost

Pulse Sequence Diagrams Using Metapost

In which I use MetaPost to generate publication quality pulse sequence diagrams...

Pulse sequences are the series of radio-frequency pulses required to generate an MR image. If you are an MR Physicist you will see these a lot and probably wondered how can I generate nice pulse sequences for my thesis, papers etc. Well handily using MetaPost and these files you can!

AjaXplorer on FreeNAS 8.3

AjaXplorer on FreeNAS 8.3

In which I set-up a nice web GUI for my home server...

So I recently invested in a HP ProLiant MicroServer N54L to backup my PC to. Also it should be quite useful as a media server etc. I've installed FreeNAS as my OS but wanted to have a easy-to-use Web interface for accessing my files over my Network. I followed the guide here: http://forums.freenas.org/threads/howto-ajaxplorer-with-nginx-in-plugin-jail-mysql-optional-webdav.10297/ but a few things need changing as always.

LaTeX: Document Details

In which I perfect a macro for listing document details in LaTeX.

The Problem

I've been using $latex LaTeX$ to typeset my MRI Glossary (see previous PhD post). I really wanted an Appendix which listed system info and $latex LaTeX$ version.*

*Wordpress.com supports native $latex LaTeX$ - which is awesome

Solution

After much googling I couldn't figure out how to do this so I asked the kind folks at tex.stackexchange.com and Heiko Oberdiek & Ivan Griffin responded with two macros which I've now combined as follows†: usepackage{hologo} usepackage{ifluatex} usepackage{ifxetex} usepackage{ifvtex}

makeatletter

newcommand{ShowOsVersion}{% immediatewrite18{systeminfo | findstr /B /C:"OS Version" > OSv.tex}% input{OSv}immediatewrite18{rm OSv.tex}% }

newcommand{ShowOsName}{% immediatewrite18{systeminfo | findstr /B /C:"OS Name"> OSn.tex}% input{OSn}immediatewrite18{rm OSn.tex}% }

newcommand*{InfoLaTeX}{% hologo{fmtname} textlessfmtversiontextgreater } newcommand*{InfoTeX}{% ifxetex hologo{XeTeX}-% theXeTeXversionXeTeXrevision else ifluatex hologo{LuaTeX}-% begingroup count@=luatexversion dividecount@ by 100 % edefx{thecount@}% count@=-xrelax multiplycount@ by 100 % advancecount@ by luatexversion x.thecount@.luatexrevision endgroup else @ifundefined{pdftexversion}{% ifvtex hologo{VTeX}% @ifundefined{VTeXversion}{% }{% begingroup count@VTeXversion dividecount@ 100 % space vthecount@ multiplycount@ -100 % advancecount@VTeXversion .two@digitscount@ endgroup }% else hologo{TeX}% fi }{% hologo{pdfTeX}-% ifnumpdftexversion thepdftexversion.pdftexrevision else ifnumpdftexversion expandafter@carthepdftexversion@empty@nil.% expandafter@cdrthepdftexversion@empty@nil pdftexrevision else expandafter@carthepdftexversion@empty@nil.% expandafter@cdrthepdftexversion@empty@nil.% pdftexrevision fi fi }% fi fi }

I then call this at the end of my document with:

appendix chapter{Document Details}

Compiled by: InfoTeX hologo{LaTeX} version: InfoLaTeX ShowOsName ShowOsVersion

end{document}

This produces the following output:

Compiled by: pdf $latex TeX$-1.40.13 $latex LaTeX$ version: $latex LaTeX$2e OS Name: Microsoft Windows 7 Professional OS Version: 6.1.7601 Service Pack 1 Build 7601

†This requires you to use the -shell-escape option when compiling

Tom Out!

P.S. http://tex.stackexchange.com/questions/78334/print-system-information-in-latex-doc

Good Internet, Bad Internet

In which I discuss poor internet connections.

Slow Internet

Today at work I was using a terribly slow internet connection. What interested me was which programs and websites worked on a slow connection and which ones didn't.

These programs/sites worked well:

These didn't:

  • Outlook

  • Outlook web

  • Wunderlist

  • Ctrl-Alt-Delete

Google Mail & Calendar were intermittent.

Why should this be? I'm not sure and would have hazarded a guess that sites and programs which send less data would work better. However, Wunderlist only needs to send short strings of text (calendar events) when Evernote was syncing complete documents. Also with the websites both CAD and Xkcd require images to load. Xkcd managed it easily but I haven't seen today's CAD yet. Maybe the ones which loaded were just better coded/written!?!

Good Wi-Fi

Currently I'm writing this from the comfort of First Class with a complimentary glass of Merlot :-) The free Wi-Fi is excellent and speedy - the upgrade was definitely worth it (£2 to upgrade which gets me the normally £6 Wi-Fi, free wine and dinner). My new Archos G9 101 tablet is working very well and for a quick trip like this it's so much better than a laptop.*

Don’t forget complimentary tea too:-)

So my first post written entirely on a tablet has gone well, also having a 250Gb HDD means I've done so to excellent musical accompaniment (LotR and TMBG among others).

*Although I did need to re-calibrate the screen after a recent update.

Tom Out!

CASE Placements and Research Software

In which I apologise for this week being low on blog posts and update you on my AstraZeneca placement. Also I use software I normally use for research for other purposes.I'm sorry there haven't been any updates this week. There was no cake made as I had no time for choir on Tuesday, no tea as it's an alternate week and the usual Thor update is delayed (pending a hot wire cutter).

CASE Placement

This week I started my work placement at AstraZeneca, the industrial part of my Industrial CASE PhD (see my post on PhD types). Apart from the system shock due to waking up significantly earlier than usual (my commute to UoM is a 15-20 min walk not a 45-60 min drive) the week has been good so far :) I've gone through a load of induction sessions and lots of positive feedback on my study designs and planning for the weeks ahead.

Next week I start work proper with my first study and hopefully the results will be as we predict. Sadly for now I can't give any more details due to confidentiality agreements. Rest assured though if I get a publication out of this placement (which I hope I will) it will be mentioned in this blog :)

Weeping Womble

On Monday night I managed to take a good set of photos of fellow Scout leader and Networker (Womble) walking ominously towards my camera. I used ImageJ a free, java based image tool commonly used by MRI researchers to animate this simple gif:

Weeping Womble (640)

After fixing some timing issues, adding 'blinks' and a final word of warning I ended up with this final masterpiece of internet animation:

Weeping Womble Final (640)

Proof that research software can be quite fun in your spare time!

Tom Out!

P.S. AstraZeneca

P.P.S ImageJ

I have a GUI

So following my post earlier today I now have a working xorg.conf and KDE 4.8.3 is running smoothly. Turns out there is an easy to use utility called nvidia-xconfig which I had overlooked and did the job perfectly. Also importantly I now have Chromium (Chrome for Linux if you didn't know) installed :) Time to start tinkering!

KDE 4.8.3 – looking good

I've provided my xorg.conf here in-case it is useful to anyone. This works with a Nvidia GTS 450 linked by HDMI to a Panasonic 42" TX-P42U30B Plasma TV:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 295.71 (buildmeister@swio-display-x86-rhel47-04.nvidia.com) Thu Aug 2 20:28:32 PDT 2012

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Module"
Load "glx"
EndSection

Section "InputDevice" 
# generated from data in "/etc/conf.d/gpm"
Identifier "Mouse0" Driver "mouse"
Option "Protocol"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5" 
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Modes"
Identifier "Modes0"
ModeLine "1920x1080@60" 182.28 1920 1952 2640 2672 1080 1102 1113 1135
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unkown"
ModelName "Unknown"
UseModes "Modes0"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
EndSection

Section "Device"
Identifier "GTS450"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection

Section "Screen"
Identifier "Screen0"
Device "GTS450"
Monitor "Monitor0"
DefaultDepth 24
Option "ConnectedMonitor" "DEP-0"
Option "DPMS" "false"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Tom out!