1 2 3
// line 44 while condition have to change to or you don't apply the last division (but return the last factor everytime) => number don't become 1 => hasnextfactor misbehave.
...
Java On Factoring Integers
by Eineki,
November 26, 2008 23:24
1 2 3 4
public static String[] loadFile(final String f) { String thisLine; final List<String> s = new ArrayList<String>(); ...
Java On Efficiently load a text fil...
by foo,
November 25, 2008 08:18
One disadvantage with your ...
1 2 3 4
public static String getRelativePath(File file, File relativeTo) { String path = ""; ...
Java On get path of a File relative...
by Mustafa,
November 03, 2008 07:45
I cannot say that this is a...
1 2 3 4
import java.util.Scanner; import java.util.Random; ...
1 2 3 4
package ircbot; /** ...
Java On Internationalize Exceptions
by David Linsin,
October 22, 2008 05:27
It is only passed in the co...
Java On Internationalize Exceptions
by barabaka.myopenid.com,
October 21, 2008 15:55
I guess there is no need of...
1 2 3 4
import java.util.Scanner; public class LeapYear { ...
1 2 3 4
public static int[] zigzag2(int[] array, int xmax, int ymax) { int[] zz = new int[array.length]; int x = 1; ...
1
if ((y == 0 && x < xmax -1) || y == ymax - 1) {
1 2 3 4
public static int[] zigzagify(int[] array, int xmax, int ymax) { int[] zz = new int[array.length]; //zigzag array if (array.length != xmax * ymax) { ...
1 2 3 4
private static boolean areSame(File f1, File f2) throws IOException { if(f1 == f2) ...
Java On fileContentsEquals
by Maciej Piechotka,
August 19, 2008 08:14
I'm tring once more - I've ...
1 2 3 4
private static boolean areSame(File f1, File f2) throws IOException { FileChannel fc1 = new FileInputStream(f1).getChannel(); ...
1 2 3 4
public static boolean fileContentsEquals(File file1, File file2) throws IOException { ByteBuffer buf1 = new FileInputStream(file1).getChannel().map(MapMode.READ_ONLY, 0, file1.length()); ByteBuffer buf2 = new FileInputStream(file2).getChannel().map(MapMode.READ_ONLY, 0, file2.length()); ...
Java On fileContentsEquals
by Maciej Piechotka,
August 18, 2008 10:40
1. Yes. It will work on byt...


The two functions, nextFact...