An event-driven program relies on events to trigger responses rather than actively polling for user input. Older programs used polling which involved continuously checking for user actions in a loop, wasting CPU resources. Event-driven programs address this by using listeners that wait passively for events from sources like user interactions. When an event occurs, the appropriate listener receives and handles the event without wasting resources on empty polling loops.
Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters.
Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow “a type or method to operate on objects of various types while providing compile-time type safety”
The Java collections framework supports generics to specify the type of objects stored in a collection instance.
This presentation gives introduction to ADO.Net.
Basic introduction to connected & Disconnected architecture.
and explain the each every component in Ado.net
JSP technology has facilitated the segregation of the work of a Web designer and a Web developer.
A Web designer can design and formulate the layout for the Web page by using HTML.
On the other hand, a Web developer working independently can use java code and other JSP specific tags to code the business logic.
The simultaneous construction of the static and dynamic content facilitates development of quality applications with increased productivity.
“The .NET Framework class library is a library of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which .NET Framework applications, components, and controls are built.”
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
The lecture was condcuted by Tushar B Kute at YCMOU, Nashik through VLC orgnanized by MSBTE. The contents can be found in book "Core Java Programming - A Practical Approach' by Laxmi Publications.
Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters.
Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow “a type or method to operate on objects of various types while providing compile-time type safety”
The Java collections framework supports generics to specify the type of objects stored in a collection instance.
This presentation gives introduction to ADO.Net.
Basic introduction to connected & Disconnected architecture.
and explain the each every component in Ado.net
JSP technology has facilitated the segregation of the work of a Web designer and a Web developer.
A Web designer can design and formulate the layout for the Web page by using HTML.
On the other hand, a Web developer working independently can use java code and other JSP specific tags to code the business logic.
The simultaneous construction of the static and dynamic content facilitates development of quality applications with increased productivity.
“The .NET Framework class library is a library of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which .NET Framework applications, components, and controls are built.”
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
The lecture was condcuted by Tushar B Kute at YCMOU, Nashik through VLC orgnanized by MSBTE. The contents can be found in book "Core Java Programming - A Practical Approach' by Laxmi Publications.
Java Programming :Event Handling(Types of Events)simmis5
Event Handling is the mechanism that controls the event and decides what should happen if an event occurs. This mechanism have the code which is known as event handler that is executed when an event occurs. Java Uses the Delegation Event Model to handle the events.
Mobile Application Development, EVENT HANDLING
Android -Event Handling
•Event Listeners−An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI.
•Event Listeners Registration−Event Registration is the process by which an Event Handler gets registered with an Event Listener so that the handler is called when the Event Listener fires the event.
•Event Handlers−When an event happens and we have registered an event listener for the event, the event listener calls the Event Handlers, which is the method that actually handles the event.
Event Handlers
#MobileApplicationDevelopment
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Home assignment II on Spectroscopy 2024 Answers.pdf
Event handling in Java(part 1)
1.
2. Why Does a Program or Application Need to
be Event Driven?
Before event handling came into the picture, a program had to collect all the user
information itself to know what it was doing at a given point in time.
This means that after being run or initialized, a program was always in a big repeat loop that
was waiting for the user to do something.
So, the program was looking for any action – from the press of a button to slider movement.
After it came to know that something has happened from the user’s side, it prepared itself to
deliver the appropriate response. This is referred to as polling.
Although polling gets the job done, more often than not, it comes across as too
unmanageable and time-consuming a task.
3. If we consider using it for modern-day applications, it doesn’t really fit the
requirements. Two primary reasons make polling unsuitable for modern
applications –
1.Polling puts all the code inside the big repeat loop, and the interactions
that take place inside this location are too complex.
2.Also, polling makes a program enter a never-ending loop, which results in the
exhaustion of CPU cycles without any guarantee of action coming from the user.
The Abstract Window Toolkit or AWT has gone ahead and struck
association with a different working model for solving the issue discussed
above. This new model is event-driven programming.
.
4. With AWT, there is no need for the program to look out for user-
generated events. It is the Java run time that does this job. It
intimates the program as soon as an event takes place. It saves a
valuable resource from exhaustion and handles user interaction
better.
Abstract Window Toolkit (AWT) is a set of application
program interfaces used by Java programmers to create
graphical user interface ( GUI ) objects, such as buttons, scroll
bars, and windows
5. Event Handling
Event Handling is the mechanism that controls the event &
decides what should happen if an event occurs.
Chain of Responsibility
Delegation Event Model
6. In the old days, Java used a Chain of Responsibility pattern
to process events.
For example, when a button is clicked, a event is
generated, which then is passed through a chain of
components.
The chain of components is defined by the hierarchy of
classes and interfaces. An event is caught and handled
by the handler class.
This mechanism was used by Java version 1.0, which
this required components to receive events that they did
not process & it wasted valuable time.
The delegation event modeleliminates
this overhead.(Java version 1.1 onwards)
7. The Delegation Event Model
The delegation event model defines standard and consistent mechanisms to generate
and process events.
Principle:
A source generates an event and sends it to one or more listeners.
The listener waits until it receives an event.
Once an event is received, the listener processes the event and then returns.
Advantage:
The application logic that processes events is cleanly separated from the user
interface logic that generates those events.
A user interface element is able to “delegate” the processing of an event to a separate
piece of code.
In the delegation event model, listeners must register with a source in order to
receive an event notification.
8. Event
Changing the state of an object is known as an event.
They are external effects that are controlled by the user
For example, click on button, dragging mouse etc.
The event object is used to carry the required information about the
state change.
When we click on the "click me" button an event is generated; that
change event generates another frame that shows our message, that
is passed to the program.
9. When you press a button in your program or Android
application the state of the button changes from ‘Unclicked’
to ‘Clicked’. This change in the state of our button is called
an Event.
10. Types of Event
1. Foreground Events
Those events which require the direct interaction of user.
They are generated as consequences of a person interacting with
the graphical components in Graphical User Interface.
For example, clicking on a button, moving the mouse, entering a
character through keyboard,selecting an item from list, scrolling
the page etc.
Foreground Events
Background Events
11. 2.Background Events
Those events that require the interaction of end user are
known as background events.
Operating system interrupts, hardware or software
failure, timer expires, an operation completion are the
example of background events.
12. Event Sources
A source is an object that generates an event
Event Sources are responsible for generating events and are
called components.
It also provides information about the event to the listener
Event sources could be anything from text boxes and combo
boxes to buttons, and more
Sources may generate more than one type of event
13.
14. Listeners
A listener is an object that listens to the event. A listener gets
notified when an event occurs
Events are handled by a special group of interfaces, known as
"listeners".
Listeners are also called as event handlers as they are the ones
responsible to handle events occurring at the source.
Listeners are interfaces and different types of listeners are used
according to the event
It has two major requirements. First, it must have been
registered with one or more sources to receive notifications
about specific types of events.
Second, it must implement methods to receive and process
these notifications.
15. Here is the general form
public void addTypeListener(TypeListener el)
For example:
Button b=new Button("click me");
b.addActionListener(this);
Here, type is the name of the event, and el is a reference to the
event listener.
For example, the method that registers a keyboard event listener is
called addKeyListener().
The method that registers a mouse motion listener is called
addMouseMotionListener().
When an event occurs, all registered listeners are notified and receive
a copy of the event object. This is known as multicasting the event.
In all cases, notifications are sent only to listeners that register to
receive them
16. A source must also provide a method that allows a listener to
unregister an interest in a specific type of event. The general form
of such a method is this:
Public void removeTypeListener(TypeListener el)
Here, type is an object that is notified when an event listener. For
example, to remove a keyboard listener, you would call
removeKeyListener()
17. Important Event Classes and Interface
EVENT CLASSES DESCRIPTION LISTENER INTERFACE
ActionEvent generated when button is
pressed, menu-item is selected,
list-item is double clicked
ActionListener
MouseEvent generated when mouse is
dragged,
moved,clicked,pressed or
released and also when it
enters or exit a component
MouseListener
KeyEvent generated when input is
received from keyboard
KeyListener
ItemEvent generated when check-box or
list item is clicked
ItemListener
TextEvent generated when value of
textarea or textfield is changed
TextListener
MouseWheelEvent generated when mouse wheel
is moved
MouseWheelListener
18. WindowEvent generated when window is
activated, deactivated,
deiconified, iconified,
opened or closed
WindowListener
ComponentEvent generated when
component is hidden,
moved, resized or set
visible
ComponentListener
ContainerEvent generated when
component is added or
removed from container
ContainerListener
AdjustmentEvent generated when scroll bar
is manipulated
AdjustmentListener
FocusEvent generated when
component gains or loses
keyboard focus
FocusListener
20. How Events are handled ?
A source generates an Event and send it to one or more listeners
registered with the source. Once event is received by the listener,
they process the event and then return.
Each type of event has its own registration method
21. Steps to handle events:
Implement appropriate interface in the class.
Register the component with the listener
Registration Methods
For registering the component with the Listener, many classes
provide the registration methods
22. For example:
Button
public void addActionListener(ActionListener a){}
MenuItem
public void addActionListener(ActionListener a){}
TextField
public void addActionListener(ActionListener a){}
public void addTextListener(TextListener a){}
TextArea
public void addTextListener(TextListener a){}
Checkbox
public void addItemListener(ItemListener a){}
Choice
public void addItemListener(ItemListener a){}
List
public void addActionListener(ActionListener a){}
public void addItemListener(ItemListener a){}