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: <bc...@wo...> - 2001-03-29 18:03:39
|
[Kent Johnson] >I am trying to rebuild jython 2.1a1 on a Mac (Java 1.1.8) > >I have these errors: > >--- _sre.java:20: Package org.python.modules.sre not found in import. > >This package is missing from the distribution. I copied from a recent snapshot. Thanks. The sre subdir will be included in the next release. >--- MD5Object.java:35: class org.python.modules.md5 is defined in >md.java. Because it is used outside of its source file, it should be >defined in a file called "md5.java". > >This is a warning, I ignore it. > > >--- PyServlet.java:81: Method setProperty(java.lang.String, >java.lang.String) not found in class java.util.Properties. > >java.util.Properties.setProperty() is not in java 1.1, please use >put() instead! Fixed in the next release. Thanks for reporting this. regards, finn |
From: D-Man <ds...@ri...> - 2001-03-29 15:14:14
|
On Thu, Mar 29, 2001 at 11:49:26AM +0100, Ype Kingma wrote: | | It seems that this is an ambiguity in the language definition. | The syntax of assert (see previous post) does not allow '(' | and ')' and it does not state that the comma introduces a tuple, | but in the last paragraph of 5.2.3 (see your URL above) it states | that a comma introduces a tuple. Yes, the documentation is a bit sparse and seemingly conflicting in this aspect. | I think I won't use the parenthesized form, it might break in the | future. It might, though that could be fixed with a not too complicated sed script. It may also be a fix in the documentation instead if it is decided that a 2-tuple is a better way of describing the usage of teh statement. -D |
From: D-Man <ds...@ri...> - 2001-03-29 15:10:41
|
----- Forwarded message from Ype Kingma <yk...@xs...> ----- From: Ype Kingma <yk...@xs...> Date: Thu, 29 Mar 2001 12:05:43 +0100 To: D-Man <ds...@ri...> -D, The following could also apply: http://www.python.org/doc/2.0/ref/exprlists.html It seems that the language implementers have been a bit lazy by implementing assert and raise with an expression list instead of the the more restricted forms from the language definition. Again: could you post your evt. (combined) reply to jython-users? Thanks in advance, Ype ----- End forwarded message ----- |
From: D-Man <ds...@ri...> - 2001-03-29 15:10:28
|
----- Forwarded message from Ype Kingma <yk...@xs...> ----- From: Ype Kingma <yk...@xs...> Date: Thu, 29 Mar 2001 11:49:26 +0100 To: D-Man <ds...@ri...> -D, >On Wed, Mar 28, 2001 at 10:19:50PM +0100, Ype Kingma wrote: >| -D, >| >| >On Wed, Mar 28, 2001 at 09:21:19PM +0100, Ype Kingma wrote: >| >| >| >| "Robert W. Bill" wrote: >| >| > >| >| > assert(test(stringtest, S[1])), "String test failed" >| >| > >| >| >| >| Also the assert code is a bit strange: >| >| 'assert' is a keyword, not a function. >| >| Leaving out one pair of brackets gives: >| > >| >Robert has already mentioned that his post was hasty and had several >| >errors in it. The posted line is harder to read due to the lack of >| >whitespace between 'assert' and '('. Anyways, just FYI, assert can >| >| Sorry for that, I assumed the whole history was there... > >No problem. > >| >take a 2-tuple as its only "argument" >| > >| >assert ( 0 , "Hello World" ) >| > >| >is equivalent to >| > >| >assert 0 , "Hello World" >| > >| >It is quite useful when the expression, or more often, the string is >| >too long. By using parens to create a tuple the \ prior to the >| >newline is not necessary. >| >| Useful indeed. I rechecked the (python) docs on the assert statement, but >| the tuple argument isn't mentioned there. Is there documentation >| for it somewhere? > >I don't know. I have noticed that several keywords that take 2 >"arguments" (like 'raise' for example) can take a 2-tuple instead. I >tried it with assert and it worked. > >Now that I think about it, I think it is actually caused by the >lexer/parser that expressions of the form > ><foo> , <bar> > >are tuples, and also > >( <foo> , <bar> ) > >is the same tuple. > > >I just took a look at > >http://www.python.org/doc/current/ref/parenthesized.html > >and the last paragraph seems most relevant. I guess assert and raise >take a 2-tuple which can optionally have parenthesis or not. I use >the parens when I want to break it over multiple lines without using >\, but I put a space so it doesn't look like a function call. > >-D It seems that this is an ambiguity in the language definition. The syntax of assert (see previous post) does not allow '(' and ')' and it does not state that the comma introduces a tuple, but in the last paragraph of 5.2.3 (see your URL above) it states that a comma introduces a tuple. I think I won't use the parenthesized form, it might break in the future. Could you post your evt. reply to jython-users? Thanks in advance, Ype ----- End forwarded message ----- |
From: D-Man <ds...@ri...> - 2001-03-29 15:09:45
|
Ype and I discussed the syntax of assert (and raise) a bit off the list. I am now forwarding the discussion to the list (as requested) in case anyone else is interested. ----- Forwarded message from D-Man <ds...@ri...> ----- From: D-Man <ds...@ri...> Date: Wed, 28 Mar 2001 16:22:53 -0500 To: Ype Kingma <yk...@xs...> User-Agent: Mutt/1.2.5i On Wed, Mar 28, 2001 at 10:19:50PM +0100, Ype Kingma wrote: | -D, | | >On Wed, Mar 28, 2001 at 09:21:19PM +0100, Ype Kingma wrote: | >| | >| "Robert W. Bill" wrote: | >| > | >| > assert(test(stringtest, S[1])), "String test failed" | >| > | >| | >| Also the assert code is a bit strange: | >| 'assert' is a keyword, not a function. | >| Leaving out one pair of brackets gives: | > | >Robert has already mentioned that his post was hasty and had several | >errors in it. The posted line is harder to read due to the lack of | >whitespace between 'assert' and '('. Anyways, just FYI, assert can | | Sorry for that, I assumed the whole history was there... No problem. | >take a 2-tuple as its only "argument" | > | >assert ( 0 , "Hello World" ) | > | >is equivalent to | > | >assert 0 , "Hello World" | > | >It is quite useful when the expression, or more often, the string is | >too long. By using parens to create a tuple the \ prior to the | >newline is not necessary. | | Useful indeed. I rechecked the (python) docs on the assert statement, but | the tuple argument isn't mentioned there. Is there documentation | for it somewhere? I don't know. I have noticed that several keywords that take 2 "arguments" (like 'raise' for example) can take a 2-tuple instead. I tried it with assert and it worked. Now that I think about it, I think it is actually caused by the lexer/parser that expressions of the form <foo> , <bar> are tuples, and also ( <foo> , <bar> ) is the same tuple. I just took a look at http://www.python.org/doc/current/ref/parenthesized.html and the last paragraph seems most relevant. I guess assert and raise take a 2-tuple which can optionally have parenthesis or not. I use the parens when I want to break it over multiple lines without using \, but I put a space so it doesn't look like a function call. -D ----- End forwarded message ----- |
From: Kent J. <kjo...@tr...> - 2001-03-29 14:42:30
|
I am trying out PyServlet using Jetty 2, a web server that implements the 2.1 servlet spec, and I have a little problem. The value of request.getServletPath() is different in 2.1 and 2.2 in a way that breaks PyServlet. Under 2.1, when the servlet is matched by an extension match, getServletPath() returns null. Under 2.2, it returns the entire path through the matched extension. The Servlet 2.1 spec says, public String getServletPath(); [snip] If the servlet was invoked by some other mechanism than by a path match (such as an extension match), then this method returns null. whereas the 2.2 spec has the example Servlet Mapping Pattern: *.jsp Servlet: JSPServlet /catalog/help/feedback.jsp ContextPath: /catalog ServletPath: /help/feedback.jsp PathInfo: null To make PyServlet work with Jetty I changed line 108 to read spath = ((HttpServletRequest) req).getServletPath() + ((HttpServletRequest) req).getPathInfo(); i think this will work under both 2.1 and 2.2, though I have not tested it with 2.2. Thanks! PyServlet is cool! Kent |
From: Robert W. B. <rb...@di...> - 2001-03-29 01:22:42
|
Hi Chris, On Wed, 28 Mar 2001, Chris Meyers wrote: > Is there an easy (or not so easy) way to run a system command in jython? yes, Runtime. > tried to run os.system(xpdf foo.pdf) and I get this: > > AttributeError: class 'org.python.modules.os' has no attribute 'system' There is no os.system in Jython. Brian Z recently posted the Runtime info/examples that will help. Found at: http://www.geocrawler.com/lists/3/SourceForge/7017/75/5376252/ - and - http://www.geocrawler.com/lists/3/SourceForge/7017/75/5376101/ I haven't really looked at this, but if you really wanted os.system, it could start with something as simple as patch below considering how os.system doesn't return data. <warning- untested, just for example> --- /usr/src/CVS/jython/Lib/javaos.py Wed Jan 31 04:38:36 2001 +++ javaos.py Mon Mar 19 18:00:37 2001 @@ -1,5 +1,6 @@ import java from java.io import File +from java.lang import Runtime import javapath path = javapath @@ -51,6 +52,10 @@ if not File(path).delete(): raise OSError(0, "couldn't delete directory", path) +def system(cmd): + if not Runtime.getRuntime().exec(cmd): + raise OSError(0, "couldn't run command: %s" % cmd) + unlink = remove def stat(path): @@ -62,5 +67,5 @@ # is zero sized or does not exist. if size == 0 and not f.exists(): raise OSError(0, 'No such file or directory', path) - mtime = f.lastModified() / 1000.0 + mtime = f.lastModified() return (0, 0, 0, 0, 0, 0, size, mtime, mtime, 0) |
From: Chris M. <ch...@hd...> - 2001-03-29 00:26:38
|
Is there an easy (or not so easy) way to run a system command in jython? I tried to run os.system(xpdf foo.pdf) and I get this: AttributeError: class 'org.python.modules.os' has no attribute 'system' Thanks, Chris |
From: Kent J. <kjo...@tr...> - 2001-03-28 22:34:14
|
I am trying to rebuild jython 2.1a1 on a Mac (Java 1.1.8) I have these errors: --- _sre.java:20: Package org.python.modules.sre not found in import. This package is missing from the distribution. I copied from a recent snapshot. --- MD5Object.java:35: class org.python.modules.md5 is defined in md.java. Because it is used outside of its source file, it should be defined in a file called "md5.java". This is a warning, I ignore it. --- PyServlet.java:81: Method setProperty(java.lang.String, java.lang.String) not found in class java.util.Properties. java.util.Properties.setProperty() is not in java 1.1, please use put() instead! Thanks, Kent Johnson Transparent Language, Inc. kjo...@tr... http://www.transparent.com |
From: D-Man <ds...@ri...> - 2001-03-28 19:41:56
|
On Wed, Mar 28, 2001 at 09:21:19PM +0100, Ype Kingma wrote: | | "Robert W. Bill" wrote: | > | > assert(test(stringtest, S[1])), "String test failed" | > | | Also the assert code is a bit strange: | 'assert' is a keyword, not a function. | Leaving out one pair of brackets gives: Robert has already mentioned that his post was hasty and had several errors in it. The posted line is harder to read due to the lack of whitespace between 'assert' and '('. Anyways, just FYI, assert can take a 2-tuple as its only "argument" assert ( 0 , "Hello World" ) is equivalent to assert 0 , "Hello World" It is quite useful when the expression, or more often, the string is too long. By using parens to create a tuple the \ prior to the newline is not necessary. -D |
From: Brian Z. <bri...@ya...> - 2001-03-28 19:22:03
|
Here's some info on how to setup and use jython servlet: http://jywiki.sourceforge.net/index.php?JythonServlet and http://jywiki.sourceforge.net/index.php?JythonServletImaging for another example. Notice it's a wiki [http://jywiki.sourceforge.net/index.php?WikiWikiWeb], so you're encouraged to add stuff to the site. So far, I really enjoy writing jython servlet. Excellent work from the jython-developers. Combined with XMLC from http://xmlc.enhydra.org it feels even cleaner than JSP. Let's share and promote the use of Jython Servlet! /bzhou |
From: Ype K. <yk...@xs...> - 2001-03-28 19:09:49
|
Jim, Robert, >On Tue, 27 Mar 2001, Jim Adrig wrote: >> "Robert W. Bill" wrote: >> > >> > Hi all, >> > >> > I've ran into a bit of confusion with the id() of characters in >> > Jython compared with Python. Here's something similar to the code >> > that started the confusion: >> > >> > ---------------------------------------------------------- >> > S = "abc" >> > L = ["a", "b", "c"] >> > LoL = [L, L, L] >> > stringtest = S[1] >> > listtest = L[1] >> > loltest = LoL[1] >> > >> > def test(obj1, obj2): >> > if ( id(obj1) != id(obj2) ): >> > return 0 >> > > > > assert(test(loltest, LoL[1])), "List-of-lists test failed" >> > assert(test(listtest, L[1])), "List test failed" >> > assert(test(stringtest, S[1])), "String test failed" >> > ---------------------------------------------------------- >> > >> > In CPython, all passes, but in Jython, there's always an AE: >> > String test failed. Is this expected? unavoidable? >> Even in CPython the test function should always return a value that evaluates to false. The "test" function returns None in case it does not return 0. Both None and 0 evaluate to boolean false when used after if. You might try this instead: def test(obj1, obj2): return id(obj1) == id(obj2) Also the assert code is a bit strange: 'assert' is a keyword, not a function. Leaving out one pair of brackets gives: assert test(loltest, LoL[1]), "List-of-lists test failed" I don't know what should happen when it is written as above. It might give the standard behaviour, but this seems to be something for advanced language lawyers. To me it looks like a function call followed by a comma and a string. As such you should get a syntax error. However, it is probably parsed as: assert_statement: "assert" expression ["," expression] with (test(loltest, LoL[1])) as the first expression because you saw the "String test failed" error. And then the fun with the string object id's hasn't even started... Regards, Ype |
From: L. H. <hu...@ha...> - 2001-03-28 16:41:04
|
Hi, asked if there is any software in Python to do genetic programming ... I wrote (at 10. March 2001): lh> There are someone working on genetic programming in Python, lh> but I don't know, who. Looking for some other file I found it again and want you to know it. from the __init__.py of Gatspy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $Id$ # # Dean Hall # Dea...@co... # # The Genetic Algorithm Training System in Python # # http://sourceforge.net/projects/gatspy/ # # __init__.py - Gatspy - Initialize the Gatspy module # ################################################################ # # The Gatspy module, including all source files, # is Copyright 2000 Dean Hall. All rights reserved in # accordance with the Artistic License: # http://www.opensource.org/licenses/artistic-license.html # ################################################################ # # A simple and flexible genetic algorithm system for Python. # Gatspy evolves a population of potential numerical solutions # to a problem. Members evolve (hopefully) toward a "good" solution. # # The problem to be solved is determined by the user (you!). # A genetic algorithm requires a fitness evaluation function to # determine the relative fitness of one member over another. # A lower fitness value is better (reducing the error), # so work your math to produce fitness values appropriately. # ################################################################ # # $Log$ # # 2000/11/17 v.1.0 # Complete software overhaul. Created Gatspy # module and Member and Population classes. # More classes to come as features increase. .... Ludger Humbert |
From: D-Man <ds...@ri...> - 2001-03-28 15:57:03
|
In Java everything is coded as part of a class. As an example class take this : public class Foo { public void func1( ) { System.out.println( "Hello from func1" ) ; } static public void func2( ) { System.out.println( "Hello from func1" ) ; } } This class contains 2 methods, func1 and func2. func2 is declared as static. That means that the following (Java) code is legal : Foo.func2() ; Foo f = new Foo() ; f.func2() f.func1() while the following is illegal : Foo.func1() ; The reason is that only "static" members belong to the _class_, all others belong to _instances_ of the class. In order to call the method you must first have an instance of java.awt.Component and call it on the instance. Note also that it will only affect the instance you call it on, not all instances of the class. Python's classes don't have any "static" members because Python doesn't force you to write everything inside of a class construct. Instead put "static" functions in the module. (If you are trying to use a mix of Java and Python then the java code is unable to access module level stuff unless it goes through the interpreter directly) -D On Wed, Mar 28, 2001 at 06:37:53PM -0500, cindy wrote: | Thanks for your reply, I also made it a bookmark. | I went to the site and track down enableEvents() and | found that it was a method of Component. So I imported | java.awt.Component and then qualified enableEvents with | java.awt.Component. I get an error tell me that enableEvents() | is not an attribute of Component. So I checked my spelling | ant thing look ok. Can someone tell me what I doing wrong? | Thanks. | Wayne |
From: Robert W. B. <rb...@di...> - 2001-03-28 15:06:00
|
On Tue, 27 Mar 2001, Jim Adrig wrote: > "Robert W. Bill" wrote: > > > > Hi all, > > > > I've ran into a bit of confusion with the id() of characters in > > Jython compared with Python. Here's something similar to the code > > that started the confusion: > > > > ---------------------------------------------------------- > > S = "abc" > > L = ["a", "b", "c"] > > LoL = [L, L, L] > > stringtest = S[1] > > listtest = L[1] > > loltest = LoL[1] > > > > def test(obj1, obj2): > > if ( id(obj1) != id(obj2) ): > > return 0 > > > > assert(test(loltest, LoL[1])), "List-of-lists test failed" > > assert(test(listtest, L[1])), "List test failed" > > assert(test(stringtest, S[1])), "String test failed" > > ---------------------------------------------------------- > > > > In CPython, all passes, but in Jython, there's always an AE: > > String test failed. Is this expected? unavoidable? > > When I cut/paste this code directly into a file and run it, it fails on > the first line. Doesn't the 'test' need a 'else' part? I'm new to Python > but using Jython in a new project so correct me if I'm wrong... Yes, it does require else. No, you're definately not wrong. Sorry for the sloppiness in my post. > I used this instead: > > def test(obj1, obj2): > if ( id(obj1) != id(obj2) ): > return 0 > else: > return 1 > > And my version (2.1a1) passes ALL the tests. > > Am I missing something? No, you are not missing anything. All tests pass in 2.1a1. I had only tested 2.0. After looking further (guided by other's comments), I'm unsure if this id is supposed to be guaranteed in this situation anyway. tnx for the reply. Regards, Robert |
From: Thomas B. B. <tb...@sy...> - 2001-03-28 13:41:38
|
Hi. Thanks for a quick response. I was asked for a complete stack trace for the "access denied" exception, which is here: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java :272) at java.security.AccessController.checkPermission(AccessController.java:399) at java.lang.SecurityManager.checkPermission(SecurityManager.java:545) at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1246) at java.lang.System.getProperties(System.java:488) at org.python.core.PySystemState.initialize(PySystemState.java:287) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:61) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:45) at jythonejb.JythonScriptBean.run(JythonScriptBean.java:25) at jythonejb.JythonScriptBean_EJBObjectImpl.run(JythonScriptBean_EJBObjectImpl. java:18) at jythonejb._JythonScriptBean_EJBObjectImpl_Tie._invoke(Unknown Source) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPO AServerSC.java:423) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOA ServerSC.java:137) at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC .java:98) at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:227) at com.sun.corba.ee.internal.iiop.CachedWorkerThread.doWork(IIOPConnection.java :262) at com.sun.corba.ee.internal.iiop.CachedWorkerThread.run(IIOPConnection.java:23 0) I've tried to run the J2EE application server without a security policy (tried to remove the "-Djava.security.policy==%J2EE_HOME%\lib\security\server.policy" from the J2EE app.serv. startup), but with no luck so far. I've also tried to grant (all) permissions to the (server) directory holding the jython.jar (2.0) file. Best regards, Thomas >Hi jython-users. > >I'm trying to implement a jython-based scripting service in the middle tier >of a J2EE application. I have a basic "test" setup consisting of: > >1) A stateful EJB session bean deployed in the "standard" J2EE application >server, >2) A test client J2EE application, accessing that session bean, calling for >a simple script execution. > >Setup 1) includes the jython.jar file, so the server should have access to >the jython class files. Also, my small test client app get as far as >obtaining the EJB object reference, but when it attempts to instantiate a >new jython interpreter, like this: > > JythonInterpreter interp = new JythonInterpreter(); > >it catches the following exception: > >java.rmi.ServerException: RemoteException occurred in server thread; nested >exception is: > java.rmi.RemoteException: Unknown Exception/Error thrown by EJB >method.; nested exception is: > java.security.AccessControlException: access denied >(java.util.PropertyPermission * read,write) Try catching the exception and printing the stacktrace to stdout or to a file. PythonInterpreter interp = null; try { interp = new PythonInterpreter(); } catch (Exception exc) { exc.printStackTrace(); throw exc; } That may supply us with more information about the actual access problem. >--- I.e. I'm not even getting to execute an actual script. > >Clearly, with a jython scripting engine server-side one could imagine all >kinds of not-so-funny things possible (which is why - I guess - I get the >security exception), but in my case all I really need to do have is >read-only access to the EJB's comprising my application (for validation >purposes). > >Now, I have two questions: > >- What is it more specifically that makes an instantiation of a new jython >interpreter cause a security exception? The stacktrace will tell us, but the jython runtime does access several system properties, read files and directories along the classpath and attempt to load unsigned bytecode. All this and more require specific access grants when running under a security manager. The security manager is typically controlled by a file called something with "policy". For instance in the jBoss EJB server it is called conf\server.policy. >- Is it at all reasonable (possible) to build a jython scripting service in >the middle-tier, as sketched above? Yes. regards, finn |
From: <bc...@wo...> - 2001-03-28 12:48:31
|
[Thomas Bang Biilmann] >Hi jython-users. > >I'm trying to implement a jython-based scripting service in the middle tier >of a J2EE application. I have a basic "test" setup consisting of: > >1) A stateful EJB session bean deployed in the "standard" J2EE application >server, >2) A test client J2EE application, accessing that session bean, calling for >a simple script execution. > >Setup 1) includes the jython.jar file, so the server should have access to >the jython class files. Also, my small test client app get as far as >obtaining the EJB object reference, but when it attempts to instantiate a >new jython interpreter, like this: > > JythonInterpreter interp = new JythonInterpreter(); > >it catches the following exception: > >java.rmi.ServerException: RemoteException occurred in server thread; nested >exception is: > java.rmi.RemoteException: Unknown Exception/Error thrown by EJB >method.; nested exception is: > java.security.AccessControlException: access denied >(java.util.PropertyPermission * read,write) Try catching the exception and printing the stacktrace to stdout or to a file. PythonInterpreter interp = null; try { interp = new PythonInterpreter(); } catch (Exception exc) { exc.printStackTrace(); throw exc; } That may supply us with more information about the actual access problem. >--- I.e. I'm not even getting to execute an actual script. > >Clearly, with a jython scripting engine server-side one could imagine all >kinds of not-so-funny things possible (which is why - I guess - I get the >security exception), but in my case all I really need to do have is >read-only access to the EJB's comprising my application (for validation >purposes). > >Now, I have two questions: > >- What is it more specifically that makes an instantiation of a new jython >interpreter cause a security exception? The stacktrace will tell us, but the jython runtime does access several system properties, read files and directories along the classpath and attempt to load unsigned bytecode. All this and more require specific access grants when running under a security manager. The security manager is typically controlled by a file called something with "policy". For instance in the jBoss EJB server it is called conf\server.policy. >- Is it at all reasonable (possible) to build a jython scripting service in >the middle-tier, as sketched above? Yes. regards, finn |
From: Thomas B. B. <tb...@sy...> - 2001-03-28 10:45:25
|
Correction: The instantiation below should read "PythonInterpreter" rather than "JythonInterpreter" (no such thing...) /Thomas > -----Original Message----- > From: Thomas Bang Biilmann > Sent: 28. marts 2001 10:33 > To: 'jyt...@li...' > Subject: Jython interpreter access from EJB (access denied) > > Hi jython-users. > > I'm trying to implement a jython-based scripting service in the middle > tier of a J2EE application. I have a basic "test" setup consisting of: > > 1) A stateful EJB session bean deployed in the "standard" J2EE application > server, > 2) A test client J2EE application, accessing that session bean, calling > for a simple script execution. > > Setup 1) includes the jython.jar file, so the server should have access to > the jython class files. Also, my small test client app get as far as > obtaining the EJB object reference, but when it attempts to instantiate a > new jython interpreter, like this: > > JythonInterpreter interp = new JythonInterpreter(); > > it catches the following exception: > > java.rmi.ServerException: RemoteException occurred in server thread; > nested exception is: > java.rmi.RemoteException: Unknown Exception/Error thrown by EJB > method.; nested exception is: > java.security.AccessControlException: access denied > (java.util.PropertyPermission * read,write) > > --- I.e. I'm not even getting to execute an actual script. > > Clearly, with a jython scripting engine server-side one could imagine all > kinds of not-so-funny things possible (which is why - I guess - I get the > security exception), but in my case all I really need to do have is > read-only access to the EJB's comprising my application (for validation > purposes). > > Now, I have two questions: > > - What is it more specifically that makes an instantiation of a new jython > interpreter cause a security exception? > - Is it at all reasonable (possible) to build a jython scripting service > in the middle-tier, as sketched above? > > Thanks in advance!!! > > Thomas |
From: cindy <inf...@pi...> - 2001-03-28 10:36:54
|
Thanks for your reply, I also made it a bookmark. I went to the site and track down enableEvents() and found that it was a method of Component. So I imported java.awt.Component and then qualified enableEvents with java.awt.Component. I get an error tell me that enableEvents() is not an attribute of Component. So I checked my spelling ant thing look ok. Can someone tell me what I doing wrong? Thanks. Wayne "O'Brien-Strain, Eamonn" wrote: > Personally I keep a bookmark on my desktop to the Java API reference at ... > > http://java.sun.com/j2se/1.3/docs/api/overview-summary.html > > ... to which I frequently go to answer questions like this. > > In this case if you go to that page, click on "Index" at the top, click on > "E", and scroll down -- you will see that there are "enableEvents" methods > in two different classes. Following the links to those two methods should > help you figure out which one to use and what to pass as its arguments. > > __ > Eamonn > > -----Original Message----- > From: cindy [mailto:inf...@pi...] > [...]For instance, > one of the statements in an example reads like this, > "enableEvents(AWTEvent.WINDOW_EVENT_MASK)". > How would I go about determining which class/package to > import and how would I know what qualifiers to us for > "enableEvents"? > [...] > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users |
From: <bc...@wo...> - 2001-03-28 08:59:45
|
On Wed, 28 Mar 2001 17:01:00 +1000, you wrote: >Hi guys! I am trying to embed Jython in a large multi-tier Java app. I am >trying to figure out what I have to do to get it to pick up the python.path >setting from the registry. What I have done so far is: > > * change the registry to say: >python.path = f:\\jython-2.1a1\\lib > * the registry is f:\jython-2.1a1\registry > * pass -Dpython.home=f:\jython-2.1a1 as a command line arg to the app > * instantiate a PythonInterpreter > * put my library, "minestar_admin.py" into f:\jython-2.1a1\lib. > >Now, my theory on how it should work is that when I instantiate >PythonInterpreter it looks in the system properties for the python.home >setting. Then it looks in that directory for the file 'registry'. Then it >loads that file, giving it a value for python.path. Then it looks along >that path to resolve things. Yep, that should work. >However, when I exec the line > >import minestar_admin > >I get: > >Traceback (innermost last): > File "<string>", line 1, in ? >NameError: minestar_admin > >.. > >which suggests to me that PythonInterpreter can't find the file. Failing to find the .py file should result in an ImportError: no module named... I think the NameError is a different problem, but you can check your actual python.path by inserting interp.exec("import sys; print sys.prefix, sys.path"); If you still can get a handle on the problem, try to make a small standalone example that show the bug and post it here. This worked for me: ----------- i:\\temp\\ss9\\registry ----------- python.path=i:\\temp\\ss9\\subdir ----------- i:\\temp\\ss9\\subdir\\minestar_admin.py ----------- print "hello" ----------- si7.java ----------- import org.python.core.*; import org.python.util.*; public class si7 { public static void main(String[] args) { PythonInterpreter interp = new PythonInterpreter(); interp.exec("import sys; print sys.prefix, sys.path"); interp.exec("import minestar_admin"); } } ----------- command line ----------- java -Dpython.home=i:\temp\ss9 si7 >Could >someone please tell me what is wrong with my hypothesis above? Just for your info, you can also set the python.path property this way: http://jython.sourceforge.net/cgi-bin/faqw.py?req=show&file=faq06.002.htp regards, finn |
From: Thomas B. B. <tb...@sy...> - 2001-03-28 08:33:22
|
Hi jython-users. I'm trying to implement a jython-based scripting service in the middle tier of a J2EE application. I have a basic "test" setup consisting of: 1) A stateful EJB session bean deployed in the "standard" J2EE application server, 2) A test client J2EE application, accessing that session bean, calling for a simple script execution. Setup 1) includes the jython.jar file, so the server should have access to the jython class files. Also, my small test client app get as far as obtaining the EJB object reference, but when it attempts to instantiate a new jython interpreter, like this: JythonInterpreter interp = new JythonInterpreter(); it catches the following exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: Unknown Exception/Error thrown by EJB method.; nested exception is: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write) --- I.e. I'm not even getting to execute an actual script. Clearly, with a jython scripting engine server-side one could imagine all kinds of not-so-funny things possible (which is why - I guess - I get the security exception), but in my case all I really need to do have is read-only access to the EJB's comprising my application (for validation purposes). Now, I have two questions: - What is it more specifically that makes an instantiation of a new jython interpreter cause a security exception? - Is it at all reasonable (possible) to build a jython scripting service in the middle-tier, as sketched above? Thanks in advance!!! Thomas |
From: John F. <jfa...@mi...> - 2001-03-28 07:01:51
|
Hi guys! I am trying to embed Jython in a large multi-tier Java app. I am trying to figure out what I have to do to get it to pick up the python.path setting from the registry. What I have done so far is: * change the registry to say: python.path = f:\\jython-2.1a1\\lib * the registry is f:\jython-2.1a1\registry * pass -Dpython.home=f:\jython-2.1a1 as a command line arg to the app * instantiate a PythonInterpreter * put my library, "minestar_admin.py" into f:\jython-2.1a1\lib. Now, my theory on how it should work is that when I instantiate PythonInterpreter it looks in the system properties for the python.home setting. Then it looks in that directory for the file 'registry'. Then it loads that file, giving it a value for python.path. Then it looks along that path to resolve things. However, when I exec the line import minestar_admin I get: Traceback (innermost last): File "<string>", line 1, in ? NameError: minestar_admin at org.python.core.Py.NameError(Py.java:134) at org.python.core.PyFrame.getglobal(PyFrame.java:166) at org.python.core.PyFrame.getname(PyFrame.java:146) at org.python.pycode._pyx0.f$0(<string>) at org.python.pycode._pyx0.call_function(<string>) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.Py.runCode(Py.java:965) at org.python.core.__builtin__.eval(__builtin__.java:241) at org.python.core.__builtin__.eval(__builtin__.java:245) at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:102) which suggests to me that PythonInterpreter can't find the file. Could someone please tell me what is wrong with my hypothesis above? I read the Javadoc for PythonInterpreter, and it said: >public class PythonInterpreter extends java.lang.Object > >The PythonInterpreter class is a standard wrapper for a JPython interpreter for use embedding in a Java >application. > >Version: 1.0, 02/23/97 <---------------------- I think there is a problem. >Author: Jim Hugunin Thanks for any help. John -- Dr John Farrell - Research Architect - Mincom Limited I don't suffer from stress, I suffer from idiots. ----------------------------- Mincom wants no credit for anything I say: This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this E-mail are the opinion of the writer only and are not endorsed by Mincom Limited unless expressly stated otherwise. |
From: Jim A. <ji...@tr...> - 2001-03-28 04:20:47
|
"Robert W. Bill" wrote: > > Hi all, > > I've ran into a bit of confusion with the id() of characters in > Jython compared with Python. Here's something similar to the code > that started the confusion: > > ---------------------------------------------------------- > S = "abc" > L = ["a", "b", "c"] > LoL = [L, L, L] > stringtest = S[1] > listtest = L[1] > loltest = LoL[1] > > def test(obj1, obj2): > if ( id(obj1) != id(obj2) ): > return 0 > > assert(test(loltest, LoL[1])), "List-of-lists test failed" > assert(test(listtest, L[1])), "List test failed" > assert(test(stringtest, S[1])), "String test failed" > ---------------------------------------------------------- > > In CPython, all passes, but in Jython, there's always an AE: > String test failed. Is this expected? unavoidable? When I cut/paste this code directly into a file and run it, it fails on the first line. Doesn't the 'test' need a 'else' part? I'm new to Python but using Jython in a new project so correct me if I'm wrong... I used this instead: def test(obj1, obj2): if ( id(obj1) != id(obj2) ): return 0 else: return 1 And my version (2.1a1) passes ALL the tests. Am I missing something? -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' |
From: Brian Z. <bz...@ig...> - 2001-03-27 21:04:55
|
Robert, Check out this bug, it might offer a useful description: http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D222789&group= _id =3D12867&atid=3D112867 brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Robert W. Bill Sent: Tuesday, March 27, 2001 2:37 PM To: jyt...@li... Subject: [Jython-users] String Object id question Hi all, I've ran into a bit of confusion with the id() of characters in Jython compared with Python. Here's something similar to the code that started the confusion: ---------------------------------------------------------- S =3D "abc" L =3D ["a", "b", "c"] LoL =3D [L, L, L] stringtest =3D S[1] listtest =3D L[1] loltest =3D LoL[1] def test(obj1, obj2): if ( id(obj1) !=3D id(obj2) ): return 0 assert(test(loltest, LoL[1])), "List-of-lists test failed" assert(test(listtest, L[1])), "List test failed" assert(test(stringtest, S[1])), "String test failed" ---------------------------------------------------------- In CPython, all passes, but in Jython, there's always an AE: String test failed. Is this expected? unavoidable? Tnx -Robert _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |
From: D-Man <ds...@ri...> - 2001-03-27 20:53:07
|
On Tue, Mar 27, 2001 at 02:37:15PM -0600, Robert W. Bill wrote: | | I've ran into a bit of confusion with the id() of characters in strings, not characters. In (CP|J)ython a character is simply a string with a length of 1. In, say, C | C++ | Java a char is different than a char* , g_string (glib) | char* , std::string (STL) | java.lang.String | Jython compared with Python. Here's something similar to the code | that started the confusion: | | ---------------------------------------------------------- | S = "abc" | stringtest = S[1] | | def test(obj1, obj2): | if ( id(obj1) != id(obj2) ): | return 0 | | assert(test(stringtest, S[1])), "String test failed" | ---------------------------------------------------------- | | In CPython, all passes, but in Jython, there's always an AE: | String test failed. Is this expected? unavoidable? I recall hearing that CPython "interns" short strings. From my understanding, this basically means that it caches the string object and uses it for every time that string is used. There is no guarantee that any particular string will be interned, it could be an entirely new object. It seems that Jython doesn't intern the strings, so they are new objects. They should compare as being equal, even though they are different objects. This is just an implementation detail, and CPython optimizes it more than Jython. -D |