Saturday, June 30, 2012

All the World's a Stage...

Last week's TropFest was awesome. I didn't like all of the finalists, but my favorite was Break Up Tour. Worth watching, which now you can because all of them are online! :)



  I've spent more time in Central Park than I'd care to admit. 10.5 hours waiting for tickets, then 3+ hours at the actual show. In a span of just over 24 hours, I've spent over half in the park. Gorgeous, magical, full of fireflies..... and totally worth the time spent there. Granted, I allowed myself the luxury of 'being a bum,' so it was no big deal. In normal everyday hustle-n-bustle mode, I would never have spent (wasted) the time waiting that long. For anything.

Yesterday's sole purpose was to secure these:



Jackie and I tried the day before, failed, came back the next morning at 6:20 am for a breakfast picnic in Central Park (thinking we'd get tickets by 9 am and skip merrily on our way to Hacker School). Ticket distribution starts at 1pm, despite what they told us in person yesterday. We misunderstood their statement of "The first people who got tickets were here at 7:35" to mean that ticket dispersal started at 7:35. Nope. Duh. When we realized this, we'd already been there for 8 hours, so we logged into gmail and IRC through my phone and told the HS facilitators about our... interesting situation. The next several hours were spent pair programming in python on my phone, which I used to ssh into a UNM cs trucks machine. Never have I been more encouraged to write clean concise code.... and never have I been as frustrated with touch typing.

(Accessing arrow keys on the android is an abysmal headache. Sorry, Emacs, I've been converted to Vim.)

I wish I'd taken a picture of the line. The wait was amusing - The two roommates in front of us brought their dog (Hamlet), who was the most adorable, well-behaved, squirrel-catching badass in the entire park. 






They don't allow photos in the performance venue, but it was magical. I leave it at that.

Afterward, Jackie, Trey, Sunah, and I went to eat at an overpriced restaurant, where I had their seemingly watered down '2010 Columbia Valley Cabernet.' (Two more down... three counting Pepijn. 50-some minus 7 to go? Haha.) On the subway ride home, I started feeling ill and abandoned ship to find a restroom. I'm convinced the new barista at One Girl used MILK in my drink, instead of soy >.< 

P.S. I ordered a raspberry pi yesterday! <Nerd swoon>

P.P.S. This is one reason I want to be a computer engineering badass...

Wednesday, June 27, 2012

I love the shiz people post on IRC...

Oh. My. Gosh ---- 

This is officially on my "ToDoEventually" List.

Steven or Amanda, you can thank me later ;)



P.S. I just had a dino-gasm....
RAWRRRRRR

Saturday, June 23, 2012

'Nuff Said



Because 


Tengo Calor!


This is what happens when Sarah can't sleep at two in the morning because it is too darn hotA little voice in my head kept saying "You know you can just buy a fan, right..." 

We call this voice the Voice of Reason. 




We usually ignore the Voice of Reason.


Additionally, 'We' are now royally exhausted. Happy Friday!


Edit: Happy Saturday! Just got back from a night out with Kristi, Linda, and Branka. First a place called Toad House (Blue Point Lager), then 'The Jane' (Vodka + Soda). Also some random bar having a 'soft opening,' but the owners ever so distastefully rejected our business. Overall, a splendid night. Beautiful company, open and on the same page... and they didn't care one bit. This is how life should be. 

Adieu ;)

P.S. I bought a fan. 

Thursday, June 21, 2012

net.dinner = Networking Layers

This week's discussion centered around networking. The beauty of the discussion group is that it exposes us to topics in a less formal context, which helps me remember. It wasn't formal, and I didn't take notes, but here are the highlights of what I recall from the conversation alone (after a day).

  • OSI Layers of Networking  
    • Seven Layers. A few significant ones: 
      • Physical (literal wires, cables, plugs)
      • Network (switches, hubs, wifi)
      • Internet (routers, firewalls, IP addresses)
  • Packets = normally page size (4k) 
    • Mail delivery trucks that carry briefcases   
  • Private and Public Keys --- Briefcase Analogy: 
    • Put secret in a briefcase
    • Snap a FRIEND'S lock on it
    • Give it to a friend
    • Friend snaps YOUR lock on it
    • Returns it to you
    • Nobody needs to share actual keys ( "asymmetric" system ) 
  • Twitter Presenter's suggestion to make your system ....[better word] easily expandable? broad? 
    • Advocating Parallelism vs Serialism 
      • Dependancies - "You won't get a baby in a month if you get 9 women pregnant at the same time."
      • 9 babies after 9 months = Parallelism  
      • Mom 1 = head, Mom 2 = torso, Mom 3 = etc.... Serialism 
    • Asynchronous != Parallel 
      • Steve Sounders's SPOF example: synchronous widget times out and prevents front end from loading. If it were asynchronous, might be skipped and loaded later - not necessarily in parallel. 
There were some great morbid analogies, and Mary's British accent made them even better. I wish I could remember them all. 

Each time, we're going to decide the next topic based on interests of those who showed up. Current interests center around security and networking, so next week we are discussing the OWASP Top Ten Most Critical Web Application Security Risks.    

if( reader.computerKnowledge > 0 && reader.submit (topicSuggestions) )
      Sarah.appreciate = true; 

;)

Shoe Shopping on Broadway


Ok, it's official. I can say I've been on Broadway ;)

Fountain at Central Park


Hershey's Chocolate World


GIANT Chocolate bar. Hand added for scale. 
Gaaaah, to think there was a time I would have eaten all that... >.<


M&M World, NY


Elvis the M&M


Carrying bag for my shoes


Menkes Theatrical Shoe store. Smaller than I expected, but very genuine :)
They had just been in ABQ for the flamenco festival...

MY NEW SHOES!

Suede.


Leather.


Comfort.


Craftsmanship.


They're so beautiful.
Too beautiful -- I don't think I can dance in them! 

</shoe fetish>

In other exciting news, I saw live fireflies for the first time EVER! I actually stopped to record them and would share my half minute of anti-climactic blackness if I thought anyone would watch. Might not have seemed like it, but there was a lot of intensity for those 30 seconds-- me, holding the camera, holding my breath, willing them with every inch of willpower to light up. "c'mon, fireflies.... c'mon!!...."  

For about 15 seconds, I felt like a 6 year old on Christmas morning. :) 

After shoe shopping, my day consisted of wandering around Broadway near 50th Street. I met with Bethany, Mary, and Greg for dinner + networking discussion group at Olieng Thai, then Greg and I walked to Central Park in hope of catching the "Indecision in the Park" Comedy Central show. It was packed and we could only listen in over the gates, but we saw Nathan (fellow hacker schooler) there and chatted the whole subway ride home.

Occasionally, I think there's something wrong with me. Who gives up the chance to see something like the Colbert Report for a day like mine. Could have seen live Colbert, and I chose live fireflies?? 

Yeah, yeah, yeah.... 
I can feel the judgement already. But sometimes I just know what I want.

And he's on television anyway, amiright??? 

Whatever. 

Tuesday, June 19, 2012

Diving into Python the Hard Way

   short attention span
   demand for quality/variety
   desire to learn Python
+ need for useful project
coolProject CreateProject (Dive Into Python, Python the Hard Way, Time)

First, some investigation...

What are Python's strengths? 

According to this:

Python code looks like executable pseudo code.
Can be used as an integration/extension language
Has strong (web) presence

Also
Python is interpreted and interactive
Doxygen-like "Sphinx" allows code to generate documentation
Supports high level datatypes (lists, tuples, dictionaries)

This page has a 'nice & concise' overview:  
Weakness = slower than C/C++/Java
Nimble language, meaning the "compiler and vm are the same program,"
     Load, Translate, Execute (no compiling, which allows optimization)

And Now for Foolish Young Optimism

Looking through basic examples, I don't feel like I need ( or can stomach ) the hand-holding, baby-step, tutorialize-me-to-death approach. Can't I just write something? Why not! 

A little more research into Python's core libraries and standard algorithms: 

Built In Functions (That I Didn't Automatically Assume ) Part I:
  • all( iterable ) - Are all the elements true? AND
  • any( iterable ) - ^ OR
  • callable( object ) - classes are callable (returning instances), class instances are callable if __call__() method is defined (Where/how/why would you use this??)
  • classmethod( function ) - returns the classmethod called function... see below for further investigation of classmethods and decorators etc.
  • cmp( x, y ) - compare two values a and b (answer is int of sign x-y )
  • complex( r, i ) - create complex number 
  • dir( [opt arg] ) - no args=> list variables in current scope; arg=>list valid attrib of arg

Decorators

David and Tom tried explaining this to me yesterday. Decorators are functions that return other functions, often "wrapping" them. 

Stack Overflow to the rescue -- HUGE answer halfway down the page (only read half, but I understand decorators now): 
You see, decorators are wrappers which means that they let you execute code before and after the function they decorate without the need to modify the function itself.
A decorator takes a function as a parameter, basically writes/defines the code to be run (before, yourFunction, after) and returns that as a new 'decorated' function. As for the syntax.... 

[define bow, giftwrap, box functions.... example: 

def box(func): 
   def wrapper():
       print "*bow on top goes here*"
   return wrapper()
]

@bow
@giftwrap
@box
def present(gift=defaultSocks)
     print gift

If you call present(), you get a pair of defaultSocks, in a box, wrapped, with a bow on top. TaDa! 


Pier 17, MoMA, and ....Knitting??

Walking across Brooklyn Bridge ~7:15pm
Pepjin and I went salsa dancing. Every Saturday they offer free lessons and open dance on Pier 17. We met up with Dave, James's friend. 



Color :)


The lesson was fun (SUUUPER BASIC). I seem to have given the impression I was a salsa dancer, though. A few people asked me to dance, pulled hellacomplex moves outta nowhere, then promptly thanked me. For you non-dancers, a 'thank-you' is a double edged sword. It simultaneously expresses appreciation and the most polite version of "I don't want to dance with you anymore"... especially mid-dance. But what do they expect? Fred Astaire wasn't taught in a day. I'd need at least two. ;)

I genuinely enjoyed it for what it was, though I'm too much of a tanguera to switch over now. Salsa lacks the intimacy of tango. 




I wish I'd taken a similar video after 9:30 pm for contrast. It got packed. This was the calm before the Salsa Storm. So refreshing... 


Sunday - MoMa (Museum of Modern Art) 
Untitled 
by Lee Bonticou


Compact Object
by Natsuyuki Nakarishi


[NoIdeaWhoDidItSorry]


Belgian Lion
by Marcel Broodthaers

Untitled
by Keith Haring 

I don't know who did this one or what it is called, 
but I can tell you my initial reaction: 
"...OH SHIT..." 

This, reaction-wise, was my favorite. It's an empty aquarium-like container that you might see at the zoo to hold a reptile or amphibian or poisonous animal of some sort. 

It is empty. 

Huggable Atomic Mushroom
from project "Design for Fragile Personalities in Anxious Times"



[insert BETTER picture here... Mine didn't do it justice. 
"Each of the sheets in Home Is a Foreign Place bears an abstract image and a word printed in Urdu, the artist's mother tongue. The terms she chose, such as "threshold," "border," "country" and "door," paired with her minimal images, create a lexicon relating to the theme of home." says MoMA website]

Home is a Foreign Place
Zarina

Untitled
Rachel Harrison


I saw this and thought of the tool bench at the lab.

 Italian 1960's Kitchen Workbench, I think I need you. 

One Hundred Lavish Months of Bushwhack
by Wangechi Mutu

....

View from the 3rd story of the Museum of Modern Art

Sushi and sashimi after a painfully grueling and thoroughly exhausting day of looking at fascinating artwork.  

Nintendo World - We passed this in Midtown somewhere. I must find it again!

As for the knitting (crocheting, actually)... some of the women here are really into it. After the museum and sushi, we (Dennis -Sweden, Oskar - Sweden, Trey - Colorado, Dominik, and I) went to Shirmung (New York)'s house to knit/crochet. I admit, I originally scoffed at the idea - going all the way to NY to then sit around and knit?? - and wasn't going to participate, but even the boys were game. Peer pressure.

I enjoyed it for what it was. Not my thing, but one woman there helped explain their affinity for the craft.... "At the end of the day, after dealing with men for 8 hours, it's nice to feel feminine.

So true.

Monday, June 18, 2012

"Python - Diving In" Chapter 2

"Python - Diving In" Chapter 2

Setting up a Virtual Environment
  • pip install virtualevn
  • virtualenv NAME
  • cd NAME
  • source bin/activate
  • which python
  • deactivate
  • which python
Activating and deactivating determine whether your script is using your normal environment or the virtual one you've created. 

Important Facts
  • Indentation (NOT {} ) determine function start/end
  • Everything is an object
  • Strongly and Dynamically typed
    • Strong - must explicitly cast
    • Dynamic - determines types at runtime
  • Does not support in-line assignments

Side Project Updates
I documented the Arduino+BT+Android door opening adventure in a README on github.
First encounter with markdown. 

This Markdown Editor was particularly helpful.

Sunday, June 17, 2012

Blue(Tooth) Skies... Smiling at Meeee


Controlling Arduinos by Pinging an Internet Relay Chat Bot

Ping the bot, flip the light! David took the lead on this one. We got this working earlier in the week.

Turning the lights on and off - Arduino + Android + Bluetooth (+spit&tape)


Sending one character by bluetooth (D or L) to flip the light switch. The servo is 360 and continuous, which was more difficult than a stepper. Currently, we attach and detach the motor rather than dictate angle or position. We rely on timing, which explains the multiple rotations in the video each time we flip the light.

Also, we didn't have a flag-like arm to reach back and trigger the lights. A whole bunch of hacker schoolers got involved, helping us extend the light switch and add the knife-arm you see above.

Here's the code. Needs some tweaking, but pretty (stupid) simple.

Notes:
  • Remember to run the Arduino BT Init Sketch  -- Just in case!
  • Select "To Board" (deal w/ Arduino shield, not BTchip specifically)
  • Default Baud rate for ITEAD shield is 9600
  • Default password is 1234
  • 4.5 volts is NOT enough to power the system. (Needs 5- don't be cheap.)
  • Disconnect USB Serial before bluetooth communication. (Defaults to using USB when Serial.available() or Serial.print() called)
  • Ensure Tx/Rx pins are not in use/connected on Arduino when programming. 
    • Had to remove shield EVERY time. Inconvenient. If we were continuing with this, I'd insist on a switch of some sort.

I love how we didn't use other people's Arduino libraries or resources. We stuck with the core Arduino ones. I did, however, use something called Bluetooth Viewer on my Android. It is very basic. Send and receive raw data after making a connection. If we dug further, we might dig there. For now, back to bash! Then javascript/python for Chordulator implementation (see first post.)

Resources : 
BT0417C DataSheet (sans data)
BT Shield DataSheet ( - the data)
Nearly Informative BT0417C Command Sheet

Arduino Servo (Important to read Arduino documentation. Arduino-servo commands != Arduino-stepper commands.)

Friday, June 15, 2012

PHPizza


Today's Guest Speaker: Rasmus Lerdorf, creator of PHP. 
Topic: Code of consequence, something we all strive for. 

It's inspiring to see someone's endeavors toward making that a reality. He talked about projects that he believes are important, one of which was Etsy. I had never thought of Etsy in terms of "consequence," but he discussed the potential to reform - or at least boost - the economies of heavily craft-based societies. He also mentioned the Sahana Software Foundation and their system of organizing disaster relief efforts. Now that is code of undeniable consequence - even something as simple as a 'Person Locator' database. He talked about his experience "diving into" writing PHP. Like many of us, his background was not specifically in computer science, but that did not matter (also inspiring to hear - qualifications shmalifications). He spoke of his travels and his struggles and triumphs... yes, I'm being vague, but the main point - the point that every anecdote came back to - was code of consequence. 

One day, I will write code of consequence. 

Maybe in 10 years. 

Maybe tomorrow. 

After breakfast. ;)

Speaking of food.......

This is how you know you're at Hacker School. :D

And speaking of birthdays, today was supposedly the 25th birthday of the animated gif!


Happy Birthday, Animated Gif!


Sushi Pizza = <3 
(Screen credit to B. Ramsey's hand)

P.S. This ^ is what I do when my roommate keeps me awake, blasting his I-Love-Jesus music into the wee hours. That's great, buddy.... Can we love Jesus at 3 in the afternoon instead of 3 in the morning??? >.< Ah well. I hadn't played with gimp/photoshop in a while. Good refresher. 

Thursday, June 14, 2012

Worst Dream Ever....


From an email excerpt:  

Physical Setting - Nazi Germany
Temporal Setting - Modern Day

"I was with my sister trying to get out of Germany, but we were captured. They sorted us - those to be exterminated and those to do the exterminating, 'officers' saved to do their bidding. They needed me to work with matrices, so I was saved... My sister, not so much. I wanted to escape, tell someone where I was. I convinced a senior officer to let me write to my family, accounting for my sudden disappearance and telling them not to worry. I wasn't sure they'd send it, but I'd find a way. So I pull out my laptop, and the keys are in dvorak - jumbled or something. Pull out my phone - same story. Not that there was internet/reception, anyway. So I find some bark paper and begin etching a message into it. Suddenly I am moderately illiterate (as you often are in dreams), but I never have been before so I figure the horrid spelling is a good indicator something is wrong. I try putting subtle hints - things that aren't true that the Nazi's might not detect... like my favorite color is blue (spelled bLD, for some reason...)  but then I realize my parents won't even bat an eye at that. So I address it to my great Aunt, misspelling her name so she'll know. Then, out of the blue, my parents arrive. My dad goes upstairs to talk about business management philosophy or something with the Nazis, and my mother is with me, upset that I'm not in ABQ spending time with her. "Mom, there's something I have to tell you.... please don't freak out. This is a concentration camp" And she doesn't believe me. "No it's not - Is this the first time you've been in a concentration camp?" Because apparently I don't know what I'm talking about since I've never seen one before and the piles of shoes aren't a dead giveaway. Not to mention the Nazis everywhere. But whatever. So I reassure her and send her on her way. Suddenly I remember that my great aunt is gone, somehow...or maybe in there with me.... So I'm like- wait, I know EXACTLY who can get me out of here (and help me solve matrices!) Joe & Steven! So I start re-addressing the letter... And I think you guys were going to break me out...

Then I woke up."


Had I been born a generation earlier, that could've happened. Really could've happened. It's unsettling. NY != concentration camp -> not sure why I had this dream NOW. Weird. 

HAPPY THURSDAY!



In cheerier news : Today's Eatsy Menu!!!
Home By the Range Eatsy Menu

The Jersey Cow - 100% grass-fed, grass-finished braised chuck roast with Milton Creamery Prairie Breeze white cheddar. (Gluten-free)
OR
The Garden State - Roasted Portobello Mushroom, Fresh Ricotta Cheese, and Caramelized Onions (vegetarian and gluten-free, vegan options available)

Fresh Ciabatta rolls from Sullivan Street Bakery (vegetarian)
Organic Mixed Greens salad with Organic Purple Mizuna, and Organic Spring Onions (vegan, gluten-free)
Pasta Salad with Fresh Fava Beans fresh herbs, lemon, and shaved pecorino fresco (vegetarian, gluten-free and vegan options available)

Tuesday, June 12, 2012

BlueToothAche

Goals:

1. Understand Bluetooth
2. Control light/signal
   A. arduino -> computer <------- done
   B. computer->arduino

ITP Physical Computing Tutorials

 
RS-232 Protocol

Not sure we will be directly concerned with the protocol itself - more with the content of the data being passed. Good to have an idea ^, however.

Serial port -> receive data->control arduino....hmmm, OSC?


Going through BlueTooth Code: 

unsigned int timeout=0;
unsigned char state=0;      //probably for direction of communication?

           
// ISR is not in ATMEGA2560 dasheet. Perhaps keyword for itead?
ISR(TIMER2_OVF_vect)          //Timer2  Service ISR= Interrupt Service Routine!
{
  TCNT2 = 0;                  // set timer2 to 0?
  timeout++;
  if (timeout>61)
  {
    state=1;                  //state 1 means timed-out / idle (if state is 1, we write to the serial terminal)
    timeout=0;                //reset timedout variable
  }

}

void init_timer2(void)           //initialize ... might just be standard for BT timing  
{
  //Timer Counter Control Register A
  //control the Output Compare pin (OC2A) behavior. pg 187
  TCCR2A |= (1 << WGM21) | (1 << WGM20);   // compound bitwise or, bitshifted waveform generation mode
  TCCR2B |= 0x07;   // by clk/1024
  ASSR |= (0<<AS2);  // Use internal clock - external clock not used in Arduino
  TIMSK2 |= 0x01;   //Timer2 Overflow Interrupt Enable
  TCNT2 = 0;
  sei();     // enable interrupts   
}

void setup()
{
  Serial.begin(9600);
  pinMode(2,INPUT);       //Direction/state pin
  pinMode(13,OUTPUT);
  attachInterrupt(0,cleantime,FALLING);  //(interrupt, function, mode) where function =ISR, executed on (every or one? ) falling clock
  init_timer2();
}

void loop()   // main loop .... [insert logic here]
{
  switch(state)
  {
  case 0:
    digitalWrite(13,LOW);  // Tell pin 13 to be LOW
    break;

  case 1:
    digitalWrite(13,HIGH);
    Serial.print("HackerSchool");
    break;

  }

}

void cleantime()
{
  timeout=0;
  state=0;
}

Ok, but where's the bluetooth part? ...hmm...

Interfacing Arduino and Python
David got it working with SkyBot, wired. I'm trying to do it at a lower level... Python IRC Client (LL) (More tutorial-like presentation of material here)

SideNotes - 
Installed pip and homebrew (a pleehg on ze macPooorts of FEHL)



We had lunch with the Etsy people to day... "Eatsy" :D 
Met a woman from Santa Fe!

As you enter the area, there are a couple of small rooms on your left. Perhaps they are offices, but the typewriter is a plushie. Nap room?... Yea, I'd head-desk that. 


Giant statue that reminds me of a cross between a Zelda "Deku," a "Save-Owl," and a Yedi. (Don't worry about it, non-n64-gamer folks ;))

In other news, people who compulsively mutter rather worry me.

Monday, June 11, 2012

Arduino Distractions + NYU Field Trip

Goal: Connect an arduino to the hackerschool IRC and, when pinged, have it do XYZ.

  • Move
  • flash LEDs
  • ping everyone that it's time for lunch
  • tell a joke
  • wave a flag 
  • something!! 
First hurdle - no ethernet shield.

Sonali thought the NYU bookstore or a professor she knew (fellow faculty member) might have one, so we visited the NYU campus.

AWESOME lab - multiple maker bots, blue bin wall of organized awesome, interactive programming lab "ITP".... Circuits and arduinos and a room full of Machining tools! Precision laser cutters, CNC mills, drill presses, really nice stuff! Didn't get a tour or anything, just a peek. Though I must say- my heart's still at ARTS!

No luck with the card, but we decided to try firing up bluetooth and using the computer's internet connection instead. Bluetooth was a headache and half the first time... sigh. Round Two?


Resources
Basic Intro to IRC Protocol
What We're Trying to Do
Arduino Speech Synthesizer


Useful Lunch Time Resource:
Food Trucks
(Today, dumplings. Tomorrow, the world.)


Sonali and David chatting in Washington Square as I did the 'tourist thing.'



So many impromptu music scenes :)

Chess, anyone? Where's the Jekyll-Hyde Pixar man when you need him...

The little B&S voices in my head saw this and wouldn't let it go ....   ;P
...and I'm not convinced they're talking about the drink...!

The blurriest picture I could've managed... Etsy's large craft/meeting room where we have Monday dinners.

Rum-Rasin Pudding from the Azteca Bakery across the street. (Not actually green.)


On Q, you are missed.