We have seen previously that the linker is invoked in three modes i.e. they are command line mode, prompt mode and data file mode. For the linker to be run in this mode we type ‘LINK85 -C MULT.OBJ’ along with the change of address. In the above command simply “MULT” is enough instead of the command ‘MULT.OBJ’. We run the linker in this Command Mode type as by simply the following steps: Simply ‘MULT’ is more than enough instead of ‘MULT.OBJ’ in the command above. The linker in running command mode is indicated by the option -C. The command which ... Read More
Before having a discussion regarding the demerits of I/O mapped I/O and merits of memory-mapped I/O, let us have a generic discussion regarding the difference between I/O mapped I/O and memory mapped I/O.In Memory Mapped Input Output −We allocate a memory address to an Input-Output device.Any instructions related to memory can be accessed by this Input-Output device.The Input-Output device data are also given to the Arithmetic Logical Unit.Input-Output Mapped Input Output −We give an Input-Output address to an Input-Output deviceOnly IN and OUT instructions are accessed by such devices.The ALU operations are not directly applicable to such Input-Output data.So as ... Read More
This example demonstrates How to write an image file in internal storage 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 a button. When user click on button, It will store data in internal storage.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.content.Context; import android.content.ContextWrapper; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import ... Read More
First, you need to open the CMD with the help of shortcut key Windows+R key.After typing cmd, press the OK button. On pressing, you will get a command prompt. The screenshot is as follows −After that, you need to reach the /bin directory. Follow the below instructions. If you are a Windows user, then use the below query to reach the /bin directory.The query is as follows −mysql> select @@datadir;The following is the output displaying the path −+---------------------------------------------+ | @@datadir ... Read More
This example demonstrate about How to get current address from Network provider 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 a text view to show the current address.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.Manifest; import android.content.pm.PackageManager; import android.location.Address; import android.location.Geocoder; import android.location.Location; import android.location.LocationManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; ... Read More
This example demonstrates How to verify action bar tittle is truncating or not 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 action bar tittle status.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.annotation.SuppressLint; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; ... Read More
An immutable copy of a LocalTime object where some seconds are added to it can be obtained using the plusSeconds() method in the LocalTime class in Java. This method requires a single parameter i.e. the number of seconds to be added and it returns the LocalTime object with the added seconds.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalTime lt = LocalTime.now(); System.out.println("The current LocalTime is: " + lt); System.out.println("The LocalTime with 5 seconds added is: ... Read More
You need to use ALTER TABLE command along with MODIFYThe syntax is as followsALTER TABLE yourTableName MODIFY COLUMN yourColumnName varchar(100) NOT NULL;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table syntaxOfAlterCommandDemo -> ( -> UserId int, -> UserName varchar(30), -> UserAge int, -> UserCityName varchar(50) -> ); Query OK, 0 rows affected (0.51 sec)Let us check the description of the table.The query is as followsmysql> desc syntaxOfAlterCommandDemo;The following is the output+--------------+-------------+------+-----+---------+-------+ | Field | Type ... Read More
If you want to remove an element from the AbstractCollection classs, use the remove() method. It returns TRUE if the elements requested to be removed is successfully removed from the collection.The syntax is as follows:public boolean remove(Object ob)Here, ob is the element to be removed the from this Collection. Whereas, the class Object is the root of the class hierarchy.To work with AbstractCollection class in Java, import the following package:import java.util.AbstractCollection;The following is an example to implement AbstractCollection remove() method in Java:Example Live Demoimport java.util.Iterator; import java.util.ArrayList; import java.util.AbstractCollection; public class Demo { public static void main(String[] args) { ... Read More
Rolling hash is a hash function in which the input is hashed in a window that moves through the input.Rabin-Karp is popular application of rolling hash. The rolling hash function proposed by Rabin and Karp calculates an integer value. For a string the integer value is numeric value of a string.The Rabin–Karp string search algorithm is often explained using a very simple rolling hash function that only uses multiplications and additions −H=c1ak-1+c2ak-2+….+ cka0.Where, a is a constant, and c1, c2….ck are the input characters. In order to manipulate Huge value of H, mod n is done.AlgorithmBegin Declare a constant ... Read More