Anvi Jain has Published 569 Articles

Configuration file parser in Python (configparser)

Anvi Jain

Anvi Jain

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

14K+ Views

The configparser module from Python's standard library defines functionality for reading and writing configuration files as used by Microsoft Windows OS. Such files usually have .INI extension.The INI file consists of sections, each led by a [section] header. Between square brackets, we can put the section’s name. Section is followed ... Read More

How to remove an array element by its index in MongoDB?

Anvi Jain

Anvi Jain

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

1K+ Views

You can remove an array element by its index using the following two steps −The first step is as follows −db.yourCollectionName.update({}, {$unset : {"yourArrayFieldName.yourIndexValue" : 1 }});The above syntax will put a null value at the location of ‘yourIndexValue’. After that, you need to pull the null value from array ... Read More

MySQL query to get the max value with numeric values in varchar field?

Anvi Jain

Anvi Jain

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

468 Views

To get the max value, use the max() function. Let us create a table first −mysql> create table findMaxValueInVarcharField    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Value varchar(200)    -> ); Query OK, 0 rows affected (1.09 sec)Following is the query to insert ... Read More

How do I insert a record from one Mongo database into another?

Anvi Jain

Anvi Jain

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

531 Views

You can switch from one database to another using the use command. Here, we are using the collection in the “test” database. Let us insert that collection in another database with the name “sample”.To understand further, let us create a collection with the document. The query to create a collection ... Read More

MySQL query to order rows with value greater than zero?

Anvi Jain

Anvi Jain

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

587 Views

Let us first create a table. Following is the query −mysql> create table gettingAndOrderingRowsDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Value int    -> ); Query OK, 0 rows affected (1.35 sec)Following is the query to insert some records in the table ... Read More

How to use getChars() in Android textview?

Anvi Jain

Anvi Jain

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

218 Views

This example demonstrate about How to use getChars() in Android textview.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 − Add the following code to res/layout/activity_main.xml.           ... Read More

Aligning two buttons vertically in iOS

Anvi Jain

Anvi Jain

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

850 Views

Auto Layout is one the most important element when it comes to designing an iOS Application. UI development has become a lot more versatile and easier using Auto Layout.For Aligning two buttons vertically we will be using Auto Layout.So let’s get started!Step 1: Open Xcode → New Projecr → Single ... Read More

How to sum the score of students with the same name in MySQL with ORDER BY?

Anvi Jain

Anvi Jain

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

726 Views

For this, use ORDER BY along with GROUP BY clause. Let us first create a table with Student Name and Score −mysql> create table countRowValueDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(20),    -> StudentMathScore int    -> ); Query OK, ... Read More

How to check cursor array list is empty or not in Android sqlite?

Anvi Jain

Anvi Jain

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

694 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

How does MongoDB index arrays?

Anvi Jain

Anvi Jain

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

184 Views

MongoDB indexes every value of an array so that you can query for single elements.To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.indexingForArrayElementDemo.insertOne({"StudentFavouriteSubject":["MongoDB", "MySQL"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8acdca6cea1f28b7aa0816") ... Read More

Advertisements