Friday, May 31, 2019

operators in java

Java Operators

Operators

Now that you've learned how to declare and initialize variables, you probably want to know how to do something with them. Learning the operators of the Java programming language is a good place to start. Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result.

As we explore the operators of the Java programming language, it may be helpful for you to know ahead of time which operators have the highest precedence. The operators in the following table are listed according to precedence order. The closer to the top of the table an operator appears, the higher its precedence. Operators with higher precedence are evaluated before operators with relatively lower precedence. Operators on the same line have equal precedence. When operators of equal precedence appear in the same expression, a rule must govern which is evaluated first. All binary operators except for the assignment operators are evaluated from left to right; assignment operators are evaluated right to left.


Operator Precedence
OperatorsPrecedence
postfixexpr++ expr--
unary++expr --expr +expr -expr ~ !
multiplicative* / %
additive+ -
shift<< >> >>>
relational< > <= >= instanceof
equality== !=
bitwise AND&
bitwise exclusive OR^
bitwise inclusive OR|
logical AND&&
logical OR||
ternary? :
assignment= += -= *= /= %= &= ^= |= <<= >>= >>>=


The Arithmetic Operators

The Java programming language provides operators that perform addition, subtraction, multiplication, and division. There's a good chance you'll recognize them by their counterparts in basic mathematics. The only symbol that might look new to you is "%", which divides one operand by another and returns the remainder as its result.
OperatorDescription
+Additive operator (also used for String concatenation)
-Subtraction operator
*Multiplication operator
/Division operator
%Remainder operator


The Unary Operators

The unary operators require only one operand; they perform various operations such as incrementing/decrementing a value by one, negating an expression, or inverting the value of a boolean.
OperatorDescription
+Unary plus operator; indicates positive value (numbers are positive without this, however)
-Unary minus operator; negates an expression
++Increment operator; increments a value by 1
--Decrement operator; decrements a value by 1
!Logical complement operator; inverts the value of a boolean



The Equality and Relational Operators

The equality and relational operators determine if one operand is greater than, less than, equal to, or not equal to another operand. The majority of these operators will probably look familiar to you as well. Keep in mind that you must use "==", not "=", when testing if two primitive values are equal.
==      equal to
!=      not equal to
>       greater than
>=      greater than or equal to
<       less than
<=      less than or equal to


The Conditional Operators

The && and || operators perform Conditional-AND and Conditional-OR operations on two boolean expressions. These operators exhibit "short-circuiting" behavior, which means that the second operand is evaluated only if needed.
&& Conditional-AND
|| Conditional-OR
The following program, ConditionalDemo1, tests these operators:
class ConditionalDemo1 {

    public static void main(String[] args){
        int value1 = 1;
        int value2 = 2;
        if((value1 == 1) && (value2 == 2))
            System.out.println("value1 is 1 AND value2 is 2");
        if((value1 == 1) || (value2 == 1))
            System.out.println("value1 is 1 OR value2 is 1");
    }
}

Another conditional operator is ?:, which can be thought of as shorthand for an if-then-else statement (discussed in the Control Flow Statements section of this lesson). This operator is also known as the ternary operator because it uses three operands. In the following example, this operator should be read as: "If someCondition is true, assign the value of value1 to result. Otherwise, assign the value of value2 to result."
The following program, ConditionalDemo2, tests the ?: operator:
class ConditionalDemo2 {

    public static void main(String[] args){
        int value1 = 1;
        int value2 = 2;
        int result;
        boolean someCondition = true;
        result = someCondition ? value1 : value2;

        System.out.println(result);
    }
}

Because someCondition is true, this program prints "1" to the screen. Use the ?: operator instead of an if-then-else statement if it makes your code more readable; for example, when the expressions are compact and without side-effects (such as assignments).












Monday, May 27, 2019

XML Basics

XML- Extensible markup language

What is XML?

  • XML stands for eXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to store and transport data
  • XML was designed to be self-descriptive
  • XML is a W3C Recommendation

XML Does Not DO Anything

Maybe it is a little hard to understand, but XML does not DO anything.
This note is a note to Tove from Jani, stored as XML:

<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

The Difference Between XML and HTML

XML and HTML were designed with different goals:
  • XML was designed to carry data - with focus on what data is
  • HTML was designed to display data - with a focus on how data looks
  • XML tags are not predefined like HTML tags are.


XML

Saturday, May 25, 2019

Javascript Basics


Javascript Basics

JavaScript presentation

Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

   1. HTML to define the content of web pages
   2. CSS to specify the layout of web pages
   3. JavaScript to program the behavior of web pages

Web pages are not the only place where JavaScript is used. Many desktop and server programs use JavaScript. Node.js is the best known. Some databases, like MongoDB and CouchDB, also use JavaScript as their programming language.



PL-SQL Concepts


PL-SQL Concepts Presentations.

PL SQL is procedural language or structured language.



The main feature of SQL (non-procedural) is also a drawback of SQL: one cannot use control statements (decision-making or iterative control) if only SQL is to be used.

PL/SQL is basically a procedural language, which provides the functionality of decision making, iteration and many more features like other procedural programming languages.

 A PL/SQL program unit is one of the following: PL/SQL anonymous block, procedurefunctionpackage specification, package body, trigger, type specification, type body, library. Program units are the PL/SQL source code that is compiled, developed and ultimately executed on the database.







Normalization in Database


Normalization

Normalization: Process to reduce redundancy.

Normalizing a Database:


Normalization is a process of reducing redundancies of data in a database. Normalization is a technique that is used when designing and redesigning a database.
 Normalization is a process or set of guidelines used to optimally design a database to reduce redundant data.
 The actual guidelines of normalization, called normal forms, will be discussed later in this hour.
 It was a difficult decision to decide whether to cover normalization in this book because of the complexity involved in understanding the rules of the normal forms this early on in your SQL journey.
 However, normalization is an important process that, if understood, will increase your understanding of SQL.
 We have attempted to simplify the process of normalization as much as possible in this hour. 
At this point, don't be overly concerned with all the specifics of normalization; it is most important to understand the basic concepts.

Transaction in Database and ACID properties


Database Transactions

In this presentation transactions in the database is explained.


In computer scienceACID (AtomicityConsistencyIsolationDurability) is a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc. In the context of databases, a sequence of database operations that satisfies the ACID properties (and these can be perceived as a single logical operation on the data) is called a transaction. For example, a transfer of funds from one bank account to another, even involving multiple changes such as debiting one account and crediting another, is a single transaction.




SQL


SQL- Structured Query Language Presentations









SQL Quick Reference



SQL StatementSyntax
AND / ORSELECT column_name(s)
FROM table_name
WHERE condition
AND|OR condition
ALTER TABLEALTER TABLE table_name 
ADD column_name datatype
or
ALTER TABLE table_name 
DROP COLUMN column_name
AS (alias)SELECT column_name AS column_alias
FROM table_name
or
SELECT column_name
FROM table_name  AS table_alias
BETWEENSELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2
CREATE DATABASECREATE DATABASE database_name
CREATE TABLECREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
...
)
CREATE INDEXCREATE INDEX index_name
ON table_name (column_name)
or
CREATE UNIQUE INDEX index_name
ON table_name (column_name)
CREATE VIEWCREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
DELETEDELETE FROM table_name
WHERE some_column=some_value
or
DELETE FROM table_name 
(Note: Deletes the entire table!!)
DELETE * FROM table_name 
(Note: Deletes the entire table!!)
DROP DATABASEDROP DATABASE database_name
DROP INDEXDROP INDEX table_name.index_name (SQL Server)
DROP INDEX index_name ON table_name (MS Access)
DROP INDEX index_name (DB2/Oracle)
ALTER TABLE table_name
DROP INDEX index_name (MySQL)
DROP TABLEDROP TABLE table_name
EXISTSIF EXISTS (SELECT * FROM table_name WHERE id = ?)
BEGIN
--do what needs to be done if exists
END
ELSE
BEGIN
--do what needs to be done if not
END
GROUP BYSELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVINGSELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
INSELECT column_name(s)
FROM table_name
WHERE column_name
IN (value1,value2,..)
INSERT INTOINSERT INTO table_name
VALUES (value1, value2, value3,....)
or
INSERT INTO table_name
(column1, column2, column3,...)
VALUES (value1, value2, value3,....)
INNER JOINSELECT column_name(s)
FROM table_name1
INNER JOIN table_name2 
ON table_name1.column_name=table_name2.column_name
LEFT JOINSELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2 
ON table_name1.column_name=table_name2.column_name
RIGHT JOINSELECT column_name(s)
FROM table_name1
RIGHT JOIN table_name2 
ON table_name1.column_name=table_name2.column_name
FULL JOINSELECT column_name(s)
FROM table_name1
FULL JOIN table_name2 
ON table_name1.column_name=table_name2.column_name
LIKESELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern
ORDER BYSELECT column_name(s)
FROM table_name
ORDER BY column_name [ASC|DESC]
SELECTSELECT column_name(s)
FROM table_name
SELECT *SELECT *
FROM table_name
SELECT DISTINCTSELECT DISTINCT column_name(s)
FROM table_name
SELECT INTOSELECT *
INTO new_table_name [IN externaldatabase]
FROM old_table_name
or
SELECT column_name(s)
INTO new_table_name [IN externaldatabase]
FROM old_table_name
SELECT TOPSELECT TOP number|percent column_name(s)
FROM table_name
TRUNCATE TABLETRUNCATE TABLE table_name
UNIONSELECT column_name(s) FROM table_name1
UNION
SELECT column_name(s) FROM table_name2
UNION ALLSELECT column_name(s) FROM table_name1
UNION ALL
SELECT column_name(s) FROM table_name2
UPDATEUPDATE table_name
SET column1=value, column2=value,...
WHERE some_column=some_value
WHERESELECT column_name(s)
FROM table_name
WHERE column_name operator value

Database Codd Rules


Codd Rules Presentation



DBMS | Relational Model Introduction and Codd Rules

Terminology
Relational Model: Relational model represents data in the form of relations or tables.
Relational Schema: Schema represents the structure of a relation. e.g.; Relational Schema of STUDENT relation can be represented as:
STUDENT (STUD_NO, STUD_NAME, STUD_PHONE, STUD_STATE, STUD_COUNTRY, STUD_AGE)
Relational Instance: The set of values present in relation to a particular instance of time is known as relational instance as shown in Table 1 and Table 2.
Attribute: Each relation is defined in terms of some properties, each of which is known as attribute. For Example, STUD_NO, STUD_NAME, etc. are attributes of relation STUDENT.
The domain of an attribute: The possible values an attribute can take in a relation is called its domain. For Example, the domain of STUD_AGE can be from 18 to 40.
Tuple: Each row of a relation is known as a tuple. e.g.; STUDENT relation given below has 4 tuples.
NULL values: Values of some attribute for some tuples may be unknown, missing or undefined which are represented by NULL. Two NULL values in a relation are considered different from each other.
Table 1 and Table 2 represent the relational model having two relations STUDENT and STUDENT_COURSE.
image
Codd Rules
Codd rules were proposed by E.F. Codd which should be satisfied by relational model.
  1. Foundation Rule: For any system that is advertised as, or claimed to be, a relational data base management system, that system must be able to manage data bases entirely through its relational capabilities.
  2. Information Rule: Data stored in Relational model must be a value of some cell of a table.
  3. Guaranteed Access Rule: Every data element must be accessible by table name, its primary key and name of attribute whose value is to be determined.
  4. Systematic Treatment of NULL values: NULL value in database must only correspond to missing, unknown or not applicable values.
  5. Active Online Catalog: Structure of database must be stored in an online catalog which can be queried by authorized users.
  6. Comprehensive Data Sub-language Rule: A database should be accessible by a language supported for definition, manipulation and transaction management operation.
  7. View Updating Rule: Different views created for various purposes should be automatically updatable by the system.
  8. High level insert, update and delete rule: Relational Model should support insert, delete, update etc. operations at each level of relations. Also, set operations like Union, Intersection and minus should be supported.
  9. Physical data independence: Any modification in the physical location of a table should not enforce modification at application level.
  10. Logical data independence: Any modification in logical or conceptual schema of a table should not enforce modification at application level. For example, merging of two tables into one should not affect application accessing it which is difficult to achieve.
  11. Integrity Independence: Integrity constraints modified at database level should not enforce modification at application level.
  12. Distribution Independence: Distribution of data over various locations should not be visible to end-users.
  13. Non-Subversion Rule: Low level access to data should not be able to bypass integrity rule to change data.





Given the basic ER and relational models, which of the following is INCORRECT?
A. An attribute of an entity can have more than one value
B. An attribute of an entity can be composite
C. In a row of a relational table, an attribute can have more than one value
D. In a row of a relational table, an attribute can have exactly one value or a NULL value
Answer: In relation model, an attribute can’t have more than one value. So, option C is the answer.

Software Development Tools


Software Development Tools Presentation



From the moment you begin developing software, whether as a freelancer for a startup or working in a big company, having the right software development tools is essential. These tools cover a wide range of needs, from helping you organize your work to uploading and transferring files and much more.








Agile Methodology and Software Testing Techniques

Software Development Life Cycle

SDLC by Dinesh Kumar

Agile Methodology and Software Testing Techniques in One page

SDLC- Software Development Life Cycle


Software Development Life Cycle Explained in this Presentation.

Software Development Life Cycle (SDLC) is a process used by the software industry to design, develop and test high quality softwares. The SDLC aims to produce a high-quality software that meets or exceeds customer expectations, reaches completion within times and cost estimates.

  • SDLC is the acronym of Software Development Life Cycle.
  • It is also called as Software Development Process.
  • SDLC is a framework defining tasks performed at each step in the software development process.
  • ISO/IEC 12207 is an international standard for software life-cycle processes. It aims to be the standard that defines all the tasks required for developing and maintaining software.

Coding Standards


Coding Standards Presentation


They are a series of procedures that can be defined for a particular programming language specifying a programming style, the methods, & different procedures. These procedures can be for various aspects of the program written in that language. They can be considered as essential attributes of software development.
A coding standard makes sure that all the developers working on the project are following certain specified guidelines. The code can be easily understood and a proper consistency is maintained.
Consistency has a positive impact on the quality of the program and one should maintain it while coding. Also, it should be taken care that the guidelines are homogeneously followed across different levels of the system and they do not contradict each other. The finished program code should look like that it has been written by a single developer, in a single session.

Create a Digital Clock using HTML and JavaScript

Create a Digital Clock using HTML and JavaScript  <! DOCTYPE html> < html > < head > ...

Followers

Search This Blog

Popular Posts