#jython IRC Log (v0.9)


IRC Log for 2012-02-19

Timestamps are in GMT/BST.

[0:01] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) Quit (Ping timeout: 272 seconds)
[0:43] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Remote host closed the connection)
[1:00] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[1:22] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) has joined #jython
[1:27] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[4:13] * stakkars (~tismer@p5DDB7772.dip.t-dialin.net) has joined #jython
[4:57] * stakkars (~tismer@p5DDB7772.dip.t-dialin.net) Quit (Quit: schnarch)
[5:27] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) Quit (Quit: Leaving.)
[5:38] * wmeissner (~wmeissner@ppp59-167-223-31.static.internode.on.net) Quit (Remote host closed the connection)
[5:38] * wmeissner (~wmeissner@2001:44b8:2134:a101:258a:254f:34c7:9ffa) has joined #jython
[8:20] * indistylo (~aruns@ has joined #jython
[9:29] * indistylo (~aruns@ Quit (Ping timeout: 248 seconds)
[13:59] * enebo (~enebo@75-168-50-253.mpls.qwest.net) has joined #jython
[15:02] * wmeissner_ (~wmeissner@2001:44b8:2134:a102:6d51:c6e1:3245:1374) has joined #jython
[15:04] * wmeissner (~wmeissner@2001:44b8:2134:a101:258a:254f:34c7:9ffa) Quit (Ping timeout: 240 seconds)
[15:04] * wmeissner_ is now known as wmeissner
[15:57] * wmeissner (~wmeissner@2001:44b8:2134:a102:6d51:c6e1:3245:1374) Quit (Quit: wmeissner)
[15:58] * delinquentme (~asdfasdf@c-24-3-189-214.hsd1.pa.comcast.net) has joined #jython
[15:58] <delinquentme> herroooooooo!
[15:59] <delinquentme> how deep do the interactions between java and python via the jython wrapped need to be?
[16:00] <delinquentme> I'm calling a particular method from inside jython ... which in looking at it seems to be redundant .. because within the java .. im running the same method with the same vars off of argv
[16:01] <agronholm> delinquentme: that's a question noboy can answer without knowing your application
[16:02] <delinquentme> agronholm, http://pastie.org/3414638 so heres the two interacting files ... im calling the setName() once within jython ln:17 and again within the java at ln:26
[16:02] <delinquentme> redundant no?
[16:03] <agronholm> well you can always make it a public attribute
[16:04] <agronholm> if that's what you mean
[16:07] <agronholm> delinquentme: besides, your None check at line 16 is redundant
[16:07] <agronholm> argv[1] is never going to be None
[16:10] <delinquentme> agronholm making name a public attribute?
[16:11] <agronholm> well, it's private now?
[16:11] <agronholm> and you have a setter for it
[16:11] <delinquentme> so then I could set it via the jython
[16:11] <agronholm> well, you could already do mc.name = name
[16:11] <agronholm> without any changes to your current Java code
[16:11] <delinquentme> see thats the thing .. i dont understand why there are two calls to the .setName() method between these programs
[16:11] <agronholm> where's the other call?
[16:12] <agronholm> I see one at line 17
[16:12] <agronholm> I don't se the other anywhere
[16:12] <delinquentme> agronholm, true! and then i shouldn't need the set line 26 of MyClass.java http://pastie.org/3414638
[16:12] <agronholm> you also seem to have a no-op constructor at line 8 of MyClass.java
[16:12] <delinquentme> 26 takes in the passed argument ( which would be the value of name )
[16:13] <agronholm> delinquentme: is there a reason why you have a main method in the java class too?
[16:13] * delinquentme googles no-op constructor
[16:13] <agronholm> no-operation
[16:13] <agronholm> translation: useless
[16:14] <delinquentme> ah
[16:14] <delinquentme> should the main method be outside of the class?
[16:14] <agronholm> why do you have one there in the first place?
[16:14] <agronholm> do you intend to run the java class on its own?
[16:15] <agronholm> without jython?
[16:15] <delinquentme> nope
[16:15] <agronholm> why did you put a main method there then?
[16:15] <agronholm> it's not being invoked anywhere
[16:15] <delinquentme> this is copied from a tutorial ... which im modifying for my purposes
[16:15] <agronholm> drop the constructor and main method then
[16:16] <agronholm> and to line 17 of python: mc.name = name
[16:16] <agronholm> if you don't need special setter/getter logic, drop the setter too and make the property public
[16:17] <delinquentme> http://pastie.org/3414638 updated
[16:17] <delinquentme> YESSS im not TOTALLY CLUELESS
[16:17] <agronholm> you're still invoking the setter explicitly
[16:17] <agronholm> also
[16:18] <agronholm> that is invalid java syntax
[16:18] <agronholm> you can't put code directly in the class definition
[16:18] <agronholm> it's as if you just removed the main method's definition and left the code hanging there
[16:19] <delinquentme> wait but i was supposed to drop the main method and the constructor?
[16:19] <agronholm> yes
[16:19] <agronholm> you didn't drop the code in the main method
[16:19] <agronholm> you just left it there
[16:20] <delinquentme> AH ok this is MUCH smaller
[16:20] <agronholm> and fix line 17 in the python code
[16:20] <delinquentme> so all i need is the public class MyClass def .. the creation of a public string "name" and the greet method
[16:20] <agronholm> yes
[16:21] <delinquentme> so I can just remove that whole ref to setName() bc im passing that value through the argv
[16:22] <agronholm> argv has nothing to do with this
[16:22] <delinquentme> yeh bc thats not in there anymore http://pastie.org/3414638
[16:22] <agronholm> you still have the call to setName() on line 17
[16:23] <delinquentme> yeah one sec
[16:23] <delinquentme> trying to figure out where the name is passed / set
[16:23] <agronholm> and the redundant None check
[16:23] <agronholm> or, rather, useless
[16:23] <agronholm> delinquentme: figure out what? on line 17 of the python module?
[16:24] <agronholm> what do you still need to figure otu?
[16:24] <agronholm> out
[16:24] <delinquentme> so in the jython im creating an instance of MyClass ... named mc
[16:24] <delinquentme> so mc.name would invoke a name method .. but i want to set the value of name within mc
[16:24] <agronholm> no it doesn't invoke any methods
[16:24] <delinquentme> which after i remove ln17 wont be happening
[16:24] <delinquentme> correct
[16:24] <agronholm> where did I tell you to remove line 17?
[16:25] <agronholm> I've already told you what to replace it with
[16:25] <delinquentme> AH!
[16:25] <delinquentme> mc.name IS NOT mc.name()
[16:25] * delinquentme CHECK
[16:26] <agronholm> I think that whole main method is a waste of space too
[16:26] <agronholm> just put everything under line 28
[16:26] <agronholm> from the main() function
[16:28] <delinquentme> yeah i think thats extra stuff
[16:33] <delinquentme> ok cool -- I've cleaned up *JUST* enough to get it to run ( I think )
[16:33] <delinquentme> http://pastie.org/3414638 << updated .. lemme go compile that java
[16:34] <agronholm> you still have a main() function
[16:34] <agronholm> why?
[16:34] * stakkars (~tismer@p5DDB7096.dip.t-dialin.net) has joined #jython
[16:38] <delinquentme> in the jython because I want to troubleshoot as few vars as possible
[16:38] <delinquentme> currently though the java portion is not compiling
[16:38] <agronholm> why not
[16:39] <delinquentme> i think it requires a main()
[16:39] <delinquentme> the java that is
[16:39] <agronholm> no
[16:39] <delinquentme> no?
[16:39] <agronholm> what is the error
[16:40] <delinquentme> http://pastie.org/3414890
[16:40] <delinquentme> NoSuchMethodError
[16:41] <agronholm> that means you're trying to run the class
[16:41] <agronholm> not just compile it
[16:41] <agronholm> see line 1 there
[16:41] <delinquentme> of the java
[16:41] <agronholm> of the error
[16:41] <agronholm> are you using an ant build file?
[16:42] <delinquentme> nah netbeans as the IDE
[16:42] <agronholm> that looks like an ant build to be
[16:42] <agronholm> *to me
[16:42] <agronholm> how did you compile it?
[16:43] <delinquentme> there is a "run main project" within netbeans
[16:43] <delinquentme> and that error output is from within netbeans
[16:43] <agronholm> and it didn't occur to you that this operation might try to "run" your app?
[16:44] <delinquentme> im still getting used to the compile vrs run
[16:44] <agronholm> eclipse at least compiles java files on the fly, whenever you save them
[16:44] <delinquentme> so even though its telling me theres an exception it compiles because it said "BUILD SUCESSFUL"
[16:44] <agronholm> no explicit compilation is usually necessary
[16:44] <agronholm> yes
[16:46] <delinquentme> cool
[16:46] <delinquentme> agronholm, you rock
[16:47] <delinquentme> sucessfully pushed the chem formula into java
[16:47] <delinquentme> NOW i insert the chem parsing
[16:58] * stakkars (~tismer@p5DDB7096.dip.t-dialin.net) Quit (Quit: schnarch)
[17:18] <delinquentme> ok so im 3/4th sure that this java should compile .. but netbeans is saying it cannot locate the main class http://pastie.org/3414638
[17:20] * juneau001 (~juneau@ has joined #jython
[17:22] <agronholm> is it in the right package?
[17:23] <agronholm> and are you sure you're not trying to run it again?
[17:39] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) has joined #jython
[17:46] * delinquentme (~asdfasdf@c-24-3-189-214.hsd1.pa.comcast.net) Quit (Ping timeout: 245 seconds)
[17:49] * enebo (~enebo@75-168-50-253.mpls.qwest.net) Quit (Quit: enebo)
[18:02] * juneau001 (~juneau@ Quit (Quit: Take care...)
[18:39] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) Quit (Quit: Leaving.)
[18:39] * shashank (~shashank@63-228-87-227.hlrn.qwest.net) has joined #jython
[18:48] * delinquentme (~asdfasdf@ has joined #jython
[18:49] <delinquentme> stinking coffee houses w their 2 hour limits
[18:51] <delinquentme> ok so back to this compile action
[18:51] <delinquentme> do i *TRULY* need a public static void main(){}
[19:17] * stakkars (~tismer@dslb-088-072-242-141.pools.arcor-ip.net) has joined #jython
[19:20] <agronholm> delinquentme: did I not already say you don't?
[19:21] <delinquentme> agronholm, everyone in ##java says I do
[19:22] <agronholm> maybe they don't realize that your entry point is not in Java
[19:22] <agronholm> have you told them so?
[19:24] <agronholm> delinquentme: are you sure you know how to run the python part instead of the java part?
[19:25] <delinquentme> yeah im pretty sure im comfy w the python / jython
[19:25] <agronholm> what problems are you having then?
[19:25] <delinquentme> i made the edits your suggested
[19:26] <delinquentme> I believe it is getting java to spit out the output into jython
[19:27] <agronholm> so are you getting an error or what
[19:29] <delinquentme> on compiling this http://pastie.org/3415838
[19:29] <delinquentme> netbeans cant find the main method
[19:29] <agronholm> delinquentme: I thought I already explained that
[19:29] <agronholm> you're trying to run the java class
[19:29] <agronholm> which is impossible because there is no main method
[19:29] <delinquentme> yeah and im trying to simply
[19:29] <delinquentme> compile it
[19:29] <delinquentme> and its not happeing
[19:29] <delinquentme> happening*
[19:30] <delinquentme> f9 is supposed to be compile
[19:30] <agronholm> so what are you using to compile it then?
[19:30] <delinquentme> netbeans
[19:30] <agronholm> and are you getting an error then?
[19:30] <agronholm> I meant, which menu item
[19:31] <delinquentme> its just not doing anything
[19:31] <agronholm> what makes you think it doesn't work then? is there no .class file for the class?
[19:31] <agronholm> at least eclipse builds into the "bin" directory, maybe netbeans has a similar dir?
[19:32] <delinquentme> correct
[19:32] <delinquentme> i deleted the .class in order to check when its rebuilt
[19:32] <delinquentme> i then take the compiled class and run that from jython
[19:32] <delinquentme> but im not getting the Main.java to compile ... and Run > Compile isnt an option
[19:33] <delinquentme> (within net beans )
[19:33] <agronholm> what did you compile then?
[19:33] <agronholm> try making a minor change and saving
[19:34] <agronholm> if it's in auto-build mode, it should regenerate the class file
[19:35] <delinquentme> not shit
[19:35] <agronholm> ?
[19:35] <delinquentme> i've compiled before and it puts it in a separate dir from the src/
[19:35] <agronholm> yes
[19:35] <delinquentme> so if it compiles it should be in a build/ dir
[19:35] <delinquentme> build/classes
[19:35] <delinquentme> put a space in .. saved it
[19:35] <delinquentme> and nothing
[19:36] <delinquentme> im wondering if i should javac this thing
[19:36] <agronholm> that's one option
[19:36] <delinquentme> lemme try that
[19:36] <agronholm> but you should probably get better acquainted with your tools before taking on any serious projects
[19:40] <delinquentme> javac is telling me there is no source
[19:40] <delinquentme> javac -classpath /home/thrive/java_projects/JARs/commons-lang-2.1.jar;/home/thrive/java_projects/JARs/oscar4-all-4.1-with-dependencies.jar:/home/thrive/java_projects/JARs/carl.jar Main.java
[19:41] <delinquentme> nm!
[19:50] <delinquentme> nice
[19:50] <delinquentme> javac and explicit compile to the rescue
[21:27] * wmeissner (~wmeissner@2001:44b8:2134:a101:fcc5:4016:57ce:fe96) has joined #jython
[21:48] * stakkars (~tismer@dslb-088-072-242-141.pools.arcor-ip.net) Quit (Quit: schnarch)
[21:50] * delinquentme (~asdfasdf@ Quit (Quit: Leaving)
[22:05] * stakkars (~tismer@ has joined #jython
[23:55] * stakkars (~tismer@ Quit (Quit: schnarch)


These logs were automatically created by JythonLogBot_ on irc.freenode.net using a slightly modified version of the Java IRC LogBot (github).