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

The two functions, nextFact...

5a00a3a98dcf6f9cd717440fd2b606e5 Talk
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 Star_fullStar_fullStar_fullStar_fullStar_full

One disadvantage with your ...

Avatar Talk
1
2
3
public boolean hasOwnerShip()
...

Java On Java IRC Bot

by tmpr, November 04, 2008 11:46
Avatar Talk
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...

Ee573f2fb953ffeb544fca3e4d12ffad Talk
1
2
3
4
import java.util.Scanner;
import java.util.Random;

...

Java On Guessing Game

by RG, October 27, 2008 18:20 Star_fullStar_full
6003d35c2b367428e323c3d86dcd3499 Talk
1
2
3
4
import java.util.Scanner;
import java.util.Random;

...

Java On Guessing Game

by halogenandtoast, October 27, 2008 15:34

Reduced your code a bit, no...

B066cb3c505933f832faa83238489a89 Talk
1
2
3
4
import java.util.Scanner;

public class LeapYear {
...

Java On Leapyear

by juo100@gmail.com, October 27, 2008 11:45

Thanks for all the refactor...

B543a43dc8cb0aae562278484db60d25 Talk

Java On Processing / Java

by Simon Hartley, October 25, 2008 13:25

I take back what I said. I ...

81a73740df646bc6cccbfef6fab61ec9 Talk

Java On Processing / Java

by Simon Hartley, October 25, 2008 13:12

I think the reason that thi...

81a73740df646bc6cccbfef6fab61ec9 Talk
1
2
3
4
package ircbot;

/**
...

Java On Java IRC Bot

by Simon Hartley, October 25, 2008 12:20

To increase clarity I've se...

81a73740df646bc6cccbfef6fab61ec9 Talk

Java On Internationalize Exceptions

by David Linsin, October 22, 2008 05:27

It is only passed in the co...

Ef079515af1c9963c7cd33e0b4f00e88 Talk

Java On Internationalize Exceptions

by barabaka.myopenid.com, October 21, 2008 15:55 Star_fullStar_fullStar_full

I guess there is no need of...

Avatar Talk
1
2
3
bool isLeap (int year)
...

Java On Leapyear

by Debajit, October 17, 2008 20:08 Star_fullStar_full

First of all, you've mixed ...

10227e415d1c4e4e1cc719c6ccd70934 Talk
1
2
3
4
import java.util.Scanner;

public class LeapYear {
...

Java On Leapyear

by Kaloyan, October 16, 2008 20:58 Star_fullStar_fullStar_fullStar_full

You do not need to implemen...

F5580b2585a846f86b5c60be5310e0d3 Talk
1
2
3
4
import java.util.Scanner;

public class LeapYear {
...

Java On Leapyear

by Maciej Piechotka, October 16, 2008 19:05
1e8f141e7857d397d8020ed3b759e88a Talk

Java On Leapyear

by john, October 16, 2008 18:39

Oh wait, you didn't do anyt...

Avatar Talk

Java On Leapyear

by john, October 16, 2008 18:37

It's not correct though (fo...

Avatar Talk
1
2
3
package ircbot;

...

Java On Java IRC Bot

by Ishkur, September 14, 2008 00:19

I decided to refactor it my...

6dc0e9a07bcff97ac9b111f36e12f1f6 Talk

Java On Java IRC Bot

by Fivesheep, September 13, 2008 14:10

you can try http://www.jibb...

4d1481f489d5ffe09a08fb6576f81ebb Talk
1
2
3
4
    public static int[] zigzag2(int[] array, int xmax, int ymax) {
        int[] zz = new int[array.length];
        int x = 1;
...

Java On Zig Zag ordering of array

by Kaloyan, August 20, 2008 12:13 Star_fullStar_fullStar_fullStar_fullStar_full

okay, I think I came up wit...

F5580b2585a846f86b5c60be5310e0d3 Talk
1
if ((y == 0 && x < xmax -1) || y == ymax - 1) {

Java On Zig Zag ordering of array

by Kaloyan, August 20, 2008 11:29

There's a bug at line 25, f...

F5580b2585a846f86b5c60be5310e0d3 Talk
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) {
...

Java On Zig Zag ordering of array

by Kaloyan, August 20, 2008 08:28

IMHO the code cannot get mu...

F5580b2585a846f86b5c60be5310e0d3 Talk
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 ...

1e8f141e7857d397d8020ed3b759e88a Talk
1
2
3
4
private static boolean areSame(File f1, File f2) throws IOException
{
        FileChannel fc1 = new FileInputStream(f1).getChannel();
...

Java On fileContentsEquals

by TFrey, August 18, 2008 15:10

I think this solution is ba...

Avatar Talk
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...

1e8f141e7857d397d8020ed3b759e88a Talk