You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(38) |
Nov
(98) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(114) |
Feb
(123) |
Mar
(96) |
Apr
(66) |
May
(84) |
Jun
(72) |
Jul
(128) |
Aug
(126) |
Sep
(82) |
Oct
(80) |
Nov
(148) |
Dec
(55) |
| 2002 |
Jan
(137) |
Feb
(85) |
Mar
(118) |
Apr
(67) |
May
(71) |
Jun
(28) |
Jul
(69) |
Aug
(48) |
Sep
(83) |
Oct
(79) |
Nov
(54) |
Dec
(32) |
| 2003 |
Jan
(44) |
Feb
(47) |
Mar
(59) |
Apr
(57) |
May
(43) |
Jun
(45) |
Jul
(44) |
Aug
(39) |
Sep
(27) |
Oct
(62) |
Nov
(17) |
Dec
(23) |
| 2004 |
Jan
(41) |
Feb
(51) |
Mar
(38) |
Apr
(30) |
May
(25) |
Jun
(12) |
Jul
(11) |
Aug
(27) |
Sep
(16) |
Oct
(56) |
Nov
(23) |
Dec
(29) |
| 2005 |
Jan
(75) |
Feb
(82) |
Mar
(50) |
Apr
(77) |
May
(19) |
Jun
(104) |
Jul
(47) |
Aug
(42) |
Sep
(28) |
Oct
(143) |
Nov
(62) |
Dec
(13) |
| 2006 |
Jan
(20) |
Feb
(10) |
Mar
(59) |
Apr
(45) |
May
(25) |
Jun
(129) |
Jul
(162) |
Aug
(91) |
Sep
(15) |
Oct
(39) |
Nov
(186) |
Dec
(191) |
| 2007 |
Jan
(134) |
Feb
(140) |
Mar
(106) |
Apr
(77) |
May
(92) |
Jun
(63) |
Jul
(233) |
Aug
(102) |
Sep
(119) |
Oct
(63) |
Nov
(68) |
Dec
(32) |
| 2008 |
Jan
(69) |
Feb
(91) |
Mar
(129) |
Apr
(44) |
May
(18) |
Jun
(53) |
Jul
(50) |
Aug
(25) |
Sep
(11) |
Oct
(28) |
Nov
(67) |
Dec
(36) |
| 2009 |
Jan
(20) |
Feb
(24) |
Mar
(66) |
Apr
(53) |
May
(48) |
Jun
(48) |
Jul
(59) |
Aug
(82) |
Sep
(49) |
Oct
(30) |
Nov
(16) |
Dec
(16) |
| 2010 |
Jan
(52) |
Feb
(25) |
Mar
(36) |
Apr
(34) |
May
(14) |
Jun
(15) |
Jul
(14) |
Aug
(16) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
(5) |
| 2011 |
Jan
(4) |
Feb
(22) |
Mar
(45) |
Apr
(9) |
May
(8) |
Jun
(13) |
Jul
(12) |
Aug
(4) |
Sep
(6) |
Oct
(10) |
Nov
(21) |
Dec
(5) |
| 2012 |
Jan
(6) |
Feb
(9) |
Mar
(25) |
Apr
(6) |
May
(4) |
Jun
(23) |
Jul
(6) |
Aug
(18) |
Sep
(21) |
Oct
(34) |
Nov
(19) |
Dec
(25) |
| 2013 |
Jan
(8) |
Feb
(34) |
Mar
(35) |
Apr
(4) |
May
(11) |
Jun
(4) |
Jul
(7) |
Aug
(5) |
Sep
(20) |
Oct
(12) |
Nov
(11) |
Dec
(7) |
| 2014 |
Jan
(10) |
Feb
(18) |
Mar
(50) |
Apr
(26) |
May
(53) |
Jun
(21) |
Jul
(12) |
Aug
(39) |
Sep
(43) |
Oct
(26) |
Nov
(8) |
Dec
(6) |
| 2015 |
Jan
(18) |
Feb
(32) |
Mar
(31) |
Apr
(42) |
May
(38) |
Jun
(13) |
Jul
(6) |
Aug
(11) |
Sep
(29) |
Oct
(25) |
Nov
(10) |
Dec
(11) |
| 2016 |
Jan
(24) |
Feb
(12) |
Mar
(13) |
Apr
(15) |
May
(22) |
Jun
(8) |
Jul
(12) |
Aug
(25) |
Sep
(8) |
Oct
(6) |
Nov
(13) |
Dec
(7) |
| 2017 |
Jan
(6) |
Feb
(29) |
Mar
(32) |
Apr
(8) |
May
(82) |
Jun
(42) |
Jul
(20) |
Aug
(17) |
Sep
(27) |
Oct
(14) |
Nov
(22) |
Dec
(6) |
| 2018 |
Jan
(12) |
Feb
(9) |
Mar
(22) |
Apr
(19) |
May
(14) |
Jun
(9) |
Jul
(9) |
Aug
(22) |
Sep
(22) |
Oct
(12) |
Nov
(13) |
Dec
(8) |
| 2019 |
Jan
(22) |
Feb
(3) |
Mar
(30) |
Apr
(20) |
May
(20) |
Jun
(6) |
Jul
(15) |
Aug
(25) |
Sep
(11) |
Oct
(24) |
Nov
(11) |
Dec
(6) |
| 2020 |
Jan
(9) |
Feb
(12) |
Mar
(29) |
Apr
(10) |
May
(22) |
Jun
(11) |
Jul
(15) |
Aug
(5) |
Sep
(6) |
Oct
(7) |
Nov
(7) |
Dec
(13) |
| 2021 |
Jan
(21) |
Feb
(5) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(7) |
Jul
(6) |
Aug
(8) |
Sep
(5) |
Oct
(9) |
Nov
(5) |
Dec
(6) |
| 2022 |
Jan
(5) |
Feb
(4) |
Mar
(8) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(10) |
Aug
(6) |
Sep
(7) |
Oct
(4) |
Nov
(4) |
Dec
(6) |
| 2023 |
Jan
(5) |
Feb
(5) |
Mar
(6) |
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(5) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(7) |
Dec
(8) |
| 2024 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2026 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <j5...@ya...> - 2001-03-31 18:14:17
|
<HTML> <BODY> <FONT face=3D"MS Sans Serif"> <FONT size=3D2> <BR> Email advertising WORKS!<BR> Email Advertise your product or website to millions for only $99.<BR> <BR> For $99.00 you will receive the Stealth Bulk Mailing Software,<BR> List Manager, Over 10 Million E-Mail Addresses, Targeted Email <BR> Address Harvesting Software, and as a FREE BONUS, a Mail Server <BR> to send your mail through.<BR> <BR> Its only $99 for everything, and you can download it all, today!<BR> <BR> FOR MORE INFO:<BR> Simply REPLY to this Email, with "99" in the "Subject" Line.<BR> <BR> To be PERMANENTLY REMOVED from our mail list, YOU MUST<BR> REPLY, with "REMOVE" in the --> "SUBJECT" Line!<BR> <BR> </FONT></FONT> </BODY> </HTML> |
|
From: Saravanan B. (EWU)
<Sar...@am...> - 2001-03-30 21:02:24
|
How to pass an array or list parameter to a Jython class function ? |
|
From: <ba...@uw...> - 2001-03-30 18:33:41
|
Finn, I have a new java version of a python wrapper module for java.lang.StringBuffer. There are also some modules to test it using ao. the string tests as distributed with Jython. It's too large to post. I'd prefer to attach it as a .tgz, but even that is more than 60k, (including the class files). A stringBuffer has all methods that a string has, but it operates in place whenever possible, so as to avoid creating objects. For the same reason I added start and stop args wherever appropriate. All string operators are implemented, including the += and *= that work in place. In case you or someone else is interested I'd gladly send a copy. Bastler. |
|
From: <Arm...@t-...> - 2001-03-30 10:07:26
|
Hi folks, I'm using jpython/jython since a few months for testing and implementing java applications in different areas (gui, networking etc.). For me, it is one of the most useful tools I have seen in recent years. I like to thank you all for providing support and new good ideas to drive its development ahead. I hope to be able to give you something back for this one day. Thank you so much and go ahead this way AE |
|
From: Jim A. <ji...@tr...> - 2001-03-29 00:24:18
|
Finn Bock wrote:
>
> This is a correct way to set/get attributes:
>
> classInstance.__setattr__( key1.intern(),
> new PyString("In my code this is actually a PyList object..." ));
> ...
I had missed the requirement to 'intern' Strings in the docs: yes this
works with 'identityHashCode()'.
Of course this makes my other changes from '==' -> '.equals' unnecessary
also.
Besides the API docs, there is not much info on the jython site about
this kind of use of Jython.
Would it be useful if I could try to put something together? Maybe a new
item in 'Working with Java' section ?
For example, I have some test code that compares this:
String s = "class Charge: pass \n" +
"c1 = Charge() \n" +
"c1.Code = 'AF' \n" +
"c1.Description = 'Appraisal Fee' \n" +
"c1.Amount = '100' \n" +
"c1.PaidTo = 'L' \n" +
"c3 = Charge() \n" +
"c3.Code = 'MSC' \n" +
"c3.Description = 'Misc Fee 1' \n" +
"c3.Amount = '200' \n" +
"c3.PaidTo = 'L' \n" +
"c4 = Charge() \n" +
"c4.Code = 'MSC' \n" +
"c4.Description = 'Misc Fee 2' \n" +
"c4.Amount = '300' \n" +
"c4.PaidTo = 'L' \n" +
...
"ChargeList = [c1, c2, c3, c4] \n" +
With this:
pi.exec( "class Charge: pass" );
PyClass Charge = (PyClass)pi.get("Charge"); // Get the Class itself
!
PyInstance c1 = new PyInstance( Charge ); // Build a new instance
of the class
c1.__setattr__( "Code".intern(), new PyString("AF") );
c1.__setattr__( "Description".intern(), new PyString("Appraisal
Fee") );
c1.__setattr__( "Amount".intern(), new PyInteger(
Integer.parseInt("100") ) );
PyInstance c2 = new PyInstance( Charge); // Another instance of
the class
c2.__setattr__( "Code".intern(), new PyString("MSC") );
c2.__setattr__( "Description".intern(), new PyString("Misc Fee 1")
);
c2.__setattr__( "Amount".intern(), new PyInteger(
Integer.parseInt("200") ) );
...
PyList ChargeList = new PyList();
ChargeList.append(c1);
ChargeList.append(c2);
ChargeList.append(c3);
pi.set("ChargeList", ChargeList );
Both allow Jython code such as this to execute:
Total = 0
for C in ChargeList:
print C.Code,C.Amount
Total += C.Amount
The advantage to the second (Java) approach is that it is easier to make
everything dynamic (for example based on XML or Database definitions).
In effect the 'words' in your database definitions because 'part of' the
scripting language from a 'non-programming user' perspective.
Let me know if you think this kind of approach is general enough to be
worth documenting on the site, and I can put something more detailed
together based on my current project.
--
__o
Jim Adrig _ \<,_
ji...@tr... ' `/ ' `
___________ `-' `-'
|
|
From: <bc...@wo...> - 2001-03-28 08:08:56
|
[Jim Adrig] >I wasn't sure whether to post to 'jython-user': but I think this brings >up something relevant for 'dev'... It is not always easy to decide. Even when the orginal poster chose absolutely right, the followups may move the discussion into new territory. Anyway, it is a minor issue. >I have just found a problem with my Java/Jython code that was driving me >crazy! It turns out it was because of the use of >'System.identityHashCode(key)' instead of 'key.hashCode()' in >PyStringMap. When I change the 3 occurences to 'key.hashCode()' all my >problems disappear. > >I have included some test code below that demonstrates the problem. Am I >doing something I shouldn't be ? Yes, the name arguments to __findattr__ and __setattr__ must be interned strings. Almost the entire attribute lookup implementation assume this to be true for the speed improvement that it gives us. http://www.jython.org/docs/api/org/python/core/PyObject.html >If not, then the question is: is this a bug? Or will I create one by >changing the code? In general I have been trying to extend the Jython >classes when necessary to add/change functionality. > >But I'm not sure what to do here: I can't see a reason in this case to >use 'identityHashCode' instead of 'hashCode()' since 'key' is only a >'String'. (In other classes that use PyObjects I can sort of see why you >might need 'identityHashCode' (?) ) It goes deeper than just PyStringMap. A very common pattern is an implementation of __findattr__(..) like this: public PyObject __findattr__(String name) { if (name == "__dict__") return __dict__; if (name == "__name__") return new PyString(__name__); if (name == "__bases__") return __bases__; ... } >If this can be a patch to Jython, I will leave my code in until I get a >new version. If not, I may try to reimplement the 'PyStringMap' method >in an extending class (?) or figure out some other workaround. This is a correct way to set/get attributes: classInstance.__setattr__( key1.intern(), new PyString("In my code this is actually a PyList object..." )); // Looking it up using the original key1 works: PyObject findIt1 = classInstance.__findattr__(key1.intern()); System.out.println("Using 'key1' this is OK :" + findIt1); // Interned key2 also works PyObject findIt2 = classInstance.__findattr__(key2.intern()); System.out.println("And interned 'key2' also works :" + findIt2); >Thanks (Finn: nice job on the Complex Number bug !) You're welcome. regards, finn |
|
From: Jim A. <ji...@tr...> - 2001-03-28 07:36:21
|
This problem is similar to my last one about using 'hashCode' vs
'identityHashCode': there are several places in PyStringMap where
Strings are compared with '=='.
When passing in arbitrary Strings from Java this can fail: see the
sample code in my last post.
To make it work, I added/changed the comparisons using '.equals' as
follows:
In '__finditem__' after this:
if (tkey == key) {
//if (collisions > 0) {
// System.err.println("key: "+key+", "+collisions+",
"+
// maxindex+",
"+System.identityHashCode(key));
//}
return values[index];
}
if (tkey == null) {
return values[index];
}
I added this:
if (tkey.equals(key)) {
return values[index];
}
in 'insertkey':
-- } else if (tkey == key) {
++ } else if (tkey.equals(key)) { // null is taken care of
above
or would you rather see this..it might be faster ?:
++ } else if ( (tkey == key) || tkey.equals(key) ) {
and in '__delitem__':
-- if (tkey == key) {
++ if (tkey.equals(key)) {
or:
++ if ( (tkey == key) || (tkey.equals(key)) {
Does this look OK? Or am I off base somehow ? (and would it be easier
for you if I learned to use 'diff' ;^) ?? )
--
__o
Jim Adrig _ \<,_
ji...@tr... ' `/ ' `
___________ `-' `-'
|
|
From: Jim A. <ji...@tr...> - 2001-03-28 06:17:11
|
I wasn't sure whether to post to 'jython-user': but I think this brings
up something relevant for 'dev'...
I have just found a problem with my Java/Jython code that was driving me
crazy! It turns out it was because of the use of
'System.identityHashCode(key)' instead of 'key.hashCode()' in
PyStringMap. When I change the 3 occurences to 'key.hashCode()' all my
problems disappear.
I have included some test code below that demonstrates the problem. Am I
doing something I shouldn't be ?
If not, then the question is: is this a bug? Or will I create one by
changing the code? In general I have been trying to extend the Jython
classes when necessary to add/change functionality.
But I'm not sure what to do here: I can't see a reason in this case to
use 'identityHashCode' instead of 'hashCode()' since 'key' is only a
'String'. (In other classes that use PyObjects I can sort of see why you
might need 'identityHashCode' (?) )
If this can be a patch to Jython, I will leave my code in until I get a
new version. If not, I may try to reimplement the 'PyStringMap' method
in an extending class (?) or figure out some other workaround.
Thanks (Finn: nice job on the Complex Number bug !)
__o
Jim Adrig _ \<,_
ji...@tr... ' `/ ' `
___________ `-' `-'
=============================================
Here is some backround info from Sun's web site (1.1 Update changes):
http://java.sun.com/docs/books/jls/first_edition/html/1.1Update.html
%< ------------------------------------------
D.2.2 New Hashing Method
The default implementation of Object.hashCode is to return keys that are
likely to be different for different objects. As described on page 64,
many
classes override both hashCode and equals to provide different notions
of equality. However, sometimes you need the original notion of
equality, in
which all objects are different, even for an object that usually is used
with a broader notion. You can use == to test if two objects are the
same, but you will
need to use System.identityHashCode to hash the objects, since it
preserves the default implementation of hashCode in which all objects
are
considered different.
%< ------------------------------------------
=============================================
And the test code:
=============================================
// Set up two strings that look the same but are different internally:
String key1 = "TESTKEY";
String key2 = "12345" + "TESTKEY" ;
key2 = key2.substring(5); // This just adjusts the pointers
to the internal byte[]
System.out.println("keys are '.equal' ?" + key1.equals(key2) );
System.out.println("keys are '==' ?" + (key1 == key2));
// The 'identityHashCode' attempts to hash differently if it finds any
differences:
System.out.println("key1 identityHashCode:" +
System.identityHashCode(key1));
System.out.println("key2 identityHashCode:" +
System.identityHashCode(key2));
// The 'String' class does it's own 'hashCode' based on the actual
characters:
System.out.println("key1 HashCode:" + key1.hashCode());
System.out.println("key2 HashCode:" + key2.hashCode());
// -= This is the bug it causes: =-
PythonInterpreter python = new PythonInterpreter();
python.exec( "class TestClass: pass" );
// Get the Class Object:
PyClass classObject = (PyClass)python.get( "TestClass" );
// So we can build new instances of it dynamically:
PyInstance classInstance = new PyInstance( classObject );
// Add attributes dynamically to support syntax like
"BorrowerList[1].AssetList[1].AssetAmount" :
classInstance.__setattr__( key1, new PyString("In my code this is
actually a PyList object..." ));
// Looking it up using the original key1 works:
PyObject findIt1 = classInstance.__findattr__(key1);
System.out.println("Using 'key1' this is OK :" + findIt1);
// But even though key2 is '.equal' it doesn't work:
PyObject findIt2 = classInstance.__findattr__(key2);
System.out.println("But with 'key2' it is not :" + findIt2);
|
|
From: Tim P. <ti...@ho...> - 2001-03-28 03:48:44
|
[Pilho Kim]
> [Result on Python 2.0]
> (2+1j)^55 = (1.55453313831e+019+5.99152971656e+018j)
>
> [Result on Jython 2.0 or Jython 2.1 alpha 1]
> (2+1j)^55 = (9223372036854775807+5991529716557069312j)
[Finn Bock]
> I think I have tracked it down to PyComplex.toString():
>
> public static String toString(double value) {
> if (value == Math.floor(value)) {
> return Long.toString((long)value);
> } else {
> return Double.toString(value);
> }
> }
>
> Changing that method to:
>
> public static String toString(double value) {
> if (value == Math.floor(value) &&
> value < Long.MAX_VALUE && value > Long.MIN_VALUE) {
> return Long.toString((long)value);
> } else {
> return Double.toString(value);
> }
> }
>
> seems to work for the test program, but my understanding of the finer
> points of FP and complex numbers is zero.
Take heart! Mine isn't, and I'm sure you've nailed it, except *perhaps* for
wanting <= and >= instead of < and >.
The original bare "value == Math.floor(value)" test is a common
floating-point coding mistake, and across languages: the author always has
in mind, for example, distinguishing 3.1 from "3.0 on the nose", but doesn't
realize that, e.g., floor(1e300) == 1e300 too (every f.p. number with a "big
enough" exponent is an exact integer!).
no-wonder-they-call-it-"complex"<wink>-ly y'rs - tim
|
|
From: <bc...@wo...> - 2001-03-27 19:41:09
|
[Brad Clements] >> >There isn't a user.. see next comment >> >> Does that mean the "user.home" property is not set? If it is set, what >> value does it have? > > >user.home = "SYS:" Is that a valid directory? If it is, I suppose that SYS:jython-2.0 would be a acceptable default installation destination. >> It is somewhat similar to the PATH envvar on Windows and Unix. After a >> jython installation, you will have to edit the PATH yourself. IMO this >> is a good feature of the installer. It shouldn't try to edit >> autoexec.bat or ~/.login or the PATH entry in the windows registry. >> >> Keeping all changes highly localized gives the user a good and secure >> feeling that she still owns the computer. > >Okay, good idea. How about I just create a file perhaps called "appendjava.cfg" in the >installation directory and tell folks to alter their existing java.cfg file to "look like" that file. >with the usual cautionary notes to not duplicate .. etc. Sounds good to me. regards, finn |
|
From: Brad C. <bk...@mu...> - 2001-03-27 15:56:59
|
On 27 Mar 2001, at 15:25, Finn Bock wrote: > >There isn't a user.. see next comment > > Does that mean the "user.home" property is not set? If it is set, what > value does it have? user.home = "SYS:" user.name = "PIT" (the file server's name) user.dir = "SYS:" > It is somewhat similar to the PATH envvar on Windows and Unix. After a > jython installation, you will have to edit the PATH yourself. IMO this > is a good feature of the installer. It shouldn't try to edit > autoexec.bat or ~/.login or the PATH entry in the windows registry. > > Keeping all changes highly localized gives the user a good and secure > feeling that she still owns the computer. Okay, good idea. How about I just create a file perhaps called "appendjava.cfg" in the installation directory and tell folks to alter their existing java.cfg file to "look like" that file. with the usual cautionary notes to not duplicate .. etc. Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements |
|
From: <bc...@wo...> - 2001-03-27 15:29:12
|
On Tue, 27 Mar 2001 09:33:45 -0500, you wrote: >> [Moved to jython-dev and cc'ed: liftoff-users] > >Thanks, I don't think I'm on the jython-dev list however. The list is open for admission all the time. >> >To install, the .class needs to be unzipped somewhere (I suggest sys:Jython) >> >> By default the installer picks the user.home property. If that property >> is initialized by the netware JVM, we should just use that. > >There isn't a user.. see next comment Does that mean the "user.home" property is not set? If it is set, what value does it have? >> >1. Add jython.jar to classpath by appending a line like this to the file sys:etc/java.cfg >> > >> >CLASSPATH=$CLASSPATH;sys:Jython/jython.jar >> > >> >(substitute the correct path) >> >> I don't yet have a wellformed opinion about this, but I would prefer if >> the installation set the classpath in the script files if at all >> possible. Not only does that match windows and unix behavior, it also >> avoids a lot of problems with proper access rights to sys:etc (I guess). > >When operating at the NetWare system console, you *are* God. There is no security >and you have full and complete rights to the entire system. There isn't any concept of >"user" either. > >I think classpath could be specified in the .ncf files, but the ultimate goal is to be able to >use Jython in servlets and other java programs without having to include the full Jython >distribution into every servlet .jar file. I agree with this goal. >There's no way to easily modify all the other programs to include Jython.jar in their >command line, so it seems to me that Jython.jar should be a system-wide .jar file for >this environment. I agree with this as well. The question is whether the installer should try and modify sys:etc/java.cfg. I would rather leave that as a manual option that the admin can perform herself. It is somewhat similar to the PATH envvar on Windows and Unix. After a jython installation, you will have to edit the PATH yourself. IMO this is a good feature of the installer. It shouldn't try to edit autoexec.bat or ~/.login or the PATH entry in the windows registry. Keeping all changes highly localized gives the user a good and secure feeling that she still owns the computer. regards, finn |
|
From: <bc...@wo...> - 2001-03-27 15:27:32
|
[Jeff Turner]
>...
Thanks for the bugreport.
>After a bit of digging, I found the problem: jython is wrapping the
>classpath in quotes. This is corrupting the first and last classpath
>entries.
>
>This problem is only obvious if you do not have your CLASSPATH set. For
>most people, this bug would manifest itself as seemingly random
>classpath issues, as jars sometimes are not picked up.
>
>So why don't you need quotes?
It was added based on a windows bug report where it fails for me when
having a classpath with spaces using jdk1.1.7.
>Well I thought the quotes were only to
>protect the string from the shell. Therefore if you're using
>runtime.exec(), you don't need to quote arguments.
All true when looking at unix.
>However I'm quite likely wrong ;) So perhaps someone on a windows
>computer should verify that my patch doesn't break things.
It breaks with jdk1.1.7. With jdk1.2, the Win32Process class contains
Win32Process(String cmd[], String env[]) throws Exception {
StringBuffer cmdbuf = new StringBuffer(80);
for (int i = 0; i < cmd.length; i++) {
String s = cmd[i];
if (s.indexOf(' ') >= 0 || s.indexOf('\t') >= 0) {
if (s.charAt(0) != '"') {
cmdbuf.append('"');
cmdbuf.append(s);
cmdbuf.append('"');
} else if (s.endsWith("\"")) {
/* The argument has already been quoted. */
cmdbuf.append(s);
} else {
/* Unmatched quote for the arguement. */
throw new IllegalArgumentException();
}
} else {
cmdbuf.append(s);
}
cmdbuf.append(' ');
}
in which case the jvm will quote problem arguments and ignore already
quoted args. So the quotes in javac.py are not needed for jdk1.2.
>I can post a self-contained test case if needed,
No need.
>--------- Patch -----------
--- javac.py.org Wed Mar 14 16:42:24 2001
+++ javac.py Tue Mar 27 16:46:16 2001
@@ -76,7 +76,10 @@
if sourcedir:
cpath.append(sourcedir)
cpath.extend(sys.path)
- cpath = '"%s"' % sep.join(cpath)
+ cpath = sep.join(cpath)
+ if System.getProperty("os.name")[:7] == 'Windows' and \
+ System.getProperty("java.version") < "1.2":
+ cpath = '"%s"' % cpath
cmd.extend([cpathopt, cpath])
cmd.extend(files)
print 'Compiling with args:', cmd
regards,
finn
|
|
From: Danney J. <dan...@ma...> - 2001-03-27 15:27:03
|
I have been programming in Java only a few days, and one of my first projects was to work on the ability to integrate Jython into InstallShield. Though there were many possible solutions, I wanted to have the ability for Jython to import .py modules from jar and zip files. I wrote the method loadFromZipFile into the imp.java file to resolve the problem. I realize it is quite crude; however, My hope is that a REAL Java programmer will run with it to add this capability to a build. I have found this capability a great deal of help in my attempts to create a number of Jython deployment solutions. -- Jython, the best thing since Java, because it is Java. Thanks, Danney Jarman Email: dan...@ma... Phone: (972) 916-4675 Alphanumeric Pager: (877) 510-8043 Email Alphanumeric Page: 877...@sk... WWW Alphanumeric Page: http://www.skytel.com/Paging/index.html |
|
From: <bc...@wo...> - 2001-03-27 15:27:01
|
[Robert] >It did reminded me of something when I tested it on *nix with dirs >containing spaces. It seems the paths in the unix_sh templates should >have quotes in case someone chooses a dir with spaces (e.g. >"/home/rbill/jython test"). > >patch for CVS/jython/installer/jython_template.unix_sh >------------------------------------------------------- >--- jython_template.unix_sh Wed Mar 14 15:39:50 2001 >+++ jython_template.unix_sh Sun Mar 25 15:50:07 2001 >@@ -4,4 +4,4 @@ > # This file generated by Jython installer > # Created on XXX by @user.name@ > >-@jvm@ -Dpython.home=@location._top_@ -classpath "@location._top_@/jython.jar:$CLASSPATH" @classname@ "$@" >+"@jvm@" -Dpython.home="@location._top_@" -classpath "@location._top_@/jython.jar:$CLASSPATH" "@classname@" "$@" > > >patch for CVS/jython/installer/jythonc_template.unix_sh >------------------------------------------------------- >--- jythonc_template.unix_sh Wed Mar 14 15:39:50 2001 >+++ jythonc_template.unix_sh Sun Mar 25 15:49:19 2001 >@@ -4,4 +4,4 @@ > # This file generated by Jython installer > # Created on XXX by @user.name@ > >-@location._top_@/jython @location._top_@/Tools/jythonc/jythonc.py "$@" >+"@location._top_@/jython" "@location._top_@/Tools/jythonc/jythonc.py" "$@" Done. Thanks. regards, finn |
|
From: <bc...@wo...> - 2001-03-27 15:26:14
|
[Jorge Tellez]
>In Python 2.0 the following code writes a binary file.
>
>original = 48565078965739
>twobis = 256l
>a = []
>f = open('c:\\code.gz','w')
>try:
> while original > 0:
> original, binary =3D divmod(original, twobis)
> a.insert(0, (chr(binary)))
> for c in a:
> f.write(c)
>finally:
> f.close()
>
>In Python this file is written correctly , but when we tried the same
>code in Jython 2.0 the code did not do the job.
>The problem we found was an incompatibility writting the binary file, in
>Python is allowed to write the code:
>
>f = open('c:\\code.gz','w') or f = open('c:\\code.gz','wb')
>
>While in Jython only the second option is valid.
Right. I have added this difference and an explation for it to the
differences page:
http://www.jython.org/docs/differences.html
regards,
finn
|
|
From: Brad C. <bk...@mu...> - 2001-03-27 14:24:19
|
On 27 Mar 2001, at 10:45, Finn Bock wrote: > [Moved to jython-dev and cc'ed: liftoff-users] Thanks, I don't think I'm on the jython-dev list however. > >To install, the .class needs to be unzipped somewhere (I suggest sys:Jython) > > By default the installer picks the user.home property. If that property > is initialized by the netware JVM, we should just use that. There isn't a user.. see next comment > >1. Add jython.jar to classpath by appending a line like this to the file sys:etc/java.cfg > > > >CLASSPATH=$CLASSPATH;sys:Jython/jython.jar > > > >(substitute the correct path) > > I don't yet have a wellformed opinion about this, but I would prefer if > the installation set the classpath in the script files if at all > possible. Not only does that match windows and unix behavior, it also > avoids a lot of problems with proper access rights to sys:etc (I guess). When operating at the NetWare system console, you *are* God. There is no security and you have full and complete rights to the entire system. There isn't any concept of "user" either. I think classpath could be specified in the .ncf files, but the ultimate goal is to be able to use Jython in servlets and other java programs without having to include the full Jython distribution into every servlet .jar file. There's no way to easily modify all the other programs to include Jython.jar in their command line, so it seems to me that Jython.jar should be a system-wide .jar file for this environment. I'm certainly open to other suggestions! Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements |
|
From: <bc...@wo...> - 2001-03-27 10:47:40
|
[Moved to jython-dev and cc'ed: liftoff-users] [Brad Clements] >I'd like to add support for NetWare in the installer.. How do I go about doing that? Start by checking out the CVS version of liftoff. http://sourceforge.net/projects/liftoff/ Build liftoff by running "bootstrap" and then "build" from within the "src" directory. Before running liftoff, some directories must be configured in the data/builder.properties file: # name of the list of stdandard files stdlist=i:\\java\\liftoff\\data\\def_list.list # name of the directory that contains the installer classes installer=i:\\java\\liftoff\\data\\installer # Jar loader class install_class=i:\\java\\liftoff\\data\\Install.class In src\installer\net\sourceforge\liftoff\installer you will find a os.properties file that maps the os.name to a platform action class. A new action class must most likely be created: NetwareAction.java. Use the WindowsAction class as a beginning. >The OS type reported (on my platform) is "NetWare 5.00", though "NetWare*" should >be used to match any version of NetWare. > >To install, the .class needs to be unzipped somewhere (I suggest sys:Jython) By default the installer picks the user.home property. If that property is initialized by the netware JVM, we should just use that. >(yes, that's right, "sys:Jython" NetWare uses volume:path/path/file) Perhaps the path handling code in liftoff can deal with that already. Perhaps not. >After unzipping to the target directory (wherever the user specified, might be >vol1:jython) these steps are needed: > >1. Add jython.jar to classpath by appending a line like this to the file sys:etc/java.cfg > >CLASSPATH=$CLASSPATH;sys:Jython/jython.jar > >(substitute the correct path) I don't yet have a wellformed opinion about this, but I would prefer if the installation set the classpath in the script files if at all possible. Not only does that match windows and unix behavior, it also avoids a lot of problems with proper access rights to sys:etc (I guess). >(anyone know if SERVLETCLASSPATH should be updated as well?) These changes to sys:etc/java.cfg should instead be described in doc/readme files. >2. Create two files in the target installation directory, like this: > >filename: jython.ncf > >Contents: > >java -ns -Dpython.home=sys:jython org.python.util.jython %1 %2 %3 %4 %5 %6 %7 %8 %9 > > >Note that the correct path needs to be inserted in place of "sys:jython", there's just one >line in the .ncf file. > >filename: jythonc.ncf > >Contents: > >java -ns -Dpython.home=sys:jython org.python.util.jython >"sys:jython/Tools/jythonc/jythonc.py" %1 %2 %3 %4 %5 %6 %7 %8 %9 > >(should be all one line, also put the correct path to sys:jython in both locations) That's relative easy with liftoff. A new builder property "exec.template.netware" must be added to liftoff and two jython specific template files must be added jython. >3. Admonish the user after installation with the following message: > >------ >You must unload java to complete the installation. Unload java by typing the command >"unload java" at the system console. Note that this will unload any DirXML drivers you >may have loaded. > >You may wish to add <installationdir> to the system search path by adding the following >line to sys:system/autoexec.ncf: > >search add <installationdir> >----- >(replace <installationdir> with the appropriate path to where the .ncf files ended up) > That is easy with liftoff's templates. >If someone could tell me how to make these changes to the installer (and submit a >patch) or if someone could just make the changes and I'll test (hint hint) I'd would be >very happy, and so would many NetWare users.. Absolutely. Making it easier for netware users to use jython would be a good thing for all. When I create the installable jython-21a1.class I run this windows script from within the jython CVS directory: java -Ddatadir=i:\java\liftoff\data -cp i:\java\liftoff\lib\LiftOff.jar net.sourceforge.liftoff.builder.Main where i:\java\liftoff is the CVS version of liftoff. I open the installer\liftoff.props file with the file/open and create the class with Create/Class menu. If you can't upload patches to the liftoff project, you can put them under the jython project instead. I have commit rights to liftoff and will be able to commit them. regards, finn |
|
From: <bc...@wo...> - 2001-03-27 08:37:30
|
[Pilho Kim]
>I have meet Jython's wrong calculation about complex numbers.
>
>Check the results of the following example.
>
>Regards,
>Kim
>
>
>
>"""
> test.py
>"""
>
>z = 2.0 + 1.0j
>
>for i in range(1, 101):
> print "%s^%d = %s" % (z, i, z**i)
>
>
>
>[Result on Python 2.0]
>(2+1j)^55 = (1.55453313831e+019+5.99152971656e+018j)
>
>[Result on Jython 2.0 or Jython 2.1 alpha 1]
>(2+1j)^55 = (9223372036854775807+5991529716557069312j)
I think I have tracked it down to PyComplex.toString():
public static String toString(double value) {
if (value == Math.floor(value)) {
return Long.toString((long)value);
} else {
return Double.toString(value);
}
}
Changing that method to:
public static String toString(double value) {
if (value == Math.floor(value) &&
value < Long.MAX_VALUE && value > Long.MIN_VALUE) {
return Long.toString((long)value);
} else {
return Double.toString(value);
}
}
seems to work for the test program, but my understanding of the finer
points of FP and complex numbers is zero. I hope somebody else with a
better understanding of this can verify that it is the intended
behaviour.
regards,
finn
|
|
From: Pilho K. <ph...@ma...> - 2001-03-26 01:40:46
|
Hi,
Sorry, I have missed a source and results in my previous posting.
I have meet Jython's wrong calculation about complex numbers.
Check the results of the following example.
Regards,
Kim
"""
test.py
"""
z = 2.0 + 1.0j
for i in range(1, 101):
print "%s^%d = %s" % (z, i, z**i)
[Result on Python 2.0]
..........................
..........................
..........................
(2+1j)^53 = (2.82408452063e+018-1.76826945532e+018j)
(2+1j)^54 = (7.41643849657e+018-7.12454390007e+017j)
(2+1j)^55 = (1.55453313831e+019+5.99152971656e+018j)
(2+1j)^56 = (2.50991330497e+019+2.75283908163e+019j)
(2+1j)^57 = (2.26698752832e+019+8.01559146823e+019j)
(2+1j)^58 = (-3.48161641158e+019+1.82981704648e+020j)
(2+1j)^59 = (-2.52614032879e+020+3.3114724518e+020j)
(2+1j)^60 = (-8.36375310938e+020+4.0968045748e+020j)
(2+1j)^61 = (-2.08243107936e+021-1.70143959786e+019j)
(2+1j)^62 = (-4.14784776274e+021-2.11645987131e+021j)
(2+1j)^63 = (-6.17923565416e+021-8.38076750536e+021j)
(2+1j)^64 = (-3.97770380295e+021-2.29407706649e+022j)
..........................
..........................
..........................
[Result on Jython 2.0 or Jython 2.1 alpha 1]
..........................
..........................
..........................
(2+1j)^53 = (2824084520626955264-1768269455316917248j)
(2+1j)^54 = (7416438496570826752-712454390006879744j)
(2+1j)^55 = (9223372036854775807+5991529716557069312j)
(2+1j)^56 = (9223372036854775807+9223372036854775807j)
(2+1j)^57 = (9223372036854775807+9223372036854775807j)
(2+1j)^58 = (-9223372036854775808+9223372036854775807j)
(2+1j)^59 = (-9223372036854775808+9223372036854775807j)
(2+1j)^60 = (-9223372036854775808+9223372036854775807j)
(2+1j)^61 = (-9223372036854775808-9223372036854775807j)
(2+1j)^62 = (-9223372036854775808-9223372036854775807j)
(2+1j)^63 = (-9223372036854775808-9223372036854775807j)
(2+1j)^64 = (-9223372036854775808-9223372036854775807j)
..........................
..........................
..........................
|
|
From: Pilho K. <ph...@ma...> - 2001-03-26 01:33:55
|
Hi, Jython is a gool tool for me. But I have meet Jython's wrong calculation about complex numbers. Check the results of the following example. Regards, Kim |
|
From: Robert W. B. <rb...@di...> - 2001-03-25 17:30:19
|
[Jeff Turner] > However I'm quite likely wrong ;) So perhaps someone on a windows > computer should verify that my patch doesn't break things. Yes, I tried it on Windows (as well as linux, solaris) and the Demo files compiled fine with jythonc. It did reminded me of something when I tested it on *nix with dirs containing spaces. It seems the paths in the unix_sh templates should have quotes in case someone chooses a dir with spaces (e.g. "/home/rbill/jython test"). patch for CVS/jython/installer/jython_template.unix_sh ------------------------------------------------------- --- jython_template.unix_sh Wed Mar 14 15:39:50 2001 +++ jython_template.unix_sh Sun Mar 25 15:50:07 2001 @@ -4,4 +4,4 @@ # This file generated by Jython installer # Created on XXX by @user.name@ -@jvm@ -Dpython.home=@location._top_@ -classpath "@location._top_@/jython.jar:$CLASSPATH" @classname@ "$@" +"@jvm@" -Dpython.home="@location._top_@" -classpath "@location._top_@/jython.jar:$CLASSPATH" "@classname@" "$@" patch for CVS/jython/installer/jythonc_template.unix_sh ------------------------------------------------------- --- jythonc_template.unix_sh Wed Mar 14 15:39:50 2001 +++ jythonc_template.unix_sh Sun Mar 25 15:49:19 2001 @@ -4,4 +4,4 @@ # This file generated by Jython installer # Created on XXX by @user.name@ -@location._top_@/jython @location._top_@/Tools/jythonc/jythonc.py "$@" +"@location._top_@/jython" "@location._top_@/Tools/jythonc/jythonc.py" "$@" |
|
From: Jeff T. <je...@so...> - 2001-03-25 05:25:42
|
Hi,
I've just installed jython-2.1a1, and found something a bit odd. When I
try to compile ('jythonc') Demo/javaclass/Graph.py, the compiler
complains that it can't find classes in jython.jar[1]. However, jython.jar is
in the classpath:
Compiling with args: ['/usr/local/java/jdk1.2.2/bin/javac', '-classpath', '"/home/jeff/jython-2.1a1/jython.jar::./jpywork::/home/jeff/jython-2.1a1/Tools/jythonc:/home/jeff/jython-2.1a1/Demo/javaclasses/.:/home/jeff/jython-2.1a1/Lib"', './jpywork/pygraph/Graph.java']
And when I enter the command manually:
/usr/local/java/jdk1.2.2/bin/javac -classpath "/home/jeff/jython-2.1a1/jython.jar::./jpywork::/home/jeff/jython-2.1a1/Tools/jythonc:/home/jeff/jython-2.1a1/Demo/javaclasses/.:/home/jeff/jython-2.1a1/Lib" ./jpywork/pygraph/Graph.java
Everything works fine.
After a bit of digging, I found the problem: jython is wrapping the
classpath in quotes. This is corrupting the first and last classpath
entries.
This problem is only obvious if you do not have your CLASSPATH set. For
most people, this bug would manifest itself as seemingly random
classpath issues, as jars sometimes are not picked up.
So why don't you need quotes? Well I thought the quotes were only to
protect the string from the shell. Therefore if you're using
runtime.exec(), you don't need to quote arguments.
However I'm quite likely wrong ;) So perhaps someone on a windows
computer should verify that my patch doesn't break things.
I can post a self-contained test case if needed, but a basic
demonstration is:
export CLASSPATH=
cd $JYTHON_HOME/Demo/javaclasses
jythonc --package pygraph Graph.py
Thanks,
--Jeff
--------- Patch -----------
Index: Tools/jythonc/javac.py
===================================================================
RCS file: /cvsroot/jython/jython/Tools/jythonc/javac.py,v
retrieving revision 2.12
diff -u -r2.12 javac.py
--- Tools/jythonc/javac.py 2001/02/07 16:52:42 2.12
+++ Tools/jythonc/javac.py 2001/03/25 05:09:40
@@ -76,7 +76,7 @@
if sourcedir:
cpath.append(sourcedir)
cpath.extend(sys.path)
- cpath = '"%s"' % sep.join(cpath)
+ cpath = '%s' % sep.join(cpath)
cmd.extend([cpathopt, cpath])
cmd.extend(files)
print 'Compiling with args:', cmd
---------------------------
[1] Full listing:
~/jython-2.1a1/Demo/javaclasses$ ../../jythonc --package pygraph Graph.py
*sys-package-mgr*: processing new jar, '/home/jeff/jython-2.1a1/jython.jar'
*sys-package-mgr*: processing new jar, '/usr/local/java/jdk1.2.2/jre/lib/rt.jar'
*sys-package-mgr*: processing new jar, '/usr/local/java/jdk1.2.2/jre/lib/i18n.jar'
*sys-package-mgr*: processing new jar, '/usr/local/java/jdk1.2.2/jre/lib/ext/iiimp.jar'
processing Graph
Required packages:
java.awt
Creating adapters:
java.awt.event.ActionListener used in Graph
Creating .java files:
Graph module
Graph extends java.awt.Canvas
Compiling .java to .class...
Compiling with args: ['/usr/local/java/jdk1.2.2/bin/javac', '-classpath', '"/home/jeff/jython-2.1a1/jython.jar::./jpywork::/home/jeff/jython-2.1a1/Tools/jythonc:/home/jeff/jython-2.1a1/Demo/javaclasses/.:/home/jeff/jython-2.1a1/Lib"', './jpywork/pygraph/Graph.java']
1 ./jpywork/pygraph/Graph.java:3: Package org.python.core not found in import.
import org.python.core.*;
^
./jpywork/pygraph/Graph.java:5: Interface org.python.core.PyProxy of class pygraph.Graph not found.
public class Graph extends java.awt.Canvas implements org.python.core.PyProxy {
^
./jpywork/pygraph/Graph.java:9: Superclass pygraph.PyFunctionTable of nested class pygraph.Graph. _PyInner not found.
public static class _PyInner extends PyFunctionTable implements PyRunnable {
^
./jpywork/pygraph/Graph.java:9: Interface pygraph.PyRunnable of nested class pygraph.Graph. _PyInner not found.
public static class _PyInner extends PyFunctionTable implements PyRunnable {
^
4 errors
ERROR DURING JAVA COMPILATION... EXITING
nescafe:~/jython-2.1a1/Demo/javaclasses$
/usr/local/java/jdk1.2.2/bin/javac -classpath
"/home/jeff/jython-2.1a1/jython.jar::./jpywork::/home/jeff/jython-2.1a1/Tools/jythonc:/home/jeff/jython-2.1a1/Demo/javaclasses/.:/home/jeff/jython-2.1a1/Lib"
./jpywork/pygraph/Graph.java
Note: ./jpywork/pygraph/Graph.java uses or overrides a deprecated API.
Recompile with "-deprecation" for details.
1 warning
nescafe:~/jython-2.1a1/Demo/javaclasses$
|
|
From: Mike C. <su...@in...> - 2001-03-24 13:03:40
|
Tkinter was ported to jPython using JNI (http://sourceforge.net/projects/jtkinter) Could it be brought up to date for jython 2? I know it is not a "pure" Java solution, but there are a lot of people like myself who need to use some of the massive Java libraries, and are looking to Jython to help provide a practical solution. Moreover, it would help to extend the completeness of CPython/Jython to include GUI work, wich is an added plus. Finn, how hard would it be to bring it up to date for jython 2? Many thanks, Mike. |
|
From: Jorge T. <jt...@te...> - 2001-03-23 15:06:15
|
In Python 2.0 the following code writes a binary file.
original =3D 48565078965739
twobis =3D 256l
a =3D []
f =3D open('c:\\code.gz','w')
try:
while original > 0:
original, binary =3D divmod(original, twobis)
a.insert(0, (chr(binary)))
for c in a:
f.write(c)
finally:
f.close()
In Python this file is written correctly , but when we tried the same =
code in Jython 2.0 the code did not do the job.
The problem we found was an incompatibility writting the binary file, in =
Python is allowed to write the code:
f =3D open('c:\\code.gz','w') or f =3D open('c:\\code.gz','wb')=20
While in Jython only the second option is valid.
Greetings
Jorge Tellez
jt...@te...
|