1 2 >   Sort: Rank

MySQL auto_increment - start value and increment value
How to set column to be AUTO_INCREMENT in MySQL? And how to set its start value and increment value? 1. If you want to create a table with a primary key column in MySQL and want to have it automatically increase it's value, you follow the following example CREATE TABLE statement: CREATE TABLE MyTabl...
2016-08-30, 1257👍, 1💬

SQL Server Query with Percentage of Two Aggregated Values
How to write a single query to perform search based on a percentage criteria of two aggregated values? For example, I have multiple pools of registration numbers in SQL Server database. Each registration number has a status of "Available" or "Registered". And I want to write a single query to find a...
2016-06-12, 376👍, 1💬

💬 2016-06-12 Rajiv: Thanks a lot!

JavaScript Implementation of MD5 Function
Where can I find a JavaScript implementation of MD5 function? Here is a nice implementation of md5() function in JavaScript: function md5(str) { // discuss at: http://phpjs.org/functions/md5 /// original by: Webtoolkit.info (http://www.webtoolkit.info/) // improved by: Michael White (http://getsprin...
2015-11-23, 434👍, 0💬

MD5 Hash Function in PHP
How to calculate the MD5 hash of a string in PHP? You can use the following md5() function to calculate the MD5 hash of a string using the MD5 Message-Digest Algorithm. string md5 ( string $str [, bool $raw_output = false ] ) str - The input string. raw_output - If TRUE, then the md5 digest is inste...
2015-11-23, 646👍, 2💬

💬 2015-08-15 Julie: Here is a source code of JavaScript MD5 Function. Enjoy!

💬 2015-05-26 Erik: What about JavaScript?

Insert JavaScript in XSLT Document
How to insert JavaScript code in XSLT and to be generated in the output in XML format? Inserting JavaScript code in XSLT and keep it in the XML output correctly is a very challenging task: You need to find a way to enter and protect special characters like, <, > and & in the input file. Yo...
2015-10-26, 360👍, 0💬

SQL Server Truncating Message with '...'
What is the best way in SQL Server to truncate a string to 140 characters and add "..." to the end if there are more than 140 characters in the string? I need this to display initial parts of user comments on my home page. Basically, you are asking the logic to be implemented in a SQL Server query, ...
2015-09-16, 385👍, 0💬

Oracle Truncating Message with '...'
What is the best way in Oracle to truncate a string to 140 characters and add "..." to the end if there are more than 140 characters in the string? I need this to display initial parts of user comments on my home page. Basically, you are asking the logic to be implemented in an Oracle query, If the ...
2015-09-16, 331👍, 0💬

Make Synchronous XMLHttpRequest Call
When making AJAX calls with XMLHttpRequest, how to force it to be synchronous?
2015-07-03, 365👍, 0💬

Difference of encodeURI() and encodeURIComponent()
What is the difference between the encodeURI() function and the encodeURIComponent() function in JavaScript?
2015-07-03, 337👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Can we declared main method with final m
main method is a standard method used by JVM to execute any java program(Java SE). - Can we declared main method with final modifier? Yes we can define main method with final modifier. package instanceofjava; public MainDemo{ public static final void main(String [] args){ } }
2015-07-01, 292👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - What are the possible main method declar
main method is a standard method used by JVM to execute any java program(Java SE). - What are the possible main method declaration with String[] args? public static void main(String[] args){ } public static void main(String []args){ } public static void main(String args[] ){ } public static void mai...
2015-07-01, 293👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Can we write static public void main(Str
main method is a standard method used by JVM to execute any java program(Java SE). - Can we write static public void main(String [] args)? Yes we can define main method like static public void main(String[] args){} Order of modifiers we can change. package instanceofjava; public MainDemo{ static pub...
2015-07-01, 288👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Why the arguments String[] args?
main method is a standard method used by JVM to execute any java program(Java SE). - Why the arguments String[] args? String array variable name args : by the naming conventions they named like that we can write any valid variable name.
2015-07-01, 294👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Why the name main?
main method is a standard method used by JVM to execute any java program(Java SE). - Why the name main? This is the name which is configured in the JVM.
2015-07-01, 324👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Why main method return type is void?
main method is a standard method used by JVM to execute any java program(Java SE). - Why main method return type is void? main method wont return anything to JVM so its return type is void.
2015-07-01, 287👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Why main method is static?
main method is a standard method used by JVM to execute any java program(Java SE). - Why main method is static? To execute main method without creating object then the main method oshould be static so that JVM will call main method by using class name itself.
2015-07-01, 309👍, 0💬

main method is a standard method used by JVM to execute any java program(Java SE). - Why main method is public?
main method is a standard method used by JVM to execute any java program(Java SE). - Why main method is public? To call by JVM from anywhere main method should be public. If JVM wants to call our method outside of our package then our class method should be public. package instanceofjava; public Mai...
2015-07-01, 296👍, 0💬

Facebook Comments for WordPress
Useful PHP Code Snippets for Developers - Facebook Comments for WordPress <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/ all.js#x...
2015-07-01, 406👍, 0💬

The Real Way To Check Uploaded File Type
Useful PHP Code Snippets for Developers - The Real Way To Check Uploaded File Type <?php // Here we specify all the type of files we want to accept $extension = array("application/pdf", "image/jpeg", "image/png", "image/gif"); if(isset($_POST['submit'])){ exec("file -i ".$_FILES['inputName']['tmp...
2015-07-01, 625👍, 0💬

WordPress – Scheduling Posts for RSS
Useful PHP Code Snippets for Developers - WordPress – Scheduling Posts for RSS function publish_later_on_feed($where) { global $wpdb; if(is_feed()) { // timestamp in WP-format $now = gmdate('Y-m-d H:i:s'); // value for wait; + device $wait = '5'; // integer // http://dev.mysql.com/doc/refma n/5.0/en/...
2015-06-19, 280👍, 0💬

Validate email Address
Useful PHP Code Snippets for Developers - Validate email Address function is_valid_email($email, $test_mx = false) { if(eregi("^([_a-z0-9-]+)(\.[_a -z0-9-]+)*@([a-z0-9-]+)(\.[a-z 0-9-]+)*(\.[a-z]{2,4})$",$email)) if($test_mx) { list($username, $domain) = split("@", $email); return getmxrr($domain, $m...
2015-06-19, 266👍, 0💬

How to generate an authentication code in PHP ?
Useful PHP Code Snippets for Developers - How to generate an authentication code in PHP ? <?php # This particular code will generate a random string # that is 25 charicters long 25 comes from the number # that is in the for loop $string = "abcdefghijklmnopqrstuvwxyz012 3456789";for($i=0;$i
2015-06-19, 278👍, 0💬

Unzip a Zip File
Useful PHP Code Snippets for Developers - Unzip a Zip File <?php function unzip($location,$newLocation){ if(exec("unzip $location",$arr)){ mkdir($newLocation); for($i = 1;$i //Use the code as following:
2015-06-19, 271👍, 0💬

username, password and date validation with php
Useful PHP Code Snippets for Developers - username, password and date validation with php
2015-06-19, 239👍, 0💬

1 2 >   Sort: Rank