- Recent
- Popular
- Tags (0)
- Subscribers (1)
- Inspiring a New Generation of EngineersNovember 19
-
I used to have an old Motorola e810, a standard non-smart phone with a camera, circa 2005. Being the cheap bastard that I am, this phone doubled as my alarm clock, boasting multiple different alarms. I stumbled across an interesting quirk: you couldn't set more than one alarm for a time; that is, if you had an alarm for 6:00pm that said "Laundry," you couldn't have one for 6:00pm that said "Order Piza". Honestly, it wasn't a big deal. It didn't matter which alarm went off, as long as one did, and that was probably a design decision made when they created the phone. But it still bothered me.
The only thing I could think of that made sense was that each alarm was some sort of key/value pair where the time was the key, and duplicates weren't allowed. I can sort of see the logic for this. If it was a hash table, for instance, then at each minute you just perform a look up to see if there was an alarm set. This makes slightly more sense then iterating over all of the possible alarms at each new minute (although since most people only have one or two alarms, probably not a huge savings).
While it was a fun exercise to try and determine why the phone wasn't working as I expected, it was sort of mental masturbation. Without the source code to the phone, I have no way of knowing if my educated guess is even in the ballpark. We're in the black box stage of our information age: we don't have to know why things work, we just know that they work. Is the voodoo too co - Why I ProgramOctober 22
-
On the bus this morning, I read part of "The World is Flat" that deals with left-brain versus right-brain activities; to Friedman, jobs that can be replaced by technology and outsourcing (left-brain) and those that require an element of creativity (right-brain). Friedman made a statement:
"This weekend there will be accountants painting watercolors in their garages. There will be lawyers writing screen plays. But I guarantee you that you won't find any sculptors who on weekends will be doing other people's taxes for fun."
Friedman is trying to convey that some things are done out of passion, and some out of necessity. People do taxes out of necessity, people paint watercolors out of passion. It's all very black and white, and the jobs of necessity are the ones that are more easily sent overseas to India.
Can't there be be passion for traditional "jobs of necessity"? You can outsource your financial management to an established group or mutual fund -- but what about the excitement of finding good deal and making a sound investment? The satisfaction of having researched it and adding your own judgment to what you find? You need a table to eat dinner on, but can't creating that table be a creative outlet? When categorizing these jobs, I don't think there are clear cut categories; it's up to the individual to say what he is passionate about.
Whenever I go home or spend time with my parents, a lot of my free time is devoted to programmi - Asynchronous PHP GotchasOctober 19
-
As part of a PixCede re-write (read: correcting damage from a rabbit I chased to far down a hole -- more on that in another post), I decided to modularize the scripts for handling new messages. Previously, procmail was sending the email to a single PHP script that handled extracting attachments, storing the image, and sending the confirmation message. As the script started to get unwieldy, I decided to break it into separate scripts:
- newMailDaemon.php - main script that handles writing the attachment to disk and asynchronously calling additional tasks. This is purposely kept minimal, so that there is less chance of something going wrong (e.g. compilation error). Worst case scenario, the email is written to disk; if the other tasks fail, the unit of work can be replayed from the message dump
- processMail.php - handles extracting the image, creating the shortname, inserting it into the database, and sending the email confirmation. This will be split up eventually
After newMailDaemon.php writes the mail file to disk, it calls exec(..) to asynchronously kick off processMail.php. I was about to pull my hair out until I figured out a couple of things:- exec(..) does not get called as though through a shell. As a result of that, you need to use absolute paths. That means that `php ./processMail.php` becomes `/usr/b
- Finally, someone made it dirt easy to transfer Flickr pictures to FacebookSeptember 29
-
Normally, I don't care about Facebook albums. Flickr has many more features, handles it better, and has a more photo-centric community around it. Unfortunately, I'm vain, and want as many people to look at my pictures as possible. I've played with a handful of Facebook applications that "integrate" Flickr into Facebook, but I've never found one that made the transition completely seamless. In fact, it seems as though the "new" Facebook design broke the last Flickr application that I used.
I could re-upload all my photos to Facebook. But why do that when I've already done it once? I just want some back end service to pull selected albums from Flickr and put the files on Facebook. It looks like dudemeister Matt McNamara felt the same way, so he wrote flickurbook. This is a dead-simple, hacked together way to pull photos from Flickr and put them on Facebook. I love it! It's exactly as unpolished of an application as I would have written. This does what I was hoping Oosah would do; Oosah is a start-up that I saw at the Palo Alto new-tech meetup a couple of months ago that boasted being able to do the same thing (remotely manage photos between different sources). Unfortunately, when I tried it, it didn't work. Looks like it would have been overkill anyway, flickurbook does exactly what I want it to do.
PS: Check out my - Mango Lassi: Better than SynergySeptember 27
-
About 3 years ago, my friend Lann showed me this sweet, cross platform program called Synergy that lets you share one computer's mouse and keyboard among multiple computer/screens. Why was this cool? This meant that with my laptop, sitting on my futon I could control my TV computer. Yea, I'm that lazy.
As the years go on, I find myself getting lazier. Now that I have an apartment, the couch is even further away from my TV! So, I went out to set up good ol' tried and true Synergy so that I can use my laptop to control my Mythbuntu box. But, it didn't work. Every time I moved my mouse off screen, if showed up back in the center of the original screen.
Now, I don't care why it doesn't work. Really, I don't. I fiddled for about five minutes, and then went to see if there was anything better out there, when I stumbled across Mango Lassi. It was designed specifically to solve the suckitude of Synergy and x2x. Unfortunately, there's not a package for Ubuntu, so we have to do it the old fashioned way:
(following Marius Gedminas's instructions)sudo apt-get install git-core curl build-essential intltool \
automake1.9 libdbus-glib-1-dev libgtk2.0-dev libxtst-dev \
libavahi-glib-dev libavahi-client-dev libavahi-ui-dev \
libnotify-dev libglade2-dev
git clone http:/
