Wednesday, December 18, 2013

AWIS Citizen Science Panel

Tonight I was on a panel at a meet-up for the Association for Women in Science! The panel was on Citizen Science. It was cool!

I said a bunch of things that I don't really remember. I talked about Foldit, which is pretty quintessential Citizen Science, and how the fact that it makes the sciencey tools available to normal people is what's awesome, even more so than it being a game. I also talked about the Citizen Computer Science I do, in the form of PhotoCity and the Face Frontier. There's some coooool software/algorithms out there, and I just want to make it so anyone can try it out on data they care about! So we can make things even better!

But enough about me (that was just so I remember kinda what I said for the future)... the other panelists had awesome things going on that you should know about.

COASST: Beach strolls with a purpose 

This is a beach-monitoring program for basically cataloging birds that have washed up on shore. Interested volunteers go to a training program, get their guide to dead birds, and are off! Apparently it takes about 20 hours to become an expert, and the volunteers' work quality is monitored, so COASST knows whether or not to trust your work. They're always collecting data so they're able to know what the baseline is. Agencies and and sometimes citizen volunteers ask for data a couple times a month. I heard a number like 800 people were involved, and these were all kinds of people, people in the community who live near the beach, people who like looking for sea glass, people who heard about it from their friends and family. I love that beach-monitoring can be a useful thing for the beach-enthusiast to do and learn about.

The bird-field-guide part made me think of LeafSnap. Computer vision IS trying to recognize birds... maybe they should get into washed-up-beach-bird territory. 

HiveBio: A DIY bio hacker space in Seattle

I didn't know this was a thing! Wet science... I know so little about it... I think of crowdsourced biology still being limited to spitting in a tube and sending it off, so I'm glad to know (some of) those things could be demystified and I could get the chance to do them myself! Also, the idea of a hacker space that revolves around molecular biology instead of robots and programming is really cool. I wouldn't even know where to start with such a thing, and I liked that these women realized people where getting overwhelmed with DIYbio options and addressed it by offering focused classes.

I heard they are in the middle of a microryza campaign and y'all should support them: https://www.microryza.com/projects/hivebio-community-lab-education-resources-community

Project Violet: Adopt a drug

Project Violet gives people the opportunity to help fund cancer research in an involved and transparent way. Adopt a drug, and get updates on that drug as science happens to it, as it gets tested, as it goes through trials, etc. If the drug doesn't work out (only about 1 in 1,000 succeed apparently) and your adopted drug drops out of the race, they'll give you a new drug to root for. 

Other stuff

I mentioned PoorMe and after the panel, a woman came up to me and told me about pharmacovigilance. Like the public health monolith of delayed and incomplete data that PoorMe was trying to tackle, pharmacology (prescription drugs) doesn't have a super efficient and effective way to know when drugs are ineffective or have negative effects outside the trials. A person has to be sick enough to report it to their doctor, and they might not even say anything because they think that's how the drug is supposed to work. 

I wish I could say that PoorMe totally worked and it should be copied and used it for this new purpose (which sounds like a superhero worked) but that whole idea of citizen public health still needs some work. What will incentivize people to contribute even when they're feeling unhealthy... 

Soooo, yeah! That was tonight! The world is full of cool and interesting people doing cool and amazing things and sharing the ability to do cool things with everyone else!

Another thing about people learning to program!

Oh, another thing! My dream for the world is that more women and awesome people learn to program so they can code things for science. Not just behind-the-scenes science... up front and in your face citizen science. Like, make web apps and phone apps with the people who want to get the rest of the world more involved. And as a bonus, learn all about how the sciency bit works, and how to re-engineer it to be interactive and accessible and make use of input from the crowd!

Sunday, November 3, 2013

BASH (command line) for beginners

If you Google "beginner bash", you apparently get a bunch of long, scary, unstyled walls of text that don't look like they'd be that helpful to beginners.

Ugh, words. I thought we were learning about using the command line.
I use bash a lot (apparently I'm in the command line about 8 hours a week according to rescue time) so maybe I have some useful tips to provide. Try using each of the commands! Make dummy files and folders (see the 'touch' command... 'foo' and 'bar' are standard fake names, but I like cat-themed names) and move and copy and delete them!

What is "bash"?

I don't remember what it stands for. Bad-Ass Shell? Whoops, no, Bourne-again shell. Is Bourne a person? Apparently. A shell is just an interactive prompt, and before there was bash, there was just the regular "Borne shell" called sh. Bash is a unix thing, so it's used for the terminal in both OSX and Linux. On windows, you can get a unix emulator called Cygwin, but the normal windows command line is DOS. I met the guys who made Cygwin! One of them taught me to walk on stilts. Anyway.

If you've used the interactive mode of something like python, you know you can type one line or multi-line code and things run. Same exact thing in your terminal, but the language is bash! 

Make your terminal sexy/pretty/aesthetically pleasing AND readable!

Colors! I wanted to ramble about colors and just having fun customizing your terminal, but additionally, you should pay attention to the color of your cursor and highlight colors and make sure you can actually SEE your cursor all the time. Please don't handicap yourself by making your potentially most powerful tool hard to read. And make your scrollback hella big (in Preferences > Window on OSX).


Tab completion and a couple other shortcuts you should start using asap:

Start typing and the hit tab to complete a file name or path or even an executable name! It'll complete as much as it can and then show you hints. Saves you from typing it all out yourself and is faster and less error-prone.

command-a (to go to beginning of line)
command-e (to go to the end of a line)
command-u (to delete everything you've typed on that line and start over)
up arrow to redo commands you did recently

Tell your friends to do these things. Superpowers++

"Where am I and what am I doing?" commands

The command line can be disorienting. If I forget what I'm doing or need a twitchy thing to do while my brain processes something, I'll type ls and pwd

ls

List the stuff in this directory! I usually tell where I am by what is in a directory... and to remind myself what files I might be trying to edit.

Other variations:
ls -l (to show details)
ls -lh (to show details in Human-readable format)
ls -lht (to sort things by Time modified)
ls *.jpg (list only files of a certain type)
list prefix_* (list only files starting with a certain prefix)

I actually put 'a's in my ls commands, like ls -lah but I don't remember what the a does. OH! It shows hidden files (see very end).

pwd

Print working directory!



cd <some other directory path>

Change directory!
cd ../ to go up one level
cd ../../ to go up two levels
cd / to go to the root of your entire computer's directory structure
cd (with no argument) to go to your default home directory
cd ~ to also go to your home directory
cd ~/some_folder (to go from anywhere to a folder in your home directory)

mkdir <new_directory_name>

Make a directory!

cp <file1> <file2>

Copy a file! 

mv <file1> <file2>

Move (or rename) a file, without leaving a copy behind

rm <file>

Remove/delete a file... and it's gone forever!
rm -r <directory_name> (to Recursively delete a directory and everything in it. BE CAREFUL WITH THIS ONE...)

touch <new_filename>

This just makes a new file... or updates an existing file's last-modified time. Okay, touch is only kinda useful, but you can use it to make empty files to practice copying and moving around.

echo "some strings"

Print out some strings or variables! Variables, mentioned below, have $ dollar signs in front of them.
echo $cat_var

cat <filename>

Meow! The name comes from "concatenate" in that you can use it to print out multiple files at one in one long concatenated string, but you can also use it to print just one file. By "print" I mean show the contents of that file in the command line.

writing things to a file with > or append to end of file with >>

For example...
echo "my cat is named MPEG" > catnames.txt
echo "my other cat is named JPEG" >> catnames.txt

EXAMPLE!!!


I used a bunch of these commands to make a dummy file called cats so I could write "touch cats", and then I used echo to add text to another file and cat to show the contents of that other file. What commands did I actually type? Lets look at my history below!

history

Seeing what you've been up to is kind of handy, but being able to re-run hairy commands you previously wrote is way better. Those #s are ways for you to return certain commands.
!515 will rerun the 'cat catnames.txt' command.
!! will rerun the last command
!<letter> will rerun the last command that started with that letter

Also, the ! is called "bang"! Bang-five-one-five, Bang-bang!

grep

history | grep <part of command I ran recently but forgot>
cat <file> | grep <thing you're looking for on some line of a file>

grep helps you search through text file and history for lines containing certain words. Honest-to-god example of how I use grep (and history) every single day because I'm too lazy to remember how to get to my MySQL database server. I also use it to figure out which file contains some particular method that I'm in search of... And other things, but I will have to thing longer/harder about those other things.
How I log into my database... I'm sure there's a more efficient way.

Okay, we're finally getting to the heavier-duty bash commands I use a lot, but maybe I should just write a second post with fun bash commands encountered throughout the day on a day when I'm deeply immersed in it. 

variables 

They're kind of awkward because you assign them one way (with an = sign and no spaces) and use them another way (with a dollar sign in front)

catSound="meow"
echo $catSound 

for loops

When I was making a web photo album of my photos when I was 15, I really wanted thumbnails of all the pictures. BUT I HAD NO IDEA HOW TO DO IT AUTOMATICALLY, so I did it by hand and it was a pain in the ass. These days, I would type

for i in *.jpg; do convert -resize 200x200 $i tiny_$i; done

You can also do it on multiple lines and not have the semi-colons. the "for / do / done" syntax is what is important. If you investigate bash for loops specifically, you'll get more guidance.


making pictures! 

See one of my very first blog posts on imagemagick and doing command line image fun times!! 

a bash script .sh file

Another real-life story. I write C++ code. Then I write Python code. The python code usually runs a bash script to run the C++ code, where the bash script does some setup and additional file mumbo jumbo that I don't want to do in C++.

A bash script of mine that converts an image to a different "pgm" format, runs another program 'sift' to compute sift features on that image, save those features, and delete the pgm version of the image.

You can run these bad boys by saying "sh myFunScript.sh"

.bashrc and .bash_profile

This is your personal bash configuration. It's basically a script that will run when your machine starts up to set everything up JUST THE WAY YOU LIKE IT. Like Goldilocks and those three bears.  Unfortunately, I don't remember the difference between .bash_profile and .bashrc ... only that I seem to have both and sometimes one references the other.

~/.bash_profile and ~/.bashrc


One thing to know: the . in front means it's a seeecret hidden file and it wont show them in 'ls' unless you add the -a flag. It also wont show when you're browsing files. If you use git, it writes things in .git folders and files. Use ls -a to look for them!

flags and 'man'

All these bash commands are powerful because of all the different options and flags they come with. To learn what flags are available, type 'man <command>' to get the manual or man page.

aliases, and how I made 'lady' and alias for 'man'

If you look in my bash profile, you'll see some fine aliases I set up...  including this tweet-inspired one:



Okay, everything I wanted to say about bash off the top of my head is out there. Now it's time to touch (pet) some real cats.

Tuesday, October 29, 2013

make IRC go (and stay going)

Liveblogging figuring out IRC?! Okay.

Adam and his old grad school buddies have a channel. Adam checks it by going to a server somewhere and looking at it in a terminal. He's always idling in there or somethign so he gets to read the history and see what people were doing when he wasn't looking at it. I've been using IRC through Adium a little bit, but it's not the same.
Hello, Adium...
The first couple steps are just about running an IRC client on a server... which I happen to have already. And then the last steps apply to anyone who is kind of an IRC noob like me, regardless of how they got into the IRC chatroom. (In addition to a chat client like Adium for mac, there are also webpages that let you connect to freenode IRC rooms.) (For web, try this one: https://webchat.freenode.net/ Just put #channelname in the box with the hashtag in front.)

1. SSH into a remote server. I have an amazon box through EC2 or something. One of the tiny ones. It runs the sketchabit webpage.

2. Run a screen. "screen -R" I love screen so much, it lets me do work and have things keep running and reconnect later even when I close my ssh connection.

3. Try to use Irssi, which is a linux IRC client. Find it installed! Learn it is because Adam installed it on my server an hour ago because he anticipated this desire of mine. You probably will need to install it yourself. 

4. /connect chat.freenode.net

5. /nick kaflurbaleen
(to change my username because "kathleen" was taken)

6. /join #adadevacademy

7. /names
(to see who's around... oh look, the version of me signed in on Adium is there.)

8. Detach with the magical screen detach command that is muscle memory now. Ctrl-A (let go) D

9. Apparently I can cycle between irssi windows with Esc (let go) [left or right Arrow Keys]
I can also do /win 1 and /win 2 to cycle

Other things Adam is telling me right now:
/me is some action where I would say
/me is a kitty! and it would say "* kaflurbaleen is a kitty"

10. Private message someone by saying /msg <their name, which you can tab complete> <the message> which will make another window that you can get to with tip #9 above. Quit that with /q 

Chat box in the terminal! Yeah!

11. Try it from my iPhone, where I can log into my amazon box using ServerAuditor.

OpenCV is whack

After my last blog post questioning the behavior of a certain OpenCV method, a colleague pointed me at the source code for OpenCV and the method in question. Turns out, in addition to supposedly (but not reliably) finding a nice transformation between two matching pairs of points, it can also find a transformation between IMAGES by computing optical flow and finding features and doing RANSAC and A BILLION OTHER RIDICULOUS things. Things I don't want it to do!

Bad computer! BAD OpenCV!! I know exactly what math needs to be done, and I don't know if you noticed, but your documentation for that particular function strongly suggests it does some least squares optimization thing.

Objective: solve for the matrix that lets you transform original grumpy cat image to aligned grumpy cat image.
Now that's what I'm talkin' about! And I even got to put the eyebrow markers by her little cat eyebrows.

So, I finally rewrote the damn alignment code: https://gist.github.com/ktuite/7225703

The secret objective of this post is actually to profess my love for C/C++ libraries like GSL (the GNU Scientific Library). (I also like the Approximate Nearest Neighbor Library ANN.) It's kind of hard to learn, with matrix multiplies looking kinda like this: gsl_blas_dgemm(CblasNoTrans, CblasTrans, 1.0, m_gsl_dst, m_gsl_src, 0.0, A); but it's sooooo reliable! And fast! And educational! OpenCV constantly disappoints me, but these other libraries feel like wielding sharp swords forged by the elders.

I basically learned linear algebra from trying to decode and use that part of GSL. If you look at my alignment code, you'll see my (wo-)man-handling of matrices to get my answer.  I think there's another way to do it with a least-squares solver, but that's something I still need to look into/teach myself/get my hands dirty with.

Friday, October 25, 2013

estimateRigidTransform breaks sometimes

Am I crazy? This problem and it's complete lack of documentation on the internet make me feel kind of crazy.

I have some points on two different images and I use estimateRigidTransform from OpenCV to find a [2x3] matrix to apply to one image to make it like the other one. It USUALLY works. But sometimes it doesn't.

So, I have the 27 x,y pixel coordinates on a default/"canonical" face:



"Canonical" configuration of points that all faces get aligned to.  Or something very similar to it.

I also have 27 x,y pixel coordinates on a face I want to align to the canonical face.
Detected face landmarks
I use that function and hopefully get a matrix like this, telling me how to rotate, scale, and translate the image to make it fit.

[1.475374961267126, 0.2485045944873411, -43.47119271840103;
  -0.2485045944873411, 1.475374961267126, 174.3608289828719]


Automatically cropped and aligned based on landmarks


This works for MOST images, but sometimes it just flips out and returns a 2x3 matrix of all zeros! This is why you see obnoxious solid colored squares in the Face Frontier sometimes, because it makes the whole cropped face just be the color in the top corner.

Damn you, solid color square faces...

Here are two of the latest point vectors that make this function wuss out:

[220, 298; 427, 313; 297, 374; 244, 457; 379, 469; 176, 257; 278, 244; 191, 282; 230, 276; 214, 324; 256, 315; 383, 252; 489, 266; 392, 318; 424, 288; 432, 338; 474, 307; 288, 319; 337, 323; 277, 354; 323, 357; 266, 386; 347, 396; 298, 409; 298, 425; 298, 443; 300, 457]

[198.24593, 218.48312; 301.75409, 218.48312; 250, 288.72064; 196.73442, 335.1088; 303.26559, 335.1088; 152.62563, 206.89514; 220.81578, 196.98947; 180.65184, 221.26352; 196.88483, 213.14243; 197.29204, 224.76518; 212.424, 220.57774; 279.18423, 196.98947; 347.37439, 206.89514; 287.57602, 220.57774; 303.11517, 213.14243; 302.70798, 224.76518; 319.34818, 221.26352; 234.78632, 222.358; 265.21368, 222.358; 227.47029, 264.40878; 272.52972, 264.40878; 216.52325, 288.04016; 283.47675, 288.04016; 250, 329.29788; 250, 337.32162; 250, 347.60889; 250, 361.46271]

I've been ignoring the problem, but I have an image of Grumpy Cat that I really need to re-align.


Has anyone else EVER seen it do this?

Friday, October 18, 2013

I think I'm doing grad school wrong

"Wombat" is the term I've adopted for when I'm in fighting-with-servers mode instead of research and design mode.

How to (not?) do grad school:

Step 0: ??? (meander, do stuff that's cool, do stuff that's not cool)
Step 1: Embark on kinda large project to make a game and crowdsource some stuff
Step 2: Build a crappy prototype (ooh yeah, you're learning all about the computer vision algorithms!)
Step 3: Build a pretty slick prototype (learn about hella systems and web things, put that computer vision system in a website! Now it's accessible! I love that!)
Step 4: Iterate on a prototype and get excited about its future potential to take over the world! (Repeat step 4 a lot and change the design a lot)
Step 5: Decide IT IS TIME. TO SEND YOUR BABY INTO THE WORLD. (I know very little about babies.)
Step 6: Aaaaand.... (before it's even released) Fill up all your hard drive space.* No world domination here. Nope. Feel defeated.
Step 7: Sleepily ponder alternatives. Not alternatives to grad school... alternatives to fixing your stupid research project.

Repeat entire process least twice. 




(Luckily, I've been hoarding disk space from the PhotoCity days. I miss that project so much, even though it has the exact same issues [but worse, I like to believe] as I'm having right now. But the thought of snuggling up in those 117G feels so cozy and familiar. Also, I'm tired.)

*The harddrive space is not the only issue. When that part gets sorted out, I'll get to find out how hilariously unprepared my other little servers and worker services are. 

Dear company(ies) with hella infrastructure. I would like you to pay me to do these kinds of projects and I want you to take care of the servers for me. I would also prefer to work with other people and not be quite so independent. 

Saturday, October 12, 2013

Sci-fi books that my brain thinks about long after I read them

Books books books! I'm taking a short break from work to tell you about some books I've read, the links between the fictional book world tech and the real world, and based on random things I remember (and can't forget) about the books, maybe why you should read them, too!

1. The Diamond Age by Neal Stephenson

I discovered some friends working on education apps hadn't read this book! I checked on Goodreads and a lot of folks there have read it, so good job. Maybe you loved it, maybe you're confused by the ending, maybe my 'review' will reveal that I forgot a large chunk of what happened. No matter! Here's what I do remember:

There are these electronic book things (the Young Lady's Illustrated Primer) that some kids get that are like an adaptive, interactive, fancy-schmancy textbook for learning all the things that a child ought to learn. Like reading and arithmetic and different animals and construction machines. So it can read aloud to the kid and then teach the kid to read and be kind of wikipedia-like in teaching about whatever the kid is interested in. No teacher? This book can do it! Or maybe it augments a teacher? I don't really remember, because the main character girl who was not in the right socioeconomic group to get one (or school) did actually get her hands on one. It (kind of) made me think of the plan to drop OLPCs all over Africa and have kids teach themselves computers. Then there's another main character of the book, the woman who does the reading aloud and communicating through the book, who winds up getting to know the little girl using the book as she grows up.

Basically, it's like you need Siri to be more intelligent, but she's not, so you have your app plug into Mechanical Turk and get a human to take care of it. Kind of like VizWiz, the app that lets blind people take a picture and have a turker tell them what they're looking at. But then some of those workers start getting paired with the same app users and they might wind up getting involved in each other's lives! The human touch! It's important! Will artificial intelligence ever be advanced enough to give us that emotional connection? Is the the human element necessary for learning? Stephenson seems to think so!

Also, the idea of adaptive learning is what's hot in education (and game design for education) these days.

I think people want something like the Illustrated Primer... interactive, personalized, unbounded learning. In your pocket! We're already headed in that direction with tablets and interactive e-books (like Al Gore's climate book... are there more? Why is that the only one I can remember?) and interactive data visualizations (like in the NYT) and MOOCs making education more widely available and universal. There are a lot of kinks still to work out, though. The biggest one I know/care about is how "interactive" content is still pretty static, like someone has to design the levels for the math game or the widgets for the website or the homework for the MOOC. But that is why Adam and friends are working on design automation! And that is why I build things that let humans contribute new content!

Anyway. Don't wait to read The Diamond Age on your own Illustrated Primer in 20 years! Read it now!

P.S. I had just finished Anathem on my Kindle and I asked Adam to suggest another Neal Stephenson book, and he was like, "Oh, you should totally read the Diamond Age because it's about a girl with an electronic book like you have there."

2. All 4 books in the Hyperion series by Dan Simmons, especially the last 3 books

The story for me reading these books is that I was in the Twice Sold Tales on 45th and the Ave, perusing books with Adam when I was fresh into grad school, and he pointed out Hyperion and said, "Mike said that was good". It is good! I think it might have been the first "people living all over space" (not just Mars) book I read, since I tend to relate all other space colonization books (see the next two on this list) to this series. My review is not going to do it justice.

My memory of the first book: Spaceship tree! Religious quest that I don't understand. Woman who comes from a planet with higher gravity that makes her short and stocky. The SHRIKE is SCARY. Guy with baby who's getting younger and younger every day. Drunk poet guy.

The next few books: I finally get to know and appreciate more of the characters. There's a spaceship with a personality. People are all over space! They live on different planets, but thanks to the some fancy-shmancy technology, they can connect the planets together. One guy (the drunk poet) has a house with different rooms on different planets. There's a main street and a river that are connected in a huge multi-planet loop. One of the books involves traveling on a raft through down this river (and all over space!), which is like that Escher staircase that always flows downhill but manages to connect in a big cycle.

3. 2312 by Kim Stanley Robinson

Speaking of humans all over space, they're all over the place in this book, too! And they travel between planets in hollowed out asteroids called terraria, that each have a different ecosystem inside. Some are savannas or full of water or totally dark.. not having been to Burning Man, I imaging different terraria offering all kinds of different experiences like different BM camps. They also keep pretty much all of Earth's animals in different terraria zoos because Earth is getting pretty run down and the animals would go extinct there. What would it be like to take a run-down Earth and put all the animals back?? Read the book to find out!

In addition to the terraria, there's also some crazy artificial intelligence that might be getting too intelligent. 

In true Kim Stanley Robinson fashion, there's a lot of drawn out boring aspects of the book, too.

The prologue about sun-walkers on Mercury is really neat, though, so you should at least get the Kindle book sample from Amazon and read that.

4. A Deepness In The Sky by Vernor Vinge

Ah, people are all over space again! But there's one planet that has not been colonized by humans, but it has some smart creatures on it, and they're going through their own technological enlightenment when the humans show up. It's all these smart, inspired characters paralleling a lot of technological advancements of the real Earth (like nuclear scientists) but at an accelerated pace! A warning, though, if you don't like spiders, maybe this book isn't for you.

Compared to the books above, this Vinge book was the most satisfying and fun to read. It's not laced with weird Stephenson sub-plots, nor is it 4 books long. You should read the Diamond Age for its historical (and future-ical) relevance, but you should read A Deepness in the Sky because it's a great story. And you should read the other books if you have time and want to think about what it would be like to live all over space.

What other books do I need to read? Ones that will CHANGE MY OUTLOOK ON LIFE??

Thursday, September 12, 2013

Ingress jibber jabber

Here are some words that were in an email from/about Ingress:

agent global struggle XM human Mind Units aim globe intel ingress report achievement ada klu gylph humans P.A. Chapeau video sequence chilling resistance conquer statement establish control power enlightened retaliate operation redemption rallied hashtag injuries efforts agent Thanatois WON'T LET ANYTHING STOP HIM bring Enlightenment to the world sacrifices message found civilization self destruct code stop misunderstand suicide sacrifice one life for a civilization battlefield full stop niantic end transmission

Honestly, "hashtag" is the only word in this entire email that means anything to me. Oh, and "Chapeau". I know that means hat in french.

Wednesday, September 11, 2013

Figuring out what TO DO

I promised Katie (who previously wrote this idea) I would write down brainthoughts regarding to-do lists and potential to-do list management tools. I started writing such a blog post in the past after finishing typing out a hefty to-do list and then getting overwhelmed by it. I am re-starting it the post because I have a good idea of what to do next, I just can't get myself to focus. (There's so much sunshine and interesting things on the internet! Also I'm kind of giddy about the task I'm supposed to do such that I can't start on the boring tiny place I need to start at.)

Idea #1: Single Task Reminder of What I'm Supposed to be Doing

I've heard people say something like, "What is the single most important thing you can do/should be doing right now? ... So do that."

Yeah yeah yeah, that's a lofty life-philosophy that is probably pretty good to reflect on every now and then, but I'm actually just taking about something that reminds me SPECIFICALLY what SMALL TASK I am doing. If I was pair programming, the other person would (hopefully) keep me on task. But if I'm alone, I'm susceptible to getting distracted by the internet or just by a separate task.


Sometimes I will actually write what I'm working on in a single not-saved text file. But I have dreams of it being part of a sexy styled webpage that gives me a custom link (like http://pastebin.com/ or something) that will maybe even save a history of the things I've been working on.

Idea #2: Something that helps me decide what to work on first/next

Last time I started this post, I wrote, Shiiiiiiit, there's so much to do, I don't want to do any of it. :( I had just finished writing a hefty todo list and it was quite overwhelming. I didn't know where to start and I was tempted to go through the list and try to order it by priority or ease-of-doing or something like that, but I really just needed to just start on SOMETHING.


At that point, I dreamed of a different sexy webpage that would let me paste in my TODO.txt and then pick a random line from it and tell me to do it. But it would let me say no to certain tasks and also track which ones I'd started and finished. For a given task suggestion, I could also say, "that's a huge task... the first step in is decomposing it into smaller tasks."

Idea #3: Something that lets me estimate times and compare to reality

I've been on a bit of a kick for estimating how long things will take and trying to become more accurate over time. Hopefully it would make me more confident and realistic about what I can accomplish, and also make me able to communicate realistic plans to other people. Maybe sexy todo.txt tracker from Idea #2 could ask me to estimate times as well.

Monday, September 2, 2013

flying by the seat of my pants

I'm releasing this website called the Face Frontier as part of my research. The idea is to collect tons of photos and labels of faces, facial expressions, and other facial attributes in order to teach computers to understand emotions in faces.

Currently, computers can sort of (under particular viewing conditions) recognize the "basic" expressions: fear, anger, sadness, joy, surprise, disgust. That's because someone has fed in psychology datasets of people in a laboratory making these expressions.

"Basic" expressions from CMU's Multi-PIE dataset

But come on, some day Siri is going to look at your face while you're talking to her and she's not going to look for FEAR vs. DISGUST. She's going to look for mild annoyance and confusion and amusement and attention/distraction and concentration and stuff like that. Maybe you'll be able to communicate via subtle expressions to your phone without actually talking out loud. (Or that old-fashioned typing/screen-touching.)

Getting back to my point, I've developed this website (that still needs a lot of work) and I feel simultaneously amazed that I have cobbled together this system that mostly seems to work, and also super critical of my own work and that I have no idea what I'm doing.


So it means a whole lot to me that you're a) trying it out, making me laugh, cheering me on and b) giving me feedback, pointers to things that are broken, and clues about what to focus on to make it a better experience.



Maybe it's an awkward and inefficient way to go about work, but I rather like Facebook being a source of bug reports intermingled with grumpy cat face swaps.

Now I have grand plans to redesign the flow of the site so if you get sucked into swapping faces with Not Bad Obama, you'll be directed to even more excitement and adventure.

Onward!

Thursday, August 29, 2013

Twisted magic so webpages can wait for longer term process to finish

Computahs!

I occasionally want to show images on my face research website that show off the average of hella (technical term) images blended together. Problem is, sometimes I haven't finished making these images yet, because they can have thousands of images in them and take a couple seconds to produce.

I totally just implemented a thing that is handy. It is a Twisted thing.

A webpage can request something (in my case, an image url), and if the image is ready, it gets it right away.

If the image is not ready, however, the webpage doesn't poll or ask again later, it just sits on the line waiting for the image to be ready. And if it (or the viewer) gets bored, they can refresh/re-ask, and it'll be like, "yo dude, it's still not ready, be patient and you can have it when it's done."


This is one of the things I'm making. It's an average of 600 of my faces!

DIAGRAM
Diagramorama! The jobs are part of the twisted server. And they are actually a dictionary. And all the other boxy things are  browser windows with lil tabs.

The part that makes the work happen

cluster_image_jobs = {}

def makeClusterAverage(cluster_id):

    @defer.inlineCallbacks
    def _makeDeferred():
        # this uses inline callbacks to the thing itself is a deferred
        print "making cluster average", cluster_id
        
        yield askDbForSomeStuff()
        yield doDirtyWorkOfMakingCluster() 
        yield moreStuffThatIsPartOfTheHardWork()
        
        defer.returnValue(cluster_id)

    # CALL the deferred thing to actually start running the job
    # notice how we return it to the outer function 
    # in case you really want to wait for it/add more callbacks 
    
    job = _makeDeferred()

    # the cleanup function
    def _removeJobFromList(cluster_id):
        print "Done with cluster job %d, removing from list" % (cluster_id)
        del cluster_image_jobs[cluster_id]

    # if there's not already a job in the list, add it
    # i only add a job if one's not already there 
    # so an older job can't remove a newer, in progress job from the list
    
    if cluster_id not in cluster_image_jobs:
        job.addCallback(_removeJobFromList)
        cluster_image_jobs[cluster_id] = job

    return job


The part that lets browsers ask for stuff 

@defer.inlineCallbacks
def getClusterImage(cluster_id):

    # if the job is in the list, sit around and wait for it to finish
    if cluster_id in cluster_image_jobs:
        print "Here I am waiting for the job to finish..."
        yield cluster_image_jobs[cluster_id]
        print "Sweet! The job has finished now and I can get on with my life!"
    
    some_id_that_i_needed = yield doSomeDatabaseStuffThatIWantedToDo()
    
    cluster_image = "image%d.jpg" % (some_id_that_i_needed)
    
    print "returning cluster image: ", cluster_image
    defer.returnValue(cluster_image)

Monday, August 5, 2013

One week of Fitbit

I didn't give much of a crap about the Fitbit until something clicked about 2 weeks ago and I impulsively ordered one for me and one for Adam. I think I was walking up the stairs in my building and I wanted credit for walking up the stairs. And for some reason, buying an expensive little device was the answer.

Some observations and anecdotes:

1. I wear in on my bra and I feel like Iron Man when I start and stop activities by pressing the center of my chest. Riding on the bus gives me a couple hundred steps and I don't want that because I didn't earn those steps! So I log when I'm on the bus and mark it as bus-riding on the website later.

Fitbit kinda makes me feel like Iron Man but slightly less of a badass.

2. Adam got one, too, and we have discovered many a late night happy hour around Capitol Hill while trying to make our 10,000 step quotas. Not sure if increased money expenditure and food/drink consumption is what we were going for, but hey, we are finally getting out and exploring our fine neighborhood. For example:
  • La Cocina Oaxaquena has $5 margaritas and $5 tacos (2x) with homemade tortillas that are quite tasty! 
  • Capitol Cider is still neat with its plethora of cider options and fancy paintings. I made Adam try some habanero cider.
  • The Pie Bar that replaced Saley's Crepes (which luckily just moved down the street) is pretty cute! 
  • Need to try moar places!! While we are still young and hip and living in the center of everything.

3. I like getting feedback on my sleep. I got the Fitbit One that does sleep tracking, and feel like that part is more novel to me (than exercise/activity), because I've never been able to track that before. I'd like to discover how much sleep I really need, because without an alarm, I seem to sleep for 9 or 10 hours. I don't know if those long sleeps are always after a few nights of not enough sleep or in the middle of the cold, dark winter or when I'm hiding from work or what. 



4. Yes, the presence of the fitbit does get me to "choose" a more active route when given an opportunity to decide, like between stairs or no stairs, or taking the bus that is better timed but involves more walking. Apparently walking slightly more is not valuable to me on its own, but when a snazzy little device gives me feedback, I want to get the positive feedback! 


5. Gamification? This makes me think about Jesse Schell's Dice 2010 talk that includes a little segment about "what if we gamify everything in the real world?" I said at the beginning that I got the fitbit because I wanted credit for taking the stairs instead of the elevator. (Is that bad? I feel like an animal! I am an animal!) Obviously I am getting some amount of joy/information/learning/life feedback from the fitbit, so I don't think of it as evil. And I don't think of it as a game, I think of it as a little pet, like a tamagotchi (I had a Giga Pet, actually) that needs walkies. Or that takes care of me and tells me I need walkies. I don't know, I'm conflicted. Gamification seems bad, but feedback can be really useful, and it can come in the form of a game/game-like elements.

Tuesday, July 30, 2013

Why tampons suck / lifehack for ladies

Which would you rather put in your mouth? Which would feel less uncomfortable taking out of your mouth again?


Pleh. I am getting kind of uncomfortable thinking about putting either of those in my mouth, but I'd prefer the silicone one that didn't absorb my spit, dry out my mouth, and leave little tufts of cotton left over. One of those things is like a tampon.

Normally tampons stay out of my life and don't bother me. But this intimidating little girl at camp got me kind of riled up. Now I feel compelled to explain why.

#1: Timing

Related to the cotton ball metaphor above, if you take a tampon out too soon, it's dry and kind of uncomfortable. If you leave it in too long, it's, uh, more moist, but more likely to have leaked. You're not supposed to leave them in for more than 8 hours, so you should need to change it right before bed, both to avoid scary-sounding "toxic shock syndrome" and to avoid leakage in the night. It's like a perpetual optimization you have to solve in your head for some number of days every month for many many many years of your life.

#2: Disposal

You can NOT flush them down the toilet, despite what the packaging says. So you put them in the trash. It's just kinda gross and wasteful. I've heard of dogs eating tampons out of the trash but I have never had a dog while also having a period. 

#3: Supplies

They make different sizes of tampons because of reason #1 and people having different amounts of flow during different times. You have to buy and keep on hand all the different sizes you could possibly need. They all cost money -- part of the lady tax. They make different kinds with different materials, different applicators, different expanding/absorbing patterns. It's up to you to buy them, experimentally put them in your body, and figure out which ones work for you. Then the brands get all new and modern and change on you. You know how you find a favorite cereal/deodorant/shoes and buy it a lot and use it a lot and then suddenly they CHANGE IT or STOP MAKING IT altogether? It's devastating, but especially so when it's a product for your fucking vagina. I am still bitter at Tampax for eliminating the cardboard "satin tip" applicators.

Lifehack: menstrual cup

Getting one of these was like entering the fucking enlightenment. It solves all of the problems above. You can wear it for ~12 hours straight, for light days and heavy days. It doesn't leak at all, if you've put it in right. You change it when you fucking want to change it, like when you're taking a shower. You dump the blood down the drain. You reuse it. You wash it out and boil it to sterilize it. You buy ONE and use it until you lose it or melt it or your pet destroys it (I've only read about this) or you feel bad about not giving the company more business. I bought my diva cup over 8 years ago (at the Herb Room in Santa Cruz because I was a hippie college student) and it's still going strong. I have avoided the use of over ~1,000 tampons. 

The two downsides of menstrual cups are that a) people find them even creepier to hear about than tampons and b) the learning curve is a bit steep, and if you put it in wrong, it's failure mode is pretty catastrophic, like it's not even there.

Monday, July 29, 2013

A lack of empathy on the internet

This tweet (and some of the responses) caught my eye the other day.

https://twitter.com/progrium/status/361233084307353601

What was that tweet about, I wondered? A frustrating general truth about the internet, and/or commentary on a specific event? Ah yes, it's probably related to Phil Fish, who has canceled Fez 2 and is quitting games. That sucks. I don't even know the full extent of what went down, but I would hate to be driven away from my passions/career by some entity that fought against me and turned my emotional responses against me and was outright cruel to me. 

Speaking of games, there was a game jam at my house yesterday. We semi-ironically listened to some music from Fez and other music by Disasterpeace. One of the randomly chosen themes was Stockholm Syndrome, so I read about nasty things humans do to each other and the bizarre ways humans respond. I made a game in Javascript that started out with fairly good intentions. I wanted it to be a reasonable game template for a friend who was learning to program. I wanted to incorporate the game jam's themes somehow. I wanted a fun "graphical" reinterpretation of Candy Box ! with more compound-candy-interest. I wanted the player to experience Stockholm Syndrome so I needed the candy man to be threatening and abusive with small bouts of kindness. I think I made the candy man too creepy to feel positive about, though, so I had to throw in some victim blaming: (e.g. "It was your own love of candy that brought you here!") It's a weird game. I didn't really know how to end it/I didn't really want to end it. You can experience it here or the creep-free, candy-only version here.





The game doesn't really capture my thoughts, though. There is so much more that I've been thinking as I observe the (online) world around me. I need to write long English paragraphs instead. So here goes. This post is about hate, bullying, harassment, nasty human behavior, and empathy.



Responding with a justification

If something is uncomfortable, we try to explain it away, find a rationalization for it. Then it's not quite so uncomfortable. This seems to be the basis for Stockholm Syndrome (according to a Freuidian hypothesis on Wikipedia) wherein the victim identifies with and adopts the values of the aggressor in order to make them less threatening/resolve cognitive dissonance.

I don't think that's a good thing. I guess we all have Stockholm Syndrome with respect to the internet/life.

There are so many nasty things we wind up trying to justify that really don't need it.
  • Rape: S/he was asking for it. 
  • Bullying: S/he needs to just ignore it. 
  • Vile threats: The internet is full of trolls and that's just how things are.

I reject these justifications. Threats and rape and abuse don't deserve to be justified and rationalized away. Even emotional manipulation in a relatively benign relationship does not need to be justified and made okay. These things deserve to be acknowledged... and then addressed head on. 

(Meta comment: This whole blog post is kind of me trying to break down and justify this discomfort so that it leaves me alone. Hmm.)

Victim blaming


Victim blaming is a pretty big part of responding with a justification. Find out more about it here. Don't do it. If you catch yourself doing it, consider why and if what you are doing will have any positive benefit except to make yourself feel better about someone else's terrible situation. My brain now automatically flags comments/articles/actions that fall under this category and then I feel sad and annoyed. Try empathy instead. Or just not getting yourself involved.

Tomb Raider


This article has stuck with me for over a year. Apparently, the "boss level" of some new-ish Tomb Raider game involves fighting off some rapists. If you lose, Lara gets raped. It makes me feel sad for Lara Croft and annoyed that this was how some game designers thought to make players connect with the character. What, why, that's not okay. The article has some good quotes to explain blaming the victim. I don't know how to segue into them, so here:
“She is literally turned into a cornered animal. It’s a huge step in her evolution: she’s forced to either fight back or die.” Generally, character evolution involves how people respond to situations, not what other people do to them. ...
Kat Howard points out how disturbing it is to have whether a character is raped be entirely dependent on the actions of the player: “Here is what we get asked: What were you wearing? Did you know him? Did you scream? Was your skirt too short? Were you in a bad part of town? Did he spend a lot of money on dinner? Were you wearing a bra with that dress? Did you let him touch you? Did you hit him? Did you fight back? Did you fight back enough?”
What. Lara Croft was already sexualized to the extreme... and now this. Go watch Feminist Frequency for more like this.

Anonymity and accountability

I think face-to-face communication can smooth over a lot of ill will between people. And maybe tying peoples' online identities to their real identities can help hold them accountable. But people are still non-anonymously bullied and harassed on Facebook and driven to suicide. And people will still spew hate at each other in person.

Cars vs. bikes

Here's another fine example of blaming the victim: drunk driver cuts off cyclist who is minding her own damn business in her own damn lane, vehicles collide, cyclist loses chunk of thumb, and people on the internet say the cyclist should have been more careful. What?!?! I hate you, Internet. The cyclist, Karlyn, who I worked with at Startup Weekend and is awesome, had the most dignified response I've ever seen:
Thanks guys... agreed, responsibility is shared all around. Although I don't think a bike lane would've prevented the crash, an infrastructure that legitimizes bikes as transportation and separates them from traffic is necessary. There are a million reasons why bike transpo is good for people and cities everywhere, not to mention it's cheaper for everyone involved! I like the idea of holding bikes accountable while riding on the roads, and maybe a formal license would help with that. Bottom line, look out for yourself and each other, wear your helmet, and in Bike + Car crashes, bikes always lose!!

Why are people nasty to each other?

Get ready for a big ol' justification! I think it's for sport. That doesn't mean it's good or right. I think it gives people certain feelings/experiences that they/we as humans crave, but that there are other ways to get similar feelings and experiences.
  • It can be a challenge (a game) to come up with the nastiest thing you can think of
  • It requires some creativity (e.g. the who/what/where/how details of a vile thread)
  • It's an outlet for self expression (see above point on creativity)
  • It's a way to communicate with/show off to their peers
  • It provides a bit of an adrenaline rush
  • It feels powerful 
  • It is one way to hold onto and preserve a specific opinion 

Solutions?

I don't know what each of us can do except try to be more empathetic and make the situation around us a little more positive.
  • Is your hobby sating nasty things online? Why is that your hobby and what do you get out of it? Consider alternative hobbies. 
  • Did you just blame the victim? Reflect on that. 
  • Are you about to justify/rationalize a nasty situation just to say something/provide input/show you have an opinion? Maybe there is a more supportive way to join the conversation.
  • Self-preservation: Extracting yourself from a toxic environment sounds like a good option to me. Lean on your friends. Pay someone on Mechanical Turk or ODesk to filter your tweets. I'm sorry, I totally just made that sound easier than it is... it can be hard/impossible to get out of a shitty situation, but it is worth trying.
  • Acknowledge someone else's shitty situation and let them know you support them.

Empathy to be found some places online

I ran into this Reddit thread on twitter in which a person discovered through a blood test that they were not biologically the gender they thought they were. I read a lot of it and felt many things: empathy for the poster. Warm fuzzies that the internet was being so loving and supportive. Curiosity about the physical, psychological, emotional and cultural logistics. 

I hope online culture changes

Humans have always hated other humans for one thing or another... for being from different tribes/races/religions/sexual orientations. But society changes and we look back and say, "Man, that was really messed up. We're so much kinder now." Maybe we're in an internet cultural dark age and the next generation will be more civil to each other. Maybe the internet is helping us be kinder to one another.

Seattle. Look how pleasant and jolly this bus is!


Thursday, July 4, 2013

CVPR brain dump, part 5 of 5

I think this is going to be the last post about this year's CVPR! It'll be about the fun times I had at the "What makes a good ground truth dataset?" workshop, which is pretty relevant since I make and think about crowdsourcing games that change how people collect data to hopefully collect better data.

Here's a list of many of the datasets used in computer vision research. The field is essentially driven by datasets -- designing and evaluating algorithms to "work" on these datasets, and basing success and publishing on improving the numbers by itty bitty amounts. That's not necessarily a good way to do things, so this workshop was held to discuss how ground truth datasets get made, how they're used in research, and how to create new high quality datasets, and what the disadvantages and advantages are of letting these datasets drive the field.

General Ideas

  • Big data does not necessarily imply good data.
    • It needs to be correct.
    • And it needs to have high coverage/be representative of what data in the real world looks like.
    • All the data we need to solve every task is already out there (on the internet) waiting to be found and used; I think new data needs to be explicitly collected for certain tasks.
  • Data is biased.
    • Check out this Unbiased look at dataset bias.
    • We need more datasets with more universal coverage.
      • Have you heard of WEIRD (Western, Educated, Industrialized, Rich, and Democratic) datasets? It's like psychology experiments that are said to generalize but might only apply to college undergrads. 
    • What are different ways to get better coverage?
  • Correctness of data is important.
    • It can be hard work to guarantee it's correct, and it can't always have that guarantee.
    • Crowdsourced data, especially, is hard to guarantee the correctness of.
  • With crowdsourcing in particular, these are some things we might want to get a better handle on:
    • What are good incentives? Money, curiosity, social connection...
    • What are ways to instruct users to contribute data?
    • What are ways to encourage certain things (e.g. contributing more useful data)?
    • What are the right kinds of feedback to give?
      • Feedback to show users what happened with their data and teach them to contribute more useful data
      • Feedback to encourage/motivate/delight

Middlebury Benchmarks

Daniel Scharstein gave an excellent talk about lessons from publishing and maintaining these Middlebury benchmarks. In addition to the datasets themselves, they also maintain an online benchmark evaluation where everyone can see how different methods compare, and it even captures "snapshots" of the state of the art research across time.
  • Good things about having benchmarks:
    • The community has a shared challenge to focus on.
    • The benchmarks can drive research. They were designed to be super challenging and then people find ways to solve these really challenging problems!
  • Bad things:
    • These datasets are pretty small, so it's hard to tell how general the solutions are. It's easy to overfit to the datasets.
    • People can focus too much on ranking.
    • People can focus too specifically on what the benchmark is about and not innovate in  valuable other directions...
      • because it's too outside the scope of what the rest of the vision community expects
      • or because there's nothing to evaluate on if moving in too new of a direction.

Middlebury + Computer Vision as one big game

These are some ideas and quotes that I couldn't help but relate to game design.
  • Obviously, the online ranking of how well your algorithm does in a benchmark is a straight up leaderboard. And that motivates a lot of people.
  • What Daniel said about maintaining the online benchmarks was how they had to put a lot of work into the UI, give it a nice compact representation, and nice visualizations of the results.
    • They had to make it easy to participate so that people would participate and find value in doing so.
  • He also said a number of things about making the datasets themselves:
    • "We're having a lot of fun creating these datasets!"
      • This was in reference to making a new stereo image dataset for specular objects, where they took a motorcylce, photographed it in all its shiny glory, and then covered it in matte clay spraypaint stuff and took more pictures including ground truth depth images.
      • The fun and challenge of capturing data is exactly what players experienced in PhotoCity and what I hope to recreate in my new project.
    • "Creating ground truth data is challenging and fun!"
      • This sounds similar to the quote above, but this was in reference to inventing new datasets to challenge the computer vision community. Exactly like designing more challenging levels for more skilled players. 

How to proceed

Carl Vondrick's last slide of the last talk of the workshop sums things up pretty nicely: 
  • share datasets
  • share annotation tools and code
  • share lessons