party plotting, also braindump of things to blog about

Back from fitbit. Which was a freakin’ awesome internship. More on that later. When I catch up with my 5000 backlogged blog posts (such as, f*** I’m an old senior now, what do I even tell freshman, oh how far I have fallen, also f*** I realized I want to go to grad school but grade fail, sometimes I hate myself, wait maybe that’s all the time, my adventures around San Francisco, the Coultier fashion exhibit was awesome, also Hardware Startup Meetup at Lemnos Labs, random Chinatown restaurant was awesome, I went to the Crucible and made glass tiles,


I did not live on a yacht nor at the Crucible this summer :'(, I should write up our startlabs experience, did I ever talk about weird Chinese social network stuff I learned last semester, I want to do hall murals, did you know paint is really expensive, emergency Europe trip, three countries in three days is terrible idea, how to avoid falling prey to corruption in Europe, did you know if you wear henna you will get to have random conversations (yay thanks to Annie Shin friend in East Bay)

, the results of hackNYancat err hackNY

I think it says “most APIs used.” Yes, we were also known as All the APIs.

, did I tell you I’m blond as of this morning and hopefully rainbow tonight, this person I met coming back on BART from the SF Pride Parade

 

, did I mention I went to Jamaica too, I am an awesome spoiled person, f*** being technically competent if everyone envies the fact that I get to fly for free, did I mention sleeping for two nights at airports before I got home from San Francisco to Atlanta, updates on the diy nanofabrication class, updates on the 21w.789 android class with Victor Youk and Sherry Wu,

, spontaneous presentations with diyBio olin Avery at barcamp boston

, also there was Iron Man cosplay created at the hobby shop at Anime Boston 2012, also there will be epic MITERS seminars this semester covering Solidworks and Eagle and microcontrollers, updates on hexarideablepod (yay youtube video!

also drill trigger motor “controllers”), scheming to finish vending machine, scheming to make a new hexapod because I killed the $50 pololu serial servo controller, I knew I should have gone with fewer outputs, how to get strange things through airport security (it helps to be female and Asian), POV poi scheming, Josh Gordonson made a more awesome spiral on the lathe for Maslab, I learned many things like strain gauges in 2.671 but not as much as I should have, I am an excellent pseudo scientist, did you see the “science” in my inkscape scientific poster caffeine study thing, open source hardware bootcamp in Shanghai likely this upcoming summer, according to David Li, khan academy + adafruit mashup is my latest Grand Vision for Becoming a Good Person and Convincing Myself Slash Others That I am Technically Competent, oh the hexapod reading group and origami hexapod making

Go check out Katy Gero’s blog! Right now! 😀

, obligatory post on origami nanorobots, tinkerCAD CAD in browser is interesting, so is nclab Online STEM library, I am crazy and dumped $600 on a solidoodle 2, crap I should get around to making Instructables for the make-ten-instructables-and-get-3dprinter-or-CNCrouter-thing, make-ten-instructables-and-get-3dprinter-or-CNCrouter-thing, Ace Monster Toys was my summer makerspace, I should blog about controls so I actually learn it before I take a grad class).

Okay, some of those belong in my head, others belong on the MITERS blog, and some belong on the nouyang blog. Anyway.

Right. As it turns out, I am now 21. (No, I had work, I didn’t do anything on my birthday).
Also, as it turns out, my hall hosts the first EC party of each semester. Which would be this Saturday. This clearly needs to be the subject of a qualitative scientific experiment to determine what number of drinks I need to reach a desired level of intoxication. Or maybe the I’m plotting to get so drunk that I never want to drink again experiment.

1. Alcohol takes several minutes to reach your brain. Therefore I should wait several minutes between datapoints. Perhaps twenty?

2. However, then it is unclear whether at the “two drink” mark I will have two drinks in my system or 1.8. However, since alcohol is known to metabolize very slowly, perhaps over the span of an hour or two we can assume that the effects of metabolism may be ignored. The small drink approximation?

3. Ideally I could consistently measure something proportional to how much alcohol I have in my system. However, there are no good DIY blood alcohol content meters that I can just whip up in the next week. See http://nootropicdesign.com/projectlab/2010/09/17/arduino-breathalyzer/.

4. Also make sure I have a friend who will make me drink lots of water.

5. Also this is probably an even worse idea than the caffeine experiment.

Toodles!

[update] So I didn’t actually conduct my experiment, because I’m a sane person and I’ve always been a bit leery of alcohol. Also according to advice from friends, a drink an hour or two is much more reasonable. I did figure out how I feel (what state of mind I am in) prior to feeling terrible / nauseous. My curiosity is satisfied now.

Focuswriter, ubuntu 12.04, typewriter sound effects

In short, in Ubuntu 12.04, if you get “unable to load typewriter sounds” in Focuswriter, open a terminal and enter “sudo apt-get install libsdl-mixer1.2-dev” (if you try “libsdl-mixer1.2” you will get package not found).

Focuswriter (sudo apt-get install focuswriter) is a full-screen tool in Ubuntu for distraction-free writing.

http://flattr.com/thing/417372/FocusWriter-1-3-0-Released-Distraction-free-writing-on-Ubuntu
You can theme it like so, though I prefer the console-like green on pure black, monospace font.

What I really like is the typewriter sound effects (it helps me concentrate & feel productive instead of despairing over my papers). I got the typewriter sounds working in 10.04 through some magic I’ve forgotten. Now I have a clean install of 12.04 on my netbook, but when I went into Settings > Preferences > check Typewriter sound effects > Ok, it said “unable to load typewriter sounds”.

http://gottcode.wordpress.com/2011/06/27/even-more-bugs-fixed-in-focuswriter/#comment-276
@Lito: You need to install the package libsdl1.2-mixer to get typewriter sound effects because they are now fully optional.

Okay… so I try “sudo apt-get install libsdl1.2-mixer” but get package not found. https://bugs.launchpad.net/ubuntu/+source/focuswriter/+bug/897055
According to this bug report, it should just magically be fixed. And according to ubuntu.com, this package is in Precise.
Turns out the package is actually called “libsdl-mixer1.2-dev” for ubuntu. So “sudo apt-get install libsdl-mixer1.2-dev” and yay typewriter sound effects will load.

If you get a package not found error, run “sudo apt-get update” to make sure you have the latest packages. If you still don’t see it, Ubuntu Sofware Center > Edit > Software Sources and make sure all the sources under “Ubuntu Software” and “Other Software” are checked.

SMS gateway to Cosm using Tropo

Here I present a terrible way to use Tropo to create an SMS gateway to Cosm feeds while waiting for the official Cosm SMS gateway to exit beta status.

This stores your Cosm API key in plain text (I don’t know how to avoid this) so it is a terrible solution, but a very easy one.

Background

I read http://cosm.com/docs/quickstart/curl.html
curl --request POST
--data '{"title":"My feed", "version":"1.0.0"}'
--header "X-ApiKey: YOUR_API_KEY_HERE"
--verbose
and
http://api.cosm.com/v2/feedshttps://www.tropo.com/docs/scripting/capturing_incoming_text.htm
currentCall.initialText

How to translate that into python? See http://stackoverflow.com/questions/111945/is-there-any-way-to-do-http-put-in-python.

The app

Create a new Tropos application and use a hosted file.
** If you don’t know how to setup Tropo to do the following, see Appendix 1.

File Name: smstocosm.py
File Text:

import urllib2

val = currentCall.initialText
say(val)
test = ('{ "version":"1.0.0", "datastreams":[{"id":"potvalue", "current_value":"%s"} ]}' % val)
contenttype = "X-ApiKey"

#Edit to your Cosm api key and feedurl,
apikey = "COSM-API-KEY"
feedurl = "http://api.cosm.com/v2/feeds/YOUR-FEED-NUMBER"

opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request(feedurl, data=test)
request.add_header(contenttype, apikey)
#request.add_header('Content-Type', 'your/contenttype')
request.get_method = lambda: 'PUT'
url = opener.open(request)

This file can later be edited at https://www.tropo.com/hosting/.
** If you don’t know what your Cosm Api Key or feed URL is, see appendix 3.

Now add a new phone number for your app.
** see appendix 2 if you’re unsure how.

Text that number with a value (e.g. “45”). Wait a few seconds and Tropo will text you back that same value (acts as a confirmation message that Tropo got it). Then wait another 30 seconds or so and refresh your Cosm feed URL. Voila! Your new value shows up there.

Todo next for me, connect a pot to an Arduino Uno + GPRS shield from Sparkfun, have the pot values sent to Cosm via SMS.

===

Appendix One.

https://www.tropo.com/docs/scripting/creating_first_application.htm
1) Start by clicking on the “Your Applications” Quick Link.
2) Click on the link to Create New Application near the top right of the new page.
Click on the Tropo Scripting icon.
4) For Tropo Scripting Application Name, enter in a name like Tropo Test.
5) Click on the “Use a Hosted File” link and choose “Create a new hosted file for this application”.
The File Name can be whatever you’d like, it just needs to end with the language extension you intend to use (.rb for Ruby, .php for PHP, etc). For the File Text, see above.

Appendix Two.

8a) To the right of the Skype phone number is an “Add a new phone number” link – go ahead and click on it.
8b) Select your preferred area code and then click the + sign next to the area code to add it to your application. Click the X at the top right to close the window and you’ll be returned to your application settings page.
9) That’s it!

Appendix Three.

Note: If you don’t have an API key for Cosm yet, follow http://community.cosm.com/quickstart_no_code (actually that is for the old pachube interface, I updated it for the new Cosm interface below):

Login to Cosm and click on “Keys” in the top right corner (or go to https://cosm.com/users/USERNAME/keys, where USERNAME should be replaced by whatever username you chose when you signed up).

Click the blue “+key” button (https://cosm.com/users/USERNAME/keys/new)

Give it some label, select “use any public feed”, and select permissions options ‘read’ and ‘update’ (because you will want to use this key both to retrieve and to update Cosm datastreams). Ignore “advanced restrictions”.
Click “create”.

After clicking “Create” note down the feed ID that you have just created (e.g. http://www.pachube.com/feeds/15556 would be feed ID 15556).