Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread sindharta_tanuwijaya
Hi, 

Not sure which specific engine you asked, but I'll just put all of them.

---
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

Linux version 2.6.25.4-10.fc8 ([EMAIL PROTECTED]) (gcc version 4.1.2 20070925 
(Red Hat 4.1.2-33)) #1 SMP Thu May 22 23:34:09 EDT 2008

This is perl, v5.8.8 built for i386-linux-thread-multi

Catalyst 5.7014
---
 
Sindharta

Robert Krimen <[EMAIL PROTECTED]> wrote: On Sat, Jun 21, 2008 at 6:36 PM,   
wrote:
> Hi,
>
> Just curious, yesterday I was playing with Java inside Catalyst, and I put a
> code like:
>
> system("java");
>
> in one of my controllers, and when I accessed the URL, the whole computer:
> Fedora Core 8, froze and I had to restart. I am not sure whether it is an OS
> problem, since I later tried the same program on Windows XP with colinux(FC
> 7)/cygwin and the java ran as expected.
>
> Anyone had a similar experience before ?

What engine were you running when this happened?

Rob

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

 

 
-
GANBARE! NIPPON! Chance to win 50,000 Yahoo! Points!
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread Robert Krimen
On Sat, Jun 21, 2008 at 6:36 PM,  <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Just curious, yesterday I was playing with Java inside Catalyst, and I put a
> code like:
>
> system("java");
>
> in one of my controllers, and when I accessed the URL, the whole computer:
> Fedora Core 8, froze and I had to restart. I am not sure whether it is an OS
> problem, since I later tried the same program on Windows XP with colinux(FC
> 7)/cygwin and the java ran as expected.
>
> Anyone had a similar experience before ?

What engine were you running when this happened?

Rob

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


Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread Mark Trostler

You can use Java.pm & there are no system calls...
Mark

Lindolfo "Lorn" Rodrigues wrote:

No, i didn't know, i looked at the source and it's true :(
at least Inline::Java it's better than a simple system("java ... ") ?


On Sun, Jun 22, 2008 at 5:58 PM, Jonathan Rockway <[EMAIL PROTECTED] 
> wrote:


* On Sun, Jun 22 2008, Lindolfo \"Lorn\" Rodrigues wrote:
 > system function it's a bad idea, if you really need to run Java
inside Perl, i
 > did not try that inside Catalyst,  you can check Inline::Java http://
 > search.cpan.org/~patl/Inline-Java-0.52/Java.pod

 > I think that will not a problem to use Inline::* inside Catalyst.

You do know that Inline::Java uses system() to call java, right?

Regards,
Jonathan Rockway

--
print just => another => perl => hacker => if $,=$"

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




--
--Lindolfo "Lorn" Rodrigues
www.slackwarezine.com.br 
http://lornlab.org
http://sao-paulo.pm.org
use Catalyst;




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


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


Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread Lindolfo "Lorn" Rodrigues
No, i didn't know, i looked at the source and it's true :(
at least Inline::Java it's better than a simple system("java ... ") ?


On Sun, Jun 22, 2008 at 5:58 PM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

> * On Sun, Jun 22 2008, Lindolfo \"Lorn\" Rodrigues wrote:
> > system function it's a bad idea, if you really need to run Java inside
> Perl, i
> > did not try that inside Catalyst,  you can check Inline::Java http://
> > search.cpan.org/~patl/Inline-Java-0.52/Java.pod
> > I think that will not a problem to use Inline::* inside Catalyst.
>
> You do know that Inline::Java uses system() to call java, right?
>
> Regards,
> Jonathan Rockway
>
> --
> print just => another => perl => hacker => if $,=$"
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
--Lindolfo "Lorn" Rodrigues
www.slackwarezine.com.br
http://lornlab.org
http://sao-paulo.pm.org
use Catalyst;
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread Jonathan Rockway
* On Sun, Jun 22 2008, Lindolfo \"Lorn\" Rodrigues wrote:
> system function it's a bad idea, if you really need to run Java inside Perl, i
> did not try that inside Catalyst,  you can check Inline::Java http://
> search.cpan.org/~patl/Inline-Java-0.52/Java.pod
> I think that will not a problem to use Inline::* inside Catalyst.

You do know that Inline::Java uses system() to call java, right?

Regards,
Jonathan Rockway

-- 
print just => another => perl => hacker => if $,=$"

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


Re: [Catalyst] Re: Private Chained Actions?

2008-06-22 Thread Ash Berlin


On 22 Jun 2008, at 18:56, Aristotle Pagaltzis wrote:


* Jonathan Rockway <[EMAIL PROTECTED]> [2008-06-22 15:35]:

* On Fri, Jun 20 2008, Aristotle Pagaltzis wrote:

That’s even uglier. Imagine there isn’t just `hello` but half
a dozen other methods all sharing the same setup. So the setup
code is one or two screens down the source file. Now when you
look at `hello` you have absolutely no indication whatsoever
that there might be other code running before it.


I guess. But this is Perl, there's never any indication of
anything. There's no indication that my function is receiving
arguments of a particular type.


Except, y’know, the code in the method body that’s *right there*.


There's no indication that my function throws exceptions.


I hope you’re not using exceptions for standard control flow.


There's no indication that "use Foo" has side effects.


Yes, and that causes no end of intermittent trouble. Ovid had
some recent posts on use.perl about getting bitten hard.


Even in Catalyst, there is a ton of implicit behavior. There is
no indication that begin/end/auto applies to my action (at
least until the action runs).


Except, method modifiers are explicit, not implicit – just
defined at a distance, the way you wrote it. In contrast, if you
use Catalyst you know that there may always be begin/end/auto
actions.

I mean, if you have to write out your intent to modify a method
anyway, why not also put that next to the code that will actually
be affected?

I recommend Schwern’s recent “Skimmable Code” talk.

Note well, I’m not arguing against method modifiers in general.

Regards,


FWIW I also think that the method modifiers makes it harder to skim  
the code, since most of the time you find the end action then look up  
the chain to see what is happening (at least I do) - method modifiers  
make this a much harder thing to find.


-ash


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


[Catalyst] test, please ignore

2008-06-22 Thread Octavian Rasnita

test

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


[Catalyst] Re: Private Chained Actions?

2008-06-22 Thread Aristotle Pagaltzis
* Jonathan Rockway <[EMAIL PROTECTED]> [2008-06-22 15:35]:
> * On Fri, Jun 20 2008, Aristotle Pagaltzis wrote:
>> That’s even uglier. Imagine there isn’t just `hello` but half
>> a dozen other methods all sharing the same setup. So the setup
>> code is one or two screens down the source file. Now when you
>> look at `hello` you have absolutely no indication whatsoever
>> that there might be other code running before it.
>
> I guess. But this is Perl, there's never any indication of
> anything. There's no indication that my function is receiving
> arguments of a particular type.

Except, y’know, the code in the method body that’s *right there*.

> There's no indication that my function throws exceptions.

I hope you’re not using exceptions for standard control flow.

> There's no indication that "use Foo" has side effects.

Yes, and that causes no end of intermittent trouble. Ovid had
some recent posts on use.perl about getting bitten hard.

> Even in Catalyst, there is a ton of implicit behavior. There is
> no indication that begin/end/auto applies to my action (at
> least until the action runs).

Except, method modifiers are explicit, not implicit – just
defined at a distance, the way you wrote it. In contrast, if you
use Catalyst you know that there may always be begin/end/auto
actions.

I mean, if you have to write out your intent to modify a method
anyway, why not also put that next to the code that will actually
be affected?

I recommend Schwern’s recent “Skimmable Code” talk.

Note well, I’m not arguing against method modifiers in general.

Regards,
-- 
Aristotle Pagaltzis // 

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


Re: [Catalyst] Running java inside Catalyst

2008-06-22 Thread Lindolfo "Lorn" Rodrigues
system function it's a bad idea, if you really need to run Java inside Perl,
i did not try that inside Catalyst,  you can check Inline::Java
http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod
I think that will not a problem to use Inline::* inside Catalyst.

Good Luck, and tell us your results.

On Sat, Jun 21, 2008 at 10:36 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Just curious, yesterday I was playing with Java inside Catalyst, and I put
> a code like:
>
> system("java");
>
> in one of my controllers, and when I accessed the URL, the whole computer:
> Fedora Core 8, froze and I had to restart. I am not sure whether it is an OS
> problem, since I later tried the same program on Windows XP with colinux(FC
> 7)/cygwin and the java ran as expected.
>
> Anyone had a similar experience before ?
>
> Sindharta
>
>
>
> --
> GANBARE! NIPPON! Chance to win 50,000 Yahoo! 
> Points!
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>


-- 
--Lindolfo "Lorn" Rodrigues
www.slackwarezine.com.br
http://lornlab.org
http://sao-paulo.pm.org
use Catalyst;
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Private Chained Actions?

2008-06-22 Thread Jonathan Rockway
* On Fri, Jun 20 2008, Aristotle Pagaltzis wrote:
> * Jonathan Rockway <[EMAIL PROTECTED]> [2008-06-20 22:20]:

>> Yeah, that's ugly.  What you really want are method modifiers:
>> 
>> package MyApp::Controller::Foo;
>> use Moose;
>> BEGIN { extends 'Catalyst::Controller' };
>> 
>> sub main_page :Path Args(0) {
>> my ($self, $c) = @_;
>> $self->hello($c);
>> }
>> 
>> sub hello {
>> my ($self, $c) = @_;
>> $c->res->body('hello! setup is'. $c->stash->{setup});
>> }
>> 
>> before hello => sub {
>> my ($self, $c) = @_;
>> $c->stash->{setup} = 'done';
>> };
>> 
>> 1;
>
> That’s even uglier. Imagine there isn’t just `hello` but half a
> dozen other methods all sharing the same setup. So the setup code
> is one or two screens down the source file. Now when you look at
> `hello` you have absolutely no indication whatsoever that there
> might be other code running before it.

I guess.  But this is Perl, there's never any indication of anything.
There's no indication that my function is receiving arguments of a
particular type.  There's no indication that my function throws
exceptions.  There's no indication that "use Foo" has side effects.
Even in Catalyst, there is a ton of implicit behavior.  There is no
indication that begin/end/auto applies to my action (at least until the
action runs).

So in other words, I disagree with you.  I use method modifiers all the
time, and I (and others) have no problem maintaining code.  If you want
ultimate verbosity, just call hello_setup from hello.  If you think you
can keep a few method modifiers straight in your head, then use the
Moose approach.

TMTOWTDI.

> Note that using method modifiers instead of Cat dispatch means
> that the Catalyst::Stats breakdown of a request will be coarser.

The less my web framework does for me, the better.  If I want profiling,
I'll use DashProfiler.

Regards,
Jonathan Rockway

-- 
print just => another => perl => hacker => if $,=$"

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