This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.io; | |
| import java.io.IOException; | |
| import java.io.RandomAccessFile; | |
| /** | |
| * Created by IDEA on 29/01/15. | |
| */ | |
| public class Tail { | |
| public static String[] tailLines(String filename, int nLinesToRead) throws IOException { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.io; | |
| import java.io.File; | |
| import java.util.List; | |
| /** | |
| * Created by IDEA on 31/01/15. | |
| */ | |
| public class WalkDir { | |
| private List<File> recursiveList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.io; | |
| import java.io.File; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * Created by IDEA on 31/01/15. | |
| */ | |
| public class WalkDir { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public long calculateDirSize() { | |
| for(File f : dirWalker.getRecursiveList()) { | |
| dirSize += f.length(); | |
| } | |
| return dirSize; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.thread; | |
| /** | |
| * Created by IDEA on 01/02/15. | |
| */ | |
| public class ThreadSafeIntList { | |
| protected int[] data; | |
| protected int size = 0; | |
| private static final int default_capacity = 8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static void printGroupInfo(PrintWriter tou, ThreadGroup g, String indent) { | |
| if(g == null) return; | |
| int num_threads = g.activeCount(); | |
| int num_groups = g.activeGroupCount(); | |
| Thread[] threads = new Thread[num_threads]; | |
| ThreadGroup[] groups = new ThreadGroup[num_groups]; | |
| // java.lang.ThreadGroup | |
| // public int enumerate(ThreadGroup[] list, boolean recurse) | |
| // Copies into the specified array references to every active subgroup in this thread group. If recurse is true, this method recursively enumerates all subgroups of this thread group and references to every active thread group in these subgroups are also included. | |
| g.enumerate(threads, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.thread; | |
| /** | |
| * Created by IDEA on 01/02/15. | |
| */ | |
| public class PrintChar implements Runnable { | |
| private char charToPrint; | |
| private int times; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.thread; | |
| import javafx.scene.layout.Pane; | |
| import javafx.scene.paint.Color; | |
| import javafx.scene.shape.Line; | |
| /** | |
| * Created by IDEA on 03/02/15. | |
| */ | |
| public class LinePane extends Pane { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.thread; | |
| import javafx.application.Application; | |
| import javafx.geometry.Insets; | |
| import javafx.scene.Scene; | |
| import javafx.scene.layout.Pane; | |
| import javafx.scene.text.Text; | |
| import javafx.stage.Stage; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package je3.thread; | |
| import javafx.application.Application; | |
| import javafx.geometry.Insets; | |
| import javafx.scene.Scene; | |
| import javafx.scene.layout.Pane; | |
| import javafx.scene.layout.StackPane; | |
| import javafx.scene.shape.Circle; | |
| import javafx.scene.text.Text; | |
| import javafx.stage.Stage; |