Remove Non-Word Characters in JavaScript

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

341 Views

Removing non-word charactersTo remove non-word characters we need to use regular expressions. The logic behind removing non-word characters is that just replace the non-word characters with nothing('').ExampleIn the following example there are many non-word characters and in between them there exists a text named "Tutorix is the best e-learning platform". So using regular expressions the non-word characters were replaced with nothing('') so as to get the word characters as the output.Live Demo    function remNonWord (string) {       if ((string===null) || (string===''))       return false;       else       string = ... Read More

Display Different Variables in MySQL Using LIKE

Kumar Varma
Updated on 30-Jul-2019 22:30:26

133 Views

Following is the syntax −show variables where Variable_name like 'yourVariable1%' or Variable_name like 'yourVariable2%', .............N;Let us implement the above syntax to show(more than one) variables −mysql> show variables where Variable_name like 'key%' or Variable_name like 'innodb_undo%' or Variable_name like 'innodb_log%';Output+------------------------------------+----------+ | Variable_name                      | Value | +------------------------------------+----------+ | innodb_log_buffer_size             | 1048576 | | innodb_log_checksums               | ON | | innodb_log_compressed_pages        | ON ... Read More

Apply Substring for Fields in MySQL to Get Part of String

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

232 Views

You can use substring() for fields in MySQL to get part of string. Following is the syntax −select substring(yourColumnName, yourStartingIndex, yourEndingIndex) from yourTableName;Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Title longtext    ); Query OK, 0 rows affected (0.57 sec)Insert records in the table using insert command −mysql> insert into DemoTable(Title) values('MySQL is a relational database management system'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable(Title) values('MongoDB is a popular No SQL database'); Query OK, 1 row affected (0.18 sec)Display all records from ... Read More

Java ResultSet Last Method with Example

Arushi
Updated on 30-Jul-2019 22:30:26

4K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ResultSet object has a cursor/pointer which points to the current row. Initially, this cursor is positioned before first row.The last() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the last row, from the current position.This method returns a boolean value specifying whether the ResultSet cursor ... Read More

Display All Deadlock Logs in MySQL

Smita Kapse
Updated on 30-Jul-2019 22:30:26

4K+ Views

First of all, you need to enable innodb_print_all_deadlocks. Following is the syntax −set global innodb_print_all_deadlocks=1;After executing the above statement, let us execute the below syntax in order to display all deadlock logs −show engine innodb status;Let us implement the above syntax −mysql> set global innodb_print_all_deadlocks=1; Query OK, 0 rows affected (0.00 sec) mysql> show engine innodb status;This will produce the following output −+--------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Type | Name | Status ... Read More

Set All Arrow Buttons in a Frame with Java

Anvi Jain
Updated on 30-Jul-2019 22:30:26

321 Views

To set arrow buttons in a frame, let us first create a frame −JFrame frame = new JFrame();Now, set the layout for the frame wherein all the arrow buttons would be displayed −frame.setLayout(new GridLayout(0, 5));Set the arrow buttons for all the locations −frame.add(new BasicArrowButton(BasicArrowButton.EAST)); frame.add(new BasicArrowButton(BasicArrowButton.NORTH)); frame.add(new BasicArrowButton(BasicArrowButton.SOUTH)); frame.add(new BasicArrowButton(BasicArrowButton.WEST));The following is an example to set all the arrow buttons in a frame −Examplepackage my; import java.awt.GridLayout; import javax.swing.Box; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.plaf.basic.BasicArrowButton; public class SwingDemo {    public static void main(String[] args) {       JButton button1 = new JButton("One");     ... Read More

Decode an Encoded String in JavaScript

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

11K+ Views

DecodingIn JavaScript, to decode a string unescape() method is used. This method takes a string, which is encoded by escape() method, and decodes it. The hexadecimal characters in a string will be replaced by the actual characters they represent using unescape() method.Syntaxunescape(string)ExampleIn the following the two exclamation marks have converted to hexadecimal characters using escape() method. Later on those marks were decoded in to their natural characters using unescape() method. Live Demo    // Special character encoded with escape function    var str = escape("Tutorialspoint!!");    document.write("");    document.write("Encoded : " + str);    // unescape() function    document.write("Decoded ... Read More

Difference Between String, StringBuffer, and StringBuilder Classes in Java

Narasimha Murthi
Updated on 30-Jul-2019 22:30:26

668 Views

The String class of the java.lang package represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class. Strings are constant, their values cannot be changed after they are created.The StringBuffer and StringBuilder classes are used when there is a necessity to make a lot of modifications to Strings of characters.Unlike Strings, objects of type StringBuffer and String builder can be modified over and over again without leaving behind a lot of new unused objects.The StringBuilder class was introduced as of Java 5 and the main difference between the StringBuffer and StringBuilder ... Read More

Find Specific Row with Multiple IDs in MySQL

Rama Giri
Updated on 30-Jul-2019 22:30:26

134 Views

To find a row, use FIND_IN_SET(). Let us first create a table −mysql> create table DemoTable    -> (    -> ListOfIds varchar(200)    -> ); Query OK, 0 rows affected (0.72 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('100, 2093, 678, 686'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('0595, 9585, 4885, 95959'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('0059954, 95986884, 9059596, 9005'); Query OK, 1 row affected (0.20 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+-------------------------------+ ... Read More

HTML DOM Input datetime-local Form Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

137 Views

The HTML DOM Input DatetimeLocal form property returns the reference of enclosing form for input DatetimeLocal.SyntaxFollowing is the syntax −Returning reference to the form objectinputDatetimeLocalObject.formExampleLet us see an example of Input DatetimeLocal form property − Live Demo Input DatetimeLocal form    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Datetime-Local-form Examination Time: ... Read More

Advertisements