Page 1 of 4

Re: Puzzle

PostPosted: Tue, 10Jan26 03:10
by Craban
I played with paths and 2D graph approximation to create a random jigsaw puzzle shape. The result is here: http://secretpaste.org/puzzle/pic1.html

Currently this is considered a beta. It is and will be free to use. Parameters control the picture and number of tiles. Just have a look at the HTML code.

DiTo: I hope you don't mind I use a picture you posted here. If you have any objections let me know and I'll replace it.

Re: Puzzle

PostPosted: Tue, 10Jan26 03:28
by LRM
It never loaded for me. IE8. anyone else?
L

Re: Puzzle

PostPosted: Tue, 10Jan26 03:35
by Craban
You need a Java plugin and as I used the simple old-style APPLET tag it won't warn if you don't have a Java plugin installed.

Hmm, maybe I should switch to the object tag instead.

I tested with Firefox, Chrome and IE8.

Re: Puzzle

PostPosted: Tue, 10Jan26 03:41
by Slipstone
No joy at all...

Using Firefox - got message saying applet loading had failed

then this:

java.lang.UnsupportedClassVersionError: org/secretpaste/jigsaw/PuzzleApplet (Unsupported major.minor version 50.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

!

Re: Puzzle

PostPosted: Tue, 10Jan26 03:44
by Craban
Oops, there are still Java 5 plugins out there?

I assumed that everybody uses Java 6. :(

Re: Puzzle

PostPosted: Tue, 10Jan26 03:45
by Greebo
The Java app failed to run and threw up an error.
I'm using Ubuntu linux 9.1 (Karmic Koala) and Firefox 3.5.7 with Java version 6 update 16 (The latest update at the moment is 18 but 16 ought to be okay I would have thought)

Re: Puzzle

PostPosted: Tue, 10Jan26 03:47
by Craban
Well, that should work. Can you please send me the stacktrace (the console message that is)?

Thanks for all the feedback. It's very appreciated.

Re: Puzzle

PostPosted: Tue, 10Jan26 03:49
by astringues
Firefox 3.6.1 : Your browser does not support the applet tag.
:-(

Re: Puzzle

PostPosted: Tue, 10Jan26 03:52
by Greebo
The error details I get are:-

Java Plug-in 1.6.0_16
Using JRE version 1.6.0_16-b01 Java HotSpot(TM) Client VM
User home directory = /home/gerry




----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------

java.lang.ExceptionInInitializerError
at org.secretpaste.jigsaw.PuzzleMatrix.(Unknown Source)
at org.secretpaste.jigsaw.PuzzlePanel.(Unknown Source)
at org.secretpaste.jigsaw.PuzzleApplet.init(Unknown Source)
at sun.applet.AppletPanel.run(AppletPanel.java:424)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:840)
at java.util.Scanner.next(Scanner.java:1461)
at java.util.Scanner.nextDouble(Scanner.java:2387)
at org.secretpaste.jigsaw.JigsawNoseFactory.(Unknown Source)
... 5 more
java.lang.NoClassDefFoundError: Could not initialize class org.secretpaste.jigsaw.JigsawNoseFactory
at org.secretpaste.jigsaw.PuzzleMatrix.(Unknown Source)
at org.secretpaste.jigsaw.PuzzlePanel.(Unknown Source)
at org.secretpaste.jigsaw.PuzzleApplet.init(Unknown Source)
at sun.applet.AppletPanel.run(AppletPanel.java:424)
at java.lang.Thread.run(Thread.java:619)

Re: Puzzle

PostPosted: Tue, 10Jan26 04:20
by Craban
@Greebo: There was a text file in the jar and that may have caused some issues. I changed it to pure code now so it should work for you.

@astringues: I changed the html from applet to a more portable way using Javascrïpt. From what I found this is the recommended way to start an applet (found on java.com).

Re: Puzzle

PostPosted: Tue, 10Jan26 04:23
by Craban
Are there more Java 5 plugins out there? As soon as you get an error saying the class version is bad it's the runtime version. I just thought about using a JDK 5 but then I saw it has already reached it's end of service life so I'm a bit hesitant to jump on this old wagon.

Re: Puzzle

PostPosted: Tue, 10Jan26 04:36
by DiTo
I love it Craban, just use them to your likings

Re: Puzzle

PostPosted: Tue, 10Jan26 04:53
by Craban
Cool, thanks. And that implies that at least for one it's working ;-)

Re: Puzzle

PostPosted: Tue, 10Jan26 05:10
by DiTo
hehe, well it took me more than half an hour to solve it, so .... Wonderful Craban, much obliged

Re: Puzzle

PostPosted: Tue, 10Jan26 05:24
by Greebo
Hmm - I still get the same error info except the final section

java.lang.NoClassDefFoundError: Could not initialize class org.secretpaste.jigsaw.JigsawNoseFactory
at org.secretpaste.jigsaw.PuzzleMatrix.(Unknown Source)
at org.secretpaste.jigsaw.PuzzlePanel.(Unknown Source)
at org.secretpaste.jigsaw.PuzzleApplet.init(Unknown Source)
at sun.applet.AppletPanel.run(AppletPanel.java:424)
at java.lang.Thread.run(Thread.java:619)
gets repeated. I think I'll try closing Firefox and restarting it - maybe it's having a funny turn! Image