Archive for 2007
PHP: Remote Kill Switch – Make Sure You Get Paid
Web Developers: Have you ever gotten to the end of a project, and had a client withhold the last of your fee to exact additional changes or features that were not in the original plan? Perhaps a client that decided your work “wasn’t what we expected” and tried to withhold payment?
Well worry no more. Put the power back in your hands with a Remote Kill Switch. The idea is this: you build into their website a small function that checks with a server you control to make sure the client’s account is in good standing. If it is, the site loads as normal. If not, their site doesn’t load, and they get a message asking for payment.
We’ll accomplish this with a little PHP and a protocol called XML-RPC (remote procedure call). Your client’s server will transmit an XML encoded, unique string identifying itself to your server. Your server will check to see if that unique string is one you’ve specified as disabled. If there is a match, it responds with a XML encoded string telling the client’s server to disable the application.
Sound like something you’d want to implement? Here’s how it breaks down:
Part One: Your server. You’ll need a fairly reliable host, and a fast one at that. You don’t want to slow down the remote application load with requests to your server. However, the below code is set to continue loading the remote application even if it does not receive a response from your server, ensuring that downtime on your end does not cause downtime on their end.
Part Two: The code on your end. Also known as the RPC server. Create a new file and paste the following:
require('XMLRPC.inc.php');
function checkapp($the_app)
{
$deactivateMe = ""; // to disable a webapp, enter it's short code here
if (isset($the_app) && $the_app == $deactivateMe)
return true; // Application Disabled
else
return false; // All systems go
}
$server = new IXR_Server(array('activation.checkapp' => 'checkapp'));
You’ll also need to download XMLRPC.inc.php and upload it to your webserver in the same directory as the file you created above. You will need to change the file extension from .phpp to .php.
Part Three: The client code. Also known as the RPC client. Insert this code in your client’s site, preferably toward the beginning of execution:
require('XMLRPC.inc.php');
$appname = "UNIQUE_APP_SHORTCODE";
$client = new IXR_Client('http://path_to_file_created_earlier.php');
if (!$client->query('activation.checkapp', $appname)) {
if($client->getResponse() )
{
die("Application Disabled. Please pay your web developer.");
}
}
Again, download XMLRPC.inc.php and upload it to the server in the same directory as the file you created above. This library is required both by the client to make the request, and the server to respond to it.
That’s it! If the client ever doesn’t pay you, and you want to shutdown the site you developed for them, just set $deactivateMe in Step 1 to the “UNIQUE_APP_SHORTCODE” you entered in the code in Step 3.
You can see that the above setup allows you to protect multiple web apps at once, just remember what shortcodes you assigned at what sites! I recommend keeping them in comments at the top of your XML-RPC server PHP file. However, a limitation of my code is that you can only disable one remote site at a time. I’m sure my code could be expanded to use an array that would allow you to disable multiple sites at once.
I realize that this is significantly more technical than my typical fare (which I will return to next post), but I hope it’s helpful to some people, if only as a demonstration. Feel free to rip my code apart in the comments, I’m sure I’ve left something out.
Why Starbucks Integration is the Best Feature on iPod Touch and iPhone
Today in San Francisco, Steve Jobs presided over one of the more product release packed press events in recent memory. We saw the entire iPod product family overhauled – new colors on the shuffle, a total redesign of the Nano (with video), larger hard drives and lower prices on the iPod Classic (as well as a new enclosure), and the introduction of the new iPod Touch with WiFi.
Jobs also had a guest on stage toward the end of the program: Starbucks Founder and Chairman Steve Schultz. Schultz was there to promote the new partnership between Apple and Starbucks, which is basically this: You walk into a Starbucks and order your latte. The song playing on the store’s stereo catches your ear. You pull out your iPhone/iPod Touch, which automatically senses that you’re in a Starbucks, and knows what song is currently playing. You can purchase the song over Wi-Fi before the barista is finished making your coffee.
Cool, but it’s certainly not going to “transform the marketplace” (to quote Steve) is it? I’m telling you that it will. And not just the coffee market, or the phone market, or the MP3 market. I mean the whole market.
Why is this such a big deal? Because the iPhone and iPod Touch are now location aware. We’ve been hearing about location based services for a while now, and there definitely some cool startups out there that try to bring people together based on location. However, this is the first time (to my knowledge) that it’s been leveraged to drive consumer spending. iPhone users can now make a purchase that is directly tied to the location they’re standing at that very second.
The feature as it stands now is not that amazing, nor is it going to radically change many people’s lives. However, imagine the ways that location based purchasing could be extended: Pre-order the DVD/MPEG of a movie as you walk out of the theater. Buy a song’s MP3 as your favorite artist plays it on stage at a concert. Receive a coupon for 10% off upon walking into a department store, encouraging you to buy more. The possibilities are endless.
Sure, all of this requires that infrastructure be built out in all of these places to notify your iPhone of its location. It will take time. But if Apple is smart (and I think they usually are), they will continue to expand the location based services on their mobile devices, and open up additional revenues for both themselves and entertainment venues and stores that did not exist before.
Selling Ads on Your Site – Why ‘Forever’ is a Long Time
I was recently approached by someone that wanted to purchase advertising space on my blog. The offer looked something like this (numbers have been changed):
Offer price: $500
Pages ad would be placed on: 6
Duration of Agreement: Forever
Bloggers, let me ask you – does that sound like something I should agree to? On one hand, you might say it’s pretty good for a personal blog I write in my free time. However, once we break down the numbers, we’ll see that it’s not.
My reasoning hinges on understanding two financial concepts – opportunity cost and net present value of a perpetuity. I’ve linked those terms to explanatory articles – make sure to have a basic grasp on the two terms before we move forward.
While the $500 sounds pretty good, we can use net present value math to convert the one time payment of $500 in today’s dollars to its equivalent amount in yearly payments, every year, forever. Because we’re working the formula backward, I will use $500 as the net present value (what I would be paid today), and solve for the equivalent yearly payment amount. I will use 4% as the risk free rate, which is just slightly below the return on a US Treasury Bond.
Net Present Value = Yearly Payment Amount / Risk Free Rate of Return
NPV = P / R
$500 = P / 0.05
$500 * 0.05 = P
P = $25 per year
Because the original $500 was for advertisments on 6 pages, divide the final number by 6:
$25 / 6 = $4.17 per page per year
So it turns out that the $500 offer is really equivalent to only $4.17 per ad per year! And not only is that rate extremely low, I’m locked into it forever! It doesn’t seem like nearly as good a deal anymore does it?
Things start looking even worse when we consider the opportunity cost of taking the offer. If I agree to place new ads on my pages, they will replace the Google Adsense ads that exist there now. This means that I would forego the revenue I would normally receive from those ads. That lost revenue is my opportunity cost.
The Adsense banner ads at the bottom of each post don’t do particularly well, but, for estimation purposes, they return about $10/year. This is obviously higher on more popular posts and lower on less popular ones, but $10 is a good average. So, by accepting this new advertising offer, I will be earning $4.17 per page per year from the new ads. However, I will also be foregoing $10 per page per year from Adsense. This means that I will actually be losing $5.83 per page, per year, FOREVER if I accept the offer!
So it turns out what looked like a good deal from the beginning is actually not such a good deal after all. Bloggers – as you consider ways to monetize your blog, be very careful to weigh your alternatives and consider your opportunity costs. Also remember – forever is a long time to be locked into anything, especially a contract that could be costing you money!
Note: If you want to learn more about present value and the time value of money, checkout this powerpoint from the University of California, Santa Barbara.
Another Note: I’m not writing this blog for the money. Anything I take in goes first to cover hosting, and whatever is left over I loan out to budding entrepreneurs in the developing world using Kiva.org. It’s a way to give back to the entrepreneurial community that brings a lot of personal enjoyment for me. You should all check out Kiva, it’s very cool.
Libraries and the RIAA
I came across a very interesting post today on the Freakonomics Blog titled “If Public Libraries Didn’t Exist, Could You Start One Today?” It’s an interesting question in today’s age of the RIAA, MPAA, and seemingly ubiquitous DRM. In a world where sending my friend a song by a new band he may like is illegal, is borrowing a favorite book that different? From the article:
If there was no such thing today as the public library and someone like Bill Gates proposed to establish them in cities and towns across the U.S. (much like Andrew Carnegie once did), what would happen?
I am guessing there would be a huge pushback from book publishers. Given the current state of debate about intellectual property, can you imagine modern publishers being willing to sell one copy of a book and then have the owner let an unlimited number of strangers borrow it?
I don’t think so. Perhaps they’d come up with a licensing agreement: the book costs $20 to own, with an additional $2 per year for every year beyond Year 1 it’s in circulation. I’m sure there would be a lot of other potential arrangements. And I am just as sure that, like a lot of systems that evolve over time, the library system is one that, if it were being built from scratch today, would have a very different set of dynamics and economics.
Best of Banking Blogs
There are a ton of blogs out there, and sometimes it’s hard to separate the wheat from the chaff, especially when we’re talking about finance and investment banking blogs. I’ve done my best to assemble here the best of the internet: a blend of news and humor, insightful commentary and satire. There is definitely something for everyone, and plenty of sources for intra-office link sharing.
- DealBreaker – Set this one as your homepage. Updated between 5 and 10 times daily, DealBreaker brings you the real news with hilarious commentary. A perfect blend of humor and fact.
- The Leveraged Sellout – Written anonymously, this blog is a scathing, sarcastic critique of the Wall Street culture and the people who exemplify it. A favorite around the office.
- Banker’s Ball – Another New York lifestyle blog written for the banking audience. Occasionally runs some great articles, but only updated once a week or so.
- iBanking Oasis – More of a forum and less of a blog, the homepage stories are selected daily from threads started by visitors. The discussions are enlightening, but often laced with a bit too much machismo. Still a great resource.
- The All Nighter – A satirical look at investment banking from a junior perspective. Funny articles that any I-Banker can relate to.
- Under the Counter – This blog focuses on the people that run Wall Street and make tons more money than I ever will. Also sometimes strays to macroeconomic topics.
- Going Private – The tagline says it best: “The sardonic memoirs of a private equity professional”. This blog covers all things PE, with the occasional extremely insightful post on industry trends and our perceptions of the market.
- Living the Dream – Another humorous take on Investment Banking, unfortunately less frequently updated than some of the others on this list. The post on the 5 stages of banking is a classic.
- An Investment Banker’s Take on Life – I became a fan of this one after the author ran a series of five posts detailing the history of investment banking, starting even before John Pierpont Morgan’s arrival in New York City in 1857. He’s now begun a similar series on Private Equity that is equally interesting.
- The Stalwart – This one reads like an online version of the Journal or The Economist, though slightly less formal. Some interesting articles, and not always centered on business.
- Trader Mike – The list wouldn’t be complete without a trading blog. Not much humor here, just an interesting look at the market as well as individual stocks. Also gets into some trading strategy, and is definitely not too complex for a beginner. A solid, educational read for those wanting to learn about trading.
That’s all I have for now, I hope I’ve been able to add a few links to your bookmarks/RSS readers. Now you tell me: Have I missed any? Share your own favorite links in the comments.
Summer Internship at KeyBanc Capital Markets
Again I find myself making excuses for not blogging frequently, but this post is just that: The reason I haven’t blogged recently is I’ve started as a Summer Analyst at KeyBanc Capital Markets in Charlotte. I’m working specifically with the Industrial Group, dealing with Industrial Technology and Transportation & Logistics. Through KeyBank, we are able to offer a full range of investment banking services, including M&A advisory, credit, equity underwriting, and more.
Specifically, my ~70 hour weeks are spent making pitch books, models, doing equity research, and developing value added ideas for our clients. Almost every day I deal with a new company, a new deal, a new industry segment. I’m learning a lot, not just about the sectors we deal with, but about investment banking in general. So I’m creating a “Finance and Economics” category here on the blog, where I will post general tips, lessons learned, and my own distilled experience.
I’ll do my best to post regularly, both for my own benefit and everyone else’s. Hopefully this category can become a reference for college students wondering what investment banking is like.
Use your “What” to find your “Why”
Recently, Philip Kaplan (aka “Pud”, founder of Adbrite and FuckedCompany.com) was emailed a question by a single mother looking to get her life back on track. Philip answered the question on his blog, and I found his answer particularly fascinating and relevant. The full text of Philip’s answer is replicated below:
Some people know what their passion is. Unfortunately, you do not. But I’m going to help you find it.
Here’s what you do:
Ask yourself, if you could do ANYTHING in the world, what would it be? What’s the ultimate fantasy that you’ll probably never actually achieve, but would be awesome? Rock star? Movie starlet? Teacher? Birthday party clown? Brad Pitt’s wife? That’s the “WHAT.”
Now ask yourself, “WHY?”
For example, my “WHAT” was “be a rock star heavy metal drummer!” Upon further analysis, my “WHY” was “I want to do something creative. I want freedom. I want to affect lots of people.”
As it turns out, there were about a million different more tangible things I could do, that would satisfy my “WHY.” That’s why I became a freelance web programmer: creativity, freedom, and the opportunity to reach the masses.
What’s your “WHAT?” What’s your “WHY?” You’ll be surprised how easy it is to satisfy your WHY, once you’ve figured out what it is.
I found that, as a college student rapidly approaching graduation, Philip’s advice to identify your “why” instead of focusing on your “what” was especially pertinent as I considered my long term career and happiness goals. I also think that his advice is helpful to entrepreneurs casting about for some direction in life. Many are so focused on becoming the next Web 2.0 darling, that I think they may have lost sight of why they embarked on an entrepreneurial career path in the first place.
Do what you love. Follow your why. The rest will fall into place.
How To Get Rid of Snap! Link Previews Forever
I hate Snap! Previews. You know, those little bubble icons like this
that appear after every link on so many blogs (most notably TechCrunch). Their uselessness has been pointed out before by such big name blogs as Lorelle on WordPress and Performancing. Lorelle says “Personally, I consider these Snap Previews a blight on the web” and Performancing’s David Krug says that Snap Preview is ruining your blog.
Snap Previews take extra time to load, are not accessible, and are generally annoying when they popup under your cursor. So, here’s how you can disable them for good, across all the sites you visit:
- Find a website that uses Snap Previews. If you can’t think of one off the top of your head, use TechCrunch.
- After the page has loaded completely, trigger a snap preview by hovering over a link or Snap Preview icon. If all goes according to plan, this is the last Snap Preview you will ever see.
- Click the “Options & Disable” link in the top right of the preview (see screenshot, click for larger version)
- Click Bubble Disable for “ALL SITES” (see screenshot, click for larger version)
- Click “Close Options” and click off of the preview. You’ll never see another Snap Preview again!
StumbleUpon, Spam Comments, and Why I Haven’t Blogged in a Month
Let me start with an apology for my, how shall I put it … less than prolific blogging over the past month. Ironically, I released the Ready Fire Aim RSS Widget, and then didn’t follow it with any content in my feed! I’ve been extremely busy with mid term exams (thank you, WFU Calloway School of Business and Accountancy). After two weeks of 5AM bedtimes and 9AM alarm clocks, I took a week off and headed to the beach to relax and catch up on sleep.
Imagine my surprise when I came back today to find that this post had received over 2,500 hits in just a few days. This seemed strange to me because the Windows version of the walkthrough had always been more popular. After checking my referrer logs, I realized that almost all of the traffic was coming from StumbleUpon. I’d heard of StumbleUpon before, but had never actually tried it. Spurred by this influx of traffic to my blog, I installed the StumbleUpon toolbar. This thing is addictive. Every time I press the “stumble” button, I’m presented with a new site I’ve never seen before. I can even customize which types of sites I’m interested in. At first I had expected that the service would be vulnerable to spammers and commercial sites with no real content, however, I learned that there is an approval system for paid content, and user feedback is also considered when displaying sites (similar to Digg). What a great time waster!
Speaking of spam, in addition to the 2,500+ hits on the Verizon/OS X walkthrough, I also received just over 800 pieces of comment spam, all of it caught by Akismet (and with no false positives too!). This means that 30% of all the visits to that article during the past week were by spam bots (and that’s just the ones that figured out how to leave a comment). This seems a huge number to me, especially when it seems that the spike in spam was correlated to the spike in traffic from StumbleUpon. The reason I find it strange is that I cannot find a link to my site anywhere on StumbleUpon.com – it seems the only way to find my article is by pressing the “stumble” button on the toolbar. This means that typical web crawling spam bots wouldn’t find me, and that those bots that did must somehow be surfing through the StumbleUpon service.
Can anyone that uses StumbleUpon take a guess as to why this might be? Is there an HTML link somewhere on StumbleUpon’s site that I missed? Let me know in the comments.
Ready Fire Aim RSS Widget Released
I few days ago, there was a post on Digg highlighting a Digg-style WordPress Admin Dashboard theme. It was by aspiring designer Teddy Hwang. Curious after reading the Digg story, I found my way over to Teddy’s site, and was immediately impressed with his blog’s design. I noticed Teddy had just begun something called Project Widget. In an attempt to further hone his design skills, Teddy is creating OS X Dashboard widgets for free. The widget conveniently pulls in all the most recent articles from your blog (via RSS), and displays them on the OS X dashboard. Teddy will create a custom themed widget for any webmaster that asks him, so if you want a custom-designed widget of your own, use the Project Widget link above to request one. Here’s what the Ready Fire Aim widget looks like, you can download it here.

