#jython IRC Log (v0.9)

Index

IRC Log for 2013-03-03

Timestamps are in GMT/BST.

[0:04] * lopex (uid4272@gateway/web/irccloud.com/x-awciyhlyyjzyhorb) Quit (*.net *.split)
[0:04] * clajo04 (~clajo04@pool-96-224-200-185.nycmny.fios.verizon.net) Quit (*.net *.split)
[0:05] * lopex (uid4272@gateway/web/irccloud.com/x-yirpflvhjutmeaja) has joined #jython
[0:32] * Trundle (~andy@python/site-packages/trundle) Quit (Remote host closed the connection)
[1:10] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[3:41] * lheuer1 (~Adium@blfd-4d08fc0b.pool.mediaWays.net) Quit (Quit: Leaving.)
[5:50] * JStoker (jstoker@unaffiliated/jstoker) Quit (Ping timeout: 255 seconds)
[5:51] * eriku74 (~erik@home.kulturit.no) Quit (Ping timeout: 255 seconds)
[5:51] * fwierzbicki (~frank@99-106-170-162.lightspeed.sntcca.sbcglobal.net) Quit (*.net *.split)
[5:51] * Hukka (hukka@hilla.kapsi.fi) Quit (*.net *.split)
[5:54] * eriku74 (~erik@home.kulturit.no) has joined #jython
[5:57] * fwierzbicki (~frank@99-106-170-162.lightspeed.sntcca.sbcglobal.net) has joined #jython
[5:57] * Hukka (hukka@hilla.kapsi.fi) has joined #jython
[6:17] * JStoker (jstoker@unaffiliated/jstoker) has joined #jython
[6:18] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[6:28] * md_5 (~md_5@mcdevs/trusted/md-5) Quit (Quit: ZNC - http://znc.in)
[6:28] * md_5 (md_5@mcdevs/trusted/md-5) has joined #jython
[7:10] * Juneau001 (~Juneau@50.44.45.110) has joined #jython
[7:13] * purplefox (~purplefox@host-2-99-42-43.as13285.net) has joined #jython
[7:39] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[7:40] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[8:09] * purplefox (~purplefox@host-2-99-42-43.as13285.net) Quit (Ping timeout: 264 seconds)
[8:21] * purplefox (~purplefox@host-2-99-42-43.as13285.net) has joined #jython
[9:44] * purplefox (~purplefox@host-2-99-42-43.as13285.net) Quit (Ping timeout: 255 seconds)
[10:07] * purplefox (~purplefox@host-2-99-42-43.as13285.net) has joined #jython
[13:55] * lheuer1 (~Adium@blfd-4d08fc0b.pool.mediaWays.net) has joined #jython
[14:02] * lheuer (~Adium@unaffiliated/lheuer) Quit (*.net *.split)
[14:04] * Juneau001 (~Juneau@50.44.45.110) has joined #jython
[14:46] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[14:46] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[14:49] * lheuer1 (~Adium@blfd-4d08fc0b.pool.mediaWays.net) Quit (Ping timeout: 252 seconds)
[14:57] * hd1 (~hdiwan@50-0-145-228.dsl.static.sonic.net) has joined #jython
[14:59] <hd1> using JTable in jython and trying to define a custom TableCellRenderer??? the method I need to override returns a component, but it's an interface, so I'm not sure how to do this
[15:03] <hd1> I've tried self.getTableCellRendererComponent, which sends the program in an infinite loop, super.getTableCellRendererComponent returns an AttributeError, and table.getCellRenderer.getCellRendererComponent gives me recursion depth exceeded
[15:32] <hd1> https://gist.github.com/hdiwan/5076526 is the script
[15:32] <hd1> if anyone minds taking a look
[15:59] <agronholm> hd1: I have to say your code looks a bit...odd
[16:00] <agronholm> table.setDefaultRenderer(type(Object()), app) <- this is probably the oddest one of all
[16:01] <hd1> how would you accomplish that, agronholm ?
[16:01] <agronholm> accomplish what
[16:01] * hd1 isn't a programmer
[16:01] <agronholm> this isn't your code then?
[16:01] <hd1> assigning a defaultCellRenderer to a JTable
[16:01] <hd1> it is my code, but I'm not a trained programmer
[16:03] <hd1> and definitely not a jython programmer
[16:04] <hd1> probably goes to explain why it's such a mess
[16:06] <agronholm> first of all, Object is already a class
[16:06] <agronholm> so you probably meant table.setDefaultRenderer(Object, app)
[16:06] <agronholm> but your column data is unlikely to be Objects
[16:07] <agronholm> hd1, I don't know if it helps, but I've written a helper library for Swing on Jython
[16:08] <hd1> so, what I need would be table.setDefaultRenderer(String, app)?
[16:08] <agronholm> if all your columns are Strings
[16:08] <agronholm> the data that is
[16:09] <hd1> they are
[16:09] <agronholm> that would work then
[16:09] <agronholm> https://pypi.python.org/pypi/jython-swingutils
[16:09] <agronholm> if you want to take a look
[16:11] <hd1> ok??? that change did nothing to solve my problem
[16:11] <agronholm> line 31 causes your problem
[16:11] <hd1> I'm not sure what I need syntax-wise to accomplish what I'm trying to do
[16:11] <agronholm> table.getCellRenderer(row, column) returns your App instance
[16:12] <hd1> I get that much
[16:12] <agronholm> so what do you figure out happens when you call getTableCellRendererComponent() on that, from that very method?
[16:12] <hd1> recursion depth exceeded, eventually
[16:12] <agronholm> see the problem?
[16:13] <hd1> yes, but how do I fix it?
[16:13] <hd1> I get that it's calling itself and getting into an infinite loop
[16:13] <hd1> what I don't get is how to fix it
[16:14] <agronholm> cell renderers are normally based on JLabels
[16:14] <agronholm> you should at least inherit your cell renderer from the default table cell renderer
[16:14] <agronholm> they need to return some swing component
[16:15] <agronholm> so make a new class, inherit it from DefaultTableCellRenderer
[16:16] <agronholm> then call the superclass method in getTableCellRendererComponent() and make your own adjustments to its appearance
[16:17] <agronholm> likewise, you usually want to make a new table model class
[16:17] <agronholm> jython-swingutils has helpers to make all of this less tedious
[16:19] * lopex (uid4272@gateway/web/irccloud.com/x-yirpflvhjutmeaja) Quit (Ping timeout: 252 seconds)
[16:22] * purplefox (~purplefox@host-2-99-42-43.as13285.net) Quit (Ping timeout: 246 seconds)
[16:27] <hd1> agronholm: the color isn't taking hold
[16:27] <agronholm> let me see your code
[16:28] <hd1> just a sec...
[16:28] * hd1 thinks the roommate is torrenting
[16:32] <hd1> https://gist.github.com/hdiwan/5076526
[16:33] <agronholm> hd1, you're making a new jdbc connection every time a table cell is rendered...?
[16:33] <hd1> seems to be the case, agronholm
[16:33] <agronholm> please don't
[16:33] <agronholm> it makes my eyes hurt :)
[16:34] <agronholm> you're also forgetting to call the superclass method
[16:35] -mrmist- [Global Notice] - If you have an old nickserv account with us, please take a few moments to check that you have a valid email listed in /msg nickserv info. To set one, see /msg nickserv help set email. Having a valid email is the only way to recover your password if you forget it. Thanks for flying freenode.
[16:36] <agronholm> hd1: may I ask what this is for? is it your hobby project?
[16:36] <hd1> pretty much
[16:37] <agronholm> why choose jython and swing?
[16:37] <hd1> most of my programming is hobbyist, at the moment
[16:37] <hd1> why not?
[16:37] <agronholm> because there are easier alternatives?
[16:38] <agronholm> like PySide (Qt)
[16:38] <agronholm> jython is pretty much for those who absolutely need to integrate Java code
[16:38] <hd1> except for the cellrenderer, everything works fine
[16:39] <agronholm> I see plenty of problems here
[16:39] -mrmist- [Global Notice] - As a followup to my last message, if you experience errors trying to update your email address right now, please try again later. Apparently 100s of email changes at once doesn't work so well....
[16:39] <hd1> the majority of them EBKAC ?
[16:40] <hd1> (Existing Between Keyboard and Chair)
[16:40] <agronholm> well, I didn't want to put it that way
[16:40] <hd1> you could, it's ok
[16:40] <agronholm> for one, your way of constructing a table model forces you to render everything you load from the database
[16:41] <agronholm> which likely prompted you to make extra connections in getTableCellRendererComponent() to get additional data
[16:41] <hd1> ok
[16:42] <agronholm> normally you'd have a subclass of DefaultTableModel and override certain methods to provide the data
[16:42] <agronholm> so you could load all the necessary data in that model and choose what you display
[16:43] <hd1> I am building a vector of vectors initially for the data
[16:44] <agronholm> I can see that
[16:45] <hd1> the second connection is for updating the database as a result of clicking on the button
[16:45] <hd1> I'm open to suggestions for a less connect-happy approach though
[16:45] <agronholm> https://bitbucket.org/agronholm/jython-swingutils/src/1b0a94f3fade2745a70051fd9bd8b8531d56fa22/examples/binding_example.py?at=default#cl-43
[16:46] <agronholm> hd1, how about you at least create your own table model class, load all the data at once and serve it from there?
[16:47] <hd1> how am I not doing that? I'm loading the data into a vector and serving from said vector?
[16:47] <agronholm> forget vectors
[16:48] <hd1> hmm?
[16:48] <agronholm> first make your own table model subclass
[16:49] <agronholm> look at the java api documentation, specifically the TableModel interface
[16:49] <agronholm> that should give you some idea which methods to override in your subclass
[16:50] <agronholm> actually the best thing would probably to inherit from AbstractTableModel
[16:52] <hd1> ok, you're going to make me change much more than I (think I) need to to get cells a different background colour
[16:52] <agronholm> I'm trying to fix your design
[16:53] <agronholm> any experienced programmer would cringe at your current way of connecting to the db on every cell render
[16:53] <agronholm> you're not even closing the connections afterwards
[16:54] <hd1> I see
[16:55] <agronholm> your cell renderer is not calling the superclass method
[16:55] <agronholm> you should at least fix that
[16:57] <hd1> ok, updating the gist
[17:00] <agronholm> why are you constructing DefaultTableModel twice?
[17:02] <hd1> poor copy-paste from a website, I'm guessing
[17:02] <hd1> this code was written -- read copy-pasted from various places -- 9 months ago.
[17:03] <hd1> copy-pasted and (poorly) edited to suit my specific circumstances
[17:03] <hd1> as is probably evident
[17:15] * msavy (~msavy@redhat/jboss/msavy) Quit (Quit: {})
[17:35] <hd1> wow??? wtf happened to Norwich on goal difference? -18
[17:36] <agronholm> wrong channel?
[17:36] <hd1> agronholm: wrong window completely, to be exact
[18:01] * hd1 (~hdiwan@50-0-145-228.dsl.static.sonic.net) has left #jython
[18:15] * lopex (uid4272@gateway/web/irccloud.com/x-qtiwskztchjwacrp) has joined #jython
[18:34] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[18:39] * HypnoGenX (~Unknown@5ED4F1F5.cm-7-5d.dynamic.ziggo.nl) has joined #jython
[18:44] <HypnoGenX> I'm trying to embed multiple interactive interpreter consoles in an application, and I'm running into an annoying issue. If I use the InteractiveConsole class, and push() every user input line, the interpreter behaves the way I want it to, like a commandline interpreter session. But adding a second instance of InteractiveConsole somehow causes them to behave as a single shared interpreter, with output coming out of the first interpre
[18:44] <HypnoGenX> ter object for both objects, but nothing out of the second.
[18:45] <HypnoGenX> Now if instead I use the InteractiveInterpreter class with unique PySystemState objects, they behave like seperate interpreters the way I want them to, but they no longer interpret user input the way I want. Multiline statements are no longer supported, so you can't do things like function definitions.
[18:46] <HypnoGenX> Any way around this problem?
[18:47] * Juneau001 (~Juneau@50.44.45.110) has joined #jython
[18:50] <HypnoGenX> If it helps illustrate what I'm talking about: http://postimage.org/image/cw8z4jmzj/ - Here I use InteractiveInterpreter objects with their own PySystemState objects, and; http://postimage.org/image/4yq85ihpt/ - Here I use InteractiveConsole objects.
[19:47] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[20:19] * Juneau001 (~Juneau@50.44.45.110) has joined #jython
[21:36] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[21:42] * Juneau001 (~Juneau@50.44.45.110) has joined #jython
[21:52] * Taggnostr (~quassel@dyn57-146.yok.fi) Quit (Read error: Connection reset by peer)
[21:53] * Taggnostr (~quassel@dyn57-146.yok.fi) has joined #jython
[23:02] * Juneau001 (~Juneau@50.44.45.110) Quit (Quit: Juneau001)
[23:15] * HypnoGenX (~Unknown@5ED4F1F5.cm-7-5d.dynamic.ziggo.nl) Quit (Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC.)

Index

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