Friday, May 15, 2009

Flash, ActionScript, and Rails 2 Integration with SWFObject


I finished integrating our Flash Map into our Rails application. It was a bit tricky since I hadn't worked with ActionScript or Flash before, but in the end it all actually made sense.

The first thing I did was use SWFObject to embed the Flash Map (swf object) into my rails view. SWFObject is a javascript library that handles multi-browser support for flash. It really takes the heavy lifting out of implementing flash from the client side. I highly recommend downloading the js libraries (here).

In your view, simply include the js file:
<script type="text/javascript" src="/javascripts/swfobject.js"></script>

You can then display your flash object like this:
<script type="text/javascript">
flashVars["authenticity_token"] = AUTHENTICITY_TOKEN;
var flashParams = { menu: "false"};
var flashID = { id : "flashObject" };
swfobject.embedSWF("/path_to_file.swf", "flashObject", "550", "400",
"9.0.0", "expressInstall.swf", flashVars, flashParams, flashID);
</script>

That will display your Flash object in the DIV following the path_to_file.swf. So this will display the Flash object in the flashObject div in your page.

There are some important points to highlight. The flashVars contains variables you can pass to your ActionScript. This is important with rails because you NEED the authenticity token in the ActionScript so that your application can validate the request. You can certainly turn this off with a before_filter, but I do not advise it. The AUTHENTICITY_TOKEN is a parameter I set in my application.

If you want to use the before_filter to turn off login or authenticity validation, use this:

skip_before_filter :login_required, :check_new_user, :verify_authenticity_token

In our case, we also needed to pass flash variables to our ActionScript from the server. Without AJAX, your JS cannot get values from the server - because it's client side. In order to handle this, we used a rails "javascript_tag" to populate the flashVars with our values on the server side. You can do this like so:

<%= javascript_tag "var flashVars = { user_id: '#{@user.id}' };"%>

Or populate it with whatever variables you want.

In the ActionScript, you'll need to read in these parameters. You can do that like so:

userId = this.loaderInfo.parameters.user_id;

Of course, you'll have to pass the auth token back to the rails app as well. You can do that by appending the token to the URL:

http://your.url.com?authenticity_token="+authToken"

Just grab the auth token the same way you just grabbed the user_id.

Enjoy.

Monday, May 11, 2009

Value of an MBA after the Financial Crisis - Come Hear Me Speak at Stanford


This is late notice...only because I wasn't ready to announce it until I had my speech written. That's the way I operate. Anyway, tomorrow night (Tuesday 5/12) I'll be speaking at Stanford, discussing the impact of the financial crisis on both business school and life after.

While applications are certainly up this year and many people are espousing a business school bubble, I'm here to say that no matter how you slice it, an advanced degree is worth it's weight in gold, both immediately and throughout your career. Nobody can tell me that two candidates of similar work experience won't be differentiated because one has an MBA. Bull. Up, down, any economy... an MBA is a ticket.

Look back thirty or forty years when a college education was a differentiating factor. Well now that's what graduate school is. Sure you can succeed and excel without one, but the doors that an MBA opens are too numerous to count.

Come and join me. It's free and refreshments will be served.

Nickel and Dimed... Anyone Else Getting Tired of Being Screwed?


Think about the last time you bought a plane ticket. You probably went to Orbitz, Farecast, Kayak, or some other airline aggregator. Maybe they even showed you a fare which was fairly reasonable. In reality, it was far from what you ended up paying. It's not entirely their fault. See, they don't include the taxes and fees in the price they show you. And the taxes and fees can be exorbitant. And they can vary widely from carrier to carrier and route to route. It's actually becoming ridiculous how they keep tacking fees on. Like that fuel surcharge last year. Do you think they even thought about rescinding it now that fuel is half the price? Not a chance. They've become dependent on it.

It's not over there though. Then you go to the airport and want to check a bag. A frickin bag?! God forbid you want to bring something with you! That will be $15. Two bags... Jesus. It can be 10 percent of your plane ticket.

My roommate was on a flight a few months ago and they wouldn't even serve him water without charging him. Food? $10 a pop. Beers are as expensive as at a baseball game.

Unfortunately the airline industry has started a trend that is rippling through the service industry. Auto rental fees can now account for a whopping "30 - 35% of the rental". There's a facility fee, a tire surcharge, and an energy fee. But here's a tip for saving some money on renting a car. Rent it OFF airport. In fact, in Phoenix, it's half the rate if you rent it off the airport. Just take a cab or bus...it'll save you plenty.

Anyone else notice that Ticketmaster fees just keep climbing? They can be 26% of a ticket price and more. In fact, "Ticketmaster’s convenience fees defy logic — and should be publicly explained. Not only do the percentages assessed differ from show to show, they vary with differently priced tickets at the same show"(here).

Then, there was my issue with Wells Fargo last week - whereby they tried to screw me for allowing them to invest my money to make more money.

And how about those damn credit card fees?

As our economy is mired in a recession, I just wonder what tacking fees onto prices is really going to do? It's certainly not going to endear the public to these companies. In fact, it's going to create resentment, like its doing with me. It's going to eventually bring these companies down. I assure you. Companies like Virgin America and Southwest will continue to thrive and continue to create goodwill while overpriced, behemoths try any which way to survive - in the face of government bailouts and incompetent management. And they're not using the money to restructure or improve their operations. They're using it to survive just a little while longer.

Saturday, May 9, 2009

Is The Recession Over?


There's a lot of talk this week about the recession possibly being over. About how we may have hit bottom and we're looking up. That's hardly the case. Unemployment has hit a 25 year high this week. Banks are still closing. Restaurants are empty. Houses aren't selling. We're a long way from a recovery.

I still don't feel like it's hit the Bay Area like the '01 crash did... but there's still time. People have been leaving San Francisco. Rents are down. I just don't buy the argument that this small stock market rally is a sign that the economy is all of the sudden looking better.

If you think about it... nothing has changed. The psyche of the American people is still in the crapper. America keeps pumping money it doesn't have into the markets. People are still getting laid off. I think we're going to be in this for a while. So strap in.

Friday, May 8, 2009

Wells Fargo Sucks! I Hate Them!


I love Mint. It's such a great service. A few days ago it sent me an email telling me that I incurred a service charge on my Vyoo business account. As is customary, I'd go down to Wells Fargo and have the charge waived. But this time was different. Not only was I sick of having to go down to Wells Fargo to deal with this crap, but I had also had them agree to waive this fee indefinitely the last time I was there. So I went down with a bone to pick.

See, Wells Fargo claims they're start-up friendly. They claim they like to help small business owners. What's so helpful about a $14 monthly fee for not having tons of money in our account.

My issue was a much larger issue though. I've been a Wells Fargo customer ever since I moved to California ten years ago. My business partner has been a customer for 10 years as well (he's linked to our business account). He also has an equity line, a personal account, and a mortgage through Wells Fargo. So when I went to speak with them about this ridiculous nickel and diming, I figured they'd be all ears. Boy was I wrong. I got stonewalled. "There's nothing we can do." And the guy was a dick about it.

Apparently it doesn't matter if we've pumped hundreds of thousands of dollars into personal accounts and home equity lines... all that matters is that our business account doesn't have much money. So they charge us a $14 fee every month. We're a damn startup. We don't have revenue. But we need a business account to pay bills, to receive payments, and god forbid, to accept money if we raise financing. The fact that these accounts can't be linked to our personal accounts or that they can't waive these fees is beyond me. Like my roommate said...their left brain doesn't talk to their right brain. I'm gone...never again to return to Wells Fargo. Screw you Wells. Hope it was worth your $14.

That Damn Algorithm Is Plugged In!


Last week I finished plugging in the Python algorithm into our Rails code. I had to add error handling this week. But all is looking good now. I also loaded our survey data from the survey we sent out last year. The reason for this is that the answers actually help calibrate our algorithm. With that done, the only pressing issue is getting our frontend up to par. I'm still struggling with what will bring people back to our site. There needs to be some draw. I think part of it is going to be how people use the site. But I guess we won't know until we kick this thing out to more people.

So there's that...and there's getting our Flash map to play nicely with Rails. It's a bit more difficult than I thought. That's my task for this week.

Things have been considerably slowed as I've taken on more consulting work and GMAT tutoring to help pay down my debt. If anyone is curious. Debt sucks.

Saturday, May 2, 2009

Berkeley Business Plan Competition Final Results


If you've followed Vyoo, you know we entered the Berkeley Business Plan competition last year. We made it to the semi-final round and that was it. I had a problem with the competition. I felt that it didn't live up to its billing as the "competition [that] provides entrepreneurs with the best possible resources to help convert ideas into reality". In fact, the only thing I think the business plan competition does is help take companies that already have products and/or users and helps them grow. Yes, this is a useful service, but not one that I feel a business plan competition should be providing.

Basically it's become a filter for VC's, or so it seems. Just another way for them to evaluate companies without having to take a huge risk. I was speaking to a good friend the other day. We were talking about the fact that there haven't been any homeruns for VC's in quite a while... and related it to the fact that VC's just don't invest in homeruns anymore. They invest in copycats. Or companies without a chance for revenue. I mean...Facebook is a great example. Maybe they'll figure out their revenue. But I just don't see it happening any time soon. Not after they flush more money down the tube. And how about YouTube. They lose about $500M/year. I love YouTube... but unfortunately there's no money there.

So if you look back at the Berkeley Bplan competition - and look at the 3 winners - they were all med device companies. Not only that, two are diagnostic devices - a TB device. And an HIV detection device. And one anti-bacterial solution. Not a single web company. Not a single energy company. Maybe it was the current "hot" topic with swine flu and all. Whatever the case...a business plan competition should be for aspiring entrepreneurs. It should cover different topics. It should give entrepreneurs the feeling of inspiration. That they can succeed with whatever they're doing. That they should take a chance because anything is possible.