Perl Archives - Page 3 of 4 - Stay N Alive

Perl – NOW is the Time to Step Up!!!

Rails has finally done it! They have finally admitted what we as Perl programmers have said since people went all Ga-Ga over it around the launch of BaseCamp. In an unprecedented blog post, Zed Shaw, creator of Mongrel, totally turned his back on the Rails community, saying what I’ve heard in outside circles all along (from Zed himself):

“This is exactly what makes Rails a ghetto. A bunch of half-trained former PHP morons who never bother to sit down and really learn the computer science they were too good to study in college. “

Perl is at a prime spot to step in here – this year, John Rockway published the first book on Catalyst, Perl’s answer to Ruby on Rails, in a much more Robust, more scalable package. Catalyst is stronger than ever. You see, I know some of the writers of Catalyst, and I know for a fact there is an entirely different mentality than that of Rails – Catalyst was built by Computer Scientists, and therefore was built by people who understand how an MVC architecture should be built!

My message to the Perl community is this – step in, do something! Promote the heck out of Catalyst now. Blog about it! Pull Zed aside, show him how it can help him, get him to blog about it. Ruby on Rails is weak right now, it’s breaking apart from the inside. Now is the time for the Perl community to show its strength and unite in an effort to make Perl once again the most used platform on the web! We need some big names in the Perl community to be stepping in here and taking advantage of the attention Zed’s bringing to Rails.

Next Utah Social Media Developers Garage Meeting: December 11

I mentioned this in the official group, but the next Utah Social Media Developers Garage meeting will be held Tuesday, December 11 at 7pm. Amazon.com’s Jeff Barr will be our featured speaker and will be talking about Social Networking sites that currently use Amazon Web Services and why AWS is beneficial to this medium. I’m excited to have him here and look forward to hearing what he has to say – I appreciate him taking the time to address our group. We will have at least one more guest speaker after Jeff, which will be announced soon – I’ll update that here and on the event page.

After the event we will hope to play some Guitar Hero, Halo 3, or Dance Dance Revolution on the Xbox 360 – bring your GH guitars! As always, the event is bring your own snack, and SNAPlicate will provide drinks for the group.

This event will be sponsored and hosted by 12 Horses and will be held at their new headquarters in Draper, unless there are too many attendees to accommodate. I’ll post a map and directions here and on the event page when that is officially confirmed. The event will also be sponsored by my Social Media development and consulting company, SNAPlicate – we are the ones organizing the event.

Please RSVP on the Facebook event site so we can have a good idea of the number of attendees that will be there – if you don’t have a Facebook account, please comment here and let me know you’re coming. This is critical to us knowing if we’ll have enough space or not. RSVP here: http://www.facebook.com/event.php?eid=20803448528

Auto-Follow Those that Follow you on Twitter

On Twitter, it is generally polite to follow those that follow you – they are saying, “you are interesting”, so it is the polite thing to show interest in them as well. I have heard from multiple people, including Scoble and Chris Pirillo that they have requested Twitter do this for them.

Well, I’m proud to announce that I’ve written a script that does just this for you. It’s a simple script, that does just what it says it does – auto-follows those that follow you. To install the script, download this script, unzip it (gunzip), then edit it. You’ll need to specify your Twitter username and password in the specified places, and if you want to blacklist any screen-names you’ll want to add those in as well. Then, add the script to a cron job somewhere, say, in cron.hourly or cron.daily, and it will now auto-follow anyone that follows you on Twitter! If you get any bologna (as I call it – others call it bacon) followers, you can simply add them to your black list in the script and it will ignore them.

If you have any problems installing it or running it, please comment. This script is being released under the GPL, v.1. Again, you can download the script at:

http://www.jessestay.com/auto_follow.pl.gz

I’ll post it to CPAN later as I get time so it can be downloaded there.

UPDATE: you’ll need to have Net::Twitter installed – you can install this by running “perl -MCPAN -e ‘install Net::Twitter'”

UPDATE (11/14/2007): Chris Pirillo has pointed out that it’s hitting an API limit if you have to follow more than 70 users within the same hour. If that is the case, set it to run on cron every hour, and eventually it should catch up. Twitter can also add your username to a white list if this is important to you and contact them. If you are on that white list, it should follow everyone in one swoop.

Jesse Stay is a Utah Facebook Developer and Consultant

Well, I’ve officially made the plunge! As of today I have announced my resignation at UnitedHealth Group and will very soon be completely self-employed, working on your business’s projects full time under my consulting business, Stay N’ Alive Productions. If you have a project of any caliber, I am giving short-term (that could become long-term) contracts first priority, but will consider anything.

I mentioned previously about my friend Thom Allen being a Facebook developer. Well, I’ve let him have the limelight for long enough and now it’s my turn! I am a Utah Facebook Developer. I currently have 4 applications written, one with near 10,000 users and growing. I also have been doing Facebook consulting since almost the launch of the Facebook platform. I have taught classes on Facebook and am definitely your man if you need some consulting or projects based on the Facebook platform.

So if you need any work, give me a ring via the GrandCentral “Call Me” button down on the right of this page and we can work on a bid or estimate for consulting work. You can also read through this blog to understand what I know and how I can help you. Feel free to blog or Twitter about me as well! I need all the help I can get to get this off the ground!

Am I Still One of the Only Utah Facebook Developers?

I mentioned this earlier, and only learned about one other Utah Facebook Developer. Today the question was raised again as someone contacted me, looking for Facebook developers in Utah. I only had one person to refer them to. Are you a Facebook developer? If so, please comment below and I’ll send you referrals!

As for other alternatives, if you are a business owner looking to launch a Facebook application and are looking for a Utah-based Facebook developer, I suggest choosing a good developer, and having them learn Facebook as part of the spec for the project. Any good developer should be able to learn Facebook in not too much time. Frankly, most Facebook Developers I know are in entrepreneurial mode right now, as there is simply too much money in this area to pass up!

Presenting at Utah Facebook Developers Garage Tomorrow

Just a reminder to everybody that I’ll be presenting at the Utah Facebook Developers Garage tomorrow (August 9th) evening at 6pm. The details are all on phil801’s blog (link above). I plan on doing a “Hello World” walk-through, where we’ll start with adding the application, work on setting it up, and actually write things for it. Hopefully we can cover a lot of the most useful features I’ve found to get you up and going. My preferred language is Perl, and the framework I use is Catalyst, so this might also be a good opportunity to get a glimpse into what the latest in Perl is doing, and how Rails’ up-and-coming competitor, Catalyst, is going to take the world. (okay, I’m biased – did I mention my license plate says “USE PERL”?)

Google Analytics for Facebook Apps

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 tags, like this:

...

Since Google reads the plain callback url it won’t interpret the fb:google-analytics, and Facebook ignores everything between the tags. Works like a charm on mine.

GrandCentral Facebook App

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 , 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

There’s More Than One Way to Sign a Perl Book

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:

img_1366-7433703
From 2007-YAPCNA

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.

Larry Wall YAPC::NA Keynote

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…