Various output fixes
This commit is contained in:
parent
910b036a69
commit
98fafd47ff
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.util.*;
|
||||
|
||||
public class EnvironmentVariables {
|
||||
@ -12,4 +13,3 @@ public class EnvironmentVariables {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -125,7 +125,7 @@ public class Lists {
|
||||
testLinkedList();
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 2 Lines)
|
||||
/* Output: (First and Last 2 Lines)
|
||||
[ALGERIA, ANGOLA, BENIN, BOTSWANA, BURKINA FASO, BURUNDI,
|
||||
CAMEROON, CAPE VERDE, CENTRAL AFRICAN REPUBLIC, CHAD,
|
||||
COMOROS, CONGO, DJIBOUTI, EGYPT, EQUATORIAL GUINEA,
|
||||
|
@ -63,7 +63,7 @@ public class References {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Just created: java.lang.ref.SoftReference@19e0bfd
|
||||
Just created: java.lang.ref.SoftReference@139a55
|
||||
Just created: java.lang.ref.SoftReference@1db9742
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {Args: GZIPcompress.java}
|
||||
// {ValidateByHand}
|
||||
import java.util.zip.*;
|
||||
import java.io.*;
|
||||
|
||||
@ -37,4 +38,3 @@ public class GZIPcompress {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -5,6 +5,7 @@
|
||||
// Uses Zip compression to compress any
|
||||
// number of files given on the command line
|
||||
// {Args: ZipCompress.java}
|
||||
// {ValidateByHand}
|
||||
import java.util.zip.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
@ -67,4 +68,3 @@ public class ZipCompress {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -16,7 +16,7 @@ public class WhileTest {
|
||||
System.out.println("Exited 'while'");
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 5 Lines)
|
||||
/* Output: (First and Last 5 Lines)
|
||||
true, Inside 'while'
|
||||
true, Inside 'while'
|
||||
true, Inside 'while'
|
||||
|
3
go.bat
Normal file
3
go.bat
Normal file
@ -0,0 +1,3 @@
|
||||
gradlew --parallel --daemon run > output.txt 2> errors.txt
|
||||
START /min "C:\Program Files\Windows Media Player\wmplayer.exe" %windir%\media\Alarm07.wav
|
||||
rem find . -size 0 -type f
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class BasicFileOutput {
|
||||
@ -23,4 +24,3 @@ public class BasicFileOutput {
|
||||
System.out.println(BufferedInputFile.read(file));
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class BufferedInputFile {
|
||||
@ -21,4 +22,3 @@ public class BufferedInputFile {
|
||||
System.out.print(read("BufferedInputFile.java"));
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class FileOutputShortcut {
|
||||
@ -22,4 +23,3 @@ public class FileOutputShortcut {
|
||||
System.out.println(BufferedInputFile.read(file));
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class FormattedMemoryInput {
|
||||
@ -19,4 +20,3 @@ public class FormattedMemoryInput {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class MemoryInput {
|
||||
@ -14,4 +15,3 @@ public class MemoryInput {
|
||||
System.out.print((char)c);
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -3,6 +3,7 @@
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Testing for end of file
|
||||
// {ValidateByHand}
|
||||
import java.io.*;
|
||||
|
||||
public class TestEOF {
|
||||
@ -16,4 +17,3 @@ public class TestEOF {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -53,4 +53,3 @@ public class ProcessFiles {
|
||||
"java").start(args);
|
||||
}
|
||||
}
|
||||
/* Output: (Execute to see) */
|
||||
|
@ -70,7 +70,7 @@ public class DoubleDispatch {
|
||||
Trash.sumValue(bin);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Loading patterns.doubledispatch.DDGlass
|
||||
Loading patterns.doubledispatch.DDPaper
|
||||
Loading patterns.doubledispatch.DDAluminum
|
||||
|
@ -49,7 +49,7 @@ public class DynaTrash {
|
||||
bin.values().forEach(Trash::sumValue);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Loading patterns.trash.Glass
|
||||
Loading patterns.trash.Paper
|
||||
Loading patterns.trash.Aluminum
|
||||
|
@ -99,7 +99,7 @@ public class RecycleA {
|
||||
Trash.sumValue(bin);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 11 Lines)
|
||||
/* Output: (First and Last 11 Lines)
|
||||
weight of patterns.recyclea.Aluminum = 0.11435456649761422
|
||||
weight of patterns.recyclea.Aluminum = 0.5295954256745989
|
||||
weight of patterns.recyclea.Aluminum = 0.44032876173820623
|
||||
|
@ -31,7 +31,7 @@ public class RecycleB {
|
||||
Trash.sumValue(bin);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Loading patterns.trash.Glass
|
||||
Loading patterns.trash.Paper
|
||||
Loading patterns.trash.Aluminum
|
||||
|
@ -59,7 +59,7 @@ public class RecycleC {
|
||||
Trash.sumValue(bin);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Loading patterns.trash.Glass
|
||||
Loading patterns.trash.Paper
|
||||
Loading patterns.trash.Aluminum
|
||||
|
@ -102,7 +102,7 @@ public class TrashVisitor {
|
||||
visitors.forEach(Visitor::total);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Loading patterns.trashvisitor.Glass
|
||||
Loading patterns.trashvisitor.Paper
|
||||
Loading patterns.trashvisitor.Aluminum
|
||||
|
@ -31,7 +31,7 @@ public class DeadlockingDiningPhilosophers {
|
||||
es.shutdownNow();
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Philosopher 1 thinking
|
||||
Philosopher 1 grabbing right
|
||||
Philosopher 1 grabbing left
|
||||
|
@ -4,6 +4,7 @@
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// {ThrowsException} on a multiprocessor machine
|
||||
// Using explicit Lock objects to create critical sections
|
||||
// {main: threads.ExplicitCriticalSection}
|
||||
package threads;
|
||||
import java.util.concurrent.locks.*;
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class FixedDiningPhilosophers {
|
||||
es.shutdownNow();
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Philosopher 4 thinking
|
||||
Philosopher 3 thinking
|
||||
Philosopher 0 thinking
|
||||
|
@ -168,7 +168,7 @@ public class GreenhouseScheduler {
|
||||
gh.repeat(gh.new CollectData(), 500, 500);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
Bing!
|
||||
Thermostat to night setting
|
||||
Turning on lights
|
||||
|
@ -88,7 +88,7 @@ public class HorseRace {
|
||||
new HorseRace(nHorses, pause);
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 18 Lines)
|
||||
/* Output: (First and Last 18 Lines)
|
||||
===========================================================
|
||||
================
|
||||
*0
|
||||
|
@ -127,7 +127,7 @@ public class PriorityBlockingQueueDemo {
|
||||
es.execute(new PrioritizedTaskConsumer(queue));
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 12 Lines)
|
||||
/* Output: (First and Last 12 Lines)
|
||||
[8 ] Task 0
|
||||
[9 ] Task 5
|
||||
[9 ] Task 13
|
||||
|
@ -206,7 +206,7 @@ public class RestaurantWithQueues {
|
||||
es.shutdownNow();
|
||||
}
|
||||
}
|
||||
/* Output: (First and last 10 Lines)
|
||||
/* Output: (First and Last 10 Lines)
|
||||
WaitPerson 0 received SPRING_ROLLS delivering to Customer 1
|
||||
Customer 1 eating SPRING_ROLLS
|
||||
WaitPerson 3 received SPRING_ROLLS delivering to Customer 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user