| Author |
Message |
| ChienFou |
Posted: Mon Jan 06, 2003 11:10 pm Post subject: 1 |
|
Many years ago (c. 1971) I had free use of a CDC 6600, which was the biggest m/c in London at the time. I solved an old conundrum which is to find the longest non-crossing knights tour on a 6x6 chessboard. (It's 17 moves btw and is unique. Anyone care to find it?) I rewrote the inner loops in Compass (native assembler) and eventually solved the 8x8 chessboard. To get any sort of performance, I built a number of tables: A list of all possible moves and a list of all moves that would be removed by making a move. By storing the move number I was able to run a full search purely by lookup and it went like s**t off a shovel. btw I could read core dumps like it was Keats or Shelley in those days.
The same approach can be used here. Maintain a list of all potentially infectable links for the current state of the board and select one at "random". Update the list from a table of additional infectable links ... etc. |
|
 |
| mathgrant |
Posted: Mon Jan 06, 2003 2:03 am Post subject: 0 |
|
Don't worry, his works. But I can't wait for yours nevertheless.
------------------ GL DPWestley: I had my backspace key removed and a beverage dispenser pur in it's place. See? I can't go back and fix "put." GLmathgrant: I once was banned from a M:TG tourney for bringing over 50 banned cards! They were Ace of Clubs, Ace of Diamonds, Ace of Hearts, Ace of Spades, 2 of Clubs. . .
|
|
 |
| CrystyB |
Posted: Mon Jan 06, 2003 1:50 am Post subject: -1 |
|
That means restart the IE program - quit all open windows of it and then open one up again.
Purpose? NONE. Just for fun. No deadline given.
mg, i am sorry to find that as with most of my 'projects' i have it half-way through workability... Maybe after another month passes and i remember i could do this to relax from the exams... |
|
 |
| ML |
Posted: Fri Jan 03, 2003 6:11 pm Post subject: -2 |
|
One more thing which may make it work. Check your Internet Explorer settings. Tools->Internet Options->Advanced. You should get a screen that looks like this:
 Check the Java(Sun) box
 Then restart.
By checking that box I can make it work/not-work on my main computer, which should speed up debugging if/when I get around to finding the bugs.
What is this for? Is it still useful, or has a deadline passed?
|
|
 |
| mathgrant |
Posted: Sat Dec 21, 2002 12:53 am Post subject: -3 |
|
| I DLed the Sun Java, and it still won't work. |
|
 |
| ML |
|
 |
| mathgrant |
Posted: Fri Dec 20, 2002 10:29 pm Post subject: -5 |
|
Microsoft Java.  |
|
 |
| ML |
|
 |
| ML |
Posted: Fri Dec 20, 2002 7:27 pm Post subject: -7 |
|
Sorry that the source is gone. I must have been too aggresive duirng one of my debugging steps.
My View menu has no Java console option. Are you talking about IE, or something else.
Googling....
[edit] Found it. Also, can one of you take this test. On step 5, both computers that the program has worked on run "Java: Sun Microsystems Inc. Version: 1.3.1_02", the one that doesn't runs "Java: Microsoft Corp. Version: 1.1.4"
[edit again] Source code back up. Sorry about that.
[This message has been edited by ML (edited 12-20-2002 02:51 PM).] |
|
 |
| mathgrant |
Posted: Fri Dec 20, 2002 6:02 pm Post subject: -8 |
|
| Yes. |
|
 |
| CrystyB |
Posted: Fri Dec 20, 2002 5:57 pm Post subject: -9 |
|
did you select the dimensions of the field and press the 'New Array' button??
ML, here's the output - view it yourself: from the View menu, select the Java Console option...
code:
Exception occurred during event dispatching: java.lang.NoSuchMethodError: java/awt/Component: method getWidth()I not found at InfectionModel$FieldDisplay.paint at com/ms/awt/WComponentPeer.doClearAndPaint at com/ms/awt/WComponentPeer.paintNode at com/ms/ui/windowmanager/PaintRequest.run at com/ms/ui/windowmanager/RunnableMessage.run at com/ms/awt/WSystemQueue.getMessage at com/ms/awt/WEventQueue.getNextEvent at java/awt/EventDispatchThread.run Exception occurred during event dispatching: java.lang.NoSuchMethodError: java/awt/Component: method getWidth()I not found at InfectionModel$FieldDisplay.paint at com/ms/awt/WComponentPeer.doClearAndPaint at com/ms/awt/WComponentPeer.paintNode at com/ms/ui/windowmanager/PaintRequest.run at com/ms/ui/windowmanager/RunnableMessage.run at com/ms/awt/WSystemQueue.getMessage at com/ms/awt/WEventQueue.getNextEvent at java/awt/EventDispatchThread.run Exception occurred during event dispatching: java.lang.NoSuchMethodError: java/awt/Component: method getWidth()I not found at InfectionModel$FieldDisplay.paint at com/ms/awt/WComponentPeer.doClearAndPaint at com/ms/awt/WComponentPeer.paintNode at com/ms/ui/windowmanager/PaintRequest.run at com/ms/ui/windowmanager/RunnableMessage.run at com/ms/awt/WSystemQueue.getMessage at com/ms/awt/WEventQueue.getNextEvent at java/awt/EventDispatchThread.run Exception occurred during event dispatching: java.lang.NoSuchMethodError: java/awt/Component: method getWidth()I not found at InfectionModel$FieldDisplay.paint at com/ms/awt/WComponentPeer.doClearAndPaint at com/ms/awt/WComponentPeer.paintNode at com/ms/ui/windowmanager/PaintRequest.run at com/ms/ui/windowmanager/RunnableMessage.run at com/ms/awt/WSystemQueue.getMessage at com/ms/awt/WEventQueue.getNextEvent at java/awt/EventDispatchThread.run Exception occurred during event dispatching: java.lang.NoSuchMethodError: java/util/Random: method nextInt(I)I not found at InfectionModel.actionPerformed at java/awt/Button.processActionEvent at java/awt/Button.processEvent at java/awt/Component.dispatchEventImpl at java/awt/Component.dispatchEvent at com/ms/awt/WUIPeer.handleEvent at com/ms/awt/WButtonPeer.handleEvent at java/awt/Component.postEvent at com/ms/ui/AwtUIHost.postEvent at com/ms/awt/WUIPeer.postEvent at com/ms/ui/UIRoot.postEvent at com/ms/ui/UIComponent.postEvent at com/ms/ui/UIStateContainer.postEvent at com/ms/ui/UIButton.¤ at com/ms/ui/UIButton.keyUp at com/ms/ui/UIComponent.handleEvent at com/ms/ui/UIComponent.postEvent at com/ms/ui/UIStateContainer.postEvent at com/ms/ui/UIRoot.µ at com/ms/ui/UIRoot.forwardEvent at com/ms/ui/AwtUIHost.postEvent at com/ms/awt/WUIPeer.postEvent at com/ms/ui/AwtUIHost.processEvent at java/awt/Component.dispatchEventImpl at java/awt/Container.dispatchEventImpl at java/awt/Component.dispatchEvent at java/awt/EventDispatchThread.run
And what happened to the source file? 
[This message has been edited by CrystyB (edited 12-20-2002 01:08 PM).] |
|
 |
| mathgrant |
Posted: Fri Dec 20, 2002 5:37 pm Post subject: -10 |
|
| Hmm. . . an applet appears, but I can't see a grid. |
|
 |
| ML |
Posted: Fri Dec 20, 2002 4:16 pm Post subject: -11 |
|
I know. I think that it's a graphics updating problem. I'll work on it more this afternoon. Right now on some computers the buttons show up, but the main field of cells does not update. It might actually be working, but without the output it does no good. 
Source code, if you have want to look at it.
|
|
 |
| mathgrant |
Posted: Fri Dec 20, 2002 3:34 pm Post subject: -12 |
|
Not working! |
|
 |
| ML |
Posted: Fri Dec 20, 2002 2:51 pm Post subject: -13 |
|
Update: I've stripped out all of the Swing package code and uploaded it all again. The graphic update is a lot faster now when it's running on my computer. But on another test computer the graphic update doesn't happen at all. Still working on it.....
[edit 10:AM] this is going to make it look ugly...... or not, it didn't work
[This message has been edited by ML (edited 12-20-2002 09:59 AM).] |
|
 |
| CrystyB |
Posted: Fri Dec 20, 2002 1:52 pm Post subject: -14 |
|
That was what i was about to post! :
Originally posted by TAKEN from command mode run of AppletViewer: java.lang.NoClassDefFoundError: InfectionModel$JFieldDisplay at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java:239) at sun.applet.AppletPanel.createApplet(AppletPanel.java:532) at sun.applet.AppletPanel.runLoader(AppletPanel.java:468) at sun.applet.AppletPanel.run(Compiled Code) at java.lang.Thread.run(Thread.java:479)
You have to upload ALL the classes created by compiling your java...
PS With all those 5 files, appletviewing works, though i have no idea why i can't seem to be able to view it online...
Originally posted by TAKEN from IE Java Console: java.lang.ClassNotFoundException: javax.swing.JApplet at com/ms/vm/loader/URLClassLoader.loadClass at java/lang/ClassLoader.loadClassInternal at java/lang/ClassLoader.resolveClass at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.run at java/lang/Thread.run
I guess you have a more advanced version of Java... But i can't understand why appletviewing works... :
[This message has been edited by CrystyB (edited 12-20-2002 09:17 AM).] |
|
 |
| ML |
|
 |
| ML |
Posted: Fri Dec 20, 2002 2:49 am Post subject: -16 |
|
That's irratating. Compile once run anywhere right? It works on my work computer and a roommate's computer, but not on my home computer (or apparantly CrystyB's or MathGrant's). I used a bunch of Swing package objects, and I suspect that they are not yet standard, even though they've been out for years.
If I have time tommorrow I'll see if I can take out the Swing package objects and maybe that'll work. I leave for Christmas tomorrow night. If I can't get it fixed by then I'll at least post the source.
Any other suggestions are welcome. |
|
 |
| mathgrant |
Posted: Fri Dec 20, 2002 2:20 am Post subject: -17 |
|
| CB's right -- it doesn't work! |
|
 |
| CrystyB |
Posted: Fri Dec 20, 2002 1:49 am Post subject: -18 |
|
doesn't work - not even saved offline...  |
|
 |
| ML |
Posted: Thu Dec 19, 2002 9:33 pm Post subject: -19 |
|
Thanks. Now I've wasted another day of my life 
Hope it's what you wanted.
[edit] grrrr. Someone else just told me that it doesn't work on their computer. Let me know if the Applet loads for you or not. I'll try and figure out what's wrong.
[This message has been edited by ML (edited 12-19-2002 06:08 PM).] |
|
 |
| Termital |
Posted: Thu Dec 19, 2002 6:27 am Post subject: -20 |
|
How about an AIM trojan instead? 
Sure, it can be done. But i'm too lazy to do it. Wait till I get bored enough! |
|
 |
| extropalopakettle |
Posted: Tue Dec 17, 2002 6:28 pm Post subject: -21 |
|
Of course it can be done.
Curious: Why do you have X's between rows C and D, and D and E (column 3) in your first diagram?
Anyway, the simplest way to do it is make a temporary list of all the connections between an X and o, then select one randomly. There may be more efficient was han generating this list each time - such as by updating the list each time (but you'd need some slightly fancy indexing scheme to actually make that be more efficent). ------------------------ ps: compaq keyboards SUCK! I'm gonna stop correcting the typoes.
[This message has been edited by extropalopakettle (edited 12-17-2002 01:30 PM).] |
|
 |
| mathgrant |
Posted: Tue Dec 17, 2002 3:24 pm Post subject: -22 |
|
Any format, be it Java, Javascript, etc.
No! I want all the connections to be equally likely. In the position:
code:
1 2 3 4 5 A o o o o o B o o o o o C o o o o o D o o o o o | | E XXX-o o o
Your technique means 1DE has a 1/2 chance and 2DE and E23 both have 1/4 chances. I want them each to have an equal chance. |
|
 |
| Legion |
Posted: Tue Dec 17, 2002 2:32 pm Post subject: -23 |
|
Yes, I did something similar, what format did you want it in?
in general, set up an 2-D array of zeroes and ones with your ones representing infection, then randomly select any position in the array, if it is surrounded by 1s, then ignore it and select again, otherwise, count the number of adjacent uninfected positions and select a random number to designate on of those to be infected. Stop when the sum of the array is (m*n)-1
Is that what you wanted?
Hope it makes sense |
|
 |
| mathgrant |
Posted: Sat Dec 14, 2002 8:11 pm Post subject: -24 |
|
*doesn't know where to post this* Mods, move it if I'm wrong 
Here's what I want.
code:
1 2 3 4 5 A o o o o o B o o o o o | | C o o-XXX-o X | D o o-X-o o | | X E XXXXX-o o
X represents an infection, o means healthy.
First, the program will search for all connections between healthy and infected squares. In this case, 3BC, 4BC, C23, C45, 4CD, D23, D34, 1DE, 2DE, and E34. Then it choose one randomly and spread the virus like that. Example: It chooses D23:
code:
1 2 3 4 5 A o o o o o B o o o o o | | C o o-XXX-o | X | D o-X X-o o | X X E XXXXX-o o
It keep doing this until only one square is safe. Could this be done?
------------------ GL DPWestley: I had my backspace key removed and a beverage dispenser pur in it's place. See? I can't go back and fix "put." GLmathgrant: I once was banned from a M:TG tourney for bringing over 50 banned cards! They were Ace of Clubs, Ace of Diamonds, Ace of Hearts, Ace of Spades, 2 of Clubs. . .
[This message has been edited by mathgrant (edited 12-16-2002 06:31 PM).] |
|
 |