Archive for December 2007

Plushie - Interactive Toy Modeling System

While I can’t so myself, I have friends that can and enjoy doing so. Yuki Mori a Ph.D student, at Fine Digital Engineering Laboratory Research Center for Advanced Science and Technology (RCAST) The University of Tokyo, has developed a system called Plushie that enables you to design and create patterns for 3D plush toys.

Yuki Mori, Takeo Igarashi. Plushie: An Interactive Design System for Plush Toys. ACM Transactions on Graphics (Proceedings of SIGGRAPH 2007), vol.23, No.3, Article No.45, San Diego, USA, August 2007 (Link to the PDF is available on her site).

Collecting Senders from Gmail Using POP3

Over the years, we’ve had a lot of people submit jokes for LOL. Since we’ve recently upgraded the site to allow user submissions, we thought it would be nice to let them know they can now add their own jokes (Truth be told, we were slow adding them).

I’m not going to go into great detail, but I thought I’d post a mini howto. Note: I’m not supporting this code, but you are free to use it

Firstly, Ruby 1.8’s POP3 implementation doesn’t support SSL. stunnel provides encrypted channels for software that doesn’t understand SSL. I run cygwin on my Windows box to get access to essential tools. Note: Configuring cygwin and installing it is beyond the scope of this entry, so ask Google for help.

A quick search for gmail and stunnel allowed me to cobble together the following configuration file called gmail-tunnel.txt

client = yes
debug = debug
foreground = yes

[pop3s]
accept = 127.0.0.1:42
connect = pop.gmail.com:995

Open up a command window and issue this command to start the tunnel:

C>stunnel gmail-tunnel.txt

Save the following code in rpopget.rb and then execute it from another command window while the tunnel is active. It will write a file called address.csv that lists each address and the number of times that person sent mail.

#!/usr/bin/ruby

require 'net/pop'

HOST = 'localhost'
USER = 'YOURACCOUT@gmail.com'
PASS = 'YOURPASSWORD'

$addr = {}

def add_address(a)
    $addr[a] = $addr[a].nil? ? 1 : $addr[a] + 1
end

Net::POP3.start(HOST, 42 , USER, PASS) do |pop|
    if pop.mails.empty?
        puts 'No mail'
    else
        pop.mails.each do |email|
            $stderr.printf(".")

            lines = email.header.split("rn")
            lines.each do |l|
                if l =~ /^From:/
                    if l =~ /^.*/
                        add_address($1)
                    elsif l =~ /^From: (.*@.*)[ ]*/
                        add_address($1)
                    end
                end
            end
        end
    end
end

open("address.csv", "w") do |f|
    f.puts "Address,Count"
    $addr.each_pair do |a, c|
        f.puts "#{a},#{c}"
    end
end

Surfin Sunday - Santa Can You Hear Me

Every once in a while I hop on that rabbit trail known as “the net”. Today’s trail started on twitter. Seeing that I’m a fan of Cali Lewis on GeekBrief.tv, I wondered who she follows. Nosing around, I decided that maybe I should add some more people to follow.

On a whim I put “trader” in the search box, a couple of squirrel revolutions later, and out pops a list with a name I couldn’t pass up — TradingGoddess. Jump to her blog, spin the mouse wheel and out pops the gem below.