December 2012
1 post
iTunes 11 creates UI color scheme from album art
This is a really awesome touch in iTunes 11. The effect was so seamless and well-done that it took me this long to notice.
October 2012
1 post
Why I'm not Ditching Instapaper for Pocket
I’ve been using Instapaper since 2010. While I really like the service, I’ve always kept and eye out for worthy replacements.
Pocket is Read It Later after a bit of a rebirth, and is undeniably the sexiest of the boomarklet-based reader apps, with a slick iOS app and a great web interface.
When you sign up for Pocket you get all of the features it has to offer, presumably forever....
September 2012
2 posts
A Poem for LISPers
MUCH madness is divinest sense
To a discerning eye;
Much sense the starkest madness.
’T is the majority
In this, as all, prevails.
Assent, and you are sane;
Demur,—you ’re straightway dangerous,
And handled with a chain.
By Emily Dickinson.
What's so bad about prefix notation?
One of the common complaints about Lisp is that it forces you to use prefix notation for mathematical expressions. This is a fair complaint, since it’s a pretty big departure from what we learned in Algebra class.
But, exactly how bad is prefix notation, after all? Let’s start with an example:
5 + 6 * 7
When you read this, in English, as “five plus six times seven”,...
June 2012
1 post
bcrypt is Not the Answer
bcrypt and other adaptive hash algoritms are a good idea. It’s comforting to know that your password hash time can be scaled up as computing power available for brute force cracking increases.
However, this is an arms race. It’s reasonable to assume that the power available to crack passwords will increase faster than the power available to initially hash passwords. It’s better...
May 2012
2 posts
jQuery plugin for XML namespaces
If you’ve ever tried parsing RSS or other XML content using jQuery, you know that it’s impossible to select elements with a specific namespace. On top of jQuery’s own selector engine, the browser’s own selector engine is broken in certain cases, too! So, I rolled a quick solution for this in the form of a plugin: $.fn.findNS.
This lets you find, for instance, a...
Memoized Blocks in Smalltalk
I came across this post on memoization in Smalltalk by way of James Rober’s blog, but it was lacking in actual code!
So, without delay, I fired up Pharo and whipped up an implementation.
It’s very simple, in typical Smalltalk fashion. It’s just a method of BlockClosure:
memoized
"returns memoized version of an unary function"
| cache |
cache := Dictionary new.
...
April 2012
1 post
What kind of idiot...
…accidentally buys DDR3-1066 (PC3-8500) when he meant to buy PC3-10600 (DDR3-1333)!?
This is why I am not a “hardware guy”. I have no patience for figuring out some rather obtuse and arcane combinations of numbers and letters that mean the difference between a computer working correctly or not working at all. Oh wait. That sounds like code.
March 2012
1 post
Yahoo! Goes Nuclear
Well, we can say without a doubt that Yahoo! is done now. They are resorting to leveraging patents like this:
This is what anybody developing an ad display system would do. How could any moderately serious site not order ads by their click-through rate or price-per-click? That would be silly to omit, and it’s completely obvious to anybody who has spent any time on the Internet.
February 2012
5 posts
What Happened to TileStack?
Every once in a while, a blog post or some article will ignite a HyperCard nostalgia trip among the programming community. Everybody remembers how awesome it was, what was possible with it, and how Apple pulled the plug. Then people start prognosticating on how to build a new and more modern HyperCard, that would be like the original but even more awesome, with features X, Y, and Z, and everybody...
Oops! I don't care!
I’ve left a half-finished pre-alpha thingamajig running at http://smarterseating.com for about 6 months now. It’s actually been running in a Clojure REPL in a SSH session since I first started it. That’s a nice testament to how long a Clojure web app can run, but it’s not the point.
It started when a friend wanted to solve this problem for his wife (a school teacher) and...
Why do remote controls still exist?
The post TV Is Broken reminded me of something that I’ve been thinking about for a while. It’s only tangential to the problem of content on TV.
I don’t buy a lot of consumer electronics, but it so happens that I have six devices that can comfortably browse the web from my couch. They are usually within reach when I’m operating the TV or its cohorts (a receiver/amplifier...
On to level 4!
I have to say I’m a little bit proud of myself for figuring out level 3 on Stripe’s Capture the Flag challenge.
Good luck to everybody out there trying this, too.
January 2012
1 post
Struggles and Success With Cygwin
While PowerShell is a great thing for Windows management, it still has a long way to go to catch up with the sheer flexibility of Bash and the staggering array of tools centered around manipulating simple streams of text.
This post on StackOverflow contains a few great bits from different perspectives: even from the creator of PowerShell itself.
I just wanted to share some of the problems that...
December 2011
2 posts
Jenkins, Cygwin, Windows 7, and permissions
Cygwin is a godsend for controlling your workflow and putting together the sort of tools that keep devops humming along. And Jenkins is a great freeform build tool for managing pretty much any software CI/build process.
But Cygwin and Windows permissions don’t always play nicely, especially when you add intermediary processes like Jenkins to the mix. My build scripts were copying various...
Things you can't do in Visual Studio
Here’s something you can’t do in Visual Studio: be editing code in one half of a split window, and be having a conversation with the language/framework author in another, with only a few keystrokes, and with the full facilities of the editor at your disposal. Thanks, Emacs. You made my day.
November 2011
1 post
Is Zach Holman trolling us?
spark is over 400 points on HN right now.
Initially, the script didn’t work on OS X. Now I’m not sure what it does work on, but it barely works on my OS X terminal, and it definitely doesn’t work in Cygwin.
It takes a comma-separated list, instead of a standard argument list. So you have to use tr "\n" "," instead of just simple substitution or xargs.
It doesn’t even...
October 2011
4 posts
R.I.P. John McCarthy
The third major computing figure to die in a month! They say famous people die in threes.
Anyway, I owe my career in software to John McCarthy. My first introduction to programming was through the Apple Logo programming environment in elementary school.
Fast forward many years later, after stumbling along in BASIC, PHP, Java, C#, Ruby, and others. I rediscovered Lisp through Scheme (and The...
Poor Man's Tuples in Clojure
Hiredman is working on a nice implementation of tuples in Clojure. But, just for fun, I wanted to whip up the absolute minimum viable O(1) tuple possible.
The result is this macro:
(defmacro tuple
[& xs]
`(fn [idx#] (case idx# ~@(mapcat list (range (count xs)) xs))))
Try that in Ruby or C# ;)
So, (tuple "foo" 5 :bar) returns a function that takes an index and returns the value at...
Getting Started in Rails is Insane
Insane. And not in a good way.
James Johnson posts a “beginner’s” guide to getting a modern Rails environment up and running, in Rails and Web Development - Take the First Step.
(note: I’m not really trying to poke fun at the tutorial here… the point is that the tutorial is actually mostly accurate: please read on)
Don’t people realize that this is crazy?...
Since Everybody Needs to Say Something About Steve...
The passing of Steve Jobs is a really big deal. His contributions to computing made a big impact for me, personally.
We programmed Apple Logo on Apple IIGS computers in the computer lab in 3rd grade. It just “clicked” with me, and nearly 20 years later, I’m still programming (and I have actually come full-circle and picked up Lisp; it turns out Logo is a Lisp). In after-school...
September 2011
1 post
Flixel with MXMLC
I found the existing tutorials for using Flixel with MXMLC lacking, so I created this guide. I hope it’s useful.
August 2011
2 posts
"Patent reform" doesn't mean what you think it...
Yesterday, in his speech at a next-generation car battery factory in MI, President Obama asked people to support passage of patent reforms necessary to enable innovation. My first instinct was to cheer this seemingly out-of-the-blue revelation, assuming that the administration had been paying attention and was advocating the kind of patent reform we actually need to ensure unfettered innovation.
...
Launching the pre-alpha of SmarterSeating.com
So, a full week after my post last week, and with a good portion of Hacker News waiting to see if I’d actually follow through, I’ve got something.
Smarter Seating
My initial plans were for something not even remotely related to what I put together in the last 24 hours. I spent a good number of hours in my spare time (driving my wife crazy, by the way) building something that I...
July 2011
2 posts
[Reading Hacker News] is not launching
I really enjoyed patio11’s AnyAsq, especially this part:
My most important bit of advice: LAUNCH. Asking me questions is not launching. Reading about the topic is not launching. Launching is launching. All good things come from launching. My business went from conception to launch in 8 days. Put a red mark on your calendar: 8 days from now, a month from now, whatever. Launch something by...
Getting (stuff) done
I’ve created this bash script to help me focus on work. It blocks and unblocks a list of websites with a single command. It’s tailored for Mac OS X, but it should work on other platforms if you set up the env vars.
I created an alias for it in my .bash_profile which runs the command in the proper fashion:
alias gsd='sudo -E gsd.sh'
To get to work:
gsd
To slack off again:
gsd...
December 2010
1 post
5 tags
Persistence is a Scaling Problem
(The first in a series of posts on Smalltalk, and Seaside in particular)
When programming in Smalltalk, the question of data persistence is not one you have to answer right away. You don’t have to think about serializing your data to disk or to a database to get on with your application. In fact, you can entirely put off the question of data persistence until the last possible moment, when...
June 2010
1 post
Customizing Safari 5's Reader
Safari 5 includes Safari Reader, which turns out to be based on Readability. I am a huge fan of the original and the integration with Safari 5 is a great move by Apple.
The only problem is that there are no options in Safari related to the presentation. If you’re like me and you prefer light text on a dark background in some cases, you might want to customize the Reader.
So I poked...
April 2010
2 posts
Comments Should Stand Out!
Like a lot of programmers, I use a subtle color theme in my text editors. But one category usually ends up dimmer, fading into the dark background, slinking off into the shadows: comments.
// variable to hold the number of pages
int numPages = ...;
Why? I think it’s because most comments suck. It’s understandable that you’d want to ignore those and get on with your work....
Why PCalc doesn't work on the iPad
PCalc is a fantastic little calculator for the iPhone. It has a RPN mode, and has all sorts of add-ons that you can purchase to enable modes that make the calculator much more useful for whatever niche (programming, financeyou work in.
There’s just one problem: the iPad version feels like a novelty/joke calculator. The buttons are huge! At this size the on-screen handheld calculator...
February 2010
4 posts
Omit Null Values From Objective-C Collections...
Often times I’ll find myself struggling with a bunch of NSNull values coming back from some JSON API (my own included). NSNull is not pretty to deal with in Objective-C, and usually I just don’t care about those null values. So, in order to deal with those API results in a simplified fashion, I wrote some code to recurse over the collections leaving out the nulls.
Enjoy.
Available...
Multitasking and the iPhone/iPad
Lots of people are hoping that the iPad gets multitasking.
As fnid2 opines on Hacker News,
it’s just the beta version people! Eventually, it’ll have a camera and multi-tasking. For crying out loud!
I hope it doesn’t get application multitasking, and here’s why.
We know by now that multitasking is a myth. Yes, your computer can do it very well, but you are not a...
diff psalm14.txt psalm53.txt
I was intrigued to read this post about the chapter in the Bible that appears twice. So naturally…
diff psalm14.txt psalm53.txt
1c1
< Psalm 14
---
> Psalm 53
5c5
< They are corrupt, their deeds are vile;
---
> They are corrupt, and their ways are vile;
8c8
< 2 The LORD looks down from heaven
---
> 2 God looks down from heaven
13c13
< 3 All have...
Dark vs. light text smoothing on OS X
Light text on a dark background comes out looking a bit heavier than dark text on a light background, which Apple’s font smoothing seems to be optimized for.
January 2010
6 posts
Webinar vs. Whitepaper
I’m really amused at the outcome of this Googlefight: Webinar vs. Whitepaper. It would seem to me that you just can’t have a webinar without a whitepaper. This gave me the idea for a site that measures the Enterpriseyness (a perfectly cromulent word) of a domain using Google. Keep an eye out for it…
You Can Always Do Less →
Sounds good to me. When doing iPhone development you can quickly descend into very complicated territory by choosing to do thing that seem simple on the surface, like changing the color scheme of your app.
Snazzy Apple Font Styles on the iPhone
If you want to reproduce the nice dark inset label style that Apple uses all over the place, the magical formula is a shadowColor of half-opaqe white and a shadowOffset of {0, 1}. Use it wisely.
Also, the deep blue text color like you can see in the labels at the top of a person’s info in Contacts is 0.121569 0.156863 0.223529 1 (r g b a, respectively).
GitHub Quick .h/.m Switch Bookmarklet
I wrote a handy little bookmarklet for iPhone or Mac developers who want to be able to switch between an interface (.h) and implementation (.m) file quickly while browsing a project on GitHub.
The code is hosted in this Gist paste, and will be updated if I come up with any improvements.
Can't build for the iPhone simulator?
Xcode decided to throw a wrench in things today and ended up unable to build my iPhone project for the iPhone Simulator. If you ever find yourself unable to compile your app for the simulator, and you have a build results window filled with linker errors (starting with errors about how each framework is of the incorrect architecture), then just apply this simple fix:
Go to your target’s...
Another Blog?
Tumblr is the new Blogspot, right? Maybe I’ll actually post here.