Arjun Thakur

Arjun Thakur

749 Articles Published

Articles by Arjun Thakur

Page 63 of 75

How to store json values in object in android?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

This example demonstrate about How to store json values in object 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 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken text view to show NAME from object.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import org.json.JSONArray; ...

Read More

Earliest data output time considering TACC in 8085 Microprocessor

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 190 Views

27128 receives the Address A13-8 by 27128 from 8085AH by means of the octal line driver 74LS244, which has a propagation delay of 12 nS. Address ranging from A7-0 is received by 27128 from 8085AH by means of 74LS373 octal latch, which consists of a propagation delay of 30 nS. Thus, address ranging from A13-0 is received by 27128 at the end of 30 nS. So the data only comes out on D7-0 pins of 27128 by 30 nS + tAcc = 30 nS + 200 nS = 230 nS.  Delays involved in accessing 27128 EPROM in ALS kit. Bus timing characteristics of MR machine cycle

Read More

In 8085 Microprocessor, compare I/O port chips and memory chips

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 314 Views

Information is also stored in an Input Output port chip similar to a memory chip. Information of 1 byte are stored in an Input Output port chip on the other hand information of few bytes are stored in the Input Output port chips. An example to be cited as only 1 byte of information is stored in Intel 8212 I/O port chip, but 3 bytes of information are stored in Intel 8255 chip. Moreover, a large number of memory locations like 1K, 4K, 8K etc. are contained in the memory chips. We select memory chip location by the address pins ...

Read More

Get another order after limit with MySQL?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 323 Views

You need to use subquery with select statement, one select for inner and one for outer. The inner select will return rows and outer will order by ascending order. The syntax is as follows:SELECT *FROM (    SELECT *FROM yourTableName ORDER BY yourColumnName1 DESC LIMIT 9 ) AS anyAliasName ORDER BY yourColumnName2;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table OrderByAfterLimit    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> UserName varchar(20),    -> UserAge int,    -> PRIMARY KEY(Id)    -> ); Query OK, ...

Read More

Prevent negative numbers in MySQL?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 2K+ Views

To prevent negative numbers in MySQL, you need to use INT UNSIGNED. Let’s say you created a table with a column as int i.e. UserGameScores heremysql> create table preventNegativeNumberDemo    - > (    - > UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    - > UserName varchar(20),    - > UserGameScores int    - > ); Query OK, 0 rows affected (1.74 sec)Now if you need to prevent negative numbers in it, modify the same column with INT UNSIGNEDmysql> alter table preventNegativeNumberDemo modify column UserGameScores INT UNSIGNED NOT NULL; Query OK, 0 rows affected (3.32 sec) Records: 0 ...

Read More

How do I prevent Android taking a screenshot when my app goes to the background?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

In some situations, we should not allow to take screen shots of our application. This example demonstrate about how do I prevent Android taking a screenshot when my app goes to the background.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.     In the above code, we have taken text view for some sample view.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import ...

Read More

Run SQL file in MySQL database from terminal?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 7K+ Views

To run SQL file in database, you need to use below syntax:mysql -u yourUserName -p yourDatabaseName < yourFileName.sqlTo understand the above syntax, let us open command prompt using windows+R shortcut key.The snapshot is as follows:After pressing OK button, you will get a command prompt. The snapshot is as follows:Now reach the bin directory, the snapshot is as follows:Here is my file ‘mydb.sql’ which is located in bin directory. The snapshot and content of SQL file is as follows:Now you can type the above syntax which I have discussed to run SQL file. The snapshot of command is as follows:Now you ...

Read More

How to change line color in EditText

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 4K+ Views

In some situations, we should change edit text bottom line color according to background color. This example demonstrate about how to change line color in EditText.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.         In the above code, we have taken edit text, To change line color use the following code for edit text -android:backgroundTint="@android:color/holo_green_light"We can change color as per project requirement. we have taken green color for sample.Step 3 ...

Read More

How to add the JDBC MySQL driver to an Eclipse project?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 12K+ Views

To add the JDBC MySQL driver to an Eclipse project, you need to follow the below steps.The first step is as follows:Step1: Create a dynamic web project with some name in Eclipse.Step2: After pressing the Dynamic Web Project, a new window will open. Now give the project name. The screenshot is as follows:After clicking the Finish button, you will get a project structure. The screenshot is as follows:Therefore, I have a project name JDBCJarFiles and in WEB-INF, there is a lib folder. You can add JDBC jar files in lib folder. Now, paste the jar files here. The screenshot is as ...

Read More

How to get the records of the last two days from the current date in MySQL?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 2K+ Views

To get the records of the last days from the current date, you need to use DATE_SUB(). We will also use NOW() to get the current date. The syntax for the same is as followsSELECT *FROM yourTableName WHERE yourDateTimeColumnName BETWEEN DATE_SUB(DATE(NOW()), INTERVAL 2 DAY) AND DATE_SUB(DATE(NOW()), INTERVAL 1 DAY);Let us see an examplemysql> create table get2daysAgoDemo - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > Name varchar(20), - > PostDateTime datetime - > ); Query OK, 0 rows affected (1.70 ...

Read More
Showing 621–630 of 749 articles
« Prev 1 61 62 63 64 65 75 Next »
Advertisements