archive-edu.com » EDU » H » HWS.EDU

Total: 727

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Javanotes 7.0, Chapter 11 -- Advanced Input/Output: Streams, Files, and Networking
    interface or a command line interface But the user is only one possible source of information and only one possible destination for information We have already encountered one other type of input output since TextIO can read data from files and write data to files However Java has an input output framework that provides much more power and flexibility than does TextIO and that covers other kinds of I O in addition to files Most importantly it supports communication over network connections In Java the most common type of input output involving files and networks is based on streams which are objects that support I O commands that are similar to those that you have already used In fact standard output System out and standard input System in are examples of streams Working with files and networks requires familiarity with exceptions which were covered in Section 8 3 Many of the subroutines that are used can throw checked exceptions which require mandatory exception handling This generally means calling the subroutine in a try catch statement that can deal with the exception if one occurs Effective network communication also requires the use of threads which will be covered in Chapter 12

    Original URL path: http://math.hws.edu/javanotes/c11/index.html (2016-02-07)
    Open archived version from archive


  • Javanotes 7.0, Chapter 12 -- Threads and Multiprocessing
    to perform several tasks at the same time To use the full potential of all those processors you will need to write programs that can do parallel processing For Java programmers that means learning about threads A single thread is similar to the programs that you have been writing up until now but more than one thread can be running at the same time in parallel What makes things more interesting and more difficult than single threaded programming is the fact that the threads in a parallel program are rarely completely independent of one another They usually need to cooperate and communicate Learning to manage and control cooperation among threads is the main hurdle that you will face in this chapter There are several reasons to use parallel programming One is simply to do computations more quickly by setting several processors to work on them simultaneously Just as important however is to use threads to deal with blocking operations where a process can t proceed until some event occurs In the previous chapter for example we saw how programs can block while waiting for data to arrive over a network connection Threads make it possible for one part of a

    Original URL path: http://math.hws.edu/javanotes/c12/index.html (2016-02-07)
    Open archived version from archive

  • Javanotes 7.0, Chapter 13 -- Advanced GUI Programming
    in that chapter suffice But the Swing graphical user interface library is far richer than what we have seen so far and it can be used to build highly sophisticated applications This chapter is a further introduction to Swing and other aspects of GUI programming Although the title of the chapter is Advanced GUI Programming it is still just an introduction Full coverage of this topic would require at least

    Original URL path: http://math.hws.edu/javanotes/c13/index.html (2016-02-07)
    Open archived version from archive

  • Javanotes Glossary
    if it is definitely true that a given variable must have been assigned a value before that point in the program It is only legal to use the value of a local variable if that variable has definitely been assigned a value before it is used For this to be true the compiler must be able to verify that every path through the program from the declaration of the variable to its use must pass through a statement that assigns a value to that variable deprecated Considered to be obsolete but still available for backwards compatibility A deprecated Java class or method is still part of the Java language but it is not advisable to use it in new code Deprecated items might be removed in future versions of Java dialog box A window that is dependent on another window called its parent Dialog boxes are usually popped up to get information from the user or to display a message to the user Dialog boxes in the Swing API are represented by objects of type JDialog distributed computing A kind of parallel processing in which several computers connected by a network work together to solve a problem dummy parameter Identifier that is used in a subroutine definition to stand for the value of an actual parameter that will be passed to the subroutine when the subroutine is called Dummy parameters are also called formal parameters or sometimes just parameters when the term argument is used instead of actual parameter enum Enumerated type A type that is defined by listing every possible value of that type An enum type in Java is a class and the possible values of the type are objects event In GUI programming something that happens outside the control of the program such as a mouse click and that the program must respond to when it occurs exception An error or exceptional condition that is outside the normal flow of control of a program In Java an exception can be represented by an object of type Throwable that can be caught and handled in a try catch statement fetch and execute cycle The process by which the CPU executes machine language programs It fetches that is reads an instruction from memory and carries out that is executes the instruction and it repeats this over and over in a continuous cycle flag A boolean value that is set to true to indicate that some condition or event is true A single bit in a binary number can also be used as a flag formal parameter Another term for dummy parameter frame One of the images that make up an animation Also used as another name for activation record function A subroutine that returns a value garbage collection The automatic process of reclaiming memory that is occupied by objects that can no longer be accessed generic programming Writing code that will work with various types of data rather than with just a single type of data The Java Collection Framework and classes that use similar techniques are examples of generic programming in Java getter An instance method in a class that is used to read the value of some property of that class Usually the property is just the value of some instance variable By convention a getter is named getXyz where xyz is the name of the property global variable Another name for member variable emphasizing the fact that a member variable in a class exists outside the methods of that class graphics context The data and methods necessary for drawing to some particular destination A graphics context in Java is an object belonging to the Graphics class GUI Graphical User Interface The modern way of interacting with a computer in which the computer displays interface components such as buttons and menus on a screen and the user interacts with them for example by clicking on them with a mouse hash table A data structure optimized for efficient search insertion and deletion of objects A hash table consists of an array of locations and the location in which an object is stored is determined by that object s hash code an integer that can be efficiently computed from the contents of the object heap The section of the computer s memory in which objects are stored high level language A programming language such as Java that is convenient for human programmers but that has to be translated into machine language before it can be executed HSB A color system in which colors are specified by three numbers in Java real numbers in the range 0 0 to 1 0 giving the hue saturation and brightness IDE Integrated Development Environment A programming environment with a graphical user interface that integrates tools for creating compiling and executing programs identifier A sequence of characters that can be used as a name in a program Identifiers are used as names of variables methods and classes index The position number of one item in an array implementation The inside of a black box such as the code that defines a subroutine immutable object An immutable object cannot be modified after it is constructed because all of its instance variables are final infinite loop A loop that never ends because its continuation condition always evaluates to true inheritence The fact that one class can extend another It then inherits the data and behavior of the class that it extends instance of a class An object that belongs to that class or a subclass of that class An object belongs to a class in this sense when the class is used as a template for the object when the object is created by a constructor defined in that class instance method A non static method in a class and hence a method in any object that is an instance of that class instance variable A non static variable in a class and hence a variable in any object that is an instance of that class interface As a general term how to use a black box such as a subroutine Knowing the interface tells you nothing about what goes on inside the box Interface is also a reserved word in Java in this sense an interface is a type that specifies one or more abstract methods An object that implements the interface must provide definitions for those methods interpreter A computer program that executes program written in some computer language by reading instructions from the program one by one and carrying each one out by translating it into equivalent machine language instructions I O Input Output the way a computer program communicates with the rest of the world such as by displaying data to the user getting information from the user reading and writing files and sending and receiving data over a network iterator An object associated with a collection such a list or a set that can be used to traverse that collection The iterator will visit each member of the collection in turn Java Collection Framework JCF A set of standard classed that implement generic data structures including ArrayList and TreeSet for example JavaFX The new toolkit for GUI applications which becomes the preferred approach to GUI programming in Java 8 JavaFX is not covered in this book JDK Java Development Kit Basic software that supports both compiling and running Java programs A JDK includes a command line programming environment as well as a JRE You need a JDK if you want to compile Java source code as well as executing pre compiled programs JRE Java Runtime Environment Basic software that supports running standard Java programs that have already been compiled A JRE includes a Java Virtual Machine and all the standard Java classes just in time compiler A kind of combination interpreter compiler that compiles parts of a program as it interprets them This allows subsequent executions of the same parts of the program to be executed more quickly than they were the first time This can result is greatly increased speed of execution Modern JVMs use a just in time compiler JVM Java Virtual Machine The imaginary computer whose machine language is Java bytecode Also used to refer to computer programs that act as interpreters for programs written in bytecode to run Java programs on your computer you need a JVM layout manager An object whose function is to lay out the components in a container that is to set their sizes and locations Different types of layout managers implement different policies for laying out components linked data structure A collection of data consisting of a number of objects that are linked together by pointers which are stored in instance variables of the objects Examples include linked lists and binary trees linked list A linked data structure in which nodes are linked together by pointers into a linear chain listener In GUI programming an object that can be registered to be notified when events of some given type occur The object is said to listen for the events literal A sequence of characters that is typed in a program to represent a constant value For example A is a literal that represents the constant char value A when it appears in a Java program location in memory The computer s memory is made up of a sequence of locations These locations are sequentially numbered and the number that identifies a particular location is called the address of that location local variable A variable declared within a method for use only inside that method A variable declared inside a block is valid from the point where it is declared until the end of block in which the declaration occurs loop A control structure that allows a sequence of instructions to be executed repeatedly Java has three kinds of loops for loops while loops and do loops loop control variable A variable in a for loop whose value is modified as the loop is executed and is checked to determine whether or not to end the loop machine language A programming language consisting of instructions that can be executed directed by a computer Instructions in machine language are encoded as binary numbers Each type of computer has its own machine language Programs written in other languages must be translated into a computer s machine language before they can be executed by that computer main memory Programs and data can be stored in a computer s main memory where they are available to the CPU Other forms of memory such as a disk drive also store information but only main memory is directly accessible to the CPU Programs and data from a disk drive have to be copied into main memory before they can be used by the CPU map An associative array a data structure that associates an object from some collection to each object in some set In Java maps are represented by the generic interface Map T S member variable A variable defined in a class but not inside a method as opposed to a local variable which is defined inside some method memory Memory in a computer is used to hold programs and data method Another term for subroutine used in the context of object oriented programming A method is a subroutine that is contained in a class or in an object module A component of a larger system that interacts with the rest of the system in a simple well defined straightforward manner multitasking Performing multiple tasks at once either by switching rapidly back and forth from one task to another or by literally working on multiple tasks at the same time multiprocessing Multitasking in which more than one processor is used so that multiple tasks can literally be worked on at the same time mutual exclusion Prevents two threads from accessing the same resource at the same time In Java this only applies to threads that access the resource in synchronized methods or synchronized statements Mutual exclusion can prevent race conditions but introduces the possibility of deadlock MVC pattern The Model View Controller pattern a strategy for dividing responsibility in a GUI component The model is the data for the component The view is the visual presentation of the component on the screen The controller is responsible for reacting to events by changing the model According to the MVC pattern these responsibilities should be handled by different objects NaN Not a Number Double NaN is a special value of type double that represents an undefined or illegal value node Common term for one of the objects in a linked data structure null A special pointer value that means not pointing to anything numerical analysis The field that studies algorithms that use approximations such as real numbers and the errors that can result from such approximation off by one error A common type of error in which one too few or one too many items are processed often because counting is not being handled correctly or because the processing stops too soon or continues too long for some other reason object An entity in a computer program that can have data variables and behaviors methods An object in Java must be created using some class as a template The class of an object determines what variables and methods it contains object type A type whose values are objects as opposed to primitive types Classes and interfaces are object types OOP Object Oriented Programming An approach to the design and implementation of computer programs in which classes and objects are created to represent concepts and entities and their interactions operating system The basic software that is always running on a computer without which it would not be able to function Examples include Linux Mac OS and Windows Vista operator A symbol such as or that represents an operation that can be applied to one or more values in an expression overloading of operators The fact that the same operator can be used with different types of data For example the operator can be applied to both numbers and strings overloading of method names The fact that several methods that are defined in the same class can have the same name as long as they have different signatures overriding Redefining in a subclass When a subclass provides a new definition of a method that is inherited from a superclass the new definition is said to override the original definition package In Java a named collection of related classes and sub packages such as java awt and javax swing parallel processing When several tasks are being performed simultaneously either by multiple processors or by one processor that switches back and forth among the tasks parameter Used to provide information to a subroutine when that subroutine is called Values of actual parameters in the subroutine call statement are assigned to the dummy parameters in the subroutine definition before the code in the subroutine is executed parameterized type A type such as ArrayList String that includes one or more type parameters String in the example parsing Determining the syntactical structure of a string in some language To parse a string is to determine whether the string is legal according to the grammar of the language and if so how it can be created using the rules of the grammar partially full array An array that is used to store varying numbers of items A partially full array can be represented as a normal array plus a counter to keep track of how many items are actually stored pixel A picture element on the screen or in an image A picture consists of rows and columns of pixels The color of each pixel can be individually set polymorphism The fact that the meaning of a call to an instance method can depend on the actual type of the object that is used to make the call at run time That is if var is a variable of object type then the method that is called by a statement such as var action depends on the type of the object to which var refers when the statement is executed at run time not on the type of variable var pointer A value that represents an address in the computer s memory and hence can be thought of as pointing to the location that has that address A variable in Java can never hold an object it can only hold a pointer to the location where the object is stored A pointer is also called a reference pragmatics Rules of thumb that describe what it means to write a good program For example style rules and guidelines about how to structure a program are part of the pragmatics of a programming language precedence The precedence of operators determines the order in which they are applied when several operators occur in an expression in the absence of parentheses precondition A condition that must be true at some point in the execution of a program in order for the program to proceed correctly from that point A precondition of a subroutine is something that must be true when the subroutine is called in order for the subroutine to function properly Subroutine preconditions are often restrictions on the values of the actual parameters that can be passed into the subroutine priority queue A data structure representing a collection of items where each item has a priority A priority queue has operations add and remove Items can be added in any order but the remove operation always removes an item of minimal priority Some version of priority queue use maximum instead of minimum priority postcondition A condition that is known to be true at some point in the execution of a program as a result of the computation that has come before that point A postcondition of a subroutine is something that must be true after the subroutine finishes its execution A postcondition of a function often describe the return value

    Original URL path: http://math.hws.edu/javanotes/glossary.html (2016-02-07)
    Open archived version from archive

  • Javanotes Version 7 -- News
    If we want to talk about the name of student number 3 we can use student 3 name should be If we want to talk about the name of student number 3 we can use classlist 3 name Chapter 6 Quiz Answers in the answer to Question 12 code setPreferredSize dim should be comp setPreferredSize dim Section 7 3 1 end of second paragraph This means that unfortunately you can have an ArrayList of int should be This means that unfortunately you can not have an ArrayList of int Section 7 5 1 in the lower part of the illustration of a two dimensional array the first item in the fourth row from the array is a 5 but should be a 5 Section 9 4 2 in the method treeContainsNR the two occurrences of node item should be runner item Chapter 9 Quiz in Question 2 to match the answer that I give System out print ln should be System out print Section 10 2 5 pg should be pq in the definitions of the methods pg add pg remove pg isEmpty Section 13 4 3 in the definition of the example method public Class getColumnClass columnNum else if columnNum 1 should be else if columnNum 1 Section 13 5 in the second paragraph the URL for the improved Mandelbrot program was listed as http math hws edu eck xJava MB but should be http math hws edu xJava MB SimpleAnimationStarter java line 50 GrowingCircleAnimation drawingArea new GrowingCircleAnimation should be SimpleAnimationStarter drawingArea new SimpleAnimationStarter Older News August 1 2014 Version 7 is released Version 7 requires Java 7 or later Note that with this version the book no longer cover applets and there are no applets in the on line version Readers are encouraged to download compile and run the examples Links for downloading are available on the front page May 2014 Labs from my intro programming course for Spring 2014 are on the course web page at http math hws edu eck cs124 The labs from Spring 2013 are also still available January 4 2014 Version 6 0 3 is released with more small error fixes many once again from Mark Cristy I have also added experimentally EPUB and MOBI ebook versions of the text available among the download links at the bottom of the index page May 17 2013 Version 6 0 2 is released with fixes for many small mostly typographical errors Again thanks to readers who sent in error reports especially Mark Christy and John Ganci who found many errors May 17 2013 The labs for my latest version of Introductory Programming are now on line at http math hws edu eck cs124 with a number of new labs for this version of the course By the way labs for older versions of the course such as those from Fall 2011 Fall 2009 and Spring 2006 are still available July 25 2012 Version 6 0 1 is released This is a very minor upgrade fixing

    Original URL path: http://math.hws.edu/javanotes/news.html (2016-02-07)
    Open archived version from archive


  • are organized into folders with one folder for each chapter except Chapter 1 which has no exercises This is done as a convenience to help you run the solutions but please don t just run them Try working on the exercises yourself and read my discussion of the solutions on the web pages You ll learn a lot more that way You can also get solutions to individual exercises by copy and pasting the code from the solution web page into a text editor Copy from the web page open in a web browser not from the HTML source of the web page The HTML source contains extra markup that will be seen as errors by the Java compiler You have two options for running the solutions RUN IN AN IDE If you want to run the programs in an IDE such as Eclipse you should be able to copy the entire contents of any one of the chapter folders into a project in the IDE and then run the programs Note Do not copy the chapter folder itself open the folder and copy the contents You can put the examples from several chapters to the same project if you want some files such as TextIO java are duplicated in several chapters but any two files with the same name are identical and you only need one copy of the file in your project COMPILE AND RUN ON THE COMMAND LINE If you know how to compile programs on the command line just change into one of the chapter directories inside sources and use the command javac java to compile all the programs from that chapter As long as your compiler supports Java 7 or higher there should be no errors You might see some warnings especially if you use

    Original URL path: http://math.hws.edu/javanotes/README-exercise-solutions.txt (2016-02-07)
    Open archived version from archive

  • No match for ''
    correct and you only used one word try using one or more similar search words with Any If the spelling is correct and you used more than one word with Any try using one or more similar search words with Any If the spelling is correct and you used more than one word with All try using one or more of the same words with Any Match All Any Boolean

    Original URL path: http://math.hws.edu/cgi-bin/htsearch (2016-02-07)
    Open archived version from archive

  • Erika L. C. King at HWS
    Please speak to me directly if you are interested in having me write a letter of recommendation for you If I have agreed to write such a letter please visit the departmental recommendations website as soon as possible so that we can work together to make your recommendation letter a good one Research Publications An unexpected discovery Involve a Journal of Mathematics 7 3 2014 373 376 A revision and extension of results on 4 regular 4 connected claw free graphs In collaboration with Trevor J Gionet Jr 12 and Yixiao Sha 12 Discrete Applied Mathematics 159 2011 1225 1230 Vertex Magic Edge Labeling Games on Graphs with Cycles In collaboration with Adam Giambrone 08 Journal of Combinatorial Mathematics and Combinatorial Computing 78 2011 75 96 Dominating sets in plane triangulations In collaboration with M J Pelsmajer Discrete Mathematics 310 2010 2221 2230 Stable Well Covered Graphs Ars Combinatoria 93 2009 313 319 Comparing Subclasses of Well Covered Graphs Congressus Numerantium 180 2006 145 159 Characterizing a Subclass of Well Covered Graphs Congressus Numerantium 160 2003 7 31 For full details of the material discussed in the above article please see the following excerpts from my dissertation Introduction Characterization Theorem

    Original URL path: http://math.hws.edu/eking/ (2016-02-07)
    Open archived version from archive