Use of Map in JavaScript

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

269 Views

MapMap holds key value pairs and remembers the actual insertion order of the keys. Map allows to store only a unique value.syntaxnew Map([iterable])Case-1: Absence Of MapIn the absence of Map, since javascript object endorses only one key object, If we provide multiple keys only the last one will be remembered. In the following example despite providing many keys such as a and b only b is remembered and displayed as output.So to eliminate this drawback "Map" came in to existence in javascript.ExampleLive Demo    const x = {};    const a = {};    const b = { ... Read More

8085 Program for Running Light with Delays Using Lookup Table

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

1K+ Views

Here we will see how we can implement running light with some delays using 8085.Problem StatementWrite 8085 program to implement running light display with appropriate delays using lookup table stored from memory location 8100H on words.DiscussionThe patterns are stored at location 8100 onwards. We are using 8255 port IC to display the content in LED displays. After displaying, it calls the delay to wait for some time and call the next byte from memory to display. So the display pattern will be like below - ProgramAddressHEX CodesLabelsMnemonicsComments800031, 00, 82START:LXI SP, 8200 HInitializing the SP80030E, 15 MVI C, 14 HInitializing the counter800521, 00, ... Read More

Efficiently Select Random Rows in MySQL

Rama Giri
Updated on 30-Jul-2019 22:30:26

502 Views

Use RAND() method for random and to limit a number of records, use the LIMIT() method in MySQL.Let us first create a table −mysql> create table DemoTable    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(300); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(600); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(700); Query OK, 1 row ... Read More

Get Current Location Latitude and Longitude in iOS

Kumar Varma
Updated on 30-Jul-2019 22:30:26

3K+ Views

Almost all the application uses location services, thus having complete understanding on location is necessary. In this post we will be seeing how to get current location’s latitude and longitude.For this we will be using CLLocationManager, you can read more about it herehttps://developer.apple.com/documentation/corelocation/cllocationmanagerWe will be developing a sample application where we will print user’s latitude and longitude on viewDidLoad method, alternatively you can print on tap of a button also on UILabel as per need.So let’s get started, Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “Location”Step 2 − Open info.plist file ... Read More

Get Max and Min Values Along with Their Row ID in MySQL

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

2K+ Views

You can use aggregate function MAX() and MIN() for this.Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Number1 int,    Number2 int    ); Query OK, 0 rows affected (0.89 sec)Insert records in the table using insert command −mysql> insert into DemoTable(Number1, Number2) values(67, 45); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(Number1, Number2) values(90, 40); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(Number1, Number2) values(80, 43); Query OK, 1 row affected (0.48 sec)Display all records from the table using select ... Read More

Java DatabaseMetaData getMaxIndexLength Method with Example

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

95 Views

The getMaxIndexLength() method of the DatabaseMetaData interface is used to find out the maximum number of bytes that the underlying database allows for an index.This method returns an integer value, representing the maximum number of byes allowed in an index. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager ... Read More

Order in Group Randomly with MySQL

Anvi Jain
Updated on 30-Jul-2019 22:30:26

355 Views

Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value char(1)    ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value) values('X'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(Value) values('Y'); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable(Value) values('X'); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable(Value) values('X'); Query OK, 1 row affected (0.07 sec) mysql> insert into DemoTable(Value) values('Y'); Query OK, 1 ... Read More

Transfer a Block in Reverse Order using 8085

George John
Updated on 30-Jul-2019 22:30:26

8K+ Views

Here we will see how we transfer a block of data in reverse order using 8085.Problem StatementWrite 8085 program to transfer a block of N-bytes in reverse order. The block is stored at location 8001 onwards, the size of the block is stored at 8000. The block will be moved at location 9000 onwards.DiscussionTo solve this problem, we are taking the size of the block at first. The DE register pair is set to point at destination address 9000H. The HL pair is set to point to the last element of the block. If the block size is 0A, then ... Read More

MySQL Query to Return Only Numeric Rows

Kumar Varma
Updated on 30-Jul-2019 22:30:26

1K+ Views

Use REGEXP to return only the numeric rows. Let us first create a table −mysql> create table DemoTable    -> (    -> StudentId varchar(100)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John74747'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('8494575Carol'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('985755645'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Carol-9032'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('101'); ... Read More

HTML DOM Input DatetimeLocal Disabled Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

129 Views

The HTML DOM Input DatetimeLocal disabled property sets/returns whether Input DatetimeLocal is enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeLocalObject.disabledSetting disabled to booleanValueinputDatetimeLocalObject.disabled = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetimeLocal is disabled.falseIt defines that the input datetimeLocal is not disabled and it is also the default value.ExampleLet us see an example of Input DatetimeLocal disabled property − Live Demo Input DatetimeLocal Disabled    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       ... Read More

Advertisements