tag:blogger.com,1999:blog-13203842674406435852024-03-13T07:27:38.463-07:00Dhanesh Manephp developer and Lamp professional.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.comBlogger30125tag:blogger.com,1999:blog-1320384267440643585.post-79529941772706395842015-01-14T06:40:00.001-08:002015-01-14T06:47:20.997-08:00how to restart Cron or Crond Service linux<div dir="ltr" style="text-align: left;" trbidi="on">
How to restart the Cron/Crond service under Linux / UNIX / ubuntu like os?<br />
<br />
<b>Whats is Crond?</b><br />
While developing any kind of application, we always need to do some common task on some specific time interval. We can simply call such activity as scheduled activity, e.g execute set of commands after every hour. Crond is the service which helps us to do so in linux operating systems.<br />
<br />
Use following commands.<br />
<br />
<b>How to start Cron service</b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code># /etc/init.d/crond start
</code></pre>
<br />
<b>How to Stop cron service</b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code># /etc/init.d/crond stop
</code></pre>
<br />
<b>How to Restart cron service</b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code># /etc/init.d/crond restart
</code></pre>
</div>
Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-73887887044887421982013-04-18T08:01:00.000-07:002013-04-18T08:05:45.580-07:00kyun ke tum hi ho aashiqui 2 guitar tabs lesson <div dir="ltr" style="text-align: left;" trbidi="on">
Guitar tabs of the title song from movie "Aashiqui 2" (Intro part). Kyun ki Tum hi ho, ab tum hi ho,.. Zindagi ab tum hi ho is a very romantic song by Arijit Singh. I am trying to play this on guitar, so check and leave your comments. :)
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/OYgq56722Mw" width="420"></iframe>
<br />
<div>
<div>
How to play this song on Guitar? --> Check out the following notes.<br />
__________Guitar Tabs___________</div>
<div>
<br /></div>
<div>
E|——--1————————————</div>
<div>
B|--1--1—-4--4--2--1———2------1--1</div>
<div>
G|————————----1--3—————-</div>
<div>
Hum tere bin, Ab reh nahi sakte</div>
<div>
<br /></div>
<div>
G|--3--3----1--3--1--0——-0—--</div>
<div>
D|———————----------1--3—--3--</div>
<div>
Tere bina kya vajoodh mera</div>
<div>
<br /></div>
<div>
E|——--1————————————</div>
<div>
B|--1--1—-4--4--2--1———2------1--1</div>
<div>
G|————————----1--3—————-</div>
<div>
Tujhse jhuda agar ho jayenge</div>
<div>
<br /></div>
<div>
G|--3--3----1--3--1--0——-0—--</div>
<div>
D|———————----------1--3—--3--</div>
<div>
Toh khud se hi ho jayenge jhuda</div>
<div>
<br /></div>
<div>
B|———1—————--1———</div>
<div>
G|--1--3—--1--3—-1--3—--</div>
<div>
Kyunki tum hi ho, Ab tum hi ho</div>
<div>
<br /></div>
<div>
G|--0--3--1—--0—-0————----</div>
<div>
D|—————————3—--1--3—————-</div>
<div>
Zindagi ab tum hi ho............Melody</div>
<div>
<br /></div>
<div>
Best Luck</div>
</div>
</div>
Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com2tag:blogger.com,1999:blog-1320384267440643585.post-577976038266016982013-02-20T03:12:00.000-08:002013-02-20T03:12:59.337-08:00Enabling query log in MySQL 5.5.28<div dir="ltr" style="text-align: left;" trbidi="on">
Enabling query log in MySQL Version : 5.5.28<div>
<br /></div>
<div>
MySQL has very strong system to log queries and events, It allows you to log </div>
<div>
</div>
<div>
1. General queries - General record of <b>mysqld </b>activities.<br /><div>
</div>
<div>
2. Binary log - These are nothing but events describing the changes in database e.g. table creation. It plays important role during database replication.</div>
<div>
<br /></div>
<div>
3. Error logs - It logs all critical errors during of running MySQL server. MySQL is smart , if it finds any table that needs automatic repair then it updates error log file with respected message.</div>
<div>
<br /><div>
4. Slow query log - MySQL can store SQL statements which takes more time than long_query_time seconds, defined in my.cnf file, which is configuration file of MySQL server. The default value of this variable is 10. This is very important step in order to optimize the MySQL server performance by identifying slow queries.</div>
</div>
</div>
<div>
<br /></div>
<div>
That's not enough about log, but just gave you rough idea about its log system, lets see how to enable different logs in MySQL.</div>
<div>
<br /></div>
<div>
<b>1. General Query Log - </b></div>
<div>
OS : Ubuntu 12.04.1 LTS</div>
<div>
MySQL version : 5.5.28</div>
<div>
<br /></div>
<div>
1. Locate and edit my.cnf file. We need to change two variables in this file to enable general query log. </div>
<div>
a. sudo gedit /etc/mysql/my.cnf</div>
<div>
b. Locate this variable in the file : <b>general_log_file</b></div>
<div>
c. It must have some default value, this variable is nothing but the path of log file.</div>
<div>
d. The default value is "/var/log/mysql/mysql.log", you can change it as per your wish.</div>
<div>
e. Now locate variable "<b>general_log</b>", and set it to 1. The means turning on the log system.</div>
<div>
f. Now restart the MySQL server by running : sudo service mysql restart</div>
<div>
d. now if you open the mysql.log file, you can see all SQL queries in it. :)</div>
<div>
<br /></div>
<div>
Will update the steps for other log system soon. :)</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-68273828014269048452012-12-16T23:09:00.001-08:002013-01-15T05:27:28.778-08:00Natrang Intro guitar full Tabs<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Checkout Natarang intro guitar tabs. I will try to upload the text format of tabs soon.</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/AVvXsEjebQt9DxiU4GJfGJn6KMda8iTjAlvd4zzSW3mXinlUdvAh65JsLfRuxhxNilMXsvpjM6AXCmPF1EpkxiZB7j_1n1DGTWqWmOkVu0BL1O6s66HdODYGvPiFkqOh83ZmAw78zbeKgqGti64/s1600/natarang-full-tablatures-guitar-tabs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjebQt9DxiU4GJfGJn6KMda8iTjAlvd4zzSW3mXinlUdvAh65JsLfRuxhxNilMXsvpjM6AXCmPF1EpkxiZB7j_1n1DGTWqWmOkVu0BL1O6s66HdODYGvPiFkqOh83ZmAw78zbeKgqGti64/s400/natarang-full-tablatures-guitar-tabs.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<center>
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/VNgvU8TzDjc?rel=0" width="420"></iframe></center>
</div>
Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com4tag:blogger.com,1999:blog-1320384267440643585.post-52541133145485715542012-10-01T00:32:00.000-07:002012-10-01T00:38:13.947-07:00Facebook funny cover picture<div dir="ltr" style="text-align: left;" trbidi="on">
Checkout these funny and creative facebook cover images. I am also giving raw files which you can use to for your facebookcover pages too.<br />
<br />
___________________________________________________<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnkv8zhYYO3hK1Pg35TdgLSKIADdW9t-eqcn1ROw-joXCJ_N0KVei-1LAt9NynvkNEML0a15KUl6cHWDxJjNThTCpf8wLW4x5tY3VCf8EP3YqWzAx7xo1JFuMFKmLuXx6H04GLI1HcbXM/s1600/think-cover.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnkv8zhYYO3hK1Pg35TdgLSKIADdW9t-eqcn1ROw-joXCJ_N0KVei-1LAt9NynvkNEML0a15KUl6cHWDxJjNThTCpf8wLW4x5tY3VCf8EP3YqWzAx7xo1JFuMFKmLuXx6H04GLI1HcbXM/s400/think-cover.png" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
___________________________________________________<br />
<br />
Here is a Raw file for you, you can use this as cover background and put some nice matching profile pic and your creative facebook cover is ready.
<br />
___________________________________________________<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPFsjv0H0a3ngHFYrWRcC7G5G579qAYQE_65gHi9aw1X5ybQEL9yko8RM3KIe8FSFRH7UhyyLocJkmhmygSY6o-ycx2qfyGUzvsbCuOYXxlYPtEfgQEWk4e7681EjIdpEprhX0GWmUzsQ/s1600/think.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPFsjv0H0a3ngHFYrWRcC7G5G579qAYQE_65gHi9aw1X5ybQEL9yko8RM3KIe8FSFRH7UhyyLocJkmhmygSY6o-ycx2qfyGUzvsbCuOYXxlYPtEfgQEWk4e7681EjIdpEprhX0GWmUzsQ/s400/think.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-85083450819861427052012-05-29T01:27:00.000-07:002012-05-29T01:36:52.053-07:00how to enable internet when vpn is connected - WINDOWS 7This week I started using my VPN connection for some work. But I notice that whenever I connect my VPN, my machine was loosing the local internet connection. Previously it was not the issue with my machine, but it started appearing once I started using wifi for local internet connection. I am using WINDOWS 7 machine. Here is a fix for this issue.<br/><br/>
How to enable local internet connection while using VPN network.<br/>
1. <b>Right click</b> on the <b>VPN</b> connector in your network connections.<br/>
2. Click <b>properties</b>.<br/>
3. Then click on the <b>networking</b> tab.<br/>
4. Then click on TCP/IP settings. i.e.(<b>Internet protocol version 4</b>..)<br/>
5. Then click on <b>Properties button</b> to view "Internet protocol version 4" properties.<br/>
6. This will open a new window.<br/>
7. Click on <b>advanced button</b>.<br/>
8. Now under <b>IP-settings tab</b> you will find a check box which reads "<b>Use default gateway on remote network</b>".<br/>
9. <b>UNCHECK</b> this checkboox.<br/>
10. <b>Save</b> all settings.<br/>
11. <b>Done</b>.<br/>
<br/>This will surely get your internet back while connecting VPN.<br/>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-45970410345087233052012-05-25T07:20:00.001-07:002012-05-25T07:22:36.719-07:005th metatarcel bone brokenBroken 5th metatarcel bone.
Day 1 & 2 Pics
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNjznptygjkZdgsKKlcVqcwEpU2W7ll1EHHTrwQWTsyLZKT6mS79UYj3jJvESlq-Y-AixFK7c7FinoYVU-mMTNXa-AXkTXl0ZPR-Vl4BzjEyQmAtaDMmjKd4fo-YBaKuXjwmZltNdDBOw/s1600/DSC00918.JPG" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNjznptygjkZdgsKKlcVqcwEpU2W7ll1EHHTrwQWTsyLZKT6mS79UYj3jJvESlq-Y-AixFK7c7FinoYVU-mMTNXa-AXkTXl0ZPR-Vl4BzjEyQmAtaDMmjKd4fo-YBaKuXjwmZltNdDBOw/s400/DSC00918.JPG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieGXJ0MU3eQupaAHfPq8MtzlBz-4s4Y2JwJ3k0SXYdO98bv4sOcXDeZFErMv_dwJdXQmSgurRL_JKGDdtkYGaJgw7YeNVEC6_vb1cyBdBgKHqY3UKveNrsA95B-dDqNu2ascvl7sUMN14/s1600/DSC00919-1.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieGXJ0MU3eQupaAHfPq8MtzlBz-4s4Y2JwJ3k0SXYdO98bv4sOcXDeZFErMv_dwJdXQmSgurRL_JKGDdtkYGaJgw7YeNVEC6_vb1cyBdBgKHqY3UKveNrsA95B-dDqNu2ascvl7sUMN14/s400/DSC00919-1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrzz_9_iA5HoW0ccT3-xX1_f1955a1IDwewkBrJksegZJgg1TC4yRQzJCL6qq68NGs0BZ_UynaRxgh_1vW7GPvnP5hT85K8Zsfk650CNWsctdYNEg6wRgOXYtTC9tVKSXHtjz_NkHeE6I/s1600/DSC00921.JPG" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrzz_9_iA5HoW0ccT3-xX1_f1955a1IDwewkBrJksegZJgg1TC4yRQzJCL6qq68NGs0BZ_UynaRxgh_1vW7GPvnP5hT85K8Zsfk650CNWsctdYNEg6wRgOXYtTC9tVKSXHtjz_NkHeE6I/s400/DSC00921.JPG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE4x9JTUNFw86cpaDLYchwABlQi6G_8Hr7gWxgJf_npzAAT3YV9ul3A6t5KiPogOxpTSSOz7H_UEAotD9lrpqTeEnX13EJpziTWDF-V_bGpZ9Vh2ReNcKGJvT4TAtaab77di9zoe-tiFg/s1600/DSC00922-1.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE4x9JTUNFw86cpaDLYchwABlQi6G_8Hr7gWxgJf_npzAAT3YV9ul3A6t5KiPogOxpTSSOz7H_UEAotD9lrpqTeEnX13EJpziTWDF-V_bGpZ9Vh2ReNcKGJvT4TAtaab77di9zoe-tiFg/s400/DSC00922-1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-YfH3Wn7B1UIsXE5qacGBq89nkoUfXops6dpEtCrXalwVnQuqY-hFFY6Fky_ZQinVzET8zPp4K_W0KQtfaP0Qx54Zu_UcI1dJa9nWlxB_KksdOyF1YF8SnGTIU3l1jnVeU9fdFrUgS0A/s1600/DSC00929.JPG" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-YfH3Wn7B1UIsXE5qacGBq89nkoUfXops6dpEtCrXalwVnQuqY-hFFY6Fky_ZQinVzET8zPp4K_W0KQtfaP0Qx54Zu_UcI1dJa9nWlxB_KksdOyF1YF8SnGTIU3l1jnVeU9fdFrUgS0A/s400/DSC00929.JPG" /></a></div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com2tag:blogger.com,1999:blog-1320384267440643585.post-49007676808195359752012-04-10T03:20:00.005-07:002012-04-10T03:39:38.387-07:00How to add dynamic rule to jQuery validator<div dir="ltr" style="text-align: left;" trbidi="on">"<span style="color:#FFAA00"><b>jQuery validator</b></span>" is really a very good plugin for validating your web forms on client side. Why I am recommending this plugin is because its flexibility and set of methods which offers complete customization. Plugin offers lots of different methods so that you can customize it as per your requirement very easily. I have used it in many applications. There are many other jQuery based form validation tools which actually using this plugin as back bone of there plugins.<br />
<br />
I was working on one application yesterday in which I need to load some form fields dynamically from AJAX call. In this case once input fields are populated in your form you may need to apply validation rule for these fields. This step is necessary because the original <span style="color:#FFAA00"><b>$("#formId").validate</b></span> method was initiated during the page load. So how to add dynamic rule to jQuery validator?? check the following solution.<br />
<br />
If you want to add validation rule to form which is already loaded then its kind of tricky and you may need to use following function.<br />
<br />
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>$("#synamicFieldId1").rules("add", {validateApp:['parameter1','parameter2']});
</code></pre><br />
You can find the <span style="color:#FFAA00"><b>.rules() documentation</b></span> with more <a href="http://docs.jquery.com/Types#Options" rel="nofollow">examples</a> here.<br />
<br />
</div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-9464697539263726882012-03-11T23:22:00.003-07:002012-03-12T23:19:22.526-07:00Is Twitter a Waste of Time?<div dir="ltr" style="text-align: left;" trbidi="on">Twitter! What is it?<br />
<br />
Internet world has one thumb rule these days, If you don't know any thing then there is only one god GOOGLE, so just ask Google. People ask almost everything to Google :). Believe it see the following example.<br />
<br />
Take a look at this funny image, I took this screenshot on Google search page with keyword <b>Twitter is a</b>. <br />
If you look at the first suggestion it says "Twitter is a waste of time". that's so funny. It means people use to search this phrase so many times that Google suggest is giving importance to this keyword more than other keywords. :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimeNpAR9oChA161n0tBS6EvFHRXyBLSkkHm8wUcrvwJRevZZ2whv-Juxli1NtWTOXFTCzHF4QNPUcQv77CQFc3u1QOhjsaX_2oPG4JYwkhtExix5xYK-SsLz8o5sN5SfBEi0s0BVCgQeA/s1600/twitter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimeNpAR9oChA161n0tBS6EvFHRXyBLSkkHm8wUcrvwJRevZZ2whv-Juxli1NtWTOXFTCzHF4QNPUcQv77CQFc3u1QOhjsaX_2oPG4JYwkhtExix5xYK-SsLz8o5sN5SfBEi0s0BVCgQeA/s640/twitter.png" width="640" /></a></div><br />
<br />
Lots of friends of mine are not actually using twitter but everyone of them says twitter is just a waste of time. What I think is they just don't know how to use it. Twitter is a invention of micro blogging, and its just cool tool , use it in a right way.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi4fnLCYj1IA78DvzPyYpW1qwwx4shQA92C7PJXPKt-toEWv0m9sz6JlivVCZ8miYxy7k4_y7Bqhyphenhyphen_ecRtEK9frd2_oXiNx-p1Lv5AEHNqzVez4772O5oby9fhPxIAUe4hHDCR89w5WoE/s1600/twitter1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi4fnLCYj1IA78DvzPyYpW1qwwx4shQA92C7PJXPKt-toEWv0m9sz6JlivVCZ8miYxy7k4_y7Bqhyphenhyphen_ecRtEK9frd2_oXiNx-p1Lv5AEHNqzVez4772O5oby9fhPxIAUe4hHDCR89w5WoE/s1600/twitter1.jpg" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br />
</div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com1tag:blogger.com,1999:blog-1320384267440643585.post-42605853102334768152012-01-28T11:50:00.000-08:002012-01-28T11:50:40.719-08:00CSS1 vs CSS2 & SEOThis post will help you to understand the primary features in CSS2 which are not there in CSS1 and how CSS2 techniques are going to help you in SEO. CSS1 is published in 1996 and CSS2 is published in year 1998. All major browsers supports practically 99.9% of CSS2. I was googlin for the difference between CSS1 and CSS2 and landed on a very good website and found really dam important information about new tags introduced in CSS2. You can check all of them on this website > <a href="http://xahlee.org/js/css2.html" rel="external nofollow">http://xahlee.org/js/css2.html</a>. <br />
<br />
Google bot and other search engines does consider uncompressed HTML size of your webpage, so even if we are using gzip compression techniques, we have to think about the uncompressed HTML size. One of my website's home page is of size 59.23 kb. The which I used to test my site have suggested CSS2 based layout and its new techniques which really helps a lot to reduce your page size. I am working on some of the new tags implementations which will help me to reduce the size of CSS file as well as my HTML page size.<br />
<br />
There are few more CSS techniques which helps us to increase the speed of our website. One of the very popular technique is "CSS Sprites". CSS Sprites is basically a technique which combines all small images on your web page in to one big image. In this case we have to just load a single image instead of loading lots of small images separately, this saves a lot of browsers time to make n no of http requests to server so increases speed of your website.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-68557721087027928912011-12-15T22:35:00.000-08:002011-12-15T22:35:07.051-08:00php best practices 1 - Handle unexpected conditionsAre you handling all the possible conditions under which your programs will run?<br />
<br />
For instance, do you always have a "default" case in you "switch" statements?<br />
<br />
switch($some_value)<br />
{<br />
case 1:<br />
$another_value = 1;<br />
break;<br />
case 2:<br />
$another_value = 4;<br />
break;<br />
}<br />
return(1 / $another_value);<br />
<br />
What if $some_value is not 1 nor 2?<br />
<br />
Notice: Undefined variable: another_value<br />
<br />
Warning: Division by zero<br />
<br />
What about "if" conditions? Do you have an "else" code section to all important "if" statements?<br />
<br />
If your program is not expecting certain conditions but those conditions are not impossible to occur, having simple calls to error_log may help you to be aware of the problems under unexpected situations.<br />
<br />
switch($some_value)<br />
{<br />
case 1:<br />
$another_value = 1;<br />
break;<br />
case 2:<br />
$another_value = 4;<br />
break;<br />
default:<br />
error_log('unexpected some_value '.$some_value.' found ');<br />
exit;<br />
}Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-4908398040497092812011-07-26T23:23:00.000-07:002011-07-26T23:26:16.056-07:00php framework comparison - performance comparisonsI am writing this post regarding PHP framework performance comparisons. There are lots of PHP frameworks available and every framework has its own advantages and disadvantages. As all frameworks are based on MVC and thus adopting any of them for product development is not that difficult. Normally developers check for no of libraries load time and some important features like ORM. Also you can check that which framework supports which php version.<br />
<br />
Here is a simple chart which programmers can use while choosing the suitable framework for their projects.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcknZ9bKUYKLDnYEpB5Z7Zfk85DuEUgPgSZTGnBtzTd8GLDnI8JtFPucvbhaqPQPPtLQx_h6HNSNnZN6LIEhyOQsqK6FcQsoI9oPGrjARNfzEn9u5Q_ugtdergZDV20wjeBgnIMKGD7OY/s1600/PHP-Framework-comparison-chart-ci-zend-zoop-cakephp-symfony-seagull.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="243" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcknZ9bKUYKLDnYEpB5Z7Zfk85DuEUgPgSZTGnBtzTd8GLDnI8JtFPucvbhaqPQPPtLQx_h6HNSNnZN6LIEhyOQsqK6FcQsoI9oPGrjARNfzEn9u5Q_ugtdergZDV20wjeBgnIMKGD7OY/s400/PHP-Framework-comparison-chart-ci-zend-zoop-cakephp-symfony-seagull.png" /></a></div><br />
<br />
phpframeworks[.]com also have explained this thing in detail. You can check that also.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-35479534816771808072011-07-21T01:07:00.000-07:002011-07-21T01:07:59.715-07:00Jquery plugin to read query string - how toIf you are looking for some jQuery plugin to read the query string parameters then you are on right page. Here is a simple function which will help you to understand how to detect/read the values of query string parameters.<br />
<br />
<strong>Jquery Plugin</strong><br />
<code><br />
$.queryParam = function(name){<br />
<br />
var answer = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);<br />
<br />
if (!answer)<br />
{ <br />
return 0; <br />
}<br />
return answer[1] || 0;<br />
}<br />
</code><br />
<br />
<strong>How to use</strong><br />
var paramValue = $.queryParam('paramName');Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-21322128570205486952011-07-06T02:49:00.000-07:002011-07-06T02:59:51.740-07:00get X days back date from current date<h2>How to get 7(X) days back date from current date?</H2>PHP is very strong server side programming language which simplifies lots of small small tasks like converting date formats etc. <br />
<br />
I was working on some task, where I was suppose to get 7 days back date from current date. Actually the task is very simple, I am sharing the code here. Have a look at it and let me know if any one can find better way than this. <br />
<br />
<br />
$format = 'YmdhIS'; // YOU CAN USE ANY FORMAT WHICH YOU WANT<br />
<br />
$date = date ( $format );<br />
<br />
// - 7 days from today<br />
$prevDate = date ( $format, strtotime ( '-7 day' . $date ) ); <br />
<br />
<b>Note:</b> If you want to get <b>yesterdays</b> date then simply do -1 instead of -7.<br />
<br />
<h2>How to get 7(X) months back month from current month?</H2>// - 7 months from today<br />
$prevDate = date ( $format, strtotime ( '-7 month' . $date ) );<br />
<br />
Its so simple.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-66189902837851852732011-04-21T04:52:00.000-07:002011-04-21T04:52:18.723-07:00Problems in enum data type mysql<div dir="ltr" style="text-align: left;" trbidi="on">MySQL ENUM data type looks like a Hot SPOT among all developers n database designers. We all know about ENUM data type, but do we really know disadvantages or lets say problems of using ENUM data type while designing tables.<br />
<br />
I was wondering what could be the reason that most of geeks don't want to use this data type, I just googled out some info about it and came across some very serious issues, so sharing on my blog.<br />
<br />
<br />
<b>1. Changing the member list of ENUM columns is very expensive.</b><br />
<br />
If your table has more than <u><i>millions records</i></u> and you are trying to change any thing in the column which has data type ENUM, then mysql rebuild complete table and look in to every row in that table. This may take lots of time may be hours and thus <b>downtime</b>. So lets create equation <br />
<br />
Server Downtime = MySQL table with ENUM data type + millions of records. Lol.<br />
<br />
<b>2. ENUM has limited portability with other databases.</b><br />
ENUM is not a standard SQL and lots of other databases doesn't have native support for ENUM.<br />
<br />
<br />
Well there are lots of more issues with ENUM data type, I would like to share some links which may help you to take decision while using ENUM in your database. Check these links for sure , great information shared on it.<br />
<br />
<a href="http://www.mysqlperformanceblog.com/?s=mysql+problems+with+enum" target="_blank" rel="nofollow">Link 1</a><br />
<a href="http://komlenic.com/244/8-reasons-why-mysqls-enum-data-type-is-evil/" target="_blank" rel="nofollow">Link 2</a><br />
</div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-72853603602267647112011-03-18T02:25:00.000-07:002011-03-18T02:29:16.125-07:00How to theme search results drupal 6.x<div dir="ltr" style="text-align: left;" trbidi="on">Drupal 6 comes up with preprocess functions and templates which makes theming job easier. So here is my first post to make your theming job easier with drupal 6.x.<br />
<br />
Lets take a scenario of having some text below each result in search result page, could be any kind of ad or some image or any HTMl component.<br />
<br />
Step 1. Define a variable in a preprocess function in template.php file.<br />
Step 2. Copy the search-result.tpl.php file from /modules/search directory to your current theme folder.<br />
Step 3. echo the defined variable in the search-result.tpl.php file.<br />
Step 4. Clear the template cache.<br />
<br />
<br />
<b>Step 1. Define a variable in a preprocess function in template.php file.</b><br />
Append following code to template.php in current theme<b>. </b><br />
<br />
<div class="codeblock"><code><span style="color: black;"><span style="color: #0000bb;"></span><span style="color: #007700;">function </span><span style="color: #0000bb;">mytheme_preprocess_search_result </span><span style="color: #007700;">(&</span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">) {<br />
</span><span style="color: #0000bb;">$vars</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'my_variable'</span><span style="color: #007700;">] = </span><span style="color: #0000bb;">t</span><span style="color: #007700;">(</span><span style="color: #dd0000;">'I am here'</span><span style="color: #007700;">);<br />
}</span></span></code></div><br />
<br />
<b>Step 2. This is self explanatory </b><br />
<br />
<b>Step 3. echo the defined variable in the search-result.tpl.php file.</b><br />
Append following code at end of search-result.tpl.php<br />
<code><span style="color: black;"><span style="color: #007700;">if (!empty(</span><span style="color: #0000bb;">$my_variable</span><span style="color: #007700;">)) { </span></span><br />
echo <span style="color: black;"><span style="color: #0000bb;">$my_variable</span></span></code><code><span style="color: #007700;">;</span></code><br />
<span style="color: black;"><span style="color: #0000bb;"> }</span><span style="color: #0000bb;"></span></span><br />
<b>Step 4. Clear the template cache.</b><br />
<br />
Now you can edit these files and can customize your search result page.<b> :)</b><br />
<br />
</div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-35343670991253994452011-02-21T22:16:00.000-08:002011-02-21T22:16:04.206-08:00Do not register Youmint.com<div dir="ltr" style="text-align: left;" trbidi="on"><div style="color: red;"><span style="font-size: large;">Do not register on Youmint.com</span></div>Website is not at all secure , Don't believe.<br />
<br />
If you are technical person then you can see that while registering the form data is sent via GET method and your personal data is passed to server without encryption. Password and all details are sent via GET method. I don't even Want to check what features they are providing after registration if this is the start.<br />
<br />
► I am not the alone ◄ Check what other blogger are saying<br />
<a href="http://yakpad10.blogspot.com/2008/04/do-not-sign-up-for-youmintcom.html" rel="nofollow">sumans blog</a></div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-34153788457546351362011-02-07T01:43:00.000-08:002011-02-07T01:43:44.384-08:00replace last occurrence of substring from string in phpAre you looking out for a built in function in php which replace last occurrence of sub string from string??<br />
<br />
You are at right place then. check out the function below which easily replaces the last occurrence of sub string from supplied string.<br />
<br />
<ol class="code"><li>function str_lreplace(mixed $search, mixed $replace, mixed $subject)</li>
<li> {</li>
<li> return substr_replace($subject, $replace, strrpos($subject, $search), strlen($search));</li>
<li> }</li>
</ol>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com1tag:blogger.com,1999:blog-1320384267440643585.post-19712496807098515232011-01-03T20:57:00.000-08:002011-01-03T21:02:01.861-08:00Life becomes for Commuters in Pune<b>Google launched Transit service in Pune (in partnership with PMPML)</b><br />
<br />
Public transport is a vital part of the infrastructure that makes our cities run efficiently, and can help mitigate congestion, environmental concerns, and increasing energy costs. Google earlier launched <b>Transit in Banglore and delhi </b>and now they come up with the idea in pune, making millions of commuters happy, as they can find out <b>bus schedules</b> and routes for 320 of PMPML buses via Google Maps on desktop and mobile.<br />
<br />
<br />
As an example, here is the route from <a href="http://maps.google.co.in/maps?f=d&source=s_d&saddr=pune+university+gate&daddr=M.G.+Road,+Camp,+Pune,+Maharashtra,+India&hl=en&geocode=;FXx8GgEd7UxnBCktKaTySMDCOzGIg7_HwVgEhg&mra=ls&dirflg=r&ttype=dep&date=11/06/10&time=11:07am&noexp=0&noal=0&sort=def&sll=18.525515,73.865633&sspn=0.055341,0.090895&ie=UTF8&t=h&start=0&ll=18.527468,73.85396&spn=0.05534,0.090895&z=14" rel="External nofollow">Pune University to MG Road</a>.You can now check the bus no and available routes easily. <br><br><br />
PMPML is the second Indian Bus service to launch on Google Maps.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-60587126612748378842010-12-19T21:49:00.000-08:002010-12-19T21:50:44.102-08:00Power of AndroidWas studying about android, as its being famous in mobile technology these days. Here is summery of my first research.<br />
<br />
<b>What is Android?</b><br />
Android is nothing but a software platform for mobile devices which are based on most flexible operating system i.e. Linux. Android is developed by Open Handset Alliance and acquired by Google. Android is a software stack for mobile devices that includes an operating system, middleware and key applications.<br />
<br />
<b>History of google and Android.</b><br />
Google acquired Android in in July 2005. Early it was a small start up company (actually 22-month-old startup) based in palo alto, CA. Co founder of this company - Andy Rubin, Rich Miner, Nick Sears, Chris White. <br />
<br />
<b>Android Development</b><br />
Android applications are written in the Java programming language. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java.<br />
<a href="http://developer.android.com/sdk/index.html" rel="nofollow" target="_blank">Download Android SDK</a><br />
<br />
<br />
An Android package archive file marked by an .apk suffix. This file is used for distribution and installation of the application on the mobile device.<br />
<br />
<b>Power of Android application.</b><br />
<br />
<ul><li>Phone's core applications and third-party applications are treated equally.</li>
<li>Android actually breaks down all the barriers of application development by providing lots of libraries and tools. e.g Android enables developers to obtain the location of the device.</li>
<li>By default, every Android application runs in its own Linux process.</li>
<li>Every application has its own virtual machine. So the app runs in isolation from other apps.</li>
<li>Each application is assigned a unique Linux user ID which is set with some permissions required by the perticular application only. Where as it is also possible that two or more android application share a same user id in some cases.</li>
</ul><br />
<b>Android Architecture</b><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://developer.android.com/images/system-architecture.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" title="click to enlarge"><img border="0" height="360" alt="android architecture" src="http://developer.android.com/images/system-architecture.jpg" width="400" /></a></div>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-61914356129548556332010-12-09T20:30:00.000-08:002010-12-09T20:49:11.024-08:00BASH shell script to rename file that has spaces<b><span class="Apple-style-span" style="color: red; font-size: x-large;">R</span></b> you looking for shell script which rename all files in a directory to replace unnecssery spaces in file names with -. Check following BASH shell script which,<br />
<br />
1. Iterate a perticular directory specified in FILES variable.<br />
2. Replaces spaces with - hyphen, and put it in temparary variable <b>new_file</b>. (sed "s/ /-/g"`)<br />
4. Then simple <b>MV</b> command to rename it.<br />
<br />
<ol class="code"><li>#!/bin/bash</li>
<li>FILES=/path/to/dir/*</li>
<li>for f in $FILES</li>
<li>do</li>
<li> new_file=`echo $f|sed "s/ /-/g"`</li>
<li>if [ "$f" != "$new_file" ]</li>
<li>then </li>
<li>mv "$f" "$new_file"</li>
<li>fi</li>
<li>done</li>
<li>exit 0</li>
</ol>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-33122054984995909492010-04-22T09:29:00.000-07:002010-04-22T09:29:06.151-07:00papa kehtain hai acoustic guitar notations<b>PAPA KEHTE HAI GUITAR NOTATIONS - acoustic </b><br />
-------------------------------------------------------------------------------<br />
<br />
D| E|----------------------------------------------------------------||<br />
H| B|----------------------------------------------------------------||<br />
A| G|-------------------------5---7----------------------------------||<br />
N| D|----------7----5---7-----------5-----------7--------------------||<br />
E| A|--5-5--------------------------------6-5------------------------||<br />
S| E|----------------------------------------------------------------||<br />
H| <br />
M| papa kehte hai bada nam karega<br />
A| <br />
N| E|----------------------------------------------------------------||<br />
E| B|-------------------------------------------8-8-----7-8----------||<br />
| G|--5-7----------------------7-7----7-7---5-------------5---------||<br />
T| D|-------5-5------5-5--4------------------------------------------||<br />
A| A|----------------------------------------------------------------||<br />
B| E|----------------------------------------------------------------||<br />
S| <br />
| magar ye to koi na jane ke meri manjil hai kaha<br />
<br />
-------------------------------------------------------------------------------Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-7712233487355330492010-03-31T22:56:00.000-07:002010-08-26T23:30:47.926-07:00How can we restrict ip based access to phpmyadmin directoryI was working on this in last week and I came to know following solution. There can be other ways too , but I am not sure. So I am just explaining the way I did it for my site.<br />
<br />
1. You can edit phpMyAdmin.conf (located at /etc/httpd/conf.d/) file in vi editor.<br />
2. Following code block should be there.<br />
<br />
< directory /var/www/phpMyAdmin ><br />
DirectoryIndex index.php<br />
Options Includes ExecCGI<br />
AllowOverride None<br />
Order deny,allow<br />
Allow from all<br />
< / Directory ><br />
<br />
3. <b>Add new line "Allow from ip.ip.ip.ip"</b>, check code below.<br />
<br />
< directory /var/www/phpMyAdmin ><br />
DirectoryIndex index.php<br />
Options Includes ExecCGI<br />
AllowOverride None<br />
Order deny,allow<br />
Allow from ip.ip.ip.ip<br />
Allow from all<br />
< / Directory ><br />
<br />
please put your comments if you have any suggestions or doubts about this implementation.Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-40798927839988486882010-03-20T00:18:00.000-07:002010-03-31T23:08:59.520-07:00Editing phpmyadmin.conf to restrict access change aliasIf you want to <b>change alias</b> of your phpmyadmin directory then you just need to edit your <b>phpmyadmin.conf</b> file and update following line.<br />
<br />
- vi phpmyadmin.conf (if you use windows then just use any editor. I like linux)<br />
- Alias /aliasname /var/www/phpmyadmin<br />
- done<br />
<br />
vi phpmyadmin.conf - Will open phpmyadmin.conf file in vi editor.<br />
aliasname - you can set any new string here<br />
<br />
So next time you can hit http://localhost/aliasname instead of http://localhost/phpmyadmin. <br />
<br />
<b>Related Questions?</b><br />
<a href="http://dhanesh-mane.blogspot.com/2010/03/how-can-we-restrict-ip-based-access-to.html" target="_blank">How to give ip based restriction to phpmyadmin directory.</a>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0tag:blogger.com,1999:blog-1320384267440643585.post-75895455811338230172010-02-24T01:59:00.001-08:002010-02-24T02:05:15.750-08:00Looking out for online regular expression toolCheck this cool tool to create regular expressions online.<br />
<br />
<a href="http://gskinner.com/RegExr/">Regular expression test tool</a>Dhaneshhttp://www.blogger.com/profile/00846865967450359044noreply@blogger.com0