Originally posted by Jim Yingst:
[damian]: I know that I could access the path as well as the filename of the class I choose from the FileChoser. I could then find the package name from the path if I knew the start of the package.
It may be awkward, but this sounds like your best bet. Let's say the complete path is
/foo/bar/baz/a/b/c/MyClass.class
I'd try these in succession:
Class.forName("MyClass")
Class.forName("c.MyClass")
Class.forName("b.c.MyClass")
Class.forName("a.b.c.MyClass")
Class.forName("baz.a.b.c.MyClass")
Class.forName("bar.baz.a.b.c.MyClass")
Class.forName("foo.bar.baz.a.b.c.MyClass")
The first one of these that returns != null, that's your class.
Originally posted by Joel McNary:
<snipped />
Gopi, I'm not sure what you did wrong, but We get different results for a 6-card deck with a cut of 3:
<snipped />
Your top and bottom cards never change; you are dropping the bottom card from the bottom stack first (as opposed to the bottom card from the top stack)
Originally posted by RArun Kumar:
What is the result for shuffles(1002,101).I am unable to find the result for shuffles(1002, 101). It runs for hours. Can anyone tell the algorithm to solve this problem. Any help is appreciated.
Thanks,
Arun
Originally posted by Ilja Preuss:
That link doesn't seem to work![]()
And I don't understand why you'd need Singleton here - it seems to me as if AbstractFactory would totally suffice (and be more flexible).