#jython IRC Log


IRC Log for 2014-08-22

Timestamps are in GMT/BST.

[0:06] <paolo> agronholm: how do you test json encoding/decoding?
[0:07] <agronholm> I'm testing decoding here
[0:07] <agronholm> I'm doing loads() on my 700+ Kb json file
[0:07] <agronholm> no decoding hooks required for this one
[0:07] <agronholm> I just tried simplejson
[0:07] <agronholm> not sure if it took longer than 5 minutes
[0:08] <agronholm> jyson does it in under 2 seconds
[0:08] <agronholm> but has no hooks for encoding/decoding and produces bytestrings instead of unicodes
[0:10] <paolo> too bad
[0:10] <agronholm> I'm basically left with no other option than pickle =)
[0:10] <agronholm> java serializers are no good
[0:10] <paolo> what about a java implementation?
[0:10] <paolo> ah ok
[0:10] <agronholm> because they produce java types
[0:11] <paolo> can't them be used in jython?
[0:11] <agronholm> and they have all sorts of quirks to work around the fact that java is statically typed :)
[0:11] <agronholm> not really.
[0:11] <paolo> ok, too bad (2dn)
[0:11] <agronholm> you can't use python decoding hooks in a java serializer
[0:13] <paolo> agronholm: is your json file flat or with a lot of nested blocks?
[0:13] <paolo> maybe it could make a difference
[0:13] <agronholm> there is some nesting, but not a lot
[0:13] <agronholm> not more than 2 levels
[0:13] <paolo> mmm.. not much.
[0:16] <agronholm> paolo: in contrast, cPickle.loads() completes instantly =)
[0:16] <paolo> i never understood if http://jyni.org/ can be user with numpy/scipy only or with other cpython extensions, too
[0:20] <agronholm> let's see how msgpack fares on jython
[0:22] <agronholm> wow
[0:22] <agronholm> lightning fast
[0:22] <agronholm> and it has object hooks :)
[0:22] <agronholm> yep, I'll be using this one
[0:22] <paolo> wow, that's wonderful, me too, thanks!!
[0:23] <agronholm> I have a websockets based RPC with a jython client and a cpython server
[0:23] <paolo> very nice setup
[0:23] <agronholm> msgpacks works nicely on javascript too
[0:23] <agronholm> -s
[0:24] <agronholm> at least it should, I've seen some code
[0:24] <agronholm> and since websocket allows for binary messages, msgpack fits in quite nicely
[0:24] <paolo> smart
[0:49] <agronholm> paolo: what's even better is that it's capable of telling the difference between unicode strings and bytestrings (though you have to configure the unpacker for that)
[0:50] <agronholm> AND the protocol seems to have support for custom types in a completely safe way (no more {'__type__': 'datetime'} hacks
[0:50] <agronholm> I haven't figured out yet how that works though
[0:50] <agronholm> but the docstrings strongly hint that way
[0:54] <agronholm> ok I figured it out
[0:54] <agronholm> it's nicely explained here: https://pypi.python.org/pypi/msgpack-python
[0:56] <agronholm> omg I love it
[7:08] * antkong (~antkong@ Quit (Quit: antkong)
[7:44] * ohumbel (5390f784@gateway/web/freenode/ip. Quit (Quit: Page closed)
[9:09] <topi`> folks, what's the "current" version of jython right now? I need to move my django stuff to a repo, but which jython version should I set up? b2 or b3?
[9:18] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) has joined #jython
[10:15] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) Quit (Quit: antkong)
[10:47] <topi`> anyone tried sending push messages to iOS devices via jython? I'm trying to use com.notnoop.apns
[10:47] <topi`> everything else works (I can create a Service object), but creating a Payload fails like this:
[10:47] <topi`> java.lang.NoClassDefFoundError: Could not initialize class com.notnoop.apns.PayloadBuilder
[10:48] <topi`> which is really really odd, as I'm importing like "from com.notnoop.apns import *" and everything else is found
[10:50] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) has joined #jython
[10:55] <topi`> funny, the root cause was this:
[10:55] <topi`> java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
[10:56] <topi`> which, for some odd reason, wasn't visible to me until I tried to import that failing class manually
[11:00] <topi`> log4j:WARN No appenders could be found for logger (com.notnoop.apns.internal.ApnsConnectionImpl).
[11:00] <topi`> log4j:WARN Please initialize the log4j system properly.
[11:00] <topi`> how do I initialize log4j correctly from within jython?
[11:13] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) Quit (Quit: antkong)
[12:25] <paolo> topi`: about the logger the docs points to this: https://logging.apache.org/log4j/1.2/faq.html#noconfig
[12:26] <paolo> (i've not been able to get rid of the warning, though)
[12:26] <paolo> if you find a solution pls share ;)
[12:42] * xemdetia (xemdetia@nat/ibm/x-auglechlgegafsrd) has joined #jython
[14:39] <jimbaker> topi`, please use beta 3
[14:39] <jimbaker> looks ;like we still need to update jython.org to point to it
[14:40] <jimbaker> fwierzbicki, did you finalize (harden?) the beta
[14:45] * xemdetia (xemdetia@nat/ibm/x-auglechlgegafsrd) Quit (Read error: Connection reset by peer)
[14:46] <jimbaker> agronholm, http://bugs.jython.org/issue2167 is the "json is slow" bug that i reported
[14:52] <jimbaker> it would be very easy to get a fast json, just a matter of some engineering time
[14:53] * xemdetia (xemdetia@nat/ibm/x-uxnbhtqxhzqpmfyv) has joined #jython
[14:58] <jimbaker> just reviewing the code in https://github.com/jythontools/jython/blob/master/lib-python/2.7/json/scanner.py, it's pretty clear that py_make_scanner (vs c_make_scanner if available from _json) is one substantial bottleneck. possibly one that could have a quick fix
[15:02] <jimbaker> apparently we just c_make_scanner, c_scanstring, c_encode_basestring_ascii, c_make_encoder - the only one that's slightly involved is the last, and even then the code in python it's replacing is pretty minimal - couple pages maybe of c-like python
[15:06] <fwierzbicki> jimbaker: yes it is released but I haven't put together an announcement yet
[15:08] <jimbaker> agronholm, can you update jython.org with the latest download link?
[15:08] <fwierzbicki> http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b3/jython-standalone-2.7-b3.jar
[15:08] <jimbaker> it would be nice to have this done before we have fwierzbicki's blog post
[15:08] <fwierzbicki> http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7-b3/jython-installer-2.7-b3.jar
[15:09] <fwierzbicki> It will be a few hours before I get that out
[15:09] <jimbaker> fwierzbicki, you have what you need from me with that state of jython talk i put together from europython, right?
[15:10] <fwierzbicki> yeah - I will take some highlights and maybe point to the doc as well
[15:10] <jimbaker> cool, thanks
[15:13] <peke> cool that 2.7b3 is officially out! i'm highly interested to test do regexp enhancements speed up robot framework.
[15:14] <jimbaker> peke, sounds good. also tell us where we are falling over in terms of regexes. anything that can specifically diagnose a specific bad re will be very very helpful
[15:15] <jimbaker> i know bottle does have something that causes a stackoverflow, however, bottle's re is way too complicated for me to want to analyze
[15:15] <peke> sure, i'll report if our acceptance tests fail mysteriously with b3.
[15:16] <jimbaker> (basically there's a very clever all-in-one re that bottle's default template engine uses. too clever in the case of trying to debug this issue unfortunately)
[15:16] <peke> our regexps aren't too complicated. we just compile plenty of them in class level and that might be one reason why `import robot` in jython takes so much time.
[15:17] <peke> i'll test this later today. now off to swim with kids.
[15:18] <jimbaker> interesting. it's also the sort of thing that could be readily cached, if re supported that
[15:18] <jimbaker> peke, have a great swim!
[15:25] <peke> jimbaker: didn't some of the new re enhancements include caching? or is that something that only improves actual regexp usage, not compilation?
[15:29] <jimbaker> peke, that caching is around the use of codepoint expansion
[15:31] <jimbaker> the underlying sre engine expands strings encoded in UTF-16 as an array of ints. that's how we inadvertently added an extra O(n) factor]
[15:32] <jimbaker> the better solution is to to just support next/prev, and avoid expansion, but that's a future bit of work. 2.7.1?
[15:33] <jimbaker> so basically this impacted all usage of REs on any relatively long strings. such as using beautiful soup against a web page...
[15:39] <jimbaker> peke, i suspect this extra factor could really impact robot framework too... it's been there regardless since 2.5 when we started making the distinction that java 5 did between characters and codepoints with utf-16 encoding
[16:42] * ohumbel (5390f784@gateway/web/freenode/ip. has joined #jython
[18:04] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)
[19:16] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:28] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Max SendQ exceeded)
[19:29] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:30] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[20:01] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) Quit (Ping timeout: 240 seconds)
[20:15] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) has joined #jython
[20:37] <agronholm> jimbaker: yeah, sure
[20:38] <agronholm> is this b3 the same as the soft launched one?
[20:38] <jimbaker> agronholm, yes
[20:38] <agronholm> okay
[20:38] <jimbaker> we have fixed more bugs since then, and progress in place for whatever will be beta 4
[20:38] <jimbaker> but time to get out that beta 3 :)
[20:39] <agronholm> alrighty
[20:39] <jimbaker> i'm having fun translating _json.c to _json.java, hopefully we will soon have this sped up
[20:45] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) has joined #jython
[21:16] * xemdetia (xemdetia@nat/ibm/x-uxnbhtqxhzqpmfyv) Quit (Ping timeout: 260 seconds)
[21:19] <agronholm> http://bpaste.net/show/191fc1297003
[21:19] <agronholm> I followed the README instructions, yet this happened
[21:19] <agronholm> I don't know how to fix it
[21:25] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 260 seconds)
[21:28] <paolo> agronholm: is there any repository to see with the website src and the stuff to compile it?
[21:29] <agronholm> http://hg.python.org/jython-docs/website
[21:32] <agronholm> ant is trying to execute rst2jysite.py, which DOES exist
[21:34] <agronholm> well, well.
[21:34] <agronholm> looks like josh was running windows
[21:34] <agronholm> because adding ./ to the command path solved the problem
[21:43] <paolo> yep, really
[21:43] <paolo> btw, jyjdbc works well but doesn't support Cursor.lastrowid. i wonder how to retrieve the id of the last committed INSERT. any idea?
[21:44] <paolo> (sqlite3)
[21:44] <agronholm> how would that work with insert ... select?
[21:44] <agronholm> or execmany insert
[21:45] <paolo> i'm not confident yet with db api, let me check
[22:01] <agronholm> jimbaker: is there any point in providing a download link for the non-standalone jython.jar? who needs it? it just confuses a lot of people
[22:02] <jimbaker> agronholm, probably not
[22:02] <agronholm> alright
[22:02] <jimbaker> so we can hide by obscurity :)
[22:02] <agronholm> I'm finally on top of the build hassle and I'm making changes now
[22:03] <paolo> agronholm: how can executemany help? i need it return a list of id that i want to return to a caller
[22:03] <agronholm> I mean, how would you get that list of ids from lastrowid?
[22:03] <agronholm> you couldn't
[22:03] <agronholm> you would need another mechanism for that
[22:04] <agronholm> postgresql does it with RETURNING, not sure about the others
[22:04] <paolo> at least i'd have lastrowid, then do a select by id
[22:04] <paolo> which is the primary key
[22:05] <agronholm> and if the primary keys are generated by a trigger?
[22:05] <agronholm> (is that possible?)
[22:05] <agronholm> jimbaker: ok so I'm going to link to two files -- the installer and the standalone jar
[22:05] <agronholm> is that okay?
[22:05] <paolo> i'm generate sql boilerplate using an orm and i don't user triggers, so it's not possible
[22:05] <agronholm> I mean generally
[22:06] <agronholm> what I'm trying to say is that there's probably a better way to do this than lastrowid
[22:06] <jimbaker> agronholm, +1
[22:06] <paolo> agronholm: ok.
[22:14] <agronholm> jimbaker: http://dpaste.com/3666C3S
[22:15] <agronholm> no checksums needed for 2.5.3+ ?
[22:16] <agronholm> what's the proper wording for the installer description? "Executable jar for installing Jython" maybe?
[22:22] <paolo> i remember that my first challenge in jython was about the choice of the right jar and their purpose. your description for the installer makes sense to me.
[22:23] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) Quit (Ping timeout: 240 seconds)
[22:25] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) has joined #jython
[22:27] * antkong (~antkong@110-174-129-54.static.tpgi.com.au) Quit (Client Quit)
[22:30] <agronholm> http://jython.org/downloads.html
[22:30] <agronholm> done.
[22:31] <agronholm> much better than before :)
[22:37] <paolo> my first project was a jython app embedded in a spring application, now i'm working the reverse and i feel like it's much more fun
[22:38] <paolo> but probably because in this project the python part prevails
[22:39] <agronholm> oh, one more change to make
[22:40] * agronholm changes topic to 'Try Jython 2.7b3 at http://tinyurl.com/p2kmxod | This channel is logged: http://jython.extreme.st/irclogs/ | Please update the wiki: http://wiki.python.org/jython | Jython Book: http://jythonbook.com | Podcast: http://jython.org/jythonpodcast/'
[22:40] <agronholm> there.
[22:41] <paolo> yay
[22:45] <paolo> agronholm: what about http://jython.org/? Latest news: Jython 2.7 Beta 2 Released (May 2013)
[22:46] <agronholm> paolo: that would require frank to update his blog first.
[22:46] <paolo> np, sorry
[23:16] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) Quit (Ping timeout: 260 seconds)
[23:28] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) has joined #jython
[23:56] <jimbaker> agronholm, i don't know about the checksums for 2.5.3, sorry
[23:56] <jimbaker> that's a question for fwierzbicki...
[23:56] <agronholm> more like wondering if they're needed here
[23:57] <agronholm> is there any merit to signing the jars?


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