Re: [AOLSERVER] Fwd: AOL Listserv to be Discontinued

2011-10-26 Thread Brett Schwarz
SF sounds ok to me

On Oct 26, 2011, at 6:43 AM, Dossy Shiobara do...@panoptic.com wrote:

 Hi,
 
 There has been little discussion or response to this matter, and the few
 responses have all been in favor of moving the lists to SourceForge.
 
 Today is the 26th, so I'd like to do the list move sometime tonight or
 tomorrow.  Consider this the last call for comments or objections.
 
 Thanks again, everyone,
 
 Dossy
 
 
 On 10/19/11 8:25 AM, Dossy Shiobara wrote:
 Everyone,
 
 It appears that AOL is going to be shutting own its LISTSERV, which
 includes several AOLserver mailing lists.
 
 Since there's still activity on this mailing list, I think it would be
 worth moving to a new list.  SourceForge offers GNU Mailman lists as
 part of its project hosting offering.
 
 Does anyone have a strong preference as to where to relocate the lists?
 Any good reasons why they shouldn't move to SourceForge?
 
 I'd like to try and wrap up discussion around this by Wednesday, October
 26th, to give us time to actually perform the relocation of the list, if
 possible.
 
 Thanks,
 
 Dossy Shiobara
 
 
  Original Message 
 Subject:AOL Listserv to be Discontinued
 Date:Tue, 18 Oct 2011 00:59:58 +
 From:AOL Listserv Service aol.listserv.serv...@teamaol.com
 To:AOL Listserv Service aol.listserv.serv...@teamaol.com
 
 
 
 Dear AOL Listserv Administrator,
 
 
 You are receiving this email because you have been listed as the
 administration for one or more lists hosted by AOL’s listserv service.
 We would like to inform you that AOL will be discontinuing the listserv
 service on November 1^st , 2011.  If your list is still actively used,
 please make arrangements to find another service prior to the shutdown
 date and notify your list members of the transition details.  If you are
 no longer actively using this service then no other action is required.
 
 
 
 If you have any questions, please contact
 aol.listserv.serv...@teamaol.com. Thank you.
 
 
 
 -- 
 Dossy Shiobara |  He realized the fastest way to change
 do...@panoptic.com |   is to laugh at your own folly -- then you
 http://panoptic.com/   |   can let go and quickly move on. (p. 70) 
  * WordPress * jQuery * MySQL * Security * Business Continuity *
 
 
 --
 AOLserver - http://www.aolserver.com/
 
 To Remove yourself from this list, simply send an email to 
 lists...@listserv.aol.com with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
 field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
lists...@listserv.aol.com with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] recent updates

2011-10-19 Thread Brett Schwarz
Hey Jeff,

I'm about to start using aolserver for the first time in many, many years, so 
your post is very encouraging, and the changes look good. Your exposed the 
gzip flag to tcl scripts (ns_conn gzip) item reminded me that I believe I had 
promised some code a while back on that...and I forgot to upload it...my 
apologies to those expecting it.

I'll grab the latest and greatest from SF and start messing around with your 
changes. Is SF the main repo for aolserver? What about the modules 
(specifically nspostgres)?

RE: TclX...can't that be loaded as an extension, so that those who still need 
it can load it?

Thanks for your effort.
     --brett



From: Jeff Rogers dv...@diphi.com
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, October 18, 2011 10:45 PM
Subject: [AOLSERVER] recent updates

Hey all, me again.

For those of you who don't monitor the commits list I wanted to share a few 
changes I've recently made as well as a few I'm still thinking about.

- implemented native decoding of strings in ns_returnfile.  This allows 
filenames that are not utf-8 to be passed, similar to tcl core functions.

- committed a long-outstanding patch to address a fastpath caching bug where 
incorrect file content could be delivered in a system when inodes are rapidly 
being reused.  Added a new config option cacheminage to control this behavior.

- implemented a suggestion to re-run pre-auth and post-auth filters on internal 
redirects.  As this could break assumptions in unusual situations, there is a 
config option filterredirect to disable it. Among other things, this 
addresses an issue in openacs that made it complicated to handle 404 errors.  
Also fixed a server crash when there is an error in the configured error page.

- added flags to insert a filter at the beginning of the list of registered 
filters instead of only at the end, and to order filters by priority.

- exposed the gzip flag to tcl scripts (ns_conn gzip)

- added another new filter, pre-write which runs after content has been 
returned but before it has been sent over the network.  To make this useful, 
there is a new method to ns_conn to examine and set the response content that 
is about to be sent.  This could be useful for implementing something like 
apache's mod_pagespeed, which rewrites content to do things like merge 
javascript and css files to reduce external requests, or just strip extraneous 
whitespace from a page.

- added a tuning knob maxaccept to let the driver accept more than one 
connection per spin.  The SF RFE for this referenced a paper that found this 
type of change could improve performance and reduce dropped connections under 
load;  I unfortunately don't have a network capable of simulating enough load 
to stress this so I cannot claim any measured improvement.

I also have a few other ideas I haven't gotten around to adding (or even 
necessarily thinking through completely) yet:

- removing encoding and gzip compression from the normal response writing 
codepath (Ns_ConnFlush) and making them into pre-write filters.

- adding an api to name C-coded filters and handler procs such that they could 
be used by the tcl ns_register_filter/ns_register_proc commands. This could 
eliminate a few special-purpose commands that do this same thing for particular 
operations (ns_register_fastpath and ns_register_filter_shortcut).

- add support for chunked encoding for requests, digest authentication, and 
Expect: 100-continue.  I've heard that these are already supported in 
NaviServer, so this may be a fairly simple cutpaste enhancement.

- replace c-coded versions of many file operations with equivalent tcl-coded 
versions.  Many of these functions (e.g., ns_mkdir, ns_cp) come from before tcl 
had equivalent functionality, but tcl now has that functionality, and it's 
better (native decoding).

- replace ns_share with tcl version built around nsv, if not eliminating it 
entirely.

- remove other really old code like tclx keylist support.  I honestly don't 
know if this is still being used, perhaps it could be kept around in a 
nscompat module along with other things like ns_var and ns_share).  I'm a bit 
reluctant to break compatibility without an easy switch to un-break it.

- make content sending event based, by pushing it back to the driver thread, a 
task thread, or a completely new writer thread, rather than blocking a conn 
thread if the content is big and the network is slow. There is support for 
doing this at the tcl level, but it would be nice to have it implicitly happen 
everywhere.

- let queue-waits be set up from a conn thread and the conn re-queued in the 
driver thread.  This would let you do database operations before making network 
calls and still wait for those calls to complete without tying up conn 
threads.  This would mean a rather esoteric coding style but I think it would 
make for a really powerful mashup engine.

Some of these are pretty disruptive (especially the 

Re: [AOLSERVER] Does not work ns_return + zlib

2010-12-06 Thread Brett Schwarz
 - Original Message 
 From: Jeff Rogers dv...@diphi.com
 To: AOLSERVER@LISTSERV.AOL.COM
 Sent: Mon, December 6, 2010 3:40:47 PM
 Subject: Re: [AOLSERVER] Does not work ns_return + zlib

 Hossein Sharifi wrote:
  One problem is that AOLserver doesn't gzip content when ns_return is 
  called; 
it works for pretty much 

 every scenario except that one.  I don't know why this is the case; we just 
hacked this by recompiling 

 nsd to always gzip regardless of the config file, as long as the client 
supports it (line 161 of connio.c).  It 

 would be nice if this worked correctly by default (or if we figured out the 
proper way to enable its use in 

 ns_return).

 I only skimmed over the code, but it looks like the problem is that the 
 content 
is only gzipped if the NS_CONN_GZIP flag is set on the conn, and the only 
place 
that flag is set is in the adp processor.

 The obvious (I think) improvement is to expose 
Ns_ConnGetGzipFlag/Ns_ConnSetGzipFlag as 

 subcommands of ns_conn, which would let you write a filter to do the 
ancient/broken browser checking 

 or whatever else you needed and turn gzip on or off as needed. (However, 
 doing 
this could impact adp 

 processing, so a corresponding change might need to be made there, lest your 
adp code has a different 

 idea about what should or shouldn't be compressed)

We had a similar discussion about this a couple years ago. See 
http://www.mail-archive.com/aolserver@listserv.aol.com/msg11598.html (although 
the threading is messed up in the mail archive, so you will have to skip 
around).


At the time, if I remember, there wasn't a real consensus, so I made changes in 
my sandbox to mimic the adp compression but for ns_return. If people are 
interested, I can try to dig up the code.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
lists...@listserv.aol.com with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.



  


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
lists...@listserv.aol.com with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Fun, free applications for building personal sites.

2008-05-06 Thread Brett Schwarz
I don't think TclSOAP uses tdom, does it? That might explain any speed problems.

In addition there is Web Services for Tcl: 
http://members.cox.net/~gerald.lester/WebServicesForTcl.html

I have not used it at all, so I can't offer any opinion...however it does look 
like it uses tdom.

- Original Message 
From: Rusty Brooks [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Monday, May 5, 2008 8:04:10 PM
Subject: Re: [AOLSERVER] Fun, free applications for building personal sites.

I've used TclSoap.  I wasn't like, impressed with it's speed but it seems OK.  
It seems quite behind the 
times, though, I did extensive modifications trying to get it to work with 
various WSDL files and in general 
it does not do a complete job, which is kind of frustrating, especially when 
integrating with web services 
that have TONS of data types and commands.  It kind of looked like that WSDL 
implementation just didn't 
progress past a certain point.  I might screw with it some time but at the 
moment I've got the manual soap 
definitions done for the apps I need to support, so, it's not that pressing.

Bas Scheffers wrote:
 On 06/05/2008, at 11:44 AM, Tom Jackson wrote:
 The main thing you need with a mashup is data. Without that, there is 
 nothing
 to mash.
 And much of that data is in XML and tdom runs rings around any Java XML 
 implementation, though not sure about the ones in PHP, Perl, etc which 
 are also likely to be C based. (I am currently profiling and optimizing 
 a car rentals aggregator site, which does tons of XML parsing and 
 creating. Its all in Java and its not pretty; sooo slow and with 
 enormous RAM requirements)
 
 Has anyone used TclSOAP? And compared it in performance to Java SOAP 
 clients?
 
 Bas.
 
 
 -- 
 AOLserver - http://www.aolserver.com/
 
 To Remove yourself from this list, simply send an email to 
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the 
 Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Fun, free applications for building personal sites.

2008-05-06 Thread Brett Schwarz


 - Original Message 
 From: Tom Jackson [EMAIL PROTECTED]
 To: AOLSERVER@LISTSERV.AOL.COM
 Sent: Monday, May 5, 2008 11:46:47 PM
 Subject: Re: [AOLSERVER] Fun, free applications for building personal sites.

 On Monday 05 May 2008 22:58, Brett Schwarz wrote:
  I don't think TclSOAP uses tdom, does it? That might explain any speed
  problems.
 
  In addition there is Web Services for Tcl:
  http://members.cox.net/~gerald.lester/WebServicesForTcl.html
 
  I have not used it at all, so I can't offer any opinion...however it does
  look like it uses tdom.

 Right Web Services for Tcl requires Tcl 8.5 and tclhttpd, it doesn't work with
 AOLserver.

Tcl 8.5 *or* the _dict (source, windows binary) extension for Tcl 8.4_

I can't imagine that it would take too much to make it work with aolserver...in 
fact I believe
the main author of that package is using aolserver now, but I'm not sure if he 
has ported this over to aolserver.


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Fun, free applications for building personal sites.

2008-05-06 Thread Brett Schwarz
  In addition there is Web Services for Tcl:
  http://members.cox.net/~gerald.lester/WebServicesForTcl.html
 
  I have not used it at all, so I can't offer any opinion...however it does
  look like it uses tdom.
 
  Right Web Services for Tcl requires Tcl 8.5 and tclhttpd, it doesn't work 
  with
  AOLserver.
 

 Besides, Web Services for Tcl is based upon the TclOO package by Donal
 K. Fellows which is not (besides other issues) multi-threading/
 AOLServer compatible (no serializer etc.)


huh? Where did you get that it is based on TclOO? TclOO isn't even out yet. And 
where did
you get that TclOO is not compatible with aolserver...just curious (I haven't 
tried it myself within aolserver). It should be thread safe, as far as I'm 
aware (although I don't believe it is fully implemented yet, so you never know).



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_share (was Active participation)

2008-04-17 Thread Brett Schwarz
Just curious...did you have to do anything special to get it working inside 
aolserver?

- Original Message 
From: Jay Rohr [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Wednesday, April 16, 2008 2:17:38 PM
Subject: Re: [AOLSERVER] ns_share (was Active participation)

just FYI

I am using the tsv (from the thread package) functions within aolserver 
and, at least for my uses, it is faster than the nsv equivalents. (and 
it is a namespace :-)) It also has a number of  advantages, I can run 
the same code outside of aolserver, the tsv::lock allows me to run a 
block of code under the shared mutex, and it has a more complete set of 
list functions.

Jay

Jim Davidson wrote:
 Hi,

 Brent Welch wrote some ns_share code which worked with Tcl variable 
 traces to emulate the original code.  It works except for a few edge 
 cases but is generally considered less efficient and flexible than the 
 new nsv_* commands.   So, when I say we gave up on ns_share I mean we 
 stopped applying our patches to the Tcl core for ns_share, allowing us 
 to use the Tcl source un-altered.

 -Jim




 On Apr 14, 2008, at 1:37 PM, Brett Schwarz wrote:

 True -- the original threading in AOLserver 2.0 way back in 1995 (yes,
 1995) was based on a thread-safe hacked Tcl 7.3.  I can't recall where
 I got it -- I think someone at UCB did the work.  We later hacked Tcl
 7.4 and 8.1 on our own before enough support was in the Tcl core and
 we were ready to give up on ns_share which was a significant hack
 that couldn't reasonably be brought forward.

 I was just looking at file.tcl, and it still uses ns_share. Is that 
 ok? Or should that be changed?




  
 
  

 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.  
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


 -- 
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to 
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the 
 Subject: field of your email blank.


 -- 
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to 
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the 
 Subject: field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db and bind variable support

2008-04-16 Thread Brett Schwarz
+1

- Original Message 
From: Dossy Shiobara [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Wednesday, April 16, 2008 7:00:14 PM
Subject: Re: [AOLSERVER] ns_db and bind variable support

On 2008.04.17, Bas Scheffers [EMAIL PROTECTED] wrote:
 That brings me to another subject: do we want prepared statements?

Yes!

In web applications, one of the big performance hits is SQL query parse
time.  The irony is, in web applications, the queries aren't really
dynamic: most can be parsed once, and different bind variable values
used at execution time.

In my local sandbox, where I've been hacking on bind variable support, I
also implemented an [ns_db prepare] which returns an opaque ID to an
entry in a prepared statement cache.  The concept looks like this:

set stmt [ns_db prepare ?-pool $pool | -handle $handle? $sql]
set values [list a 1 b 2 ... z 26]
ns_db exec -statement $stmt $values

Or, something very much like that.  One thought, to avoid having
application code store and save and retrieve the statement handle
between requests was to hash the SQL statement and make the opaque ID
the hash.  The unlikely hash collision issue aside, this could fail
where a prepared statement can't be cached (and there's no way for nsdb
to know this)--so, caching/reuse of prepared statements really should
be left up to the application code, as the developer ought to know when
it can be reused vs. when it should be flushed/re-prepared.

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] aolserver and Pgtcl

2008-04-16 Thread Brett Schwarz
This is how pgtcl actually does bind variables...

- Original Message 
From: Bas Scheffers [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Wednesday, April 16, 2008 4:20:46 PM
Subject: Re: [AOLSERVER] aolserver and Pgtcl

On 17/04/2008, at 8:14 AM, Dossy Shiobara wrote:
 I have wanted to add bind variable support to nsdb for a _long_ time,
 but never got around to computing this support matrix that I describe
 above.
I don't really like bind variables, I would much rather see it  
implemented like:

ns_db select $db select * from people where country = $1 and age   
$2 [list au 25]

The api could even fall back to emulating this when the database  
itself does not support it.

This would be in a database independent way, instead of the current  
way with Postgres and Oracle implementing their own commands.

Bas.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-13 Thread Brett Schwarz
I'll take a stab at it. I already have part of it changed in my sandbox. This 
has escalated further than my original email, so I'll have to take a look 
again, but I'm willing to try. I'll probably need some help on some things, but 
I most likely will be able to do most of the work...

- Original Message 
From: Dossy Shiobara [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Sunday, April 13, 2008 9:46:51 AM
Subject: Re: [AOLSERVER] Compression

On 2008.04.13, Jade Rubick [EMAIL PROTECTED] wrote:
 Is anyone volunteering to do this work (provided there is agreement)?
 If not, this entire discussion is pointless.

This is why I asked this in a previous message:

 Eventually, we will settle on a list of things that we've
 eventually arrived at through this consensus-forming process.  At
 that point, Don (or Tom), how do we go about actually
 accomplishing these tasks and completing these changes?  Do we
 have any workable way of solving that problem?

As you point out, until this problem is solved, all this discussion is
pointless.

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-12 Thread Brett Schwarz
I think I would agree with you, if I change your wording slightly:

The application should [have the ability to] hint to the server when 
compression might be
appropriate for a response.

I think in most scenarios, the config params should be good enough for deciding 
on when to compress, however, having the ability to add a decision point in the 
application code I think is worthwhile, and gives the developer a lot of 
flexibility.

For *my* application, I would have the config params do the decision almost all 
of the time. However, I concede that other people's use cases may be 
different...so I think a hook into the compression decision making from 
application code is a good idea. I believe what I proposed covers the 
bases...although the details would need to be worked out...


- Original Message 
From: Dossy Shiobara [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Saturday, April 12, 2008 6:55:53 AM
Subject: Re: [AOLSERVER] Compression

On 2008.04.11, Tom Jackson [EMAIL PROTECTED] wrote:
 If folks keep anything in mind it should be that applications should
 not deal with I/O performance details, at least in AOLserver.
 AOLserver is an application server, which means that it serves the
 application, the application doesn't serve anything. 

This is why compression was implemented the way it is for ADPs.  The
application should hint to the server when compression might be
appropriate for a response.  But, the server is ultimately responsible
for determining if compression can happen, doing the compression and
handling the I/O.

 It isn't an easy concept, and it shouldn't be handled by modifications
 to the ns_return API.

Which is why I suggested ns_return_compress, similar to ns_adp_compress
but for ns_return'ed responses.

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-11 Thread Brett Schwarz
Hey Dave,

Which option would you prefer though?

Thanks,
--brett

- Original Message 
From: Dave Bauer [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Friday, April 11, 2008 8:23:56 AM
Subject: Re: [AOLSERVER] Compression

Dossy,

I think the discussion is just this:

As Bret clearly stated at the beginning of the thread:

1) modify ns_return to take a flag. The optional connid parameter
makes parsing the args a little trickier.
Current:
  ns_return ?connid? status type string  (is connid ever used??)
New
 ns_return ?connid? status type string ?gzip?
OR
 ns_return ?connid? status type string ?-gzip boolean?

2) add a new command similar to the workarounds:
 ns_returnz status type string

3) Expose Ns_ConnSetGzipFlag to the script level. This would be most
similar to how the ADP compression is done

I would like to see it but I don't forsee being able to write the code.

Dave


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-11 Thread Brett Schwarz
 
 I have to agree with Tom.  I don't think the application should be
 making decisions about if and when to send data compressed.
 I think it should be handled in the config the same as the character
 encoding is handled.
 
 Tom Jackson wrote:
  I thought that someone had suggested that the compression feature should be
  handled without any flags, but based upon configuration parameters and 
  client
  headers.
 
  The main reason for this is because you would have to do the checks anyway,
  does the compression library exist, can the client accept compression, etc.
  Then what do you do if compression is requested and it doesn't exist?
 
  Maybe this discussion happened over at OpenACS.org, but this is equivalent 
  to
  an ssl layer, in general the application layer shouldn't get involved in 
  this
  type of detail.
 
  tom jackson

Let me clarify this a little bit. First of all, it would use the existing 
scheme for ADP pages. So, this part would not change at all. It would utilize 
the existing configuration. Currently, for ADP pages to be compressed, you have 
to do these things:

1) turn compression on in ns_section ns/server/${servername} as such:
ns_param   gzipon

2) Specify the minimum size of the data that will be compressed in the same 
section:
ns_param   gzipmin 1024

3) In the ADP section ns_section ns/server/${servername}/adp, turn it on for 
ADP
ns_param   gzipon

4) In the ADP page, if you want the page to be compressed, you just do:
ns_adp_compress 1
   

So, what I am proposing is that ns_return follows a similar structure. When I 
proposed having a flag (#3 below), I was merely mimicking #4 above. For me 
personally, I think I would have compression on all the time (meaning, have the 
server decide when to compress). But, I assume since ns_adp_compress command is 
in there, perhaps there is some reason why you might not want to compress 
certain pages. So, I believe the way it works with ADP pages is (i.e server 
logic):

1) it first checks that ns_adp_compress is set.
2) if yes, then if would check if the client supports compress 
(Accept-Encoding: gzip...)
3) if yes, it would then check the size, and based on gzipmin, would decide 
whether or not to compress the data

Right now, I have in my sandbox just a new command, ns_returnz, which is 
exactly like ns_return, but will set the Ns_ConnSetGzipFlag flag internally, 
and then the server will do the same decisions as above in 2 and 3. I think 
this would be my preferred option, although if someone happens to share some 
light on maybe edge cases where you might want to turn it on/off in the script.

*If* we do decide to go with a flag (similar to ns_adp_compress), I would 
like to see the default to be on.

So, in summary, the server will be doing most of logic. ns_adp_compress is 
there (I presume) to handle edge cases. So, really, I think my question boils 
down to whether or not to have a command to set the flag.

I hope that clears things up.



 
  On Friday 11 April 2008 08:23, Dave Bauer wrote:
  
  Dossy,
 
  I think the discussion is just this:
 
  As Bret clearly stated at the beginning of the thread:
 
  1) modify ns_return to take a flag. The optional connid parameter
  makes parsing the args a little trickier.
  Current:
   ns_return ?connid? status type string  (is connid ever used??)
  New
   ns_return ?connid? status type string ?gzip?
  OR
   ns_return ?connid? status type string ?-gzip boolean?
 
  2) add a new command similar to the workarounds:
   ns_returnz status type string
 
  3) Expose Ns_ConnSetGzipFlag to the script level. This would be most
  similar to how the ADP compression is done
 
  I would like to see it but I don't forsee being able to write the code.
 
  Dave
 




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-11 Thread Brett Schwarz
 On 2008.04.11, Brett Schwarz [EMAIL PROTECTED] wrote:
  So, what I am proposing is that ns_return follows a similar structure.
 
 I'll suggest the introduction of ns_return_compress ?on|off? --
 similar to ns_adp_compress, but for ns_return.  It would set the
 Ns_ConnSetGzipFlag accordingly, but in requests that are not in an ADP
 context.
 
  *If* we do decide to go with a flag (similar to ns_adp_compress), I
  would like to see the default to be on.
 
 In reality, compression of the output stream doesn't make sense until we
 implement better server-side caching, which I briefly discussed with Jim
 several years ago.  The basic idea is: some requests are mostly static
 ... generated in response to a dynamic request, but the response across
 separate requests is static until some event invalidates that cached
 response.  In that scenario, compression of the response makes sense:
 you compress it once and return the compressed version many times.
 

I agree that smarter caching will definitely improve things. However, I
think it depends on the use case for the web app. For example, my web app
is an internal tool...and there are small number of users, hence not
many request/sec. However, I am doing DB queries heavily with big payloads
and my server is sitting in a remote office with a small pipe to the main
office. So, in my case, gzipping definitely makes sense. I did some
subjective tests, and for my case, compression seems to help.

I have also been reading this book High Performance Web Sites, by Steve 
Souders (good book BTW), and he advocates compression. He's an engineer
at Yahoo, and they did some detailed studies on this. Here is a cheat sheet
for those who are interested:

http://developer.yahoo.com/performance/rules.html

 However, current AOLserver implementation where all dynamic requests are
 generated dynamically, compression almost doesn't make sense: how many
 folks are still serving content to narrowband (dialup) users?  For the
 high-bandwidth users, the cost (in time spent) of compressing the
 response vs. the savings in transmission time is almost equal (thus the
 minsize parameter, preventing small responses from even being
 compressed at all).

IMHO, I think the cost vs response time savings will lessen more in
the future, so the benefits of compression will become more so.

 
 This can partially be addressed in current AOLserver by writing a
 request handler that checks an NSV cache.  On cache misses, the response
 is generated, compressed and stored in the NSV cache and returned to the
 client.  On cache hits, it's simply an NSV fetch from cache and return
 the already compressed response.
 

It would be great if the core server would handle this ;)

Thanks,
   --brett


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-11 Thread Brett Schwarz
 - Original Message 
 From: Tom Jackson [EMAIL PROTECTED]
 To: AOLSERVER@LISTSERV.AOL.COM
 Sent: Friday, April 11, 2008 5:14:24 PM
 Subject: Re: [AOLSERVER] Compression
 
 On Friday 11 April 2008 16:41, Dossy Shiobara wrote:
  Configuration parameters is too coarse-grained control.  Ultimately, the
  compression flag should be conditionally turned on in a registered
  filter if you want it at a higher level than in the actual request
  processing code, itself.  (IMHO, the decision to compress a request
  should be handled on a per-request basis, as not all requests
  unilaterally benefit from server-side compression ... so this should be
  an _intelligent_ decision that's being made by the developer whether to
  compress the result or not.)
 
  My two cents, anyhow.
 
 If configuration is done using a trie, like threadpools, you will have very
 good control.
 
 I think the main point is that ns_return is not the place to decide this, it
 leads to very brittle code.
 
 Also, if I remember correctly, the ns_zlib module can be configured to only
 compress data which is larger than some minimum number of bytes. So even with
 a broad compression filter, you should be able to add parameters.
 
 For instance, look at Content-Length header, if  than some amount, compress
 and rewrite the header and add others.
 

Yes, see my earlier post...there is the gzipmin param that controls the
minimum length to compress.

The Apache folks no doubt have already gone through this analysis/debate. Here
is what they have (for Apache 2.0): 

http://httpd.apache.org/docs/2.0/mod/mod_deflate.html

Amoung other things, you can specify the mime type and browser type to decide 
on 
compression as well.

Ultimately, here is what I would like to see:

1) config param to enable compression (this is already there)
2) config param to set the minimum size (this is already there)
3) config param for file/mime type to compress. Note that this would take care
   of the *.adp and *tcl pages as well.
4) Have a command (ns_compress) that could override gzip setting per 
request/page
Or, have a separate command (ns_returnz) that does the over riding.

Logic would be:
1) check if compression is enabled globally (#1 above)
2) check file type/mime type to see if compression is enabled
3) check content length to see if  gzipmin
4) Override the above if ns_compress is set

I think this gives a good control over what you end up compressing. If you are 
in a high bandwidth, 
high requests/sec, you might turn off compression, or have gzipmin at a high 
level. If you are at
the other end of the spectrum (me), you will most likely be compressing most 
things.

BTW, one thing I left out in an earlier post. For those interested in the Yahoo 
performance
tips, and for those that use Firefox...there's an extension called YSlow that 
you can add
that will test a web page's response against the 10 performance tips I referred 
to earlier.
It's actually very useful.

Thanks,
--brett





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
I threw this together http://www.bschwarz.com/aolserver.jpg with Gimp. Now, I'm 
not a graphic's wiz, but I thought I would create something basic that we can 
start with, as a way to get to the design we want. I would be willing to *try* 
to make any suggested enhancements, but like I said, I am no graphics designer. 
Perhaps this will spark some momentum.

BTW, are there any legal matters that we need to be concerned with in creating 
a logo for aolserver?



On 2008.04.08, Mark Aufflick [EMAIL PROTECTED] wrote:
  Looks clean - but it *really* needs a logo to inject some motion.

 I agree; I'd like a modern and attractive logo treatment, along with a
 few key icons for downloads, documentation, community ...







  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
 
 On 2008.04.08, Brett Schwarz [EMAIL PROTECTED] wrote:
  I threw this together http://www.bschwarz.com/aolserver.jpg with Gimp. Now, 
  I'm not a graphic's wiz, but I thought I would create something basic that 
  we can start with, as a way to get to the design we want. I would be 
  willing to *try* to make any suggested enhancements, but like I said, I am 
  no graphics designer. Perhaps this will spark some momentum.
 
 It's awesome.  Very Web 2.0 (gradient, reflection) ... an orange
 starburst and a swoosh would fully trick it out as a Web 2.0 treatment.
 Heh.
 

Hey, does this mean I can put graphic artist on my resume ;) (for those 
serious folks...yes, I am joking)

For those who are interested, most of the design of the logo I followed from 
this tutorial: http://gimp-tutorials.net/node/91

 I've used the logo.  Can you send me the GIMP .xcf file for it?

http://www.bschwarz.com/aolserver.xcf

cheers,
--bret






  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


[AOLSERVER] Compression

2008-04-08 Thread Brett Schwarz
So, from my reading, its seems as though that in 4.5, we got on the fly ADP 
page compression. However, it seems as though there isn't comparable 
functionality for Tcl files (i.e. ns_return). I know there are some work 
arounds, but I was just curious why this was not implemented in the core? I 
took a look at the sources, and it looks fairly straight forward to add this 
functionality. I see there are three possibilities:

1) modify ns_return to take a flag. The optional connid parameter makes parsing 
the args a little trickier.
Current:
   ns_return ?connid? status type string  (is connid ever used??)
New
  ns_return ?connid? status type string ?gzip?
OR
  ns_return ?connid? status type string ?-gzip boolean?

2) add a new command similar to the workarounds:
  ns_returnz status type string 

3) Expose Ns_ConnSetGzipFlag to the script level. This would be most similar to 
how the ADP compression is done

Or, am I missing something here? Is there already a way to do this (without 
workarounds)?

Thanks,
   --brett


p.s. I'd really like on the fly compression for static files as well (yes, I 
know there are work arounds). 




  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
I like the color. Not sure if Dossy was serious, but actually thinking about 
more...some sort of swoosh over the server part..in that color would look 
nice I think...but I'm biased...I like blue/orange color scheme...


- Original Message 
From: Juan José del Río (Simple Option) [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 12:43:57 PM
Subject: Re: [AOLSERVER] Minor facelift to aolserver.com

What about this?!

-  
Juan José del Río|  Comercio online / e-commerce
(+34) 616 512 340|  [EMAIL PROTECTED]


Simple Option S.L.
  Tel: (+34) 951 930 122
  Fax: (+34) 951 930 122
  http://www.simpleoption.com


On Tue, 2008-04-08 at 14:29 -0400, Dossy Shiobara wrote:
 On 2008.04.08, Brett Schwarz [EMAIL PROTECTED] wrote:
  I threw this together http://www.bschwarz.com/aolserver.jpg with Gimp. Now, 
  I'm not a graphic's wiz, but I thought I would create something basic that 
  we can start with, as a way to get to the design we want. I would be 
  willing to *try* to make any suggested enhancements, but like I said, I am 
  no graphics designer. Perhaps this will spark some momentum.
 
 It's awesome.  Very Web 2.0 (gradient, reflection) ... an orange
 starburst and a swoosh would fully trick it out as a Web 2.0 treatment.
 Heh.
 
 I've used the logo.  Can you send me the GIMP .xcf file for it?
 
  BTW, are there any legal matters that we need to be concerned with in
  creating a logo for aolserver?
 
 Good question.  I really should have a serious conversation with AOL
 Legal about this issue.  I'm hoping that as long as we stay away from
 the actual AOL logo treatment itself, we'll be okay ... but I'd like to
 get that in writing.
 
 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
Something sort of like this, is what I was thinking about:

http://www.bschwarz.com/aolserver2.jpg

Although the orange color kind of changed when it was converted to jpg...it 
was originally more like what Juan had...


- Original Message 
From: Brett Schwarz [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 1:58:01 PM
Subject: Re: [AOLSERVER] Minor facelift to aolserver.com

I like the color. Not sure if Dossy was serious, but actually thinking about 
more...some sort of swoosh over the server part..in that color would look 
nice I think...but I'm biased...I like blue/orange color scheme...


- Original Message 
From: Juan José del Río (Simple Option) [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 12:43:57 PM
Subject: Re: [AOLSERVER] Minor facelift to aolserver.com

What about this?!

-  
Juan José del Río|  Comercio online / e-commerce
(+34) 616 512 340|  [EMAIL PROTECTED]


Simple Option S.L.
  Tel: (+34) 951 930 122
  Fax: (+34) 951 930 122
  http://www.simpleoption.com


On Tue, 2008-04-08 at 14:29 -0400, Dossy Shiobara wrote:
 On 2008.04.08, Brett Schwarz [EMAIL PROTECTED] wrote:
  I threw this together http://www.bschwarz.com/aolserver.jpg with Gimp. Now, 
  I'm not a graphic's wiz, but I thought I would create something basic that 
  we can start with, as a way to get to the design we want. I would be 
  willing to *try* to make any suggested enhancements, but like I said, I am 
  no graphics designer. Perhaps this will spark some momentum.
 
 It's awesome.  Very Web 2.0 (gradient, reflection) ... an orange
 starburst and a swoosh would fully trick it out as a Web 2.0 treatment.
 Heh.
 
 I've used the logo.  Can you send me the GIMP .xcf file for it?
 
  BTW, are there any legal matters that we need to be concerned with in
  creating a logo for aolserver?
 
 Good question.  I really should have a serious conversation with AOL
 Legal about this issue.  I'm hoping that as long as we stay away from
 the actual AOL logo treatment itself, we'll be okay ... but I'd like to
 get that in writing.
 
 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Compression

2008-04-08 Thread Brett Schwarz
Hey John,

I use something similar...in fact I think I stole it from an older post from 
you, IIRC. However, I guess my point was, that the mechanism is all there in 
4.5. The *only* thing that is needed for ns_return's to return compressed data 
is to set a flag (via Ns_ConnSetGzipFlag)...that's it. It's seems like a shame 
to me to let that go to waste...

Thanks,
 --brett

- Original Message 
From: John Buckman [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 2:59:44 PM
Subject: Re: [AOLSERVER] Compression

On Apr 8, 2008, at 1:54 PM, Brett Schwarz wrote:

 So, from my reading, its seems as though that in 4.5, we got on the  
 fly ADP page compression. However, it seems as though there isn't  
 comparable functionality for Tcl files (i.e. ns_return). I know  
 there are some work arounds, but I was just curious why this was  
 not implemented in the core? I took a look at the sources, and it  
 looks fairly straight forward to add this functionality. I see  
 there are three possibilities:

 1) modify ns_return to take a flag. The optional connid parameter  
 makes parsing the args a little trickier.
 Current:
ns_return ?connid? status type string  (is connid ever used??)

I use:
ns_return_gzipped $conn $x

which is this, and works very reliably:

proc ns_return_gzipped {conn html} {
if {[string first {gzip} [ns_set get [ns_conn headers] {Accept- 
Encoding}]] == -1} {
ns_return $conn 200 text/html $html
return TCL_OK
}

# john 9/21/07 -- found that we need to convert to utf-8, it isn't  
automatic
set zl [ns_zlib gzip [encoding convertto utf-8 $html]]
set h [subst {HTTP/1.0 200 OK
MIME-Version: 1.0
Server: MoochServer/4.5.0a
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: [string length $zl]
Content-Encoding: gzip

$zl}]

ns_write $conn $h
 return TCL_OK
}


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
actually, where I was going with this whole thing was trying to convey speed 
(meaing aolserver is fast). That's the reason I used italic text, and that's 
why the lines fade away from the 'L'. Oh well, I guess I didn't do a good 
enough job conveying that :(

BTW, the xcf for the second version is at my website as well: aolserver2.xcf

Here are the logos I have so far, with 2 additional based on Juan's commets'... 
the last 2 are png as well...

http://bschwarz.com/aol_logo.html


- Original Message 
From: Dossy Shiobara [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 5:24:45 PM
Subject: Re: [AOLSERVER] Minor facelift to aolserver.com

On 2008.04.09, Juan José del Río (Simple Option) [EMAIL PROTECTED] wrote:
 As a suggestion: save it as PNG, that way colours won't change.

And, make sure to keep the original .xcf, so lossless changes can be
made.  :-)

 Also, you can try starting the lines from the L itself, or more to the
 right than they're now. Or you can make them fade in from the L too... I
 don't know how to fix it exactly, but that I like the lines is a fact :)

I don't think the lines should fade in, but they should be staggered
to match the slant of the L.

I'll grab Brett's .xcf and see if I can make the change I'm talking
about.

Indeed, great work, Brett.  Thanks for taking the initiative with this.


-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Minor facelift to aolserver.com

2008-04-08 Thread Brett Schwarz
Ah, ok...now I know what you meant about following the L...yes, that looks 
better.

darn it...I thought by saving as xcf, Gimp would remember the colors, etc  
:(

I believe I used Arial bold italic for the text. I think I started with the 
blues in the article I quoted, but ended up making them darker. The colors from 
the article were 6291c0 and cce6f9. Sorry about that...I should have noted 
everything...I don't play around with the Gimp much :(

- Original Message 
From: Dossy Shiobara [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Tuesday, April 8, 2008 5:48:55 PM
Subject: Re: [AOLSERVER] Minor facelift to aolserver.com

OK, so I added one more horizontal line (so now there are 4 instead of
3), and added a slight single pixel step, to try and match the slant of
the L.

http://aolserver.com/images/aolserver.png
http://aolserver.com/images/aolserver.xcf

I'd like to redo the original .xcf - what font face and size did you
use?  Colors, etc.  (Can you tell _I'm_ not a pixel jockey?  I can't
tell just from looking at what you did ... heh.)


On 2008.04.08, Dossy Shiobara [EMAIL PROTECTED] wrote:
 I don't think the lines should fade in, but they should be staggered
 to match the slant of the L.
 
 I'll grab Brett's .xcf and see if I can make the change I'm talking
 about.
 
 Indeed, great work, Brett.  Thanks for taking the initiative with this.


-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] ns_db problem

2008-04-01 Thread Brett Schwarz
 I have this in my config file:
 ns_section ns/server/games-admin/modules
 ns_param nssock $bindir/nssock.so
 ns_param nslog $bindir/nslog.so
 ns_param nscp $bindir/nscp.so
 ns_param nsdb $bindir/nsdb.so
 ns_param shared_tcl tcl
 
 ns_section ns/db/drivers
 ns_param postgres nspostgres.so
 
 ns_section ns/db/pools
 ns_param gameskillspool Postgres
 
 ns_section ns/db/pool/gamespool
 ns_param Driver postgres
 ns_param Connections 5
 ns_param DataSource localhost::games
 ns_param User postgres
 ns_param Password secret
 ns_param Verbose On
 ns_param LogSQLErrors On
 ns_param ExtendedTableInfo On
 ns_param Connection 5
 
 ns_section ns/server/games-admin/db
 ns_param Pools *
 
 I have the following in my db.tcl file:
 set db  [ns_db gethandle  gamespool]

Are you sourcing in db.tcl from admin_op.tcl? Otherwise, how will admin_op.tcl 
know about $db that was set from db.tcl by [ns_db gethandle  gamespool] ?


 set datasource [ns_db datasource $db]
 set dbtype[ns_db dbtype$db]
 set driver  [ns_db driver$db]
 set poolname  [ns_db poolname  $db]
 set user[ns_db user  $db]
 set password[ns_db password  $db]
 
 In file admin_op.tcl I do this:
 set row [ns_db select $db select * from tadminoptype;]
 while { [ns_db getrow $db $row] } {
 ns_log Notice [ns_set get $row type] - [ns_set get $row desc]
 }
 
 The problem is that the code in admin_op does not work, I get this error:
 can't read db: no such variable
 while executing
 ns_db select $db select * from tadminoptype;
 
 But if I put this code in the db.tcl file, then it works fine.
 



  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] 64bit crashes right away

2007-09-11 Thread Brett Schwarz
 
 
 - Original Message 
 From: Tom Jackson [EMAIL PROTECTED]
 To: AOLSERVER@LISTSERV.AOL.COM
 Sent: Tuesday, September 11, 2007 9:21:40 AM
 Subject: Re: [AOLSERVER] 64bit crashes right away
 
 My laptop is 64 bit:
 Linux localhost 2.6.18-gentoo-r4 #1 SMP Mon Nov 20 16:49:16 UTC 2006 x86_64
 AMD Turion(tm) 64 X2 Mobile Technology TL-52 AuthenticAMD GNU/Linux
 
 For Tcl I do:
 ./configure --prefix=/web/nsd45 \
   --enable-64bit \
   --enable-threads \
   --enable-shared
 
 But when it builds I get the impression it isn't 64 bit.  Don't know how to
 check it.
 

You can check it by looking at the tcl_platform array





  

Shape Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] AOLserver crash related to ns_atclose and namespace commands

2007-01-21 Thread Brett Schwarz
That's funny actually...I just changed a bunch of these cases in a Tcl 
extension I help maintain, just earlier today. I happened upon this post that 
talks about it: 
 http://sourceforge.net/mailarchive/forum.php?thread_id=30611212forum_id=43966

Might be worthwhile doing an audit of the rest of the aolserver code for these 
occurances.

--brett

- Original Message 
From: Tom Jackson [EMAIL PROTECTED]
To: AOLSERVER@LISTSERV.AOL.COM
Sent: Sunday, January 21, 2007 7:17:41 PM
Subject: Re: [AOLSERVER] AOLserver crash related to ns_atclose and namespace 
commands

I found the following change fixes the bug:

in nsd/tclresp.c, line 840:

static int
Result(Tcl_Interp *interp, int result)
{
   /* Tcl_SetBooleanObj(Tcl_GetObjResult(interp), result == NS_OK ? 1 : 0); */
Tcl_SetObjResult(interp, Tcl_NewBooleanObj((result == NS_OK ? 1 : 0)));
return TCL_OK;
}

I'll commit the change.

tom jackson


On Sunday 21 January 2007 17:06, Tom Jackson wrote:
 Okay, some more info on this.

 ns_atclose has been changed in some strange ways.

 First it now requires that you are in an open connection to invoke
 ns_atclose.

 ns_atclose used to execute in scheduled procs, which makes sense so that
 you can use one method to clean up stuff in case of errors.

 It is easy to re-enable adding ns_atclose to scheduled procs by removing a
 few lines of code. Now I can call ns_atclose everywhere, but in scheduled
 procs, the cleanup scripts don't run.

 Question is: why the (silent) change, and
 is there something to replace this?

 The old description of the command is here:
 http://rmadilo.com/files/nsapi/ns_atclose.html

 I still haven't figured out where exactly the crash is coming from, but _it
 is not in the NsAtCloseObjCmd or NsRunAtClose... code.

 tom jackson

 On Sunday 21 January 2007 11:24, Tom Jackson wrote:
  I have been getting some crashes in AOLserver (current cvs version).
  AOLserver doesn't exit, but prints the following and stops responding:
 
  'Tcl_SetBooleanObj called with shared object'
 
  Here is a tcl page which exposes the behavior:
 
  ---
  # Script to expose bug with ns_atclose/namespace commands
  set store ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnop
  namespace eval ::bug { }
 
  # Commenting out this line leads to bug: 'Tcl_SetBooleanObj called with
  shared object'
  #namespace eval ::bug::$store { }
 
  proc ::bug::atClose { store } {
  ns_log Debug checking if namespace ::bug::$store exists
  if {[namespace exists ::bug::${store}]} {
  ns_log Debug Deleting namespace ::bug::$store
  namespace delete ::bug::${store}
  #log Notice Closed store (memory delete) $store
  return $store
  } else {
  ns_log Debug namespace ::bug::$store does not exist
  }
 
  }
 
  # Comment out one of these and things work fine:
  ns_atclose ::bug::atClose $store
  #ns_atclose ::bug::atClose $store
 
 
  ns_return 200 text/plain ns_atclose bug
 
  -
 
  The bug doesn't show up under all conditions. If the namespace exists, or
  had existed and was deleted, things work as expected. Also, even if the
  namespace never existed, if ns_atclose is only called once, things work
  as expected.
 
  However, if the namespace to be deleted never existed, and ns_atclose is
  called twice with the same args, none of the ns_log Debug statements
  print, and the crash occurs. (But the page is returned)
 
  Not sure what is the cause.
 
  tom jackson
 
  On Friday 03 November 2006 10:31, Alex wrote:
   Oh, well
  
   so I guess it was too early to celebrate. Now I am getting the same
   crashes again, even without exit command in the tcl code executed in
   thread.
  
   Seems to me that the same problem now discussed in
   bug 1589968
   https://sourceforge.net/tracker/?func=detailatid=103152aid=1589968gr
  ou p_ id=3152
  
   and
  
   bug 1582671
   http://sourceforge.net/tracker/?func=detailatid=110894aid=1582671gro
  up _i d=10894
  
  
   Thanks,
   ~ Alex.
  
   On 11/1/06, Alex [EMAIL PROTECTED] wrote:
Zoran, Jim
   
thanks very much for suggestions!
I think I figured it out.
The code which was executing in the thread concluded with exit tcl
command. I got it replaced with return and it seems not to be
crashing anymore.
   
However, it would be probably a good idea to disable/rename exit
for the code executed in threads created by ns_thread. Not sure if
this shall be submitted as an enhancement-level bug.
   
Thanks,
~ Alex.
   
On 11/1/06, Alex [EMAIL PROTECTED] wrote:
 Jim,

 I tried in on the command line, seems to be my case :)

 However, I run aolserver on debian, via /etc/init.d/aolserver,
 Which basically invokes /usr/lib/aolserver4/bin/nsd.
 How do I make it use nstclsh instead of tclsh ?
 I don't see any options for that.

 Thanks,
 ~ Alex.

 On 11/1/06, Jim Davidson [EMAIL PROTECTED] wrote:
  Hi,
 
  I 

Re: [AOLSERVER] New Config API's which document default values.

2005-02-23 Thread Brett Schwarz
just a couple of suggestions, from a very quick first
look (it is hard too sifting through the TAB changes,
as Dossy said):

1) Tcl already has Tcl_GetBoolean...this could be used
instead of the boolean...I believe...no big deal
though

2) This might be a good time to start moving away from
Tcl_AppendResult...just a thought. This is for AS in
general. Note: there is also a Tcl_WrongNumArgs
function that probably could be used in a few places
too.

3) similar to 2), it might be a good time to start
moving to Obj based commands.


--- Tom Jackson [EMAIL PROTECTED] wrote:

 I have added a few new C API's for setting (just
 adding, not replacing) config
 params during startup.

 The new API's are named after the current Get API's,
 for instance:

 Ns_ConfigGetValue
 Ns_ConfigSetValue

 Due to the amount of common code which would have
 been repeated in the new
 API's, I factored out this code into private
 procedures.

 I also compared the resulting code with the Tcl C
 API standards contained in
 http://www.tcl.tk/doc/engManual.pdf.

 There were many deviations from this standard in the
 original file, so I made
 any changes that I noticed, the result is that the
 file is mostly new.

 If there are any style changes which need to be
 made, please point them out on
 this list, so I can make the changes.

 I included a sample use of the new APIs in nslog.c.

 The diff, and changed files are located at:
 http://rmadilo.com/m2/config-changes/

 If this is something that should be included in
 future versions of AOLserver,
 I need to know which cvs version to do a diff on,
 and how. If there are
 further suggestions, please note them on this list.

 For one, it might be nice to have a ParamDelete
 procedure to hide things like
 password params after they have been read.  Note
 that all config sections are
 returned from every virtual server with the current
 tcl api commands.

 The new APIs are only useful for adding params for
 values which are not in the
 config file. The section Ns_Set is appended to only
 if the section exists,
 but in every case, the new APIs return the value
 that is needed to set the
 default.
 I haven't investigated the case where a null
 (missing) default is used later
 to determine configuration (such as rollFmt), for
 now these will remain
 undocumented, but I think I can add a check for a
 null value to get it to
 work.
 Untested is Int64.
 I'm writing a C module to run tests over the APIs.

 tom jackson


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



=
--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] Asterisk and AOLserver

2005-02-09 Thread Brett Schwarz
--- Malte Sussdorff [EMAIL PROTECTED] wrote:

 While reading the previous postings I stumbled upon
 multiple mentioning of
 multi protocol support and asterisk, therefore I
 assume people on this list
 are knowledgeable about this topic.

 Here is what we need:

 We run a CRM system on top of AOLserver. The CRM
 system contains the phone
 numbers of the clients. I want my PBX connected
 phone to make a connection
 to the client if I click on a link in the CRM
 System. Once the phone call is
 finished, the CRM system should be notified about
 this, so it can add a new
 entry in the call history.

 Same goes the other way round, if the client calls
 me, the CRM systems
 starts logging and once finished, an entry is added.


I believe there is a web based soft phone for
Asterisk. You could invoke that from the link.
However, it might be easier to just read the CDRs that
Asterisk generates, instead of tracking calls
realtime...just a thought...


=
--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] AOLserver Applications Spec DRAFT

2005-02-09 Thread Brett Schwarz
would it be possible to align the directory structure
to that of kits? That way, people could distribute
webapps via starkits...just a thought...

--- Bas Scheffers [EMAIL PROTECTED] wrote:

 I have written down my first thoughts on how this
 could work at:

 http://bas.scheffers.net/wiki/14

 As you can see, it is not easy to do this quick and
 dirty as proof of
 concept. It will require application awareness in
 many places (library
 sourcing, ns_register_*) and changing the pageroot
 on the fly in every
 request, based on what application is requested.

 Still, I don't believe it is too big a job.

 Looking forward to hear comments!

 Cheers,
 Bas.


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



=
--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] 4.0.8

2004-10-06 Thread Brett Schwarz
Just FYI for anybody, this page gives some good hints
on when you need to do ref management:

http://wiki.tcl.tk/1192

HTH,

--brett

--- Andrew Piskorski [EMAIL PROTECTED] wrote:

 On Wed, Oct 06, 2004 at 03:54:23PM -0400, Andrew
 Piskorski wrote:

  I am suspicious of nsopenssl.  It is doing stuff
 with Tcl_Obj's, but I
  don't see ANY calls to Tcl_IncrRefCount() or
 Tcl_DecrRefCount() at
  all.  I recently had a huge leak problem in my own
 custom C code for
  EXACTLY that reason...

 Well, that concerned me, because I am soon to start
 making heavy use
 of nsopenssl 3.0, but I think it was a false alarm.
 Again I haven't
 done any testing, but I looked at the code:

 I only really see two uses nsopenssl makes of
 Tcl_Obj, saving the
 result of calls to Tcl_GetObjResult() and
 Tcl_ListObjGetElements().
 ALL the code I looked at both in AOLserver and Tcl
 that uses those
 calls seems to be written in the same style, no use
 of
 Tcl_IncrRefCount() or Tcl_DecrRefCount() anywhere
 there either.  So, I
 don't think that's the problem.

 --
 Andrew Piskorski [EMAIL PROTECTED]
 http://www.piskorski.com/


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


[AOLSERVER] OT: Embedding Tcl Interp into existing C application

2004-08-27 Thread Brett Schwarz
Hello,

Sorry for the OT, but I thought this would be the best
list to contact about this.

There is an existing app that is multi-threaded, that
I wanted to added the ability to execute Tcl code from
this app. This reminded me very much of how aolserver
works, so I was going to start digging into the
aolserver code to see how it is done.

However, before I start, I was wondering if any kind
souls out there have any helpful tips...maybe an
overview on how aolserver does this, where to start
looking in the code, and any general threading tips.

thanks,

--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] OT: Embedding Tcl Interp into existing C application

2004-08-27 Thread Brett Schwarz
--- Dossy Shiobara [EMAIL PROTECTED] wrote:

 On 2004.08.27, Brett Schwarz
 [EMAIL PROTECTED] wrote:
 
  However, before I start, I was wondering if any
 kind
  souls out there have any helpful tips...maybe an
  overview on how aolserver does this, where to
 start
  looking in the code, and any general threading
 tips.

 How you go about embedding the Tcl interpreter will
 depend on what it'll
 be used for and how.

 Can you elaborate on some details about your
 requirements?


Sure, I didn't elaborate before, because I was trying
to keep the OT noise down.

Anyways, there is an open source PBX system (asterisk)
that has an programming interface that is very similar
to CGI (in fact it is called AGI). Right now, it forks
off a process everytime an AGI is called (just like
CGI). I would like to change that so that Tcl scripts
are loaded in ahead of time, and are executed in
process (no forking). Pretty much how aolserver runs
tcl procs and tcl pages.

More info for asterisk can be gotten here:
www.asterisk.org, and I actually wrote an article
about it that you can get an overview about here:
http://linuxjournal.com/article.php?sid=6769 which
gives an example of an AGI.

Hope that helps...

thanks for your time,

--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] OT: Embedding Tcl Interp into existing C application

2004-08-27 Thread Brett Schwarz
--- Andrew Piskorski [EMAIL PROTECTED] wrote:

 On Fri, Aug 27, 2004 at 11:11:59AM -0700, Brett
 Schwarz wrote:

  Sure, I didn't elaborate before, because I was
 trying to keep the OT
  noise down.

 Actually, I think this sort of discussion, while not
 PRECISELY on
 topic for the AOLserver list, is more than close
 enough for
 discsussion.  In fact, I'd like to encourage it.

 Your question is basically one example of, I know
 that AOLserver does
 X really well, I'd like to understand how, so that I
 can do something
 similar to X with a different program..  I think
 those sorts of
 engineering design questions are likely to teach
 many of us something
 useful.

  Anyways, there is an open source PBX system
 (asterisk) that has an
  programming interface that is very similar to CGI
 (in fact it is
  called AGI). Right now, it forks off a process
 everytime an AGI is
  called (just like CGI). I would like to change
 that so that Tcl
  scripts are loaded in ahead of time, and are
 executed in process (no
  forking). Pretty much how aolserver runs tcl procs
 and tcl pages.

 You might also consider something like FastCGI.
 Maybe that approach
 would be easier to integrate into the Asterisk
 codebase than
 AOLserver's in-process interpreter approach, I
 dunno.


I thought, in essense, aolserver is FastCGI. What are
the differences?

 Now, I've never done it, but my understanding is
 that anytime you want
 to combine Tcl and C, your first thing to decide is
 which language is
 in charge?  In AOLserver the C code is in charge,
 and that's the way
 Ousterhout originally envisioned embedding Tcl.  The
 other way, more
 popular lately, is to make Tcl in charge, and embed
 all your C
 functionality into tclsh as new Tcl commands.

 I imagine that depending on how the Asterisk code is
 organized, one or
 both of those approaches should be feasible.  But of
 course, unless
 the whole codebase is already organized as a library
 for easy
 embedding into other code, the AOLserver style C is
 in charge way
 sounds more likely.


By default, C is in charge, since this is an existing
C app.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] OT: Embedding Tcl Interp into existing C application

2004-08-27 Thread Brett Schwarz
--- Dossy Shiobara [EMAIL PROTECTED] wrote:

 On 2004.08.27, Brett Schwarz
 [EMAIL PROTECTED] wrote:
  Anyways, there is an open source PBX system
 (asterisk) that has an
  programming interface that is very similar to CGI
 (in fact it is
  called AGI). Right now, it forks off a process
 everytime an AGI is
  called (just like CGI). I would like to change
 that so that Tcl
  scripts are loaded in ahead of time, and are
 executed in process (no
  forking). Pretty much how aolserver runs tcl procs
 and tcl pages.

 You specifically asked about embedding Tcl in a
 multithreaded
 application.  Is Asterix multi-threaded?  If it is,
 and they fork and
 exec a new process for each AGI invocation, that's
 interesting ...


yes, it is multi-threaded. They fork, because it is an
external program. Just think of CGI.

 The simplest thing to do is to start by not
 pre-loading all the scripts
 ahead of time (since there's still no multi-threaded
 Tcl_CloneInterp()
 function, loading them ahead of time may not benefit
 you much).  I'd

But, what is the impact of loaded them ahead of time?
I thought that's was aolserver does (i.e. the tcl
procs).

I realize that there is some performance problems with
cloning an interp, but isn't this done at startup
time, where I don't necessarily care about timing? Or
am I way off base here?

 start by simply creating a new Tcl interp. and
 evaluate a script,
 instead of fork/exec of an external program.  This
 also keeps a lof of
 the headaches of multi-threaded programming out of
 your hair.  Expose
 the Asterix API to Tcl by creating Tcl commands from
 C.


Here's one of the deals that I am clueless about
mult-threaded programming. This is how I would think
it would happen. The main thread would read that it is
a Tcl app, and so it needs to send that to the
Tcl_Interp. I would imagine that the Tcl_Interp would
be in anther thread. So, I am assuming that there is
communication between the threads. Is this similar to
how aolserver does it? If so, where would I begin to
look to see how data is passed back and forth?

 Once you've got that working, then just tune for
 performance as real
 measurements dictate.

 A good page to learn how to start embedding Tcl in
 your C app. can be
 found on the Tcl'ers Wiki:

 How to embed Tcl in C applications
 http://wiki.tcl.tk/2074


I am familiar with embedding Tcl in C, I am just
unsure how its works in a mult-threaded
environment...especially how data is passed back and
forth between the main C thread, and the thread that
has Tcl embedded.

thanks for the info...I am learning ;)

--brett


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] Support for non-HTTP protocols

2004-08-17 Thread Brett Schwarz
I definitely vote for a). I think AS has a very
powerful framework that can be used outside of http.

--- Zoran Vasiljevic [EMAIL PROTECTED] wrote:

 On Tuesday 17 August 2004 10:32, Zoran Vasiljevic
 wrote:
  Hi!
 
  I would like to start a discussion which will
 eventually lead
  to one of the two proposals listed below (one from
 Vlad Seryakov
  and the other from Stephen Deasey) included in the
 core-server
  distribution.

 Eh... wrong turn again...
 By start a discussion, I really expected the
 people to
 respond with:

   a. YES, I like AS to be more powerful
 multiprotocol
  server instead of being a powerful http-server
 only.
  And, I like proposal X better than Y because of
 Z.

   b. NO, I do not need AS doing anything else than
 http
  and am perfectly happy with status-quo now.
 Just
  forget the whole thing.

 I apologize for not being more precise.

 If a. turns out to be everbody's darling, then there
 are
 two excellent proposals for making this work. If
 somebody
 has a better solution, lets see this as RFE. Then,
 get a
 couple of (knowledgeable) people vote in democratic
 way
 about what's the better solution. I think there is a
 AOLSERVER-DEVEL (or such) list where deeper
 technical
 issues can be discussed in a smaller audience.

 If b. well, than it is clear. We just leave it
 as-is.

 Can we agree on this?

 Zoran


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] AOLSERVER Digest - 10 Aug 2004 to 11 Aug 2004 (#2004-171)

2004-08-13 Thread Brett Schwarz
Personally, I agree. I really think it would be over
complicating things. I am not sure why OpenACS was so
gungho (sp?) about the templating system, in the first
place.

BUT, that's just my opinion. I am sure there are
people that want this behavior...but, most likely it
is something that can just be added as an extension
anyways...no reason to put it in the core...correct?


--- Dossy Shiobara [EMAIL PROTECTED] wrote:

 On 2004.08.13, Steve Manning [EMAIL PROTECTED]
 wrote:
  As well as the tags what about OACS style pairing
 of the adp with a tcl
  page to do the processing and prepare the output.
 I like the demarkation
  especially if your processing a query or
 validating form data - the tcl
  page does the work and the adp displays the
 results.

 Too cumbersome.  Just write Tcl procs and have them
 loaded into the
 server, and just call them from your ADPs.

 We're talking web applications here that consist of
 a collection of web
 pages.  That's so simple, why overcomplicate things
 with a whole
 templating system?  If folks want to punish
 themselves by requiring an
 ADP and Tcl page, that's fine.  I certainly wouldn't
 encourage that
 behavior ... unless someone can give me a real
 example with code why
 it's actually superior, as opposed to the way ACS
 has always done it.

 -- Dossy

 --
 Dossy Shiobara   mail:
 [EMAIL PROTECTED]
 Panoptic Computer Network web:
 http://www.panoptic.com/
   He realized the fastest way to change is to laugh
 at your own
 folly -- then you can let go and quickly move
 on. (p. 70)


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] AOLSERVER Digest - 10 Aug 2004 to 11 Aug 2004 (#2004-171)

2004-08-12 Thread Brett Schwarz
--- IRA [EMAIL PROTECTED] wrote:

 Automatic digest processor wrote on 8/11/2004, 11:01
 PM:

Has anyone tried to get the asp style ADP parser
 originally written in
like 1999 or 2000 by some guys at AM Computers
 working with Aolserver
4?  The source file was nsAspStyleAdps.c.  It
 allowed conditional code
throughout the file separated by the % %
 sequence, in the manner of
ASP.


 This has always been one of my biggest complaints
 with aolserver.   When
 you have to output html conditionally in adp pages,
 you have to
 backslash everything to keep tcl from choking on it.

 It's just this sort of problem that makes me wonder
 if the people
 building aolserver ever actually USE aolserver to
 build web
 applications.  It seems like not that big of a deal
 . . . until you
 realize that we do this ALL THE TIME.



Won't single quotes work (at least for the \ part)?
i.e.:

if {$vlCountryCode == DE} {
 ns_puts td
 background='$imageDir/hdr_bg.gif' valign='top'
 align='right'a
.
.
.

or am I missing something? I don't use ADP too much, I
just prefer straight Tcl pages...



 Here's an example from our code:

 if {$vlCountryCode == DE} {
 ns_puts td
 background=\$imageDir/hdr_bg.gif\ valign=\top\
 align=\right\a

href=\http://www.aol.de/action_templates/globalhelp_1.jsp?cid=1041541\;
 target=\top\img
 src=\$imageDir/btn_helptop.gif\ width=$img2w
 height=$img2h border=0 alt=\$str6\/a/td
 } elseif {$vlCountryCode == FR} {
 ns_puts td
 background=\$imageDir/hdr_bg.gif\ valign=\top\
 align=\right\a

href=\http://aolaide.aol.fr/version4/topic/theme6.htm\;
 target=\top\img
 src=\$imageDir/btn_helptop.gif\ width=$img2w
 height=$img2h border=0 alt=\$str6\/a/td
 } else {
 ns_puts td
 background=\$imageDir/hdr_bg.gif\ valign=\top\
 align=\right\a

href=\javascript:pop=prntPack('help/help.adp',530,500);\img
 src=\$imageDir/btn_helptop.gif\ width=$img2w
 height=$img2h border=0
 alt=\$str6\/a/td
 }



 Whereas in darn near any other language/appserver
 out there
 (php,npe,jsp,asp), it would look something like this
 (syntax varies a
 bit, of course):


 % if $vlCountryCode == DE %

 td background=%=$imageDir%/hdr_bg.gif
 valign=top align=right
 a

href=http://www.aol.de/action_templates/globalhelp_1.jsp?cid=1041541;
 target=topimg src=$imageDir/btn_helptop.gif
 width=%=$img2w%
 height=%=$img2h% border=0
 alt=%=$str6%/a/td

 % elseif $vlCountryCode == FR %

 td background=%=$imageDir%/hdr_bg.gif
 valign=top align=right
 a

href=http://aolaide.aol.fr/version4/topic/theme6.htm;
 target=topimg
 src=%=$imageDir%/btn_helptop.gif
 width=%=$img2w%
 height=%=$img2h% border=0
 alt=%=$str6%/a/td


 % else %
 td background=%=$imageDir%/hdr_bg.gif
 valign=top
 align=righta

href=javascript:pop=prntPack('help/help.adp',530,500);img
 src=%=$imageDir%/btn_helptop.gif
 width=%=$img2w%
 height=%=$img2h% border=0
 alt=%=$str6%/a/td

 % endif %


 The readability difference may not be so apparent
 given the lack of
 formatting in this email, but the difference in my
 text editor (using
 syntax coloring) is tremendous.

 IRA

 --
 Sr. Software Engineer
 Parental Controls Web


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] command line history with nscp module

2004-06-28 Thread Brett Schwarz
--- Dossy [EMAIL PROTECTED] wrote:
 On 2004.06.28, Nathaniel Haggard
 [EMAIL PROTECTED] wrote:
  Is there command line history in the nscp module?
 If so how do I turn
  it on?  What about tab auto completion.  I don't
 want to do any
  unnecessary suffering.

 No.  Readline support in nscp makes it overly
 complex.  You may be
 better off using an enhanced telnet client (most MUD
 clients come to
 mind) that offer things like history, tab
 completion, etc.


tkcon might be able to help out too...


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] TclX keyed list changes in HEAD

2004-06-22 Thread Brett Schwarz
Zoran,

I am just curious what you have done. Did you update
the AS code to match what is at tclx.sf.net? Or is
this just something you did? I believe you converted
to the Tcl objects, but wasn't sure if you took it
from SF or did it on your own.

thanks,

--brett

--- Zoran Vasiljevic [EMAIL PROTECTED] wrote:
 On Tuesday 22 June 2004 18:24, you wrote:
  Zoran implemented some recent changes to TclX
 keyed lists in CVS HEAD
  which changed the C API, which broke at least some
 code at AOL which was
  still using the old C API.

 Ah, the C-API you're talking about! Well, this is
 right.
 This has changed. I see no problem in addint the
 compat
 layer on top of that.

 Zoran


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an
 email to [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message.
 You can leave the Subject: field of your email
 blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] ns_set questions

2004-06-11 Thread Brett Schwarz
some more $0.02...


--- Jim Wilcoxson [EMAIL PROTECTED] wrote:
 Sets allow entries with duplicate keys.  If
 duplicates are returned in
 the list for this new ns_set keys, that's fine,
 except that a naiive
 programmer can't go through the list of keys
 returned and fetch the
 corresponding values.  You'd have to do a foreach
 loop on the keys,
 increment a counter, and use the counter to lindex
 into the ns_set values
 result:

   set values [ns_set values $myset]
   set i -1
   foreach key [ns_set keys $myset] {
 incr i   ;# put it here so that continues
 can be used to exit early
 set val [lindex $values $i]
 do whatever
   }


I think this would work too:

foreach key [ns_set keys $myset] val [ns_set values
$myset] {
do whatever
}



 Another option would be ns_set aget to return
 alternating keys and
 values in a list that could be used as input to
 array set - sort of,
 ignoring the multiple key issue - to convert sets to
 arrays, and
 ns_set aset could be used to convert from arrays
 to sets, like:

 set myset [ns_set create]
 ns_set aset $myset [array get myarray]


and you could do this as well:

{key1 val1 key2 val2 ...}

foreach {key val} [ns_set list $myset] {

do whatever
}

 I don't know how often these would be used in
 practice though, because
 I think experienced TCL programmers quickly avoid
 using ns_sets except
 where they have to, like for interfacing with
 smallish nsd data
 structures.


I actually never fully understood the reason for
ns_set...but I never really tried to understand it
either. I almost always just used Tcl's internal data
structures...

--brett




__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] ns_set questions

2004-06-11 Thread Brett Schwarz

 Rather than building on top of Tcl Array, another
 alternative is to
 use some entirely new from-scratch C implementation,
 in the future
 maybe even something like Ratcl.  But I'm not aware
 of any existing
 code that would currently be a good fit as an ns_set
 replacement.



I've never really used them but what about keyed lists
in Tclx? I believe the order is preserved, and by the
looks of it, it has a very similiar interface to
ns_set (from a quick look through). It also supports
nesting, which would be nice. Maybe we could hijack
this





__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] ns_set questions

2004-06-11 Thread Brett Schwarz
--- Brett Schwarz [EMAIL PROTECTED] wrote:
 
  Rather than building on top of Tcl Array, another
  alternative is to
  use some entirely new from-scratch C
 implementation,
  in the future
  maybe even something like Ratcl.  But I'm not
 aware
  of any existing
  code that would currently be a good fit as an
 ns_set
  replacement.
 


 I've never really used them but what about keyed
 lists
 in Tclx? I believe the order is preserved, and by
 the
 looks of it, it has a very similiar interface to
 ns_set (from a quick look through). It also supports
 nesting, which would be nice. Maybe we could hijack
 this


although it doesn't support duplicate keys :(





__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] tcl q: how to see escape chars

2003-10-17 Thread Brett Schwarz
--- Scott Laplante [EMAIL PROTECTED] wrote:
 Is there a way in tcl to puts(?) a string, but
 instead of intrepreting,
 showing all special characters?

 For example, this is what i have:

 % set thing hi
 bye
 hi
 bye
 % puts $thing
 hi
 bye
 %

 and this is what i'd want:

 % set thing hi
 bye
 hi
 bye
 % puts -option? $thing
 hi\nbye
 %

string map {\n \\n} $thing


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] Expect in AOLserver?

2003-09-14 Thread Brett Schwarz
I haven't tried it from AS, but I always load Expect from within tclsh:

this works for me:

package require Expect

If  you are on  Windows, then I think the Expect for windows is still a
little shaky...



On Sun, 2003-09-14 at 12:44, Andrew Piskorski wrote:
 I have an Expect script which I'm exec'ing from AOLserver.  This
 works, and the inefficiency of forking doesn't really matter in this
 case.  But it's annoying, as it means I can only communicate with the
 Expect script via command line arguments and stdin/stdout/stderr.

 I'd much rather just have the Expect Tcl API directly available in
 AOLserver.  But is that in fact feasible?  Is there any version of
 Expect which can be dynamically loaded into AOLserver (or plain tclsh
 for that matter), via 'package require', the modules list in
 AOLserver's config file, or some other such mechanism?  For AOLserver
 3.3, or 4.0?

 --
 Andrew Piskorski [EMAIL PROTECTED]
 http://www.piskorski.com


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with 
 the
 body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field 
 of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] {SPAM?} [AOLSERVER] announcing C API draft for review

2003-08-29 Thread Brett Schwarz

 A suggestion. The new api page says: This page lists the C APIs that are
 new in AOLserver 4.0. To improve readability, the Ns_ prefix is omitted on
 this page.

 In a reference I like to see the whole function name, without anything
 implied. I think removing the Ns_ decreases readability. How do others
 feel about that?


I agree...it should have the whole function...


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] ns_include -sameframe

2003-08-15 Thread Brett Schwarz
 Rename the current ns_include proc to
 _std_ns_include or somesuch, then
 define your own ns_include proc that looks for the
 -sameframe arg and
 does something intelligent with it ...

 However, all the code that gets included will need
 to be touched to be
 wrapped in an uplevel (simplest change, can be
 applied
 programmatically).


I guess I am not following here (maybe because its
friday), but why do you need the uplevel? Couldn't the
new proc do this. I have never used ns_include...

--brett


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] Lengthy tcl interp initialization

2003-08-14 Thread Brett Schwarz
Item number one is still a bit of a mystery. The init
script is notdramatically different between our 3.5
server and our 4.0 server. Asomewhat unscientific
attempt to load the 4.0 init script into a 3.5server
showed a similar slowdown, so we do not currently
believe thatthis slowdown is due to a change in the
AOLserver core threadinitialization code between 3.5
and 4.0 (but we haven't totally ruledthat out). The
one difference we do know of is the use of tcl
packages,but its not yet clear to us how that might
dramatically affect theinitialization time.

* If auto_path has a lot of directories to check, then
it will take a while to search through the filesystem.
This *may* be the problem you see with packages. When
you do a [package require] it searches for that
package based on the auto_path variable. So, if there
are alot of directories, then the longer it will take
to search. You could try an experiment, and try using
source/load instead of [package require], or see what
auto_path is set as, to see if it is too long. If it
is long, try trimming that to just what is actually
needed.

--brett


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] Are the weekly chats officially dead?

2003-07-31 Thread Brett Schwarz
 Lately, I've been thinking of switching to tclsh as
 my login shell (yes,
 I'm a nut) and I've heard from other folks that
 they'd like readline
 support in nscp ... so, I wonder ... what might it
 take for something
 like package require readline to work.  So, if you
 really want
 readline support in nscp, you'd just connect, then
 issue package
 require readline and off you go.

 Okay, so maybe that idea is half-baked.  But, if
 people don't mind
 linking nscp against libreadline, I'd be happy to
 work on putting
 readline support into nscp since I know almost
 everybody wants it.


There is already a tclreadline binding.
http://tclreadline.sourceforge.net

I think there was another lib similar to readline, but
not GPL that someone was going to work on as well, but
I forget who it was

--brett


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of 
your email blank.


Re: [AOLSERVER] ns_register_proc

2003-03-28 Thread Brett Schwarz
I believe in Tcl 8.4 that if regexp sees a simple pattern (i.e. one
that string match could use), then it will use string match to process
it. I am not sure where exactly that takes place, so I am not sure if
that's what you are seeing or not. Maybe once Jeff gets back, he would
have some input.

--brett

On Fri, 2003-03-28 at 10:29, Ayan George wrote:
 Guys,

 During my lunch break, I wrote a small program to
 compare the execution of Tcl_StringMatch() (what
 ns_register_filter uses to match URLs) and
 Tcl_RegExpExec() (what I propose
 ns_register_filter should have the option of
 using).

 It looks like the regular expression stuff is
 just as fast (or slow depending on how you look
 at it) as the Tcl_StringMatch() we currently
 use.

 Of course, I haven't tested it very thouroughly.
 If you are interested in the code I used, it is
 here:

 http://www.ayan.net/software/TclReCmp/

 I'd like to take a stab at implementing the RE
 matching for the ns_register_* procedures if that
 is okay.

 -ayan

 On Fri, 28 Mar 2003, Nathan Folkman wrote:

  Agree. If you want to take a stab at implementing, and can provide a
  patch, we'll take a look and get it added to the core. Thanks in
  advance.
 
  - Nathan
 
  On Friday, March 28, 2003, at 01:17 PM, Tim Moss wrote:
 
   That sounds like a good idea. Espcially if you make the default
   behaviour
   whatever the current behaviour is.
  
   This will ensure backwards compatibility (with no changes to existing
   code).
  
   If you want the extra flexibility the regexp option gives you then you
   add
   it to your code and chaneg the expressions accordingly.
 
 
  --
  AOLserver - http://www.aolserver.com/
  To Remove yourself from this list: http://www.aolserver.com/listserv.html
  List information and options: http://listserv.aol.com/
 


 --
 AOLserver - http://www.aolserver.com/
 To Remove yourself from this list: http://www.aolserver.com/listserv.html
 List information and options: http://listserv.aol.com/
--
Brett Schwarz [EMAIL PROTECTED]
Very Little


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_register_proc

2003-03-28 Thread Brett Schwarz
I agree, but maybe we can add a option to the command, similar to what
Tcl's switch and lsearch commands do (i.e. -glob -regexp, etc)

--brett

On Fri, 2003-03-28 at 07:43, Peter M. Jansson wrote:
  Why can't we just use POSIX regular expressions for all of
  the ns_register* procedures?

 I'd be concerned about REs degrading performance.  REs are usually
 significantly slower than glob matches, and the registered proc matcher will
 be called a _lot_.


 --
 AOLserver - http://www.aolserver.com/
 To Remove yourself from this list: http://www.aolserver.com/listserv.html
 List information and options: http://listserv.aol.com/
--
Brett Schwarz [EMAIL PROTECTED]
Very Little


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] AS 4.0 (beta 2) running on privledge port

2003-03-06 Thread Brett Schwarz
Hummm, I have tried it on 2 different machines now, and it still does
not work...even with the -b option. I have tried other ports as well
(i.e. 81, 82, etc).

What version of 4.0 do you have (i.e. beta 1, beta 2, cvs)?

I tried the same with 3.5.1, and that worked.

I am on SuSE Linux 7.3, if that matters at all.

Humm, I guess I need to do some more digging...

Thanks,

   --brett

On Wed, 2003-03-05 at 17:24, Peter M. Jansson wrote:
 On Wednesday, March 5, 2003, at 07:20 PM, Brett Schwarz wrote:

  However, NsPreBind does
  nothing is the -b or -B option are not given, when, I believe it should
  pre bind anyways from what is given in the config file. I could be wrong
  here.
 

 My inittab line:

 ww:345:respawn:/usr/local/aolserver-4.0/bin/nsd -i -b 192.168.1.239:80 -u
 web -g web -t /usr/local/aolserver-4.0/click.tcl

 You must specify the -b on the command line,  It does work.



 I. To remove yourself from this list:

 Send a message to [EMAIL PROTECTED]  with the following text in
 the BODY of your message:

 signoff aolserver

 II. For a complete list of listserv options please visit:

 http://listserv.aol.com/

 III. For more AOLserver information please visit:

 http://www.aolserver.com/
--
Brett Schwarz
brett_schwarz AT yahoo.com



I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] 4.0 ClientData arg ??

2003-02-18 Thread Brett Schwarz
On Tue, 2003-02-18 at 16:44, Andrew Piskorski wrote:
 On Tue, Feb 18, 2003 at 07:20:14PM -0500, Jim Davidson wrote:
  In a message dated 2/18/2003 5:53:54 PM Eastern Standard Time,
  [EMAIL PROTECTED] writes:

   - The BB_Nsv* C functions I've created in my nsvapi.c still aren't
   working right in some cases, Tcl_GetCommandInfo is still claiming that
   nsv_set, etc. don't exist.  This is despite the fact that the thread
   calling these is now being spawned AFTER full server initialization.

  Are you using Ns_TclAllocateInterp to get your interp with a NULL server arg
  within your Ns_ModuleInit?  This would provide you a non-virtual server

 Nope.  Mostly all I do in my Ns_ModuleInit is init a Tcl hash table,
 name some mutexes, and create a Tcl command.  Like this:

   static int BB_interpInit(Tcl_Interp *interp, void *data)
   {
   Tcl_CreateCommand(interp, myapi, BB_TclCmd, NULL, NULL);
   return NS_OK;
   }


As a side note, you may want to look into using the Object interface to
Tcl, i.e. Tcl_CreateObjCommand. Of cource there may be reasons why you
are doing it this way, but thought I would just mention it...

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] 4.0 ClientData arg ??

2003-02-18 Thread Brett Schwarz
On Tue, 2003-02-18 at 17:21, Andrew Piskorski wrote:
 On Tue, Feb 18, 2003 at 05:12:38PM -0800, Brett Schwarz wrote:

  As a side note, you may want to look into using the Object interface to
  Tcl, i.e. Tcl_CreateObjCommand. Of cource there may be reasons why you
  are doing it this way, but thought I would just mention it...

 :)  The reason was in this comment which I clipped out for brevity:

   Tcl_CreateCommand(interp, bbapi, BB_TclCmd, NULL, NULL);

   /* For Tcl 8.x, should probably be using Tcl_CreateObjCommand
  rather than Tcl_CreateCommand, but it doesn't compile right for
  me - I dunno why.  [EMAIL PROTECTED], 2001/11/01 09:35 EST */

 The Tcl overhead from my custom commands was never even showing up in
 my performance profiling, so once I learned more about using Tcl's
 object interface, I never bothered going back and trying to object-ify
 that again.  I'll save it for a rainy day.  :)


Come to think of it, I had trouble with 3.5 compiling with object
commands for a module I wrote. 4.0 came out, so I just starting using
4.0 instead. I haven't had any problems compiling with 4.0 and
objects...

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] 4.0 ClientData arg ??

2003-02-15 Thread Brett Schwarz
On Sat, 2003-02-15 at 14:22, Andrew Piskorski wrote:
 Could someone please explain the different uses of the ClientData
 arg parameter to the Nsv C functions in AOLserver 3.x vs. 4.0?  For
 example, let's look at the 3.x NsTclVSetCmd and the (equivalent but
 object-ified) 4.x NsTclNsvSetObjCmd functions (see below).

 I believe the ClientData typdef is a void * in both 3.x and 4.x.  For
 these two NsTclNsv*Set*Cmd functions, in 3.x, arg is clearly just
 the single character 'g', while in 4.x, well basically I have no idea
 what arg is.  Using the character 'g' like in 3.x definitely isn't
 right, as that makes my AOLserver segfault with a Bus Error.  :)


For 4.0 it looks like it is a NsInterp (look at LockArray).

 Could someone explain what's really going on with arg, please?
 Thanks!


Looks like they are passing around a Tcl_Interp pointer as well as a
NsInterp pointer in 4.0. Not sure why, I haven't examined the code that
thoroughly yet. Previously, they were using it to pass 's' or 'g'; set
or get I suppose.

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] nspostgres and aolserver4beta1 and beta2

2003-02-10 Thread Brett Schwarz
This is what I have in my nsd.tcl:

#
# Modules to load
#
ns_section ns/server/${servername}/modules
ns_param   nsdb  ${bindir}/nsdb${ext}
ns_param   nssock  ${bindir}/nssock${ext}
ns_param   nslog   ${bindir}/nslog${ext}
ns_param   nsresult   ${bindir}/nsresult${ext}

Notice the nsdb line...

--brett



On Mon, 2003-02-10 at 11:12, Wes James wrote:
 I checked the nsd.tcl and I have these now:

 ns_section ns/db/drivers
 ns_param   postgres ${bindir}/nspostgres.so


 ns_section ns/db/pools
 ns_param   main   Main Pool

 ns_section ns/db/pool/main
 ns_param Driver postgres
 ns_param Connections 5
 ns_param DataSource localhost::pgdb
 #ns_param User nsadmin
 #ns_param Password yourpassword
 ns_param Verbose Off
 ns_param LogSQLErrors On
 ns_param ExtendedTableInfo On
# ns_param MaxOpen 10
# ns_param MaxIdle 10

 ns_section ns/server/${servername}/db
 ns_param Pools  *
 ns_param DefaultPoolmain


 ns_section ns/server/${servername}/modules
 ns_param nssock ${bindir}/nssock.so
 ns_param nslog ${bindir}/nslog.so
 ns_param   postgres ${bindir}/nspostgres.so


 And when I run nsd now it I get:

 [10/Feb/2003:12:06:37][5838.8192][-main-] Warning: modload: could not load
 /usr/local/aolserver/bin/nspostgres.so:
 /usr/local/aolserver/bin/nspostgres.so: undefined symbol: Ns_TclDbGetHandle
 [10/Feb/2003:12:06:37][5838.8192][-main-] Fatal: modload: failed to load
 module '/usr/local/aolserver/bin/nspostgres.so'
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] AOLserver 4.0 Beta available!

2003-01-24 Thread Brett Schwarz
I noticed this was not under the NEWS section at www.aolserver.com ... I
didn't know if that was on purpose, or not...

--brett

On Fri, 2003-01-24 at 05:36, Elizabeth Thomas wrote:
 The first beta release of AOLserver 4.0 is now available with CVS tag
 aolserver_v4_r0_beta_1.  It is also available via the Source Forge
 download page:
 https://sourceforge.net/project/showfiles.php?group_id=3152release_id=135781

 Please report bugs via SourceForge at:
 https://sourceforge.net/tracker/?group_id=3152atid=103152

 with group aolserver_v4_r0_beta_1

 Test On!


 Elizabeth Thomas
 Principal Software Engineer
 America OnLine, Inc.
--
Brett Schwarz
brett_schwarz AT yahoo.com



[AOLSERVER] Updates for 4.0

2003-01-23 Thread Brett Schwarz
I started looking into 4.0, and I noticed that there are some
enhancements that could be made at both the C level and the Tcl level.
For example, some of the commands are still not objectified at the C
level, and at the Tcl level, some of the Tcl procs under modules/tcl/
could use some updating.

I will probably do some of these things for my setup regardless, but I
would like to have these changes incorporated into AS as well. Does the
AOL Core Team accept enhancements?

Thanks,

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] OTish: Data abstraction facilities in Tcl

2003-01-17 Thread Brett Schwarz
Humm, I never really found the short list of data types a hinderance for
Tcl. I have always been able to manage with what is there, although I
did write the record package (tcllib) to overcome one obstacle I had,
but I did that more as an excercise really.

If you really are stuck, and want to find some other stuff, then I know
some people have loaded XOTcl into AOLserver, you may want to look into
that. It gives you an OO facility. You may also want to look at TclX,
which has other data types available (most notably, keyed lists).

I really use lists heavily, and with Tcl8.4, list manipulation has
improved quite a bit, so that's good news for me. I also use an array of
lists quite a bit...

I am just curious, can you give an example of something that is giving
you a hard time?

--brett


On Fri, 2003-01-17 at 14:30, Peter M. Jansson wrote:
 (...that work in AOLserver.)

 So, I've been writing Tcl for AOLserver since it only ran Tcl 7.4, and you
 only had 3 choices for storing data in Tcl -- scalars, lists and arrays.
 Things like a list of arrays weren't possible; if you wanted to have such
 a thing, you had to fake it.  I admit, I've gotten used to being able to
 do such things in Perl, where an array of hashes is an ordinary thing (or
 at least an array of hash references), and I have to say that I find it
 convenient.  How do Tcl programmers normally do such things?  Do they
 avoid messes like these, handle them in other languages, and provide Tcl
 commands to manipulate them?  Do they use one or more Tcl add-ons?  (If so,
   which ones work under AOLserver?)  Or am I approaching the problem from
 the wrong perspective?

 What makes this an AOLserver question, rather than just a Tcl question, is
 that I want to make sure whatever I do would be supported within AOLserver.
But other than that, it's not really an AOLserver question.

 Thanks,
 Pete.
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] Modules for AS4.0

2003-01-16 Thread Brett Schwarz
I should have followed up earlier on this. Actually, what the problem
was, is that I didn't have nsdb to be loaded in nsd.tcl file, so it
wasn't getting loaded, DOH!

So, you don't need to do any special linking...


On Wed, 2003-01-15 at 08:52, Tim Moss wrote:
 You need to link with nsdb.lib - In AS4 nsdb has been separated out of nsd.

 regards,

 Tim Moss
 SiteSpeed Ltd
 Mobile: 0 77 9613 4891
 Email:  [EMAIL PROTECTED]
 Website:http://www.site-speed.com

 This email contains information from SiteSpeed Ltd, which may be privileged
 or confidential. If you are not the intended recipient, be aware that any
 disclosure, copying, distribution or use of the contents of this information
 is prohibited. If you have received this electronic message in error, please
 notify us immediately.




  -Original Message-
  From: AOLserver Discussion [mailto:[EMAIL PROTECTED]]On Behalf
  Of Brett Schwarz
  Sent: 15 January 2003 16:43
  To: [EMAIL PROTECTED]
  Subject: Re: [AOLSERVER] Modules for AS4.0
 
 
  I have that already in my source code, otherwise, it wouldn't compile
  ;^)
 
  On Wed, 2003-01-15 at 08:14, Lamar Owen wrote:
   On Tuesday 14 January 2003 18:31, Brett Schwarz wrote:
Has the module interface changed in 4.0? I am trying to compile a C
module I wrote for AS3.5. It compiles fine, but when I try to
  start AS,
I get undefined symbol error:
  
[14/Jan/2003:15:20:51][14736.1024][-main-] Warning: modload: could not
load /usr/local/aolserver40/bin/nsresult.so:
/usr/local/aolserver40/bin/nsresult.so: undefined symbol: Ns_DbGetRow
[14/Jan/2003:15:20:51][14736.1024][-main-] Fatal: modload: failed to
load module '/usr/local/aolserver40/bin/nsresult.so'
  
   #include nsdb.h
   --
   Lamar Owen
   WGCR Internet Radio
   1 Peter 4:11
  --
  Brett Schwarz
  brett_schwarz AT yahoo.com
 
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] Modules for AS4.0

2003-01-15 Thread Brett Schwarz
I have that already in my source code, otherwise, it wouldn't compile
;^)

On Wed, 2003-01-15 at 08:14, Lamar Owen wrote:
 On Tuesday 14 January 2003 18:31, Brett Schwarz wrote:
  Has the module interface changed in 4.0? I am trying to compile a C
  module I wrote for AS3.5. It compiles fine, but when I try to start AS,
  I get undefined symbol error:

  [14/Jan/2003:15:20:51][14736.1024][-main-] Warning: modload: could not
  load /usr/local/aolserver40/bin/nsresult.so:
  /usr/local/aolserver40/bin/nsresult.so: undefined symbol: Ns_DbGetRow
  [14/Jan/2003:15:20:51][14736.1024][-main-] Fatal: modload: failed to
  load module '/usr/local/aolserver40/bin/nsresult.so'

 #include nsdb.h
 --
 Lamar Owen
 WGCR Internet Radio
 1 Peter 4:11
--
Brett Schwarz
brett_schwarz AT yahoo.com



[AOLSERVER] Modules for AS4.0

2003-01-14 Thread Brett Schwarz
Has the module interface changed in 4.0? I am trying to compile a C
module I wrote for AS3.5. It compiles fine, but when I try to start AS,
I get undefined symbol error:

[14/Jan/2003:15:20:51][14736.1024][-main-] Warning: modload: could not
load /usr/local/aolserver40/bin/nsresult.so:
/usr/local/aolserver40/bin/nsresult.so: undefined symbol: Ns_DbGetRow
[14/Jan/2003:15:20:51][14736.1024][-main-] Fatal: modload: failed to
load module '/usr/local/aolserver40/bin/nsresult.so'

For 4.0, do I have to explicitly link in the object that has
Ns_DbGetRow. I am not really familiar how AS loads modules...

Anyways, has anyone run any modules for 4.0?

Thanks,

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] Problem with the compile

2002-12-29 Thread Brett Schwarz
What Tcl version do you have installed? You will need 8.4 I believe. If
you have multiple versions of Tcl installed, also make sure you are
picking up the correct version.

 --brett

On Sun, 2002-12-29 at 17:01, Damon wrote:
 Hi all,
 I have problem with the compiling of Aolserver Version 3.5.1 on Suse 8.1:
 After typing make to compile the source code I get the output
 as following:

 nsthreadtest.o: In function `DumperThread':
 nsthreadtest.o(.text+0x7a6): undefined reference to `Tcl_GetMemoryInfo'
 nsthreadtest.o: In function `main':
 nsthreadtest.o(.text+0xb03): undefined reference to `pthread_create'
 nsthreadtest.o(.text+0xb6f): undefined reference to `pthread_join'
 libnsthread.so: undefined reference to `pthread_getspecific'
 libnsthread.so: undefined reference to `pthread_detach'
 libnsthread.so: undefined reference to `pthread_key_create'
 libnsthread.so: undefined reference to `pthread_attr_setstacksize'
 libnsthread.so: undefined reference to `pthread_sigmask'
 libnsthread.so: undefined reference to `pthread_mutex_trylock'
 libnsthread.so: undefined reference to `pthread_cond_timedwait'
 libnsthread.so: undefined reference to `pthread_setspecific'
 collect2: ld returned 1 exit status
 make[1]: *** [nsthreadtest] Error 1
 make[1]: Leaving directory `/usr/local/src/aolserver/nsthread'
 make: *** [all] Error 1

 Can please anybody tell me how to solve the problem?
 cheers
 Damon
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] new result module

2002-12-26 Thread Brett Schwarz
To be honest, I rarely ever use the -array option. I use the -list and
-llist options almost exclusively. Especially for Tcl 8.4, lists have
even become more attractive. I added the -array option, just for
versitility (more ways to do things).

On Tue, 2002-12-24 at 12:30, Tom Jackson wrote:
 Brett,

 I think you would have to factor in the problem of parsing the attribute
 name out of the array element name, plus you can't easily search for an
 element by name either.

# This is essentially the same as ns_set find
foreach {K V} [array get myarr *,some_attr] {
puts This is an element for 'some_atttr' with key $K: $V
}

OR

foreach K [array names myarr *,some_attr] {
puts This is an element for 'some_atttr' with key $K: $myarr($K)
}

Is this what you mean?

 Ns_set supports mulitple attributes with the same name, as well as
 attribute order. Arrays mess up the order, that is why they are faster,
 for one.


Yes, an array element would get clobbered if there were 2 attributes of
the same name. However, I have always found it good practise to rename
attributes that have the same name as another attribute, using the SQL
'AS' keyword. But, I know that not everyone does this. Again, the -array
option is not a useful option in all cases.

Bottom line is that I wasn't looking to *replace* ns_set, just to add an
alternative; ns_set has alot of good features to it. In some cases,
ns_set might be the right choice; in other cases, it may not be the
right choice. I plan on adding more features to the module as well,
since this was just a first time pass at it...

Thanks for the feedback,

--brett

--
Brett Schwarz
brett_schwarz AT yahoo.com



[AOLSERVER] new result module

2002-12-24 Thread Brett Schwarz
I was messing around writing a small module that retrieved results
differently than the standard way that AS does. I believe that it is
quite a bit quicker than the standard way (i.e. ns_set), but this is the
first time that I have written anything for AS at the C level, so I am
not sure if I am missing something here. In fact, I am quite surprised
that there hasn't been something like this in the core...which makes me
wonder if there is something inherently wrong with this approach, and I
am missing some vital concepts.

I tested it on a result set of 1000 tuples, with 5 attributes, and it
returns almost immediately (although the browser has trouble rendering
it that quickly). I am on a modest machine as well (dual PII @ 333MHZ
running SuSE Linux). The AS process, and the DB process (PG) are running
on the same machine (PG is not tuned at all); however, there is no other
web/db traffic at the moment. I also tested a result set with 10
attributes and 5 tuples. It took roughly 3 seconds to retrieve the
results, but of course my browser took quite a long time to render (in
fact I stopped it before it finished).

Anyways, there are alot of variables that might determine the actual
performance, but in general, I think these are quite a bit quicker.

So, why am I writing this?
1) To see if there is something fundamentally wrong with my approach
2) To see if my code makes sense (especially with respect to threading)
3) To share the code for anyone who wishes to use it

There are 3 different ways to gets results (more to come):
1) all within one list.
   EXAMPLE

   set sql SELECT att1, att2, att3 FROM table1;
   set db [ns_db gethandle main]
   set handle [ns_db select $db $sql]

   if {[catch {set L [ns_result $db $handle -list]} err]} {
   ns_db releasehandle $db
   ns_returnnotice $conn 200 ERROR $err
   }

   set t table
   foreach {a1 a2 a3} $L {
  append t trtd$a1/tdtd$a2/tdtd$a3/td/tr
   }

   append t /table

   ...

2) List of lists
   EXAMPLE

   set sql SELECT att1, att2, att3 FROM table1;
   set db [ns_db gethandle main]
   set handle [ns_db select $db $sql]

   if {[catch {set L [ns_result $db $handle -llist]} err]} {
   ns_db releasehandle $db
   ns_returnnotice $conn 200 ERROR $err
   }

   set t table
   foreach T $L {
  append t trtd[join $R /tdtd]/td/tr
   }

   append t /table

   ...

3) array (with tuple num and attr as index; i.e. myarr(tupno,attr)

   EXAMPLE

   set sql SELECT att1, att2, att3 FROM table1;
   set db [ns_db gethandle main]
   set handle [ns_db select $db $sql]

   if {[catch {set L [ns_result $db $handle -array myarr]} err]} {
   ns_db releasehandle $db
   ns_returnnotice $conn 200 ERROR $err
   }

   set t table
   foreach R [array names myarr] {
  append ul TRTD $R /tdtd $myarr($R)/td/tr
   }
   append t /table

   ...

I plan to port this to 4.0 as well (i.e. objectify the commands), since
I want to start messing with 4.0.

Anyways, if anyone has any comments, I would appreciate them.

Thanks and happy holidays to everyone,

--brett


--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] nspostgres 3.5 released.

2002-12-23 Thread Brett Schwarz
I got it to compile, but I had to modify it a bit. I had to add nsdb.h
to nspostgres.h.

I haven't done any significant testing on it though...

--brett

On Mon, 2002-12-23 at 20:51, Marc Spitzer wrote:
 On Mon, 23 Dec 2002 19:14:33 -0500
 Lamar Owen [EMAIL PROTECTED] wrote:

  Having been no bug reports on 3.5beta1, 3.5 is now released.  The only
  change from 3.5beta1 is to comments, the README, and the ChangeLog.
  No code has changed.
 

 will this work with the aolserver 4 also?

 thanks

 marc
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] AOLserver Project Update

2002-11-11 Thread Brett Schwarz
On Mon, 2002-11-11 at 10:22, Jeff Hobbs wrote:
  Tcl arrays are associative.  Tcl has pretty much 3 data structures:
 
  - scalars
  - lists
  - arrays (which are associative)
 
  The trick is that a list is really just a scalar with whitespace between
  the elements, unless the element is enclosed by braces, so there's really
  only two.

 Woah, that last part isn't true at all, and is a common misconception
 that leads people to think Tcl isn't up-to-snuff, which isn't true.

 Lists are preserved in Tcl as arrays of Tcl_Obj's.  If I do the following:

 proc makeList {size} {
 set output 

Is there any difference in initializing output to list at first, or is
there no difference. IOW, should I initialize 'output' to a list object,
or does 'set output ' just create an untyped object?

   set output [list]  --- does this have any affect?

thanks,

--brett


--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] Good reading: Yahoo moving to PHP

2002-10-30 Thread Brett Schwarz
I know there were problems with threads/Java/Linux at one point (not
sure if it was fixed). I think that's why there came about this green
threads and native threads variants. Not sure if the same limitation
is on FreeBSD. I *think* the problem was that it actually wouldn't
distribute the threads across multiple CPUs, or something like thatI
just faintly remember...

--brett


On Wed, 2002-10-30 at 06:54, Ayan George wrote:
 Jim,

 A library threads implementation doesn't
 necessarily mean poor performance.  On a single
 CPU machine, it can actually be more effecient
 than a kernel implementation.  Although the use
 of user threads precludes scaling threads across
 CPUs I think the FreeBSD threads library works
 well.

 Not to start a discussion about pthreads
 implementations, I just wanted to note that
 library implementations do not inherently perform
 poorly.

 -Ayan

 On Wed, 30 Oct 2002, Jim Davidson wrote:

 
  In a message dated 10/30/02 9:03:22 AM, [EMAIL PROTECTED] writes:
 
 
   The article mentions that they stayed away from Java because of the thread
   implementation on FreeBSD (presumably 4.x).  Given that AOLserver uses
   threads heavily, does anyone have experience running it under FreeBSD?  Is
   it OK?  OK under load?
  
 
  Hi,
  I do some of the aolserver development on my FreeBSD laptop but I wouldn't
  run it there - default threads are user based which perform poorly.   You can
  get AOLserver to link against a port of Linux threads which emulate system
  clone() based threads with BSD rfork() which may perform better.
  -Jim
 
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] ns_get_multipart_formdata

2002-09-04 Thread Brett Schwarz

Just curious, 'file tail' did not work for you? I thought it worked
cross platform...

--brett


On Wed, 2002-09-04 at 07:37, [EMAIL PROTECTED] wrote:
 In a message dated 9/4/2002 10:08:21 AM Eastern Daylight Time,
 [EMAIL PROTECTED] writes:


  Will someone give me a working example of how to upload a file?



 First I wrote a proc (below) to drop the path and get the filename by itself.
  I'm sure can be tweaked if I were to use string last instead of string
 first, but for the most part it works for me.  Also I have not tried this on
 a non-windows machine so I'm not sure how it accomodates other platforms'
 pathing schemas. I'm sure someone can fix it if it doesn't, though :)   Since
 100% of the users of the applications I write are on windows, it hasn't been
 a priority to check that!

 At any rate, once you have the file name by itself, you need to access the
 uploaded data and copy that to wherever you want to put it.  Posted file data
 can be accessed through file_control_name.tmpfile. In the example below, the
 file upload control on the form is named f.

 snip

 set myfile [dropPathDOS [ns_queryget f]]

 #convert spaces in win32 filename to underscore
 regsub -all   $myFile _ myFile

 ns_cp [ns_queryget f.tmpfile] [ns_info pageroot]/my_uploads_folder/$myFile




 proc dropPathDOS { filepath } {

 #
 #   #
 # Drops the path from a DOS path\file name  #
 #   #
 #

 set lastSlash 0

 while { $lastSlash = 0 } {

 set filepath [string range $filepath [expr $lastSlash + 1] end]

 set lastSlash [string first \\ $filepath]

 }

 return $filepath

 }
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] TCL varying arg lists

2002-05-25 Thread Brett Schwarz

Try using 'eval'. It will expand the list for you and feed it to the
proc. So, for

proc xyzzy1 {arg1 args} {
  return [eval xyzzy0 $arg1 $args]
}

proc xyzzy2 {arg1 args} {
  return [eval xyzzy1 $arg1 $args]
}

You could also for xyzzy0 and xyzzy1, use a variable instead of 'args',
and treat that variable as a list. This would work unless these procs
are used elsewhere, where there truly is an unknown number of arguments.


HTH,

--brett



On Sat, 2002-05-25 at 14:28, [EMAIL PROTECTED] wrote:
 TCL (we're on 7.6) has a special variable name args for variable
 arguments.  It seems to work fine for 1 level, but I'm confused if/how
 it can be used for multiple procedure levels since it listifies its
 argument on every procedure call.

 For example, in this test program, passing args to lower level
 procedures keeps modifying the argument, but I really want it to stay
 the same:

 proc xyzzy0 {arg1 args} {
   return 
 arg1=$arg1
 args=$args
 llength=[llength $args]
 1st el=[lindex $args 0]
 
 }

 proc xyzzy1 {arg1 args} {
   return [xyzzy0 $arg1 $args]
 }

 proc xyzzy2 {arg1 args} {
   return [xyzzy1 $arg1 $args]
 }

 ns_return 200 text/plain 
 xyzzy0: [xyzzy0 a1 a2 a3 a4 a5]

 xyzzy1: [xyzzy1 a1 a2 a3 a4 a5]

 xyzzy2: [xyzzy2 a1 a2 a3 a4 a5]
 
 return


 Here's the output:

 xyzzy0:
 arg1=a1
 args={a2 a3} {a4 a5} --- this one is what I expected
 llength=2
 1st el=a2 a3


 xyzzy1:
 arg1=a1
 args={{a2 a3} {a4 a5}}
 llength=1
 1st el={a2 a3} {a4 a5}


 xyzzy2:
 arg1=a1
 args={{{a2 a3} {a4 a5}}}
 llength=1
 1st el={{a2 a3} {a4 a5}}


 Is there a way to unlistify $args before passing it to a lower level
 proc?  Or is there a better/right way to do this?

 Any advice appreciated.

 Jim
--
Brett Schwarz
brett_schwarz AT yahoo.com



Re: [AOLSERVER] lappend_unique in C ?

2002-05-04 Thread Brett Schwarz

You may want to look at TclX extension. Either try to load it into AS, or
look at the C code to customize it to your liking. It has extra list
functions as well as keyed lists.

http://tcl.activestate.com/man/tclx8.2/TclX.n.html



On Fri, 3 May 2002 20:44:19 -0400
Andrew Piskorski [EMAIL PROTECTED] wrote:

 I sometimes need to assemble a list of unique values, while preserving
 the order of the list.  So when creating the list, I append a value to
 a list, but only if the value isn't already on the list.  In Tcl,
 usually I do this with the bb_lappend_uniq procedure below.  It uses a
 helper Tcl array to maintain the state info of what values are already
 on the list - presumably this is faster than calling lsearch every
 time.

 But does anyone have something to generate the same unique Tcl list,
 but implemented in C?  Or something else similar?

 Reason I care, is I have lots of key/value pairs, and each key is made
 up several strings concatenated together.  For discussion, we'll
 assume each key has the structure ABCD.  And what I need, is a list
 of all the unique SUB-keys AB.  Right now, I do that in Tcl.  But
 that extra pass of grubbing through all my keys is dominating my
 execution time - and it's too slow.  (There's regexp involved, etc.)

 But, I'm generating all those keys and sub-keys myself in my C code,
 so rather than tuning my Tcl, the obvious thing to do is to assemble
 my unique list of subkeys right there in C, and thus avoid having to
 iterate through all my data an extra time in Tcl.

 Note I still want to end up with a Tcl list of unique sub-keys, I just
 want the implementation done in C.  It would be extra nice if I could
 pass in a Tcl array or NSV name from Tcl to maintain the state of
 what's already on the list, because then I could pre-populate it if I
 wanted to, in order to append to an already existing list, etc.  But
 that's frosting really, it'd be ok if the C code always starts with an
 empty list and the state array/nav isn't accessible to anything
 outside my C function.

 Well, I've probably rambled on too long about something so simple, but
 before I start implementing my simple solution (using Tcl_AppendResult
 and a TclHashTable to maintain list state, I think), I figured I'd ask
 if anyone else has already done it...

 And of course, maybe somebody will point out some entirely different
 and better way to do this, instead.  :)


 ad_proc bb_lappend_uniq {{
-key_prefix {}
 } list_name item_name luniq_state_arr_name} {

Appends an item to a list emonly/em if that item is not already
on the list.  In order to avoid doing an lsearch of the whole list
for every single lappend, takes a helper state array which is
emmust/em alrady have an array variable defined for each item
already on the list, if the list is not empty.

 } {
upvar 1 $list_name  L
upvar 1 $item_name  item
upvar 1 $luniq_state_arr_name  arr

if { [info exists arr(${key_prefix}${item})] } {
   # Do nothing, this left_key is already on the list.
} else {
   lappend L $item
   set arr(${key_prefix}${item}) 1
}
 }

 ad_proc bb_luniq {L} {
Returns a list with all duplicates removed, and keeping the
original order.
p
Code taken from the
a href=http://mini.net/tcl/526.html;Tcl'ers Wiki/a
 } {
set t {}
foreach i $L {if {[lsearch -exact $t $i]==-1} {lappend t $i}}
return $t
 }

 --
 Andrew Piskorski [EMAIL PROTECTED]
 http://www.piskorski.com



Re: [AOLSERVER] Exposing API's to other modules?

2002-01-03 Thread Brett Schwarz

 One of Ousterhout's greater contributions was the documentation of his
 team's programming standards.  I apologize for ending this message
without
 the link.  But if they're not there already, maybe the AOLserver.com
folks
 could link to them from their site.


maybe this link?

http://tcl.activestate.com/doc/


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Re: [AOLSERVER] 3.4 memory usage

2001-10-17 Thread Brett Schwarz

Ok, I must have missed something, or might have been off of the cluetrain too long, 
but what exactly is 'zippy'? I did a google search, but I was getting mostly 'zippy 
the pinhead' and other weird stuff!

Anyone have an URL or explanation?

thanks,

--brett


On Wed, 17 Oct 2001 09:54:25 -0500
Rob Mayoff [EMAIL PROTECTED] wrote:

 +-- On Oct 17, Jim Wilcoxson said:
  In glancing at the zippy code, it looks like it used a power-of-2
  algorithm, so I figured it might cause less heap fragmentation.  I
  think that might be at least some of the problem.  Does the standard
  gnu/linux memory allocator handle fragmentation poorly/well?

 I think the standard Linux allocator is dl-malloc, which as I recall has
 pretty good fragmentation properties.

 The reason zippy may use more memory is that it keeps a separate pool
 of memory for each thread.  This reduces lock contention but means that
 less free memory is shared between threads.

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



[AOLSERVER] OT: content management

2001-09-14 Thread Brett Schwarz

This is a bit off topic, but I thought some people on this list might
know:

I have a web site that links to video clips; such that when someone
clicks on them, it invokes the player, and streams the video clip. What
is the best way to update those video clips such that it does not
interrupt any streaming, or corrupt any of the files. I guess this could
be said for content in general, but this is my situation.

Any insight would be appreciated.

thanks,

--brett

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Re: [AOLSERVER] Configure tcl for AolServer 3.4

2001-08-23 Thread Brett Schwarz

I have seem some of my tcl files not returning correctly, when I don't
send back proper HTML headers... are your tcl files sending back HTML
headers?


Mark Hubbard wrote:

 I have the same trouble actually.  I made param enabletclpages true and
 restarted the server, but it didn't seem to make any difference.  It serves
 out .tcl files as-is, and then my tcl plug-in in my IE tries to run them,
 which of course fails.
 --
 Mark Hubbard: [EMAIL PROTECTED]
 Microsoft Certified Professional
 Knowledge is Power.

 -Original Message-
 From: rana deepti [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Thursday, August 23, 2001 6:39 AM
 Subject: Configure tcl for AolServer 3.4

 I've successfully installed AOLServer on WindowsNT
 according to Mark's Instructions.
 but now I want to run a tcl file.
 and I'm not able to do so
 I've no idea about tcl.
 how to configure it
 need helpregards...
 Deppti
 
 
 __
 Do You Yahoo!?
 Make international calls for as low as $.04/minute with Yahoo! Messenger
 http://phonecard.yahoo.com/

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Re: [AOLSERVER] Easy way to get raw POST data into a tcl variable?

2001-07-26 Thread Brett Schwarz

Just curious, is there a *rough* estimate on when AOLserver 4 will be
out? I am not trying to push, just want a ball park figure (days, weeks,
months, etc).

thanks,

--brett


Kriston Rehberg wrote:

 I've been given to understand that it's because the functions that handle
 data coming in from the client gobble up the data and don't leave it behind
 in an intact form.  AOLserver 4 is going to allow seeking around the
 incoming data, headers and all.

 Kris

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Re: [AOLSERVER] aolserver weekly chat

2001-06-14 Thread Brett Schwarz

Rob,

I would like to hop on, but I don't have anything
specific to say. I have never used AIM...do you have
to be a AOL member to use it? Is there a linux client?

thanks,

--brett

--- Rob Mayoff [EMAIL PROTECTED] wrote:
 There used to be a weekly AOLserver chat on AIM. I
 can't find mention of
 it on aolserver.com now. As I recall, it used to be
 from 4 PM to 5 PM US
 Eastern time on Thursdays, in chat room AOLserver.

 I guess if nobody shows up I'll assume that it's
 been disbanded.

 I'll hang out there for an hour, so if you can't
 figure out how to get
 into the chat room, AIM me (quixotus) and I'll
 invite you.

 The time is 20:00 UTC, which is 4 PM US/Eastern, 3
 PM US/Central, 1 PM
 US/Pacific.


__
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/