tag:blogger.com,1999:blog-26258419849738984342024-02-07T09:23:18.439+05:30Mahesh Babu. BokkisamHi My name is Mahesh Babu. Bokkisam, I am working for <a href="https://www.infinite.com/">ICS</a> as Technical Lead, Bengaluru, INDIA.
<br>
I have total 12+ years of experience in IT with different technologies like PHP, MySQL, Angular, React, Knockout, MongoDB.
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.comBlogger42125tag:blogger.com,1999:blog-2625841984973898434.post-30831074649997782292014-02-28T18:11:00.004+05:302020-07-26T12:44:57.916+05:30Create Virtual Host in IIS Server<div dir="ltr" style="text-align: left;" trbidi="on">
<b>1)</b> Open Command Prompt using Administrative Rights<br />
<br />
<b>2)</b> Flush the cache of ARP (Address resolution protocol)<br />
<b><span style="color: #0c343d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>a) C:\Windows\system32></span><span style="color: #4c1130;">netsh interface ip delete arpcache</span></b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #0c343d;">b) C:\Windows\system32></span><span style="color: #4c1130;">arp -a</span></b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<b>3)</b> Open IE (Internet Explorer)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>a)</b> Open Internet Options window from settings<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>b)</b> Click on Connections Tab -> Click on LAN Settings button<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>c)</b> Uncheck all checkbox but make sure to check the "Bypass proxy server for local address."<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSFj7Q5gp1rXDTaOxh8phN3KIRpxHC6uZDFjkIyGus_4-RXJ6FXugjS5sBP-bQ96JE8FrqjNFMWeIpGE7Yx0cL1oEwEMg28vskI7vXtGWBdSPc2KgokH3i4RRoBk2ooEd7Q2Hho51T4Tko/s1600/IE_IO_LAN_settings.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSFj7Q5gp1rXDTaOxh8phN3KIRpxHC6uZDFjkIyGus_4-RXJ6FXugjS5sBP-bQ96JE8FrqjNFMWeIpGE7Yx0cL1oEwEMg28vskI7vXtGWBdSPc2KgokH3i4RRoBk2ooEd7Q2Hho51T4Tko/s1600/IE_IO_LAN_settings.jpg" height="640" width="337" /></a></div>
<br />
<b>4)</b> Open Hosts file from C:\Windows\System32\drivers\etc Folder (Make sure is it have write permission)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>It will look like this<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<b><span style="color: #660000;"><span class="Apple-tab-span" style="white-space: pre;"> </span># localhost name resolution is handled within DNS itself.</span></b><br />
<b><span style="color: #660000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#<span class="Apple-tab-span" style="white-space: pre;"> </span>127.0.0.1 localhost</span></b><br />
<b><span style="color: #660000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#<span class="Apple-tab-span" style="white-space: pre;"> </span>::1 localhost</span></b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Add these lines at bottom of this file (You can add multiple names)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<b><span style="color: #660000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>127.0.0.1<span class="Apple-tab-span" style="white-space: pre;"> </span>mysite.com</span></b><br />
<b><span style="color: #660000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>127.0.0.1<span class="Apple-tab-span" style="white-space: pre;"> </span>maheshbokkisam.com</span></b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<b>5)</b> Now check is these virtual host/domain names are working<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>a)</b> Go to Command Prompt and run this commands<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>5.a.1)<span style="color: #783f04;"> ping mysite.com</span></b> (check is this pinging to 127.0.0.1 or not)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>5.a.2)</b> <span style="color: #783f04;"><b>tracert mysite.com</b></span> (check is mysite.com is tracing to 127.0.0.1)<br />
<br />
<b>6)</b> Now open IE (Internet Explorer) OR any browser<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>type in address bar for first time like <span class="Apple-tab-span" style="white-space: pre;"> </span><b><span style="color: #274e13;">http://mysite.com:80</span></b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>It will show default localhost files (<b>C:\inetpub\wwwroot</b>)<br />
<br />
<b>7)</b> Now Create folder in any Driver<br />
<br />
<b>8)</b> Open IIS Manager<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>a)</b> Click on Add Website from Connections<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>b)</b> add sitename as mysite.com(your custom domain name)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>c)</b> Select your Physical Path (You can select existed one or you can create New Folder)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>d)</b> Open Bindings from Actions and check is you domain is present, if not then add<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI_4ir6DA_ckNKQsAlVWaBvbqasYq12l4l35U3tXlxqbcT7CZD4lTfY2EOjutRxCK9YCUY9wvOsgbeAIjMzLFI8Ly2SGOqLqcM5yeWMWgdIRjfDQl7Aa2RFJ0FPtkv9BXSqAkJyMUIpMJk/s1600/IIS_virtual_host_name.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI_4ir6DA_ckNKQsAlVWaBvbqasYq12l4l35U3tXlxqbcT7CZD4lTfY2EOjutRxCK9YCUY9wvOsgbeAIjMzLFI8Ly2SGOqLqcM5yeWMWgdIRjfDQl7Aa2RFJ0FPtkv9BXSqAkJyMUIpMJk/s1600/IIS_virtual_host_name.jpg" height="470" width="640" /></a></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<br />
<b>9)</b> Now Restart your IIS server OR your domain<br />
<br />
<b>10)</b> Open browser and access you virtual host (domain name)<br />
<br />
<b><span style="color: red;">NOTE:</span></b><br />
If the virtual host/website is not working in <b><span style="color: red;">IE</span></b> and is working in <span style="color: #274e13;"><b>Firefox browser</b></span>, then do these changes<br />
<br />
1) Fix it by adding the necessary URLs to the list of <b>“Local intranet”</b> sites in Internet Explorer.<br />
<br />
2) Go to<br />
<b> “Internet Options”</b>, under the <b>“Security”</b> tab,<br />
select <b>“Local intranet”</b>,<br />
and then click the <b>“Sites”</b> button near the top.<br />
<br />
3) In the window that opens,<br />
click the <b>“Advanced”</b> button, and<br />
add <b>websites</b> to this zone,<br />
and then they seem to work locally.<br />
4) This might be a simpler option for someone who only needs to access a few URLs locally.</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-69263154121463230892014-02-26T15:33:00.001+05:302014-02-26T15:34:21.988+05:30Find the php.ini or php installed path in windows from command line prompt<div dir="ltr" style="text-align: left;" trbidi="on">
How to find .ini file OR php path OR php version OR any other details of PHP.<br />
<br />
If you installed <b>PHP</b> in windows directly or using webplotform installer.<br />
<br />
Open command prompt and go to C Drive type<br />
<br />
<b>C:\> php -v</b><br />
<b><br /></b>
The result will be like this in my system, it may differ to you based on PHP version<br />
<br />
PHP 5.4.24 (cli) (built: Jan 8 2014 20:26:10)<br />
Copyright (c) 1997-2013 The PHP Group<br />
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies<br />
<br />
<b>C:\>php --ini</b><br />
<b><br /></b>
Configuration File (php.ini) Path: C:\Windows<br />
Loaded Configuration File: C:\Program Files (x86)\iis express\PHP\v5.4\php.ini<br />
Scan for additional .ini files in: (none)<br />
Additional .ini files parsed: (none)<br />
<br />
If you want search/find using particular key word you can use this command<br />
<br />
<b>C:\>php -i | findstr php.ini</b><br />
<b><br /></b>
Configuration File (php.ini) Path => C:\Windows<br />
Loaded Configuration File => C:\Program Files (x86)\iis express\PHP\v5.4\php.ini<br />
<br />
<b>C:\>php -i | findstr version</b><br />
<b><br /></b>
System => Windows .........<br />
iconv library version => 1.14<br />
json version => 1.2.1<br />
libmbfl version => 1.3.2<br />
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.<br />
Multibyte regex (oniguruma) version => 4.7.1<br />
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: 2d.............. $<br />
Client API library version => mysqlnd 5.0.10 - 20111026 - $Id: 2d........ $<br />
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: 2d................$<br />
Phar EXT version => 2.0.1<br />
Phar API version => 1.1.1<br />
core library version => xmlrpc-epi v. 0.51<br />
php extension version => 0.51<br />
Zip version => 1.11.0<br />
Libzip version => 0.10.1<br />
<br />
<br /></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-30067125107122410942014-02-17T23:41:00.001+05:302014-02-17T23:41:27.714+05:30AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<i><span style="color: #274e13;">AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes</span></i><br />
<br />
If you get error like this while Installing <span style="color: orange;">Windows 8.1</span> as guest OS using <span style="color: #783f04;">Oracle VirtualBox</span>/VirtualMachine<br />
<br />
Then check your RAM Allocation for the Guest OS.<br />
<br />
Example: First time i gave <b><span style="color: #783f04;">5120 (5 GB) of RAM</span></b> for Guest OS.<br />
<br />
while installing i got the error like this in log file<br />
<br />
<b><span style="color: #660000;">AIOMgr:</span></b> <b style="background-color: white;"><span style="color: #4c1130;">Preparing flush failed with </span><span style="color: #274e13;">VERR_NOT_SUPPORTED</span><span style="color: #4c1130;">, disabling async flushes.</span></b><br />
<b style="background-color: white;"><span style="color: #4c1130;"><br /></span></b>
<span style="background-color: white;">Now i changed the <span style="color: #660000;"><b>RAM</b> </span>size to<b><span style="color: #660000;"> 4096(4 GB)</span></b>, now the error gone, the guest OS installed successfully.</span><br />
<span style="background-color: white;"><br /></span>
<span style="background-color: white;">My Suggestion is to set <b>RAM</b> size in <b>EVEN</b> for this kind of errors.</span></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-65915849459314990422014-02-17T22:50:00.003+05:302014-02-17T22:50:34.070+05:30AJAX log of Downloading Windows 8.1 os using Akamai netsession interface control panel<div dir="ltr" style="text-align: left;" trbidi="on">
For every one sec (Akamai netsession interface control panel)<br />
<br />
<b><span style="color: #20124d;">Request</span></b> URL:http://127.0.0.1:9421/api?cid=0&function=getFileAttributes&complete&url=http%3A%2F%2Fcare.dlservice.microsoft.com%2Fdl%2Fdownload%2FB%2F9%2F9%2FB999286E-0A47-406D-8B3D-5B5AD7373A4A%2F9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO&wrapper=DLMHelper.dispatchResponse(0,%20%27UPDATE%27,*);&r=0.02329613664187491<br />
<br />
<b><span style="color: #20124d;">RESPONSE</span></b><br />
DLMHelper.dispatchResponse(<br />
0,<br />
'UPDATE',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"http://care.dlservice.microsoft.com/dl/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO":<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"status":"DOWNLOADING",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"dontshare":false,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"peerratio":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"maxdownloadrate":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"suberror":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"peerrecv":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"path":"D:/Softwares/microsoft/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO.part",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"size":3797866496,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"useCustomerOrigin":false,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"totalrecv":1432227763,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"errorstring":"",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"originurl":"http://care.dlservice.microsoft.com/dl/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"unpausable":false,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"progress":1425456128,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"resetdownload":false,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"peersent":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"error":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"verifiedcontentmd5":"",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"cid":0,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"verifiedcontenthash":"",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"downloadrate":2045559,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"localurl":"http://127.0.0.1:9421/api?function=serveFile&cid=0&url=http%3a%2f%2fcare.dlservice.microsoft.com%2fdl%2fdownload%2fB%2f9%2f9%2fB999286E-0A47-406D-8B3D-5B5AD7373A4A%2f9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"uniquerecv":1432223744,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"contenttype":"application/octet-stream",<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"maxuploadrate":0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
);</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-56705201013502303012014-02-11T17:19:00.001+05:302014-02-11T17:19:46.144+05:30Setup environment for PhoneGap android with eclipse in Windows 7/8<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #073763;">1) Download </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #741b47;">a) JAVA from <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">http://www.oracle.com/technetwork/java/javase/downloads/index.html</a></span><br />
<span style="color: #741b47;"><br /></span>
<span style="color: #741b47;"><span class="Apple-tab-span" style="white-space: pre;"> </span>b) APACHE ANT from <a href="http://ant.apache.org/bindownload.cgi">http://ant.apache.org/bindownload.cgi</a> (under Current Release of Ant)</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #741b47;"> </span></span><br />
<span style="color: #741b47;"><span class="Apple-tab-span" style="white-space: pre;"> </span>c) ANDROID SDK from <a href="https://developer.android.com/sdk/index.html#ExistingIDE">https://developer.android.com/sdk/index.html#ExistingIDE</a></span><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #3d85c6;">* This will contain </span><br />
<span style="color: #3d85c6;"><span class="Apple-tab-span" style="white-space: pre;"> </span>* Eclipse + ADT Plugin</span><br />
<span style="color: #3d85c6;"><span class="Apple-tab-span" style="white-space: pre;"> </span>* Android SDK Tools</span><br />
<span style="color: #3d85c6;"><span class="Apple-tab-span" style="white-space: pre;"> </span>* Android Platform-tools</span><br />
<span style="color: #3d85c6;"><span class="Apple-tab-span" style="white-space: pre;"> </span>* The latest Android platform</span><br />
<span style="color: #3d85c6;"><span class="Apple-tab-span" style="white-space: pre;"> </span>* The latest Android system image for the emulator</span><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #741b47;">d) If you want new version of Eclipse you can download from <a href="https://www.eclipse.org/downloads/">https://www.eclipse.org/downloads/</a></span><br />
<br />
<span style="color: #073763;">2) Install all Software.</span><br />
<br />
<span style="color: #073763;">3) Now we will Set up environment variables</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #741b47;">* Follow the bellow images</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0jY0uaigVlvByQnwcoVBLBX-SZhqODF4G6JZZrt6IpDG7a5ai21COSwa5xNABc8cWVHEbIH2Ztmd5S_uJAhTFXwJ6tIfkytyKe35ctsyCQ5fl8a67a11ny2wmjHqIzcashdYlsJ2Mh2GC/s1600/phonegap_image_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0jY0uaigVlvByQnwcoVBLBX-SZhqODF4G6JZZrt6IpDG7a5ai21COSwa5xNABc8cWVHEbIH2Ztmd5S_uJAhTFXwJ6tIfkytyKe35ctsyCQ5fl8a67a11ny2wmjHqIzcashdYlsJ2Mh2GC/s1600/phonegap_image_1.png" height="274" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1qyDswlXBG26VDB6zm6BdW41bRrH8wQy3alOb5ABhu7-OjQIEteh4foRRGYMrrypct17rZ2ZGJ-tBJewMC4T0x0ONjcuvQcHRe7Z18srXaHI4gSXxIWOlChF0JZq1if_TI2w-Zuu3dLGz/s1600/phonegap_image_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1qyDswlXBG26VDB6zm6BdW41bRrH8wQy3alOb5ABhu7-OjQIEteh4foRRGYMrrypct17rZ2ZGJ-tBJewMC4T0x0ONjcuvQcHRe7Z18srXaHI4gSXxIWOlChF0JZq1if_TI2w-Zuu3dLGz/s1600/phonegap_image_2.png" height="358" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEins7a7A2360kM32wkpk3XqhfA2Cr_2gbNwajc4zXz-SJcv7KylwQkAuxdeoVCVwdiYc6DWAcoHE8OByP6xdfwMcaooTjxdBsrj-H10QNI48_wYT3-2YpwSm9ZggM9ilmPflmQjTO3WJqbS/s1600/phonegap_image_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEins7a7A2360kM32wkpk3XqhfA2Cr_2gbNwajc4zXz-SJcv7KylwQkAuxdeoVCVwdiYc6DWAcoHE8OByP6xdfwMcaooTjxdBsrj-H10QNI48_wYT3-2YpwSm9ZggM9ilmPflmQjTO3WJqbS/s1600/phonegap_image_3.png" height="400" width="358" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Under User variables for {YOUR NAME}</span><br />
<span class="Apple-tab-span" style="color: #e06666; white-space: pre;"> </span><span style="color: #38761d;">JAVA_HOME C:\Program Files\Java\jdk1.7.0_51\</span><br />
<span style="color: #e06666;"> </span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Under System variables</span><br />
<span class="Apple-tab-span" style="color: #e06666; white-space: pre;"> </span><span style="color: #38761d;">ANDROID_HOME E:\Downloads\adt-bundle-windows-x86_64-20131030\sdk </span><br />
<span style="color: #e06666;"> (This is my source path)</span><br />
<span style="color: #e06666;"><br /></span>
<span class="Apple-tab-span" style="color: #e06666; white-space: pre;"> </span><span style="color: #38761d;">ANT_HOME C:\apache-ant-1.9.3 (This is my source path)</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>PATH {Here already have some variables along with we need add these};C:\Program Files\Java\jdk1.7.0_51\bin;C:\Program Files\Java\jre7\bin;C:\Program Files (x86)\Java\jre7\bin;%ANT_HOME%\bin;</span><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #e06666;">If you are using 64 bit OS then look for java in</span> <span style="color: #93c47d;">C:\Program Files (x86)\Java\ and C:\Program Files\Java\<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #e06666;">After set up env variables check for is java and apache ant are working fine</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Open command prompt and type bellow command</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span style="color: #bf9000;"> C:\> java</span><br />
<span style="color: #bf9000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>here you can see all parameters.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #bf9000;"> </span></span><br />
<span style="color: #bf9000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>C:\>ant</span><br />
<span style="color: #bf9000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Buildfile: build.xml does not exist!</span><br />
<span style="color: #bf9000;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Build failed</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #e06666;">Don't worry Apache Ant set successfully </span><br />
<span style="color: #e06666;"> </span><br />
<span style="color: #e06666;">5) Now install ADT Plugin in eclipse (If you installed eclipse as per (d), other wise check the installed software's in eclipse )</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexRY3jNACzS4Cf6-q_ybOfpLFpP64I1ltOIDqAMg6LEcG9B7NPXD9kYgim56cc6MxxPpAGSAKeXCTdpkJlHGgbZ8WX6lJh6fYL4ZPWZo_GcFUa12xPv9Cd0dd6w-RnLXOCfQiScyMXmxR/s1600/phonegap_image_4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexRY3jNACzS4Cf6-q_ybOfpLFpP64I1ltOIDqAMg6LEcG9B7NPXD9kYgim56cc6MxxPpAGSAKeXCTdpkJlHGgbZ8WX6lJh6fYL4ZPWZo_GcFUa12xPv9Cd0dd6w-RnLXOCfQiScyMXmxR/s1600/phonegap_image_4.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtoCi5GG5z82wp41kMCXBMrFy1RzxpNCc9-VeS5dWSjtSwWLWXBUpi0c2xKNr1E3E1EGzznDeYYdJroZtNjxN00pgNayaJNztGQkBrb4TGAIebsrDyJxp4ypI9X93IKhAwyfhGhMZ2at1Q/s1600/phonegap_image_5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtoCi5GG5z82wp41kMCXBMrFy1RzxpNCc9-VeS5dWSjtSwWLWXBUpi0c2xKNr1E3E1EGzznDeYYdJroZtNjxN00pgNayaJNztGQkBrb4TGAIebsrDyJxp4ypI9X93IKhAwyfhGhMZ2at1Q/s1600/phonegap_image_5.png" height="500" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #e06666;">Download the ADT Plugin</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Start Eclipse, then select Help > Install New Software.</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Click Add, in the top-right corner.</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="https://dl-ssl.google.com/android/eclipse/">https://dl-ssl.google.com/android/eclipse/</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span style="color: #e06666;"> Click OK.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> If you have trouble acquiring the Plugin, try using "http" in the Location URL, instead of "https"</span><br />
<span style="color: #e06666;"> (https is preferred for security reasons).</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> In the Available Software dialog, select the checkbox next to Developer Tools and click Next.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> In the next window, you'll see a list of the tools to be downloaded. Click Next.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> Read and accept the license agreements, then click Finish.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> If you get a security warning saying that the authenticity or validity of the software can't be</span><br />
<span style="color: #e06666;"> established, click OK.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"> When the installation completes, restart Eclipse.</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>For more information fallow this URL</span> <a href="http://developer.android.com/sdk/installing/installing-adt.html">http://developer.android.com/sdk/installing/installing-adt.html</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span style="color: #e06666;">6) Close and open Eclipse</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Now you will prompt with an alert box to set the Android SDK path. Set that</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;">7) Download phonegap from <a href="http://phonegap.com/install/">http://phonegap.com/install/</a></span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>You can use npm install if you already installed Node.js in your system. Other wise download latest zip file</span><br />
<span style="color: #e06666;"><br /></span>
<span style="color: #e06666;">8) Now create new android project</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>a) Follow these images</span><br />
<span style="color: #e06666;"><br /></span>
<span style="color: #e06666;"> </span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoLAedbOGu1ZWTMkrPXlOdH0OpPzRFhn0Sk3NwSeuzno90FGY09N09GNyxoV2LmKkJz0LeX-U4RSbiBBx504Ep-QQiTlb0wrlzFCyUrmuvqoOsc590y7-gsb1ysJtRs0XrEenRC8PIxvxz/s1600/phonegap_image_7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoLAedbOGu1ZWTMkrPXlOdH0OpPzRFhn0Sk3NwSeuzno90FGY09N09GNyxoV2LmKkJz0LeX-U4RSbiBBx504Ep-QQiTlb0wrlzFCyUrmuvqoOsc590y7-gsb1ysJtRs0XrEenRC8PIxvxz/s1600/phonegap_image_7.png" height="640" width="624" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;">Click on New->Project->Select Android->new</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgpRtLiYUwWVtFeymWmjYoSNF3jlRKBV8DP5ArnvthZUv0ozv5IXRKL4qkOt3kfMtjU1G5e_7KTF_gYRpNHWcjd2koQx_c0VmhlhRH497BrVwU_G-2xvA1Cu1nkwhdZoxjrPKF1SYj54c7/s1600/phonegap_image_8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgpRtLiYUwWVtFeymWmjYoSNF3jlRKBV8DP5ArnvthZUv0ozv5IXRKL4qkOt3kfMtjU1G5e_7KTF_gYRpNHWcjd2koQx_c0VmhlhRH497BrVwU_G-2xvA1Cu1nkwhdZoxjrPKF1SYj54c7/s1600/phonegap_image_8.png" height="550" width="640" /></a></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3UPlC_z3SssuM6gV9BCqNNAdvwSgIK8jWL2i6d-YSybQD0_ajk0hQf0GMomch2E-65PrcdDq85ej5S8PLQG6I1gd6SsUr7oHNk2jyX6lDNjlZWhU2TVkHsASyp09CJmEHjwq8-tc-fTwA/s1600/phonegap_image_11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3UPlC_z3SssuM6gV9BCqNNAdvwSgIK8jWL2i6d-YSybQD0_ajk0hQf0GMomch2E-65PrcdDq85ej5S8PLQG6I1gd6SsUr7oHNk2jyX6lDNjlZWhU2TVkHsASyp09CJmEHjwq8-tc-fTwA/s1600/phonegap_image_11.png" height="572" width="640" /></a></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Xg_rRAdzMsbE1cU1F41oF-ehnkBUTCdTjWwF6aThKFJLP3skOXTDRZMrz_kswPLN5iqIum8jJvp0oNmzP-OPZQBlx-9_0i6L9B65lJS2TXyWSXHJK2yz2FUZeQ55tFBqEoKItr8bSPnL/s1600/phonegap_image_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-Xg_rRAdzMsbE1cU1F41oF-ehnkBUTCdTjWwF6aThKFJLP3skOXTDRZMrz_kswPLN5iqIum8jJvp0oNmzP-OPZQBlx-9_0i6L9B65lJS2TXyWSXHJK2yz2FUZeQ55tFBqEoKItr8bSPnL/s1600/phonegap_image_12.png" height="574" width="640" /></a></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimtcPBguIj_AtiAmH2I46WYY-ln8HHeik9Dp4yg9qbNOVCcGnyd2fdzaamHXXh-2FHZya6mJPSwYxwwrPLyhb3S-wl49j8xAAx1kwLtAtiqqTSRuXUICOEhWnjbYerCPRVnUpt3v6C1Nx8/s1600/phonegap_image_13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimtcPBguIj_AtiAmH2I46WYY-ln8HHeik9Dp4yg9qbNOVCcGnyd2fdzaamHXXh-2FHZya6mJPSwYxwwrPLyhb3S-wl49j8xAAx1kwLtAtiqqTSRuXUICOEhWnjbYerCPRVnUpt3v6C1Nx8/s1600/phonegap_image_13.png" height="640" width="281" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;">The above will be the project strtucture.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #e06666;"><br /></span></div>
<br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>b) Now go to phonegap folder {phonegap-2.9.0\lib\android\example\assets\} copy www folder and paste it in your current android project asstes folder</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>c) The same for cordova jar file {phonegap-2.9.0\lib\android\example\libs\}</span><br />
<span style="color: #e06666;"><span class="Apple-tab-span" style="white-space: pre;"> </span>d) config xml file from {phonegap-2.9.0\lib\android\example\res} copy xml folder and paste in res folder of your application</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #e06666;"> </span></span><br />
<span style="color: #e06666;">9) Now click F5 in eclipse.</span><br />
<span style="color: #e06666;"><br /></span>
<span style="color: #e06666;">10) Now follow these images to Buildpath/configure jar files</span><br />
<span style="color: #e06666;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4jczxFVYqZTBp5VqVAqWXYnaGI38A7ykvDxC2tK6lkiaFMJUKCBxy6Pim_-e23dBGmu3ju-iWpXCoxhfmegnmFvbuvViW9OhCHburYBfWFDTRY4IsE9hVZKvvId64YPi7VzYwUHBeEEs/s1600/phonegap_image_15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4jczxFVYqZTBp5VqVAqWXYnaGI38A7ykvDxC2tK6lkiaFMJUKCBxy6Pim_-e23dBGmu3ju-iWpXCoxhfmegnmFvbuvViW9OhCHburYBfWFDTRY4IsE9hVZKvvId64YPi7VzYwUHBeEEs/s1600/phonegap_image_15.png" height="394" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6e9ZDHZxbf94uRyx7sUuNCQ0ZxYQV2rFk6P1DfRmoZDRwTznZFIdbdEXO6MEpooV-mcTG8p_eRZN9MrLb6dH5dr59wd15J83MBJ0E7ACFORrjEiuCqSV3DmaTxOH1RXzmu5ufJdqwe3VX/s1600/phonegap_image_16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6e9ZDHZxbf94uRyx7sUuNCQ0ZxYQV2rFk6P1DfRmoZDRwTznZFIdbdEXO6MEpooV-mcTG8p_eRZN9MrLb6dH5dr59wd15J83MBJ0E7ACFORrjEiuCqSV3DmaTxOH1RXzmu5ufJdqwe3VX/s1600/phonegap_image_16.png" height="426" width="640" /></a></div>
<br />
Click on Add JARs<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzNt3TcXMIbzbM0bi8mTcQqd_LAT79oZuF18sJCy3Ft_Lrb4pHdtOziDRHTbsYy8ARJoMT9AEzccZS_g4m85B-1PJmM1hmRNQgdpb1M5OyLSiubWvgiEZjUT6Qdi9JJNadtxJUNTN4JuyU/s1600/phonegap_image_17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzNt3TcXMIbzbM0bi8mTcQqd_LAT79oZuF18sJCy3Ft_Lrb4pHdtOziDRHTbsYy8ARJoMT9AEzccZS_g4m85B-1PJmM1hmRNQgdpb1M5OyLSiubWvgiEZjUT6Qdi9JJNadtxJUNTN4JuyU/s1600/phonegap_image_17.png" height="640" width="560" /></a></div>
<br />
Select Cordova jar file from and click OK button.<br />
<br />
<span style="color: #e06666;">11) Now open MianActivity.java file from src/ folder and do changes</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJj2zSGA01bQTLRyjLeTB-LuOuYl7V1hvazGSIaWYPBucvbB5BJF_uSjeW1yJhsLmrlHMrY3R6SplUNT62ACaMrKnRgvovEwK4M1GDLMPZWCPHaqwZwZ_W0SGVH0YHHpqs7wlItc_yEDqK/s1600/phonegap_image_14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJj2zSGA01bQTLRyjLeTB-LuOuYl7V1hvazGSIaWYPBucvbB5BJF_uSjeW1yJhsLmrlHMrY3R6SplUNT62ACaMrKnRgvovEwK4M1GDLMPZWCPHaqwZwZ_W0SGVH0YHHpqs7wlItc_yEDqK/s1600/phonegap_image_14.png" height="302" width="640" /></a></div>
<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>a) This is before change (Do these changes.)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #0b5394;">package com.mahesh.myfirstphonegapapp;</span><br />
<span style="color: #0b5394;"><br /></span>
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>import android.os.Bundle;</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><strike>import android.app.Activity;</strike></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>import android.view.Menu;</span><br />
<span style="color: #0b5394;"><br /></span>
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><strike>public </strike>class MainActivity extends <strike>Activity </strike>{</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onCreate(Bundle savedInstanceState) {</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><strike>setContentView(R.layout.activity_main);</strike></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: #0b5394;"><br /></span>
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public boolean onCreateOptionsMenu(Menu menu) {</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Inflate the menu; this adds items to the action bar if it is present.</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>getMenuInflater().inflate(R.menu.main, menu);</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return true;</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>b) This code after change (The bold and highlighted code is the changes)<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #0b5394;">package com.mahesh.myfirstphonegapapp;</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>import org.apache.cordova.*;</b></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>import android.os.Bundle;</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>import android.view.Menu;</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>public</b> class MainActivity extends <b>DroidGap</b> {</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span><b>super.loadUrl("file:///android_asset/www/index.html");</b></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public boolean onCreateOptionsMenu(Menu menu) {</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Inflate the menu; this adds items to the action bar if it is present.</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>getMenuInflater().inflate(R.menu.main, menu);</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return true;</span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} </span><br />
<span style="color: #0b5394;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
12) Now run the project as shown bellow image<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhigV7oZwwEqGgDGevvRZJFBotAYSaZDt7WkHTu5fScN3b3Rbc_rbLcphwZi47-HRhkFfLhyphenhyphengk409LKqSRFG_G6pbfpNLzyWZm39w1jLS3ErsbgzSC7yb6VHIXeb4lqt_m4qUPsruF-ICsd/s1600/phonegap_image_18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhigV7oZwwEqGgDGevvRZJFBotAYSaZDt7WkHTu5fScN3b3Rbc_rbLcphwZi47-HRhkFfLhyphenhyphengk409LKqSRFG_G6pbfpNLzyWZm39w1jLS3ErsbgzSC7yb6VHIXeb4lqt_m4qUPsruF-ICsd/s1600/phonegap_image_18.png" height="640" width="588" /></a></div>
<br />
13) If you already setup emulator you can use that other wise create one emulator and use it,<br />
OR if you want to test directly from your mobile phone, then connect your phone with data cable<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>and check the optin for usb debugging and install from 3rd pary software options in your phone.<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<div>
<br /></div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0Bangalore, Karnataka, India12.9715987 77.59456269999998312.4764182 76.949115699999979 13.4667792 78.240009699999987tag:blogger.com,1999:blog-2625841984973898434.post-42352123482590327772014-01-13T19:12:00.000+05:302014-01-13T19:12:54.981+05:30The model type is invalid. please select an item from the list ( ASP.Net MVC)<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
If any one face this problem, hear is one solution<br />
<br />
While creating/Add controller for Entity Framework in Asp.Net <i><span style="color: #274e13;">MVC3</span></i> OR<i><span style="color: #38761d;"> MVC4</span></i><br />
<br />
<b>Example:</b><br />
As per this <a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/accessing-your-models-data-from-a-controller" target="_blank">website</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi93mlH3lSKVDmBU0Zwv6Eppr3L-ZQioySqoIIDdqxo8Qw8Q0Dd0wOM-ItdoeQVY1G2Bwab3kk-SC_6Az5wCrKRBzfN2R1vRgu93YkTcvqJ21B2GgLeEcAyhICy5wYzKjYpWkkkZ31hNJ8l/s1600/addmoviecontroller2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi93mlH3lSKVDmBU0Zwv6Eppr3L-ZQioySqoIIDdqxo8Qw8Q0Dd0wOM-ItdoeQVY1G2Bwab3kk-SC_6Az5wCrKRBzfN2R1vRgu93YkTcvqJ21B2GgLeEcAyhICy5wYzKjYpWkkkZ31hNJ8l/s1600/addmoviecontroller2.png" height="265" width="400" /></a></div>
<br />
<br />
<ul style="background-color: #fffbe9; border: 0px; color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 18px 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="background-color: transparent; border: 0px; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;">Controller name: <strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">MoviesController</strong>. (This is the default. )</li>
<li style="background-color: transparent; border: 0px; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;">Template: <strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Controller with read/write actions and views, using Entity Framework</strong>.</li>
<li style="background-color: transparent; border: 0px; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;">Model class: <strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Movie (MvcMovie.Models)</strong>.</li>
<li style="background-color: transparent; border: 0px; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;">Data context class: <strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">MovieDBContext (MvcMovie.Models)</strong>.</li>
<li style="background-color: transparent; border: 0px; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;">Views: <strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Razor (CSHTML)</strong>. (The default.)</li>
</ul>
<div>
<span style="color: #222222; font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 18.203125px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 18.203125px;"><br /></span></span></div>
<div>
<span style="font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 18.203125px;"><span style="color: #222222;">when we click on "</span><b style="color: #222222;">Add" </b><span style="color: #222222;">Button the application show one alert message </span><i><span style="color: #990000;">"The model type is invalid. please select an item from the list</span></i></span></span><span style="font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18.203125px;"><i><span style="color: #990000;">"</span></i></span></div>
<div>
<span style="font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18.203125px;"><i><span style="color: #990000;"><br /></span></i></span></div>
<div>
<span style="font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18.203125px;">Before adding MoviesController we need to </span><span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;">built the project before proceed to this step.</span></div>
<div>
<span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQA9l6HMs1RhJZHQijEgds2WWeCeKoQIp1WiUgKfti2bSd5xHuWhj-rChvlrl7KJqD9heIKxQS1uqonMRrBB8eBDy5iubwq1mDifYKpc2wRWhNdxGvbWPs1OWG4981-fkJrRQcfLLprcCu/s1600/addmoviecontroller3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQA9l6HMs1RhJZHQijEgds2WWeCeKoQIp1WiUgKfti2bSd5xHuWhj-rChvlrl7KJqD9heIKxQS1uqonMRrBB8eBDy5iubwq1mDifYKpc2wRWhNdxGvbWPs1OWG4981-fkJrRQcfLLprcCu/s1600/addmoviecontroller3.png" height="44" width="640" /></a></div>
<div>
<span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;"><br /></span></div>
<div>
<span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;">Click on Run Button to built the project and now add controller with above steps.</span></div>
<div>
<span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;"><br /></span></div>
<div>
<span style="color: #222222; font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.203125px;">I hope you problem will be solved.</span></div>
<div>
<span style="font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18.203125px;"><i><span style="color: #990000;"><br /></span></i></span></div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0Bangalore, Karnataka, India12.972442010578417 77.59643554687512.724836510578417 77.273712046875 13.220047510578418 77.919159046875tag:blogger.com,1999:blog-2625841984973898434.post-63897555134331960842014-01-09T18:02:00.001+05:302014-01-13T19:14:11.439+05:30How to install Node.js, npm, socket.io and use them?<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
1 Go to <a href="http://nodejs.org/" style="background-color: transparent; border: 0px; color: #4a6b82; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;">http://nodejs.org</a> and click on Install button, </div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
2.. Download node and install it</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
3.. Create an empty folder on your hard disk</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
3.1) check environment path of nodejs using command prompt</div>
<div style="background-color: white; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="font-size: 14px; line-height: 18px;"> a) <b>C:\>set %PATH%</b></span></span></div>
<div style="background-color: white; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="font-size: 14px; line-height: 18px;"> If it is not showing any path regarding node then set the environment path</span></span></div>
<div style="background-color: white; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: Arial, Liberation Sans, DejaVu Sans, sans-serif;"><span style="font-size: 14px; line-height: 18px;"> b) </span></span><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"><b>C:\>set path=%PATH%;C:\Program Files\nodejs\</b></span></div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
4.. Create an package.json file with the following content</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Ex: <b>C:\Program Files\nodejs\package.json</b></div>
<pre class="lang-js prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"name"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"App"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"version"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"0.0.1"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"description"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"App"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"dependencies"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"socket.io"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"latest"</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">},</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"author"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"developer"</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">}</span></code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
5.. Open windows's command prompt (press Windows key + R and type <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">cmd</em>)</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
6.. Navigate to your newly created directory with <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">cd</em> command</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
7.. Type <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><b>npm install</b></em> in that directory</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
7.1) If you face any problem like file not found for package.json then go to nodejs path</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<b>C:\Program Files\nodejs\ </b>and then type<b> npm install</b></div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
8.. Wait till everything is downloaded and installed</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
9.. Create a file app.js with the following content:</div>
<pre class="lang-js prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">var</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> app </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> require</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'http'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">).</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">createServer</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">handler</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> io </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> require</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'socket.io'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">).</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">listen</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">app</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> fs </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> require</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'fs'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
app</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">listen</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="lit" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">3000</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">function</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> handler </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">req</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> res</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
fs</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">readFile</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">__dirname </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'/index.html'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">function</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">err</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">if</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">err</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
res</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">writeHead</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="lit" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">500</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">return</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> res</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">end</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'Error loading index.html'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">}</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
res</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">writeHead</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="lit" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">200</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
res</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">end</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">}</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
io</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">sockets</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">on</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'connection'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">function</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">socket</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
socket</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">emit</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'news'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> hello</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'world'</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
socket</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">on</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'my other event'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">function</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
console</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">log</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span></code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
10.. Create a file index.html with the following content</div>
<pre class="lang-js prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">script src</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"/socket.io/socket.io.js"</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">></</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">script</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"><</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">script</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">var</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> socket </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> io</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">connect</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'http://localhost'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
socket</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">on</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'news'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">function</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
console</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">log</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">data</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">);</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
socket</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">emit</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'my other event'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> my</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'data'</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">});</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"></</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">script</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">></span></code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
11.. Again, go to the command prompt (console) and type <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">node app.js</em>. This will run nodejs server and you may open <em style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">localhost:3000</em></div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-46479490016807783702014-01-02T13:17:00.002+05:302014-01-13T19:15:00.322+05:30How to pass Magento Certification Exam in 30 days<div dir="ltr" style="text-align: left;" trbidi="on">
This is from <a href="https://www.smashwords.com/books/view/327369" target="_blank">"SMASHWORDS.COM"</a><br />
<br />
<a href="https://www.smashwords.com/extreader/read/327369/3/how-to-pass-magento-certification-exam-in-30-days">https://www.smashwords.com/extreader/read/327369/3/how-to-pass-magento-certification-exam-in-30-days</a></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-41007585042595575502013-12-24T11:44:00.001+05:302014-01-13T19:16:27.803+05:30Basic CRUD operations using php, mongodb and knockoutjs with validation<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-bottom: 15px; margin-top: 15px;">
1) I used knockout simplegrid for table data with DELETE, EDIT action and pagination support</div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
2) THE CRUD operations are using XHR/AJAX</div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
3) I used Twitter Booststarp Framework.</div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
You can Download/Fork from the github.com <a href="https://github.com/maheshbabubokkisam/basicphpmongoknockout" target="_blank"><b>basics_of_php_mongodb_knockoutjs</b></a></div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
Before trying this we need to install PHP, Apache webserver/Any HTTP server and MongoDB</div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
second download mongodb.dll file (php mongodb driver) and keep this file extension if you are using windows OS.</div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNyEsfTDpfd4WMMjme1gr4ptObXqaE7agskuVRE2K1dOKvMBKpP6wxM1OsUezWmKJGA93ckzbuw6Id7M1DC4r3eW1vNo5sDIPZUslNr-lTj3_lylwUE6k01d3OkI04KaEhZbpIlL5sNgxt/s1600/simple_grid_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNyEsfTDpfd4WMMjme1gr4ptObXqaE7agskuVRE2K1dOKvMBKpP6wxM1OsUezWmKJGA93ckzbuw6Id7M1DC4r3eW1vNo5sDIPZUslNr-lTj3_lylwUE6k01d3OkI04KaEhZbpIlL5sNgxt/s400/simple_grid_1.png" height="281" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXdzekgpf6twqVhO7O-FU4U4-5ZGAJsYE6X_-8csC8_86thNjhvPSKysT2Un1DEIhbiYz6CM3VVou0P5p19PiBWAODurnVgQnwItrEuRS9aCnJan0blXQz9SHC4gr0VtM6rRyZaK3Hviwd/s1600/simple_grid_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXdzekgpf6twqVhO7O-FU4U4-5ZGAJsYE6X_-8csC8_86thNjhvPSKysT2Un1DEIhbiYz6CM3VVou0P5p19PiBWAODurnVgQnwItrEuRS9aCnJan0blXQz9SHC4gr0VtM6rRyZaK3Hviwd/s640/simple_grid_2.png" height="413" width="640" /></a></div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
<br /></div>
<div style="margin-top: 15px;">
<span style="color: #0b5394;"><span style="font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><b>These are JavaScript files required</b></span></span></span></div>
<div style="margin-top: 15px;">
<span style="font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="color: #333333; white-space: pre;"> </span><span style="color: #073763;"><!-- Just for debugging purposes. Don't actually copy this line! --></span></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!--[if lt IE 9]><script src="js/ie8-responsive-file-warning.js"></script><![endif]--></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!--[if lt IE 9]></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><![endif]--></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span style="font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="js/jquery-1.11.0.js"></script></span></span><span style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; white-space: pre;"> </span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span style="font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="js/bootstrap.js"></script></span></span><span style="font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; white-space: pre;"> </span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="js/knockout-3.0.0.js"></script></span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763; font-family: Helvetica, arial, freesans, clean, sans-serif;"><span style="font-size: 15px; line-height: 25px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" src="js/knockout.simpleGrid.3.0.js"></script></span></span></div>
<div style="margin-top: 15px;">
<b><span style="color: #0b5394;"><br /></span></b></div>
<div style="margin-top: 15px;">
<b><span style="color: #0b5394;">These are the CSS files and Stylesheet required</span></b></div>
<div style="margin-top: 15px;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #073763;"><link href="" media="screen" rel="stylesheet" /></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!-- Bootstrap core CSS --></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span><link href="css/bootstrap.css" rel="stylesheet"></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!-- Custom styles for this template --></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span><style></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>body {padding-top: 40px;padding-bottom: 40px;background-color: #eee;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin {max-width: 330px;padding: 15px;margin: 0 auto;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin .form-signin-heading, .form-signin .checkbox {<span class="Apple-tab-span" style="white-space: pre;"> </span>margin-bottom: 10px; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin .checkbox {font-weight: normal;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin .form-control {position: relative;font-size: 16px;height: auto;padding: 10px;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin .form-control:focus {z-index: 2;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin input[type="text"] {margin-bottom: -1px;border-bottom-left-radius: 0;border-bottom-right-radius: 0;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.form-signin input[type="password"] {margin-bottom: 10px;border-top-left-radius: 0;border-top-right-radius: 0;}<span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="margin-top: 15px;">
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #073763;"> </span></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/* KO Grid */</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid { margin-bottom: 1em; width: 100%; border: 1px solid silver; background-color:White; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid th { text-align:left; background-color: Black; color:White; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid td, th { padding: 0.4em; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid tr:nth-child(odd) { background-color: #DDD; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid-pageLinks { margin-bottom: 1em; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid-pageLinks a { padding: 0.5em; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.ko-grid-pageLinks a.selected { background-color: Black; color: White; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.liveExample { height:20em; overflow:auto } /* Mobile Safari reflows pages slowly, so fix the height to avoid the need for reflows */</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><br /></span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>li { list-style-type: disc; margin-left: 20px; }</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.action-status{color:green;}</span></div>
<div style="margin-top: 15px;">
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span></style></span></div>
<div style="color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px; margin-top: 15px;">
<br /></div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-21809322813619528622013-11-20T11:42:00.002+05:302013-11-20T11:42:52.894+05:30Htaccess File Tutorial and Tips<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="border: 0px; color: #333333; font-family: Helvetica, Arial; font-size: 36px; line-height: 1.1em; margin: 0px; outline: 0px; padding: 0px 0px 5px; text-shadow: rgb(255, 255, 255) 0px 1px 0px;">
Htaccess File Tutorial and Tips.</h1>
<div class="socialicons" style="border-bottom-color: rgb(245, 245, 245); border-style: solid none; border-top-color: rgb(245, 245, 245); border-width: 1px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; height: 25px; line-height: 18px; margin: 0px; outline: 0px; padding: 5px 0px 0px;">
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<br /></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<br /></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
[THIS DOCUMENT COPIED FROM <a href="http://www.9lessons.info/2013/11/htaccess-file-tutorial-and-tips.html">http://www.9lessons.info/2013/11/htaccess-file-tutorial-and-tips.html</a><span style="font-family: inherit; font-style: inherit; font-weight: inherit;"> ]</span></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<span style="font-family: inherit; font-style: inherit; font-weight: inherit;"><br /></span></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;"><br /></span></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;"><br /></span></div>
<div class="socialspace" style="border: 0px none; float: left; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px 0px 0px 10px; outline: 0px; padding: 0px;">
<span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;">Using </span><span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;">.htaccess </span><span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;">file</span><span style="color: #1e1e1e; font-family: Muli, Helvetica, Arial, Georgia, 'Times New Roman'; font-size: 16px; font-style: inherit; font-weight: inherit; line-height: 24px; text-align: justify;"> we can easily configure and redirect Apache Web Server file system. This post will explain you how to create friendly URLs, sub domain directory re-directions and many more.</span></div>
</div>
<div class="post-body-n" style="border: 0px none; color: #1e1e1e; font-family: Muli, Arial, 'Times New Roman', Times, Arial, serif; font-size: 15px; line-height: 24px; margin: 0px; outline: 0px; padding: 0px;">
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="cen" style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">
<img alt="Understanding Htaccess Redirect " class="sri" src="https://lh3.googleusercontent.com/-mSroaw3IiFI/UoparJTYmeI/AAAAAAAAIec/LSmFG144YHc/s550/htaccess.png" style="background-color: white; border: 1px solid rgb(204, 204, 204); font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 9px;" /></div>
<a href="" name="more" style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;"></a><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">Note:</span> <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">.htaccess</span> file will be in hidden format, please change your folder and file settings to view this file. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">How to Create a .htaccess File?</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Open any text editor application and file save as with <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">.htaccess</span> name and enable<span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">mod_rewrite</span> extension in <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">php.ini</span> file in Apache Web Server configurations. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Default directory Listing</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="cen" style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">
<img alt="Enable directory Listing using htaccess " class="sri" src="https://lh3.googleusercontent.com/-Mt4Mg0Hr2pY/UoukdliNlMI/AAAAAAAAIe4/d4ipOER47fQ/s550/disable.png" style="background-color: white; border: 1px solid rgb(204, 204, 204); font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 9px;" /></div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Disable directory Listing</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />If you want to disable folder files listing, include following code. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
# Disable Directory Browsing<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="border: 0px none; color: #e06666; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">Options</span> All <span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">-Indexes</span></div>
<div class="cen" style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">
<img alt="Disable directory Listing using htaccess" class="sri" src="https://lh5.googleusercontent.com/-gjuWyCcS1iw/UoukdvrzhdI/AAAAAAAAIe8/7zlx74GZ4hQ/s550/enable.png" style="background-color: white; border: 1px solid rgb(204, 204, 204); font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 9px;" /></div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Error Pages</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Here error page is redirecting to <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">error.html</span>. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
errorDocument <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">400</span> http://www.youwebsite.com/error.html<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />errorDocument <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">401</span> http://www.youwebsite.com/error.html<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />errorDocument <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">404</span> http://www.youwebsite.com/error.html<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />errorDocument <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">500</span> http://www.youwebsite.com/error.html</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="cen" style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">
<img alt="htaccess 404 error disply" class="sri" src="https://lh3.googleusercontent.com/-ZKLKl020xXU/Uoul_a1KnYI/AAAAAAAAIfU/owU0RjSCozs/s550/404.png" style="background-color: white; border: 1px solid rgb(204, 204, 204); font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 9px;" /></div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">RewriteEngine On</span> it is turn on Rewrite Rules in Apache Server. if you want to turn off, just change the value to <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">off</span>.<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteEngine <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">on</span></div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Domain Redirection</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">.htacces</span> code for redirecting <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">yourwebsite.com</span> to <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">www.yourwebsite.com</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteCond %{<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">HTTP_HOST</span>} ^<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">yourwebsite.com</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule (.*) <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">http://www.yourwebsite.com/</span>$1 [<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">R=301</span>,L]</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Sub Domain Redirection</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Sub domain redirection mapping to folder. Here <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://www.yourwebsite.com</span> is connecting to <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">website_folder</span> folder. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteCond %{<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">HTTP_HOST</span>} ^<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">www</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">yourwebsite</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">com</span>$<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteCond %{<span style="border: 0px none; color: #a64d79; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">REQUEST_URI</span>} !^/<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">website_folder</span>/<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule (.*) /<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">website_folder</span>/$1</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Here <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://subdomain.yourwebsite.com</span> is connecting to <span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">subdomain_folder</span>folder. <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteCond %{<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">HTTP_HOST</span>} ^<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">subdomain</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">yourwebsite</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">com</span>$<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteCond %{<span style="border: 0px none; color: #a64d79; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">REQUEST_URI</span>} !^/<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">subdomain_folder</span>/<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule (.*) /<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">subdomain_folder</span>/$1</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><a href="http://www.9lessons.info/2010/03/htaccess-file-inside-folder.html" style="border: 0px none; color: #176092; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none;" target="_blank">Htaccess File Inside The Folder.</a><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Old Domain Redirection</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />htaccess code for redirecting old domain(abc.com) to new domain(xyz.com). Live demo <a href="http://fglogin.com/" style="border: 0px none; color: #176092; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none;" target="_blank">fglogin.com</a> is now redirecting to <a href="http://oauthlogin.com/" style="border: 0px none; color: #176092; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none;" target="_blank">oauthlogin.com</a><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteCond %{<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">HTTP_HOST</span>} ^<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">abc.com</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule (.*) <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">http://www.xyz.com</span>/$1 [<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">R=301</span>,L]<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteCond %{<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">HTTP_HOST</span>} ^<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">www</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">abc</span>\.<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">com</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule (.*) <span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">http://www.abc.com/</span>$1 [<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">R=301</span>,L]</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Friendly URLs</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Friendly/Pretty URLs help in search engine rankings.<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Profile URL</b> <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Profile parameter allows [<span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">a-zA-Z0-9_-</span>] these inputs. More help read <a href="http://www.9lessons.info/2013/10/understanding-regular-expression.html" style="border: 0px none; color: #176092; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration: none;">Understanding Regular Expression</a> <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/profile.php?username=srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />to<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteRule ^([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">profile.php?username=</span>$1<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule ^([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)/$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">profile.php?username=</span>$1</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Messages URL</b> <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/messages.php?message_username=srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />to<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/messages/srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">messages</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">messages.php?message_username=</span>$1<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">messages</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)/$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">messages.php?message_username=</span>$1</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Friends URL</b> <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/friends.php?username=srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />to<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/friends/srinivas</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends.php?username=</span>$1<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)/$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends.php?username=</span>$1</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Friends URL with Two Parameters</b> <br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />Here the first parameter allows [a-zA-Z0-9_-] and second parameter allows only number [<span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">0-9</span>]<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/friends.php?username=srinivas&page=2</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />to<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://labs.9lessons.info/friends/srinivas/2</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">0-9</span>]+)$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends.php?username=</span>$1<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">&page=</span>$2<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />RewriteRule ^<span style="border: 0px none; color: blue; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends</span>/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">a-zA-Z0-9_-</span>]+)/([<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">0-9</span>]+)/$ <span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">friends.php?username=</span>$1<span style="border: 0px none; color: #3d85c6; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">&page=</span>$2</div>
<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><b style="border: 0px none; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;">Hiding File Extension</b><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://www.yourwebsite.com/index.html</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" />to<br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><span style="background-color: #c7f464; border: 0px none; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px 2px;">http://www.yourwebsite.com/index</span><br style="border: 0px none; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;" /><div class="code" style="border: 2px dashed rgb(222, 222, 222); color: black; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-style: inherit; font-weight: inherit; line-height: 16px; margin: 0px; outline: 0px; padding: 10px; width: 547px; word-wrap: break-word;">
RewriteRule ^([<span style="border: 0px none; color: #274e13; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">^/.</span>]+)/?$ $<span style="border: 0px none; color: #cc0000; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px;">1.html</span></div>
</div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com1tag:blogger.com,1999:blog-2625841984973898434.post-71779856280132515502013-11-20T11:35:00.000+05:302013-11-20T11:35:03.604+05:30Create localhost webserver simple http server<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="post-content
" data-role="post-content" style="-webkit-transition: all 0.2s ease-in-out; box-sizing: border-box; color: #42474a; font-family: 'Helvetica Neue', arial, sans-serif; font-size: 15px; line-height: 15px; margin-bottom: 24px; transition: all 0.2s ease-in-out;">
<div class="post-body" style="box-sizing: border-box; position: relative;">
<div class="post-body-inner" style="box-sizing: border-box;">
<div class="post-message-container" data-role="message-container" style="box-sizing: border-box; overflow: hidden; position: relative; width: 640px; zoom: 1;">
<div data-role="message-content" style="box-sizing: border-box;">
<div class="post-message publisher-anchor-color " data-role="message" dir="auto" style="box-sizing: border-box;">
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; margin-bottom: 15px; padding: 0px;">
<b>Using PYTHON</b></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; margin-bottom: 15px; padding: 0px;">
$ python -m SimpleHTTPServer 8000</div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
This will start a webserver listening on port 8000 and serving files from the current directory.</div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<br /></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<b>Using PYTHON 3</b></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
python -m http.server</div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<br /></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<b>Using PHP</b></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px; text-align: left;">
$ php -S localhost:8000</div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<br /></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
<b>Using Ruby with Rack</b></div>
<div style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 21px; padding: 0px;">
$ rackup -b "run Rack::Directory.new('.')"</div>
</div>
<div class="post-media" style="box-sizing: border-box; margin: 0px;">
<ul data-role="post-media-list" style="border: 0px; box-sizing: border-box; font-family: inherit; line-height: 1; list-style: none; margin: 0px; padding: 0px;"></ul>
</div>
</div>
</div>
</div>
<footer style="box-sizing: border-box; clear: both; color: #6c6c6c; margin: 6px 0px 0px;"><br /></footer></div>
</div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-81950903521515577562013-11-14T23:24:00.002+05:302013-11-14T23:26:43.823+05:30Determine which service using port 80 in Windows<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: red;"><b>1)</b> How to determine what software is using port 80 in WINDOWS</span><br />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><br /></span>
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><span style="color: #0b5394;"><b>netstat -aon | findstr 0.0:80</b></span></span><br />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><span style="color: #0b5394;"><b><br /></b></span></span>
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><span style="color: #0b5394;">It will list all services which is using port 80 with PID (Process ID), The last one PID</span></span><br />
<span style="background-color: white; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><span style="color: #0b5394;"><b><br /></b></span></span>
<span style="color: #0b5394; font-family: verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif; font-size: x-small;">TCP 0.0.0.0:445 0.0.0.0:0 LISTENING <b>4</b></span><br />
<span style="color: #0b5394; font-family: verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif; font-size: x-small;">TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING <b>524</b></span><br />
<span style="color: #0b5394; font-family: verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"></span></span><br />
<span style="color: #0b5394; font-family: verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif; font-size: x-small;">TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING <b>1012</b></span><br />
<br />
<br />
<span style="color: red;"><b>2)</b> Port 80 is being used by SYSTEM (PID 4), How to stop IIS Services</span><br />
<br />
Open command prompt and type these command<br />
<span style="color: #0b5394;"><b>Taskkill /PID 4 /F</b></span><br />
<span style="color: #0b5394;"><b><br /></b></span>
<b><span style="color: #0c343d;">If</span></b><span style="color: #0b5394;"> this will result like this </span><br />
<span style="color: #0b5394;">ERROR: The process with PID 4 could not be terminated.</span><br />
<span style="color: #0b5394;"></span><br />
<span style="color: #0b5394;">Reason: Access is denied.</span><br />
<span style="color: #0b5394;"><b><br /></b></span>
<b style="color: #274e13;">Then </b><span style="color: #0b5394;">Type this command</span><br />
<b><span style="color: #0b5394;">iisreset /stop</span></b><br />
<b><span style="color: #0b5394;"><br /></span></b>
<span style="color: #0b5394;">now run this command<b> </b></span><b style="background-color: white; color: #0b5394; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">netstat -aon | findstr 0.0:80</b><br />
<b><span style="color: #274e13;"><br /></span></b></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-1127038455194362992013-06-11T16:33:00.000+05:302014-01-13T19:17:32.528+05:30How to Run Various Linux Commands On Windows Using GIT Bash<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
First way is :--> Install <b><a href="http://git-scm.com/" target="_blank">GIT</a></b> latest stable version.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
After install open GIT-->Bash</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcK7YBo-5jFTiyxe4KiuLNUVjATzLTblD1mk_yZpZN1ufChd79GNxiYTV_P9eS4VHMDj5kqhvqnlabOJhTqkVSnyvMnfZWOaM8gqjegC257q8cBchSQFt7XPV6kIub1BjUKQA2gWtWIYZ/s1600/git-bash.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcK7YBo-5jFTiyxe4KiuLNUVjATzLTblD1mk_yZpZN1ufChd79GNxiYTV_P9eS4VHMDj5kqhvqnlabOJhTqkVSnyvMnfZWOaM8gqjegC257q8cBchSQFt7XPV6kIub1BjUKQA2gWtWIYZ/s320/git-bash.jpg" height="320" width="140" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
and now you can execute Linux commands.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
If you want check which commands can execute just go to this PATH <b>C:\Program Files\Git\bin </b>and check the file names.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
And one more thing you can use GIT as Version Controller like SVN</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Second way is :--> <a href="http://ashu-geek.blogspot.in/2012/01/how-to-run-various-linux-commands-on.html" target="_blank"><b>How to run various Linux Commands on Windows using GOW (GNU on Windows)</b></a></div>
<div style="text-align: left;">
<br /></div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-36238098635972347352013-05-17T15:30:00.000+05:302013-05-17T16:01:13.863+05:30Simple Jquery iframe popup like fancybox<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<link href="http://yandex.st/highlightjs/5.12/styles/default.min.css" rel="stylesheet"></link>
<script src="http://yandex.st/highlightjs/5.12/highlight.min.js"></script>
<script>
hljs.tabReplace = ' ';
hljs.initHighlightingOnLoad();
</script>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
A simple jquery iframe popup like fancybox, set a rel attribute for anchor tag to load iframae as popup otherwise do not add rel attribute so it can redirect to source page.<br />
<br />
CODE: <a href="https://github.com/maheshbabubokkisam/jquery_iframe_pupup_like_fancybox" target="_blank">source</a><br />
<br />
DEMO</div>
<html>
<head>
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]</head></html>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">!window.jQuery && document.write(unescape('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script>
<!-- iframe popup -->
<style>
#mybox-overlay{left: 0;position: absolute;top: 0;width: 100%;z-index: 1100;}
#mybox-wrap {left: 0;outline: medium none;position: fixed; top: 0; z-index: 1101; background:#fff;width: 820px;}
#mybox-content {outline: medium none;overflow: hidden;padding: 0;position: relative;width: 0;z-index: 1102;}
</style>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function (e) {
jQuery('body').append('<div id="mybox-overlay" style="background-color: rgb(119, 119, 119); opacity: 0.7; cursor: pointer; height: 2455px; display: none;">
</div>
');
jQuery('body').append('<div id="mybox-wrap" style="height: auto; top: 50px; left: 220px; display: none;">
<div id="fancybox-outer">
<div id="fancybox-bg-n" class="fancybox-bg">
</div>
<div id="fancybox-bg-ne" class="fancybox-bg">
</div>
<div id="fancybox-bg-e" class="fancybox-bg">
</div>
<div id="fancybox-bg-se" class="fancybox-bg">
</div>
<div id="fancybox-bg-s" class="fancybox-bg">
</div>
<div id="fancybox-bg-sw" class="fancybox-bg">
</div>
<div id="fancybox-bg-w" class="fancybox-bg">
</div>
<div id="fancybox-bg-nw" class="fancybox-bg">
</div>
<div id="mybox-content" style="border-width: 10px; width: 800px; height: 578px;">
</div>
<a id="fancybox-close" class="mybox-close" style="display: inline;"></a></div>
</div>
')
jQuery("ul.policy li a").click(function (e) {
e.preventDefault();
var ref = jQuery(this).attr('href');
var flag = true;
if (jQuery(this).is('[rel]')) {
var relType = jQuery(this).attr('rel');
jQuery("#mybox-overlay").show();
jQuery("#mybox-wrap").show();
jQuery('<iframe frameborder="0" scrolling="auto" src="' + ref + '" hspace="0" name="mybox-frame" id="mybox-frame" style="width:100%; height:100%"></iframe>').appendTo("#mybox-content");
jQuery("#mybox-content").show();
}else{
location.href=ref;
}
});
jQuery("#mybox-overlay, .mybox-close").click(function(){
jQuery("#mybox-wrap").hide();
jQuery("#mybox-content").text('').hide();
jQuery("#mybox-overlay").hide();
});
});
//]]>
</script>
<br />
<ul class="policy">
<li><a href="https://www.facebook.com/" rel="gpop">Facebook</a></li>
<li><a href="http://maheshbokkisam.blogspot.com/" rel="gpop">Mahesh Bokkisam</a></li>
<li><a href="http://google.com/">Google</a></li>
</ul>
<!-- iframe popup -->
</div>
-->
<br />
<pre><code>
</code></pre>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-33494406519577714242013-05-07T18:00:00.000+05:302013-05-07T18:02:34.286+05:30Run javascript/jQuery function when user finishes typing instead of on key up.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<script><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jQuery(window).load(function() {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: #073763;"> </span></span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//setup before functions</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var typingTimer; //timer identifier</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var doneTypingInterval = 500; //time in ms</span><br />
<span style="color: #073763;"><br /></span>
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//on keyup, start the countdown</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>jQuery('.UI-SEARCH').keyup(function(){</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span> clearTimeout(typingTimer);</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span> if (jQuery('.UI-SEARCH').val) {</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span> typingTimer = setTimeout(doneTyping, doneTypingInterval);</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span> }</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span style="color: #073763;"><br /></span>
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//user is "finished typing," do something</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>function doneTyping () {</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span> alert('hi');</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: #073763;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></script><br />
<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><body><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type="text" maxlength="128" value="" name="q" autocomplete="off" class="input-text UI-SEARCH"><span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></body><br />
<br />
<br />
<b style="background-color: purple;"><span style="color: white;">Delay keystroke/keyup/keydown action until user complete the type in text box.</span></b><br />
<br /></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-13286773118227740222013-04-23T18:10:00.001+05:302014-06-13T17:28:26.262+05:30How to Create Multiple Virtual Hosts in Ubuntu with LAMP/Apache<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
I also assume that you have the Apache mod_rewrite module enabled. You
can enable this by typing the following command in the terminal<br />
<br />
<code class="plain"><span style="color: #20124d;">sudo a2enmod rewrite</span></code><br />
<code class="plain"><br /></code>
<code class="plain"><b>Create Multiple Directories.</b></code><br />
<code class="plain"><br /></code>
<code class="plain"></code><br />
<pre><code class="plain"><span style="color: #20124d;">mkdir /var/www/mylocalsite1
mkdir /var/www/mylocalsite2
mkdir /var/www/mylocalsite3</span></code></pre>
<pre><code class="plain">
</code></pre>
<pre><code class="plain"><strong>Add your sites to the hosts file:</strong></code></pre>
<pre><code class="plain"><code class="plain"><span style="color: #20124d;">sudo nano /etc/hosts </span></code></code><span style="color: #20124d;"><b>OR</b> </span><span style="color: #20124d;">sudo vim /etc/hosts</span></pre>
<pre><code class="plain"><code class="plain"><span style="color: #20124d;">
</span></code></code></pre>
<pre><code class="plain"><code class="plain">It will look like this</code></code></pre>
<pre><code class="plain"><code class="plain"><span style="color: #20124d;">
</span></code></code></pre>
<pre><code class="plain"><code class="plain"><pre><span style="background-color: black; color: white;">127.0.0.1 localhost
127.0.1.1 mahesh-thinkpad
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters</span></pre>
<pre><span style="background-color: black;">
</span></pre>
<pre><span style="background-color: white;">Now add your virtual host names after </span></pre>
<pre><span style="background-color: black; color: white;">127.0.1.1 mahesh-thinkpad</span></pre>
<pre></pre>
<pre><span style="background-color: white;">Like</span></pre>
<pre><span style="background-color: black; color: white;">127.0.01 www.mylocalsite1.com</span></pre>
<pre><pre><span style="background-color: black; color: white;">127.0.01 www.mylocalsite2.com</span></pre>
<pre><span style="background-color: black; color: white;">127.0.01 www.mylocalsite3.com</span></pre>
</pre>
<pre><strong>Configure Apache</strong></pre>
<pre>Open new file sudo vim /etc/apache2/sites-available/mylocalsites</pre>
<pre>and add like this</pre>
<pre></pre>
<pre><VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/mylocalsite1
ServerName mylocalsite1.com
ServerAlias www.mylocalsite1.com
</pre>
<pre> <Directory />
DirectoryIndex index.php index index.html
Options FollowSymLinks
AllowOverride All
</Directory>
</pre>
<pre> <Directory /var/www/html/mylocalsite1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/mylocalsite2
ServerName mylocalsite2.com
ServerAlias www.mylocalsite2.com
<Directory />
DirectoryIndex index.php index index.html
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/html/mylocalsite2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/mylocalsite3
ServerName mylocalsite3.com
ServerAlias www.mylocalsite3.com
<Directory />
DirectoryIndex index.php index index.html
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/html/mylocalsite3/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost></pre>
</code></code></pre>
</div>
<pre><ol style="text-align: left;">
<li><span style="color: purple;">We open the virtual host tag and tell apache to listen to port 80. </span></li>
<li><span style="color: purple;">The DocumentRoot directive tells apache where our site files are stored. </span></li>
<li><span style="color: purple;">ServerName is the server name of our site, the url that we will use to navigate to the site. </span></li>
<li><span style="color: purple;">ServerAlias is any other name or url that we may use to access the site, themostcommon being excluding the www. </span></li>
<li><span style="color: purple;">So basically we’re saying mylocalsite1.com is equivalent to www.mylocalsite1.com</span></li>
</ol>
<div>
<strong>Enable the sites in Apache and restart Apache</strong></div>
<div>
<code class="plain"><span style="color: #20124d;">sudo a2ensite mylocalsites</span></code></div>
<div>
<code class="plain"><span style="color: #20124d;">
</span></code></div>
<div>
<code class="plain">Now reload Aapche</code></div>
<div>
<code class="plain"><span style="color: #20124d;">sudo service apache2 reload/restart</span></code></div>
<div>
<code class="plain"><span style="color: #20124d;">
</span></code></div>
<div>
<code class="plain"><em><strong>Notes:</strong></em>
1. If you navigate to <em>/etc/apache2/sites-enabled</em>, you’ll see a
symlink to each of your sites (in terminal they just look like files,
but if you browse to the folder using your GUI file manager you’ll
notice that they are links). They are placed there by the <em>a2ensite</em> command we execute in the last step.
2. If you need to remove any sites, the cleanest way in my opinion is to reverse through the steps.
- First disable them using the <em>a2dissite</em> command:
sudo a2dissite <span style="color: #20124d;">mylocalsites</span>
- Then delete the mylocalsites file from /etc/apache2/sites-available/ folder.
- Then remove the reference to mylocalsite1.com, mylocalsite2.com, mylocalsite3.com from /etc/hosts
- And finally restart the apache server
</code></div>
<div>
<code class="plain"><span style="color: #20124d;">
</span></code></div>
<div>
<code class="plain"><span style="color: #20124d;">
</span></code></div>
</pre>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-447149610845492402013-04-12T13:14:00.002+05:302013-04-12T13:14:39.612+05:30Find Nth Highest value in array without sorting in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #cc0000;"><b>Find Nth/ N th highest value from given array without using any sorting in PHP</b></span><br />
<br />
$ar<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;">array</span>(23,56,87,12,98,85,24,54,99,100,1,4,5,2,76,37,92);<br />
<br />
$n <span class="Apple-tab-span" style="white-space: pre;"> </span>= <span style="color: red;">count</span>($ar); //5;<br />
<br />
<span style="color: red;">for</span>($i = 0; $i < $n; $i++){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;">echo</span> $a = <span style="color: red;">max</span>($ar); // Get the max value from array // get the Nth value from last loop<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #274e13;">//echo "<br /><pre>"; print_r($ar);</pre>
</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$ar = <span style="color: red;">array_flip</span>($ar); // Flip the array<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #274e13;">//print_r($ar); </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;">unset</span>($ar[$a]); // Unset the max value from array<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #274e13;">//print_r($ar);</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$ar = <span style="color: red;">array_flip</span>($ar); // Flip the array<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;">echo</span> "</div>
";<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;">echo</span> "<hr />
";<br />
}<br />
<br />maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-45272489984700955902013-04-10T13:13:00.003+05:302013-04-10T13:13:43.126+05:30Get repeated rows in based on child table from Parent table<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fselect.html&token=b6486a05d2656a9ce739b56b505eba5d" style="background-color: #e5e5e5; border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; font-family: Verdan, Arial, Tahoma; font-size: 14px; outline: none; text-decoration: none;" target="mysql_doc"><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">SELECT</span></a><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_punct" style="background-color: #e5e5e5; color: magenta; font-family: Verdan, Arial, Tahoma; font-size: 14px;">*</span><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_white syntax_white_newline" style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"></span><br style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;" /><span class="syntax_alpha syntax_alpha_reservedWord" style="background-color: #e5e5e5; color: #990099; font-family: Verdan, Arial, Tahoma; font-size: 14px; font-weight: bold; text-transform: uppercase;">FROM</span><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_quote syntax_quote_backtick" style="background-color: #e5e5e5; color: green; font-family: Verdan, Arial, Tahoma; font-size: 14px; white-space: pre;">`parents`</span><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_white syntax_white_newline" style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"></span><br style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;" /><span class="syntax_alpha syntax_alpha_reservedWord" style="background-color: #e5e5e5; color: #990099; font-family: Verdan, Arial, Tahoma; font-size: 14px; font-weight: bold; text-transform: uppercase;">WHERE</span><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_alpha syntax_alpha_identifier" style="background-color: #e5e5e5; font-family: Verdan, Arial, Tahoma; font-size: 14px;">id</span><br style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;" /><a href="http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fcomparison-operators.html%23function_in&token=b6486a05d2656a9ce739b56b505eba5d" style="background-color: #e5e5e5; border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; font-family: Verdan, Arial, Tahoma; font-size: 14px; outline: none; text-decoration: none;" target="mysql_doc"><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">IN</span></a><span style="background-color: #e5e5e5; color: #444444; font-family: Verdan, Arial, Tahoma; font-size: 14px;"> </span><span class="syntax_punct syntax_punct_bracket_open_round" style="background-color: #e5e5e5; color: magenta; font-family: Verdan, Arial, Tahoma; font-size: 14px;">(</span><br />
<div class="syntax_indent1" style="background-color: #e5e5e5; font-family: Verdan, Arial, Tahoma; font-size: 14px; margin-left: 1em;">
<span style="color: #444444;"><span class="syntax_white syntax_white_newline"></span></span><br /><a href="http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fselect.html&token=b6486a05d2656a9ce739b56b505eba5d" style="border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; outline: none; text-decoration: none;" target="mysql_doc"><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">SELECT</span></a><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_identifier" style="color: black;">parent_id</span><span style="color: #444444;"><span class="syntax_white syntax_white_newline"></span></span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">FROM</span><span style="color: #444444;"> </span><span class="syntax_quote syntax_quote_backtick" style="color: green; white-space: pre;">`tbl_parent_child`</span><span style="color: #444444;"> <span class="syntax_white syntax_white_newline"></span></span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">GROUP</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">BY</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_identifier" style="color: black;">parent_id</span><span style="color: #444444;"><span class="syntax_white syntax_white_newline"></span></span><br /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: #990099; font-weight: bold; text-transform: uppercase;">HAVING</span><span style="color: #444444;"> </span><a href="http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fgroup-by-functions.html%23function_count&token=b6486a05d2656a9ce739b56b505eba5d" style="border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; outline: none; text-decoration: none;" target="mysql_doc"><span class="syntax_alpha syntax_alpha_functionName" style="color: red; text-transform: uppercase;">COUNT</span></a><span class="syntax_punct syntax_punct_bracket_open_round" style="color: magenta;">(</span><span style="color: #444444;"> </span><span class="syntax_alpha syntax_alpha_identifier" style="color: black;">parent_id</span><span style="color: #444444;"> </span><span class="syntax_punct syntax_punct_bracket_close_round" style="color: magenta;">)</span><span style="color: #444444;"> </span><span class="syntax_punct" style="border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; cursor: pointer; outline: none; text-decoration: none;"><a href="http://localhost/phpmyadmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Fcomparison-operators.html%23operator_equal&token=b6486a05d2656a9ce739b56b505eba5d" style="border-bottom-color: black; border-bottom-style: dotted; border-bottom-width: 1px; color: #235a81; cursor: pointer; outline: none; text-decoration: none;" target="mysql_doc">=</a><span style="color: teal;">2</span></span><span style="color: #444444;"><span class="syntax_white syntax_white_newline"></span></span></div>
<span class="syntax_punct syntax_punct_bracket_close_round" style="background-color: #e5e5e5; color: magenta; font-family: Verdan, Arial, Tahoma; font-size: 14px;">)</span></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-45906941886468056102013-04-06T08:38:00.004+05:302013-04-06T08:40:04.611+05:30Mysql InnoDB optimization<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="background-color: #f4f4f4; border: 0px; color: #333333; font-family: Arial, Tahoma, Verdana, FreeSans, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 5px; outline: 0px; padding: 5px 0px; vertical-align: baseline;">
<code style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">query_cache_size = 512M<br />query_cache_limit = 256M</code></div>
<div style="background-color: #f4f4f4; border: 0px; color: #333333; font-family: Arial, Tahoma, Verdana, FreeSans, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 5px; outline: 0px; padding: 5px 0px; vertical-align: baseline;">
tmp_table_size = 256M<br />
key_buffer_size = 64M<br />
read_buffer_size = 128M<br />
read_rnd_buffer_size = 128M<br />
bulk_insert_buffer_size = 64M<br />
myisam_sort_buffer_size = 128M<br />
myisam_max_sort_file_size = 128M<br />
myisam_max_extra_sort_file_size = 128M<br />
myisam_repair_threads = 2<br />
myisam_recover</div>
<div style="background-color: #f4f4f4; border: 0px; color: #333333; font-family: Arial, Tahoma, Verdana, FreeSans, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 5px; outline: 0px; padding: 5px 0px; vertical-align: baseline;">
innodb_additional_mem_pool_size = 256M<br />
innodb_log_buffer_size = 128M<br />
innodb_log_file_size = 128M<br />
innodb_log_files_in_group = 2<br />
innodb_flush_log_at_trx_commit = 0<br />
innodb_buffer_pool_size = 512M<br />
innodb_data_home_dir = /var/lib/mysql/<br />
innodb_data_file_path = ibdata1:256M:autoextend<br />
innodb_autoextend_increment=32<br />
<br />
<span style="background-color: #e7e7e7; color: #777777;">max_allowed_packet = 16M</span><br style="background-color: #e7e7e7; color: #777777;" /><span style="background-color: #e7e7e7; color: #777777;">wait_timeout = 1800</span><br style="background-color: #e7e7e7; color: #777777;" /><span style="background-color: #e7e7e7; color: #777777;">connect_timeout = 120</span></div>
<div style="background-color: #f4f4f4; border: 0px; color: #333333; font-family: Arial, Tahoma, Verdana, FreeSans, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 5px; outline: 0px; padding: 5px 0px; vertical-align: baseline;">
Notice the above is adjusted for a DB dedicated server with 2GB of RAM.</div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-2558939920753975882013-03-05T21:24:00.002+05:302013-11-20T12:16:46.822+05:30Magento Interview Questions and Answers<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://daivalaravuru.com/magento_int_q_a.html" target="_blank">Magento Interview Q & A</a><br />
<br />
<br /></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-87516752440598079812013-02-26T11:16:00.001+05:302013-02-26T11:16:05.065+05:30What Is The Universe?<iframe allowfullscreen="" frameborder="0" height="270" src="http://www.youtube.com/embed/nrTsvn9usVQ" width="480"></iframe>maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-1430706862207516952013-01-23T12:01:00.003+05:302014-01-13T19:18:40.532+05:30Sanitize Phone no, if phone no length is more than 10 then, Remove 0, +91, 91 from phone no<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
Sanitize Phone no, if phone no length is more than 10 then, Remove 0, +91, 91 from phone no.<br />
All Indian phone no's length is 10 digits including with STD code<br />
<br />
<br />
<br />
/**<br />
* Sanitize Phone no, if phone no length is more than 10 then<br />
*/<br />
function sanitizePhoneNo(phone){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(phone.length >= 10) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(phone[0] == 0) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>phone<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>makePNo(phone, 1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}else if( (phone[0] == 9) && (phone[1] == 1) ){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>phone<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>makePNo(phone, 2);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}else if( (phone[0] == '+') && (phone[1] == 9) && (phone[2] == 1) ){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>phone<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>makePNo(phone, 3);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return phone;<br />
}<br />
function makePNo(val, cnt){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var a='';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>for(var i=0; i<=(val.length)-1; i++){ if(i>=cnt){ a += val[i];} }<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return a;<br />
}<br />
<br />
<br />
/**<br />
* Validate Phone no with regular expression<br />
*/<br />
function validatePhoneNo(phone){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if( /^[0-9\ \-]+$/.test(phone)){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(phone.length==10){return true;}else {return false;}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}else {return false;}<br />
}<br />
<br /></div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-8926296292624193052013-01-18T10:52:00.001+05:302013-01-18T10:52:58.771+05:30Lok Satta Videos: Lok Satta Leader Hyma With Kommineni Srinivas Rao ...<a href="http://www.loksattavideos.com/2013/01/lok-satta-leader-hyma-with-kommineni.html?spref=bl">Lok Satta Videos: Lok Satta Leader Hyma With Kommineni Srinivas Rao ...</a>maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0tag:blogger.com,1999:blog-2625841984973898434.post-56194664751205516392012-12-28T11:41:00.000+05:302012-12-28T11:41:12.046+05:30MAGENTO, How to find Product Tax Rate OR Tax Percentage<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: red;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #6aa84f;">## MAGENTO, How to find Product tax rate</span><br />
<span style="color: #6aa84f;"><br /></span>
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">foreach</span> ($productIds <span style="color: blue;">as</span> $productId) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #674ea7;">$_product<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>Mage::getModel('catalog/product')->load($productId);<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: #674ea7;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$productsPrice<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>floatval($_product->getData("price"));<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #6aa84f;">// Get the product's tax class' ID</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #351c75;">$taxClassId<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>$_product->getData("tax_class_id");</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">echo</span> 'Tax Class ID '.$taxClassId.'<br />';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #6aa84f;">// Get the tax rates of each tax class in an associative array</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #351c75;">$taxClasses<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>Mage::helper("core")->jsonDecode( Mage::helper("tax")- </span><br />
<span style="color: #351c75;">>getAllRatesByProductClass() );</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">echo </span><span style="color: #351c75;">'Tax Classes '.$taxClasses.'<br />';</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #6aa84f;">// Extract the tax rate from the array</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #351c75;">$taxRate<span class="Apple-tab-span" style="white-space: pre;"> </span>=<span class="Apple-tab-span" style="white-space: pre;"> </span>$taxClasses["value_".$taxClassId];</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">echo</span> <span style="color: #351c75;">'Tax Rate '.$taxRate.'<br />';</span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="background-color: white;"><span style="color: red;">?></span></span><br />
</div>
</div>
maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com2tag:blogger.com,1999:blog-2625841984973898434.post-11058441104179467092012-11-24T12:37:00.001+05:302012-11-24T12:37:37.961+05:30Lok Satta Videos: Short Film for Surajya Udyamam<a href="http://www.loksattavideos.com/2012/11/short-film-for-surajya-udyamam.html?spref=bl">Lok Satta Videos: Short Film for Surajya Udyamam</a>maheshbokkisamhttp://www.blogger.com/profile/08153830538867585124noreply@blogger.com0