India Vs. Pakistan Cricket

Pocket

India Vs. Pakistan WorldCup 2011-SemifinalMarch 30, 2011 : I am watching India Vs. Pakistan Cricket, semifinal match. The winning team will be playing the final. And I am happy that whoever wins, the worldcup trophy will be in Asia this time for sure. Since the other finalist is Srilanka, who has won with 10 wickets with New Zealand. It’s really getting interesting more and more. And while I was writing this blog, Zahir Khan has returned to the Pavilian, by making 9 runs. Now India seems to get Pressure. Although the score made by India till now, which has crossed 250 runs is enough to put Pakistan team in pressure.

Pakistan is playing very well. This seems to be the most interesting match of this world cup.

India has chosen Power Play. Let’s see who wins the match. I favor no-one just to make this match interesting for myself I have choosen India as my team.

Vimoperator-Vim for Firefox [Addons]

Pocket

What is Vimoperator ?

Vimperator is a Firefox browser extension with strong inspiration from the Vim text editor, with a mind towards faster and more efficient browsing. It has similar key bindings and you could call it a modal web browser, as key bindings differ according to which mode you are in. For example, it has a special Hint mode, where you can follow links easily with the keyboard only. Also most functionality is available as commands, typing :back will go back within the current page history, just like hitting the back button in the toolbar.

However, Vimperator does not try to be a 100% Vim clone, it rather brings Vim’s ideas to the 21st century. This means making use of new graphical capabilities but also of faster computers. Furthermore, great care is taken into making its command line interface more consistent and easier to use, while still being a powerful extension for advanced users.

The above information about vimoperator was copy & paste from the Vim Official Website.

Download :Get Vimoperator Extension for firefox

So you installed the firefox addons vimoperator and stucked how to use it.

After you install the vimoperator, You will find the following changes

  • Menu Bar is gone
  • Navigation toolbar is hidden
  • bookmarks Toolbar is hidden

See the words I used menu bar is totally is gone, they are for purpose. Navigation and bookmarks toolbar can be shown again.

Q. How to Show Navigation Toolbar ?

A. Right-click on the top-right section of the toolbar and select Navigation Toolbar.

Q. How to Show Bookmark Toolbar ?

A. Same as navigation toolbar but this time select Bookmark Toolbar.

Q. How to use Vimoperator ?

A. After you install vimoperator you will get a console at the bottom of the window. We use this console to send command to firefox for carrying out our required operations. Belive me you’ll find it quite interesting once you get used to it.

Like Vim, all commands start with colon(:) followed with some command.

I used [no-space] because my cms would convert : o to smily as :o.

:[no-space]o www.hotmail.com

will open hotmail in your browser. [no-space-here] just remove that line

:emenu File.sa [Tab]

will show some autocomplete options for save and file save as options.

There are many commands we can use with vimoperator To know about more commands Use

:help

followed with the options you want to see help for, and you’ll get list of options that are available to you.

These are features of Vimoperator [Again from Vim Official Website]

  • Ex commands  (:quit) with a proper command line
  • Tab completion available for all commands, showing suggestions while you type
  • Hint mode (start with f to follow a link)
  • Easily customizable GUI (easily hide all GUI elements with :set gui=)
  • Ability to :source JavaScript files, and to use a ~/.vimperatorrc file with syntax highlighting if you install vimperator.vim
  • Easy quick searches (:[no-space]open foo will search for “foo” in google, :[no-space]open ebay terminator will search for “terminator” on eBay) with support for Firefox keyword bookmarks and search engines

Conclusion

For those we are used to with keyboards and especially with vim, will find vimoperator very niffty tool. Since they already know most of the basics of vimoperator. For webdevelopers it is bit harder at begginning and for advanced users (extension developer) there is always place for improvement.


References:
http://vimperator.org/vimperator

[jQuery] Retrieve the Value of Selection Box

Pocket

Here is a simple jQuery tutorial to retrieve the content of the value of Selection Box.

Screenshot of Selection Box Layout

Screenshot of the Selection Box Layout
Screenshot of the Selection Box Layout

Here is the code snippet for the above screenshot.

Create this folder structure, these all are placed in a same folder

CSS [directory]
→  style.css
►  JS [directory]
jquery.js
remote.js
index.html

Jquery
Download jQuery from the jQuery official site http://code.jquery.com/jquery-1.5.1.min.js

Index.html

<!-- Filename : index.html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/remote.js"></script>
<title>Remote Fetch (Ajax)</title>
</head>
<body>
<div id="wrapper">
<form method='post' action='' name='ajaxForm'>
<fieldset>
<legend> Remote Fetch Request</legend>
<p class='clearfix'>
<label for ='Fruits'>Your Favourite Fruit :</label>
<select name='cmbFruits' id="cmb_fruits">
 <option value='1'>Apple</option>
 <option value='2'>Banana</option>
 <option value='3'>Orange</option>
 <option value='4'>Pineapple</option>
</select>
</p>
<p  class='clearfix'>
<label for ='Colors'>Your Favourite Color:</label>
<select name='cmbColors' id="cmb_colors">
 <option value='1'>Blue</option>
 <option value='1'>Green</option>
 <option value='3'>Pink</option>
 <option value='2'>Red</option>
 <option value='4'>Yellow</option>
</select>
</p>
<p><span class='right'>
 <label for="submit"><input type='submit' value="Order Items" name='btnOrder' id="btn_order"></label>
</span>
</p>
</fieldset>

</form>
</div>
</body>
</html>

Here is the stylesheet for the above layout.
Style.css

/* Filename : style.css */
@CHARSET "ISO-8859-1";
body {
	background:#444;
	color:#fff;
	margin:0 auto;
	padding:0;
	font-family:verdana,sans-serif;
	font-size:14px;
}
fieldset {
	margin:0 auto;
	padding:10px;
}
legend {
	padding:4px;
	display:block;
	border:1px solid #ccc;
}

input,select {
	line-height:2;
	width:120px;
	border:1px solid #ccc;
}
p {
	border:0px solid #000;
}
label {
	float:left;
	display:block;
}
select {
	display:block;
	float:right;
}
#wrapper {
	position:relative;
	margin:0 auto;
	padding:0;
	padding-top:15%;
	width:320px;
}
.right {
float:right;

}
input[type=submit] {
	height:30px;
	width:90px;
	text-align:center;
	border:3px solid #fff;
}

/** Clearfix hack */

/* drop the dot, replace with space */
.clearfix:after {
     content: " ";
     display: block;
     height: 0;
     clear: both;
     visibility: hidden;
     }
.clearfix {display: inline-block;}

/* Hides from IE-mac \*/
* html .clearfix {height: 0.5%;}
.clearfix {display: block;}
/* End hide from IE-mac */

jQuery Remote Selection Code

// Wait until DOM is ready
$(document).ready(function(){

	// Wait for change in Fruits
	$("#cmb_fruits").change(function(e){
		value = $(this).val();
		alert(value);
	});
});

[Solved] FAILED ERROR: Magento is already installed

Pocket

Explanation:
We get this error when re-trying to install magento. This happens because magento stores the log of the previous installation date and before carrying out installation process again it checks for previous installations and it does so by checking the date which is stored inside the xml file → app/etc/local.xml.

Code Snippet from local.xml file

<config>
    <global>
        <install>
            <date><![CDATA[Tue, 15 Mar 2011 15:14:24 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[83bf8a0a3ed2788db79e121c00f1cebb]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[root]]></username>
                    <password><![CDATA[]]></password>
                    <dbname><![CDATA[magento]]></dbname>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[db]]></session_save>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

Solutions:
There are two solutions for this problem.

  1. Delete the local.xml file entirely, Re-installation will create this file again.
  2. Edit the file local.xml and delete the date portion (line 4)

Make this portion of code snippet

 <date><![CDATA[Tue, 15 Mar 2011 15:14:24 +0000]]></date>

to look like this, See the difference, I just delete d everything in between CDATA[].

 <date><![CDATA[]]></date>

Re-installing the magento will fill it again. That’s it. Now you should be able to install magento as usual visiting the page http://magentotest.com/magento/install.php

Hope this helps you.