Wednesday, June 5, 2013

Sourcing a prism for a camera lucida

So this little exercise records my attempts at recreating a camera lucida for a budding artist. I was inspired to do this after briefly sponsoring the NeoLucida kickstarter project (link). Unfortunately the price point for shipment to Europe was quite high; shipping costs accounting for a large part. But the idea stayed and so I figured I could source the central element locally. A small glass prism. Sounds simple (that's what Oisin said)... The essential design elements as below (from Wikipedia)


Thus began a small voyage of discovery as I sought to uncover who, in Ireland, has the skills and tools, to work with glass.

Some remaining possibilities:
  • Blackrock Glass, a local glassier known for custom cutting glass shelves and the like (link
  • Jerpoint Glass, an artisan glass studio in Kilkenny (link)
  • Karl Harron Studio in Strangford (link)
  • The Glass Society of Ireland (link)
  • and perhaps other artisans through Craft Ireland (link)


Out of consideration.
  • Dublin Crystal (link)? No, they source their stock from international suppliers, they only cut and engrave in Dublin.
  • Heritage Crystal in Waterford (link)? Similar story except they do blow glass and cut it into crystal but the production director wasn't interested in doing anything bespoke like this.
  • Scholer Crystal from Austria? One of Europe's biggest contract crystal products producers (link) but they don't really do bespoke.

Monday, April 29, 2013

Updating the minecraft.jar file on a Mac

So the Minecraft files on a Mac are stored in
~/Library/Application Support/minecraft/ 
In the command sequence below you can see the space " " in Application Support is actually present but represented by the forward slash escape sequence to force the space to be read in at the command line).

An easy way to get there is, from the Finder > Go > Go to folder; and enter "/Users/myname/Library/Application Support/minecraft/bin".
Another way is to use the Finder shortcut "cmd+shift+G", and enter "/Users/myname/Library/Application Support/minecraft/bin".

Anyway, the above gets you to the installation folder.

To install the minecraftforge mod pack access the latest .jar and launch it. The new installer finds your Minecraft files and unpacks/downloads the files to the right location.

The following notes applied to pre-1.5.2 Minecraft...

cd ~/Desktop
mkdir ADD_MOD_FILES_HERE
cd ADD_MOD_FILES_HERE
jar xf ~/Library/Application\ Support/minecraft/bin/minecraft.jar
rm META-INF/MOJANG_C.*
ADD_MOD_FILES_HERE $
jar uf ~/Library/Application\ Support/minecraft/bin/minecraft.jar *


Pointers:
http://docs.oracle.com/javase/tutorial/deployment/jar/update.html
http://minecraftformac.tumblr.com/post/19686390830/unjarrejar

Sunday, April 7, 2013

Home energy saving measures.

Our annual usage 2017-18:
3,172 kWh - electricity from 8-Jun-2017 to 16-Jun-2018
7,049 kWh - gas from 8-Jun-2017 to 16-Jun-2018 (635m3 x 11.1 conversion factor)

Compared to a typical national market estimate for an average household of 5,300kWh electricity and 13,800kWh (source: bonkers.ie)

Our annual usage 2015-16:
3,024 kWh - electricity from 23-Jul-2015 to 21-Jul-2016
6,100 kWh - gas from 22-Dec-2015 to 22-Dec-2016


Use the SEAI BEH self assessment survey (link). Result: No recommendations. The house already has:

  • Solar hot water heating for hot water cylinder.
  • High efficiency condensing gas boiler system for primary heating and hot water.
  • > 4 inches of glass fibre ceiling insulation in the attic.
  • Mixed Solid Wall and Hollow Block and Timber Frame construction.

Checklist the SEAI credits list (pdf file, link).

Own plan as follows:

  • Replace halogen low voltage MR16 bulbs/transformers with GU10 high efficiency LED bulbs on direct 240v supply.
  • Fit additional ceiling insulation in the attic.
  • Complete upgrade of windows and front door (street side, North facing).
  • Fit shutter blinds to internal window frames.
  • Computer logging of internal temperature, electricity supply, weather station data.
  • Conduct thermal survey of the house.

Our goal, perhaps unrealisable, is to get near the Passivhaus requirement for energy-consumption of 120 W/m²/K.

References:
Passive House on Wikipedia (link)
W/m²/K is Watts per square metre per kelvin; see Wikipedia on thermal transmittance (link)

Friday, March 15, 2013

Pi Projects (generally no soldering iron required)

The Register has done its homework and come up with some of the easy Raspberry Pi construction projects.
  • Coffee table arcade game
  • LAMP server (that is Linux, Apache, MySQL, and PHP, and server as in a computer server)
  • Pi/Kindle Chimera
  • Pi Netbook
  • Info kiosk info projector
  • Weather station
  • Cloud server
  • Pi scales
  • Pi-BX
The projects are summarised on www.theregister.co.uk.

Saturday, March 2, 2013

Python and Minecraft on the pi.

Right, first for a copy of Minecraft: Pi Edition visit pi.minecraft.net/. And background information on Minecraft on the raspberry pi; see www.raspberrypi.org).

Copy the file (e.g. minecraft-pi-0.1.1.tar.gz) into your home directory.
Expand it; I used the tar -xvf command to unpack the gzipped and tarred up distribution.
tar -xvf minecraft-pi-0.1.1.tar.gz
cd mcpi
./minecraft-pi
And this starts Minecraft from the xterm.
At this point you can play Minecraft as you would expect on any conventional computer.

Now for the spice; using Python to send commands to directly to Minecraft, taking command of or interacting with the environment.

Well Python comes with the Raspbian “wheezy” Linux distribution for pi. It's already there waiting for me.
Following instructions from numerous other early explorers (best and most interesting for beginners I judge to be that by prmrytchr).

From a new xterm and staring in the mcpi directory...
cd api/python/mcpi/
Then start Python, and tell Python to import the minecraft.py functions and connect to my local running Minecraft session. My xterm looked like this.

Python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import minecraft as minecraft
>>> mc = minecraft.Minecraft.create()

The >>> indicates that the Python session is running so now I can type in some of the suggested Python instructions.
>>> mc.postToChat(“Hello, Minecraft!”)
And I see the message display in my running Minecraft game.
I can get the game to report my player position...
>>> mc.player.getPos()
Even if my player is at the spawn point I should probably can use this position (x,y,z) to do stuff. Like this to place a mushroom at the coordinates...
>>> mc.setBlock(x,y,z,40)
Now from Ger a quick command to test set all the numbered block types in sequence.
>>> for i in range(50):
>>> mc.setBlock(i, 53+i, 25, i)

Useful links for further progress
www.minecraftwiki.net beginners guide
www.minecraftwiki.net tutorial
www.stuffaboutcode.com
A maze generator: www.jonasavrin.com

And when you've finished shutdown X to the console then type sudo shutdown

Wednesday, February 27, 2013

Writing the Raspbian Pi image to an SD card.


My pi!

So, downloaded Raspbian “wheezy” (link). 493.6 MB.

Check the checksum in an xterm:
shasum ./2013-02-09-wheezy-raspbian.zip
b4375dc9d140e6e48e0406f96dead3601fac6c81  ./2013-02-09-wheezy-raspbian.zip

Which is the same as the published checksum
SHA-1 Checksum: b4375dc9d140e6e48e0406f96dead3601fac6c81

and unpack the file (2013-02-09-wheezy-raspbian.zip), again, from the xterm:

unzip ./2013-02-09-wheezy-raspbian.zip
Archive:  ./2013-02-09-wheezy-raspbian.zip
inflating: 2013-02-09-wheezy-raspbian.img

On the Mac I followed elinux.org's instructions for "Copying an image to a 4GB SD card in Mac OS X (command line)". They seemed to be the most accurate and complete (link).

The following pointers apply to a computer with an external USB SD card reader. I my case I used the Puremedia SD USB Card Reader product.

Inferring the device id for the SD reader:

From 'About this Mac' click on System Report. Select Hardware>USB. One of the USB High-Speed Bus entries will reflect the details of whatever SD card is currently loaded. Eject and reinsert a couple of times, reloading the System Report between each state to verify that you are referring to the correct entry. This is important because you can wipe hard disks with incorrect disk duplication commands.

In my case I had an SD card with the following details:
  Volumes:
NO NAME:
  Capacity: 78.6 MB (78,643,200 bytes)
  Available: 48.3 MB (48,336,896 bytes)
  Writable: Yes
  File System: MS-DOS FAT32
  BSD Name: disk2s1
  Mount Point: /Volumes/NO NAME
  Content: Windows_FAT_32
disk2s2:
  Capacity: 1.67 GB (1,667,235,840 bytes)
  BSD Name: disk2s2
  Content: Linux
disk2s3:
  Capacity: 200.3 MB (200,278,016 bytes)
  BSD Name: disk2s3
  Content: Linux_Swap

What this means, in MY CASE ONLY, that the device name (and therefore the 'raw device name') is disk2 (or rdisk2 for its raw equivalent). In this particular case the BSD names (e.g. disk2s1, disk2s2, disk2s3) are volumes or partitions on the SD card I was using. They will probably all disappear after following the disk image copying instructions. The reason I had these extra volumes on my SD card is that I was practicing disk imaging/partitioning on it.

I replicated the process from an xterm using the df -h command. Same result.
So starting with the SD card inserted and mounted, unmount it using sudo diskutil unmount /dev/disk2s1 (my case only). The icon will also disappear from the desktop confirming this step was successful.

The last step is to write the raspbian image file to the raw SD card device as identified above, replacing disk2s1 with rdisk2:
sudo dd bs=1m if=./2013-02-09-wheezy-raspbian.img of=/dev/rdisk2

After anywhere from 3 to 5 minutes the disk image write finishes. The xterm looked like this:
1850+0 records in
1850+0 records out
1939865600 bytes transferred in 226.104953 secs (8579492 bytes/sec)

And there's a shiny new disk labelled 'Untitled' on the desktop. At first impression it looks like your 4G sized disk has tragically shrunk to 58.7 MB. The reason is that the SD disk now has a Linux swap partition and a Linux file system partition occupying the available space. The good news is that most of the slack space can be recovered the first time you load this SD card on the Raspberry Pi via one of the Pi configurator (raspi-config) options to reallocate the space from the linux partition to the FAT32 partition.

I plan to duplicate the process on Windows to verify the approach.

Friday, February 1, 2013