TIP: draw plots directly in terminal! (with iTerm2)

General
Example: your data is already in CSV format in "z.plt", this one-line command will render a plot and show it in the terminal:gnuplot -e 'set terminal png ; set output "plot.png"; plot "z.plt" using 0:7 with lines' && imgcat plot.pngThis is great for testing web site performance. The previous one line ran Apache Bench to beat the crap out of my local server, and write the output into a Gnuplot-compatible CSV file:ab -n10000 -c100 -g z.plt http://192.168.64.3:30260/
Read More

John at work

General
I'm updating a class for Saturday, "Zero to Webapp in Three Hours", for non- or intro programmers. I just realized that all of the students have already learned most of the material!  So here's me updating the class:
Read More

Favorite podcasts

General
I listen to a lot of podcasts. Some are moderately heavy and technical, some are lighter stories and just for fun. Many encourage me to be a better person, or help me to move forward to achieve my goals.Here are a few favorites:- 99% Invisible: this podcast is fun and interesting!  Their specialty is "intriguing design of everyday things", often architecture. Recently they had an episode of mini-stories, one on the design of the standard ("Snelling") eye chart. It turns out everyone uses it because it's easy, but not because it's the best. It's easier for the doctors, but not necessarily for the patients, it's not as accurate.Another mini-story was about "copyright traps" in maps. Map makers spend a great deal of time and effort on their work, so they…
Read More

Never type a Bash command again with Infinite Shell History!

General
To turn on infinite history, add this to your ~/.bash_profile file :# infinite timestamped historyexport HISTTIMEFORMAT='%F %T 'export HISTSIZE=''When next you log in, your terminal history will be saved forever!  I'm up to about 30,000 commands typed in the last two years.ExampleToday I was looking up that command, you know, that one where you can hop in to Docker container running the main appserver, for debugging and testing.  IE: run a Bash shell on a named container.I knew it was "docker exec..." something:history | egrep docker.*exec26790  2016-08-31 16:18:12 docker exec -it e3f bashOops, I found the command where I created a Bash shell in a specific Docker container.  I'd have to used "docker ps", found the specific ID, and typed a second command to run a shell.  Lame.How about running…
Read More

Creativity

General
In my creative and job work, I've learned how to move around and have great ideas. It turns out these things are related. In "Doodle Revolution", Sunni Brown points out that moving and creative thinking are related.  Steve Jobs would go on "power walks" not to clear his mind but to focus and to work through creative blocks.  Einstein would play the violin, improvising melodies while pondering complicated problems. Tesla could design and run machines in his mind, not bothering to draw them out! At work I walk around as much as possible. Often I'll jog around the block to stimulate the little gray cells. Before or after lunch I'll draw my coworkers or tourists or cute dogs. At meetings and when learning new material I'll take notes on paper,…
Read More

Programming vs Programmer

Dev, General
Although I have many years of professional programming experience, it's still startling to realize the distance between writing a program for "Hello World", vs working as a day-to-day programmer. The amount of stuff you have to know, and use quickly in ever-changing combinations, is substantial.A student decried that his two-month class in Ruby didn't really prepare him for being a big-P Programmer, it just taught him little-p programming.My view is that the material in that class, as well as Computer Science in general, is meaningless. What you learn is not useful, it's all about learning how to learn.The following article shows how to do professional-level deployment of your Python webapp onto a server.  It uses ten different technologies, only one of which is "Python"!  This is all after your webapp is…
Read More

I salute Fabrice Bellard

General
Recently the amazing hack of "boot Linux in a web page" has been circulating around. Bellard wrote a x86 emulator in JavaScript, then took the straight Linux binaries and was able to boot it. In a web page. At reasonable speeds. His distribution even includes a C compiler. This is amazing, but that's not all.Bellard wrote the emulator QEMU, which lets you run one set of software "inside" another. It's mostly used for virtual machines, so you can run multiple operating systems inside a "host" OS. The guests can run Linux or Windows or whatever. The guest virtual machines can even be of different CPU types: ARM on a x86! This can be incredibly useful. But that's not all.A large majority of video software uses the "ffmpeg" library. It's quite…
Read More

Superdevelopers at Facebook

General
Facebook gets unprecedented traffic. They don't want things to go down so they... release changes constantly, a few times a day! They use peer review and their immense audience to see how well their solutions work, then iterate. The other teams *support* engineering, rather than being gatekeepers.I actually did this at a medium-sized site many years ago. Push change to live, capture logs for five minutes while people beat it, then undo the change. It worked well.
Read More