Recent Changes · Search:

Functional Programming

Type Inference

Toss

  • (incorporates former Speagram)

Emacs

Kurs Pascala

Artificial General Intelligence

AI:

Algorithmic Game Theory: Prediction Markets (po polsku)

Programming in Java

kurs pracy w systemie Linux

Evolutionary Algorithms

Animation

Data Stores and Data Mining

Language Understanding

Systemy Inteligentnych Agentów

Przetwarzanie Języka Naturalnego

Programowanie Funkcjonalne

PmWiki

pmwiki.org

add user

edit SideBar

Java.Java History

Hide minor edits - Show changes to output

January 12, 2012, at 04:37 PM by lukstafi - lec11
Changed lines 59-60 from:
to:
## Write a "Reminder" graphical application, managing messages to be displayed at scheduled times, perhaps periodically. Use @@ScheduledThreadPoolExecutor@@.
Added line 79:
# [[Attach:java-lecture11.pdf | Lecture 11]] -- Usable, secure and maintainable code: [[http://java.sun.com/docs/books/effective/ | Effective Java]] by Joshua Bloch.
January 11, 2012, at 01:51 PM by lukstafi - lec10
Added lines 76-77:
# [[Attach:java-lecture10.pdf | Lecture 10]] -- Model-View-Controller pattern for Swing applications.
## [[Attach:Lec10.jar]] -- comprehensive example from [[http://books.google.com/books?id=LjJcCnNf92kC&printsec=frontcover#v=onepage&q&f=false | Head First design patterns]] By Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates.
December 25, 2011, at 11:42 PM by lukstafi - concurrency assignment
Changed lines 53-59 from:
to:
# Concurrency. Select one of the following exercises.
## Write a program that downloads several pages from the internet and computes a joint histogram of words in the pages. Compare the performance when the pages are downloaded sequentially and concurrently.
## Rewrite the "Settlers" example from cooperative concurrency to fully using Java threads.
*** I will provide an almost-ready rewrite with only some bits to finish, stand by if you choose this exercise...
## Rewrite (parallelize) a project of your choice into using Java threads.
*** You need to get the project accepted on the first lab of January if you choose this exercise.

December 21, 2011, at 12:19 PM by lukstafi - lecture 9
Changed lines 68-69 from:
# More of Swing and SWT GUI libraries. Model-View-Controller.
# Concurrency
.
to:
# [[Attach:java-lecture09.pdf | Lecture 9]] -- Concurrency.
## [[Attach:Lec9.jar]] -- selected code examples from [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
December 13, 2011, at 01:41 PM by lukstafi - Settlers GUI assignment
Changed lines 48-53 from:
to:
# Due last week before the Christmas break, or if we cannot organize a class, on the first lab in 2012: either
## Write a graphical interface to display results of the Settlers simulation.
### For bonus points, extend it with a graphical interface to set-up the simulation.
### For bonus points, extend it with a stepping mechanism to display the course of the simulation as it evolves.
## Write a graphical interface to a project of your choice; you need to get the project accepted by Dec. 16.

December 12, 2011, at 05:08 PM by lukstafi - Settlers assignment comment
Added lines 49-50:
I will post the solution to the Settlers series of exercises in compiled form only not to spoil the fun, but if you'd rather develop new features than redo the assignments above, contact me, and I'll share the sources.
December 09, 2011, at 01:03 PM by lukstafi - serializable comment
Changed lines 47-48 from:
## Add functions to save the state of simulation into a file and restore it from a file, in binary.
to:
## Add functions to save the state of simulation into a file and restore it from a file, in binary. Hint: use serialization; don't forget to make all and every class serializable (perhaps even turn the @@LookFor@@ interface into a serializable abstract class).
Changed lines 59-60 from:
# Graphical user interfaces (comparison of AWT, Swing, SWT...) Event handling.
# More of Swing GUI library
. Model-View-Controller.
to:
# Graphical user interfaces: Swing, SWT. Event handling.
## [[Attach:Lec8.jar]] -- selected code examples from [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
# More of Swing and SWT GUI libraries
. Model-View-Controller.
December 02, 2011, at 03:25 PM by lukstafi - pretty-print assignment
Changed line 46 from:
## Modify the program to, instead of printing on the screen, pretty-print the output into a file. I'll provide details later.
to:
## Modify the program to, instead of printing on the screen, pretty-print the output into a file. Generate a table with rows corresponding to successive time instances and columns corresponding to buildings and settlers. Create either a formatted text table, or an HTML table.
Changed line 57 from:
# Input / Output.
to:
# [[Attach:java-lecture07.pdf | Lecture 7]] -- Input / Output.
December 01, 2011, at 12:24 PM by lukstafi - binary exercise
Changed lines 47-48 from:
to:
## Add functions to save the state of simulation into a file and restore it from a file, in binary.
November 30, 2011, at 01:46 PM by lukstafi - lec7.jar
Added line 57:
## [[Attach:Lec7.jar]] -- selected code examples from [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
November 23, 2011, at 11:28 AM by lukstafi - minor
Added line 4:
* [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
Deleted line 5:
* [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
November 23, 2011, at 11:27 AM by lukstafi - upgrade TiJ
Added line 5:
* [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
Deleted line 10:
* [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
November 23, 2011, at 11:19 AM by lukstafi - IO assignment
Changed line 37 from:
# Due Dec 2: Modify the simulation inspired by The Settlers game [[Attach:settlers.jar]] in one of the following ways. (Select one exercise; the first five exercises are simple, the first three require little work.)
to:
# Due Dec 2: Modify the simulation inspired by The Settlers game [[Attach:settlers.jar]] in one of the following ways. (Select one exercise; the first four exercises are simple, the first three require little work.)
Deleted line 40:
## Configure the simulation by reading a file.
Changed lines 44-47 from:
to:
# Due Dec 9: Modify the simulation inspired by The Settlers game [[Attach:settlers.jar]] in one of the following ways.
## Configure the simulation by reading a file.
## Modify the program to, instead of printing on the screen, pretty-print the output into a file. I'll provide details later.

Added line 56:
# Input / Output.
November 14, 2011, at 04:59 AM by lukstafi - assignment 5
Changed lines 37-45 from:
to:
# Due Dec 2: Modify the simulation inspired by The Settlers game [[Attach:settlers.jar]] in one of the following ways. (Select one exercise; the first five exercises are simple, the first three require little work.)
## Write a method to add a road segment between two existing waypoints.
## Add another kind of resources, for example @@STONE@@.
## Make the carriers return to the warehouse they came from after making a delivery, similarly to how they return when they cannot make the delivery; but in case they make the delivery to a warehouse where there is not enough carriers (e.g. less than 3), let them stay. Now, a small number of carriers should still distribute all resources needed.
## Configure the simulation by reading a file.
## Add a terrain: a two-dimensional array of @@enum@@ objects that decides which kinds of buildings can be built at which locations. (The terrain can be a field in the @@Scheduler@@ class.)
## Add another kind of settler: a constructor, add an @@underConstruction@@ boolean field to the @@Building@@ class and modify @@notFunctional ()@@ to account for it. Modify the @@Building@@ class so that the constructor settler needs to reside in a building for a time proportional to @@resourcesToBuild().sum()@@ before @@underConstruction@@ becomes false. Write a method in the @@Castle@@ class that generates and schedules a task which searches for a building that is @@underConstruction@@ but does not have a constructor, and sends a constructor there. The constructor should return back to the castle after finishing the job.
## Add another kind of building: sawmill, and another settler: woodcutter. The castle should send a woodcutter and a carrier to a sawmill after it is built. The woodcutter produces the wood and the carrier delivers it periodically to the nearest warehouse.

November 09, 2011, at 07:52 PM by lukstafi - Lec6 code samples
Added line 45:
## [[Attach:Lec6.jar]] -- selected code examples from [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
November 04, 2011, at 07:18 PM by lukstafi - delay due date
Changed line 34 from:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of so called ''unchecked'' warnings. To get the locations of warnings, compile with @@javac -Xlint:unchecked *.java@@. For bonus points, select one of the exercises:
to:
# Due Nov 18: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of so called ''unchecked'' warnings. To get the locations of warnings, compile with @@javac -Xlint:unchecked *.java@@. For bonus points, select one of the exercises:
November 02, 2011, at 01:51 PM by lukstafi - variance
Changed line 44 from:
# [[Attach:java-lecture06.pdf | Lecture 6]] -- Generics. Collections.
to:
# [[Attach:java-lecture06.pdf | Lecture 6]] -- Covariance and Contravariance. Generics. Collections.
October 29, 2011, at 12:44 PM by lukstafi - bonus exercise
Changed lines 34-37 from:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of so called ''unchecked'' warnings.
** To get the locations of warnings, compile with @@javac -Xlint:unchecked *.java@@.
## For bonus points, implement the Java standard library collection interfaces @@Set<E>@@ and @@Map<K,V>@@ using ordered linked lists, subclassing appropriate abstract classes from the library.
to:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of so called ''unchecked'' warnings. To get the locations of warnings, compile with @@javac -Xlint:unchecked *.java@@. For bonus points, select one of the exercises:
## Add an iterator (or another form of browsing the elements) to the @@MySet@@ interface. In @@union@@ and @@intersect@@ methods, use the @@instanceof@@ operator to switch to a general way of performing these operations in case the argument is not of the @@MySetImpl@@ class.
## Implement
the Java standard library collection interfaces @@Set<E>@@ and @@Map<K,V>@@ using ordered linked lists, subclassing appropriate abstract classes from the library.
Changed line 34 from:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of _unchecked_ warnings.
to:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of so called ''unchecked'' warnings.
October 29, 2011, at 12:08 PM by lukstafi - more ex4 comments
Changed lines 34-35 from:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts.
to:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Remember to fix all sources of _unchecked_ warnings.
** To get the locations of warnings, compile with @@javac -Xlint:unchecked *.java@@
.
October 29, 2011, at 11:14 AM by lukstafi - ex4 comment
Changed line 30 from:
** [[Attach:ex3nested.jar]] -- nicer example using nested classes.
to:
** [[Attach:ex3nested.jar]] -- example using nested classes.
Changed line 34 from:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. Remove the unnecessary class casts.
to:
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. (Some change to the class structure might be needed.) Remove the unnecessary class casts.
October 28, 2011, at 11:15 PM by lukstafi - ex3 update
Added lines 31-33:
** Exercise update:
### implement the @@clone()@@ method for @@MySetImpl@@ and @@MyMapImpl@@;
### don't forget to add simple demonstration tests for @@MySet.intersect@@, @@MyMap.union@@ and @@clone()@@ methods.
October 28, 2011, at 10:58 PM by lukstafi - new assignment
Changed lines 30-33 from:
to:
** [[Attach:ex3nested.jar]] -- nicer example using nested classes.
# Due Nov 11: Modify the [[Attach:ex3nested.jar | nested]] implementation of sets and maps (including the interfaces) to use generic types. Remove the unnecessary class casts.
## For bonus points, implement the Java standard library collection interfaces @@Set<E>@@ and @@Map<K,V>@@ using ordered linked lists, subclassing appropriate abstract classes from the library.

October 27, 2011, at 02:54 AM by lukstafi - Swing
Changed lines 38-39 from:
# Graphical user interfaces (AWT library). Event handling.
to:
# Graphical user interfaces (comparison of AWT, Swing, SWT...) Event handling.
# More of Swing GUI library. Model-View-Controller
.
October 27, 2011, at 02:49 AM by lukstafi - assignment source
Changed line 28 from:
** [[Attach:Ex3.jar]]
to:
** [[Attach:ex3.jar]]
October 27, 2011, at 02:48 AM by lukstafi - assignment source
Changed lines 28-30 from:
to:
** [[Attach:Ex3.jar]]
*** DISCLAIMER: this example does not show the right way to implement containers or good programming practice, it is just an exercise in use and limitations of inheritance and interfaces.

October 21, 2011, at 10:21 PM by lukstafi - another book
Changed lines 13-14 from:
to:
* [[http://books.google.com/books/about/Clean_code.html?id=dwSfGQAACAAJ | Clean code: a handbook of agile software craftsmanship]] by Robert C. Martin
October 19, 2011, at 11:47 AM by lukstafi - tutorials primary
Added line 3:
* [[http://download.oracle.com/javase/tutorial/ | The Java Tutorials]] at Sun/Oracle.
Deleted line 8:
* [[http://download.oracle.com/javase/tutorial/ | The Java Tutorials]] at Sun/Oracle.
October 19, 2011, at 11:44 AM by lukstafi - change deadline, tentative lectures
Changed lines 26-27 from:
# Due Oct 28: [[Attach:Ex3-SetsAndMaps.pdf | Sets and Maps]].
to:
# Due Nov 4: [[Attach:Ex3-SetsAndMaps.pdf | Sets and Maps]].
Added lines 35-36:
# Graphical user interfaces (AWT library). Event handling.
# Concurrency.
October 16, 2011, at 10:23 PM by lukstafi - javadoc
Changed line 33 from:
# [[Attach:java-lecture05.pdf | Lecture 5]] -- Exceptions. Packages.
to:
# [[Attach:java-lecture05.pdf | Lecture 5]] -- Exceptions. Packages. Generating documentation with @@javadoc@@.
October 16, 2011, at 11:30 AM by lukstafi - new lecture
Added lines 33-34:
# [[Attach:java-lecture05.pdf | Lecture 5]] -- Exceptions. Packages.
# [[Attach:java-lecture06.pdf | Lecture 6]] -- Generics. Collections.
October 14, 2011, at 08:59 AM by lukstafi - new exercises
Changed lines 26-27 from:
to:
# Due Oct 28: [[Attach:Ex3-SetsAndMaps.pdf | Sets and Maps]].
October 12, 2011, at 12:06 PM by lukstafi - new lectures
Changed lines 29-31 from:
#  [[Attach:java-lecture02.pdf | Lecture 2]] -- Classes, objects, inheritance.
to:
# [[Attach:java-lecture02.pdf | Lecture 2]] -- Classes, objects, inheritance.
# [[Attach:java-lecture03.pdf | Lecture 3]] -- Inheritance and interfaces. Nested types and inner classes.
# [[Attach:java-lecture04.pdf | Lecture 4]] -- Review: the Java tutorials
.
October 07, 2011, at 02:10 PM by lukstafi - dates extended
Changed lines 24-26 from:
# Due Oct 7: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].
# Due Oct 14: [[Attach:Ex2-PrimeFactors.pdf | Prime Factors]].
to:
# Due Oct 14: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].
# Due Oct 21: [[Attach:Ex2-PrimeFactors.pdf | Prime Factors]].
Changed lines 25-26 from:
# Due Oct 14: [[Attach.Ex2-PrimeFactors.pdf | Prime Factors]].
to:
# Due Oct 14: [[Attach:Ex2-PrimeFactors.pdf | Prime Factors]].
Changed lines 25-26 from:
to:
# Due Oct 14: [[Attach.Ex2-PrimeFactors.pdf | Prime Factors]].
October 06, 2011, at 10:45 PM by lukstafi - run online
Added lines 19-22:
Run Java code online:
* [[http://ideone.com/]] (do not make the class defining @@main@@ public)
* [[http://www.browxy.com:9001/codeRunner]] (do make it public)

October 06, 2011, at 09:53 PM by lukstafi - OOP articles
Changed lines 12-13 from:
to:
* [[http://en.wikiversity.org/wiki/Object_Oriented_Software_Design#Introductory_Articles | The Object-Oriented Thought Process]] articles by Matt Weisfeld
October 05, 2011, at 07:07 AM by lukstafi - reorganized references
Changed lines 1-6 from:
References:
to:
Primary course material:
* [[http://java.sun.com/docs/books/javaprog/ | The Java Programming Language, 4th ed.]] by Ken Arnold, James Gosling, and David Holmes.
* [[http://java.sun.com/docs/books/effective/ | Effective Java]] by Joshua Bloch.
* [[http://download.oracle.com/javase/6/docs/api/ | Java SE6 API]] and [[http://download.oracle.com/javase/7/docs/api/ | Java SE7 API]].

See also
:
Deleted line 9:
* [[http://download.oracle.com/javase/6/docs/api/ | Java SE6 API]] and [[http://download.oracle.com/javase/7/docs/api/ | Java SE7 API]].
Deleted line 10:
* [[http://java.sun.com/docs/books/effective/ | Effective Java]] by Joshua Bloch.
Changed lines 22-23 from:
# [[Attach:java-lecture01.pdf | Lecture 1]] -- references, the Java story, syntax.
#
  [[Attach:java-lecture02.pdf | Lecture 2]]
to:
# [[Attach:java-lecture01.pdf | Lecture 1]] -- Introduction to Java.
#  [[Attach:java-lecture02
.pdf | Lecture 2]] -- Classes, objects, inheritance.
Changed lines 6-14 from:
to:
* [[http://www.mindviewinc.com/Books/TIJ4/ | Thinking in Java]] by Bruce Eckel.
* [[http://java.sun.com/docs/books/effective/ | Effective Java]] by Joshua Bloch.
* [[http://books.google.com/books?id=LjJcCnNf92kC&printsec=frontcover#v=onepage&q&f=false | Head First design patterns]] By Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates

Integrated Development Environments (Java and general):
* [[http://netbeans.org/kb/index.html | NetBeans]]
* [[http://www.eclipse.org/downloads/moreinfo/java.php | Eclipse]]
* Emacs [[http://cedet.sourceforge.net/ | CEDET]] with [[http://jdee.sourceforge.net/ | JDEE]]

Changed lines 16-17 from:
* Due Oct 7: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].
to:
# Due Oct 7: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].

Lectures:
# [[Attach:java-lecture01.pdf | Lecture 1]] -- references, the Java story, syntax.
#  [[Attach:java-lecture02.pdf | Lecture 2]]
September 30, 2011, at 06:26 PM by lukstafi - references
Changed lines 1-9 from:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].
to:
References:
*
[[http://java.sun.com/docs/books/jls/ | The Java Language Specification]] at Sun/Oracle.
*
[[http://download.oracle.com/javase/tutorial/ | The Java Tutorials]] at Sun/Oracle.
* [[http://en.wikiversity.org/wiki/Learning_Java | Learning Java]] at Wikiversity or [[http://en.wikibooks.org/wiki/Java_Programming | Java Programming]] at Wikibooks.
* [[http://download.oracle.com/javase/6/docs/api/ | Java SE6 API]] and [[http://download.oracle.com/javase/7/docs/api/ | Java SE7 API]].

Exercises:
* Due Oct 7: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].

September 30, 2011, at 08:55 AM by lukstafi - book link
Changed line 1 from:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]] (and [[Attach:SelfAvoidingWalk.java]]).
to:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]]; [[http://introcs.cs.princeton.edu/java/home/ | Introduction to Programming in Java]]: [[http://introcs.cs.princeton.edu/java/14array/SelfAvoidingWalk.java.html | SelfAvoidingWalk.java]].
September 30, 2011, at 08:40 AM by lukstafi - source
Changed line 1 from:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]].
to:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]] (and [[Attach:SelfAvoidingWalk.java]]).
September 30, 2011, at 08:27 AM by lukstafi - exercise 1
Added line 1:
The first exercise list: [[Attach:Ex1-SelfAvoidingWalk.pdf | Self-Avoiding Walk]].
Edit · History · Print · Recent Changes · Search · Links
Page last modified on January 12, 2012, at 04:37 PM