[rwet week 9] midterm with functions/modules

For this week’s assignment to redo an old one with functions and modules, I decided to go with my midterm. I found this exercise to be trickier than I thought it would be, probably because I had to organize my code in a way that I had not really considered when I first wrote it. Anyway, here it is:


[web dev with open data week 2] internet users

Screenshot 2016-04-07 13.53.30

(See the page here.)

This week, I made a little visualization about how many people have access to the internet around the world. It’s built sort of jankily with SVG. The data is from Gapminder, showing how many people in 100 have access to the internet in 2011. You can see it here.

[nothing week 9] reading response: Notes in Justification of Putting the Audience Through a Difficult Evening

This week, we read “Notes in Justification of Putting the Audience Through a Difficult Evening” by Wallace Shawn. I read up a little about the context of this essay — it was in response to the way people reacted to Shawn’s play,  Aunt Dan and Lemon, about a young, sick girl, influenced by a charismatic family friend to support Nazism. The New York Times reviewer from that time writes, “I can’t remember the last time I saw a play make an audience so uncomfortable, and I mean that as high praise.”

The essay discusses how we enjoy watching film and other media about historical figures we know to be evil, like slave-holders or Hitler, because we enjoy a sense of superiority in knowing that we would never have supported them if we lived in that time period. Shawn challenges this idea, saying that the clarity of time-passed gives us “over-confidence” that we are somehow morally better and smarter than the people who lived back then. There were lots of things that were convincing and refreshing about Hitler, and of course those people who supported him at the time could not see into the future at the atrocities he would commit.

Reading this, the parallels to our current election are pretty obvious, as a lot of people have been comparing Trump to Hitler for the same reasons. If the worst case scenario happens, will our great-grandchildren (assuming they exist after the climate apocalypse) look back at us with the same feeling people currently have for those that stood by and let Hitler win?

The piece is a good reminder that we’re naturally easily influenced by the narratives created by people close to us, or by the media we consume. “Intellectual clarity seems to be a very important weapon in the fight against evil, although ‘clarity’ is of course a very difficult concept to define,” Shawn writes. “I think staying awake rather than falling asleep when people are talking to you is an important component of the definition of clarity.” This line reminds me of the thing people say these days: “Stay woke.”


[rwet week 8] petfinder + nytimes biographies

Screenshot 2016-04-01 14.25.48

Last year, I learned that Petfinder has an API, which was a pretty amazing discovery. For this project, I used its Get Random Pet function, which randomly picks an adoptable pet from its database.

From there, I extracted the pet’s name and description from the JSON file.

I then took that pet’s name, and used the New York Times article search API to find articles with that name as a keyword. I then took the “lead paragraph” from the first article chosen.

I used the NLTK library to split sentences into lines, and then made a little biography poem with alternating lines from each.

I’m pretty happy with the results, though if I had more time I would clean up the code so that it works more consistently. (For example, it currently only really works if the pet name is just one word.)

Screenshot 2016-04-01 14.28.10

Screenshot 2016-04-01 14.36.31

Screenshot 2016-04-01 14.41.21


Screenshot 2016-04-01 14.50.44


Screenshot 2016-04-01 14.56.59


Screenshot 2016-04-01 15.03.52https://gist.github.com/nicolehe/5943a8beb734b5bee5c874eb3a98f6d0.js

[arcade week 8] final cabinet ideas

For our final arcade cabinet, I’m working with Jesse, Paula, and Ian.

We aren’t entirely sure what our game will be, but we’ve agreed upon a few things:

  • Probably prom themed
  • Lighthearted and positive in tone
  • Possibly exploring feelings of awkwardness
  • Maybe dancing related?
  • The cabinet will uniquely reflect the game in some way

We are inspired by the Realistic Kissing Simulator game. Hopefully we’ll narrow it down soon!

[live web week8] recreating an older socket project with webrtc

Screenshot 2016-03-30 10.06.00

Screenshot 2016-03-30 10.06.07

(URL here.)

This week, I simply recreated the chatroom I made a few weeks back using peer.js instead of socket.io. The difference now is that you have to call the other person/people, but otherwise it works in the same way. Much more simple, but maybe less interesting?


[nothing week 8] einstein’s dreams and projection mapping


Without knowing anything about the book going in, I enjoyed reading the first few sections of Einstein’s Dreams. It reminded me a lot of Invisible Cities, in using small vignettes to explore a specific idea, or a version of an idea. Although it’s ostensibly about time — and the different possible ways time could work or exist in our universe — it seems to be more of a reflection on humanity and about people. More about philosophy than about physics, which is a little different from what might be expected from a book with “Einstein” in the title.

One of my favorites was “26 April 1905,” which is the one depicted in the illustration above. It describes a world where “time flows more slowly the farther from the center of earth.” As a result, in fear of old age and death, everyone lives at the top of mountains, and rich people build tall stilts for their houses. Only a few adventurous people visit the valleys and swim in the rivers down below. In contrast, those at the top “have become thin like the air, bony, old before their time,” defeating the whole purpose.

This vignette is very proverb-like, maybe even a little too on the nose. But even so, I thought it was an effective story.

My other favorite was “3 May 1905,” describing “a world in which cause and effect are erratic.” I found the examples and questions it raised to be quite interesting:

A man stands there just now, absently emptying his pockets and weeping. Without reason, his friends have abandoned him. No one calls any more, no one meets him for supper or beer at the tavern, no one invites him to their home. For twenty years he has been the ideal friend to his friends, generous, interested, soft-spoken, affectionate. What could have happened? A week from this moment on the terrace, the same man begins acting the goat, insulting everyone, wearing smelly clothes, stingy with money, allowing no one to come to his apartment on Laupenstrasse. Which was cause and which effect, which future and which past?

In this world, artists thrive and scientists have no power. The reason this example is interesting, I think, is because there is some truth to it that already exists in our world.

I worked with Jamie on our two projection mapping projects this week. The first one we made was having snow fall between two squares:

The second was a spinning pizza in a box. This one was particularly hard to capture in a video with my phone camera, so it’s kind of dark, but you get the idea.

[rwet week 7] midterm: please visit the forum

Screenshot 2016-03-24 22.46.48

For my midterm, I made a “new” poetic form I’m calling “Please Visit The Forum.”

There are a lot of forums on the internet, covering pretty much all imaginable subjects for all sorts of niche interests and communities. I wanted to generate new weirdo community forums, each including a URL, moderator name, contact info and some popular topics.

Screenshot 2016-03-24 23.24.45

I downloaded a bunch of JSON files from Corpora, and then picked two of those files each time. I then mashed the words together in different ways for each of the categories.

While I found Corpora delightful and very useful, I could only figure out how to make this work for a limited group of lists that were formatted in the same way (so that I could consistently grab the values from a specific key in each list).

Screenshot 2016-03-24 22.48.33

My goal was to capture the feeling of surprise and intrigue that you get from discovering a niche community on the internet that you didn’t know about before, and some of the results of my program I thought were pretty effective.

Screenshot 2016-03-24 22.47.27

I think this is this could be more effective and interesting with a larger data set, perhaps with more live data or something more generative. Hopefully I can explore that with later projects.

Screenshot 2016-03-24 23.36.20

[arcade week 7] Out Run

maxresdefault (1)

I went to Barcade on St. Marks and played a few games. I was actually pretty surprised at how many games they had, but I guess these things are coming back in full force (in bar settings).

One game I really liked that I had never played before was Out Run. It’s a driving game with a steering wheel, pedels and stick shift. Immediately, it felt different from other racing games I’ve played in arcades: for one, there are two people in the convertible, which makes it feel more like a leisurely drive and and less like NASCAR. The camera angles are also interesting, because it’s low to the ground, which doesn’t allow for a far view of the road, especially when you’re going up a hill.

The tactile feedback was also a draw – the steering wheel shakes when you run into obstacles or crash, but in a way that feels very different from controller vibrations I’m used to with modern consoles.  You can also pick your music, and go down a number of different paths when driving.

All these little details add up to a game that looks predictable from the outside, but feels very different from the kind of frenetic, competitive car racing games that I’m used to. It makes you feel like driving can be a fun and enjoyable activity in itself, not just because you’re trying to win some big race.

[live web week 6] midterm: swap chat

Screenshot 2016-03-09 10.26.21

Try Swap Chat here.

For my midterm, I made a chat room that takes a picture of somebody else in the room whenever you submit a message. I built it off of the Face Chat from the other week.

One of the first things I added was a thing to tell you how many other people are currently in the room. I kept track of the client count in a variable in the server-side code, and added to it every time a new person joined the room. Once they disconnected, I removed a number, and I sent this updating number over to the client-side, which shows it on the page.

In order to take a picture of a different person in the room, I made an array of all the clients’ socket IDs, and added someone’s ID once they joined, and then removed them once they left.

I knew I had to pick a random ID from the ID array in order to take a picture of that person, but I didn’t want the user getting themselves, so I made another array called notMe[] of all the IDs in the room except for the user’s own ID on the client side. Then sending a message looked like this:

function sendmessage(message, randoPicked) {
//pick a random person each time
randoPicked = notMe[Math.floor(Math.random() * notMe.length)];
socket.emit(‘chatmessage’, message, randoPicked);

From there, I executed the picture-taking code, and added that photo to the text that the original user sent.

There were a couple other extra things I added in order to make the chat experience a little better, like the floating text box, and the auto-scrolling to the bottom of the page once new data is added.

There are still a lot of CSS related things I’d want to change so that it looks better, but getting all my divs lined up properly is a task beyond me right now. I also want to add something that prevents people who don’t allow a camera on the page to not be able to access the content.

Screenshot 2016-03-08 21.07.34

I’ve only tested it myself with two cameras, so we’ll see what happens once more users try it……

See Swap Chat here.