Misc. Ramblings

Funny Business: The Paradoxical Nature of Business Success

2 November 2005 · Comments Off

I know I’m probably giving my 11 regular readers (as opposed
to you irregular ones – ed.) whiplash by breaking one of the 10
rules of blogs by not focusing on only one topic. But hey, that’s
the way my mind works. I’m interested in all kinds of things (and
he can’t avoid talking about them – ed.).

So I was surfing the ‘net reading that preeminent
business commentator Robert Scoble
and came upon a link
to the Dilbert Blog
. From there, I followed a link to
a cartoon called “Pearls Before Swine.”
The cartoonist uses
the metaphor of animals and their stereotypical characteristics
(e.g., rats are, well, ratty) to make social comments that are
funny and insightful. For example,
this panel with a crocodile
made me laugh. Then think about
how sometimes people end up in the jobs they have.

Getting back to Mr.Scoble, he may have hit on one of the major
paradoxical truths of successful businesses in
Robert Scoble’s post on, among other things, Google
. The
truth? That if you focus only on making money, you won’t make as
much as if you focus on making stuff that people want to use and
are therefore eventually willing to pay money for. In
the case of Google Maps, the primary customer may not even be the
average person. Perhaps the money is on the cool applications
that can be built on top of Google’s Maps. But there is no way
even Google can predict which types of applications would work
well. So, the genius of Google is in creating the infrastructure
that developers then use to create their own applications which
fill a need and by doing so, creates oodles of money for Google.
It may sound like the same thing, but it’s not. Deciphering the
difference is the difference between being fabulously successful
and wondering what happened to your job.

Categories: Misc.

Using Perl to Display a File Creation Date

2 November 2005 · 3 Comments

Getting back to
my post on displaying the file creation date and time
, a couple of readers have sent in helpful suggestions. Before I get to one, let me briefly recap what I am trying to do.

Via a security webcam/server at home, I periodically ftp an image to my website, seto.org. A web page I’ve created then displays the image. Every once in awhile, I check the web page to see what’s going on at home. But want I wanted was a way of time stamping the image so I would know when it was taken. I found that a Linux program called Stamp! would do that. Sort of. What Stamp! does is uses the current system time and overlays the image with that. This causes a problem for me in that Stamp! may be updating even if the webcam is turned off. This means the image that is sitting on seto.org could be several hours old, but by just viewing the web page, you would have very little, if any way of knowing this.

So I searched for a program that would overlay the test.jpg file with the file’s creation date and time. I have been unsuccessful in finding such a program. So, I tried finding some Perl script that would at least read the creation date and time of test.jpg and then insert/output the result into the web page that also displays the image.

By searching the web, I found a code snippet that supposedly reads the file date and time but ran into problems. Which is where we left off.

A reader by the name of Peter, sorry I don’t have is last name so I can’t give him full credit but he knows who he is, suggested the following:

#!/usr/bin/perl
use File::stat;
use Time::localtime;
$file='/path/to/test.jpg';
$date_string = ctime(stat($file)->mtime);
print "file $file updated at $date_string\n";

Making this executable and running this from the command line displays the wanted date and time of the file. Now I could use some help in figuring out how to display this information in a web page that also displays the test.jpg file so that, using a web browser, I can see the test.jpg image and the date and time of the test.jpg file (If this information can be overlayed on the test.jpg itself like Stamp! does would be a bonus but I don’t know of any programs that will do that. So, just displaying the date and time of the file in HTML would be better than what I have now.).

The present web page code itself is below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Seto.org Upstairs</title>
<meta http-equiv="refresh" content="60">
</head>
<body>
<img src="/path/to/test.jpg" width="640" height="480" alt="
Upstairs Web Cam.">
<p>Refreshes automatically every 60 seconds.</p>
</body>
</html>

A big thank you to Peter and to fellow Daynoter John Dominik who suggested a different way of doing it.

UPDATE: Go here for one way of solving the problem.

Aloha!

Categories: Computers · How-To