Monday, December 21, 2009

Picasa Browser with Ruby on Rails

I would like to show small example how to use AIR application and Ruby on Rails for backend. PicasaBrowser is very simple application with 2 http requests to server:

1. to obtain list of public albums for specified gallery


2. to get all photos from selected album.


In the RoR application I have used REXML library to parse rss feed. I know, my ruby code is not perfect and is not in ruby style (yet :)), so I would like you to correct my code.

Air app source code. ROR source code.

On Flex on Rails blog you could find few more examples of AIR and Rails applications.

Thursday, December 10, 2009

Tanjooberrymutts :)

By the time you read through this YOU WILL UNDERSTAND "TANJOOBERRYMUTTS"
...and be ready for China .
In order to continue getting-by in China , we need to learn English the way it is spoken......

Practice by reading the following conversation until you are able to understand the term "TANJOOBERRYMUTTS" .
With a little patience, you'll be able to fit right in.

Now, here goes...
The following is a telephonic exchange between maybe you as a hotel guest and room-service today......

Room Service: "Morrin. Roon sirbees."
Guest: "Sorry, I thought I dialed room-service."
Room Service: " Rye . Roon sirbees....morrin! Joowish to oddor sunteen???"
Guest: "Uh..... Yes, I'd like to order bacon and eggs ."
Room Service: "Ow ulai den?"
Guest: ".....What??"
Room Service: "Ow ulai den?!?... Pryed, boyud, pochd?"
Guest: "Oh, the eggs! How do I like them? Sorry.. Scrambled, please."
Room Service: "Ow ulai dee bayken ? Creepse?"
Guest: "Crisp will be fine."
Room Service: "Hokay. An sahn toes?"
Guest: "What?"
Room Service: "An toes. ulai sahn toes?"
Guest: "I.... Don't think so.."
RoomService: "No? Udo wan sahn toes???"
Guest: "I feel really bad about this, but I don't know what 'udo wan sahn toes' means."
RoomService: " Toes ! Toes!...Why Uoo don wan toes? Ow bow Anglish moppin we botter?"
Guest: "Oh, English muffin! !! I've got it! You were saying 'toast'...
Fine...Yes, an English muffin will be fine."
RoomService: "We botter?"
Guest: "No, just put the botter on the side."
RoomService: "Wad?!?"
Guest: "I mean butter.... Just put the butter on the side."
RoomService: "Copy?"
Guest: "Excuse me?"
RoomService: "Copy...tea. .meel?"
Guest: "Yes. Coffee,
please... And that's everything."
RoomService: "One Minnie. Scramah egg, creepse bayken , Anglish moppin,
we botter on sigh and copy ... Rye ??"
Guest: "Whatever you say."
RoomService: "Tanjooberrymutts. "
Guest: "You're welcome"


Remember I said "By the time you read through this YOU WILL UNDERSTAND 'TANJOOBERRYMUTTS' .......
and you do, don't you!

(c) morning spam :)

Tuesday, December 8, 2009

How to get IP address with AIR 2.0 (windows version)

Previously it was quit difficult to get client's IP address from AIR application, but with AIR 2.0 SDK it is just few lines of code.

if (NativeProcess.isSupported)
{
var file:File = File.applicationDirectory;
file = file.resolvePath("c:\\WINDOWS\\system32\\ipconfig.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess(); process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.start(nativeProcessStartupInfo);
}

private function onOutputData(event : ProgressEvent):void
{
trace(process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable));
}

As you can see this is Windows version. I am not very familiar (yet) with OSX native processes, but I am sure that there is a way to get IP address as well.
So, it is time to try some IP2GEO API. It will be fun :)