What\’s Up

Random Quotes

leave a comment »

Here is a small script that I've used in the online slam book to display random quotes which reads the contents of a file and displays a random quote from it.

<?

$quotesfile = "quotesrandom.txt"; //The file in which all the quotes are stored.

$filecontents = fopen($quotesfile, "r"); // Open the file to read

$quotes = fread($filecontents, filesize($quotesfile)); // Read the file and store the contents of the file in $quotes

fclose($filecontents); // Close the file

if($quotes != "") { // Proceed if the file is not empty

$splitquotes = explode("n", $quotes); // Split the individual quotes into an array, explode using the new line character

$n = count($splitquotes); // Number of quotes available from the file

$quote = rand(0, $n - 1); // Generate a random number

$quote_display = explode("::", $splitquotes[$quote]); // Select a random quote using the random number and split the corresponding quote and author.

}

?>

<? echo $quote_display[0]; ?><div align="right">-<i><? echo $quote_display[1]; ?></i></div>

Here is the general format followed in the text file –

quote1::author1

quote2::author2

quote3::author3

quote4::author4

The symbol used in the file to seperate the quotes and the corresponding author is :: and any other symbol can also be used instead. Each quote is to be present in a new line in the text file.

Written by lokesh

May 14, 2006 at 5:45 am

Posted in PHP

Time Passing Coding

leave a comment »

Long time since I updated my blog. Seems like its become a practice for me to say this everytime :). I've got some good news this time. I've started another blog, the third one which is regarding my fun coding in PHP, AJAX…its all about sharing the knowledge whatever I gained and I'm about to gain and I'm doing it for personal satisfaction.

I've been coding in PHP and AJAX so much since my project review got over and I had lot of fun doing that, days were running like minutes for me and I was so much immersed in it. I was working a lot on the online slam book and yes its over and  I almost launched, but suddenly due to the server problems it has been delayed and now I'm in search of a good hosting which is reliable enough. Whenever I find a host and setup everything to launch the site, suddenly some problem shoots up from the server side, either the server goes down, or suddenly they include some forced ads which ruins the website design and so I start searching for another hosting. This is what is going on and I hope I find a perfect hosting solution soon so that I can unveil the online slam book. 🙂

Written by lokesh

May 13, 2006 at 4:23 pm

Posted in General, Personal

Transloading – Copying Files From Server to Server

with 5 comments

Let me start off the blog with a very good application. Before I got much used to PHP, I was wondering much about transloading which is nothing but copying a file from one server to another. At that time I couldn't find much about it and I really became mad finding how to do that. Well, there is no need for you to become mad 🙂 , here is the code:

<?

if ($transload)

{

if ($_POST[sourceurl] == "")

{

print "Please enter the source URL";

}

else

{

$sourceurl = $_POST[sourceurl];

$newname = $_POST[newname];

copy("$sourceurl", "files/$newname");

$newsize = round((filesize("files/$newname")/1000000), 3);

echo "The file $sourceurl has been successfully transloaded here:

<a href=files/$newname>$newname</a> - $newsize MB";

}

}

else

{

?>

<form action="" method="post">

Source URL: <input type="text" name="sourceurl"><br>

Destination filename: <input type="text" name="newname"><br>

<input type="submit" name="transload" value="Transload">

<?

}

?>

The above code is very useful when files are needed to be transferred while changing hosting provider as it is very fast compared to usual method of downloading and then uploading. 

Written by lokesh

May 13, 2006 at 4:08 pm

Posted in PHP

Howdy!

leave a comment »

Welcome to my 3rd blog on wordpress.com. Yes, this one is my third and its been long time since I thought of starting to blog on all my coding practices. I dint concentrate much on my personal blog and tech blog, but I'm sure posts will be pouring in here, the reason being I spend 75% of a day's time coding in PHP and AJAX.

There might be lot of resources out there related to PHP and AJAX, then why another one, you might ask. Its all for self satisfaction. I've learned many things and I would be very happy if I could share this knowledge with everyone. Someone somewhere might be benefited by this blog and I'm sure I'm doing the right thing of creating a blog to share all the knowledge that I've gained and about to gain. 🙂

Written by lokesh

May 13, 2006 at 3:41 pm

Posted in General

Windows Live Academic Search

leave a comment »

Another Windows Live tool has been released – Windows Live Academic Search

It was released some 2 weeks back. For those who missed to know about this amazing tool – The academic search tool lets you search for all the academic papers submitted by various authors. In case you are doing a project, this live academic search tool is really going to help you a lot.

The interface is done using AJAX and its really quick in finding the papers you need. But the first time you search for something it really takes so much time which is unusual. 

Written by lokesh

April 19, 2006 at 12:04 pm

Google Calendar

leave a comment »


Google Calendar is finally out. Previously it was code named as CL2 and it was the time when some of the screenshots were released. Now Google has finally let out its next tool to compete against Yahoo and Microsoft.

Google Calendar is a free web-based calendar and as usual it is also powered by AJAX, hence giving it a feel of desktop application.

You just need your Google account to use the Calendar application. The Google Calendar application is so advanced compared to Yahoo calendar application. Here is a screenshot the main page of Google Calendar.

You can add events to any time and date and you have a number of useful sub-options that are really handy. Once you create an event you have options to edit all of the event details such as time duration of the event, description of the event, reminder, whether the event detail is private or public etc.

Apart from these there is also one other good feature which is well worth mentioning. You have options to invite guests to any event that you add.

All you have to do is add the email addresses of your guests/friends and they’ll be notified. Thats not it, the system works similar to a poll. The guests can also confirm whether they are attending the event or not.

One feature that I feel is left out is the availability of gmail contacts inside google calendar. It is really annoying to type in the contacts manually. Since its just a beta, I hope many more features will be rolled out soon.

Written by lokesh

April 14, 2006 at 12:22 pm

BarCamp – Chennai

leave a comment »

BarCamp is an unconference born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos and interaction from attendees. The BarCampChennai focusses on Web 2.0, Social Media and Next Generation Internet.”

Now this is a event which I was long awaiting to go for. I thought that these kinds of conferences related to web 2.0, AJAX and other internet technologies used to take place only in countries like US, UK… but to my shock I’m hearing for the first time that such a event is taking place in India and that too in Chennai.

The event focuses mainly on web technologies, where every person attending the event is a participant. unlike other conferences where there are lot of spectators, this even is an unconference where each and everyone actively participates in something or the other. I was very desperate to present some of my experiences with web 2.0 applications & AJAX as soon I came to know about this event. Unfortunately the sign-up for presentations was over by the time I came to know about this event.

The BarCamp is a 2 day event which took place today and yesterday in Anna University. Apart from participating in presentations one can also participate in live blogging and live photo & video-casting of the event. Free wifi was provided so that you can live update your blogs.

This BarCamp takes place all over the world and you can also organize your own BarCamp in you locality. More details here.

I’m quite sad that I was not able to attend such an event which I was longing for, but I’m happy that I came to know about this wonderful event.

One more important thing that I came to know is that how good Indians are at making internet applications. I always had a false belief that in India the internet applications field growth is very slow and that there are very few out there who are interested in such web applications, but this BarCamp has proved that my beliefs are so wrong. Infact I can say that Indian webdevs are really awesome. Want to know why ? Check out these blogs which has the BarCamp events covered…

http://bothack.wordpress.com/

http://www.kiruba.com/

Written by lokesh

April 9, 2006 at 5:29 pm