Peter Christensen

  • Presentations
  • Contact Me

Sprint Conclusion – Clojure

December 30, 2013 by Peter Leave a Comment

I just finished my first personal sprint, spending the last 2 weeks working on learning Clojure. I’ve loved the idea of Clojure since it came out in 2008 but never spent the time to work on it. While I didn’t finish all the things I wanted to, I did spend more time programming in Clojure over the last 2 weeks than I did in the previous year. Since my goal with personal sprints was to get more done, this is a great validation of the concept.

For the next sprint, I’m going to continue working on the Pedestal Tutorial and then educate myself more about single-page web applications in general. More in 2 weeks!

My original goals for the week were to:

  • Clojurescript Koans – http://clojurescriptkoans.com/
  • Clojurescript 101: http://swannodette.github.io/2013/11/07/clojurescript-101/
  • Pedestal Tutorial: https://github.com/pedestal/app-tutorial/wiki
  • Create a simple database-backed website, so I need to learn a persistence library, ring, templating, etc

I finished the first two and about a quarter of the Pedestal Tutorial.

I found some great resources for a beginning Clojure developer:

  • Clojure Cheatsheet: http://clojure.org/cheatsheet
  • Online Clojurescript REPL: http://himera.herokuapp.com/index.html

I took notes on the parts of the Pedestal Tutorial that I worked through but I’ll put all those notes together when I finish it.

Great big thanks to David Nolen (@swannodette) for his very helpful tutorial writing!

Filed Under: Clojure, Personal Sprints

Why Aren’t More Programs Written in Powerful Languages?

December 23, 2013 by Peter Leave a Comment

http://coffeeghost.net/2008/03/19/your-ignorance-does-not-make-a-programming-language-suck/

Fans of obscure but powerful languages like Lisp, Haskell, Scala, and OCaml can sometimes get overzealous about how much great their language is, especially compared to those (holding nose) “common” languages like Java, C++, or C. Not only is this really annoying, but it sets them up for one the easiest comebacks in all of trash talking: “SCOREBOARD!” (For those not familiar, when fans of one sports team is losing to another team but still talking trash, all the fans of the winning team have to say is “SCOREBOARD” to indicate that, despite all you guys have to say, you’re losing the game). The nerd equivalent of this is “If X is so great (for any powerful value of X), how come there aren’t any programs written in it?” Indeed, people writing trillions of dollars worth of software in C, C++, C#, and Java, it is a valid rebuttal.

To those of you that have ever been hit with this rebuttal, take heart. Although you probably understand that it’s not a completely valid point, allow me to offer a theory. The start for this theory comes from a gem of a quote from Paul Graham, tucked away in a footnote of one of his articles: “Never attribute to malice what can be explained by math.” So please permit me to use some crude math.

[Read more…]

Filed Under: Programming

Personal Sprints

December 15, 2013 by Peter Leave a Comment

I have a problem – I have too many balls in the air, and I can’t even juggle. There are too many things to learn, too many toys to play with, too many things to make, too many books to read. I’m too good at keeping track of things so nothing ever falls off of my TODO list – it just gets punted forward. My attention is split between too many things and I never get any of them done (or even started).

This bugs me. To become technically excellent, open up career opportunities, influence the world, you need to ship, finish, produce, practice, promote, and share. I haven’t been doing any of those things, and without changing my behavior, I unsurprisingly kept getting the same results.

New plan:

  • Keep my project wish-list in a separate document rather than my active TODO list.
  • Every two weeks, choose one project that I most want to work on right now. For those two weeks, I will defer all the other projects to focus on the one I have chosen.
  • By Wednesday of the first week, I will write up and publish a rough roadmap and set of goals for the two weeks I will spend on this project.
  • At the end of the two weeks, I will write up what I accomplished, learned, etc and include code, demos, deliverables, etc.
  • I don’t have to feel guilty about the other projects I’m not working on, since they’re still on the list and when it’s their turn, they’ll get my full attention.

After one year, I will have 26 completed projects with deliverables. However, since this is a new idea, I’m committing to 3 months (7 cycles). At that point, I’ll evaluate if I’m satisfied with my output using this method.

For my first cycle, I’m going to get more comfortable writing Clojure code. Some of the things I plan to do are:

  • Clojurescript Koans – http://clojurescriptkoans.com/
  • Clojurescript 101: http://swannodette.github.io/2013/11/07/clojurescript-101/
  • Pedestal Tutorial: https://github.com/pedestal/app-tutorial/wiki
  • Create a simple database-backed website, so I need to learn a persistence library, ring, templating, etc

Here’s a small subset of other projects I hope to get to:

  • Make a directory of company dossiers and tools to generate them – kind of like Crunchbase but from the perspective of a potential employee trying to quickly evaluate the company
  • Basic computer vision and image processing
  • Sphero hacking
  • Nodecopter hacking
  • Study Peepcode videos
  • Learn Python
  • Write some meatier essays I’ve had in mind for a while

Thanks to @swizec for his 52 Academic Papers in 52 Weeks project, which sparked this idea.

Filed Under: Personal Sprints

Password Hygiene

November 22, 2013 by Peter Leave a Comment

Github recently discovered a distributed brute force password cracking effort. Short version, scammers used a network of 40,000 IP addresses and slow, methodical retries to get around lockout restrictions.

Good news: Github emailed users who were compromised, including some that they could not confirm but suspected were compromised. If you didn’t receive that email, you’re probably ok.

Bad news: They probably tried logging into your account anyway. Check your Github Security page for failed logins (look for user.failed_login). I found one from Indonesia from 3 days ago. A GeoIP lookup tool will give you a botnet world tour.

This is as good a time to repeat password hygiene advice:

  • Do not reuse passwords across different sites
  • Use strong passwords (12-16+ characters, include symbols and alphanumerics)
  • Use a password manager so you don’t have to remember or write down strong passwords. PwSafe is cross-platform, 1Password works well for the Apple ecosystem. There are others, but make sure to use one!
  • Use 2 factor authentication for important accounts. I have it for Google, Dropbox, Github. The Google Authenticator app (iOS+Android) and Authy both work well.

Hacker News has a good discussion that covers more angles on this attack and security in general. Here’s an article about why you should not reuse passwords.

Stay safe!

Filed Under: Programming

Javascript Underwater – My JS.Everywhere Talk about OpenROV

November 13, 2013 by Peter Leave a Comment

I was invited to speak at the JS.everywhere(2013) conference. This was different from my other talks where I talked about hardware projects. The conference is about inspirational stories of coding and learning, each speaker about a unique topic. My talk is about my love of water and how the OpenROV project lets me express that in code. This version has a lot more words than the one I presented with, so you can read it without hearing me speak. I’ll update this when the videos are posted.

Thanks to the JS.everywhere team and of course to the whole OpenROV team – David Lang, Eric Stackpole, Colin Ho, Brian Adams, and more!

Javascript Underwater – The OpenROV Project from pchristensen

Download presentation (14MB pdf)

Here was a reaction to the talk:

Inspiring talks this PM at @JSeverywhere. I'm ready to learn to code while diving underwater. cc @apartovi @christensenp #jseverywhere

— Kevin F. Adler (@kevinfad) October 25, 2013

If you’d like to have me present this or similar topic at your event, please email me

Filed Under: Presentations, Programming

UI Beyond the Browser

October 31, 2013 by Peter Leave a Comment

I recently presented a talk at HTML5DevConf called “Robots, Circuits, and Drones, Oh My! Javascript for Makers“. It took a slight change from the proposed title, to “UI Beyond the Browser – Software for Hardware Projects”. It’s an evolution of the talk I gave at SpainJS about the exciting changes taking place in hardware development and ways that software developers can dive in and enjoy the fun. I think it was recorded but the videos haven’t been posted yet. I’ll update this page when they are. Video below!

I hope this is helpful to you! Special thanks to everyone that has helped me on my Maker journey so far – Jeff McAlvay and the Tempo Automation team, the OpenROVs, the Upverters, Lady Ada, Parrot for making the awesome AR Drone, Orbotix for making the delightfully magical Sphero, and more. Very special thanks to the organizers of HTML5DevConf for inviting me to speak!

UI Beyond the Browser – Software for Hardware Products from pchristensen

Download presentation (21MB pdf)

If you’d like to have me present this or similar topic at your event, please email me.

Now go, goof around, make something awesome!

Filed Under: Education, Presentations, Programming

Engineering The Alpha – Review of Month 1

October 11, 2013 by Peter Leave a Comment

While looking for an e-book to read on the train commute home, I found the book Engineering the Alpha. I bought it a few months ago after I heard Andrew Warner of Mixergy interview with author John Romaniello.

I’ve had weight issues for my whole life, and I’ve never found a fitness routine that I could stick with long term. I know about nutrition and exercise but I’ve never stuck with them. Aside from thinking about my long term health, my energy levels, and feelings of self-confidence, I found a spreadsheet where I tracked my weight 3 years ago, and I was at exactly the same dissatisfying level then. Lots of time where I patted myself on the back for trying real hard, giving an honest effort, blah blah blah, and I made exactly 0 progress in three years. Engineering the Alpha presented a compelling new motivation to try again.

The Book

The book is divided into three parts: the psychological foundation for changing your life, a scientific explanation for the diet and exercise program, and the program itself. The first part uses the Hero’s Journey to explain the phases you go through, from being a normal person to being the hero of your own life. It’s both inspring and rational.

The scientific explanation is very thorough. It focuses on the importance of changing levels of different hormones and how that improves your strength, energy, alertness, etc. The different parts of the program increase or decrease specific hormones to achieve the desired effect. I was a tiny bit skeptical at first because there were no footnotes or references, but in another review of the book, the author explained that the references were cut for space. But let’s be honest, I either believed the authors or not; I wasn’t going to read the research papers.

The diet and exercise section are very detailed, broken to four different programs for one month each. Every other review of the book I read started with “So I made a Google spreadsheet…”, and I did too. It’s tedious and helped me see a lot of the value that a personal trainer provides. I list some of the time, money, and planning I spent to comply with the program.

The basic nutrition program is that first, sugar and carbs are bad. You’re given a formula for calculating how many grams of protein, carbs, and fat you should eat per day (your macronutrients) and calories from each, based on your weight and body fat percentage. Second, spans of time where you are not eating are good for your body. This method, called intermittent fasting, means that you only eat during an eight hour window each day. He recommends noon to 8pm, but you can shift it to whatever works for you.

The exercise program varies from month to month. I don’t remember the details of the following months, but the first month (Prime) is four different workouts, done in a different order each week. Each is two or more circuits of 3-5 exercises that complement each other. They’re hard workouts, no doubt about that, but you can survive them and feel stronger afterwards.

Why Did I Follow It

I’ve complied about 80% with the workouts and diet, which is way more effort. I also spent a bunch of money and time when I could use more of both of those. What motivated me to put in the effort? In short, the authors make a very convincing argument for getting outsized results from following a specific program. They claim that changing your hormones lets you compete on a different level; your body becomes your ally instead of your enemy.

If what they claim is true, then their program is the key to succeeding where I’ve failed before. Given my lack of success with my health throughout my adult life, acting on a convincing argument is not the worst thing I could do. I was at a time when I felt the need to try again, and this gave me enough hope of success, enough to make a serious, concerted effort to test the program.

So far, through one month, it has been a great experience. Lots of observations and thoughts below, but the short answer is that I’ve lost 9lbs, I feel stronger and more confident, and I have hours more energy a day. We’ll see what happens over the next three months and beyond, but I have accepted the call and I’m on my way to becoming my own Alpha.

Thank you John and Adam!

Thoughts on Month 1: Prime

Nutrition

  • You have to eat some dang tasty food to get enough protein and fat to hit the macronutrient goals
  • When I hit the macronutrient goals, I’m not hungry and I have no problem resisting other foods
  • When I hurt my muscle, I decided to try a cheat day, and the sugar crash from donuts, milk, birthday cake, bread, and pizza dropped me like a Vulcan Neck Pinch
  • I’ve eaten basically the same 5 meals for the last 4 weeks. The monotony has not gotten to me, because a) the meals are really good, and b) they greatly reduce craving and increase satiety
  • Typical meal: 8oz chicken (or other meat), 2 oz shredded cheese, 2 oz salsa, 5 strips of bacon, 3-4 oz vegetables, 1oz butter
  • Fasting breakfast is not that hard if you ate your protein and fat the previous day

Exercise

  • The workouts are hard but well designed. I workout more of my body with less rest than I did on sports teams as a teenager
  • The workouts are long – 45-60 minutes. I’ve had to shorten them because it takes too long during the work day once I add in walking to/from gym and showering
  • To shorten, I’d recommend cutting # of reps of each circuit rather than cutting out whole exercises
  • It’s old-school – mostly dumbbells, bars and plates, and body weight. The only machine I’ve used is a lat pulldown because I can’t do pull-ups yet
  • After workouts, I feel like I played sports, not lifted weights
  • Workouts focused on core, legs, lower back, etc. When I lifted as a teenager, it was all biceps/chest/shoulders
  • I took two workouts off because of a pain in a shoulder muscle.Not working out made nutrition compliance harder

Planning, Cost & Time

  • I bought a fancy electronic scale to measure and weigh food. This has been invaluable.
  • It took me hours to come up with a few days worth of meals that hit the macronutrient targets. I tried the resources recommended in the book and really, really didn’t like them, so much that I’m not going to look up their names or mention them. I found the meal planner in the paid version of Daily Burn Tracker to be much better
  • I use the GAIN Fitness app. It’s free but I spent about $24 on their “packs” that add extra exercises to complete the workouts outlined in EtA. It’s worth it because it a) is very easy to use quickly in the gym to update rep count, weights, b) it’s a great way to keep pace for circuits, rest, timed exercise (planks!), and progress in different exercises across workouts, c) has visual and text representations of the exercises in the app.
  • The cost of the book, scale, workout packs, etc was about $100. I’ve spent more on groceries but far less on restaurants because it’s hard to get exact macronutrient numbers without planning beforehand
  • My gym membership is $69/mo. There were cheaper gyms (including the one in my apartment complex) but I paid more for the one close to where I am at the time of day I wanted to work out
  • The biggest cost by far is the time I’m spending at the gym and cooking and measuring food – probably 8 hours a week (more laundry time too). This huge (comparative) investment made spending on the scale app a no-brainer
  • I spent about 4 hours setting up the workouts in GAIN Fitness, including finding the same exercise but with different names, finding reasonable substitute exercises where there isn’t a match, and copying the text and images from the book so I remember what they are and how to do them when the app prompts me to do the substitute. I expect to have to spend a similar amount of time for each of the 3 parts of the program left.
  • For timed exercises, make the rest for the previous exercise equal to the rest + the time for the next exercise
  • Right now you can only edit workouts in the GAIN Fitness app, not on their website

Results

  • I lost 9.5 lbs the first week, 1.5 the 2nd week, gained 3 the 3rd week, and ended up down 9 lbs for the month
  • Until I crashed on cheat day, I hadn’t realized how much extra energy I’ve had every day since I started the program
  • The weight I used for exercises increased by 50-80%, although I started from pretty low weights since I haven’t lifted weights in years
  • I’m walking straighter and with better posture – I feel about an inch taller
  • My energy is so much more and steadier throughout the day. Before I would crash in the afternoon and be useless by 10:30pm. It was the crash in the afternoon that was part of my plan – I wasn’t getting anything done at work during that time so I thought I’d go to the gym instead
  • I haven’t done any measurements (inches or body fat %), but clothes that barely fit a month ago are comfortable now, and clothes that were comfortable a month ago are pretty loose
  • My arms and legs actually feel muscular now, and if you dig your fingers down far enough, you can feel my abs

Filed Under: Book Review

Find the Largest Files In A Directory

October 2, 2013 by Peter Leave a Comment

tl;dr: $ find . -type f -ls | sort -r -k 7 | head -20

I’m a programmer who grew up on Windows, so while I’m competent at Unix commands, there’s a lot I don’t know. That “young and clueless with lots of time” period is a great time to pick up skills; the “busy working father” period means I have to be much more selective now.

Backstory: I have been a Dropbox user since they were in beta in 2006, and every once in a while I bump up against my free space limit and have to weed out files. This gets harder every time since everything left is something I’d previously decided to keep. COMPUTERS TO THE RESUCE!

I went to the first place I always look for these problems: Stack Overflow. There was an answer, of course, but it didn’t work for me. I tried to get it to work, but didn’t feel like looking past the man page for why the printf option wasn’t valid on my machine.

So the next place I looked was the rest of the Google search results. Eventually I came up with this:

$ find . -type f -ls | sort -r -k 7 | head -20

List all the files, sort in reverse order based on the 7th field, and take the top 20. Thanks nerds of the world for answering my question!

Filed Under: Programming

Zero To Maker – A Bible and a Road Map for Makers

September 19, 2013 by Peter Leave a Comment

Full disclosure: David Lang (and OpenROV) was one of the first friends I made after moving to the Bay Area last year. This review is completely, hopelessly biased.

I supported David’s Kickstarter to write this book, I’ve read it on the web in pre-release, I’m getting the ebook from the Kickstarter, and I’m buying a physical copy because this book is that important. This is the kind of book that you can’t wait to recommend to someone when you find out they’re interested in the subject.

As the Maker movement grows around the world, more and more people are becoming inspired to create things. Anyone at any level of skill can learn from this book. David has been in the center of many different branches of the Maker movement and reports on them all – hackerspaces, electronics, Arduino, learning from scratch, sharing, finding ideas, working with others, community, writing, promotion, Kickstarter, Maker Faire, licensing, starting companies, etc.

But this book is not just for Makers. It is an outstanding guide for building your own skills and presence in ANY creative field. The pattern, told through a Maker lens, is:

  1. Find something you’re interested in and want to learn
  2. Find people doing that thing
  3. Ask them what they’re working on and what they recommend learning
  4. Do some project involving the thing you want to learn
  5. Share your results (good or bad) and solicit feedback
  6. Based on experiences and feedback, return to step 1 and repeat forever

It’s also well written and delightful to read because of David’s writing skill and the breadth of his Maker experiences.

Conclusion: This book will grow to be a cherished and work fixture on the shelf of anyone who loves learning and making. There’s no substitute for doing, but this book will guide your doing in the right direction. Whether you’re a pro or completely new, learning for fun or inventing a new career, making your first prototype or turning a project into a business, David will give you confidence and clarity as you move forward. Don’t let the title fool you, you’re never done becoming a Maker.

PS I’ve posted a bunch of my favorite snippets of the book to Twitter at #zerotomaker.

Filed Under: Book Review

We Are All Joe/Jane Developer

August 21, 2013 by Peter Leave a Comment

[EDIT: Full attribution for the JD Intellectual Property rights]

My coworker Andres, whenever he spots “clever” code during code reviews, asks “What will Joe Developer think of this?”

(Feel free to use Jane Developer if it’s more appropriate.)

Joe Developer is our fictional persona of a capable but not outstanding developer. He knows the popular parts of commonly used APIs, the mainstream parts of the language, but doesn’t know or use quirky constructs or features. He’s probably better at writing code than reading it, and he doesn’t have any particular knowledge of the domain.

You might think we look down on Joe Developer, like he’s not one of us, that he’s not smart. That’s not the case at all – Joe Developer is us.

We have a team of about 10 people and a 3 year old codebase. People have joined and left the team during that time. Even the most senior or most productive people on our team haven’t written more than 20% of the code, and haven’t even seen more than half of it. Some code is new and evolving quickly. Most business reasons behind the code are only documented in our issue tracker and the brains of the people that worked on it.

This means that most of us, most of the time, have to actually read code to understand what it’s doing and how to modify it. Reading new code without the benefit of knowing the domain is hard enough. You have to read, understand, and simulate the execution of the code in order to reason about it. And that’s hard! Brian Kernighan (creator of C and Unix) said:

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

When you’re reading code, you are Joe Developer. Joe reminds us of the difficulty of reading vs writing code, of the power imbalance between the writer and the maintenance programmer a year later. It’s a clever shorthand reminding us to be clear, concise, and as simple as possible in our code. Putting 5% extra attention and rework to accommodate Joe Developer makes reading and revisiting code so much easier. We don’t fix everything, but we remove the most burdensome, most confusing time-sinks, producing an outsized benefit.

We look out for Joe Developer because we are all Joe Developer.

(Andres already wrote about Joe Developer on our company blog)

Filed Under: Programming

« Previous Page
Next Page »

Categories

  • Blog
  • Book Review
  • Business
  • Clojure
  • Education
  • Emacs
  • Fun
  • iOS
  • Lisp
  • Personal Sprints
  • Pictures
  • Polyphasic
  • Presentations
  • Programming
  • Rails
  • Startups
  • Uncategorized

Copyright © 2025 · Minimum Pro Theme on Genesis Framework · WordPress · Log in