[Catalyst] Re: [Dbix-class] Anybody else OSCONing?

2007-07-20 Thread Joel Bernstein
On Sat, Jul 21, 2007 at 02:31:26AM +0100, Matt S Trout wrote:
> While I know of a few names who are, I bet there are more on here I don't
> know about and that a lot of us don't know about each other, so put your names
> here and let's see if we can meet up for a beer and some software hate.

I'm flying off to Seattle (and thence PDX) today, will be there until
28th and in need of beer.

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst promoters required

2007-02-05 Thread Joel Bernstein
On Sun, Feb 04, 2007 at 10:38:45PM -0600, Jonathan Rockway wrote:
> Seems like it's doing well even without the Cata-list members (heh).  I added 
Didn't we agree on IRC that it's the "Cat Lyst"?

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hair-pulling over YAML config

2007-01-29 Thread Joel Bernstein
On Mon, Jan 29, 2007 at 10:31:13AM -0600, Jonathan Rockway wrote:
> Carl Vincent wrote:
> > I've patched my Config::Any (attached below) so it throws a warning. Not
> > sure if this would cause problems if it was included in the distributed
> > module...
> 
> This is something I've been worried about for a while.  Config::Any
> tries to load every config file with every "backend", so printing
> warnings is going to lead to a lot of spurious garbage.
> 
> Perhaps making ConfigLoader louder would help?  If no config is loaded
> (but ConfigLoader is loaded), then perhaps we need to
> 
>   [warn] Config file found but failed to load.  Errors
>   [warn] YAML_OMG_YOU_FORGOT_SOMETHING (Line 42, Column 32)
> etc.
>   [warn] XML::Parser error: no  declaration
>   [warn] JSON ...
> 
> As you can see it's kind of verbose that way.  What do other people think?

I'm looking into this. You're wrong about Config::Any trying to load
files with every backend, though. Config::Any *can* do that, but
C::P::ConfigLoader doesn't use that:
sub setup {
my $c = shift;
my @files = $c->find_files;
my $cfg   = Config::Any->load_files( {
files   => [EMAIL PROTECTED], 
filter  => \&_fix_syntax,
use_ext => 1
} );

that use_ext => 1 means "use the file extension to determine which
plugins to offer it to", so we can be fairly sure *providing that the
user is correctly naming their config files* that anything we offer to a
plugin ought to be the correct format.

On the one hand, users creating broken YAML (or whatever) files is out
of our scope. On the other, we mustn't make it any more difficult for
them to see the errors reported on their files than it would be if they
used YAML.pm directly.

I think the difficulty here is that Config::Any::_load has the potential
if running without use_ext=>1 to generate a lot of spurious warnings
caused by all the plugins to which a given config file is offered, but
which can't parse the file. So any patch would presumably only report
warnings if use_ext=>1. But that still doesn't seem ideal. Suggestions?

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Binary Conversion

2007-01-08 Thread Joel Bernstein
On Mon, Jan 08, 2007 at 09:42:36AM -0800, Will Smith wrote:
> Hi, 
>  I want to conver a number to binary. I installed Math::BigInt, and get this 
> error when trying to plugin in the main controller:
>  Can't locate Catalyst/Plugin/Math/BigInt.pm ... in 
> /lib/usr/lib/perl5/5.8.5/i386-linux-thread-multi .. 

What is C::P::Math::BigInt? Did you do:

use Catalyst qw(.. Math::BigInt);

instead of:

use Catalyst qw(...);
use Math::BigInt;

?

Or am I missing something? C::P::Math::BigInt doesn't exist on CPAN -
did you write it yourself? In which case, have you installed it
correctly?

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] {OT] protecting against attacks with multilingual input

2006-12-05 Thread Joel Bernstein
On Tue, Dec 05, 2006 at 02:11:27PM +0100, Daniel McBrearty wrote:
> hmmm ... I'll start here ...
> 
> http://www.perl.com/doc/manual/html/pod/perllocale.html

Read perllocale, perlre (the section on \w and \W escapes for
word/non-word characters) and locale.

You will need the correct locales compiled on your system for every
language and input method you want to support - IIRC these can take up
quite some disk space so there is a concommitant cost associated with
handling the different languages, but I don't recall it being enormous.
To be honest the one-off cost of compiling the locales is the only real
downside of this approach that I can see.

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] {OT] protecting against attacks with multilingual input

2006-12-05 Thread Joel Bernstein
On Tue, Dec 05, 2006 at 01:10:35PM +0100, Daniel McBrearty wrote:
> How does one do this?
> 
> If you have a text input field which can be in *any* language, which
> will get stored in the db, how do you protect against script
> injection?
> 
> If it's just english, I normally only accept characters from a given
> list (something like /[A-Za-z0-9]/ , plus whitespace and punctuation).
> But if the input can be in any language  ??

Isn't there any way you could require the input to be associated with a
particular language? Perl supports locale definitions which modify, for
example, the set of 'word' characters matched by the \w regular
expression escape. If you could dynamically switch locales to the
correct one for your input text then you could trivially s/\W//g to
sanitize strings.

If you really have to accept input in any language without knowing 
what language it is, then perhaps you should take the opposite approach
and test for the presence of certain characters which you can be sure
would occur in program code but not typically in text. Of course,
English might suffer without the dollar-sign and semicolon, and you may
decide that this is overly restrictive on your users...

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ConfigLoader

2006-09-13 Thread Joel Bernstein
On Wed, Sep 13, 2006 at 09:49:38PM +0300, Octavian Rasnita wrote:
> Hi,
> 
> I have tried to install the ConfigLoader plugin under Windows using cpan,
> because I couldn't find a ppm distribution of it.
> This plugin depends on Data::Visitor::Callback that also need to be
> installed using cpan, because there is no ppm distribution for it.
> 
> I couldn't install this module because it also depends on Test::use::ok and
> cpan gives errors when trying to compile it with Visual C++ 6, but I was
> able to find a ppm distribution for Test::use::ok.
> 
> After finding that ppm distro, I was able to install Data::Visitor::Callback
> and ConfigLoader Catalyst plugin using cpan.
> 
> Isn't there a more elegant solution for this?

Well, you could use gcc, or use Strawberry Perl, or bug ActiveState to
ppm'ify a lot more CPAN modules. I'm guessing there's no PPM of
Config::Any either -- did that install OK from CPAN? 

You could try Cygwin, too. My experience is that ActiveState Perl is
best avoided, but I haven't used Windows in quite a while, so maybe
that's changed.

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] load more than 2 yaml files in Catalyst

2006-08-22 Thread Joel Bernstein
On Tue, Aug 22, 2006 at 01:37:49AM +, Fayland Lam wrote:
> Joel Bernstein wrote:
> > On Mon, Aug 21, 2006 at 10:09:10AM +, fayland wrote:
> >> Now I'm using Config::YAML to load more than 2 yaml files in Catalyst, 
> >> but I wonder why ConfigLoader don't support to load more than 2 yaml 
> >> files? (like a.yaml b.yaml c.yaml, but not a.yaml a_local.yaml)
> something like:
> 
> __PACKAGE__->config( file => ['a.yml', 'b.yml', 'c.yml'] );
> 
> It doesn't work for me? What's wrong?

Well, to put it bluntly, it doesn't work because you just made that
interface up. If you read the ConfigLoader synopsis at:
http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.12/lib/Catalyst/Plugin/ConfigLoader.pm#SYNOPSIS

you'll see that the interface expects file => filename, ie a scalar NOT
an arrayref.

However, I've initiated a discussion on the catalyst-dev list about
whether this is a reasonable change to make to the interface, ie for it
to accept either a scalar or an arrayref of scalars. If the dev team
like the idea I'll make up a patch to ConfigLoader.

I'd point out at this point that anything you can do with multiple
config files, you could do with a single one -- what is your rationale
for needing multiple ones? Do you store each class's configuration
separately? I can sort of see the logic in doing that. Please mail the
list back and explain what you're doing with the multiple files, so we
can understand the use case better and see if there's a better way to do
what you need. At the very least it'll help me to make up a patch to get
the behaviour you want.

In summary, then:
1) the interface doesn't work like you think it does...for now anyway
2) you can get around it by rolling your multiple files into a single
one
3) just making up an interface doesn't magically cause it to exist

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] load more than 2 yaml files in Catalyst

2006-08-21 Thread Joel Bernstein
On Mon, Aug 21, 2006 at 10:09:10AM +, fayland wrote:
> Now I'm using Config::YAML to load more than 2 yaml files in Catalyst, 
> but I wonder why ConfigLoader don't support to load more than 2 yaml 
> files? (like a.yaml b.yaml c.yaml, but not a.yaml a_local.yaml)

Are you sure? What version of ConfigLoader are you using? You can find
out with:
perl -MCatalyst::Plugin::ConfigLoader -le 'print
$Catalyst::Plugin::ConfigLoader::VERSION'

> Am I missing something?

Not unless there's a problem with the YAML files, I'd say. Have you
verified that both are valid YAML? Do they possibly contain exactly the
same keys and overwrite each other?

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] SOLUTION: Re: Authentication::Store::DBIC worksundermyapp_server.pl butnot Apache/mod_perl

2006-08-12 Thread Joel Bernstein
On Sat, Aug 12, 2006 at 01:57:27PM -0700, Rodney Broom wrote:
> From: "Jonathan Rockway" <[EMAIL PROTECTED]>
> 
> > Interesting version of diff there.
> 
> These were diff -c, which patch(1) is happy with. Can you tell me what format 
> (in diff(1)) you're refering to?

Unified-context diffs, aka diff -u. That's the standard way for patches
to be distributed, AFAIK.

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] 'require' vs 'use' in Catalyst*

2006-08-10 Thread Joel Bernstein
On Thu, Aug 10, 2006 at 10:28:47AM -0700, Rodney Broom wrote:
> Disliking the fact that require() doesn't call my import(), I'm trying to 
> figure out why Catalyst (and so many other things) use require() over use(). 
> I have to think there's a good reason that just isn't occuring to me.

require is runtime, use is compile-time.

Perl doesn't know at compile-time which plugins you're going to load.

That's why require is necessary.

In any case, use Foo is exactly equivalent to:
require Foo; Foo->import();

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Andre Giesler/HASCO ist außer Haus.

2006-07-14 Thread Joel Bernstein
On Sat, Jul 15, 2006 at 03:36:26AM +0100, Matt S Trout wrote:
> Matt S Trout wrote:
> >> Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.
> > And now unsubscribed. I dunno if this is an auto-reply or a retarded 
> > notifier 
> > that doesn't exclude address boks, please fix it before you re-subscribe.
> s/address boks/mailing lists in your address book/
> What? Why are you looking at me like that?

It's much simpler than that. Nothing with a Precedence: bulk header
should possibly receive an autoreply. Most non-braindead systems support
this by default.

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] PPM vs CPAN

2006-06-28 Thread Joel Bernstein
On Wed, Jun 28, 2006 at 01:09:13PM -0400, Hugh Lampert wrote:
> Err, yes... gcc... seems to be a bit of a problem.  Hate to impose on 
> the members of the list, but can anyone point me in the direction of a 
> good  win32 binary GCC package that doesn't require Cygwin or other 
> "environments"?  

Depends how strictly we interpret your question. If you can handle
having a runtime DLL, you should be able to install gcc and binutils
without needing a full Cygwin/UWIN/MinGW32 environment.

If you want something fully native, you'll still not have anything
providing (most of) the POSIX function set just using MS' libraries,
AFAIK.

http://www.mingw.org/x86-win32-ports.shtml
Your best bet will be to install something from that list, I guess.

Perhaps somebody should write a gcc-compatible C compiler in Perl. 

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Remote Method

2006-06-23 Thread Joel Bernstein
On Fri, Jun 23, 2006 at 04:08:13PM +0200, Dominique Quatravaux wrote:
> Joel Bernstein a écrit :
> > On Fri, Jun 23, 2006 at 04:51:57PM +0530,
> > [EMAIL PROTECTED] wrote:
> >> Get me the solution how to implement this.
> > That sounds awfully aggressive.
> More like a non-native speaker perhaps? (look at his name)

Quite possibly. I hope my email wasn't rude. I was trying to emphasise
"sounds" rude, not "is definitely" rude. I asked for more information,
politely, in order to help the guy, and then tried to let him know that
his request could be construed as a rude one. I can't imagine any
non-native speaker being offended to have a gentle suggestion like that
made. If I travel, I try to speak the native language, and I certainly
appreciate any correction of my use of language.

In any case until Francis explains what he wants to do, we're all
shooting in the dark ;)

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Remote Method

2006-06-23 Thread Joel Bernstein
On Fri, Jun 23, 2006 at 04:51:57PM +0530, [EMAIL PROTECTED] wrote:
> I have one unix server and two windows servers all are connected to 
> lan. Unix server has a particular folder called 'inbox', I should get 
> notified immediately whenever a new file comes windows server to this 
> folder. We can connect to unix server only thru windows server not the
> vice versa.

I think you need to explain more:
1) What does this have to do with Catalyst?
2) What code do you have now that doesn't work?
3) By what means do you expect to be "notified"?

> Get me the solution how to implement this.

That sounds awfully aggressive. Demanding a solution from people doesn't
tend to engender a friendly cooperative spirit. For a start, you can
help us to help you, by explaining in *far* more detail what you are
trying to do, and where Catalyst fits in!

/joel

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/