December 8, 2010

App Engine Channels and Chrome Extensions

Google's latest toy for App Engine, its Channel API, is really a cool tool. It gives you Comet support on a free webhost. That's a phenomenal achievement, in my mind. I was given early access to it, to build the android2cloud web server with its technology, to relieve our polling woes. And I tested it, and it worked great.

And then there were some mishaps, with frontends, and the roll-out to production servers was taking a bit longer than I had hoped, so I had to look into other alternatives. When an app is eating $80 a week and is constantly in a state of financial peril, I couldn't afford to just rest on my haunches and wait for Google.

And then, of course, Google got the Channels to production before I got my node.js implementation to production-readiness. So, of course, I tested the beta software I had written a couple months prior, ensured it still worked, and called for a test. Except something blew up in my face: I had neglected to trust the extension, trusting that it would still work. It didn't.

Google had changed their code that handles their "CrossPageChannel"; basically, a hidden, embedded Google Talk iframe. Whatever, no big deal. Except now they were automatically passing through the domain the code was called from (in a Chrome extension, chrome-extension://chromeextensionidhere) and appending "/_ah/channel/xpc_blank". Fine, whatever. I don't understand the changes, and I don't really care to. The problem, I discovered, is that the new code rejected anything that wasn't on the http or https protocol. Which these weren't.

OK, fair enough. I downloaded the javascript file that's responsible for making the channels (http://talkgadget.google.com/talkgadget/channel.js) and substituted in my local channel.js file for the http://yourappid.appspot.com/_ah/channel/jsapi file in the script tag. Then, in my local file, I added chrome-extension to the test for http and https, so extensions were listed as ok. Loaded it up, and... it failed. A dynamically generated file that Google hosts itself tested again. Darn.

And then I had an idea. What if, instead of trying to make the tests allow the link, I tried to make the link pass the test? It was worth a shot. So I changed the /_ah/channel/xpc_blank to be http://yourappid.appspot.com/_ah/channel/xpc_blank, and fired it up. A little ferreting around (had to find the code that was extracting the current domain, match it for the chrome-extension protocol, and tell it to not append the domain and path if the protocol was chrome-extension. Otherwise, it was giving me "chrome-extension://extensionidhere/http://yourappid.appspot.com/_ah/channel/xpc_blank", which is not quite what I wanted) and lo and behold, the extension worked again.

I fired off an email to Moishe Lettvin, the developer who had been working with the testers on the API, letting him know about the bug. He acknowledged it existed, but claimed he didn't know how to fix it off-hand. I explained what I had done, and he acknowledged that was the correct fix. He has (by now, I presume) applied the fix, and it will be rolling out with the next GTalk frontend rollout. Unfortunately, that could be weeks or months away. So I'm keeping my hacked together file, and am going to end up pushing it out for android2cloud. And I'm going to let you do the same.

Using it is simple:

  1. Grab yourself the channel.js file I've modified.
  2. Put it in the folder of your Chrome extension.
  3. Open the channel.js file, and modify line 2:
    var myHost = "http://connegt.appspot.com"; needs to become
    var myHost = "http://yourappid.appspot.com";
  4. Build a webpage that is Channel-enabled, as usual. Your chrome extensions are just HTML pages, so you shouldn't have to modify anything at all.
  5. Change "http://yourappid.appspot.com/_ah/channel/jsapi" to "/channel.js" anywhere it appears in your code (though you should only have it in there once...)
  6. Enjoy!
It's really that simple to have your browser updated in realtime. I don't think you have any excuse left for polling.

August 18, 2010

On Peter Pan

It's probably pretty obvious, but I have a huge Peter Pan complex. I blame my parents for this (they made my song "Forever Young"—the Rod Stewart version, not the Jay-Z version—when I was young), but it probably stems from a lot of things. Regardless, I've always had a fascination with Peter Pan. My favourite portrayal so far has to be the 2003 version starring Jeremy Sumpter, but I got the chance to watch Hook the other day, and I thoroughly enjoyed it.

While watching it, though, I started thinking about the untapped stories in Peter Pan. The story is magical because of the character that Peter holds. Peter embodies and is Neverland, and a lot can be done with that. Few films seem to accept or embrace that, which is why the 2003 version happens to be my favourite; it really plays with the idea and personality of Peter, while staying rather close to the original J.M. Barrie story.

Peter is embodied by his childishness—his refusal to grow up is what gives Neverland its timelessness. And in that inherent immaturity, we see the pros and cons of such an approach. Peter is tactless, to the point of hurting those around him out of ignorance, but enchanting, happy, and carefree. He is incapable of some of the stronger emotions, and exhibits a fleeting character that one may miss if they blink.

What then, is made of the crush that Tinkerbell clearly has on him? It is implied in every version I've seen that this is what fuels her betrayal of Wendy to Captain Hook, but the dynamics aren't really explored. And Tink, herself, is a wonderful font for exploration: a creature so tiny she can only hold a single emotion at any given point. Much a mirror of Peter's undeveloped emotional capacities, the dynamics between Tink and Peter hold a plethora of opportunities for stories. What would Tink say, should she have a chance to tell the story? What would Peter say, should he know of Tink's feelings for him? What would a relationship between Tink and Peter look like?

Perhaps I'll have to write some explorations into this realm that I love so, should I get the opportunity this semester. I would love to hear other people's thoughts on the matter, though.

August 2, 2010

I'm a Shakespeare of Software

I wear funny clothes and people will remember me for centuries to come.

OK, maybe not for those reasons. But still, I find the best comparison to my programming style is the great bard himself. Some of you may not know this, with all the programming stuff I do, but I'm actually an English/Adolescent Education dual-major. No, no Computer Science degree. Yes, I spend my time reading literature. Yes, I will be teaching your kids.

As any English major must, I've spent some time with the bard (or his work, at least). One of the most striking things, and one of the things discussed in classrooms ad-nauseum, is the bard's remarkable lack of originality. King Lear, for example, is little more than an amalgamation of three similar stories, told and retold throughout cultures and time periods. In essence, William Shakespeare was the Disney of his day. Which is not to say that the bard never created something; he simply grounded his creation in the creations of others, standing on the shoulders of giants.

Which is all well and good, but software has no cultural history. Does it? Well, yes and no. There are certain problems that are solved and re-solved almost continuously. things like user authentication. These solutions grow to be abstracted out, and suddenly we wind up with things like OAuth and OpenID. We wind up with open source platforms that can solve these problems. These platforms, I would argue, are the cultural history of the craft.

And I, like Shakespeare, simply weave them together.

android2cloud, one of the most successful pieces of software I've written, was built by simply tying together four of these platforms. I stood on the shoulders of Google and OAuth, and in a month I pumped out an application that is used by over 300 people. The amount of code I actually wrote for that project is laughably small. Minuscule. And that is how I do programming; weaving together what others have built, until it fits what I need it to do. With the amount of cultural history available in programming, there's very little I can't do.

My suspicion is there are a lot of Shakespeares running around right now, weaving software together into a sum that's bigger than its component parts. We all owe a debt to the creators around us, who pioneer the new technologies we stand on, but they owe us a debt as well, for making that technology more than they dreamed it could be.

June 30, 2010

Thoughts

I've been thinking a lot lately. This is a largely unintentional side-effect of some current personal life happenings that I won't share, simply to save you the whining. And yet it remains, there have been a lot of thoughts bouncing around in my skull. I'm sure I've been annoying my friends, texting and IMing them about some pretty abstract things.

Last night, I got to thinking about why I write. Whitney Turland wrote recently on why she writes and asked for commenters to chime in on why they write. And I intend to, but I'll do that in its own blog post. In a nutshell, though, I write to think.

Rather than killing trees, thinking in notebooks that are then scattered around my room, gathering dust and doing nothing for anyone, I've decided that this blog should fulfill that purpose. I've been trying to write for an audience, trying to write what I think people will care about. But this is my blog. It's supposed to be my presence. And so I intend to let it archive my thoughts, and guide my thinking. Perhaps you will take the time to comment, to help shape my thinking. Perhaps you won't. That's entirely up to you.

What does this mean for you? It means more posts that you may not care about. It means more of my personality, more of the things I care about, and more variety on this blog. It does not mean more personal problems or interests that mean nothing to anyone but those closest to me. Instead of posting about how Charlie and Jane are fighting, I'll be looking at why they're fighting, and pondering over which of them (anonymously, of course) is right. I will be trying to refrain from adding unnecessary personal information into posts as possible, focusing instead on the ideas, the abstract.

Maybe you'll like this. Maybe you won't. If you don't, I'd love to hear from you on why. But I've grown distant from my writing, and my lack of practice has weakened and poisoned my abilities. I intend to get back to my writing, and that means writing my thoughts, not the thoughts I think people want to hear about.

May 22, 2010

All Quiet

I started out to write this post thinking I hadn't written anything for this site in quite some time. Actually, I wrote a post here four days ago. Seems like that was a long time ago. Probably because I've done so much in between then and now. My last post was on Tuesday; let's recap what has happened since then.

Tuesday

Tuesday was the introduction of Neil Patrick Harris to Glee. I'm not much of a television person; Glee's the only show I watch regularly. And NPH happens to be my personal hero.

Naturally, I set up a projector to view the show. And naturally, I almost wet myself. I was extremely disappointed that the producers saw fit to auto-tune NPH (who does that?!), but it was still amazing to see him rock out to Dream On and Piano Man.

Wednesday

Wednesday I dedicated to Google I/O. I watched the recorded versions of the streams as soon as I got the chance, and thought and thought some more about the company I want to work for. Day 1, I thought, was far more web-oriented. It was all about building web applications: HTML5, cloud computing, app stores, etc. Day 2, to the contrary, I saw as being far more focused on devices; namely, Android and Google TV.

I'm squeeing like a schoolgirl over Google TV, because I may actually watch TV again now. Ignoring the fact that I don't have the time for it, this is really exciting. And Android was exciting, for reasons I'll cover in a minute.

Thursday

Thursday was also dedicated to I/O. I've only seen the first half (before the Google TV news) due to availability, but Android already has me super pumped. The cloud to Android sync option (the Push notification done right, as it were) particularly inspired me. It inspired me so much that on...

Friday

I started a new project, android2cloud. I figured if the cloud could push pages to Android, Android should be able to push back.

I was in Rochester for the day, at my brother's commencement, but in the four hour round-trip and an hour or so after the event, I managed to get a working prototype of the cloud side of this. A Chrome extension pings an App Engine server every 15 seconds and gets the latest link attached to your Google Account (using OAuth, of course). If that link is the same as the last link that Chrome opened, Chrome does nothing. If it's different, Chrome opens it in a new tab. There's also a button in the browser that will open the last link attached to your account, no matter what.

I plan to release two versions of the Android app when I (start and) finish it: a free version, and a $0.99 version. These two versions will be absolutely identical in every way. The only difference is one donates $0.99 to me to help me get through college, and (maybe? Possibly? No promises.) send me to I/O next year. Basically, it's a convenient way to donate to me.

Of course, I need to have an Android app to sell, and I haven't even started yet. I want to wait until I have an Android phone I can actually test it on (though I have a pretty good theory as to how the app will work...) Which leads me to...

Today

Today, the glorious day in which I bought my Nexus One. It will arrive Monday or Tuesday. I'm excited.

I also did some work on android2cloud, designing logos, opening sites, and checking policies. I have a request in to Google to use the word "android" in my application, as well as to allow me to use my modified copy of the Android logo in situations where it's impossible or impractical to include their attribution statement at the bottom of a page. Like, for example, in the app, in Chrome, in Google Code, and in Google Groups. Basically, everywhere I use the icon. I feel like Google will come through for me, so long as I attribute them somehow.

So yeah, busy week. And it looks like my next week is bright: Lady GaGa is on Glee, I get my Nexus One, and I get to see an improv show my friends are performing in.

I love summer.

May 17, 2010

Let's Cut Down a Tree, Knowing No One Will Hear

A couple days ago, I read Paul Carr's thoughts on the growing number of complaints against Jobs, Zuckerberg, and Wales, CEOs of three of the most prominent tech companies. As I sat there reading his article, I was uncomfortably nodding my head. I was nodding because most of what he was saying (which, in case you don't read my mouse-overs [you should], was essentially "Shut the hell up, and stop whining.") was absolutely spot on. It was uncomfortable because I really, really wanted to hate Jobs.

I've hated Jobs for a while now. I find his entire style of running a company and producing a product to be unmanageable, unscalable, and unwieldy. Yes, it produces pretty stuff, but we all know to beware the pretty-faced girl. But you know what? I don't have a Mac, for that very reason. I have an iPhone, and am dumping it instead of upgrading. I'm voting with my dollar, and that's where my voice ends. Or so Paul says.

And up until that point, I'd agree with him. I have no business telling Steve Jobs how to run his company. None whatsoever. Lord knows I couldn't do his job better, or even half as well. I'm a big enough boy to admit that; I have my strengths, and running Apple is not one of them. And yet, that doesn't mean I should sit down and shut the hell up. It just means I shouldn't expect Steve to change for me.

Let's talk about how friendship, trust, and recommendations work. My friends know me as the most tech-savvy thing they're likely to know personally until they leave college. Which is kind of cool, but kind of a heavy responsibility. Every time a friend wants new speakers, a new laptop, a new monitor, a new computer, a new anything that has circuits, they ask me what they should get. They tend to trust my opinions, and so I put a lot of thought into what I tell them. Because they trust me to know what I'm talking about and trust our friendship to ensure I act in their best interest, they're likely to follow my recommendations. See how that works?

Because of this, I'm acutely aware of something: Apple products are not for everyone. Just like Windows isn't the best thing for everyone, or Linux, or any other single product. People are complex beasts, and there is no one-size-fits-all product out there. My mother would have no idea how to use a Mac. My R.A. prefers one. It all comes down to how they feel comfortable interacting with computers.

So rather than trusting Apple to know what's best for all of these people, I need to know what's best for them. And to know that, I need to know what there is. And how do I know that?

I know that because people complain. Because people complain, I get a feel for the downsides of every product. Not all complaints are reliable and hold water, but you learn to wade through and get a feel for what's on the money and what's bullshit. I don't have the time to run a Mac and a PC as my main computers, and work a lot in both. I've dabbled with Macs, know how to get around in them, have logged some hours on one, but I'm nowhere near as familiar with them as I am with PCs. So I rely on the reports other people make, I rely on their complaints, to fill in the gaps in my knowledge.

The bottom line is, no, Steve Jobs should not bend to the demands of Apple haters, trying to make a product that makes everyone happy. There's no such thing. But that's not to say people should stop complaining; it's just saying he should continue to not care.

Which I'm sure he's quite good at, as he checks his bank account balance.

May 12, 2010

What I've Been Up To

OK, so I haven't written here in a little while. Not nearly as long as some of my writing dry spells. But I've been busy! Not in the "so I didn't have time to write" way, but in the "so I have cool stuff to share with you guys" way.

First of all, I started with Yet Another Blog. This one is going to be mainly active this summer, and then periodically over the next school year—or that's the plan, anyways. It details my adventures as a Googler In Training (which is a wonderful title I've made up for myself; it basically just means I want to work for Google really badly, and am trying to hone my skills so I can). I'll be learning C/C++ over the summer, and enhancing my skills with Java. I'll also be looking into learning data structures and algorithms.

If any of you readers know about these kinds of things and would like to teach me even a little bit, drop me a line in the comments, or @ me (@paddyforan) on Twitter. I'll need all the help I can get.

Besides my over-publicised attempt to get hired at the greatest company on Earth, I've been busy with finals. But those aren't nearly as exciting, so I'm just going to skip right over that part.

I'm working on a QR-based ticket site written in Java for App Engine, basically because it sounded like a cool tool. I'm focusing on keeping it simple. You log in with a Google account, all transactions are handled by Google checkout, and there are no lists of events or searches for events. It's meant to be a tool, something people link to, not a destination of its own. The basic premise of it is that you can sell tickets to an event, and the user can print them off right from their computer. The tickets have a QR code, an ID number (in case the QR code magically fails or something, you can check from a web interface), and then whatever extra attributes you include. When the QR code is scanned, it checks if that is a valid ticket, reports that it has been used, and then displays any extra attributes, along with the buyer's name and, optionally, picture.

Again, just a really simple ticketing system for lightweight events. Also working on a way to integrate "on-site" or "at the door" tickets with the system. Think I've got it figured out.

I may release that project as open source. Probably will, just because that's how I roll. Look for it on Github, or I'll write a post here when it's ready to actually, y'know, be used.

So there you have it. That's what I've been up to, besides my normal hacking on @spaz and mundane college stuff. Oh, and super-secret Google stuff I'm not allowed to tell anyone about. Like, laws and such. Which makes me feel all warm and fuzzy.

I forgot to mention that.

April 28, 2010

In Support of @Spaz

I can't believe I'm advertising here. OK, yes I can, but still. Makes me feel all sorts of cheap.

And yet, it feels right to give a shout-out to a group that's already done so much for me, in a lot of ways. @funkatron and @ElizabethN are two of the nicest, friendliest people I've met. Despite my disgusting Javascript skills and my complete lack of experience with Git and Open Source development, they've both welcomed me and put up with my obnoxious questions on Google Talk, IRC, Twitter, and anywhere else I can find them. @ramsey, @wlturland, and @elazar have collaborated to make me feel welcome and involved, and have proven that getting involved in Open Source is one of the best choices I could have made.

Just last night, @wlturland and @elazar got into a conversation about me over Twitter based on my @spaz contribution. For the record, I've changed three files, added four methods, meaning support for one feature. I'm not exactly writing huge chunks of their codebase. But they make me feel involved, and I find myself wanting to contribute more. This is how FOSS is done, ladies and gents. It was mildly odd, getting mentioned by two people I had only heard of in passing and never interacted with directly, but I got over it rather quickly.

Really, all this post is meant to say is that @spaz is an awesome experience. May 8th is an IRC hackathon on freenode.net's #spaz channel, with more information here. I plan on joining in, and hope some new people will stop by. For a project this awesome, it's absolutely worth it. Definitely a great project to get started in the FOSS world with.

April 26, 2010

I Support Twitter's Ads, and So Should You

Ok, so pretty much anyone who's tech-savvy knows by now that Twitter has started "embedding" ads in its search results. Embedding is in quotes because Twitter will say it's the wrong word. They like "promoting".

In a system it calls "promoted tweets", it lets advertisers pay to have their tweets promoted in places like searches and in their followers streams--or so far as I've understood, at least. Granted, I don't understand much about this new revenue system, and I don't really care to; an odd approach, given the post title. Let me explain.

I'm not so much saying that you should support Twitter and its ads; instead, I'm saying that applications should. Twitter made the risky decision to not require its third-party clients to include the promoted tweets, and to split the revenue with them. Meaning if a developer doesn't want to display ads in their application, they don't have to. Which is admirable.

And yet, I'm claiming that developers should include these promoted tweets in their application. And here's why: it isn't the developer's choice.

Ads have a really negative stigma associated with them today, and for good reason: most suck and are annoying. We need to keep in mind the point of advertising, however: to make us buy things. And so long as we aren't being tricked into buying things, one would imagine that we'd actually want what we're buying. This is what the whole industry is built on. Advertising is simply the business of bringing a user and the product they want together. Everyone wins.

Most users, however, don't want to see these promoted tweets. Why? I don't care. Honestly, it's superfluous to my argument, a tangent that only breeds trouble. I don't know enough about the system to argue it effectively. But I do know that if I'm a user, there's a chance that I may enjoy these ads, they may work for me, or hell, that I may want to support Twitter. And why should the developer of the application I'm choosing to use make that decision for me? With Twitter launching its own official clients, developers can't afford to estrange users by making decisions for the user.

So yes, I support Twitter's Ads. I'll be asking @funkatron if we can include them in @spaz. But, to be perfectly clear: I support including them as an option. A check box in the settings page. Let the user decide.

April 19, 2010

Beware the Pretty-Faced Girl

It's astonishing how quickly forget one of the most important lessons in life, just because it's applicable somewhere unexpected: if something seems too good to be true, it probably is. Why then, do we not hear words like "magical" and "revolutionary" and become suspicious, as we should, instead of fawning and yammering on excitedly about the future?

Any semi-savvy computer user (or anyone with common sense, really) can tell you that no, there is no Kenyan prince willing to sign over a vast sum of money to you, if you only send him the bank fees. No, the bank didn't make a mistake on the account you didn't know you had, and will not mail you a large check if only you can verify your social security number.

Why then, when we hear about a magical, revolutionary new tablet, do we think it comes with no strings attached? Why is it ok for us to find a brilliant product, a brilliant free product, even, and think it's not going to have some sort of cost somewhere down the road? Why do we think we can make thousands, if not millions of dollars developing applications for a service, but the service (with financial woes of its own!) won't step in to compete?

We're just used to the Web being free. We're naturally suspicious of Open Source software (that's changing, as of late, thank God) because we don't understand why people would waste their time developing free, open tools they can't profit from for our use and enjoyment. And the simple answer that they like to seems out of place. And yet, when those tools are embedded in a webpage... Suddenly it's all okay.

You'll notice I've strayed away from Apple's iPad. There are plenty of posts out there on how the iPad is a "poisoned apple". Nobody needs another one. And the iPad isn't what got me thinking about this.

I was just thinking about Tumblr, the wonderful micro-blogging site. Free to use, elegant, well-designed, and with a nasty tendency to copy features from other sites, it is the blogging tool of choice for most the hipsters I know. Just as Apple is the company of choice. And that really got me thinking: it comes down to aesthetics.

I mean, how could something so pretty possibly be bad?

And yet... Tumblr has that aforementioned nasty knack for cloning functionality. Apple has a sour relationship with developers, competitors, and really anything they decide not to like that morning. Apple's practices are, more often than not, borderline monopolistic in nature: want to develop for your iPhone? Good. Get a Mac.

There are plenty of arguments for why this is. The one that holds the most water, I believe, is controlling user experience. By making sure their products work best together, Apple can control the user experience. By copying features in-house, Tumblr can control the user experience.

When did we decide it was okay for anyone to control our experience except for us? Are we really that insecure about our ability to have a good experience on our own? Imagine going to a movie, and having the cinema tell you where you were sitting, what you were drinking, what you were eating, who you were watching the movie with, what movie you were watching, and what you thought of the movie, including whether you liked it or not.

Why is that experience not okay to control? Doesn't Regal know best? If Apple went into the cinema business, would it be okay for them to do that?

We really need to consider the types of businesses we're supporting and condoning, all because they have a pretty face and control our experience for us.

April 15, 2010

A Return to My Roots

I should be writing a paper right now. Two, actually. But a book review of Go To is nowhere near as interesting, and a response to Shameful Flight is far too tedious. So, in a true return to my past, I'm writing a blog post instead of worrying about schoolwork. Such is life.

I started my life as a hacker playing with JavaScript on ProBoards. But my true immersion into the world of hacking and programming came when I took up Linux, inspired by my programming mentor Bob Duke, and formed the Linux Campaign in my high school. As a LUG, the Linux Campaign was a bust. But it was fun. And I found something out:

I really enjoy Open Source software.

The GPL, the MIT, the Creative Commons... these are my licenses. Free Culture is my bible. And yet... in the past few years, I've been drifting away from FOSS. Not intentionally, and not significantly. I still prefer FOSS products, when I can find them. I still use CakePHP and Django to make stuff, and still don't care if other people use my stuff.

But I guess that's the issue. I don't care.

Part of the culture surrounding FOSS is the desire to share. The desire to help others use you work, to contribute back to the community. And the community gives me so much, it's hard to justify not giving back. To be honest, for the last year or two, I've been a leech on the FOSS community. I've been busy, yes, but so are @funkatron, and @felixge, and all the other FOSS contributors that I admire and strive to emulate. And I'd like to change that.

I'm starting this summer by applying to GSoC. If accepted, I'll be working on either Melange or Big Blue Button for the summer, contributing Open Source Code. Last night, I also attended a @spaz meeting, and signed up as a contributer to the wonderful FOSS.

So here it is, FOSS community: my apology to you. And my promise to make amends.