by Jesse Stay — published on July 11th, 2007
Hi - you seem to be new here. If you like what you see, please give back by subscribing to my RSS feed!
You can check me out on Twitter, Facebook, or FriendFeed to see what I'm up to. Thanks for visiting!
Today, Facebook announced they were releasing a new FBML tag for developers that would allow developers of Facebook Apps to track their applications via Google Analytics. Before this, because the code you put on your page is javascript, there was no way to track your apps. I tried to install this, but ran into issues, in that Google tries to look at your main facebook app page for the javascript (which isn’t parsed by Facebook), while Facebook gives an error if you put the raw Javascript on the page. I came up with the below solution, which works like a beauty - you put your javascript between your <fb:google-analytics> tags, like this:
<fb:google-analytics uacct="12345">
<script type="text/javascript">
...
</script>
</fb:google-analytics>
Since Google reads the plain callback url it won’t interpret the fb:google-analytics, and Facebook ignores everything between the <fb:google-analytics></fb:google-analytics> tags. Works like a charm on mine.
by Jesse Stay — published on July 9th, 2007
Well, I took advantage of a low-hanging fruit, and wrote my first public Facebook app yesterday. My Picasaweb app is still in the works, but this appeared to be a bit more simple, as I would only have to deal with the Facebook API on this one, rather than the Google API as well. The concept is simple - you copy the code generated from your “Call Me” button generated from GrandCentral into a text box after you add the App to Facebook. The app then converts that embeded swf into FBML and sends it to your Facebook Profile for others to see.
The app itself wasn’t that hard once I got over the learning curve. The basics of the Facebook API are to generate a session key with canvas->validate_sig(), and then pull the session key parameter from the returned parameter hash to be passed through forms, used in a cookie, etc. Then on every page you need to access Facebook data (such as sending fbml to the user’s profile) you just run session_key(), passing in your session key you retrieved with validate_sig() on the entry page.
I also used this app as an opportunity to learn Perl’s Catalyst Framework, the Ruby on Rails of Perl. I will definitely be using this more in my web apps in the future - maybe even in some of my non-web apps (one advantage it has over RoR - it’s very flexible). The basics were I just run a simple command to create the basic Catalyst framework files and libs, then create my Database Model files and run a command to generate the libraries for that, including DBIx::Class ties. Then I just create my Controller libraries with a simple command, and then my TTSite (Template Toolkit libraries and files) libraries with another command. I’m then free to edit and write as I please, and it forces the code into a modularized structure. I used Perl’s WWW::Facebook::API libraries to access the Facebook API - once I figured out the session stuff everything else was very easy.
The one quirk I’m still trying to get around is Facebook forces you to click on an swf before it gets activated when it’s on a user’s Profile page. You’re supposed to be able to display an image in it’s place, but I’ve only been able to get that to work on the Canvas pages. The tag for that is <fb:swf/>, btw. I think I’m going to sniff httpd to see what that swf is doing behind the scenes to see if I can find a non-swf way of doing the call me button.
If anyone has issues in particular with either the GrandCentral App or WWW::Facebook::API, feel free to list your questions below. Also, please add my app and give comments! The url is:
http://www.facebook.com/apps/application.php?api_key=a5438e29c1b4df4ec650d374b4175741
by Jesse Stay — published on June 29th, 2007
While at YAPC::NA, being the Fanboy that I am, I asked Larry Wall to sign my Perl Book. He, very timidly (Larry Wall is a very shy person), started pulling out an entire stamp set, and a pen. For those that haven’t had their Perl book signed by Larry Wall, it’s not just a signing, it’s an experience. He not only signed it, but stamped it with “There’s more than one way to do it”, and then stamped a camel multiple times, getting lighter as his stamps moved to the right. Very cool… Here’s his autograph for those that want to see it:
Follow the link to the album to see a couple more pictures of YAPC::NA. Overall it was a very nice experience - I’ll probably blog more about my experience tomorrow.
by Jesse Stay — published on June 25th, 2007
Here’s my summary of the Larry Wall YAPC::NA Keynote. I came late, so I missed some of the beginning. I’ll update as I go…
- Scripting Languages - Larry Wall started with BASIC, which he considers to be the first scripting language
- Tcl is a purer scripting language than Tcl. Perl got its extension mechanism because Tcl doesn’t have it
- Python - not qualified to talk about Python
- Ruby - Perl programmers take their programming much more serious than Ruby programmers
- Corn shell - shows just how crusty a language can get if you just keep adding to it
- PHP - seems to be making the same progression of mistakes as earlier Perl did, only slower
- Javascript - might be a decent platform for running Perl 6 on
- Monad/PowerShell - object types similar to Perl 6 - hope they don’t patent it
- Lua and AppleScript
- The Present - Larry views a string as a “T”ext (capital T): an active communication which requires interaction on both sides??? “All Languages are incomplete”; Human languages differ not in what you can say, but what you have to say; If your language forces you to say something you can’t be concise.
- early binding, late binding: these days most scripting languages are trending towards late binding. Perl 6 and Perl 5, all methods are virtual by default;
- Single Dispatch, Multiple Dispatch: single dispatch - send message to an object, and object determines what to do with that message; multiple dispatch - objects are passive, who determines what to bind? All routines get together and hold a “political conference”. All potential candidates put their names in a hate. Eventually the teams decide amongst themselves what to call it. Worst way to permit binding (democracy).
- eager evaluation, lazy evaluation: Perl 6 working with a mixture of eagure and lazy; scalar context will be eager by default, while list context will be lazy by default.
- Perl 6 will have a different set of FAQ’s - hopefully not, “huh?” (laughs from audience)
- symbolic, wordy: likes it when most of the words are chosen by the programmer to represent the problem at hand. In Perl 6, trying to raise standard for when to use punctuation and when to not. Each symbol added must justify its existence. Introducing new punctuation for Perl 6.
- compile time, run time: Perl runs a lot of code at compile time, which can get messy - don’t want too much File IO in BEGIN blocks.
- declarational vs. operational: Perl 5 has always been a little bit more declarational than Python or Ruby. Perl 6 has more kinds of scopes - a few more declarators that work like my and our. When declaring a variable you’re really just doing a kind of tie. Difference is you’re doing it at compile time instead of run time.
- mutable classes, immutable classes: Perl 6 will have an interesting mix…
- crap - switched networks and forgot to save - missing a little here…
- The future: Perl 6 is taking a gamble. Hoping to come ahead before the tried and true “worse is better” thing
- Talk 2!: Wearing a black hat, saying he’s a “black hat programmer”. Puts on an LA Dodgers hat, and starts talking about his life growing up in LA, trips to volcanoes, making snow cones out of snow, fascination with natural disasters
- In CA a lot of Californians had this thing about being cool…
- Cool - Larry has the same screen saver as I use (3D fireworks)
- At age 6, moved to Pasadena. Second grade, they built a post office… Mom cut postage stamps with sewing machine - he thought it was cool, using a tool for something it wasn’t intended for (Sometimes perl get used for things it wasn’t intended for (laughs))
- Mention of Autistic/Asperger tendencies when younger
- New hat, white Fedora: Did a lot of fishing when younger, takes patience. Many people are impatient to get Perl 6 out the door. People writing it are probably more impatient. We came pretty close to not having perl, because Larry came pretty close to drowning when younger. Couldn’t swim very well, went out with styrofoam surfboard, and it blew away after slipping away from him. Later on decided to learn to swim.
- 4th grade, all he had to read was World Book Encyclopedia or old Readers Digests; year Kennedy was assasinated; learned to be a teachers pet
- 5th grade, don’t remember anything - as autistic spectrum kid, tuned everything out. Does remember saying “For Your Information” to teacher and teacher getting offended. Didn’t realize “For Your Information” has a pragmatic meaning as well as semantic
- Junior High: another lesson in pragmatics - “don’t smirk like that (am I smirking? I thought I was just smiling)”
- High School - hired to do summer camp thing. Did a summer camp called “Green Barays”. Subsisted for about a day and a half on nothing but peanut butter and raisins because food couldn’t get up to them. Lesson is “don’t trust your leaders” (laughs from audience).
- New hat: detective hat (sherlock holmes style hat): lived life a lot like Sherlock holmes, violin, etc. Liked LOTR… Took a year off to go to bible school…
- new hat: pigskin golf-type cap - likes the dutch look of it; bible school didn’t go well, liked to think for himself, bible school told him what to think… started working for computer center learning to hack at college… only flunked one class at the time - preparation for marriage (laughs from audience)… remembers Bill Gates wandering in and out periodically… moment of glory there was discovering a solution to major bug in colleague’s code…
- new hat - austrialian indiana jones-type hat: got married, decided to become missionaries, started going to Bible translators’ school… displays his trills, triple trill, language in New Guinea… Don’t take culture over there - idea is to take minimal universal truths to another culture and adapt their culture to it
- how do you communicate across cultures?
- Missionaries are pretty ordinary folks, main difference is they typically drink less beer… When you’re married and a missionary you get to make a lot of jokes about “Missionary Position” (laughs from audience)… some mention about “Bum Wrap”, and more laughs from audience, correcting himself trying to figure out a non-sexual missionary joke…
- New hat (well back to old): LA Dodgers Hat - moved back to LA… got a “temporary job” there… Moment of glory was taking a class from a professor at UCLA on tonal languages (I like Larry
)… Developed food allergies… took it as a “tuberfour” upside the head to re-evaluate life… biggest decision was to drop out and continue working for industry…
- New hat - Linux Cap: Started learning Unix (well, BSD)…
- New hat - mickey mouse hat: best thing about working there is every so often they would rent out disneyland for the evening
- Back to Linux Hat - went back to Systems Administration for a Secure Networking company… That’s how Perl was born - theoretically they could put him in prison because it was written there and taken back on a tape (I think he’s being sarcastic)
- Back to Pig Skin Golf cap (missed the reason - something about his father)
- Back to Linux cap (something about a speech)
- Purple Cap: moved to bay area, where Perl 5 was born. Decided to make Perl 5 more object-oriented…
- New hat - black hat again
- white fishing hat - talking about Stanford
- Black hat again
- Orange hat, talking about Europe
- White Cap, talking about Geek cruises (he’s just telling quick stories of various places he’s been)
- French Purple baray - never been to France
- Santa hat - christmas, which is when Perl 6 comes out…
by Jesse Stay — published on June 20th, 2007
I will be in Houston next week for YAPC::NA. I’ll try to post updates to the conference as I can, in particular Larry Wall’s report on Perl 6. If anyone has any questions or items you’d like to me to look up or keep note on, let me know. I’m totally excited, as Houston is where I grew up, and I haven’t been back in around 10 years! I’ve got to get the Texan back in me.