Residents’ Digest #02

Resident's Digest Cover: Week 4

Antonius

Last week I started my ITP/IAC fellowship with Mindspark. My team is great. I’m learning so much and they’re very open to me ideating, building and implementing a new product. At ITP, I’ve been running the Illustrator workshops with Genevieve and continuing the Smart Crafting workshop series with Merche, this time on computerized embroidery. Because of high interest, I believe I will run the embroidery workshop again. The fabrication tool I’m most uncomfortable with is the CNC router, so of course I got asked to consult on a project that specifically needs it. I’m friends with carpenter and frame-maker Barry Frier, who works with artist Vik Muniz. Together, we visited the NYU Advanced Media Studio (AMS) to talk about 3D scanning and replicating the frames of works of high art, specifically Rembrandt’s “Lucretia” at the Minneapolis Institute of Arts. But I had to put everything on hold to make sure I had time to write a decent post for my Art21 blog column, Praxis Makes Perfect. And also to rearrange my thesis presentation for ESI Design – Michael Luck Schneider invited me to talk about our responsibilities as designers when introducing new technologies to different cultures and generations. It got me fired up and energized to revisit my thesis and continue where I left off.

Craig

I started building a site to house Dan Shiffman’s amazing ICM videos. If you haven’t seen them yet, you can grab them HERE. To get the best quality video, you should download the vid(s) to your own machine and watch them locally. With the help of Steve “Ruby” Klise, the plan is to build the alpha site as a Sinatra App with DataMapper (Comm Lab Web), push to Heroku (Dynamic Web), store the vids on Amazon EC3 (Thesis?), and back everything up on Github (Everybody).

Next week I start my fellowship with IAC at Vimeo, which I’m looking forward to. Lately I’ve been busy putting together a promo video for the NYU Entrepreneurship Festival, which is happening early November. The video should be posted in a week or two and will have ample ITP representation. Stay tuned.

And, without further delay, your moment of Zen:

Why Facebook is moving away from HTML5 – Jan 2011 Facebook CTO  said they were going all in on HTML5 for mobile. Now, they’re claiming this was a mistake and going native. Why? What happened? Here’s a post from Facebook engineer Tobie Langel offering some technical insight.

Beginners Guide to Twitter API with Python and Terminal – If you’ve never worked with Twitter data, Python, or Terminal, this is a great post/tutorial that takes you through a step-by-step process to grab tweets from the Twitter streaming API and storing them in a file (CSV) on your machine.

Olympics Twitter Data Sculpture – by Emoto

Teux Deux - Every morning I seem to need/wantI to make a quick list of all the things to do that day. This app helps. It’s not an all in one solution, but it does one thing well, and I like it.

Eric

I ran a number of shop safety sessions last week, and we are almost completely done with those. If you have not signed up for a shop safety session, expect an e-mail this next week. For those who haven’t heard, the laser cutter is back to functioning in full, and I took some time this week to watch the repair happen in preparation for working on ITP’s Lasersaur, an open source laser cutter. I was also tasked these past two weeks with an increase in MakerBot maintenance do to more people printing 3d objects on the floor. Both the PComp and ICM sessions I attended moved along smoothly, and the end of my week has been hectic with last minute Maker Faire preparations for my project Cycle. Hope to see everyone out this weekend at Maker Faire!

Some Puppet Love: Cookie Monster and Grover perform their own musical

And I can’t stop thinking about surfing, so here is a great video shot just a few miles from here: Rockaway Opera

Genevieve

The past two weeks have been full of workshops and office hours at ITP. Lia, Merche, Craig and I have been adding info to the Video help pages, as well as organizing workshops on helpful tips for video shoots. Antonius and I led an introduction to Illustrator last week, and had a second workshop today on outputting from Illustrator to the various 2D fabrication tools we have on the floor, like the newly operational laser cutter and the embroidery machine. Lia and I led an ICM help session last week, and the questions I’ve been getting during office hours have impressed me with how much students have been able to absorb in such a short time. With Marina at ISEA last week, Gabe and I held the first Crit Group, and heard from two Big Screens projects, which made me pretty excited for this year’s show already. I just came from the IAC and saw the new video wall for the first time, which looks pretty amazing and is way more visible during the daytime than it was before, so that’s a plus for students as they develop their projects. I also filled in for Marina in her Renatured class, and gave a talk about the role of data visualization in different time periods and cultures, and artistic practices. The David Rumsey map collection is an amazing resource for maps and infographics throughout history. I also really enjoyed learning about stick maps, which are navigational tools used in the Marshall Islands.

In light of my thesis research, I found this NY Times article encouraging. Changing the fees the exchanges charge to correspond to data rates (to account for all of the cancelled orders) instead of the amount of executed trades seems reasonable to me. Hopefully this might curb some of the more erratic HFT behavior.

Yesterday I helped the Nerdy Derby crew get their gear out to the New York Hall of Science for Maker Faire. All went smoothly on the way over, but I did end up getting stopped at a checkpoint near the Midtown Tunnel. Luckily the van was empty at that point. Apparently if I don’t get a NY state license before the next time that cop stops me in a UHaul I’ll be getting a summons…

But anyway, come out to Maker Faire this weekend and check out Tangible Lights, a project I’m working on with Emily Webster (ITP’12) and Mustafa Bagdatli (ITP’10). We’ll be in the ZONE A VISCUSI area, aka the dark room.

Lia

Very busy with help sessions and office hours this week, particularly ICM on Mondays/ Thursdays and Video on Thursday. If you haven’t been to a workshop, we upload all code to our Github Page, so check those out.

This was my week of sitting in more classes, like Dynamic Web and 3D Sensing. I probably won’t be able to keep this up, but it was nice to pick up some new things and see what the students were coming up with. Cleaned up some of the more outdated pages from the Video section of the Help Wiki (“Where to get cheap video tapes in Manhattan”, “Record 30 seconds of color bars first!”).

Continued development work with Chien Yu Lin and Anna Pinkas  for Anna and Carlin Wragg’s Storywalks at Eldridge St. iPhone app which we are writing in openFrameworks. Met with Tom Igoe and his former student, Kenny Chiou, about making a mobile, Phonegap-based version of a data-collecting app for field research, a project that was started in Tom’s Monkey Tracking class years ago.  Went to the Dentist. Watched all of Firefly again, for the 3rd time. Going to the Resident’s Show tonight at Dumbo see you guys there!

iOS, for Artists: C4 is a brand new creative-coding framework lets you build expressive user experiences and create works of art.

The first episode of Astroboy, subtitled.

Merche

I have a white board on my table! A little shifted though, but it gives somehow a special touch to this 120cmx80cm surface (yes, I still prefer the Metric Unit System..)

Nick and I finished the second round of Audio Workshops, this time in basics on editing, with the inestimable help of our Pro Tools guru on the floor, Phan.

With Lia, Genevieve and Craig we have been preparing the video ones, that we started yesterday, and updating the video help pages…so a lot of diving again in the equipment available in the ER and its manuals Cole Haan…and discovering such things as we have a Giga Pan!

In NIME very powerful ideas for the final project seem to be taking shape after this third round of instruments. Still no luck with the Venue hunting, though..

Finally I’m helping  Antonius with some tutorials for the Soft Lab machines.

And outside the office I have been spending some time in some Perch displays installed in Cole Haan stores and some sound reactive visuals that I will present in collaboration with the Brazilian Sound Artist Thessia Machado next Saturday the 6th October in Local Project Art Space, part of DystorTorpia Media Project

To go:

http://issueprojectroom.org/drupal/event/sergei-tcherepnin

and of course don’t miss Dumbo Arts Festival and Maker Faire this weekend!

To read:

http://people.brunel.ac.uk/bst/home3.html

To listen:

Loops!!! : http://www.radiolab.org/2011/oct/04/

Mimi

Subbed for Matt Parker’s ICM section on Strings and Mouse/Keyboard interaction (fun!) which generated this set of silly text-based animations. Because of that I have finally committed the various Processing text/font syntax to memory.

Building a repo of examples for an upcoming workshop on “de-mystifying” Processing’s various m*th and geometry-related functions.

Have already lost a significant portion of my lifespan to figuring out how to make uploaded images show up in the wiki.

All 6 screens running in the lounge now! Team effort.

Sat through 4.5 hours of Einstein on the Beach (no intermission) and then 4 hours of Turandot (1.5 hours of intermission) in a single week.

About 4 hours into Einstein this happens:

This “Bed” of light took about 5 minutes to go from 180 to 90 degrees. Never before have I contemplated whether something had reached 45-degrees or not for such a length of time.

Nick

On the sound front, Merche and I finished up the audio help sessions with Phan’s help and I’ve been meeting with people during office hours about audio projects. We’ve been discussing some exciting new audio equipment purchases with Rob and will do some additional help sessions once it’s here. Physical computing help sessions are happening (Thursdays 4-5pm) and have been lots of fun come and join us if you’re having trouble with something or just want some support while you work through the labs. I’m putting together some p-comp sessions on specific subjects as well that should be helpful as people work towards their first projects. NIME continues to be exciting still communicating with potential venues to nail down a location.

I’m delighted that the ITP laser cutter is back (thanks John & Eric!). I’m cutting a lot of mechanical parts for a sound installation piece going up at New York Hall of Science next month.

some links:

Steve

The past two weeks have seen a lot of students at my office hours (there’s still plenty of slots available!), which has been great. There were a few questions from the Visualizing JS class so I read through the syllabus and am really envious of everyone in the class. In Stewart’s notes for the class he linked to the hilarious Wat talk from Gary Bernhardt. (If you also want to have a Javascript REPL in your Terminal like in the video, click here)

I finally finished the write up of the Git workshops from the second week of classes. You can read it here, and please do. If you have questions on anything in the post, leave a comment. On Tuesday I held a tutorial on branching and collaborating with Git. Maybe due to the hour or that all the first years were at Applications there were very few people there. Expect another similar talk soon. For that talk I compiled a list of Git resources.

Our Residents’ Github page is filling up with some great examples. Even if you don’t understand Git yet, go look at our page and click through to read the code, see the examples. [http://github.com/itpresidents](http://github.com/itpresidents]

  • Scientists have discovered similarities in the way ants look for food and how TCP works.
  • Clay Shirky’s TED talk about how Git & Github will hopefully transform how governments work. Seeing how Git is getting used in non-programming ways is fascinating.
  • Flocking in Processing.js with Coffeescript. This blog post was based on Dan Shiffman’s flocking example in Processing which the writer has ported to Coffeescript and Processing.js. It’s a great read to get everyone excited about Nature of Code next semester (and for the book to be released soon!).
  • My friend Drew has an excellent blog about cities, the internet, and how the two intersect. In this post Drew talks about how much of what happens behind the scenes on the internet is technologically amazing and complex but to most users is just clicking a button. Drew’s a much better writer than I am, read that post.
  • Woah. This just blew my mind: Styler. If you’ve ever changed some CSS in the web inspector and been irked that you have to repeat the changes in your CSS files, this is for you. Styler is a CSS editor that instantly changes the page to reflect your new style rules and also puts those same changes in your local CSS files.

Physical Computing Week 4 Lab: Error message in Processing when using serial library?

A few people have mentioned that they got an error message in Processing when doing the serial communication lab.  You may get it if you haven’t used Processing for serial communication on your computer before.  It requires you to open the terminal and enter two sudo commands.

Here’s the important part of it (the instructions you’ll need to follow):

To use the serial library, first open
Applications -> Utilities -> Terminal.app
and enter the following:
sudo mkdir -p /var/lock
sudo chmod 777 /var/lock

You’ll also get a prompt to enter your system password to authorize the changes.  Once you do this, restart processing and you should be good to go.

Also to note:
Depending on your operating system and the configuration of your computer, the serial ports may appear in a different order than the example in the lab.  Make sure you’re selecting the port that your Arduino in on.

 

Geometry Help and More!


Next Session: Thursday Oct 11th 6-7:30PM Room 15

Are you waking up in the middle of the night wondering…

  1. How do I draw more awesome curves?
  2. How do I make stuff that goes in a circle-like manner (e.g. sun rays)?
  3. How do I create “Photoshop” effects (e.g. drop shadows)?
  4. How do I create more interesting motion effects?
  5. How do I make cool patterns?

Come to the residents’ workshop on Geometry Help and More!

We’ll de-mystify some of Processing’s basic geometry functions to “do more with less code.”

We will begin with absolute basics and assume no prior knowledge of anything.

This session should be helpful for people working in JS too as we’ll cover concepts that translate easily to other languages.

Monday Oct 8th 1-2PM Conference Room

ICM Help Session Week 3: Loops, Modulo, Buttons and Sliders

Code Examples Here

How to make a Slider | Code

This is a great example for understanding the following Processing functions:

  1. constrain() – How to make the slider button not fall off the ends of the slider.
  2. Using variables to keep a bunch of shapes together relative to the mouse. (Our slider button is a complex shape comprising of 2 circles and 2 lines, all moving together relative to the y-location of the slider bar and the x-location of the mouse.)

Using Loops to Generate Patterns | Code

  1. % modulo - Use division to create “regular” patterns, e.g. alternating rectangles by only filling a rectangle with “black” if the index number of the rectangle (in the loop) can be divided by 2 without a remainder. (e.g. 0, 2, 4, 6, 8, 10, 12, etc…)

Interactive Buttons | Code

We went over this example which shows 4 different kinds of interactive buttons working side by side.

  1. Momentary click
  2. Turning a button ON and OFF
  3. Mouseover or Hover effect
  4. Momentary click plus Mouseover or Hover effect

Concepts convered include:

  1. Using booleans to keep track of on/off states
  2. What’s the difference between mousePressed and mousePressed()?

mousePressed is a Processing variable like mouseX that tells you if the mouse button is pressed down.

mousePressed() is a function that runs code  you write ONE TIME when you click the mouse.

This sketch illustrates it. 

So then can you guess what’s the difference between keyPressed and keyPressed()?

Teaser For Next Week

How do you create a grid of on/off switches?
Approach 1
Approach 2 (with hover state)
Approach 3 (randomly placed cells with drawing via objects)

Introduction to Git and Github

This post is a mirror of the original article on Steve’s blog, which is here.

This tutorial will teach you the basics of using Git and Github and is based on a workshop given on September 12th and 13th at ITP.

Audience

This tutorial is intended for someone who has had at least a little exposure to programming and none to the command line. The goal is to give you, the reader, an introduction to Git and Github that will inform you both technically and conceptually as to what all of this is.

Outline

  • What is Git?
  • What is Github?
  • Install Git
  • Learning to talk to your computer
  • Your first Git repository
  • Summary of Git workflow
  • Sign up for a Github Account
  • Pushing code from your computer and Github
  • References and further reading

What is Git?

Git is a version tracking program used to track changes to files and folders. Git allows you to switch back to older versions of these files.

Each project you want to track with Git needs to be in its own folder on your computer. Git will monitor changes to all files within that folder. Each folder tracked by Git is referred to as a repository.

Git is really awesome and really, really powerful. I could go on for pages about all of the stuff Git can do. Instead, let’s dive right in and start using it

What is Github?

Github is a website, a social website where instead of photos of partying with your friends you post files of code to program with your friends.

Install Git

Git needs to be installed on your computer. You can download it from the Git SCM website.

Mac

If you are on a Mac and have Xcode installed you should already have Git and can skip this step, but there’s no harm in re-installing.

Install the program from the package. When you get to the end of the installer you’ll notice your computer looks very similar to how it did when you started. There is no icon for Git in your Applications or Program Files folder. Don’t worry. Git gets installed in a different place and doesn’t have an icon to click on. Don’t worry about using Git yet, we’ll cover that later in the tutorial.

Attention Mountain Lion Users

Apple has decided to protect your computer making it harder for you to install Git.

To fix this, open up System Preferences and click on Security & Privacy (top row, third from the right).

Now click the padlock in the bottom left corner and enter the password for your computer and click the Unlock button.

Under “Allow applications downloaded from:” select “Anywhere” like so:

Once you’ve done that you should be able to install Git.

Windows

If you’ve got a Windows computer, download the setup exe file and use all the default settings.

When you get to the Adjusting your PATH environment screen, be sure to choose the option for Use Git Bash Only. Git Bash is a program that will be installed that lets you interact with Git and your computer in much the same way as the Terminal application on Apple computers.

You should have now have a program in your Start Menu called Git Bash. If you hit the Windows key to pull up the start menu and type “git bash” you should see the program highlighted. I’m going to explain a bit about what Git and Github are before we need to open the program.

Learning to talk to your computer

Git is a program with out a graphical user interface. Git has no buttons, no icons. There are quite a few programs that give Git a graphical user interface, but we aren’t going to use those.

Why? Because I prefer the keyboard to the mouse/trackpad but also because the buttons and icons obscure what Git is doing and what you are telling Git to do. So we’re going to learn the hard way so that you learn more.

No Buttons

Most of the programs you use have graphical user interfaces (GUIs), the Finder (Explorer on Windows), web browsers, word processors, etc. You click on a button and something happens.

Before GUIs there was the command line. No buttons, just text input. On the command line you have to type in what you want the computer to do and it responds. It is through this command line that we will interact with Git.

Opening Terminal (or Git Bash)

To get to the command line on a Mac open up the application Terminal. The quickest way to open Terminal is to click the magnifying glass in the top right corner of your screen and type “terminal” and click the first result, looking something like this:

On Windows, we will use Git Bash which is a program that was installed with Git and emulates the same command line as on OS X. To open Git Bash, hit the Windows Key and type “git bash” you should see a program listed first with an orange icon, click that to open it. If you don’t see this program, reinstall Git and be sure to select the option to install Git Bash.

For the rest of this tutorial I’m going to use “Terminal” to refer to both Terminal.app on Mac and Git Bash.exe on Windows.

What is this Terminal?

You can think of the Terminal as an alternate view of the files and folders on your computer, instead of a Finder or Explorer window, it’s this black or white box with a cursor.

In the Finder each folder has a list or grid of the contents of the folder. In Terminal we have something called the prompt, it’s all that text to the left of the cursor.

Hit enter a few times and you’ll see the same thing repeated down the screen of the Terminal. That’s your prompt. Treat it like a good friend, get to know it.

Somewhere in your prompt you should see a tilde (~). In every Finder window you’re looking at a location on your computer. It could be your Downloads folder or your Pictures folder. This is the same in Terminal. The tilde is the folder you are currently in. Wait, you don’t have a folder named “~”? That’s because the tilde is a variable for /Users/sklise but instead of “sklise” it would be your username. On Windows the “~” stands for /c/Users/sklise. When you direct Terminal to a different folder the “~” will change to reflect the name of the folder you are in. This is the only visual clue as to where you are, so pay close attention to it.

Seeing Files, Moving to Folders

Finally, some commands for Terminal.

Let’s see what the contents of ~ are. To do this we will use the command ls. Type the following in to Terminal and hit enter:

$ ls 

(Whenever you see $ at the beginning of a line of code, don’t type it, it’s there to say “This is something typed in to Terminal.”)

What just happened? Your computer gave you some output and then returned you to your prompt. Here’s what my output looked like, you’ll probably have less items listed than I do:

The list you see is a list of the folders and files inside of /Users/sklise. Now I want to move to the Desktop, just because. In the Finder I’m able to just click on the word “Desktop” and there I am. In Terminal we have to type a command to get there.

The command to move to move to a folder is cd. CD stands for “change directory.” Directories and folders are the same thing. When we use the cd command we need to tell it what directory we want to change to.

Type the following into Terminal and hit enter:

$ cd ~/Desktop 

Are you back at your prompt? Is anything different? You should see the ~ has been replaced with Desktop. That means we are now in the Desktop folder. If you type

$ ls 

You’ll get a list of all the files and folders on your Desktop. This may be a lot of files or it may be nothing.

Make a Folder, Make a File

Thus far we’ve only looked at things with the Terminal, we haven’t modified or created any thing. And by “thing” I mean folders or files on your computer.

For this tutorial we will work with a Processing sketch. If you don’t already have Processing installed, go download it now.

I want to make a Processing sketch called “radsketch.” Processing requires all sketch files to be inside of folders with the same name. So we will need a folder named “radsketch” and a file inside that folder called “radsketch.pde”. Let’s get started.

The command to make a folder is mkdir. This stands for “make directory,” programmers are lazy and don’t like to type unnecessary characters. Dropping vowels from words started way before the internet. We need to give the mkdir command the name of the directory (remember, folder and directory are the same thing) we want to make. Terminal doesn’t deal well with spaces, and in general having spaces in folder and file names will just slow you down. Anyways, Processing doesn’t let you have spaces in folder or sketch names. Let’s make our folder “radsketch”:

$ mkdir radsketch 

It looks like nothing happened in the Terminal, you are right back at your prompt and nothing has changed. But if you look at your desktop you should find a folder named “radsketch”.

Now to make the file “radsketch.pde”. For this we will use the touch command. Why’s it called touch? Because this command is used to update the timestamps on a file, if the file doesn’t exist, touch creates the file.

But first we want to be inside the “radsketch” folder. Do the following:

$ cd ~/Desktop/radsketch 

Now we’ll use the touch command:

$ touch radsketch.pde 

If you look in the radsketch folder on your desktop you’ll see a file you can open with Processing.

Leave the Terminal open and open radsketch.pde in Processing.

Our Processing sketch is not rad right now. Let’s make it rad. Open the file in Processing and write some code. This is what I’ll write:

// radsketch.pde void setup() { size(200,200); background(255); smooth(); noStroke(); fill(255,0,0); ellipse(width/2, height/2, 50, 50); fill(255); triangle(width/2, height/2 - 25, width/2 + cos(radians(210))*25, height/2 - sin(radians(210))*25, width/2 + cos(radians(330))*25, height/2 - sin(radians(330))*25 ); } 

Kinda rad. It could be radder, but I don’t want to lose this state of the sketch. What should I do? Track the sketch with Git!

Setting up Git

We need to take a quick detour and execute two commands before we use Git. These two commands you only need to do once, ever. Or until you get a new computer.

A note about the following commands, put your name and preferred email address inside the quote marks. These values will be stored with Git and with every project you work on with Git. So be sure that the email address you use is ok to be public.

$ git config --global user.name "YOUR_FULL_NAME" $ git config --global user.email "YOUR_EMAIL_ADDRESS" 

What’s the deal with this? Why does Git need to know your name and email address? Git is used to track changes to files in a project, part of tracking changes is noting who made the changes.

Your first Git repository

To start tracking a project with Git you need to tell Git to start doing so.

In the same Terminal window as we’ve been using, execute the following:

$ git init 

You’ll get a one line response similar to the following

What just happened was Git created a folder inside the radsketch folder named “.git” which is hidden by the operating system. This folder is where Git stores all of the information needed to do what Git does. You’ll never have a reason to look at the contents of this folder.

Status Updates

What does Git know about the radsketch folder and its contents, and how do we find out what Git knows?

$ git status 

Returns:

This is a really awesome message. Git is telling us that it sees one file in the folder that it is not tracking. This means Git doesn’t care about any changes to this file right now. And we are told to use git add to track the file.

Git is great at giving descriptive messages. So read the messages Git gives you.

Really, if you don’t read what Git spits out you won’t know what you’ve done or if it worked properly.

Seriously. READ THE MESSAGES THE COMPUTER GIVES YOU WHEN YOU EXECUTE A COMMAND.

Staging

Git uses a concept called a “staging area.” This is a liminal “space” between changes to files and a commit. It’s the prep area. You earmark the state of a file to be included in a commit and then you commit it.

This two step process will make more sense when you are dealing with a project with many files, right now it’s sufficient to tell you this is how it works and you have to do it this way.

Files are added to Git by typing git add and then the name of the file:

$ git add radsketch.pde 

If you execute that command it looks like nothing happened—there’s no response. It’s time to run git status again.

$ git status 

The status message has changed and we see that radsketch.pde is marked as a “new file” and under the heading “Changes to be committed.” So let’s make a commit already.

Always Leave A Message

When making a commit with Git you are required to leave a message. When working with others on a project it’s important to leave messages about what the changes were that you made to the code. Otherwise everyone on your team would have to read through your code and figure out what you were doing or you could just tell them “Made the circle green” and they can get back to work.

Also, as your projects grow in scale you’ll have a lot of commits and maybe take a few months off from working on a project. When you return to work on a project, say after summer vacation, you’ll probably have forgotten what you had been doing. Now, I’m not saying I did that with my thesis, but here is a section of commit messages from my thesis:

You can see some descriptive messages but then also a string of 4 commits where the error message is “debugging.” To figure out what the heck I was doing then I’ll have to back and look at the commits in detail, much more tedious than if I had left myself a good message.

This is not a contrived example and no, I didn’t make those 4 “debugging” commits 6 months ago just for use in this blog post.

So, please, leave good messages. You’ll thank yourself later.

Committing

Now, where were we. Make a commit. Ok. The command to make a commit is git commit -m. The -m is to leave a message. Always leave a message.

$ git commit -m "Created a triangle in a circle" 

We’ve made our first commit. Let’s do git status again and see what’s going on.

$ git status 

Git doesn’t see any changes to the files since the last commit. Let’s make some changes and see what git status says after that.

// radsketch.pde void setup() { size(200,200); background(255); smooth(); noStroke(); fill(0,255,0); rect(width/2 - 25, height/2 - 25, 50, 50); fill(255,0,0); ellipse(width/2, height/2, 50, 50); fill(255); triangle(width/2, height/2 - 25, width/2 + cos(radians(210))*25, height/2 - sin(radians(210))*25, width/2 + cos(radians(330))*25, height/2 - sin(radians(330))*25 ); } 

Now save those changes and execute:

$ git status 

Geez, Git is great. It knows that we changed the file and it even tells us what we could do next. We’re going to do git add but before that let’s dig a bit deeper in to what is happening.

$ git diff 

Git doesn’t just know that the file has changed, Git knows which lines have changed and more specifically that they are additions. When we add radsketch.pde and commit it Git will only store the contents of the change, which means that you aren’t wasting space making copies of everything that didn’t change which is what would happen if you copied the whole folder and renamed it “radsketch_v2″.

So let’s add radsketch.pde and make a commit

$ git add radsketch.pde $ git commit -m "Added a rectangle behind the other shapes" 

That in a nutshell is how Git works on your computer. Everything we’ve done has been on our own computer. At no point did we reach out to the internet or use Github in anyway. That’s next.

Leave Terminal open, we’ll be returning to it soon.

Sign up for a Github Account

Click here to sign up for a free Github account.

Github is a Website

Github is a website. Git is program on your computer. They may sound the same but they are distinct and separate.

Say it with me, Github is a website and Git is a program on your computer.

It’s not quite that simple though. Github is a website made of many servers some of which run Git. But the key thing to realize is that Github is not on your computer. We’ll be going over 2 Git commands that let your computer talk to Github’s servers.

Get Your Code on Github

We need to make a “new repository” on Github in order to send our Processing sketch to their servers.

Click the button in the top right of the screen, third icon from the left that says “Create a New Repo” when you hover over it.

We already have a repository, why are we making a new one?

Github is a website and websites get their information from a database. So when we click “Create a New Repo” what we are doing is creating a new database entry on Github for this “repo.” One field in that entry is the location of the actual Git repository. In this case “Repository” refers both to the database entry and the actual Git repository.

Filling out this form

Here’s how I filled out this form

Notes on this form:

  • The “Repository name” does not need to match the name of the folder on your computer.
  • Description is of course optional.
  • Private repos on Github cost money. But if you’re a student you can request a free micro plan.
  • Don’t check the “Initialize this repository with a README.” Readmes are important and useful but for right now this will throw a wrench in the tutorial.

Click “Create repository.”

Telling Git about Github

The page we are brought to has instructions for telling Git (on your computer) about this new Github repository we’ve created. Scroll down to “Push an existing repository from the command line” because we’ve made a repository on our computer already and we haven’t done this before.

There are two lines there for us to copy and paste in to the Terminal.

Let’s copy and paste the first line in Terminal and then talk about it. My line is different than yours because yours will have your Github username in it.

We are adding a remote to this Git repository. A remote is another computer that we want to share our repository with. Remotes are URLs. But those URLs are long so we can give the remote a name, in our case origin, so we don’t have to type the entire URL over and over.

At this point Git has still not connected to Github, we’ve merely told it the URL to connect to.

A Push or a Shove

At this point in the talk, hand motions were used. You’ll need to imagine them, or mime along with the reading.

We’ve told Git about Github, now we want to show Github what we’ve got. Let’s copy and paste the second line of the instructions into Terminal and hit enter.

$ git push -u origin master 

You’ll be prompted for your Github username, type it in and hit enter. Then you’ll be prompted for you Github password. Type it in. The cursor will not move, you won’t see any visual indication of your typing. This is a security measure, if you mess up your password just hit DELETE…maybe 30 times, 40 for safe measure. Hit enter, you’ll get a response similar to but not identical to the following screenshot

Go back to your browser and refresh the page.

You’ll see radsketch.pde on the page, if you click it, there’s the contents of the file. Awesome.

This is the end of this blog post. I haven’t even touched on the most amazing parts of either Git or Github. That’s coming in the next blog post.

For now, repeat this process with your own homework assignments. Only through repeated practice will you get better.

References & Further Reading

Did I make a mistake?

If you find something wrong or missing or unclear, please let me know by opening an issue on Github.

ICM Help Session Week 2: Variables, Conditionals, and Interaction

What we covered in Week 2′s ICM Help Session:

Here’s the example we created together during the help session.

Variables

What are they useful for? Storing information your program needs to run, especially information that changes over time (e.g. location of a ball).

- Declaring variables : Telling your computer you want memory to store information. (To make variables “global”, declare them at the top of the sketch outside of setup and draw)
- Initializing (Setup) : What values do you want your variables to start with when you run your program?
- Running (Draw): How do you want your variable values to change over time?

Conditionals

I want one thing to happen if and only if something else happens.

- && and || (ands and ors)
- >,=,

Random

- I want my ball to bounce around randomly. I want my ball to change color randomly.
- Why do “randomly” generated things look so evenly spread out?

Creating Counters

I want something to happen, but only for 5 seconds.

Mouse/Keyboard Interaction

- Interrupts the draw loop to run code when you interact with your keyboard or mouse
- mousePressed(), keyPressed(), etc…

 

STATE SWITCHES

Here is an example of how to use a boolean, conditionals, and mousePressed to create a simple state switch- changing the color of a circle from one to another.

Click the mouse over the circle!

Residents’ Digest #01

Hey everyone,

Every other Friday, we’ll be posting a “Residents’ Digest” where each of us will offer a brief description of what we’re up to in and around ITP, as well as some useful, interesting, entertaining or just random links we think are worth sharing. Here goes, hope u enjoy!

- The Residents

ANTONIUS:  I got to relive some of my favorite ITP memories this past week by presenting The Pool to the new Big Screens students and by documenting the first assignment instruments for NIME. Eric Rosenthal sent me this great tutorial on making solder masks for PCBs with UV paint, which I hope to incorporate into the Soft Lab tutorials. Speaking of which, Merche and I ran the first Soft Lab workshop on sewing with conductive materials. It’s hard to open up to strangers, but I read a short story to a mixed group of ITP, Performance Studies, Steinhardt and Gallatin students for the class Nancy Hechinger and Anna Deavere Smith co-teach on Sundays. I’m assisting them with the tech, but they are kind enough to treat me as if I were one of the students. I’m lucky enough to participate in another awesome performance class – Puppets with Ithai! For our first assignment, Marianne, Eric Hagan and I performed a short skit with two grumpy friends and a butterfly who didn’t know how to fly. Considering the growing number of performance courses associated with ITP, I suggested to the faculty we consider reserving rehearsal space close to the floor. They’re taking the request seriously and thanks to George Agudow’s infinite wisdom and connections it may come to fruition soon. Hold tight!

CRAIG:  The first two weeks of school have been great. Steve and I successfully carved out what appears to be a useful tetris piece for our corner of the Residents’ office. Besides building furniture, I’ve been working with Dan Shiffman on the ICM Video project. We’re still in a preliminary phase, but we’re excited about the possibilities. And we’d love your feedback, so please let us know what you think. I’ve aso been helping out with the ICM and Git workshops. Next week, Steve, Mimi, and I are starting a weekly Web Dev workshop every Wednesday from 2-4pm. (And for every Residents’ workshop, we’re posting documentation to this blog.)

I’m also sitting in on Stewart Smith’s “Visualizing Javascript”, which is going to be an epic class. and I added a “Shep” command, “Shep give me love” – give it a try once Steve lets “Shep” run loose again on ITP.

And some links:

The DataGotham Conference – is happening today (09/13) and tomorrow (09/14). They’re live streaming the event, and will hopefully post vids once it’s done. Def worth checking out.

The Setup - aka usesthis.com a site about what people use to get stuff done.

Envisioning The Future of Health Tech – a nice infographic looking at the future of health technology.

Kinetic Art - this relaxes me every time I watch.

ERIC:  I would say that my desk has also been finished, but I have in mind that there will always be room for new growth. I’ve been busy keeping an eye on the shop and the new tools, including a number of new drills, a much better scroll saw, and various other smaller parts. I’ve running both 1st and 2nd years through Shop Safety sessions, sign up on shop.itp.nyu.edu for next week if you haven’t attended one this year. Once everyone has attended a basic shop safety, I will begin to host sessions on using the Laser Cutter, CNC, and Makerbot.

I’ve also been very excited about Ithai Benjamin’s Puppets class. We worked together before class on Wednesday to create a stage which the class will modify over the course of the semester, with plans to add a curtain and lights. I worked with Marianne and Antonius for the first puppet performance and with three vastly different puppets we were able to come together and create a compelling story.

An awesome rolling ball kinetic sculpture built using K’nex:

http://www.youtube.com/watch?v=q76r-3z4Ckk

An interesting video on a simplified explanation for encryption:

http://www.wimp.com/howencryption/

New York City Archive makes available 2.2 million images of the city dating back to the early 1800s:

http://www.dailymail.co.uk/news/article-2134408/Never-seen-photos-100-years-ago-tell-vivid-story-gritty-New-York-City.html#ixzz23LEgdR00

GENEVIEVE: I’m enjoying the classes I’ve been sitting in on – Understanding Networks, Renatured and the Art of Graphics Programming. If you didn’t get a chance to come to the Art Out last week (with Marina, Tom and Danny) to see the Ghosts in the Machine show at the New Museum, I recommend checking it out before it closes September 30th. I’ve been working with Crys and Ali to get Crit Group up and running, so if you’d like the chance to get a longer focused critique on a project (even in its very initial stages), please sign up at the Crit Group wiki, or just come out to listen and give feedback to your peers.

I also spent the week working on a project for Maker Faire, as well as making a photo booth for my friend’s wedding. It’s pretty satisfying to trigger a 5d by pressing a giant red button! And the residents’ office is also starting to feel a lot more comfortable now that our furniture is built and we have a Shep sound system.

Here’s a fun project I found in my survey of DIY photo booths, which reminded me a lot of the work of recent ITP grads Reed+Rader. I also came across some helpful javascript libraries for embedding Open Street maps into a website, which I’ll be using to build out a project I’m working on for a festival in SF coming up in October.

LIA:  Helped run the Documentation, Photoshop and ICM Help Workshops, which for the most part went well (if you don’t think so let us know — we are learning too!). I’ve been spying on the first week’s ICM homework, and am really impressed and excited by the incoming class. That said, I echo Steve’s comment that people have to start signing up for office hours if you need extra help. We get a huge variety of questions, everything from “for” loops to: “Where do I get free Photoshop?” (can’t say), and, “Do you have a pair of scissors in here?” (yes we do).

Outside school, Will & I revived some of our Video Sculpture projects for the giant Winkel &  Balktick party at the old Pfizer building in BK — an experience much like the ITP show except that your guests are all intoxicated. I’m also enjoying sitting in some classes within ITP, and signed up for some programming ones outside of ITP.

Yesterday I took down all the pictures with the faces of the class of 2012 from the front lounge to make way for new photos — a task that took longer than necessary because I kept stopping to reminisce. It goes by quickly, folks, don’t forget to stop and enjoy each others company :)

Learning to program at 30 - I google this topic a lot.

25 life saving tips for Processing - a good collection of snippets that would have saved me a lot of time.

Roll Your Own Front End - a survey of creative coding frameworks by some 2011 alum.

New York Times Graphics Editor Amanda Cox speaks at Eyeo - because she is great. Browse the other Eyeo videos too.

The Ramayana & Rubbish Books - some fun storytelling online

MERCHE:  It is been an intense week, still trying to figure out loads of things and mainly happy to be back! No white board top yet on my table though…lack of time

We have been working around NIME with Nick and Antonius and in that line I installed with Marlon the new audio system for the class which should be properly operating for next week, and enjoyed so much the performances of all NIMErs in their first exercise! We have been doing some research for the venues for the show too.

With Nick we hosted the second audio help session in Recording basics and have been going through all the audio equipment in the ER and updating the online information about it in the audio help page.
I also assisted Antonius in the Smart Crafting Workshop, which had a great response.
We had our first PComp help session with almost no students…wondering if the questions will arrive in the next days, so we are scheduling an extra one for Tuesday…Maybe Steve and Craig with sexy-github at the same time was too much to compete with!

Outside the office I have been working in the performance for Geekdownfestival, where I plan to use some pieces from my Thesis, some other instruments I developed in NIME class and a wearable piece that needed some re-tuning.

And keep on with my work in Potion, mainly around Perch project.

Some interesting sound related “to-go”:

+ Last Sunday I had the enormous pleasure of meeting Marjorie Eliot and her Parlor’s Jazz  sessions.  Can’t think of a better way to spend Sunday afternoon!

+ Coming in Eyebeam on Monday:  Music After Hours: CT-SWaM

Roulette and  The Stone agendas is always worth checking

+ And if you want to test and share your new audio/visual creations Share hosts open jam sessions every Sunday late afternoon/night (you can actually combine with Marjorie)

MIMI:  I found a piece of masonite that was exactly the dimensions of my desk. Drilled a lot of holes into the plywood wall with Antonius and Gennie most of which line up and cultivated a Garden of Eden of color-coded ethernet, DVI and power cables behind the Big Screens machines.  Figuring out how to be helpful with ICM without going TMI.

A number of people asked in the ICM help session for examples of what people do with Processing.

http://openprocessing.org/browse/?viewBy=most&filter=favorited

People were also asking about drawing curves in Processing and in particular Bezier curves. Here’s an online tool that animates what’s going on and gives you a graphical interface for manipulating the curve. http://www.jasondavies.com/animated-bezier/

(Link is gory) Re: Storyboarding and delivering a punchline in a short amount of time. http://www.youtube.com/watch?v=prDCDmchtTg

NICK:  It’s great to be back at ITP and to see so many new faces around the floor.  I’ve been working with Merche to update the audio help pages and run recording workshops.  Also got started with the pcomp help sessions this week and have been making some small edits to the online labs.  I’m also helping out with the NIME class and loved the first round of instruments everyone created.  Merche and I are working on securing a venue for the class’ Dec 9th show.

Outside of ITP, I took part in the Brooklyn-wide Go Open studios last weekend and have been prepping for my performance at the opening of The Geekdown show this Saturday night.  In particular, I’ve been working on programming new sounds for my “Thing Synth” module, which plays tuned notes on physical objects by striking them rapidly.  http://vimeo.com/41399528  when millis() will no longer do the trick, turn to micros().

Some Links:

September 5th marked the 100th birthday of John Cage, one of my heroes.  Here he is performing his piece “Water Walk” on the game show “I’ve Got a Secret” in 1960 and displaying a marvelous sense of humor about the situation.
http://blog.wfmu.org/freeform/2007/04/john_cage_on_a_.html
Since the Comm Lab sound projects are happening this week, it seems appropriate to highlight the work of another hero of mine: Tony Schwartz. Among many other things, he was a pioneer of urban field recording.  Here’s a nice radio piece about him produced by the Kitchen Sisters:
http://hearingvoices.com/news/2008/06/tony-schwartz/
And for those new to sound recording & editing (or those who simply love it), I highly recommend the site Transom.
It features great reviews and tutorials on equipment and a nicely curated selection of audio pieces
http://transom.org/

 

STEVE:  My desk is finally finished with a white board top. Craig and I cleaned a bunch of dust off the light fixtures and de-tangled many of the cables running around the room. Which means students need to start signing up for office hours.
I also installed a Mac Mini in the office with a jukebox program/server that is controlled by Shep so we can play music on the big speakers in the office from our own computers. It’s been a lot of fun using Play and chatting with Shep. In a week or two I hope to have the Shep website running again. For the first years, Shep was my thesis project which I’ll hopefully introduce you to in a few weeks.
Outside of ITP I’ve been working with Dan Shiffman on a website for his soon-to-be-released Nature of Code book: https://twitter.com/shiffman/status/243902864957792256/photo/1 as well as a website for my friends’ farm in upstate New York, Clawhammer Farm, http://clawhammerfarm.com.

Finally I led two workshops to introduce Git (a program on your computer) and Github (a website on the internet) to students. Both bordered on being over-packed and I think they went well. Many thanks to Craig for helping out with the second session. Stay tuned for more Git workshops. The slides are online here: https://speakerdeck.com/u/sklise/p/git and I’ll write up the notes and post to our blog later this weekend.

My favorite Stackoverflow q&a I read this week: http://stackoverflow.com/questions/6559164/rails-associations-has-many-through-but-same-model

An excellent introduction to Javascript: http://jsforcats.com/ This is in general a great tutorial for anyone new to programming.

A great article about how the reset command works in Git: http://git-scm.com/2011/07/11/reset.html

This is a handbook on how to use streams in Node.js, I haven’t read this yet but am really intrigued by its implications: https://github.com/substack/stream-handbook (If you’re in to Node.js check out the rest of substack’s repositories)

“Ali Baba” by John Holt: http://www.youtube.com/watch?v=bQhrbW9FlQQ Nick played this song this week in the office and it’s been stuck in my head ever since.