If you want to find all the HTML, or XML, tags in a document, `grep` the following:


In a GUI app you can choose find all or replace all (with whatever you like).

Codecademy’s “Something of Value”

Here’s the bit of code I wrote for this particular segment of the Python course. I’m rather happy with its simplicity:

# Two dictionaries given: {prices} and {stock}
total = 0

for item in prices:
worth = prices[item] * stock[item]
total += worth

print total

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]:

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](

[Simon Peyton]:
[Yevgeniy Brikman]:

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.


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]:

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]( 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


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

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


@arr = split(‘–[0-9][0-9][0-9]–‘);
for $c (@arr)
print FO $c;

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

It turns out that [StackOverflow is not all that friendly](, 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][html] with links to the [javascript itself][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].


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.