Wednesday, December 12, 2012
updated sunset jar
Friday, December 7, 2012
rainbow food jar
Thursday, December 6, 2012
Sunset jar
It is full of rice crackers at the moment.
Tuesday, December 4, 2012
fun fur sweater
The pictures a bit blurry, I'll get better ones later.
Wednesday, November 28, 2012
an experimental double wide hammock
Wednesday, November 21, 2012
deodorant spray bottle
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.
Thursday, September 13, 2012
bulk rename of file extensions
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" done
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
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; } close(OUT);
The above script gets used by the script that I use to do the conversion of directories to pdf files:
scan2pdf
#!/bin/bash if [ "$2" == "" ]; then echo "converts a directory of 150dpi scan images to a properly fit pdf" echo use: input-directory output-file exit fi 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
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
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
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
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 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 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
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
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
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
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
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
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
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
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
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.
#!/bin/bash [ "$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".mp3The 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
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. */ @Override public void run() { slider = new JSlider(); slider.setPaintTicks(true); slider.setPaintLabels(true); slider.setMaximum(127); slider.setMinimum(-128); slider.setMajorTickSpacing(32); slider.setMinorTickSpacing(8); slider.setValue(0); label = new JLabel("value = " + slider.getValue()); JFrame frame = new JFrame("Slider Sample"); frame.setLocationByPlatform(true); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Container p = frame.getContentPane(); p.add(label, BorderLayout.SOUTH); p.add(slider); slider.addChangeListener(sliderChangeListener); frame.pack(); frame.setVisible(true); } /* * and things that will be triggered later */ private ChangeListener sliderChangeListener = new ChangeListener() { @Override 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
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); textArea.setEditable(false); } private void log(String event) { textArea.append(event + "\n"); } private void log(String event, MouseEvent e) { log(event + ": " + e); } private MouseListener mouse = new MouseListener() { @Override public void mouseClicked(MouseEvent e) { log("click", e); } @Override public void mousePressed(MouseEvent e) { log("pressed", e); } @Override public void mouseReleased(MouseEvent e) { log("released", e); } @Override public void mouseEntered(MouseEvent e) { log("entered", e); } @Override public void mouseExited(MouseEvent e) { log("exited", e); } }; private MouseMotionListener mouseMotion = new MouseMotionListener() { @Override public void mouseMoved(MouseEvent e) { log("moved", e); } @Override public void mouseDragged(MouseEvent e) { log("dragged", e); } }; @Override 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); split.add(blankPanel); split.add(scroll); JFrame window = new JFrame("Mouse Track"); Container panel = window.getContentPane(); panel.setLayout(new BorderLayout()); panel.add(split); blankPanel.addMouseListener(mouse); blankPanel.addMouseMotionListener(mouseMotion); window.pack(); window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); window.setLocationByPlatform(true); window.setVisible(true); } public static void main(String[] args) { SwingUtilities.invokeLater(new MouseTrackMain()); } }
This program is laid out so that there are no forward references.