• Introducing R to a non-programmer, in an hour

    January 7, 2014  |  Coding

    Biostatistics PhD candidate Alyssa Frazee was tasked with teaching her sister, an undergraduate in sociology, how to use R. She had only one hour.

    Once you load in a dataset, things start to get fun. We learned a whole bunch of stuff from this data frame, like how to do basic tabulations and calculate summary statistics, how to figure out if you have missing data, and how to fit a simple linear model. This part was pretty fun because my sister started leading the session: instead of me saying "I'm going to show you how to do this," it was her asking "Hey, could we make a scatterplot?" or "Do you think we could put the best-fit line on that plot?" I was really glad this happened — I hope it meant she was engaged and enjoying herself!

    This is the nice thing about R. There are so many built-in functions and packages that you can get something useful with a few lines of code, and you don't really even have to know what a function is to get started (although you should eventually). Then you can go as far down the rabbit hole as you want.

  • Live Coding Implemented

    March 19, 2012  |  Coding

    water

    Remember Bret Victor's live coding talk from last month? He presented an example where he would edit code on one side, and the corresponding visual would automatically update on the other side. It was instant feedback that could help in learning code. Gabriel Florit implemented the idea with D3, and it's called water. Edit on the right and the diagram updates on the left. Try clicking on a number and then holding down the Alt key (or option on the Mac) for slider goodness.

    Also, check out Daniel Hooper's interactive JavaScript editor, CodeBook. It's the same idea but a slightly different implementation.

    [via Waxy]

  • Programming gets you freedom to do what you want with data

    October 26, 2011  |  Coding

    After the vote

    Casey Reas and Chandler McWilliams asked visual designers why they write their own software and how it affects their process:

    The answers reflect the individuality of the designers and their process, but some ideas are persistent. The most consistent answer is that custom software is written because it gives more control. This control is often expressed as individual freedom. Another thread is writing custom software to create a precise realization for a precise idea. To put it another way, writing custom code is one way to move away from generic solutions; new tools can create new opportunities.

    Most of the interviewees are media artists, but there are a couple of names you'll recognize. My favorite, Amanda Cox, uses a Mad Libs metaphor:

    Mad Libs is a game where key words in a short story have been replaced with blanks. Players fill in the blanks with designated parts of speech (“noun”, “adverb”) or types of words (“body part”, “type of liquid”), without seeing the rest of the story. Occasionally, hilarity ensues, but no one really believes that this is an effective method for generating great literature.

    I'm looking at you, non-programming statistician.

    Update: The article isn't there anymore, so you can read the cached page for now.

  • Sorting algorithms demonstrated with Hungarian folk dance

    April 14, 2011  |  Coding

    Bubble sort dance

    We've seen sorting algorithms visualized and auralized, but now it's time to see them through the spirit of Hungarian folk dance. In a series of four videos (so far), folks at Sapientia University in Romania demonstrate how different sorting algorithms work with numbered people dancing around and arranging themselves from least to greatest.

    See them in action in the video below. This one is for Bubble-sort. They move with such zest.
    Continue Reading

  • Code to make your own movie barcodes available

    March 16, 2011  |  Coding

    Austin Powers - Jay Roach (1997)

    You know those compressed movie barcodes that we saw last week? Here's a Python script by Benoît Romito to make your own. Run a .avi format movie through, and voila. Free gift idea: digitize some old home movies and make a personalized barcode for your family.

  • Why everyone should learn programming

    October 28, 2010  |  Coding

    Daniel Shiffman, assistant professor at the NYU Interactive Telecommunications Program, talks programming, computation, data, and why everyone should learn programming in this interview by Mark Webster.

    It's not just about saving time. There are certain things you can discover and be creative with with computation that you can't by hand. They both go together.

    Watch the four-minute interview below. The excitement in Shiffman's voice alone might want to make you learn some Processing (which he wrote a useful book for).
    Continue Reading

  • How to Make Your Own Twitter Bot – Python Implementation

    November 5, 2008  |  Coding, Self-surveillance, Tutorials

    Following up on my post last week about using Twitter to track eating and weight, some of you voiced some interest in creating your own Twitter bot. This post covers how you can do that.

    The Gist of It

    Creating my own Twitter bot was pretty straightforward (much more than I thought it'd be), mostly because Twitter provides an API and the resources to make it that way.

    I wanted something really simple that I could play around with. I just wanted to be able to send a direct message to my Twitter bot, and from there, it would store my data. OK, so here are the basic steps I took:

    1. Create Twitter account for bot
    2. Turn on email notification for direct messages only
    3. Check email periodically for new direct messages
    4. Parse direct messages and store in database

    Continue Reading

Unless otherwise noted, graphics and words by me are licensed under Creative Commons BY-NC. Contact original authors for everything else.