Marcos Placona Blog

Programming, technology and the taming of the web.

Month: March 2007 (page 1 of 2)

Yet another first Apollo app – Lyric Finder

Reading time: 3 – 4 minutes

I was going through the blogs and found that I was pretty late in releasing my first Apollo app.
So I decided to play around with Apollo and build something. It’s a Lyric Finder (I know… very stupid creative name).
It uses lyricwiki as source and some regular expressions to interpret the results.
I know there should be an easier way to do that using some sexy webservices, but as I’m still learning the stuff….

And it also helped me to realize that I’m still pretty bad in AS3.



        .*?
/"                 var returnStr:String = pattern.exec(str)                 if(returnStr != null){                 requestResult.htmlText = pattern.exec(str);             }             else{                 requestResult.htmlText = "No Matches Found";             }                          }             private function doSearch():void             {                 import mx.controls.Alert;                 var url:String = "http://lyricwiki.org/";                 var queryStrURL:String = prepareString(artistCriteria.text,songCriteria.text);                 var newURL:String = url + queryStrURL;                 trace(newURL);                 pageRequest.url=newURL;                 pageRequest.send()                 lbl_res.text="Results For:";                 lbl_details.text = capFirst(artistCriteria.text," ") + " - " + capFirst(songCriteria.text," ");             }             private function prepareString(artist:String,track:String):String             {                 var newArtist:String = capFirst(artist,"_");                 var newTrack:String = capFirst(track,"_");                 return newArtist + ":" + newTrack;             }             private function capFirst(txt:String,delimiter:String):String{                 var str:String = txt;                 var aSTR:Array = str.split(" ");                 var i:int;                 var uString:String;                 var newStr:String = "";                 var strSpace:String = "";                 for (i = 0; i < aSTR.length; i++) {                     uString = aSTR[i].substr(0, 1).toUpperCase() + aSTR[i].substr(1);                     newStr = newStr + strSpace + uString                     strSpace = delimiter;                 }                 return newStr             }         ]]>     

    
    
    
    
    
    
    
    
    

AS3 my own implementation of capFirst()

Reading time: < 1 minute

I’m just studying a little bit of Flex and Action Script 3. Basically to be able to build some tiny gadgets using Apollo.

While building one of them, I came up with the following function:

private function capFirst(txt:String):String{
    var str:String = txt;
    var aSTR:Array = str.split(” “);
    var i:int;
    var uString:String;
    var newStr:String = “”;
    var strSpace:String = “”;
    for (i = 0; i < aSTR.length; i++) {
           uString = aSTR[i].substr(0, 1).toUpperCase() + aSTR[i].substr(1);
           newStr = newStr + strSpace + uString
           strSpace = ” “;
    }
    return newStr
}

What it does, is take all the first letters of each word of the string given and return them in upper case.

Not sure if there’s any easier way of doing that, but for my first steps it’s just fine.

I’m Iron Man

Reading time: 1 – 2 minutes

After testing myself to know which Super Hero personality I have, I got this:

Your results:
You are Iron Man

























Iron Man
85%
Green Lantern
70%
Superman
60%
Spider-Man
50%
Catwoman
45%
The Flash
45%
Robin
40%
Supergirl
40%
Batman
40%
Wonder Woman
35%
Hulk
20%
Inventor. Businessman. Genius.


Click here to take the Superhero Personality Test

Hope you’re not catwoman! Show me your results…

Ray has done it again! ColdFire RC1 released.

Reading time: < 1 minute

As usual Raymond Camden is always trying to make our lives easier with his free tools.

Now it’s time for a ColdFusion version of Firebug. For those who don’t know, Firebug is a very handy FireFox extension for debugging Ajax and DOM. And this one will be used for ColdFusion.

Check it out

Thanks Ray!!!

UPDATE: I forgot to mention Adam Podolnick on the original post. He worked on the Firefox side. Thanks Adam

UKCFUG calling for some drinks!

Reading time: < 1 minute

We’re gonna have some drinks together tonight. If you wanna join us for a whole bunch few drinks, just pop in.

Directions

Older posts

© 2015 Marcos Placona Blog

Theme by Anders NorenUp ↑