[Catalyst] IUseIt on Digg

2006-07-11 Thread J. Shirley
A Catalyst app that is making the news:
http://digg.com/apple/iUseThis_-_Union_between_digg_and_MacUpdate

Thought you guys would enjoy seeing it

___
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] RESTful perl implementations...

2006-09-08 Thread J. Shirley
I'm working on a similar thing, except relying heavier on JSON-RPC for
certain things, and a mix of RESTful constructs for the rest.

Maybe an IRC meeting where we can get together and compare notes to
solidify our efforts?

-J

On 9/7/06, Garrett Goebel <[EMAIL PROTECTED]> wrote:
> My apologies. I haven't made the time yet to fix my code to use an
> ActionClass. And it doesn't look like I'll have a chance to work on
> things again until this weekend at the earliest.
>
> In the mean time, you might consider checking out the
> Jifty::Plugin::REST::Dispatcher in the svn repository (http://
> svn.jifty.org/svn/jifty.org) and the slides from the following
> presentation: http://pugs.blogs.com/talks/oscon-rhox.pdf.
>
> cheers,
>
> Garrett
>
>
> On Sep 7, 2006, at 8:22 AM, John Napiorkowski wrote:
>
> > I'm not trying to make something as magical as
> > InstantCRUD, but I'd like to add some RESTful matching
> > and convienence to Catalyst actions.  So I'd like to
> > be able to match on various HTTP method types and
> > preparse XML type bodies by various modules (XML::Atom
> > if it's an atom feed, XML::Simple if it's
> > application/xml, etc.)
> >
> > My goal is to make it easy to build web services
> > similar to the Google Data API.
> >
> > As a side project, but related, I'm working up a
> > controller to handle different error types, so you can
> > just say $c->detach('/errors/method_not_allowed') and
> > have it give a meaningful response.
> >
> > I've attached something I'm working on (which I am
> > sure doesn't work yet :) ) to give you the idea of my
> > direction.  If you think it looks in the same ballpark
> > as your goal we should followup.
> >
> > Seems all the cool REST articles are using Python or
> > Ruby, I'd like to give them a reason to use Perl
> > instead :)
> >
> > --john
> >
> > --- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> >
> >> On Sep 6, 2006, at 3:35 PM, John Napiorkowski wrote:
> >>
> >>> Garrett,
> >>>
> >>> Looks like we are working on something similar.  I
> >>> hadn't noticed your postings about two weeks about
> >> (I
> >>> was in the middle of moving from Beijing back to
> >> the
> >>> USA and missed about a week of Catalyst postings)
> >> or I
> >>> might have saved time asking the same questions
> >> you
> >>> asked.
> >>>
> >>> I'm actually doing this as an Action class.  Since
> >> I
> >>> don't find any additional posts I'm not sure your
> >>> status.  Want to collaborate?  I am also very
> >>> interested in REST based services and would enjoy
> >>> having someone to bounce ideas off of.
> >>>
> >>>
> >>
> >> I've just been through something similar. Moving
> >> back to the USA from
> >> Lima, Peru.
> >>
> >> I spent the week following that last post dissecting
> >> InstantCRUD and
> >> rewriting something similar but RESTful for the work
> >> I've previously
> >> mentioned. I had to present something that kinda
> >> sorta worked on the
> >> 28th. Which led to many shortcuts being taken. I'm
> >> still not happy
> >> with where I'm at. But the last week of
> >> transitioning back to the
> >> states and getting the kids into school is settling
> >> down. Reminder to
> >> self... I still need to send a foreign key patch for
> >>
> >> DBIx::Class::Schema::Loader::DBI::SQLite to Brandon.
> >>
> >> I'd be happy to collaborate. I'm fully aware that
> >> I'm unaware of
> >> Catalyst best practices. And like you, I'd love to
> >> bounce ideas and
> >> code around.
> >>
> >> Perhaps you could start by describing your goals and
> >> your approach in
> >> more detail. I still need to convert my hacked
> >> Catalyst::Action into
> >> an class derived from ActionClass. If I get some
> >> time tomorrow, I'll
> >> work that up and post some code.
> >>
> >> cheers,
> >>
> >> Garrett
> >>
> >>
> >>> --- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> >>>
>  On Aug 22, 2006, at 3:49 AM, Matt S Trout wrote:
> >> Garrett Goebel wrote:
> >>
> >> I hacked something into the Path and Regex
>  dispatchers to get
>  collective
> >> matching on method and path working in the
>  prototype.
> >
> > You shouldn't need to hack anything into these;
>  just use a custom
>  ActionClass
> > that overrides $action->match to introspect onto
>  the request
>  method and
> > anything else you need (this is already how
> >> :Args
>  is handled, see the
> > Catalyst::Action source for the implementation).
> 
>  Thanks. I'd found the :Args code in
> >> Catalyst::Action
>  last night and
>  managed to shoehorn the request method and path
>  parameter matching
>  checks into it. How to subclass or override it
> >> was
>  going to be my
>  next question. I'll check out using a custom
>  ActionClass.
> 
>  Last night I also sub-classed the Request class
> >> to
>  add:
>  __PACKAGE__->mk_accessors(qw/path_parameters
>  accept_extension/);
> 
>  And I'm currently subclassing the Dispa

Re: [Catalyst] (Beginner) Plugins

2006-10-24 Thread J. Shirley

Be weary about that -- Safari doesn't like image scaling without both
width and height attributes set.  It'll set the width to 100%, but the
height will remain the default image height.

On 10/24/06, Bill Moseley <[EMAIL PROTECTED]> wrote:

On Tue, Oct 24, 2006 at 12:34:05PM -0400, Alejandro Imass wrote:
> Yes, sorry, I was lazy in my answer. I meant that this whole thing seemed
> too much trouble. It seems that by setting the proportion fixed (fixing the
> w/h ratio) I can generate the image only once on the server and the resize
> with CSS and JS.

Shouldn't this do the trick?

width: 100%;


--
Bill Moseley
[EMAIL PROTECTED]


___
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/



___
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] Re: packaging and porting Catalyst

2006-10-30 Thread J. Shirley

I'm also interested in getting an EC2 (Amazon's grid computing) image
for Catalyst up and running.  I've been playing around with it a bit,
if there is more of a desire for this let me know.

I'm still trying to come up with some good use cases as to why an EC2
image is worth the work getting there (aside from the fact Catalyst
kicks ass, and it should merely be there just because)

-J

On 10/30/06, Bill Moseley <[EMAIL PROTECTED]> wrote:

On Mon, Oct 30, 2006 at 04:04:09PM +0100, A. Pagaltzis wrote:
> * Bill Moseley <[EMAIL PROTECTED]> [2006-10-30 16:00]:
> > One disadvantage of generating packages for distributions is
> > that users without root access (such as on shared hosting)
> > cannot install the packages.
> >
> > I have a tarball I used for on Debian Stable that I unpack into
> > $HOME/local. It has the additional advantage that I'm not
> > relying on system-installed packages which could change --
> > perhaps breaking my application.
>
> For admins rolling out stuff to many machines in a controlled
> envirvonment, unpacking tarballs is a stupid idea.

But, who is the target of this effort?  I thought it was to help get
past the often difficult process of installing Catalyst via CPAN.

Or is it to get providers, like Dreamhost, to include Catalyst in
their offerings to their users?  Actually, for Dreamhost it might be
more likely for them to offer it as one of their "one-click installs"
which would likely be better as a tarball than a deb.

--
Bill Moseley
[EMAIL PROTECTED]


___
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/



___
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] Last Chance / Last Day: Web development platform contestand Perl / Catalyst

2006-12-01 Thread J. Shirley

On 12/1/06, Bill Moseley <[EMAIL PROTECTED]> wrote:

On Fri, Dec 01, 2006 at 04:43:03PM -0200, Nilson Santos Figueiredo Junior wrote:
> On 12/1/06, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
> >Perl.  Is.  Not.  Dead.
>
> No one *here* is stating that Perl is really dead. Otherwise we'd all
> be undead zombies from hell or something like that. Anyone who's
> inside the Perl community knows it's alive and kicking and that most
> of Perl's "widely known problems" are actually FUD. The real problem
> is that it currently seems to be an ever shrinking community.

Unfortunately, FUD drives the real world.  How often do projects get
written in Perl or Ruby or Python because it is the best choice vs.
what the managers think is the best choice?

What's the goal?  Open up the paper and see lots of listing for Perl
jobs?  That managers pick Perl/Catalyst over another solution?  That
Perl is popular enough to drive up demand for good perl programmers?



On the other side of the coin, my company is actively hiring right now
and we've been flooded by people who have that same perception and
poor Perl knowledge.  To the point that we've had candidates inform us
it would be highly advantageous to rewrite certain parts in C (of all
languages).

Perl has always had a stigma attached to it that it was a hackish
language.  This comes from perl4, in my opinion.  When Perl 5 came
out, it turned Perl into a language that can actually be used for
larger projects, and used very well.  I believe Perl 6 will take the
simplicity that Perl offers, as well as the capability and put a new
face on it that will help justify the time to give Perl a second look.

Perl is not dead.  However, Perl is not a language many people feel
comfortable putting their career on the line.  A very good friend of
mine, who is a brilliant programmer, abandoned Perl for Java because
of job security.  I'm hoping to win him back to the Perl side, but
he's not alone.  Why bother risking the safety of your career because
you want to hang on to what most people consider an out-of-date and
less capable language?  There is very little incentive to do so.
Right now it is more beneficial for developers to focus on other
languages, because there are more jobs out there.  Regardless of
"death", that part is true and easily substantiated.

My opinion on changing that is to simply do very cool things in Perl,
get people who want to work on cool things, and just get it done.
Things like plat_forms help, as well, and I hope the Catalyst team
does very well.

Hopefully these things help contribute in someway to promote the idea
that Perl is a good language.

-J.

___
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] Last Chance / Last Day: Web development platform contestand Perl / Catalyst

2006-12-01 Thread J. Shirley

On 12/1/06, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

J. Shirley wrote:
> A very good friend of mine, who is a brilliant programmer, abandoned
> Perl for Java because of job security.  I'm hoping to win him back to
> the Perl side, but he's not alone.  Why bother risking the safety of
> your career because you want to hang on to what most people consider
> an out-of-date and less capable language?

Hmm, I didn't know that you were only allowed to know one programming
language.  You probably don't want to tell him this, but [whispering]
some people know both!  I hear some legends even know... get this...
*three* programming languages!


Hyperbole much?

There is a difference between the languages known, and what is
recognizable as a persons career language.  The vast majority of
developers focus specifically on one language, and then have other
languages that they know, but to a lesser degree.

As someone who has screened probably around a thousand resumes in the
last 12 months, I can say that this is the way most developers are.
If someone claims they are advanced or experts in more than one
language, they tend to either be liars, or open source developers.

___
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] Last Chance / Last Day: Web development platform contestand Perl / Catalyst

2006-12-01 Thread J. Shirley

On 12/1/06, Sebastian Riedel <[EMAIL PROTECTED]> wrote:

apv wrote:
> The last two big companies I worked for were both moving away from
> Perl. One of them was Amazon.com (I known there are still a few
> boosters and projects for Perl there but as a whole the company has
> become quite anti-Perl and has been rewriting everything in Java it
> can get budget money for). It isn't because Perl isn't useful, Perl
> helped build both of the companies, but because it has an image of not
> being up to the task. Sure Perl's not dead but that's at least 100
> high paying, high profile Perl jobs in my town alone that are gone.
> Not because Perl sucks but because a lot of people think it does.

Funny you mention Amazon switching to Java.
I would expect more Ruby projects from them since the Jeff Bezos /
37signals deal.


http://www.37signals.com/svn/archives2/bezos_expeditions_invests_in_37signals.php


--
sebastian

___
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/



All of Amazon's front-end is in Mason (and as such, Perl) along with
their middle-ware.  The backend is changing out, but that has usually
been in C/C++ and is switching to Java.

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com - http://code.toeat.com/~jshirley

___
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] nmake "too long" error installing catalyston activeperl5.8.8

2007-01-19 Thread J. Shirley

On 1/19/07, Octavian Rasnita <[EMAIL PROTECTED]> wrote:

Hi,

What's EU::MM?
I have tested Test::Harness but I have the latest version.

Thanks.

Octavian

- Original Message -
From: "Christopher H. Laco" <[EMAIL PROTECTED]>
To: "The elegant MVC web framework" 
Sent: Friday, January 19, 2007 10:45 PM
Subject: Re: [Catalyst] nmake "too long" error installing catalyston
activeperl5.8.8


> ___
> 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/
>


___
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/




EU::MM is ExtUtils::MakeMaker -
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.31/lib/ExtUtils/MakeMaker.pm

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] Question on serving files

2007-02-16 Thread J. Shirley

Hi Joe,

If you really want Catalyst to do this, check out
Catalyst::Plugin::Static::Simple and its configuration options.

It typically yields much better results to leave that action to your
webserver, though.


--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com


On 2/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi,

I have a catalyst application which displays a list of files in a directory.
I would like to provide an anchor on the files to have them download according
to their
mime-type.
e.g. Clicking on a link to an excel file will stream the file with mime-type
application/excel just as though it came from an indexed folder.

How do I do this through the Catalyst handler & response mechanism?

Thanks,

Joe


--
Sent with "Me-Mail", Boltblue's FREE mobile messaging service.
http://www.boltblue.com


___
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/



___
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] "You have been automatically logged out."

2007-02-20 Thread J. Shirley

On 2/20/07, Gavin Henry <[EMAIL PROTECTED]> wrote:

Dear All,

How would you advise implementing an automated logout system?

Polling via js?
Server side timing?

Not sure, but I've seen many sites (banking etc.) do this.

Thanks,

Gavin.

--
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673

___
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/



Hi Gavin,

If you aren't doing any AJAX interactions, the simple approach is to
add a JavaScript listener to the onload event that calls the following
(untested) function:

var activityTimer;
function setActivityTimeout(time) {
   if ( activityTimer ) clearTimeout(activityTimer);
   activityTimer = window.setTimeout( function() {
   alert("You have been logged out.");
   document.location = "/";
   }, time || 600);
}

On each page unload, this timer will be canceled.  If you do any AJAX
loads that count as activity, simply call setActivityTimeout() on the
initiation of the remote event.  And, of course, expire the session on
the server to match whatever is your client side time out as well.

-J

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com - http://code.toeat.com/~jshirley

___
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] "You have been automatically logged out."

2007-02-20 Thread J. Shirley

On 2/20/07, Chris Carline <[EMAIL PROTECTED]> wrote:

On 2/20/07, J. Shirley <[EMAIL PROTECTED]> wrote:
> If you aren't doing any AJAX interactions, the simple approach is to
> add a JavaScript listener to the onload event that calls the following
> (untested) function:
>
> var activityTimer;
> function setActivityTimeout(time) {
> if ( activityTimer ) clearTimeout(activityTimer);
> activityTimer = window.setTimeout( function() {
> alert("You have been logged out.");
> document.location = "/";
> }, time || 600);
> }
>
> On each page unload, this timer will be canceled.  If you do any AJAX
> loads that count as activity, simply call setActivityTimeout() on the
> initiation of the remote event.  And, of course, expire the session on
> the server to match whatever is your client side time out as well.

Why not simply add a meta refresh tag to the top of the template header?

e.g.:


___
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/



Chris,

The meta refresh is a good idea, although I avoid it because an
inadvertent escape cancels the timeout in some browsers (Firefox being
one).  This means if the user hits escape for whatever reason, the
feature is just disabled without warning; with a javascript method it
tends to be more consistent for the user.

-J

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com - http://code.toeat.com/~jshirley

___
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] "You have been automatically logged out."

2007-02-21 Thread J. Shirley

On 2/21/07, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

Ted Carnahan wrote:
> I've been pondering an alternative that uses a JS timeout to do
> something HTML-y, like a div appearing on the side of the window to tell
> them.  This probably still suffers from the "escape cancels timeout"
> issue reported down-thread.

I think the way most people do this is:

1) Do nothing with javascript
2) In /auto, check if the session is timed out
3) If so, print an error message instead of doing the full request

Skip this check for the /login page, obviously.

The idea is to let the user know why their action failed, not to pop up
messages saying "something might fail in the future!"  Plus it's easier
to implement, and works with every browser.

Regards,
Jonathan Rockway

--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

___
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/



That isn't an automated logout system, in which he specifically asked
for a solution for.

___
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::Log::Log4perl branch

2007-03-05 Thread J. Shirley

On 3/2/07, Adam Jacob <[EMAIL PROTECTED]> wrote:

Several people have pointed out that various parts of Log::Log4perl
don't work well with Catalyst.  Specifically, many of the options
that rely on Stack information are incorrect.  The format strings:

%L Line number within the file where the log statement was issued
%F File where the logging event occurred
%C Fully qualified package (or class) name of the caller
%M Method or function where the logging request was issued
%l Fully qualified name of the calling method followed by the callers
source the file name and line number between parentheses.

Sebastian Willert has helpfully provided a patch that should resolve
these issues.  He rules.  His changes have been put on this branch:

http://dev.catalyst.perl.org/repos/Catalyst/branches/Catalyst-Log-
Log4perl/cspec-fixes

I'm going to be pretty busy for the next few days, but don't want to
sit on this any longer.  Can those of you using
Catalyst::Log::Log4perl give this a whirl, and make sure it works
with your applications? (And doesn't cause any kind of nasty
performance implications, especially with the cspec fixes disabled?)

Your rewards will be my enduring gratitude, and a better
Catalyst::Log::Log4perl.

Thanks!

Adam

___
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/



Hey Adam,

Thanks for doing the work here.  I've got it going in one of my apps
on the dev site, things are working ok so far.  I'll keep banging on
it and making sure that it continues to work a-ok.  If you have
anything specific you'd like me to focus on just holler, otherwise
I'll be doing generalized testing.

Example from the log (pattern is:[%d %p (Method: %M; Class: %C; Line:
%L; FQN: %l] %m%n) :
[2007/03/03 13:31:30 DEBUG (Method: Catalyst::View::TT::render; Class:
Catalyst::View::TT; Line: 453; FQN: Catalyst::View::TT::render
/usr/lib/perl5/site_perl/5.8.7/Catalyst/View/TT.pm (453)] Rendering
template "root.tt"


And, as an aside, It'd be great to have a _dump feature as well --
patches welcome?

Thanks,
-Jay
--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com - http://www.mailroller.com

___
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] work with second database

2007-04-11 Thread J. Shirley

On 4/11/07, Michael Higgins <[EMAIL PROTECTED]> wrote:

Hello, All --

As I'm still trying to get my head around the Catalyst way of doing things,
I'm hoping can someone give me a hint:

I have an application set up to report on a database. So far, so good.

Now, I've got another database I need to query. How do I best integrate
access to it into my existing application?

Sorry for the generality of the question, but I don't even know the
terminology yet. Is this, say, going to be a 'separate namespace' or
something?

Is there an example out there I could familiarize myself with, where a
Catalyst application uses two different databases?

I understand I can have as many models, views and controllers as I need. I
don't understand what I need to create in order to have another model
accessed from an existing controller, or how to define that model and get it
loaded.

Any leg up greatly appreciated.

Cheers,

--
Michael Higgins





Hi Michael,

The long answer depends a bit on what you are already using to connect
to the database (DBix::Class, Data::ObjectDriver, RoseDB, etc?).

The short answer is simply create another model class and configure
it, just like you did with the first one.

The tutorial has a lot of good information on accessing a database:
http://search.cpan.org/~jrockway/Catalyst-Manual-5.700501/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod

-Jay

___
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] Re: oe1.orf.at now running on Catalyst

2007-04-20 Thread J. Shirley

On 4/20/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote:

* Josef Chladek <[EMAIL PROTECTED]> [2007-04-19 18:05]:
> we even put a "powered by catalyst" in the bottom-right corner
> of the page.

May I say something? I currently avoid linking people to the site
because… well… it could use some shape-up.

There was talk about a relaunch about half a year ago, but it
seems those plans fizzled out. Have they?



There's a branch for the work, but it needs to be populated (blame me).

We have some MojoMojo templates (thank jrockway), and now we just need
time to work on it.  Unfortunately I think this is one of those things
not very many people find all that interesting to work on so it easily
slips through the cracks.

-J.

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] Re: oe1.orf.at now running on Catalyst

2007-04-20 Thread J. Shirley

On 4/20/07, Chisel Wright <[EMAIL PROTECTED]> wrote:

On Fri, Apr 20, 2007 at 07:44:30AM -0700, J. Shirley wrote:
> We have some MojoMojo templates (thank jrockway), and now we just need
> time to work on it.  Unfortunately I think this is one of those things
> not very many people find all that interesting to work on so it easily
> slips through the cracks.

What's involved/required to make it happen?



Nothing monumental, really.  The overly simplified roadmap is:

1) Populating the repos with the most current stuff (mojomojo
templates, etc,
http://dev.catalyst.perl.org/browser/branches/site-notrac)
2) Setup a MojoMojo site for the new Catalyst site running out of that branch
3) Finish up the templates
4) Import content from Trac
5) Assign WikiGnomes

Feel free to chat w/ me on IRC (#catalyst-dev preferably) if you're
interested in helping.  I'm eager to get it done, but have been
extremely busy at work lately.

___
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] User account registration login

2007-05-12 Thread J. Shirley

On 5/12/07, Tom Printy <[EMAIL PROTECTED]> wrote:

Hello,

I was wondering if there is a user registration/account creation/login
module for catalyst.  While I understand that all login systems are
different I was hoping that there was one that I could extend to meet my
needs instead of rolling my own from scratch. Furthermore is there a
directory of open Catalyst projectes out there other than the Catalyst
wiki?

Thanks
-Tom Printy





Hi Tom,

There aren't any ready made applications, but it probably could be a
good example application.  It depends on a number of factors, though.

What backend do you want to use for user storage?  LDAP or DB?  If DB,
DBIC is probably the most likely example you'll get.

You may find the "examples" section of the SVN repository helpful:
SVN: http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/
Web: http://dev.catalyst.perl.org/browser/trunk/examples

Keep in mind several of these examples are very old, though.  Look out
for the more modern distributions.

Good luck, and happy hacking.

-J

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] Sending email from Catalyst and scripts

2007-05-22 Thread J. Shirley

On 5/22/07, Evaldas Imbrasas <[EMAIL PROTECTED]> wrote:


Hello list,

I'm looking for best practices for sending email from the catalyst app
that would also work with command-line scripts (cronjobs, one-time
scripts, etc.).

In my current setup, Email model takes care of storing metadata in the
database for each sent email, and Email controller has a private
method which takes care of generating and sending actual emails. Is
this the right way to go, or would it make more sense to move the
email sending functionality to some utility module so it works equally
well for non-catalyst scripts as well? Or is it easy enough to
setup/prepare the catalyst context in the scripts so that I could use
the send_email method from the catalyst Email controller?

What is the most common email framework setup among catalyst users? I
think it would be useful to add a few possible examples for this to
Catalyst::Manual::Cookbook as well.

Thanks.
--
-
Evaldas Imbrasas
http://www.imbrasas.com



Hi Evaldas,

I've recently been working on an Email view, which I hope will become the
recommended way to send Email from Catalyst.  It hitches into Email::Send,
and also ties into your Template view (which, sadly, only works with
View::TT at the moment but I'm hoping to get the other views supported soon)

I haven't posted it to CPAN yet, as I'm waiting to get some tests written up
for it, but you can download it from the Catalyst SVN repository at:
http://dev.catalystframework.org/repos/Catalyst/trunk/Catalyst-View-Email/

I also have a tarball at
http://staff.toeat.com/~jshirley/Catalyst-View-Email-0.01.tar.gz

I recommend you read through the pod for both Catalyst::View::Email and
Catalyst::View::Email::Template

And, as for sending out an email via the command line, there are many ways
to achieve this depending upon what your goal and full use case is.

Good luck, and happy hacking,
-J

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] installing Cache::Memcached::Managed without failed tests?

2007-05-30 Thread J. Shirley

On 5/30/07, John Goulah <[EMAIL PROTECTED]> wrote:


As most people know, the Cache::Memcached::Managed is a dependency of
Catalyst::Plugin::Session::Store::Memcached.   If I force install
Cache::Memcached::Managed,  I can install the catalyst plugin without
errors, however, without the force, the 'managed' module fails many tests.
I'm wondering if anyone has successfully installed it with the tests
passing, and if so what versions of libevent and memcached are you using?

I'm using libevent-1.3b and memcached-1.2.1.

I tried to post the errors, but the  message was apparently too big for
the list.  In other words, there are lots of errors.  Also, I reproduced
this on 3 different machines (one 32bit, one 64bit, one mac os).


Thanks
John





Hi John,

I have 0.15 installed w/o any issue, but it looks like 0.16 has some other
issues with it.

CPANTS is showing failures across the board, but there don't seem to be any
open tickets against the module.  It may be a good idea to open a ticket.


--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] installing Cache::Memcached::Managed without failed tests?

2007-05-31 Thread J. Shirley

On 5/31/07, John Goulah <[EMAIL PROTECTED]> wrote:


On 5/30/07, J. Shirley <[EMAIL PROTECTED]> wrote:
>
>
> I have 0.15 installed w/o any issue, but it looks like 0.16 has some
> other issues with it.




Which version of libevent and memcached are you using with the 0.15module?   I 
cant make that one pass the tests either



Running libevent 1.0.2 and memcached 1.1.12


--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] installing Cache::Memcached::Managed without failed tests?

2007-05-31 Thread J. Shirley

On 5/31/07, John Goulah <[EMAIL PROTECTED]> wrote:



On 5/31/07, J. Shirley <[EMAIL PROTECTED]> wrote:
>
> On 5/31/07, John Goulah <[EMAIL PROTECTED] > wrote:
> >
> > On 5/30/07, J. Shirley <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > I have 0.15 installed w/o any issue, but it looks like 0.16 has some
> > > other issues with it.
> >
> >
> >
> >
> > Which version of libevent and memcached are you using with the 0.15module?  
 I cant make that one pass the tests either
> >
> >
> Running libevent 1.0.2 and memcached 1.1.12



I'm assuming you  mean  libevent-1.2  since I cant find any 1.0.2?  (they
only have 1.0a-e) ?

In any case I still fail tests with that combo, I'll be glad to open a
ticket, just not sure what that means exactly.

Thanks,
John



___
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/



Hi John,
I doubt that the libevent would be much of an issue there.

After looking again I think that libevent 1.02 was actually 1.1a and my
build masked that, though.

http://www.monkey.org/~provos/libevent/

Let me know if you want any other info from me, I can get stuff from other
boxes, too.

-Jay
___
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] strange namespace behavior for dbic : schema

2007-06-08 Thread J. Shirley

On 6/8/07, Guy Debord <[EMAIL PROTECTED]> wrote:


So is this not a good option if I want specific logic in Model::Foo but
not Model::Bar ( I can't even create these without breaking )
This seems to run contrary to my reading of the documentation and
tutorials, etc.




Hi Guy,

I think that a diagram of how things are encapsulated would probably be of
assistance.  Sorry if I'm covering stuff you already know, just want to make
sure everything is thoroughly laid out.

First, it's important to know how things work outside of Catalyst.  The DBIC
classes you have can be used just like $schema->resultset('TableName'),
where $schema is (as I can see) a "TMP::Schema" object.

The DBIC::Schema helpers basically create a short-hand for you to access
"TableName", but they make you use some prefix.  This is really useful if
you have a model in your app called "User" but you also have a schema class
(a database table) named "User"

As an example, something like this:
  $c->model("User");# Just some other model class
  $c->model("DB::User");  # A DBIC class resultset, equivalent to doing
$schema->resultset('User')

So, just think that when you are doing "$c->model("DB::SomeTable")" you're
doing the equivalent of $schema->resultset("SomeTable");  And, as such,
$c->model("DB") would be somewhat analogous to returning the $schema object
-- except it doesn't, because that gets shoved off behind the scenes, and
Model::DBIC::Schema  creates a map between the ->resultset("TableName") and
model("DB::TableName") automatically, so you shouldn't need the $schema
object to get at the result sets.

The prefix there ("DB::") is configurable via the helper scripts, but is
very important (both for the reason I listed above w/ having other model
classes) and the way that Catalyst::Model::DBIC imports your schema classes
into your Catalyst application.

The syntax that Matt posted:
script/tmp_create.pl model DB DBIC::Schema TMP::Schema

Breaks down like this:
You're creating (tmp_create.pl) a model, with a prefix of "DB" that inherits
from "DBIC::Schema" and will use Helper::DBIC::Schema to generate the code.

The arguments beyond there ("TMP::Schema") are instructive to
Helper::DBIC::Schema to know what to map against.

Helper::DBIC::Schema then creates a map of the prefix ("DB") to
"TMP::Schema".

You're on the right track though, and what you said in the original post
about it getting "ugly" as the app grows I suppose is just a matter of
perspective.  You can always run without debugging enabled so you don't see
how things get dumped out.  But, it's all just information for you to look
at. Even without the ("DB::") prefix (or "Foo::" as you have in your
example) you'd still have to load each and every schema class into Catalyst
so that ->model(...) knows what to work with.

Hope this helps clear things up,
-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] Returning values from forward()

2007-06-08 Thread J. Shirley

On 6/8/07, Jim Spath <[EMAIL PROTECTED]> wrote:


What is the consensus on returning values from a call to forward?

I've seen a mailing list post stating that one should not rely on return
values from forward():

http://www.mail-archive.com/catalyst@lists.rawmode.org/msg03519.html

But the Catalyst docs seem to indicate that returning values is allowed
as long as you are aware of the the consequences:


http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7007/lib/Catalyst.pm#$c-%3Eforward(_$action_[,[EMAIL
 PROTECTED])

Anyways, just wanted to get a sense of what people think.

- Jim

___
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/




My personal opinion on it is to never use return values from ->forward.  If
you need the data, stick it in the stash.  I also find it very useful to
setup structured stash key definitions along with a glossary to keep things
sane.

For instance, if I'm holding onto any result sets in a chain, or forwards,
those always go to ->stash->{resultset}->{foo} (where foo is typically the
action name used to generate the resultset).

It's kept my applications extensible and pretty clean.

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] DateTime in session- breaks during login/logout

2007-06-13 Thread J. Shirley

On 6/13/07, Adam Bartosik <[EMAIL PROTECTED]> wrote:

I put DateTime object into session like this:

use DateTime;
$c->session->{dateo} = DateTime->now;

Everything works ok, object is properly stored/retrevied until you login
or logout.

After logout ($c->logout) I get:

undef error - Invalid locale name or id: , at
/usr/lib/perl5/Cache/FastMmap.pm line 551

and some warnings from
Use of uninitialized value in transliteration (tr///) at
/usr/share/perl5/DateTime/Locale.pm line 202.
Use of uninitialized value in exists at
/usr/share/perl5/DateTime/Locale.pm line 206.
Use of uninitialized value in hash element at
/usr/share/perl5/DateTime/Locale.pm line 209.
...

After that session is broken - you need to destroy it manually or delete
cookie for new session record.

The same happens using Session::Store::DBI.
The same happens with DateTime in session when login.

It seems to be related only to DateTime objects, other objects can
survive in session during login/logout without any problems.

Do you have such problems with DateTime in session?

--
[EMAIL PROTECTED]  http://www.hurra-communications.com/
$ o m et e a m  .  d e v e l o p e r
Hurra Communications, Krakow/Stuttgart/London/Paris/Madrid




Hi Adam,

If you don't have DateTime::Locale version 0.34, please try that.
There was a bug in the Storable freeze/thaw handling.

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] html::prototype syntax in new Cat version

2007-07-10 Thread J. Shirley

On 7/5/07, John Wang <[EMAIL PROTECTED]> wrote:

On 7/4/07, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
> The Prototype + Scriptaculous javascript framework is junk.
> It doesn't work very well, the syntax is terrible, it will break other
> javascript on the page just by being included, and the "cool effects" it
> includes aren't even very good.  There is absolutely no reason to use
> Prototype.

It might be useful to provide some specifics in helping people decide which
JS framework to use.

 What do you mean by "It doesn't work very well"? Is this a performance
issue (does it take a long time to load), a cross-browser issue (do more
browsers not work compared to other JS frameworks), a security issue, etc.?

What do you mean by "the syntax is terrible"? Is this regarding $() (which
is also used by jQuery) or something else?

When you say "it will break other javascript on the page just by being
included" what kind of JS will break? Prototype.js was updated a while back
to solve a lot of this. Have you run into this with a recent version of
prototype.js?

Do the other libraries have better "cool effects"? Which ones do you think
are better in other libraries?

Just trying to get some clarification.

--
John Wang
http://www.dev411.com/blog/


One must rate JavaScript libraries using a very objective scale.  The
categories I use are:
1) Robustness (quality of code)
2) Standardization (do they break existing standard JavaScript, other
libs, proper encapsulation?)
3) Efficiency (execution and rendering speed)

prototype.js and friends (scriptaculous, openrico, etc) are rated the
lowest in those categories.  It fails the robust check by having
several things that don't play nice together, and also I've seen some
serious cross-browser compatibility issues.  Standardization is
probably the biggest gripe people have with prototype.js.  It doesn't
encapsulate and clobbers existing objects or adds on to them in weird
ways (like arrays).  As an example, if you use some effects in
scriptaculous, Google Maps fails to work because of their mouse
capturing code.

Efficiency I'm not sure of, really.  I've never bothered to check
because the other two categoreis are so dismally rated.

It's safe to say that inside of the Catalyst community, you will get
absolutely zero support if you chose to use Prototype.  You are free
to ask, but you will get flamed for your choice.  That's just the way
it goes.

If you want alternatives, here are the more favored solutions that
have proven themselves to be of a quality Catalysters will bother
assisting with:
* Dojo - http://www.dojotoolkit.org/
* YUI - http://developer.yahoo.com/yui/
* jQuery - http://www.jquery.com/
* Mootools - http://mootools.net
* MochiKit - http://www.mochikit.com

And, of course, there is Ext (http://www.extjs.com) which sits on top
of YUI and jQuery (and hopefully Dojo soon... and unfortunately
prototype.js, but it's a good way of getting your code away from
prototype and onto something higher quality.) and is more of a
"widget".

Picking a quality JS lib is just as important as picking a quality framework.

-J.

___
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] html::prototype syntax in new Cat version

2007-07-10 Thread J. Shirley

On 7/10/07, John Wang <[EMAIL PROTECTED]> wrote:


Good to know. Do you know which Scriptaculous effects break Google Maps? It
will be useful for planning for the future.



Sorry, was too long ago to remember the specifics... it was a
mouseover event that attached to the document and thus blocked any
events.  It could even be fixed now.  I remember a lot of
prototype/scriptaculous events clobbered the events rather than
appending to the event list.


Some of the larger Catalyst-based sites use prototype (or parts of
prototype) but the ones I've seen don't use Google Maps. Those projects also
don't ask for prototype help from the Catalyst community. I think some of
the flames given for prototype usage also prevent others from providing
assistance. As you say, that's just the way it goes.


Right, and the people who use prototype are aware of the deficiencies
and work around them.  They're not asking for support :)  Marcus is a
smart guy, as evidenced continuously, but I'll never know why he uses
prototype :)

-J.

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] html::prototype syntax in new Cat version

2007-07-10 Thread J. Shirley

On 7/10/07, John Napiorkowski <[EMAIL PROTECTED]> wrote:


It's been said by others but I really prefer to do all
this in my templates.  It would be easy to have this
in a Template Toolkit plugin if you wanted, but I
can't see the value of basically using perl as a code
generator for Javascript.  I prefer to be closer to
the original API.  But that's my choice :)

--john




Agreed, but I sometimes doubt the practicality of this when attracting
new users.  Folks who are comfortable with full-spectrum development
(setting up Apache, FastCGI/MP, Catalyst, their templating, DBs) are
the minority.  A significant number of users are copy'n'paste-based.
They take code that works, and include it in their own app and
continue until they get the product they want.

Without helpers, we're going to be stuck with people asking about the
JS-toolkit that does have a helper.

The only way I think we can help promote a "better path" is to make it
just as easy to use a better JS kit.  This means helpers, and TT
macros and all that.

The problem is that everybody who has the knowledge to do this, simply
doesn't care to because they fundamentally view it as wrong or a waste
of time (which I do as well, but I see the "business" case for the
Catalyst project).

-J.

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] size limit on file uploads

2007-07-10 Thread J. Shirley

On 7/10/07, Jim Spath <[EMAIL PROTECTED]> wrote:

I would like to place a maximum file size limit on uploads, but am not
quite sure how to go about this in Catalyst.

I've done this in CGI scripts by reading in chunks of the file until I
hit some size limit, but couldn't find anything in the Catalyst docs.

Thanks!
- Jim



Hi Jim,

A better approach would be to configure the webserver to do this, that
way you aren't tying up your application.

As an example, if you use Apache simply do:
LimitRequestBody 1048576

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] size limit on file uploads

2007-07-10 Thread J. Shirley

On 7/10/07, Jim Spath <[EMAIL PROTECTED]> wrote:

J. Shirley wrote:
> On 7/10/07, Jim Spath <[EMAIL PROTECTED]> wrote:
>> I would like to place a maximum file size limit on uploads, but am not
>> quite sure how to go about this in Catalyst.
>>
>> I've done this in CGI scripts by reading in chunks of the file until I
>> hit some size limit, but couldn't find anything in the Catalyst docs.
>>
>> Thanks!
>> - Jim
>>
>
> Hi Jim,
>
> A better approach would be to configure the webserver to do this, that
> way you aren't tying up your application.
>
> As an example, if you use Apache simply do:
> LimitRequestBody 1048576
>
> -Jay

Jay,

Using the webserver is a definite possibility, and something we should
put in place anyways, to restrict large requests.

One downside of using such an option for limiting of file uploads is
that it restricts me from providing meaningful error messages to the
user within my application.

Another downside is that the limit would then be static across my
application, preventing me from setting different limits depending on
what the user is doing.

- Jim



Hi Jim,

I didn't realize that was what you were after.  The upload object
($c->req->uploads->{name}) has a ->size method that returns the size
in bytes.  You can check that to determine the actual attachment size.

I don't believe (and some of the Engine guys can correct me if
necessary) there is any way to split off while the upload is actually
happening unless you override prepare_body_chunk.

That method is called while processing the HTTP body and working with
an HTTP::Body object.  I'm not sure how you could not do something
application wide, since this happens during prepare_body:

http://search.cpan.org/~jrockway/Catalyst-Manual-5.700701/lib/Catalyst/Manual/Internals.pod#Request_Lifecycle

So -- as you can see there, I'm not sure how your action would know
about the limits unless you wrote a plugin for this, that then was
configured on a per-action basis.  Something like PageCache, really.

Just wild speculation, but hope it helps.

Happy hacking,
-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] Request for text handling advice -- Security, etc

2007-07-12 Thread J. Shirley

On 7/12/07, Dennis Daupert <[EMAIL PROTECTED]> wrote:

I'm focusing on form validation issues at the moment, particularly text
input for stories, articles. I'd like to ask for advice on handling user
input. I know, for example, it is unwise to trust user input -- but what are
recommended modules/plugins/etc for securing my Catalyst app?

/dennis






Hi Dennis,

My personal favorite is using Data::FormValidator, which is very
robust and full featured.  A simpler alternative is
FormValidator::Simple.

If you want to actually tie something into form generation and
handling, Catalyst::Controller::FormBuilder is the recommended
package.

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] TT2 + CP::Authentication + DBIC gotcha

2007-07-13 Thread J. Shirley

On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:

Matt S Trout wrote:
> On Fri, Jul 13, 2007 at 05:31:53PM +0100, Matt Lawrence wrote:
>
>> stephen joseph butler wrote:
>>
>>> On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
>>>
>> I can't replicate this behaviour. As far as I can tell, the postfix if
>> is identical to the block if I wrote above.
>>
>>
>> perl -Mstrict -wle 'my $foo = 1 if 0; print defined $foo ? $foo : "undef"'
>> undef
>>
>>
>> Has the bug been fixed?
>>
>
> No, because people use the "if 0" construct as a way to create a static.
>
> cain$ re.pl
> $ sub foo { my $foo if 0; $foo++; }
> $ foo();
> 0 
  $ foo();
> 1 
  $ foo();
> 2 
  $
>

Eurgh. I've never seen that before, but it's horrible.

Matt





As anecdotal evidence to its insidious behavior, I've personally been
involved in a 5 man debugging effort that took 13 days (not full days,
but probably an average of 3-4 hours a day * 5 people * 13 days) to
finally find the bug.  Which was simply "my $foo = $bar if $baz;"

The reason why it was so hard to track down was because ot he
wonderful undefined behavior.

Ahh, good times.  Never use that construct, for it will hurt you.  At
least we were all on billable hours ;)

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] flash with DBIC session storage

2007-07-27 Thread J. Shirley
On 7/27/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
> While hammering my site with ab (Apache bench) I'm getting loads of the
> the following error message:
>
> Couldn't render template "undef error -
> DBIx::Class::ResultSet::find_or_create(): DBI Exception:
> DBD::mysql::st execute failed: Duplicate entry
> 'flash:4f1bddce6c7828c27b2e47265f614109d4c21f19'
> for key 1 [for Statement "INSERT INTO sessions (id) VALUES (?)"
> with ParamValues: 0='flash:4f1bddce6c7828c27b2e47265f614109d4c21f19']
> at /usr/local/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/
> Session/Store/DBIC/Delegate.pm line 52"
>
> Any ideas what's going on here and how to fix it?
>
> Thanks!
>
> --Tobias
>

What's your backend RDBMS?  Not using MyISAM or something similarly
silly, right?

-Jay

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] flash with DBIC session storage

2007-07-27 Thread J. Shirley
On 7/27/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
> Am 27.07.2007 um 20:14 schrieb J. Shirley:
> > On 7/27/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
> >> While hammering my site with ab (Apache bench) I'm getting loads
> >> of the
> >> the following error message:
> >> Couldn't render template "undef error -
> >> DBIx::Class::ResultSet::find_or_create(): DBI Exception:
> >> DBD::mysql::st execute failed: Duplicate entry
> >> 'flash:4f1bddce6c7828c27b2e47265f614109d4c21f19'
> >> for key 1 [for Statement "INSERT INTO sessions (id) VALUES (?)"
> >> with ParamValues: 0='flash:4f1bddce6c7828c27b2e47265f614109d4c21f19']
> >> at /usr/local/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/
> >> Session/Store/DBIC/Delegate.pm line 52"
> >
> > What's your backend RDBMS?  Not using MyISAM or something similarly
> > silly, right?
>
> Indeed, I'm using MySQL + MyISAM but I've never come across this
> problem before.
>
> Is this some sort of locking issue and I've no choice but switch to
> InnoDB?
>
> --Tobias
>

MyISAM cannot do row level locking, so the only alternative is table
locking on writes.  So, what happens is you'll have two concurrent
write requests with the same session key and they'll clobber each
other.

The session table really really really should be InnoDB.  MyISAM is
very poorly suited for such activities.  As a general rule of thumb, I
tend to always say that unless you know why you should be using
MyISAM, you should use InnoDB.

Good luck with it though :)

-Jay
-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] flash with DBIC session storage

2007-07-27 Thread J. Shirley
On 7/27/07, Jonathan T. Rockway <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 27, 2007 at 06:11:03PM -0700, Mesdaq, Ali wrote:
> > I think in the case of the person who initially emailed the group the
> > problem is poor load testing. But it does bring up the point of better
> > handling of exception statements by DBIx.
>
> DBIx:: is a generic namespace for DBI extensions.  DBIx::Class is
> abbreviated as DBIC.  (This comes up a lot, I should add it to a FAQ
> or something.)
>
> > The DBIx::Class::ResultSet::find_or_create(): call should handle
> > this exception better because it can happen in tons of different
> > places and its not always an application or benchmarking issue.
>
> What do you think it should do?  create failed.  Only your app knows
> what to do in that situation.
>
> Maybe you are suggesting that errors be hidden so your app silently
> loses data?  I am not in favor of that.
>
> > In high load situations you WILL see this happen.
>
> I have a feeling that your app is broken then.  I often do dumbass
> load testing on my apps and don't have any problems with transactions
> failing unchecked.
>
> I really think you should read about transactional isolation and how
> deadlocks/conflicts are handled by your RDBMS.
>
> The Berkeley DB has really good documentation on both of these things,
> describing both theory and how to avoid common problems with the
> library itself.  SQLite's docs are also good.
>
>
> > To illustrate here is an example: Your DB has a first_name table to
> > store user first names You get a flood of new people registering and
> > you normalize their first names to get id's 2 Users have the first
> > name of Tom which does not exist yet You call
> > DBIx::Class::ResultSet::find_or_create(): Both calls detect the name
> > does not exist Both calls insert with one getting this error
> >
> > Now there is no real way to handle this in your app unless you do a lot
> > of concurrency checking or queuing of inserts.
>
> Rollback and try again.  Your DBMS' docs will tell you about the best
> strategy for dealing with this case.  I'm sure there's a good-enough
> generic solution... if someone knows it, I would like to hear.
>
> Anyway, you should probably continue this thread on the DBIC mailing
> list instead.  DBIC has *nothing* to do with Catalyst.
>
> Regards,
> Jonathan Rockway
>

Agreed on all counts, doubly so on moving to the DBIC mailing list.

If you believe that concurrency isn't handled properly in DBIC, I'm
sure several people would love to hear it.  I'm sure they'll
immediately shoot you down, though for the same reasons Jonathan
posted.

Here's a good test script that you can even port to DBIC that
demonstrates a concurrency bug in MySQL:
http://bugs.mysql.com/file.php?id=6906&text=1

-Jay

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] UTF16 issue

2007-07-30 Thread J. Shirley
On 7/30/07, Jim Spath <[EMAIL PROTECTED]> wrote:
> I'm getting the following warning in our Catalyst application:
>
>   UTF-16 surrogate 0xdecb at /usr/lib/perl/5.8/IO/Handle.pm line 199.
>
> Does anyone know anything about this type of error?  It doesn't happen
> when I run the script via the command line.
>
> - Jim
>
>

Hey Jim,
I'm getting similar warnings on my app.  Haven't figured it out, but
if you want some additional info (versions or something) to compare,
let me know.

-Jay
-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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 Hosting

2007-08-09 Thread J. Shirley
On 8/8/07, Matt Rosin <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I remember somewhere catalyst-friendly hosting. I'm looking for a new
> hosting company. I don't relish using catalyst without root access,
> having built it once locally, especially since I don't want to have to
> ask the company every time to edit the apache config for me.
>
> 1. Has anyone got a good one. I'm thinking of trying a Swamp acct on
> HostGator temporarily (around $20) and maybe upgrading to a VPS or
> tiny dedicated server later on for about $60-70. I had a VPS at a very
> bad hosting company I have to get rid of now. Anyway I understand you
> can't do things like ffmpeg with a shared account there so probably a
> pain to install other things. I'd probably use fastcgi I think.
>
> 2. Is it possible to do all the apache configs needed for running
> catalyst (fastcgi, or mod_perl) in a config file in my own public_html
> directory I wonder. Or does everyone running catalyst as a normal user
> emailing their ISP admin to configure apache every time they write a
> new app? Yes I know just get a root account is the answer but I'd like
> to know.
>
> Thanks,
>
> Matt
>

If you want to take the VPS route now, I've been really happy with
Linode.com.  $20/mo and it's been rock solid for a couple months.
Have 2 slices and been very pleased.  Supportive IRC channel, plus a
responsive customer support system.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] Bug in wiki

2007-08-10 Thread J. Shirley
On 8/10/07, Tatsuhiko Miyagawa <[EMAIL PROTECTED]> wrote:
> On 8/10/07, Steve Chervitz <[EMAIL PROTECTED]> wrote:
> > to this:
> >
> > my $vars = {
> > fruit => 'apple',
> > colors => qw(red yellow green blue)
> > };
>
> and I guess this should really be:
>
>   color => [ qw(red yellow green blue) ],
>
>
>
> --
> Tatsuhiko Miyagawa
>


Updated accordingly.  Thanks for pointing it out.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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 Hosting

2007-08-10 Thread J. Shirley
On 8/9/07, Barry Hoggard <[EMAIL PROTECTED]> wrote:
> On 8/9/07, Brian Kirkbride <[EMAIL PROTECTED]> wrote:
> > Linode++
> >
> > I used them for years before outgrowing it and moving on to several
> > dedicated servers.  Their support cannot be beat and the prices are
> > very reasonable.
>
> I don't see a discussion of backups on the site.  How did you manage
> that?  I suppose I could set up an amazon s3 backup routine.
>
> Barry Hoggard
>

Just pure speculation on my part, but I would imagine that they have
some sort of backup in place on any VPS setup to restore the servers
in case of failure.  I know they were able to chuck mine to a
different (geographically speaking) data center with nothing more than
a support ticket -- so I'm guessing they have systems in place to
handle the mirrors of VPS images.

But ... I'd rather be cautious, and if the data is that important back
it up separately so in case of an uncontrolled failure you can at
least pick up the pieces elsewhere. :)

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
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] improving usability / doc

2007-08-16 Thread J. Shirley
On 8/16/07, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
>
> Adam Bartosik wrote:
> > How many people decided to take different framework just because
> > catalyst doc still sucks?
> "Sucks" is somewhat hurtful to the many contributers, but whatever, I
> see what you mean.
>
> There has been talk of putting the POD on our site and making it look
> nicer (search.cpan.org's navigation sucks).  There has been talk of
> taking good articles from Planet Catalyst and giving them cleanup and a
> permanent home.  There has been talk of putting the Planet Catalyst feed
> on the main site.  There has been talk of completely revamping the
> design.  There has been talk of getting a team of happy wikignomes to
> polish up the wiki.
>
> The recurring theme is that /this is all talk/.
>
> Someone needs to Just Fucking Do It.  Implement the things above, and
> I'll buy you a case of your favorite beer.  If someone commits, I will
> move up the mojomojo migration on my priority list, so we can have some
> decent software running the wiki.
>
> With gnomes to tend the wiki, the upcoming book, prettyified API docs,
> and a front page with more information, I think we'll have the best
> offering of any framework.  Momentum is what we need, and right now
> there is none.  We need someone to commit to getting this stuff done (or
> even starting!) some time before the heat death of the Universe.  So the
> deal is, if you do this stuff, I will give you beer (is $50 reasonable?
> it is to me).
>
> I will help out with anything that doesn't involve HTML or design.  Let
> me know what you need, and I will help you get it.  Others share the
> same sentiment.
>
> Let's do this.
>
> Regards,
> Jonathan Rockway
>
>
I've been working on this in my free time -- trying to go to a unified look
and feel that we can move forward with, with a full style guide for
contributors, etc.

Here's the mockup that I'm working on:
http://staff.toeat.com/~jshirley/Catalyst/NewSite/

Suggestions welcome, patches more so.  You can grab this work from:
http://dev.catalystframework.org/repos/Catalyst/branches/site-notrac/

We have a ton of content, and no where to put it and no centralized style
yet.

I agree with Jonathan, lets JFDI.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] A Perl Message Queue?

2007-08-23 Thread J. Shirley
On 8/23/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
>
> > Has anyone seen stuff like a Messages Queue (I dont have other words for
> > it) But a more generic implementation of a thing where you can put in
> > messages and  pick them out in some other part of the program.
> >
> > It would be nice when you have stuff that takes longer that people
> usually
> > can wait for.
>
> Maybe TheSchwartz does what you want:
>
> http://search.cpan.org/dist/TheSchwartz/
>
> --Tobias
>
> ___
> 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/
>


I second using TheSchwartz -- 6a/TypePad had a presentation at OSCON on it,
reporting that they were having throughput of 800 messages per second.

We're using it at my job, and loving it.  I wrote out the very high level
"experience" at
http://jshirley.vox.com/library/post/catalyst-and-theschwartz-reliable-jobqueue-in-a-great-framework.html

Also, you can look at Gearman.

Hope this helps,
-Jay

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] A Perl Message Queue?

2007-08-23 Thread J. Shirley
On 8/23/07, tprinty <[EMAIL PROTECTED]> wrote:
>
> I don't know if you can do Queing but from Jesper's description it
> didn't seem like order was important. Seemed to me that he just wanted
> to stash something away and grok it later on.
>
> Supposedly the twitter guys have hacked memcached to act as a queue but
> I can't find anything on how they did it.


Gearman can probably do that then.

When you have messaging queues, it's important to specify if you want
reliable or unreliable message delivery... vastly different problems :)
___
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] XML RPC : Authentication and Session

2007-08-24 Thread J. Shirley
On 8/24/07, Nicolas Raspail <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm new in the Catalyst World and I'm trying to make my first app with
> it. But I have a
> problem with the session.
>
> I'm building an XML RPC server, and I want the users to be
> authenticated before using
> some commands. So I have created a controller (XMLRPC.pm) with the
> script and I have
> specified some commands iwth XMLRPCGlobal.
>
> At the beginning, the user must issue an RPC command named host_login,
> sending the
> username and the password. If the user exists, the function returns
> the sessionid that
> have been created after the authentification. this sessionid will be
> passed in argument
> in the next commands. But, that doesn't seem to work like this.
>
> Here is how I have implemented my RPC command :
>
> sub host_login : XMLRPCGlobal {
>  my ($self, $c, @args) = @_;
>
>  my $username = $args[0];
>  my $password = $args[1];
>
>  if ($c->authenticate({username => $username, password =>
> $password})) {
>  $c->stash->{xmlrpc} = $c->sessionid;
>  } else {
>  $c->stash->{xmlrpc} = 'KO';
>  }
>  $c->response->output('host_login');
> }
>
> But I don't know how to use this sessionid. If in an another RPC
> command, I call
> $c->session, it creates a new session, as if there is no more any
> session present.
>
> So, my question is how I can return a sessionid (or anything else)
> from a fisrt rpc
> command that authenticate the users, and use it in other commands to
> avoid sending again
> the username/password.
>
> Thanks
>
> Regards
>
> Nicolas



Hi Nicolas,

The session needs to have something that records state, such as a cookie, in
order to preserve across various requests.  For an RPC system, this is best
accomplished by using Catalyst::Plugin::Session::State::URI

http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-State-URI-0.07/lib/Catalyst/Plugin/Session/State/URI.pm

Please read all the pod available there, as there are some other issues you
should be aware of (especially about session hijacking)

Hope this helps!  And, you may want to look at Catalyst::Plugin::Server,
which makes the RPC handling much cleaner:
http://search.cpan.org/~michiel/Catalyst-Plugin-Server-0.24/lib/Catalyst/Plugin/Server.pm

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] A Perl Message Queue?

2007-08-24 Thread J. Shirley
On 8/24/07, Jesper Krogh <[EMAIL PROTECTED]> wrote:
>
>
> > I don't know if you can do Queing but from Jesper's description it
> > didn't seem like order was important. Seemed to me that he just wanted
> to
> > stash something away and grok it later on.
>
> Thats pretty much the requirement. But it needs to be "fail-tolerant" and
> survive a reboot of the computer without loosing messages.
>
> Jesper
> --


If you require fault-tolerant (reliable message delivery) then you'll need
to have a fail-over system for storage.  Typically, this involves databases
as Perrin posted earlier.

If you do a Master-Master replication setup, you're guaranteed to have
redundancy between the jobqueue and you won't have any loss of data.  If you
only have one server, you at least get the failure when trying to insert the
job rather than it being lost in the ether.

I'm not sure of the other messaging queues others have posted, perhaps they
can address if the recommendations support this requirement.

I can, however, say that TheSchwartz does work and is fault-tolerant (both
in terms of hardware failures and recording if a message/job was unable to
be processed properly).

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] A Perl Message Queue?

2007-08-24 Thread J. Shirley
On 8/24/07, Bernhard Graf <[EMAIL PROTECTED]> wrote:
>
> Hartmaier Alexander wrote:
>
> > So TheSchwartz may be a good module to queue mails by a Catalyst app
> > for sending them by let's say a perl script run by cron (or running
> > all the time)?!
> >
> > At the moment I'm sending the mails directly from my Cat app (SMTP to
> > localhost mail daemon) which works flawless (as long as the local MTA
> > runs).
>
> Don't know about TheSchwartz (btw. what a stupid name), but MTAs have
> their own message queues, so no need for another one.
>
> SMTPing to localhost usually doesn't make much sence - it is slow and as
> you mentioned already it causes trouble when the daemon is down or slow.
>
> So either you want to do queueing overhead, dns resolving and SMTPing to
> the *remote* host yourself or you simply open(MAILER,"|sendmail @args").
> --
> Bernhard Graf
>
>
>
That's not entirely true, in as much as it may be technically correct but in
reality could bite you in the ass.  If you send out a lot of emails, you'll
likely piss off a lot of admins if you open/close a bunch of connections and
send one email a piece

Better to send out in a group while you have the socket open...

And TheSchwartz has a module for this already:
http://search.cpan.org/~btrott/Email-Send-TheSchwartz-0.01/lib/Email/Send/TheSchwartz.pm

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] Re: A Perl Message Queue?

2007-08-26 Thread J. Shirley
On 8/26/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
>
> * Jonathan Rockway <[EMAIL PROTECTED]> [2007-08-25 05:15]:
> > When you write your own message queue that actually works
> > correctly, is supported and documented, and is available freely
> > on the CPAN, you can pick the name. In the mean time, STFU.
>
> If I told a client that I intend to use "TheSchwartz", they'd
> look at me like I'd grown a third head. I understand and even
> appreciate the joke, but since I like to write numbers on
> invoices I prefer my puns more palatable to stodgy business
> people with no sense of humour (or ideally out of their sight
> so there is no need to dilute the joke for their benefit).
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.org/>
>
>
It's all semantics.

"The job queue system is in place at LiveJournal, Vox and other Six Apart
services.  It's fully open source, written in Perl, and can use our existing
database infrastructure."

Invoice: Reliable Job Queue System

Good enough for me.

And then the geeks can appreciate it being called TheSchwartz and the
business folks can talk about their robust, cost effective reliable
distributed message queue.

-Jay

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] XML RPC : Authentication and Session

2007-08-27 Thread J. Shirley
On 8/27/07, Nicolas Raspail <[EMAIL PROTECTED]> wrote:
>
> Nicolas Raspail a écrit :
>
> Hi,
>
> I'm struggling with Session URI and XML RPC with no sucess. I can't
> figure out how this works. I'm using Data::Dumper to dump the value of
> some catalyst and it seems that the session is not valid anymore in the
> second RPC call.
>
> Can anyone that is using XML RPC and session can explain me how to do
> that please ?
>
> Thanks
>
> Nicolas
>
> PS: I have made a mistake and send this email only to J. Shirley two
> time... Sorry


Have you made sure to load a session store?  If you capture the session with
the client and send it out, and then call again with the session ID still in
the URL it should be working.

Can you paste in your plugin loading and other session config?

-J

(PS., no prob on the private dupes :))
___
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] Best way to validate Chained actions?

2007-09-12 Thread J. Shirley
On 9/12/07, Micah Jaffe <[EMAIL PROTECTED]> wrote:
>
> I'm trying to figure out the best[*] way to validate Chained actions
> at various points along the action chain.  By validate, I mean "check
> if the action should proceed or bomb out."  Validation is not the
> same as authentication; I may be logged in but I may not have
> permissions to do certain things.  It may also mean proceeding is not
> possible because there is some bad data introduced in one of the
> links.  Let's take a simple chain where I want to check whether or
> not a user can perform basic CRUD type things on our data.
> Given two paths:
>
> /bigthing/
> /bigthing//edit
>
> I was building this chain as:
>
> load-bigthing-data -> check_read -> view
>   -> check_update -> edit
>
> Now this gets convoluted when I want to act on sub part of bigthing.
> Say we have action paths that resemble something like:
>
> /bigthing//smallthing/
> /bigthing//smallthing//edit
>
> So presumably, I'd try to chain like:
>
> load-bigthing-data -> check_read -> load-smallthing-data -> view
> (that's ok)
>   ->
> check_update -> edit (bad)
>
> check_update is chained between check_read and edit, so I either need
> to create a new (duplicated) check_update for smallthing edit or
> preferably come up with something better.
>
> I wasn't very happy with the permissions validation being wedged in
> as a link in this action chain.  I think a better solution might be
> to use attributes and custom Actions, but I'm still trying to wrap my
> head around that possibility.  The best solution would bomb out
> before doing any more processing in further actions (i.e. doing it as
> part of an 'end' action is not preferable).
>
> Thoughts?
>
> thanks,
> Micah
>
> [*] Best = laziest to code + cleanest to extent + easiest to understand
>
>
> ___
> 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/
>


Sounds like you want Authorization (Catalyst::Plugin::Authorization)

http://search.cpan.org/search?query=Catalyst%3A%3APlugin%3A%3AAuthorization

Easy to extend and implement :)

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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] TT VMethods

2007-09-13 Thread J. Shirley
On 9/12/07, Mitchell Jackson <[EMAIL PROTECTED]> wrote:
>
> Today I saw how easy it is to extend Template-Toolkit within Catalyst.
> Perhaps somebody here will find this useful.
>
> I wanted to easily format dollar amounts from within the tt2 template.
> I had been doing this with [% FILTER format( "%.2f" ) %], but having
> FILTER/END everywhere seemed a bit annoying, and I wanted to add commas
> to make the data easier to read on large numbers.
>
> In Catalyst, you can add extensions to Template from your app's lib
> directory.  You can add filters ( Template::Plugin::Filter ) and
> VMethods ( Template::Plugin::VMethods ) simply by putting them into
> MyApp/lib/Template/Plugin
>
> Following is an example that adds a 'commify' method to any scalar
> template variable.  [% var.commify %] to add seperating commas, [%
> var.commify(2) %] to add commas and round to two decimal places
>
> /Mitch
> OnSite Mobile
>
>
>
> #MyApp/lib/Template/Plugin/commify.pm
> package Template::Plugin::commify;
>
> use Template::Plugin::VMethods;
> use base qw(Template::Plugin::VMethods);
> @SCALAR_OPS = qw(commify);
>
> =head1 commify
>
> VMethod extension to format a number with pretty commas each 3rd
> digit,
> and to specify decimal precision
>
> Template Syntax:
> [% USE commify %]
> [% test = '1234567890.983457' %]
> [% test.commify%] 1,234,567,890.983457
> [% test.commify(2) %] 1,234,567,890.98
>
> =cut
>
> sub commify {
> my ( $data, $precision ) = @_;
> my $decimals;
>
> # don't do anything to the data if it doesn't look like a number
> return $data
> if $data !~ /^\d+(?:\.\d+)$/;
>
> # round to the specified precision
> $data = sprintf "%.${precision}f", $data
> if defined $precision;
>
> # detach the decimals, we don't want commas there
> $decimals = $1 if $data =~ s/(\.\d+)//;
>
> # insert commas
> $data =~ s/(\d{1,3})(?=(?:\d\d\d)+(?!\d))/$1,/g;
>
> # reattach decimals
> $data .= $decimals if defined $decimals;
>
> $data;
> }
>
> 1;
>
>
>
> ___
> 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/
>

Not to rain on your parade, but miyagawa++ has a plugin on the CPAN for this
already:

http://search.cpan.org/~miyagawa/Template-Plugin-Comma-0.04/lib/Template/Plugin/Comma.pm

The more advanced Template::Plugin::Number::Format is probably more useful.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
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/