Archive for April, 2010

Nursery Rhyme

The idea for the project was to mash-up nursery rhymes. I used speeches from obama and palin to re-populate the rhymne
Little Mr. barack, sat on a check
Eating his curds and growth
Along came a crisis
Who sat down beside his
And frightened Mr. barack month

Little Mr. barack, sat on a stock
Eating his curds and risk
Along came a crisis
Who sat down beside his
And frightened Mr. barack risk


Little Mr. barack, sat on a check
Eating his curds and applause.
Along came a This
Who sat down beside his
And frightened Mr. barack applause.


Little Mr. barack, sat on a pick
Eating his curds and issue
Along came a is
Who sat down beside his
And frightened Mr. barack rescue


Little Mr. barack, sat on a pick
Eating his curds and come
Along came a this
Who sat down beside his
And frightened Mr. barack outcome


Little Miss palin, sat on a win
Eating her curds and kill
Along came a never
Who sat down beside her
And frightened Miss  palin still


Little Miss palin, sat on a McCain
Eating her curds and Al
Along came a pollster
Who sat down beside her
And frightened Miss palin Al


Little Miss palin, sat on a remain
Eating her curds and food
Along came a teleprompter
Who sat down beside her
And frightened Miss palin good


Little Miss palin, sat on a again
Eating her curds and “TARP
Along came a another
Who sat down beside her
And frightened Miss palin “TARP


Little Miss sarah, sat on a Yeah
Eating her curds and question[s]
Along came a together
Who sat down beside her
And frightened Miss sarah question[s]


from BeautifulSoup import BeautifulSoup
import urllib
import sys
import random


words = set()
wordSet = set()
rhyme = dict()
rhymeList = list()

url = "littlemuffet.html"
changer = sys.argv[1]
name = sys.argv[2]

data = urllib.urlopen(url).read()
soup = BeautifulSoup(data)

genderID1 = "Mr."
genderID2 = "his"

#parses speech
for line in sys.stdin:
  line = line.strip()
  line_words = line.split(" ")
  for word in line_words:
    words.add(word)

for word in words:
    wordLength = len(word)
    if (".")  in word:
        wordSet.add(word[:(wordLength-1)])
    elif (",") in word:
        wordSet.add(word[:(wordLength-1)])
    elif (";") in word:
        wordSet.add(word[:(wordLength-1)])
    elif ("?") in word:
        wordSet.add(word[:(wordLength-1)])
    elif (":") in word:
        wordSet.add(word[:(wordLength-1)])
    else:
        wordSet.add(word)


for word in wordSet:
    wordLength = len(word)
    lastLetter = word[wordLength-2:wordLength]

    if lastLetter in rhyme.keys():
        rhyme[lastLetter].append(word)
    else:
        rhyme[lastLetter]=[word]







if "true" in changer:
    gender1 = soup.findAll('span', { "id" : "1" }, { "gender" : changer })
    gender2 = soup.findAll('span', { "id" : "4" }, { "gender" : changer })

    for i in range(0,len(gender1)):
                   gender1[i].replaceWith(genderID1)
    for i in range(0,len(gender2)):
                   gender2[i].contents[0].replaceWith(genderID2)
else:
  gender1 = soup.findAll('span', { "id" : "1" }, { "gender" : changer })
  for i in range(0,len(gender1)):
                  origWord = gender1[i].contents[0]
                  gender1[i].replaceWith(origWord)

namer = soup.findAll('span', { "id" : "2" }, { "namer" : "1" })
for i in range(0,len(namer)):
    namer[i].contents[0].replaceWith(name)

#rhyme 1
rhyme1 = soup.findAll('span',{ "rhyme" : "1" })
baseRhyme1 = str(rhyme1[0].contents[0])
baseRhyme1Last = baseRhyme1[len(baseRhyme1)-2:len(baseRhyme1)]
rhyme1Search = rhyme[baseRhyme1Last]
rhyme1Word = random.choice(rhyme1Search)
rhyme1[0].replaceWith(baseRhyme1)
rhyme1[1].replaceWith(rhyme1Word)
rhyme1[2].replaceWith(baseRhyme1)


#rhyme 1
rhyme2 = soup.findAll('span',{ "rhyme" : "2" })
letters = random.choice(rhyme.keys())
randomList = rhyme[letters]
rhyme2Word1 = random.choice(randomList)
rhyme2Word2 = random.choice(randomList)

rhyme2[0].replaceWith(rhyme2Word1)
rhyme2[1].replaceWith(rhyme2Word2)

#rhyme 3
rhyme3 = soup.findAll('span',{ "rhyme" : "3" })
baseRhyme3 = str(rhyme3[0].contents[0])
baseRhyme3Last = baseRhyme3[len(baseRhyme3)-2:len(baseRhyme3)]
rhyme3Search = rhyme[baseRhyme3Last]
rhyme3Word = random.choice(rhyme3Search)
rhyme3[0].replaceWith(baseRhyme3)
rhyme3[1].replaceWith(rhyme3Word)
rhyme3[2].replaceWith(baseRhyme3)


print soup
Little <span id="1" gender="true" >Miss</span> <span id="2" namer="1" rhyme="1">Muffet</span>, sat on a <span id="3" rhyme="1">tuffet</span>

Eating <span id="4" gender="true" rhyme="3">her</span> curds and <span id="5" rhyme="2">whey</span>

Along came a <span id="5" rhyme="3">spider</span>

Who sat down beside <span id="4" gender="true" rhyme="3">her</span>

And frightened <span id="1" gender="true">Miss</span> <span id="2" namer="1" rhyme="1">Muffet</span> <span id="6" rhyme="2">away</span>

Political Nursery Rhyme from Zeven Rodriguez on Vimeo.

LumiLife

LumiLife is a solar powered lantern that during the day sleeps and charges and comes alive with breath and light at night. It uses a nocturnal circuit and a motor control circuit to light up and bellow the lamp. It was designed and created by Susan Ngo and Zeven Rodriguez.

LumiLife from Zeven Rodriguez on Vimeo.

This is the diagram of how it all flows together.

The nocturnal circuit is made of a 74AC14

This is the schematic for the nocturnal circuit from the beam wiki site.

The motor controller circuit is composed of a 74AC14 and a 74AC240. The motor circuit was made from this tutorial on the beam wiki site. The parts include

74AC14 Hex Schmitt Inverter IC (the MicroCore chip).

74AC240 Octal Buffer / Line Driver with Tri-state Outputs (The Motor Driver).

.22 uF Monolithic Capacitors (Four).

10 uF Monolithic, Electrolytic or Tantalum Capacitors (Two).

2 Meg Resistors red-black-green (Four).

4.2 uF Monolithic or Tantalum Capacitors (One for the Reversing Circuit).

3 Meg Resistors orange-black-green (One for the Reversing Circuit).

1N914 or 1N4148 Diodes (Two).

This picture from the beam wiki site illustrates all of the basic connections for the 74AC14 microcore to work.

This is how to wire the 74AC240

The one thing missing from the graphic above is a cap going from pin 20 to pin 1.

This image shows how to connect the motors and connect the 74AC14 and 74AC240.

•Solar Panels
– Open circuit: 4x 4.5v @ ~20 mA
•Battery
– 3x 1.2v @ 600mAh
•Motors & LEDs = 3.6 @ 300mAh
– 2x Motors
– 6x LEDs

Collager

Collager is a screen based interactive table that lets you compose collages from images you take from your surroundings and then stamp on the screen.  It is designed by Zeven Rodriguez and Matt Swenson for the kids at the NYU Langone Medical Center: The Rusk Institute of Rehabilitation Medicine Pediatric Department.

The system works in 2 parts: the controller and the the over head camera. The controller has a camera inside and a IR light. The controllers camera is used to take pictures of your surroundings. The IR light inside the ball is used to position and stamp the image on to the screen.

The UI of the interface is displayed above. The interface is trying to maintain a easy and kid friendly approach. The use of primary colors is not only design choice, but is a palette for the drawing tool.
The Basic setup for the system is a computer, a 24in monitor, a camera, and a custom puck object we created.

Reddit 5-7-5 poems

This python program grabs headlines from reddit’s homepage and picks a headline randomly and converts it into a randomized 5-7-5 structured poem

Here YEARS Here 2 undercover
for goes YEARS report. Here is author
YEARS evangelical Atheist is church.

consider understands and seeking understands
service host; want understands want no you
assuming fucking one you’re Lunarpages.

Was Laid Off Obama? Off
Obama? for Obama? Off Employee Was Voting
Voting for Was Off Voting

Cool infographic infographic Nintendo Nintendo
infographic infographic infographic Nintendo Nintendo Cool infographic
infographic Cool Cool Nintendo Cool

from BeautifulSoup import BeautifulSoup
import urllib
import random

def haiku(words):

  for i in range(0,5):
    haiku = random.choice(words)
    haikuList1.append(haiku)

  print " ".join(haikuList1)

  for i in range(0,7):
    haiku = random.choice(words)
    haikuList2.append(haiku)

  print " ".join(haikuList2)

  for i in range(0,5):
    haiku = random.choice(words)
    haikuList3.append(haiku)

  print " ".join(haikuList3)


url = "http://www.reddit.com/r/reddit.com/"
titlesList = list()
num = int()
haikuList1 = list()
haikuList2 = list()
haikuList3 = list()

data = urllib.urlopen(url).read()
soup = BeautifulSoup(data)

for tag in soup.findAll("p", {"class" : "title"} ):
  a = tag.findAll("a", {"class" : "title "} )
  titles = a[0].string.encode('ascii', 'ignore')
  titles = titles.strip()
  titles = titles.split(" ")
  titlesList.append(titles)

num = random.randrange(0,len(titlesList))
words = titlesList[num]
haiku(words)

Power Consumption Calculation for xbee 900

First we calculate our battery
The battery is rated at 3.7v @ 200 mA to make it easier to convert later we turn it into micro volts.

To calculate the Watt hours = voltage * Amps
740,000 micro watt hours = 3.7volts * 200,000 micro amp hours

Now we Calculate the xbee 900 which run at 3.3v:
The xbee has 3 modes we have to deal with their consumption:
sleep mode: 60 micro amp hours
transmit mode: 210,000 micro amp hours
receive mode: 80,000 micro amp hours

next is calculating the time ratio
We are sending and receiving 100 times a day
each takes 1 second
thats 200 seconds everyday 73,000 seconds
31,556,926 seconds in one year
73,000 secs/31,556,926 secs = .002 the xbee is transmitting and receiving during the year

We have combined the 2 events so we can average:
80,000 micro amps and 210,00 micro amps = 135,000 micro amps

Now that we have a time ratio we calculate
(.002)(3.3volts)(135,000 micro volts) + (.998)(3.3volts)(60 micro volts) = 740, 000 micro amp hours
The right side of our calculation gives use Watts and the left gives us Watt hours

891 watts + 197 watts = 740,000 micro amp hours
1088 watts = 740,000 micro amp hours
740,000/1088 = 680 hours or 35 days on one battery
we need this to last at least a year and a half
That will be 27 batteries but we’ll need closer to 36 batteries to be safe

The most important number is that for a year and a half we need more then 3600 milliamps at 3.3v