Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-10 Thread Sam Tregar
Thanks - it wasn't clear to me which comments earlier were from maintainers
and which from interested bystanders.  No patch will ever be universally
loved, so I thought I'd try to figure out which changes needed to be made.

Sam


On Thu, Mar 9, 2017 at 2:26 PM, William A Rowe Jr <wr...@rowe-clan.net>
wrote:

> On Thu, Mar 9, 2017 at 3:23 PM, Sam Tregar <s...@tregar.com> wrote:
> > I'm not totally clear on who's maintaining Apache::Test.
> >
> > If not, what changes would you need to take it?
>
> Refer back to my earlier comments. There is very little chance that any
> specific vendor deviations will be accommodated at the ASF. Once broken
> without community consensus, the vendor owns their choices. That said...
>
> There's a very good chance that making variable lookup more abstract
> in a way that allows all builders to inform Apache::Test and all other
> consumers of specific resources (through apachectl, apxs and similar)
> will be readily accepted. Please look at Eric's answer for a next step.
>
> In answer to your root question, Apache::Test is under the perl.apache.org
> PMC's domain.
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-10 Thread Sam Tregar
No it does not.  Ubuntu and Debian still error:

waiting 60 seconds for server to start: .AH00534: apache2: Configuration
error: No MPM loaded.


I think this could be fixed by just the part of my patch that allowed for
IncludeOptional in addition to Include when finding sub-confs for
inheriting the parts that load an MPM.  I'll work up a patch that switches
to apachectl and includes that.  Thanks!

Sam

On Thu, Mar 9, 2017 at 1:54 PM, Eric Covener <cove...@gmail.com> wrote:

> On Thu, Mar 9, 2017 at 4:23 PM, Sam Tregar <s...@tregar.com> wrote:
> > I'm not totally clear on who's maintaining Apache::Test.  If you are the
> > maintainer, can you say whether you'll take my patch to get the module
> > working on Debian and Ubuntu?  If not, what changes would you need to
> take
> > it?
>
> I think several of the responders can write to Apache::Test. But IMO
> the original patch ITT is not suitable, it duplicates a bunch of
> environment variables that are debian-specific. Does the framework
> work for you pass -httpd pointing to apachectl as in my previous post?
>
> --
> Eric Covener
> cove...@gmail.com
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-09 Thread Sam Tregar
I'm not totally clear on who's maintaining Apache::Test.  If you are the
maintainer, can you say whether you'll take my patch to get the module
working on Debian and Ubuntu?  If not, what changes would you need to take
it?

Thanks!

Sam


On Tue, Mar 7, 2017 at 11:15 AM, William A Rowe Jr 
wrote:

> On Tue, Mar 7, 2017 at 12:59 PM, Stefan Fritsch  wrote:
> > On Tuesday, 7 March 2017 11:17:57 CET Eric Covener wrote:
> >> On Tue, Mar 7, 2017 at 10:32 AM, William A Rowe Jr  >
> > wrote:
> >> > It seems we should have the framework process the bin/envvars (in the
> >> > normal path,  or /etc/apache2 in this case)... but that should be
> based
> >> > on retrieving the
> >> > pathname of bin/envvars from apxs, and apxs doesn't have this info (it
> >> > also does not have two distinct entitites for the progname and config
> >> > file name, requiring that both be overridden if the progname is
> changed.)
> >>
> >> Having a bit of trouble sorting out these two, but they don't seem to
> >> affect the conf filename
> >>
> >> Apache-Test/lib/Apache/TestConfig.pm
> >>   httpd   => 'server to use for testing (default is
> $bindir/httpd)',
> >> target  => 'name of server binary (default is apxs -q TARGET)',
> >>
> >> e.g. this works for me:
> >>
> >> perl Makefile.PL  -apxs ~/SRC/httpd-trunk/built/bin/apxs -httpd
> >> ~/SRC/httpd-trunk/built/bin/apachectl
> >
> > Yes, always using apachectl is probably the best solution. The
> alternative
> > would have been to call something like
> >
> > env -i sh -c '. /etc/apache2/envvars; env'
> >
> > from Apache::Test and parse the output. But one would have to find the
> envvars
> > file, first.
>
> On Fedora, this is apparently /etc/sysconfig/httpd - although reduced
> now to mostly
> a no-op, as the systemd service config handles overriding any defines
> or envvars...
>
> [Service]
> Type=notify
> Environment=LANG=C
> ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
> ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
>
> Agreed that apachectl solves a bunch of issues except SYSCONFDIR
> and conf file name... we can extract this like so...
>
> apachectl -V 2>/dev/null | sed "s# -D SERVER_CONFIG_FILE=##p;d;"
> "conf/httpd.conf"
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-07 Thread Sam Tregar
If you're looking for a stop-gap for Ubuntu, apply my patch and tests start
running.  :)

Or are you looking for a better stop-gap?  I'm happy to make changes if you
can explain what needs to work differently.

Sam


On Tue, Mar 7, 2017 at 7:32 AM, William A Rowe Jr <wr...@rowe-clan.net>
wrote:

> On Mon, Mar 6, 2017 at 3:11 PM, Sam Tregar <s...@tregar.com> wrote:
> > Are you suggesting that people who want to run tests that use
> Apache::Test
> > should know that they have to source /etc/apache2/envvars first?  Or
> that I
> > should patch Apache::Test to source that file instead of guessing which
> vars
> > to set?
> >
> > That file unsets HOME on Ubuntu and changes LANG to C, so if we tell
> people
> > to source it we should probably also tell them to logout afterwards.
>
> It seems we should have the framework process the bin/envvars (in the
> normal
> path,  or /etc/apache2 in this case)... but that should be based on
> retrieving the
> pathname of bin/envvars from apxs, and apxs doesn't have this info (it
> also does
> not have two distinct entitites for the progname and config file name,
> requiring
> that both be overridden if the progname is changed.)
>
> Because of a small delta between fedora's openssl x509 and my stock openssl
> build (and fedora's is found first on the path)... processing
> bin/envvars without
> loading it into the current console session would be a big win for me!
>
> I guess we aught to add both the envvars and distinct conffile defaults to
> the
> apxs utility, and then we can play catch-up in Apache::Test. Not sure what
> the
> stop-gap would be for Ubuntu short-term. WDYT?
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-06 Thread Sam Tregar
Are you suggesting that people who want to run tests that use Apache::Test
should know that they have to source /etc/apache2/envvars first?  Or that I
should patch Apache::Test to source that file instead of guessing which
vars to set?

That file unsets HOME on Ubuntu and changes LANG to C, so if we tell people
to source it we should probably also tell them to logout afterwards.

Sam


On Mon, Mar 6, 2017 at 12:23 PM, Stefan Fritsch <s...@sfritsch.de> wrote:

> On Friday, 3 March 2017 22:59:10 CET Sam Tregar wrote:
> > Hello all.  I've been working on getting Apache::Test running on Debian
> and
> > it's not going well.  One problem seems to be that Debian's system Apache
> > conf is not named what Apache::Test thinks it should be named
> (apache2.conf
> > vs httpd.conf).
> >
> > After solving that problem I hit a bigger one - the system apache2.conf
> > file shipped with Debian is quite peculiar.  It requires numerous
> > environment variables (i.e. APACHE_RUN_DIR, APACHE_USER, etc) which are
> set
> > in apache2ctl.
>
> These are set in /etc/apache2/envvars. You should simply source that file
> before running the test suite. Also, you can pass another config file name
> to
> the test suite. Maybe this helps:
>
> https://sources.debian.net/src/apache2/2.4.25-3/debian/
> tests/run-test-suite/
>
> (Though this is a rather quick and dirty hack that was done to get the test
> suite included in the next Debian stable release).
>
> > Worse, it doesn't define a ServerRoot and neither does apxs
> > have a value for prefix.
>
> I have done this patch to Apache::Test:
>
> http://svn.apache.org/viewvc?view=revision=1782838
>
> That seems to take care of most warnings about apxs.
>
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-06 Thread Sam Tregar
That seems like a reasonable solution.  Do you think we should switch to
using apachectl everywhere, or try to detect whether it's necessary?

Sam


On Mon, Mar 6, 2017 at 12:46 PM, Eric Covener  wrote:

> On Mon, Mar 6, 2017 at 3:23 PM, Stefan Fritsch  wrote:
> > These are set in /etc/apache2/envvars. You should simply source that file
> > before running the test suite. Also, you can pass another config file
> name to
> > the test suite. Maybe this helps:
>
> I can't remember/find the parm, but on one system I have been asking
> the test suite to use "apachectl" instead of "httpd" even with
> something much less complex then the debian layout.  This also saves
> the envvars from affecting the framework itself.
>
>
> --
> Eric Covener
> cove...@gmail.com
>


Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-03-04 Thread Sam Tregar
I have attached a patch for this issue and a few others I found while
trying to run tests on recent Debian and Ubuntu servers.  Please let me
know if you have any questions.

Part of this patch came from this Debian patch that seemingly hasn't gotten
back into the main distro:

https://sources.debian.net/patches/libapache2-mod-perl2/2.0.9~1624218-2%2Bdeb8u1/030-apxs-no-prefix.patch/

Sam


On Fri, Mar 3, 2017 at 10:59 PM, Sam Tregar <s...@tregar.com> wrote:

> Hello all.  I've been working on getting Apache::Test running on Debian
> and it's not going well.  One problem seems to be that Debian's system
> Apache conf is not named what Apache::Test thinks it should be named
> (apache2.conf vs httpd.conf).
>
> After solving that problem I hit a bigger one - the system apache2.conf
> file shipped with Debian is quite peculiar.  It requires numerous
> environment variables (i.e. APACHE_RUN_DIR, APACHE_USER, etc) which are set
> in apache2ctl.  Worse, it doesn't define a ServerRoot and neither does apxs
> have a value for prefix.
>
> Part of this bug appears in this bug report:
>
> https://rt.cpan.org/Public/Bug/Display.html?id=118445
>
> In short it seems like Apache::Test relies on the system Apache conf being
> fairly vanilla and sane, but the Debian/Ubuntu maintainers have different
> ideas.  I'm not sure what to do here - perhaps package up a very simple
> default config for Debian/Ubuntu and sub that in?
>
> Any help would be appreciated.  I'm happy to work up a patch if I can only
> figure out what needs to change.
>
> Thanks!
>
> Sam
>
>
>
diff -Naur Apache-Test-1.40.orig/lib/Apache/TestConfigParse.pm Apache-Test-1.40/lib/Apache/TestConfigParse.pm
--- Apache-Test-1.40.orig/lib/Apache/TestConfigParse.pm	2016-09-06 12:18:11.0 +
+++ Apache-Test-1.40/lib/Apache/TestConfigParse.pm	2017-03-04 23:20:40.335455514 +
@@ -87,8 +87,10 @@
'user-supplied $base' ],
  [ $self->{inherit_config}->{ServerRoot},
'httpd.conf inherited ServerRoot' ],
- [ $self->apxs('PREFIX'),
-   'apxs-derived ServerRoot' ]);
+ [ $self->apxs('PREFIX', 1),
+   'apxs-derived ServerRoot' ],
+  [ $self->apxs('SYSCONFDIR'),
+   'apxs-derived ServerRoot based on SYSCONFDIR' ]);
 
 # remove surrounding quotes if any
 # e.g. Include "/tmp/foo.html"
@@ -342,7 +344,7 @@
 
 (my $directive, $_) = split /\s+/, $_, 2;
 
-if ($directive eq "Include") {
+if ($directive eq "Include" or $directive eq "IncludeOptional") {
 foreach my $include (glob($self->server_file_rel2abs($_))) {
 $self->inherit_config_file_or_directory($include);
 }
@@ -456,13 +458,31 @@
 my $httpd = $self->{vars}->{httpd};
 return unless $httpd;
 
+# to run this on Debian/Ubuntu's default install we need a few
+# extra env vars, which are setup by apache2ctl - it's not
+# terribly important that we get these right, we're not trying to
+# run the server, but we'll get warnings if we're too far off.
+# Seems harmless to define them for everyone, but we could add a
+# check here to try to guess if they're needed, perhaps by running
+# httpd -V and checking the output.
+$ENV{APACHE_RUN_DIR} = $self->server_file_rel2abs('');
+$ENV{APACHE_PID_FILE} = $self->server_file_rel2abs('/tmp/apache2.pid');
+$ENV{APACHE_LOG_DIR} = $self->server_file_rel2abs('/tmp');
+$ENV{APACHE_LOCK_DIR} = $self->server_file_rel2abs('/var/lock/apache2');
+$ENV{APACHE_RUN_USER} = getpwuid($<);
+$ENV{APACHE_RUN_GROUP} = getgrgid($();
+
 $httpd = shell_ready($httpd);
 my $cmd = "$httpd -V";
 
 my $httpdconf = $self->{vars}->{httpd_conf};
 $cmd .= " -f $httpdconf" if $httpdconf;
 
-my $serverroot = $self->{vars}->{serverroot};
+# use server_file_rel2abs so we can check a few possible places
+# Apache might be hiding its prefered ServerRoot.  We need to get
+# this right for Debian/Ubuntu to work since they don't set a
+# ServerRoot in their file and then do relative includes
+my $serverroot = $self->server_file_rel2abs('');
 $cmd .= " -d $serverroot" if $serverroot;
 
 my $proc = $self->open_cmd($cmd);
diff -Naur Apache-Test-1.40.orig/lib/Apache/TestConfig.pm Apache-Test-1.40/lib/Apache/TestConfig.pm
--- Apache-Test-1.40.orig/lib/Apache/TestConfig.pm	2016-09-06 12:18:11.0 +
+++ Apache-Test-1.40/lib/Apache/TestConfig.pm	2017-03-04 23:06:58.962892758 +
@@ -442,6 +442,13 @@
 
 if ($vars->{conf_dir}) {
 $vars->{httpd_conf} ||= catfile $vars->{conf_dir}, 'httpd.conf';
+
+# recent Debian/Ubuntu di

Problems using Apache::Test on Debian (and Ubuntu)

2017-03-03 Thread Sam Tregar
Hello all.  I've been working on getting Apache::Test running on Debian and
it's not going well.  One problem seems to be that Debian's system Apache
conf is not named what Apache::Test thinks it should be named (apache2.conf
vs httpd.conf).

After solving that problem I hit a bigger one - the system apache2.conf
file shipped with Debian is quite peculiar.  It requires numerous
environment variables (i.e. APACHE_RUN_DIR, APACHE_USER, etc) which are set
in apache2ctl.  Worse, it doesn't define a ServerRoot and neither does apxs
have a value for prefix.

Part of this bug appears in this bug report:

https://rt.cpan.org/Public/Bug/Display.html?id=118445

In short it seems like Apache::Test relies on the system Apache conf being
fairly vanilla and sane, but the Debian/Ubuntu maintainers have different
ideas.  I'm not sure what to do here - perhaps package up a very simple
default config for Debian/Ubuntu and sub that in?

Any help would be appreciated.  I'm happy to work up a patch if I can only
figure out what needs to change.

Thanks!

Sam


[Bug 1612004] [NEW] Dual batteries producing incorrect estimates of remaining power

2016-08-10 Thread Sam Tregar
Public bug reported:

My laptop (a Lenovo T560) has two batteries.  They show correctly when I
click on the power manager plugin - for example one might say 21%
remaining 25 minutes and the other might show 5% remaining 15 minutes
left.  However, when I hover over the battery I see 11% remaining 20
minutes.  Instead of the correct 40 minutes left.  It appears that the
two batteries are being averaged together but that's not how this laptop
works - it runs one battery down and then switches to the other, so the
available power should be added together not averaged.

I am running Xubuntu 16.04.1 fully updated as I write.

Please let me know if I can provide additional information.

** Affects: xfce4-power-manager (Ubuntu)
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1612004

Title:
  Dual batteries producing incorrect estimates of remaining power

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1612004/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: PAUSE permissions clash between HTML::Template::DEFAULT and HTML::Template::Default

2016-08-09 Thread Sam Tregar
That's fine - there's no upside to indexing these inner classes, they're
entirely internal and don't have a public API.  Thanks!

Sam


On Tue, Aug 9, 2016 at 5:05 PM, Neil Bowers  wrote:

> Hi Sam and Michael,
>
> I’m one of the PAUSE admins. I’m emailing you because I’m working on
> resolving conflicts caused by PAUSE now considering package names case
> insensitively. This has left us with some situations where two or more
> people are owners of namespaces previously considered distinct, and now
> considered the same.
>
> The HTML::Template module defines a number of inner classes, including
> HTML::Template::DEFAULT. These aren’t currently being indexed, because
> Michael (WONKO), who’s done the recent releases, doesn’t have permission
> for them. So HTML::Template::DEFAULT is still indexed against the last
> release SAMTREGAR did, 2.9.
>
> This now conflicts with HTML::Template::Default, which is owned by
> LEOCHARRE, and included in his HTML-Template-Default.
>
> Given these are inner classes, the easiest way to resolve this is to tell
> PAUSE not to index any of the inner classes. Then I’ll be able to drop
> SAMTREGAR’s ownership of HTML::Template::DEFAULT.
>
> The easiest way to do this is to add the following to dist.ini
>
> [MetaNoIndex]
> package = HTML::Template::COND
> package = HTML::Template::DEFAULT
> package = HTML::Template::ESCAPE
> package = HTML::Template::JSESCAPE
> package = HTML::Template::LOOP
> package = HTML::Template::NOOP
> package = HTML::Template::PRINTSCALAR
> package = HTML::Template::URLESCAPE
> package = HTML::Template::VAR
>
> I could then drop permissions on HTML::Template::DEFAULT, once there’s a
> new release on CPAN, we can schedule deletion of the old releases.
>
> Are you ok to do this?
>
> PAUSE doesn’t let situations like this occur any more — I’m working
> through the existing cases resolving them.
>
> Cheers,
> Neil
>
>


Re: Requesting COMAINT on HTML::Template

2016-04-29 Thread Sam Tregar
Hey Steve - sorry to be slow getting back to you.  I just reached out to
Michael to get commit on the repo (his email address has changed I think,
since he's no longer at PlusThree).  I can make the change you're asking
for.

Sam


On Thu, Apr 28, 2016 at 10:30 AM, Steve Bertrand <steve.bertr...@gmail.com>
wrote:

> Just a follow up to check the status of my request below.
>
> The problem still persists, and I haven't heard anything from the current
> maintainers.
>
> Cheers,
>
> Steve
>
>
> -- Forwarded message --
> From: Steve Bertrand <steve.bertr...@gmail.com>
> Date: Thu, Apr 14, 2016 at 10:07 AM
> Subject: Requesting COMAINT on HTML::Template
> To: modu...@cpan.org
> Cc: Sam Tregar <s...@tregar.com>, mpet...@plusthree.com
>
>
> Said module has had an outstanding bug (
> https://rt.cpan.org/Public/Bug/Display.html?id=98029) since v5.20. It
> uses CGI, but this module is not listed as a prereq, and since CGI was
> removed from core, this module fails on 5.20+.
>
> I'd like to get this issue corrected. I attempted to contact the
> authors/maintainers (cc'd) late last month.
>
> My PAUSE ID is STEVEB.
>
> Cheers,
>
> Steve
>
>


onlinepayment v1.0.0 released

2010-03-22 Thread Sam Tregar
onlinepayment v1.0.0 - a generic Python API for making online payments

This module provides an API wrapper around a variety of payment
providers.  Using this module you can write code that will work the
same regardless of the payment provider in use.

Examples::

   from onlinepayment import OnlinePayment

   # connect to authorize.net, setup auth with login and key
   auth= { 'login': 'YOUR LOGIN HERE',
   'key':   'YOUR KEY HERE' }

   op = OnlinePayment('authnet', test_mode=True, auth=auth)

   # or for paypal, setup auth with user, pass, vendor and product:
   auth= { 'username': 'YOUR USERNAME HERE',
   'password': 'YOUR PASSWORD HERE',
   'vendor':   'YOUR VENDOR HERE',
   'product':  'YOUR PRODUCT HERE' }

   # connect to PayPal
   op = OnlinePayment('paypal', test_mode=True, auth=auth)

   # charge a card
   try:
   result = op.sale(first_name = 'Joe',
last_name  = 'Example',
address= '100 Example Ln.',
city   = 'Exampleville',
state  = 'NY',
zip= '10001',
amount = '2.00',
card_num   = '400700027',
exp_date   = '0530',
card_code  = '1234')

   except conn.TransactionDeclined:
  # do something when the transaction fails

   except conn.CardExpired:
  # tell the user their card is expired

   except conn.ProcessorException:
  # handle all other possible processor-generated exceptions generically

   # examine result, the values returned here are processor-specific
   success  = result.success
   code = result.code
   message  = result.message
   trans_id = result.trans_id

   # you can get the raw data returned by the underlying processor too
   orig = result.orig

Installation


Before you can use this module you must install one or more payment
processors.  To install the PayPal payflowpro package::

  # easy_install pytz
  # easy_install python-payflowpro

To install the zc.authorizedotnet package and the authorize package
(for recurring support)::

  # easy_install zc.authorizedotnet
  # easy_install authorize

If you want authorize.net support you'll need to install a patched
version of zc.ssl.  Hopefully someday this will be released by the
Zope devs, but so far I haven't heard anything back.  Download the
zc.ssl source package from http://pypi.python.org/pypi/zc.ssl/, then
unpack::

  # tar zxvf zc.ssl-1.1.tar.gz
  # cd zc.ssl-1.1

Now download and apply my zc-ssl-timeout.patch::

  # wget
http://python-onlinepayment.googlecode.com/svn/trunk/zc-ssl-timeout.patch
  # patch -p1  /zc-ssl-timeout.patch

And install the patched module::

  # python setup.py install

(You may also need to edit setup.py and remove the
'ssl-for-setuptools' dependecy.  I did, although it may be a quirk of
my Python install rather than a general problem.)

Once you have a payment processor you can install this module::

  # easy_install onlinepayment

For more information see: http://pypi.python.org/pypi/onlinepayment/1.0.0
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[ANN] onlinepayment v1.0.0 released

2010-03-21 Thread Sam Tregar
onlinepayment v1.0.0 - a generic Python API for making online payments

This module provides an API wrapper around a variety of payment
providers.  Using this module you can write code that will work the
same regardless of the payment provider in use.

Examples::

   from onlinepayment import OnlinePayment

   # connect to authorize.net, setup auth with login and key
   auth= { 'login': 'YOUR LOGIN HERE',
   'key':   'YOUR KEY HERE' }

   op = OnlinePayment('authnet', test_mode=True, auth=auth)

   # or for paypal, setup auth with user, pass, vendor and product:
   auth= { 'username': 'YOUR USERNAME HERE',
   'password': 'YOUR PASSWORD HERE',
   'vendor':   'YOUR VENDOR HERE',
   'product':  'YOUR PRODUCT HERE' }

   # connect to PayPal
   op = OnlinePayment('paypal', test_mode=True, auth=auth)

   # charge a card
   try:
   result = op.sale(first_name = 'Joe',
last_name  = 'Example',
address= '100 Example Ln.',
city   = 'Exampleville',
state  = 'NY',
zip= '10001',
amount = '2.00',
card_num   = '400700027',
exp_date   = '0530',
card_code  = '1234')

   except conn.TransactionDeclined:
  # do something when the transaction fails

   except conn.CardExpired:
  # tell the user their card is expired

   except conn.ProcessorException:
  # handle all other possible processor-generated exceptions generically

   # examine result, the values returned here are processor-specific
   success  = result.success
   code = result.code
   message  = result.message
   trans_id = result.trans_id

   # you can get the raw data returned by the underlying processor too
   orig = result.orig

Installation


Before you can use this module you must install one or more payment
processors.  To install the PayPal payflowpro package::

  # easy_install pytz
  # easy_install python-payflowpro

To install the zc.authorizedotnet package and the authorize package
(for recurring support)::

  # easy_install zc.authorizedotnet
  # easy_install authorize

If you want authorize.net support you'll need to install a patched
version of zc.ssl.  Hopefully someday this will be released by the
Zope devs, but so far I haven't heard anything back.  Download the
zc.ssl source package from http://pypi.python.org/pypi/zc.ssl/, then
unpack::

  # tar zxvf zc.ssl-1.1.tar.gz
  # cd zc.ssl-1.1

Now download and apply my zc-ssl-timeout.patch::

  # wget
http://python-onlinepayment.googlecode.com/svn/trunk/zc-ssl-timeout.patch
  # patch -p1  /zc-ssl-timeout.patch

And install the patched module::

  # python setup.py install

(You may also need to edit setup.py and remove the
'ssl-for-setuptools' dependecy.  I did, although it may be a quirk of
my Python install rather than a general problem.)

Once you have a payment processor you can install this module::

  # easy_install onlinepayment

For more information see: http://pypi.python.org/pypi/onlinepayment/1.0.0
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unreadable external LCD after upgrade to 2.6.32

2010-03-10 Thread Sam Tregar
Thanks, that works perfectly.

-sam

On Tue, Mar 9, 2010 at 4:14 PM, Konstantin Svist fry@gmail.com wrote:

 On 03/09/2010 01:12 PM, Sam Tregar wrote:
  Hey all.  I've got a Dell Latitude E1505 running Fedora F12.  I just
  updated to 2.6.32.9-67.fc12.i686 today and as soon as I rebooted my
  external LCD was unreadable.  It had wavy vertical lines all over it
  and appeared to have less than the full vertical resolution.  The
  laptop LCD looked fine.
 
  After checking the cable, power-cycling the monitor and reseting its
  settings, and rebooting a few times didn't help, I booted back
  into 2.6.31.12-174.2.22.fc12.i686 and all was well again.  Any ideas
  what could cause this and what I might do to fix it?
 
  The display chip on this laptop is an ATI Radeon Mobility X1400 and
  I'm using the radeon driver.  Let me know if I can provide anything
  that might help - X logs, dmesg, whatever.
 
  Thanks!
  -sam
 

 I have the same laptop.
 What you need to do is add nomodeset to your kernel parameters in
 /boot/grub/grub.conf


 --
 users mailing list
 users@lists.fedoraproject.org
 To unsubscribe or change subscription options:
 https://admin.fedoraproject.org/mailman/listinfo/users
 Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


Unreadable external LCD after upgrade to 2.6.32

2010-03-09 Thread Sam Tregar
Hey all.  I've got a Dell Latitude E1505 running Fedora F12.  I just updated
to 2.6.32.9-67.fc12.i686 today and as soon as I rebooted my external LCD was
unreadable.  It had wavy vertical lines all over it and appeared to have
less than the full vertical resolution.  The laptop LCD looked fine.

After checking the cable, power-cycling the monitor and reseting its
settings, and rebooting a few times didn't help, I booted back
into 2.6.31.12-174.2.22.fc12.i686 and all was well again.  Any ideas what
could cause this and what I might do to fix it?

The display chip on this laptop is an ATI Radeon Mobility X1400 and I'm
using the radeon driver.  Let me know if I can provide anything that might
help - X logs, dmesg, whatever.

Thanks!
-sam
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


Re: QuerySet without result_cache?

2009-08-28 Thread Sam Tregar
On Thu, Aug 27, 2009 at 8:18 PM, Alex Gaynor <alex.gay...@gmail.com> wrote:

>
> On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar<s...@tregar.com> wrote:
> > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor <alex.gay...@gmail.com>
> wrote:
> >>
> >> Instead of iterating over the QuerySet itself, use
> >> QuerySet.iterator(), this will avoid populating the result cache.
> >
> > Thanks, works great!  This would make a good addition to the manual
> section
> > that describes how the QuerySet cache system works.  Maybe I'll see about
> a
> > patch.
> >
> > -sam
> >
> >
> > >
> >
>
> Note that the iterator() method is documented in the QuerySet
> documentation:
> http://docs.djangoproject.com/en/dev/ref/models/querysets/#iterator


Good point.  If the description had used the word "cache" I might have even
found it when I was searching for a workaround.

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor  wrote:

>
> Instead of iterating over the QuerySet itself, use
> QuerySet.iterator(), this will avoid populating the result cache.
>

Thanks, works great!  This would make a good addition to the manual section
that describes how the QuerySet cache system works.  Maybe I'll see about a
patch.

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
Hey all.  So, I figured out how to run my QuerySet through MySQLdb's
SSCursor!  Woo!

Bad news: it's still using a ton of memory.  As far as I can tell it's being
used by QuerySet's internal _result_cache which is holding all the rows
retrieved by the query.  Is there any way to turn this cache off?  Looking
at the code leads me to think no, but I thought I'd ask.

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to control which DB connection and cursor a queryset will use

2009-08-27 Thread Sam Tregar
I'm trying to get a queryset to issue its query over a different DB
connection, using a different cursor class.  Does anyone know if that's
possible and if so how it might be done?  In psuedo-code:

  # setup a new db connection:
  db = db_connect(cursorclass=AlternateCursor)

  # setup a generic queryset
  qset = blah.objects.all()

  # tell qset to use the new connection:
  qset.use_db(db)

  # and then apply some filters
  qset = qset.filter(...)

  # and execute the query:
  for object in qset:
 ...

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Executing a queryset with MySQL's SSCursor cursor class

2009-08-26 Thread Sam Tregar
Hello all.  I'm wondering how I can tell Django to use
MySQLdb.cursors.SSCursor instead of the default MySQLdb.cursors.Cursor.  The
critical difference here is that SSCursor uses mysql_use_result and streams
data from the server rather than loading it all into memory at once.
Anybody know if that's possible?  My searches of the docs and code haven't
turned up much yet.

Thanks,
-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Online payment module

2009-08-04 Thread Sam Tregar
On Tue, Aug 4, 2009 at 4:25 PM, Kushal Kumaran 
kushal.kumaran+pyt...@gmail.com kushal.kumaran%2bpyt...@gmail.com wrote:


 Not really familiar with this area, but have you seen these?

 http://code.google.com/p/pypaypal/
 http://www.geteasyshop.com/front-page


Thanks, but neither of these are remotely what I'm looking for!  The first
is an API for accessing PayPal, but not the one I'll be using - this one has
only one release and hasn't been updated in over a year, looks basically
useless.  The other is a full-fledged e-commerce application, not a code
library.

-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Online payment module

2009-08-03 Thread Sam Tregar
Hello all.  I'm considering building a module to provide a
cross-payment-gatewat API for making online payments.  In the Perl world we
have a module like this called Business::OnlinePayment (
http://search.cpan.org/~jasonk/Business-OnlinePayment-2.01/OnlinePayment.pm).


Is there anything like this in Python?  My searches so far haven't turned up
anything.  If I don't find one I'll probably build one, covering PayPal and
Authorize.net to start.  If anyone is interested in discussing the project
and/or getting involved shoot me an email.

Thanks,
-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ImageField performance

2009-07-17 Thread Sam Tregar
On Fri, Jul 17, 2009 at 4:27 PM, Javier Guerra  wrote:

>
> On Fri, Jul 17, 2009 at 8:10 PM, Fredz./
> wrote:
> > I might be loading the image in memory, but it sure seems 1000x faster
> > when you reach images the size of 10 megs and more.
>
> this assumes that it would have to read the whole file anyway.  some
> formats have the size info in a header on the first few KBs.  i
> believe on those cases PIL can give the info as soon as possible.
>

Which does invite the question - what format is this monster 35MB image in?
Maybe if you choose a smarter format the size info will be in the header!

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-17 Thread Sam Tregar
On Fri, Jul 17, 2009 at 3:23 PM, Dudley Fox  wrote:

>
> Should I have posted this to the developer's list? I ask because I
> have received no responses yet. Not even a "...you shouldn't do that."
> :)


I can help you with that - you shouldn't do that.   Instead you should
create a new model for friends and link users to friends with a one-to-many
relation.  Each friend can have a single character field for their name,
which will give you a list of strings (friends) attached to each user.

Does that make sense?

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: home page caching

2009-07-13 Thread Sam Tregar
On Mon, Jul 13, 2009 at 3:34 PM, Ramdas S  wrote:

> I have a web site where around 15 SQL semi complex queries run on the home
> page. Traffic is increasing and the page loads are getting slower. What is
> the best way to cache just the home page. I have already done standard
> memcached on the server.
>
> Please suggest the best caching options, where we can have page loads (home
> page is about 100 K with the ads). I have fine tuned everything possible
> from client side, like minimifying javascripts/css files and using right
> graphic formats.
>

I'm a beginner with Django, so I'm curious to hear about Django-specific
approaches.  However, a more general approach would be to put your site
behind a caching proxy like Squid (http://www.squid-cache.org/).  Then all
you need to do is configure Squid to cache your home-page output for
whatever period you require.  One way to do that is entirely with Squid, but
another would be to modify your app to output HTTP cache control headers
(Expires, Cache-Control, etc).  I'm not sure how to do that in Django but I
imagine it shouldn't be too hard.

-sam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Your Favorite Python Book

2009-05-15 Thread Sam Tregar
Thanks for the suggestions everyone!  I've got a copy of Core Python 2nd
Edition on the way.

-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Difference between list() and [] with dictionaries

2009-05-15 Thread Sam Tregar
Hello all.  Can anyone explain why this creates a list containing a
dictionary:

  [{'a': 'b', 'foo': 'bar'}]

But this creates a list of keys of the dictionary:

  list({ a: b, foo: bar })

I expected them to be equivalent but clearly they're not!  I'm using Python
2.6.1 if that helps.

-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New to python, can i ask for a little help?

2009-05-12 Thread Sam Tregar
On Wed, May 13, 2009 at 12:18 AM, warhammer1...@gmail.com 
warhammer1...@gmail.com wrote:

 Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
 (Intel)] on win32
 Type copyright, credits or license() for more information.
  print hello world!
 SyntaxError: invalid syntax (pyshell#0, line 1)
 

 Can anyone tell me what is wrong? I didnt expect that error


Try:

  print(hello world!)

I believe Python 3 requires parenthesis for print.  Someone else can explain
why perhaps.

-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Your Favorite Python Book

2009-05-11 Thread Sam Tregar
Greetings.  I'm working on learning Python and I'm looking for good books to
read.  I'm almost done with Dive into Python and I liked it a lot. I found
Programming Python a little dry the last time I looked at it, but I'm more
motivated now so I might return to it.  What's your favorite?  Why?

-sam
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [htmltmpl] using cache

2009-03-24 Thread Sam Tregar
2009/3/24 mail...@comcast.net

 as a new user to html::templates i've found it pretty easy to use but
 quite slow.  i've turned on cache'ing but there is still no
 improvement and apache's log indicates that the files are being loaded
 each time.  so, what am i doing wrong?  i've included the perl code i
 use to create the template and the results shown in apache's log.
 this shows, i believe, that each file is being loaded each time it's
 referenced.  it also shows another problem, that i encounter every so
 often, that the file can't be found when, in fact, it's there.  if i
 simply reload the page the file is found the 2nd time.  very confusing.


Are you running mod_perl?  Are you pre-loading your cache during apache
startup as described in the docs?  And finally, what makes you sure
HTML::Template is the source of your performance problem?  It's actually
pretty rare in my experience.

-sam
--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] using cache

2009-03-24 Thread Sam Tregar
On Tue, Mar 24, 2009 at 5:39 PM, Dawid Joubert djspy...@gmail.com wrote:

  One problem you may find with the built-in caching is how it determines
 if a file has changed. It does this by getting the last modified time of the
 file and then comparing it to the cache version.

 You should look into whether the modification time is cached.


Good advice generally, but that doesn't appear to apply here.  The log
messages show the files coming back with the same cache signature.  I'm
guessing he's not running mod_perl which makes an in-memory cache pretty
useless, or he is and he's not pre-caching during startup.


 We wrote our own cache system with a preparser that used memcache. As we
 had over 10 webapps servers we only needed to store one copy of the template
 and that was on the memcached server.


Memcached is a neat system.

-sam
--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] using cache

2009-03-24 Thread Sam Tregar
2009/3/24 mailbin mail...@comcast.net

 thanks for the fast response, guys.  i really appreciate the help.  you're
 correct that i'm not running mod_perl.  i thought simply loading mod_perl
 was sufficient but obviously i was wrong, so i'm now in the process of
 puzzling how to get this mod_perl thingy working. :)


Cool.  The mod_perl mailing list is a good place for questions about that,
as is Perl Monks.  I think you'll find the speedup from using mod_perl is
way more helpful than caching templates!

-sam
--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


[xml] Parsing a particular HTML file causes parse_html_string to hang

2009-01-31 Thread Sam Tregar
Hello all.  I've hit a problem using libxml2 to parse HTML files.  Usually
everything works great, but on a particular input file I'm getting a hang
with the process hogging the CPU indefinitely until killed.  When I run it
through xmllint I see (aside from a bunch of run-of-the-mill HTML parsing
warnings):

  $ /usr/local/bin/xmllint --html fail.html
  fail.html:927: parser error : Excessive depth in document: change
xmlParserMaxDepth = 1024
  marcy playgroundbr /optionem

Then xmllint hangs, using 100% of the CPU until killed.

Another note - my first attempt to work around this was to add an alarm()
call before parsing, hoping to terminate the failed parse if it took too
long.  For some reason that didn't work - the alarm signal never reach my
signal handler.  Any ideas why?  I'm ok with the parser failing to parse bad
HTML - that's just a fact of life - but I can't allow it to hang
indefinitely!

This is libxml2 v2.6.30 on Linux:

  $ /usr/local/bin/xmllint --html --version
  /usr/local/bin/xmllint: using libxml version 20630
 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv
ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib


Would you like me to send in the killer file?  It's around 208k, so I didn't
think it would be very polite to send unasked-for.

Thanks for any help you can give me!

-sam
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [RDBO] ANNOUNCE: Rose::DB::Object 0.767 released

2008-02-17 Thread Sam Tregar
On Feb 15, 2008 4:56 PM, John Siracusa [EMAIL PROTECTED] wrote:

* Added the forget_related() helper method.


This wasn't added to the :all export set in Rose::DB::Object:::Helpers.
Intentional?

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Manager quiet about bad syntax

2008-02-17 Thread Sam Tregar
On Feb 17, 2008 3:36 PM, John Siracusa [EMAIL PROTECTED] wrote:

 Maybe, but as I've said I'm not really a fan of runtime parameter
 validation.


I'm a horrible typist which makes me a big fan.

Doing it in just one place may have a minimal impact, but
 then the question becomes, why isn't it done everywhere?  (Doing it
 everywhere adds significant overhead, both in terms of runtime cost
 and code bulk.)  Do we add it on a per-request basis every time
 someone mistypes a parameter name?  It's quite a sinkhole, IMO, which
 is why I do it nowhere: it's the egalitarian approach ;)


I think all public APIs should have validation.  Using it for complex
internal APIs can have value too, but it's definitely not as big a win.
I'll admit that I don't always follow this prescription, but the more
comfortable I get with Params::Validate the more often I use it.

I think the maintainance hastle of maintaining param checking code is
greatly reduced by using a module like Params::Validate.  It needs one hash
per method with one item per parameter.  Compared to maintaining POD
describing the parameters it's a breeze!

As far as runtime overhead, there's only one way to know for sure what it
would cost.  I'll play with it and report back.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Manager quiet about bad syntax

2008-02-14 Thread Sam Tregar
Hey all.  I'm working on adjusting to Rose from a long history with CDBI, so
I do this kind of thing a lot:

  $foos = My::Foo::Manager-get_foos(bar = big);

When I really mean:

  $foos = My::Foo::Manager-get_foos(query = [bar = big]);

This is a nasty bug since the first incorrect call doesn't croak() - it just
returns all the My::Foos!  Sometimes I don't notice right away that I'm
getting the wrong objects since my test set is small.  Shouldn't it
croak()?  I can see about a patch if so.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
On Feb 12, 2008 4:18 PM, John Siracusa [EMAIL PROTECTED] wrote:

 You need to strip() before freezing:


 http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Helpers.pm#strip


Thanks, that should help.  Any reason you didn't just bake this into a
default Storbable freeze hook?  If that sounds like a good idea I could try
cooking up a patch.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
On Feb 12, 2008 2:51 PM, John Siracusa [EMAIL PROTECTED] wrote:

 On Feb 12, 2008 2:28 PM, Sam Tregar [EMAIL PROTECTED] wrote:
  But if I pass the object through Storable:
 
  use Storable qw(freeze thaw);
  my $foo = freeze($object);
  my $obj = thaw($foo);
  $obj-some_method_that_doesnt_exist(foo);
 
  I get the completely nonsensical error:
 
  Can't store CODE items at ../../lib/Storable.pm (autosplit into
  ../../lib/auto/Storable/_freeze.al) line 287

 Are you sure that error is generated by the
 some_method_that_doesnt_exist() call and not the freeze() call?


Yes.  I can whip up a simple test case if need be.  Let me know if that
would help.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
Hello all.  I'm serializing some RDBO objects and it's causing some AUTOLOAD
confusion when I make a typo.  For example, without Storable this code:

  $object-some_method_that_doesnt_exist(foo);

Produces the expected error:

  Can't locate object method some_method_that_doesnt_exist via package
Whatever at /usr/lib/perl5/site_perl/5.8.5/Rose/DB/Object.pm line 1499

But if I pass the object through Storable:

use Storable qw(freeze thaw);
my $foo = freeze($object);
my $obj = thaw($foo);
$obj-some_method_that_doesnt_exist(foo);

I get the completely nonsensical error:

Can't store CODE items at ../../lib/Storable.pm (autosplit into
../../lib/auto/Storable/_freeze.al) line 287

In case it helps, I'm running the latest RDBO from CPAN, Storable 2.13 and
Perl v5.8.5.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] RDBO equivalent of Class::DBI's temp columns?

2008-02-06 Thread Sam Tregar
Hey all.  I'm working on migrating a Class::DBI system to RDBO and I'm
wondering how to implement temp columns.  In CDBI these are accessors that
behave like normal column accessors but don't store data in the database.
Weird, but sometimes useful.  Here's how they're setup in Class::DBI:

  __PACKAGE__-columns(TEMP = qw/foo bar baz/);

Is there a RDBO equivalent?

Thanks,
-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Stale results from relationship accessors

2008-02-01 Thread Sam Tregar
On Feb 1, 2008 5:50 PM, John Siracusa [EMAIL PROTECTED] wrote:

 To make an object forget a previously fetched set, just set it to undef:


Cool, that works for me.  Thanks!

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: FAIL XML-Validator-Schema-1.09 amd64-freebsd-thread-multi 6.2-release

2008-01-31 Thread Sam Tregar
On Jan 31, 2008 4:33 PM, [EMAIL PROTECTED] wrote:

 t/02yaml# No tests run!
 dubious
Test returned status 255 (wstat 65280, 0xff00)


You, like your compatriots, have a broken XML::SAX.  I just uploaded
v1.10with a check for this problem in
Makefile.PL.  Hopefully that will address the problem.

-sam


Re: FAIL XML-Validator-Schema-1.10 i86pc-solaris 2.10

2008-01-31 Thread Sam Tregar
On Jan 31, 2008 5:48 PM, bob walker [EMAIL PROTECTED] wrote:

 t/02yaml..# No tests run!
  Dubious, test returned 255 (wstat 65280, 0xff00)
  No subtests run


Huh.  I guess my attempts to screen this out in Makefile.PL didn't work.  I
guess it doesn't get run again after satisfying dependencies.

Oh well, email filter it is.

-sam


Re: FAIL XML-Validator-Schema-1.09 amd64-freebsd-thread-multi 6.2-release

2008-01-31 Thread Sam Tregar
On 01 Feb 2008 00:41:49 +0100, Slaven Rezic [EMAIL PROTECTED] wrote:


 Probably it's easier to have some check in the 02yaml.t test and skip
 it if necessary.


You guys are hilarious!  It's as though the tests themselves had no meaning
at all - all you want is 100% passed, and it's no big deal if we have to
cheat to get there!

My module is useless with a broken XML::SAX install.  Why would I want my
tests to pass if the module itself can't be used?

-sam


Re: [RDBO] Problem using check_in with a varchar column

2008-01-31 Thread Sam Tregar
On Jan 31, 2008 3:53 PM, John Siracusa [EMAIL PROTECTED] wrote:

 I'm assuming it only produces that error when it tries to emit the
 Perl code for that class into a .pm file, right?


Yes, that's it.  I was using the emitted Perl code to debug my auto-init
setup.


 If so, I think I have the fix in SVN.  Give it a spin and let me know if
 it solves your
 problem.


Yup, that did the trick.  Thanks!

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: FAIL XML-Validator-Schema-1.09 i686-linux 2.4.27-3-686

2008-01-30 Thread Sam Tregar
On Jan 30, 2008 9:22 AM, [EMAIL PROTECTED] wrote:

 t/02yaml# No tests run!
 dubious
Test returned status 255 (wstat 65280, 0xff00)


Amazing.  Does every CPAN tester have a broken XML::SAX install?  Is there
something wrong with the way you guys are installing XML::SAX?

-sam


Re: FAIL XML-Validator-Schema-1.09 i686-linux 2.4.27-3-686

2008-01-30 Thread Sam Tregar
On Jan 30, 2008 1:33 PM, David Cantrell [EMAIL PROTECTED] wrote:

 Sort of.  The fault appears to be with XML::SAX, which is broken
 when installed using CPAN.pm.  You're getting failure reports because
 one of your dependencies is broken in a way that CPAN::Reporter can't
 detect (it passes its tests) and so the FAIL report for your module
 doesn't get suppressed like it should be.  Until XML::SAX is fixed, can
 you force it to use XML::SAX::PurePerl if there appears to be no parser
 installed, using XML::SAX-add_parser()?  Or is there another XML parsey
 thing you can use instead?


That might be possible, but I'm not sure it's a good idea.   It will only
serve to mask a real problem - the module really is useless with a broken
XML::SAX.  I was thinking about releasing a version that blew up in
Makefile.PL when it detected a broken XML::SAX install.  Is there a way I
can blow up that tells your test-bots not to email me?

and so it goes and creates a ParserDetails.ini file, but in the
 perl-5.6.2/.cpan/build/XML-SAX-0.16-BgiDq8/blib/lib/XML/SAX/ directory.
 That is, obviously, only in @INC while I'm installing XML::SAX.  Having
 taken a quick gander at the XML::SAX source, it looks like this will
 affect at least everyone who installs it through CPAN.pm.


Odd.  I installed XML::SAX through CPAN just a few days ago on 5.8.8 and
5.10.0 and didn't hit this problem.

-sam


Re: FAIL XML-Validator-Schema-1.09 i686-linux 2.4.27-3-686

2008-01-30 Thread Sam Tregar
On Jan 30, 2008 1:46 PM, David Cantrell [EMAIL PROTECTED] wrote:

 exit(0) before calling WriteMakefile().


Hmm, that's a chicken-or-egg problem.  If I try to check before
WriteMakefile() then you might not have XML::SAX installed yet.  You might
be about to install a broken one, and I won't find out about that until the
tests run.  Any way to have a test fail but not get an email from CPAN
testers?

-sam


Re: FAIL XML-Validator-Schema-1.09 i686-linux 2.4.27-3-686

2008-01-30 Thread Sam Tregar
On Jan 30, 2008 2:52 PM, daniel bosold [EMAIL PROTECTED] wrote:


 run the tests manually? mine fail with manually installed XML::SAX as
 well as cpan-installed.


Do you have a broken XML::SAX install, one without any parsers defined?  If
so, nothing I can (should) do will make the tests pass...

-sam


Re: FAIL XML-Validator-Schema-1.09 i686-linux 2.4.27-3-686

2008-01-30 Thread Sam Tregar
On Jan 30, 2008 8:42 PM, David Golden [EMAIL PROTECTED] wrote:

 On Jan 30, 2008 2:47 PM, Sam Tregar [EMAIL PROTECTED] wrote:

  Hmm, that's a chicken-or-egg problem.  If I try to check before
  WriteMakefile() then you might not have XML::SAX installed yet.  You might
  be about to install a broken one, and I won't find out about that until the
  tests run.  Any way to have a test fail but not get an email from CPAN
  testers?
 


 Fails will always get reported, but you could check for a working XML::SAX
 and use plan skip_all = $reason.


Oh well.  I suppose I can setup a rule that looks for the telltale signs of
a broken XML::SAX install in a fail report and just sends it to /dev/null.

I'm definitely not going to make my module pass its tests when there's
absolutely no way it can work!  I guess that's the disconnect here -
sometimes failing is good!  In this case it's a clue that your setup is
broken.  Making that clue more explicit is a good idea, but making it go
away isn't.

-sam


Re: [RDBO] Sharing a DBI connection with Class::DBI

2008-01-30 Thread Sam Tregar
On Jan 29, 2008 10:32 PM, John Siracusa [EMAIL PROTECTED] wrote:

 On 1/29/08, Sam Tregar [EMAIL PROTECTED] wrote:
  Do you happen to know if RDBO will tolerate a
  DBIx::ContextualFetch based DBI handle?
 It should, and if it doesn't, I can probably make it do so with some
 minor edits.  Give of a try and let me know.


Looks pretty good.  I setup a hacked Rose::DB with RootClass set to
DBIx::ContextualFetch by default and ran the Rose::DB::Object test suite
against it with MySQL.  Everything passed.  I'll let you know if I see
anything odd when I try to actually use it myself.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: FAIL XML-Validator-Schema-1.09 i86pc-solaris 2.10

2008-01-29 Thread Sam Tregar
On Jan 29, 2008 2:56 PM, bob walker [EMAIL PROTECTED] wrote:

 t/02yaml..# No tests run!
  Dubious, test returned 255 (wstat 65280, 0xff00)
  No subtests run


Looks like you don't have any XML::SAX parsers installed.  You should at
least have XML::SAX::PurePerl, since it comes with XML::SAX.  To confirm:

   perl -MXML::SAX -MData::Dumper -le 'print Dumper([XML::SAX-parsers])'

If that's empty then try installing a SAX XML parser.

-sam


Re: FAIL XML-Validator-Schema-1.09 OpenBSD.i386-openbsd 4.2

2008-01-29 Thread Sam Tregar
On Jan 29, 2008 5:09 PM, bob walker [EMAIL PROTECTED] wrote:

 t/02yaml..# No tests run!
  Dubious, test returned 255 (wstat 65280, 0xff00)
  No subtests run


Did you get my earlier message about this problem?  Could you fix your
XML::SAX installs before sending me any more failures?

Thanks,
-sam


Re: FAIL XML-Validator-Schema-1.09 i86pc-solaris 2.10

2008-01-29 Thread Sam Tregar
On Jan 29, 2008 7:01 PM, Bob Walker [EMAIL PROTECTED] wrote:

 the module was tested automatically. This is why you received several
 failures from me. Ijust ran it manually and got the same failure.
 details follow. I would suggest that XML::SAX is failing to do something.


 [EMAIL PROTECTED]:~ ./cpantesting/perl-5.8.8/bin/perl -MXML::SAX 
 -MData::Dumper
 -le 'print Dumper([XML::SAX-parsers])'
 could not find ParserDetails.ini in
 /export/home/bob/cpantesting/perl-5.8.8/lib/site_perl/5.8.8/XML/SAX


Yup, you've got a broken XML::SAX install.  XML::SAX without a
ParserDetails.ini is XML::SUX.  Oddly, the only people this seems to happen
to are CPAN testers.  I've never had a real user report this error but I
think you're the third CPAN tester to hit it!  I should add a check in
Makefile.PL telling you to go pester the XML::SAX developers instead.

-sam


Re: [RDBO] Sharing a DBI connection with Class::DBI

2008-01-29 Thread Sam Tregar
On Jan 29, 2008 9:55 PM, Peter Karman [EMAIL PROTECTED] wrote:

 just a naive guess here, but if you were using DBI-connect_cached as the
 underlying connect method, wouldn't DBI handle the sharing for you?


No, I'm pretty sure DBI uses the class as part of the connect_cached key.

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Sharing a DBI connection with Class::DBI

2008-01-29 Thread Sam Tregar
Hey all.  I'm getting started with Rose::DB::Object.  My problem is I need
to inter-operate with a large pre-existing Class::DBI code-base.  I'd like
to setup Rose to be able to share the same DBI connection that Class::DBI
uses - otherwise I'll instantly double the number of connections from our
web cluster when I roll out Rose::DB::Object.

I know of one problem - Class::DBI requires its DBI handles to inherit from
DBIx::ContextualFetch while Rose wants its handle to inherit from
Rose::DB::MySQL.  Anybody know how to solve this?  Alternately, do you know
of other reasons why it won't work?

Thanks!

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Sharing a DBI connection with Class::DBI

2008-01-29 Thread Sam Tregar
On Jan 29, 2008 10:06 PM, John Siracusa [EMAIL PROTECTED] wrote:


 The db atribute of an RDBO-derived object isa Rose::DB, but each
 Rose::DB-derived object has a DBI $dbh.  IOW, plain old DBI database
 handles are used via delegation in RDBO.  There's no subclassing of
 DBI classes at all.


Good to hear.  Do you happen to know if RDBO will tolerate a
DBIx::ContextualFetch based DBI handle?

but keep in mind the new new_or_cached() Rose::DB method that makes a
 lot of the caching discussion in some older threads less relevant
 these days.

 http://search.cpan.org/dist/Rose-DB/lib/Rose/DB.pm#new_or_cached


Yes, I found that one - seems very useful.  Maybe something to add to the
tutorial?

Thanks for the help!

-sam
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [Mason] mason webapp best practices

2007-07-02 Thread Sam Tregar
On Tue, 26 Jun 2007, Alan wrote:

 Just wondering if there are any best-practices documented for mason.  I
 use it daily and seem to end up with a relative hodge-podge (that's the
 technical term) of components, form handling, etc.  I realize this is
 mostly my own fault abusing both perl and the ability to do inline logic
 in mason, and want to get better and make more maintainable / usable
 apps.  I really dread going back to old projects for maintenance or
 updates :)

Take a look at MasonX::WebApp.  With discipline it could give you
nearly as much separation between form and function as something like
CGI::Application.  The key here is to keep the complex application
code in modules, leaving the components with just display management.
It's a hard job to do this consistently in an environment as flexible
as Mason, but it can be done.

-sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users


Re: FAIL Devel-Profiler-0.04 i686-linux 2.4.27-3-686

2007-06-21 Thread Sam Tregar


On Thu, 21 Jun 2007 [EMAIL PROTECTED] wrote:


Perl lib version (v5.6.2) doesn't match executable version (v5.8.8) at 
/home/david/cpantesting/perl-5.6.2/lib/5.6.2/i686-linux/Config.pm line 21.


That doesn't look like my problem!  Please fix your test rig.

-sam


Re: RFC: The future of Text::CSV_XS

2007-05-25 Thread Sam Tregar

On Fri, 25 May 2007, H.Merijn Brand wrote:


I have been digging a bit to find what people consider loose ends in
Text::CSV_XS, and tried to summarize that (in no particular order) in
the new TODO list. Here TODO gives no guarantee that it will be done,
nor on any implementation or API that it might suggest, it is there now
just so I/we do not forget to think about these issues.

I'd like to get thoughts/feedback/suggestions about items on this list,
and how valuable you consider adding these features to a modules so
heavily used by other applications.


Oooo, how exciting!  Text::CSV_XS is a great module with some rather
unfortunate problems.

My number one problem is that binary-mode deals exceptionally badly
with the \r character.  You can read all about it here, including a
patch for part of the problem:

   http://use.perl.org/~samtregar/journal/31443

In my fantasy world Text::CSV_XS would automatically accept \r, \n
and \r\n as line-ending characters with no user-interaction
necessary.  I went into the source hoping to do it but I came away
empty-handed.


=item parse returning undefined fields


I like this one too.

Good luck!

-sam


Re: [htmltmpl] Trailing 1

2007-04-16 Thread Sam Tregar
On Mon, 16 Apr 2007, Barry Michels wrote:

 my $pjx = new CGI::Ajax('change_page' = \change_page);

I'm guess that CGI::Ajax is expecting you to return the HTML, not
print it.  So try changing this:

 print Show_Content($pg) if(defined $pg);

To:

 return Show_Content($pg) if(defined $pg);

When you put a print() as the last statement in a subroutine it will
return 1 when it succeeds.

-sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] escape html whitespace

2007-03-30 Thread Sam Tregar
On Fri, 30 Mar 2007, Matt Taylor wrote:

 I couldn't find this information in the archive...

 I like the ESCAPE options (HTML, URL, JS).

 Is there a way to also escape whitespace?  In particular, I would like
 an easier way to replace spaces with nbsp;

 Currently looping through data from dbi and replacing.  Any ideas?

Don't do that?  nbsp; really shouldn't be needed in modern HTML
layout.  Maybe you can show us what you're using it for and we can
suggest a better way?

-sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] How to handle UTF-8?

2007-03-21 Thread Sam Tregar
On Wed, 21 Mar 2007, Mathew Robertson wrote:

 As an aside, there are a number of different techniques used to get
 the UTF8 strings into the templates, eg: TMPL_VAR's, hacks to H::T,
 using H::T::E with a callback.

Why would you need a hack to get UTF8 strings into the templates?  Is
there a bug I should be fixing here?

-sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


[htmltmpl] ANNOUNCE: Krang v2.100

2007-02-19 Thread Sam Tregar
Krang v2.100 is now available (the source release is up now and binary
builds should be up soon).  Notable changes in this release:

 * Numerous bugs were fixed in Krang's most intensive QA cycle in
   years.

 * Krang now includes methods to integrate with dynamic front-end
   applications by publishing CGI::Application instance scripts and
   templates.  New methods were added to
   Krang::ElementClass::TopLevel to facilitate this:
   publish_frontend_app_template() and publish_frontend_app_stub().
   [Jesse Erlbaum]

 * Modified Site Server configuration to support CGI applications
   and Apache::Registry apps.  This will permit the site server to
   host interactive applications.  [Jesse Erlbaum]

 * Added new parameter mode to additional_content_block() method
   in the publisher. This new parameter permits the permission of
   the file to be set, which is particularly useful for publishing
   executable files.  [Jesse Erlbaum]

 * Added new options to Krang::HTMLPager to allow paging of data
   from external sources.  [Michael Peters]

 * Krang now sends no-cache HTTP headers for all Krang::CGI
   requests. This will fix some problems when logging in as a
   different user with the same browser session in IE.
   [Michael Peters]

 * Upgraded to HTML::Template v2.9, fixing several bugs. [Sam]

 * Added a new configuration variable, PreviewSSL, which controls
   whether links to preview use SSL. This behavior was previously the
   default when EnableSSL was set, but now it is available
   independently and can be turned off even when Krang itself is using
   SSL. [Sam]

 * During DB creation, addon SQL files now come after core Krang.
   This allows addons to change existing Krang data/tables.
   [Michael Peters]

 * Stricter enforcement of asset permissions. [Michael Peters]

Detailed change-log here: http://krang.sf.net/docs/changelog.html

Krang is an Open Source web-publisher / content-management system
designed for large-scale magazine-style websites.  It is a 100% Perl
application using Apache/mod_perl and MySQL, as well as numerous CPAN
modules.

Krang provides a powerful and easy to use story and media editing
environment for website editors, as well as a complete template
development environment for web designers. On the back-end, Perl
programmers can customize Krang to control the data entered in the
story editor and add code to drive the templates to build output.
Krang can be enhanced with add-ons containing new skins and other new
features.  Krang easily handles large data sets and can manage
multiple websites in a single installation.

For more information about Krang, visit the Krang website:

http://krang.sourceforge.net/

There you can download Krang, view screenshots, read documentation,
join our mailing-lists and access the CVS tree.

- the Krang team


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] Questions on file_cache

2007-02-08 Thread Sam Tregar
On Thu, 8 Feb 2007, Robert Hicks wrote:

 I am in a CGI only environment and it seems that file_cache is an easy
 speed up. So I am wary of it. I understand the security aspects but is
 there anything else to worry about using it?

Nope.  If you're worried about people peeking at your cached templates
just be careful to set the permissions on your cache dir correctly.
It needs to be readable and writable by the CGI process, but it
doesn't need to be accessible by anyone else.

-sam

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] resultset Paging and Row limitation

2007-02-08 Thread Sam Tregar
On Sun, 4 Feb 2007, Massoud Kohan wrote:

 I am new to the Html-template and perl.
 How can I show the resultset to the web page which Shows 10
 records per page and also page numbers on the bottom of the
 table?

HTML::Pager was designed to do this for you.  It's a little tricky to
use, but you can study the code if you just want to see an example of
how it's done.

For the database side of things, be sure to use LIMIT and OFFSET to
get your data-set back from MySQL.  Selecting everything like you're
doing now is going to be very slow for large lists.

-sam

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


[cgiapp] [htmltmpl] ANNOUNCE: HTML::Template v2.9

2007-01-30 Thread Sam Tregar

CHANGES
- New Feature: the force_untaint option makes sure you do not
  pass tainted values to param(). [Sven Neuhaus]

- New Feature: Added ESCAPE=none as a synonym for ESCAPE=0.
  Fixed both to work with default_escape. [EMAIL PROTECTED]

- Bug Fix: DEFAULT didn't work with URL and JS escaping.

- Bug Fix: Long-standing bug where variables set in a loop weren't
  available inside inner loops under global_vars if the variable
  wasn't actually used in the outer loop.  (Thanks to Richard Fein
  for help debugging the fix.)

- Doc Fix: Changed references to CVS in the docs to Subversion now
  that the switch is complete.

- Test Fix: At long last, the work from the Phalanx project has
  been merged!  The tests are now more complete and easier to work
  on.  Thanks Phalanx guys!

DESCRIPTION

 This module attempts to make using HTML templates simple and
 natural. It extends standard HTML with a few new HTML-esque tags -
 TMPL_VAR, TMPL_LOOP, TMPL_INCLUDE, TMPL_IF, TMPL_ELSE
 and TMPL_UNLESS.  The file written with HTML and these new tags
 is called a template. It is usually saved separate from your
 script - possibly even created by someone else! Using this module
 you fill in the values for the variables, loops and branches
 declared in the template. This allows you to separate design - the
 HTML - from the data, which you generate in the Perl script.

 This module is licensed under the same license as Perl. See the
 LICENSE section of the docs for more details.

TUTORIAL

 If you're new to HTML::Template, I suggest you start with the
 introductory article available on the HTML::Template website:

http://html-template.sourceforge.net

AVAILABILITY

 This module is available on SourceForge.  Download it at:

http://html-template.sourceforge.net

 The module is also available on CPAN.  You can get it using
 CPAN.pm or go to:

http://www.cpan.org/authors/id/S/SA/SAMTREGAR/

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] HT vs TT speed wise

2007-01-30 Thread Sam Tregar

On Tue, 30 Jan 2007, Ron Savage wrote:


OTOH, on each invocation of your CGI script, you're probable only calling
HT or TT once to render one page, right? Perhaps best to just not worry
about it :-).


All too true.  But, if you decide to worry about it anyway be sure to
try HTML::Template::JIT!  I think it's a fine example of the ultimate
absurdity of tuning your templating engine that it's never been useful
to me.  It's a pretty rare application that actually has templating as
a significant bottleneck.

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ANNOUNCE: HTML::Template v2.9

2007-01-30 Thread Sam Tregar

CHANGES
   - New Feature: the force_untaint option makes sure you do not
 pass tainted values to param(). [Sven Neuhaus]

   - New Feature: Added ESCAPE=none as a synonym for ESCAPE=0.
 Fixed both to work with default_escape. [EMAIL PROTECTED]

   - Bug Fix: DEFAULT didn't work with URL and JS escaping.

   - Bug Fix: Long-standing bug where variables set in a loop weren't
 available inside inner loops under global_vars if the variable
 wasn't actually used in the outer loop.  (Thanks to Richard Fein
 for help debugging the fix.)

   - Doc Fix: Changed references to CVS in the docs to Subversion now
 that the switch is complete.

   - Test Fix: At long last, the work from the Phalanx project has
 been merged!  The tests are now more complete and easier to work
 on.  Thanks Phalanx guys!

DESCRIPTION

This module attempts to make using HTML templates simple and
natural. It extends standard HTML with a few new HTML-esque tags -
TMPL_VAR, TMPL_LOOP, TMPL_INCLUDE, TMPL_IF, TMPL_ELSE
and TMPL_UNLESS.  The file written with HTML and these new tags
is called a template. It is usually saved separate from your
script - possibly even created by someone else! Using this module
you fill in the values for the variables, loops and branches
declared in the template. This allows you to separate design - the
HTML - from the data, which you generate in the Perl script.

This module is licensed under the same license as Perl. See the
LICENSE section of the docs for more details.

TUTORIAL

If you're new to HTML::Template, I suggest you start with the
introductory article available on the HTML::Template website:

   http://html-template.sourceforge.net

AVAILABILITY

This module is available on SourceForge.  Download it at:

   http://html-template.sourceforge.net

The module is also available on CPAN.  You can get it using
CPAN.pm or go to:

   http://www.cpan.org/authors/id/S/SA/SAMTREGAR/


[ANNOUNCE] Krang v2.008 Released

2006-12-20 Thread Sam Tregar

Krang v2.008 is now available (the source release is up now and binary
builds should be up soon).  Notable changes in this release:

* Improved password security.  Password policy is now configurable
  and extensible by addons. [Michael Peters]

* Added several new configuration options which allow Krang
  instances to run on separate IPs and have different SSL
  configurations. [Sam]

* Added a new option for addons, DataSetClasses. This allows
  addons to extend Krang::DataSet and include new objects in KDS
  files. [Sam]

* Implemented a system of universally-unique identifiers (UUIDs)
  for Krang objects.  This allows updates between machines to propagate
  changes correctly even when keys have changed. [Sam]

* Several bugs were fixed.

Detailed change-log here: http://krang.sf.net/docs/changelog.html

Krang is an Open Source web-publisher / content-management system
designed for large-scale magazine-style websites.  It is a 100% Perl
application using Apache/mod_perl and MySQL, as well as numerous CPAN
modules.

Krang provides a powerful and easy to use story and media editing
environment for website editors, as well as a complete template
development environment for web designers. On the back-end, Perl
programmers can customize Krang to control the data entered in the
story editor and add code to drive the templates to build output.
Krang can be enhanced with add-ons containing new skins and other new
features.  Krang easily handles large data sets and can manage
multiple websites in a single installation.

For more information about Krang, visit the Krang website:

http://krang.sourceforge.net/

There you can download Krang, view screenshots, read documentation,
join our mailing-lists and access the CVS tree.

- the Krang team


Re: [htmltmpl] The sf.net Subversion Repository and the Phalanx One

2006-11-17 Thread Sam Tregar
On Thu, 16 Nov 2006, James Keenan wrote:

 Sam, we'd still welcome feedback.

Thanks Jim.  I'll see what I can do this weekend.

-sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] The sf.net Subversion Repository and the Phalanx One

2006-11-16 Thread Sam Tregar
On Thu, 16 Nov 2006, Shlomi Fish wrote:

 Took me exactly 10 minutes to forward port the patch from the Phalanx
 repository. So it wasn't such a painful process. :-D

 Hmmm... I spoke too soon. The first incarnation of the patch did not pass the
 tests. I now have a better patch at the same URL:

 http://www.shlomifish.org/Files/files/code/perl/HTML-Template/h-t-phalanx.diff.bz2

 Please apply it instead.

Thanks Shlomi, this is helpful.  I'll sort through it and apply what I
can live with.  Some of these tests look counter-productive to me
(like the ones that ensure the internal structure of the object stays
the same as v2.7), but most look like improvements.

-sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] The sf.net Subversion Repository and the Phalanx One

2006-11-15 Thread Sam Tregar
On Wed, 15 Nov 2006, Shlomi Fish wrote:

 A question if I may. Why weren't the tests and other changes that
 were done to the Phalanx work on HTML-Template:

 * http://svn.perl.org/phalanx/HTML-Template/
 * http://hew.ca/yapc/phalanx/slides/TABLE_OF_CONTENTS.html

 Integrated into the mainline HTML-Template at:

 https://svn.sourceforge.net/svnroot/html-template/

Lack of motivation, I suppose.  As far as I know they never found or
fixed a bug in HTML::Template.  At this point their repo is out of
date and it would be a painful process to do the merge.

Patches welcome, of course.  Beware though, I have a history of
rejecting changes to existing tests - if it ain't broke...  New tests
are always welcome though!

-sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [cgiapp] CAF methodology

2006-11-10 Thread Sam Tregar

On Fri, 10 Nov 2006, Robert Hicks wrote:

I think that is a pretty cool idea and was wondering if anyone likes that as 
well. Is there a plugin for it or anything (outside of CAF)?


Seems a little silly to use a plugin for:

  $template-param(foo_mode = $self-foo);

And:

  tmpl_var foo_mode

If you wanted to get really fancy and support any mode:

  my %run_modes = $self-run_modes();
  $template-param(${_}_mode = $self-$_) for
grep { $template-query(name = ${_}_mode) } keys %run_modes;

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Re: Using AJAX with C::A

2006-10-19 Thread Sam Tregar

On Thu, 19 Oct 2006, Robert Hicks wrote:


Maybe someone with experience could update the CA site with an
example or two of doing this with CA?


You could just include a link to CGI::Application::Search - it has a
couple AJAX features which should be easy to follow.

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Eval and standard error page

2006-10-08 Thread Sam Tregar

On Sun, 8 Oct 2006, Mark A. Fuller wrote:


The idea of die'ing anywhere in my application seems elegant to
me. Right now I have to do my own $template processing anywhere an
unexpected/unrecoverable error occurs (to display a common page).


Have you looked at error_mode()?  I think it offers exactly what
you're looking for,


I've always heard eval is slow. Will it slow everything that
happens behind the run method? Or, is it just a cost involved with
starting eval?


Eval has two uses - eval on a string compiles code dynamically.  This
is the slow one:

  eval some perl here;

It also serves as Perl's try implementation, catching exceptions:

  eval { some code here; }

This is not at all slow.  Yes, Perl sucks for combining them.  Oh
well, at least we have CPAN.

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Safely timing out DBI queries

2006-09-19 Thread Sam Tregar

On Tue, 19 Sep 2006 [EMAIL PROTECTED] wrote:


And some drivers have a timeout parameter that handles this issue at the
vendor API level (e.g. DBD::Sybase's timeout parameter that is handled
internally by OpenClient).


Good to know.  I'm looking into adding something like this to MySQL,
but damn, multi-threaded C++ is complicated!

-sam


Re: Safely timing out DBI queries

2006-09-19 Thread Sam Tregar

On Tue, 19 Sep 2006 [EMAIL PROTECTED] wrote:


And some drivers have a timeout parameter that handles this issue at the
vendor API level (e.g. DBD::Sybase's timeout parameter that is handled
internally by OpenClient).


Good to know.  I'm looking into adding something like this to MySQL,
but damn, multi-threaded C++ is complicated!

-sam


PrintError won't turn off

2006-09-18 Thread Sam Tregar

Just finished a rather irritating debugging session trying to track
down a warning triggered by DBIx::Timeout.  Turns out this code
doesn't exactly do what I mean:

  $dbh-{PrintError} = 0;

Looks like it turns PrintError off, huh?  Actually, as far as I can
tell it turns it on.   The relevent C code is (from dbih_set_attr_k):

  else if (strEQ(key, PrintError)) {
DBIc_set(imp_xxh,DBIcf_PrintError, on);

In contrast to attributes that you can turn off, which look like:

  else if (strEQ(key, Warn)) {
(on) ? DBIc_WARN_on(imp_xxh) : DBIc_WARN_off(imp_xxh);

Is this a bug, or is there some reason for this behavior?

-sam


Re: PrintError won't turn off

2006-09-18 Thread Sam Tregar

On Mon, 18 Sep 2006, Sam Tregar wrote:


Looks like it turns PrintError off, huh?  Actually, as far as I can
tell it turns it on.   The relevent C code is (from dbih_set_attr_k):

 else if (strEQ(key, PrintError)) {
   DBIc_set(imp_xxh,DBIcf_PrintError, on);


Sheesh, ignore me.  I see that's using on, which should toggle it on
and off.  I wonder why it doesn't seem to be working.

-sam


Re: PrintError won't turn off

2006-09-18 Thread Sam Tregar

On Mon, 18 Sep 2006, Sam Tregar wrote:


On Mon, 18 Sep 2006, Sam Tregar wrote:


Looks like it turns PrintError off, huh?  Actually, as far as I can
tell it turns it on.   The relevent C code is (from dbih_set_attr_k):

 else if (strEQ(key, PrintError)) {
   DBIc_set(imp_xxh,DBIcf_PrintError, on);


Sheesh, ignore me.  I see that's using on, which should toggle it on
and off.  I wonder why it doesn't seem to be working.


Is it possible that connect_cached() resets PrintError if it's not
explicitely set in the options hash?  That would explain what I'm
seeing.  I can set PrintError off and see its effect, but as soon as
some other code gets the same handle via connect_cached() PrintError
is on again.

-sam



Re: PrintError won't turn off

2006-09-18 Thread Sam Tregar

On Mon, 18 Sep 2006, Tim Bunce wrote:


Yes, and the same applies to AutoCommit. Whether it's a good thing or
not is debatable but it's been that way forever. The 'workaround' is
to explicitly state the attributes you want.


Hmmm, interesting.  What would you think about making PrintError
default to 0 when RaiseError is on?  My reasoning is that if the error
is getting croak()ed then there's no need to warn() it too.  The
warn() comes without a stack-trace and can be very difficult to track
down when the croak() is being intentionally trapped (as was the case
in DBIx::Timeout).  When the croak() isn't being trapped it's just
duplicate information on STDERR.

-sam


Re: Safely timing out DBI queries

2006-09-17 Thread Sam Tregar

On Sun, 17 Sep 2006, Tim Bunce wrote:


For any driver that uses a network socket to connect you could close()
the socket in the signal handler to (relatively) safely timeout.

Should be fairly clean/safe for the db client library state, though
unsafe signals means there's still a chance perl's internal state could
be corrupted.


That doesn't sound quite safe enough to me, frankly.  I hate memory
corruption bugs...


Right now I'm putting together
DBIx::Timeout which implements my fork()-based timeout in a reusable
package.  Seems to work, although I've learned to expect forking code
to have unexpected bugs which take time to shake out.


It's mysql specific currently, using $id=$dbh-{thread_id} and
do(KILL $id).  (And shouldn't thread_id be mysql_thread_id?)


Yup, I figured other people could send me patches implementing that
for their DBs if they were so inclined, but a DBI solution would be
even better!


Also, rather than fork each time you need a timeout it would be nice to
be able to have a single 'watchdog' process and use some form of fast
IPC to tell it when to be active (passing the timeout to use and
relevant session id) and when to be inactive. A pipe would be fine.
But perhaps that could be a new DBIx::Watchdog module. Just a thought.


That's an interesting idea, and worthwhile if DBIx::Timeout was a
bottleneck.  That's unlikely in my application since I'm using it in a
case where the query is very likely to be a long one.

-sam


Re: Safely timing out DBI queries

2006-09-17 Thread Sam Tregar

On Sun, 17 Sep 2006, Henri Asseily wrote:

This is a good way for handling a few potentially long-running queries, but 
forking each time means that you create a new dbh each time, correct? That's 
impossibly slow for environments like high-volume webservers.


Right.  And a few long-running queries is exactly what I plan to use
it for!  It would be nice to have something that could prevent any
query from running long, but what I really need is to have a way to
time-out the few obvious problem-children.


Some kind of a DBI::Pool on the process level, basically. With a
parent process that manages the pool of DBI processes, which can be
killed by a calling process when the query takes too long.


Patches welcome.  It's overkill for my app, but I can see the value of
it.

-sam


Re: Safely timing out DBI queries

2006-09-17 Thread Sam Tregar

On Sun, 17 Sep 2006, Dean Arnold wrote:


Er, but how ? Unless/until the DBI is threadsafe, the only way
for kill_session() to work is by breaking the DBD out of the
current blocking request. Which I assume is to be accomplished
by throwing signals around ?


DBIx::Timeout uses a separate fork()ed process.  No need for threads
here!


(I'll note that signals are conclusive proof that UNIX was developed
in an era when recreational narcotics were readily available and
inexpensive.)


Ever read Linux Core Kernel Commentary?  It makes signals seem
almost sane.  Probably because from the kernel's point of view they
make perfect sense.


Oh, and then there's the little matter of non-POSIX
platforms. Trying to reliably use Perl + fork + signals + some
external library on Win32 will certainly keep a developer busy for a
few days.


I'd be interested in a patch to get DBIx::Timeout working on Windows.
I have absolutely no interest in developing or testing it, but that
shouldn't stop you!

-sam


Re: Safely timing out DBI queries

2006-09-16 Thread Sam Tregar

On Sat, 16 Sep 2006, Henri Asseily wrote:


Use the great Sys::SigAction by Lincoln Baxter.


That's just a wrapper around POSIX sigaction(), right?  As I
understand it that's equivalent to the old unsafe signals in Perl
before 5.8.  I'd rather avoid that if it all possible!

-sam


Re: Safely timing out DBI queries

2006-09-16 Thread Sam Tregar

On Sun, 17 Sep 2006, Henri Asseily wrote:

You've got a catch-22: If you ALWAYS want the signal to fire on time, then 
you should expect unsafe signals.

Just clean up after yourself.


It's hard to clean up after the kind of problems unsafe signals can
cause.  For example, imagine the DB client code is in the middle of
updating some global state when the signal fires.  That state variable
or structure will be left in an inconsistent state, just waiting for
the next usage to explode.  This kind of corruption can be very hard
to recognize - it might not trigger a problem until that state is used
again, likely in a completely different area of your program.

Memory corruption bugs are the very worst kind, in my opinion - I'll
do whatever I have to do to avoid them.  Yes, it's unlikely, but
that's actually worse!  I'd rather have a bug that happens every time
than one that only happens once a week, or once a month.

-sam


Re: Safely timing out DBI queries

2006-09-16 Thread Sam Tregar

On Sat, 16 Sep 2006, Dean Arnold wrote:


I just saw your note on mysql internals, and suspect your
request there is unlikely to be given serious consideration.


Always a possibility.  Maybe they'd be more interested in a patch.
(For the curious, I wrote a message to the MySQL internals
mailing-list proposing a new feature:

  SELECT ... WITH TIMEOUT 10;

)


I think your best bet might be to work with the DBD::mysql maintainers
to implement some driver-specific nonblocking versions of
execute/prepare (and maybe fetch), as well as support for
'out of band' cancel.


That's an interesting idea.  Right now I'm putting together
DBIx::Timeout which implements my fork()-based timeout in a reusable
package.  Seems to work, although I've learned to expect forking code
to have unexpected bugs which take time to shake out.

-sam


ANNOUNCE: DBIx::Timeout v1.00

2006-09-16 Thread Sam Tregar

Changes

  - First release!

Description

This module provides a safe method of timing out DBI requests.  An
unsafe method is described in the DBI docs:

   
http://search.cpan.org/~timb/DBI/DBI.pm#Signal_Handling_and_Canceling_Operations

The problem with using POSIX sigaction() (the method described
above) is that it relies on unsafe signals to work.  Unsafe
signals are well known to cause instability.  To understand why,
imagine the DB client code is in the middle of updating some
global state when the signal arrives.  That global state could be
left in an inconsitent state, just waiting for the next time it is
needed to cause problems.  Since this will likely occur far from
the cause, and only ocur rarely, it can be a very difficult
problem to track down.

Instead, this module:

  - Forks a child process which sleeps for $timeout seconds.

  - Runs your long-running query in the parent process.

  - If the parent process finishes first it kills the child and
returns.

  - If the child process wakes up it kills the parent's DB thread
and exits with a code so the parent knows it was timed out.

Download

You can get DBIx::Timeout using the CPAN shell or at:

  http://search.cpan.org/~samtregar/DBIx-Timeout/



Safely timing out DBI queries

2006-09-15 Thread Sam Tregar

Greetings all.  I'm working on an app which allows users to construct
queries using a web UI in a moderately free-form fashion.  There's
plenty of data and hence plenty of rope.  I need to save my users from
themselves by timing-out long-running queries and killing the MySQL
thread.

Our first attempt used alarm() and $SIG{ALRM}.  For reasons described
in the DBI docs, this didn't work - the alarm fires, but only after
the database is done with the query.  I did try the POSIX sigaction()
recipe from the docs, and it worked.  However, I'm very nervous about
the possibility of random instability inherent in unsafe signals.  I'm
hoping to find a better way.

At present I'm imagining something like:

  - Parent forks a child before starting long-running query.

  - Child sleeps for $timeout seconds.

  - If parent finishes first, kills child and proceeds.

  - If child wakes up, kills parent's MySQL thread ID and exits.
Parent gets lost connection during query and assumes that's a
timeout.

I am concerned about a race condition here.  What happens when the
parent finishes just before the child wakes up?  Seems to me the child
could kill the parent's connection and the parent might not notice.
In my case I think I can get away with this - when the parent finishes
it's about the exit() itself, and doesn't need its DB handle anymore.
I'd like to have a recipe that didn't have this potential problem
though, since I forsee needing this elsewhere in the future.

Ideas?  Am I better off giving in to darkside of POSIX?

-sam


[htmltmpl] [ANNOUNCE] Krang v2.007

2006-09-14 Thread Sam Tregar
Krang v2.007 is now available (the source release is up now and binary
builds should be up soon).  Notable changes in this release and in
v2.006, which never received a proper announcement:

   * Improvements to the list-data management system, command-line
 tools and associated element classes. [Jesse Erlbaum]

   * Added support for Konqueror and fixed Krang to deny access to Mac
 IE, which was never supported.  [Michael Peters]

   * Krang now automatically deletes any alerts tied to a desk when
 that desk is deleted, fixing a long-standing import/export
 bug. [Michael Peters]

   * Added --clean option to bin/krang_addon_installer. [Michael
 Peters]

   * Added new index to element table.  This index will greatly speed
 complex publishing logic.  Thanks to James Reidy for identifying
 the bottleneck.  [Jesse Erlbaum]

   * Allow users whose page-size preference is 100, to be able to
 toggle between 100 and 20, instead of 100 and 100.
 [Michael Peters]

   * SiteServer configuration now does server-side includes by default.
 SSI is very common for sites managed by Krang.  This will make
 development use of the SiteServer more useful and easier.
 [Jesse Erlbaum]

   * Added new --grep option to krang_upload_media.  This option
 permits you to use a regex to filter what you want media to
 upload.  [Jesse Erlbaum]

   * Binary distributions now include src/ allowing for rebuilding
 installed copies of Krang. [Sam]

   * Fixed krang_install --FromBackup issues when the backups contain
 addons. [Michael Peters]

   * Fixed bug where KDS import would trigger delete_hook calls when
 updating elements for stories and categories. [Sam]

   * Fixed bulk-edit to allow white-space on the blank line separating
 paragraphs.  [Sam]

   * Modified krang_schedulectl to skip scheduler start-up if
 SchedulerMaxChildren parameter is set to 0 in krang.conf.  This
 is useful in development when you do not want the scheduler to
 run.  [Jesse Erlbaum]

   * Fixed several bin/ scripts to always load Krang::Conf via
 Krang::ClassLoader before using it.  This fixes problems
 overriding Krang::Conf in an addon.  [Sam]

   * Changed krang_upload_templates script to now handle global
 templates (those without categories). [Jesse Erlbaum]

   * Numerous other bug fixes.

Detailed change-log here: http://krang.sf.net/docs/changelog.html

Krang is an Open Source web-publisher / content-management system
designed for large-scale magazine-style websites.  It is a 100% Perl
application using Apache/mod_perl and MySQL, as well as numerous CPAN
modules.

Krang provides a powerful and easy to use story and media editing
environment for website editors, as well as a complete template
development environment for web designers. On the back-end, Perl
programmers can customize Krang to control the data entered in the
story editor and add code to drive the templates to build output.
Krang can be enhanced with add-ons containing new skins and other new
features.  Krang easily handles large data sets and can manage
multiple websites in a single installation.

For more information about Krang, visit the Krang website:

http://krang.sourceforge.net/

There you can download Krang, view screenshots, read documentation,
join our mailing-lists and access the CVS tree.

- the Krang team

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


[ANNOUNCE] Krang v2.007

2006-09-14 Thread Sam Tregar

Krang v2.007 is now available (the source release is up now and binary
builds should be up soon).  Notable changes in this release and in
v2.006, which never received a proper announcement:

  * Improvements to the list-data management system, command-line
tools and associated element classes. [Jesse Erlbaum]

  * Added support for Konqueror and fixed Krang to deny access to Mac
IE, which was never supported.  [Michael Peters]

  * Krang now automatically deletes any alerts tied to a desk when
that desk is deleted, fixing a long-standing import/export
bug. [Michael Peters]

  * Added --clean option to bin/krang_addon_installer. [Michael
Peters]

  * Added new index to element table.  This index will greatly speed
complex publishing logic.  Thanks to James Reidy for identifying
the bottleneck.  [Jesse Erlbaum]

  * Allow users whose page-size preference is 100, to be able to
toggle between 100 and 20, instead of 100 and 100.
[Michael Peters]

  * SiteServer configuration now does server-side includes by default.
SSI is very common for sites managed by Krang.  This will make
development use of the SiteServer more useful and easier.
[Jesse Erlbaum]

  * Added new --grep option to krang_upload_media.  This option
permits you to use a regex to filter what you want media to
upload.  [Jesse Erlbaum]

  * Binary distributions now include src/ allowing for rebuilding
installed copies of Krang. [Sam]

  * Fixed krang_install --FromBackup issues when the backups contain
addons. [Michael Peters]

  * Fixed bug where KDS import would trigger delete_hook calls when
updating elements for stories and categories. [Sam]

  * Fixed bulk-edit to allow white-space on the blank line separating
paragraphs.  [Sam]

  * Modified krang_schedulectl to skip scheduler start-up if
SchedulerMaxChildren parameter is set to 0 in krang.conf.  This
is useful in development when you do not want the scheduler to
run.  [Jesse Erlbaum]

  * Fixed several bin/ scripts to always load Krang::Conf via
Krang::ClassLoader before using it.  This fixes problems
overriding Krang::Conf in an addon.  [Sam]

  * Changed krang_upload_templates script to now handle global
templates (those without categories). [Jesse Erlbaum]

  * Numerous other bug fixes.

Detailed change-log here: http://krang.sf.net/docs/changelog.html

Krang is an Open Source web-publisher / content-management system
designed for large-scale magazine-style websites.  It is a 100% Perl
application using Apache/mod_perl and MySQL, as well as numerous CPAN
modules.

Krang provides a powerful and easy to use story and media editing
environment for website editors, as well as a complete template
development environment for web designers. On the back-end, Perl
programmers can customize Krang to control the data entered in the
story editor and add code to drive the templates to build output.
Krang can be enhanced with add-ons containing new skins and other new
features.  Krang easily handles large data sets and can manage
multiple websites in a single installation.

For more information about Krang, visit the Krang website:

   http://krang.sourceforge.net/

There you can download Krang, view screenshots, read documentation,
join our mailing-lists and access the CVS tree.

- the Krang team



Re: [cgiapp] blank page printed when using cgiapp_postrun

2006-09-02 Thread Sam Tregar

On Sat, 2 Sep 2006, Octavian Rasnita wrote:


sub cgiapp_postrun {
my $self = shift;
$self-header_props(-charset = 'ISO-8859-2');
}


Try using header_add() instead of header_props().  From the docs:

  Unlike calling header_props(), header_add() will preserve any
  existing headers.

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] time outs

2006-08-28 Thread Sam Tregar

On Mon, 28 Aug 2006, Michael Peters wrote:


Putnam, Denis (Contractor) wrote:

Can anyone tell me how to send an http response back to the browser
before i complete my output buffer on a long running query.  I need to
do this to keep the browser from timing out.


If you need to do this, then you need to do it manually. First set
the header_type to 'none', then print your own http headers, and
then periodically print a null byte to the client.  


Better than a null-byte, show a progress bar.  It's pretty easy to
setup a little Javascript to render a progress bar and then
periodically send:

  script language=javacriptupdate_progress(10);/script

You can see an example of this done with CGI::App in Krang's
Krang::CGI::Publisher module.  You can get Krang from:

  http://krang.sf.net

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] CGI::App in the wild: Miami University

2006-08-17 Thread Sam Tregar

On Thu, 17 Aug 2006, Mark Stosberg wrote:

- Storing photos in PostgreSQL for easy deployment on load-balanced web 
servers. (So far, that's worked surprising well)


That is surprising!  Why would you do that instead of using NFS?

-sam

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [htmltmpl] Speeding up H::T

2006-06-27 Thread Sam Tregar
On Mon, 26 Jun 2006, Matthew wrote:

I've already got use HTML::Template in my startup.pl so
 theoretically its being compiled at server start (anyway to verify
 this?). But its the instantiation in my handler() routine that's using
 the CPU time.

 How I can I get H:T to preform better?

Are you pre-caching your templates in startup.pl?  There's a recipe
for that in the HTML::Template docs.  After you do it, turn on
cache_debug and see if you're getting 100% cache hits (you should if
you did it right).

Also, are you loading many templates and doing includes manually?
Switching to tmpl_include (which is processed at compile time) can be
much faster.

Lastly, if you absolutely gotta have more speed, you could try
HTML::Template::JIT.  It's got some drawbacks - not all of
HTML::Template's syntax is supported and compilation times are long -
but it is reliably 4 to 8 times faster.

-sam

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: [htmltmpl] Speeding up H::T

2006-06-27 Thread Sam Tregar
On Tue, 27 Jun 2006, Matthew wrote:

 Also, are you loading many templates and doing includes manually?
 Switching to tmpl_include (which is processed at compile time) can be

   Not sure what you mean.

Some people do stuff like:

   my $header = HTML::Template-new(...);
   my $body   = HTML::Template-new(...);
   my $footer = HTML::Template-new(...);

   print $header-output, $body-output, $footer-output;

It's slower than just using tmpl_include.  I see it a lot so I thought
I'd mention it.

 TMPL_IF NAME=LOGIN_MENU
   TMPL_INCLUDE NAME=login_menu.tpl
 /TMPL_IF

This is a little strange, but I doubt it's a performance problem.
Usually each of those would be an indepenent template with:

   tmpl_include header.tmpl
   ... content stuff ...
   tmpl_include footer.tmpl

But I might be biased by using CGI::Application, which makes it really
easy for each run-mode (login_menu would be a CGI::App run-mode) to
have it's own template.

-sam

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


Re: Encode::decode_utf8 and references

2006-06-19 Thread Sam Tregar

On Mon, 19 Jun 2006, Dan Kogai wrote:


I can't help wondering how you got Encode to install.


Sorry - I meant to type 5.8.6.  I somehow managed to misread 5.8.6 as
5.6.1.  Too many years spent running that fine version, I guess!


All I know is I cannot support your case.


I can dig it.  I'll find a workaround in my app.

-sam


Encode::decode_utf8 and references

2006-06-18 Thread Sam Tregar

Hello all.  I'm maintaining a Perl app which relies on a possibly
incorrect behavior in Encode::decode_utf8 - references are expected to
pass through unmangled.  This worked fine until a recent upgrade.
Observe Encode v2.08 with Perl v5.6.1:

  $ perl -MEncode -MData::Dumper -e \
  'my $ref = Encode::decode_utf8({ foo = 1}); print Dumper($ref);'
  $VAR1 = {
'foo' = 1
  };

However, Encode v2.18 with Perl v5.6.1 is not so forgiving:

  $ perl -MEncode -MData::Dumper -e \
  'my $ref = Encode::decode_utf8({ foo = 1}); print Dumper($ref);'
  $VAR1 = 'HASH(0x9932180)';

So, is this a bug in Encode or a bug in my app?  I'm leaning towards
the latter but I thought I'd check with you before I started trying
to fix it (no tests, argh!).  Aside from don't do that, can you
suggest a fix?

Thanks,
-sam


Re: [htmltmpl] HTML::Template::output() : Unknown item in parse_stack : HASH at /usr/local/share/perl/5.8.8/HTML/Template.pm line 2781

2006-06-09 Thread Sam Tregar
On Fri, 9 Jun 2006, Alexey Melezhik wrote:

 HTML::Template INST_VERSION 2.6

Please upgrade to 2.8.  I fixed a couple bugs that could cause this
problem since 2.6.  If you can replicate the problem with 2.8 then
please send me your template.

Thanks!

-sam


___
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users


  1   2   3   4   5   6   7   8   >