[Zope] Adding content type to internet explorer

2001-01-15 Thread Hung Jung Lu

Hi,

Can someone tell me how to add content types (and the associated program) to 
internet explorer on Windows platform? Is it in the registry?

thanks,

Hung Jung

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] HTTP status code 302

2000-12-10 Thread Hung Jung Lu

From: "Steve Spicklemire" [EMAIL PROTECTED]
Did you set a 'Host' header in your request? Is
 the request going straight to ZServer, or through
 Apache? (Also... do you have a SiteRoot?) These can
 all affect how the request is handled by the server...

Ahh... that's it. Thank you very much!! Virtual hosting was the problem.
After supplying the 'Host' header, everything was fine.

The httplib offers more control, I think. It allows me to supply the
'Authorization' header. The urllib probably does not do that, right?

That being said, I am still not 100% familiar with all the HTTP headers (for
both request and response), it's like I learn one at a time. :) Do you know
any pointer where I can get info on all the headers?

regards,

Hung Jung


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] HTTP status code 302

2000-12-09 Thread Hung Jung Lu



I can view certain document on a Zope site over the 
web if I use a brower. But for fun I tried to download it by using Python's 
httplib, and for some Zope sitesgot a status code 302. This probably means 
I need to use another URL address. The web browser does this automatically so I 
don't need to do anything. But I can't seem to find the right URL. 

Reading from http://www.w3.org/Protocols/HTTP/HTRESP.html, 
it says that when 302 happens, the header line would be

URI: url String CrLf

But I don't see this line in the returned header. 
And the returned body is an HTML telling me the document has been moved. Funny 
thing is thatbrowsers (IE, Netscape) do not have problems with 
it.

Is this a limitation of Python's httplib (not 
showing the URI in the response header)? Is therea way to circumvent it? 
Or does this have to do with virtual hosting, or Apache stuff?

Thanks,

Hung Jung



Re: [Zope] IP address and US city name

2000-12-02 Thread Hung Jung Lu

From: Bill Anderson [EMAIL PROTECTED]
Hung Jung Lu wrote:
 
  Hi,
 
  I know that IP addresses in the USA follow a strict pattern of 
geographical
  locations. (Most other countries don't do that.) Does anyone know where 
I
  can get a copy of the table of IP addresses vs. city names?

Whomever told you this was wrong.

No Bill. You are the one that is wrong. :)

regards,

Hung Jung

_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] IP address and US city name

2000-12-02 Thread Hung Jung Lu

From: Michel Pelletier [EMAIL PROTECTED]
Actually Hung, on this one he is right.  I owned and operated an
...
That said, there is a company that has intrusivly scanned the whole
...
service is very expensive, not 100% accurate (because neworks move and

It happens that I saw with my own eyes in a vendor's demo how a well-known 
product (and you are right on the "very expensive" part, but nowadays I seem 
to use only the "very expensive" software products) pinpointed visitors down 
to the city level. I asked the vendor how this was done and he, obviously 
unaware of the details, gave me the answer that I have mentioned. This was 
not even recent development. So I just thought it was common knowledge.

thanks and regards,

Hung Jung



_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Python and EJB (J2EE)

2000-11-26 Thread Hung Jung Lu

1) EJB's are TRANSACTIONAL components (MTS components are also
transactional)

Thanks for your comments. Transaction certainly is one of the important 
features of EJB. But my personal opinion is that instance pooling 
(multi-threading) is even more important. If you have to implement a 
components server from scratch, and you can only do so much, which feature 
would you implement first? Transaction? Or Multithreading? I think the 
answer is Multithreading.

All this can be specified in a deployment-descriptor - an XML
"properties" file.

Yeap. :) XML "properties" file is the way to go. For many things.

Thus multiple database servers at different sites on the net can
participate in a single transaction.  This implicitly involves TWO-PHASE
COMMIT and XA/TX interfaces. In plain words, if one database engine in a
distributed transaction decides to rollback, all other engines must
rollback as well.

Two-phase commit is crucial. That's why I explicity mentioned it in my 
original message: the final commit must be done in matter of milliseconds, 
if not microseconds. Let's face it, the commit action takes time. There is 
never a 100% sure trasaction. NEVER EVER, since the transaction can fail 
exactly when you are performing the commit action. So the next best thing to 
do is to commit in two phases: (1)prepare to commit: which can take a few 
seconds to prepare everything up to the point of hanging all the transaction 
changes on one single index field (a few bytes), (2) Final commit: modify 
those few bytes, which on a single machine means of the order of 
nano-seconds, and on distributed transaction, microseconds to milliseconds. 
Milliseconds certainly is still not very comforting, but it beats a commit 
action that takes 30 or 40 seconds that is totally unacceptable in business.

Hence EJB's can potentially participate in DISTRIBUTED TRANSACTIONS.

Yes, totally agree with you.

4) ENTITY EJB's allow programmatic access to database rows

That's the object mapper. I am not sure, though, whether it's the best 
approach to put the object mapper as part of the Components Server. The fact 
that even SUN's own people recommend against using entity beans tells me a 
lot. Object mapper can be used as an independent utility, outside the 
Components Server.

We need more of these for transactional components. However I think
before that Zope will need to evolve to include the next level of
sophistication in DB transaction
management, especially two-phase commit, XA/TX ..., support for existing
transaction co-ordinators, and/or provide one.

I've mentioned two-phase commit to Digicool people. Not sure whether it's 
already inside Zope or not, but it seems not. Zope's TM (Transaction 
Machinery) does not seem to be two-phase. See the TM.py file itself: it only 
has

def _finish(self):
self.db.commit()

That is, I don't see the equivalent of prepare_to_commit().

If you know where to get more info on XA/TX, could you provide some 
pointers?

thanks,

Hung Jung

_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Python and EJB (J2EE)

2000-11-25 Thread Hung Jung Lu

From: Ender [EMAIL PROTECTED]
...

Thanks for the comments. I'll reply other points in a few more days.

as for distributed technologies, while xml-rpc is useful and simple its
not useful (IMO) for enterprise programming, its too basic.

This maybe true. However, HTML is also basic and simple, but exactly because 
of its simplicity, it became widely accepted and used. On the opposite end 
is CORBA: because it's so complicated, there is no vendor out there that can 
possibly implement all its features. Trading powerful features for a wider 
acceptance at times does work.

SOAP is showing symptoms of becoming complicated. And that's a bad sign. See 
Fredrik Lundh's implementation comment for Python SOAP at 
http://www.pythonware.com/products/soap/profile.htm

Profile
Posted Jun 08, 2000

SOAP 1.1 is a highly modular and rather complicated standard. Supporting 
every little nook and cranny is huge task, and since the specification is 
still a moving target, we've decided to do this implementation step by 
step.

OK. Even the guru describes SOAP as "rather complicated", what then for the 
novices? I personally went through the SOAP protocol spec today and I had to 
agree it's "rather complicated". SOAP is going down the path of CORBA all 
over again. It's becoming COAP (Complicated Object Access Protocol). If not 
because Microsoft is behind it, I'd dump SOAP right away. Due to its 
simplicity, I'd say XML-RPC is here to stay, SOAP or no SOAP. It's 
unfortunate that the twin brothers have to fare good-bye, but at the same 
time I am glad that XML-RPC split off to remain simple. Future servers will 
have to handle both: more work, but that's fate.

More on the other points later.

regards,

Hung Jung

_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Python and EJB (J2EE)

2000-11-24 Thread Hung Jung Lu

Python and EJB (J2EE)
=

Searching through comp.lang.python newsgroup archive 
([EMAIL PROTECTED]) and the [EMAIL PROTECTED] mailing list, I have not been 
able to find much about EJB (Enterprise Java Bean) and Python/Zope 
comparisons. (J2EE is Java Two Enterprise Edition, basically another jargon 
for any architecture based on EJBs.)

I believe this field deserves to be explored a little bit more. If Python is 
going to be more used in the corporate environment, it has to be made 
stronger. This message is kind of unorganized, but I would like to have 
comments/feedback from other people.

The following message shows that I am not the only one interested:

ruben [EMAIL PROTECTED] 11/08/2000 in comp.lang.python:

Coming from a Java background and recently using Python for application 
development, I have a question. Is there an equivalent to Enterprise 
JavaBeans in Python?  If so, please point me to some resources!!!

Similarly Joe Grace [EMAIL PROTECTED] has posted an explanation on J2EE in 
the Zope mailing list:

http://zope.nipltd.com/public/lists/zope-archive.nsf/0dec1f578f18f116802568ab003585d2/86cffddc1a8a73b980256865006d44a2?OpenDocument

I am starting to look into Java EJB, and I must say that despite all the 
hype, it is totally horrible. I can understand the goals of EJB, but I 
wonder whether something simpler and cleaner might be better. EJBs, 
especially entity beans, have largely failed and have disappointed many Java 
developers, or so it seems from the comments I have received from other 
people.

First off: what is an EJB? There are plenty of books out there, there are 
plenty of websites out there, but you'll probably be hard-pressed to find 
someone that has actually worked with EJBs. I've never liked the names "Java 
Beans" and "Enterprise Java Beans". These are marketing names. We need some 
more generic names. "Java Beans" are an attempt by Sun to implement 
component programmming. That is, the idea is to have component classes on a 
single machine (virtual machine in the case of Java) that can be shared/used 
by different programs. In this sense, "Java Beans" are much like DLLs, Unix 
shared libraries, Python modules, or Microsoft's COM, ActiveX stuff. "Java 
Beans" are designed to be shared within one single machine. "Enterprise Java 
Beans" are much more complex than "Java Beans", and they are aimed at 
distributed computing: EJBs are designed as classes/components to be shared 
by multiple machines. In this sense, they are more like CORBA, or 
Microsoft's DCOM. Therefore:

(1) Java Beans --- local components, run on the same machine
(2) Enterprise Java Beans --- distributed components, distributed 
computing, multiple machines, potentially located in different geographic 
locations. These components often have instance pools running in multiple 
threads, and often are transactional.

-

What about Python? Or Zope? Simple distributed computing is not too hard to 
implement. CGIs in fact are a way of distributed computing. Python does have 
DCOM (Mark Hammond) and CORBA. But I don't think DCOM/CORBA are the way to 
go. In Python/Zope world, I guess Fredrik Lundh's XML-RPC is the closest 
starting point for distributed computing, and eventually for something 
similar to EJB container. (See http://www.zope.org/Members/Amos/XML-RPC for 
XML-RPC in Zope and http://www.pythonware.com/products/xmlrpc/ for XML-RPC 
in Python.) There is also (See SOAP 
http://static.userland.com/xmlRpcCom/soap/SOAPv11.htm ), which is an 
extended version of XML-RPC.

For more information on XML-RPC, visit http://www.xmlrpc.com/ .

Zope can be used as equivalent to EJB container. But Zope is a general 
webserver with a lot of features that a simple server don't need.

-

EJBs are there because of a few good reasons:

(1) Multi-threaded, workload distribution, instance pooling
(2) Security
(3) Transactional
(4) Managed persistence (for "entity beans" in the EJB jargon)

These are all important requirements for the corporate world. Can Python do 
all these things? The answer right now is no. There is nothing really 
equivalent to EJB in the Python world.

-

Security: Python is great for rapid development. The 
reflection/introspection power of Python is wonderful. I particularly like 
the absence of the "private" keyword. In C++ and Java, corporate security is 
implemented at the language level, which makes these language quite 
annoying, in my opinion. That being said, corporates DO need security 
mechanisms. If Python were to be used in corporate environment, there MUST 
be a security interface layer. We don't want any employee to be able to peek 
into the president's salary, for instance. That is, absolute data hiding at 
a higher level is necessary. As Java/C++ have shown, data hiding at the 
language level not only is an illusion, but ties up programmers hands too 
much. So, it's best to leave the language itself free, and implement the 
data 

RE: [Zope] Zope declining?

2000-11-13 Thread Hung Jung Lu

From: "Jason C. Leach" [EMAIL PROTECTED]
2. Many of the people are now way past the general skill level in this
list and have lost interest.
3. Alt. sources of info like: irc.zope.net #Zope

It's obvious when you see companies like www.cbsnewyork.com runing zope
that it is gaining in market penetration.

This site definitely is re-assuring. :) Thanks for the good news. I am 
nowadays more in the Javaland than Pythonland.

Haven't tried irc in these years. It used to be that if newsgroups were 
cocaine, irc would be morphine, so I avoided it completely. :)

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Zope declining?

2000-11-11 Thread Hung Jung Lu

Hi,

From the mailing list volume in the last 3 months, it is not hard to see 
that there is a steady decline. This compared to the trend of last two years 
(doubling volume every year), should probably raise a red flag.

I know what many would say: there are now more experts than newbies as 
compared to before. There are not as many problems as before, etc. But that 
is that really all? I don't think so.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Medusa Monitor

2000-10-12 Thread Hung Jung Lu

Thanks for the follow-ups on Medusa Monitor.

But as I can see (after using Zope for 1.5 years, now), few people actually 
use it. Unless one is really into the guts of Zope itself, the monitor is 
pretty useless for debugging. It of course could be made more useful, but 
one must implement some Python programs first. Even for dynamic reloading of 
modules, I usually just write External methods to do the job, instead of 
firing up the monitor.

A more useful debuging tool would be some monitor where you can receive 
print message logs in real time. That would be great, especially if you have 
multiple thread problems.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Medusa Monitor

2000-10-12 Thread Hung Jung Lu

I know that, the stupid log file thingy. But you'll have to write an 
independent thread to display the log file (or peek the file manually each 
time), or implement some CString stuff to capture the file output (if that 
is possible).

It'll be more fun if all this is already done, and the user can just tap 
into the monitor console screen (even remotely).

A good monitor should actually display hit information, memory usage, etc, 
and preferably with charts, all in real time. Too much to ask? I don't think 
so. :)

Hung Jung

From: Dieter Maurer [EMAIL PROTECTED]
To: "Hung Jung Lu" [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [Zope] Medusa Monitor
Date: Thu, 12 Oct 2000 23:47:35 +0200 (CEST)

Hung Jung Lu writes:
   A more useful debuging tool would be some monitor where you can receive
   print message logs in real time. That would be great, especially if you 
have
   multiple thread problems.
You know Zope's logging support?

It provides a kind of "print message logs", you receive in real time
(in your log file).



Dieter

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Medusa Monitor

2000-10-10 Thread Hung Jung Lu

Hi,

Zope comes with the Medusa monitor (port 8099 by default) which is kind of 
cute and allows one to get into the guts of Zope. But do people really use 
it? How do people use it? Is there any document describing the usages of 
this monitor? Are there some features of this monitor that makes debugging 
easier?

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Java equivalent to WorldPilot?

2000-10-06 Thread Hung Jung Lu

Hi,

Does anyone know any Java software (commercial or not) that is equivalent to 
WorldPilot?

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] HTTP user authentication in Python

2000-10-06 Thread Hung Jung Lu

Hi,

Where can I find out more information on HTTP user authentication? I have 
seen the RFC before, but it's a bit too technical to follow. I think Python 
does not include the authentication/cookie handling part probably because 
out of concern about abuses. :)

Does anyone know where I can find more info on the authentication and cookie 
protocol stuff? Is there any Python module already written to handle these 
things?

The idea is to be able to fetch external webpages automatically using 
Python, including providing the necessary auth and cookie info. Of course 
this opens up a whole can of security worms, but heck, it's open information 
and someone must already have written something in Python already.

regards,

Hung Jung
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Mutiple images don't always show up

2000-09-23 Thread Hung Jung Lu

Hi,

I have observed that in some Zope installations (I am using Zope 2.1.6 
through PCGI on Linux, my browser is Internet Explorer 5.5), if I have more 
than 4 or 5 images (currently I have one page with 12 GIF images), sometimes 
not all the pictures show up. If I reload the page, the problem is often 
fixed.

I have seen similar situations both with static images and dynamic images 
(images generated by Python programs.) I am not sure whether the problem is 
in the browser, in the Zope server, or in my ISP.

Has anyone seen something similar?

regards,

Hung Jung

-

PS- related to this, I also know that for Zope 2.1.x there is some thread 
competing write problem: when two threads (from different browser windows) 
compete in writing, one browser window does not receive any response. I know 
Zope is supposed to abort one of the threads and restart it, and matter of 
fact I do see that happen when I insert print statements. But it's just 
strange that the browser window does not display anything. This problem 
reportedly happens with Zope 2.1.6 and 2.1.x, both on Linux and Windows, 
with IE5 and Netscape browsers alike. This could be a different problem, 
though.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Mutiple images don't always show up

2000-09-23 Thread Hung Jung Lu

It kind of make me feel better to know other people have observed the same 
problem. I found the following message in the mailing list by Pierre-Julien 
Grizel around 09/04/2000, with title: [Zope] Images slow rendering problem

http://zope.nipltd.com/public/lists/zope-archive.nsf/242bb7cc2b2c343d802568ab003585d4/cb99522a7c8258f280256950002d9618?OpenDocument

So, it does seem that Zope 2.1.6 has some problems handling multiple images. 
The problem seems to happen at least with Unix flavor OS (Linux, Solaris, 
FreeBSD,) and seems to be browser-independent (Netscape and IE alike). I 
don't think it's the If-Modified-Since problem, since I have applied the 
patch in http://classic.zope.org:8080/Collector/1388/view
and it did not make a difference.

regards,

Hung Jung

PS- correction: in my previous message, where I said Zope 2.1.x, should have 
been 2.2.x.

--- In [EMAIL PROTECTED], "Hung Jung Lu" [EMAIL PROTECTED] wrote:
Hi,

I have observed that in some Zope installations (I am using Zope 2.1.6 
through PCGI on Linux, my browser is Internet Explorer 5.5), if I have more 
than 4 or 5 images (currently I have one page with 12 GIF images), 
sometimes not all the pictures show up. If I reload the page, the problem 
is often fixed.

I have seen similar situations both with static images and dynamic images 
(images generated by Python programs.) I am not sure whether the problem is 
in the browser, in the Zope server, or in my ISP.

Has anyone seen something similar?

regards,

Hung Jung

-

PS- related to this, I also know that for Zope 2.1.x there is some thread 
competing write problem: when two threads (from different browser windows) 
compete in writing, one browser window does not receive any response. I 
know Zope is supposed to abort one of the threads and restart it, and 
matter of fact I do see that happen when I insert print statements. But 
it's just strange that the browser window does not display anything. This 
problem reportedly happens with Zope 2.1.6 and 2.1.x, both on Linux and 
Windows, with IE5 and Netscape browsers alike. This could be a different 
problem, though.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] ODBC Error

2000-09-14 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Julio Flores Schwarzbeck [EMAIL PROTECTED] wrote:
The problem is that no matter what I do, with any valid sql statement like 
"select * from test1" gives me the following error:

Error Type: ValueError
Error Value: unpack sequence of wrong size
(RoleMgr)

Has anyone played with DBC/DBF files and encountered a similar problem?
thx.

Hmm... were you issue the SQL from the Test tab?

Try to make an actual ZSQL method. And see if it works.

The ZODBC adapter had that problem... (Test tab did not work, but actual 
ZSQL worked.) I'd be shocked if it has not been fixed all this time. See, 
this would be what I call a carcass piece of software. No one maintains it 
anymore. It just sits dead there, despite that the problem has been metioned 
again and again. :) You'll do a great service if you could fix it and upload 
it to Zope website.

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] checking Zope's version number

2000-09-13 Thread Hung Jung Lu

Use version_txt:

   from App.version_txt import version_txt
   version_string = version_txt()

In CVS versions of Zope this will return '(unreleased version)' though.

You could also test for the existence of registerHelp:

   if hasattr(context, 'registerHelp'):
   context.registerHelp()

Ahh... very cool. Thanks.

Hung Jung
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Backslash as line continuation in C (Unix)

2000-09-13 Thread Hung Jung Lu

Or your source files get white space after the "\" only when transported
to Linux; this may happen if under Linux the lines of your source files
still end with CR-LF (carriage return, line feed) as they do in Windows,
instead of only LF (the expected end of line character in Unix).

Yeap yeap, this is exactly the problem. :) I have written a small Python 
program and got rid of the CR characters. The problem must have happened 
when the original author FTP'ed the files in binary mode from Windows onto a 
Unix machine.

Thanks to everyone that have helped!

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Backslash as line continuation in C (Unix)

2000-09-12 Thread Hung Jung Lu

Hi,

This is a Unix C question. But since I am doing something that ultimately 
results in a Zope product, I might as well ask the question here. :)

I am trying to build a third-party utility in Linux. I ran into troubles in 
the compilation process because of the usage of backslash \ as line 
continuation. (This is used in #def preprocessor macro statements.) When I 
remove the backslashes and join the lines, it compiles fine. (I know 
backslashes are fine in Windows Visual C++.)

Does anyone know any other better solution than go into the code and 
explicitly remove the backslashes? Is there any gcc option that recognizes 
backslashes are line-joining characters? Or is there another character used 
in gcc for joining lines? Any other suggestions?

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZGDChart/GDChart on Linux

2000-09-11 Thread Hung Jung Lu

Hmmm... I don't remember anymore how to build GDChart on Linux. To simplify 
the situation, let us say that we want to focus on GDChart alone, not 
ZGDChart.

I downloaded from

   http://athani.pair.com/msteed/software/gdchart/index.html

and did the "make -f makepy.linux" thing. But when I opened a Python 
interpreter, it says:

  import gdchart
  Traceback (innermost last):
File "stdin", line 1, in ?
  ImportError: ./gdchart.so: undefined symbol: gdImagePng

I have suceeded (don't remember how) to get passed this error, but then I 
get something similar for gdImageJpeg.

Has anyone succeeded in installing gdchart module on Linux?
(I thought I was successful once!)

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] GDChart on Linux

2000-09-11 Thread Hung Jung Lu

OKie, I now remember I did succeed in building GDChart on Linux. :)

Let me repost here a message exchange with Mike Steed a while back in the 
Python mailing list, so in the future I won't get lost again. :)

Hung Jung
==

From: Mike Steed  [EMAIL PROTECTED]
Date: Sat Aug 12, 2000 4:01am
Subject: Re: GDChart

Hung Jung Lu wrote:

Hi,

Does anyone have experience with GDChart (Python interface to GD)?

http://www.fred.net/brv/chart/

I tried to install it on Linux, the make process seems fine, but I get the
following error in Python:

 import gdchart
Traceback (innermost last):
   File "stdin", line 1, in ?
ImportError: ./gdchart.so: undefined symbol: gdImagePng

Any help is appreciated.

I became aware of this problem several days ago, but being the slacker
that I am, I have not yet put an updated archive on the web.

Here's the fix.  In gd-1.8.1/Makefile, change line 18 from:

CFLAGS=-O

to:

CFLAGS=-O -DHAVE_JPEG

And change line 25 from:

LIBS=-lm -lgd -lpng -lz

to:

LIBS=-lm -lgd -lpng -lz -ljpeg

Then if you rebuild libgd and the Python interface, it should all work.
Sorry for the hassle.

regards,

Hung  Jung


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Lock and Transaction in Zope.

2000-09-08 Thread Hung Jung Lu

Hi Aitor,

(I am posting to the Zope mailing list, too.)

I have Zope in W2000
Zope 2.2.1
Internet Explorer 5.0

Ok. I just tried with Zope on Linux, after I tried with Zope on Windows 98.

  RedHat 6.2
  Zope 2.1.6
  Internet Explorer 5.0

Guess what? The thread did not hang. The long thread returns, but the value 
of your "var" was 2.

The situation is then:

(1) For Zope running on Windows, the long thread hangs and never returns 
anything to the browser.

(2) For Zope running on Linux, the long thread gets into transaction 
conflict. But Zope was smart enough to abort the transaction and restart the 
request again. (Just like what other people said.)

I think this should be considered as a bug in Zope for the Windows platform. 
We should submit the bug report to the Zope bug collector. Notice that it 
happens for Zope 2.1.6 and Zope 2.2.1, I wonder why no one has reported this 
bug... (or has it been reported but not been fixed?)

regards,

Hung Jung


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Import from file via management-interface

2000-09-08 Thread Hung Jung Lu

I found it very disturbing having to get my .zexp exports
into the subdirectory 'import' of the server and then using
the management-interface to do the actual import.

I found it inconvenient, too. (Not disturbing, though.) And I had to 
implement my own uploading scheme via web. But as anything that is put into 
the file system, I thought that there must be some security reason. At least 
I know that's why the Extensions folder is there.

Is this (existence of import folder) really a shortcoming of Zope, or is 
there some security reason why .zexp cannot be uploaded directly from 
browser? Can someone somehow write a destructive external method, and then 
upload it via .zexp?

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: HappySession

2000-09-01 Thread Hung Jung Lu

From: Diego Rodrigo Neufert [EMAIL PROTECTED]
...
too... well, in the standard html header I call call a method that do a 
call in
all my sessions

Okie, now I see why you get the Transaction error problem. After an 
exception is raised, Zope aborts the http request transaction, and any 
attempt to further use Zope objects that are transaction-aware will cause an 
error. In the next release of HappySession I will try to detect whether the 
transaction has ended, and return some meaningless result like None. But the 
real thing is, after the exception happens, SESSION object should not be 
called again.

If you really need to call SESSION in your standard_html_header, then please 
do two things:

(1) Please use a standard_error_message, and it should start with something 
like:

  dtml-if "not error_message and error_type == 'SessionNotFoundError'"
dtml-return session_not_found_html
  /dtml-if

  !--#var standard_html_header--

  !--#if error_message--
   !--#var error_message--
  !--#else--
   

(2) In your session_not_found_html, please do NOT use dtml-var 
standard_html_header. Instead, write another DTML and call it 
session_ended_html_header, and use it instead. Inside your 
session_ended_html_header, please do NOT call the SESSION object.

I have two SESSION objects, one in the root of zope and
other in the opt folder of zope look how I call the SESSIONS
in standard_html_header
dtml-call callSession

The callSession method:
dtml-call SESSION
dtml-call opt.SESSION

(Hmmm... multiple SESSION objects... in typical situations usually one 
single SESSION object should be enough. Notice that two SESSION objects mean 
two separate storage. Although HappySession is designed to handle multiple 
SESSION objects sharing the same key cookie, the expiration time might be a 
tricky issue... I do not recommend multiple SESSION objects.)

The thing I don't understand is why you need to make explicit call to the 
SESSION objects. Ohh...! I see, you probably think that SESSION objects need 
to be initialized? OK, unlike FSSession or SQLSession, HappySession's 
SESSION objects do NOT need to be initialized! You don't need to make an 
explicit call to SESSION in your standard_html_header. HappySession is smart 
enough to initialize itself whenever you touch it the first time using any 
of its methods. No explicit initialization call needed.

(I'll add an observation on this in the help file in the future.)

-

In short, I think that by simply removing your callSession method and its 
reference in standard_html_header, you will be fine and happy! :)

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Success in installing ZPoPyDA (after 3 months...)

2000-09-01 Thread Hung Jung Lu

From: "Bak @ kedai" [EMAIL PROTECTED]
where did you find linux.h that's needed by PoPy?  thtt stump me from
continuing.

Download postgresql-7.0.2 source (not the RedHat's RPM), unzip and untar it, 
and the file is located at:

postgresql-7.0.2/src/include/port/linux.h

What I did was:

  (1) copy this file into your /usr/include/pgsql
  (2) delete /usr/include/pgsql/os.h (which is merely a link, not an actual 
file)
  (3) rename /usr/include/pgsql/linux.h to /usr/include/pgsql/os.h

Oh, I also had to tweak some of the Makefiles at some point, so the include 
directory becomes pgsql instead of postgresql.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Success in installing ZPoPyDA (after 3 months...)

2000-08-31 Thread Hung Jung Lu

Good news. I finally succeeded in installing ZPoPyDA (PostgreSQL database 
adapter for Zope.) I think it was more than 3 months ago when I started to 
try to install ZPoPyDA.

The process involved many tricky steps, the most tricky one was, uh, 
installing a whole new Linux operating system. (Upgrade from 5.2 to 6.2) :)

But sweat and blood were involved in many other little tiny things. 
Including installing PostgreSQL and its dev package RPMs, Python Dev, 
figuring out what was missing in os.h and where to find linux.h for the 
PostgreSQL, version compatibility problems between PoPy and ZPoPyDA, etc. So 
many steps that I don't remember them all, now.

Do I recommend PostgreSQL to other Zope users? Probably yes. But I'd advise 
them to give themselves *plenty* of time to deal with installation issues. I 
know, some have been lucky and did not have any problems. But for me, it's 
been a horrible experience. But I hope the reward of a good (and cheap) 
database will compensate all the bad times.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: HappySession

2000-08-31 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Diego Rodrigo Neufert [EMAIL PROTECTED] wrote:
I'm making a site with frames with session management. I'm using 
HappySession
to do it...
I need to call SESSION['something'] in various frames at the same time, but
when a SESSION expire I got a Transaction Error that blow up my Zserver...

Anyone know how to solve this or another SESSION product that doesnt have 
that
problem?

Arghh! Sorry about that. It made you very unhappy, I guess. :(  Please try 
SQLSession and FSSession.

I'll go dig into the problem. Could you provide a little bit more details? 
Anything will help. (Is your server Unix of Windows based? Have you had more 
then one crash?)

obrigado,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: HappySession

2000-08-31 Thread Hung Jung Lu

My conjecture now is that your error-handling HTML might be accessing 
attributes from Zope server. A more correct way of handling exceptions 
should have been using the dtml-try...dtml-except.../dtml-try block. 
But I kind of make a cheat sheet recipe recommendation, tweaking the 
standard_error_message, which was not a good idea. When Zope arrives to 
standard_error_message, the transaction has been aborted and if your 
session_not_found_html is not simple enough and uses more DTML features, I 
can see that it can cause transaction error.

Can you send me your session_not_found_html? I think this was the problem.

In the future I will remove the standard_error_message trick from the help 
file and instead tell people to use proper exception handling, which is the 
right way of doing things. But it will require people to structure their 
sites more carefully so they can catch the SessionNotFound exception. 
Basically, it is recommended that you have single (or few) index_html on 
your site, and place a dtml-try...dtml-except ../dtml-try block to 
capture all exceptions from Zope and deal with them. It's the right way of 
doing things, it's just that many people tend to have many index_html and it 
will make their site harder to catch exceptions and deal with them in a 
centralized way.

In short, HappySession itself is probably not the cause of the transaction 
error. The problem probably comes from bad exception handling. If you want 
to use the standard_error_message trick, then please use a simple html page 
for session_not_found_html without additional Zope features. If I find out 
more, I'll let you know.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] FSSession problems...

2000-08-30 Thread Hung Jung Lu

Curtis,

Could you describe how often does the problem happen? How many session users 
goes to the site? You mentioned about a month of public usage. During that 
month, did you have one single incident? How many sessions happened during 
that month?

All key-based session management systems are intrinsically unsafe, since 
other people can tap into your session, with non-zero probability, if the 
key-length is finite. The only hope is to make the key long enough, so even 
if the hacker has a supercomputer, it would still take him/her the age of 
the universe to crack into your website. One thing I mentioned to Pavlos 
(and/or Anthony Baxter?) before is that the key lengths of their cookies are 
a bit too short. For my HappySession product (another session management 
product, which is RAM based), I cranked up the key length to 128 
alphanumeric char key, exactly because I wanted no key collision for a long 
long time. :)

Another thing I observed during the development of HappySession was that on 
Linux (and Debian) server systems, I had problem with deleting the cookies 
of the clients. (No problem with NT server.) At the end, I chose not to 
delete cookies but instead setting their values to blank, when the session 
expires. It was a weird problem, I did not know why I couldn't delete client 
cookies (maybe it was a mistake on my part), but I chose the simple way out 
by setting the cookie to blank. And it worked fine. So instead of detecting 
the presence of the cookie alone, I detected the presence AND whether the 
cookie was blank.

regards,

Hung Jung

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Apache: mod_perl, mod_rewrite, prefix

2000-08-30 Thread Hung Jung Lu

(1) I have mod_rewrite statically
(2) I have mod_perl statically
(3) prefix is /usr/mydir

Okie, I figured it out. So I'll reply to myself. :) By the way, I am on 
Linux platform.

So the appropriate commands are

(1) Download latest apache and mod_perl. Unzip and untar them.
(2) Place the untarred mod_perl-1.24 into your apache_1.3.12 folder.
(3) cd into the mod_perl-1.24 folder.
(4) perl Makefile.PL \
USE_APACI=1 \
APACI_ARGS='--enable-module=rewrite' \
APACHE_PREFIX=/usr/mydir
(5) make
(6) make install (this will install the the httpd executable but not 
override the existing httpd.conf file. If you want to play safe, make a 
backup of the httpd executable before installing the new one.)

C'est tout!

Hung Jung
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Apache: mod_perl, mod_rewrite, prefix

2000-08-30 Thread Hung Jung Lu

Hi,

Although this is more an Apache question, I would guess that a lot of Zope 
users have gone through exactly the same problem I am going through, so I 
might as well try it out here.

As you can probably tell, I am trying to hook up Zope and Apache via PCGI. 
The thing is, I need also mod_perl, and my Apache root prefix is 
non-standard (not /usr/local/apache). I want to build Apache from source 
such that

(1) I have mod_rewrite statically
(2) I have mod_perl statically
(3) prefix is /usr/mydir

Now, those are three requirements, and things got too complicated. I  know 
how to do (1) and (2) together, I know how to do (1) and (3) together, but I 
still fail to do (1)(2)(3) all together. Anyone cares to share their 
experience? I want a final httpd executable, so that I can simply copy and 
replace my current copy of apache.

I have read:

  http://perl.apache.org/guide/install.html

but I am still a bit confused.

Thanks,

Hung Jung

PS- I think mod_perl is an example of big failure when it comes to 
installation, since it tries to control and override the apache installation 
process. What a mess! In comparison Zope product installations are as easy 
as drag and drop.
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] _setBasesHoldOnToYourButts()

2000-08-20 Thread Hung Jung Lu

Hi,

Can any hardcore Zope developer explain to me what this wonderful little 
method does? Please? Even if it is just pure voodoo.

(I am looking for any voodoo magic that allows me to change a Z Object's 
ZClass dynamically. You heard me right: after an instance of Z Object is 
created, I want to change its ZClass from ZClassA to ZClassB. It's voodoo 
all right, but heck, voodoo is magic.)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Changing a Z object's __class__ dynamically

2000-08-19 Thread Hung Jung Lu

Hi,

One powerful feature of Python is the ease of reloading modules. This makes 
debugging extremely nice, since you can modify the code, reload the module, 
and all this while the main program is still running.

Moreover, if a particular instance object has been created, you can actually 
edit the object's class code, reload the module, and change the class of the 
object to the modified class. Something like:

my_module = sys.modules['module_name']
reload(my_module)
my_new_class = my_module.my_class
my_instance.__class__ = my_new_class

This works all very nicely in pure Python. But not in Zope. When the object 
is a Zope object, somehow the last statement does not seem to do anything. 
That is, the object's class is not updated.

I don't know what exactly is going on. My conjectures are: (1) Digicool 
people have re-written Python's system function setattr(), so that when it 
is an Z Object, the __class__ cannot be changed. (2) Caching: when I change 
the class of a Z Object, somehow it does not reflected in the Z Object's 
memory-cached version.

At any rate, this is really surprising. Since usually when you do:

x = 3
print x

you would expect the result to be 3. But with a Z object's __class__, you 
can assign it to something, and then nothing happens. That is:

x.__class__ = new_class
print x.__class__

and it will print the old class, not the new class.

Does anyone know what I can do to change the class of a Z object 
dynamically? This will make the development of Zope products a lot easier. 
(Of course, all these reloading features are extremely dangerous, so it's 
best to use them only for development and strip them from the code at the 
end.)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZPoPyDA installation: help needed

2000-08-09 Thread Hung Jung Lu

you stumbled across a tiny problem there :-)

Danke. The problem does not seem so tiny, after all. :-)

postgres SQL database server itself as well as you are not running a libc6 
but
mereley a libc5 system ?

Correct. RedHat Linux 5.2.

try this:
rpm -qf /lib/libc.so*

glibc-2.0.7-29

Old enough to be a fossil, eh? :)

Check out http://rpmfind.net and go to the rpm database and then to

Will do.

PS: ever though about upgrading your installation ? You might get benefits 
(and
lots of work) by doing this.

Leider die ist nicht meine Maschine... too bad.

-

This is not the first time I install some software, then find out that I 
need to install something else first, and then find out that to install that 
"something else", I need to install some other thing first, and to install 
that "some other thing", I only need to install a whole new Operating 
System. :)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZPoPyDA installation: help needed

2000-08-08 Thread Hung Jung Lu

Hi,

I have been trying to install ZPoPyDA (database adapter for PostGreSQL.) And 
I am kind of stuck.

I was told to install the RedHat PostGreSQL development RPM first. But I 
can't even install this RPM. I must be missing something obvious.

# rpm --install postgresql-devel-7.0.2-2.i386.rpm
failed dependencies:
postgresql = 7.0.2 is needed by postgresql-devel-7.0.2-2
libc.so.6(GLIBC_2.0) is needed by postgresql-devel-7.0.2-2
libc.so.6(GLIBC_2.1) is needed by postgresql-devel-7.0.2-2

what is the libc.so shared object? Is it part of standard C library? Is it 
part of Red Hat Linux? Where can I find/get it? Do I need to set any 
particular path? Do I need to modify the /etc/ld.so.conf file?

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] When does Zope become single-threaded?

2000-07-01 Thread Hung Jung Lu

Hi,

I seem to remember that in the old days, if one uses Zope with PCGI, it 
would only run single-threaded. Is the correct? Or is Zope now always 
multi-threaded?

(I know one can control the number of threads via the -t option in the start 
script.)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] Kid clicking and Zope thread deadlock

2000-06-30 Thread Hung Jung Lu

From: Brian Lloyd [EMAIL PROTECTED]
The quick way to determine this: install a fresh Zope without
SybaseDA installed and see if you can reproduce the kid-clicking
behavior.

Another thing potentially to look at: there is problem with
Sybase connections that I have run into before where if you
have a request that runs a transactional query, then a non-
transactional query, then trys another transactional query
you get a hang :(  I don't know if this could be the case
here, but if so you might want to look here for more info:

http://classic.zope.org:8080/Collector/1059/view

Thank you very much! My preliminary test indicates that indeed the deadlock 
is coming from the Sybase database adapter. Zope alone seems to be doing 
fine (what a relief!), even under intense bombardment of http form requests.

I'll have more about Sybase deadlocking later, as I try to isolate the 
problem. I think the problem is not only with transaction-non_transaction 
interaction. The problem happens even after I connect all the Zope threads 
to Sybase, and use transactions for all threads afterwards.

regards,

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Multiple clicks: how to handle them?

2000-06-30 Thread Hung Jung Lu

Hi,

This must be a well-known problem: you click multiple times on a form 
button, and multiple requests are send to the server. On many websites they 
ask you not to click on the "confirm purchase" button twice, because 
otherwise you'll be charged twice.

Of course, browsers are to blame for this fault. I can't believe Internet 
Explorer and Netscape are both faulty at this (on Windows platform), but 
that's the sad reality. (What the heck where these programmers thinking when 
they made the form requests non-blocking?!!)

Anyway, how can one handle the problem from the server side? Session 
management is an obvious candidate. Every time you receive a request, you 
set a busy flag, and dump all the following requests, until the first 
request is properly finished. But this has two problems:

(1) You'll see on your browser the response to your last request, not to 
your first request.

(2) If you use RESPONSE.redirect(), your session is locked up.

Of course I can go down into the transaction manager level of Zope and do 
things from there.

But I'd like to know how other people handle the multiple click problem. Is 
there any easy way out?!

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Using Java-Script with DTML

2000-06-29 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Thomas Weholt [EMAIL PROTECTED] wrote:
script language="javascript1.2

function ShowStuff(params){

   var text = "dtml-in expr="sqlMethod(some_id=params" !-- this does
not work, of course. How I can I pass argument thru Javascript to the
sqlMethod ?? ---
   alert (text);
}

/script

I think I know what you are talking about. But you have to really
keep your mind straight about one thing: DTML runs with the CPU
on the server side, JavaScript runs with the CPU on the client side.
In other words, by the time you are running Javascript, you
CAN'T access your database records.

I have done a lot of things in displaying dynamic pull-down menus.
E.g: you choose a state from one pull down menu, and the content
of another pulldown menu is automatically changed to the list of
cities within that particular state. When you click on a state,
you CAN'T query your database for the list of its cities. It's
too late, your code is already running on the client side. So
what should you do? What you should do is to pre-generate
JavaScript arrays, storing the names of all the cities for all
the states.

That being said, there is one more caveat. When you pre-render
your database records into JavaScript arrays, you have to be
careful about quoting. I don't know whether there are any string
format quoting in DTML suitable for rendering into JavaScript
(the dtml-sqltest ... type=string comes to mind, but I am not
sure it works outside ZSQL methods), I ended up implementing my
own external method to quote Python strings into JavaScript strings.

If you still don't understand what I mean, consider a python string

'He said, "no".'

stored in your DTML variable mystring, that is, something like:

dtml-call "REQUEST.set('mystring', 'He said, "no".')"

and you pre-render it into JavaScript code

x = "dtml-var mystring";

It won't work. Because if you look at the source of your JavaScript,
you will see:

x = "He said, "no".";

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope] HappySession-0.1.1 available

2000-06-26 Thread Hung Jung Lu

This release fixes a problem with erasing cookie of expired sessions on the 
Linux platform. Thanks to Felipe Alvarez for pointing out the problem to me.
HappySession is an easy-to-use RAM-based session management product. It can 
be found at:

http://www.zope.org/Members/hungjunglu/Products/HappySession/a


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: HappySession-0.1.1 available

2000-06-26 Thread Hung Jung Lu

Sorry, the URL should be:

http://www.zope.org/Members/hungjunglu/Products/HappySession


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: brain hurts regarding dynamic fcn args in Python

2000-06-19 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], [EMAIL PROTECTED] ("Jeff Sasmor") wrote:
dtml-in
"Catalog.searchResults(meta_type='EventDoc',event_date=[first,last],event_date_usage='range:min:max',sort_on='event_date
')"
   

Now if the 'moderated' property is active I want to add the keyword arg

reviewed='on'

to the arg list at the time that the searchResults method is invoked.

Hmm... I have had to do something similar recently. But I did not use 
dynamical argument list. If your choices are simple enough, you could do:

--

dtml-if "moderated == 'active'"

dtml-in 
"Catalog.searchResults(meta_type='EventDoc',event_date=[first,last],event_date_usage='range:min:max',review='on',sort_on='event_date
')"
  dtml-var shared_dtml
dtml-in

dtml-else

dtml-in 
"Catalog.searchResults(meta_type='EventDoc',event_date=[first,last],event_date_usage='range:min:max',sort_on='event_date
')"
  dtml-var shared_dtml
dtml-in

/dtml-if

--

Yes, the shared_dtml will still have full access to all the "sequence-item" 
type of variables.

If you have to check more than a few properties, then the above construction 
might not be so good.

If you can always pass a value to a keyword argument, then it's best to use 
an aux variable and preset the value of the argument.

dtml-if "moderated == 'active'"
  dtml-call "REQUEST.set('review', 'on')"
dtml-else
  dtml-call "REQUEST.set('review', 'off')"
/dtml-if

dtml-in 
"Catalog.searchResults(meta_type='EventDoc',event_date=[first,last],event_date_usage='range:min:max',review=review,sort_on='event_date
')"
...
/dtml-in

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] SQL security at row level

2000-06-19 Thread Hung Jung Lu

Hi,

This is a general question.

One can protect the ZSQL methods by employing user folders. This offers 
table-level protection.

But what about protecting database information at row level? (This can come 
from hackers tweaking form variables.)

Currently I store some security information (like the owner of row, among 
other things) on all rows on all tables. When retrieving records from tables 
(in particular, for "select" and "update" methods), I'd like to verify that 
the current user indeed has the privilege for accessing a particular row. I 
know at least two ways for checking this information. (Notice that we may 
have complicated situations where not only the owner can have access... we 
may have group privileges, superuser user privileges, etc. Also, I have a 
few hundreds ZSQL statements, so it's not a small question.)

(1) Pre-generate the allowed owner ids, so "select" statements can only 
select rows with given owner ids... I could put something like: (keeping in 
mind superusers, team-members, supervisers, etc.)

  where dtml-sqltest owner_id column=owner_id type=int
  or dtml-sqltest additional_id1 column=owner_id type=int
  or dtml-sqltest additional_id2 column=owner_id type=int
  .

(2) Use a wrapper for ZSQL methods, and raise an exception when unauthorized 
rows are retrieved.

I guess row-level protection is a very common issue, so I would like to know 
what other strategies are used. I would appreciate description of actual 
implementations.

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: From where does nothing spring from?

2000-06-17 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Graham Chiu [EMAIL PROTECTED] wrote:
dtml-var "REQUEST.set('error',f_Email.isNotEmail(f_Email,_))"

This mistake happens all the time. :) Instead of "var", use "call".

  dtml-call "REQUEST.set('error',f_Email.isNotEmail(f_Email,_))"
  dtml-var "REQUEST.error"

(I think you face is red, now. ha! OK, I maybe wrong.)

---

If this is not the source of the problem, please provide also the function 
argument list. It's kind of hard to read the function without seeing the 
function header.

regards,

Hung Jung

(Thanks for encouraging me to make HappySession into a product!)




Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: programatically generating images

2000-06-17 Thread Hung Jung Lu

Grüß Dich,

There are many freeware utilities out there for generating images 
on-the-fly. I don't know about Zope products, but I guess it's better for 
you anyway to handle the details by hand.

Check out these links. (I saved them recently from the Python list... 
haven't tried them myself, yet.)

http://www.fred.net/brv/chart/
http://piddle.sourceforge.net/
http://www.object-craft.com.au/paint_doc.html
http://www.object-craft.com.au/paint.tar.gz
http://www.manning.com/Grayson/chapt11.pdf

Alles Gute,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope-dev] Getting SessionUID from FSSession

2000-06-16 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], "Jeff Nielsen" [EMAIL PROTECTED] wrote:
How can I gather the current SessionUID from FSSession? From the docs, I
gather that

dtml-var "FSSession['SessionUID']"

should return the SessionUID, but it always returns "None". Can anyone clue
me in?

Try:

  dtml-var "FSSession.getName()"

regards,

Hung Jung

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope] Re: get fssession value

2000-06-16 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], "Richard Bartels" [EMAIL PROTECTED] wrote:
dtml-call "FSSession['username'].update(REQUEST.form)"
... I get {'username':'something'}

Try:

  dtml-call "FSSession.update(REQUEST.form)"

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Difference between dtml-myvar; and dtml-var myvar

2000-06-15 Thread Hung Jung Lu

This has been something that I've never been very careful about. Until I got 
bitten in generating a JavaScript.

What is the difference between

  dtml-var myvar

and

  dtml-myvar;

?

I have noticed some differences before, but I don't remember the details, 
now. I guess one of them mangles the result so it can be looked at in a 
browser (properly HTML quoted?)

  dtml-call "REQUEST.set('myvar', '')"
  dtml-var myvarbr
  dtml-myvar;br

Visually they look the same, but if I looked at the source:

  br
  amp;br

Is the a technical term (e.g: "rendering", "HTML-quoting", etc.) that 
describes the difference in the output?

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Difference between dtml-myvar; and dtml-var myvar

2000-06-15 Thread Hung Jung Lu

From: [EMAIL PROTECTED]
From the Using the DTML entity syntax How-To
(http://www.zope.org/Members/AlexR/EntitySyntax) :

Very very cool. Thanks a lot!

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: user contributions to Zope.org (Mangled text)

2000-06-13 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Stephen Harrison [EMAIL PROTECTED] wrote:
Joe Hewitt wrote:
  http://marc.theaimsgroup.com/
...
http://zope.nipltd.com/public/lists.html

Very cool.

Would it be possible for NIP to include a reply feature like in Egroups?

I tell you how I operate with the newsgroups. Which might be common to a lot 
of people.

(1) I browse on Egroups. I don't want to receive thousands of messages 
directly from mailing lists.

(2) When I feel like I want to post some thing, I use my e-mail account.

(3) I use Egroups so I can generate a reply-quoted message (lines starting 
with the  symbol), I cut and paste to my e-mail account, I send off the 
message.

Egroups is pretty good at that. The part that is slowing me down is the 
e-mail address mangling.

If NIP can offer a reply-quoted-message, that'll be great. If it can offer 
membership so I can browse and reply from NIP directly, that'll be even 
better. :) Nowadays, for posting messages to the Zope list, I have to have 3 
browser windows open: I simultaneously access Egroups, Zope.org and my 
Hotmail accounts. Not an easy life. But that's still a heck lot better than 
receiving 1000 messages per day from all the lists that I frequent. :) If 
NIP can help me to bring down the number of browsers windows to 2, or 1, 
that'll be really nice. :)

For now, I still have to rely on Egroups to generate the reply-quoted 
message. I guess I'll use it in combination with NIP or the AIMS group. I 
hate the black background color of AIMS group, by the way. :)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: FSSession newbie problem

2000-06-12 Thread Hung Jung Lu

From: Marcello Lupo [EMAIL PROTECTED]
Have some ideas to let the browser pass the cookie in a right way?
I think we can work on the PATH but i don't know how.

Okie, you have a cookie problem.

You should definitely solve your cookie problem, if you can. But you can 
also use cookie-less sessions by tweaking the URL: you can append SessionUID 
form variable for all your links, and also use hidden fields for all your 
FORM requests.

FSSession and SQLSession both come with URL-modifier feature. For FSSession, 
instead of a link like:

  a href="dtml-var my_url" ...

you would use

  a href="dtml-var "FSSession.url(my_url)"" ...

And for forms, you have to remember to place a hidden field:

  form ...
  input type=hidden name="SessionUID" value="dtml-var 
"FSSession.getName()""
  ...
  /form

regards,

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: FSSession newbie problem

2000-06-09 Thread Hung Jung Lu

From: Pavlos Christoforou [EMAIL PROTECTED]
On Fri, 9 Jun 2000, Marcello Lupo wrote:
  1) Is necessary to call FSSession in every document of the site Yes it 
is neccessary beacuse HTTP is stateless. It will only start a new
session if FSSession cannot find a valid UID either through a cookie or a
FORM or as part of te URL

Pavlos: this is the part that is confusing to newbies. FSSession can be made 
in such a way that this initial call can be avoided. HappySession works that 
way: no need for explicit initialization. Matter of fact, in the very first 
call to the HappySession (any dictionary method), it does the initialization 
itself behind the scene. FSSession can do the same thing.

It's a minor detail, but anything to make a newbie's life easier is worth 
it. :)

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: user contributions to Zope.org (Mangled text)

2000-06-09 Thread Hung Jung Lu

Not to be picky, Ken, but since you are from Digicool... could you take a 
look at your own message at:

http://www.egroups.com/message/zope/33350?start=33322

(I checked both IE and Netscape, from PC.)

Lately there have been quite a few mangled messages at egroups. Could you 
find out what went wrong and let people know how to prevent this kind of 
mangling? I have heard people saying repeatedly that please do not use 
HTML-format e-mail messages, did you use HTML format? Or is it related to a 
particular mail software that you use?

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: SQLSession and lexical token problems

2000-06-08 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Jason Lee [EMAIL PROTECTED] wrote:
I'm trying to use SQLSession, and not having much luck.

The other two choices are FSSession and HappySession. FSSession is 
File-System-based. HappySession is RAM-based.

HappySession is very easy to install and use. You don't need to worry about 
setting up database tables or file folder, you don't need to worry about 
cleaning up old session data, and you don't need to worry about initializing 
the session object in each REQUEST. If you (1) don't need to store the 
session data forever, (2) are willing to use cookie, (3) don't store 
gigantic session data, then you may consider using HappySession.

http://www.zope.org/Members/hungjunglu/Products/HappySession

regards,

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: FSSession newbie problem

2000-06-08 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Marcello Lupo [EMAIL PROTECTED] wrote:
and macically i obtain the same error.
this is the code i used:
dtml-call FSSession
dtml-unless "FSSession.has_key('cart')"
dtml-call "FSSession.set('cart',{})"
/dtml-unless

dtml-call "FSSession['carrello'].update(REQUEST.form)"

I have tried your code with 'cart' everywhere, and it worked just fine. Can 
you print out the form variables?  Are all the statements inside the same 
DTML file? It really works fine. Also, make sure that FSSession is in a 
parent folder of your DTML method. (Root folder is usually a good idea.) Is 
your machine cookie-enabled?


dtml-var standard_html_header
dtml-call FSSession
dtml-unless "FSSession.has_key('cart')"
  dtml-call "FSSession.set('cart',{})"
/dtml-unless
dtml-call "FSSession['cart'].update(REQUEST.form)"
dtml-var "FSSession['cart']"
dtml-var standard_html_footer


If you still have problems, you can try SQLSession or HappySession. For 
beginners I would recommend HappySession so you don't need to worry about 
the details of FSSession or SQLSession.

Download HappySession from
http://www.zope.org/Members/hungjunglu/Products/HappySession

Add an HappySession instance in your Zope hierarchy. Then try:


dtml-var standard_html_header
dtml-unless "SESSION.has_key('cart')"
  dtml-call "SESSION.set('cart',{})"
/dtml-unless
dtml-call "SESSION['cart'].update(REQUEST.form)"
dtml-var "SESSION['cart']"
dtml-var standard_html_footer


regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] www.zope.org cataloging server problem?

2000-06-07 Thread Hung Jung Lu


I have been trying to catalog a "News Item" and a "Product Release" inside 
www.zope.org, but I get the error

===
System Unavailable
This site is currently experiencing technical difficulties. Please contact 
the site administrator for more information. For additional technical 
information, please refer to the HTML source for this page. Thank you for 
your patience.


Error type:  NameError
Error value: getRoles
==
  H2Zope Error/H2
  PZope has encountered an error while publishing this resource.
  /P
  PSTRONGInvalid request/STRONG/P

  The parameter, emsubmit/em, was omitted from the request.pMake sure 
to specify all required parameters, and try the request again.
  HR NOSHADE

  ...

!--
Traceback (innermost last):
  File /usr/local/dc/zope-2.1.x/lib/python/ZPublisher/Publish.py, line 214, 
in publish_module
  File /usr/local/dc/zope-2.1.x/lib/python/ZPublisher/Publish.py, line 179, 
in publish
  File /usr/local/dc/zope-2.1.x/lib/python/Zope/__init__.py, line 202, in 
zpublisher_exception_hook
(Object: HappySession)
  File /usr/local/dc/zope-2.1.x/lib/python/ZPublisher/Publish.py, line 165, 
in publish
  File /disks/slab/dc/zope20-update/lib/python/ZPublisher/mapply.py, line 
155, in mapply
(Object: manageCatalog)
  File /usr/local/dc/zope-2.1.x/lib/python/ZPublisher/Publish.py, line 107, 
in missing_name
  File /disks/slab/dc/zope20-update/lib/python/ZPublisher/HTTPResponse.py, 
line 531, in badRequestError
BadRequest: (see above)

--


regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: detail record editing

2000-06-05 Thread Hung Jung Lu

--- In [EMAIL PROTECTED], Robert Del Huerto [EMAIL PROTECTED] wrote:
I can get Zope to generate a table and form like this from an SQL
database.  I'm stuck after that.  The form only has one 'action' so how
would I get it to handle the right function depending on the button that
was pushed?

The short answer is: use JavaScript.

Instead of using input type=submit ..., I use input type=button  I 
guess an example is better than long explanations.

--
center
  form name=my_form method=get
  input type=hidden name=handling_method
  input type=button value="Notes" onclick="go_notes()"
  input type=button value="Edit" onclick="go_edit()"
  /form
/center

script language="JavaScript1.1"
!--//
if (document.images) {

function go_notes() {
// example of a submission without handling method
document.my_form.action = "dtml.url-Notes;" ;
document.my_form.submit();
}

function go_edit() {
// example of a submission with handling method
document.my_form.handling_method.name = "method_edit:method";
document.my_form.action = "dtml.url-Person;" ;
document.my_form.submit();
}

}
// --
/script
--

In the first case (go_notes), your submission is sent to the "Notes" folder 
inside Zope, and it's handled by the conventional index_html method.

In the second case (go_edit), your submission is sent to the "Person" folder 
and it's handled by the "method_edit" method inside the "Person" folder. The 
"method_edit:method" tag in the above code tells Zope that "method_edit" is 
a method. It's a Zope thing, and you won't find it in JavaScript books. I 
find it useful to put my methods that handle a Person inside the Person 
folder, so I can have something like

  method_edit
  method_delete
  method_update
  ...

neatly lined up inside the Person folder. Another trick is, inside these 
handling methods, at the end I do a redirection, something like:

  dtml-call "RESPONSE.redirect(MyNextPage.absolute_url() + '?person_id=%s' 
% my_person_id)"

That is, the handling methods only handle the logical part. For actually 
displaying the result, I use redirection to a displaying page.

Oh, on the dtml.url-...; notation: if you need more complicated URLs, you 
cannot use the "dtml.url-Object;" notation. You have to use "dtml-var 
"MyFolder.MySubFolder.Object.absolute_url()"" notation instead.

Now you know how to make Zope work for you. :)

regards,

Hung Jung




Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] HappySession 0.1.0 released!

2000-06-04 Thread Hung Jung Lu

Hi,

I have been using RAM-based session management for a while, but never wrote 
a product for it. Since Graham Chiu has mentioned it again about making a 
real product, I have taken the time to make one, and called it HappySession. 
:) Well, in short, it uses cookie for session id, you specify a maximum 
session expiration time, and expired session data are automatically deleted. 
It's Zope-transaction-aware.

I got a lot of help from Pavlos Christoforou (author of FSSession, a 
file-system-based session management product.) Thanks a lot, Pavlos!

Give it a try. Let me know whether there is any problem. It's easy to use, 
or at least that's what I have intended. :) It's my very first product, so 
if there are any bad things that I have done, please let me know.

Here is the URL:

http://www.zope.org/Members/hungjunglu/Products

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: [Fwd: Returned mail: Service unavailable]

2000-05-31 Thread Hung Jung Lu

From: Daryl Tester [EMAIL PROTECTED]
...
./configure --prefix=/usr/foo --exec-prefix=/usr/foo
make
make test
make install
...
(or, as Aristotle said, "deprecated, my arse").

Tough! :) Best quote in years. Yes, I did not run "make install" in Python, 
culpa mia.

I still haven't been able to install PyGreSQLDA, but it seems that the new 
problem is with the new PostGreSQL 7.0. Anyway, thanks to everyone that have 
helped. I have only one hour daily or so to play with installing PyGreSQLDA. 
When I finally succeed, I'll let people know what's going on.

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Building ZPyGreSQLDA on Linux

2000-05-28 Thread Hung Jung Lu

From: Daryl Tester [EMAIL PROTECTED]
  Let me try again, does any of you guys have a "config" subfolder inside 
your
  /usr/lib/python1.5/ folder?

Yes.  For the record (RedHat 6.1):

[dt@nipnyep dt]$ ls /usr/lib/python1.5/config/
MakefileSetup.local   config.c.in makesetup
Makefile.pre.in  Setup.thread  install-sh  python.o
Setup   config.c  libpython1.5.a

Thanks a lot, I am inching in day-by-day. :) Your directory structure is 
really illuminating. You've been very helpful. You'll see why in a second.

Trust me, and please take the time to verify yourself, and let me repeat 
once and for all: the "config" subfolder is a deprecated feature in Python. 
It's gone. Bye bye to "config". It no longer exists in Python distribution 
1.5.2.

My Python folder shows the following: (this is from the latest source 
install of Python... downloaded yesterday from www.python.org)


[hjlu@www src]$ ls /u/c2/hjlu/Python-1.5.2/
BeOSMakefile.in Parser  config.cacheconfigure.in
DemoMiscPython  config.h
getbuildinfo.o
Grammar Modules README  config.h.in install-sh
Include Objects Tools   config.log  
libpython1.5.a
Lib PC  acconfig.h  config.status   pg.py
MakefilePCbuild buildno configure   python


As you can see, a lot of your files that  used to be inside the "config" 
subfolder are nowadays at the root of the Python installation directory. The 
"makesetup" file is nowadays inside the "Modules" subfolder.

It seems to me that Python installation has changed substantially from 1.5 
to 1.5.2. So, in short, those of you that are running ZPyGreSQLDA are a very 
limited lucky bunch of people that are still using Python 1.5 instead of 
1.5.2. :) In other words, ZPyGreSQLDA simply doesn't work out-of-the-box 
with Python 1.5.2.

After tweaking the Makefile.pre.in, I have been able to go a few more steps 
in the makefile process. It still has error, but I'll solve one error at a 
day, ha. :)

Regards and thanks again to all who have helped. I'll post a summary on how 
to install ZPyGreSQLDA with Python 1.5.2, if I succeed to. :)

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Building ZPyGreSQLDA on Linux

2000-05-27 Thread Hung Jung Lu

Let me try again, does any of you guys have a "config" subfolder inside your 
/usr/lib/python1.5/ folder? I guess the "config" subfolder maybe an feature 
from the old python1.5, because in the new python1.5.2 there is no such a 
folder.

Also, in an error like:

make[1]: *** No rule to make target `/usr/lib/python1.5/config/Makefile', 
needed
by `sedscript'.  Stop.

Is it complaining that the config/Makefile cannot be made? Or is it 
complainig that the Makefile cannot be found? It the Makefile a target or a 
source in this particular case? That is, is the "config" folder to be 
generated, or is it supposed to be there from a start?

I guess RedHat Python RPMs set up folder structures very differently from 
the plain source files build of Python. I am using the source file build of 
Python and there is no "config" folders anywhere.

Contacted the author of ZPyGreSQLDA but so far no response...

Hung Jung

From: "Hung Jung Lu" [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Subject: Re: [Zope] Building ZPyGreSQLDA on Linux
Date: Fri, 26 May 2000 22:38:41 PDT

From: "Cary O'Brien" [EMAIL PROTECTED]
Ok, the build procedure can't find the Makefile supplied
by the standard python install (the python-development package
if you are installing via RPMS).  It looks as if you
have python installed in /u/c2/hjlu/lwc_zope... rather than
/usr/local/... or something like that.  Either the Makefile
is missing, or the build procedure is looking in the wrong
place.

Does any of you know where to obtain the Python-dev files? I searched all 
over www.python.org but could not find anything on Python-dev. I am not 
using RPMs, I just download source directly from www.python.org.

regards,

Hung Jung



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Building ZPyGreSQLDA on Linux

2000-05-26 Thread Hung Jung Lu

Hi,

I need help building the PostGreSQL database adapter on Linux.

Sigh... why is installing everything on Linux such a nightmare? ZPyGreSQLDA 
installation is in such a primitive stage... I don't understand... it's like 
it's written to work with one very particular directory structure at the 
author's machine, and the heck with the rest of the world. :) Why not just 
write something to build the C Python module in place and then tell the user 
to move the compile C Python module (.so) to whereever it needs to be moved?

The problem now is that the ZPyGreSQLDA/Makefile.pre.in has all kinds of 
settings of folder structures that don't match with my folder structure.

I get the following error: (yes yes, I have played with PATH and the 
prefix variable mentioned inside Makefile.pre.in... and by the way, the 
FTP site ftp://www.eevolute.com/pub/python/ mentioned in README.linux no 
longer exists.)

--
[hjlu@www src]$ make -f Makefile.pre.in boot
rm -f *.o *~
rm -f *.a tags TAGS config.c Makefile.pre python sedscript
rm -f *.so *.sl so_locations
VERSION=`python -c "import sys; print sys.version[:3]"`; \
installdir=`python -c "import sys; print sys.prefix"`; \
exec_installdir=`python -c "import sys; print sys.exec_prefix"`; \
make -f ./Makefile.pre.in VPATH=. srcdir=. \
VERSION=$VERSION \
installdir=$installdir \
exec_installdir=$exec_installdir \
Makefile
make[1]: Entering directory 
`/u/c2/hjlu/lwc_zope_current/lib/python/Products/ZPy
GreSQLDA/src'
make[1]: *** No rule to make target 
`/u/c2/hjlu/lwc_zope/lib/python1.5/config/Ma
kefile', needed by `sedscript'.  Stop.
make[1]: Leaving directory 
`/u/c2/hjlu/lwc_zope_current/lib/python/Products/ZPyG
reSQLDA/src'
make: *** [boot] Error 2

-

Not that I like to complain, but every time I run into a trouble, dozens 
more people will run into the same problem. I still remember when I 
complained about some other database adapter, someone popped up and said "I 
have been running it with ZERO problem"... and 3 months later the same 
person was screaming about the very database adapter that that supposingly 
had "ZERO problem".

Things do improve. I remember the days when Python couldn't be installed 
easily, but nowadays even the Tcl/Tk part of Python has been absorbed into a 
single installer on Windows system. And it's as trivial as 
one-click-does-it-all. PostGreSQL has been around for a while, now. And I 
guess we all could do a little bit more towards making the installation of 
the adapter easier.

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] SQLSession and Memory leak

2000-05-26 Thread Hung Jung Lu

Hi,

This is just for people's information on my own experience in Zope memory 
leak. It may not reflect your personal case. But if it does, please post a 
note to the mailing list.

When there is a problem, people have to face it. I really dislike the 
attitude of people who just shrug their shoulders. I have seen this all too 
many times. Everytime I go through a problem and posted in to the mailing 
list, there are always people that try to say nonsense and refuse to accept 
that there is a problem. Guess what? Weeks later more and more people suffer 
similar problems.

By now I am very sure that a huge memory leak is coming from SQLSession. 
Remember about one or two months ago I mentioned about memory leak in Zope? 
There were so many die-hard Zope mongers that the very first thing they feel 
is their pride being hurt, and instead of looking at possible sources of the 
problem, their attitude was: it can't be, you must be doing something wrong, 
Zope has no memory leak. Now, does that attitude help to find the source of 
the problem???! Perl mongers are bad enough, and now we have Zope mongers.

The thing is, no one would complain about memory leak if there is no 
performance impact. When someone complains about memory leak, it's because 
the performance is getting to be unbearable.

After using SQLSession with two different databases (Gadfly and Sybase), and 
after the problem persisted, and after using manage_debug in Control Panel, 
I have decided that enough is enough. I implemented my own RAM-based Session 
Management.

And it's been about a month now. No more memory leak. Zope memory usage 
stayed nice and low. Performance improved substantially to the amazement of 
everyone. No more need to re-start Zope to bring the memory down.

There are hundreds of people out there using SQLSession. I know for fact 
that someone using SQLSession has actually written a Unix cron job to 
restart Zope every night in order to keep the memory usage down. (Of course, 
the person does not know the memory leak is coming from SQLSession.)

From the manage_debug screen, it seems that the leak has something to do 
with the SQLSession inheriting from Implicit class. I don't remember much 
anymore (since I got rid of SQLSession already a while ago.) I just remember 
the keyword "Implicit" showing up in the objects in the manage_debug screen.

All I know is that after I stop using SQLSession (mainly with Gadfly, which 
was a temporary solution anyway), my problems stopped.

regards,

Hung Jung


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )