Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst
On 8/29/07, Felix Antonius Wilhelm Ostmann [EMAIL PROTECTED] wrote: after a few tests we gone use this classes under catalyst ... and ... dont work :-/ under catalyst our classes dont use Attribute::Handlers :-/ we declare UNIVERSAL::Property and then use sub nondigit : Property { defined !m{[0-9]} } (see the code) Catalyst breaks regular subroutine attributes. Apparently, it tries to parse them all so other code never gets the chance to parse them. I've seen this problem before while using a module (which used subroutine attributes) along with Catalyst and I decided to work around it instead of looking for a proper fix. Good luck. Hopefully someone else can come up with solution other than using Catalyst's own attribute handling framework. -Nilson Santos F. Jr. ___ 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: PATCH: refactor Catalyst::Engine::HTTP::Restarter to standalone module
On 7/24/07, Matt S Trout [EMAIL PROTECTED] wrote: Any chance you could comment on the bit of the thread where signal-like solutions for win32 were discussed instead of repeating the bit of the conversation we already went past a day ago? Of course (I assume you're talking about Ash Berlin's reply). Using Windows messages from Perl is clunky and would involve using XS code. And, even then, I'm not sure if it's possible at all without hacking perl itself. The message processing queue is probably either handled by perl itself or not handled at all. In both cases, I have no idea how it would be possible to interrupt the currently executing code when a message arrives without special hooks on the perl interpreter itself. If perl is ever going to fully emulate signals under Win32, using messages is probably the way to do it. But I'm not sure if it's possible to do that without modifying the interpreter. Note that, even then, it wouldn't be simple because Windows messages don't invoke a callback on arrival. They just sit on a queue waiting for the application to dequeue them and act accordingly. I think they're more like X Window Events than signals. They're used for all sorts of things such as requesting a window to be repainted, sending a key stroke or mouse event, for IPC (and for communication between threads) and probably for a lot more. -Nilson Santos F. Jr. ___ 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: PATCH: refactor Catalyst::Engine::HTTP::Restarter to standalone module
On 7/22/07, Matt S Trout [EMAIL PROTECTED] wrote: I suspect SIGUSR1 would work just fine; the 'authors' (mostly Sebastian) don't actually understand signal handling, I had to do quite a lot of cleanup work to make the child-related stuff sane. Please, keep in mind that the current code, as it is, is portable. There's no SIGUSR1 (or SIGHUP, or any sort of native signal handling since that's a Unix thing) under Win32, so making it depend on these features would break Win32 support. -Nilson Santos F. Jr. ___ 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] template toolkit caching
On 5/31/07, Perrin Harkins [EMAIL PROTECTED] wrote: The second step is loading that perl code and compiling it to a sub in memory. That happens once per process and no external cache can help with it, since it's compiled perl code in memory. Well, if you're feeling risky and think that it might be worth it, you could try using something like B::Bytecode to precompile the code. I have no idea how well would that play with Catalyst, but the last time I checked (precompiling svk to make it load faster) it was quite usable. -Nilson Santos F. Jr. ___ 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] JavaScript::Minifier new version
On 5/26/07, Peter Michaux [EMAIL PROTECTED] wrote: Thanks for the suggestions. I just want to keep a little utility module like this plain Perl without any dependencies. Just because I think Perl if funny looking doesn't affect whether or not I'll be using it. With my first Perl adventure I did notice that it is very slow to type $s-{a} instead of s.a like in JavaScript. I don't really think using Moose would fit this specific example, but since you seem to be developing using Perl, it might be a nice addition to your projects. If you're using objects instead of hashes it's pretty common to use accessor methods (generated using Class::Accessor or some other module). So, instead of $obj-{property}, you can use $obj-property, which is a bit cleaner. Perl 6 will take care of making that: obj.property I also just remembered that there's actually a module called Acme::Dot for Perl5 which provides dotted syntax for Perl5 but, as the Acme namespace indicates, it's not really meant to be used in any serious way. But it's nevertheless interesting to see how the language can be flexible, though. -Nilson Santos F. Jr. ___ 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] JavaScript::Minifier new version
On 5/26/07, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: Perl 6 will take care of making that: obj.property Oops, missed the dollar sign, it's: $obj.property -Nilson Santos F. Jr. ___ 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] DBIC/RDBO comparison (excuse new thread)
On 5/22/07, Matt S Trout [EMAIL PROTECTED] wrote: * Queries accept rich values as arguments (e.g., DateTime and Bit::Vector objects) -- expected in 09 This works (at least for DateTime objects). For instance: $rs-search( { my_date_field = { -between = [$dt1, $dt2] } } ); works as expected (of course, InflateColumn::DateTime is in place). Am I missing something? -Nilson Santos F. Jr. ___ 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: forwarding to chained actions
On 4/24/07, Bernhard Graf [EMAIL PROTECTED] wrote: I don't want to be rude, but could you guys open your own thread when you want to discuss pros and cons of forwards and redirects? This is the classic XY problem[1]. They're trying to show you that Y is bad for solving X. No one wants to discuss the pros or cons of forwards vs redirects (since it's an already settled debate). They're trying to show you the proper way of solving X. Usually, people which post to Perl mailing lists don't like to help other people which insist on doing things in a suboptimal way without at least trying to justify their points of view on the matter at hand. [1] http://www.perlmonks.org/index.pl?node_id=542341 -Nilson Santos F. Jr. ___ 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] Internet Explorer.... not doing the log-in redirect thing?
On 4/2/07, Michael Higgins [EMAIL PROTECTED] wrote: Using IE7, log-in with redirect (just like the tutorial) doesn't work. Are you running the builtin server with -k? e.g: perl myapp_server.pl -k -Nilson Santos F. Jr. ___ 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] Componentised actions.
On 3/29/07, Oleg Pronin [EMAIL PROTECTED] wrote: I cannot forward to the list actions because they are not private actions (they have its own URLs). In docs 'forward' is for private actions. If the docs state that, they're wrong. It's perfectly possible to forward to public actions. For example you can create url-action which edits some objects and include it in many templates. This is not like ordinary template toolkit's include - this component can show itself, modify data, receive request params etc, like any web page. And this doesnt depend on whether this action is directly called from browser or included in some template. You could have some thing like this: sub nice_page : Local { my ($self, $c) = @_; $c-forward('object1'); $c-forward('object2'); } Then, inside nice_page.tt: [% INCLUDE object1.tt %] [% INCLUDE object2.tt %] Should do exactly what you want. And, well, if it doesn't you can always use Catalyst::Plugin::SubRequest. -Nilson Santos F. Jr. ___ 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] Performance
On 3/8/07, Jim Spath [EMAIL PROTECTED] wrote: URI is next up at around 14% of time. Is there anything that can be done about this one? Wherever is reasonably possible, instead of actually using calls to $c-uri_for() for every item, call it only once and then build the rest of the URI manually. This is specially useful on those tables where each line links to a different item. Then, instead of something like: [% FOREACH item IN items %] [% c.uri_for('/item', item.id) %] [% END %] Use something like: [% base_uri = c.uri_for('/item') %] [% FOREACH item IN items %] [% base_uri %]/[% item.id %] [% END %] By making this kind of changes throughout an entire Catalyst application I've been able to get 15-20% better performance. -Nilson Santos F. Jr. ___ 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.
On 2/21/07, Jonathan Rockway [EMAIL PROTECTED] wrote: 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. I've been a victim of web applications designed like this for several times. It all seems like a good idea until you spend a long time filling a form or writing a piece of text only to find out that you've been logged out and your last 10 minutes were suddenly trashed. If you're *only* using server-side checks be sure to never drop user submitted data when their session has timed out otherwise it might become a major PITA for your users. Of course you shouldn't rely on JavaScript for actually timing out the sessions, but your users will surely appreciate it if they get a warning when their sessions time out. This could be implemented using a JavaScript time out. When it expires, there's a good chance that the user's session has expired. If you want to be sure, make an asynchronous call back to the server. Users without JavaScript will just get the default behaviour (i.e. no warnings). -Nilson Santos F. Jr. ___ 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] CGI::State style Plugin?
On 2/9/07, Jim Spath [EMAIL PROTECTED] wrote: Looks interesting, but it doesn't provide for arrays? It should - at least that's what CGI::Expand's documentation claims (CGI::Expand is the underlying module which actually converts params to data structures). Unfortunately, it seems to be broken. It has never been a major nuisance for me though. Maybe the author would be glad to receive a patch fixing this issue. I don't really know if it's C::P::Params::Nested or CGI::Expand's fault. -Nilson Santos F. Jr. ___ 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] Pagenav?
On 2/9/07, Jonathan Rockway [EMAIL PROTECTED] wrote: $rs = $c-model('DBIC')-search-whatever; I'd advise you against calling whatever() and limiting yourself to the first search() call if you're planning on using DBIC's built-in pager for this resultset. As of 0.07005, multiple search()es over the same resultset can break paging in weird ways (usually, it ends up generating wrong LIMIT offsets). -Nilson Santos F. Jr. ___ 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] memory usage of mod_perl process
On 2/8/07, Fayland Lam [EMAIL PROTECTED] wrote: but the memory usage of each process seems to be 95 m. it's pretty high! we have more 60+ pms. We've got around 100+ pms and myapp_server.pl uses around 87mb of RAM. Don't really know about usage under mod_perl, I'd need to check it out. -Nilson Santos F. Jr. ___ 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::Engine::HTTP::Restarter issue
On 2/2/07, Jim Spath [EMAIL PROTECTED] wrote: Another way I can get around the issue is to kill the server, and restart it by hand. This problem also happens with me. It's even reproducible: every time I edit MyApp.pm, restarter can't do its thing so I end up killing it and running it again. -Nilson Santos F. Jr. ___ 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] uri_for() and Chained endpoints: a proposed convenience method
On 1/26/07, Jason Gottshall [EMAIL PROTECTED] wrote: 1) Is my convenience method a sensible approach, or is there a better way to do this? I usually stuff this inside MyApp.pm: sub uri_for_action { my ($c, $controller, $action, @params) = @_; $c-uri_for( $c-controller($controller)-action_for($action), @params ); } It works pretty nicely for me. Its only drawback is that if you're doing some refactoring and decide to move some methods to a new controller, you'd probably need to change whenever it was called. But it's grepable and pretty reasonable IMO. -Nilson Santos F. Jr. ___ 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] CALLING FOR VCS AND EDITOR REGEXES
On 1/26/07, Matt S Trout [EMAIL PROTECTED] wrote: So, everybody with dumbass editors and version control systems that like polluting lib, get chore patterns for these files in this thread. If nobody else collects 'em up and sends 'em to muttley, I will, because I'm sick of hearing about this :) I use EditPlus under Win32. It likes copying files with a .bak appended to their filenames. But I've never really had any problems with this while using Catalyst before (will this change?). -Nilson Santos F. Jr. ___ 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] Recommend methods for form handling
On 1/19/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: These types of application decisions always make me ponder about javascript going back into lockdown mode in large corporations. You seem to be boxing yourself into a corner if js filtering ever becomes back in trend. Also how are you handling accessibility -- or are users with special needs considered expendable in your sector? Most of (what I consider) to be sane web2.0/ajax/js applications I see tend to build apps that are fully usable without js, and then layer on js/ajax to make pieces of them more dynamic or polish the UI. I am not ripping on this decision, just asking if you can go into your rational for this a little bit. Nowadays, when conservative stats are showing that at at least 95% of the users have Javascript enabled (and some other stats showing numbers like 99.3% of the user have it enabled) it's hard to sustain a case against Javascript. Sure, if you're designing a government agency site or a bank site it might be needed to support all kinds of users. But even Google has decided against supporting non-Javascript enabled browsers in some application (e.g. JS disabled = no Google ads) I'm sure there are good reasons backing up this decision since losing 0.7% to 5% of the advertising revenue means losing approx. 70 to 500 million dollars. From a developer POV I think that the major benefit of designing things with those graceful degradation statements in mind is that you end up writing things in a cleaner and much more modularized fashion yet you need to make sure that all the bits fit together very well. But it sure means a lot of extra work. -Nilson Santos F. Jr. ___ 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 vs Rails vs Django Cook off
On 1/15/07, Octavian Rasnita [EMAIL PROTECTED] wrote: That's why I was curious and I have sent to the list that blog with the comparison between RoR and Catalyst. You need to keep in mind that sometimes it's easier to optimize things for benchmarks than for real world applications. That happens in almost every field of computer technology: from video cards to web development frameworks. The only real way of comparing frameworks is to build a small (but complex) application using each one of them. I honestly don't know if Catalyst would perform better than the others but I think that if it performs worse, it won't be by a large margin under these conditions. Of course, no one wants to do that. People want to do quick and dirty benchmarks (and, thus, get quick and dirty results). I wish I had enough knowledge regarding RoR and Ruby so that I could perform a proper benchmark but I don't even know if it supports things such as chained actions which we take for granted when using Catalyst. Leaving performance aside, I think Catalyst is probably the best web framework out there feature-wise. And, for most people who have a clue, that's usually what really matters. -Nilson Santos F. Jr. ___ 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] RFC for Catalyst enabled GWT clone
On 12/29/06, John Napiorkowski [EMAIL PROTECTED] wrote: So I guess my question is would people like a GWT like system for Catalyst and if so what would you like to see in it? I've been thinking a lot about these sort of things lately but I couldn't come up with a clean way to do it the way I envisioned it. I think one of the most relevant concepts of these toolkits such as GWT is the ability to have everything represented as widgets. I don't know if it's just me but I've always failed when trying to to cleanly code real widgets using the Catalyst + TT + DBIC combo. I always ended up with something that violated MVC (or was just plain ugly). Either I had lots of TT code that talked directly to the model or I had view logic leaked into my controllers. But then, maybe I'm just too picky or simply unable to think of an obvious good way to do it. Then on particular pages you can use the GWT concept of widges to create models to represent bundles of functional and have a TT template to convert that into something meaningful. I'd like to see this renderer bundled with a good Javascript library like Jquery to make it more easy to create dynamic controls. Hmmm... I've never thought of it from this angle (i.e. having the widgets as models which would then be rendered by TT). Maybe that's the obvious way of doing it I would've never thought of because I primarily associate models with data. Anyway I have a whole pile of fake-code around playing with the idea but nothing firmed up yet. Anything publishable? Maybe looking at some (pseudo) code that demonstrates how you envision it working could make your ideas clearer to everyone. But either way it is, I think it might be great addition to Catalyst. Even if Reaction is around and there is some functionality overlap, having alternatives can be a good thing. -Nilson Santos F. Jr. ___ 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/
[Catalyst] Performance Tip (regarding URI handling)
I've previously posted about my performance issues regarding TT. At the time, one of Matt's suggestions for improving performance was to reduce the usage of uri_for() whenever possible. I had some list pages where I'd need to display dozens of items and link to each one of them and all my links were built using uri_for(), e.g. [% c.uri_for(/item/view/$item.id) %]. I decided to give Matt's advice a try and changed that to something along these lines: [% base_item_uri = c.uri_for('/item/view/') %] [% FOREACH item IN items %] [% base_item_uri _ item.id %] [% END %] This resulted in a ~20% speedup on these pages - which is a quite good speedup for such a small change. So, if there's anyone else suffering from some performance issues like myself, this might help out a little bit. I don't really know if the Catalyst devs can make uri_for() work faster in a sane way (maybe some sort of caching of URI objects?) but until then, I think I'll stick to this slightly less readable approach. I hope this tip can help others as it did help me. -Nilson Santos F. Jr. ___ 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 on Windows
On 12/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: A recent version of ActiveState Perl, the mingw package/environment, a well configured CPAN and CPANPLUS and finally PPM (with such extra repositories such as the one provided by Randy Kobes) makes installing modules (and Catalyst) an almost painless effort. I'm not saying *everything* works but until now I did not encounter a real show-stopper. I share this feeling. I usually surprised about the amount of trouble people seem to be getting into while trying to install / use Catalyst under Windows. Of course, some things just can't be done (e.g. Cache::FastMmap didn't support Windows until recently) and there's nothing you can do about it. But these are exceptions. I successfully develop Catalyst applications under Windows and deploy them on Linux and I actually face far *less* problems than other developers which prefer Linux (we can use our OS of choice here, as long as we're productive). Of course there is some ocasional breakage when updating some previously working module due to the authors not being Windows users (mainly on modules which are wrapper around C libraries). But these are rare and the authors are usually more than glad to fix them when they get to know about the issue. -Nilson Santos F. Jr. ___ 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 on Windows
On 12/27/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Does Cache::FastMmap support Windows now? I have tried installing it with ppm, but I couldn't find it, and using cpan, but it gave errors. I've tested a preliminary version and (incorrectly) assumed it was already available at the CPAN. If you read through this discussion thread: http://lists.rawmode.org/pipermail/catalyst/2006-October/010168.html you'll find a link to an unreleased version which supports Win32. Beware, if you're compiling using MSVC, you'll need to read the full thread, since some fixes were necessary. -Nilson Santos F. Jr. ___ 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] SchemaLoader?
On 12/25/06, Octavian Rasnita [EMAIL PROTECTED] wrote: After forcing a new DBI install, the Catalyst helper works well, without any error and it creates all the files that it should create. That's probably because you've previously updated DBI using PPM instead of the CPAN shell. PPM can be a real life saver when you need to install something on a Windows box without a C compiler environment. But whenever you can avoid it, it's best if you do avoid it. Last time I checked PPM didn't even have the latest DBI version, that's why I assumed you wouldn't have it either. -Nilson Santos F. Jr. ___ 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] SchemaLoader?
On 12/25/06, Emanuele Zeppieri [EMAIL PROTECTED] wrote: Nilson, there are several PPM repositories, and the availability of the various CPAN packages depends on the repositories you are querying, of course. Yes, I'm aware of that and usually I've got every repository under the sun configured on my PPM shell. Last time I checked means a long long time ago. If I remember correctly, it was when DBI 1.50 had been released but only 1.49 was available on PPM. -Nilson Santos F. Jr. ___ 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] SchemaLoader?
On 12/24/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Attempt to free unreferenced scalar: SV 0x237e190, Perl interpreter: 0x274324 at D:/usr/site/lib/DBIx/Class/Schema/Loader/Base.pm line 501. These errors are not usually errors per se - just warnings. And everything ends up working correctly. Either way, reinstalling a newer DBI version should do away with some of those. I have tried to reinstall DBIx::Class::Schema::Loader because it might be wrong installed, but I couldn't do it because it uses the module IO::Tty and I couldn't install that module under Windows. This is pretty weird because I've the latest DBIx::Class::Schema::Loader version (0.03009) installed here on my Windows machine and I don't have IO::Tty installed (since that's not even possible under Win32). And it's working like charm. Are you sure you're correctly installing it (perl -MCPAN -e install DBIx::Class::Schema::Loader) and using a good CPAN mirror? So unfortunately I cannot use the Catalyst helper module for creating the Scheme under Windows. Well, I use it almost on a daily basis and it works pretty well. You're probably doing something wrong along the way. Maybe if you send us a complete install log as output by CPAN install we could help you a bit more. -Nilson Santos F. Jr. ___ 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] SchemaLoader?
On 12/25/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Can you tell me what version of perl do you have? I use ActivePerl 5.8.8 build 819. Same here. Have you tried updating DBI itself (not DBIx::Class), using the CPAN shell, as I've said before? That usually does away with those unreferenced scalars warnings. Note that, in order to properly install DBI you'll need to have a properly configured C compiling environment. Under Win32 using AS Perl you can achieve that by either having Microsoft Visual C++ installed or by having a working gcc (mingw) environment. Since MSVC licenses are expensive, I'll assume you don't have one and you'll follow the gcc path. The easiest way to get everything working using gcc is to install Bloodshed Dev-Cpp with is an open source IDE-wannabe. After that you'll just need to set up some environment vars and your CPAN shell will automatically recognize what it calls a gcc environment. There's also something called Strawberry Perl, which supposedly makes things easier. When I've tried it, I couldn't get things to work at all, so I prefer the AS Perl + Dev-Cpp combo. It's a tried and tested setup, which I've replicated to many boxes already. If you've already got all of this set up, you can ignore it and just try updating DBI and, hopefully, your problems will be gone. -Nilson Santos F. Jr. ___ 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 from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?
On 12/6/06, Matt S Trout [EMAIL PROTECTED] wrote: Reaction calls these ViewPort objects :) Sweet. Any docs yet? -Nilson Santos F. Jr. ___ 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 from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?
On 12/6/06, Eden Cardim [EMAIL PROTECTED] wrote: Why not override MyApp::View::MyView-process() and put your Perl code layer in there? What I do is have -process() build up pieces of HTML, like tables, forms, etc, with whatever external module I see fit, based on the stash data. Then I stuff them back into the stash and use the template only for layouting those pre-built pieces. I don't want some generic code that'd be used by all actions (well, actually, I might want that *too*), I want to have Perl code specific to each action. Using you approach I'd need to redirect to the specific view in every request which is clumsy. Others have suggested Mason, but I don't want Perl code *inside* my templates. I want Perl code in my views, but I also want to have separate templates. -Nilson Santos F. Jr. ___ 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 from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?
On 12/6/06, Jonathan Rockway [EMAIL PROTECTED] wrote: The code example that comes with the reaction source is pretty understandable. If that's not enough, questions are welcome on the #reaction channel on irc.perl.org :) Hmm... I will take a look at it again. I don't remember seeing any code examples when I've first checked Reaction... -Nilson Santos F. Jr. ___ 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
On 12/5/06, Jonathan Rockway [EMAIL PROTECTED] wrote: Nilson Santos Figueiredo Junior wrote: This way, everything will probably just work, even when the user has a on their names or any other weird characters. No, you can inject plenty of bad code without . You need to escape , , , , and '. Quoting myself: ...everything will probably just work, even when the user has a on their names *or any other weird characters*. Specifically you could use TT's already existing html filter. Or even write your own. -Nilson Santos F. Jr. ___ 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 from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?
On 12/5/06, Perrin Harkins [EMAIL PROTECTED] wrote: It can be really easy to add custom view code to TT templates. You can immediately load any class and just call it: [% USE MyView %] [% MyView.method(arg) %] Yes, but you'd need to manually use the correct class in every template and then call the appropriate method. This can be automated for the general case. Or you can pass a sub ref to the stash with your data and just call it: [% sub_ref(arg) %] Yes, but this sub ref would need to be created somewhere else, which would probably end up being at the controller, which is wrong. There's no need to do anything special for TT or make a plugin unless you want to do something that requires access to the TT internals. By plugin, I meant anything that is called Template::Plugin::* and can be USEd inside a template (since [% USE Module %] will map to Template::Plugin::Module). -Nilson Santos F. Jr. ___ 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: Last Chance / LastDay:Webdevelopmentplatformcontestand Perl / Catalyst
On 12/4/06, Octavian Rasnita [EMAIL PROTECTED] wrote: And I said that there is no de facto standard, because there isn't one generally accepted. There's a defacto standard for writing Catalyst applications. The Catalyst users have an opinion, the CGI::App might have another one, the Mason users who knows... maybe another one, and so on. So the newbie might finally start learning Python or Ruby. And those other languages probably also have choices between templating systems or ORMs. The thing that actually makes Rails so successful is the fact that it has everything already sorted out. You can't really learn Rails without using ActiveRecord for instance. If the newbie gives up on Catalyst and ends up learning another language it won't be because of having to learn TT and DBIx::Class along with Catalyst. It would probably because he's a Windows user and things don't work as smoothly as the alternatives. Most people don't really want nor need the flexibility provided by Catalyst, they'd rather have a pre-packaged framework that just works. This whole conversation boils down to what are the aims of Catalyst as an open source project. In order to gain popularity there should be less focus on flexibility and more focus on achievability. However, in most serious developments this won't help much, it'd just be a lot of work and the only benefits might be a dozen new users - there would be no real benefits for the existing users and, most importantly, for the core devs. -Nilson Santos F. Jr. ___ 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: old versions of Catalyst on CPAN
On 12/3/06, Jonathan Rockway [EMAIL PROTECTED] wrote: Sorry, I don't. This is a common complaint on IRC and PM, so I'd like to resolve it. I know search.cpan isn't the ideal source of current documentation, but lots of people use it for that, and I'd like to help them if possible. If that's not possible, I'd like to be able to explain why not. IMO, the real issue is that the CPAN indexer and search are crap. Really, it can't be *that* difficult to display the most recent Catalyst version instead of some terribly old one. However, I do think that sri could be more helpful on this matter, since CPAN works in the bugged way it does. But as I remember from the short time on IRC and mailing lists discussions where he was involved, this will probably never happen (instead, we'll get a PATCHES WELCOME for the CPAN search or something like that ;-) ). And, of course, this is something he has the right to do. Anyway, I don't think this discussion thread will ever end up generating productive results. -Nilson Santos F. Jr. ___ 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: Last Chance / LastDay:Webdevelopmentplatformcontestand Perl / Catalyst
On 12/2/06, Octavian Rasnita [EMAIL PROTECTED] wrote: I have seen that your example modifies the root controller, so this convince me that this is not a tutorial for beginners. The beginners should start learning to use Catalyst, without SVN, with its default ways of doing things, without other external modules that can be avoided. The SVN and mkdir crud could really have been left out, IMO. However, modifying your root controller is something pretty basic, your conclusion is completely wrong. Your root controller is the default responsible for the / namespace and that's usually where you'll put your login stuff and the like. Honestly, your tackling this problem from a very ackward POV. When I had no clue about Catalyst I sure had difficulties and so on but they were primarily TT and DBIC issues. Catalyst itself always seemed pretty intuitive to me. There's something in your questioning that sets you appart from the regular Catalyst newbie group. I, for one, really like the Catalyst tutorial where it taught me Catalyst, some basic DBIC and TT in one go. If it wasn't laid out that way at the time I'd probably have thought that Catalyst wasn't consolidated enough or something to that effect. -Nilson Santos F. Jr. ___ 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: Last Chance / Last Day: Webdevelopmentplatformcontestand Perl / Catalyst
On 12/2/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Of course, there are more ways to do it in every language, but for perl, the correct expression should be: There are too many ways to do it. :-) There is no the most important templating system in perl, or the best module for creating configuration files, or other bests, so Catalyst should try beeing compatible with all of them, because otherwise it would lose the interest of some programmers. Just because you can use all of them it doesn't mean there isn't a defacto standard. TT is pretty much the default templating system for Catalyst, DBIx::Class the default ORM and well, for configuration files, I suppose it'd be YAML. At least those are the better supported choices and that's why you can't properly learn Catalyst without tackling DBIC or even TT, to a lesser degree. -Nilson Santos F. Jr. ___ 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
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. Perl's liveliness needs exposure besides what has already been done - that's what everyone is arguing for IMO. And, of course, it's much easier said than done. -Nilson Santos F. Jr. ___ 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: using Plugin::Singleton and testing
On 11/17/06, Daniel McBrearty [EMAIL PROTECTED] wrote: So my original example : say we have an application that streams audio, and only one source may be streamed at a time. Having more than one player instance in existence could violate this on many OS's. Even if the OS would cause an error (due to more the resource being busy when it starts up), you just don't want it to happen. How would you design this? Right. But then you are on system with two sound cards and suddenly you're able to stream two sources at the same time. Suddenly, you'll find the need for proper objects, since now you'd need one instance per sound card. I think this is the point the guy who wrote the linked rant was trying to get at. People use Singletons due to lack of foresight since, eventually, they will need to have more than one instance. Of course this is not always true and you might really only need one instance ever, but since using Singletons inherently breaks some cases of reusability and is against fundamental OO theory, it's a practice that should be avoided. -Nilson Santos F. Jr. ___ 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] Non-real world irrelevant benchmarks
On 11/16/06, Matt S Trout [EMAIL PROTECTED] wrote: Besides which, I've never yet seen a production application (and between Shadowcat's client portfolio I've seen not a small number thereof) where the dispatch overhead was even statistically significant to the overall performance - the bottleneck has always been either data retrieval or template rendering. This makes me wonder if these high traffic Catalyst sites are using TT or another templating solution. If they are using TT, it should be very helpful if someone published a sort of TT performance guide. Or at least a bulleted list with things not to do because I'm probably doing them all, given the current (lack of) speed from my applications without that much traffic. Any complex (or just plain big) page will take around 3-4 seconds to render with 90% of that time being spent with TT. The best work around was to use one of the caching plugins where I could, but users still have to experience crappy load times whenever something is updated on the database. Thankfully, it's an internal system - so it's not *that* critical. -Nilson Santos F. Jr. ___ 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] Non-real world irrelevant benchmarks
On 11/16/06, Brandon Black [EMAIL PROTECTED] wrote: If template rendering speed might be a bottleneck for you, you may want to investigate ClearSilver. I haven't tried it yet myself, but I've heard good things about its performance, and there's already a Cat View for it. Its a bit different than other systems though, in that you explicitly define the structure of all of the data going to your template in an external file. I've already looked at ClearSilver but it's probably too inflexible for me. Also, the way it handles data just seems really ackward. Anyone knows how Mason compares to TT, performance-wise? -Nilson Santos F. Jt. ___ 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] Chained('.') counter-intuitive?
On 11/10/06, Josef Karthauser [EMAIL PROTECTED] wrote: Ooh, am I missing a trick here? What are chained action? I've been chaining actions together using $c-forward(). Is this the same kind of thing, or something altogether different? Chained actions is a feature that has already been around for while you can read about it on Catalyst::DispatchType::Chained manpage (or, a direct link to the CPAN page: http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7005/lib/Catalyst/DispatchType/Chained.pm). It explains the concept and how to use it fairly well. -Nilson Santos F. Jr. ___ 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] Chained actions usage and DBIC performance
On 11/1/06, David Jack Olrik [EMAIL PROTECTED] wrote: http://www.onemogin.com/blog/528-chained-searches-the-beauty-of- dbixclass-and-catalyst.html Nice article. However, by chained actions I meant Catalyst's builtin Chained actions. But I guess it still added some weight to the previous suggestion of using search for everything. By the way... in your search_date() method. Are you aware that DBIx::Class understands DateTime objects directly when using InflateColumn::DateTime? Or is it that you really prefer to manually build the string instead of using the date manipulating routines in DateTime? -Nilson Santos F. Jr. ___ 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/
[Catalyst] Chained actions usage and DBIC performance
Lately I've been using chained actions a lot, since it ends up making everything look cleaner and more organized. I tend to structure things in a way that I've got some Catalyst actions that load some items from the database which are the root of the chain and then I've got another set of Catalyst actions that actually do things with those loaded items (e.g. /item/12/view, /item/12/edit, and so on). Sometimes, those items also have subitems and those might even have another set of subitems. In these cases, when using Catalyst and DBIx::Class it can be useful to prefetch stuff for performance reasons. But, using my setup it's not currently possible to do that, so I end up issuing lots of queries to the database since the initial root item didn't prefetch anything, because it couldn't know in advance what would be needed by the chained actions. Most of the item loading code I've previously mentioned looks like this (simplified): sub load : Chained('/item') PathPart('') CaptureArgs(1) { my ($self, $c, $id) = @_; $c-stash-{item} = $c-model('DB')-find($id); } The only work around I could think of is to prefetch everything and hope that it would result in a performance gain, at least on average. But, honestly, I find it a kind of crappy solution so I didn't even implement it. I'd like to know how people usually handle this because there must a better way than ignoring performance concerns at all. The only better way I could think of would be if DBIC's -find() worked in a similar way to -search() and only actually fetched the values when they were needed. So I could add prefetch conditions arbitrarily using stacked find() calls. Maybe this should be suggested on DBIC mailing list? Or am I just complicating a trivial situation and there's a simple way around this problem? -Nilson Santos F. Jr. ___ 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] Testers Wanted: Cache::FastMmap 1.15 (w/Win32 Support)
On 10/29/06, Ash Berlin [EMAIL PROTECTED] wrote: If you could all run it through its paces on both Win and *nix and let me know if there are any problems that would be great. Unfortunately, it doesn't compile under Win32 with AS Perl 5.8.8 (build 817) using MSVC. Compile log follows: Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. cp FastMmap.pm blib\lib\Cache\FastMmap.pm nmake -f Makefile all -nologo cp CImpl.pm ..\blib\lib\Cache\FastMmap\CImpl.pm C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\Perl\lib\E xtUtils\typemap CImpl.xs CImpl.xsc C:\Perl\bin\perl.exe -MExtUtils::Comman d -e mv CImpl.xsc CImpl.c Please specify prototyping behavior for CImpl.xs (see perlxs manual) cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO _STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CON TEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\1.15\ -DXS_VERSION=\1.15\ -IC:\Perl\lib\CORE CImpl.c CImpl.c CImpl.c(466) : warning C4101: 'RETVAL' : unreferenced local variable CImpl.xs(606) : warning C4101: 'found' : unreferenced local variable cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO _STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CON TEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\1.15\ -DXS_VERSION=\1.15\ -IC:\Perl\lib\CORE mmap_cache .c mmap_cache.c mmap_cache.c(26) : fatal error C1083: Cannot open include file: 'win32.c': No such file or directory NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop. NMAKE : fatal error U1077: 'C:\Arquivos de programas\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe' : return code '0x2' Stop. -Nilson Santos F. Jr. ___ 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] Testers Wanted: Cache::FastMmap 1.15 (w/Win32 Support)
On 10/29/06, Ash Berlin [EMAIL PROTECTED] wrote: My bad - it didn't take the updated MANIFEST file (somewhere I messed up clearly) so it didn't include all the right files. Please try again, same url as before. That previous problem was fixed. Unfortunately, a linking error popped up. Here's the compile log: Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. cp FastMmap.pm blib\lib\Cache\FastMmap.pm nmake -f Makefile all -nologo cp CImpl.pm ..\blib\lib\Cache\FastMmap\CImpl.pm C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\Perl\lib\E xtUtils\typemap CImpl.xs CImpl.xsc C:\Perl\bin\perl.exe -MExtUtils::Comman d -e mv CImpl.xsc CImpl.c Please specify prototyping behavior for CImpl.xs (see perlxs manual) cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO _STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CON TEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\1.15\ -DXS_VERSION=\1.15\ -IC:\Perl\lib\CORE CImpl.c CImpl.c CImpl.c(466) : warning C4101: 'RETVAL' : unreferenced local variable CImpl.xs(606) : warning C4101: 'found' : unreferenced local variable cl -c -I. -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO _STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CON TEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\1.15\ -DXS_VERSION=\1.15\ -IC:\Perl\lib\CORE mmap_cache .c mmap_cache.c e:\cgi\Cache-FastMmap-1.15\Cache-FastMmap-CImpl\win32.c(212) : warning C4018: ' ' : signed/unsigned mismatch e:\cgi\Cache-FastMmap-1.15\Cache-FastMmap-CImpl\win32.c(165) : warning C4101: 'r es' : unreferenced local variable e:\cgi\Cache-FastMmap-1.15\Cache-FastMmap-CImpl\win32.c(467) : warning C4013: 'v snprintf' undefined; assuming extern returning int mmap_cache.c(164) : warning C4013: 'time' undefined; assuming extern returning i nt mmap_cache.c(807) : warning C4018: '' : signed/unsigned mismatch Running Mkbootstrap for Cache::FastMmap::CImpl () C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 CImpl.bs C:\Perl\bin\perl.exe -MExtUtils::Mksymlists -e Mksymlists('NAME'=\Ca che::FastMmap::CImpl\, 'DLBASE' = 'CImpl', 'DL_FUNCS' = { }, 'FUNCLIST' = [ ], 'IMPORTS' = { }, 'DL_VARS' = []); link -out:..\blib\arch\auto\Cache\FastMmap\CImpl\CImpl.dll -dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:C:\Perl\lib\CORE -machine:x86 CIm pl.obj mmap_cache.obj C:\Perl\lib\CORE\perl58.lib oldnames.lib kernel32.lib us er32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib o dbc32.lib odbccp32.lib msvcrt.lib -def:CImpl.def Creating library ..\blib\arch\auto\Cache\FastMmap\CImpl\CImpl.lib and object ..\blib\arch\auto\Cache\FastMmap\CImpl\CImpl.exp mmap_cache.obj : error LNK2019: unresolved external symbol _vsnprintf referenced in function __mmc_set_error ..\blib\arch\auto\Cache\FastMmap\CImpl\CImpl.dll : fatal error LNK1120: 1 unreso lved externals NMAKE : fatal error U1077: 'link' : return code '0x460' Stop. NMAKE : fatal error U1077: 'C:\Arquivos de programas\Microsoft Visual Studio .N ET 2003\VC7\BIN\nmake.exe' : return code '0x2' Stop. -Nilson Santos F. Jr. ___ 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] Testers Wanted: Cache::FastMmap 1.15 (w/Win32 Support)
On 10/29/06, Ash Berlin [EMAIL PROTECTED] wrote: Hmmm okay. Could you try editing Win32.c and including varargs.h and changing line 467 to one of the following: No need to include varargs.h. Chaning line 467 from: vsnprintf(errbuf, 1023, error_string, ap); to _vsnprintf(errbuf, 1023, error_string, ap); did the trick and it compiled successfully. All tests completed successfully (test 6 was skipped due the fact that I don't have GTop installed, since I'm under Win32). So I guess it was 1 character issue, fortunately. ;-) -Nilson Santos F. Jr. ___ 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] acceptable solution for running Catalyst on Windows
On 10/13/06, Cédric Bouvier [EMAIL PROTECTED] wrote: Question: what would you recommend to deploy a Catalyst app on Windows, ideally without too much headaches, and knowing that it is not meant to handle much traffic? We have tried mod_perl2, but getting it to work seems quite cumbersome... :-( Unfortunately, that's probably your best shot. The builtin server can't handle IE properly without the -k option which makes work it terribly slow (at least under Win32). However there are pre-built apache + mod_perl2 packages around the net (Apache2Triad comes to mind) which might make your job easier. -Nilson Santos F. Jr. ___ 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 Performance issues
On 10/7/06, Jonathan Rockway [EMAIL PROTECTED] wrote: Obviously you don't get all of TT's features. No EVAL, no MACRO, no BLOCK. I don't use any of that anyway. I write my code in perl, not in TT :) Unfortunately, I use MACROs and BLOCKs extensively. Anyway, if you Need Something Now, try clearsilver. The advantage is that the entire dataset is fetched before the page is loaded. This means that clearsilver never needs to call into perl, which is the slowest part of TT. However, the syntax is really ugly, and fetching 1000s of rows from the database when 90% of them are going to be discarded by a conditional in the template is pretty inefficient. Careful coding can avoid that. There's a reason Google and Yahoo use Clearsilver and not TT. I've never heard of ClearSilver before. I'll take a look at it. The thing is: I'm always suspicious of modules that aren't on the CPAN... -Nilson Santos F. Jr. ___ 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/
[Catalyst] Catalyst Performance issues
Hi everyone, Recently I've been facing some performance issues in my Catalyst application and the situation worries me a little bit. The first optimization I tried was to start prefetching everything I could and it indeed improved the performance quite a bit (by a factor of 2 or so). But it still isn't enough. I've got pages that take 3-4 seconds to render with a single user using the application while the database query takes something between 0.15-0.20s to complete. Whenever the application faces a moderate amount of usage, users start complaining. So, in my quest for optimization, I tried profiling my Catalyst application. It saddened me a little bit to find out that, apparently, at least 60% of the time (probably more) is spent inside Catalyst, TT and DBIC internal routines (a big cycle eater is Class::C3). Particularly, URI handling seems to take a lot of time (maybe this was influenced by the fact that I profiled using the builtin server). I'd like to know if there are any performance tips or really just how do you get acceptable performance from your Catalyst application in moderately complex or large pages (especially regarding pages where there might be hundreds or records fetched from the database). Thanks for any help and just in case it might be useful in order to diagnose what I could've done wrong, here's the profiling output of dprofpp -R -O 50 for my application: Total Elapsed Time = 298.9974 Seconds User+System Time = 44.42747 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 7.52 3.341 0.010 33082 0.0001 0. next::method 7.00 3.109 38.560 86056 0. 0.0004 Template::Stash::XS::get 6.32 2.809 3.041 5163 0.0005 0.0006 DBIx::Class::ResultSet::_collapse_ result 3.78 1.680 5.675 18010 0.0001 0.0003 URI::_generic::abs 3.05 1.357 1.581 63205 0. 0. URI::_generic::authority 2.98 1.325 2.958 36156 0. 0.0001 URI::new 2.69 1.194 1.296 54137 0. 0. URI::_generic::path 2.37 1.052 12.538 9005 0.0001 0.0014 Catalyst::uri_for 2.27 1.008 1.647 72169 0. 0. URI::_scheme 2.16 0.959 1.247174 0.0055 0.0072 Class::C3::_calculate_method_dispa tch_table 2.09 0.930 0.930 5128 0.0002 0.0002 Template::Stash::clone 1.87 0.833 0.939 36156 0. 0. URI::_init 1.84 0.819 0.819 115481 0. 0. DBIx::Class::AccessorGroup::get_si mple 1.77 0.785 0.908 9256 0.0001 0.0001 Params::Validate::_validate 1.69 0.751 4.116 11295 0.0001 0.0004 DBIx::Class::Row::inflate_result 1.54 0.686 2.718 2649 0.0003 0.0010 DateTime::new 1.36 0.605 0.621250 0.0024 0.0025 Algorithm::C3::merge 1.24 0.550 0.853 3748 0.0001 0.0002 DBIx::Class::ResultSet::search_rs 1.20 0.533 4.199 32805 0. 0.0001 DBIx::Class::InflateColumn::get_co lumn 1.19 0.527 0.527 1260 0.0004 0.0004 NEXT::ELSEWHERE::ancestors 1.13 0.504 18.551 3 0.1679 6.1838 Template::Document::__ANON__(9e3) 1.08 0.482 45.518 1356 0.0004 0.0336 NEXT::AUTOLOAD 1.07 0.476 0.476 16836 0. 0. Template::Stash::XS::set 1.04 0.460 1.743 9029 0.0001 0.0002 URI::_server::canonical 0.99 0.439 13.844 5 0.0878 2.7688 Template::Document::__ANON__(8d0) 0.94 0.416 0.416 27151 0. 0. URI::implementor 0.83 0.368 0.368 46161 0. 0. Scalar::Util::blessed 0.81 0.362 0.538 11724 0. 0. DBIx::Class::Schema::source 0.79 0.350 0.468 35 0.0100 0.0134 Template::Parser::_parse 0.77 0.341 4.838898 0.0004 0.0054 Template::Document::__ANON__(91f) 0.76 0.339 0.420 3645 0.0001 0.0001 DBIx::Class::ResultSet::_resolved_ attrs 0.76 0.338 1.853 63059 0. 0. URI::scheme 0.75 0.331 1.998 3532 0.0001 0.0006 DBIx::Class::Relationship::Base::r elated_resultset 0.74 0.328 2.325 9029 0. 0.0003 URI::http::canonical 0.73 0.326 0.326 27112 0. 0. URI::_generic::_check_path 0.69 0.307 8.311 3213 0.0001 0.0026 DBIx::Class::ResultSet::next 0.69 0.307 42.798 1057 0.0003 0.0405 Template::Context::process 0.64 0.286 6.734 3 0.0955 2.2447 Template::Document::__ANON__(97f) 0.62 0.277 0.363 5726 0. 0.0001 DBIx::Class::ResultSet::new 0.58 0.256 0.256 27040 0. 0. URI::clone 0.58 0.256 0.569 9054 0. 0.0001 URI::_server::host 0.54 0.241 0.433 4450 0.0001 0.0001 DateTime::_calc_utc_rd 0.52 0.233 3.289 2612 0.0001 0.0013 DateTime::Format::Builder::Parser: :generic::__ANON__(8c9) 0.52 0.233 0.854 4451 0.0001 0.0002
Re: [Catalyst] Catalyst Performance issues
On 10/7/06, Matt S Trout [EMAIL PROTECTED] wrote: The Class::C3::* methods you're seeing are startup overhead only; unless you're messing with class hierarchies at run-time that's a one-off hit. Right. But next::method calls also seem to weight in a little bit. But I really have no idea on how (and if) it could be improved. I think maybe uri_for isn't as efficient as it could be; you might find you're better off doing uri_for once to get a URI object and then just appending ids to the end. Considering that at least 23% of the time is being spent inside URI::* methods I think I'll take a look at this. URI handling being so expensive really surprised me. The killer seems to be the Template::Stash::XS::get time; assuming it's basically a table that you're generating, perhaps adding a static routine to your code that chucks out the HTML for that in an efficient perl fashion might help? I don't know if it would help that much, since it means only 7%. Its cumulative time is so high because it accounts for all the next::method lookups and DBIC methods, etc. But avoiding using the stash would only provide a maximum speedup of 7%. Oh well, maybe if I focus on improving both URI and stash usage I can make things run about 20% faster or so. Maybe it'd be nice if someone came up with a faster drop-in replacement for TT... any volunteers? ;-) -Nilson Santos F. Jr. ___ 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 Performance issues
On 10/7/06, Perrin Harkins [EMAIL PROTECTED] wrote: Maybe this will help: http://www.modperlbook.org/html/ch09_05.html Thanks, I'll try using Apache::DProf as suggested. How did you determine this? Manually running and timing the queries as output when DBIC_TRACE=1. Switching from running a $rs-next loop inside TT to loading the objects inside the controller (through $rs-all). Then I tried using $rs-all inside the template and noticed the time spent in the controller going down and the spent in the end action going up by approximately the same amount as I've timed when manually running the queries. There are some generic things you can do to speed up TT (use PROCESS instead of INCLUDE, use the support for constants if you have any, make sure you are using the template cache), but I'd do a profile sorted by real time before spending the effort on them. The template cache gives me a performance boost varying from almost 0% to 10% (average 3%). Using PROCESS instead of INCLUDE makes a tiny difference in my case. I'll take a look into using constants, I never knew TT had them. Does your template do anything that might cause DBIC to fetch more data? Some of them, yes. The ones in question, no - they prefetch everything they need (at least according to DBIC_TRACE there's nothing missing and only one query is issued). -Nilson Santos F. Jr. ___ 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/
[Catalyst] InstantCRUD and Windows
I'm currently starting a new simple Catalyst application and decided to give InstantCRUD a shot. However, it couldn't even be installed under Windows since Cache::FastMmap isn't installable under Win32. I don't really know if the authors are aware of this issue, that's why I'm posting this here. Maybe the session store could be changed to something more cross-platform friendly like Session::Store::File or even Session::Store::DBIC. -Nilson Santos F. Jr. ___ 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] Announce Catalyst::Plugin::DBIC::TemplateMaker
On 8/30/06, Kieren Diment [EMAIL PROTECTED] wrote: It does virtually nothing, apart from saving you some typing. You must resolve any related columns to a properly stringified name for example. Maybe it should've been a Catalyst::Helper ? Then it could be used through Catalyst's default code-generating interface (i.e. myapp_create.pl). -Nilson Santos F. Jr. ___ 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] Chained actions question
On 8/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: sub base :Chained('/') PathPart('') CaptureArgs(0) { sub drpt : Chained('base') PathPart('dailystatusrpt') CaptureArgs(0) { sub view_drpt :Chained('drpt') PathPart('view') Args(0) {} sub drpt_year : Chained('base') PathPart('dailystatusrpt') CaptureArgs(1) { sub year_view :Chained('drpt_year') PathPart('view') Args(0) {} sub drpt_month : Chained('base') PathPart('dailystatusrpt') CaptureArgs(2) { sub view_month :Chained('drpt_month') PathPart('view') Args(0) {} sub drpt_day : Chained('base') PathPart('dailystatusrpt') CaptureArgs(3) { sub day_view :Chained('drpt_day') PathPart('view') Args(0) { sub create_drpt :Chained('drpt_day') PathPart('create') Args(0) { sub issue : Chained('drpt_day') PathPart CaptureArgs(0) {} sub create_issue : Chained('issue') PathPart('add') Args(0) { I've never really used chained actions (except when experimenting with it) because all the code I could come up with looked like this - which are extremely confusing action definitions IMO. I think chained actions would work a lot better if there was a way to chain things in a more abstract way. So that, in this example, you could have a single 'view' action which would handle all the cases and the preceeding action would just populate the resultset accordingly or something to that effect (of course, your reports may actually be completely different, but in my own use cases it does make a lot of sense). However, the current way is also useful in some usage cases, so I think Catalyst should probably have two ways of chaining stuff. Of course, there might be better was to achieve the same functionality that I'm not aware of. For now, I need to forward things around and do it a little backwards (e.g. /dailystatusrpt/view/2005/10/08). It's kind of counter intuitive, but it works. -Nilson Santos F. Jr. ___ 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] Minor Problem With Tutorial
On 8/14/06, Kevin Monceaux [EMAIL PROTECTED] wrote: Anyway, I'm at the end of the BasicCRUD section of the tutorial where one creates the Books::Delete method. The last line in the method is: $c-forward('list'); Catalyst appears to be ignoring this statement. When I tried to delete a book I got: Coldn't render template file error - books/delete.tt2: not found So, I tried creating an empty books/delete.tt2 template to see if Catalyst just wanted to find a template file matching the method it was in before performing the redirect. It then displayed the blank page instead of redirecting to the list method. I'm sure there is something simple I overlooked. This might seem a little bit non-intuitive when you're just a beginner at Catalyst, but $c-forward('list') won't cause Catalyst to render your books/list.tt2 template. It will execute the 'list' action and return, getting back to your books/delete.tt2 template. In order to achieve the desired behaviour you could either issue a redirect response (through $c-response-redirect($uri) ) or explicitely set the desired template filename. -Nilson Santos F. Jr. ___ 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] Storing a password hash with DBIC
On 8/10/06, Jonas [EMAIL PROTECTED] wrote: I'm trying to store an hashed password in a database using DBIC. What is the best way to create the digest of the password? When checking the password (e.g. during login) Catalyst::Plugin::Authentication should handle this task for you. When storing the password, I usually just call sha1() (or md5() or whatever digest algorithm you choose) manually when creating the new user or changing the user password. -Nilson Santos F. Jr. ___ 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] quick windows catinabox question
On 8/9/06, Joe Landman [EMAIL PROTECTED] wrote: Last I tried, Cygwin had some issues (Matt had been wrestling with it). Is Catinabox working in Cygwin, or will everything just work in Cygwin? Native vs cygwin doesn't matter. I don't know about Cygwin - Catalyst runs alright natively under WinXP for me using AS Perl. You just need to have a suitable compiling environment (GCC as found on Blooshed Dev-Cpp IDE will do) in order to install everything from CPAN instead of relying on crappy PPM files and that's it. You should give it a try. Being platform independent is one of the goals of languages like Perl, after all. -Nilson Santos F. Jr. ___ 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] Sigh. How do we get on this list?
On 8/9/06, Matt S Trout [EMAIL PROTECTED] wrote: Point out that everybody on http://dev.catalyst.perl.org/wiki/LiveApplications disagrees :) I haven't stumbled upon this page before and I'm sort of amazed. I never thought there were so many public facing sites using Catalyst. I really think this page should be linked from the Catalyst front-page or something like that. From my personal experience, no one else is using it is a somewhat frequent excuse against trying modern Perl solutions. Hopefully I'll be adding a new application to that page in the upcoming months. ;-) Also, I think it might be nice to have a wiki page where users could write about their intranet use of Catalyst applications. A place where people could write things as simples as We at XYZ company use Catalyst up to full length testimonials describing their experience with Catalyst, as allowed by their companies' policies. This might be something even nicer to the eyes of the manager-types out there. -Nilson Santos F. Jr. ___ 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 storing session in win32 machine
On 8/9/06, Nagarajan M [EMAIL PROTECTED] wrote: I am using **Cache::FileCache** since **Session::Store::FastMmap** is not supported in Win32. Use C::P::Session::Store::File and your problems should be solved. -Nilson Santos F. Jr. ___ 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] c-user_exists causes runtime error.
On 8/2/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Are you running C::P::Auth v0.09? I think that error was happening to people running v0.08... Yep. Auth 0.09. Try it with 0.07. That seems to be working alright (at least for me) where 0.08 didn't. -Nilson Santos F. Jr. ___ 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/
[Catalyst] Breakage in Catalyst::Plugin::Authentication v0.08
I've seen all these numerous posts regarding problems with Catalyst::Plugin::Authentication and, naively, I thought I'd be immune to them. I updated everything yesterday on my development machine and it was working alright. But today (probably after the session expired or something like that) my application bombed while trying to login: Caught exception in MyTasks::Controller::Root-auto Can't call method from_session on an undefined value at C:/Perl/site/lib/Catalyst\Plugin\Authentication.pm line 120. I've tried downgrading C::P::Authentication to 0.07 and luckily it's now working alright. -Nilson Santos F. Jr. ___ 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::Widget styling
On 7/28/06, Bogdan Lucaciu [EMAIL PROTECTED] wrote: uhm, do attribute selectors work in IE? As of IE 6, unfortunately, not. Hopefully, IE 7 will get a little better. But don't get your hopes up. -Nilson Santos F. Jr. ___ 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] authentication plugin advice
On 7/27/06, Jonathan Rockway [EMAIL PROTECTED] wrote: I checked the manpage, and it says $c-request-user is deprecated and that $c-user should be used instead. There's no mention of $c-user existing elsewhere in the docs, though, so I'm not sure about that. I will test and get back to you (well, the list anyway). Try reading the Catalyst::Plugin::Authentication manpages. -Nilson Santos F. Jr. ___ 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] How do you structure multi-table DBIx queries?
On 7/24/06, Dennis Daupert [EMAIL PROTECTED] wrote: I have a number of tables that contain foreign keys to other tables; I need to be able to do selects on multiple tables, specifying particular columns in particular tables. If you define your relationships correctly you should be able to accomplish this using prefetch and/or join conditions. You can see usage examples in DBIx::Class::Manual::Cookbok (http://search.cpan.org/~mstrout/DBIx-Class-0.07000/lib/DBIx/Class/Manual/Cookbook.pod). If you don't know how to define your relationships, you should take a look at DBIx::Class::Manual::Intro and other related docs. -Nilson Santos F. Jr. ___ 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] Bugfree development release?
On 7/3/06, Matt S Trout [EMAIL PROTECTED] wrote: RFC a proposed API to the DBIC list if you want to see that in 0.08 - or at the very least throw together a couple of tests for the hack if you want to be able to rely on it in production :) I was thinking about that earlier today. There should be a friendlier way of doing that. It should be a very simple API though. Maybe it could even be added in 0.07001 (as it happened before to some other features in 0.06xxx I think), since it would just be adding something that didn't exist before will probably just be a method or something like that. Or maybe it should be a deeper change such as me being current resultset scoped instead of whatever it is right now. But probably this already too much off-topic for this list. I'll try to post a proper RFC later this week to the DBIC list after I figure out a good solution. Hey, not complaining - but it *was* a dev release from the -current and it won't go to trunk and thence CPAN until we've fixed it. Yes, yes. But I thought that a release was emminent and then OMG the app doesn't work panic bells started ringing all over my head. And I'm *really* glad you'll be fixing it, even though it's not a supported API (honestly, I didn't really know it was an unsupported hack when you told me to use it - I assumed I had just overlooked the docs or something like that). -Nilson Santos F. Jr. ___ 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] Restricting access to the model
On 7/3/06, Matt S Trout [EMAIL PROTECTED] wrote: I tend to just modify the relevant ACCEPT_CONTEXT to return a resultset that already has (e.g.) WHERE order.user_id = $current_uid applied to it, at which point I can just do $c-model('DBIC::Orders') in my controller code and it Does The Right Thing. But then how do you handle situations like when there are users which can see other users orders? Also, from Catalyst::Component's docs I got the impression that ACCEPT_CONTEXT is something you'd put inside your model classes, so how do you do customize its behaviour for different database tables? -Nilson Santos F. Jr. ___ 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] Restricting access to the model
On 7/3/06, Matt S Trout [EMAIL PROTECTED] wrote: and C::M::DBIC::Schema gives you a model per table. I'm not sure I see the problem here ... From Catalyst::Model::DBIC::Schema docs there's an example which reads: # For resultsets, there's an even quicker shortcut: $c-model('FilmDB::Actor') # is the same as $c-model('FilmDB')-resultset('Actor') So, from this example, I concluded that only FilmDB was a proper Catalyst model. FilmDB::Actor was only a shortcut, not a real model. But I think I was mislead by the docs, then. -Nilson Santos F. Jr. ___ 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] Bugfree development release?
On 7/1/06, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 7/1/06, Marcus Ramberg [EMAIL PROTECTED] wrote: So, we've heard nothing from you guys about the development release. I guess that means one of two things. Either we've made a bugfree catalyst version, or you guys haven't tested it out. If that's the case, this is your last chance. I'm about to leave YAPC NA, and fly back home to norway. When I get back to work on monday morning, GMT+1 , _03 will become 5.7, unless we've heard anything to the contrary. Right, I'll try to test an Catalyst application I've got and report the results. I've just tested and everything seems to be working alright. One note regarding performance is that, in my case, it seems be a little bit better. I didn't benchmark it seriously or anything like that and, usually, the rendering times between refreshes of the same can vary a lot but the average rendering time seems to have gotten a little better (i.e. faster) by about 3-5% on some pages. On other pages I didn't notice any performance differences. Anyway, I liked the new shorter debug output. ;-) -Nilson Santos F. Jr. ___ 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 in a Windows Context
On 6/30/06, Christopher H. Laco [EMAIL PROTECTED] wrote: Don't do that. Bad things will happen. Always compiled your modules with the same compiler used for the perl install itself on Windows. To that point, you could compile perl in .NET, then do the modules that way too. FUD. VS.NET 2003 compiles everything that's compilable successfully for AS Perl. That's what I've been using for at least two years without any problems. As GCC also does compile everything successfully for AS Perl. In fact, I don't even know if AS Perl is still compiled using the VC6. -Nilson Santos F. Jr. ___ 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 in a Windows Context
On 6/30/06, Matt S Trout [EMAIL PROTECTED] wrote: I think that's the point - that AS has switched to gcc and it's *generally* preferable to use the same compiler as your perl binary was built with. There's nothing in the release notes indicating that they've done this (they've recently switched to GCC on other platforms but not a single mention of Windows). What they did was to start supporting GCC under Windows. -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/29/06, John Napiorkowski [EMAIL PROTECTED] wrote: writing monolythic cgi type applications. Personally I put all the logic having to do with manipulating the database into my model class. So things like adding/removing users or very common searches I put there. Anything that more than a single controller might want I put in the Model. I think this really boils down to what you call application logic. Manipulating the database (i.e. what DBIx::Class does) isn't the kind of logic I was talking about. I meant actual business logic. This means things like validation (not that the other layers shouldn't validate data), access control, bridging your model and your view, triggering model actions, etc. IMO, the controller should be responsible for the higher level logic involved in an application while the logic contained in the model is a lower level (i.e. implementation details), usually data oriented, logic. -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: If you find yourself putting code in your View templates that isn't directly related to rendering this specific flavour of output, it probably needs to be moved to the Controller. Good code in views: iterating an arrayref to generate a ul list, walking a data structure to generate a table, or walking a data structure to generate a graph image. I've found myself building somewhat fat views lately. Mostly, I've done it when trying to build generic widget thingies that might appear in different pages. By fat I mean resultset-manipulating views, but usually the manipulations are restricted only to the view-related aspect of them, though. This means stuff like ordering the resultset by some column (using order_by). I'm usually in doubt if this is indeed a good practice or if it should be done another way, but it sure makes things easier. Overall, I find it somewhat difficult to satisfactorily come up with a nice and clean design for generic widgets. For example, if you've got a login box that displays either login fields when the user is not logged in or some user information whe the user's logged in, you'll usually need some of HTML and some of Perl code. But it's really up to the view to decide whether it wants to display that widget or not, so the general controller actions should be widget agnostic. My main dilemma is: should I have a LoginBox controller that handles it and then forward from the view back to the controller while rendering (maybe issuing a subrequest?) or is it alright to have this sort of widgets with lots of code, possibly calling the model directly themselves? Is there an estabilished best practice for doing this? This is currently my main philosophical issue while developing using Catalyst. If someone could enlighten me regarding this subject, I'd appreciate it. ;-) -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: The approach I'm attempting lately (and I haven't gotten it all working right yet...) is to make Controller base-classes that implement generic concepts for things like paging and sorting tables of data (complete with handling form args like ?page=3count=50 or ?sortby=foo:desc silently for the controller), which makes it effortless for the controller to apply those sorts of things to the resultset before its sent to the view. These bits of controller functionality are of course View-agnostic. It's View-agnostic but then the View still isn't Controller-agnostic. Actually, after some thought this might be the real question that'd solve my issues: how to properly decouple Controller from Views? I'll give you a real world example that's actually already in use in an implemented (but evolving) system. I've got a somewhat generic table widget. This table contains items that can be either active or closed. Sometimes the closed items should be displayed along the active, other times they shouldn't, but there's always a button show/hide closed items. It's currently implemented entirely in the View, since the controller IMO shouldn't really need to know if the closed items should or shouldn't be displayed. That involves doing bad things such as using c.param() from the View but it really was the only practical way (i.e. DRY) I could think of. So, any suggestions are welcome. ;-) They (the base controllers implementing these features) basically boil down to: Check for some standardized GET form parameters, provide some data to the controller in the form of a paging object or some DBIC sorting hashref stuff, and also directly set stash variables for the views to see, regarding paging and sorting. There are template includes that go along with these meta controller actions (displaying the 1 2 3 paging clickies and whatnot, based on those stash vars...). But how do you specify which actions are supposed to get the wanted behaviour? How do you handle pages with multiple resultsets being displayed? I think the convention could quickly become ugly. If you threw in some AJAX stuff in the mix it might even get uglier still. But I'd be *very, very* happy if you showed me I was wrong. ;-) -Nilson Santos F. Jr. ___ 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
On 6/29/06, Hugh Lampert [EMAIL PROTECTED] wrote: OK, don't mean to sound like a whiner here, and I haven't spent any time investigating the various GCC packages, but it's making me laugh that it's been suggested I download a C++ development package just so I can get my perl modules to install. Although I'm primarily a Windows user, I can't really deny that the only one to blame in this situation is Windows itself for not having a way to easily build stuff yourself. *Every* other OS has this sort of things. Even those Linux distros that are completely targetted at the end user (such as Ubuntu) and don't come with a bundled compiler can have it easily installed with a mere apt-get install gcc. I find it rather weird that the suggestion of downloading a C/C++ development package in order to compile C/C++ code makes you laugh. It's like saying that downloading Perl in order to run Perl application makes you laugh. Clearly you've got a wicked sense of humor. I know... I'm supposed to do that all myself, and I guess I will, but for now I just don't have time. After downloading the setup file, it takes a double-click plus three aditional clicks in order to get it installed. I really can't imagine someone *this* busy. I mean I only want to finish my small app. My boss is going to split his gut when I tell him first I need to download a C++ dev package so I can install the application framework that actually is written in perl. Catalyst's written in Perl. Most of its dependencies also are. But some of them have parts written in C/C++. How do you expect to compile C/C++ code without a C/C++ compiler? I can't really figure what's the hassle about a 8MB download, some mouse clicks and about 1 or 2 minutes of setup time. I can't really figure out why your boss should even know or care about what you're using to get your job done. Looks like I'll be sticking to whatever Catalyst modules are available in PPM form for now. Not because I'm afraid of installing GCC, but because I can't imagine altering the roll-out environment to the point of installing UNIX emulation layers or C++ development packages just to put this app into production. There's no need of installing UNIX emulation layers. If your worries are deployment related, you could easily use PAR, which would pack the already compiled DLLs in a single package. Production servers shouldn't need this installed. Also, unless it's something absolutely necessary, I'd suggest you against deploying it in a Windows server. It's somewhat of a hassle to get mod_perl or FastCGI working correctly under Windows, the best I've got so far is running Catalyst under Apache::Registry, since mod_perl crashes when using PerlModule directives and I can't manage to even compile FastCGI and it's related Perl module and the built-in server becomes really slow if you need to support IE clients directly connecting thanks to the necessary -k switch. -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/29/06, Matt S Trout [EMAIL PROTECTED] wrote: Nilson Santos Figueiredo Junior wrote: That involves doing bad things such as using c.param() from the View but it really was the only practical way (i.e. DRY) I could think of. So, any suggestions are welcome. ;-) No, it's the best separation of concerns, I think. The trick is to make the View smarter, which is a hard problem for webapps because of the degree of flexibility in styling required (ASP.Net has great shiny components, but any ASP.Net app looks like an ASP.Net app). Encapsulating the c.param bits in a TT plugin or three might be a good halfway measure. I couldn't really get the point of your ASP.Net analogy nor could I imagine how to encapsulate c.param() bits in some TT plugins (well, actually, I could think of aliasing c.param() to param() but this probably wasn't what you meant). So, could you please elaborate on this? -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/29/06, Matthieu Codron [EMAIL PROTECTED] wrote: This does not matter much in most cases except big projects where business logic elements are reused in various situations around the application. Then you put that logic in external regular Perl modules and make your controllers just use them. Pretty simple. -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just that: the model. It's usually mapped to some kind of storage engine such as a RDBMS. Many strong advocates of MVC specifically try to leave business logic out of the database. What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). You'll see that it's a little more than that (at least when you're using DBIx::Class - Class::DBI can't even be compared feature-wise nowadays). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really. It's something somewhat straight-forward when using something like Catalyst. All you've got to do is resist the temptation of polluting your controllers with things that really should be in your views. But sometimes it's even worth it. -Nilson Santos F. Jr. ___ 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] Program the logic
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: When you create a Catalyst application some tests are created also. I thought calling the Controller actions could be performed by the testing framework... (without using a browser)... I guess I was wrong :) Yes, it can be performed without using a browser. If you've at least tried running those test you'd have seen it. Also, if you were really up to it, you could write something like a Catalyst::Engine::Tk and have and have a somewhat weird URI-based Tk handling (i.e. each of your widgets actions would be described by an URI). It just doesn't make much sense since Catalyst is geared towards web development, but perfectly possible. -Nilson Santos F. Jr. ___ 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
On 6/28/06, Hugh Lampert [EMAIL PROTECTED] 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? the CPAN module was kind enough to download and install NMAKE from Microsoft itself (that was nice), when I upgraded it. Although it's somewhat like killing a mosquito using a shotgun, I usually install the Dev-Cpp open-source IDE for Windows. It already comes with everything you need to self-compile your modules (GCC/MinGW, etc) and works out-of-the-box. It's not a big download (8mb I think) so it's something pretty reasonable. The only manual configuration I remeber having to do is to add the GCC /bin dir to my system PATH variable. And then the CPAN shell from ActiveState will automatically configure itself and work using GCC. Since you've upgraded your CPAN shell using a version from the CPAN, I don't know if the magic still works and you might have to manually configure your compiler parameters (but that's a one time thing). -Nilson Santos F. Jr. ___ 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 (Was: Problem with Catalyst Authorization)
On 6/26/06, Hugh Lampert [EMAIL PROTECTED] wrote: Thanks for responding! Perhaps you can forward this to the mailing list, as I am unable to reach it from my work (the mail server will not accept my relays.) Done. I'll answer your message without removing anything you wrote. I looked at the CPAN shell and it seems to be harder to use and less flexible than the PPM shell (Couldn't find an easy way find module descriptions like the PPM describe command, for example). Also, PPM's are pretty much guaranteed by the packagers to work with ActiveState Perl - I've been hesitant to install modules from CPAN due to fear of blowing up my Perl installs. Perhaps that's a foolish fear? I mean development is time intensive enough without debugging problems introduced by incompatible modules. Your discussion of the problem with Module::Install is a good example that I'd prefer to not have to worry about if I didn't have to. I also see that the CPAN shell is soon to be deprecated in favor of CPANPLUS in Perl 5.10 - Is it worth it for me to switch from PPM to something new that won't be applicable shortly? I really can't understand what you mean by flexible, then. I agree that it's a little bit easier to use the PPM shell but it's really *a little bit* (basically, at the CPAN shell you'll have to confirm the install of dependencies [even when you set your preferences to automatically follow them] while the PPM shell will do this automatically - I could argue this is one of the lack of flexibilities of the PPM shell). It really is a foolish fear, IMO. There's no such thing as blowing up your Perl install. The same sense of safety provided by the PPM shell regarding module compatibility is also available at the CPAN shell (i.e. version checking of dependencies, because that's pretty much the compatibility that is verified). I think this subject really can be summed up like this: the things that are problematic when dealing with the CPAN shell are usually not even available when you're restricted to the PPM shell. So, when you get an error when using the CPAN shell, probably that module (or module version) isn't even available at ActiveState's repositories. At least, you'll have a chance to fix it yourself and make it work instead of not even having the choice to do it. -Nilson Santos F. Jr. ___ 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] development setup
On 6/23/06, Carl Johnstone [EMAIL PROTECTED] wrote: Do you mean that you have a shared apache installation under which every developer runs his/her own code ? Yes. I think that if you're really willing to maintain this development setup then Catalyst won't be a good choice. I find this sort of setup rather amusing. I actually work at a place where most of the developers don't even run Perl code on their own machines. Most of them don't even have Perl installed on their Windows machines. Everything is tested at the development server. Granted, none of those do anything remotely related to Catalyst development. I don't really know if your environment is as extreme as what I described (it seems to be a little better since, apparently, you've got one environment per developer which is automagically set up through network shares), but as far as I can see Catalyst is a framework geared towards a different development mindset. Developers are expected to run code on their own machines and to keep everything is sync using SVN (or whatever makes it easy to do it). The thing you mentioned about having to update 12 desktops is irrelevant when updating means each developer typing svn up, IMHO. -Nilson Santos F. Jr. ___ 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] Problem with Catalyst Authorization
On 6/23/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I understand DBIx::Class:Schema is now in vogue, but I do not have access to the schema variant of the model in a PPM. I'm thinking this might be causing my problem, but I'm hoping not. You should try installing a recent ActivePerl build and using the CPAN shell instead of PPM. In those newer versions, it already comes pre-configured, so you really won't have that much issues. Of course, you still won't be able to install modules that require compilation, such as Set::Object, but that's easily solved by installing GCC and then ActivePerl can also automatically configure itself in order to use it. The downside of using these newer and better AS Perl builds is that because of some... erm... issues in Module::Install pre-0.61 you won't be able to effortlessly install some things such as the newest (5.6902) Catalyst and any other modules packaged with Module::Install pre-0.61. But hopefully this is something that will stop happening in the future. -Nilson Santos F. Jr. ___ 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/