Posts

Showing posts from February, 2020

Can you break a wooden stick using newspaper?

Image

CSS Code to Remove Border (Outline) Around Text / Input Boxes on Focus

Image
This border is used to show that the element is focused (i.e. you can type in the input or click the button with Enter key). You can remove it, though: textarea:focus, input:focus { outline: none; } Chrome browser will also apply highlighting to other elements such as DIV's used as modals. To prevent the highlight on those and all other elements as well, you can do: *:focus { outline: none; }

How to enable Cross Origin Access through .htaccess File

Image
Copy and paste the below code in the .htaccess file to enable Cross Origin Access to files. # Access-Control-Allow-Origin <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" <IfModule> If you don’t have .htaccess file in your web server, create it and add the above mentioned code. Warning: This will provide direct access to files from your domain to other domains.

CSS Code to Disable Highlighting Text Selection

Image
.no-select { -webkit-touch-callout: none !important; /* iOS Safari */ -webkit-user-select: none !important; /* Chrome/Safari/Opera */ -khtml-user-select: none !important; /* Konqueror */ -moz-user-select: none !important; /* Firefox */ -ms-user-select: none !important; /* Internet Explorer/Edge */ user-select: none !important; /* Non-prefixed version, currently not supported by any browser */ } Note: The user-select is currently supported in all browsers except Internet Explorer 9 and earlier versions.

Reorder / Reset Auto Increment Primary Key

Image
Question I have a MySQL table with an auto increment primary key. I deleted some rows in the middle of the table. Now I have, for example, something like this in the ID column: 12, 13, 14, 19, 20. I deleted the 15, 16, 17 and 18 rows. I want to reassign / reset / reorder the primary key so that I have continuity, i.e. make the 19 a 15, the 20 a 16, and so on. How can I do it? Solution Even though this question seems to be quite old, will post an answer for someone who reaches in here searching. SET @count = 0; UPDATE `users` SET `users`.`id` = @count:= @count + 1; If the column is used as a foreign key in other tables, make sure you use ON UPDATE CASCADE instead of the default ON UPDATE NO ACTION for the foreign key relationship in those tables. Further, in order to reset the AUTO_INCREMENT count, you can immediately issue the following statement. ALTER TABLE `users` AUTO_INCREMENT = 1; For MySQLs it will reset the value to MAX(id) + 1

PHP Sendmail() method delivers mail after 5 minutes - How to Fix?

Image
Problem: Use sendmail() method to send mail to the registered user. Email sends when user registered but it takes 5 minutes to send the mail every time. Solution: Try using normal php mail() function to check if its server issue <?php $to      = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> if mail get sent fast then server is working fine.

Do you know light blinks 100times/sec?

Image

Prevent Search Engine Indexing through .htaccess File

Image
Copy and paste the above code in the .htaccess file to prevent search engine indexing. # Prevent Search Engine Indexing SetEnvIf Host ^www.yourwebsite.com INDEX Header set X-Robots-Tag "noindex, nofollow" env=!INDEX If you don’t have .htaccess file in your web server, create it and add the above mentioned code.

CSS Code to Remove Grey Highlight when Tapping Links in Webkit Browsers

Image
Use the code below to avoid highlight when tapping links in the Webkit Browsers from Touch Device. /* Essentially means a[href], or that the link actually goes somewhere */ *:link { -webkit-tap-highlight-color: rgba(0,0,0,0) !important; } *:visited { -webkit-tap-highlight-color: rgba(0,0,0,0) !important; } *:hover { -webkit-tap-highlight-color: rgba(0,0,0,0) !important; } *:active { -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }

header('location: ..') is not working in PHP

Image
It happens if you are echo-ing text to the browser before sending the header('location').
You can not send content to your browser before executing a header(), as your echo will force a header to be sent. Comment these lines out and check if it works: // echo $variable; // print_r($array); //..... Now your header will be sent and you will be redirected.

Applications of Bernoulli's Principle

Image
Applications of Bernoulli's principle is explained in Tamil

How to force redirect www or non-www using htaccess file?

Image
Force www: RewriteEngine on RewriteCond %{HTTP_HOST} ^yourwebsite.com [NC] RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [L,R=301,NC] Force non-www: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://yourwebsite.com/$1 [L,R=301] Now, when you type in your domain name with either www in front or not, it should display as you have set it in the .htaccess file. Be sure to replace 'yourwebsite.com' with your actual domain name. Note: do not place both selections of code in the file as it will cause an error.

Different Text Column Data Types and Maximum Storage Sizes in MySQL

Image
The actual text column type is classified in to four: TINYTEXTTEXTMEDIUMTEXTLONG TEXT The maximum length that you can store in a column of each data type is given below. Type | Maximum length -----------+------------------------------------- TINYTEXT | 255 (2 8−1) bytes TEXT | 65,535 (216−1) bytes = 64 KiB MEDIUMTEXT | 16,777,215 (224−1) bytes = 16 MiB LONGTEXT | 4,294,967,295 (232−1) bytes = 4 GiB Note: The number of characters that can be stored in your column will depend on the character encoding.

Kurai Ondrum Illai - Lakshmi Kataksham Video Song

Image

Is it possible to time travel? Part-2

Image

Is it possible to time travel? Part-1

Image

Refresh (or) Reload Web Page using Meta Tag

Image
You can refresh (or) reload HTML web page using meta tag without script tag as given below. <meta http-equiv="refresh" content="5"> The above code will reload the same page in 5 seconds. To reload the page immediately you should set content="0". Redirect to Specific URL To redirect the page to different URL you should follow the code as given below. <meta http-equiv="refresh" content="5;url=http://www.yourwebsite.com"> Note:Meta tag is always placed inside the <head> tag.Meta tag provides information about contents in the html page.

Should I put input elements inside a label element?

Image
The label itself may be positioned before, after or around the associated control. Example 1: <label for="lastname">Last Name</label> <input type="text" id="lastname" /> Example 2: <input type="text" id="lastname" /> <label for="lastname">Last Name</label> Example 3: <label> <input type="text" name="lastname" /> Last Name </label> Note: the third technique cannot be used when a table is being used for layout, with the label in one cell and its associated form field in another cell. Either one is valid. I like to use either the first or second example, as it gives you more style control.

The Complete Linux Course: Beginner to Power User!

Image
If you want to get started using Linux, you will LOVE this course! This 7+ hour Ubuntu Linux tutorial will take you from beginner to power user. We will cover installation, command line, administrative privileges, app development, server hosting, GitHub, and much more!

இந்த உலகில் வெறும் 100 பேர் மட்டும் இருந்தால்

Image
What if the world has just 100 people இந்த உலகத்தில் வெறும் 100 பேர் மட்டும் இருந்தால் என்ன நடக்கும் This video talks about what if world has just 100 people how many of them will men and womenwhat languages do they speak?what food they would eat?what color they would behow much do they earnwill they have water?will they have shelterthis video will inspire you to change and your look towards world and many such interesting facts about world tamil psychology

How to use .htaccess file on an Apache Localhost Server

Image
.htaccess is a configuration file that should be stored where your page is. In short, it should be in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ (or) custom folder --> D:\dev\www\. Don't forget to turn on mod_rewrite by deleting a hash from the line where it resides LoadModule rewrite_module modules/mod_rewrite.so and enable .htaccess by changing AllowOverride None to AllowOverride All This was clearly explained as follows: Find your apache directly which uses the php installationOpen your httpd.conf with notepad, Which is located in the path \apache\conf directoryFind the code like below #LoadModule rewrite_module modules/mod_rewrite.so Remove # from above codeMake sure the line is AllowOverride None as shown below. # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All <--- c…

What is the best way to reload (or) refresh an iframe using JavaScript?

Image
Solution 1: document.getElementById('iframeid').contentWindow.location.reload(); be careful, in Firefox, window.frames[] cannot be indexed by id, but by name or index. Solution 2: document.getElementById('iframeid').src = document.getElementById('iframeid').src; It will reload the iframe, even across domains! Tested with IE7/8, Firefox and Chrome. Solution 3: If using jQuery, this seems to work: $('#iframeid').attr('src', $('#iframeid').attr('src'));

What is the unicode character for the close symbol?

Image
Unicode and larger font size alternatives for the close symbol [OR] multiplication sign ( × ) ✕ Multiplication X (U+2715) Decimal HTML entity: &#10005;
Hex HTML entity: &#x2715; ✖ Heavy Multiplication X (U+2716) Decimal HTML entity: &#10006;
Hex HTML entity: &#x2716; ❌ Cross Mark (U+274C) Decimal HTML entity: &#10060;
Hex HTML entity: &#x274c;

Chinnanchiru Kiliye - Mahakavi Subramanya Bharati Video Song

Image

What is the difference between GET, POST and REQUEST method in PHP?

Image
There are 2 methods to send HTML form data from 1 Page to another or HTML page to server side in PHP. POST It is a method in which data gets sent using packet which is not visible to any user on web-browser. it is secured compared to GET method. GET It is a method in which data gets sent with URL which is visible to user in address-bar of any web-browser. So, it’s not secure as POST method. Now, There are total three methods to catch this data in PHP. POST: It can catch the data which is sent using POST method.GET: It can catch the data which is sent using GET method.REQUEST: It can catch the data which is sent using both POST & GET methods.

Secret of 4th Dimension

Image
4வது பரிமாணத்தில் கடவுள். A part(story) of credits goes to Carl Sagan and translated in Tamil.

Archaeological Importance of Tirukoilur

Image
It has a number of temples both Vaishnava and Saiva sects, was once a capital of an important chieftain Malayaman of Sangam age datable to 3rd century BCE to 3rd century CE. To corroborate this, a Tamil Brahmi inscription at Jambai (near Tirukkovilur ) mentions about the king AthiyamanNedumanAnchi as SathiyaPutoAtiyanNedumanAnjihiIttaPali. MalaiyamanTirumudikkari was the illustrious ruler of this dynasty. The Sangam works speak of the invasion of Tirukkoilur and defeat of MalayamanTirumudikkari by NedumanAnji, king of Takadur (modern Dharmapuri) who is said to have offered Avvaiyar, the celebrated poetess (of that period), a myrobalan (gooseberry) fruit to increase her longevity. Tirukkoilur seems to have been as important a religious center as Kanchipuram in Tondaimandalam. There is ample evidence to prove that Vaishnavism, Saivism and Jainism had flourished at this center. It is said the MudalAlvars, the first three Alvars, (Poigai, Butham and Pei) were made to meet by the…

How to change your default Index page in htaccess

Image
Paste the following code at the top of the .htaccess file to configure your desired index page. In the example below, we decided to make the index page of our folders named first.html. #Alternate default index page DirectoryIndex first.html You can also list more than one file in the configuration. The file will be read left to right and check for them in that order. In this example, we add index.htm, index.html, and index.php to the list. #Alternate default index pages DirectoryIndex first.html index.htm index.html index.php First the server will check for first.html, if it does not find a file with that name, it continues to index.htm and so on.

Write a Javascript program to print maximum number between 2 numbers?

Image
Find the below code to print maximum number from 2 numbers in javascript. Simple Idea var a = 56,     b = 67; var max = (a > b) ? a : b; console.log("The maximum number is "+ max); Developed IdeaView Demo:http://www.gtvcreations.com/demo/js-print-max-from-two-numbers.htmlView Code: <!DOCTYPE html> <html> <head>     <title>Print Maximum Number between Two Numbers - Javascript</title> </head> <body>     <!-- Input Form -->     <form id="findmaxform">         <label for="number1">Number 1:</label>         <input type="number" id="number1">         <br>         <label for="number2">Number 2:</label>         <input type="number" id="number2">         <br>         <input type="submit" value="Print Maximum Number">         <input type="reset" value="Reset Fo…

How to open Microsoft Edge from Run command box?

Image
Follow the below steps to open Microsoft Edge from Run command box in Windows. Open the Run command box by simultaneously pressing Win + R In the Open field, type microsoft-edge: and then press Enter key to launch Microsoft Edge browser
(or)
In the Open field, type microsoft-edge:http://www.yourwebsite.com and then press Enter key to open the URL

6 Reliable Alternatives to Windows 10 OS

Image
You're looking for a new operating system for your computer? Maybe you're on Windows 7 but don't want to use Windows 10. This video provides a few realistic alternatives to Windows 10 that aren't made by Microsoft.

How To Draw A Man From The Word "Man"

Image
Learn with this step by step tutorial how to turn words into pictures, very easy art on paper for kids.

How to open Microsoft Edge from Command Prompt?

Image
Follow the below steps to open Microsoft Edge from Command Prompt in Windows. Open the command prompt Type start microsoft-edge: command and then press Enter key to launch Microsoft Edge browser
(or)
Type start microsoft-edge:http://www.yourwebsite.com command and then press then Enter key to open the URL Note: You can use the above commands to open Microsoft Edge from Windows PowerShell.