Hot Web Matter

An anagram of Matthew Obert

import time
import sys
import os

def sleep(z):
    for n in range(z):
        print
        time.sleep(0.25)

def hack(s):
    for c in s:
        sys.stdout.write( '%s' % c )
        sys.stdout.flush()
        time.sleep(0.25)
    time.sleep(3)
    print

def repeat(r):
    for duration in range(r):
        sleep(r)
        os.system("clear")
        sleep(r)
        hack("            dc401.org")
        hack("      sleep. hack. repeat.")

repeat(6)

This dc401.py script does the job, but I think it would benefit from some old-fashioned code bumming. For example, I wonder whether I could rewrite the sleep() function to accept multiple arguments in such a way that I could avoid extra time.sleep() and print statements in the hack() function.

But there is an additional constraint: everything should be accomplished in the three named functions, which are a DC401 slogan of sorts. It’s like those “Perl poetry“ competitions — only cooler, because it’s Python poetry. (No offense intended to my Perl-monger friends.)

Read More


Cast Party (2012) by Matthew ObertGraphite, GIMP
My dear friend Vicky just broke her arm, which inspired me to create this pencil drawing / faux-silkscreen digital illustration for a homemade D.I.Y. get-well card.
The caption inside the card reads: “CONGRATULATIONS on your big break! When is the cast party?”
At the risk of giving away the secret recipe to my special sauce (dude, it’s ketchup and mayonnaise!) I figured I’d post a little GIMP tutorial.
You can use Photoshop instead, if that’s how you choose to live your life — just be aware that your menus and dialogs will not be identical to those in this tutorial.
Once you know the trick, you can make any line drawing look like a silkscreen!

Draw something. Make certain that the lines are thick and dark, and that the background is relatively light. In other words: high-contrast.
Tape your drawing up on the wall and photograph it. We’re not looking for a perfect, crisp, high-resolution scan here. In other words: low-contrast.
Open your photo in the GIMP and save as XCF (Edit -> Save As…). NOTE: If you are using Photoshop, save as PSD instead.
Duplicate the background layer (Layer -> Duplicate Layer).
Find the Layers dialog docked in a floating toolbar nearby, locate the new layer (which by default will be named ”Copy of Background”) and click to select it — be careful not to modify the Background layer.
Use the Threshold control (Colors -> Threshold) to make all the pixels in the image either black or white. Play with the sliding control to select an arbitrary threshold value.
Optionally: Invert black and white on the new layer (Colors -> Invert). I did this with the salmon pink and dark green layers.
Use (Colors -> Color to Alpha…) to make the white pixels transparent. NOTE: Swapping the order of step 8 and steps 9 - 11 may produce semitransparent colors, depending on their tint. In other words, highly saturated hues and dark tints (colors blended with black) will remain opaque, but light tints (colors blended with white) will blend alpha transparency into their hue instead of white. Use this option sparingly, as it may produce unpredictable effects.
Use (Select -> By Color) to select all the black pixels in the image.
Click on the foreground color (by default, it’s a black rectangle) in the Toolbox to open the color selection dialog. Pick a new foreground color. 
Use (Edit -> Fill with FG Color) to fill the selection with your new foreground color.
In the Layers dialog, right-click on the new layer, which by default will be named ”Copy of Background” (on a Mac with a one-button mouse, hold down the Option key and click) and select “Edit Layer Attributes…” from the context menu to change the Layer Name to something more descriptive. 
Repeat steps 4 - 12, choosing a different threshold value for each color.
In the Layers dialog, click and drag the layers up or down to taste. From top to bottom, my layers are labeled Black, Wintergreen, Edamame, Flamingo, Wasabi, Salmon, and Mint. (I’ll bet you didn’t think there were that many layers! I assigned alpha transparency to some of the colors, too, so they’d blend.) Leave the Background layer on the bottom — it’s opaque, so it will completely obscure any layers below it.
Save as XCF (or PSD, if that’s how you roll).
In the Layers dialog, click on the eye icon at the left edge of the row for the layer labeled “Background” to hide the background layer from view.
Save as PNG (flatten layers).
That’s it!
If you know what you’re doing, you can reduce the file size considerably by changing the mode from RGB to Indexed, discarding unused colors (Image -> Mode)  but that’s outside the scope of this tutorial.

Cast Party (2012) by Matthew Obert
Graphite, GIMP

My dear friend Vicky just broke her arm, which inspired me to create this pencil drawing / faux-silkscreen digital illustration for a homemade D.I.Y. get-well card.

The caption inside the card reads: “CONGRATULATIONS on your big break! When is the cast party?”

At the risk of giving away the secret recipe to my special sauce (dude, it’s ketchup and mayonnaise!) I figured I’d post a little GIMP tutorial.

You can use Photoshop instead, if that’s how you choose to live your life — just be aware that your menus and dialogs will not be identical to those in this tutorial.

Once you know the trick, you can make any line drawing look like a silkscreen!

Read More