I dehydrated some oranges, but instead of just slicing them thinly, I peeled them and sliced them in four, making round slices. They took a long time to dry, but they look like and feel like cookies, but taste like orange. Two cookies makes half an orange. I also dried the peeling since it is edible.
So yummy, the oranges don't last long like this.
Thursday, April 18, 2013
Thursday, March 7, 2013
funky food jar
I had another empty jar taped and ready to paint... This time I decided to put a drop of paint on it, spread it using a brush without overlapping paint that was already on it, change colors, and repeat until it was covered.
updated sunrise jar
I was not feeling pleased with my sunset jar, so I got out the paint and turned it into a nice sunrise jar.
I like this more, but it still feels like something is missing, when I figure out what I will updated it again.
I like this more, but it still feels like something is missing, when I figure out what I will updated it again.
Wednesday, February 13, 2013
wool sweater coat
I decided it was time to try out a wool layer for my rainbow sweater coat, here is what it looks like. This has been inside the rainbow fleece layer since it was made yesterday. The fabric is coating weight 80% wool and 20% polyester.
Also, being barefoot in the winter is getting easier with practice.
Also, being barefoot in the winter is getting easier with practice.
Thursday, January 31, 2013
painted "Loved" pins
I recently got myself a set of lighter acrylic paints, and had a pack of blank clothespins around, then this happened:
Six colors of paint, many clothespins, and a set of sharpies met up for a party and created something beautiful.
It took me about a day to paint, write on, and re-assemble the clothespins. The result is so pleasing that I almost don't want to give them away, but the knowledge that I can always make balances that feeling out.
Six colors of paint, many clothespins, and a set of sharpies met up for a party and created something beautiful.
It took me about a day to paint, write on, and re-assemble the clothespins. The result is so pleasing that I almost don't want to give them away, but the knowledge that I can always make balances that feeling out.
Wednesday, January 30, 2013
simple yellow back bag
One afternoon I decided to stick a strap on my yellow nylon packing bag, and it turned into a very nice back sling bag.
I have everything I need on the road except for hammocks and food in this bag. I haven't tried walking with this bag for 5km yet, but I expect it would work fine.
Tuesday, January 29, 2013
java regular expression on byte array
Ever wanted to use a regular expresson on a byte array in Java? It turns out that regular expressions are eight bit safe in Java, and bytes can safely map into the lower half of the character type. With a simple adapter it becomes a trivial task.
Demonstration:
package org.yi.happy.binary_regex;
import static org.junit.Assert.assertEquals;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Test;
public class BinaryRegexTest {
/**
* Find line endings in a byte array using a regular expression.
*/
@Test
public void testExpression() {
byte[] data = new byte[] { 'a', '\r', '\r', 'c' };
Pattern p = Pattern.compile("\r\n?|\n\r?");
Matcher m = p.matcher(new ByteCharSequence(data));
assertEquals(true, m.find(0));
assertEquals(1, m.start());
assertEquals(2, m.end());
assertEquals(true, m.find(2));
assertEquals(2, m.start());
assertEquals(3, m.end());
assertEquals(false, m.find(3));
}
/**
* Find null bytes in a byte array using a regular expression.
*/
@Test
public void testNull() {
byte[] data = new byte[] { 'a', 0, 'b', 0 };
Pattern p = Pattern.compile("\0");
Matcher m = p.matcher(new ByteCharSequence(data));
assertEquals(true, m.find(0));
assertEquals(1, m.start());
assertEquals(2, m.end());
assertEquals(true, m.find(2));
assertEquals(3, m.start());
assertEquals(4, m.end());
assertEquals(false, m.find(4));
}
}
And the adapter is as one might expect,
package org.yi.happy.binary_regex;
public class ByteCharSequence implements CharSequence {
private final byte[] data;
private final int length;
private final int offset;
public ByteCharSequence(byte[] data) {
this(data, 0, data.length);
}
public ByteCharSequence(byte[] data, int offset, int length) {
this.data = data;
this.offset = offset;
this.length = length;
}
@Override
public int length() {
return this.length;
}
@Override
public char charAt(int index) {
return (char) (data[offset + index] & 0xff);
}
@Override
public CharSequence subSequence(int start, int end) {
return new ByteCharSequence(data, offset + start, end - start);
}
}
Subscribe to:
Posts (Atom)












