#jython IRC Log

Index

IRC Log for 2016-01-21

Timestamps are in GMT/BST.

[0:10] * paolo (~paolo@2a03:8180:1001:b2:25::12c) has joined #jython
[0:10] * paolo (~paolo@2a03:8180:1001:b2:25::12c) Quit (*.net *.split)
[0:11] * paolo (~paolo@2a03:8180:1001:b2:25::12c) has joined #jython
[0:23] * jamierocks (jamierocks@bnc.lol768.com) has joined #jython
[2:18] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[4:41] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Quit: Konversation terminated!)
[8:41] * ohumbel (5390f784@gateway/web/freenode/ip.83.144.247.132) Quit (Ping timeout: 252 seconds)
[10:00] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[10:37] * qwebirc66848 (47c6aed2@gateway/web/freenode/ip.71.198.174.210) has joined #jython
[10:37] <qwebirc66848> hi all
[10:38] <qwebirc66848> i'm having some problems loading opencv, should i ask here or should i ask in opencv forums?
[10:42] * qwebirc66848 (47c6aed2@gateway/web/freenode/ip.71.198.174.210) Quit (Ping timeout: 252 seconds)
[10:44] * aw (~user@2601:644:301:d500:521a:c5ff:fef3:f5e7) has joined #jython
[10:45] * aw (~user@2601:644:301:d500:521a:c5ff:fef3:f5e7) has left #jython
[10:51] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[10:51] * ChanServ sets mode +o Arfrever
[10:54] * jythonlinkerror (~user@2601:644:301:d500:521a:c5ff:fef3:f5e7) has joined #jython
[10:55] <jythonlinkerror> Hi all, I'm getting an UnsatisfiedLinkError when trying to load opencv
[10:56] <jythonlinkerror> the library should be at /home/user/projects/opencv/lib/libopencv_java300.so
[10:57] <jythonlinkerror> I have tried import java.lang
[10:57] <jythonlinkerror> java.lang.System.load("/home/user/projects/opencv/lib/libopencv_java300.so")
[10:58] <jythonlinkerror> and also export LD_LIBRARY_PATH=/home/user/projects/opencv/lib
[10:58] <jythonlinkerror> I appended the jar file to sys.path
[10:59] <jythonlinkerror> sys.path.append("/home/user/projects/opencv/bin/opencv-300.jar")
[11:00] <jythonlinkerror> I have also tried java.lang.System.setProperty("java.library.path", "/home/user/projects/opencv/lib")
[11:01] <jythonlinkerror> Then to use the code, I did:
[11:01] <jythonlinkerror> import org.opencv.imgcodecs.Imgcodecs as Imgcodecs
[11:01] <jythonlinkerror> Imgcodecs.imread("filename")
[11:01] <jythonlinkerror> and it gives me this:
[11:01] <jythonlinkerror> Traceback (most recent call last):
[11:01] <jythonlinkerror> File "<stdin>", line 1, in <module>
[11:01] <jythonlinkerror> at org.opencv.imgcodecs.Imgcodecs.imread_1(Native Method)
[11:01] <jythonlinkerror> at org.opencv.imgcodecs.Imgcodecs.imread(Imgcodecs.java:102)
[11:01] <jythonlinkerror> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[11:01] <jythonlinkerror> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[11:01] <jythonlinkerror> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[11:01] <jythonlinkerror> at java.lang.reflect.Method.invoke(Method.java:497)
[11:03] <jythonlinkerror> definition of imread is here:
[11:03] <jythonlinkerror> public static Mat imread(String filename)
[11:03] <jythonlinkerror> {
[11:03] <jythonlinkerror>
[11:03] <jythonlinkerror> Mat retVal = new Mat(imread_1(filename));
[11:03] <jythonlinkerror>
[11:03] <jythonlinkerror> return retVal;
[11:03] <jythonlinkerror> }
[11:03] <jythonlinkerror> and there is this declaration
[11:03] <jythonlinkerror> private static native long imread_1(String filename);
[11:03] <jythonlinkerror> this is my first time asking on this channel, so please let me know if there's better way to format error messages and if there are missing info
[11:06] <agronholm> jythonlinkerror: the better way would be not spamming the channel with huge error messages and using a pastebin instead
[11:07] <agronholm> also doesn't look like you have a problem with jython in the first place
[11:24] <jythonlinkerror> oh sorry. I guess it's not a jython development problem per se, but I am not sure if I'm doing something wrong or if opencv has some problems
[11:27] <agronholm> jythonlinkerror: from the error message it looks like it's missing a dependent library
[11:27] <agronholm> other than that IDK
[11:27] <agronholm> but, not a jython problem
[11:33] <jythonlinkerror> do you know if I can find out what I'm missing from jython?
[11:34] <agronholm> jythonlinkerror: no
[11:34] <agronholm> jythonlinkerror: the "ldd" tool may help you when you run it against the .so file in question
[11:42] <jythonlinkerror> thanks for your help. do I need to java.lang.System.load all of the libraries? http://pastebin.com/4PyHUpmn
[12:46] * jythonlinkerror (~user@2601:644:301:d500:521a:c5ff:fef3:f5e7) Quit (Ping timeout: 250 seconds)
[12:56] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[12:56] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Remote host closed the connection)
[12:56] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[14:08] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Remote host closed the connection)
[15:05] * xemdetia (xemdetia@nat/ibm/x-wzeddnykzysbpeqe) has joined #jython
[15:20] * xemdetia (xemdetia@nat/ibm/x-wzeddnykzysbpeqe) Quit (Remote host closed the connection)
[15:24] <topi`> on CPython, multiprocessing (and concurrent.futures.ProcessPoolExecutor) all tend to suck for fine-grained tasks, however I'd like to try out concurrent.futures for Jython (since threading can be used, because of no GIL)
[15:24] <topi`> does anyone know of any adaptation/port of concurrenet.futures for python 2 so that it could be tried on Jython?
[15:25] <topi`> ah, "futures 3.0.4", it's a backport of the concurrent.futures in python 3.2
[15:25] <topi`> how do I install a wheel for jython?
[15:26] <topi`> agronholm: it seems to be yours! the backport I mean
[15:26] <agronholm> topi`: yes
[15:26] <topi`> damn you, the amount of stuff you do is amazing
[15:26] <agronholm> to install a wheel, "pip install futures"
[15:26] <agronholm> hehe
[15:26] <topi`> :)
[15:26] <topi`> btw, I work for a java shop who wants to recruit as effectively as Reaktor and other big names. Any hints? :)
[15:27] <topi`> (I'm just looking forward for those recruitment bounties...)
[15:27] <topi`> they are looking for people in Helsinki
[15:27] <agronholm> I dunno, I haven't recruited anyone yet
[15:27] <topi`> :)
[15:28] <topi`> I've tried to explain the suits that by broadening the scope of tools, they could become more interesting. Scala, clojure, even jython :)
[15:28] <topi`> I'd rule Scala out, it's an immense mishmash of FP and OOP concepts and just takes a huge effort to learn properly
[15:29] <topi`> it's just inconsistent... the beauty of Python is the consistency and aesthetics
[15:29] <topi`> and maybe the personality cult behind GvR :) :)
[15:30] <topi`> is it even possible to do proper asynchronous programming (network events) in Java anyways? sounds like a good match for Jython (if the requirement is still to stay under JVM)
[15:31] * xemdetia (xemdetia@nat/ibm/x-rthwmjrfatvyfpsh) has joined #jython
[15:33] <agronholm> topi`: barring any jython specific bugs, I don't see why not
[15:34] <topi`> agronholm: I mean, from my point of view, jython would be the best "way" to do proper network (async) programming on JVM
[15:34] <topi`> would you agree?
[15:34] <topi`> maybe JRuby as well, they have EventMachine
[15:35] <agronholm> topi`: with its generators, jython would certainly fare better there than Java
[15:35] <agronholm> dunno much about other JVM languages
[15:36] <topi`> now, the only challenge left is to match JRuby's level of performance :)
[15:37] <topi`> I guess jimbaker knows a thing or two about perf
[15:37] <agronholm> jython has a long way to go there
[15:37] <agronholm> and trouble is, not many people other than jimbaker know how to fix the performance problems
[15:37] <topi`> yes. But targeting "JRuby level" would be a good milestone - a long throw I know
[15:38] <topi`> yes
[15:38] <topi`> I wish he would get paid for fixing jython's perf :)
[15:39] * xemdetia (xemdetia@nat/ibm/x-rthwmjrfatvyfpsh) Quit (Remote host closed the connection)
[15:40] * xemdetia (xemdetia@nat/ibm/x-gjjkbqpukmmvsoeo) has joined #jython
[16:02] <topi`> agronholm: I tried "futures", but I got this:
[16:03] <topi`> Error: unbound method __enter__() must be called with ThreadPoolExecutor instance as first argument (got nothing instead)
[16:03] <topi`> I basically tried this:
[16:03] <agronholm> pastebin plz
[16:03] <topi`> with concurrent.futures.ThreadPoolExecutor as exe:
[16:03] <topi`> result = exe.map(is_prime, PRIMES)
[16:03] <topi`> it's the example in python3 docs
[16:04] <topi`> https://docs.python.org/3.2/library/concurrent.futures.html#processpoolexecutor
[16:04] <agronholm> topi`: you're forgetting to instantiate it
[16:04] <agronholm> the () are missing
[16:04] <topi`> oh!
[16:04] <topi`> sorry
[16:04] <topi`> I modified it to use ThreadPoolExecutor instead
[16:04] <topi`> :)
[16:04] <topi`> I'm sloppy, maybe I should head home
[16:07] <topi`> does ThreadPoolExecutor() take an argument?
[16:07] <agronholm> yes, the maximum size of the pool
[16:07] <topi`> OK
[16:08] <topi`> it can be, say, 100 threads :)
[16:08] <topi`> or is it useful to give a smaller value?
[16:08] <agronholm> better not use that many
[16:08] <agronholm> I wouldn't use more than 10-20
[16:08] <topi`> right, it's only an i7 with 4 cores
[16:08] <topi`> my laptop, I mean :)
[16:09] <topi`> the startup time is quite long
[16:09] <agronholm> we know
[16:09] <agronholm> using more threads is only beneficial if using blocking network APIs
[16:10] <topi`> but works, and for larger tasks this is going to work very well
[16:10] <topi`> I'll try to construct a benchmark to see how much better Thread based scheduling is than Process
[16:10] <agronholm> it's certainly more convenient
[16:23] <topi`> ProcessPoolExecutor is really inefficient in python3, as it uses multiprocessing which uses ForkingPickler() to spread the calculations
[16:23] <topi`> so basically if you have a lot of tasks, and the amount of work one worker does is small, then the overhead from the pickling alone is huge
[16:23] <agronholm> topi`: do you know about my Asphalt project?
[16:25] <topi`> what's it about?
[16:25] <agronholm> I just want to mention that while it won't work with jython in the near future (due to being py3 only) I have a component project in the works "asphalt-tasks" that will provide Celery level functionality while being easy to configure and use
[16:25] <agronholm> asphalt is a generic application framework
[16:26] <agronholm> you can watch my pycon.fi talk about it on youtube
[16:26] <topi`> I had a look at Celery once, and decided against using it :)
[16:26] <topi`> pycon.fi 2015 or?
[16:26] <agronholm> yes
[16:26] <agronholm> it has a reputation of being complicated to set up, and requires you to declare the task callables in advance
[16:27] <topi`> exactly
[16:28] <topi`> 44 views for your presentation on youtube! not exactly a resounding success ;)
[16:28] <agronholm> yeah...
[16:29] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[16:30] <agronholm> I am currently working on both the WAMP client (the websocket subprotocol) and the web framework (asphalt-web)
[16:31] <topi`> you have strange client requirements...
[16:31] <agronholm> what requirements?
[16:35] <agronholm> the problem with properly presenting Asphalt is that it enables the kinds of applications that would've been considered too complicated before, and thus nobody has made them so nobody is looking for a solution like this
[16:36] <topi`> I agree w.r.t Tornado being obsoleted by aiohttp :)
[16:36] <agronholm> everybody is just thinking: "I need to make an app. Which web framework should I pick?"
[16:37] <topi`> oh, you use type hints!
[16:37] <agronholm> yes, heavily
[16:37] <topi`> I tried "mypy" recently, nice piece of work
[16:38] <agronholm> didn't work so well for me
[16:38] * shoemonkey (~shoemonke@2601:240:c801:f010:9c:ff6f:6fc0:6b44) has joined #jython
[16:38] <agronholm> so I created something else: https://pypi.python.org/pypi/typeguard
[16:39] <agronholm> gives you java-style type safety for function calls
[16:39] <agronholm> it was originally supposed to come with asphalt but I decided to release it as an independent library
[17:47] * shoemonkey (~shoemonke@2601:240:c801:f010:9c:ff6f:6fc0:6b44) Quit (Remote host closed the connection)
[18:37] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[18:44] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) Quit (Remote host closed the connection)
[18:48] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[18:59] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) Quit (Remote host closed the connection)
[19:00] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[19:10] * TomA_ (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[19:10] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Read error: Connection reset by peer)
[19:45] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) Quit (Remote host closed the connection)
[20:41] * shoemonkey (~shoemonke@173-15-28-214-Illinois.hfc.comcastbusiness.net) has joined #jython
[21:08] * shoemonk_ (~shoemonke@173-15-28-214-Illinois.hfc.comcastbusiness.net) has joined #jython
[21:11] * shoemonkey (~shoemonke@173-15-28-214-Illinois.hfc.comcastbusiness.net) Quit (Ping timeout: 276 seconds)
[21:27] * shoemonk_ (~shoemonke@173-15-28-214-Illinois.hfc.comcastbusiness.net) Quit (Remote host closed the connection)
[21:34] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[21:56] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) Quit (Remote host closed the connection)
[21:57] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[22:32] * TomA_ (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Remote host closed the connection)
[22:43] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) Quit (Remote host closed the connection)
[23:00] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Quit: Ex??re)
[23:10] * pilne (~pilne@75-132-212-62.dhcp.stls.mo.charter.com) has joined #jython
[23:32] * shoemonkey (~shoemonke@c-24-12-55-211.hsd1.il.comcast.net) has joined #jython
[23:59] * xemdetia (xemdetia@nat/ibm/x-gjjkbqpukmmvsoeo) Quit (Ping timeout: 276 seconds)

Index

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