Archive for June, 2006

UTF-8 Support in PHP and JavaScript

Thursday, June 29th, 2006

When I was developing phpLiveTalk, I wanted to send some URL encoded text in the AJAX response. I encoded the text using urlencode() php function, but the decoding on the client side (JavaScript) was an issue!

Why?

The JavaScript unescape() function does not understand the ‘+’ (Plus) in the encoding of ‘ ‘ (Space). Actually, it should be %20. So why not replacing all the + with %20 then unescape()!!!

Bingo… Solved.

Here’s the code you may use:


message = unescape(replaceAll(message,'+‘,’%20‘));

function replaceAll( str, from, to ) {
    var idx = str.indexOf( from );
    while ( idx > -1 ) {
        str = str.replace( from, to );
        idx = str.indexOf( from );
    }
    return str;
}

Good Luck!

CSS Hacks to customize Input Types independently

Friday, June 23rd, 2006

When I was working on phpLiveTalk, I decided to have a background for the text inputs in forms. I couldn’t find a decent hack to make it work on both IE and Mozilla! So I came out with a solution! Here it is:


input[type="text"], input[type="password"], input[type="file"] {border: solid 1px #336699;
color: #336699;
background-image: url('images/input-text-bg.png');
}

/* this is for IE */
input {
border: expression(this.type=="text" || this.type=="password" || this.type=="file" ? "solid 1px #336699" : "this.border");
color: expression(this.type=="text" || this.type=="password" || this.type=="file" ? "#336699" : "this.color");
_background-image: none;
_background-image: expression(this.type=="text" || this.type=="password" || this.type=="file" ? "url('theme/default/images/input-text-bg.png')" : "this.background-image");
}

Working perfectly…

Go Brazil Go!!!

Sunday, June 18th, 2006

Brazil Rocks (MSN Messenger)

World Cup MSN Messenger Addon

Friday, June 16th, 2006

Hey friends,

I developed a small addon that updates scores of current World Cup matches, and displays them in your MSN Messenger Personnal Message (PSM)…

World Cup MSN Messenger Addon BalloonTip Screenshot

Make sure u give it a shot!

World Cup MSN Messenger Addon

btw, the .Net Framework is required to be able to run it! so download it if the program did not run :)


See ya


Hola amigos,He programado un pequeño addon que actualiza tu mensaje personal con los resultados del Mundial de Fútbol y te lo actualiza regularmente.Captura/Imagen del addon

World Cup MSN Messenger Addon Screen Shot (Spanish)


World Cup MSN Messenger Addon (Spanish)

Nota: necesitas el .Net Framework para que te funcione correctamente, si no lo descargas el programa no te funcionará

Nos vemos

Ephemeral Soul - MaGmA

Monday, June 12th, 2006

3 years ago… We, Magma band, were recording a song to join the anti drugs competition at Peak Hall… We were young, SCHOOl DAYS :D. Anyway, to remember those days, I uploaded the video to YouTube.com (The quality’s not that good…)

http://www.youtube.com/watch?v=CmUPvYRxRcc

Enjoy!!! (Hope so :$)

See ya

phpLiveTalk on sourceforge

Friday, June 9th, 2006

I’ve been working for a while on phpLiveTalk. A cross browser chatting engine developed using AJAX techniques and php/mysql on the server side…

Here’s the development page: http://www.phplivetalk.com

I decided to have a project page on sourceforge.net maybe I can get in touch with few contributors… If you wanna contribute, leave a message.

DEDICATED SERVER WOULD BE VERY HELPFULL (help needed!!!)

see ya later…

Intellij IDEA to ECLIPSE

Friday, June 9th, 2006

As a java developer, I’ve been using Intellij IDEA IDE for about 3 years to manage my java projects. I was quite happy and satisfied with this environment. As a web developer, I’ve been using Macromedia Dreamweaver and it wasn’t bad at all!!!

Suddenly I decided to try Eclipse IDE! WoW is the least I can say. My java and php projects were scrambled… I needed a common environment for all my projects, from web to desktop java applications. Eclipse did the job! PHPEclipse plugin is really great…

If you’re a Java, C++, C#, php, etc… developer make sure you try Eclipse… IT REALLY ROCKS!!

I’m in the middle of my exams, See you soon guys!!