Articles

Photoshop: Create an iPhone Google Map-style Shadow for Icons • August 23, 2010

While working on the next release of Sphericle (which is going to be awesome), I've had to create new map icons for the Search screen in the app. I want these icons to have the same style of shadow as the Google Map pins do on the iPhone. So, after some experimentation, I found a pretty easy and accurate way to do that. Here's what we're starting with:

Icon without shadow

On the left, you can see the typical pin. On the right is an icon I'm working on, showing a player's profile picture. This is the icon we'll make a shadow for.

Duplicate and Merge Your Shadowed Object

First off, you want to create a flat copy of whatever you're making a shadow for. In this example, the icon is actually made up of several layers grouped together, so I select the Group, then "Duplicate Group", then "Merge Group". read more »

HostingRails and Capistrano Permissions Mismatch • April 9, 2010

I stumbled across a problem, and then a solution, today, when deploying a Rails application to HostingRails. After I deployed, I started getting Application (500) Errors on all of my pages.

After talking with support, I found out that is was because the group write permission was being turned on on my dispatch.fcgi file. Looking further though, I realized that all of my deployed files had group write turned on! So, the question was, why?

Some searching led me to this post on the HostingRails forum, which essentially says that starting with version 1.4, Capistrano turns on group write for all your files by default. Lovely.

One commenter posed this solution (which I slightly modified), which worked for me:

In deploy.rb, add the following code:

desc "Set permissions to 755, so HostingRails does not complain"
task :hostingrails_fix do
  run "chmod 755 #{deploy_to}/current/public"
  run "chmod 755 #{deploy_to}/current/public/dispatch.*"
end

after "deploy:symlink", :hostingrails_fix

A Simpler Magnifying Glass (Loupe) View for the iPhone • March 25, 2010

magnifier_screen.jpg

I recently needed to create one of those magnifying glasses in an iPhone app that shows you a close-up view of where you're touching. Searching around led me to this article by Sean Christmann, which was really helpful in showing me how to create what I was looking for (Thanks Sean!).

However, once I got familiar with his approach, it seemed like there had to be a simpler and possibly more efficent way to get the same thing. He generates a cached image to get the effect, which takes up some memory, but more importantly, it also prevents the magnifying glass from having live updates (which I needed). In other words, once the magnifier is there, any activity going on beneath it won't be properly shown.

So, I wrote my own. read more »

Experimenting with NetLogo • March 23, 2010

netlogo_exp1.jpg

My friend Matthew has repeatedly told me that I should try out NetLogo to aid me in my experiments with cellular automata (such as Glory Math), and a couple of days ago, I finally took his advice. Man, he was right.

I think I downloaded it somewhere around 4pm. I stopped using it and went to bed around 2am. The following is part of what I have to show for it. I started with the Vants model (one of the many models that comes with NetLogo), and experimented from there, both with the behavior of the agents, and the color mapping, until I got something that I found visually interesting.

Basically, this model makes a bunch of little guys that run around in circles. Most of the time they like to stick to the same general area, but occasionally they get inspired and bolt off to new territory. Along the way, they leave trails that light up the more they are traversed.

Here's the NetLogo source file so that you can poke around yourself. read more »

The Math Behind Glory Math 1 • March 20, 2010

Glory Math 1, all stretched out

Glory Math 1 is an example of an asynchronous, two-dimensional cellular automaton (CA). If you poke around Wikipedia, you can find some pretty good information on what exactly that means, but in a nutshell, it's a rectangular grid of squares, each containing a number (which represents a color), and each square in the grid constantly updates itself based on a set of rules that take into account that square's neighbors (the squares around it).

The Rule

The rule dictating the behavior of the cellular automaton is really simple: each generation (step in time), each square takes on the value of the average of its 4 neighbors' values (in the cardinal directions, not the diagonals). That's it.

But, It's Asynchronous

A synchronous CA computes each cell in a generation simultaneously, meaning that only the cells from a previous generation are taken into account when calculating the next generation. read more »

We Need an Easy Way to Correct Others' Spelling and Grammar Mistakes Online • February 18, 2010

Often when I'm reading blogs or news articles online, I notice small spelling mistakes. They're usually the ones that get through spell checkers... the ones where the writer accidentally spelled a different word (e.g. today I saw "cap" instead of "cape"). Every time I encounter a mistake like this, I want to tell the author about it (I'm just that way about spelling). But, I'm too lazy to find a way to contact the author, and describe the mistake. I wish I could just highlight the text, make the correction, and have it sent to the author. read more »

How to Plan Freelance Projects (or, why I built HourPatch) • February 10, 2010

I've been freelancing full-time for 3 years now (although I started freelancing about 6 years ago), and after all this time, I've finally found a method for planning my project schedule and keeping my commitments in check. read more »

Changing the Search Block Form Text in Drupal 6 • August 6, 2009

A couple of weeks ago I had a client request to change the search box on their site to have the text "SEARCH" appear inside of the text area on their search form. Some searching led me to a couple of posts on drupal.org about how to go about this, but the way that I chose ended up actually being in the comments on one of those posts. read more »

Easy Ranking with Rails and MySQL • July 14, 2009

As part of some of the new features I'm adding to Sphericle, I needed to add a ranking system for user accounts, based on a point system. Specifically, I needed to write a method for my User class (on the Sphericle server, which is a Rails app) that would give me the ranking for a User, based on how many points that User has compared to all the other Users. read more »

Applying our Photoshop Thumbnail Script to Multiple Documents • May 25, 2009

A reader asked if there was a way to apply the Photoshop Thumbnail script I wrote to all open documents, so I figured I'd post it up here for everyone to see. read more »

More Pages

Syndicate content