Cousins Night Out


It was really a great night with cousins and friends.
We were playing music and also watching the Cricket Match (India vs Pakistan – India Lost).

 But it was fun talking and dancing and eating yummmyy food…..

we all had a blast, but i would like to share this small video that plays the Birdy Dance Song and we all dancing to its beats… enjoy!!!

Lets all dance on the Oldest and Enjoyable Song – The Birdy Dance

The Birdy Dance – Enjoy it!!

Compress Javascript and CSS Files Using PHP


Enhance your Javascript and CSS resources:

I have been doing some web applications lately, and wanted to compress my Javascript and CSS files so that page loads are quicker and also the files are cached at all times.

So i thought to myself, that we could truncate the JS and CSS files by removing the unwanted spaces and characters.

So i began writing a script that does the following:

  1. Reads JS or CSS files(s) from a particular folder called either js or css.
  2. Removes all the unwanted characters and blank spaces.
  3. Creates a new file in a new directory called js_cache or css_cache.
  4. Wallla!! we have done it, you have successfully reduced the file file size.

The script will allow you to manage easily your Javascript and CSS resources and to reduce the amount of data transferred between the server and the client.

Performances:

We can say that the performance is better but not the best, but it works.

You would see a slight reduce in time between the server and the client.

Restrictions:

In CSS files there are no problems, but in case of Javascript there may some problems where single line comments are used like ‘// comment ‘.

Therefore always use multi line comments like /* comment */ if you want to use this script

Requirements:

  1. Create a folder for you project
  2. Dump all the js files in js folder and css files in css folder
  3. Then create two more folders js_cache and css_cache
  4. Copy and paste this script in the project directory
  5. Edit the script by changing the constant FILE_TYPE as js or css only
  6. Run the script
  7. New files will be created in js_cache and css_cache
  8. Wow, its done now use these file instead of the original one

ALL THE BEST…

HAPPY SCRIPTING…..

Do keep sharing!!!

Download file:

Compress Javascript and CSS Files Using PHP

Bandra Fair 2009 – Mount Mary


mount mary church

mount mary church

The Basilica of Our Lady of the Mount, more commonly known as Mount Mary, is a Roman Catholic church in the city of Mumbai, India.

The church is one of the most visited churches in the city located in the suburb of Bandra. Every September, the feast of St. Mary is celebrated on the Sunday following 8 September, the birthday of the Virgin Mary. This is a week long celebration known as the Bandra Fair and is visited by thousands of people.

The church stands on a hillock about 80 metres above sea level overlooking the Arabian Sea. It draws lakhs of devotees and pilgrims annually. Many faithful attest to the miraculous powers of St. Mary.

During the Bandra Fair, tens of thousands visit the shrine. The shrine attracts people from all faiths who pray to the statue for thanksgiving or requesting of favors.

In 1760, the church was rebuilt and the statue was substituted with a statue of Our Lady of Navigators in St. Andrew’s church nearby.

This statue has an interesting legend. It goes that a Koli fisherman dreamt that he would find a statue in the sea. The statue was found floating in the sea between 1700 and 1760. A Jesuit Annual Letter dated to 1669 and published in the book St. Andrew’s Church, Bandra (1616–1966) supports this claim.

The Bandra Fair 2009

This is the most awaited event of the year is come up. Popularly known as the Bandra Fair, the festival is celebrated on Mother Mary’s birth anniversary and people of all faiths throng to seek her blessing.

The streets take on a carnival-like atmosphere, with shops and mini-bazaars offering everything from food (yummy), shopping opportunities (@ good prices) and joyrides (super enjoyment).

Street plays, musical concerts, book readings and food festivals also become a part of the celebrations.

2009 : This year the fair starts from 13th Sunday 2009 to 20th Sunday 2009, Its basically for one week.

Also check my new post for: Bandra Fair 2010 Mount Mary.

Basic AJAX (Asynchronous JavaScript and XML)


Ajax, sometimes written as AJAX (shorthand for asynchronous JavaScript and XML), is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications.

With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page.


/**
* Declare global variable....
* @param string elementName this is to identify the elemnt in which the response should be dispalyed. like as div id (required)
*/
var elementName = "";

/**
* Open a connection to the specified URL, which is
* intended to provide an XML message. The specified data
* is sent to the server as parameters. This is the same as
* calling xmlOpen(“POST”, url, toSend, responseHandler).
*
* @param string url The URL to connect to.
* @param string toSend The data to send to the server; must be URL encoded.
* @param function responseHandler The Javascript function handling server response.
* @param function elementIdentify The elemnt in which the response should be dispalyed.
*/
function xmlPost(url, toSend, responseHandler, elementIdentify)
{
elementName = elementIdentify;
xmlOpen(“POST”, url, toSend, responseHandler);
}

/**
* Open a connection to the specified URL, which is
* intended to provide an XML message. No other data is
* sent to the server. This is the same as calling
* xmlOpen(“GET”, url, null, responseHandler).
*
* @param string url The URL to connect to.
* @param function responseHandler The Javascript function handling server response.
* @param function elementIdentify The elemnt in which the response should be dispalyed.
*/
function xmlGet(url, responseHandler, elementIdentify)
{
elementName = elementIdentify;
xmlOpen(“GET”, url, null, responseHandler);
/**
* This code can be used if you need to call the required function after every interval i.e seconds..
* setTimeout(“xmlGet(‘products.php’, notesResponseHandler)”,3000);
* setTimeout(“alert(‘products.php’)”,3000);
*/
}

/**
* Open a connection to the specified URL, which is
* intended to respond with an XML message.
*
* @param string method The connection method; either “GET” or “POST”.
* @param string url The URL to connect to.
* @param string toSend The data to send to the server; must be URL encoded.
* @param function responseHandler The Javascript function handling server response.
*/
function xmlOpen(method, url, toSend, responseHandler)
{
// alert(url);
if (window.XMLHttpRequest)
{
// browser has native support for XMLHttpRequest object
req = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
// try XMLHTTP ActiveX (Internet Explorer) version
req = new ActiveXObject(“Microsoft.XMLHTTP”);
}

if(req)
{
req.onreadystatechange = responseHandler;
req.open(method, url, true);
req.setRequestHeader(“content-type”,”application/x-www-form-urlencoded”);
req.send(toSend);
}
else
{
alert(‘Your browser does not seem to support XMLHttpRequest.’);
}
}

/**
* Handler for server’s response to notes.xml request.
* Notes are pulled from notes.xml and replace the
* contents of the DIV with id ‘notesSection’.
*/
function notesResponseHandler()
{
// Make sure the request is loaded (readyState = 4)
if (req.readyState == 4)
{
// Make sure the status is “OK”
if (req.status == 200)
{
var swappableSection = document.getElementById(elementName);
var str = req.responseText;
swappableSection.innerHTML = str;
}
else
{
alert(“There was a problem retrieving the XML data:\n” +
req.statusText);
}
}
}

/**
* When a file gets included in the page….
* Call the function on load or on click….
*/
//xmlGet(‘products.php’, notesResponseHandler);
//alert(‘called’);

XML-RPC


XML-RPC and XML-RPC Server Classes

What is XML-RPC?

Quite simply it is a way for two computers to communicate over the internet using XML. One computer, which we will call the client, sends an XML-RPC request to another computer, which we will call the server. Once the server receives and processes the request it will send back a response to the client.

For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will send a request to an XML-RPC Server running on your site. This request might be a new weblog entry being sent for publication, or it could be a request for an existing entry for editing. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. Once processed, the server will then send back a response message.

For detailed specifications, you can visit the XML-RPC site: http://www.xmlrpc.com/

This can be easily implemented using CodeIgniter’s framework: http://codeigniter.com/

CodeIgniter’s XML-RPC classes permit you to send requests to another server, or set up your own XML-RPC server to receive requests. Overview XML-RPC is a Remote Procedure Calling protocol that works over the Internet.

http://www.codeignitor.com/user_guide/libraries/xmlrpc.html

An XML-RPC message is an HTTP-POST request. The body of the request is in XML. A procedure executes on the server and the value it returns is also formatted in XML. Procedure parameters can be scalars, numbers, strings, dates, etc.; and can also be complex record and list structures.

XML-RPC Specification : http://www.xmlrpc.com/spec