2D array is quite similar to 1D [[array]]. The first "number of arrays" portion will have an array of pointers to other arrays, that will either contain the actual values if primitive or references to objects.\n<html><pre>\n type [] [] array_name; // This creates the array identifier\n array_name = new type [number of arrays] [length]; // This creates the array object, the array itself.\n array_name[array index] [index]= value; // This is to place values in the array. Index starts at zero.\n\n sales[0][4] = 42;\n</pre></html>
config.options.chkHttpReadOnly = false;\n
Here is an example of ArrayList. Upon creation:\n*There are no initial elements\n*The list is empty\n*Set an initial capacity, a best guess is better than nothing.\n*The first piece of data added will be an "index" 0.\n<HTML><PRE>\n ArrayList libation = new ArrayList(c); // You can specify a "c" for capacity, or omit this.\n</PRE></HTML>\nTo retrieve data from an ~ArrayList you cannot use square "[ ]" brackets, you have to use the methods that the class provides. \n*''add()'' - to add data eg @@libation.add(42,"Mango Juice");@@\n*''remove()'' - to remove data, eg: @@libation.remove(42);@@\n*''get(x)'' - to get data at position "x". If omitted, position "0" is used.\n*''clear()'' - everything is gone.\n*''contains("Mango")'' - does a search w/o an index.\n*''indexOf("Mango")'' - does a search, returns index. -1 if not found.
Autoboxing and unboxing operations are used to convert from/to primitives to/from objects (aka wrappers). Autoboxing would convert int to Integer. There are 8 primitives. Java with [[Generics]] automatically does un/boxing where needed. \n<html><pre>\nFloat f = new Float(3.1415926F);\nprintln(Math.something(f)); # If "Math.something()" requires a primitive, (f=Object), jave will unbox f to a primitive.\n</pre></html>
To cover all the parts of a Java Application. At least basic ones.\n\n<html><pre>\npublic class Book {\n public static int;\n public static void main(String []args){\n System.out.println("Hello World");\n }\n</pre></html>
When using [[Generics]] you can restrict what parameters are allowed, sending a wrong type will cause a [[Checked]] error. In the following example, we only allow Number types.\n<html><pre>\n public &lt;U extends Number&gt; void inspect(U u){ ...\n// So something like the following will throw an exception:\n somename.inspect("some text"); \n</pre></html>
''BufferedInputStream'' creates a buffer that bytes get read into. \nThe ~BufferedInputStream will read data from the source and place in a buffer for processing by the program.\nA read from source is an expensive operation, so reading more than a single byte and using a buffer saves time.\nThis will read bytes into a buffer\n<html><pre>\nimport java.io.*;\n\npublic class ByteBuffRead {\n public static void main(String[] args) {\n File file = new File("hello.txt");\n BufferedInputStream bin = null;\n try {\n FileInputStream fin = new FileInputStream(file);\n bin = new BufferedInputStream(fin);\n \n byte[] contents = new byte[1024];\n int bytesRead=0;\n String strFileContents;\n \n while( (bytesRead = bin.read(contents)) != -1){\n strFileContents = new String(contents, 0, bytesRead);\n System.out.print(strFileContents);\n }\n }\n catch(FileNotFoundException e) { System.out.println("File not found" + e); }\n catch(IOException ioe) { System.out.println("Exception while reading the file " + ioe); }\n finally { \n try{\n if(bin != null)\n bin.close();\n } catch(IOException ioe) { System.out.println("Error while closing the stream :" + ioe); }\n }\n }\n}\n</pre></html>
''Checked'' and ''Unchecked'' refer to Java exceptions. (Like EOF before you expect it, or malformed URL). All exceptions are subclasses from the ''Throwable'' class.\n*''Checked'' exceptions are those that can be checked by the compiler. They have to be either caught in a [[try-catch]] statement or thrown by a [[throws]] clause in the [[method]] header. Exceptions are mostly derived from the [[Exception]] class and its many subclasses, but not from the Exception.RuntimeException class.\n*''Unchecked'' exceptions (aka [[runtime exceptions]]) are those not ''checked'' by the compiler. These are usually severe problems or program bugs. \n\n
Classes to know\n*~StringTokenizer - takes a character string and turns it into tokens, based on some delimiter.\n**ex: str1 = new ~StringTokenizer(someString, ","); # Token some string based on a comma (csv format)\n**ex: str2 = new ~StringTokenizer(someDate, "/"); # Token some string based on a forward slash ("9/6/1961");\n
The Collection (see [[Collection Framework]]) interface is the root of the collection hierarchy. It represents in a general way a collection of objects called [[Elements]]. Think of it like a container. It is the lowest common denominator needed to implement and use collections. For more specific handling (like no duplicate data, ordered data) there are two sub-interfaces: [[Set]] and [[List]]. There is no concrete implementation of Collection, it is an interface, defined lie:\n<html><pre>\n public interface Collection &lt;E&gt; ...\n</pre></html>So a Collection is generic, it accepts any type. You can use the [[for-each]] and [[Iterator]] to traverse the collection.\n
The Collection Framework is an architecture (standard way) for representing and manipulating collections. The framework contains three things:\n*Interfaces - abstract types to represent collections\n*Implementation - concrete mplementations of interfaces\n*Methods/algorithms.\nCollections are used to manipulate data. It can be thought of as a container - that groups related data together. The two top level interfaces are:\n*[[Collection]] hierarchy: [[Set]], [[SortedSet]], [[List]] and [[Queue]]. \n*[[Map]] hierarchy: [[SortedMap]]. ([[Map]] is considered a collection, but not a true one.) \n\nThe Collections interface has standard methods that are available to all that instantiate it. Examples are:\n|!Signature|!Description|\n|boolean isEmpty();|determines if empty|\n|boolean add(Element);|Adds an element|\n|boolean addAll(Collection<? extends E> c);|Adds lots.|\n|Iterator<E>|Iterator over elements. The syntax ''<E>'' tells you the interface is [[Generics]].|\n\nCollections hold objects as type "Object". So placing an object into a collection means that the object loses their actual type. When they are retrieved from the collection, they have be be cast back to their original type, which is a source of errors. This is where [[Generics]] come in handy.\nCollections can use [[Iterator]] to iterate thru a collection. You can also use [[for-each]].\n
A ''Comparator'' is an interface that allows you to sort objects. It is often used in the [[collections|Collection]]. Basically - it compares two objects (arguements) returns:\n* -1 for o1 < o2\n* 0 for o1 = o2\n* 1 for o1 > o2\nThrows a ClassCastException if something is amiss.\n<html><pre>\npublic interface Comparator<T> {\n int compare(T o1, T o2);\n}\n</pre></html>\n
This is a big topic, so summarizing as best as possible. Concurrency using [[multithreading]].\nConcurrency involves using \n*[[Thread]]\n*[[Runnable]]
To create a constant, a field that cannot change,we use ''static final''. It should also be in all uppercase.\n<html><pre>\n static final int ANSWER2LIFE = 42;\n</pre></html>\n\n
A constructor is called first when a Java object is created - it has the same name of the class, and have the same name as the class and do not return a value. It creates the instance and does any assigning of vars that is needed.\nThere can be many different constructors, the difference being the parameter signature.\nThey are only executed once, unlike regular methods that can be called many times. To call other constructors from within a constructor, use ''this()''. to call the superclass constructor use ''super()''.\n<html><pre>\n public class SomeName\n \n [modifiers] SomeName ( [arguements] ) { // Constructor Name is SomeName \n ...code ...\n }\n }\n</pre></html>\nTechnically you always call a constructor when creating an object. Even if you don't make one, a default one is created for you. A constructor can be overloaded.\nConstructors can be called that are in the superclass like: @@super(...)@@, but it must be the first statement in the constructor of the current class, If you don't then Java called the default super constructor.
[[Introduction]]\n[[TiddlyWiki]]
''Encapsulation'' refers to keeping all the related members (variables and methods) together in an object. This is important for integrity and security. We can make sure values are correct and acceptable and that other processes cannot alter them incorrectly.
Here is Enumeration to print out a [[vector]].\n<html><pre>\n Enumeration drivesEnum = drives.elements(); \n while(drivesEnum.hasMoreElements()) \n System.out.print(drivesEnum .nextElement() + " "); \n</pre></html>
Erasure (a little misnomer) removes parameters at runtime but then adds\ncasts. Types like List<Integer> and List<String> at runtime are represented\nby the same type: [[List]].\n\nErasure also keeps generics simple to read and does not add anything that \nis not already in java. There is only one implementation of List, not one \nversion for each type. And both generic & nongeneric code translates to\nthe *same* bytecode! So legacy non-generic code is fine in Java1.5 and up.
The ''Error'' class is a subclass of Throwable. \nIf you get this error, it is usually something beyond your control.\nUsually these are JVM problems that you can do little about except catch them.\nYou should not sublass any of these errors on your own. See [[exceptions - roll yer own]] errors.\n\n
''Exception'' is a subclass of [[Throwable]]. \nSubclasses of Exception are either [[Checked]] or ''Unchecked'' exceptions. \nWhen an error occurs, the method that it occurs in creates an exception object and hands it off to the runtime system. This system then tries to find something to handle this object, an ''exception handler''. It does this by going thru the call stack looking for some block of code to handle this, that will take responsibility. If it finds something, this code then ''catches the exception'' and all is well. If not then the program terminates. \nIf you can extend this class, this will be a [[Checked]] exception. If you extend it off of the RunTime class then it is an [[Unchecked|Checked]] exception.\nAn exception is caught by a either a\n*[[try-catch]] construct. \n*[[throws]] clause in a method.\n*[[throws example]]\n\nThere are different kinds of exceptions:\n*[[Checked]] exceptions.\n*[[Error]].\n*[[runtime exceptions]], aka ''Unchecked'' exceptions.\n*[[exceptions - roll yer own]] - DIY\n
The ''File'' object is used to create & modify & delete files. This class does not actually read into or out of a file, we'll use something else (like [[FileReader]] or [[FileWriter]]) for that. Creating an object is simple:\n<html><pre>\n File variable-name = new File(&lt;directory-name&gt;, &lt;file-name&gt);\n</pre></html>
''~FileInputStream'' extends InputStream. It is for reading a file byte-by-byte.\nA return of -1 (impossible for a byte is 0-255) means end of file.\nThis is obviosly very slow, so using a filter (buffer) will speed things up.\nThis is called like:\n<html><pre>\nFileInputStream file = new FileInputStream("/path/Filename.txt"); // Unix format. Windows format = "//"\n</pre></html>\nHere is a complete example:\n<html><pre>\nimport java.io.*;\n\n// Read a file byte-by-byte\npublic class ByteReader {\n public static void main(String[] arguments) {\n try (\n FileInputStream file = new FileInputStream("save.gif") ) {\n boolean eof = false;\n while (!eof) {\n int input = file.read(); // HERE - we read a single byte\n System.out.print(input + " ");\n if (input == -1)\n eof = true;\n }\n file.close();\n } catch (IOException e) { System.out.println("Error: " + e.toString()); }\n }\n}\n</pre></html>\nSee complimentary example: FileOutputStream.
''~FileoutputStream'' extends OutputStream. It is for writing out to a file byte-by-byte.\n<html><pre>\nimport java.io.*;\n\npublic class ByteWrite {\n public static void main(String[] arguments) {\n int[] data = { 71, 73, 70, 56, 57, 97, 24, 0, 24, 0, 162, 255, 0, 255, 255, 255, 204, 204, 204, 153, 153, 153, 102, 102, 102, 0, 0, 0, 192, 192, 192, 0, 0, 0, 0, 0, 0, 33, 249, 4, 1, 0, 0, 5, 0, 44, 0, 0, 0, 0, 24, 0, 24, 0, 64, 3, 124, 88, 186, 220, 222, 4, 4, 17, 234, 184, 163, 134, 33, 67, 100, 209, 164, 141, 99, 247, 45, 33, 101, 97, 26, 87, 157, 74, 42, 204, 116, 61, 191, 0, 68, 236, 124, 239, 195, 168, 159, 144, 231, 72, 181, 88, 22, 83, 14, 213, 1, 56, 159, 208, 142, 103, 25, 147, 168, 72, 37, 28, 200, 138, 37, 41, 31, 224, 176, 120, 252, 136, 0, 4, 79, 140, 154, 227, 36, 64, 184, 171, 75, 235, 203, 20, 197, 51, 73, 109, 253, 186, 198, 208, 171, 93, 129, 83, 91, 19, 81, 134, 127, 5, 41, 135, 81, 122, 128, 104, 139, 79, 141, 137, 86, 144, 145, 131, 13, 149, 134, 100, 155, 11, 9, 0, 33, 254, 79, 67, 111, 112, 121, 114, 105, 103, 104, 116, 32, 50, 48, 48, 48, 32, 98, 121, 32, 83, 117, 110, 32, 77, 105, 99, 114, 111, 115, 121, 115, 116, 101, 109, 115, 44, 32, 73, 110, 99, 46, 32, 65, 108, 108, 32, 82, 105, 103, 104, 116, 115, 32, 82, 101, 115, 101, 114, 118, 101, 100, 46, 13, 10, 74, 76, 70, 32, 71, 82, 32, 86, 101, 114, 32, 49, 46, 48, 13, 10, 0, 59 };\n try (FileOutputStream file = new\n FileOutputStream("save2.gif")) {\n for (int i = 0; i < data.length; i++) { file.write(data[i]); } // Write out byte-by-byte.\n file.close();\n } catch (IOException e) {\n System.out.println("Error: " + e.toString());\n }\n }\n}\n\n</pre></html>See complimentary example: FileOutputStream.
The ''FileReader'' class is the main class to use when reading characters from a file. Inherits from ~InputStreamReader.\nIt will read in as a byte stream and convert this to integer values that represent Unicode characters. \nSince we are handling human readable information, it makes sense (and more efficient) to read in complete lines, so In the following example we are using ~BufferedReader. \nThis class has the method ''~ReadLine'' to read in a line (ie terminated by a \sn) of entered text. The following will be in a try block.\n<html><pre>\n File file = new File("someFileName.ext");\n BufferedReader in = new BufferedReader(new FileReader(file));\n String s;\n s = in.readLine();\n while (s != null) {\n System.out.println("Read: " + s);\n s = in.readLine();\n }\n in.close();\n</pre></html>See also FileWriter.
We use ''FileWriter'' to write to files, the following example will by in a try block.\nWe will use a buffer to be more efficient\n<html><pre>\n File file = new File("something.txt");\n InputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader in = new BufferedReader(isr);\n\n // Could also use the BufferedWriter.\n PrintWriter out = new PrintWriter(new FileWriter(file));\n String s;\n System.out.println("Enter something:");\n System.out.println("Enter cntl-z to exit.");\n\n while ((s = in.readLine()) != null) {\n out.println(s);\n }\n in.close();\n out.close();\n\n</pre></html>See also FileReader.
Generics enable compile-time type safety with classes that work on arbitrary types. \nTheses type of errors are usually runtime errors and are difficult to manage.\nWith Generics you specify the classes expected in the [[data structures]].\n[[Collections]] is a great example of something that generics has made simplier and safer to use. Generics use generic type or [[parameterized type]] invocation.\nTn the following we specify that the [[ArrayList]] is meant to hold Integer information only. Anything else will give a compiler error, not a runtime error.\n<html><pre>\n ArrayList&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();\n list.add(new Integer(13));\n int total = list.get(0).intValue();\n list.add("test"); // Error: Will not compile!\n</pre></html>\nAnother example, first without Generics and then with Generics:\n<html><pre>\nHashMap hash1 = new HashMap(); // Without Generics\nhash1.put(0,"Mango"); \nhash1.put(1, 3.14f);\nString a = (String) hash.get(0); // Don't try this at home!\nFloat b = (Float) hash.get(1); // If you cast wrong - Runtime Error\nObject c = hash1.get(1); // This will cast correctly\n\n/* This is how to declare HashMap - Generics*/\nHashMap&lt;Integer, Double> hash2 = new HashMap&lt;>(); \nhash2.put(0, 6.66d); \nhash2.put(1, 3.14d); \nDouble f0 = hash2.get(0);\nDouble f1 = hash2.get(1);\n//hash2.put(1, 1.123f); # This will crash & burn\n//Float f3 = hash2.get(1); # This will crash & burn\n\n/* Quick iterate */\nfor (Integer key : hash2.keySet()) {\n System.out.println("Key = " + key + " - " + hash2.get(key));\n}\n</pre></html>Note that we do not have to cast retrieved data \nYou can also restrict what parameters are allowed using [[Bounded Type Parameters]].\nBe careful of subtyping generics, its not like regular classes. \n*An Integer is-a Number and a Double is-a Number, ie Integer is a subtype of Number.\n*A Box<Integer> is ''not'' a subtype of Box<Number> .\nWhy? Because generics are containers, a container for Integers cannot hold a container built for Doubles.\n
Getting setup with Java on Ubuntu (See [[install on Ubuntu 18]]).\nDo you have it? Run @@java โ€“version@@\nIf not, run:\n*First set up ~PPAs: @@sudo add-apt-repository ppa:webupd8team/java@@\n*Next prep your machine: @@sudo apt-get update@@\n*We are a dev shop, so we'll run: @@sudo apt-get install oracle-java8-installer@@\n**Pop ups ask for license permission, accept them.\n*Finally set environment variables automatically: @@sudo apt-get install oracle-java8-set-default@@\n*Check version: @@java -version@@\n**Should be something like: @@java version "1.8.0_121"@@\nNow you are good to code.\nFor a program example, see [[hello, world]].
The ''~HashMap'' class implements the [[Map]] interface. \nConsequently, all methods in the Map interface have to be implemented. ~HashMap alsohas a few of its own, like ''clear()''.\nIt is a key mapped [[data structures]]. There is a "load factor" (0.0 to 1.0) to determine when the hash map allocates more space. It compares its size & capacity with the load factor. A load factor close to 0.0 means efficient lookups but memory wasteful, and a 1.0 is inefficient lookup but memory efficient.\nThere are 3 ~HashMaps constructors, with capacity & load factor parameters:\n<html><pre>\nHashMap hashOne = new HashMap(); // Defaults to 16 elements and load factor of 0.75.\nHashMap hashTwo = new HashMap(50); // Defaults to a load factor of 0.75, sets it to 50 elements.\nHashMap hashTree = new HashMap(42, 0.42f); \n</pre></html>\nSome ~HashMap specific methods:\n*''clear()'' - removes all keys and data (elements)\n*''containsValue(Object)'' - looks for Object in the ~HashMap.\n*''containsKey(String)'' - looks for key in ~HashMap.\nThe key is a computed value, to help efficiently store data in memory.\nSee also [[Generics]].\n
Is the best performing [[Set]] implementation, but makes no guarantees for the order of iteration.
Hashtable is a concrete implementation.
Java ''IO'' classes are all under the ''java.io'' package. See also [[Stream]].\nThere are two types of IO classes, binary & character.\n*''Binary'' classes all descend from the abstract ''InputStream'' and ''OutputStream'' classes.\n*''Character'' classes all descend from the abstract [[Reader]] and [[Writer]] classes.\n\nThere are many types of streams, files, memory and pipes. Terms to know:\n*''Stream'' - a flow of data, typically binary data.\n**Is either byte (0-255) or character (specialized bytes - unicode).\n*''Source'' - starts flow of data. A byte stream is [[InputStream]] and a character stream is a [[Reader]].\n*''Sink'' - terminates a flow of data. A byte stream is [[OutputStream]] and a character stream is a [[Writer]].\n*''Standard Input'' - access via ''system.in'' used to read keyboard data, as a byte stream only.\n*''Standard Output'' - access via ''system.out'' used to write data to screen.\n*''Standard Error'' - access via ''system.err'' used to write error messages to screen.\n
Here are the ''IO Classes'' - which are either Character or Byte streams.\n\nHere are the classes used:\n|!Type|!Character Streams|!Byte Streams|\n|File|FileReader|FileInputStream|\n|File|FileWriter|FileOutputStream|\n|Memory Array|CharArrayReader|ByteArrayInputStream|\n|Memory Array|CharArrayWriter|ByteArrayOutputStream|\n|Memory String|StringReader|n/a|\n|Memory String|StringWriter|n/a|\n|Pipe|PipedReader|PipedInputStream|\n|Pipe|PipedWriter|PipedoutputStream|\n|Buffering|[[BufferedReader|FileReader]]|BufferedInputStream|\n|Buffering|[[BufferedWriter|FileWriter]]|BufferedOutputStream|\n|Object Serialization|n/a|ObjectInputStream|\n|Object Serialization|n/a|ObjectOutputStream|\n\nUse ''~InputStreamReader'' to translate ''Standard Input'' byte stream data to string (unicode) data, see [[FileReader]] example.\nUse ''~BufferedReader'' to convert unbuffered data to buffered data. You can do this manually too with the ''Reader'' class.\nUse ''~DataInputStream'' to convert low level (raw) binary stream to convert to primitive data & string type.\n\n
Identifiers are the names that we give [[Constants]], [[variables]], [[method]]s and [[class]]es. They typically start with:\n*a letter\n*$ (dollar sign)\n*_ (underscore)\nand can contain numbers and letters. Case is important.
There are two types of Inheritance, Interface & Implementation. Interface inheritance is the preferred method, following a "is-a" relationship. Bike is-a Vehicle. Implementation is a "has-a" relationship. Bike has-a ~FrontWheel.\nInheritance uses the [[extend]] keyword. It is uni-directional.\n\n''Implementation (aka class inheritance):''\nThis type is where a class inherits functionality from the parent class. This is something already implemented. You can only inherit from one superclass. This is rigid, and if changes are done to the superclass, this means that all subclasses will need to be checked so that they don't break. This uses [[abstract]] classes and the [[extends]] keyword.\n \n''Interface (aka type inheritance or subtyping)''\nThis allows unrelated classes to have a relationship. This reduces the tight coupling of the above method, you program to the interface not the implementation. This method allows multiple inheritance. This uses [[interface]]s and the [[implements]] keyword.\n\nTrue multiple inheritance is not possible in Java.\n
The ''InputStream'' is an abstract class that allows us to read byte data as well as close the stream. \nIt is the superclass of all input streams.\nWe will typically use the [[FileInputStream]] class, to read bytes from files.
Instance variables are created whenever a class is instantiated. \nEach instance has that variable, and it is independent of the same variable in another instance.\nQuite the opposite are [[Static Variables]].
Java is an [[object oriented|OO]] programming language. It has [[multithreading]] and [[Networking]] capabilities as well as automatic garbage collection lotsa other cool things. Bytecode is created by compilation and can run on any JVM on any platform. Here are some starting points:\n*[[Getting setup]]\n*[[The Basics]]\n*[[The Java 7 API|https://docs.oracle.com/javase/7/docs/api/overview-summary.html]]\n*[[hello, world]]\n*[[Collection Framework]]\n*[[Generics]]\n*[[IO]]\n*[[java.net]]\nSee also: http://langref.org/all-languages\n\n
There are two ways to traverse collections: \n*with the [[for-each]] construct \n*using [[Iterators]].
Iterator is an interface in the ''java.util'' class.\nIt allows you to iterate thru a list of elements in a standard way. Here are some methods in the ''iterator'' interface:\n*public boolean hasNext();\n*public Object next();\n**If you call ''next()'' and there is none, you get exception: ''~NoSuchElementException''\n*public void remove();\nThe [[data structures]] that implements this ''iterator'' interface, will provide the implementation of the above methods.\nHere are two examples, the first is more detailed, the 2nd is streamlined:\n<html><pre>\n ArrayList aList = new ArrayList();\n // Populate aList.\n Iterator iter = aList.iterator();\n while (iter.hasNext()) {\n Object o = aList.next();\n // If we knew that we were dealing with strings...\n // String s = (String) aList.next();\n }\n</pre></html>\nThis is more succinct<html><pre>\n ArrayList aList = new ArrayList();\n // Populate aList.\n while (aList.hasNext()) {\n Object o = aList.next();\n // If we knew that we were dealing with strings...\n // String s = (String) aList.next();\n }\n</pre></html>\nDone as a For loop<html><pre>\n ArrayList aList = new ArrayList();\n // Populate aList.\n for (Iterator i = aList.iterator(); i.hasNext(); ) {\n Object o = i.next();\n // If we knew that we were dealing with strings...\n // String s = (String) i.next();\n }\n</pre></html>\nWe can also use [[Generics]], although there is no ''iterator'' ???\nHere we go<html><pre>\n ArrayList<String> aList = new ArrayList<>();\n // Populate aList.\n for (String a : aList) {\n ... // We have the string in var "a"\n }\n</pre></html>
An Iterator is an object that enables you to traverse through a collection and to remove elements from the collection selectively, if desired. You get an Iterator for a collection by calling its iterator method. The following is an example of a polymorphic, which means it works for any collection:\n<HTML><PRE>\nstatic void filter(Collection<?> c) {\n for (Iterator<?> it = c.iterator(); it.hasNext(); )\n if (!cond(it.next()))\n it.remove();\n}\n</PRE></HTML>
[[abstract]]\n[[array]]\n[[assert]]\n[[Autoboxing]]\n[[block]]\n[[Bounded Type Parameters]].\n[[Checked]]\n[[class]]\n[[class example]]\n[[class variables|Static Variables]]\n[[Classes to know]]\n[[Comparator]]\n[[compile]]\n[[Collection]]\n[[Collection Framework]]\n[[comparison]]\n[[Concurrency]]\n[[conditional operator]]\n[[Constants]]\n[[Constructor]]\n[[data structures]]\n[[eclipse]]\n[[Encapsulation]]\n[[enum]]\n[[Enumeration]]\n[[equality]]\n[[Erasure]]\n[[Error]]\n[[Exception]]\n[[exceptions - roll yer own]]\n[[extends]]\n
[[final]]\n[[File]]\n[[FileReader]]\n[[FileWriter]]\n[[for loop]]\n[[for-each]]\n[[format strings]]\n[[Generics]]\n[[Getting setup]]\n[[HashSet]]\n[[Hashtable]]\n[[Identifiers]]\n[[if]]\n[[implements]]\n[[Inheritance]]\n[[interface]]\n[[import]]\n[[InputStream]]\n[[instance]]\n[[Instance Variables]]\n[[instanceof]]\n[[IO]]\n[[IO Classes]]\n[[Iteration]]\n[[java.lang]] \n[[keyword]]\n[[LinkedHashSet]]\n[[List]]\n[[literal]]\n[[Map]]\n[[Math]]\n[[memory]]\n[[method]]\n[[modifiers]]\n[[multithreading]]
[[Networking]]\n[[NullPointerException]]\n[[Object]]\n[[OO]]\n[[operators]]\n[[OutputStream]]\n[[Overloading]]\n[[Overriding]]\n[[package]]\n[[Polymorphism]]\n[[primitive]]\n[[println]]\n[[process]]\n[[Queue]]\n[[read webpage]]\n[[Reader]]\n[[Reify]]\n[[Runnable]]\n[[runtime exceptions]]
[[Scanner]]\n[[Set]]\n[[static]]\n[[Static Initializers]]\n[[Static Methods]]\n[[Static Variables]]\n[[Stream]]\n[[String Class]]\n[[subclass]]\n[[substring]]\n[[super]]\n[[synchronized]]\n[[System]]\n[[Thread]]\n[[thread safety]]\n[[Throwable]]\n[[throws]]\n[[throws example]]\n[[TreeSet]]\n[[try-catch]]\n[[type]]\n[[Unchecked|Checked]]\n[[UML]]\n[[URL]]\n[[utility class]]\n[[varag]]\n[[variables]]\n[[vector]]\n[[while and do]]\n[[Wrapper Class]]\n[[Writer]]\n[[2D array]]\n[[==|equality]]\n[[?|conditional operator]]
/***\n|''Name:''|LegacyStrikeThroughPlugin|\n|''Description:''|Support for legacy (pre 2.1) strike through formatting|\n|''Version:''|1.0.1|\n|''Date:''|Jul 21, 2006|\n|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|\n|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|\n|''License:''|[[BSD open source license]]|\n|''CoreVersion:''|2.1.0|\n|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|\n\n***/\n\n//{{{\n\n// Ensure that the LegacyStrikeThrough Plugin is only installed once.\nif(!version.extensions.LegacyStrikeThroughPlugin)\n {\n version.extensions.LegacyStrikeThroughPlugin = true;\n\nconfig.formatters.push(\n{\n name: "legacyStrikeByChar",\n match: "==",\n termRegExp: /(==)/mg,\n element: "strike",\n handler: config.formatterHelpers.createElementAndWikify\n});\n\n} // end of "install only once"\n//}}}\n
This implementation of [[Set]] is a hash table with a linked list. It orders its elements based on the order they are inserted into the set. It is almost as fast as HashSet, but spares a "chaotic" ordering by [[HashSet]].\nA list has:\n*Positional access: can manipulate elements based on position.\n*Search: finds specified objectand returns its position.\n*Iteration: extends [[Iterator]].\n*Range-view: performs arbitrary range operations.
A List is an ordered [[Collection]]. It is an [[interface]]. It can contain duplicates. There is precise control over data placement, as well as insert, access and delete elements based on position. One can also iterate.\n\n[[Vector]] (a concrete implementation) has been retrofitted to implement List.\n\nThere are two List implementations. \n - [[ArrayList]]: usually better-performing to random access but slow to insert/delete from middle of list..\n - [[LinkedList]]: optimal sequential access, inexpensive insertions & deletions from middle of list.\n\n
[[Introduction]]\n[[Java A-E]]\n[[Java F-M]]\n[[Java N-R]]\n[[Java S-Z]] \n\n[[Swing|http://swing.rtfm.tiddlyspot.com/]]\n[[Eclipse|http://eclipse.rtfm.tiddlyspot.com]]\n[[JSF Notes|http://jsf.rtfm.tiddlyspot.com]]\n[[JSP Notes|http://jsp.rtfm.tiddlyspot.com]]\n[[J2EE Notes|http://j2ee.rtfm.tiddlyspot.com]]\n\n\n''Other Sites''\n[[Concepts|http://concepts.rtfm.tiddlyspot.com]]\n[[Python|http://python.rtfm.tiddlyspot.com/]]\n[[Ruby|http://ruby.rtfm.tiddlyspot.com]]\n[[Rails|http://rails.rtfm.tiddlyspot.com]]\n[[Rails 3|http://rails3.rtfm.tiddlyspot.com]]\n[[linux|http://linux.rtfm.tiddlyspot.com/]]\n[[SQL|http://sql.rtfm.tiddlyspot.com]]\n[[Mongo|http://mongo.rtfm.tiddlyspot.com]]\n[[PHP|http://php.rtfm.tiddlyspot.com]]\n[[Ajax|http://ajax.rtfm.tiddlyspot.com]]\n[[AngularJS|http://angular.rtfm.tiddlyspot.com]]\n[[Javascript|http://javascript.rtfm.tiddlyspot.com]]\n[[CSS|http://css.rtfm.tiddlyspot.com]]\n[[Drupal|http://drupal.rtfm.tiddlyspot.com]] \n[[gae|http://gae.rtfm.tiddlyspot.com/]]\n[[Go|http://go.rtfm.tiddlyspot.com]]\n[[nsis|http://nsis.rtfm.tiddlyspot.com/]]\n[[Groovy|http://groovy.rtfm.tiddlyspot.com/]]\n[[JRuby|http://jruby.rtfm.tiddlyspot.com]]\n[[Grails|http://grails.rtfm.tiddlyspot.com/]]\n\nOther Java sites: \n*[[Javamex|http://www.javamex.com/]]\n*[[Java2s|http://www.java2s.com/Tutorial/Java/CatalogJava.htm]]\n*[[Leepoint|http://www.leepoint.net]]\n
A Map interface is for dealing with key based [[data structures]]. That is - storing and retrieving data based on a key.\nThere are mathods that have ot be implemented by classes that use the ''Map'' interface:\n*''put(String, Object)'' - to put data into a map.\n*''get(String, Object)'' - to get data.\n*''remove(String)'' - to remove data.\n*''size()'' - to get size of map.\n*''isEmpty()'' - to see if map is empty.\nIt is a [[Collection]] that maps keys to values. It is an interface. Each key maps to only one value. Therefore, there are no duplicate keys. Maps provide a safe way to remove elements during iteration. Similar to a hash table, but with added bonus of being able to iterate key/value pairs.\nMap has three implementations:\n*HashMap - allows nulls and is unsynchronised.\n*TreeMap - self balanced binary tree, uses natural ordering or define your own [[Comparator]]. Not synchronised.\n*LinkedHashMap - like HashMap but iterates a predictable order. \n\nThe sub-interface is: [[SortedMap]]. Perfect for a dictionary.\nSee also [[Generics]].\n
The ''java.Math'' class has nothing but static methods and attributes. Math.PI has the constant value of pi. Has a random() method. Go nuts.
Java has networking capabilities and can use both [[application and transport]] layers. Communication between two computers is done by the use of [[sockets]]. A socket will have two [[streams|IO]] - an input stream and an output stream.\nTo connect to another machine you need two things:\n#Address of the machine - 32 bit IP address.\n#Port number (0-65535, 16 bit) Port numbers below 1024 are reserved for predefined services.\n''The Steps''\n#The server will use the ServerSocket class to listen on a port for a connection request.\n#The client uses the [[Socket]] class to attempt to connect - using ''Socket(host, port)''\n#The server will ''~ServerSocket.accept()'' the connection request and be passed the ''Socket'' class to communicate.\n#The file [[IO]] classes are used to communicate within the socket. \n#To terminate the connection, both client & server must ''Socket.close()'' the connection.\nThe server can handle connection & communication to many different clients on the same port.
Object Oriented Programming (OOP) has many advantages over other languages. The basic three are: \n*''Abstraction'' - describe essential components of an object, the make it differ from others\n*[[Encapsulation]] - keeping data and methods associated with object together\n*[[Inheritance]] - objects are able to inherit properties from amother object.\n*[[Polymorphism]] - a class or method that can handle different data types
An object is a way of modeling the real world, by using state and behaviour. Or data (aka fields, variables) and methods (aka functions).\nWe access objects in Java by reference. For an object variable, the [[variable|The Basics]] can only have a reference to an object, whereas in a variable for a [[primitive]] we store the actual variable. \nSo, for an object \n<html><pre>\n Vehicle fury; // This creates a variable named "fury" that can only have a reference value.\n fury = new Vehicle(); // Now the "new" operator create an object in memory and return a reference to the object.\n // The variable "fury" now has a reference to the object we have just created.\n vwBug = new Vehicle("red"); // Calls a constructor to assign red.\n</pre></html>\nWhen we create a new object by using the ''new'' operator. There is a [[Constructor]] that is called whether we have one or not, this sets up the object. Above you can see that we are setting some initial value to be "Red". To many or to few arguments will throw an error.\nTo access attributes or methods in an object, we use the dot notation:\n<html><pre>\n fury.wheelCount = 4; // Set the variable "wheelCount"\n String colour = fury.getColour(); // Access the method "getColour()".\n</pre></html>\nObject comparison is a little tricky, for example, the String class. Both could "look" the same but depending upon creation, they may not be.\n<html><pre>\nString a = "goodbye"; # a == b\nString b = a;\nString c = "goodbye" # a != c\na.equals(c) # This is true!\n</pre></html>Both string "a" and "b" both point to the same object in memory, but "c" points toa different address in memory. Use ''equals'' method to see if "same".
The ''OutputStream'' allows us to write out data. \nWe will typically use the FileOutputStream class, to write out bytes to files.
[[Method]]s can be ''overloaded''. To overload a method simply have a different argument signature. The return-value has to be the same, otherwise it is a different method and not overloaded.
''Overriding'' methods.You can override methods by [[extend]]ing classes and using the same method signature. \nIf you override a method that throws exceptions, you can do one of three things:\n#Throw the same exception\n#Throw a subclass of the exception\n#Throw no exception at all.\nYou cannot do these two things:\n#Throw a parent of the original exception.\n#Throw an exception of a different type.
POJO - stands for Plain Old Java Object
''Polymorphism'' means "one object, many forms". This means that an object can be treated differently based on what object called it, This is usually done by such things as method [[overloading|Overloading]] and method overriding. and means that a superclass variable can refer to a subclass object. \n\n\nthe ability of a single variable of a given type to be used to reference objects of different types, and automatically call the method that is specific to the type of object the variable references. This means it is very easy to add new classes without breaking calling code. This is done using [[interface]]s.
A Queue is a [[Collection]] used to hold multiple elements in a queue. A Queue also provides insertion, deletion and inspection capabilities.\nQueues typically order elements as FIFO. Priority queues are non-FIFO. Each queue must specify its ordering properties.\n\nA call to remove or inspect a queue accesses the head. In a FIFO queue, all new elements are inserted at the tail. Non-FIFO queues can use \ndifferent placement rules.\n\n
|!HTTP|!Method URI|!Operation|!Operation Type|\n|GET|/~UserService/users|Get list of users |Read Only|\n|GET|/~UserService/users/1|Get User with Id 1 |Read Only|\n|PUT|/~UserService/users/2|Insert User with Id 2 |Idempotent|\n|POST|~UserService/users/2|Update User with Id 2 |N/A|\n|DELETE|/~UserService/users/1|Delete User with Id 1 |Idempotent|\n|OPTIONS|/~UserService/users|List the supported operations in web service |Read Only|
The ''Reader'' class is abstract, and is used to read characters. All higher level reading functions descend from here. We will use the [[FileReader]] class, to read files.
In Java OO, a reference is an address to where an object's methods and data are.\nWhen you assign a variable to an object, you are actually assigning a reference to it, not the actual object!\nThis can easily be seen when you assign two different variables to the same object. A change in the object will change both vars.
[[Generics]] reifies array component types but does not reify [[element types]]. \n\nWhen we issue:\n\n new String[size]\n\nan array is allocated and stores info that the components are type String.\n\nWhen we issue:\n\n new ArrayList<String>()\n \na list is allocated but there is no indication of the element type. So we\nsay that Java does not reify list element types, but it does reify \ncomponent types.
Runnable is an interface with defines only the one method "run()". It allows you to create a [[Thread]] and extend it if you wish. It is preferred to use of a new [[Thread]], which if you extend - you are changing the behaviour of threads, not something you want to do.
The java.util class has a method ''Scanner'' that provides a formatted input function. That is, reading in data from keyboard as well as from network streams.
The ''ServerSocket'' class uses [[TCP|application and transport]] to communicate.\n
Set is a sub-interface of [[Collection]] and provides more specific handling of data. There are six concrete implementations of this set. A set cannot contain duplicate elements. This interface models mathematical sets and is used to represent such things as: phone numbers, poker hands...\n\nThere are three implementations of Set, in order of common use: [[HashSet]], [[TreeSet]], and [[LinkedHashSet]].\n\nThere is a sub-interface of this: [[SortedSet]]. Perfect for a membership list.
rob's various miscellaneous mumblings
Java Notes
A ''SortedMap'' is a sub interface of [[Map]] and is a [[Collection]] interface.Its mappings are in ascending key order. This is the Map analog of [[SortedSet]]. Sorted maps are used for naturally ordered collections of key/value pairs, such as dictionaries and telephone directories.
The ''SortedSet'' is a sub interface of [[Set]] and is a [[Collection]] interface. It keeps its elements in ascending order. Several additional operations are provided to take advantage of the ordering. Sorted sets are used for naturally ordered sets, like word and membership lists.
The Stack class in Java is LIFO. It is found in ''java.util''. Some basics:\n*Stack only has one constructor that builds an empty stack.\n*It is a 0 base index system.\n*The ''push()'' method pushes data on to the stack.\n*The ''pop()'' methods pops data off of the stack.\n*The ''empty()'' method determines if the stack is empty.\n<html><pre>\nStack s = new Stack();\n</pre></html>
These are chunks of code that are only *ever* executed once, even before constructors, when the class is initially loaded.\n<html><pre>\n public static final int A = 42;\n public static final int B;;\n...\n static {\n if (A == 8) B = 99;\n else B = 13; }\n</pre></html>\nIf a method has no need to access an instance variable it may be a good candidate for being static. A static variable is useful to have only one value of something, like an object creation count! Or a count of how many times something is done - so it does not matter what particular object (all from same class) calls it, but that it was called.
''Static Methods'' aka ''Class Methods'' are methods that belong to the class, not an instance. So each instance has access to the method that is only in one spot (to be shared) in memory. As opposed to [[instance methods]] where each instance has its own copy in memory of the method. They are made like:\n<html><pre>\n static int getTheBikeCount() { return numberOfBikes; } // Declared\n ...\n Bike.getTheBikeCount() // Called like this ...\n</pre></html>
Static variables (aka ''Class Variables'') are used to have a common variable across all created objects. They are associated with the class and not the instantiated object. \nThese variables and methods can be accessed right away, even before the object is created. If this is important, then it is right to make it static. \nStatic vars are given default values, even if not explicitly given.\nThere will only ever be one variable and one method if they are declared ([[modified|modifiers]]) as ''static''. Quite opposite are [[Instance Variables]].\nThere are many built in classes that have static variables and methods like the [[Math]] class and the [[System]] class.\n<html><pre>\nclass Sled\n static int secret = 42;\nend\n</pre></html>To print this out there are two ways, using the instance name or the class name:\n<html><pre>\nrosebud=New.bike()\nprintln("Rosebud sled secret is " + rosebud.secret);\nprintlh("Sled secret is " + Sled.secret); # This one is better.\n</pre></html>\nBest practise is to use the form: ''<~ClassName>.class_var_name''
In a *nix environment, we use streams to read from a source or write to a source.\nYou first create an object, then write/read to that object.\nFor example, if the source is a file:\n*Input: ''read'' - use FileInputStream, and method read() to read and close() to close.\n**Filtered: ~DataInputStream\n*Output: ''write'' - use FileOutputStream, with methods write() and close().\n**Filtered: ~DataOutputStream\nYou can ''filter'' a stream. \nInstead if reading/writing at full speed a ''filter'' allows you to read/write in a controlled manner. So you read/write to that filter.\nIn handling any stream, you will have to handle exceptions. Like ~FileNotFoundException
Strings are an important part of Java that they have their own class: ''String''.\nOther [[data structures]] are in the ''java.util'' class.\nThe String class has many useful methods, will list a few:\n\na="artbobcow"\n|!Method|!Example|!Description|\n|length|a.length();|Gives length of car "a", so 9|\n|charAt|a.charAt(1);|Giver character at position 1, so "r". (start at zero)|\n|indexOf|a.indexOf('8');|Gives "w", position 8.}|\n|toUpperCase|a.toUpperCase()|Gives: ARTBOBCOW|\nSee [[format strings]].
The ''System'' class has many [[Static Methods]] as well as [[Overloaded|Overloading]] methods, like [[println]]. Important ones are:\n|!Static Class|!I/O|!Description|\n|System.out|Standard output|Writes|\n|System.in|Standard input|Reads from keyboard.|\n|System.err|Standard error|Writes|\n
Java is Object Oriented ([[OO]]).\nJava source files end with ''.java''. Each file typically should (but not required) have to contain, in this order:\n*[[Package|package]] declaration - used to group related classes and interfaces. Allows namespacing.\n*[[Import|import]] statements - don't actually import, but rather give us a shorter name to access classes and methods within.\n*[[Class|class]] definitions\nJava only allows single class inheritance, so get around this we have [[interface]]s.\nJava has many keywords, like [[class]], [[foreach]], [[static]] and so forth. Identifiers are variables and must start with either a letter, underscore or a dollar sign. Identifiers cannot be a [[keyword]]. They are case sensitive.\nThere are [[primitive]] types as well as other [[type]]s.\n*Creating a new [[Object]]\n*Creating a [[class]]\n*Controlling access to vars, methods, & classes: [[modifiers]]\n*[[control]] - vars, loops,blocks, assignments...\n*To handle [[Exception]]s we have [[Throwable]].\n*[[data structures]]
A ''Thread'' is a lightweight [[process]] that runs in a [[multithreading]] environment. Each thread (which is an instance of class Thread) in a process has access to all the resources of that process. The following are ''Thread'' methods:\n|!Method|!Description|\n|start()|This starts a thread, don't use run()!|\n|isAlive()|Is the thread still alive?|\n|getName() |Get the thread name. There is also set method.|\n|getPriority()|Get thread priority. There is also set method.|\n|sleep()|Puts thread in a suspended state. Must be in [[try-catch]] block. Not guaranteed to be accurate.|\n|[[interrupt()]]|This will halt the execution of a thread. A thread can interrupt itself.|\n|yield()|Let someone else use time if needed.|\n|join()|This will cause a thread to finish processing before moving on.|\n|wait()|Will cause a thread to suspend, releasing any locks it has, therefore only in [[synchronized]] code.|\n|notify()|Will notify (or wake up) a thread that is waiting for that object.|\n|yield()|Yield control to another thread.|\nFor java it is simplier to extend from the Thread class. Otherwise, you implement the Runnable interface, which is better OO design.\n
When an error occurs, an instance of the ''Throwable'' class is created.\n''Throwable'' has two different subclasses: [[Error]] and [[Exception]]\n''Exception'' is a subclass of ''Throwable''. Subclasses of Exception are either [[Checked]] or ''Unchecked'' exceptions.
Java Notes\nhttp://www.leepoint.net/notes-java/
Is an implementation of [[Set]], slower then [[HashSet]] but orders its data based on the value. \n
UML notation for Java:\n|!Symbol|!Description|\n|#|Protected [[modifier|modifiers]].|\n|-|Private modifier.|\n|+|Public modifier.|\nUnderlines variables and methods are [[static]].\nDashed lines joining objects means implements an interface.\nSolid lines joining objects means inherits (extands) a class.
A Uniform Resource Locator or ''URL'' is a reference to locate data on the internet. The URL class provides many methods for getting port, host, ref etc information from the URL. In java to create a URL object:\n<html><pre>\n URL rtfm = new URL("http://rtfm.ca/"); // Absolute\n URL rtfmPix = new URL(rtfm, "pictures.html"); // Relative\n</pre></html>\n\n
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |\n| 16/11/2006 11:41:25 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 16/11/2006 13:51:35 | rob | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 16/11/2006 13:51:35 | rob | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/4/2007 14:36:21 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 15:46:17 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:20:36 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:22:26 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:24:43 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:26:3 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:28:3 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:32:58 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/4/2007 16:34:1 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/4/2007 16:36:17 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/4/2007 16:37:10 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/4/2007 16:38:32 | rvr | [[/|http://rtfm.tiddlyspot.com/#]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/4/2007 0:7:11 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/4/2007 0:7:30 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 10/4/2007 1:53:50 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/4/2007 1:59:49 | rvr | [[rtfm(3).html|file:///C:/Documents%20and%20Settings/RobRichards/Desktop/rtfm(3).html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 10/4/2007 2:3:18 | rvr | [[rtfm(3).html|file:///C:/Documents%20and%20Settings/RobRichards/Desktop/rtfm(3).html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/4/2007 16:10:21 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/4/2007 0:28:5 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/4/2007 23:46:40 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 28/4/2007 21:9:40 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/5/2007 2:10:52 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/1/2008 18:27:58 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 8/1/2008 20:36:34 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/1/2008 23:9:3 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/1/2008 23:10:5 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/1/2008 23:13:52 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/1/2008 17:54:9 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 21/1/2008 21:38:32 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 24/2/2008 22:58:5 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 24/3/2008 18:26:57 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/9/2008 15:27:38 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 28/1/2009 19:26:0 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 28/1/2009 22:25:30 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/2/2009 19:24:25 | YourName | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/2/2009 19:10:5 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/2/2009 23:34:4 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 11/2/2009 19:40:2 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 14/2/2009 23:48:44 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 15/2/2009 14:1:23 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 15/2/2009 14:20:15 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 15/2/2009 16:58:59 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 15/2/2009 17:18:45 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/2/2009 23:26:5 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/2/2009 0:9:46 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/2/2009 0:13:15 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/2/2009 14:42:54 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/2/2009 16:28:52 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/3/2009 14:32:41 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 4/3/2009 17:25:29 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/3/2009 23:53:35 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 5/3/2009 1:20:45 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/3/2009 20:40:36 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/3/2009 19:7:59 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html#IO]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/3/2009 16:35:27 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/3/2009 23:14:7 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 1/4/2009 23:24:49 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 1/4/2009 23:27:11 | rvr | [[rtfm.html|file:///C:/Docs/notes/programming/tiddly/rtfm.html]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 1/6/2009 10:28:53 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 14/6/2009 11:40:49 | YourName | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/9/2009 14:18:16 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 23/11/2009 22:0:56 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 24/2/2010 10:48:25 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/8/2010 23:42:45 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 14/8/2010 10:2:41 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 15/8/2010 23:12:44 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 16/8/2010 21:52:6 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 17/8/2010 20:33:54 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/8/2010 20:58:13 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/8/2010 21:24:18 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 18/8/2010 22:44:15 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/8/2010 0:41:31 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/8/2010 19:18:42 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/8/2010 22:39:29 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/8/2010 23:38:47 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/8/2010 1:19:8 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 20/8/2010 10:21:8 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/8/2010 10:24:1 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/8/2010 23:11:23 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 21/8/2010 22:18:7 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 23/8/2010 20:59:13 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 24/11/2010 15:25:17 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/12/2010 21:28:58 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 28/2/2011 1:49:8 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 12/7/2011 10:45:43 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 12/7/2011 10:45:55 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 17/8/2011 21:22:15 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/8/2011 21:23:33 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/9/2011 22:5:30 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 5/9/2011 23:34:37 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 12/9/2011 18:19:39 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 14/9/2011 1:16:17 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 27/9/2011 13:52:3 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 3/11/2011 21:52:51 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/4/2012 21:0:6 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/4/2012 22:47:10 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/5/2012 17:15:22 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 28/6/2012 13:37:51 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 31/8/2012 10:17:18 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 1/7/2016 0:4:9 | fred | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 17/2/2017 15:45:23 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/2/2017 16:36:32 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/2/2017 17:2:49 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 21/2/2017 8:20:42 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 22/2/2017 22:45:6 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/2/2017 23:8:10 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/2/2017 23:19:56 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 23/2/2017 12:42:34 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 23/2/2017 16:8:7 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 23/2/2017 16:31:19 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 23/2/2017 16:39:21 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 24/2/2017 9:21:36 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 24/2/2017 9:34:51 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 24/2/2017 9:47:44 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 24/2/2017 10:10:4 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/2/2017 15:3:26 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/2/2017 21:35:30 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/2/2017 21:42:18 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 28/2/2017 10:4:40 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 28/2/2017 10:24:1 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 28/2/2017 20:28:23 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 28/2/2017 23:2:46 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 1/3/2017 20:10:55 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 3/3/2017 15:54:50 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 3/3/2017 16:37:6 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 3/3/2017 17:12:15 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 3/3/2017 22:20:52 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 3/3/2017 22:29:53 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 3/3/2017 23:18:42 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 4/3/2017 13:30:48 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 4/3/2017 13:38:55 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/3/2017 20:15:38 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 9/3/2017 10:54:6 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 9/3/2017 10:55:45 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 9/3/2017 10:57:2 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 9/3/2017 16:4:29 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/3/2019 20:14:34 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 11/3/2019 21:45:33 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 13/3/2019 10:8:28 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 26/4/2019 0:40:17 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 30/8/2020 22:38:32 | rvr | [[/|http://rtfm.tiddlyspot.com/]] | [[store.cgi|http://rtfm.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***\n|''Name:''|UploadPlugin|\n|''Description:''|Save to web a TiddlyWiki|\n|''Version:''|3.4.4|\n|''Date:''|Sep 30, 2006|\n|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|\n|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|\n|''Author:''|BidiX (BidiX (at) bidix (dot) info)|\n|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|\n|''~CoreVersion:''|2.0.0|\n|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|\n|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|\n|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|\n***/\n//{{{\nversion.extensions.UploadPlugin = {\n major: 3, minor: 4, revision: 4, \n date: new Date(2006,8,30),\n source: 'http://tiddlywiki.bidix.info/#UploadPlugin',\n documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',\n author: 'BidiX (BidiX (at) bidix (dot) info',\n license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',\n coreVersion: '2.0.0',\n browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'\n};\n//}}}\n\n////+++!![config.lib.file]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.file) config.lib.file= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.file.dirname = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n } else {\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n }\n};\nconfig.lib.file.basename = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("#")) != -1) \n filePath = filePath.substring(0, lastpos);\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(lastpos + 1);\n } else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n};\nwindow.basename = function() {return "@@deprecated@@";};\n//}}}\n////===\n\n////+++!![config.lib.log]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.log) config.lib.log= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 1}, \n date: new Date(2006,8,19)\n};\nconfig.lib.Log = function(tiddlerTitle, logHeader) {\n if (version.major < 2)\n this.tiddler = store.tiddlers[tiddlerTitle];\n else\n this.tiddler = store.getTiddler(tiddlerTitle);\n if (!this.tiddler) {\n this.tiddler = new Tiddler();\n this.tiddler.title = tiddlerTitle;\n this.tiddler.text = "| !date | !user | !location |" + logHeader;\n this.tiddler.created = new Date();\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[tiddlerTitle] = this.tiddler;\n else\n store.addTiddler(this.tiddler);\n }\n return this;\n};\n\nconfig.lib.Log.prototype.newLine = function (line) {\n var now = new Date();\n var newText = "| ";\n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += config.options.txtUserName + " | ";\n var location = document.location.toString();\n var filename = config.lib.file.basename(location);\n if (!filename) filename = '/';\n newText += "[["+filename+"|"+location + "]] |";\n this.tiddler.text = this.tiddler.text + "\sn" + newText;\n this.addToLine(line);\n};\n\nconfig.lib.Log.prototype.addToLine = function (text) {\n this.tiddler.text = this.tiddler.text + text;\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[this.tiddler.tittle] = this.tiddler;\n else {\n store.addTiddler(this.tiddler);\n story.refreshTiddler(this.tiddler.title);\n store.notify(this.tiddler.title, true);\n }\n if (version.major < 2)\n store.notifyAll(); \n};\n//}}}\n////===\n\n////+++!![config.lib.options]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.options) config.lib.options = {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\n\nconfig.lib.options.init = function (name, defaultValue) {\n if (!config.options[name]) {\n config.options[name] = defaultValue;\n saveOptionCookie(name);\n }\n};\n//}}}\n////===\n\n////+++!![PasswordTweak]\n\n//{{{\nversion.extensions.PasswordTweak = {\n major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),\n type: 'tweak',\n source: 'http://tiddlywiki.bidix.info/#PasswordTweak'\n};\n//}}}\n/***\n!!config.macros.option\n***/\n//{{{\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) \n {\n var optNode = nodes[t].getAttribute("option");\n if (opt == optNode) \n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n};\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n if(config.options[opt] === undefined) {\n return;}\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.className = "txtOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "pasOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n};\n//}}}\n/***\n!! Option cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n};\n\nwindow.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n};\n//}}}\n/***\n!! Initializations\n***/\n//{{{\n// define config.options.pasPassword\nif (!config.options.pasPassword) {\n config.options.pasPassword = 'defaultPassword';\n window.saveOptionCookie('pasPassword');\n}\n// since loadCookies is first called befor password definition\n// we need to reload cookies\nwindow.loadOptionsCookie();\n//}}}\n////===\n\n////+++!![config.macros.upload]\n\n//{{{\nconfig.macros.upload = {\n accessKey: "U",\n formName: "UploadPlugin",\n contentType: "text/html;charset=UTF-8",\n defaultStoreScript: "store.php"\n};\n\n// only this two configs need to be translated\nconfig.macros.upload.messages = {\n aboutToUpload: "About to upload TiddlyWiki to %0",\n backupFileStored: "Previous file backuped in %0",\n crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileLocked: "Files is locked: You are not allowed to Upload",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n passwordEmpty: "Unable to upload, your password is empty",\n urlParamMissing: "url param missing",\n rssFileNotUploaded: "RssFile %0 NOT uploaded",\n rssFileUploaded: "Rss File uploaded to %0"\n};\n\nconfig.macros.upload.label = {\n promptOption: "Save and Upload this TiddlyWiki with UploadOptions",\n promptParamMacro: "Save and Upload this TiddlyWiki in %0",\n saveLabel: "save to web", \n saveToDisk: "save to disk",\n uploadLabel: "upload" \n};\n\nconfig.macros.upload.handler = function(place,macroName,params){\n // parameters initialization\n var storeUrl = params[0];\n var toFilename = params[1];\n var backupDir = params[2];\n var uploadDir = params[3];\n var username = params[4];\n var password; // for security reason no password as macro parameter\n var label;\n if (document.location.toString().substr(0,4) == "http")\n label = this.label.saveLabel;\n else\n label = this.label.uploadLabel;\n var prompt;\n if (storeUrl) {\n prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {\n config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); \n return false;}, \n null, null, this.accessKey);\n};\nconfig.macros.upload.UploadLog = function() {\n return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );\n};\nconfig.macros.upload.UploadLog.prototype = config.lib.Log.prototype;\nconfig.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {\n var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";\n line += uploadDir + " | " + toFilename + " | " + backupDir + " |";\n this.newLine(line);\n};\nconfig.macros.upload.UploadLog.prototype.endUpload = function() {\n this.addToLine(" Ok |");\n};\nconfig.macros.upload.basename = config.lib.file.basename;\nconfig.macros.upload.dirname = config.lib.file.dirname;\nconfig.macros.upload.toRootUrl = function (storeUrl, username)\n{\n return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));\n}\nconfig.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)\n{\n var root = this.toRootUrl(storeUrl, username);\n if (uploadDir && uploadDir != '.')\n root = root + '/' + uploadDir;\n return root;\n}\nconfig.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)\n{\n return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;\n}\nconfig.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)\n{\n // parameters initialization\n storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);\n toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);\n backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);\n uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);\n username = (username ? username : config.options.txtUploadUserName);\n password = config.options.pasUploadPassword; // for security reason no password as macro parameter\n if (!password || password === '') {\n alert(config.macros.upload.messages.passwordEmpty);\n return;\n }\n if (storeUrl === '') {\n storeUrl = config.macros.upload.defaultStoreScript;\n }\n if (config.lib.file.dirname(storeUrl) === '') {\n storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;\n }\n if (toFilename === '') {\n toFilename = config.lib.file.basename(document.location.toString());\n }\n\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n if (!storeUrl) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n // Check that file is not locked\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {\n alert(config.macros.upload.messages.fileLocked);\n return;\n }\n }\n \n var log = new this.UploadLog();\n log.startUpload(storeUrl, toFilename, uploadDir, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);\n displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);\n this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";\n this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, \n function (responseText) {\n if (responseText.substring(0,1) != '0') {\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);\n displayMessage(config.macros.upload.messages.rssFileUploaded.format(\n [toFileUrl]), toFileUrl);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n });\n }\n return;\n};\n\nconfig.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);\n return;\n }\n else {\n // standard way : Local file\n \n original = loadFile(getLocalPath(document.location.toString()));\n if(window.Components) {\n // it's a mozilla browser\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]\n .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);\n converter.charset = "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n }\n //DEBUG alert(original);\n this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password);\n};\n\nconfig.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it\n var endSaveArea = '</d' + 'iv>';\n // Locate the storeArea div's\n var posOpeningDiv = original.indexOf(startSaveArea);\n var posClosingDiv = original.lastIndexOf(endSaveArea);\n if((posOpeningDiv == -1) || (posClosingDiv == -1))\n {\n alert(config.messages.invalidFileError.format([document.location.toString()]));\n return;\n }\n var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n var newSiteTitle;\n if(version.major < 2){\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n\n revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");\n revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPreHead","") + "\sn");\n revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPostHead","") + "\sn");\n revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPreBody","") + "\sn");\n revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPostBody","") + "\sn");\n\n var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, \n username, password, function (responseText) {\n if (responseText.substring(0,1) != '0') {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));\n }\n else {\n if (uploadDir !== '') {\n toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);\n } else {\n toFilename = config.macros.upload.basename(toFilename);\n }\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n if (responseText.indexOf("destfile:") > 0) {\n var destfile = responseText.substring(responseText.indexOf("destfile:")+9, \n responseText.indexOf("\sn", responseText.indexOf("destfile:")));\n toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;\n }\n else {\n toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format(\n [toFileUrl]), toFileUrl);\n if (backupDir && responseText.indexOf("backupfile:") > 0) {\n var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, \n responseText.indexOf("\sn", responseText.indexOf("backupfile:")));\n toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;\n displayMessage(config.macros.upload.messages.backupFileStored.format(\n [toBackupUrl]), toBackupUrl);\n }\n var log = new config.macros.upload.UploadLog();\n log.endUpload();\n store.setDirty(false);\n // erase local lock\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n BidiX.GroupAuthoring.lock.eraseLock();\n // change mtime with new mtime after upload\n var mtime = responseText.substr(responseText.indexOf("mtime:")+6);\n BidiX.GroupAuthoring.lock.mtime = mtime;\n }\n \n \n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n};\n\nconfig.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, \n username, password, callbackFn) {\n var boundary = "---------------------------"+"AaB03x"; \n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n if (window.netscape){\n try {\n if (document.location.toString().substr(0,4) != "http") {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}\n }\n catch (e) {}\n } \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data; name=\s"";\n sheader += config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + username \n +";password=" + password\n +";uploaddir=" + uploadDir;\n // add lock attributes to sheader\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n var l = BidiX.GroupAuthoring.lock.myLock;\n sheader += ";lockuser=" + l.user\n + ";mtime=" + l.mtime\n + ";locktime=" + l.locktime;\n }\n sheader += ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data; name=\s"userfile\s"; filename=\s""+toFilename+"\s"\sr\sn";\n sheader += "Content-Type: " + config.macros.upload.contentType + "\sr\sn";\n sheader += "Content-Length: " + content.length + "\sr\sn\sr\sn";\n // compose trailer data\n var strailer = new String();\n strailer = "\sr\sn--" + boundary + "--\sr\sn";\n //strailer = "--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n //request.open("POST", storeUrl, true, username, password);\n try {\n request.open("POST", storeUrl, true); \n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if (request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent + "\snStatus: "+request.status.statusText);\n }\n };\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n};\n\n\nconfig.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, \n username, password) {\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n if (uploadUrl.substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n //request.open("GET", document.location.toString(), true, username, password);\n try {\n request.open("GET", document.location.toString(), true);\n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n \n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, \n uploadToFilename, uploadDir, uploadBackupDir, username, password);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format(\n [document.location.toString()]) + "\snStatus: "+request.status.statusText);\n }\n };\n request.send(null);\n};\n\n//}}}\n////===\n\n////+++!![Initializations]\n\n//{{{\nconfig.lib.options.init('txtUploadStoreUrl','store.php');\nconfig.lib.options.init('txtUploadFilename','');\nconfig.lib.options.init('txtUploadDir','');\nconfig.lib.options.init('txtUploadBackupDir','');\nconfig.lib.options.init('txtUploadUserName',config.options.txtUserName);\nconfig.lib.options.init('pasUploadPassword','');\nsetStylesheet(\n ".pasOptionInput {width: 11em;}\sn"+\n ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadFilename {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadDir {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadBackupDir {width: 25em;}\sn"+\n "",\n "UploadOptionsStyles");\nconfig.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\sn"; \nconfig.options.chkAutoSave = false; saveOptionCookie('chkAutoSave');\n\n//}}}\n////===\n\n////+++!![Core Hijacking]\n\n//{{{\nconfig.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\n\nconfig.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;\n\nconfig.macros.saveChanges.handler = function(place)\n{\n if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))\n createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);\n};\n\n//}}}\n////===\n
Test list\n* one item\n* two items\n
This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.\n\n@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://rtfm.tiddlyspot.com/controlpanel]] (your control panel username is //rtfm//).\n<<tiddler tiddlyspotControls>>\n@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the "save to web" button in the column on the right.\n\n@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click "upload" and your ~TiddlyWiki will be saved back to tiddlyspot.com.\n\n@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].\n\n@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions.
The wrapper class is an object representation of the [[primitive]]s. So for primitive ''int'' we have ''Integer'' and ''double'' we use ''Double''.
The ''Writer'' class is abstract, and is used to write out characters. Also a close method and others. We will typically used the [[FileWriter]] class.
An ''abstract class'' is a class that is uninstantiable. It may have both may have both concrete and abstract methods. Abstract methods have only their signature without any code. Therefore derived (inherited ie child) classes must provide a definition, making the method [[polymorphic|Polymorphism]].\nTherefore, the parent method will have an abstract method like:\n<html><pre>\n public abstract class BiteMe { ...\n...\n public abstract int calcualteMagicNumber();\n...\n</pre></html>So when we extend the parent class, the child class *must* implement the ''calcualteMagicNumber'' method. If not you get a compiler error.
Java uses both ''application and transport'' layers in [[Networking]]. The transport layer has both TCP and UDP.\n*TCP is used when reliable communication is required, that is information is guaranteed or errors are reported (HTTP, FTP). \n*UDP does not guarantee if data gets there, uses datagrams and is used by Ping or clock functions\nThe application layer has HTTP, ftp, telnet. (Java classes: URL, URLConnection, Socket, and ServerSocket).\nThe transport layer has TCP, UDP, . (Java classes: DatagramPacket, DatagramSocket, and MulticastSocket).\nTCP and UDP deliver data to ''Ports'', which are identified by a 16-bit number.
Array is an object that holds information. Primitives are stored as [[primitive]]s and objects are stored as object reference variable - which points to the real object. The ''type'' below can either be primitive or an object and the array_name is how we identify the array. These variables names are created in stack memory are are not yet instantiated. See also [[2D array]].\nFormat: @@<type> [] <array_name>@@\n<html><pre>\n float [] depth; // Declare - This creates the array of floats called depth\n depth = new float [13]; // Construct - This creates the array object, the array itself, with 13 spaces available.\n depth[0] = 6.66f; // Initialize - This is to place values in the array. Index starts at zero.\n\n String [] colours = { "red", "yellow", "green" }; // This declares, creates, and populates an array.\n</pre></html>\nThis table shows what the default values are when we create an array object..\nSee also [[data structures]].\n|!Type|!Default Value|\n|int, byte, short|0|\n|float|0.0f|\n|double|0.0d|\n|char|\su0000|\n|boolean|false|\n|String|null|\n!!Multidimensioned Array\nThese are declared like:\n<html><pre>\nint[][] a; \na = new int[3][3];\n\nint[][] b = new int [3][3]; // Preferred & shorter method\n</pre></html>\n\n
The assert statement is used to test pre and post conditions. Assertions are not used for production. If it fails an AssertionError is thrown.\n<html><pre>\n assert &lt;boolean-expression&gt; ;\n assert &lt;boolean-expression&gt; ; &lt;detail-expression&gt;;\n // Examples of assert.\n assert ( x == 42);\n assert false : "That was so wrong.";\n</pre></html>
See [[variables]], [[comparison]], [[literals]].\nAssigning values to [[primitive]]s\n<html><pre>\nint j,k\nj=42;\nk=j/21;\n</pre></html>\nAssigning values to [[References]] \n<html><pre>\nInteger i2 = new Integer("22"); \nSystem.out.println("i2 class is : " + i2.getClass().getName()); # => i2 is : i2 class is : java.lang.Integer \n</pre></html>\n!!Mathematical Operations\n<html><pre>\nint a=42, b=7;\nSystem.out.println(a+b); # Gives 49\nSystem.out.println(a-b); # Gives 35\n</pre></html>\n!!Relational Operators\n<html><pre>\nint a=42, b=7;\nSystem.out.println("a > b : "+(a > b)); # Gives: a > b : true\n</pre></html>\n!!Compound Operators\n<html><pre>\nint a=42, b=7;\na += 100;\nSystem.out.println("a : " + a); # Gives: a : 142\n</pre></html>\n!!Increment & Decrement\nWe have a few options:\n\n<html><pre>\nx += y // x=x + y\na -= b // a=a-b\nc *= d // c=c*d\ne /= f // e=e/f\ni++ // i=i+1\nj-- // j=j-1\n</pre></html>\n\n!!Assign var to Objects\nIt is straightforward, use the dot notation. For An instance named "User", we want to set the var "age": User.age = 42;
Local chunks of code are called ''blocks''. It looks like:\n<html><pre>\nvoid doSomeBlockOfCode() {\n a=42;\n}\n</pre></html>\nThey can also look slightly different, like in an [[if]] statement, the block starts and ends with cutry brackets,\n<html><pre>\nif (fruit == "Banana") {\n int count = 42;\n println("Peel away!);\n println("And then eat it!");\n}\n</pre></html>
Casting allows us to use objects of one type to represent another. There is implicit and explicit casting.\n<html><pre>\n Object obj = new Bike(); // implicit casting, obj is both an object and a bike.\n Bike a = (Bike)obj; // explicit casting\n</pre></html>\n!!Casting Primitives\nWhen you cast a [[primitive]] most have some degree of flexibility, but not booleans. They are black & white, haha.\nIf the destination is larger then the original, typically that is done without problem, The other can be a problem.\nTo cast to a larger type into a smaller one, you'll use: @@<type-name> value@@\nAn example would be: @@int hotness = (int) (a/b)@@ \n!!Casting Objects\nThis is possible, easy in fact when casting down. Casting up is different as superclasses will not have all the method that their subclasses have.\nCast format is (only needed for upcasting): @@(class-name} object@@ Note that the class-name is the destination class.\nYou cannot cast: @@primitives &larr; to &rarr; Objects@@\nHowever, [[primitive]]s have classes that correspond to them or ''wrap'' them, so for ''int'' we have ''Integer'' etc\nHere is some casting magic (see [[Autoboxing]]):\n<html><pre>\nint jenny = 8675309;\nInteger jennyJenny = new Integer(x);\nint oldJenny = jennyJenny.intValue(); \n\nString jen1="8675309";\nint jen2 = Integer.parseInt(jen1); # String must be numbers only! Else ~NumberFOrmatException\n</pre></html>
The ''class'' is like a blueprint of a building. Every java class has only one direct ''superclass'', except [[Object]] which is at the top of the pile. A class that you make can only inherit one class, but can implement multiple [[interface]]s. \nA class is declared like:\n<html><pre>\n &lt;class_modifier&gt class class-name \n [extends superclass-name]\n [implements interface-name, interface-name2, ...] \n [throws exception-name, ...] { ... }\n</pre></html>A class [[extends]] a class and it [[implements]] an [[interface]].\nHere is a basic main class:\n<html><pre>\n public class FirstClass\n public static void main(Sting[] args) {\n // Some code here...\n }\n</pre></html>\nSee [[class example]].
Here is a class with all kinds of things:\n\n<html><pre>\npublic class Bike {\n int wheels; // Instance var\n String name;\n static int COUNT; // Class var\n \n public static void main(String[] args) {\n if (args.length > 0) {\n System.out.println("We have "+args.length+" arguments.");\n for (int i=0; args.length>i; i++) {\n System.out.println("Agrument:"+i+" is: "+args[i]); \n }\n }\n Bike b = new Bike(6);\n System.out.println("Wheels on the bike " + b.countWheels());\n b.setWheels(3);\n System.out.println("Wheels on the bike " + b.countWheels());\n System.out.println("Class var: Count is " + Bike.COUNT);\n }\n Bike () {\n COUNT += 1;\n setWheels(2);\n System.out.println("In Bike constructor......");\n }\n Bike (int wheels) {\n this();\n setWheels(wheels);\n }\n int countWheels() {\n return wheels;\n }\n void setWheels(int x) {\n this.wheels = x;\n }\n}\n\n\n</pre></html>
Comparisons using [[operators]] will typically produce a boolean response. \nThe usual suspects: =&#61;, !=, <, >,...\n<html><pre>\nboolean happy = (health > 5) && (money == "lots");\n</pre></html>
You have to compile java code before running it.\nYou'd compile it like: @@javac ~HelloWorld.java@@\nAnd you'd run it like: @@java ~HelloWorld@@\n\nIf you have the class wrapped up in a [[package]], then it is slightly different. You have to compile and place the class file in the correct directory:\nGiven the stmt: @@package ca.rtfm.hello@@\n#To create class in the package-directory, ie: ''./ca/rtfm/hello''\n#Compile it like: @@javac ~HelloWorld.java -d .@@\n#The class file will be in directory: ''./ca/rtfm/hello''\n#Run it like: @@java ca.rtfm.hello.~HelloWorld@@
The ''conditional operator'' or ''?'' is also known as a ternary operator. It is used to pack simple coding into one statement. For example the following code:\n<html><pre>\nif (x) { a = b; }\n else { a = c; }\n</pre></html>Can be written as:<html><pre>\n a = x ? b : c;\n</pre></html>\n
The basics of programming Java\n*[[variables]]\n*[[assignment]]\n*[[block]]\n*[[if]] statements, bonus: ternary!\n*[[for loop]]s\n*[[while and do]] loops
Java has many data structures. The basic ones are [[String Class]] and [[array]], but there are many more.\nData structures (except array) are in the ''java.util'' class.\n*''~BitSet'' - used to work on bits, or boolean vars.\n*[[ArrayList]] - Like an [[array]] but can grow as needed, as well it can shrink.\n*[[Stack]] - Stack is a LIFO structure, you push and pull from the top of the stack.\n*[[Map]] - The Map is an interface for key-based data structures.\n*[[HashMap]] - Uses a key-map system to store data.\nThese structures have an [[iterator]] and [[map]] interface. These interfaces provide a standard way of storing and retrieving data \n[[Iterators]] - \n[[Iterator]] - \n\n
Eclipse is an IDE that I often use.\nCheck out http://eclipse.rtfm.tiddlyspot.com/
The ''enum'' is a Java keyword used to declare an enumerated type. \n<html><pre>\n public enum TrafficLights { RED, YELLOW, GREEN }\n...\n public class TrafficGame (\n private TrafficLight light;\n \n public TrafficGame(TrafficLight light) {\n this.light = light;\n }\n }\n</pre></html>
The operator [[==]] tests for equality of the ''reference''.\nThe operator ''equals()'' tests the equality of the ''content''.\n<html><pre>\n String s1 = "hello";\n String s2 = "hello";\n String s3 = new String("hello");\n\n System.out.println( s1 == s2); // will be true\n System.out.println( s1 == s3); // will be false\n System.out.println( s1.equals(s3)); // will be true\n</pre></html>
You can roll your own [[Exception]]s. You have to:\n*Inherit from somewhere in the [[Exception]] class, not the [[Error]] class which is meant for JVM errors.\n*Find a closely related error and subclass that. Example, for file errors, use IOException.\n**If there is none, go directly under [[Exception]].\n*Usually the Exception class has two constructors. \n**The first constructor takes no arguments.\n**The other constructor takes 1 argument, a String.
We use ''extends'' to implement inheritance. We can only extend one other superclass.\n<html><pre>\n &lt;class_modifier&gt; class class-name extends superclass-name\n\n public class Bike extends Vehicle { ... }\n</pre></html>\nThis class now a [[subclass]] to the superclass we extended from. We can access the superclass methods by using the [[super]] keyword.
Final on a class modifier means that you cannot subclass it. String class in java.lang is a ''Final'' class.\nFinal on a method means that you cannot override it when the class is subclassed.\nFinal on a static variable, it becomes a constant.\n<html><pre>\n private static final int MAGIC_NUMBER = 42; // Essentially a constant\n private final int greatNumber; // So this can be set some other time, but not changed thereafter.\n public final void someMethod () { ... } // This cannot be overridden by any subclass\n public final class String { ... } // This cannot be subclassed\n</pre></html>\n
The ''for'' loop, is one of [[The Basics]] of java.\nFormat: @@for (initial; test; increment) { statements... }@@\n*Start at 0\n*Do loop if i<5\n*Increment i by 1\n<html><pre>\nfor (int i=0; i<5; i++ ) {\n System.out.println("Hello there " + i);\n}\nYou can have ncrement as something like @@i += 3@@ - this will increment by jumps of three.\n</pre></html>
Here is an example of a for-each:\n<HTML><PRE>\n List<String> colours = new ArrayList<String>();\n // Load up colours list.\n for (String colour: colours )\n System.out.println(colour);\n</PRE></HTML>
Formatting [[strings|String Class]].\nOne way to do this is\n>System.out.format("Wage: $%,d%n", wage);\n*The @@$@@ gives a''$'' sign.\n*The @@%,d@@ gives numbers separated by a comma\n*The @@%n@@ giver a new line.\n>System.out.format("%.11f%n", Marh.PI); # Wil give: 3.14159265359\n
This is your basic ''hello, world'' app.\n<html><pre>\npublic class HelloWorld {\n public static String hi = "Bonjour"; # Class var - automatically initialized, even if we don't \n public static void main(String[] args) {\n String hi = "Hello"; # Local Variable\n System.out.println(hi+" world");\n System.out.println(HelloWorld.hi+" world");\n }\n}\n</pre></html>\nLet's [[compile]] and run this...\n<html><pre>\n$ javac HelloWorld.java\n$ java -Xmx128M -Xms16M HelloWorld \nHello world \nBonjour world\n</pre></html>\nNow if this were in a [[package]] then we'd have to compile it slightly differently, we'd have to make sure that the directories are there.\nYou'd compile it like: @@javac ~HelloWorld.java -d .@@\nAnd you'd run it like: @@java path.to.directory.~HelloWorld@@
The ''if'' statement is can be a few formats. See also [[block]].\n<html><pre>\nif (age < 2) \n println("GooGoo.");\n\nif (age < 18) {\n println("You cannot vote yet.");\n} else {\n println("Welcome to the polling station.);\n}\n</pre></html>\nThere is also a ternary if, \n*Format: @@test ? true-result : flase-result@@\n*Example: @@String answer = 42>41 ? "Biteme" : "Go Home";@@ \n*The result will be answer="Biteme"\nSee also [[switch]], which is one of [[The Basics]] of java.\n
In java a class ''implements'' an [[interface]]. \n<html><pre>\n &lt;class_modifier&gt class class-name [implements interface-name, interface-name2, ...] { ... }\n</pre></html>\nThe implementation of a class is an actual object. An ''implementation'' is the realization of something. You have to implement all abstract methods in the interface.\nJava has single inheritance, you can only have one superclass. But you can implement multiple interfaces.\n<html><pre>\n\n</pre></html>
The ''import'' statement is placed at the top of your application. If there is a [[package]] statement, it must follow that.\nThe ''import'' statement only shortens the path name you need to use, nothing else.\nYou can import [[package]]s to use in your application. It can be a specific class, or a whole package of classes.\nYou can always refer to a class by the full path name. \nTo import:\n<html><pre>\n import package_name.*; // The whole shebang\n import package_name.class_name; // A specific class\n Import javax.swing.JButton;\n</pre></html>\nFor the last one, it makes it cleaner in the code to use ''~JButton'' instead of the cumbersome ''javax.swing.~JButton''.\nAlso, you have access to constants, so if you have imported @@java.lang.Math.*@@ then you have access to PI: ''printing(PI);''\nEven with import, if class names clash, you'll have to use the full path. A typical example is the Date class, it is in both ''java.sql'' and ''java.util'' packages.\n
Type the text for 'install on Ubuntu 18'\n<html><pre>\n$ sudo apt install openjdk-11-jdk\n$ sudo add-apt-repository ppa:linuxuprising/java\n$ sudo apt-get update\n$ sudo apt-get install oracle-java11-installer\n$ sudo apt-get install oracle-java11-set-default\n$ java -version\n</pre></html>
When a [[class]] is [[instantiated]] it is called an ''instance''. Therefore you can have many instances of a class. In each instance the variables are called ''instance variables''. Each method in an instance is an ''instance method''. \nThe opposite of this is a [[class variables|Static Variables]] and ''class method'', which is specified by the [[static]] keyword.
The ''instanceof'' keyword is used to determine if an object is an instance of some object. This is useful for casting ''upward'' to make sure we are casting properly - no [[runtime exceptions]].\n<html><pre>\nif (bike instanceOf vehicle) \n Vehicle myBike = (Vehicle)bike ;\n}\n\n</pre></html>
An ''interface'' is a description of typically related methods that an implementing class must have. This allows non-hierarchical classes to have an inheritance relationship. It is just like a class but all of its methods must be [[abstract]]. This is the only way in Java to have multiple inheritance. An interface can be implemented any way that you like but its method signatures must be followed exactly.Here are a list of other characteristics:\n*Key uses of interfaces are: @@inheritance@@ and as an @@API@@.\n*Can be implemented by classes.\n*Can be extended by one or more other interfaces.\n*A class must implement all methods in the interface - if not it must be [[abstract]].\n*Methods must be ''public'', ''abstract'' or ''default''.\n*All variables must be ''public'', [[static]] and [[final]].\n*An interface name can be used anywhere a type can be used.\n*Can contain nested types.\n*an interface is a reference type @@more info@@ please.\n\nA typical interface is defined like:\n<html><pre>\ninterface SecretAgent { \n String CODENAME = '007';\n public abstract void mission();\n}\n</pre></html>or a little more complex:<html><pre>\n public interface SomethingCool extends OtherIface { // public = all have access\n int gears = 22; // All constant are implicitly public, static, or final.\n void DoSomething (int i, String s); // By default this is Public & abstract - because "interface"\n public void DoMore (float f, String s); // By default this is abstract & explicitly public.\n int UndoSomething (double d) ;\n}\n</pre></html>\nTo actually use an interface, we will use the [[implements]] keyword.
The ''interrupt()'' method will halt a thread. This can be called on itself. \n<html><pre>\n t.interrupt();\n</pre></html>\n The ''interrupted()'' method can be used to determine if an interrupt has been called. It is up to the programmer to determine what to do when detected.<html><pre>\nif (Thread.interrupted()) {\n throw new InterruptedException();\n}\n</pre></html>\n Many threading operation operations (like ''sleep()'') require a [[try-catch]] construct.<html><pre>\n try { \n Thread.sleep(4000);\n } catch (InterruptedException e) {\n //We've been interrupted: no more messages.\n return;\n }\n</pre></html>\n
This class is always loaded, it contains: [[String]], Math, System and Integer, amoung others. Others have to be[[import]]ed.
The ''java.net'' package is for communicating on the internet.\nWhen accessing a webpage, many things beyond our control can happen so we use a [[try-catch]] bloxk.\nFirst, set up a URL: @@URL page = new URL(address);@@\n2nd, setup connection: @@HttpURLConnection conn = (HttpURLConnection) page.openConnection();@@\n3rd, open up that URL: @@conn.connect();@@\n4th, use ~BufferedReader to read the stream.\nSee example: [[read webpage]]
You cannot use keywords as names for variables, classes, etc...\nThey include: \nabstract, default, if, private, this, boolean,do,implements , protected, throw, break, double, import, public, throws, byte, else, instanceof, return...
A ''literal'' is a boolean, character, numeric, or string data. A boolean literal is either ''true'' or ''false''. An int literal can be 0, 42, 2017, or 8675309.\nNumber literals, 0, 1, 2, 3, ... These are ints, but can also be byte or short. See [[primitive]].\nLiterals can also be octal (013), hex (0xA), binary (0b101), etc.., \nFloating-point numbers are considered a [[primitive]] type of ''double''. So 3.1415926\nCharacter literals are "a", "b", "#", "$", etc. Also includes special escape codes like: "\sn", "\st", etc, basically unprintable.\nStrings have literals, and a String is an object. Like "hello, world."\nSee also [[Constants]]
Stack memory is short term memory - short lived variables, ie local vars.\nHeap Memory is long term memory - long term variables, ie instance variables.
A ''method'' is a block of code that can be called many times to perform some systematic task. Its format is:\n<html><pre>\n [modifier] return_type method_name ( [arguments] } { ... code ... } \n //\n int addNumbers (int one, int two) { return one+two; }\n</pre></html>\nSee [[modifiers]].
Modifiers control access to variables, methods, and classes.\nHere are ''Access Modifiers''\n|!Name|!Description|\n|private|Open only to the same class.|\n|<default>|Open only to same [[package]].|\n|protected|Open only to same package & [[subclass]].|\n|public|Open for everyone.|\nThere can be more than one modifier.\n|!Name|!Description|\n|void|This means that the [[method]] returns nothing.|\n|[[final]]|Final is well, final!|\n|[[static]]|There is only ever one - for class vars and methods.|\n
Java has great support for ''multithreading'''. Multithreading is where you have two or more tasks running at the same time. In java there are four thread states:\n*''New'' - A [[Thread]] has been declared, but no resources are allocated, the ''start()'' method has not been called.\n*''Running'' & [[Runnable]] - A thread has to be ''runnable'', then scheduled for execution, and when executing it is in a ''running'' state. \n*''Blocked'' - Two different blocked states.\n**If the thread tries to get the ''lock'' for code that is [[synchronized]] and is blocked then the thread is placed in a special ''blocked'' state waiting for a lock. Once it has the lock it is then placed in a ''runnable'' state.\n**A thread cannot access an unavailable resource (ie a file) or we hit a [[sleep()|Thread]] method, the thread is then ''blocked''.\n*''Dead'' - Aka Terminated - execution is stopped and cannot be resumed. \nA problem with multithreading is that there can be errors introduced, many can be solved with the [[synchronized]] keyword for locking code.\nSee also [[Concurrency]] for more info.\n
The usual suspects:\n*Math: - + * / % ++ &dash;-\n*Relational: > < >= <= = =&#61; != \n*Logical: && || & | ! ^ \n*Compound: += -= *= /= %= <&lt;= >&gt;= >&gt;>=\nThere is operator precedence: \n# inc/decrement\n# arithmetic operations\n# comparisons\n# logical operations\n# assignment operations\nSee [[assignment]].
Java organizes code by packages. It is the first line of any java application.\nThe package [[java.lang]] is automatically loaded.\nA package is declared as:\n<html><pre>\npackage ca.rtfm.widget;\n</pre></html>\nBenefits:\n*organized and easy to know where specific code is\n*namespacing - avoids conflicts of similar class names\n*can specify better control of access protection\n*identify what you have created\nSee also [[import]].\nYou'd have to change compiling a little, see Example: see [[hello, world]]
The defulat ''parameterized type'' name conventions used in the Java apis are:\n* E - Element (used extensively by the Java Collections Framework)\n* K - Key\n* N - Number\n* T - Type\n* V - Value\n* S,U,V etc. - 2nd, 3rd, 4th types \n
There are 8 primitive [[variables]] in Java.\n|!Type|!Min|!Max|!Default|!size (bits)|!Example|!Example|!Wrapper Class|\n|boolean|false|true|false|1|boolean biteMe = true;||Boolean|\n|byte|-126|127|0|8|byte b = 10;||Bytle|\n|short|-32768|32767|0|16|short s = 9;||Short|\n|int|-2147483648|2147483647|0|32|int i = 1; |int j = 0x1a;|Integer|\n|long|-2^^63^^ |-2^^63^^ - 1|0|64|long x = 123L |long z = 0xfff;|Long|\n|float|-big-|-big-|0.0|32|float f = 1.2f;|float f2 = 1.23F;|Float|\n|double|-big-|-big-|0.0|64|double d = 3.14;|double dd = 6.02E23;|Double|\n|char|\su0000|\suffff|\su0000|16|char c = 'w'; |char c1 = '\su4567';|Char|\n\nNote that the wrapper classes are all subclasses of class ''Number''.\nLocal vars do not get a default value. You must specify a value for a local variable.\nSee also [[Constants]].
The ''println'' is an [[overloaded|Overloading]] method that will convert its parameter to a string. The ''ln'' ending gives us a new line. Printing an object will actually call its ''toSting'' method. Make it look nice, could also try using ''printf''.
A ''process'' can be considered a single program running. It has resources like memory and is self contained. Most Java programs run in a single process. A multiprocess application is advanced. Running multiple processes will chew up resources, a lightweight approach is to use [[threads|Thread]].
Here is code to read a webpage:\n<html><pre>\nimport java.net.*;\nimport java.io.*;\n\npublic class GrabWebpage {\n\n void getData(String address) throws MalformedURLException {\n\n URL page = new URL(address);\n StringBuilder text = new StringBuilder();\n try {\n HttpURLConnection conn = (HttpURLConnection) page.openConnection();\n conn.connect();\n InputStreamReader in = new InputStreamReader( (InputStream) conn.getContent());\n BufferedReader buff = new BufferedReader(in);\n System.out.println("Website:" + address);\n String line;\n do {\n line = buff.readLine();\n text.append(line);\n text.append("\sn");\n } while (line != null);\n System.out.println(text);\n } catch (IOException ioe) {\n System.out.println("IO Error: " + ioe.getMessage());\n }\n }\n\n public static void main(String[] arguments) {\n if (arguments.length < 1) {\n System.out.println("Usage: java GrabWebpage url");\n System.out.println("Default: http://rtfm.ca/test");\n arguments = new String[1];\n arguments[0] = "http://rtfm.ca/test";\n// System.exit(1);\n }\n try {\n GrabWebpage app = new GrabWebpage();\n app.getData(arguments[0]);\n System.out.println("---------------fini-------------");\n } catch (MalformedURLException mue) {\n System.out.println("Bad URL: " + arguments[0]);\n }\n }\n}\n</pre></html>\n
''runtime exceptions'' are exceptions that the application typically cannot recover from. They are either from the ''~RuntimeException'' class or a subclass. You typically don't catch them via [[try-catch]] because they are often logic or programming errors.\nExamples are null pointer, index out of bounds, or security exceptions.
The keyword ''static'' is used in java to make:\n*''class variable'' (aka [[Static Variables]]) \n* ''class method'' (aka [[Static Methods]]). \nClass variables are [[variables]] where all instances of the class have access to the same variable in memory. This is the opposite of instance variables where each instance has its own variable in memory. A static method means that there is only one of them associated with the object, no matter how many instances there are. Static methods can only access static variables.\n<html><pre>\n // Static variable\n private static int counter = 0; // Class var\n private static double length; // Class var\n static String version = "v1.2.3"; // This has a "default" modifier.\n public static final double PI = 3.1415926; // Class constant var - cannot be changed\n\n // Static method\n public static boolean doesItHurt() { ... );\n</pre></html>\nThere are also [[final]] or [[static initializers|Static Initializers]].\n\n
A ''subclass'' is a class that is derived from another class. aka derived or child class. The ''superclass'' would be the parent or original class.\nA ''subclass'' can override a parent method - but has to have exact same signature. The [[super]] keyword allows you to access methods in the parent class. A subclass all public and protected methods and fields of the parent class. You can hide fields from the superclass by declaring them in the subclass, this is not a good idea - because depending on where the field is accessed from - you'll get different answers! This also applies to [[class methods]].
Substring...and a few other things...\n<html><pre>\n String alpha = "abcdefghijkl";\n alpha.substring(0,2); // would be "ab"\n alpha.substring(2); // would be "cdefghijkl"\n\n alpha.indexOf("ef"); // would be 4\n alpha.indexOf("xyz"); // would be -1\n</pre></html>
The [[super]] keyword allows you to access methods and variables in the parent or superclass.
A ''switch'' is used to test a variables against many values.\nUse ''break'' to skip to end, otherwise processing continues through other cases.\n<html><pre>\nString name = "Fred";\nswitch (name) {\n case 'Wilma':\n println "Let's go shopping!";\n break;\n case 'Fred':\n println "Yabba Dabba doooo!";\n break;\n case "BamBam":\n printlt("BamBam!");\n break;\n default:\n println("Welcome to Bedrock!");\n end\n}\n</pre></html>
The ''synchronized'' keyword is used in a [[multithreading]] environment which means that the system will lock the code and treat it as a block that will not allow other threads to interrupt it. This requires processing overhead, so only use when there is a possibility of code corruption. You can synchronized an entire method or a portion of code.\n<html><pre>\n public synchronized void something() { ... }\n // ...or...\n synchronized(this) { ..... }\n</pre></html>\nBe careful of ''deadlock'', where two threads lock a resource and wait for the other to release it.
''Local variables'' - are stored in the threads own stack and are therefore thread safe.\n''Local references to objects'' - the reference is thread safe but the object is ''not''. Objects are stored on a shared heap. If the object is only used internally, it is safe.\n''Object members'' - are not thread safe. They are stored, along with the Object on a shared heap.\n\nTo avoid race conditions, you have to use the [[synchronized]] keyword.\n
The ''throws'' clause is used to throw [[checked|Checked]] exceptions. You can throw unchecked ones, but they are moot you don't have to.\nThe ''throws'' statement added to a method signature, is used to show calling methods what *might* happen. \n[[Unchecked|Checked]] exceptions of the type ''Error'' or ''~RuntimeException'' class or subclass do @@not@@ need to be thrown, because they can happen at any time & not much you can do. One example is ''~OutOfMemoryError'' - it could happen anywhere at anytime.\nWhen you use the ''throws'' on your method signature, the calling method must handle it - but only if it is a [[checked|Checked]] exception.\nIn summation: Calling methods have to handle thrown checked exceptions, they do not have to handle unchecked.\nThe syntax can be seen in the [[class]] declaration.\n<html><pre>\npublic void soSomething() throws IOException {\n ...\n try {\n ...\n } catch (IOException ioe) {\n ... // Handle this like a pro\n throw ioe; // If you want calling method to do something too!\n }\n}\n</pre></html>\nSee [[throws example]] for more & how-to!\nA calling method that gets a thrown exception, can either handle it, or pass it up the stack.\n!!What NOT to do\nExceptions are processing time expensive, so avoid them if you can.\n#Do not use exceptions to handle things that you can otherwise avoid.\n##This includes verifying that user input if wanting integers, check that it is an integer\n##This includes check for out of bounds in an array, you have the technology.\n#Try and litter exceptions all over the place to have everything covered, it'll make the program difficult to read.\n!!One case: A superclass method being overridden by a new method.\nThe method overriding the superclass usually has to match the superclass method signature exactly. Not true with the ''throws'' clause - it can vary. The overriding method can:\n*throw the exact same exception as the superclass method.\n*not throw a different exception not used in the superclass\n*choose to ''not'' throw any exception - because it handles it.
To thow an exception, you have a few things to do:\n*You need to create an instance of an [[Exception]] class.\n*You can only throw objects that implement the [[Throwable]] class.\n*You have to throw that instance you created.\n*Some exceptions have arguments you can pass.\nExample:\n<html><pre>\nif (x==42) {\n System.out.println("x should not be answer to anything.");\n throw new RuntimeException();\n}\n</pre></html>\nOnce you execute a throws you leave the method, no more code is executed except for code in the ''finally'' block.\nSee [[exceptions - roll yer own]].
| tiddlyspot password:|<<option pasUploadPassword>>|\n| site management:|<<upload http://rtfm.tiddlyspot.com/store.cgi index.html . . rtfm>>//(requires tiddlyspot password)//<<br>>[[control panel|http://rtfm.tiddlyspot.com/controlpanel]], [[download (go offline)|http://rtfm.tiddlyspot.com/download]]|\n| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|
The ''try-catch-finally'' block allows us to try code that may throw an exception and not crash the program. When an error is encountered, Java creates an [[Exception]] object. We have access to this object. Note that the ''finally'' is not required.\n<html><pre>\n try {\n x = y * z;\n } catch (SomeException sex) {\n // Some code you want executed.\n } catch (SomeOtherException soex) {\n // Some code you want executed.\n } finally (\n // This code always executes, no matter what.\n }\n</pre></html>\nBe careful of what exceptions you use, for example, if you use ~IOException at the top, you'll never get to ~EOFException. Try for specific ones first, followed by more general ones. That is, if one exception is a superclass of another, the superclass one will cover many that the subclass is more specific to.
Java has [[primitive]] types, as well we can have types that are classes, like an [[array]].
A ''utility class'' is a class with all static members and is therefore not instantiated.
This allows the last method parameter to be an array. Format:\n\n\n public static <T> void something(String title, T... arr) {...\n \nYou can explicitly declare what <T> is by:\n\n List<Integer> ints = <Integer>something();
Java variables have to begin with a letter, underscore (_), or a dollar sign ($). After this, then can also include numbers.\nThe first letter should be lowercase. Later words in the var name should be uppercase.\nJava variable names are case sensitive.\nThere are three types of java variables. \n*Local variables - are used to hold information within local blocks of code. \n**Local variables must be given a value before being used. Static & Instance do not, they do have defaults assigned.\n*[[Static Variables]] aka ''Class Variables'' - apply to the class and are available to all instances created.\n*[[Instance Variables]] - are created whan a class is instantiated and an object is created.\nA variable has to be assigned a [[modifier]], [[type]], which in Java are [[primitive]]s or a [[class]].\nFormat: @@[modifiers] type variable_name [ = value] ;@@\n<html><pre>\n private int age;\n private int weigh = 42;\n protected String biteme;\n public boolean answer; // Note that public is the default, so can be omitted.\n</pre></html>\nVariables can be given literals, for example:\n|!Decimal|!Octal|!Hexidecimal|!long|!float|!double|!Scientific|\n|10|013|0xA|10.0L|3.1415986f|1212d|1.23e22|\nSee also [[literal]]s and [[Constants]]\n
The ''vector'' class extends AbstractList and implements the List interface. It is a dynamic array.\n<html><pre>\n Vector v = new Vector(3, 2); // size, inc\n v.addElement(new Integer(1)); // Same as "add" below.\n\n Vector&lt;CustomRecord&gt; vc=new Vector&lt;CustomRecord&gt;();\n vc.add(new CustomRecord(11,"biteme"));\n</pre></html>\nSee [[Enumeration]] to print these out.
A ''while'' loop like a [[for]] statement, continues processing while the statement is true.\nTo exit these methods before the conditions turn false, use ''break''.\nTo skip following statements and go to the test condition, use ''continue''.\n<html><pre>\nwhile ( i < 42) {\n i++;\n if (answer.equals("All hell breaks loose")\n break;\n ...more statements..\n}\n</pre></html>Careful to have ''i'' incremented!\nThe do loop will ''always'' execute at least once...\n<html><pre>\nint i\ndo {\n i++;\n if (i=22) \n continue;\n ...more statements...\n} while ( i < 42) \n</pre></html>\n