Wednesday, December 12, 2012

updated sunset jar

I wanted my sunset jar to be opaque, so I taped, painted, and glossed the gaps above and below the part that was already taped.

Friday, December 7, 2012

rainbow food jar

I painted the other empty soy butter jar, this time I made it fully opaque by taping right up to the rim below the threads and covering the bottom.  I decided on a rainbow swirl, and here it is.

Thursday, December 6, 2012

water bottle

I taped and painted another water bottle, I am not entirely sure what the pattern is.

Sunset jar

I had an empty and cleaned soy butter jar, it was still perfectly good for storing food in so I stripped the label off, taped it, and painted it.

It is full of rice crackers at the moment.

Tuesday, December 4, 2012

fun fur sweater

I just made a new sweater out of fun fur.  It is very soft and fairly warm.

The pictures a bit blurry, I'll get better ones later.

Wednesday, November 28, 2012

an experimental double wide hammock

I wanted to experiment with this large weave fabric that I found, to see how it would hold up as a hammock.

I used a very wide nylon trim (75cm, or half of the full width) to make the whole thing 3m wide.  Last night I was in this with a sleeping bag and was warm most of the night, the temperature got down to -7c according to the thermometer a few meters from the hammock.  I can not yet dress warm enough to sleep below zero without a sleeping bag in a thin hammock.  The trim covering the top of the hammock when I am inside is a nice bonus feature.

The fabric stretches a little when I get in, making getting out an interesting challenge, I need to basically climb out of the hammock, I can't use the rolling out method that I usually use.

Wednesday, November 21, 2012

deodorant spray bottle

A few years ago I got introduced to using rubbing alcohol to remove arm pit odor, instead of the various other deodorants available in the stores.  It has the advantage of not leaving any white deodorant stains, it is also a general anti-septic, and cleaner for some things.

I finally got around to painting the spray bottle I keep my rubbing alcohol in, there is a clear sight on the side to tell the remaining level in the bottle.  The colors were chosen to indicate a good (green), worth refilling (yellow), and low (red) level.

The bottle may even last longer than the old one because of the extra layer of protection on it.

water bottle

One of my friends gave me a nice water bottle which was branded, so I taped and painted it.

Thursday, September 13, 2012

bulk rename of file extensions

When the software that drives my scanner on my mac saves PDF files it uses the extension ".PDF".  I would like to have the extension ".pdf" on the files.

I accomplished this by renaming the files using this shell snippet:

for x in *.PDF; do
  y="`echo "$x" | sed -e s/\.PDF$/.pdf/g`"
  mv -i "$x" "$y-"
  mv -i "$y-" "$y"

There are two moves because the file system acts case insensitive and recognizes the initial and final file name as the same. Also the file name variables are quoted because of spaces in the file names.

Friday, September 7, 2012

JPEG scans to PDF

Long ago I would scan pages of paper to JPEG images at 150dpi, more recently I have been scanning to PDF, and today I finally got around to converting all the old scans into the new format.  This presented a challenge because not all of the scan files are the same dimensions.

My first challenge was figuring out what the dimensions of each JPEG file were, which was not so hard once I realized that I was using Portable Any Map intermediates between the JPEG file and the Postscript version that gets turned into a PDF file, the intermediate format has the dimensions of the image in plain text in a header which I could just read.

The rest of the challenges were minor in comparison, either because I solved them in the past, or were solved by a quick search online.

This first script converts an incoming Portable Any Map to a properly sized postscript file with a 150dpi version of the image as the entire page: pnmtops-150dpi-filter
#!/usr/bin/perl -w
use strict;
my $ver = <STDIN>;
my $size = <STDIN>;

my ($width, $height) = ($size =~ m{^(\d+) (\d+)$});

$width = $width / 150.0 + 1.0 / 72.0;
$height = $height / 150.0 + 1.0 / 72.0;

local *OUT;
open(OUT, "|-", "pnmtops", "-dpi", "150", "-equalpixels", "-nocenter",
        "-width", $width, "-height", $height, "-setpage");

my $buff;

print OUT $ver;
print OUT $size;
while(read(STDIN, $buff, 8192)) {
    print OUT $buff;


The above script gets used by the script that I use to do the conversion of directories to pdf files: scan2pdf
if [ "$2" == "" ]; then
  echo "converts a directory of 150dpi scan images to a properly fit pdf"
  echo use: input-directory output-file

for x in "$1"/*.jpg; do
  djpeg "$x" | pnmtops-150dpi-filter
done |
ps2pdf14 - "$2"

This seems to be working well for me, it even produces PDF files with varying page sizes.

warm rainbow jacket

One day about two years ago I was at the fabric store and one of the staff knew that I liked wearing very colorful things, so they showed me a bolt of rainbow printed fleece.  At that point I got enough for two fairly small ponchos and added them to the mix of fleece I was wearing through the winter.  The following winter I saw the fleece at the store again and got more with the intention of making a jacket type thing, and made three parts that I could wear mixed with other things.  Recently I decided to take the parts and make them into a single jacket.

I also updated the waterproofing coating on the jacket, so it is mostly waterproof in the rain and snow.  The fleece was very warm before I made it into a jacket, now it feels even warmer.

I am considering making the jacket a little longer, about trenchcoat length.

I also made the leg warmers from the same rainbow print fleece.

Monday, September 3, 2012

Pill case cover

Last year I started taking some daily pills, and got myself a weekly pill box to remind me if I have taken them yet on a particular day.  One time last summer I went on a trip and found that the box would not keep itself closed in my backpack, so it spilled which was annoying.  In response I came up with a very easy solution, make a box that was just big enough to slide the pill box into.

It works extremely well.  Now I do not need to worry at all about where I pack it for overnight stays, multi-week trips, or even camping. It will no longer be opening and spilling in my bag.

The case itself is made of plastic canvas and sewn with strips of used shopping bags.

positive clothespins

One of my friends was making clothespins with cute words on them to give out for christmas last year, and I extended the idea to something to share and gift to people at parties and festivals.

I have heard people wondering where they come from many times, after seeing them clipped on people all over the place at a party.  Also many people seem to love these.

Not only can they be shared and clipped on people, they can also hold clothes onto lines, and anything else one might use a clothespin for.

Transparent wallet

In university I had a meal plan, and the holder it was in was transparent on the inside and would hold both the meal plan slip and my student id card.  I liked the convenience of being able to see what was in it like that.  Later I made myself a wallet out of a milk bag.

It is all transparent and sewn together.

The previous one lasted about two years, and this one was made a few days ago.

Other previous attempts were walets made from overhead sheets and packing tape; just packing tape; sandwich bags and tape; and tape with cardboard. None of those lasted nearly as long as a milk bag with thread.

When I had a bus pass I could just put it on one of the outside surfaces and not even open my wallet to show it.

I like it.

Sunday, September 2, 2012

My toothbrush holder

I keep my toothbrush in one of those plastic toothbrush tubes, since it is traveling with me all over the place.  I found the tube to be boring, so I tried painting right on the plastic, and later using sharpies on the plastic, but both rubbed fairly quickly.  Eventually I just wrapped it in hockey tape and painted that.

I also glossed it when it was done.  The split where the toothbrush tube opens is part way into the yellow stripe.

I expect the tube will actually last longer because of the reenforcement on the surface.

Friday, August 31, 2012

Travel Sewing Kit

I fix stuff, and sew stuff, however carrying the basic sewing essentials can be a challenge sometimes.  After a few years of storing my sewing needles in folds in 1/8ths of sheets of paper I decided to make a box that would slide shut to hold some of these needles.  It also turns out that I could hold thread wrapped around the same size papers, making the kit complete.

I have some big needles and small needles, potato sack string, elastic string, and a few colors of thread in there.

Also it all closes up into a neat small package.  I am quite happy with the result.  This kit has been traveling with me for a few years now with no trouble.

SD card holder card

I personally find SD cards too hard to manage because they are so small, especially when they do not end up living inside of devices.

So my solution was to make a holder for the few that I had out of some plastic canvas sewn with strips of shopping bags, making the cards larger and easier to manage.  The holder is nice and simple, and the cards just slide in and out, but do not fall out.  If I had any more cards I would make a holder twice the size, this one is the size of 1/16th of a sheet of letter sized paper.

Custom Hula Hoops

A little over two years ago I learned how to make really nice hula hoops for learning to do tricks with.

These are the first two hoops I made.  Both are made from 25mm IPEX pipe and a straight pipe joiner.  I have also made a few hoops for other people over the last two years.

The larger one was the first one I created, and was originally wrapped in white hockey tape with writing all over it.  Recently it accidentally ended up getting soaked in insecticide, so I stripped the tape off and re-wrapped it.  Both hoops are wrapped in white hockey tape and painted.

I plan to make an even larger one that moves even slower to help with learning motions, moving up to smaller ones as I get the motions learned and ingrained in muscle memory.

Monday, August 20, 2012

my first fun fur hammock

In the winter after I learned how to make hammocks I decided to try and make a warm one.

This hammock is fun fur lined with a thick fleece shell.  It is 1.5m wide and 2.5m long.  I actually built it to fit under the 3m long double wide nylon hammock that I started using as a tarp. 

This hammock is very comfortable, but does not actually block the wind very well, so it is not quite as warm as I hoped for winter sleep. However, it does make an extremely warm blanket on a double bed.

It has been well used for about a year, but has now fallen into disuse since I made the double wide fun fur windproof hammock.

large hand bag

When I was making my winter outfit I had a strip of leftover fleece, which when folded in half looked like a good sized hand bag.

It holds everything I need for a day of temping with fairly consistent weather and temperatures, or everything I need while in transit on a bus going anywhere.  The straps are scrap webbing that I diverted from the garbage at a furniture building gig a few years ago. There are loops in all four ends of the straps where I can hook small things, like my keys, phone, and water bottle, for easy retrieval.

The bag measures 43cm x 30cm with a 27cm opening.

smaller water bottle

I decided to paint the water bottle I got a few years ago during a gambling awareness presentation.

The bottle holds about 1/2 L of water, and is well used. At this point it is falling into disuse because I got myself a larger metal water bottle to keep in my bag.

Sunday, August 19, 2012

super cheap bike lights

One evening I was sprinting to catch a city bus, tripped, and smashed the back light for my bike. After that I was using some electric glow sticks for front and back lights on my bike for a while. Finally I found some bike lights at the local Dollarama, so I got the pair.

When I tried to install the bike lights the mounting clips broke off. Being a person who does crafting with things like plastic canvas this only drove me to find a way to make a mount to put them on my bike, since the lights themselves still worked fine.

The end result was a little box, held closed with a twist tie, attached to the bike with twist ties, holding the light part of the Dollarama bike lights, and they are working quite well.  The picture is the rear light, and the front light is basically the same.

Total cost to me: about $3 and about an hour.

Rainbow lighter

I had a quiet evening in Fredericton on one of my trips, and a couple of lighters in my kit bag, so I decided to start coloring them.

This is actually the third rainbow painted lighter I made.  The first one got borrowed at Eclipse and did not end up getting returned. The second one I gave to Pixie Sun Child before we went in opposite directions in Ontario. Finally the third one I made when I got back to Halifax.

Saturday, August 18, 2012

Winter ready hammock

Last winter I spent most of my nights sleeping outside in a hammock.  This may sound cold, but it really was not.

This hammock is 3m wide and 2.5m when the ropes are not installed, and has slept three people comfortably.  The liner is thick fleece fun fur. The shell is coated rain wear nylon, which is both wind and water proof.  With the tarp and everything tethered properly it is ready for any weather except extreme heat.

I also have two fun fur blankets that I use as the temperature gets lower. I have gotten to almost -20 degrees Celsius with just two fun fur blankets and some warm clothing, and about zero with almost nothing in addition to the blankets.

There are zippers on the ends so that the foot end of the hammock can be zipped up to both keep the blanket inside the hammock around the feet, and keep the hammock closed by the feet.

In a pinch the hammock can be used as a warm sleeping bag on the ground as well.  This year when I took this hammock to Evolve I did not actually get to sleep in it because it was always occupied by someone else who was sleeping. I only hear good things about the comfort and warmth.

Wednesday, August 15, 2012

new water bottle

About a week ago I was shopping at a local thrift store and found a good sized metal water bottle.

This was good, except for the water bottle being branded, and I prefer to not have visible brands on my stuff.

The response was completely logical for me:

I covered the bottle with strips of white hockey tape, with as little overlap as I could.

Then I painted the bottle with acrylic paint, freehand, trying my best to color each strip one color.

Finally I glossed it with some of the gloss that my sister uses to make her masks shiny, though this step was not even really necessary.

I am happy with how the water bottle looks now, and it holds a pleasing amount of water, some time in the future I will actually measure how much water that is.

Neon yellow basic hammock

I learned how to make basic cloth hammocks about two years ago, they are quite comfortable and most are easy to transport.

This is one of the recently created ones.  I got the material before I left for Eclipse, and hung it as a no-sew hammock there for casual napping.  Later on one of the stops on the way home I sewed it at a friend's place to make it hang easier, and even more recently I trimmed it down to 2.5m in length so that it would hang between my regular two hammock trees and fit under my rain tarp.

The fabric is a fairly thick raincoat nylon.  This particular one does not stretch at all so it takes me a little while to get comfortable enough to sleep.

Combined with the rain cover this hammock is good for all summer weather: wind, rain, and clear.  I have also slept out in all of these with it already.

The main thing that keeps the rain off the hammock is the metal rings that divide the rope on the tree from the rope on the hammock.

The reason I created this hammock was because one of my hammocks that I took to Evolve left to go on an adventure without me.

Sunday, August 12, 2012

Joining audiobook mp3 files together

I like to listen to audiobooks sometimes when I am walking and relaxing, and I like to listen to them on an iPod, but usually when I find them they are split up into a large number of mp3 files, and the iPod does not deal with them very well.

After getting sufficiently annoyed at the problem I decided it was time to find a way to join the files together into one, so it was easier to manage, also it would be nice to be able to reliably resume in the same place as I left off, it would keep resuming several minutes away from where I paused it.

The results of my tinkering was a small script to decode a directory of mp3 files, and then encode the resulting audio stream into a single constant bitrate mp3 file. I used a 64kbit rate since I was only dealing with speech.

[ "$1" ] || {
  echo use: $0 directory
  exit 0

for file in "$1"/*; do
  ffmpeg -i "$file" -acodec pcm_s16be -f s16be -ar 44100 -ac 2 -
done |
  lame -r -x -b 64 --cbr -s 44.1 --bitwidth 16 -m j - "$1".mp3
The script takes a directory as a parameter, and outputs an mp3 file by the same name. Remember to leave the trailing slash off the directory name, unless you want to get a hidden mp3 file in that directory as a result.

Tuesday, February 21, 2012

Swing Slider Example

I wrote a Slider 'Hello World' program to make sure I understand how to use them to control another value in the user interface.

Here is that self contained simple example.

package ca.sarah_happy.sandbox.circles;

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JSlider;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class SliderSample implements Runnable {
    public static void main(String[] args) {
         * do all the work on the GUI thread.
        SwingUtilities.invokeLater(new SliderSample());

     * things I will need access to later.

    private JSlider slider;
    private JLabel label;

     * do the work of creating the user interface.

    public void run() {
        slider = new JSlider();

        label = new JLabel("value = " + slider.getValue());

        JFrame frame = new JFrame("Slider Sample");

        Container p = frame.getContentPane();
        p.add(label, BorderLayout.SOUTH);



     * and things that will be triggered later

    private ChangeListener sliderChangeListener = new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            String adjust = "";
            if (slider.getValueIsAdjusting()) {
                adjust = " (adjusting)";
            label.setText("value = " + slider.getValue() + adjust);

Saturday, February 11, 2012

tracking mouse events example

I expect to need a program to inspect mouse events soon. I intend to find out how mouse events are delivered on a touch screen, when I have access to such a device. In the mean time I put together a program to display the mouse events that are visible to a java application.

package org.yi.happy.mouse;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;

 * Track mouse events over a panel and log in a text area.
public class MouseTrackMain implements Runnable {
    private final JTextArea textArea;
        textArea = new JTextArea(10, 80);

    private void log(String event) {
        textArea.append(event + "\n");

    private void log(String event, MouseEvent e) {
        log(event + ": " + e);

    private MouseListener mouse = new MouseListener() {
        public void mouseClicked(MouseEvent e) {
            log("click", e);

        public void mousePressed(MouseEvent e) {
            log("pressed", e);

        public void mouseReleased(MouseEvent e) {
            log("released", e);

        public void mouseEntered(MouseEvent e) {
            log("entered", e);

        public void mouseExited(MouseEvent e) {
            log("exited", e);

    private MouseMotionListener mouseMotion = new MouseMotionListener() {
        public void mouseMoved(MouseEvent e) {
            log("moved", e);

        public void mouseDragged(MouseEvent e) {
            log("dragged", e);

    public void run() {
        JPanel blankPanel = new JPanel();
        blankPanel.setPreferredSize(new Dimension(400, 300));
        blankPanel.setBackground(new Color(0x7f, 0x7f, 0xff));

        JScrollPane scroll = new JScrollPane(textArea);

        JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

        JFrame window = new JFrame("Mouse Track");
        Container panel = window.getContentPane();
        panel.setLayout(new BorderLayout());



    public static void main(String[] args) {
        SwingUtilities.invokeLater(new MouseTrackMain());

This program is laid out so that there are no forward references.