Block printing at the hacklab

Alex is here to lead us in a print workshop. My previous printing experiment failed with intaglio style printing. I meant to try imitation letterpress but didn’t get around to it. Alex is showing us block printing and she knows what she’s doing. Here I try to liveblog what she’s doing. It’s not going to be complete so you’ll want to watch the video too, and probably search for block printing on instructables.

PC290107You can see her laying down markings in pencil. The marks are slightly bigger than the blocks we’ll be using. After she marks them, she uses a syringe to lay out drops of water along the lines. You can see in the photo that the water is beading. She fixes that by scoring over the lines so the water can absorb. After that, she can tear.

Once the paper is torn up she tosses them into a flat tupperware container that’s filled with water. Note that this paper actually has cotton in it, it’s not entirely wood pulp like printer paper. You soak it to get the sizing out, which is a starchy glue thing that keeps it stiff. Warm water works best for this. With that out you can use less force in order to press the paper and leave the indent, also known as the “kiss” of the block. The water also resists the oil so you get a cleaner print.

The extender looks like runny caulk

The extender looks like runny caulk

Now, she mixes the paint. Some tips: You don’t need printer’s ink, and you don’t need to use paint thinner or mineral spirits to clean up. In fact paint thinner or mineral spirits in the kitchen is a bad idea unless you want to be poisoned to death. We’re using oil based paint with an extender. It’s cheap. To clean up we’re using tough-on-grease palmolive. It’s also cheap. Also note that we’re using a dye based paint, not powder in an oil suspension. You can’t mix the two.  After that we’re using corn oil as a cheap alternative to printer’s medium. You might notice that cheap is a theme here. Mix and scrape and tweak to get the desired viscosity. Once that’s done it’s time to ink.

The next segments I’ve conveniently got available in video form! Apologies for the shakycam and poor framing. They were taken on impulse using my point and shoot camera. If we do another workshop we’ll bring a real video camera.

Lucite roller used to ink the mandelbrot block

Lucite roller used to ink the mandelbrot block

It’s best to use a roller than can go over the entire block at once and take as much time as you need for this part. Alex takes her time here, explaining that a lucite roller works, or you can use a rubber one. She explains that attention to detail is probably the most important part. You will get some ink splatter away from the raised edges. Leave that for a photocopier-like effect. She thinks that’s cool, like an underground zine. Sponge it off if you want it to look perfect. Not for Alex, though. If she wants perfect she uses a laser printer. It looks like this is where you get creative and can decide things like if you want to ink the edges of the block so that you get a border when you’re pressing down with the barren.

Finally, we’re ready to do the actual pressing. Alex takes some paper out of the soak tank and blots it from both sides with a towel. She leaves it damp. She lays the paper on the inked block, then takes her time and presses it with the barren several times with even of a pressure. Watch the end of the first video for a better explanation of what to do.

Alex demonstrates this in the first video using a laser etched wood block. The second part we do the same thing but using a laser etched acrylic block. The last video explains cleanup.

Cleanup without the solvents involves a lot of scraping. Alex would first scrape off most of the ink onto tin foil if she wants to use it later, but this time she uses newsprint since it’s going to be thrown out. Eventually she just can’t scrape off any more and she’s left with a fine film. She pours on some corn oil. This dilutes the oil paint and lets her spread it around again. She can polishes it off using crumpled newsprint. After that, she uses grease busting dish soap to clean the remnants off.

All of this is very cheap to do. The tube of extender cost $45 and is the most expensive part. The barren was ten to fifteen dollars at any art store. The lucite roller was about twenty dollars. The tube we used here is still more than a third full and it’s been used for seven years. The oil pant you can find on sales for cheap. The spreaders come in three and six packs from hardware stores and cost only a couple bucks. Best of all, this all can be done in a kitchen, just like the video shows.

Whew. And that’s the end of the liveblog attempt. Take a look at Owen’s photo set on flickr and my gallery below. I have photos for the first few steps which Owen missed, and he’s got photos that I couldn’t take while I was recording video.

Reblog this post [with Zemanta]

Worthwhile vim tips

David Wolever is the man who made me productive in vim. Not from the ground up, mind you. I already knew the basics from my internship like how to swap between modes. I’d internalized that each string of keystrokes forms a command with a verb[0] and, if applicable, movement keys. It was enough to use as a lowest common denominator if I had to edit a configuration file on a server but I was fooling myself by thinking I knew enough to use it as a development environment.

Here he puts into writing the same tips he gave me last year when taking an operating systems course together. (It was the first time I had to use vim on a project of a considerable size.)

It’s come up a few times, so I’ll just go and post it here: the things, in no particular order, I believe to be the bare minimum you should be able to do while you’re editing source code (and how to do them in Vim): [Easily move between files, jump-to-definition, and search for/highlight the current word.]

The first two tips on movement between files, and jumping to function definitions are the most important and have turned vim from small project editor (like, oh, university assignments excepting the operating systems course) to an editor that I can use on moderately sized projects. It doesn’t take that much practice to use the :tag command but I still fumble when using the hjkl movement keys. David was right to encourage me to use them over the arrow keys, though, as it’s the convention used in just about all of the vim commands.

In the same spirit here’s a couple things that I wish someone told me about while I was still an intern, using vim to edit config files because it was the only thing available on those Solaris boxes. They’re basic where David’s tips are intermediate, but they’re also essential:

Know your movement keys

And not just hjkl or the arrow keys. Vim likes to have upper and lowercase characters mean different things but it doesn’t always hold in the case of movement keys. Know that “b” goes to the beginning of a word and “e” goes to the end of the word. Meanwhile, “g” goes to the beginning of the document and “G” goes to the end of the document. These can be combined with commands like delete. The [t]ill movement key is especially helpful there, and I often find myself typing “dt(” which means “delete until the ( character.” Lastly, you can easily jump to a specific line number mentioned in the trace by prefixing it with a colon, so skip to line 13 with :13.

Use set

Even today half the time that I use vim it’s on someone else’s machine. The easiest way to turn on line numbering is to type “:set number” which will toggle it on. To toggle it off you use “:set nonumber”. There’s no meddling with someone’s .vimrc this way and it won’t persist, so no worries about upsetting anyone’s preferences.

Similarly, you can use set to change values of settings, like change the tabstop to five spaces with “:set tabstop=5″. This is especially useful when editing someone else’s python files where they use a different tabstop than you, and you don’t want to permanently change your tabstop but just want to edit their file.

String search and replace

Okay, now you’ve got line numbering on, so you can do a search and replace. It works based on the string search and replace regular expression. You have to specify a range, but there’s a convenient shorthand for a range of the entire file.

For lines 5-15 inclusive, you can replace “fizz” with “buzz” by:

:5,15 s/fizz/buzz/g

And to replace fizz with buzz on the entire file, use:

:% s/fizz/buzz/g

Using the regular expression here can be quite powerful, so if you’re not aware then I suggest you read up on it. If not, know that the s denotes string search and replace, the first thing between the slashes (fizz) is what you’re replacing, the second (buzz) is what you’re replacing it with, and the “g” means that you’re doing a “replace all.” Remove the trailing “g” if you only want to replace the first instance from the cursor.

And it’s not related to vim, but you can do a string search and replace on several files by using a command similar to:

perl -pi -e “s/string_to_replace/string_to_replace_with/g” *.conf

[0] Wincent.com has a writeup that includes similar observations, and contrasts to Emacs.

Reblog this post [with Zemanta]

Fooling around with Wave

I’ve received two e-mails from Google today. They’re both regarding Wave. First, there’s the e-mail saying that my name was put forth by a Googler (thank you to the chap from #hacklabto, you know who you are) for a developer sandbox account and please fill out this form with your desired usernames. The next was saying that I was accepted into the preview. Sorry, my invites are already spoken for.

After a bit of play with Wave my first instinct is that it’ll be great for collaborating on taking class notes. The problem is that most of my class notes involve pretty big formulas. The solution? I’m writing a gadget that takes in LaTeX code and returns a PNG suitable as a blip. I’ll be using LatexRender for that part. The downside that I can immediately see is that most of my lecture halls don’t have wifi signal, but maybe releasing the gadget will be useful to someone out there.

I don’t yet have my developer sandbox account but I’m working with the Wave gadgets tutorial. It looks like an AJAX-enabled textbox will do the trick. The state handler will check if there’s a pre-rendered PNG; if so it’ll display that, and if not it’ll query the PHP script. I’m hoping that I’ll be able to instead replace the gadget with the static PNG render once the editing of the Wave is done but I haven’t discovered the hook for that yet. I also hope that the state handler will be called immediately after init, and I think that’s the case, but judging from the documentation I’m not entirely sure.

I’m hoping to have a simple version of the gadget that just takes LaTeX within two weeks of getting my sandbox. The pipe dream feature would be a WYSIWYG editor that outputs LaTeX, so for the foreseeable future I’ll just be copying and pasting from LyX.

Reblog this post [with Zemanta]

An experiment in printing

I was sitting in my book history lecture and looking at a picture of a compositor putting his type into a galley. Later, we watched a video of John Kristensen talking up letterpress. It shows him laying out illumination by hand. It also shows his linotype, but he still spent a fair bit of time laying out type.

John got me interested in letterpress. I don’t think I’ve seen a letterpress book in person yet, and though I have opportunity to in the Fisher Rare Book Library, I figured it’d be more fun to make my own little booklet. I don’t have a linotype, but I do have access to a 500 dpi laser etcher. I’m sure it won’t meet John’s standards but I’ve decided to attempt to make a couple printing plates out of acrylic.

Book history buffs might immediately think of intaglio printing. While it’d be easier to etch the forms for intaglio printing, I’m a bit worried that it’ll be a lot harder in the long run. It’ll certainly mean I’ve got more work since I need to clean excess ink off the plate. I’m not sure if it works with straight-down pressure rather than a roller and, if it does, it looks like it’ll need more than your standard movable type press. I think a roller is more likely to break off parts of the acrylic than pressing right down; pieces like the circle inside an engraved “a” would be easy to snap. The worst part is it’s impossible to accurately control the depth of the cut in our laser etcher, there might be a problem with the grooves or maybe it’ll be too deep or too shallow.

Instead I’ll try to carve out the equivalent to a movable type form, burning down the majority of the acrylic. The downside here is running the laser that long. A single plate will take ages, and I worry about the heat and exhaust. There’s still a chance that the acrylic will just break when put through the press.

I’m going to make a small plate for each type of printing and give it a go before I make what’ll likely be a pair of plates for a quarto print.

Reblog this post [with Zemanta]

So long SugarSync, hello Dropbox

I’ve had some problems with SugarSync. My Leopard install died, and I also reformatted my Windows 7 machine to go from RC1 to the copy of RTM I received through MSDNAA. Now I can’t add my “new” machines to SugarSync because I’m at my two machine limit. Worse still, I can’t have my “new” machine take over and restore from their synced folders automatically. If I want to get all that stuff back I have to download them one by one over the web front end. I’d be better off if I rsync’d everything to one of my servers.

I put in a support request on the forum but got no reply. I could put in a support ticket, but I won’t bother. I’m just going to switch to dropbox.

What’s that you say? “But dropbox doesn’t have Windows Mobile support!” Well, I’m not convinced that SugarSync has it either. I installed their client and it crashed on launch. No error message, it just dies. I put in a support request and I’m told to reinstall. Okay, I use Remove programs, delete the CAB file from my downloads, clear my browser cache, redownload and reinstall. The issue persists. I reply to the ticket, and I’m told to reinstall. I use Remove programs, dig through the registry with Resco Registry Editor, delete any key that looks related, delete the CAB file, clear my cache, redownload and reinstall. The issue persists. I reply to the ticket.

What do you think I’m told in response? Yeah, reinstall.

SugarSync now has no advantages to Dropbox for me. I can see how the Magic Briefcase is useful for recovering files after a crash, but not the machine specific folders, and I might want to keep backups of folders without sharing them over all computers. I’ve already seen that their support is poor, so it’s time to try the other guys.

What I did Friday night (or: I might be a geek)

I’ve recently picked up an Arduino with an ethernet shield. I didn’t have good reason to, and I probably shouldn’t have paid as much as I did, but it sure is a fun toy. I say that as someone who’s played around a little with AVRs too. I bought my kit on Friday night. I sat down, followed the install guide, and before I knew it the sun was rising and I had written an IRC bot that connects via ethernet and doesn’t need a computer at all.

I learned about AVRs in my Computer Organization course, CSC 258. It’s one of my favourites because we had a great instructor, Corey Manders. I won’t be able to forget the first day of class. He admitted that he already set the course grading scheme and couldn’t change the weighting of labs, but he still wanted us to do nine labs instead of the three or four our course usually contains. I’m glad we voted yes. He also pulled some strings to get us, the lowly computer science students, access to an engineering lab with FPGA development boards and awesome oscilloscopes. We wound up doing three labs in TTL gates, three labs in FPGAs, and three labs in AVRs. We also had an assignment in gate logic and another AVR coding.

Atmel AVR ATmega8 PDIP
Image via Wikipedia

I wound up coding a simple game, a security system, sophisticated blinkie and interrupt triggered serial communication; all in assembler on AVRs. It was good prep for working in C on my own later. I only dabbled in it. The summer after CSC 258 I decided that I wanted to get my AVR on the internet. There were plans out there that required you to build your own board using an ethernet controller with an SPI interface, but you had to load in your own TCP stack which took up most of your RAM. Maybe I could have a second AVR just for ethernet? There was another expensive box that I handle sockets for me, and maybe I could use wireless over SDIO, or any number of ideas that required circuit building skills that I didn’t have. Eventually I twisted my programming cable in the wrong way, the solder broke, and I forgot all about it.

Nuit Blanche Toronto, in front of the Royal On...
Image via Wikipedia

Fast forward to last Friday. I had volunteered to staff the desk at Hacklab.to to keep it open until 4am for Nuit Blanche. I wanted something to do so I hit Creatron to buy some LEDs, capacitors and transistors to make blinkies. Right below the glass on the checkout counter was an array of gadgetry from Arduino and Sparkfun. Temptation was too much this time. I broke down and bought the Arduino kit with an ethernet shield.

The Arduino itself was $31.75. It hurt to pay that much for what I knew contained a microcontroller that was, at most, worth two dollars. The premium I paid was for the board which contained a USB to serial adapter, software to program using it, several LEDs and a button. Pretty paltry for a development board, but it’s there. Okay, there’s one more thing that they add that makes the premium worth it: The headers for the shields. These shields mean I can skip all the work of building in extensions like ethernet support, or bluetooth, or any number of complicated addons. The ethernet shield cost $67, which stung a bit, but I knew that the ethernet controller on the board alone was probably worth $50. Plus, I wouldn’t be capable of building the thing myself.

On the same Friday night I got I’ve managed to write a very basic IRC bot that can maintain a connection and listen to commands. It differs from the other IRC bots out there because it reads line by line, not character by character, then tokenizes the string. Right now I have a very simple branching table which is good enough.

My plans are to first merge it with the hacklab.to toilet code so that we can revive the IRC bot. Previously it would connect, spit a message, and then disconnect. It got a little spammy. My version will maintain the connection and spit out a message and include rate limiting.

For the curious, here’s the blocking readclrf() function that I wrote, as well as the code that keeps the simple bot going. In its present form I think it’ll eventually crash, I need to properly allocate and free the memory when tokenizing. Readclrf() should be fine though.

[cc lang="cpp"]void loop()
{
if (client.available()) {
char c[256];
readcrlf(c, 256);
//Serial.println(c); // debug

// tokenize the string, enter FSM
// maybe generate an interrupt on PING?
int i = 0;
char *msg_tok = strtok(c, ” “);
char *msg_toks[6]; // TODO: allocate this properly later
while (msg_tok != NULL) {
strcpy(msg_toks[i], msg_tok);
if (++i >= 6) {
break; // :nick!user@host #channel :command arg1 arg2
}
msg_tok = strtok(NULL, ” “);
}

if (!strcmp(msg_toks[0],”PING”)) {
// it’s a ping, PONG IT BACK
client.print(“PONG “);
client.println(msg_toks[1]);
Serial.print(“Ping? Pong! “);
Serial.println(msg_toks[1]);
}

// Command loop checks all tokens
for (int j; j < 6; j++) {
if (!strcmp(msg_toks[j], “:quit”)) {
client.println(“QUIT”); // add verification
}
// add port reading and setting commands here
}
}

if (!client.connected()) {
Serial.println();
Serial.println(“disconnecting.”);

client.stop();
for(;;)
;
}
}

int readcrlf(char *buf, int max)
{
memset(buf, 0, max);
int b;
int i = 0;

while (client.connected()) {
b = client.read();

if (b == -1)
continue;

if (i >= max) {
break;
}

if (b == ‘\n’)
continue;

if ((b == ‘\r’) || (b == 0)) {
break;
}

buf[i] = b;

i++;
}

return i;
}[/cc]

Reblog this post [with Zemanta]