To format date while inserting records, use DATE_FORMAT() in the MySQL INSERT statement. Let us first create a table −mysql> create table DemoTable2012 -> ( -> ShippingDate varchar(20) -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2012 values(date_format(curdate(), '%d.%m.%Y')); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable2012 values(date_format(now(), '%d.%m.%Y')); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable2012 values(date_format('2014-01-21', '%d.%m.%Y')); Query OK, 1 row affected (0.17 sec)Display all records from the table using select statement −mysql> select *from ... Read More
To execute SHOW CREATE TABLE in a stored procedure, use SHOW CREATE TABLE. Let us first create a table −mysql> create table DemoTable2011 -> ( -> StudentId int NOT NULL AUTO_INCREMENT, -> StudentName varchar(20), -> StudentAge int, -> StudentCountryName varchar(20), -> PRIMARY KEY(StudentId) -> ); Query OK, 0 rows affected (0.80 sec)Following is the stored procedure executing SHOW CREATE TABLE −mysql> delimiter // mysql> create procedure test_show_create_demo(table_name varchar(100)) -> begin -> set @query=concat("SHOW CREATE TABLE ", table_name); -> prepare st from @query; -> execute st; -> end ... Read More
The directory structure of JDK and JRE are almost the same, except that JDK has two additional directories like jmods and include and also there is no JRE subdirectory in the JDK9 version. The JDK directory is the root directory for JDK software installation. This directory also includes copyright, readme, and src.zip files, which can be a source code archive file of the Java platform.JDK Directory Structure:JDK-9 - bin - conf - include - jmods - legal - libThe JDK/bin directory contains an executable and command-line launcher that can be defined by the modules linked to an image.The JDK/conf directory contains ... Read More
Following is the code to create modal image gallery with CSS and JavaScript −Example Live Demo
Following is the code to produce a fixed social media icon bar with CSS −Example Live Demo *, *::before, *::after { box-sizing: border-box; } main { margin-left: 300px; } .SocialBar { position: fixed; display: block; top: 30%; font-size: 0; width: 200px; border: 2px solid darkgreen; box-shadow: 5px 10px 18px rgb(55, 173, 39); } button { display: block; width: 100%; margin: 0px; border: none; padding: 15px; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-weight: bold; font-size: 20px; } button:not(:last-child) { ... Read More
Following is the code to create a dropup menu with CSS −Example Live Demo .menu-btn { background-color: #7e32d4; color: white; padding: 16px; font-size: 20px; font-weight: bolder; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; border: none; } .dropdown-menu { position: relative; display: inline-block; padding-top: 130px; } .menu-content { display: none; position: absolute; bottom: 50px; background-color: #017575; min-width: 160px; z-index: 1; } .links { color: rgb(255, 255, 255); padding: 12px 16px; text-decoration: none; display: block; font-size: 18px; font-weight: bold; border-bottom: 1px solid black; } .links:hover { background-color: rgb(8, 107, 46); } .dropdown-menu:hover .menu-content { display: block; } .dropdown-menu:hover .menu-btn { background-color: #3e8e41; } Hover over the below button to open a dropup menu Open
To get the free space in a drive, use the AvailableFreeSpace and TotalFreeSpace properties in C#.Firstly, set the name of the drive using DriveInfo −DriveInfo dInfo = new DriveInfo("D");Let’s say, you need to find the available space for D drive −Exampleusing System; using System.Linq; using System.IO; public class Demo { public static void Main() { DriveInfo dInfo = new DriveInfo("D"); // Get free space Console.WriteLine(dInfo.AvailableFreeSpace); // get total free space Console.WriteLine(dInfo.TotalFreeSpace); } }OutputThe following is the output showing the free space available in D drive−722243567912 722243567912
Use the DriveFormat property to get the drive format in C#.Set the drive for which you want to display the format −DriveInfo dInfo = new DriveInfo("C");Now, use DriveFormat to get the drive format −dInfo.DriveFormatThe drive formats for a windows system can be NTFS or FAT32.Here is the complete code −Exampleusing System; using System.Linq; using System.IO; public class Demo { public static void Main() { DriveInfo dInfo = new DriveInfo("C"); Console.WriteLine("Drive Format = "+dInfo.DriveFormat); } }OutputThe following is the output −Drive Format = NTFS
The below lines of code can be used, wherein UTF-8 input is expected.$chr_map = array( // Windows codepage 1252 "\xC2\x82" => "'", // U+0082⇒U+201A single low-9 quotation mark "\xC2\x84" => '"', // U+0084⇒U+201E double low-9 quotation mark "\xC2\x8B" => "'", // U+008B⇒U+2039 single left-pointing angle quotation mark "\xC2\x91" => "'", // U+0091⇒U+2018 left single quotation mark "\xC2\x92" => "'", // U+0092⇒U+2019 right single quotation mark "\xC2\x93" => '"', // U+0093⇒U+201C left double quotation mark "\xC2\x94" => '"', // U+0094⇒U+201D right double quotation mark "\xC2\x9B" => "'", // U+009B⇒U+203A single right-pointing angle ... Read More
A PHP reference is an alias, that allows two different variables to write it to the same value. In PHP version 5, an object variable doesn't contain the object itself as its value. It holds an object identifier that allows object accessors to find the actual object.When an object is sent by an argument, returned or assigned to a different variable, these different variables are not aliases. They contain a copy of the identifier, that points to the same object.Example$my_var = new class_name; echo $my_var->get_class_name(5)->value; $my_var->test(); echo $my_var->get_class_name(5)->value;OutputThis will produce the following output −class_name #5This isn't "pass by reference". It ... Read More