Time to Get Back to Learning to Code

There’s a lot of places to start. I’m starting with [Real Python][] this morning, as well as a bit of [Codecademy][]. I was a Kickstarter backer for _Real Python_, so this is my chance to see what kind of return I got on my investment.

[Real Python]: http://www.realpython.com
[Codecademy]: http://www.codecademy.com

If you need a reason for why you should start to learn to code: [Simon Peyton][] (link to Youtube video of TED talk) and [Yevgeniy Brikman][] tie it to learning to think.

There are plenty of places to start learning to code: [TED has a list] and [Lifehacker has a tutorial for beginners][lh] — the tutorial addresses both abstract concepts as well as grounding you in actual coding. In this case, LH uses Javascript, which may or may not interest you.

Believe it or not, [Google has a nice curriculum](http://www.google.com/edu/tools-and-solutions/guide-for-technical-development/index.html).

[Simon Peyton]: https://www.youtube.com/watch?v=Ia55clAtdMs
[Yevgeniy Brikman]: http://brikis98.blogspot.com/2014/05/dont-learn-to-code-learn-to-think.html
: http://blog.ted.com/2013/01/29/10-places-where-anyone-can-learn-to-code/
[lh]: http://lifehacker.com/5744113/learn-to-code-the-full-beginners-guide

Review of “10 PRINT CHR$(205.5+RND(1)); : GOTO 10”

There’s an interesting [review of _10 PRINT CHR$(205.5+RND(1)); : GOTO 10_ at Slate][slate]. For those that don’t, like me, recognize that particular line of code, it’s from a Commodore 64 program that would create an ever-incrementing maze on the screen. The [book about the line of code][book] seems to be wide ranging and playful and thus, to my mind, worth a look. By the way, the book is available through a Creative Commons license and can be purchased in codex form in support of two nonprofits or downloaded for free as a PDF. My advice? Check out the PDF and if you like the book, buy the codex.

[slate]: http://www.slate.com/articles/technology/books/2012/11/computer_programming_10_print_chr_205_5_rnd_1_goto_10_from_mit_press_reviewed.single.html
[book]: http://10print.org

Python in XCode

If you want to use XCode for Python development, there’s a [way to do it][], but it’s not straightforward. Tyler Crompton’s instructions have 22 steps, but he insists that it’s easier than those steps make it look.

[way to do it]: http://stackoverflow.com/questions/5276967/python-in-xcode-4

Tinker … Learn

This is really cool. Given that I have been thinking about developing an iOS app for field researchers, the timing on this could not have been better: [TinkerLearn](https://www.tinkerlearn.com/xray) aims to teach you iOS development by showing you a real app and walking you through its source code. What you get is an Xcode project with lots and lots of comments. You can run it yourself and then see what works and what doesn’t work.

If we taught writing the way programming is often taught, we would never have students read any kind of writing before asking them to write themselves, which is somewhat nonsensical. The way we learn so much of what we learn is through mimicry, mimicry leads competency, and, with desire and discipline, competency can lead to mastery.

And I love the logo:

Xray 3895018b0d6f2110795a349393a45af5

Splitting a File

Make no mistake: my coding fu remains quite weak. Still, something as simple as splitting a text file into smaller files based on a small string that sits on a line by itself shouldn’t be too hard of a problem. Well, the splitting isn’t that hard when someone hands you a Perl script. What’s hard is finding a way to split the files for yourself and also to have the files named after the string by which they were split.

What do I mean by this? I have a large text file, two of them actually, which are made up of over one hundred texts each. Each text begins with `–###–` and proceeds for some number of lines before the next `–###–` occurs.

I would like to split these larger files into their constituent parts and have each of those parts be contained in a file named, `###`. This shouldn’t be as hard as it is. I have tried:

split -p ‘^–[0-9][0-9][0-9]–‘ mytext.txt

And:

csplit -k individuals.txt /–[0-9][0-9][0-9]–/

And that’s just to split the file. (Neither worked.) This Perl script did:

#!/usr/bin/perl

open(FI,”individuals_refs.txt”);
read(FI,$_,10000000);
close(FI);
@arr = split(‘–[0-9][0-9][0-9]–‘);
$cnt=0;
for $c (@arr)
{
open(FO,”>$cnt.txt”);
print FO $c;
close(FO);
$cnt++;
}

But it simply labels the files by number, which loses their original identifying number.

It turns out that [StackOverflow is not all that friendly](http://stackoverflow.com/questions/11090292/break-text-file-into-multiple-text-files), or at least the subset that decided to close the question I had asked. (You’d think you could only close a question if you had either opened it or tried to answer it. Ah, Internet moderation, you are a beast that feeds the self-righteous.)

Google Doodle Is a Moog Synthesizer and 4 Track Machine (in Javascript)

The Goog has still got it. Their celebration of Robert Moog’s birthday is a doodle done in Javascript, using what will be standard HTML5 web audio APIs, that re-creates not only a Moog synthesizer but also lets you play, and record, into a four-track machine. The [HTML5 Audio blog has the story] with links to the .

: http://www.html5audio.org/2012/05/new-google-doodle-uses-web-audio-api.html
: http://www.google.co.jp/logos/2012/moog.2.js

The Importance of Feedback for Creativity

Bret Victor focused his recent presentation at CUSEC on what he calls “inventing on principle.” Much of the early part of his presentation is fantastic walkthrough of a coding environment he has developed which allows programmers to see the result of code changes immediately and even interactively — in fact, what’s most fascinating is how his initial impulse to “close up” the feedback loop between the writing of code and its compilation actually led him to innovate the environment in really amazing ways.

His principle: “creators need to be able to see what they are doing.” It seems pretty straightforward, but realizing it, say, in how we might teach better, is harder. I’m especially struck by the importance of the tight feedback loop that Victor emphasizes and a recent conversation I had with Sarah Spell about things happening in UL’s Industrial Design department.

Sometimes the universe whispers in your ear when you are headed in the right direction. I have been thinking about developing an app for the iPhone which would be built for field researchers like myself, and then I came across this on [Kottke][1]: [Start Developing iOS Apps Today][2].

[1]: http://kottke.org/12/02/beginners-guide-to-developing-ios-apps
[2]: https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/Introduction/Introduction.html

End of the Week Link Roundup for January 13

Here’s a list of the stuff that’s filling up the tabs of my browser. I wanted to write about a number of them, but I just don’t have the time.

* [“That’s what she said”.js (JavaScript)][twss]: Very cool, very funny. The glories of GitHub.
* [Who killed lard?][wkl]: NPR’s Planet Money has a podcast and they recently asked: who killed lard? Was it Upton Sinclair? Or should we blame William Procter and James Gamble? It was their company which created a new alternative to lard — the “pure and wholesome” Crisco?
* [Sell Your By-Products][svb]: is the advice of the good folks at 37Signals, who have a pretty good track record given that they developed Ruby on Rails and have written two books, which in turn spawned a consulting business. They are that good. (Definitely on my “would work for them” list.)
* [AppStorm’s Ultimate Dropbox Toolkit and Guide][db] is a roundup of Dropbox apps or apps that get better with Dropbox.

[twss]: https://github.com/DanielRapp/twss.js
[wkl]: http://www.npr.org/blogs/money/2012/01/06/144806987/the-friday-podcast-who-killed-lard
[svb]: http://37signals.com/svn/posts/1620-sell-your-by-products
[db]: http://web.appstorm.net/roundups/data-management-roundups/the-ultimate-dropbox-toolkit-guide/

[2012 is the year I teach myself how to program in Python.](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/)