Pete as a Newspaper

Freetype, jpeg, zlib and the Python Imaging Library on OSX 10.5

Posted Jul 18, 01:51 PM in by Pete Karl, comments closed.

I’ve spent the better part of a few days going through the Django guide, following along closely, and executing their code examples as I proceeded.

Predictably, things haven’t been smooth.

Continue reading »

Diary of a Web Developer: Perl, Python, and PHP. Required knowledge.

Posted Jul 15, 03:53 PM in by Pete Karl, received 2 comments, comments closed.

This post is about tools in the web developer’s toolbox. This post is the sort of post that I wish I’d seen when I first got into web development. This post is meant to describe the tools in your toolbox, and their use within the context of the web.

Continue reading »

Parse Yahoo! Weather RSS using PHP and SimpleXML (also: explore the yweather namespace)

Posted Jul 7, 10:07 AM in by Pete Karl, received one comment, comments closed.

The Yahoo! Weather API is just swell. We get current temp, atmosphere, et cetera for any area of the US and a forecast for tomorrow all for free. In a similar bout of awesomeness, PHP5 contains the SimpleXML class.

Continue reading »

Using Apache logs to track 500m pageviews a month

Posted Jun 16, 04:55 PM in by Pete Karl, received 4 comments, comments closed.

So here’s the deal. GateHouse Media is becoming a large newspaper/technology company. We have several hundred web sites, and accurate stats on those sites in invaluable.

When I heard that accredited stat tracking companies like HitBox and Omniture cost hundreds of thousands of dollars a year, I thought — Holy geez, can I help out w/this expense?

Continue reading »

Must have modules for fresh Drupal 6 installations

Posted Jun 6, 02:19 PM in by Pete Karl, comments closed.

Nothing like starting a fresh install and having to claw around for the latest and greatest for each of the integral 3rd party modules.

Here are a few starters & their CVS checkout linkages. You should execute these from within the sites/all/modules directory in your Drupal 6 install. You should create this directory if it doesn’t exist already.

Continue reading »

Add leading zeros to a number using PHP or JavaScript

Posted May 28, 08:11 AM in by Pete Karl, received 2 comments, comments closed.

I was creating an associate array the other day. Riveting, I know.

I needed to sort this array by a piece of data, and I was lazy (like all healthy programmers), so I decided to prepend the data to a unique string and make that the key. Nailed, it sorts, right?

No. PHP doesn’t realize that 1 is less than 12 when you’re sorting strings. The solution I chose for sorting strings of numbers was to add leading zeros. The functions below can be used to do so.

Continue reading »

jQuery makes you smarter: Keep users from clicking on a link (or submitting a form) multiple times

Posted May 20, 11:21 AM in , by Pete Karl, comments closed.

There will be instances in which you need to limit user input for their own sake. Payment submission, file downloads, and…basically any time you require user input once and only once.

The script I’ve constructed here is meant to help reign in the wild masses by limiting clicks on links or form submissions.

Continue reading »

Introduction to Git: Version Control for you and me (on OS X 10.5 Leopard)

Posted May 13, 11:36 AM in by Pete Karl, comments closed.

While I’m relatively new to the field of version control, I’ve been through the basics of CVS and SVN, and at work, SVN is part of my programming workflow.

That said, people are hot for Git, and so I’m going to explore its installation on Leopard (OS X 10.5), and basic usage.

Continue reading »

jQuery makes you smarter: Dynamically parsing a form field for golf score input

Posted Apr 9, 09:48 AM in , by Pete Karl, comments closed.

I know this sounds obtuse, but check it out. I think this code could provide a foundation for some slick, quick UI out there some day.

What I'm working on right now is a scorekeeper for disc golf scores that my friends and I keep. Entering scores for 3 or 4 people + 18 holes + HTML form fields = pain in the ass.

See the input model & code after the jump.

Continue reading »