Social Media Marketing - An interesting read

February 22nd, 2009

My friend and former colleague John Koetsier has put together an interesting blog post on measuring the results of social media marketing campaigns:

http://sparkplug9.com/9-simple-free-ways-measure-social-media-marketing-results/.

A must-read for anyone looking to market their wares online!

Wordpress iphone plugin

July 23rd, 2008

Pretty slick! I’m writing this entry from the comfort of my iPhone using the new wordpress plugin available on the iPhone app store. It’s a free plugin and works as advertised. You basically punch in your username and password and you’re off to the races. Obviously it’s not as convenient as when youre sitting at a real keyboard, but if you’re out and about, there’s no better way to blog! Since my thumbs are getting sore now, I’m going to cut this one short… Adi?s!

Fun things to do with your iPhone

April 23rd, 2008

With all the buzz of the iPhone developer kit being released, it’s easy to forget that there are still some pretty cool things you can do with the iPhone browser. My cousin recently bought an iPhone and has busy loading it up with applications. He managed to find one that controls the music on his workstation. Unfortunately he couldn’t control the volume on it. He wanted a way to control the system volume remotely from his iPhone.

I thought this would be a relatively simple app to build, so I gave it a shot. Within 30 minutes or so I had a working solution.

The workstation my cousin had was a Windows XP based machine.  I found a freeware command line utility to set the XP system volume (it also does a bunch of other nifty tricks):

http://www.nirsoft.net/utils/nircmd.html

This and a bit of PHP glue gets us where we need to be. So I walked him through a basic install of the Apache/PHP stack to run on his local (private) network. One that was up and running, we put the nircmd.exe file in the htdocs folder (yes - it’s a security risk, but this is a local-only-behind-the-firewall Apache configuration). To control the nircmd.exe file, I whipped up this uber-simple php script:

<?php

if ($_GET['up'] == ‘1′) {
system(’nircmd.exe changesysvolume 5000′);
}
if ($_GET['down'] == ‘1′) {
system(’nircmd.exe changesysvolume -5000′);
}
if ($_GET['mute'] == ‘1′) {
system(’nircmd.exe mutesysvolume 2′);
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta name=”viewport” content=”width=device-width, initial-scale=3.0, maximum-scale=3.0, user-scalable=0″/>
</head>
<body>
<input type=”button” value=”vol up” onclick=”location.href=’<?php echo(preg_replace(’/\?.*$/’,”,$_SERVER['REQUEST_URI']));?>?up=1′;void(0);”><br>
<input type=”button” value=”vol down” onclick=”location.href=’<?php echo(preg_replace(’/\?.*$/’,”,$_SERVER['REQUEST_URI']));?>?down=1′;void(0);”><br>
<input type=”button” value=”mute” onclick=”location.href=’<?php echo(preg_replace(’/\?.*$/’,”,$_SERVER['REQUEST_URI']));?>?mute=1′;void(0);”><br>
</body>
</html>

And that’s it!  Now I can control the system volume directly from my iPhone’s Safari browser (on any device with a browser really).

A blast from the past

April 4th, 2008

I guess that title could have multiple meanings.  I’m really not the most frequent of posters.  But in this case it actually has to do with something from years ago.  In one of my Google adventures, I noticed my name pop up in a list of old BBS systems:

http://bbslist.textfiles.com/604/

For a while there back-in-the-day I actually ran a BBS (Bulletin Board Service). The date listed says 1993, which would have made me 17 at the time. I seem to recall running it earlier and longer than that, but I’m sure this list isn’t 100% inclusive. In any case, for the uninitiated, a BBS was one of the predecessors to the internet. Well, not really - the internet *did* exist back then, but it was largely restricted to large businesses, government agencies and universities. When the average Joe with his Intel 386 and a 1200 baud modem wanted to communicate with others, transfer files or play an “online” game, they’d connect they’d turn to a BBS.

My service was largely just an online gaming service. I had 2 phone lines coming in to my house. It was actually inexpensive back then - even for a 17-year-old. I recall paying something like $7 per line. One of my favorite games that I offered (and played) was called BRE or Baron Realms Elite. It had a really cool concept that seems lost on the graphics-intensive glitzy games of today. Basically it was all text based. You logged in and were only allowed to play one round per day. The game was on online warfare type affair. Your mission was to attack other players and gather points / money and increase your military. But the fact that you could only make one move per day made it really interesting. Would your opponent(s) log in that day? How would the guy you just attacked respond? Could your military take on his? It’s amazing how engulfing the experience can be with literally just a few lines of text glowing on a fuzzy amber monitor.

I’m not a game player by any means these days. I actually own an XBox 360, but I’ve turned it on probably 3 times since I’ve owned it. Not for lack of interest in the games that are available mind you, I’m just a busy guy and I’d rather build something or do something constructive than play a game.  And when I am feeling lazy, I’ll usually turn to my TV or watch a movie.

It was an interesting trip down memory lane to see my old BBS mentioned. It’s good to know that someone took the time to make note of an interesting point in history and honor some of the people that had a hand in connecting the people of the day.

Fidonet forever! (BBSers will know what this was)

Ideas for iPhone apps

August 22nd, 2007

So I’ve been playing with some apps that have been developed for the iPhone (you know - the type of apps that aren’t supposed to exist - locally installed apps). There are already some pretty impressive offereings out there. Natetrue’s NES emulator is probably one of the coolest. It’s a full Nintendo emulator, complete with a mini on-screen control pad :)

Well, it go me thinking. What other type of apps would be neat to have in the iPhone? And what might be worth my time to try and build?

Here’s a few off the top of my head:

- A video recorder. There’s a camera built in to the iPhone, however the built-in software only includes the ability to take static photos. Someone has already made a pseudo-video conferencing app (http://macdaddyworld.com/?p=39). Why not make a video recorder app that can film simple movies and save them to the flash disk or email them?

- An app to measure off-the-line accelleration for a race car. The iPhone already has a built in accellerometer. I’m not sure how sophisticated it is, but if it could be done the iPhone could be used as a handy data-capture device.

- nmap and other such network admin tools - I’m sure it’s just a matter of recompiling for this platform, but having some of these basic open source networking tools available for the iPhone would make it alot more of a valuable tool in the field. Full shell support already exists on the device, and we already have ssh and sftp apps. I’m sure it’s only a matter of time.

- VNC / RDP client - This would allow an iPhone to be used as a connection in to a terminal services or VNC equiped desktop. In order words you would be able to run your remote apps directly from your iPhone. Open source vnc clients already exist on other platforms, so I’m sure this one is also just a matter of time.

- Streaming media center client - This one is probably only practical within a wifi enviroment. It would be pretty cool to stream content from a media center equiped PC though. Orb already lets you do this with music, but I tried the streaming with video and had no success. Really it should just be a matter of transcoding on the server side of things and providing a simple client to allow selection of videos or channels.

- Graphical IRC client - IRC is a highly valuable tool for collaborating with other developers and really anyone who has a similar interest as you. I’ve seen a console-based IRC client released, but thus far no GUI app. This would be pretty huge if a full easy-to-use GUI app could be developed.

Top 10 things that suck about the iPhone

August 20th, 2007

Having recently purchased Steve Job’s new so-called “Jesus Phone”, I became very interested in reading up as much as I could about this little device. It seems that every site you go to these days is inundated with glowing reviews of the tiny ipod/phone combo. I found myself wondering where the serious counterpoints and critisizms are. After all, it can’t be the perfect gadget, can it? Every device has it’s flaws, right?

Don’t get me wrong, I do love my iPhone, and there numerous upsides (which you can read about elsewhere) but come on, let’s be real. There are downsides to this thing. Without further adeu, here are my top 10 critisizms of the new iPhone:

1. Locked to AT&T - This one is a doozie.  The iPhone is sold as a “you must sign up with AT&T on a new contract” device. Period. If you live outside the states (like me), or if you are on a different carrier (also like me) then the iPhone wont work for you. But it gets even better - you can’t even use the iPod or wifi functionality without an AT&T contract! Thank good ness hackers have solved this problem already…hehehe.

2. Flash support - The iPhone with all its technical wizardry and fancy web features doesn’t even have a browser that supports Flash content! Last time I checked Flash was *required* on a vast majority of sites out there. YouTube is one of them, which I guess is why Apple decided to include the YouTube functionality as a stand-alone app.  So say goodbye to any other streaming video or gaming website. The rumour is that Apple is going to release an update with Flash support in the near future. Let’s hope this has some truth to it…

3. No 3rd party apps - I don’t care what Steve Jobs says about Safari being the only thing you need to develop apps on the iPhone. Phooey. 1st off there is no way you are every going to get close to hardware level speed with the bloated abstraction that a web browser imposes. Secondly, has anyone even considered the security implications of all your apps running remotely on a web server? I mean when I have to run an app on someone else’s server, that means they can see everything I’m doing. So if I am forced to use a web app for my word processing et al, that means each document is hosted at a remote location and is viewable by whomever runs that site.

4. No video recorder - There is a nice shiny camera built in to the iPhone. It’s pretty decent (although the sensor is a bit dim for my liking). But if I can take videos on my el cheapo cell phone, then why is my $600 iPhone not able to perform the same task? Nuff said. Bad Steve Jobs. No biscuit for you!

5. No printer support - Maybe this isn’t a big deal for the vast majority. But I’m thinking since this thing has a decent web browser and wifi support, why is there not even an option to send a page through to a network-enabled printer?

6. No disk mode - Unlike a regular iPod, and pretty much anything with a USB adapter, the iPhone dooes not have a disk mode. This means that you will not see a file system when you plug this unit in to your computer. You will not be able to store random files on it like you can on your iPod. Sorry folks. Unless you hack it, your iPhone will be limited to saving music, photos and specially formatted videos. I guess AT&T wants you to buy their overpriced ringtones instead of uploading your own…

7. No drag and drop for iTunes - This one had me scratching my head for a while. I thought I had done something wrong with the install untill I realized that this was also happening to other people. With my iPod I am able to manage the playlists and songs manually on the device itself. With the iPhone, you must sync with your iTunes library. This adds a whole level of headaches when sharing iTunes with multiple devices or sharing your iPhone between multiple computers.

8. No saving files - See something you like in Safari and want to download a local copy? Too bad. No downloading.

9. No GPS - Uggh. You know, with all the Apple ads touting the Google maps functionality built in to the iPhone, you’d think that they would want to include a GPS for route tracking. Nope. Sorry. The iPhone does not know where you are. This means that there will never be any killer tomtom-like navigation software for the iPhone. Now apparently AT&T is disabling GPS support on one of its upcoming Blackberry models so that it doesn’t steal any thunder away for the iPhone (http://blackberrycool.com/2007/08/16/005386/). Has the world gone mad?

10 No Office apps - No Word. No Excel. No Powerpoint. And thanks to the refusal of Apple to release any real API’s for the iPhone you’re not going to ever get those (or even a close facsimile). Admittedly, the ability to work on office apps within a smartphone or pda has never really appealed to me. But I’d at least like to be able to read the occasional Word or Excel document.

Well, that’s it for now. I’m sure I could go on and on about other things like lame Bluetooth support or slow GPRS data speeds, but I really prefer to be a bit more positive. Any way you cut it, the iPhone really does kick butt. I’ve never seen anything work as slickly and as smoothly as this device. There was alot of hard work put in to this one, and it looks like its only going to be getting better as more updates roll in.

Blog Spam Postings

June 19th, 2007

Just curious… Has anyone out there in the (rather short) history of blogging ever bought anything from those numerous spam messages that seem to show up in the comments moderation queue? I typically get dozens of these messages per day. It’s easy enough to delete them, but I wonder where the payoff is for the spammer? Typical email spamming has proven return ratios, but you’d think that spam messages going to bloggers would have a lot less ROI. My reasoning is this… while grandma and grandpa and your next door neighbors might have an email account, usually blogging is reserved for more technically inclined/adept users.  Who really wants to get a mortgage from an unknown fly-by-night Internet company that uses guerilla marketing techniques anyways? And if I really did want a penis enlargement or illegally distributed pharmaceuticals, I probably wouldn’t do business with someone who just sent 50 messages to me through a no-return email address.

Proper Text Wrapping in ImageMagick

June 5th, 2007

I’ve read alot of threads (and experienced first hand) many issues with annotating text on top of an image. ImageMagick is a great versatile tool, but its text handling can leave you a bit frazzled at times. For example, I have yet to see sample code demonstrating switching fonts (or even just font parameters like bold & italic) midway through a sentence.

The traditional approach is to pass multiple annotate commands through to ImageMagick and deal with it that way. The problem is that you have to keep track of where you are on the image yourself for successive annotate calls. Otherwise what happens is that you end up overwriting what you just printed and create a big mess.

 An even bigger problem occurs when you try to do wrapping. All of a sudden you’re responsible for checking every word to see if it goes outside your bounding box, and then linefeeding intelligently if it does. Sounds alot like the job for a typesetter, right?

Well, I found a nice little approach that does the job and spits out a beautiful annotated image within ImageMagick. All it takes is Perl, a module called PostScript::BasicTypesetter and of course your fonts!

Here is my sample Perl code:

use PostScript::BasicTypesetter;

my $fontsize = 15;
my $lineheight = 16;
my $currentline = 1;

my $r = new PostScript::BasicTypesetter(”fg2/FrankGB2.afm”); #FranklinGothic-Book
$r->fontsize($fontsize,$lineheight);
my $bi = new PostScript::BasicTypesetter(”fg2/FranGDOw.afm”); #FranklinGothic-DemiOblique
$bi->fontsize($fontsize,$lineheight);
my $b = new PostScript::BasicTypesetter(”fg2/FrankGDq.afm”); #FranklinGothic-Demi
$b->fontsize($fontsize,$lineheight);
my $i= new PostScript::BasicTypesetter(”fg2/FranGBO0.afm”); #FranklinGothic-BookOblique
$i->fontsize($fontsize,$lineheight);

my $ps = new PostScript::BasicTypesetter(”fg2/FrankGB2.afm”);
$ps->fontsize($fontsize,$lineheight);
$ps->ps_setcolor([0,0,0]);
print STDOUT (”%!PS-Adobe-3.0\n”,
“%%DocumentResources: font “,
$ps->metrics->FontName, ” “,
“%%Pages: 1\n”,
$ps->ps_preamble,
“%%EndPrologue\n”,
“%%Page 1 1\n”);
print STDOUT “%%DocumentMedia: Default 300 150 0 () ()\n”;

my @arr = ($r,’This is a nice chunk of text with ‘,$b,’bold, ‘,$i,’Italics’,$bi,’, and both at once!’);

my $x = 50;
my $xi = 0;
my $y = 100;
my $w = 200;

print STDOUT ($ps->ps_textbox ($x, $xi, $y, $w,\@arr, “l”));

print STDOUT (”showpage\n”,
“%%Trailer\n”,
“%%EOF\n”);
 

What this code produces is straight postscript data. Not too appealing on its own. However if you pipe the output in to ImageMagick, you get perfectly formatted and wrapped text:

perl textwrap.pl | convert - test.jpg

Produces the following image:

Wrapping example

Very useful for realtime wrapping previews!

The *real* reason for overheating laptop batteries

May 31st, 2007

Remember the big recall with Sony branded batteries last year? Remember how they were overheating? I think I found out why:

Fat Cat on Laptop

Seriously though. That fat thing is sitting on my laptop. That can’t be good for the fans, can it? Does Dell cover furball clogs in their warranty?

Writing PDF’s - The easy way

May 29th, 2007

I recently ran in to an interesting problem. How do I ensure that what gets displayed in a browser screen gets printed out correctly on paper (i.e. WYSIWYG) when the user presses the “print” button? The true answer is *you can’t*. At least not when it comes to supporting multiple browsers on multiple platforms.

Browsers are inherently a screen-based platform. Content can be made to show up nicely on many different display devices at varying resolutions, width restrictions, browser versions and a whole host of other challenges that I won’t get in to right now.

But how do we ensure that content gets printed correctly? I.E. v6 and 7 seem to do a nice job of translating the screen copy to a reasonable facsimile of the original on the paper. Firefox however is a nightmare to work with. Especially when you have a lot of CSS descriptors or a long table.

No matter what I’ve tried, I’ve found it extremely difficult to get consistent print output between the “big 3″ browsers (IE, FF and Safari) - and that’s not even getting in to older versions of said browsers and varying types of printers!

So what’s a competent web coder to do you ask? Well, that’s what PDF’s were made for! Adobe’s PDF format was designed to be a consistent WYSIWYG multi-platform document format. The result is that it should print correctly no matter what browser, O/S or print device you are using.

So PDF’s are great and all, but how about getting the page content in to a PDF document so that it’s easily downloadable and printable? What if you need it to be dynamically generated?

I found a great Perl module that addresses just such a challenge. It’s called PDF::FromHTML (http://cpan.uwinnipeg.ca/dist/PDF-FromHTML). The idea is that you feed the module an HTML page, and it spits out a nice PDF document. If the page is really long, it simply paginates the document and gives you a muti-page document. There are a few restrictions with what you can feed it (most noteably CSS, so you *will* have to reformat your layouts), but for the most part it’s really straight forward.

The documentation itself is really sparse, but I found that you do not have to feed it actual files (as shown in the example code). You can actually feed it HTML on-the-fly without ever having a PDF file touch your hard disk. The trick is to pass it an scalar-ref to your html as such:

$pdf->load_file(\$html);

then proceed with the conversion as normal:

$pdf->convert;

Now if you want to dump the contents in to an array (also not shown in the docs), simply grab the PDF document from the module’s buffer:

my $doc = $pdf->pdf->get_buffer;

There you have it… Easy and simple PDF’s on-the-fly.