8086 Program to Find the Square Root of a Perfect Square Root Number

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

1K+ Views

In this program we will see how to find the square root of a perfect squared.Problem StatementWrite 8086 Assembly language program to find the square root of a perfect squared number. The number is stored at memory address 3000. Finally store the result at memory address 3002.DiscussionFor the perfect square number starting from 0 we are performing square of it, then check whether it is same as the given number or not. If they are same then the current value will be the square root.For a number 51H (81D), we will check 02, 12, 22, ….. , 92. After 92 ... Read More

Create Digital Clock with TextView in Android

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

1K+ Views

This example demonstrates How to create digital clock with textview 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 textview. It will show clock with blink animation as we see in normal digital clock.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; public ... Read More

Important Server Response Headers in Web Programming

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

183 Views

Following is a summary of the most useful HTTP 1.1 response headers which go back to the browser from the web server. These headers are frequently used in web programming −Sr.No.Header & Description1AllowThis header specifies the request methods (GET, POST, etc.) that the server supports.2Cache-ControlThis header specifies the circumstances in which the response document can safely be cached. It can have values public, private or no-cache etc. Public means document is cacheable, Private means document is for a single user and can only be stored in private (nonshared) caches and no-cache means document should never be cached.3ConnectionThis header instructs the ... Read More

Pass Date Variable in SQL Query in JSP

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

1K+ Views

The tag is used as a nested action for the and the tag to supply a date and time value for a value placeholder. If a null value is provided, the value is set to SQL NULL for the placeholder.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueValue of the date parameter to set (java.util.Date)NoBodytypeDATE (date only), TIME (time only), or TIMESTAMP (date and time)NoTIMESTAMPExampleTo start with basic concept, let us create a simple table Students table in the TEST database and create a few records in that table as follows −Step 1Open a Command Prompt and change ... Read More

DoubleStream boxed() Method in Java

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

172 Views

The boxed() method of the DoubleStream class returns a Stream consisting of the elements of this stream, boxed to Double.The syntax is as followsStream boxed()Here, Double is the class that wraps a value of the primitive type double in an object. To work with DoubleStream class in Java, import the following pageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream boxed() method in JavaExample Live Demoimport java.util.*; import java.util.stream.Stream; import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(80.2, 84.6, 88.9, 92.9); ... Read More

IntStream sum Method in Java

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

248 Views

The sum() method of the IntStream class is used in Java to return the sum of elements in this stream.The syntax is as follows −int sum()To work with the IntStream class in Java, import the following package −import java.util.stream.IntStream;Create IntStream and add some elements −IntStream intStream = IntStream.of(50, 100, 150, 200, 250, 300);Now, return the sum of elements in the IntStream added above −int sumVal = intStream.sum();The following is an example to implement IntStream sum() method in Java −Example Live Demoimport java.util.stream.IntStream; public class Demo {    public static void main(String[] args) {       IntStream intStream = IntStream.of(50, ... Read More

Passing a 2D Array to a C++ Function

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

2K+ Views

Arrays can be passed to a function as an argument. In this program, we will perform to display the elements of the 2 dimensional array by passing it to a function.AlgorithmBegin The 2D array n[][] passed to the function show(). Call function show() function, the array n (n) is traversed using a nested for loop. EndExample Code Live Demo#include using namespace std; void show(int n[4][3]); int main() {    int n[4][3] = {       {3, 4 ,2},       {9, 5 ,1},       {7, 6, 2},       {4, 8, 1}};    show(n);    return 0; } void show(int n[][3]) { cout

Convert ObjectId to String in MongoDB

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

3K+ Views

To convert ObjectId to string, use the $toString in MongoDB. To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.objectidToStringDemo.insertOne({"UserName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92b80036de59bd9de0639d") } > db.objectidToStringDemo.insertOne({"UserName":"Chris"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92b80436de59bd9de0639e") } > db.objectidToStringDemo.insertOne({"UserName":"Larry"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92b80936de59bd9de0639f") } > db.objectidToStringDemo.insertOne({"UserName":"Robert"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92b81836de59bd9de063a0") }Display all documents from a collection with the help of find() method. The query is as follows −> ... Read More

Connect to MongoDB Database Using JDBC Program

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

1K+ Views

MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.Before you start connecting MongoDB in you need to make sure that you have MongoDB JDBC driver. If not, download the jar from the path Download mongo.jar and, add it to your classpath.ExampleFollowing JDBC program establishes connection with the MongoDB database and creates a collection in it.import com.mongodb.client.MongoDatabase; import com.mongodb.MongoClient; import com.mongodb.MongoCredential; public class CreatingCollection {    public static void main( String args[] ) {       // Creating a Mongo client       MongoClient ... Read More

Use Android Loader

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

1K+ Views

This example demonstrate about How to Use Android loaderStep 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. ss     In the above code, we have taken listview to show contact names.Step 3 − Add the following code to src/MainActivity.java import android.Manifest; import android.content.CursorLoader; import android.content.Loader; import android.content.pm.PackageManager; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.support.v4.content.ContextCompat; import android.support.v4.widget.SimpleCursorAdapter; import android.widget.ListView; public class MainActivity extends FragmentActivity implements android.app.LoaderManager.LoaderCallbacks {    private ... Read More

Advertisements