8085 program to access and exchange the content of Flag register with register B

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

725 Views

In this program we will see how to exchange the content of Flat register with register B.Problem StatementWrite 8085 Assembly language program to swap the content of flag register and the register B.DiscussionAs we cannot access the flag register content directly, we have to take the help of stack. By using stack, we can push the content of PSW (Accumulator and Flag). Then we can get it back and store into some other registers. Similarly, from other register, we have to push them into stack, then pop it to PSW.Here if we want to exchange the value of B and ... Read More

How to create multiple styles inside a TextView on iOS App?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

340 Views

To create multiple styles inside a textview we need to use attributed string. The text view in ios has a property attributedText which can be used to style the text inside a text view. We’ll see this with help of an example.First, we’ll create an attributelet attributeOne : [NSAttributedString.Key : Any] = [NSAttributedString.Key(rawValue: NSAttributedString.Key.font.rawValue) : UIFont.systemFont(ofSize: 16.0), NSAttributedString.Key(rawValue: NSAttributedString.Key.foregroundColor.rawValue) : UIColor.blue]Then we’ll create an attributed string with the attribute we createdlet string = NSAttributedString(string: "Text for first Attribute", attributes: attributeOne)Similarly, we’ll create another string with different attribute. Then we’ll initialize the text of textView with the attributed string.Now the whole ... Read More

Differences between Flatten() and Ravel() in Numpy

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

198 Views

There are numerous ways to create a numpy array. Numpy provides two different kinds of ways to convert a ndarray to 1Darray: that is using the flatten() method and the other using the ravel() method.Example#Import required library, numpy import numpy as np #create an array from a list arr = np.array( [ (2, 7, 3, 4), (5, 6, 9, 1)]) #flatten_output print(arr.flatten()) #ravel_output print(arr.ravel())Output[2 7 3 4 5 6 9 1] [2 7 3 4 5 6 9 1]Now above we can see that both functions return the same list, so the question arises, why two methods for the same ... Read More

How to select max of mixed string/int column in MySQL?

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

205 Views

To select max of mixed string/int column, you need to use substring() function. The syntax is as follows:SELECT MAX(CAST(SUBSTRING(yourColumnName, 4, length(yourColumnName)-3) AS UNSIGNED)) AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table StringIntMixHighestDemo    -> (    -> InvoiceId int NOT NULL AUTO_INCREMENT,    -> InvoiceNumber varchar(20),    -> PRIMARY KEY(InvoiceId)    -> ); Query OK, 0 rows affected (0.65 sec)Now you can insert some records in the table using insert command. The query is as follows:mysql> insert into StringIntMixHighestDemo(InvoiceNumber) values('INV129'); Query OK, 1 row ... Read More

What is the syntax for defining the data structure in C++?

yashwanth sitamraju
Updated on 30-Jul-2019 22:30:24

254 Views

C++ Programming is basically an enhanced version of C programming language and it is used for “Object-oriented Programming”C++ was developed by Bjarne Stroustrup who did the first development of the language as his first Ph.D. project.He had begun this project because there were no existing programming languages used for large-scale projects.It was initially called as “C with classes”The programming language was first standardized in 1998 and was again issued in 2003, 2007 and 2011.C++ is maintained by ISO, a large standard committee.C++ is widely and commonly used in embedded systems and software engineering.C++ has influenced languages like PHP and C-sharp.Data ... Read More

How to Reset MySQL AutoIncrement using a MAX value from another table?

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

893 Views

You can use prepare statement to Reset MySQL AutoIncrement using a MAX value from another table.The following is the syntax −set @anyVariableName1=(select MAX(yourColumnName) from yourTableName1); SET @anyVariableName2 = CONCAT('ALTER TABLE yourTableName2 AUTO_INCREMENT=', @anyVariableName1); PREPARE yourStatementName FROM @anyVariableName2; execute yourStatementName;The above syntax will reset MySQL auto_increment using a maximum value from another table. To understand the above syntax, let us create two tables. The first table will contain the records and the second table will use the maximum value from the first table and use for an auto_increment property.The query to create a table is as follows −mysql> create table FirstTableMaxValue ... Read More

Insert datetime into another datetime field in MySQL?

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

355 Views

You can achieve this with the help of update command. To understand the method, let us create a table. The query to create a table is as follows −mysql> create table AddDateTimeWithOther −> ( −> Id int, −> IssueDate datetime, −> DueDate datetime −> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table with insert statement. The query is as follows −mysql> insert into AddDateTimeWithOther values(100, now(), date_add(now(), interval -3 year)); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More

What is the difference between scramjet and ramjet engines?

Shanmukh Pasumarthy
Updated on 30-Jul-2019 22:30:24

806 Views

Both scramjet and Ramjet are types of jet engines. A ramjet is an air breathing jet engine which is usually associated with supersonic transport. Ramjets can start at supersonic speeds only, so as a result they cannot be started at zero velocity and cannot produce thrust as there is a lack of airspeed.Hence assisted take off flights or rockets are needed to or accelerate it to a supersonic speed from which it starts producing thrust. This makes ramjet engine to be efficient only at supersonic speeds as it can accelerate to speeds of about Mach 6. Ramjet has revolutionized Rocket ... Read More

What are Guerrilla Marketing Strategies?

Knowledge base
Updated on 30-Jul-2019 22:30:24

121 Views

The concept of Guerrilla marketing was created by Jay Conrad Levinson. Traditional marketing involves advertising methods such as advertising on television, radio, print, and mail. Online marketing or Digital marketing is the type of advertising which we see today on websites, YouTube videos, blogs, etc. Whereas, Guerrilla Marketing is an inexpensive method that focuses more on reach rather than frequency. This style of marketing is effective for small businesses to advertise their product and services. One needs to have imagination, energy and time for this kind of advertising.Give an ImpactThis kind of advertising engages the customers with the product and ... Read More

Basic Slicing and Advanced Indexing in NumPy Python

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

376 Views

Indexing of ndarrays can be done using the standard python x[obj] syntax, where x is the array and obj the selection.There are three kinds of indexing available −field accessbasic slicingadvanced indexingWhat kind of indexing will be there depends on obj. In this section, we are going to mainly concentrate on basic slicing & advanced indexing.We can divide advanced indexing into two parts −Integer array indexingBoolean indexingBasic SlicingPython basic concept of slicing is extended in basic slicing to n dimensions. As with python slice object which is constructed by giving a start, stop & step parameters to slice function. To get ... Read More

Advertisements