Tuesday, July 12, 2011

HTML Textarea new line problems with PHP

Many of the beginners face problem with textarea new line. When you save some data in textarea, you may write data beautifully in many lines (by giving {ENTER} key, new line), then when you save the data inside any database, and when you retrive and display that data, you will notice that, all new line startings are lost.

This is because when you press ENTER and give a new line character '\n' character is used inside textarea. But when you print it back, HTML cannot recognize '\n' character. PHP comes with a handy solution for this. There is a function called nl2br(),which replaces all \n characters with <br/> hence all new lines appear in HTML again!
Its not the only solution, you can also use explode function or something similar to find \n and replace it with a <br/> to comply with HTML

echo nl2br("Sachin\nis great");

Sachin<br/>is great

echo nl2br($textarea_data);
will work for textarea data!

Unity 3D handVu Integration Tutorials

Again Im really sorry for taking a long time for releasing this awaited tutorials with all working codes.

Since I dont have web space of my own, I rely on free file hostings, I have uploaded the required files with the mirrors::

Tutorials PDF file:
Full Project (Unity Package File):

Download the PDF file, that contains links of files to be downloaded...

Saturday, July 2, 2011

VLC Current Track to Google Talk Status [VLC2GTalk v1.0 BETA]

I made one small script that checks VLC for the current track and sends this track name to Google Talk so that your google talk status gets updated with the current VLC track. This is similar to plugins available for Google Talk with ITunes, Winamp and so on.

I created this small script because i use VLC, im a music lover, so i listen to songs in 200% volume, which is available in VLC only, so i use VLC and then thought of developing a small script for posting the current track to Google Talk


Here is the download link: (514 KB)

And for coders, here is the source code: http://hobbycoders.com/products/vlc2gtalk/VLC2GTalk.ahk
(Its an AutoHotKey code)

I just checked it and it works, if you find any bugs please post it here, so that we can try to resolve them. This small software will be useful till a good programmer develops a good plugin for VLC GTalk status or Google allows VLC tracks too :)!!

BTW, The only problem with this that i face as of now is, when the song changes, an UI activity is performed, so so, for a moment, the focus is removed from your current focused object. Thats annoying, i know...the next release will be free from these problems

Anyways, if anyone wants to try developing the same. The idea is this:
1. Use high level language to poll VLC process in the system and detect song changes (VLC sets the song name as process title as SONG_NAME - VLC Player :)
2. Google provides codes for jabber client XMPP so that you can directly communicate with Google Talk and set the track as stauts