Another Ruby tweet…

Was browsing the new Popular Science archives, which led to an article from 1984, which had a picture of the book Creative Graphics for the BBC Microcomputer, which led me to an archived copy of the book online, which had a dirt-simple program to draw Lissajous curves, which led me to write this tweetable Ruby version. (Phew!)

ruby -rcurses -e"include Curses;i=0;loop{setpos 12*(Math.sin(i)+1),40*(Math.cos(i*0.2)+1);addstr'.';i+=0.01;refresh}" #ruby
****         *******                ********                ******           **
*  *        **     **              **      **              **     *         * **
*  **       *       **            **        **            **       *        *  *
*   *      *         **          *           **          **        **      *   *
*   *      *          *         **             *         *          **     *   *
*    *    *            *        *              **       *            *    *    *
*    *   **             *      *                **     **            **   *    *
*    **  *              **    *                  *     *              *   *    *
*     * **               *   **                  **   *               ** *     *
*     * *                ** **                    *  *                 * *     *
*     * *                 * *                      * *                 **      *
*      **                  **                      **                   *      *
*      *                   **                       *                   *      *
*      **                 * *                      * *                 ***     *
*     * *                **  *                    *   *                * *     *
*     *  *               *   **                  **   *               ** *     *
*    *   *              *     *                  *     *              *  **    *
*    *   **            *       *                *      *             *    *    *
*   **    *            *       *               *        *            *    *    *
*   *     **          **        **            **         *          *      *   *
*   *      *         *           **           *          **         *      *   *
*  *        *       **            **        **            **       *       **  *
** *         *     **              **      **              **     **        * **
 **           ******                 *******                *******         ***

development
ruby

Permalink

If your code base has .xsl files, and you sometimes confuse them with with the .xls files… You might be a Java dev.

development
java

Permalink

An underinsured taxpayer…

Posted (in vain, I’m sure) to Sen. Jon Kyl’s Facebook wall:

I’m a productive, tax-paying, native-born American with inadequate health insurance for myself and my family. Oh, we tried to purchase private insurance, but no one will underwrite us because my wife had major surgery too recently. We wound up having to settle for a $250-a-month out-of-pocket plan. We pay an additional $300 a month for medications because there’s no prescription benefit.

I’ve gone from contractor to salaried status with my employer, so the situation will improve for me. In June, when my benefits start. Until then, I have to wait and worry about my family.

Senator Kyl, I ask you, is this an acceptable situation? Is it acceptable for the millions of Americans who won’t have a reprieve in a few months?

-Jay McGavren, Mesa

Given Kyl’s voting record on this issue I doubt it will even be read. By Senator Kyl, that is. But at least it’ll make the topic a little harder for him to ignore.

I did this as part of MoveOn.org’s virtual march for healthcare reform. Please consider doing the same!

family

Permalink

Ruby Tweets!

ruby -e "i=0;loop{puts ' '*(29*(Math.sin(i)/2+1))+'|'*(29*(Math.cos(i)/2+1)); i+=0.1}" #ruby

about 23 hours ago via web

ruby -rtk -e "w=TkCanvas.new(TkRoot.new{title:paint});w.pack.bind('B1-Motion',proc{|x,y|TkcOval.new(w,x,y,x+4,y+4)},'%x %y').mainloop" #ruby

about 3 hours ago via web

Almost got this one short enough to tweet:

ruby -rtk -e"v,w=0,0;a=[1]*9;c=TkCanvas.new;c.pack.bind('Motion',proc{|x,y|a<<TkcLine.new(c,v,w,v=x,w=y,:arrow=>'last');a.shift.delete rescue 1},'%x %y').mainloop"

Ruby Tk

development
ruby

Permalink

Killing the Pegasus…

Going salaried at my current employer, and have to fill out a job application as a formality. So I was digging around for past employer info in my archives, and came across this e-mail, sent on the occasion of departing Pegasus Solutions…

Date: Sat, 22 Oct 2005
From: Me
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
To: John
Subject: Re: New job!

John McGavren wrote:
 > What level are you now, and what did you put your stat points into?
 > Oh! I'm curious about the loot you got from killing the pegasus too.
 > Any tomes of knowledge? Or swords?

Um, no.  But I am gonna take my stapler with me.

-Jay

family
friends

Permalink

Jemini Tutorial (Part 2 of 2)

In Part 2 of our tutorial, we’ll create some enemies for our player to fight. We’ll set up collision detection, use timers to make a pretty fading effect, and set up a custom manager to coordinate enemy movements and shooting.

Be sure to visit jemini.org for help on starting your own game!

You can view part 1 here.

Jemini Tutorial (Part 2 of 2)

development
games
ruby

Permalink

Jemini Tutorial (Part 1 of 2)

Jemini is a Ruby-based framework for game development. In this screencast, we’ll create a shooter game from scratch.

Part 1 shows creating a project, setting up a game state, loading animations, music and sound effects, and setting up keyboard input and event handlers. (Not bad for 22 minutes, right?)

You can view part 2 here.

Jemini Tutorial (Part 1 of 2)

development
games
ruby

Permalink

Puerto Penasco/Rocky Point was fun, if not exactly my cup of tea… This was my first time to Mexico, so we weren’t exactly seasoned travelers, but we got by and actually had a good time.

Rocky PointRocky Point

Continue Reading »

family

Permalink

SVG On Acid…

Everything so far has relied on some tricky-to-install GUI gem… Working in SVG lets Ruby On Acid make pretty graphics (viewable in any modern browser) by outputting plain text.

Here’s a few samples. I’m sure I could produce more consistently pretty results with more SVG expertise, but that’s something I’ll have to play with another time.

1
2
3
4
5

Continue Reading »

development
ruby

Permalink

A computer can mimic the style of a classical composer by analyzing sheet music. I bet GUIs could be (partially) generated for command-line tools. You just analyze how people mapped a CLI tool’s functions to a GUI wrapper (say, Git vs. GitX), then apply the rules you learn to other CLI tools.

general

Permalink