Arjun Thakur has Published 1109 Articles

Create a new user with password in MySQL 8?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

3K+ Views

You need to use CREATE command to create a new user with password in MySQL 8. Let us check the versionmysql> select version(); +-----------+ | version() | +-----------+ | 8.0.12    | +-----------+ 1 row in set (0.14 sec)The syntax is as follows to create a new user with passwordCREATE ... Read More

How to retrieve the documents whose values end with a particular character in MongoDB?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

1K+ Views

Following is the syntax to retrieve the documents whose values end with a particular character in MongoDBdb.yourCollectionName.find({yourFieldName: {$regex: "yourEndingCharacter$"}}).pretty();Let us first create a collection with documents>db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Adam", "StudentAge":25, "StudentCountryName":"LAOS"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9c45b32d66697741252456") } >db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Sam", "StudentAge":24, "StudentCountryName":"ANGOLA"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9c45c02d66697741252457") ... Read More

Transpose a matrix in Python?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

3K+ Views

Transpose a matrix means we’re turning its columns into its rows. Let’s understand it by an example what if looks like after the transpose.Let’s say you have original matrix something like -x = [[1, 2][3, 4][5, 6]]In above matrix “x” we have two columns, containing 1, 3, 5 and 2, ... Read More

8085 program to add three 16 bit numbers stored in registers

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

2K+ Views

In this program we will see how to add three 16-bit numbers stored in register pairs.Problem StatementWrite 8085 Assembly language program to add three 16-bit numbers stored in register pair BC, DE and HL. Store the result at DE register pair.DiscussionIn this program we are storing the 16-bit numbers into ... Read More

C++ Program to Implement Quick Sort with Given Complexity Constraint

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

3K+ Views

Quick sort is based on divide-and-conquer. The average time complexity of this algorithm is O(n*log(n)) but the worst case complexity is O(n^2). To reduce the chances of the worst case here Quicksort is implemented using randomization.Algorithmpartition(int a[], int l, int h)Begin    pivot = h    Index = l   ... Read More

What is the function of action in JSP?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

289 Views

This action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.Following table lists out ... Read More

Convert MySQL Unix-Timestamp format to date format?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

525 Views

To achieve this, the following is the syntaxselect date_format(from_unixtime(yourColumnName), '%b %d, %Y %l:%i %p PDT') from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table unixTimeStampFormatDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ... Read More

Create Ennead Tuple from another collection in Java

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

72 Views

To create Ennead Tuple from another collection, use the fromCollection() method. Using this method, create an Ennead Tuple using List collection. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package.import org.javatuples.Ennead;Note Download JavaTuples Jar ... Read More

8085 program to find nth power of a number

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

622 Views

In this program we will see how to find nth power of a number.Problem StatementWrite 8085 Assembly language program to find nth power of a number. The base is stored at location 8000H, and the exponent is stored at 8001H. Store the result at 8002H.DiscussionIn 8085, we cannot perform the ... Read More

Adding/ concatenating text values within a MySQL SELECT clause?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

1K+ Views

To add/ concatenate text values within a select clause, you can use concat() function.Let us create a tablemysql> create table ConcatenatingDemo -> ( -> UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> UserName varchar(20), -> UserCountryName varchar(20) ... Read More

Advertisements