Pranav Mistry: Master of SixthSense Technology
Posted in Technical | Tags: SixthSense, Technology
Basic Questions on PHP Part2
Posted in PHP
I Love Firefox

Posted in Myidea
Credit Card Traps
The credit card is one of the very good facilities offered by banks. But some times this facility becomes a hassle for you and you feel like trapped. I’ve been through same kind of experience last month.Posted in Myidea
AJAX Request Using YUI
<html>
<head>
<title>Simple Ajax Request</title>
<script type=”text/javascript” src=”http://yui.yahooapis.com/2.7.0/build/yahoo/yahoo-min.js”></script>
<script type=”text/javascript” src=”http://yui.yahooapis.com/2.7.0/build/event/event-min.js”></script>
<script type=”text/javascript” src=”http://yui.yahooapis.com/2.7.0/build/connection/connection-min.js”></script>
</head>
<body>
<h1>Simple Example of creating Ajax Request</h1>
<script>
//The callback function:
var callback = {
success: function(a){
//Assign the resonse to the HTML element
document.getElementById(‘response’).innerHTML = a.responseText;
},
failure: function(a){
//Alert the failure message
alert(a.statusText);
}
}
//Make the Ajax request:
function ajaxRequest(){
var newRequest = YAHOO.util.Connect.asyncRequest(‘GET’, ‘Request/Url’, callback);
}
</script>
<!–The div element in which the resonse will be shown –>
<div id=”response”></div>
<input type=”button” value=”Create Request” onClick=”ajaxRequest();”>
</body>
</html>
Hope this example helped in better understanding of Ajax using YUI.
Posted in YUI
YUI Profiler
The HTML part will display a button “Create Profile”. Clicking on that button will generate the report of the pObject.sayHello() function call and display the result in the div with id “p_report”.
This is just an example of how to use YUI code profiler. Hope this will help creating code profiles.
Posted in YUI
Badi Mushkil se Duniya me Dost Milte Hai….
This is a line of a famous Hindi song by Kishor Da. This line completely fits to my friends.
My father got a major heart attack and I was in Bangalore. I had to rush to my native place, Kanpur. Before leaving, I just informed one of best friend around me about my arrival. I informed other and he booked the flight ticket on-line. I reached Delhi then from there I took train and reached Kanpur. I was trying to grab an auto, but what I saw another friend already waiting for me. He took me directly to the hospital where papa was admitted. Within half an hour all my true friends gathered at the hospital and offered to stay there for any kind of requirement.
We 5 guys stayed at the hospital for full 7 nights without a single nap for a single minute. In that span of time all of them slept just for 2-3 hours in day time. Although all of them were very busy in there work schedule and one of them was fasting for 8 days due to Navrata, they took care of my dad with me. Although they are not strong financially, they offered the financial support. But at that time I required moral support very badly which they provided just by their presence.
Now my dad is out of danger and about to be released from the hospital within 2-3 days. After being assured about papa’s health, I came back to Bangalore, but friends are still there supporting my family. I will not give thanks to them for their efforts but will pray to God to make me available whenever any of my friends seeks my presence.
Posted in Personal
Funny things about Ghajini:
Amir Khan’s latest released movie Ghajini is the biggest Bollywood hit of the year 2008. I have seen the movie and appreciated a lot. I could find good humor in the happy part of the movie. but the kids of this generation are smarter and more humorous than the adults. Want to know how? Just read below….

Humor in Ghajini
Posted in Personal
Zend Framework:: Helper method for creating breadcrumbs
Here I am going to show how one can create breadcrumbs in the web application based on Zend Framework. This can be achieved by creating a helper method. Before creating helper method, we need to do the following exercise:
- Create Zend view object,
- Add view script path,
- Add the default helper path to the view object,
Now lets start step by step:
Creating Zend view object:
$view = Zend_View();
Adding view script path:
$viewPath = “path/to/viewsDirectory”;
$view->addScriptPath($viewPath);
Adding the default helper path to the vew object:
$helperPath = “path/to/helperDirectory”; Zend_Controller_Action_HelperBroker::getStaticHelper(‘viewRenderer’)->setView($view);
$view->addHelperPath($helperPath, ‘Helper_’);
Now creating the class for the breadcrumbs:
class Helper_BreadCrumbs {
public function breadCrumb(){
$cFront = Zend_Controller_Front::getInstance();
$module = $cFront->getRequest()->getModuleName();
$module = strtolower($module);$controller = $cFront->getRequest()->getControllerName();
$controller = strtolower($controller);$action = $cFront->getRequest()->getActionName();
$action = strtolower($action);if($module == “default” && $controller == “index” && $action == “index”){
return;
}
//Home link
$home = ‘<a href=”/”>Home</a>’;//start breadcrumbs
$bCrumbs = $home . “::”;
if($action == “index”){
$bCrumbs .= $controller;
}
else{
$bCrumbs .= “<a href=’/$controller’>$controller</a>::
<a href=’/$controller/$action’>$action</a>”;
}return $bCrumbs;
}
}
Hope this article will help the web application users to indicate “where are you”.
Posted in Zend Framework
Zend Framework:: Caching the database query results
Caching is basically used to improve the performance of the application. Your application may consists of multiple expensive queries ruining the application performance. The Zend_Cache component of Zend Framework provides a good feature to improve the page performance by caching the database query results. Here is the sample code :
// Creating the cache options
$frontend = array(
‘lifetime’ => 86400, // cache lifetime of 24 hours (time is in seconds)
‘automatic_serialization’ => true //default is false
);$cachedir = /path/to/cacheDirectory;
if(!is_dir($cachedir)){
mkdir($cachedir,0755);
}$backend = array(‘cache_dir’ => $cachedir);
// Getting a Zend_Cache_Core object
$zend_cache = Zend_Cache::factory(‘Core’, ‘File’, $frontend, $backend);$result = run_query($zend_cache);
print_r($result);function run_query($cacheObj){
$q = “Database query”;
if(!$result = $cacheObj->cache->load(“myresult”)){
$db = Zend_Db::factory(DB_connection_parameters);
$result = $db->fetchAll($q);
$cacheObj->save($result, “myresult”);
}
else {
echo “This result is from cache.”;
}
return $result;
}
Caution: You should give the unique name in the “load(‘name’) and save(‘name’)” functions.
Otherwise you will get the same result on the pages where the query is intended to produce
different results.
Posted in Zend Framework