RSS

We Live in a Science Fiction World

At the most recent Google I/O™, an annual conference in San Francisco at which Google unveils its latest technologies to the development community, Sergey Brin made his grand entrance via Google Hangout. From ten thousand feet in the air. While sky diving. How did he pull off such a feat? He was wearing Google’s latest and most highly anticipated creation, Project Glass.

The mythology surrounding the announcement of the Project Glass devices began a few months prior, when Google X, a secretive and highly experimental division of Google, released a promotional video depicting a world of “augmented reality” where surfaces, spaces, things, and people would be digitally overlaid by maps, encyclopedia entries, and social media information. Project Glass, as Google has portrayed it, will further tie together our already interconnected world, putting at our fingertips a potentially limitless amount of information in a manner unlike Molly’s implants in Neuromancer by William Gibson.

Although most of the functionality portrayed in the promotional video remains to be implemented by the developers who eagerly shelled out $1500 for the first version of the devices to be released next spring, the Sixth Sense project in MIT Media lab has shown that Google’s “augmented” reality is not actually far from it.

However, Project Glass-like augmentation comes at a cost. As it is, students like myself have trouble resisting the distractions of the internet, going onto news and social networking sites during class instead of paying attention to the professor at the front of the room. What is to prevent the same behavior from bleeding into the rest of our lives? How can we prevent our human interactions from turning into an aggregated exchange of tweets, check-ins, and likes? When we start relying on technology to mediate our interactions by providing us with the content of those interactions, we begin to cede not just our thoughts, but the very interactions themselves.

Update: Really relevant article from CNET on “How Google is becoming an extension of your mind

(This post is taken from a reading response for my English class “Science Fiction and the Technologies of Identity,” taught by Professor Alfred Guy)

 
Leave a comment

Posted by on December 10, 2012 in General

 

Tags: , , , ,

American Beauty

Since I decided to take an English class this semester in lieu of an extra Computer Science elective or Psychology class, I have been reading a whole lot more and watching more films.  It’s been a fun process of rediscovering a hobby I enjoy immensely, and I am finding that the worlds with which the movies and books deal (real or otherwise) have unlocked a whole new set of thoughts, questions, and experiences.  If you want to follow what I’m reading, you can check out my Shelfari bookshelf — I’ll update that pretty regularly with some impressions of books that I read.

Anyway, this is a post about a film I watched last night, American Beauty.  Without going too much into the plot, the basic premise is that Lester Burnham (Kevin Spacey) faces a mid-life crisis in which he attempts to break out of what he calls ‘a 20-year coma,’ of depression, dissatisfaction, and general lack of life.  He has a failing marriage, a failing family, and a daughter who simultaneously struggles to find her own identity in the typical world of high-school and pubescent insecurities.  I’ll leave you to watch the movie to get the rest of the details, which I would suggest you do before reading on (spoiler alert).

The characters themselves are sufficiently unique and differentiated that each serves as a symbol of some collection of mental, physical, and emotional afflictions — ranging from depression to drug addiction to curiosity — yet not enough that I was able to identify with any of them as an individual.  Instead, I think the generic-ness allowed me and my friends as the audience to project our own thoughts and identities on each character in turn, creating sets of characters that are as unique as we are ourselves.  The most unbelievable thing about the movie for me, then, was that the movie is poignant to all of us despite the differences in how we perceived the characters.

As an example, when my friends and I were trying to figure out why Colonel Fitts shoots Lester at the end of the movie, we each had different responses.  The consensus was that Fitts was a severely repressed homosexual, and therefore he shot Lester out of anger and embarrassment at Lester’s rebuke of his advances. I actually took the minority view — that Fitts’s advances were fake and intended to test Lester’s reaction to homosexuality, and that Fitts was not upset out of rejection.  Instead, Fitts left horrified because Lester’s rebuke undermined his reasons for being mad at his son and he would never get the opportunity to repair the damage.  Given that the film leaves Fitts’s reasons intentionally ambiguous, I think our responses were interesting because they very much reflect that fact that we go to school in such a liberal social environment as Yale, where homosexuality is embraced as a norm.

American Beauty also left me chewing on another question – who do we think of as being the voice of the film, and more importantly, how can we trust any of the characters’ conclusions given the moral transgressions that each commit?  For example, Ricky Fitts (Colonel Fitts’s son) speaks movingly about beauty in the world and makes Jane (Lester’s daughter) feel loved and wanted, but he is a drug dealer as well as a creep who films others without their knowledge.  Similarly, Lester espouses the need to live in the moment and stops himself before taking Angela’s (Jane’s attractive friend) virginity, all the while abdicating any obligations he has to his job and family.  It is a film of paradoxes, but those paradoxes provide us choices in how we wish to view the world, with equally interesting implications in either case.  Whether we view the world of the film as a dystopic reality or realistic dystopia, it is a beautiful and insightful look into our everyday world.

 
Leave a comment

Posted by on December 1, 2012 in Movies, Reviews

 

Tags: , , , , ,

My first Hackathon

Last week, my friend an I went down to AOL headquarters in Palo Alto to compete (more like participate) in AngelHack, a hackathon with four simultaneous events around the country whose winners would go on to subsequently compete for angel funding from VCs and entrepreneurs in the tech industry.

Although I organized a hackathon at Yale last semester, I found that participating is (unsurprisingly) a whole different beast.

First, something I learned:

There is a difference between doing and understanding. Given the time constraints and the sheer fact that your project will be evaluated on the basis of a two minute demo, your code does not need to be ‘clean’ or well-tested, and there are plenty of features for which you can simply use a plug-and-play solution rather than building it custom. Of course, if you want to turn your project into a real application, you have just left yourself with a mountain of technical debt, but for the most part, a Hackathon project is just something to make and let alone.

Something that impressed me:
The creativity involved in making a new tool, something that is not just a modification of an existing solution, but is an entirely new combination of technologies.

All told, it was a great experience that I would definitely like to repeat. There is nothing else quite like being surrounded by 200 other people who are just hacking away and having a ton of fun, even as you hit the wee hours of morning when you’re running on caffeinated soda and energy drinks.  The corollary to that, of course, is the fantastic networking opportunity — for me this realized itself in meeting Alexey Komissarouk, the UPenn graduate whose blog helped me through both hosting a hackathon and deciding what I would do this summer (this is a great article).  He happened to be sitting next to me during the hackathon, and when I overheard him introducing himself to someone else, I couldn’t help but turn and say, “hey, do you happen to keep a blog?”  You can probably fill in the rest of the story.

So beyond my project and the actual experience of hacking, that’s what I took away from AngelHack.  When it’s a little bit more polished and functional, I’ll post a link so you can check it out. But for those who are curious, it is a web app that allows a single admin create a phone directory with a list of contacts, etc and provide access to that directory via sms. A typical use case might be a parent who compiles a list of doctors phone numbers so their children can simply text “call dr. jones” to the directory number and be connected without having to lookup the number. It’s a problem I’ve run into myself, so I hope my solution can be useful to other people.

 
Leave a comment

Posted by on July 1, 2012 in General, Programming

 

Online Education with Coursera

I think it’s pretty safe to say that my readership doesn’t come anywhere near that of Jeff Atwood or Joel Spolsky, but I do awant to apologize nonetheless for the utter lack of content over the past few months. That said, I am going to comit myself to writing at least one post a week for the duration of the summer (for something a little more intense, see Alexey Komissarouk’s blog post, so we’ll see what interesting things come out of it. Should be fun.

So this first one is going to be a review of my experience with taking an online course with Coursera.org. For those of you who don’t know, Coursera is a quickly expanding online education platform that serves up online courses from places like Stanford, UC Berkeley, Princeton, the University of Michigan, and the University of Pennsylvania (ya, I though you’ve heard of them).  All signs point to them adding more resources from more schools.

Given that I have some spare time this summer when I am not at work, and given that I can only take so many courses during a school year (plus the fact that Yale doesn’t offer CS courses in certain areas), I decided to give it a shot. I’ve tried online learning in the past, and I usually have lost interest/have not stuck with the course all the way through, mostly because there is no one mandating that I do the work, and it is all too easy for my mind to wander while watching a video.

This time was different.  I took the Software as a Service course offered by UC Berkeley professors David Patterson and Armando Fox.  Essentially, the course teaches web development with Ruby on Rails, teaching key concepts like Agile development, behavior/test-driven design, and service-oriented architecture.  In one month, I learned more about web development than I was able to do all year, and I had a number of lingering conceptual questions fall into place.  David and Armando are great professors and deserve kudos for putting together a great course (this is the second iteration of SaaS), and a lot of my learning resulted from the thoughtful way in which they prepared the course materials, but more importantly, the platform Coursera created led to a much more engaging and ultimately educational experience.

The first thing that sets Coursera apart from other online education resources like MITOpenCourseware, KhanAcademy (as a side note, you should watch Salman Khan’s commencement speech at Rice), and others, is that these are real courses.  yes, MIT provides all of the course materials (including exams and answer keys) to go along with videos, but Coursera provides all of that, AND they have the participation of the professors who created the courses, answering questions by email and on forums. And oh yea, did I mention it’s free?

I think the reason Coursera is and will continue to be successful is that they took a traditionally static online education model and made it dynamic.  Through forums that are actually tended to by volunteer TAs, questions that are actually answered by professors, and homework assignments that are actually graded by an autograder (for a programming assignment or quiz) or a real person, they added a level of human interaction and reality that has thus far been lacking in free online educational platforms of this scale.  That the video lectures are posted week by week, rather than all at once, that my homework assignments have [real] deadlines — each of these contributes to an experience that strikes a balance between being serious and enjoyable.

So that’s my take. What are your thoughts?

 
Leave a comment

Posted by on June 21, 2012 in General, Programming

 

Tags: , , , , , , , , ,

Functional Programming and Haskell

Hey everyone — sorry it’s been a while since my last post.  School got off to a crazy start, and I’ve been really busy planning a hackathon, writing material for my iOS course, and just generally being involved with life on campus.  Oh right, and I am taking a few CS courses, too.

This post in particular is dedicated to a hidden gem that I found, and one that has given me a new way to look at programming and problem solving:

In addition to taking my two core CS courses, Data Structures and Algorithms, I enrolled in a a linguistics course that explores how we can represent and manipulate meaning in a computer.  In order to do that, we are learning Haskell. It is an incredible language. Here’s where I’ve been learning, and here’s the scoop:

It’s functional. What does that mean? I had learned Scheme for my introduction to CS course, but I did not understand the essence of functional programing. It’s based on lambda calculus, which is a system for manipulating functions.  Essentially, the lambda “term” are defined as follows (you can read more here if you’re interested):

  1. Any variable or atomic statement, x
  2. Abstraction, λx . M – i.e. turn M into a function, with x as the variable
  3. Application, (M N) – i.e. replace every appearance of x in M (see 2) with N

It may seem a bit confusing, but it is quite similar to how we think about math.  You have functions, denoted f(x) or the like, and you can apply that function to x.  Alternatively, given some expression (without an equal sign), you can turn it into a function by setting it equal to g(x) or the like.  The single most powerful feature of lambda calculus is the ability to pass a function as an argument to another function.  Just like we can apply a function to a variable or a constant (1), we can also do something like f(g(x)) and get a totally new function which we can then apply to some other expression.  What’s more, and here is a place lambda calculus gets cool, is that if a function takes multiple variables, if we give it a value for one of the variables, it becomes a totally new, and perfectly legal function.  This has tremendous implications for how we can manipulate data, and gives you the opportunity to write highly flexible code.

But enough of my raving.  If you don’t believe me, read thisthis, or this.  And get started learning Haskell!  Here are my favorite things about the language:

  • Strong typing – the compiler will yell at you if your types don’t match exactly.  Seriously.  And ghc (glasgow haskell compiler) will give you very precise, useful error messages.  This prevents a lot of runtime errors, and usually means that you will have a working program once it has successfully compiled.
  • First class functions – since Haskell is functional, there is no concept of “parameters” per se, only terms to which you are applying a function.  Because of this, functions are applied to terms immediately following them, and function application takes the highest precedence.  Say goodbye to parentheses!
  • First class math – so many built in functions for math.  One line fibonacci sequence. ‘Nuff said.  Maybe not – the use of guards instead of if-else statements makes code look like real, pencil-and-paper math
  • Infinite lists – didn’t think that was possible?  Thank laziness.

Sold?  If you’re interested in learning the language, I would start with Learn You a Haskell, which gives a great rundown of all the important library functions, as well as gives you a good sense of how to use the functional constructs of Haskell.  More advanced programmers may want to look here.

 
Leave a comment

Posted by on February 14, 2012 in General, Programming

 

Tags: , , , , , , , , ,

New Year’s Resolutions

Since classes start tomorrow, I figured that now would be a really good time to make a post. I am more excited for this coming term than any so far while at Yale, in large part because I am finally going to get to dive into the heart of the computer science major and otherwise submerse myself in the computer science community. In terms of CS classes, I will be taking two: Data Structures and Programming Techniques and Design and Analysis of Algorithms. The first one is going to really whip my C into shape, and obviously give me forwards and backwards knowledge of linked lists, I mean, data structures (okay, okay, it’s really hard to be funny on paper).  The second course, a bit more theoretical and a bit more math-y, will definitely structure my thinking and approaches to problem solving.

But enough of the boring stuff.  I decided last semester that I love computer programming, and even more so, that I want to put the time in to be good at it.  Not, not good.  Great.  So over break, I spent a fair amount of time reading up in the Stanford CS Library as well as various programming blogs like Joel on Software, Steve Yegge’s Rants, and Coding Horror, and my reading prompted me to make the following New Year’s Resolutions:

  1. I will use version control.  Not just for CS assignments, but for papers as well.  As both Joel Spolsky (Fog Creek, Stack Overflow) and the guys at Reliscore described, the use of version control is one of the things that sets apart the good programmers from the great ones.  I can’t tell you how many times I made copies of my project folder for my Yale Daily News iPhone app — I realized that I needed to do version control, but at that point, hadn’t bothered to learn to use git (or even XCode’s built in repository system, for that matter).  But now, I am convinced.  So after a fair amount of research, I installed git on my computer, and set up an account with BitBucket to handle my online repositories.  Why BitBucket, you ask, rather than Github or Google Project Hosting?  Simple answer: free, unlimited repositories (public and private), and, if you’re a student, unlimited users.  BitBucket also allows you to keep Mercurial repositories, which is nice if you prefer that to git.  Also, for Mac users, SourceTree, made by the company who runs BitBucket, is a brilliant GUI for Git and Mercurial on Mac OSX.  Although I will make an effort to learn how to use git from the command line, SourceTree will really help to keep myself organized.
  2. I will learn how to use and write test scripts for my assignments.  In a technical interview I had the other day, I was asked not only how to optimize an algorithm for a given problem, but also what test cases I would implement to check that algorithm.  I was able to come up with a few on the spot — EOF conditions, whitespace, non-ASCII characters, int overflow errors, null pointers — but developing test cases on a regular basis will challenge me to think in a more complete way about the problems that I am solving.  I also decided that I will write my test scripts in Python, which, quite obviously, will help me learn Python.
  3. I will learn as much Linux as possible.  There are so many ways in which Linux can help with coding, whether they be command-line utilities like grep and sed or software like emacs (yes, I know I can use it on a Mac, but I much prefer TextWrangler) and valgrind.  If I want to consider myself a real programmer, then Linux is a must.

Those are my resolutions.  I’ll let you know how they go!

 
Leave a comment

Posted by on January 8, 2012 in General, Programming

 

Tags: , , , , , , , , , , , , , ,

Linked Lists and Pointers – struct node**

As I was reading up on linked lists is C and C++, I challenged myself to write an implementation for the data structure itself (i.e. the nodes) and the list operations (push, pop, etc). On my first go, I wrote the following:

struct node
{
    int data;
    struct node* next;
};

void push (struct node* head, int data)
{
    struct node* newNode = malloc(sizeof(struct node));

    newNode->data = data;
    newNode->next = head;

    head = newNode;
}

The node implementation is correct, of course, but the implementation for push is wrong. Any guesses?

Here is the correct implementation for push:

void push (struct node** head, int data)
{
    struct node* newNode = malloc(sizeof(struct node));

    newNode->data = data;
    newNode->next = *head;

    *head = newNode;
}

My guess would be that your first question upon reading this code is: “What is this struct node** business?” Well, that was my question, and it took me a few articles to figure it out. I first came across the problem in a programming interview book, Programming Interviews Exposed, but it took me until reading Nick Parlante’s article on Linked Lists in the Stanford CS Library to really understand it. I’ll save you the trouble of reading the whole document (although it is worth a read), but the gist of it is this.  When you pass a parameter to a function, whether it’s a primitive, composite (array), struct, or pointer, the function allocates its own stack memory for each of the parameters upon the function call, just as it does for any other local variable.  What this means for our purposes is that the first (incorrect) implementation of push only changes the value of the local variable head and not the value of the pointer that you originally passed, because in this case, head is a pointer to the struct data, not a pointer to the pointer-to-struct.  If you instead pass struct node** head, head then is a pointer to the pointer-to-struct.  By dereferencing head, you then can change the memory address stored at that memory location.

Moral of the story?  Pass a pointer to the data typeof the data that you want to change.  So if that’s an int, pass an int*, if that’s a pointer-to-int, pass an int**.  Seems easy enough…hope I follow my own advice!

 
Leave a comment

Posted by on January 2, 2012 in General, Programming

 

Tags: , , , , , , , , , ,

 
Follow

Get every new post delivered to your Inbox.

Join 27 other followers