You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jiger P. <jig...@ho...> - 2002-04-06 06:26:42
|
Hi all, I am writting a script in Jython which uses swing etc in it. I am creating a JList object & assigning actionPerformed to it but jython gives me this error. TypeError: can't set arbitrary attribute in java instance: actionPerformed My code creating the jlist obj is like this self.jlist = swing.JList(actionPerformed=self.onefileselection); & onefileselection is defined in the same class like this def onefileselection(self,event): self.openFile(self,event.source.selectedValue); I dont see anything wrong & infact if I assign the same actionPerformed syntax to a JTextField it works fine. But not with JList or JComboBox etc. Is there anything am missing. Thanks & Awaiting your replies, Jiger _________________________________________________________________ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com |
From: Frank C. <fc...@pu...> - 2002-04-06 01:30:38
|
Thanks for the tip. I'll take a look and post what I find. By the way, when I replace the random number loop with code to make an HTTP request the lock-up problem did not occur. I created 20,000 threads which all ran successfully. This makes me wonder if these are real threads at all? -Frank -- Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for free open-source Active Security solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. > From: "leon j. breedt" <lj...@ne...> > Date: Fri, 5 Apr 2002 13:33:03 +0200 > To: Oti <oh...@ya...> > Cc: jyt...@li... > Subject: Re: [Jython-users] Scalability study > > On Fri, Apr 05, 2002 at 12:30:46AM -0800, Oti wrote: >>> I couldn't get more than 2000 threads created. Trying the same script >>> with 3000 threads caused Jython to freeze. Using the GNOME System >>> Monitor I noticed 20+ instances of JRE but they were all taking 0% >>> CPU time.This makes me wonder if there is an upper limit to threads >>> in Jython? > Java threads in the JVMs I've used map to native operating system > threads. Its not so much a memory issue as it is operating system > resource. > > On Linux, where each thread is an actual lightweight process, it > consumes a process descriptor, of which there is a finite limit > set in one of the kernel header files (default is 4096, I think). > If you bump this up, you will see that you can create more threads. > > Check your syslog messages to see if the kernel logs an error > when your script starts failing. > > Regards, > Leon. > > -- > lj...@ne... :: +27.82.7890445 > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Frank C. <fc...@pu...> - 2002-04-06 01:29:13
|
I noticed that when I changed the script to make an actual HTTP request - instead of looping through the random number thing - that I could get as many threads as I want. I ran it up to 20,000 and the script completed. So I'm now wondering if these are real threads? -Frank -- Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for free open-source Active Security solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. > From: Oti <oh...@ya...> > Date: Fri, 5 Apr 2002 00:30:46 -0800 (PST) > To: jyt...@li... > Subject: Re: [Jython-users] Scalability study > > [ root ] > >> I couldn't get more than 2000 threads created. Trying the same script >> with 3000 threads caused Jython to freeze. Using the GNOME System >> Monitor I noticed 20+ instances of JRE but they were all taking 0% >> CPU time.This makes me wonder if there is an upper limit to threads >> in Jython? > > I think there is an upper limit for Threads in java (each Thread uses a > bit of memory). Never tried it myself, but a in a presentation held by > Paul Giotta I got the impression that he had an upper limit of around > 4000 Threads (don't remember the platform, though). > > Oti. > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Jeff E. <je...@ad...> - 2002-04-05 20:10:03
|
Sorry guys. This appears to be another manifestation of the JVM crash I reported here a couple of months ago. Jeff Emanuel wrote: > > Has anyone seen anything like this? > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D47AB75 > Function=[Unknown.] > Library=C:\Java\jre\bin\server\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at org.python.core.PyString.__tojava__(PyString.java) > at org.python.core.ReflectedArgs.matches(ReflectedArgs.java) > at > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.ja > at org.python.core.PyMethod.__call__(PyMethod.java) > at org.python.core.PyObject.__call__(PyObject.java) > at org.python.pycode._pyx0.writeSurface$85(AiInterp.py:631) > etc. > > > The relevant code is: > > 630 for node in nodeMap.keySet().iterator(): > 631 s = "VRTX %d %f %f %f" % > (nodeMap.get(node),node.x(),node.y(),node.z()) > 632 stream.println(s) > 633 i+=1 > > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Jeff E. <jem...@ad...> - 2002-04-05 15:16:23
|
Has anyone seen anything like this? Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D47AB75 Function=[Unknown.] Library=C:\Java\jre\bin\server\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at org.python.core.PyString.__tojava__(PyString.java) at org.python.core.ReflectedArgs.matches(ReflectedArgs.java) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.ja at org.python.core.PyMethod.__call__(PyMethod.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.pycode._pyx0.writeSurface$85(AiInterp.py:631) etc. The relevant code is: 630 for node in nodeMap.keySet().iterator(): 631 s = "VRTX %d %f %f %f" % (nodeMap.get(node),node.x(),node.y(),node.z()) 632 stream.println(s) 633 i+=1 |
From: leon j. b. <lj...@ne...> - 2002-04-05 11:31:57
|
On Fri, Apr 05, 2002 at 12:30:46AM -0800, Oti wrote: > > I couldn't get more than 2000 threads created. Trying the same script > > with 3000 threads caused Jython to freeze. Using the GNOME System > > Monitor I noticed 20+ instances of JRE but they were all taking 0% > > CPU time.This makes me wonder if there is an upper limit to threads > > in Jython? Java threads in the JVMs I've used map to native operating system threads. Its not so much a memory issue as it is operating system resource. On Linux, where each thread is an actual lightweight process, it consumes a process descriptor, of which there is a finite limit set in one of the kernel header files (default is 4096, I think). If you bump this up, you will see that you can create more threads. Check your syslog messages to see if the kernel logs an error when your script starts failing. Regards, Leon. -- lj...@ne... :: +27.82.7890445 |
From: Oti <oh...@ya...> - 2002-04-05 08:30:47
|
[ root ] > I couldn't get more than 2000 threads created. Trying the same script > with 3000 threads caused Jython to freeze. Using the GNOME System > Monitor I noticed 20+ instances of JRE but they were all taking 0% > CPU time.This makes me wonder if there is an upper limit to threads > in Jython? I think there is an upper limit for Threads in java (each Thread uses a bit of memory). Never tried it myself, but a in a presentation held by Paul Giotta I got the impression that he had an upper limit of around 4000 Threads (don't remember the platform, though). Oti. __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Frank C. <fc...@pu...> - 2002-04-05 06:51:07
|
Hi Dave: I manage an open source project called TestMaker (formerly Load) that builds intelligent test agents to assure Web Services (HTTP, HTTPS, SOAP, .NET, etc.) for functionality, scalability and performance. TestMaker embeds Jython as a scripting language to drive a library of test objects. You may find it to be a good compliment to Junit. About your question on learning materials, take a look at: http://www.pushtotest.com/ptt/thekit.html This is a knowledge kit I put together for BEA that shows how to set-up a SOAP-based Web service and test it using TestMaker. The kit comes with an article and all the source code. You're welcome to use it as courseware. -Frank -- Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for free open-source Active Security solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. > From: Dave Dench <d.j...@hu...> > Date: Fri, 22 Mar 2002 10:13:42 GMT > To: jyt...@li... > Subject: [Jython-users] Possibly FAQ re Junit > > Dear All, > I have searched the archives and posted on the Junit list. > No definitive answer, so trying again. ;) > I have been using unittest with Jython but would like to use JUnit > for teaching/illustrative purposes. The maillings suggest that use > of JUnit and automatic suite generation is problematical due to reflection. > I have tried using docstrings and jythonc but without much success. > Does there exist a port of the JUnit distribution demo ( Money ) in > jython that successfully works with GUI runner that I can use as a > leg-up ? > Many thanks > David > > ______________________________________________________________________________ > __ > > ******************************************************** > * David Dench * > * School of Computing & Mathematics * > * The University of Huddersfield * > * Tel: 01484 472083 * > * email: d.j...@hu... * > * web: http://scom.hud.ac.uk/scomdjd * > ******************************************************** > ______________________________________________________________________________ > __ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Quentin C. <nan...@eu...> - 2002-04-05 02:37:16
|
All: I get the following from the interpreter: C:\PROGRA~1\PROGRA~1\JAVA\JYTHON21>jython C:\PROGRA~1\PROGRA~1\JAVA\J2SDK1~1.0\lib;C:\PROGRA~1\PROGRA~1\JAVA\J2SDK1~1.0\jre\lib;C:\PROGRA~1\PROGRA~1\JAVA\J2SDKE~1.1\lib Jython 2.1 on java1.4.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from javax.servlet import * Traceback (innermost last): File "<console>", line 1, in ? ImportError: No module named servlet >>> from javax.ejb import * Traceback (innermost last): File "<console>", line 1, in ? ImportError: No module named ejb >>> (The path stuff is because I modified the batch file so that CLASSPATH was echoed.) What am I doing wrong? Installed it wrong? Importing servlet/ejb stuff incorrectly? thanks! -- Quentin ------------------------------------------------ Those who dread a dead-level of income or wealth do not dread, it seems, a dead-level of law and order, and of security of life and property. -- R.H. Tawney |
From: Mark E. <m.e...@AD...> - 2002-04-05 01:19:11
|
Doh! I was testing on a platform with the beta jython.jar file. When I run with the new jar file I get the same results you get. I will have to update my code *and* the jar file we are distributing. Thanks for the heads up. Mark -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Samuele Pedroni Sent: Thursday, April 04, 2002 4:51 PM To: Mark Elston; jyt...@li... Subject: Re: [Jython-users] Can we use Jython with just the jython.jar file? From: Mark Elston <m.e...@AD...> > Thanks, Paul. This seems to do the trick quite nicely. > > In a response to your post Samuele Pedroni wrote: > > >> To access python module in a directory "Lib" contained in file > >> JythonLib.jar used this syntax: > >> > >> "/path/JythonLib.jar!Lib" > >> > > > >with Jython 2.1 final that becomes simply > > > >"/path/JythonLib.jar/Lib" > > I tried this and couldn't import the modules. I do have the latest > Jython installed. He is right that it is in the Readme. However, > this talks about the sys.path variable, while I added the file to the > python.path variable. I don't know if that makes a difference or > not. In addition, this appears to be referring to how it is handled > from within a script, not from a Java program instantiating an > interpreter. Maybe that makes a difference. python.path ends up in sys.path, no special-casing, that's all about it. > Until I hear differently, I will continue to use the method you > provided. > Ok, I live inside some kind of reality distorsion field: C:\exp\z>jar tf z.zip Lib/ Lib/a.py Lib/a$py.class C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip/Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a a >>> C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip!Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named a and <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/cor e/S yspathArchive.java.diff?r1=1.1&r2=1.2> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/cor e/S yspathArchive.java?rev=1.2&content-type=text/vnd.viewcvs-markup> puzzled regards. _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Edward P. <epo...@te...> - 2002-04-05 01:09:44
|
Ok, a little experiment: import new from java.lang import Integer def funcToMethod(func, clas, methodName = None): method = new.instancemethod(func, None, clas) if not methodName: methodName = func.__name__ clas.__dict__[methodName] = method def newInit(self,a,b): self.__init__(a*b) funcToMethod(newInit, Integer, "__init__") Integer(5,5) >>> TypeError: java.lang.Integer(): expected 1 args; got 2 def doit(self): print "doit" funcToMethod(doit, Integer, "doit") i=Integer(5) i.doit() >>>doit dir(Integer) >>> ['MAX_VALUE', 'MIN_VALUE', 'TYPE', '__init__', 'compareTo', 'decode', 'doit', 'getInteger', 'parseInt', 'toBinaryString', 'toHexString', 'toOctalString', 'toStr ing', 'valueOf'] So. Can I not override __init__, or any other existing other function for that matter? I have a java class with 6 parameters, though only the first 2 are needed in most cases. I would really want to have default parameters sent from the Jython side, instead of creating 5 constructors on the Java side. Any hints? Thanks -Ed |
From: Samuele P. <pe...@in...> - 2002-04-05 00:52:38
|
From: Mark Elston <m.e...@AD...> > Thanks, Paul. This seems to do the trick quite nicely. > > In a response to your post Samuele Pedroni wrote: > > >> To access python module in a directory "Lib" contained in file > >> JythonLib.jar used this syntax: > >> > >> "/path/JythonLib.jar!Lib" > >> > > > >with Jython 2.1 final that becomes simply > > > >"/path/JythonLib.jar/Lib" > > I tried this and couldn't import the modules. I do have the latest > Jython installed. He is right that it is in the Readme. However, > this talks about the sys.path variable, while I added the file to the > python.path variable. I don't know if that makes a difference or > not. In addition, this appears to be referring to how it is handled > from within a script, not from a Java program instantiating an > interpreter. Maybe that makes a difference. python.path ends up in sys.path, no special-casing, that's all about it. > Until I hear differently, I will continue to use the method you > provided. > Ok, I live inside some kind of reality distorsion field: C:\exp\z>jar tf z.zip Lib/ Lib/a.py Lib/a$py.class C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip/Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a a >>> C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip!Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named a and <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/core/S yspathArchive.java.diff?r1=1.1&r2=1.2> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/core/S yspathArchive.java?rev=1.2&content-type=text/vnd.viewcvs-markup> puzzled regards. |
From: root <fc...@pu...> - 2002-04-04 23:17:20
|
I am working on a scalability study of SOAP-based Web Service systems for Elsevier Science - a content aggregation company for the medical industry. They asked me to study the performance and scalability of SOAP stacks, including BEA WebLogic, IBM WebSphere, Apache Axis and others. Elsevier also bought a license to the PushToTest TestNetwork software that I am using to generate load on the SOAP stacks. TestNetwork uses embedded Jython to script intelligent test agents that use a library of test objects written in Java to implement protocol handlers. As the first step in the test I needed to determine how many concurrent users I could generate using TestNetwork on a 900 Mhz AMD K5 CPU system with 512 Mbyte RAM running RedHat Linux 7.1. I wrote this Python (Jython) script to study threads: --start-- print "Minamax is a test to learn how many agents a machine may run concurrently." print print "This version of Minamax creates a local thread and determines the" print "MInimum, Average and MAXimum time it takes for the threads to run" print "at various numbers of concurrent threads." print print "(c) 2002 Frank Cohen. All rights reserved." print "for details see http://www.PushToTest.com" print import thread import time import random import sys agentcount = 500 min = 10.0 # shortest time a thread took to run avg = 0.0 # average time max = 0.0 # maximum time it took for a thread to run count = 0.0 # count of threads reporting results runtime = time.time() # This thread is called and returned def dominic( me ): global min, avg, max, count start = time.time(); thumbs = random.random() for i in range(1000): thumbs = thumbs * random.random() stop = time.time() duration = stop - start if duration<0: print "gotcha" if duration<min: min=duration if duration>max: max=duration avg = avg + duration count = count + 1 print "Initializing ", agentcount, "threads" # reset the values min = 10.0 avg = 0.0 max = 0.0 count = 0.0 for j in range( agentcount ): #start_new_thread is a handy feature of Python #it calls a function in a new thread, when the #function is complete the thread terminates silently thread.start_new_thread( dominic, ( 0, ) ) while count<agentcount: time.sleep(1) print "Min = %9.6f Max = %9.6f Avg = %9.6f count=%d" % (min, max, avg/count, count) totalduration = time.time() - runtime print "Total duration: ", totalduration --end-- I ran the script on Jython 2.1 with JRE 1.4: First I set the Java memory parameters to something low: -Xms24m -Xmx96m Min = 0.014000 Max = 0.341000 Avg = 0.050662 count=500 Total duration: 10.888000011444092 Min = 0.012000 Max = 1.128000 Avg = 0.050813 count=1000 Total duration: 19.13100004196167 Min = 0.014000 Max = 0.817000 Avg = 0.051882 count=2000 Total duration: 40.84600007534027 Then I set the Java memory parameters to: -Xms24m -Xmx196m and reran the same test: Min = 0.013000 Max = 0.874000 Avg = 0.058184 count=500 Total duration: 10.628999948501587 Min = 0.013000 Max = 1.140000 Avg = 0.054767 count=1000 Total duration: 21.02300000190735 Min = 0.013000 Max = 0.961000 Avg = 0.051195 count=2000 Total duration: 39.53999996185303 I couldn't get more than 2000 threads created. Trying the same script with 3000 threads caused Jython to freeze. Using the GNOME System Monitor I noticed 20+ instances of JRE but they were all taking 0% CPU time.This makes me wonder if there is an upper limit to threads in Jython? My next step is to add an HTTP request to each of the threads. I will post those results as they are known. Any feedback is appreciated. -Frank Cohen http://www.PushToTest.com --- Frank Cohen, CEO, http://www.PushToTest.com, phone: 408 374 7426 Come to PushToTest for free open-source test automation solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. |
From: Oti <oh...@ya...> - 2002-04-04 21:27:27
|
[ Dave Dench ] > Dear All, > I have searched the archives and posted on the Junit list. > No definitive answer, so trying again. ;) > I have been using unittest with Jython but would like to use JUnit > for teaching/illustrative purposes. The maillings suggest that use > of JUnit and automatic suite generation is problematical due to > reflection. > I have tried using docstrings and jythonc but without much success. > Does there exist a port of the JUnit distribution demo ( Money ) in > jython that successfully works with GUI runner that I can use as a > leg-up ? Hello Dave, not sure if this is what you are looking for: We extended JUnit in a way that we can use the normal ui (gui or text) to run our tests, but the tests themselves are written in Jython. One advantage of this is (in addition to all other advantages of Jython versus Java) that we can unit test both Java and Jython classes in the same framework. There was a small change necessary to the getTest() method in the junit.<any>ui.TestRunner classes: If a Jython unit test should be found, use a custom test finder to locate the .py file containing the test. The Jython test class extends junit.framework.TestCase (and therefore implements junit.framework.Test). The trick is to use embedded Jython to be able to return a junit.framework.Test object to the TestRunner. This way we can use the whole junit framework to run Jython unit tests behaving like normal java unit tests. Hopefully this gave you an idea. Best wishes, Oti. __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Oti <oh...@ya...> - 2002-04-04 20:56:42
|
[ Dylan Browne ] > Is there any simple way to find the size of a file in Python. I get > my file > by calling: > > f = open('myfile','r') > > I then want to determine wither the size in bytes, or the number of > lines in > the file. Normally I would use f.length(), but as it is a pyfile I am > a bit > stuck. Hello Dylan, not a big help, but one concerning the number of lines: [huohead|pwe] > jython Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> f = open("e:/temp/joined.html", "r") >>> lines = f.readlines() >>> len(lines) 149 >>> __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Oti <oh...@ya...> - 2002-04-04 20:50:39
|
[ Noel Rappin ] > There's a new Jython article on O'Reilly.com at: > <http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html> Maybe it is worth stating explicitly that Noel's and Samuele's long awaited book (Jython Essentials) is now available. enjoy! Oti. __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: O'Brien-Strain, E. <eo...@ex...> - 2002-04-04 20:24:50
|
To get the size of a file-system file you can do: from os import stat ... length = stat('myfile')[6] Alternatively you can use a Java File object: from java.io import File ... length = File('myfile').length() To get the number of lines in the file however you will have to read its bytes and count the line-endings. An easy (but not memory efficient) way to do this is: lineCount = len( open('myfile','r').readlines() ) (Possibly you need to create a separate file variable so that you can close the file.) __ Eamonn O'Brien-Strain HP Labs eo...@hp... > -----Original Message----- > From: Dylan Browne [mailto:DB...@la...] > Sent: Thursday, March 14, 2002 3:52 AM > To: jyt...@li... > Subject: [Jython-users] Size of File > > > Is there any simple way to find the size of a file in Python. > I get my file > by calling: > > f = open('myfile','r') > > I then want to determine wither the size in bytes, or the > number of lines in > the file. Normally I would use f.length(), but as it is a > pyfile I am a bit > stuck. > > Thanks, > Dylan. > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Mark E. <m.e...@AD...> - 2002-04-04 17:58:23
|
Thanks, Paul. This seems to do the trick quite nicely. In a response to your post Samuele Pedroni wrote: >> To access python module in a directory "Lib" contained in file >> JythonLib.jar used this syntax: >> >> "/path/JythonLib.jar!Lib" >> > >with Jython 2.1 final that becomes simply > >"/path/JythonLib.jar/Lib" I tried this and couldn't import the modules. I do have the latest Jython installed. He is right that it is in the Readme. However, this talks about the sys.path variable, while I added the file to the python.path variable. I don't know if that makes a difference or not. In addition, this appears to be referring to how it is handled from within a script, not from a Java program instantiating an interpreter. Maybe that makes a difference. Until I hear differently, I will continue to use the method you provided. Mark -----Original Message----- From: Paul Giotta Sent: Thursday, April 04, 2002 4:00 AM To: jyt...@li...; m.e...@AD... Subject: Re: [Jython-users] Can we use Jython with just the jython.jar file? Forgive me for not replying to this sooner, but it took while for me to sort through code and actually find the relevant answers. We have dealt with most of common Jython embedding issues, and a few less-common ones. This effort was completed a while ago, so the answers are not fresh in my mind. First, let me say that it is unfortunate that the mailing list archives are not searchable, as this theme keeps popping up from time to time, and most of the answers are already there. But I would have a hard time finding the relevant postings myself :-( You can pack python library modules in a jar file. The most compact deployments that I have seen distribute 2 jar files: jython.jar, plus one containing the libraries. It is conceivable that both of these could be packed into a single jar, but I have not tried it. To access python module in a directory "Lib" contained in file JythonLib.jar used this syntax: "/path/JythonLib.jar!Lib" Here is is code that one of my colleagues used to deduce the location of the libraries in the CLASSPATH. It requires no mods to jython, but may not be 100% reliable: // jar:file:$ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py final URL url = ClassLoader.getSystemResource("Lib/string.py"); // file:$ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py final StringBuffer pythonpath = new StringBuffer(url.getFile()); // $ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py pythonpath.delete(0, 5); // $ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib final int len = pythonpath.length(); pythonpath.delete(len - 10, len); // $ABSOLUTE_PATH_TO_JYTHON_LIB!Lib pythonpath.deleteCharAt(pythonpath.length() - 4); Some other things things that you my find useful is to set the cachedir to some directory that you know you have write access to, and to load a jython registry file and perhaps also include jython properties via system properties. Below, I combined some code snippets that demonstrate these thing. Use it as a guide, I am not sure that I pasted all the pieces together properly: HashMap properties = new HashMap(); properties .put("python.path", "/path/JythonLib.jar!Lib"); properties .put("python.cachedir", "/tmp/my_python_cachedir"); InputStream registryFile = ClassLoader.getSystemResourceAsStream("jython.registry"); // registryPre remains empty Properties registryPre = new Properties(); // values in registryPost override those in registryPre Properties registryPost = new Properties(); // load properties into registryPost from file registryPost.load(registryFile); // System properties override the file values registryPost.putAll(System.getProperties()); // more properties are appended here: registryPost.putAll(properties); PythonInterpreter.initialize(registryPre, registryPost, new String[]{}); Hope this helps, -Paul >I would prefer putting the .py files into a jar file and loading >them from the classpath, but from the discussion so far that may >only be available to me if I modify Jython itself which I am >somewhat reluctant to do due to the maintenance problem associated >with future releases of Jython. Although, it doesn't seem too big >a problem to overcome at present.... > -- Paul Giotta Software Architect Technoparkstrasse 1, CH-8005 Zurich. Email: pau...@So... Home Page WWW: http://www.softwired-inc.com *Next stop UBIQUITY!* Office: +41 1 4452370 | Fax: +41 1 4452372 | Mobile: +41 76 389 1180 *** Go Mobile: Out NOW: iBus//Mobile 2.1 *** ***iBus//MessageServer 4.5 with XA extensions*** _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <Dan...@at...> - 2002-04-04 17:41:15
|
Very good article. Recapitulates many of the points I made in my "Scripting Java" presentation (session 2609) at JavaOne last week. I got a lot of positive feedback from attendees who seemed to 'get it' (i.e., get the message that Java is an interesting way to build components which can best be integrated with Jython. We are starting to capture a considerable amount of mindshare. Regards -- _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Dana Moore - BBN Technologies 703.284.4740 (W) 240.350.4196 (M) dan...@at... _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > I hope that you find this interesting and useful... > > There's a new Jython article on O'Reilly.com at: > > <http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html> > > It's primarily advocacy aimed at Java programmers to encourage them to > use Jython. There will be another one aimed at Python programmers > coming up in about two weeks. There may also be a third article (a case > study of using Jython on a web site) after that. > > Thanks for listening. > > Noel > > ---- > > Noel Rappin > nr...@so... > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------ Get the award winning ISP, AT&T WorldNet Service http://download.att.net/webtag |
From: Noel R. <nr...@so...> - 2002-04-04 17:31:18
|
Finn pointed out that I had neglected to mention in my last email that _Jython Essentials_, by Samuele Pedroni and myself, is actually in bookstores in the US (I know that Amazon is shipping as well, but I don't know about other countries). We hope you like it, and we'd love to year your feedback. Thanks, Noel PS -- the animal is a bank vole, and no, they didn't tell us why. |
From: Mike H. <th...@bi...> - 2002-04-04 16:00:08
|
On Thu, Mar 14, 2002 at 11:51:45AM -0000, Dylan Browne wrote: > Is there any simple way to find the size of a file in Python. I get my file > by calling: > > f = open('myfile','r') > > I then want to determine wither the size in bytes, or the number of lines in > the file. Normally I would use f.length(), but as it is a pyfile I am a bit > stuck. Can you change the order a little bit? This way will work, without loading the file, which is a better if you are worried about size anyway: >>> import os,stat >>> os.stat("file1.xml")[stat.ST_SIZE] 841L C:\stuff\xml>dir file1.xml 03/21/2002 09:56a 841 file1.xml Also, it's good to have a bookmark on the official Python documentation, too: http://www.python.org/doc/current/ -- mikeh |
From: Noel R. <nr...@so...> - 2002-04-04 14:24:36
|
I hope that you find this interesting and useful... There's a new Jython article on O'Reilly.com at: <http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html> It's primarily advocacy aimed at Java programmers to encourage them to use Jython. There will be another one aimed at Python programmers coming up in about two weeks. There may also be a third article (a case study of using Jython on a web site) after that. Thanks for listening. Noel ---- Noel Rappin nr...@so... |
From: <bc...@wo...> - 2002-04-04 13:42:56
|
[Paul Giotta] >... >First, let me say that it is unfortunate that the mailing list archives >are not searchable, ... Recently SF added some new mail archives that are searchable: http://sourceforge.net/mailarchive/forum.php?forum_id=5586 http://sourceforge.net/mailarchive/forum.php?forum_id=5587 regards, finn |
From: Samuele P. <pe...@in...> - 2002-04-04 12:16:02
|
From: Paul Giotta <pau...@so...> > To access python module in a directory "Lib" contained in file > JythonLib.jar used this syntax: > > "/path/JythonLib.jar!Lib" > with Jython 2.1 final that becomes simply "/path/JythonLib.jar/Lib" It is even stated in the README. regards. |
From: Paul G. <pau...@so...> - 2002-04-04 12:00:18
|
Forgive me for not replying to this sooner, but it took while for me to sort through code and actually find the relevant answers. We have dealt with most of common Jython embedding issues, and a few less-common ones. This effort was completed a while ago, so the answers are not fresh in my mind. First, let me say that it is unfortunate that the mailing list archives are not searchable, as this theme keeps popping up from time to time, and most of the answers are already there. But I would have a hard time finding the relevant postings myself :-( You can pack python library modules in a jar file. The most compact deployments that I have seen distribute 2 jar files: jython.jar, plus one containing the libraries. It is conceivable that both of these could be packed into a single jar, but I have not tried it. To access python module in a directory "Lib" contained in file JythonLib.jar used this syntax: "/path/JythonLib.jar!Lib" Here is is code that one of my colleagues used to deduce the location of the libraries in the CLASSPATH. It requires no mods to jython, but may not be 100% reliable: // jar:file:$ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py final URL url = ClassLoader.getSystemResource("Lib/string.py"); // file:$ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py final StringBuffer pythonpath = new StringBuffer(url.getFile()); // $ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib/string.py pythonpath.delete(0, 5); // $ABSOLUTE_PATH_TO_JYTHON_LIB!/Lib final int len = pythonpath.length(); pythonpath.delete(len - 10, len); // $ABSOLUTE_PATH_TO_JYTHON_LIB!Lib pythonpath.deleteCharAt(pythonpath.length() - 4); Some other things things that you my find useful is to set the cachedir to some directory that you know you have write access to, and to load a jython registry file and perhaps also include jython properties via system properties. Below, I combined some code snippets that demonstrate these thing. Use it as a guide, I am not sure that I pasted all the pieces together properly: HashMap properties = new HashMap(); properties .put("python.path", "/path/JythonLib.jar!Lib"); properties .put("python.cachedir", "/tmp/my_python_cachedir"); InputStream registryFile = ClassLoader.getSystemResourceAsStream("jython.registry"); // registryPre remains empty Properties registryPre = new Properties(); // values in registryPost override those in registryPre Properties registryPost = new Properties(); // load properties into registryPost from file registryPost.load(registryFile); // System properties override the file values registryPost.putAll(System.getProperties()); // more properties are appended here: registryPost.putAll(properties); PythonInterpreter.initialize(registryPre, registryPost, new String[]{}); Hope this helps, -Paul >I would prefer putting the .py files into a jar file and loading >them from the classpath, but from the discussion so far that may >only be available to me if I modify Jython itself which I am >somewhat reluctant to do due to the maintenance problem associated >with future releases of Jython. Although, it doesn't seem too big >a problem to overcome at present.... > -- Paul Giotta Software Architect Technoparkstrasse 1, CH-8005 Zurich. Email: pau...@So... Home Page WWW: http://www.softwired-inc.com *Next stop UBIQUITY!* Office: +41 1 4452370 | Fax: +41 1 4452372 | Mobile: +41 76 389 1180 *** Go Mobile: Out NOW: iBus//Mobile 2.1 *** ***iBus//MessageServer 4.5 with XA extensions*** |