Similar problem with getCodeSource() in ARFFPlayer.java

11 views
Skip to first unread message

Jeff Berkowitz

unread,
Aug 29, 2010, 9:18:57 PM8/29/10
to cspoker...@googlegroups.com
I found another instance of the same problem where it tries to create the opponent files.  In ARFFPlayer the variable "folder" holds a path starting with ".." and it gets appended to a path ending in .jar.  I hacked a quick fix to put the files in the same directory as the jar.  Obviously this isn't a good place for them.  I'm curious how this bug is persisting - perhaps the core developers generally run from the un-jar'd classfile directories?  Because I suspect the getCodeSource().getLocation() might return a directory in that case, and then the existing code might work.

Jeff

                // ARFFPlayer.java near line 44:
try {
// Begin new code
URL codeSource =
getClass().getProtectionDomain().getCodeSource().getLocation();
File f = new File(codeSource.toURI());
while (!f.isDirectory()) {
f = f.getParentFile();
if (f == null) {
throw new IOException("Cannot find location for ARFFFiles");
}
}
String path = f.getAbsolutePath();
// End new code
// String path = (getClass().getProtectionDomain().getCodeSource()
//    .getLocation().getPath() + folder).replace("%20", " ");
// End old code
preCheckBetFile = new ARFFFile(path, player, "PreCheckBet.arff",
ARFFPropositionalizer.getPreCheckBetInstance().toString(), config);



Guy Van den Broeck

unread,
Sep 4, 2010, 5:10:39 PM9/4/10
to cspoker...@googlegroups.com
Applied in r1396.

I must admit that I always run CSPoker from Eclipse. 

2010/8/30 Jeff Berkowitz <pdx...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "cspoker-discuss" group.
To post to this group, send email to cspoker...@googlegroups.com.
To unsubscribe from this group, send email to cspoker-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cspoker-discuss?hl=en.

Jeff Berkowitz

unread,
Sep 4, 2010, 9:31:55 PM9/4/10
to cspoker...@googlegroups.com
No worries.  Some friends and I will be continuing to fuss with this code, it a great looking piece of work.  We will probably set up some sort of "nightly build" using Maven, creating the jars and running the unit tests (at least).  When we do this and find an issue, should we send it to the alias or just to you two (Guy and Laurent)?

Thanks,
Jeff

Guy Van den Broeck

unread,
Sep 5, 2010, 5:59:34 AM9/5/10
to cspoker...@googlegroups.com
2010/9/5 Jeff Berkowitz <pdx...@gmail.com>
No worries.  Some friends and I will be continuing to fuss with this code, it a great looking piece of work.  We will probably set up some sort of "nightly build" using Maven, creating the jars and running the unit tests (at least).  When we do this and find an issue, should we send it to the alias or just to you two (Guy and Laurent)?

I could also give you commit access.

I must warn you that the future of CSPoker is unclear. Laurent just finished his master thesis and I don't know whether he'll choose to be involved in CSPoker in the future. A new master thesis student will start to work on Poker AI soon, but we're considering to continue development of our MCTSBot within the opentestbed framework: http://code.google.com/p/opentestbed/ . They ported MCTSBot and they support the Meerkat API that we need to participate in the Poker competition.

Cheers,

Guy

Jeff Berkowitz

unread,
Sep 5, 2010, 11:26:29 PM9/5/10
to cspoker...@googlegroups.com
That's interesting.  I am aware of opentestbed and also interested in their Meerkat compatibility.  I plan to start working with that code base shortly (meaning sometime in the next few weeks).

I am a very experienced SW developer (30 years) but I've never had commit access on an open source project.  I sort of don't know the "rules" (conventions).  Let me keep working in parallel for now and we'll see what develops as you decide whether to transition your code.

Thanks Guy.

Jeff

--
Reply all
Reply to author
Forward
0 new messages