SlideShare a Scribd company logo
CONTENT
CHAPTER 1
1.1SOFTWARE DEVELOPMENT LIFE CYCLE
1.2 WATERFALL MODEL
1.3 AGILE MODEL
1.4 AGILE VS TRADITIONAL SDLC MODELS
1.5 AGILE MODEL -PROS AND CONS
1.6 REQUIREMENTS FOR EVENT MANAGEMENT
CHAPTER 2
2.1 DATA
2.2 DATABASE
2.3 OLTP VS OLAP
2.4 DATABASE QUERY FOR EVENT MANAGEMENT
CHAPTER 3
3.1 UNIFIED MODELING LANGUAGE(UML)
3.2 STARUML
3.3 UMLET
CHAPTER 4
4.1 INTERNET OF THINGS(IOT)
4.2 IOT SENSORS
4.3 ARDUINO
4.4 BREADBOARD
4.5 ULTRASONIC SENSOR
4.6 SERVO MOTOR
4.7 HUMIDITY SENSOR DHT11
4.8 ARDUINO I2C SERIAL LCD 16X2
4.9 PIR SENSOR
4.10 LPG GAS SENSOR(MQ6)
4.11 ELT
CHAPTER 5
5.1 Smart Packaging
CHAPTER 6
6.1 JAVA
6.2 FEATURES OF JAVA
6.3 ARRAYLIST IN JAVA
6.4 ENUM IN JAVA
6.5 Anonymous Classes
CHAPTER 7
7.1 WHAT IS ANDROID?
7.2 WHY DEVELOP APPS FOR ANDROID?
7.3 ANDROID DEVELOPMENT ARCHITECTURE
CHAPTER 8
8.1 HTTP
8.2 HISTORY OF HTTP
8.3 HOW HTTP WORKS?
8.4 ISSUES WITH HTTP
8.5 CLIENT SERVER ARCHITECTURE
CHAPTER 9
9.1 WHAT IS .NET?
9.2 LANGUAGES
9.3 CROSS PLATFORM
9.4 ONE CONSISTENT API
9.5 LIBRARIES
CHAPTER 1
1.1 Software Development Life Cycle (SDLC)
Definition - What does Software Development Life Cycle (SDLC) mean?
The software development life cycle (SDLC) is a framework defining tasks performed at each
step in the software development process. SDLC is a structure followed by a development team
within the software organization. It consists of a detailed plan describing how to develop,
maintain and replace specific software. The life cycle defines a methodology for improving the
quality of software and the overall development process.
The software development life cycle is also known as the software development process
SDLC consists of following activities:
1. Planning: The most important parts of software development, requirement gathering or
requirement analysis are usually done by the most skilled and experienced software
engineers in the organization. After the requirements are gathered from the client, a scope
document is created in which the scope of the project is determined and documented.
2. Implementation: The software engineers start writing the code according to the client's
requirements.
3. Testing: This is the process of finding defects or bugs in the created software.
4. Documentation: Every step in the project is documented for future reference and for the
improvement of the software in the development process. The design documentation may
include writing the application programming interface (API).
5. Deployment and maintenance: The software is deployed after it has been approved for
release.
6. Maintaining: Software maintenance is done for future reference. Software improvement
and new requirements (change requests) can take longer than the time needed to create
the initial development of the software.
There are several software development models followed by various organizations:
• Waterfall Model: This model involves finishing each phase completely before
commencing the next one. When each phase is completed successfully, it is reviewed to
see if the project is on track and whether it is feasible to continue.
• V-Shaped Model: This model focuses on the execution of processes in a sequential
manner, similar to the waterfall model but with more importance placed on testing.
Testing procedures are written even before the commencement of writing code. A system
plan is generated before starting the development phase.
• Incremental Model: This life cycle model involves multiple development cycles. The
cycles are divided up into smaller iterations. These iterations can be easily managed and
go through a set of phases including requirements, design, implementation and testing. A
working version of the software is produced during the first iteration, so working
software is created early in the development process.
.
1.2 Waterfall Model:
The Waterfall Model was the first Process Model to be introduced. It is also referred to as
a linear-sequential life cycle model. It is very simple to understand and use. In a waterfall
model, each phase must be completed before the next phase can begin and there is no
overlapping in the phases.
The Waterfall model is the earliest SDLC approach that was used for software development.
The waterfall Model illustrates the software development process in a linear sequential flow.
This means that any phase in the development process begins only if the previous phase is
complete. In this waterfall model, the phases do not overlap.
WaterfallModel-Design
Waterfall approach was first SDLC Model to be used widely in Software Engineering to ensure
success of the project. In "The Waterfall" approach, the whole process of software development
is divided into separate phases. In this Waterfall model, typically, the outcome of one phase acts
as the input for the next phase sequentially.
The following illustration is a representation of the different phases of the Waterfall Model.
The sequential phases in Waterfall model are −
• Requirement Gathering and analysis − All possible requirements of the system to be
developed are captured in this phase and documented in a requirement specification
document.
• System Design − The requirement specifications from first phase are studied in this
phase and the system design is prepared. This system design helps in specifying
hardware and system requirements and helps in defining the overall system architecture.
• Implementation − With inputs from the system design, the system is first developed in
small programs called units, which are integrated in the next phase. Each unit is
developed and tested for its functionality, which is referred to as Unit Testing.
• Integration and Testing − All the units developed in the implementation phase are
integrated into a system after testing of each unit. Post integration the entire system is
tested for any faults and failures.
• Deployment of system − Once the functional and non-functional testing is done; the
product is deployed in the customer environment or released into the market.
• Maintenance − There are some issues which come up in the client environment. To fix
those issues, patches are released. Also to enhance the product some better versions are
released. Maintenance is done to deliver these changes in the customer environment.
All these phases are cascaded to each other in which progress is seen as flowing steadily
downwards (like a waterfall) through the phases. The next phase is started only after the defined
set of goals are achieved for previous phase and it is signed off, so the name "Waterfall Model".
In this model, phases do not overlap.
1.3 Agile MODEL
Agile model believes that every project needs to be handled differently and the existing methods
need to be tailored to best suit the project requirements. In Agile, the tasks are divided to time
boxes (small time frames) to deliver specific features for a release.
Iterative approach is taken and working software build is delivered after each iteration. Each
build is incremental in terms of features; the final build holds all the features required by the
customer.
Here is a graphical illustration of the Agile Model −
The Agile thought process had started early in the software development and started becoming
popular with time due to its flexibility and adaptability.
The most popular Agile methods include Rational Unified Process (1994), Scrum (1995),
Crystal Clear, Extreme Programming (1996), Adaptive Software Development, Feature Driven
Development, and Dynamic Systems Development Method (DSDM) (1995). These are now
collectively referred to as Agile Methodologies, after the Agile Manifesto was published in
2001.
Following are the Agile Manifesto principles −
• Individuals and interactions − In Agile development, self-organization and motivation are
important, as are interactions like co-location and pair programming.
• Working software − Demo working software is considered the best means of communication with
the customers to understand their requirements, instead of just depending on documentation.
• Customer collaboration − As the requirements cannot be gathered completely in the beginning of
the project due to various factors, continuous customer interaction is very important to get proper
product requirements.
• Responding to change − Agile Development is focused on quick responses to change and continuous
development.
1.4 Agile Vs Traditional SDLC Models
Agile is based on the adaptive software development methods, whereas the traditional SDLC
models like the waterfall model is based on a predictive approach. Predictive teams in the
traditional SDLC models usually work with detailed planning and have a complete forecast of
the exact tasks and features to be delivered in the next few months or during the product life
cycle.
Predictive methods entirely depend on the requirement analysis and planning done in the
beginning of cycle. Any changes to be incorporated go through a strict change control
management and prioritization.
Agile uses an adaptive approach where there is no detailed planning and there is clarity on
future tasks only in respect of what features need to be developed. There is feature driven
development and the team adapts to the changing product requirements dynamically. The
product is tested very frequently, through the release iterations, minimizing the risk of any
major failures in future.
Customer Interaction is the backbone of this Agile methodology, and open communication
with minimum documentation are the typical features of Agile development environment. The
agile teams work in close collaboration with each other and are most often located in the same
geographical location.
1.5 Agile Model - Pros and Cons
Agile methods are being widely accepted in the software world recently. However, this method
may not always be suitable for all products. Here are some pros and cons of the Agile model.
The advantages of the Agile Model are as follows −
• Is a very realistic approach to software development.
• Promotes teamwork and cross training.
• Functionality can be developed rapidly and demonstrated.
• Resource requirements are minimum.
• Suitable for fixed or changing requirements
• Delivers early partial working solutions.
• Good model for environments that change steadily.
• Minimal rules, documentation easily employed.
• Enables concurrent development and delivery within an overall planned context.
• Little or no planning required.
• Easy to manage.
• Gives flexibility to developers.
The disadvantages of the Agile Model are as follows −
• Not suitable for handling complex dependencies.
• More risk of sustainability, maintainability and extensibility.
• An overall plan, an agile leader and agile PM practice is a must without which it will not work.
• Strict delivery management dictates the scope, functionality to be delivered, and adjustments to meet
the deadlines.
• Depends heavily on customer interaction, so if customer is not clear, team can be driven in the wrong
direction.
• There is a very high individual dependency, since there is minimum documentation generated.
• Transfer of technology to new team members may be quite challenging due to lack of documentation.
Organising a sport or recreation event can be a daunting task, particularly for an individual or
committee planning an event for the first time. While the scale of the events varies dramatically,
the principles of event management essentially remain the same. This information sheet provides
an overview of some of the major issues to consider when planning and running an event.
Planning and preparation
Effective planning and preparation are crucial to the success of an event. There are numerous
elements involved in planning and preparation.
Purpose of the event
In planning an event it is important to understand why the event is being held, who it is for and
who it will benefit. Having a clear focus and defined objectives will help direct the planning
process
Timing and location of the event
When and where an event takes place can have a significant impact on its overall success. When
considering the best time of the day, month or year to hold an event, it is important to consider
other events that may compliment or compete with the event you are organising. With regard to
location, there are many variables to consider, including the availability of facilities,
accommodation, transport, and the support of local stakeholders.
The organising committee and event manager
There is usually more than one person involved in organising a sport or recreation event. In
many cases it is useful to establish an organising committee and clearly assign roles and
responsibilities to committee members. There should be an event manager appointed who has
overall control of the event and is ultimately responsible for the major decisions and directions of
the committee..
Event checklist
In order to allocate responsibilities to individuals on the organising committee, the committee
must have a clear idea of all the different aspects of the event, including venue, equipment,
staffing, communication, catering, garbage, toilets, money handling, medical, hospitality,
transport, prizes, trophies and ceremonies. It is useful to compile an event plan, or checklist,
which will ensure that all aspects of the event are considered and adequately addressed in the
planning stages. See the example event checklist at the end of this document to help you organise
your event.
Finances and budget
When preparing for an event it is important that all sources of income and all costs are accounted
for, including hidden costs and in-kind support. Developing an event checklist before the budget
will ensure that all costs are considered. The event manager or organising committee should
work closely with a financial manager or club treasurer to ensure the event follows the relevant
financial procedures.
Sponsorship
Once the event manager and organising committee have a clear understanding of the finances and
budget, they may wish to secure sponsorship for the event. When looking at sponsorship it is important
that the organising committee has a clear idea of what it is that they would like from potential sponsors
(i.e. money, free publicity, discounts, goods and services). The committee must also be clear on what the
event can offer potential sponsors (i.e. free advertising, publicity, naming rights, media coverage and
exposure for new products). Developing a profile of the event (i.e. a brief history of the event, number
and type of participants, media coverage and publicity) will help the committee to target relevant sponsors
and to highlight the benefits of being involved with the event. Any attempt to secure sponsorship should
be based on a definite sponsorship strategy that targets specific organisations and tailors the approach to
each organisation. A general mail out requesting sponsorship from many different organisations is
generally unsuccessful.
Promotion and publicity
Regardless of the size of the event it is important to consider the level of publicity and
promotion required. While some events may require minimal publicity or promotion (depending
on the aim, target audience and existing profile), in most cases event organisers will aim to
maximise the profile of the event through promotion (controlled and paid for by organisers) and
publicity (media coverage). Unfortunately, it is not uncommon for this aspect of the event
organisation to be overlooked or left to the last minute, which can result in poor exposure for the
event, a poor turn out of participants and unsatisfied sponsors. When looking at publicity, it is
important to consider various forms of media (print, radio, online and television) and different
ways to approach each of these.
Approvals and legal requirements
When organising an event in a public facility, or on land owned by someone other than the
organising group, it is important to get the approval and any permits or licences required by the
property owners or land managers. It is common for land and facility managers to ask for
evidence of insurance and risk management procedures from the event organiser before approval
or permits are granted. In most cases, it is advisable that the organising committee or
organisation responsible for the event become an incorporated body in order to limit potential
legal liability of individual members. If in doubt, the event manager should seek professional
legal advice in this area.
Implementation and evaluation
Event delivery
If sufficient time and effort has been put into planning and preparation, the event should run
smoothly. The event manager should have a checklist of tasks with time frames to keep the event
on track. Effective communication is essential to ensure the event goes to plan. There will
always be minor difficulties and challenges; however, hopefully most of these will have been
considered and there will be contingency plans to address problems as they arise. During the
event it is important to take the time to publicly acknowledge the contribution of staff, volunteers
and sponsors.
1.6 REQUIREMENTS FOR EVENT MANAGEMENT:
FUNCTIONAL REQUIREMENTS FOR EVENT MANAGEMENT
REGISTRATION
LOGIN
CHNAGES TO EVENT
PAYMENT
LOGOUT
REPORT GENERATION
TECHNICAL ISSUES
INTERFACE REQUIREMENT
LOGIN PAGE
REGISTRATION FORM
INFORMATION SCREEN
IF CUSTOMER SELECTS THE BUY THEN ANOTHER SCREN OF SHOPPING CART
ISSUE TICKET
NONFUNCTIONAL REQUIREMENT
SECURITY
RELIABILITY
AVAILABILITY
MAINTENANCE
PORTABILITY
CHAPTER 2
2.1 What is Data?
Data is nothing but facts and statistics stored or free flowing over a network, generally it's raw
and unprocessed. For example: When you visit any website, they might store you IP address, that
is data, in return they might add a cookie in your browser, marking you that you visited the
website, that is data, your name, it's data, your age, it's data.
Data becomes information when it is processed, turning it into something meaningful. Like,
based on the cookie data saved on user's browser, if a website can analyse that generally men of
age 20-25 visit us more, that is information, derived from the data collected.
2.2What is a Database?
A Database is a collection of related data organised in a way that data can be easily accessed,
managed and updated. Database can be software based or hardware based, with one sole
purpose, storing data.
During early computer days, data was collected and stored on tapes, which were mostly write-
only, which means once data is stored on it, it can never be read again. They were slow and
bulky, and soon computer scientists realised that they needed a better solution to this problem.
Larry Ellison, the co-founder of Oracle was amongst the first few, who realised the need for a
software based Database Management System.
What is DBMS?
A DBMS is a software that allows creation, definition and manipulation of database, allowing
users to store, process and analyse data easily. DBMS provides us with an interface or a tool, to
perform various operations like creating database, storing data in it, updating data, creating tables
in the database and a lot more.
DBMS also provides protection and security to the databases. It also maintains data consistency
in case of multiple users.
Here are some examples of popular DBMS used these days:
• MySql
• Oracle
• SQL Server
• IBM DB2
• PostgreSQL
• Amazon SimpleDB (cloud based) etc.
Characteristics of Database Management System
A database management system has following characteristics:
1. Data stored into Tables: Data is never directly stored into the database. Data is stored
into tables, created inside the database. DBMS also allows to have relationships between
tables which makes the data more meaningful and connected. You can easily understand
what type of data is stored where by looking at all the tables created in a database.
2. Reduced Redundancy: In the modern world hard drives are very cheap, but earlier when
hard drives were too expensive, unnecessary repetition of data in database was a big
problem. But DBMS follows Normalisation which divides the data in such a way that
repetition is minimum.
3. Data Consistency: On Live data, i.e. data that is being continuosly updated and added,
maintaining the consistency of data can become a challenge. But DBMS handles it all by
itself.
4. Support Multiple user and Concurrent Access: DBMS allows multiple users to work
on it(update, insert, delete data) at the same time and still manages to maintain the data
consistency.
5. Query Language: DBMS provides users with a simple Query language, using which
data can be easily fetched, inserted, deleted and updated in a database.
6. Security: The DBMS also takes care of the security of data, protecting the data from un-
authorised access. In a typical DBMS, we can create user accounts with different access
permissions, using which we can easily secure our data by restricting user access.
7. DBMS supports transactions, which allows us to better handle and manage data integrity
in real world applications where multi-threading is extensively used.
Advantages of DBMS
• Segregation of applicaion program.
• Minimal data duplicacy or data redundancy.
• Easy retrieval of data using the Query Language.
• Reduced development time and maintainance need.
• With Cloud Datacenters, we now have Database Management Systems capable of storing
almost infinite data.
• Seamless integration into the application programming languages which makes it very
easier to add a database to almost any application or website.
Disadvantages of DBMS
• It's Complexity
• Except MySQL, which is open source, licensed DBMSs are generally costly.
• They are large in size.
2.3 OLTP vs. OLAP
We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can
assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help
to analyze it.
- OLTP (On-line Transaction Processing) is characterized by a large number of short on-line
transactions (INSERT, UPDATE, DELETE). The main emphasis for OLTP systems is put on
very fast query processing, maintaining data integrity in multi-access environments and an
effectiveness measured by number of transactions per second. In OLTP database there is detailed
and current data, and schema used to store transactional databases is the entity model (usually
3NF).
- OLAP (On-line Analytical Processing) is characterized by relatively low volume of
transactions. Queries are often very complex and involve aggregations. For OLAP systems a
response time is an effectiveness measure. OLAP applications are widely used by Data Mining
techniques. In OLAP database there is aggregated, historical data, stored in multi-dimensional
schemas (usually star schema).
The following table summarizes the major differences between OLTP and OLAP system design.
OLTP System
Online Transaction Processing
(Operational System)
OLAP System
Online Analytical Processing
(Data Warehouse)
Source of data
Operational data; OLTPs are the
original source of the data.
Consolidation data; OLAP data comes
from the various OLTP Databases
Purpose of data
To control and run fundamental
business tasks
To help with planning, problem solving,
and decision support
What the data
Reveals a snapshot of ongoing
business processes
Multi-dimensional views of various kinds
of business activities
Inserts and
Updates
Short and fast inserts and updates
initiated by end users
Periodic long-running batch jobs refresh
the data
Queries
Relatively standardized and simple
queries Returning relatively few
records
Often complex queries involving
aggregations
Processing
Speed
Typically very fast
Depends on the amount of data involved;
batch data refreshes and complex queries
may take many hours; query speed can be
improved by creating indexes
Space
Requirements
Can be relatively small if historical
data is archived
Larger due to the existence of aggregation
structures and history data; requires more
indexes than OLTP
Database
Design
Highly normalized with many tables
Typically de-normalized with fewer
tables; use of star and/or snowflake
schemas
Backup and
Recovery
Backup religiously; operational data
is critical to run the business, data
loss is likely to entail significant
monetary loss and legal liability
Instead of regular backups, some
environments may consider simply
reloading the OLTP data as a recovery
method
2.4 DATABASE QUERY FOR EVENT MANAGEMENT
create table logins
(
id int(20),username varchar(40),password varchar(40)
);
insert into logins values(1,'bibek',1234);
select *from logins;
create table city
(
city_id int(40) primary key,
city_name varchar(30)
);
create table events(
event_id int(40) primary key,
event_name varchar(40),
event_description varchar(100),
city_id int(40),
foreign key(city_id) references city(city_id)
);
create table shows (
show_id int(30) primary key,
event_id int(40),
foreign key(event_id) references events(event_id),
show_date date,
show_timing time
);
alter table city
add show_id int(40);
alter table city
add foreign key(show_id) references shows(show_id);
create table location(
location_id int(30)primary key,
city_id int(40),
foreign key(city_id) references city(city_id),
event_id int(30),
foreign key (event_id) references events(event_id),
event_start_date date,
location_name varchar(30),
location_address varchar(40)
);
create table user(
user_id int(40) primary key,
user_name varchar(30),
user_details varchar(100),
booking_id int(30)
);
create table booking(
booking_id int(30) primary key,
user_id int(40),
foreign key(user_id) references user(user_id),
show_id int(30) ,
foreign key(show_id) references shows(show_id)
);
alter table user
add foreign key(booking_id) references booking(booking_id);
CHAPTER 3
3.1 Unified Modeling Language (UML)
An Introduction
Unified Modeling Language (UML) is a general purpose modelling language. The main aim of
UML is define a standard way to visualize the way a system has been designed. It is quite
similar to blueprints used in other fields of engineering.
UML is not a programming language, it is rather a visual language. We use UML diagrams to
portray the behavior and structure of a system. UML helps software engineers, businessmen
and system architects with modelling, design and analysis. The Object Management Group
(OMG) adopted Unified Modelling Language as a standard in 1997. Its been managed by OMG
ever since. International Organization for Standardization (ISO) published UML as an approved
standard in 2005. UML has been revised over the years and is reviewed periodically.
Do we really need UML?
▪ Complex applications need collaboration and planning from multiple teams and hence require a
clear and concise way to communicate amongst them.
▪ Businessmen do not understand code. So UML becomes essential to communicate with non
programmers essential requirements, functionalities and processes of the system.
▪ A lot of time is saved down the line when teams are able to visualize processes, user interactions
and static structure of the system.
UML is linked with object oriented design and analysis. UML makes the use of elements and
forms associations between them to form diagrams. Diagrams in UML can be broadly classified
as:
1. Structural Diagrams – Capture static aspects or structure of a system. Structural Diagrams
include: Component Diagrams, Object Diagrams, Class Diagrams and Deployment Diagrams.
2. Behavior Diagrams – Capture dynamic aspects or behavior of the system. Behavior diagrams
include: Use Case Diagrams, State Diagrams, Activity Diagrams and Interaction Diagrams.
The image below shows the hierarchy of diagrams according to UML 2.2
Object Oriented Concepts Used in UML –
1. Class – A class defines the blue print i.e. structure and functions of an object.
2. Objects – Objects help us to decompose large systems and help us to modularize our system.
Modularity helps to divide our system into understandable components so that we can build our
system piece by piece. An object is the fundamental unit (building block) of a system which is used
to depict an entity.
3. Inheritance – Inheritance is a mechanism by which child classes inherit the properties of their
parent classes.
4. Abstraction – Mechanism by which implementation details are hidden from user.
5. Encapsulation – Binding data together and protecting it from the outer world is referred to as
encapsulation.
6. Polymorphism – Mechanism by which functions or entities are able to exist in different forms.
3.2 STARUML
StarUML is a UML tool by MKLab. The software was licensed under a modified version
of GNU GPL until 2014, when a rewrittenversion 2.0.0 was released for beta testing under a
proprietary license.
After being abandoned for some time, the project had a revival to move
from Delphi to Java/Eclipse and then stopped again. In 2014, a rewritten version was released
as proprietary software. However, the open source version's community is still active and many
topics are discussed on the forums.[citation needed]
The stated goal of the project was to replace larger, commercial applications such as Rational
Rose and Borland Together.
StarUML supports most of the diagram types specified in UML 2.0. It is currently
missing timing and interaction overview diagrams.
StarUML was written in Delphi, which is one of the reasons why it was abandoned for a long
time.[citation needed]
Since December 2005 StarUML was not updated anymore, although some
external modules were updated[2]
Currently the newest version of StarUML by the original authors is available for download under
the handle "StarUML 2". The public beta is available, although not under the GPL license. Final
price and new license type yet remains unknown. This version has been completely rewritten
from scratch and includes among many features: support for extensions, OS X compatibility and
a new graphical user interface
3.3 UMLET
UMLet is an open-source Java-based UML tool designed for teaching the Unified Modeling
Language and for quickly creating UML diagrams. It is a drawing tool rather than a modelling
tool as there is no underlying dictionary or directory of reusable design objects. UMLet is
distributed under the GNU General Public License.[1]
UMLet has a simple user interface that uses text-formatting codes to modify the basic shapes
with decorations and annotations, so there is no forest of icons or parameter list dialogs in the
user's way. This does require the user to learn yet another text markup language, but the effort is
small and the markup obvious to the experienced UML designer.
UMLet can export diagrams to pictures (eps, jpg), drawing formats (SVG), document formats
(PDF). The clipboard can be used to copy-paste diagrams as pictures into other applications. It is
possible to create custom UML elements.
The basic drawing objects can be modified and used as templates which allows users to
customize the app to their needs. This requires programming of the elements in Java.
The most important UML diagram types are supported: class, use case, sequence, state,
deployment, activity. Support for UML 2.0 features is not yet available, though the
customization feature could be used to do this. It supports concepts like Martin Fowler's
UmlAsSketch.[2]
Its design goals are described in the paper "Flyweight UML Modelling Tool for
Software Development".[3]
Another paper compares UMLet to Rational Rose.[4]
The app's native file format is UXF, an extension of XML intended for exchanging UML
models.
UMLet runs stand-alone or as Eclipse plug-in on Windows, OSX and Linux.
CHAPTER 4
4.1 INTERNET OF THINGS(IOT)
IoT (Internet of Things) is an advanced automation and analytics system which exploits
networking, sensing, big data, and artificial intelligence technology to deliver complete systems
for a product or service. These systems allow greater transparency, control, and performance
when applied to any industry or system.
IoT systems have applications across industries through their unique flexibility and ability to be
suitable in any environment. They enhance data collection, automation, operations, and much
more through smart devices and powerful enabling technology.
This tutorial aims to provide you with a thorough introduction to IoT. It introduces the key
concepts of IoT, necessary in using and deploying IoT systems.
Audience
This tutorial targets IT professionals, students, and management professionals who want a solid
grasp of essential IoT concepts. After completing this tutorial, you will achieve intermediate
expertise in IoT and a high level of comfort with IoT concepts and systems.
Prerequisites
This tutorial assumes general knowledge of networking, sensing, databases, programming, and
related technology. It also assumes familiarity with business concepts and marketing.
IoT systems allow users to achieve deeper automation, analysis, and integration within a
system. They improve the reach of these areas and their accuracy. IoT utilizes existing and
emerging technology for sensing, networking, and robotics.
IoT exploits recent advances in software, falling hardware prices, and modern attitudes towards
technology. Its new and advanced elements bring major changes in the delivery of products,
goods, and services; and the social, economic, and political impact of those changes.
IoT − Key Features
The most important features of IoT include artificial intelligence, connectivity, sensors, active
engagement, and small device use. A brief review of these features is given below −
• AI − IoT essentially makes virtually anything “smart”, meaning it enhances every aspect
of life with the power of data collection, artificial intelligence algorithms, and networks.
This can mean something as simple as enhancing your refrigerator and cabinets to detect
when milk and your favorite cereal run low, and to then place an order with your
preferred grocer.
• Connectivity − New enabling technologies for networking, and specifically IoT
networking, mean networks are no longer exclusively tied to major providers. Networks
can exist on a much smaller and cheaper scale while still being practical. IoT creates
these small networks between its system devices.
• Sensors − IoT loses its distinction without sensors. They act as defining instruments
which transform IoT from a standard passive network of devices into an active system
capable of real-world integration.
• Active Engagement − Much of today's interaction with connected technology happens
through passive engagement. IoT introduces a new paradigm for active content, product,
or service engagement.
• Small Devices − Devices, as predicted, have become smaller, cheaper, and more
powerful over time. IoT exploits purpose-built small devices to deliver its precision,
scalability, and versatility.
IoT − Advantages
The advantages of IoT span across every area of lifestyle and business. Here is a list of some of
the advantages that IoT has to offer −
• Improved Customer Engagement − Current analytics suffer from blind-spots and
significant flaws in accuracy; and as noted, engagement remains passive. IoT completely
transforms this to achieve richer and more effective engagement with audiences.
• Technology Optimization − The same technologies and data which improve the
customer experience also improve device use, and aid in more potent improvements to
technology. IoT unlocks a world of critical functional and field data.
• Reduced Waste − IoT makes areas of improvement clear. Current analytics give us
superficial insight, but IoT provides real-world information leading to more effective
management of resources.
• Enhanced Data Collection − Modern data collection suffers from its limitations and its
design for passive use. IoT breaks it out of those spaces, and places it exactly where
humans really want to go to analyze our world. It allows an accurate picture of
everything.
IoT − Disadvantages
Though IoT delivers an impressive set of benefits, it also presents a significant set of
challenges. Here is a list of some its major issues −
• Security − IoT creates an ecosystem of constantly connected devices communicating
over networks. The system offers little control despite any security measures. This
leaves users exposed to various kinds of attackers.
• Privacy − The sophistication of IoT provides substantial personal data in extreme detail
without the user's active participation.
• Complexity − Some find IoT systems complicated in terms of design, deployment, and
maintenance given their use of multiple technologies and a large set of new enabling
technologies.
• Flexibility − Many are concerned about the flexibility of an IoT system to integrate
easily with another. They worry about finding themselves with several conflicting or
locked systems.
• Compliance − IoT, like any other technology in the realm of business, must comply with
regulations. Its complexity makes the issue of compliance seem incredibly challenging
when many consider standard software compliance a battle.
IoT − Sensors
The most important hardware in IoT might be its sensors. These devices consist of energy
modules, power management modules, RF modules, and sensing modules. RF modules manage
communications through their signal processing, WiFi, ZigBee, Bluetooth, radio transceiver,
duplexer, and BAW.
The sensing module manages sensing through assorted active and passive measurement devices.
Here is a list of some of the measurement devices used in IoT −
S.No Devices
1. Accelerometers temperature sensors
2. Magnetometers proximity sensors
3. Gyroscopes image sensors
4. acoustic sensors light sensors
5. pressure sensors gas RFID sensors
6. humidity sensors micro flow sensors
4.3What is an Arduino?
Introduction
Arduino is an open-source platform used for building electronics projects. Arduino consists of
both a physical programmable circuit board (often referred to as a microcontroller) and a piece
of software, or IDE (Integrated Development Environment) that runs on your computer, used to
write and upload computer code to the physical board.
The Arduino platform has become quite popular with people just starting out with electronics,
and for good reason. Unlike most previous programmable circuit boards, the Arduino does not
need a separate piece of hardware (called a programmer) in order to load new code onto the
board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified
version of C++, making it easier to learn to program. Finally, Arduino provides a standard form
factor that breaks out the functions of the micro-controller into a more accessible package.
This is an Arduino Uno
The Uno is one of the more popular boards in the Arduino family and a great choice for
beginners. We’ll talk about what’s on it and what it can do later in the tutorial.
This is a screenshot of the Arduino IDE.
Believe it or not, those 10 lines of code are all you need to blink the on-board LED on your
Arduino. The code might not make perfect sense right now, but, after reading this tutorial and the
many more Arduino tutorials waiting for you on our site, we’ll get you up to speed in no time!
What Does it Do?
The Arduino hardware and software was designed for artists, designers, hobbyists, hackers,
newbies, and anyone interested in creating interactive objects or environments. Arduino can
interact with buttons, LEDs, motors, speakers, GPS units, cameras, the internet, and even your
smart-phone or your TV! This flexibility combined with the fact that the Arduino software is
free, the hardware boards are pretty cheap, and both the software and hardware are easy to learn
has led to a large community of users who have contributed code and released instructions for
a huge variety of Arduino-based projects.
For everything from robots and a heating pad hand warming blanket to honest fortune-telling
machines, and even a Dungeons and Dragons dice-throwing gauntlet, the Arduino can be used as
the brains behind almost any electronics project.
4.4 What is a breadboard?
A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you
easily insert electronic components to prototype (meaning to build and test an early version of)
an electronic circuit, like this one with a battery, switch, resistor, and an LED (light-emitting
diode). To learn more about individual electronic components, see our Electronics Primer.
The connections are not permanent, so it is easy to remove a component if you make a mistake,
or just start over and do a new project. This makes breadboards great for beginners who are new
to electronics. You can use breadboards to make all sorts of fun electronics projects, from
different types of robots or an electronic drum set, to an electronic rain detector to help conserve
water in a garden, just to name a few.
4.5 How It Works – Ultrasonic Sensor
It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or
obstacle on its path It will bounce back to the module. Considering the travel time and the speed
of the sound you can calculate the distance.
The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the
VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino
Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will
send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the
Echo pin. The Echo pin will output the time in microseconds the sound wave traveled.
For example, if the object is 10 cm away from the sensor, and the speed of the sound is 340 m/s
or 0.034 cm/µs the sound wave will need to travel about 294 u seconds. But what you will get
from the Echo pin will be double that number because the sound wave needs to travel forward
and bounce backward. So in order to get the distance in cm we need to multiply the received
travel time value from the echo pin by 0.034 and divide it by 2.
Components needed for this tutorial
You can get these components from any of the sites below:
• Ultrasonic Sensor HC-SR04……… Amazon / Aliexpress
• Arduino Board…………………………. Amazon / Aliexpress
• Breadboard and Jump Wires……. Amazon / Aliexpress
*Please note: These are affiliate links. I may make a commission if you buy the components
through these links.
I would appreciate your support in this way!
Source Codes
First you have to define the Trig and Echo pins. In this case they are the pins number 9 and 10 on
the Arduino Board and they are named trigPin and echoPin. Then you need a Long variable,
named “duration” for the travel time that you will get from the sensor and an integer variable for
the distance.
In the setup you have to define the trigPin as an output and the echoPin as an Input and also start
the serial communication for showing the results on the serial monitor.
In the loop first you have to make sure that the trigPin is clear so you have to set that pin on a
LOW State for just 2 µs. Now for generating the Ultra sound wave we have to set the trigPin on
HIGH State for 10 µs. Using the pulseIn() function you have to read the travel time and put that
value into the variable “duration”. This function has 2 parameters, the first one is the name of the
echo pin and for the second one you can write either HIGH or LOW. In this case, HIGH means
that the pulsIn() function will wait for the pin to go HIGH caused by the bounced sound wave
and it will start timing, then it will wait for the pin to go LOW when the sound wave will end
which will stop the timing. At the end the function will return the length of the pulse in
microseconds. For getting the distance we will multiply the duration by 0.034 and divide it by 2
as we explained this equation previously. At the end we will print the value of the distance on
the Serial Monitor.
1. /*
2. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial
3. *
4. * by Dejan Nedelkovski,
5. * www.HowToMechatronics.com
6. *
7. */
8.
9. // defines pins numbers
10. const int trigPin = 9;
11. const int echoPin = 10;
12.
13. // defines variables
14. long duration;
15. int distance;
16.
17. void setup() {
18. pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
19. pinMode(echoPin, INPUT); // Sets the echoPin as an Input
20. Serial.begin(9600); // Starts the serial communication
21. }
22.
23. void loop() {
24. // Clears the trigPin
25. digitalWrite(trigPin, LOW);
26. delayMicroseconds(2);
27.
28. // Sets the trigPin on HIGH state for 10 micro seconds
29. digitalWrite(trigPin, HIGH);
30. delayMicroseconds(10);
31. digitalWrite(trigPin, LOW);
32.
33. // Reads the echoPin, returns the sound wave travel time in microseconds
34. duration = pulseIn(echoPin, HIGH);
35.
36. // Calculating the distance
37. distance= duration*0.034/2;
38.
39. // Prints the distance on the Serial Monitor
40. Serial.print("Distance: ");
41. Serial.println(distance);
42. }
If you want to display the results from the HC-SR04 Ultrasonic Sensor on an LCD you can use
the following source code:
1. /*
2. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial
3. *
4. * by Dejan Nedelkovski,
5. * www.HowToMechatronics.com
6. *
7. */
8.
9. #include <LiquidCrystal.h> // includes the LiquidCrystal Library
10.
11. LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6,
d7)
12.
13. const int trigPin = 9;
14. const int echoPin = 10;
15.
16. long duration;
17. int distanceCm, distanceInch;
18.
19. void setup() {
20. lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width
and height) of the display
21.
22. pinMode(trigPin, OUTPUT);
23. pinMode(echoPin, INPUT);
24. }
25.
26. void loop() {
27. digitalWrite(trigPin, LOW);
28. delayMicroseconds(2);
29.
30. digitalWrite(trigPin, HIGH);
31. delayMicroseconds(10);
32. digitalWrite(trigPin, LOW);
33.
34. duration = pulseIn(echoPin, HIGH);
35. distanceCm= duration*0.034/2;
36. distanceInch = duration*0.0133/2;
37.
38. lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be
displayed
39. lcd.print("Distance: "); // Prints string "Distance" on the LCD
40. lcd.print(distanceCm); // Prints the distance value from the sensor
41. lcd.print(" cm");
42. delay(10);
43. lcd.setCursor(0,1);
44. lcd.print("Distance: ");
45. lcd.print(distanceInch);
46. lcd.print(" inch");
47. delay(10);
48. }
4.6 Arduino - Servo Motor
A Servo Motor is a small device that has an output shaft. This shaft can be positioned to specific
angular positions by sending the servo a coded signal. As long as the coded signal exists on the
input line, the servo will maintain the angular position of the shaft. If the coded signal changes,
the angular position of the shaft changes. In practice, servos are used in radio-controlled
airplanes to position control surfaces like the elevators and rudders. They are also used in radio-
controlled cars, puppets, and of course, robots.
Servos are extremely useful in robotics. The motors are small, have built-in control circuitry,
and are extremely powerful for their size. A standard servo such as the Futaba S-148 has 42
oz/inches of torque, which is strong for its size. It also draws power proportional to the
mechanical load. A lightly loaded servo, therefore, does not consume much energy.
The guts of a servo motor is shown in the following picture. You can see the control circuitry,
the motor, a set of gears, and the case. You can also see the 3 wires that connect to the outside
world. One is for power (+5volts), ground, and the white wire is the control wire.
Working of a Servo Motor
The servo motor has some control circuits and a potentiometer (a variable resistor, aka pot)
connected to the output shaft. In the picture above, the pot can be seen on the right side of the
circuit board. This pot allows the control circuitry to monitor the current angle of the servo
motor.
If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is
not correct, it will turn the motor until it is at a desired angle. The output shaft of the servo is
capable of traveling somewhere around 180 degrees. Usually, it is somewhere in the 210-degree
range, however, it varies depending on the manufacturer. A normal servo is used to control an
angular motion of 0 to 180 degrees. It is mechanically not capable of turning any farther due to
a mechanical stop built on to the main output gear.
The power applied to the motor is proportional to the distance it needs to travel. So, if the shaft
needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small
amount, the motor will run at a slower speed. This is called proportional control.
HowDoYouCommunicatetheAngleatWhichtheServoShouldTurn?
The control wire is used to communicate the angle. The angle is determined by the duration of a
pulse that is applied to the control wire. This is called Pulse Coded Modulation. The servo
expects to see a pulse every 20 milliseconds (.02 seconds). The length of the pulse will
determine how far the motor turns. A 1.5 millisecond pulse, for example, will make the motor
turn to the 90-degree position (often called as the neutral position). If the pulse is shorter than
1.5 milliseconds, then the motor will turn the shaft closer to 0 degrees. If the pulse is longer
than 1.5 milliseconds, the shaft turns closer to 180 degrees.
Components Required
You will need the following components −
• 1 × Arduino UNO board
• 1 × Servo Motor
• 1 × ULN2003 driving IC
• 1 × 10 KΩ Resistor
Procedure
Follow the circuit diagram and make the connections as shown in the image given below.
Sketch
Open the Arduino IDE software on your computer. Coding in the Arduino language will control
your circuit. Open a new sketch File by clicking on New.
Arduino Code
/* Controlling a servo position using a potentiometer (variable resistor) */
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
val = analogRead(potpin);
// reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180);
// scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15);
}
Code to Note
Servo motors have three terminals - power, ground, and signal. The power wire is typically red,
and should be connected to the 5V pin on the Arduino. The ground wire is typically black or
brown and should be connected to one terminal of ULN2003 IC (10 -16). To protect your
Arduino board from damage, you will need some driver IC to do that. Here we have used
ULN2003 IC to drive the servo motor. The signal pin is typically yellow or orange and should
be connected to Arduino pin number 9.
Connecting the Potentiometer
A voltage divider/potential divider are resistors in a series circuit that scale the output voltage to
a particular ratio of the input voltage applied. Following is the circuit diagram −
$$V_{out} = (V_{in} times R_{2})/ (R_{1} + R_{2})$$
Vout is the output potential, which depends on the applied input voltage (Vin) and resistors
(R1 and R2) in the series. It means that the current flowing through R1 will also flow through
R2 without being divided. In the above equation, as the value of R2 changes, the Vout scales
accordingly with respect to the input voltage, Vin.
Typically, a potentiometer is a potential divider, which can scale the output voltage of the
circuit based on the value of the variable resistor, which is scaled using the knob. It has three
pins: GND, Signal, and +5V as shown in the diagram below −
Result
By changing the pot’s NOP position, servo motor will change its angle. A Stepper Motor or a
step motor is a brushless, synchronous motor, which divides a full rotation into a number of
steps. Unlike a brushless DC motor, which rotates continuously when a fixed DC voltage is
applied to it, a step motor rotates in discrete step angles.
The Stepper Motors therefore are manufactured with steps per revolution of 12, 24, 72, 144,
180, and 200, resulting in stepping angles of 30, 15, 5, 2.5, 2, and 1.8 degrees per step. The
stepper motor can be controlled with or without feedback.
Imagine a motor on an RC airplane. The motor spins very fast in one direction or another. You
can vary the speed with the amount of power given to the motor, but you cannot tell the
propeller to stop at a specific position.
Now imagine a printer. There are lots of moving parts inside a printer, including motors. One
such motor acts as the paper feed, spinning rollers that move the piece of paper as ink is being
printed on it. This motor needs to be able to move the paper an exact distance to be able to print
the next line of text or the next line of an image.
There is another motor attached to a threaded rod that moves the print head back and forth.
Again, that threaded rod needs to be moved an exact amount to print one letter after another.
This is where the stepper motors come in handy.
4.7 Humidity Sensor DHT11
Introduction
Humidity Sensor DHT11 Module
A humidity sensor senses,measures and regularly reports the relative humidity in the air. It
measures both moisture and air temperature.Relative humidity, expressed as a percent, is the
ratio of actual moisture in the air to the highest amount of moisture air at that temperature can
hold.The warmer the air is, the more moisture it can hold, so relative humidity changes with
fluctuations in temperature.
Humidity Sensor
Humidity sensors detect the relative humidity of the immediate environments in which they are
placed. They measure both the moisture and temperature in the air and express relative humidity
as a percentage of the ratio of moisture in the air to the maximum amount that can be held in the
air at the current temperature. As air becomes hotter, it holds more moisture, so the relative
humidity changes with the temperature.
Most humidity sensors use capacitive measurement to determine the amount of moisture in the
air. This type of measurement relies on two electrical conductors with a non-conductive polymer
film laying between them to create an electrical field between them. Moisture from the air
collects on the film and causes changes in the voltage levels between the two plates. This change
is then converted into a digital measurement of the air’s relative humidity after taking the air
temperature into account.For more details,check the datasheet here.
How to connect Humidity Sensor with Arduino Uno?
Hardware and Software Required
• Arduino Uno
• Humidity Sensor DHT11 Module
• Arduino IDE(1.0.6 version)
Hardware Connections
The Humidity sensor module has 3 pins.The following connections should be made to connect
the sensor module with Arduino.
• + to 5V
• - to Gnd
• Out to Analog 0 pin of Arduino
Program for Humidity Sensor
The user can download the library file here:File:DHT.zip.Here the program generates the
humidity and temperature present in a room as an output in the serial monitor.
#include <dht.h>
#define dht_dpin A0
dht DHT;
void setup()
{
Serial.begin(9600);
}
void loop()
{
DHT.read11(dht_dpin);
Serial.print("Current humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
delay(1000);
}
4.8 HOW TO USE ARDUINO I2C SERIAL LCD 16X2 (YELLOW
BACKLIGHT)
Description
Now, with only 3 pins from microcontroller, you can display message on this LCD. Compared to
parallel LCD which required at least 6 pins of I/O, this LCD offer more cost effective solution.
The LCD display is two lines by 16 characters and provides basic text wrapping so that your text
looks right on the display.
Feature:
1. 5V powered 2 x 16 character
2. SPI communication
3. Minimum 3 Pins interface to microcontroller
4.Compatible with all types of microcontrollers
5.Suitable for hobbyists and experts
6.Back light and contrast control is available
Add TipAsk QuestionCommentDownload
Step 1: MATERIAL PREPARATION
In this tutorial,the things you are needed as below:
1. I2C Serial LCD 16x2 (Yellow backlight)
2. Arduino Uno Board and USB
3.4 Male-to-Female Jumper Wire
Add TipAsk QuestionCommentDownload
Step 2: PIN DETAILS
You could see the pinout labeled at the back of the module. It has 4 pins that is VCC, GND,SDA
and SCL.
Add TipAsk QuestionCommentDownload
Step 3: PIN CONNECTION
Connect I2C Serial LCD Module to Arduino UNO as following :
• VCC to 5V
• GND to GND
• SDA to A4
• SCL to A5
Then, Connect your Arduino UNO Board to your computer via USB Cable.
Add TipAsk QuestionCommentDownload
Step 4: Library
For this tutorial,it is necessary to download and install the "LiquidCrystal_I2C"
library.LiquidCrystal_I2C is a library of Arduino which enables serial LCD 16x2 connect with
Arduino.To be able to interface the serial LCD with arduino, you will have to download this
library and save it into your Arduino's libraries. Download the LiquidCrystal_I2C file below
>Go to document >Save the file into your Arduino Uno Library folder. Refer the image above
for your references.
Attachments
• LiquidCrystal_I2C.rar
Download
Add TipAsk QuestionCommentDownload
Step 5: SAMPLE SOURCE CODE
To get the result, please download the sample source code which is attached below and upload it
into your Arduino. In this tutorial, the Arduino UNO is being used.
Attachments
• I2C_Hello_World.ino
Download
Add TipAsk QuestionCommentDownload
Step 6: RESULT
The LCD will display the text.
4.9 PIR SENSOR
What is a PIR Sensor?
PIR sensor detects a human being moving around within approximately 10m from the sensor.
This is an average value, as the actual detection range is between 5m and 12m.PIR are
fundamentally made of a pyro electric sensor, which can detect levels of infrared radiation.
For numerous essential projects or items that need to discover when an individual has left or
entered the area. PIR sensors are incredible, they are flat control and minimal effort, have a wide
lens range, and are simple to interface with.
How It Works ?
First let’s explain the working principle. The module actually consists of a Pyroelectric sensor
which generates energy when exposed to heat.
That means when a human or animal body will get in the range of the sensor it will detect a
movement because the human or animal body emits heat energy in a form of infrared radiation.
That’s where the name of the sensor comes from, a Passive Infra-Red sensor. And the term
“passive” means that sensor is not using any energy for detecting purposes, it just works by
detecting the energy given off by the other objects.
The module also consists a specially designed cover named Fresnel lens, which focuses the
infrared signals onto the pyroelectric sensor.
The HC-SR501 PIR Sensor Module
The module has just three pins, a Ground and a VCC for powering the module and an output pin
which gives high logic level if an object is detected. Also it has two potentiometers. One for
adjusting the sensitivity of the sensor and the other for adjusting the time the output signal stays
high when object is detected. This time can be adjusted from 0.3 seconds up to 5 minutes.
The module has three more pins with a jumper between two of them. These pins are for selecting
the trigger modes. The first one is called “non-repeatable trigger” and works like this: when the
sensor output is high and the delay time is over, the output will automatically change from high
to low level. The other mode called “repeatable trigger” will keep the output high all the time
until the detected object is present in sensor’s range.
Components needed for this tutorial
You can get the components from any of the sites below:
• HC-SR501 PIR Sensor Module…….. Amazon / Aliexpress
• 5V Relay Module………………………….. Amazon / Aliexpress
• Arduino Board……………………………… Amazon / Aliexpress
• Breadboard and Jump Wires…………. Amazon / Aliexpress
• Cable, Plug, Socket
• Circuit Schematic
As an example for this tutorial I will make a circuit that will turn on a high voltage lamp when
the sensor will detect an object. Here’s the circuit schematics. The output pin of the sensor will
be connected to pin number 8 on the Arduino Board and when an object will be detected the pin
number 7 will activate the relay module and the high voltage lamp will turn on.
For more details how the relay module works, you can check my Arduino Relay Tutorial. (Keep
in minds that we use high voltage in the example, so you should be very caution, because I don’t
take any responsibility of your actions)
Source Code
Here’s the Arduino Code for this example. It’s quite simple. We just need to define the PIR
Sensor pin as input and the relay pin as output. Using the digitalRead() function we will read the
output of the sensor and if its high or if an object is detected it will activate the relay. For
activating the relay module we will send a logic low as the relay input pin works inversely.
1. /* Arduini PIR Motion Sensor Tutorial
2. *
3. * by Dejan Nedelkovski, www.HowToMechatronics.com
4. *
5. */
6. int pirSensor = 8;
7. int relayInput = 7;
8.
9. void setup() {
10. pinMode(pirSensor, INPUT);
11. pinMode(relayInput, OUTPUT);
12. }
13.
14. void loop() {
15. int sensorValue = digitalRead(pirSensor);
16.
17. if (sensorValue == 1) {
18. digitalWrite(relayInput, LOW); // The Relay Input works Inversly
19. }
20. }
The demonstration of the example can be seen at the end of the video attached above. Note that
after powering the sensor module it needs about 20 – 60 seconds to “warm-up” in order to
function properly. Now when you will put your hand in front of the sensor the relay will activate
the lamp. But note that even if you move your hand constantly the lamp will turn off after the
adjusted delay time is over because the PIR sensor is in “non-repeatable trigger” mode. If you
change the sensor with the jumper to the “repeatable trigger” mode and you constantly move the
hand, the lamp will be constantly on as well and it will turn off after the movement is gone and
the set delay time is over.
4.10 LPG Gas Sensor(MQ6) (SKU:SEN0131)
The MQ6 Gas Sensor module is useful for gas leakage detection. They are used in gas leakage
detecting equipments in home and industry, are suitable for detecting of LPG, iso-butane,
propane, LNG, avoid the noise of alcohol , cooking fumes and cigarette smoke. Due to its high
sensitivity and response time, measurements can be taken as soon as possible.
The sensitivity of the sensor can be adjusted by using the potentiometer.
mq-6
FEATURES
* High sensitivity to LPG, iso-butane, propane
* Small sensitivity to alcohol, smoke.
* Fast response .
* Stable and long life
* Simple drive circuit
Connection
here are the connections for my sensor
Arduino Gas Sensor
5V VCC
GND GND
NC DO
Analog A0 AO
Code
Source code
void setup()
{
Serial.begin(9600);
}
void loop()
{
float sensorVoltage;
float sensorValue;
sensorValue = analogRead(A0);
sensorVoltage = sensorValue/1024*5.0;
Serial.print("sensor voltage = ");
Serial.print(sensorVoltage);
Serial.println(" V");
delay(1000);
}
Results
Again look at the serial monitor, in this case I noticed that it took about 3 minutes for the
readings to stabilise, something you may want to factor in
sensor voltage = 1.14 V
sensor voltage = 1.44 V
sensor voltage = 1.71 V
sensor voltage = 1.95 V
sensor voltage = 2.16 V
sensor voltage = 2.32 V
sensor voltage = 2.46 V
sensor voltage = 2.55 V
sensor voltage = 2.56 V
sensor voltage = 2.47 V
sensor voltage = 2.28 V
sensor voltage = 2.08 V
sensor voltage = 1.90 V
sensor voltage = 1.76 V
sensor voltage = 1.63 V
sensor voltage = 1.52 V
sensor voltage = 1.43 V
sensor voltage = 1.34 V
sensor voltage = 1.26 V
3 minutes worh of readings
sensor voltage = 0.40 V
sensor voltage = 0.40 V
sensor voltage = 0.40 V
sensor voltage = 0.39 V
sensor voltage = 0.39 V
sensor voltage = 0.39 V
sensor voltage = 0.39 V
4.11 Extract, transform, and load (ETL)
Extract, transform, and load (ETL) is a data pipeline used to collect data from various sources,
transform the data according to business rules, and load it into a destination data store. The
transformation work in ETL takes place in a specialized engine, and often involves using staging
tables to temporarily hold data as it is being transformed and ultimately loaded to its destination.
The data transformation that takes place usually involves various operations, such as filtering,
sorting, aggregating, joining data, cleaning data, deduplicating, and validating data.
Often, the three ETL phases are run in parallel to save time. For example, while data is being
extracted, a transformation process could be working on data already received and prepare it for
loading, and a loading process can begin working on the prepared data, rather than waiting for
the entire extraction process to complete.
Relevant Azure service:
• Azure Data Factory v2
Other tools:
• SQL Server Integration Services (SSIS)
Extract, load, and transform (ELT)
Extract, load, and transform (ELT) differs from ETL solely in where the transformation takes
place. In the ELT pipeline, the transformation occurs in the target data store. Instead of using a
separate transformation engine, the processing capabilities of the target data store are used to
transform data. This simplifies the architecture by removing the transformation engine from the
pipeline. Another benefit to this approach is that scaling the target data store also scales the ELT
pipeline performance. However, ELT only works well when the target system is powerful
enough to transform the data efficiently.
Typical use cases for ELT fall within the big data realm. For example, you might start by
extracting all of the source data to flat files in scalable storage such as Hadoop distributed file
system (HDFS) or Azure Data Lake Store. Technologies such as Spark, Hive, or PolyBase can
then be used to query the source data. The key point with ELT is that the data store used to
perform the transformation is the same data store where the data is ultimately consumed. This
data store reads directly from the scalable storage, instead of loading the data into its own
proprietary storage. This approach skips the data copy step present in ETL, which can be a time
consuming operation for large data sets.
In practice, the target data store is a data warehouse using either a Hadoop cluster (using Hive or
Spark) or a SQL Data Warehouse. In general, a schema is overlaid on the flat file data at query
time and stored as a table, enabling the data to be queried like any other table in the data store.
These are referred to as external tables because the data does not reside in storage managed by
the data store itself, but on some external scalable storage.
The data store only manages the schema of the data and applies the schema on read. For
example, a Hadoop cluster using Hive would describe a Hive table where the data source is
effectively a path to a set of files in HDFS. In SQL Data Warehouse, PolyBase can achieve the
same result — creating a table against data stored externally to the database itself. Once the
source data is loaded, the data present in the external tables can be processed using the
capabilities of the data store. In big data scenarios, this means the data store must be capable of
massively parallel processing (MPP), which breaks the data into smaller chunks and distributes
processing of the chunks across multiple machines in parallel.
The final phase of the ELT pipeline is typically to transform the source data into a final format
that is more efficient for the types of queries that need to be supported. For example, the data
may be partitioned. Also, ELT might use optimized storage formats like Parquet, which stores
row-oriented data in a columnar fashion and providess optimized indexing.
Relevant Azure service:
• Azure SQL Data Warehouse
• HDInsight with Hive
• Azure Data Factory v2
• Oozie on HDInsight
Other tools:
• SQL Server Integration Services (SSIS)
Data flow and control flow
In the context of data pipelines, the control flow ensures orderly processing of a set of tasks. To
enforce the correct processing order of these tasks, precedence constraints are used. You can
think of these constraints as connectors in a workflow diagram, as shown in the image below.
Each task has an outcome, such as success, failure, or completion. Any subsequent task does not
initiate processing until its predecessor has completed with one of these outcomes.
Control flows execute data flows as a task. In a data flow task, data is extracted from a source,
transformed, or loaded into a data store. The output of one data flow task can be the input to the
next data flow task, and data flowss can run in parallel. Unlike control flows, you cannot add
constraints between tasks in a data flow. You can, however, add a data viewer to observe the data
as it is processed by each task.
In the diagram above, there are several tasks within the control flow, one of which is a data flow
task. One of the tasks is nested within a container. Containers can be used to provide structure to
tasks, providing a unit of work. One such example is for repeating elements within a collection,
such as files in a folder or database statements.
Relevant Azure service:
• Azure Data Factory v2
Other tools:
• SQL Server Integration Services (SSIS)
Technology choices
• Online Transaction Processing (OLTP) data stores
• Online Analytical Processing (OLAP) data stores
• Data warehouses
• Pipeline orchestration
CHAPTER 5
Smart Packaging - Intelligent Packaging for Food, Beverages,
Pharmaceuticals and Household Products
Background
What have these three scenarios got in common? The tin of baked beans that urges you to buy it
as you pass along the supermarket aisles (assuming you still shop for goods and they are not all
delivered via the internet), the smart microwave that has your steaming plate of lasagne ready the
moment you arrive, following a mobile call to your smart home on the way borne (assuming you
still go out to work), and the pill bottle that alerts the health centre if an elderly relative forgets
their medication. They are all visions of a future in which the package does more than just
contain and protect its contents - it plays an active and sometimes ‘Intelligent’ role in adding
functionality to the product itself, or to aspects of product consumption, convenience or security.
Smartness in Packaging
‘Smartness’ in packaging is a broad term that covers a number of functionalities, depending on
the product being packaged, including food, beverage, pharmaceutical, household products etc.
Examples of current and future functional ‘smartness’ would be in packages that
• Retain integrity and actively prevent food spoilage (shelf-life)
• Enhance product attributes (e.g. look, taste, flavour, aroma etc)
• Respond actively to changes in product or package environment
• Communicate product information, product history or condition to user
• Assist with opening and indicate seal Integrity
• Confirm product authenticity, and act to counter theft.
Smart Packaging and Activated Packaging
There is an important distinction between package functions that are smart/Intelligent, and those
that become active in response to a triggering event, for example, filling, exposure to UV, release
of pressure etc and then continue until the process is exhausted. Some smart packaging already
exists commercially and many other active and intelligent packaging concepts are under
development, table 1. A good example of active packaging is the highly successful foam-
producing ‘widget’ in a metal can of beer. Another is the oxygen scavenging MAR technology
patented by CMB Packaging Technology (now Crown Cork & Seal).
Table 1. Smart packaging under development.
Active Intelligent
• Oxygen scavenging
• Anti-microbial
• Ethylene scavenging
• Heating/cooling
• Odour and flavour absorbing/releasing
• Moisture absorbing
• Time-temperature history
• Microbial growth indicators
• Light protection (photochromic)
• Physical shock indicators
• Leakage, microbial spoilage indicating
How Activated Packaging Systems Work
This consists of a matrix polymer, such as PET, an oxygen scavenging/absorbing component and
a catalyst. The oxygen-scavenging component is a nylon polymer (MXD6) melt blended with the
PET at around the 5% level. The catalyst is a cobalt salt added at a low concentration (less than
200ppm) that triggers the oxidation of the MXD6. The OXBAR system remains active for
periods of up to two years providing protection to oxygen sensitive products such as beer, wine,
fruit juice and mayonnaise throughout their shelf-lives. Active food packaging systems using
oxygen scavenging and anti-microbial technologies (e.g. sorbate-releasing LDPE film for
cheese) have the potential to extend the shelf-life of perishable foods while at the same time
improving their quality by reducing the need for additives and preservatives.
How Intelligent Packaging Works
In ‘intelligent’ packaging, the package function switches on and off in response to changing
external/internal conditions, and can include a communication to the customer or end user as to
the status of the product. A simple definition of intelligent packaging is ‘packaging which senses
and informs’, and nowhere does this generate a more potent vision than within the smart home of
the future.
Factors That Will Aid the Growth of Intelligent Packaging
Consumer and societal factors are likely to drive the adoption of smart packaging in the future.
The growing need for information on packaging will mean there has to be a step change in
providing this information. Consumers increasingly need to know what ingredients or
components are in the product and how the product should be stored and used. Intelligent
labelling and printing, for example, will be capable of communicating directly to the customer
via thin film devices providing sound and visual information, either in response to touch, motion
or some other means of scanning or activation. Voice-activated safety and disposal instructions
contained on household and pharmaceutical products will be used to tell the consumer how they
should be disposed of after consumption - information that can be directly used in the recycling
industry to help sort packaging materials from waste streams. Drug delivery systems in smart
packaging will be programmed to communicate patient information back to healthcare centres.
Quality Assurance Using Intelligent Labels
Another important need is for consumer security assurance, particularly for perishable food
products. The question as to whether, for example, a chilled ready-meal is safe to use or consume
is currently answered by ‘best by’ date stamping. However, this does not take into account
whether the product has inadvertently been exposed to elevated temperatures during storage or
transportation. In the future, microbial growth and temperature-time visual indicators based on
physical, chemical or enzymatic activity in the food will give a clear, accurate and unambiguous
indication of product quality, safety and shelf-life condition. As an example, COX Technologies
has developed a colour indicating tag that is attached as a small adhesive label to the outside of
packaging film, which monitors the freshness of seafood products. A barb on the backside of the
tag penetrates the packaging film and allows the passage of volatile amines, generated by
spoilage of the seafood. These are wicked passed a chemical sensor that turns FreshTag
progressively bright pink as the seafood ages, figure 1.
Figure 1. Colour indicating tags attached as a small adhesive label to the outside of packaging
film can be used to monitor the freshness of perishable food products such as seafood
Intelligent Packaging for Fresh Fruit and Vegetables
Fresh-cut produce continues to be one of the fastest growing segments of food retailing and
while conventional film packaging is suitable for lettuce and prepared salads, it cannot cope with
the high respiration rates of pre-cut vegetables and fruit, leading to early product deterioration. In
the USA, novel breatheable polymer films are already in commercial use for fresh-cut vegetables
and fruit. Landec Corporation supplies Intellipac packaging films that are acrylic side-chain
crystallisable polymers tailored to change phase reversibly at various temperatures from 0-68°C.
As the side-chain components melt, gas permeation increases dramatically, and by further
tailoring the package and materials of construction, it is possible to fine tune the carbon dioxide
to oxygen permeation ratios for particular products. The final package is ‘smart’ because it
automatically regulates oxygen ingress and carbon dioxide egress by transpiration according to
the prevailing temperature. In this way, an optimum atmosphere is maintained around the
product during storage and distribution, extending freshness and allowing shipping of higher
quality products to the consumer.
Self-Heating and Self-Chilling Packaging
Improved convenience is a value-added function that customers are likely to pay extra for as
lifestyles change. Self-heating packages, for soup and coffee, for example, and self-cooling
containers for beer and soft drinks have been under active development for more than a decade,
but have yet to achieve commercial status. However, Crown Cork & Seal is pioneering the
development of a self-chilling beverage can in conjunction with Tempra Technologies and
development is nearing completion. The Crown/Tempra technology uses the latent heat of
evaporating water to produce the cooling effect. The water is bound in a gel layer coating a
separate container within the beverage can, and is in close thermal contact with the beverage.
The consumer twists the base of the can to open a valve, exposing the water to the desiccant held
in a separate, evacuated external chamber This initiates evaporation of the water at room
temperature. The unit has been designed to meet a target specification set by major beverage
customers cooling 300ml of beverage in a 355ml can by 16.7°C in three minutes. This
performance level has been achieved in laboratory tests and working samples are currently
undergoing focus group trials with customers.
Thermochromic Labelling
Give a self-heating or self-cooling container a sensor to tell the consumer it is at the correct
temperature and the package becomes ‘smart’ (such packaging is currently under development).
The most common use a thermochromic ink dot to indicate the product is at the correct serving
temperature following refrigeration or microwave heating. Plastic containers of pouring syrup for
pancakes can be purchased in the USA that are labelled with a thermochromic ink dot to indicate
that the syrup is at the right temperature following microwave heating. Similar examples can be
found on supermarket shelves with beer bottle labels that incorporate thermochromic-based
designs to inform the consumer when a refrigerated beer is cold enough to drink.
Smart Packaging Concepts for Pharmaceuticals
Smart packaging concepts that improve case of use could include ‘dial-a-dose’ smart caps and
closures that allow the safe dispensing of exact controlled quantities of product, e.g.
pharmaceuticals, cleaning materials, and other potentially hazardous materials. Already a
prescription drug bottle with bottle cap alarm is available - it beeps to alert users when it is time
to take the medication, and it displays how many times the bottle has been opened and the
intervals between openings. The bottle can be connected via a modem to the healthcare centre for
the automatic transmission of drug usage and, if necessary, provide feedback to the patient if not
in compliance. Eventually, programmed skin patches using smart gels that rely on changes in
skin properties to trigger drug delivery could replace conventional pill-taking medication.
Intelligent Tamper-Proof Packaging
Knowing whether a package has been tampered with is equally important to consumers. Tamper
evidence technologies that cannot easily be replicated, e.g. based on optically variable films or
gas sensing dyes, involving irreversible colour changes, will become more widespread and cost-
effective for disposable packaging of commodity items. Piezoelectric polymeric materials might
be incorporated into package construction so that the package changes colour at a certain stress
threshold. In this way, a 'self-bruising' closure on a bottle or jar might indicate that attempts had
been made to open it.
Easier to Open Packaging
Easier to open packaging will be a paramount feature of future packaging. A recent DTI survey
showed that in the UK in 1997, 90,964 accidents requiring hospital treatment were packaging
related. The focus will be on better design (size, shape, etc.) and the optimum use of materials, to
produce easy to open packages consistent with the strength capabilities of an ageing population.
Developments in low peel-force adhesives and structures, even smart packages that are self-
opening, e.g. based on shape memory alloys (the metal ‘rubber’ band), can be envisaged.
Possible Concerns over Intelligent Packaging
When it comes to the environment, consumer attitudes towards packaging are generally confused
and contradictory. There are increasing concerns about the amount of waste created by
packaging, but the growth of more elaborate and attractive packaging is being driven by
consumers to fuel our desire for convenience and feed our lifestyle choices. Ultimately, future
consumers could react negatively to the perception of increased waste and lack of recyclability of
disposable smart packages. The perception of extra cost and complexity, and the possible
mistrust/confusion of technology - for example, if there is both a date stamp and a visual
indicator on a food pack, which does the customer take note of? - are further factors that could
slow widespread market introduction of smart packages. The overall acceptance barriers to smart
packaging can be summed up as:
• Extra cost - can it be absorbed/passed on to consumer?
• Unreliability of indicating devices - showing either food to be safe when it is not (potential
liability?) or food to be unsafe when it is (increased spoilage stock loss)
• Food safety and regulatory issues - e.g. possible migration issues of complex packaging
materials into product
• Recycling features and environmental regulations.
What Areas will Benefit from Intelligent Packaging First?
Cost issues will probably mean that early adopters of smart packaging are likely to be in non-
commodity products, e.g. pharmaceuticals, health and beauty, and packaging that plays a part in
lifestyle and leisure activities. A further consideration is the need for education to reassure the
consumer of package safety, and ensure against incorrect operation and mistrust of smart
technology. The successful adoption of smart packaging concepts in the future must create
advantages for the whole of the supply chain.
The Future for Packaging
The vision of the future of packaging, according to the recently published Foresight report
‘Materials: Shaping Our Society’, is one in which the package will increasingly operate as a
smart system incorporating both smart and conventional materials, adding value and benefits
across the packaging supply chain. For smart materials to be adopted in packaging, they need to
be inexpensive relative to the value of the product, reliable, accurate, reproducible in their range
of operation, and environmentally benign and food contact safe.
Lessons in Packaging Learned from Nature
Perfect packaging exists in nature - examples include the banana and the egg, together with the
many smart materials and systems that control plant and biological functions. Learning from
Nature to solve engineering problems (biomimetics) is not new, although the term itself is. In
1850, Joseph Paxton gained his inspiration for the design of the Crystal Palace in London from a
study of the structure of the lilypad, Victoria amazonica. At the Centre for Biomimetics at the
University of Reading, researchers are studying expanded starch in the search for a sustainable
alternative to polystyrene, used extensively in the secondary packaging of consumer goods.
Another team is looking at smart fabrics by examining polymer analogues to plant leaf structures
controlling respiration, or humidity control, based on the opening and closing of pine cones.
Research groups at other institutions are studying how helmet design could give improved head
protection by looking at the energy absorbing properties of the hazelnut shell and the skull of the
woodpecker. A spin-off application is in the packaging and transportation of fragile goods.
Animals and plants have evolved many successful structural and functional mechanisms and
increasing our study of biological materials and systems will almost certainly yield promising
engineering concepts applicable to smart packaging. Packaging in the future could indeed be
‘smart by name, smart by Nature!’
CHAPTER 6
6.1 JAVA
Definition - What does Java mean?
Java is a programming language that produces software for multiple platforms. When a
programmer writes a Java application, the compiled code (known as bytecode) runs on most
operating systems (OS), including Windows, Linux and Mac OS. Java derives much of its syntax
from the C and C++ programming languages.
Java was developed in the mid-1990s by James A. Gosling, a former computer scientist with Sun
Microsystems.
6.2 Features of Java
The main objective of Java programming language creation was to make it portable, simple and
secure programming language. Apart from this, there are also some awesome features which
play important role in the popularity of this language. The features of Java are also known as
java buzzwords.
A list of most important features of Java language are given below.
1. Simple
2. Object-Oriented
3. Portable
4. Platform independent
5. Secured
6. Robust
7. Architecture neutral
8. Interpreted
9. High Performance
10. Multithreaded
11. Distributed
12. Dynamic
Simple
Java is very easy to learn and its syntax is simple, clean and easy to understand. According to
Sun, Java language is a simple programming language because:
o Java syntax is based on C++ (so easier for programmers to learn it after C++).
o Java has removed many confusing and rarely-used features e.g. explicit pointers, operator
overloading etc.
o There is no need to remove unreferenced objects because there is Automatic Garbage
Collection in java.
Object-oriented
Java is object-oriented programming language. Everything in Java is an object. Object-oriented
means we organize our software as a combination of different types of objects that incorporates
both data and behaviour.
Object-oriented programming (OOPs) is a methodology that simplifies software development
and maintenance by providing some rules.
Basic concepts of OOPs are:
1. Object
2. Class
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
Platform Independent
Java is platform independent because it is different from other languages like C, C++ etc. which
are compiled into platform specific machines while Java is a write once, run anywhere language.
A platform is the hardware or software environment in which a program runs.
There are two types of platforms software-based and hardware-based. Java provides software-
based platform.
The Java platform differs from most other platforms in the sense that it is a software-based
platform that runs on the top of other hardware-based platforms. It has two components:
1. Runtime Environment
2. API(Application Programming Interface)
Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java
code is compiled by the compiler and converted into bytecode. This bytecode is a platform-
independent code because it can be run on multiple platforms i.e. Write Once and Run
Anywhere(WORA).
Secured
Java is best known for its security. With Java, we can develop virus-free systems. Java is secured
because:
o No explicit pointer
o Java Programs run inside virtual machine sandbox
o Classloader: Classloader in Java is a part of the Java Runtime Environment(JRE) which
is used to dynamically load Java classes into the Java Virtual Machine. It adds security by
separating the package for the classes of the local file system from those that are
imported from network sources.
o Bytecode Verifier: It checks the code fragments for illegal code that can violate access
right to objects.
o Security Manager: It determines what resources a class can access such as reading and
writing to the local disk.
These security are provided by java language. Some security can also be provided by application
developer through SSL, JAAS, Cryptography etc.
Robust
Robust simply means strong. Java is robust because:
o It uses strong memory management.
o There are lack of pointers that avoids security problems.
o There is automatic garbage collection in java which runs on the Java Virtual Machine to
get rid of objects which are not being used by a Java application anymore.
o There is exception handling and type checking mechanism in java. All these points makes
java robust.
Architecture-neutral
Java is architecture neutral because there is no implementation dependent features e.g. size of
primitive types is fixed.
In C programming, int data type occupies 2 bytes of memory for 32-bit architecture and 4 bytes
of memory for 64-bit architecture. But in java, it occupies 4 bytes of memory for both 32 and 64
bit architectures.
Portable
Java is portable because it facilitates you to carry the java bytecode to any platform. It doesn't
require any type of implementation.
High-performance
Java is faster than other traditional interpreted programming languages because Java bytecode is
"close" to native code. It is still a little bit slower than a compiled language (e.g. C++). Java is an
interpreted language that is why it is slower than compiled languages e.g. C, C++ etc.
Distributed
Java is distributed because it facilitates users to create distributed applications in java. RMI and
EJB are used for creating distributed applications. This feature of Java makes us able to access
files by calling the methods from any machine on the internet.
Multi-threaded
A thread is like a separate program, executing concurrently. We can write Java programs that
deal with many tasks at once by defining multiple threads. The main advantage of multi-
threading is that it doesn't occupy memory for each thread. It shares a common memory area.
Threads are important for multi-media, Web applications etc.
Dynamic
Java is a dynamic language. It supports dynamic loading of classes. It means classes are loaded
on demand. It also supports functions from its native languages i.e. C and C++.
Java supports dynamic compilation and automatic memory management (garbage collection).
6.3 ArrayList in Java
ArrayList is a part of collection framework and is present in java.util package. It provides us
dynamic arrays in Java. Though, it may be slower than standard arrays but can be helpful in
programs where lots of manipulation in the array is needed.
▪ ArrayList inherits AbstractList class and implements List interface.
▪ ArrayList is initialized by a size, however the size can increase if collection grows or
shrunk if objects are removed from the collection.
▪ Java ArrayList allows us to randomly access the list.
▪ ArrayList can not be used for primitive types, like int, char, etc. We need a wrapper class
for such cases (see this for details).
▪ ArrayList in Java can be seen as similar to vector in C++.
Now primarily the Java ArrayList can constitute of both Constructors and Methods. Below
mentioned is a list of few constructors and methods along with there use and functions.
Constructors in Java ArrayList:
1. ArrayList(): This constructor is used to build an empty array list
2. ArrayList(Collection c): This constructor is used to build an array list initialized with the
elements from collection c
3. ArrayList(int capacity): This constructor is used to build an array list with initial capacity
being specified
Let us look at the code to create generic ArrayList-
// Creating generic integer ArrayList
ArrayList<Integer> arrli = new ArrayList<Integer>();
// Java program to demonstrate working of ArrayList in Java
import java.io.*;
import java.util.*;
class arrayli
{
public static void main(String[] args)
throws IOException
{
// size of ArrayList
int n = 5;
//declaring ArrayList with initial size n
ArrayList<Integer> arrli = new ArrayList<Integer>(n);
// Appending the new element at the end of the list
for (int i=1; i<=n; i++)
arrli.add(i);
// Printing elements
System.out.println(arrli);
// Remove element at index 3
arrli.remove(3);
// Displaying ArrayList after deletion
System.out.println(arrli);
// Printing elements one by one
for (int i=0; i<arrli.size(); i++)
System.out.print(arrli.get(i)+" ");
}
}
Output:
[1, 2, 3, 4, 5]
[1, 2, 3, 5]
1 2 3 5
enum in Java
Enumerations serve the purpose of representing a group of named constants in a programming
language. For example the 4 suits in a deck of playing cards may be 4 enumerators named Club,
Diamond, Heart, and Spade, belonging to an enumerated type named Suit. Other examples
include natural enumerated types (like the planets, days of the week, colors, directions, etc.).
Enums are used when we know all possible values at compile time, such as choices on a menu,
rounding modes, command line flags, etc. It is not necessary that the set of constants in an enum
type stay fixed for all time.
In Java (from 1.5), enums are represented using enum data type. Java enums are more powerful
than C/C++ enums . In Java, we can also add variables, methods and constructors to it. The main
objective of enum is to define our own data types(Enumerated Data Types).
Declaration of enum in java :
▪ Enum declaration can be done outside a Class or inside a Class but not inside a Method.
// A simple enum example where enum is declared
// outside any class (Note enum keyword instead of
// class keyword)
enum Color
{
RED, GREEN, BLUE;
}
public class Test
{
// Driver method
public static void main(String[] args)
{
Color c1 = Color.RED;
System.out.println(c1);
}
}
▪ Run on IDE
▪ Output :
▪ RED
// enum declaration inside a class.
public class Test
{
enum Color
{
RED, GREEN, BLUE;
}
// Driver method
public static void main(String[] args)
{
Color c1 = Color.RED;
System.out.println(c1);
}
}
▪ Run on IDE
▪ Output :
▪
▪ RED
6.5 Anonymous Classes
Anonymous classes enable you to make your code more concise. They enable you to declare and
instantiate a class at the same time. They are like local classes except that they do not have a
name. Use them if you need to use a local class only once.
This section covers the following topics:
• Declaring Anonymous Classes
• Syntax of Anonymous Classes
• Accessing Local Variables of the Enclosing Scope, and Declaring and Accessing
Members of the Anonymous Class
• Examples of Anonymous Classes
Declaring Anonymous Classes
While local classes are class declarations, anonymous classes are expressions, which means that
you define the class in another expression. The following
example,HelloWorldAnonymousClasses, uses anonymous classes in the initialization statements
of the local variables frenchGreeting and spanishGreeting, but uses a local class for the
initialization of the variable englishGreeting:
public class HelloWorldAnonymousClasses {
interface HelloWorld {
public void greet();
public void greetSomeone(String someone);
}
public void sayHello() {
class EnglishGreeting implements HelloWorld {
String name = "world";
public void greet() {
greetSomeone("world");
}
public void greetSomeone(String someone) {
name = someone;
System.out.println("Hello " + name);
}
}
HelloWorld englishGreeting = new EnglishGreeting();
HelloWorld frenchGreeting = new HelloWorld() {
String name = "tout le monde";
public void greet() {
greetSomeone("tout le monde");
}
public void greetSomeone(String someone) {
name = someone;
System.out.println("Salut " + name);
}
};
HelloWorld spanishGreeting = new HelloWorld() {
String name = "mundo";
public void greet() {
greetSomeone("mundo");
}
public void greetSomeone(String someone) {
name = someone;
System.out.println("Hola, " + name);
}
};
englishGreeting.greet();
frenchGreeting.greetSomeone("Fred");
spanishGreeting.greet();
}
public static void main(String... args) {
HelloWorldAnonymousClasses myApp =
new HelloWorldAnonymousClasses();
myApp.sayHello();
}
}
Syntax of Anonymous Classes
As mentioned previously, an anonymous class is an expression. The syntax of an anonymous
class expression is like the invocation of a constructor, except that there is a class definition
contained in a block of code.
Consider the instantiation of the frenchGreeting object:
HelloWorld frenchGreeting = new HelloWorld() {
String name = "tout le monde";
public void greet() {
greetSomeone("tout le monde");
}
public void greetSomeone(String someone) {
name = someone;
System.out.println("Salut " + name);
}
};
The anonymous class expression consists of the following:
• The new operator
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report
My 15 day intern report

More Related Content

What's hot

SDLC Final (1)
SDLC Final (1)SDLC Final (1)
SDLC Final (1)
Krystal McLean
 
Waterfall model ppt final
Waterfall model ppt  finalWaterfall model ppt  final
Waterfall model ppt final
shiva krishna
 
Process Models IN software Engineering
Process Models IN software EngineeringProcess Models IN software Engineering
Process Models IN software Engineering
Arid Agriculture university rawalpindi
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
Raheel Aslam
 
2. Software process
2. Software process2. Software process
2. Software process
Ashis Kumar Chanda
 
I
II
Software Development Process Models (SCRUM Methodology)
Software Development Process Models (SCRUM Methodology)Software Development Process Models (SCRUM Methodology)
Software Development Process Models (SCRUM Methodology)
Muhammad Ahmed
 
The Waterfall Model
The Waterfall ModelThe Waterfall Model
The Waterfall Model
Damian T. Gordon
 
Software Engineering Methodologies
Software Engineering MethodologiesSoftware Engineering Methodologies
Software Engineering Methodologies
Damian T. Gordon
 
Software development PROCESS
Software development PROCESSSoftware development PROCESS
Software development PROCESS
Ivano Malavolta
 
Software development methodologies
Software development methodologiesSoftware development methodologies
Software development methodologies
Ankita Lachhwani
 
Waterfall model in system development life cycle
Waterfall model in system development life cycleWaterfall model in system development life cycle
Waterfall model in system development life cycle
Management Study online
 
SDLC or Software Development Life Cycle
SDLC or Software Development Life CycleSDLC or Software Development Life Cycle
SDLC or Software Development Life Cycle
Jyothi Vbs
 
Introduction to Software Process
Introduction to Software ProcessIntroduction to Software Process
Introduction to Software Process
Fáber D. Giraldo
 
Software engineering 25 models details
Software engineering 25 models detailsSoftware engineering 25 models details
Software engineering 25 models details
Samiul Hossaini
 
Pressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-modelsPressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-models
saurabhshertukde
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
Vaibhav యం.
 
SDLC
SDLCSDLC
List of Software Development Model and Methods
List of Software Development Model and MethodsList of Software Development Model and Methods
List of Software Development Model and Methods
Riant Soft
 
Comparision between waterfall model and agile model
Comparision between waterfall model and agile modelComparision between waterfall model and agile model
Comparision between waterfall model and agile model
diwas mishra
 

What's hot (20)

SDLC Final (1)
SDLC Final (1)SDLC Final (1)
SDLC Final (1)
 
Waterfall model ppt final
Waterfall model ppt  finalWaterfall model ppt  final
Waterfall model ppt final
 
Process Models IN software Engineering
Process Models IN software EngineeringProcess Models IN software Engineering
Process Models IN software Engineering
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
2. Software process
2. Software process2. Software process
2. Software process
 
I
II
I
 
Software Development Process Models (SCRUM Methodology)
Software Development Process Models (SCRUM Methodology)Software Development Process Models (SCRUM Methodology)
Software Development Process Models (SCRUM Methodology)
 
The Waterfall Model
The Waterfall ModelThe Waterfall Model
The Waterfall Model
 
Software Engineering Methodologies
Software Engineering MethodologiesSoftware Engineering Methodologies
Software Engineering Methodologies
 
Software development PROCESS
Software development PROCESSSoftware development PROCESS
Software development PROCESS
 
Software development methodologies
Software development methodologiesSoftware development methodologies
Software development methodologies
 
Waterfall model in system development life cycle
Waterfall model in system development life cycleWaterfall model in system development life cycle
Waterfall model in system development life cycle
 
SDLC or Software Development Life Cycle
SDLC or Software Development Life CycleSDLC or Software Development Life Cycle
SDLC or Software Development Life Cycle
 
Introduction to Software Process
Introduction to Software ProcessIntroduction to Software Process
Introduction to Software Process
 
Software engineering 25 models details
Software engineering 25 models detailsSoftware engineering 25 models details
Software engineering 25 models details
 
Pressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-modelsPressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-models
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
 
SDLC
SDLCSDLC
SDLC
 
List of Software Development Model and Methods
List of Software Development Model and MethodsList of Software Development Model and Methods
List of Software Development Model and Methods
 
Comparision between waterfall model and agile model
Comparision between waterfall model and agile modelComparision between waterfall model and agile model
Comparision between waterfall model and agile model
 

Similar to My 15 day intern report

Software development life cycle.
Software development life cycle.Software development life cycle.
Software development life cycle.
RishavChandel1
 
SDLC
SDLCSDLC
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
vishal choudhary
 
Lecture 1. Software Process Models.pdf
Lecture 1. Software Process Models.pdfLecture 1. Software Process Models.pdf
Lecture 1. Software Process Models.pdf
OwenHarveyBalocon
 
SDLC - Software Development Life Cycle
SDLC - Software Development Life CycleSDLC - Software Development Life Cycle
SDLC - Software Development Life Cycle
Suresh Koujalagi
 
Software life cycle models
Software life cycle modelsSoftware life cycle models
Software life cycle models
Wasif Khan
 
Best SQA Document.pdf
Best SQA Document.pdfBest SQA Document.pdf
Best SQA Document.pdf
AzmatIqbal2
 
SDLC presentation-1.pptx
SDLC presentation-1.pptxSDLC presentation-1.pptx
SDLC presentation-1.pptx
EvelynChinnu
 
Plagiarism Report SDLC 1.pdf
Plagiarism Report SDLC 1.pdfPlagiarism Report SDLC 1.pdf
Plagiarism Report SDLC 1.pdf
OmethSanchitha
 
Lesson 2 introduction in computing
Lesson 2 introduction in computingLesson 2 introduction in computing
Lesson 2 introduction in computing
Professor Thor
 
software development life cycle(SDLC)
software development life cycle(SDLC)software development life cycle(SDLC)
software development life cycle(SDLC)
sanoop s
 
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptxREPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
ESAChannel
 
Comparing Various SDLC Models On The Basis Of Available Methodology
Comparing Various SDLC Models On The Basis Of Available MethodologyComparing Various SDLC Models On The Basis Of Available Methodology
Comparing Various SDLC Models On The Basis Of Available Methodology
IJMER
 
SDLC Models
SDLC ModelsSDLC Models
SDLC Models
akash250690
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
eniolaolutunde
 
Difference Between Agile And Waterfall Model
Difference Between Agile And Waterfall ModelDifference Between Agile And Waterfall Model
Difference Between Agile And Waterfall Model
Tammy Moncrief
 
Software development process basic
Software development process basicSoftware development process basic
Software development process basic
Anurag Tomar
 
Designing A Waterfall Approach For Software Development Essay
Designing A Waterfall Approach For Software Development EssayDesigning A Waterfall Approach For Software Development Essay
Designing A Waterfall Approach For Software Development Essay
Alison Reed
 
1. object oriented concepts & principles
1. object oriented concepts & principles 1. object oriented concepts & principles
1. object oriented concepts & principles
poonam bora
 
Ch 02 s.e software process models 1
Ch 02 s.e software process models   1Ch 02 s.e software process models   1
Ch 02 s.e software process models 1
Badar Waseer
 

Similar to My 15 day intern report (20)

Software development life cycle.
Software development life cycle.Software development life cycle.
Software development life cycle.
 
SDLC
SDLCSDLC
SDLC
 
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
 
Lecture 1. Software Process Models.pdf
Lecture 1. Software Process Models.pdfLecture 1. Software Process Models.pdf
Lecture 1. Software Process Models.pdf
 
SDLC - Software Development Life Cycle
SDLC - Software Development Life CycleSDLC - Software Development Life Cycle
SDLC - Software Development Life Cycle
 
Software life cycle models
Software life cycle modelsSoftware life cycle models
Software life cycle models
 
Best SQA Document.pdf
Best SQA Document.pdfBest SQA Document.pdf
Best SQA Document.pdf
 
SDLC presentation-1.pptx
SDLC presentation-1.pptxSDLC presentation-1.pptx
SDLC presentation-1.pptx
 
Plagiarism Report SDLC 1.pdf
Plagiarism Report SDLC 1.pdfPlagiarism Report SDLC 1.pdf
Plagiarism Report SDLC 1.pdf
 
Lesson 2 introduction in computing
Lesson 2 introduction in computingLesson 2 introduction in computing
Lesson 2 introduction in computing
 
software development life cycle(SDLC)
software development life cycle(SDLC)software development life cycle(SDLC)
software development life cycle(SDLC)
 
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptxREPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
REPORT IN SYSTEM INTEGRATION AND ARCHITECTURE.pptx
 
Comparing Various SDLC Models On The Basis Of Available Methodology
Comparing Various SDLC Models On The Basis Of Available MethodologyComparing Various SDLC Models On The Basis Of Available Methodology
Comparing Various SDLC Models On The Basis Of Available Methodology
 
SDLC Models
SDLC ModelsSDLC Models
SDLC Models
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Difference Between Agile And Waterfall Model
Difference Between Agile And Waterfall ModelDifference Between Agile And Waterfall Model
Difference Between Agile And Waterfall Model
 
Software development process basic
Software development process basicSoftware development process basic
Software development process basic
 
Designing A Waterfall Approach For Software Development Essay
Designing A Waterfall Approach For Software Development EssayDesigning A Waterfall Approach For Software Development Essay
Designing A Waterfall Approach For Software Development Essay
 
1. object oriented concepts & principles
1. object oriented concepts & principles 1. object oriented concepts & principles
1. object oriented concepts & principles
 
Ch 02 s.e software process models 1
Ch 02 s.e software process models   1Ch 02 s.e software process models   1
Ch 02 s.e software process models 1
 

Recently uploaded

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 

Recently uploaded (20)

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 

My 15 day intern report

  • 1. CONTENT CHAPTER 1 1.1SOFTWARE DEVELOPMENT LIFE CYCLE 1.2 WATERFALL MODEL 1.3 AGILE MODEL 1.4 AGILE VS TRADITIONAL SDLC MODELS 1.5 AGILE MODEL -PROS AND CONS 1.6 REQUIREMENTS FOR EVENT MANAGEMENT CHAPTER 2 2.1 DATA 2.2 DATABASE 2.3 OLTP VS OLAP 2.4 DATABASE QUERY FOR EVENT MANAGEMENT CHAPTER 3 3.1 UNIFIED MODELING LANGUAGE(UML) 3.2 STARUML 3.3 UMLET CHAPTER 4 4.1 INTERNET OF THINGS(IOT) 4.2 IOT SENSORS 4.3 ARDUINO 4.4 BREADBOARD 4.5 ULTRASONIC SENSOR 4.6 SERVO MOTOR 4.7 HUMIDITY SENSOR DHT11 4.8 ARDUINO I2C SERIAL LCD 16X2
  • 2. 4.9 PIR SENSOR 4.10 LPG GAS SENSOR(MQ6) 4.11 ELT CHAPTER 5 5.1 Smart Packaging CHAPTER 6 6.1 JAVA 6.2 FEATURES OF JAVA 6.3 ARRAYLIST IN JAVA 6.4 ENUM IN JAVA 6.5 Anonymous Classes CHAPTER 7 7.1 WHAT IS ANDROID? 7.2 WHY DEVELOP APPS FOR ANDROID? 7.3 ANDROID DEVELOPMENT ARCHITECTURE CHAPTER 8 8.1 HTTP 8.2 HISTORY OF HTTP 8.3 HOW HTTP WORKS? 8.4 ISSUES WITH HTTP 8.5 CLIENT SERVER ARCHITECTURE CHAPTER 9 9.1 WHAT IS .NET? 9.2 LANGUAGES 9.3 CROSS PLATFORM 9.4 ONE CONSISTENT API 9.5 LIBRARIES
  • 3. CHAPTER 1 1.1 Software Development Life Cycle (SDLC) Definition - What does Software Development Life Cycle (SDLC) mean? The software development life cycle (SDLC) is a framework defining tasks performed at each step in the software development process. SDLC is a structure followed by a development team within the software organization. It consists of a detailed plan describing how to develop, maintain and replace specific software. The life cycle defines a methodology for improving the quality of software and the overall development process. The software development life cycle is also known as the software development process SDLC consists of following activities: 1. Planning: The most important parts of software development, requirement gathering or requirement analysis are usually done by the most skilled and experienced software engineers in the organization. After the requirements are gathered from the client, a scope document is created in which the scope of the project is determined and documented. 2. Implementation: The software engineers start writing the code according to the client's requirements. 3. Testing: This is the process of finding defects or bugs in the created software. 4. Documentation: Every step in the project is documented for future reference and for the improvement of the software in the development process. The design documentation may include writing the application programming interface (API). 5. Deployment and maintenance: The software is deployed after it has been approved for release. 6. Maintaining: Software maintenance is done for future reference. Software improvement and new requirements (change requests) can take longer than the time needed to create the initial development of the software. There are several software development models followed by various organizations: • Waterfall Model: This model involves finishing each phase completely before commencing the next one. When each phase is completed successfully, it is reviewed to see if the project is on track and whether it is feasible to continue. • V-Shaped Model: This model focuses on the execution of processes in a sequential manner, similar to the waterfall model but with more importance placed on testing. Testing procedures are written even before the commencement of writing code. A system plan is generated before starting the development phase. • Incremental Model: This life cycle model involves multiple development cycles. The cycles are divided up into smaller iterations. These iterations can be easily managed and go through a set of phases including requirements, design, implementation and testing. A working version of the software is produced during the first iteration, so working software is created early in the development process.
  • 4. . 1.2 Waterfall Model: The Waterfall Model was the first Process Model to be introduced. It is also referred to as a linear-sequential life cycle model. It is very simple to understand and use. In a waterfall model, each phase must be completed before the next phase can begin and there is no overlapping in the phases. The Waterfall model is the earliest SDLC approach that was used for software development. The waterfall Model illustrates the software development process in a linear sequential flow. This means that any phase in the development process begins only if the previous phase is complete. In this waterfall model, the phases do not overlap. WaterfallModel-Design Waterfall approach was first SDLC Model to be used widely in Software Engineering to ensure success of the project. In "The Waterfall" approach, the whole process of software development is divided into separate phases. In this Waterfall model, typically, the outcome of one phase acts as the input for the next phase sequentially. The following illustration is a representation of the different phases of the Waterfall Model.
  • 5. The sequential phases in Waterfall model are − • Requirement Gathering and analysis − All possible requirements of the system to be developed are captured in this phase and documented in a requirement specification document. • System Design − The requirement specifications from first phase are studied in this phase and the system design is prepared. This system design helps in specifying hardware and system requirements and helps in defining the overall system architecture. • Implementation − With inputs from the system design, the system is first developed in small programs called units, which are integrated in the next phase. Each unit is developed and tested for its functionality, which is referred to as Unit Testing. • Integration and Testing − All the units developed in the implementation phase are integrated into a system after testing of each unit. Post integration the entire system is tested for any faults and failures. • Deployment of system − Once the functional and non-functional testing is done; the product is deployed in the customer environment or released into the market.
  • 6. • Maintenance − There are some issues which come up in the client environment. To fix those issues, patches are released. Also to enhance the product some better versions are released. Maintenance is done to deliver these changes in the customer environment. All these phases are cascaded to each other in which progress is seen as flowing steadily downwards (like a waterfall) through the phases. The next phase is started only after the defined set of goals are achieved for previous phase and it is signed off, so the name "Waterfall Model". In this model, phases do not overlap. 1.3 Agile MODEL Agile model believes that every project needs to be handled differently and the existing methods need to be tailored to best suit the project requirements. In Agile, the tasks are divided to time boxes (small time frames) to deliver specific features for a release. Iterative approach is taken and working software build is delivered after each iteration. Each build is incremental in terms of features; the final build holds all the features required by the customer. Here is a graphical illustration of the Agile Model −
  • 7. The Agile thought process had started early in the software development and started becoming popular with time due to its flexibility and adaptability. The most popular Agile methods include Rational Unified Process (1994), Scrum (1995), Crystal Clear, Extreme Programming (1996), Adaptive Software Development, Feature Driven Development, and Dynamic Systems Development Method (DSDM) (1995). These are now collectively referred to as Agile Methodologies, after the Agile Manifesto was published in 2001. Following are the Agile Manifesto principles − • Individuals and interactions − In Agile development, self-organization and motivation are important, as are interactions like co-location and pair programming. • Working software − Demo working software is considered the best means of communication with the customers to understand their requirements, instead of just depending on documentation.
  • 8. • Customer collaboration − As the requirements cannot be gathered completely in the beginning of the project due to various factors, continuous customer interaction is very important to get proper product requirements. • Responding to change − Agile Development is focused on quick responses to change and continuous development. 1.4 Agile Vs Traditional SDLC Models Agile is based on the adaptive software development methods, whereas the traditional SDLC models like the waterfall model is based on a predictive approach. Predictive teams in the traditional SDLC models usually work with detailed planning and have a complete forecast of the exact tasks and features to be delivered in the next few months or during the product life cycle. Predictive methods entirely depend on the requirement analysis and planning done in the beginning of cycle. Any changes to be incorporated go through a strict change control management and prioritization. Agile uses an adaptive approach where there is no detailed planning and there is clarity on future tasks only in respect of what features need to be developed. There is feature driven development and the team adapts to the changing product requirements dynamically. The product is tested very frequently, through the release iterations, minimizing the risk of any major failures in future. Customer Interaction is the backbone of this Agile methodology, and open communication with minimum documentation are the typical features of Agile development environment. The agile teams work in close collaboration with each other and are most often located in the same geographical location. 1.5 Agile Model - Pros and Cons Agile methods are being widely accepted in the software world recently. However, this method may not always be suitable for all products. Here are some pros and cons of the Agile model. The advantages of the Agile Model are as follows − • Is a very realistic approach to software development. • Promotes teamwork and cross training. • Functionality can be developed rapidly and demonstrated. • Resource requirements are minimum.
  • 9. • Suitable for fixed or changing requirements • Delivers early partial working solutions. • Good model for environments that change steadily. • Minimal rules, documentation easily employed. • Enables concurrent development and delivery within an overall planned context. • Little or no planning required. • Easy to manage. • Gives flexibility to developers. The disadvantages of the Agile Model are as follows − • Not suitable for handling complex dependencies. • More risk of sustainability, maintainability and extensibility. • An overall plan, an agile leader and agile PM practice is a must without which it will not work. • Strict delivery management dictates the scope, functionality to be delivered, and adjustments to meet the deadlines. • Depends heavily on customer interaction, so if customer is not clear, team can be driven in the wrong direction. • There is a very high individual dependency, since there is minimum documentation generated. • Transfer of technology to new team members may be quite challenging due to lack of documentation. Organising a sport or recreation event can be a daunting task, particularly for an individual or committee planning an event for the first time. While the scale of the events varies dramatically, the principles of event management essentially remain the same. This information sheet provides an overview of some of the major issues to consider when planning and running an event. Planning and preparation Effective planning and preparation are crucial to the success of an event. There are numerous elements involved in planning and preparation. Purpose of the event In planning an event it is important to understand why the event is being held, who it is for and who it will benefit. Having a clear focus and defined objectives will help direct the planning process
  • 10. Timing and location of the event When and where an event takes place can have a significant impact on its overall success. When considering the best time of the day, month or year to hold an event, it is important to consider other events that may compliment or compete with the event you are organising. With regard to location, there are many variables to consider, including the availability of facilities, accommodation, transport, and the support of local stakeholders. The organising committee and event manager There is usually more than one person involved in organising a sport or recreation event. In many cases it is useful to establish an organising committee and clearly assign roles and responsibilities to committee members. There should be an event manager appointed who has overall control of the event and is ultimately responsible for the major decisions and directions of the committee.. Event checklist In order to allocate responsibilities to individuals on the organising committee, the committee must have a clear idea of all the different aspects of the event, including venue, equipment, staffing, communication, catering, garbage, toilets, money handling, medical, hospitality, transport, prizes, trophies and ceremonies. It is useful to compile an event plan, or checklist, which will ensure that all aspects of the event are considered and adequately addressed in the planning stages. See the example event checklist at the end of this document to help you organise your event. Finances and budget When preparing for an event it is important that all sources of income and all costs are accounted for, including hidden costs and in-kind support. Developing an event checklist before the budget will ensure that all costs are considered. The event manager or organising committee should work closely with a financial manager or club treasurer to ensure the event follows the relevant financial procedures. Sponsorship Once the event manager and organising committee have a clear understanding of the finances and budget, they may wish to secure sponsorship for the event. When looking at sponsorship it is important that the organising committee has a clear idea of what it is that they would like from potential sponsors (i.e. money, free publicity, discounts, goods and services). The committee must also be clear on what the event can offer potential sponsors (i.e. free advertising, publicity, naming rights, media coverage and exposure for new products). Developing a profile of the event (i.e. a brief history of the event, number and type of participants, media coverage and publicity) will help the committee to target relevant sponsors and to highlight the benefits of being involved with the event. Any attempt to secure sponsorship should be based on a definite sponsorship strategy that targets specific organisations and tailors the approach to each organisation. A general mail out requesting sponsorship from many different organisations is generally unsuccessful.
  • 11. Promotion and publicity Regardless of the size of the event it is important to consider the level of publicity and promotion required. While some events may require minimal publicity or promotion (depending on the aim, target audience and existing profile), in most cases event organisers will aim to maximise the profile of the event through promotion (controlled and paid for by organisers) and publicity (media coverage). Unfortunately, it is not uncommon for this aspect of the event organisation to be overlooked or left to the last minute, which can result in poor exposure for the event, a poor turn out of participants and unsatisfied sponsors. When looking at publicity, it is important to consider various forms of media (print, radio, online and television) and different ways to approach each of these. Approvals and legal requirements When organising an event in a public facility, or on land owned by someone other than the organising group, it is important to get the approval and any permits or licences required by the property owners or land managers. It is common for land and facility managers to ask for evidence of insurance and risk management procedures from the event organiser before approval or permits are granted. In most cases, it is advisable that the organising committee or organisation responsible for the event become an incorporated body in order to limit potential legal liability of individual members. If in doubt, the event manager should seek professional legal advice in this area. Implementation and evaluation Event delivery If sufficient time and effort has been put into planning and preparation, the event should run smoothly. The event manager should have a checklist of tasks with time frames to keep the event on track. Effective communication is essential to ensure the event goes to plan. There will always be minor difficulties and challenges; however, hopefully most of these will have been considered and there will be contingency plans to address problems as they arise. During the event it is important to take the time to publicly acknowledge the contribution of staff, volunteers and sponsors. 1.6 REQUIREMENTS FOR EVENT MANAGEMENT: FUNCTIONAL REQUIREMENTS FOR EVENT MANAGEMENT REGISTRATION LOGIN CHNAGES TO EVENT PAYMENT LOGOUT REPORT GENERATION TECHNICAL ISSUES
  • 12. INTERFACE REQUIREMENT LOGIN PAGE REGISTRATION FORM INFORMATION SCREEN IF CUSTOMER SELECTS THE BUY THEN ANOTHER SCREN OF SHOPPING CART ISSUE TICKET NONFUNCTIONAL REQUIREMENT SECURITY RELIABILITY AVAILABILITY MAINTENANCE PORTABILITY CHAPTER 2 2.1 What is Data? Data is nothing but facts and statistics stored or free flowing over a network, generally it's raw and unprocessed. For example: When you visit any website, they might store you IP address, that is data, in return they might add a cookie in your browser, marking you that you visited the website, that is data, your name, it's data, your age, it's data. Data becomes information when it is processed, turning it into something meaningful. Like, based on the cookie data saved on user's browser, if a website can analyse that generally men of age 20-25 visit us more, that is information, derived from the data collected. 2.2What is a Database? A Database is a collection of related data organised in a way that data can be easily accessed, managed and updated. Database can be software based or hardware based, with one sole purpose, storing data. During early computer days, data was collected and stored on tapes, which were mostly write- only, which means once data is stored on it, it can never be read again. They were slow and bulky, and soon computer scientists realised that they needed a better solution to this problem.
  • 13. Larry Ellison, the co-founder of Oracle was amongst the first few, who realised the need for a software based Database Management System. What is DBMS? A DBMS is a software that allows creation, definition and manipulation of database, allowing users to store, process and analyse data easily. DBMS provides us with an interface or a tool, to perform various operations like creating database, storing data in it, updating data, creating tables in the database and a lot more. DBMS also provides protection and security to the databases. It also maintains data consistency in case of multiple users. Here are some examples of popular DBMS used these days: • MySql • Oracle • SQL Server • IBM DB2 • PostgreSQL • Amazon SimpleDB (cloud based) etc. Characteristics of Database Management System A database management system has following characteristics: 1. Data stored into Tables: Data is never directly stored into the database. Data is stored into tables, created inside the database. DBMS also allows to have relationships between tables which makes the data more meaningful and connected. You can easily understand what type of data is stored where by looking at all the tables created in a database. 2. Reduced Redundancy: In the modern world hard drives are very cheap, but earlier when hard drives were too expensive, unnecessary repetition of data in database was a big problem. But DBMS follows Normalisation which divides the data in such a way that repetition is minimum.
  • 14. 3. Data Consistency: On Live data, i.e. data that is being continuosly updated and added, maintaining the consistency of data can become a challenge. But DBMS handles it all by itself. 4. Support Multiple user and Concurrent Access: DBMS allows multiple users to work on it(update, insert, delete data) at the same time and still manages to maintain the data consistency. 5. Query Language: DBMS provides users with a simple Query language, using which data can be easily fetched, inserted, deleted and updated in a database. 6. Security: The DBMS also takes care of the security of data, protecting the data from un- authorised access. In a typical DBMS, we can create user accounts with different access permissions, using which we can easily secure our data by restricting user access. 7. DBMS supports transactions, which allows us to better handle and manage data integrity in real world applications where multi-threading is extensively used. Advantages of DBMS • Segregation of applicaion program. • Minimal data duplicacy or data redundancy. • Easy retrieval of data using the Query Language. • Reduced development time and maintainance need. • With Cloud Datacenters, we now have Database Management Systems capable of storing almost infinite data. • Seamless integration into the application programming languages which makes it very easier to add a database to almost any application or website. Disadvantages of DBMS • It's Complexity • Except MySQL, which is open source, licensed DBMSs are generally costly.
  • 15. • They are large in size. 2.3 OLTP vs. OLAP We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it. - OLTP (On-line Transaction Processing) is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE). The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second. In OLTP database there is detailed and current data, and schema used to store transactional databases is the entity model (usually 3NF). - OLAP (On-line Analytical Processing) is characterized by relatively low volume of transactions. Queries are often very complex and involve aggregations. For OLAP systems a response time is an effectiveness measure. OLAP applications are widely used by Data Mining techniques. In OLAP database there is aggregated, historical data, stored in multi-dimensional schemas (usually star schema).
  • 16. The following table summarizes the major differences between OLTP and OLAP system design. OLTP System Online Transaction Processing (Operational System) OLAP System Online Analytical Processing (Data Warehouse) Source of data Operational data; OLTPs are the original source of the data. Consolidation data; OLAP data comes from the various OLTP Databases Purpose of data To control and run fundamental business tasks To help with planning, problem solving, and decision support What the data Reveals a snapshot of ongoing business processes Multi-dimensional views of various kinds of business activities Inserts and Updates Short and fast inserts and updates initiated by end users Periodic long-running batch jobs refresh the data Queries Relatively standardized and simple queries Returning relatively few records Often complex queries involving aggregations Processing Speed Typically very fast Depends on the amount of data involved; batch data refreshes and complex queries may take many hours; query speed can be improved by creating indexes Space Requirements Can be relatively small if historical data is archived Larger due to the existence of aggregation structures and history data; requires more indexes than OLTP Database Design Highly normalized with many tables Typically de-normalized with fewer tables; use of star and/or snowflake schemas Backup and Recovery Backup religiously; operational data is critical to run the business, data loss is likely to entail significant monetary loss and legal liability Instead of regular backups, some environments may consider simply reloading the OLTP data as a recovery method 2.4 DATABASE QUERY FOR EVENT MANAGEMENT create table logins
  • 17. ( id int(20),username varchar(40),password varchar(40) ); insert into logins values(1,'bibek',1234); select *from logins; create table city ( city_id int(40) primary key, city_name varchar(30) ); create table events( event_id int(40) primary key, event_name varchar(40), event_description varchar(100), city_id int(40), foreign key(city_id) references city(city_id) ); create table shows ( show_id int(30) primary key, event_id int(40), foreign key(event_id) references events(event_id), show_date date, show_timing time
  • 18. ); alter table city add show_id int(40); alter table city add foreign key(show_id) references shows(show_id); create table location( location_id int(30)primary key, city_id int(40), foreign key(city_id) references city(city_id), event_id int(30), foreign key (event_id) references events(event_id), event_start_date date, location_name varchar(30), location_address varchar(40) ); create table user( user_id int(40) primary key, user_name varchar(30), user_details varchar(100), booking_id int(30) ); create table booking( booking_id int(30) primary key, user_id int(40), foreign key(user_id) references user(user_id), show_id int(30) , foreign key(show_id) references shows(show_id)
  • 19. ); alter table user add foreign key(booking_id) references booking(booking_id); CHAPTER 3 3.1 Unified Modeling Language (UML) An Introduction Unified Modeling Language (UML) is a general purpose modelling language. The main aim of UML is define a standard way to visualize the way a system has been designed. It is quite similar to blueprints used in other fields of engineering. UML is not a programming language, it is rather a visual language. We use UML diagrams to portray the behavior and structure of a system. UML helps software engineers, businessmen and system architects with modelling, design and analysis. The Object Management Group (OMG) adopted Unified Modelling Language as a standard in 1997. Its been managed by OMG ever since. International Organization for Standardization (ISO) published UML as an approved standard in 2005. UML has been revised over the years and is reviewed periodically. Do we really need UML? ▪ Complex applications need collaboration and planning from multiple teams and hence require a clear and concise way to communicate amongst them. ▪ Businessmen do not understand code. So UML becomes essential to communicate with non programmers essential requirements, functionalities and processes of the system. ▪ A lot of time is saved down the line when teams are able to visualize processes, user interactions and static structure of the system. UML is linked with object oriented design and analysis. UML makes the use of elements and forms associations between them to form diagrams. Diagrams in UML can be broadly classified as: 1. Structural Diagrams – Capture static aspects or structure of a system. Structural Diagrams include: Component Diagrams, Object Diagrams, Class Diagrams and Deployment Diagrams. 2. Behavior Diagrams – Capture dynamic aspects or behavior of the system. Behavior diagrams include: Use Case Diagrams, State Diagrams, Activity Diagrams and Interaction Diagrams. The image below shows the hierarchy of diagrams according to UML 2.2
  • 20. Object Oriented Concepts Used in UML – 1. Class – A class defines the blue print i.e. structure and functions of an object. 2. Objects – Objects help us to decompose large systems and help us to modularize our system. Modularity helps to divide our system into understandable components so that we can build our system piece by piece. An object is the fundamental unit (building block) of a system which is used to depict an entity. 3. Inheritance – Inheritance is a mechanism by which child classes inherit the properties of their parent classes. 4. Abstraction – Mechanism by which implementation details are hidden from user. 5. Encapsulation – Binding data together and protecting it from the outer world is referred to as encapsulation. 6. Polymorphism – Mechanism by which functions or entities are able to exist in different forms. 3.2 STARUML
  • 21. StarUML is a UML tool by MKLab. The software was licensed under a modified version of GNU GPL until 2014, when a rewrittenversion 2.0.0 was released for beta testing under a proprietary license. After being abandoned for some time, the project had a revival to move from Delphi to Java/Eclipse and then stopped again. In 2014, a rewritten version was released as proprietary software. However, the open source version's community is still active and many topics are discussed on the forums.[citation needed] The stated goal of the project was to replace larger, commercial applications such as Rational Rose and Borland Together. StarUML supports most of the diagram types specified in UML 2.0. It is currently missing timing and interaction overview diagrams. StarUML was written in Delphi, which is one of the reasons why it was abandoned for a long time.[citation needed] Since December 2005 StarUML was not updated anymore, although some external modules were updated[2] Currently the newest version of StarUML by the original authors is available for download under the handle "StarUML 2". The public beta is available, although not under the GPL license. Final price and new license type yet remains unknown. This version has been completely rewritten from scratch and includes among many features: support for extensions, OS X compatibility and a new graphical user interface 3.3 UMLET UMLet is an open-source Java-based UML tool designed for teaching the Unified Modeling Language and for quickly creating UML diagrams. It is a drawing tool rather than a modelling tool as there is no underlying dictionary or directory of reusable design objects. UMLet is distributed under the GNU General Public License.[1] UMLet has a simple user interface that uses text-formatting codes to modify the basic shapes with decorations and annotations, so there is no forest of icons or parameter list dialogs in the user's way. This does require the user to learn yet another text markup language, but the effort is small and the markup obvious to the experienced UML designer. UMLet can export diagrams to pictures (eps, jpg), drawing formats (SVG), document formats (PDF). The clipboard can be used to copy-paste diagrams as pictures into other applications. It is possible to create custom UML elements. The basic drawing objects can be modified and used as templates which allows users to customize the app to their needs. This requires programming of the elements in Java. The most important UML diagram types are supported: class, use case, sequence, state, deployment, activity. Support for UML 2.0 features is not yet available, though the customization feature could be used to do this. It supports concepts like Martin Fowler's UmlAsSketch.[2] Its design goals are described in the paper "Flyweight UML Modelling Tool for Software Development".[3] Another paper compares UMLet to Rational Rose.[4]
  • 22. The app's native file format is UXF, an extension of XML intended for exchanging UML models. UMLet runs stand-alone or as Eclipse plug-in on Windows, OSX and Linux. CHAPTER 4 4.1 INTERNET OF THINGS(IOT) IoT (Internet of Things) is an advanced automation and analytics system which exploits networking, sensing, big data, and artificial intelligence technology to deliver complete systems for a product or service. These systems allow greater transparency, control, and performance when applied to any industry or system. IoT systems have applications across industries through their unique flexibility and ability to be suitable in any environment. They enhance data collection, automation, operations, and much more through smart devices and powerful enabling technology. This tutorial aims to provide you with a thorough introduction to IoT. It introduces the key concepts of IoT, necessary in using and deploying IoT systems. Audience This tutorial targets IT professionals, students, and management professionals who want a solid grasp of essential IoT concepts. After completing this tutorial, you will achieve intermediate expertise in IoT and a high level of comfort with IoT concepts and systems. Prerequisites This tutorial assumes general knowledge of networking, sensing, databases, programming, and related technology. It also assumes familiarity with business concepts and marketing. IoT systems allow users to achieve deeper automation, analysis, and integration within a system. They improve the reach of these areas and their accuracy. IoT utilizes existing and emerging technology for sensing, networking, and robotics. IoT exploits recent advances in software, falling hardware prices, and modern attitudes towards technology. Its new and advanced elements bring major changes in the delivery of products, goods, and services; and the social, economic, and political impact of those changes. IoT − Key Features
  • 23. The most important features of IoT include artificial intelligence, connectivity, sensors, active engagement, and small device use. A brief review of these features is given below − • AI − IoT essentially makes virtually anything “smart”, meaning it enhances every aspect of life with the power of data collection, artificial intelligence algorithms, and networks. This can mean something as simple as enhancing your refrigerator and cabinets to detect when milk and your favorite cereal run low, and to then place an order with your preferred grocer. • Connectivity − New enabling technologies for networking, and specifically IoT networking, mean networks are no longer exclusively tied to major providers. Networks can exist on a much smaller and cheaper scale while still being practical. IoT creates these small networks between its system devices. • Sensors − IoT loses its distinction without sensors. They act as defining instruments which transform IoT from a standard passive network of devices into an active system capable of real-world integration. • Active Engagement − Much of today's interaction with connected technology happens through passive engagement. IoT introduces a new paradigm for active content, product, or service engagement. • Small Devices − Devices, as predicted, have become smaller, cheaper, and more powerful over time. IoT exploits purpose-built small devices to deliver its precision, scalability, and versatility. IoT − Advantages The advantages of IoT span across every area of lifestyle and business. Here is a list of some of the advantages that IoT has to offer − • Improved Customer Engagement − Current analytics suffer from blind-spots and significant flaws in accuracy; and as noted, engagement remains passive. IoT completely transforms this to achieve richer and more effective engagement with audiences. • Technology Optimization − The same technologies and data which improve the customer experience also improve device use, and aid in more potent improvements to technology. IoT unlocks a world of critical functional and field data.
  • 24. • Reduced Waste − IoT makes areas of improvement clear. Current analytics give us superficial insight, but IoT provides real-world information leading to more effective management of resources. • Enhanced Data Collection − Modern data collection suffers from its limitations and its design for passive use. IoT breaks it out of those spaces, and places it exactly where humans really want to go to analyze our world. It allows an accurate picture of everything. IoT − Disadvantages Though IoT delivers an impressive set of benefits, it also presents a significant set of challenges. Here is a list of some its major issues − • Security − IoT creates an ecosystem of constantly connected devices communicating over networks. The system offers little control despite any security measures. This leaves users exposed to various kinds of attackers. • Privacy − The sophistication of IoT provides substantial personal data in extreme detail without the user's active participation. • Complexity − Some find IoT systems complicated in terms of design, deployment, and maintenance given their use of multiple technologies and a large set of new enabling technologies. • Flexibility − Many are concerned about the flexibility of an IoT system to integrate easily with another. They worry about finding themselves with several conflicting or locked systems. • Compliance − IoT, like any other technology in the realm of business, must comply with regulations. Its complexity makes the issue of compliance seem incredibly challenging when many consider standard software compliance a battle. IoT − Sensors The most important hardware in IoT might be its sensors. These devices consist of energy modules, power management modules, RF modules, and sensing modules. RF modules manage communications through their signal processing, WiFi, ZigBee, Bluetooth, radio transceiver, duplexer, and BAW.
  • 25. The sensing module manages sensing through assorted active and passive measurement devices. Here is a list of some of the measurement devices used in IoT − S.No Devices 1. Accelerometers temperature sensors 2. Magnetometers proximity sensors 3. Gyroscopes image sensors 4. acoustic sensors light sensors 5. pressure sensors gas RFID sensors 6. humidity sensors micro flow sensors
  • 26. 4.3What is an Arduino? Introduction Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package. This is an Arduino Uno The Uno is one of the more popular boards in the Arduino family and a great choice for beginners. We’ll talk about what’s on it and what it can do later in the tutorial.
  • 27. This is a screenshot of the Arduino IDE. Believe it or not, those 10 lines of code are all you need to blink the on-board LED on your Arduino. The code might not make perfect sense right now, but, after reading this tutorial and the many more Arduino tutorials waiting for you on our site, we’ll get you up to speed in no time! What Does it Do? The Arduino hardware and software was designed for artists, designers, hobbyists, hackers, newbies, and anyone interested in creating interactive objects or environments. Arduino can
  • 28. interact with buttons, LEDs, motors, speakers, GPS units, cameras, the internet, and even your smart-phone or your TV! This flexibility combined with the fact that the Arduino software is free, the hardware boards are pretty cheap, and both the software and hardware are easy to learn has led to a large community of users who have contributed code and released instructions for a huge variety of Arduino-based projects. For everything from robots and a heating pad hand warming blanket to honest fortune-telling machines, and even a Dungeons and Dragons dice-throwing gauntlet, the Arduino can be used as the brains behind almost any electronics project. 4.4 What is a breadboard? A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you easily insert electronic components to prototype (meaning to build and test an early version of) an electronic circuit, like this one with a battery, switch, resistor, and an LED (light-emitting diode). To learn more about individual electronic components, see our Electronics Primer. The connections are not permanent, so it is easy to remove a component if you make a mistake, or just start over and do a new project. This makes breadboards great for beginners who are new to electronics. You can use breadboards to make all sorts of fun electronics projects, from
  • 29. different types of robots or an electronic drum set, to an electronic rain detector to help conserve water in a garden, just to name a few. 4.5 How It Works – Ultrasonic Sensor It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance. The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
  • 30. In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The Echo pin will output the time in microseconds the sound wave traveled. For example, if the object is 10 cm away from the sensor, and the speed of the sound is 340 m/s or 0.034 cm/µs the sound wave will need to travel about 294 u seconds. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward
  • 31. and bounce backward. So in order to get the distance in cm we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2. Components needed for this tutorial You can get these components from any of the sites below: • Ultrasonic Sensor HC-SR04……… Amazon / Aliexpress • Arduino Board…………………………. Amazon / Aliexpress • Breadboard and Jump Wires……. Amazon / Aliexpress *Please note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way! Source Codes First you have to define the Trig and Echo pins. In this case they are the pins number 9 and 10 on the Arduino Board and they are named trigPin and echoPin. Then you need a Long variable, named “duration” for the travel time that you will get from the sensor and an integer variable for the distance. In the setup you have to define the trigPin as an output and the echoPin as an Input and also start the serial communication for showing the results on the serial monitor.
  • 32. In the loop first you have to make sure that the trigPin is clear so you have to set that pin on a LOW State for just 2 µs. Now for generating the Ultra sound wave we have to set the trigPin on HIGH State for 10 µs. Using the pulseIn() function you have to read the travel time and put that value into the variable “duration”. This function has 2 parameters, the first one is the name of the echo pin and for the second one you can write either HIGH or LOW. In this case, HIGH means that the pulsIn() function will wait for the pin to go HIGH caused by the bounced sound wave and it will start timing, then it will wait for the pin to go LOW when the sound wave will end which will stop the timing. At the end the function will return the length of the pulse in microseconds. For getting the distance we will multiply the duration by 0.034 and divide it by 2 as we explained this equation previously. At the end we will print the value of the distance on the Serial Monitor. 1. /* 2. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial 3. * 4. * by Dejan Nedelkovski, 5. * www.HowToMechatronics.com 6. * 7. */ 8. 9. // defines pins numbers 10. const int trigPin = 9; 11. const int echoPin = 10; 12. 13. // defines variables 14. long duration; 15. int distance; 16. 17. void setup() { 18. pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output 19. pinMode(echoPin, INPUT); // Sets the echoPin as an Input 20. Serial.begin(9600); // Starts the serial communication 21. } 22. 23. void loop() { 24. // Clears the trigPin 25. digitalWrite(trigPin, LOW); 26. delayMicroseconds(2); 27. 28. // Sets the trigPin on HIGH state for 10 micro seconds 29. digitalWrite(trigPin, HIGH); 30. delayMicroseconds(10); 31. digitalWrite(trigPin, LOW); 32. 33. // Reads the echoPin, returns the sound wave travel time in microseconds 34. duration = pulseIn(echoPin, HIGH); 35. 36. // Calculating the distance 37. distance= duration*0.034/2;
  • 33. 38. 39. // Prints the distance on the Serial Monitor 40. Serial.print("Distance: "); 41. Serial.println(distance); 42. } If you want to display the results from the HC-SR04 Ultrasonic Sensor on an LCD you can use the following source code: 1. /* 2. * Ultrasonic Sensor HC-SR04 and Arduino Tutorial 3. * 4. * by Dejan Nedelkovski, 5. * www.HowToMechatronics.com 6. * 7. */ 8. 9. #include <LiquidCrystal.h> // includes the LiquidCrystal Library 10. 11. LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7) 12. 13. const int trigPin = 9; 14. const int echoPin = 10; 15. 16. long duration; 17. int distanceCm, distanceInch; 18. 19. void setup() { 20. lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display 21. 22. pinMode(trigPin, OUTPUT); 23. pinMode(echoPin, INPUT); 24. } 25. 26. void loop() { 27. digitalWrite(trigPin, LOW); 28. delayMicroseconds(2); 29. 30. digitalWrite(trigPin, HIGH); 31. delayMicroseconds(10); 32. digitalWrite(trigPin, LOW); 33. 34. duration = pulseIn(echoPin, HIGH); 35. distanceCm= duration*0.034/2; 36. distanceInch = duration*0.0133/2; 37. 38. lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed 39. lcd.print("Distance: "); // Prints string "Distance" on the LCD
  • 34. 40. lcd.print(distanceCm); // Prints the distance value from the sensor 41. lcd.print(" cm"); 42. delay(10); 43. lcd.setCursor(0,1); 44. lcd.print("Distance: "); 45. lcd.print(distanceInch); 46. lcd.print(" inch"); 47. delay(10); 48. } 4.6 Arduino - Servo Motor A Servo Motor is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. If the coded signal changes, the angular position of the shaft changes. In practice, servos are used in radio-controlled airplanes to position control surfaces like the elevators and rudders. They are also used in radio- controlled cars, puppets, and of course, robots. Servos are extremely useful in robotics. The motors are small, have built-in control circuitry, and are extremely powerful for their size. A standard servo such as the Futaba S-148 has 42 oz/inches of torque, which is strong for its size. It also draws power proportional to the mechanical load. A lightly loaded servo, therefore, does not consume much energy. The guts of a servo motor is shown in the following picture. You can see the control circuitry, the motor, a set of gears, and the case. You can also see the 3 wires that connect to the outside world. One is for power (+5volts), ground, and the white wire is the control wire.
  • 35. Working of a Servo Motor The servo motor has some control circuits and a potentiometer (a variable resistor, aka pot) connected to the output shaft. In the picture above, the pot can be seen on the right side of the circuit board. This pot allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not correct, it will turn the motor until it is at a desired angle. The output shaft of the servo is capable of traveling somewhere around 180 degrees. Usually, it is somewhere in the 210-degree range, however, it varies depending on the manufacturer. A normal servo is used to control an angular motion of 0 to 180 degrees. It is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear. The power applied to the motor is proportional to the distance it needs to travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small amount, the motor will run at a slower speed. This is called proportional control. HowDoYouCommunicatetheAngleatWhichtheServoShouldTurn? The control wire is used to communicate the angle. The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse Coded Modulation. The servo expects to see a pulse every 20 milliseconds (.02 seconds). The length of the pulse will determine how far the motor turns. A 1.5 millisecond pulse, for example, will make the motor turn to the 90-degree position (often called as the neutral position). If the pulse is shorter than
  • 36. 1.5 milliseconds, then the motor will turn the shaft closer to 0 degrees. If the pulse is longer than 1.5 milliseconds, the shaft turns closer to 180 degrees. Components Required You will need the following components − • 1 × Arduino UNO board • 1 × Servo Motor • 1 × ULN2003 driving IC • 1 × 10 KΩ Resistor Procedure Follow the circuit diagram and make the connections as shown in the image given below.
  • 37. Sketch Open the Arduino IDE software on your computer. Coding in the Arduino language will control your circuit. Open a new sketch File by clicking on New.
  • 38. Arduino Code /* Controlling a servo position using a potentiometer (variable resistor) */ #include <Servo.h> Servo myservo; // create servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); } Code to Note Servo motors have three terminals - power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino. The ground wire is typically black or brown and should be connected to one terminal of ULN2003 IC (10 -16). To protect your Arduino board from damage, you will need some driver IC to do that. Here we have used
  • 39. ULN2003 IC to drive the servo motor. The signal pin is typically yellow or orange and should be connected to Arduino pin number 9. Connecting the Potentiometer A voltage divider/potential divider are resistors in a series circuit that scale the output voltage to a particular ratio of the input voltage applied. Following is the circuit diagram − $$V_{out} = (V_{in} times R_{2})/ (R_{1} + R_{2})$$ Vout is the output potential, which depends on the applied input voltage (Vin) and resistors (R1 and R2) in the series. It means that the current flowing through R1 will also flow through R2 without being divided. In the above equation, as the value of R2 changes, the Vout scales accordingly with respect to the input voltage, Vin. Typically, a potentiometer is a potential divider, which can scale the output voltage of the circuit based on the value of the variable resistor, which is scaled using the knob. It has three pins: GND, Signal, and +5V as shown in the diagram below −
  • 40. Result By changing the pot’s NOP position, servo motor will change its angle. A Stepper Motor or a step motor is a brushless, synchronous motor, which divides a full rotation into a number of steps. Unlike a brushless DC motor, which rotates continuously when a fixed DC voltage is applied to it, a step motor rotates in discrete step angles. The Stepper Motors therefore are manufactured with steps per revolution of 12, 24, 72, 144, 180, and 200, resulting in stepping angles of 30, 15, 5, 2.5, 2, and 1.8 degrees per step. The stepper motor can be controlled with or without feedback. Imagine a motor on an RC airplane. The motor spins very fast in one direction or another. You can vary the speed with the amount of power given to the motor, but you cannot tell the propeller to stop at a specific position. Now imagine a printer. There are lots of moving parts inside a printer, including motors. One such motor acts as the paper feed, spinning rollers that move the piece of paper as ink is being printed on it. This motor needs to be able to move the paper an exact distance to be able to print the next line of text or the next line of an image. There is another motor attached to a threaded rod that moves the print head back and forth. Again, that threaded rod needs to be moved an exact amount to print one letter after another. This is where the stepper motors come in handy.
  • 41. 4.7 Humidity Sensor DHT11 Introduction Humidity Sensor DHT11 Module A humidity sensor senses,measures and regularly reports the relative humidity in the air. It measures both moisture and air temperature.Relative humidity, expressed as a percent, is the ratio of actual moisture in the air to the highest amount of moisture air at that temperature can hold.The warmer the air is, the more moisture it can hold, so relative humidity changes with fluctuations in temperature. Humidity Sensor Humidity sensors detect the relative humidity of the immediate environments in which they are placed. They measure both the moisture and temperature in the air and express relative humidity as a percentage of the ratio of moisture in the air to the maximum amount that can be held in the air at the current temperature. As air becomes hotter, it holds more moisture, so the relative humidity changes with the temperature. Most humidity sensors use capacitive measurement to determine the amount of moisture in the air. This type of measurement relies on two electrical conductors with a non-conductive polymer film laying between them to create an electrical field between them. Moisture from the air collects on the film and causes changes in the voltage levels between the two plates. This change is then converted into a digital measurement of the air’s relative humidity after taking the air temperature into account.For more details,check the datasheet here.
  • 42. How to connect Humidity Sensor with Arduino Uno? Hardware and Software Required • Arduino Uno • Humidity Sensor DHT11 Module • Arduino IDE(1.0.6 version) Hardware Connections The Humidity sensor module has 3 pins.The following connections should be made to connect the sensor module with Arduino. • + to 5V • - to Gnd • Out to Analog 0 pin of Arduino Program for Humidity Sensor The user can download the library file here:File:DHT.zip.Here the program generates the humidity and temperature present in a room as an output in the serial monitor. #include <dht.h> #define dht_dpin A0 dht DHT; void setup() { Serial.begin(9600); } void loop() { DHT.read11(dht_dpin); Serial.print("Current humidity = "); Serial.print(DHT.humidity); Serial.print("% "); Serial.print("temperature = "); Serial.print(DHT.temperature); Serial.println("C "); delay(1000); }
  • 43. 4.8 HOW TO USE ARDUINO I2C SERIAL LCD 16X2 (YELLOW BACKLIGHT) Description Now, with only 3 pins from microcontroller, you can display message on this LCD. Compared to parallel LCD which required at least 6 pins of I/O, this LCD offer more cost effective solution. The LCD display is two lines by 16 characters and provides basic text wrapping so that your text looks right on the display. Feature: 1. 5V powered 2 x 16 character 2. SPI communication 3. Minimum 3 Pins interface to microcontroller 4.Compatible with all types of microcontrollers 5.Suitable for hobbyists and experts 6.Back light and contrast control is available Add TipAsk QuestionCommentDownload Step 1: MATERIAL PREPARATION In this tutorial,the things you are needed as below: 1. I2C Serial LCD 16x2 (Yellow backlight) 2. Arduino Uno Board and USB
  • 44. 3.4 Male-to-Female Jumper Wire Add TipAsk QuestionCommentDownload Step 2: PIN DETAILS You could see the pinout labeled at the back of the module. It has 4 pins that is VCC, GND,SDA and SCL. Add TipAsk QuestionCommentDownload Step 3: PIN CONNECTION Connect I2C Serial LCD Module to Arduino UNO as following : • VCC to 5V • GND to GND • SDA to A4 • SCL to A5 Then, Connect your Arduino UNO Board to your computer via USB Cable. Add TipAsk QuestionCommentDownload Step 4: Library For this tutorial,it is necessary to download and install the "LiquidCrystal_I2C" library.LiquidCrystal_I2C is a library of Arduino which enables serial LCD 16x2 connect with Arduino.To be able to interface the serial LCD with arduino, you will have to download this library and save it into your Arduino's libraries. Download the LiquidCrystal_I2C file below >Go to document >Save the file into your Arduino Uno Library folder. Refer the image above for your references.
  • 45. Attachments • LiquidCrystal_I2C.rar Download Add TipAsk QuestionCommentDownload Step 5: SAMPLE SOURCE CODE To get the result, please download the sample source code which is attached below and upload it into your Arduino. In this tutorial, the Arduino UNO is being used. Attachments • I2C_Hello_World.ino Download Add TipAsk QuestionCommentDownload Step 6: RESULT The LCD will display the text. 4.9 PIR SENSOR What is a PIR Sensor? PIR sensor detects a human being moving around within approximately 10m from the sensor. This is an average value, as the actual detection range is between 5m and 12m.PIR are fundamentally made of a pyro electric sensor, which can detect levels of infrared radiation. For numerous essential projects or items that need to discover when an individual has left or entered the area. PIR sensors are incredible, they are flat control and minimal effort, have a wide lens range, and are simple to interface with. How It Works ?
  • 46. First let’s explain the working principle. The module actually consists of a Pyroelectric sensor which generates energy when exposed to heat. That means when a human or animal body will get in the range of the sensor it will detect a movement because the human or animal body emits heat energy in a form of infrared radiation. That’s where the name of the sensor comes from, a Passive Infra-Red sensor. And the term “passive” means that sensor is not using any energy for detecting purposes, it just works by detecting the energy given off by the other objects. The module also consists a specially designed cover named Fresnel lens, which focuses the infrared signals onto the pyroelectric sensor.
  • 47. The HC-SR501 PIR Sensor Module The module has just three pins, a Ground and a VCC for powering the module and an output pin which gives high logic level if an object is detected. Also it has two potentiometers. One for adjusting the sensitivity of the sensor and the other for adjusting the time the output signal stays high when object is detected. This time can be adjusted from 0.3 seconds up to 5 minutes.
  • 48. The module has three more pins with a jumper between two of them. These pins are for selecting the trigger modes. The first one is called “non-repeatable trigger” and works like this: when the sensor output is high and the delay time is over, the output will automatically change from high to low level. The other mode called “repeatable trigger” will keep the output high all the time until the detected object is present in sensor’s range. Components needed for this tutorial You can get the components from any of the sites below: • HC-SR501 PIR Sensor Module…….. Amazon / Aliexpress • 5V Relay Module………………………….. Amazon / Aliexpress • Arduino Board……………………………… Amazon / Aliexpress • Breadboard and Jump Wires…………. Amazon / Aliexpress • Cable, Plug, Socket • Circuit Schematic As an example for this tutorial I will make a circuit that will turn on a high voltage lamp when the sensor will detect an object. Here’s the circuit schematics. The output pin of the sensor will be connected to pin number 8 on the Arduino Board and when an object will be detected the pin number 7 will activate the relay module and the high voltage lamp will turn on.
  • 49. For more details how the relay module works, you can check my Arduino Relay Tutorial. (Keep in minds that we use high voltage in the example, so you should be very caution, because I don’t take any responsibility of your actions) Source Code Here’s the Arduino Code for this example. It’s quite simple. We just need to define the PIR Sensor pin as input and the relay pin as output. Using the digitalRead() function we will read the output of the sensor and if its high or if an object is detected it will activate the relay. For activating the relay module we will send a logic low as the relay input pin works inversely. 1. /* Arduini PIR Motion Sensor Tutorial 2. * 3. * by Dejan Nedelkovski, www.HowToMechatronics.com 4. * 5. */ 6. int pirSensor = 8; 7. int relayInput = 7; 8. 9. void setup() { 10. pinMode(pirSensor, INPUT); 11. pinMode(relayInput, OUTPUT); 12. }
  • 50. 13. 14. void loop() { 15. int sensorValue = digitalRead(pirSensor); 16. 17. if (sensorValue == 1) { 18. digitalWrite(relayInput, LOW); // The Relay Input works Inversly 19. } 20. } The demonstration of the example can be seen at the end of the video attached above. Note that after powering the sensor module it needs about 20 – 60 seconds to “warm-up” in order to function properly. Now when you will put your hand in front of the sensor the relay will activate the lamp. But note that even if you move your hand constantly the lamp will turn off after the adjusted delay time is over because the PIR sensor is in “non-repeatable trigger” mode. If you change the sensor with the jumper to the “repeatable trigger” mode and you constantly move the hand, the lamp will be constantly on as well and it will turn off after the movement is gone and the set delay time is over. 4.10 LPG Gas Sensor(MQ6) (SKU:SEN0131) The MQ6 Gas Sensor module is useful for gas leakage detection. They are used in gas leakage detecting equipments in home and industry, are suitable for detecting of LPG, iso-butane, propane, LNG, avoid the noise of alcohol , cooking fumes and cigarette smoke. Due to its high sensitivity and response time, measurements can be taken as soon as possible. The sensitivity of the sensor can be adjusted by using the potentiometer. mq-6 FEATURES
  • 51. * High sensitivity to LPG, iso-butane, propane * Small sensitivity to alcohol, smoke. * Fast response . * Stable and long life * Simple drive circuit Connection here are the connections for my sensor Arduino Gas Sensor 5V VCC GND GND NC DO Analog A0 AO Code Source code void setup() { Serial.begin(9600); } void loop() { float sensorVoltage; float sensorValue; sensorValue = analogRead(A0); sensorVoltage = sensorValue/1024*5.0;
  • 52. Serial.print("sensor voltage = "); Serial.print(sensorVoltage); Serial.println(" V"); delay(1000); } Results Again look at the serial monitor, in this case I noticed that it took about 3 minutes for the readings to stabilise, something you may want to factor in sensor voltage = 1.14 V sensor voltage = 1.44 V sensor voltage = 1.71 V sensor voltage = 1.95 V sensor voltage = 2.16 V sensor voltage = 2.32 V sensor voltage = 2.46 V sensor voltage = 2.55 V sensor voltage = 2.56 V sensor voltage = 2.47 V sensor voltage = 2.28 V sensor voltage = 2.08 V sensor voltage = 1.90 V sensor voltage = 1.76 V sensor voltage = 1.63 V sensor voltage = 1.52 V sensor voltage = 1.43 V sensor voltage = 1.34 V sensor voltage = 1.26 V 3 minutes worh of readings sensor voltage = 0.40 V sensor voltage = 0.40 V sensor voltage = 0.40 V sensor voltage = 0.39 V sensor voltage = 0.39 V sensor voltage = 0.39 V sensor voltage = 0.39 V
  • 53. 4.11 Extract, transform, and load (ETL) Extract, transform, and load (ETL) is a data pipeline used to collect data from various sources, transform the data according to business rules, and load it into a destination data store. The transformation work in ETL takes place in a specialized engine, and often involves using staging tables to temporarily hold data as it is being transformed and ultimately loaded to its destination. The data transformation that takes place usually involves various operations, such as filtering, sorting, aggregating, joining data, cleaning data, deduplicating, and validating data.
  • 54.
  • 55. Often, the three ETL phases are run in parallel to save time. For example, while data is being extracted, a transformation process could be working on data already received and prepare it for loading, and a loading process can begin working on the prepared data, rather than waiting for the entire extraction process to complete. Relevant Azure service: • Azure Data Factory v2 Other tools: • SQL Server Integration Services (SSIS) Extract, load, and transform (ELT) Extract, load, and transform (ELT) differs from ETL solely in where the transformation takes place. In the ELT pipeline, the transformation occurs in the target data store. Instead of using a separate transformation engine, the processing capabilities of the target data store are used to transform data. This simplifies the architecture by removing the transformation engine from the pipeline. Another benefit to this approach is that scaling the target data store also scales the ELT pipeline performance. However, ELT only works well when the target system is powerful enough to transform the data efficiently. Typical use cases for ELT fall within the big data realm. For example, you might start by extracting all of the source data to flat files in scalable storage such as Hadoop distributed file system (HDFS) or Azure Data Lake Store. Technologies such as Spark, Hive, or PolyBase can
  • 56. then be used to query the source data. The key point with ELT is that the data store used to perform the transformation is the same data store where the data is ultimately consumed. This data store reads directly from the scalable storage, instead of loading the data into its own proprietary storage. This approach skips the data copy step present in ETL, which can be a time consuming operation for large data sets. In practice, the target data store is a data warehouse using either a Hadoop cluster (using Hive or Spark) or a SQL Data Warehouse. In general, a schema is overlaid on the flat file data at query time and stored as a table, enabling the data to be queried like any other table in the data store. These are referred to as external tables because the data does not reside in storage managed by the data store itself, but on some external scalable storage. The data store only manages the schema of the data and applies the schema on read. For example, a Hadoop cluster using Hive would describe a Hive table where the data source is effectively a path to a set of files in HDFS. In SQL Data Warehouse, PolyBase can achieve the same result — creating a table against data stored externally to the database itself. Once the source data is loaded, the data present in the external tables can be processed using the capabilities of the data store. In big data scenarios, this means the data store must be capable of massively parallel processing (MPP), which breaks the data into smaller chunks and distributes processing of the chunks across multiple machines in parallel. The final phase of the ELT pipeline is typically to transform the source data into a final format that is more efficient for the types of queries that need to be supported. For example, the data may be partitioned. Also, ELT might use optimized storage formats like Parquet, which stores row-oriented data in a columnar fashion and providess optimized indexing. Relevant Azure service: • Azure SQL Data Warehouse • HDInsight with Hive • Azure Data Factory v2 • Oozie on HDInsight Other tools: • SQL Server Integration Services (SSIS) Data flow and control flow In the context of data pipelines, the control flow ensures orderly processing of a set of tasks. To enforce the correct processing order of these tasks, precedence constraints are used. You can think of these constraints as connectors in a workflow diagram, as shown in the image below. Each task has an outcome, such as success, failure, or completion. Any subsequent task does not initiate processing until its predecessor has completed with one of these outcomes.
  • 57. Control flows execute data flows as a task. In a data flow task, data is extracted from a source, transformed, or loaded into a data store. The output of one data flow task can be the input to the next data flow task, and data flowss can run in parallel. Unlike control flows, you cannot add constraints between tasks in a data flow. You can, however, add a data viewer to observe the data as it is processed by each task. In the diagram above, there are several tasks within the control flow, one of which is a data flow task. One of the tasks is nested within a container. Containers can be used to provide structure to tasks, providing a unit of work. One such example is for repeating elements within a collection, such as files in a folder or database statements. Relevant Azure service: • Azure Data Factory v2 Other tools: • SQL Server Integration Services (SSIS) Technology choices • Online Transaction Processing (OLTP) data stores • Online Analytical Processing (OLAP) data stores • Data warehouses • Pipeline orchestration
  • 58. CHAPTER 5 Smart Packaging - Intelligent Packaging for Food, Beverages, Pharmaceuticals and Household Products Background What have these three scenarios got in common? The tin of baked beans that urges you to buy it as you pass along the supermarket aisles (assuming you still shop for goods and they are not all delivered via the internet), the smart microwave that has your steaming plate of lasagne ready the moment you arrive, following a mobile call to your smart home on the way borne (assuming you still go out to work), and the pill bottle that alerts the health centre if an elderly relative forgets their medication. They are all visions of a future in which the package does more than just contain and protect its contents - it plays an active and sometimes ‘Intelligent’ role in adding functionality to the product itself, or to aspects of product consumption, convenience or security. Smartness in Packaging ‘Smartness’ in packaging is a broad term that covers a number of functionalities, depending on the product being packaged, including food, beverage, pharmaceutical, household products etc. Examples of current and future functional ‘smartness’ would be in packages that • Retain integrity and actively prevent food spoilage (shelf-life) • Enhance product attributes (e.g. look, taste, flavour, aroma etc) • Respond actively to changes in product or package environment • Communicate product information, product history or condition to user • Assist with opening and indicate seal Integrity • Confirm product authenticity, and act to counter theft. Smart Packaging and Activated Packaging
  • 59. There is an important distinction between package functions that are smart/Intelligent, and those that become active in response to a triggering event, for example, filling, exposure to UV, release of pressure etc and then continue until the process is exhausted. Some smart packaging already exists commercially and many other active and intelligent packaging concepts are under development, table 1. A good example of active packaging is the highly successful foam- producing ‘widget’ in a metal can of beer. Another is the oxygen scavenging MAR technology patented by CMB Packaging Technology (now Crown Cork & Seal). Table 1. Smart packaging under development. Active Intelligent • Oxygen scavenging • Anti-microbial • Ethylene scavenging • Heating/cooling • Odour and flavour absorbing/releasing • Moisture absorbing • Time-temperature history • Microbial growth indicators • Light protection (photochromic) • Physical shock indicators • Leakage, microbial spoilage indicating How Activated Packaging Systems Work This consists of a matrix polymer, such as PET, an oxygen scavenging/absorbing component and a catalyst. The oxygen-scavenging component is a nylon polymer (MXD6) melt blended with the PET at around the 5% level. The catalyst is a cobalt salt added at a low concentration (less than 200ppm) that triggers the oxidation of the MXD6. The OXBAR system remains active for periods of up to two years providing protection to oxygen sensitive products such as beer, wine, fruit juice and mayonnaise throughout their shelf-lives. Active food packaging systems using oxygen scavenging and anti-microbial technologies (e.g. sorbate-releasing LDPE film for
  • 60. cheese) have the potential to extend the shelf-life of perishable foods while at the same time improving their quality by reducing the need for additives and preservatives. How Intelligent Packaging Works In ‘intelligent’ packaging, the package function switches on and off in response to changing external/internal conditions, and can include a communication to the customer or end user as to the status of the product. A simple definition of intelligent packaging is ‘packaging which senses and informs’, and nowhere does this generate a more potent vision than within the smart home of the future. Factors That Will Aid the Growth of Intelligent Packaging Consumer and societal factors are likely to drive the adoption of smart packaging in the future. The growing need for information on packaging will mean there has to be a step change in providing this information. Consumers increasingly need to know what ingredients or components are in the product and how the product should be stored and used. Intelligent labelling and printing, for example, will be capable of communicating directly to the customer via thin film devices providing sound and visual information, either in response to touch, motion or some other means of scanning or activation. Voice-activated safety and disposal instructions contained on household and pharmaceutical products will be used to tell the consumer how they should be disposed of after consumption - information that can be directly used in the recycling industry to help sort packaging materials from waste streams. Drug delivery systems in smart packaging will be programmed to communicate patient information back to healthcare centres. Quality Assurance Using Intelligent Labels Another important need is for consumer security assurance, particularly for perishable food products. The question as to whether, for example, a chilled ready-meal is safe to use or consume is currently answered by ‘best by’ date stamping. However, this does not take into account whether the product has inadvertently been exposed to elevated temperatures during storage or transportation. In the future, microbial growth and temperature-time visual indicators based on physical, chemical or enzymatic activity in the food will give a clear, accurate and unambiguous indication of product quality, safety and shelf-life condition. As an example, COX Technologies has developed a colour indicating tag that is attached as a small adhesive label to the outside of
  • 61. packaging film, which monitors the freshness of seafood products. A barb on the backside of the tag penetrates the packaging film and allows the passage of volatile amines, generated by spoilage of the seafood. These are wicked passed a chemical sensor that turns FreshTag progressively bright pink as the seafood ages, figure 1. Figure 1. Colour indicating tags attached as a small adhesive label to the outside of packaging film can be used to monitor the freshness of perishable food products such as seafood Intelligent Packaging for Fresh Fruit and Vegetables Fresh-cut produce continues to be one of the fastest growing segments of food retailing and while conventional film packaging is suitable for lettuce and prepared salads, it cannot cope with the high respiration rates of pre-cut vegetables and fruit, leading to early product deterioration. In the USA, novel breatheable polymer films are already in commercial use for fresh-cut vegetables and fruit. Landec Corporation supplies Intellipac packaging films that are acrylic side-chain crystallisable polymers tailored to change phase reversibly at various temperatures from 0-68°C. As the side-chain components melt, gas permeation increases dramatically, and by further tailoring the package and materials of construction, it is possible to fine tune the carbon dioxide to oxygen permeation ratios for particular products. The final package is ‘smart’ because it automatically regulates oxygen ingress and carbon dioxide egress by transpiration according to the prevailing temperature. In this way, an optimum atmosphere is maintained around the product during storage and distribution, extending freshness and allowing shipping of higher quality products to the consumer. Self-Heating and Self-Chilling Packaging Improved convenience is a value-added function that customers are likely to pay extra for as lifestyles change. Self-heating packages, for soup and coffee, for example, and self-cooling containers for beer and soft drinks have been under active development for more than a decade,
  • 62. but have yet to achieve commercial status. However, Crown Cork & Seal is pioneering the development of a self-chilling beverage can in conjunction with Tempra Technologies and development is nearing completion. The Crown/Tempra technology uses the latent heat of evaporating water to produce the cooling effect. The water is bound in a gel layer coating a separate container within the beverage can, and is in close thermal contact with the beverage. The consumer twists the base of the can to open a valve, exposing the water to the desiccant held in a separate, evacuated external chamber This initiates evaporation of the water at room temperature. The unit has been designed to meet a target specification set by major beverage customers cooling 300ml of beverage in a 355ml can by 16.7°C in three minutes. This performance level has been achieved in laboratory tests and working samples are currently undergoing focus group trials with customers. Thermochromic Labelling Give a self-heating or self-cooling container a sensor to tell the consumer it is at the correct temperature and the package becomes ‘smart’ (such packaging is currently under development). The most common use a thermochromic ink dot to indicate the product is at the correct serving temperature following refrigeration or microwave heating. Plastic containers of pouring syrup for pancakes can be purchased in the USA that are labelled with a thermochromic ink dot to indicate that the syrup is at the right temperature following microwave heating. Similar examples can be found on supermarket shelves with beer bottle labels that incorporate thermochromic-based designs to inform the consumer when a refrigerated beer is cold enough to drink. Smart Packaging Concepts for Pharmaceuticals Smart packaging concepts that improve case of use could include ‘dial-a-dose’ smart caps and closures that allow the safe dispensing of exact controlled quantities of product, e.g. pharmaceuticals, cleaning materials, and other potentially hazardous materials. Already a prescription drug bottle with bottle cap alarm is available - it beeps to alert users when it is time to take the medication, and it displays how many times the bottle has been opened and the intervals between openings. The bottle can be connected via a modem to the healthcare centre for the automatic transmission of drug usage and, if necessary, provide feedback to the patient if not in compliance. Eventually, programmed skin patches using smart gels that rely on changes in skin properties to trigger drug delivery could replace conventional pill-taking medication.
  • 63. Intelligent Tamper-Proof Packaging Knowing whether a package has been tampered with is equally important to consumers. Tamper evidence technologies that cannot easily be replicated, e.g. based on optically variable films or gas sensing dyes, involving irreversible colour changes, will become more widespread and cost- effective for disposable packaging of commodity items. Piezoelectric polymeric materials might be incorporated into package construction so that the package changes colour at a certain stress threshold. In this way, a 'self-bruising' closure on a bottle or jar might indicate that attempts had been made to open it. Easier to Open Packaging Easier to open packaging will be a paramount feature of future packaging. A recent DTI survey showed that in the UK in 1997, 90,964 accidents requiring hospital treatment were packaging related. The focus will be on better design (size, shape, etc.) and the optimum use of materials, to produce easy to open packages consistent with the strength capabilities of an ageing population. Developments in low peel-force adhesives and structures, even smart packages that are self- opening, e.g. based on shape memory alloys (the metal ‘rubber’ band), can be envisaged. Possible Concerns over Intelligent Packaging When it comes to the environment, consumer attitudes towards packaging are generally confused and contradictory. There are increasing concerns about the amount of waste created by packaging, but the growth of more elaborate and attractive packaging is being driven by consumers to fuel our desire for convenience and feed our lifestyle choices. Ultimately, future consumers could react negatively to the perception of increased waste and lack of recyclability of disposable smart packages. The perception of extra cost and complexity, and the possible mistrust/confusion of technology - for example, if there is both a date stamp and a visual indicator on a food pack, which does the customer take note of? - are further factors that could slow widespread market introduction of smart packages. The overall acceptance barriers to smart packaging can be summed up as: • Extra cost - can it be absorbed/passed on to consumer? • Unreliability of indicating devices - showing either food to be safe when it is not (potential
  • 64. liability?) or food to be unsafe when it is (increased spoilage stock loss) • Food safety and regulatory issues - e.g. possible migration issues of complex packaging materials into product • Recycling features and environmental regulations. What Areas will Benefit from Intelligent Packaging First? Cost issues will probably mean that early adopters of smart packaging are likely to be in non- commodity products, e.g. pharmaceuticals, health and beauty, and packaging that plays a part in lifestyle and leisure activities. A further consideration is the need for education to reassure the consumer of package safety, and ensure against incorrect operation and mistrust of smart technology. The successful adoption of smart packaging concepts in the future must create advantages for the whole of the supply chain. The Future for Packaging The vision of the future of packaging, according to the recently published Foresight report ‘Materials: Shaping Our Society’, is one in which the package will increasingly operate as a smart system incorporating both smart and conventional materials, adding value and benefits across the packaging supply chain. For smart materials to be adopted in packaging, they need to be inexpensive relative to the value of the product, reliable, accurate, reproducible in their range of operation, and environmentally benign and food contact safe. Lessons in Packaging Learned from Nature Perfect packaging exists in nature - examples include the banana and the egg, together with the many smart materials and systems that control plant and biological functions. Learning from Nature to solve engineering problems (biomimetics) is not new, although the term itself is. In 1850, Joseph Paxton gained his inspiration for the design of the Crystal Palace in London from a study of the structure of the lilypad, Victoria amazonica. At the Centre for Biomimetics at the University of Reading, researchers are studying expanded starch in the search for a sustainable alternative to polystyrene, used extensively in the secondary packaging of consumer goods. Another team is looking at smart fabrics by examining polymer analogues to plant leaf structures
  • 65. controlling respiration, or humidity control, based on the opening and closing of pine cones. Research groups at other institutions are studying how helmet design could give improved head protection by looking at the energy absorbing properties of the hazelnut shell and the skull of the woodpecker. A spin-off application is in the packaging and transportation of fragile goods. Animals and plants have evolved many successful structural and functional mechanisms and increasing our study of biological materials and systems will almost certainly yield promising engineering concepts applicable to smart packaging. Packaging in the future could indeed be ‘smart by name, smart by Nature!’ CHAPTER 6 6.1 JAVA Definition - What does Java mean? Java is a programming language that produces software for multiple platforms. When a programmer writes a Java application, the compiled code (known as bytecode) runs on most operating systems (OS), including Windows, Linux and Mac OS. Java derives much of its syntax from the C and C++ programming languages. Java was developed in the mid-1990s by James A. Gosling, a former computer scientist with Sun Microsystems. 6.2 Features of Java The main objective of Java programming language creation was to make it portable, simple and secure programming language. Apart from this, there are also some awesome features which play important role in the popularity of this language. The features of Java are also known as java buzzwords. A list of most important features of Java language are given below.
  • 66. 1. Simple 2. Object-Oriented 3. Portable 4. Platform independent 5. Secured 6. Robust 7. Architecture neutral 8. Interpreted 9. High Performance 10. Multithreaded 11. Distributed 12. Dynamic
  • 67. Simple Java is very easy to learn and its syntax is simple, clean and easy to understand. According to Sun, Java language is a simple programming language because: o Java syntax is based on C++ (so easier for programmers to learn it after C++). o Java has removed many confusing and rarely-used features e.g. explicit pointers, operator overloading etc. o There is no need to remove unreferenced objects because there is Automatic Garbage Collection in java. Object-oriented Java is object-oriented programming language. Everything in Java is an object. Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour. Object-oriented programming (OOPs) is a methodology that simplifies software development and maintenance by providing some rules. Basic concepts of OOPs are: 1. Object 2. Class 3. Inheritance 4. Polymorphism 5. Abstraction 6. Encapsulation
  • 68. Platform Independent Java is platform independent because it is different from other languages like C, C++ etc. which are compiled into platform specific machines while Java is a write once, run anywhere language. A platform is the hardware or software environment in which a program runs. There are two types of platforms software-based and hardware-based. Java provides software- based platform. The Java platform differs from most other platforms in the sense that it is a software-based platform that runs on the top of other hardware-based platforms. It has two components: 1. Runtime Environment 2. API(Application Programming Interface) Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java code is compiled by the compiler and converted into bytecode. This bytecode is a platform- independent code because it can be run on multiple platforms i.e. Write Once and Run Anywhere(WORA).
  • 69. Secured Java is best known for its security. With Java, we can develop virus-free systems. Java is secured because: o No explicit pointer o Java Programs run inside virtual machine sandbox
  • 70.
  • 71. o Classloader: Classloader in Java is a part of the Java Runtime Environment(JRE) which is used to dynamically load Java classes into the Java Virtual Machine. It adds security by separating the package for the classes of the local file system from those that are imported from network sources. o Bytecode Verifier: It checks the code fragments for illegal code that can violate access right to objects. o Security Manager: It determines what resources a class can access such as reading and writing to the local disk. These security are provided by java language. Some security can also be provided by application developer through SSL, JAAS, Cryptography etc. Robust Robust simply means strong. Java is robust because: o It uses strong memory management. o There are lack of pointers that avoids security problems. o There is automatic garbage collection in java which runs on the Java Virtual Machine to get rid of objects which are not being used by a Java application anymore. o There is exception handling and type checking mechanism in java. All these points makes java robust. Architecture-neutral Java is architecture neutral because there is no implementation dependent features e.g. size of primitive types is fixed. In C programming, int data type occupies 2 bytes of memory for 32-bit architecture and 4 bytes of memory for 64-bit architecture. But in java, it occupies 4 bytes of memory for both 32 and 64 bit architectures. Portable Java is portable because it facilitates you to carry the java bytecode to any platform. It doesn't require any type of implementation.
  • 72. High-performance Java is faster than other traditional interpreted programming languages because Java bytecode is "close" to native code. It is still a little bit slower than a compiled language (e.g. C++). Java is an interpreted language that is why it is slower than compiled languages e.g. C, C++ etc. Distributed Java is distributed because it facilitates users to create distributed applications in java. RMI and EJB are used for creating distributed applications. This feature of Java makes us able to access files by calling the methods from any machine on the internet. Multi-threaded A thread is like a separate program, executing concurrently. We can write Java programs that deal with many tasks at once by defining multiple threads. The main advantage of multi- threading is that it doesn't occupy memory for each thread. It shares a common memory area. Threads are important for multi-media, Web applications etc. Dynamic Java is a dynamic language. It supports dynamic loading of classes. It means classes are loaded on demand. It also supports functions from its native languages i.e. C and C++. Java supports dynamic compilation and automatic memory management (garbage collection). 6.3 ArrayList in Java ArrayList is a part of collection framework and is present in java.util package. It provides us dynamic arrays in Java. Though, it may be slower than standard arrays but can be helpful in programs where lots of manipulation in the array is needed. ▪ ArrayList inherits AbstractList class and implements List interface. ▪ ArrayList is initialized by a size, however the size can increase if collection grows or shrunk if objects are removed from the collection. ▪ Java ArrayList allows us to randomly access the list. ▪ ArrayList can not be used for primitive types, like int, char, etc. We need a wrapper class for such cases (see this for details). ▪ ArrayList in Java can be seen as similar to vector in C++.
  • 73. Now primarily the Java ArrayList can constitute of both Constructors and Methods. Below mentioned is a list of few constructors and methods along with there use and functions. Constructors in Java ArrayList: 1. ArrayList(): This constructor is used to build an empty array list 2. ArrayList(Collection c): This constructor is used to build an array list initialized with the elements from collection c 3. ArrayList(int capacity): This constructor is used to build an array list with initial capacity being specified Let us look at the code to create generic ArrayList- // Creating generic integer ArrayList ArrayList<Integer> arrli = new ArrayList<Integer>(); // Java program to demonstrate working of ArrayList in Java import java.io.*; import java.util.*; class arrayli { public static void main(String[] args)
  • 74. throws IOException { // size of ArrayList int n = 5; //declaring ArrayList with initial size n ArrayList<Integer> arrli = new ArrayList<Integer>(n); // Appending the new element at the end of the list for (int i=1; i<=n; i++) arrli.add(i); // Printing elements System.out.println(arrli); // Remove element at index 3 arrli.remove(3); // Displaying ArrayList after deletion System.out.println(arrli); // Printing elements one by one for (int i=0; i<arrli.size(); i++) System.out.print(arrli.get(i)+" "); } } Output: [1, 2, 3, 4, 5] [1, 2, 3, 5]
  • 75. 1 2 3 5 enum in Java Enumerations serve the purpose of representing a group of named constants in a programming language. For example the 4 suits in a deck of playing cards may be 4 enumerators named Club, Diamond, Heart, and Spade, belonging to an enumerated type named Suit. Other examples include natural enumerated types (like the planets, days of the week, colors, directions, etc.). Enums are used when we know all possible values at compile time, such as choices on a menu, rounding modes, command line flags, etc. It is not necessary that the set of constants in an enum type stay fixed for all time. In Java (from 1.5), enums are represented using enum data type. Java enums are more powerful than C/C++ enums . In Java, we can also add variables, methods and constructors to it. The main objective of enum is to define our own data types(Enumerated Data Types). Declaration of enum in java : ▪ Enum declaration can be done outside a Class or inside a Class but not inside a Method. // A simple enum example where enum is declared // outside any class (Note enum keyword instead of // class keyword) enum Color { RED, GREEN, BLUE; } public class Test { // Driver method public static void main(String[] args) { Color c1 = Color.RED; System.out.println(c1); } } ▪ Run on IDE ▪ Output :
  • 76. ▪ RED // enum declaration inside a class. public class Test { enum Color { RED, GREEN, BLUE; } // Driver method public static void main(String[] args) { Color c1 = Color.RED; System.out.println(c1); } } ▪ Run on IDE ▪ Output : ▪ ▪ RED 6.5 Anonymous Classes Anonymous classes enable you to make your code more concise. They enable you to declare and instantiate a class at the same time. They are like local classes except that they do not have a name. Use them if you need to use a local class only once. This section covers the following topics:
  • 77. • Declaring Anonymous Classes • Syntax of Anonymous Classes • Accessing Local Variables of the Enclosing Scope, and Declaring and Accessing Members of the Anonymous Class • Examples of Anonymous Classes Declaring Anonymous Classes While local classes are class declarations, anonymous classes are expressions, which means that you define the class in another expression. The following example,HelloWorldAnonymousClasses, uses anonymous classes in the initialization statements of the local variables frenchGreeting and spanishGreeting, but uses a local class for the initialization of the variable englishGreeting: public class HelloWorldAnonymousClasses { interface HelloWorld { public void greet(); public void greetSomeone(String someone); } public void sayHello() { class EnglishGreeting implements HelloWorld { String name = "world"; public void greet() { greetSomeone("world"); } public void greetSomeone(String someone) { name = someone; System.out.println("Hello " + name); } } HelloWorld englishGreeting = new EnglishGreeting(); HelloWorld frenchGreeting = new HelloWorld() { String name = "tout le monde"; public void greet() { greetSomeone("tout le monde"); } public void greetSomeone(String someone) { name = someone; System.out.println("Salut " + name); }
  • 78. }; HelloWorld spanishGreeting = new HelloWorld() { String name = "mundo"; public void greet() { greetSomeone("mundo"); } public void greetSomeone(String someone) { name = someone; System.out.println("Hola, " + name); } }; englishGreeting.greet(); frenchGreeting.greetSomeone("Fred"); spanishGreeting.greet(); } public static void main(String... args) { HelloWorldAnonymousClasses myApp = new HelloWorldAnonymousClasses(); myApp.sayHello(); } } Syntax of Anonymous Classes As mentioned previously, an anonymous class is an expression. The syntax of an anonymous class expression is like the invocation of a constructor, except that there is a class definition contained in a block of code. Consider the instantiation of the frenchGreeting object: HelloWorld frenchGreeting = new HelloWorld() { String name = "tout le monde"; public void greet() { greetSomeone("tout le monde"); } public void greetSomeone(String someone) { name = someone; System.out.println("Salut " + name); } }; The anonymous class expression consists of the following: • The new operator