To compare two strings which are numbers in MySQL, use the CAST() function.The syntax is as followsselect *from yourTableName where cast(yourColumnName as signed)=yourIntegerValue;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table compareTwoStringDemo -> ( -> UserId varchar(100) -> ); Query OK, 0 rows affected (0.78 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into compareTwoStringDemo values('1083745'); Query OK, 1 row affected (0.12 sec) mysql> insert into compareTwoStringDemo values('9867585'); Query OK, 1 ... Read More
The C / C++ library function div_t div(int numer, int denom) divides numer (numerator) by denom (denominator). Following is the declaration for div() function.div_t div(int numer, int denom)The parameters are numerator and the denominator. This function returns the value in a structure defined in , which has two members. For div_t:int quot; int rem;Example Live Demo#include #include using namespace std; int main () { div_t output; output = div(27, 4); cout
In iOS versions previous to 7.0 getting the MAC address of device was possible. But with new iOS version it has been disabled for the apps to access MAC address of the device.When it is accessed or requested on current version of iOS it always returns 02:00:00:00:00:00. This has been implemented by apple because of privacy concerns. If your app needs to uniquely identify a device, apple recommends to use UDID/ UUID instead of MAC. In swift we can useUIDevice.current.identifierForVendor Which as per apple documentation says that, The value of this property is the same for apps that come from ... Read More
To reduce MongoDB storage space after deleting a large amount of data, you need to use repairDatabase(). Let’s say we are using the database “test”. Following is the query to get to the current database> db;This will produce the following outputTestAfter deleting large amount of data, this is how you can reduce the storage space of MongoDB> db.repairDatabase()This will produce the following output{ "ok" : 1 }Here is the screenshot after we implement the above query. This will reduce the storage space:
To populate a 2d array with random alphabets, use the Random class. Let us first declare a 2d array −char arr[][] = new char[3][3];Now, in a nested for loop, use the Random class object to get random values on the basis of switch case. Here, our range is 3 i.e. set of 3 alphabets at once −Random randNum = new Random(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { int x = randNum.nextInt(3); switch (x) { case ... Read More
The net meeting is a popular video conferencing solution given by Microsoft. When we install the Windows 95 and Windows XP, Net Meeting was included automatically. This was replaced by Windows Meeting Space when Windows Vista version was launched. It is no longer used.It was very simple and the menu drove to start and to join the net meeting. Here are the steps to use it.To begin a Net Meeting session, go to the Start menu and select Run. There you type conf and click Ok.Click the Phone button, and enter the IP address of the machine you want to ... Read More
Address and data buffers are used for bidirectional data transfer. They perform the unidirectional data transfer when they send out the Least Significant Byte of the address. These buffers are only used for increasing the driving capacity of the current. Through the internal bus data goes to the buffers. The Least Significant Byte of the address goes to the buffers from the internal address latch to the other.Hence the address or data are sent out on the address ranging from AD7 to AD0 can drive every external chips, like chips of RAM, chips of EPROM, and other peripheral chips meant for ... Read More
This example demonstrate about How to use Line chart graph in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Open build.gradle(module level) and add library dependency.apply plugin: 'com.android.application' android { packagingOptions { exclude 'META-INF/proguard/androidx-annotations.pro' } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/license.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' ... Read More
To search a value in JavaTuples Quartet class, you need to use the contains() method.Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Quartet Class in JavaTuples, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file.The following is an example −Exampleimport org.javatuples.Quartet; public class Demo { public static void main(String[] args) ... Read More
You need to use REGEXP for this. The syntax is as followsSELECT *FROM yourTableName WHERE yourColumnName REGEXP '[a-zA-Z]';To understand the concept, let us create a table. The query to create a table is as followsmysql> create table SelectNonNumericValue -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> UserId varchar(100) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command. The query is as followsmysql> insert into SelectNonNumericValue(UserId) values('123John'); Query OK, 1 row affected (0.12 sec) mysql> insert into SelectNonNumericValue(UserId) values('58475Carol98457Taylor24'); Query OK, 1 row affected (0.52 sec) ... Read More