Python with crontab on Mac OS X 10.5.1 Leopard

I had a simple goal: run a python script every 15 minutes throughout the day. I read up on cron and expected to move on to the next task in no time…

Four frustrating hours later, I nailed it down:

For those of you Googling for a solution, here it is:

crontab -e:

crontab

Some pointers:

1) Use the full path to the Python interpreter.

2) Make sure the path is to the correct Python interpreter.

Some of the third party modules my script imported weren’t loading because my script was looking in the wrong place.

For example, one of my earlier attempts I tried using:

/usr/bin/python

But that interpreter wasn’t the same as the one I normally get when I simply type “python” at the terminal. The correct one for me is located at:

/Library/Frameworks/Python.framework/Versions/2.5/bin/python

3) When referencing files from the Python script, use the full path.

Bad:

text = open(‘hn_source.html’, ‘r’).read()

Good:

text = open(‘/Users/Matt/Programming/python/tests/hn_source.html’, ‘r’).read()

Bottom line: When using cron, ensure that you explicitly declare where everything is located.

Progress with Flash: A Dead-Simple Chart

This is the culmination of many hours of work:

Be amazed: the points change every time you load the page.

I’m hoping the pace picks up now that I’ve gotten the hang of it…

Ads vs Content on Kaboodle

While looking for a birthday gift for my wife, I came across Kaboodle.com, a social shopping site that lets you shop with your friends online. Cool idea.

There’s a section on their homepage titled Popular Stores that lists Etsy as its first item. I recognized Etsy, so I clicked through to see what Kaboodle has to say about them.

Here’s the page. I added red outlines around the four visible ads:

A fair chunk of my screen is used by ads and for their nontechnical, small-monitor-owning target audience, it would make up even more.

There’s a tricky balance between making the content easy to find and placing ads in prominent positions to increase clickthrough rates and profits. You want ads but you don’t want so many that people have no reason to come to your site or can’t find the information once they’re there. If you cover you three quarters of your site with ads, you’d likely lose a significant portion of the new visitors who can’t quickly find what they’re looking for.

And just because you can place more ads doesn’t necessarily mean you should. Its possible that a few well placed ads on Kaboodle would result in more people sharing the site, which would lead to more visitors to the site in the long run and higher profits.

But who knows. Maybe the majority of their nontechnical target audience thinks the ads are the content. Or maybe they know they’re ads, but don’t care because hey, it’s an online shopping site. Maybe Kaboodle has A/B tested their pages dozens of times and have determined that this is the optimal ad to content ratio. Maybe they don’t care about the people who care about ad placement because those people, like me, never click the ads (that’s probably true). And maybe the people that can’t find the content because they can’t scroll past the ads are also the people who believe their identity will be stolen if they use their credit card online, so won’t buy anything anyway.

Admittedly, they seem to be doing alright for themselves:

There’s an important lesson here for picky web developers like me: most people are not picky web developers.

Entrepreneurs Can Change the World

Flash: First Project

I’ve been spending most of my free time reading about and experimenting with Flash CS4.

For my first project, I decided to create an animated header for this blog.

I started by drafting a layout in Photoshop, but quickly realized that the direction I was heading was going to result in something way too obnoxious to actually use:

I started over, this time merely animating the existing header:

(It’s set to not to loop — to see it in action, right click and hit Play)

Alas, even after reducing it to something mind-blowing simple, it just didn’t look right. Not here anyway.

Lesson learned: There’s a time and a place for Flash apps… blog headers are not one of them.

Identify The Essential

Setting limits helps you achieve. Many times, when we are spread too thin, we only make incremental progress on important projects and goals. But if we focus on just a few important things, we can actually complete them. You’ll achieve much more by focusing on the essential.

Leo Babauta, The Power of Less

A few days ago I picked up a copy of The Power of Less after reading about it on Derek Siver’s blog.

The key theme of the book is to simplify your life, which can be boiled down to two steps:

1. Identify the essential

2. Eliminate the rest

I’ve recently found myself bogged down in clutter so I figured I’d give it a try. I started by making a list:

Identify the Essential:

- Wife: Having a healthy, prosperous relationship is my number one priority. I’d sooner let everything else fail than have them affect my marriage.

- Startup: Eventually (3 to 5 years) I’m going to found a startup and I want to be as technically skilled as possible for when that time comes. This bullet serves as a reminder that the majority of my free time should be spent working towards that end. In the next few months that means learning Flash, Photoshop, Django, jQuery, and launching a new site.

- Health and Nutrition: It’s easy to push this to the side when you’ve got a lot to do but long term it affects every single other thing you do.

- Education: I have a bad tendency of reading a few dozen pages from a book, and then quitting when I find a new book that piques my interest. Then I repeat that cycle over and over until I have 20-30 books that I haven’t finished. Eventually I’ll come back to them and read 20-30 pages then rotate to another one. That, or I never get back to it. Probably not the best way to go. Accordingly, I’m narrowing it down to two that I’m going to finish before I move on to anything else:

– The Power of Less

– Four Steps to Epiphany

Minimize the Rest: (note: not eliminate, for now)

- HackerNews: Definitely my number one time eater. I considered categorizing it under Education, but right now I think that time is better spent hacking. New homepage: Progamming Adobe ActionScript 3.0 for Adobe Flash. Man I’m cool.

- Google Analytics: Looking at the numbers for this blog is a purly ego scratching, unproductive waste of time. In fact I’m removing it from my favorites, right now.

- GMail: I check email to procrastinate. I get about 8 emails a day and yet check it about 20 times a day. Let’s try once.

- Blogging: My plan is to write fewer, higher quality posts than many short mediocre ones.

- Domain Names: When I get bored I hit up AjaxWhois and search for domain names that might make good company names. Hows about building something people want and worrying about the company name later, eh?

Don’t Forget:

- Housework, Call Family: The first one is mostly to appease my wife and the second one is for me.

- Keep Desk Clean: I tend to let stuff–paperwork, dishes–pile up on my desk. At some point it gets to be too much and I take 20 minutes to clean it all off and put things where they belong. As soon as my desk it spotless, I find that I can concentrate better and that I get I can get more done.

After you’ve identified the essentials and reduced/eliminated the rest, the trick is to do it.

Now, every time I find myself pulling up HackerNews or checking GMail I take a look at the list and remember: focus.

Not surprisingly, I’ve gotten more done in the last few days than I have in the last few weeks.

Persistence

Cloninger has trained rats and mice in mazes to have persistence by carefully not rewarding them when they get to the finish. “The key is intermittent reinforcement,” says Cloninger. The brain has to learn that frustrating spells can be worked through. “A person who grows up getting too frequent rewards will not have persistence, because they’ll quit when the rewards disappear.”

From How Not to Talk to Your Kids.

Learning Flash

I just finished Chapter 6 of Flash CS4 Professional Digital Classroom:

I’m fairly certain if you keep this on loop and watch it for more than 30 seconds your head will explode.

Go Fish!

I’ve started learning Flash with the help of an excellent book titled Flash CS4 Professional Digital Classroom.

Here’s the culmination of today’s work, which is based on the tutorial in Chapter 3.

I’m quite proud of it myself.

Man Builds Toothpick City

Scott Weaver, 49, spent 34 years building a city out of 1M+ toothpicks:

Click here to read the entire article.

The best line from the interview is at the end when he says:

“The lesson in this is what do we do with our time. And I love to create. I love to show people what can be done in life if you spend time to create. Use your imagination.”

Embedded video from CNN Video

« Previous PageNext Page »