PH_Lyrics Android Widget

As mentioned previously I have been using a database of Peter Hammill and Van Der Graaf Generator songlines as test data for various projects.  Whilst doing some Android related things I  put together a “widget”.

So as an extension to the PH Lyrics project (www.ninelocks.com/ph_lyrics) and twitter.com/ph_lyrics here is an Android widget.

The widget updates from the web every hour while the device is awake. The widget can also be tapped on to force a refresh. Its only available in the one size at the moment and sometimes it looks a bit empty when the chosen songline is a short one.

Download from here

qrcode_ph_lyrics_widget

Posted in android, computing, music, Uncategorized | Comments Off

Neko

The first version of Neko I was aware of was on the Apple Macintosh as a desktop accessory,but since then the code has been modified and re-written by various people so that Neko can play on a variety of different machines.

web_hi_res_512

I use Neko as a way of trying out dev tools an new platforms. So here is a variation on Neko for Android. Download here

qrcode_neko_ninelocksDownload Neko from Ninelocks.com


The history of Neko (as far as I am aware is)
neko DA (Macintosh version) © 1989 by Kenji Gotoh
xneko (X11 version) ©1990 by Masayuki Koba
Pilot version ©1997 by Hoshi Takanori
(If I have missed someone out, please let me know.)

This is an update of the version (with multiple cats) that I wrote for PalmOS and later Windows Mobile devices.

web_hi_res_512

Posted in android, coding, JAVA | Tagged , | Comments Off

ByteSplorer- A fun way to explore Binary numbers…

One thing the Android world is not short of is binary calculators but I required one with very specific functionality and behaviour. Hence ByteSplorer, available from Google Play or a direct download here.

ByteSplorer shows how the byte may be interpreted as an unsigned or signed number and its hexadecimal representation.

There are a limited number of functions as well that allow shifting (to demonstrate its effect on the value) and invert all and add 1 keys to allow experimentation with converting numbers to their to complement negative version.

ByteSplorer is at GooglePlay

device-480_320

qrcode_bytesplorer_googleGoogle Play

Posted in android, coding, computing, education, JAVA | Tagged , , | Comments Off

Quick Way to serve files to devices such as tablets

Fighting with a few mobile devices that I want to easily share content with…. I suspect I am not alone. Manufacturers provide handy transfer software for Windows and Mac users, not so much for Linux.
A quick way to serve up files via a web server is using the built in python one.

Just go to the folder you want to server up and python -m SimpleHTTPServer 8888 & (or whatever port number you want to use)

Posted in android, computing, linux, LinuxMint | Comments Off

wxGlade wxPython and custom components

A reminder to me of how to use custom components in a wxGlade Project.
I had a Panel which contained controls for a Matplotlib Project. The panel contained the plotting surface and some combo boxes to set parameters. I wanted to use this on multiple packages of a notebook to present different data views. This was a good canditiate for being re-used and subclassed. But how to to do that using wxGlade…..

This assumes a component based upon a Panel called a nineGraafTabPage_M
Where the component is first used
Properties->Common->Class nineGraafTabPage_M
Properties->Common->BaseClasse(s) tick and set to wx.Panel (not NOT wxPanel)

How to reuse the Component

Now if we wish to reuse that panel somewhere else, for example on a notebook page. Then on the page you wish to use it. First of all inset a normal panel. Then
Properties->Common->Class NewNameWhatever
Properties->Common->BaseClasse(s) tick and set to nineGraafTabPage_M
Then also add on
Properties->Common->Code tick Extra code for this widget
and in the extra code section
from nineGraafTabPage_M import nineGraafTabPage_M
(important follow this with a carriage return)
Then click on the add properties button and set a property of id with a value of -1

General

In the application property page also tick
Code Generation Separate file for each class

Posted in coding, computing, python, wxGlade | Tagged , | Comments Off

Matplotlib, BaseMap, Pyinstaller

(brief random notes, that may help someone else)
A brief tale of getting a matplotlib and basemap to work with pyinstaller. There are two strands to this the Linux and Windows.

This is mostly the linux story.

Step by step, to how I got working.

I was trying to build a single directory solution and a single file solution.
Final conclusion was best to make the application single file and dont include the BaseMap data. then supply the basemap data separately.

This makes it easier to share the basemap data with other applications.

Dependent upon whether you are working on a machine that has matplotlib/basemap installed or not did change how things behaved.

In what follows dev_machine is my dev machine with all packages installed, the target machine is the users machine and has none of the dev tools installed.
Things needed…
On target machine it needed a matplotlibrc,
As a fiddle (thanks to this post http://ubuntuforums.org/archive/index.php/t-1506538.html) I copied my dev machine /etc/matplotlibrc to the directory in which the exectuable was stored on the target machine

the next problem was

IOError: proj data directory not found. Expecting it at: /usr/share/basemap/data

This required a tweak to /usr/share/pyshared/mpl_toolkits/basemap/pyproj
in new install ended up in /usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap

as per this post http://code.google.com/p/pyproj/issues/detail?id=40&q=PROJ_DIR

Which boils down to around line 239, replace this line


pyproj_datadir = '/usr/share/basemap/data'

with

if 'PROJ_DIR' in os.environ:
   pyproj_datadir = os.environ['PROJ_DIR']
else:
    pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data'])

The setting an enviroment variable to wherever you have the basemap data
in my setup this was in a folder where the executable was
export BASEMAPDATA=./basemap/data

Next rebuild the pyinstaller files and try again….
export PROJ_DIR=./basemap/data

just didnt work!
copied /etc/matplotlibrc from dev machine into the same folder as the executable and
it worked!….As long as I supplied the basemap data in a folder called basemap/data

Posted in computing, matplotlib, python, Uncategorized | Comments Off

Pyinstaller, Matplotlib and BaseMap

Having big problems persuading a python,matplotlib and Basemap project to freeze using Pyinstaller.

On doze and Linux,

Basemap kept looking in the site distribution for the data files.

Workround I found was the addition of this environment variable PROJ_DIR via a tweak to proj.py
as per this post http://code.google.com/p/pyproj/issues/detail?id=40&q=PROJ_DIR

Which boils down to around line 239, replace this line


pyproj_datadir = '/usr/share/basemap/data'

with

if 'PROJ_DIR' in os.environ:
   pyproj_datadir = os.environ['PROJ_DIR']
else:
    pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data'])

I still needed to copy the mpl_tools folder across top where the pyinstaller produced single file executable was stored.

Then set these env variables as always ymmv

(looking round in basemaps proj.py and pyproj.py for where folders get set can be fruitful )as well)

I will document this more fully sometime,along with all the useful links I found on the way meantime this may help you get working

set BASEMAPDATA=p:\dist\mpl_toolkits\basemap\data

set PROJ_DIR=P:\dist\mpl_toolkits\basemap\data

Posted in coding, linux, matplotlib, pandas | Tagged , , | Comments Off