Camelia, the Perl 6 bug

IRC log for #mojo, 2012-06-06

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:15 tempire well.
00:15 tempire I'm at a loss
00:15 tempire "Can't open *ARGV: No such file or directory"
00:15 tempire !?
00:33 mattastrophe joined #mojo
00:57 zivester joined #mojo
01:01 mattastrophe joined #mojo
01:03 balazs joined #mojo
01:06 scott joined #mojo
01:59 d4rkie joined #mojo
02:05 zivester joined #mojo
02:14 jnap joined #mojo
03:39 andrefs joined #mojo
03:52 Leandr joined #mojo
04:42 angelixd joined #mojo
05:04 Leandr joined #mojo
05:10 ovnimancer joined #mojo
05:12 alnewkirk joined #mojo
06:01 Leandr joined #mojo
06:24 Vandal joined #mojo
06:27 ladnaV joined #mojo
06:29 migo joined #mojo
06:29 espent joined #mojo
06:46 osprey_ joined #mojo
06:50 Foxcool joined #mojo
06:56 AmeliePoulain joined #mojo
06:57 AmeliePoulain joined #mojo
07:04 snailfromhu joined #mojo
07:24 nicolasbd tempire: are you there ?
07:49 pau4o joined #mojo
07:59 fhelmber_ joined #mojo
08:03 tempire yes
08:38 nicolasbd joined #mojo
08:38 nicolasbd hello
08:39 nicolasbd i have to re-ask my question from yesterday : how can i build a mojolicious modular application that would have many subdirectories (for each "module") containing a specific "lib" & "public" directories
08:39 nicolasbd ?
08:43 crab why do you want to do such a thing?
08:43 crab it would be more sensible to have each module in its own directory under lib and also with a directory under public, no?
08:43 crab then you wouldn't even have to ask the question.
08:46 tempire nicolasbd: http://mojolicio.us/perldo​c/Mojolicious/Plugin/Mount might be what you're looking for
08:47 nicolasbd crab: you're right, but i'm working on a "webdesktop" project, and i was looking at this project : https://github.com/xantus/comet-desktop .. my boss likes the way the "3rd-part" apps are added to the desktop, as one well formatted folder with a config file. But it's a bit complicated to setup
08:47 nicolasbd tempire: thank you, i take a look right now
08:49 nicolasbd crab: but the authour seems to make an "eval" of the code placed in the sub "lib" folder .. not very secure (but i might misunderstand this, i'm not a pro with perl)
08:50 nicolasbd tempire: seems cool !
08:52 nicolasbd crab: tempire : are you guys Mojolicious developpers ? because if you are, i must thank you and admit I've never been so "seduced" by any kind of framework or library before .. congratulations
08:53 tempire we are involved.  crab is definitely the best looking.
08:53 * crab flicks an imaginary speck of lint off his already-shiny shell
08:53 spleenjack joined #mojo
08:54 nicolasbd haha
08:55 crab nicolasbd: you can definitely do what your boss wants. e.g. in startup, look at your "apps" (or whatever) directory, and for each directory inside it, push the path to the "lib" subdirectory in your @INC and the path to the "public" subdirectory into the list of static ->paths
08:55 crab and then eval whatever startup/other code it needs for setup.
08:56 crab if it sounds a bit painful, well... it is.
08:56 nicolasbd crab: ok ! but would it be less painful using Plugin::Mount ?
09:01 nic nicolasbd: You'll probably want to do similar for 'templates'
09:02 nicolasbd nic: apps won't use templates but thanks, i didn't think about that and it could be useful for other works
09:03 nic I really like the presentation of mojolicio.us/perldoc, but it would be even nicer if there was a convenient link to 'view code'
09:05 nicolasbd nic: and some more complicated examples and improved doc .. but it takes lot of time i guess, and i don't know mojolicious well enough to provide some
09:06 nicolasbd crab: what do you think about Plugin::Mount tempire suggested me ?
09:06 nicolasbd crab: don't you find it less "painful" than an "eval", or do you think it won't work ?
09:07 nicolasbd (i'm building a test right now, but your opinions is interesting ..
09:07 nic nicolasbd: Do you want your umbrella app to be hot-pluggable?
09:08 nicolasbd nic: well .. as i'm not a pro with perl & mojolicious yet, i can't guess :/
09:09 nicolasbd nic: what did you mean ?
09:10 nic At some point (startup) it needs to see what child apps are present, then possibly use M::P::Mount
09:11 nic (I was asking cos I was imagining the parent app would 'watch' the dir and config any child apps that were dropped in; but then decided that was an undesirable complication so shouldn't be mentioned)
09:13 nicolasbd nic: no, you're right .. in fact, the apps will be registered in database, and only registered apps will be loaded, that's why Plugin::Mount seems to be cool. I could iterate on registered apps, and load them at startup
09:14 nic yep, it sounds to me like you're seeing a good way forward
09:15 nicolasbd nic now i have to write all this stuf .. huh
09:15 nic 'eval' would be useful for untested/untrusted child apps, but sounds like you're going the route of controlled deployment of trusted apps
09:17 nicolasbd yes. i could also imagine a kind of "sandbox" where the admin can run an unregistered app .. but an "eval" is dangerous anyway, so he better has to read the entire code before running it
09:20 nic An alternative is to have your child apps sit in self-contained dirs, and have a script that scans the dirs and constructs symlinks in a single standard dir
09:21 nicolasbd nic: ah .. yes, why not
09:21 nic That way you don't elongate @INC as the number of child apps grows
09:21 mandreacchio joined #mojo
09:22 mandreacchio hey is it possible to change a app->defaults variable after navigating away from the page, or rather should I set the variable in the session data?
09:29 Foxcool joined #mojo
09:32 nicolasbd tempire: thank you very much
09:34 * nicolasbd thinks about all the time he didn't waste on this stuff, and now would waste the spared time drinking beer with tempire
09:36 mandreacchio hey guys, what's the easiest way I can send a value from a form to a session variable? (in a form that submits to its self?
09:36 mandreacchio I can put up what I've coded though it doesn't seem to work just yet
09:37 nicolasbd andy82: using ajax ?
09:37 andy82 really? mojo can't do that?
09:37 andy82 well I guess the form doesn't need to submit to its self
09:38 nic andy82: Have you worked through the examples in the Guides?
09:38 nic (I don't have a link but I'm sure I've seen a few examples doing exactly that)
09:38 andy82 though I'd like the session to carry a default variable value
09:38 andy82 I've seen this : http://mojocasts.com/e4
09:39 nic andy82: You'll get a much better launch into this if you also read the Guides
09:39 nicolasbd you can use something like jQuery Forms, a jquery plugin that submits the form with ajax to the "action" url without reloading the page or anything .. all you have to do is defining a route and an action on server side to store the received var in session
09:40 andy82 if submitting the get to a different page is quicker then I'll just do that
09:46 andy82 http://www.gitpaste.com/paste/717/
09:50 andy82 the problem is in this line: $self->session->(soap_session=​>"$self->param('soap_url')");
09:51 andy82 how can I do something like this? (pass from form into the session?)
09:56 andy82 ok a version where the get is somewhere else: http://www.gitpaste.com/paste/718/
09:58 nic andy82: http://mojolicio.us/perldoc/Mojoli​cious/Guides/Growing#State_keeping
10:00 andy82 nic:
10:00 andy82 right I'll read over that example, thanks
10:11 Leandr joined #mojo
10:24 cosmincx joined #mojo
11:02 taryk joined #mojo
11:48 black joined #mojo
12:06 daxim joined #mojo
12:06 lukep joined #mojo
12:31 andrefs joined #mojo
12:49 ZadYree joined #mojo
12:54 jnap joined #mojo
13:05 i_am_batman joined #mojo
13:08 Psyche^ joined #mojo
13:14 rem_lex|pivo joined #mojo
13:19 marcus yow
13:22 andy82 hey I want to click in a link then store the current locahot in the flash to populate in a back button
13:23 andy82 is there an easy way to do that and stick it in the default teamplate?
13:25 andy82 $self->flash('$self->param('/'));
13:27 andy82 humm may be able to do this in .js
13:29 andy82 ok done, thanks!
13:42 diegok andy82: $self->req->headers->referrer is what you want?
13:43 andy82 diegok: yeah I could have done it like that - but I just used .js instead
13:43 diegok andy82: ok
13:43 andy82 diegok: thanks for the advice though
13:46 gryphon joined #mojo
14:16 Leandr joined #mojo
14:30 Htbaa joined #mojo
14:36 inokenty joined #mojo
14:43 black joined #mojo
15:19 nic memowe: Did you mention you're a salsa teacher?
15:29 hahainternet joined #mojo
15:29 hahainternet i can't find an easy entry about this in the docs
15:29 hahainternet but i'm trying to render a page that's url/something/etc/domainname.tld
15:29 hahainternet and i keep getting errors about 'page.tld.tx' not being found
15:29 hahainternet how can i control appending this tld? this is with mojo lite
15:36 hahainternet hmm and i can't add /path/:capture/
15:36 hahainternet because that doesn't match at all
15:37 hahainternet even though it seems to be in the docs, what the heck
15:40 hahainternet aha, it's placeholder type, how did i miss that
15:46 asarch joined #mojo
15:51 GitHub6 joined #mojo
15:51 GitHub6 [mojo] kraih pushed 2 new commits to master: http://git.io/QIKleA
15:51 GitHub6 [mojo/master] Small doc fix :) - Ilya Chesnokov
15:51 GitHub6 [mojo/master] Merge pull request #336 from ichesnokov/master - Sebastian Riedel
15:51 GitHub6 left #mojo
15:56 pau4o left #mojo
16:06 GitHub11 joined #mojo
16:06 GitHub11 [mojo] kraih pushed 1 new commit to master: http://git.io/CLAKqA
16:06 GitHub11 [mojo/master] updated Changes file - Sebastian Riedel
16:06 GitHub11 left #mojo
16:13 Vandal joined #mojo
16:17 memowe nic: yip, sometimes. ;)
16:18 memowe That must be the reason why I'm opped here. ;)
16:19 memowe Thanks, btw
16:21 sri it is!
16:58 memowe \oF
16:59 xaka joined #mojo
17:09 i_am_batman left #mojo
17:18 andy82 is it just impossible to put a for $i loop in a mojo template?
17:18 andy82 I've been trying every which way it just dosen't work
17:20 snailfromhu joined #mojo
17:20 gryphon_ joined #mojo
17:20 jnap joined #mojo
17:23 JiYu joined #mojo
17:27 andy82 %= for (my $i = 1; $i < 10; $i++) {
17:27 andy82 dude
17:27 andy82 %= }
17:27 andy82 does not work
17:28 marty andy82:  Please, no posting in the channel.   Are you look for this? .....  http://mojolicio.us/perldoc/Mojolic​ious/Guides/Rendering#Embedded_Perl
17:28 marty s/posting/pasting/g    :)
17:30 andy82 thanks marty
17:30 marty \o/
17:30 andrefs joined #mojo
17:35 andy82 omg this is painful
17:47 marty What's painful?
17:53 andy82 I'mjust dying to stick an array into a template it downs twork
17:53 andy82 the browser times out
17:53 andy82 other's no indications of what's going on
17:54 marty If by "stick an array into a template" you mean "pass an array to a template" then look at this...  https://github.com/kraih/moj​o/wiki/Recipes-for-templates
17:58 andy82 http://www.gitpaste.com/paste/719/
18:00 marty Is that psudo code or your actual code?
18:01 andy82 yes marty
18:01 andy82 sorry I fixed the $out problem
18:02 andy82 http://pastebin.com/9bdUCTfx
18:02 bpaluch joined #mojo
18:02 jnap_ joined #mojo
18:03 marty Hmmm,  Where are you routes?
18:03 andy82 mojo lite
18:04 andy82 http://pastebin.com/khkY6ZnG
18:04 andy82 I'm not using them Just links
18:04 andy82 I just don't know why it doesn't get that array
18:04 andy82 there's nothing wrong with it there
18:04 andy82 I've tried putting the loop instead in the template
18:04 andy82 but the template shits its self
18:07 sshaw joined #mojo
18:08 marty Well, there is to much for me to digest but I don't see where you are passing the array to the template via the stash.   You should use the stash as the mechanism for accessing the array in the template.
18:09 tempire andy82: what happens?
18:10 andy82 tempire: times out in the browser
18:11 andy82 This webpage is not available
18:12 andy82 marty: can't I "render them like i'm doing there?
18:12 andy82 I can throw it in the stash instead
18:12 andy82 I';ll try that
18:14 andy82 fail
18:14 andy82 http://pastebin.com/index/khkY6ZnG
18:14 andy82 not much different
18:14 andy82 '
18:15 tempire is there a reason you commented out ->render_later?
18:15 sri tempire: this is why i was considering a baby mojolicious for learning, lite is fine when you're already a perl programmer, but for learning perl it's still too advanced imo
18:16 andy82 tempire: not really a reason, I just have been trying everything
18:16 andy82 doesn't help
18:16 andy82 unless I"ve put it in the wrong spot now
18:17 andy82 don't get me wrong, I really enjoy writing in this
18:17 andy82 it's been great to connect with web services
18:17 andy82 but this has really made me hit the wall
18:18 andy82 but yeah that self render later does nothing really at the moment
18:18 andy82 if I then pull out the pagination and the loop then it all works again
18:20 andy82 tempire: what did I stuff up there?
18:22 tempire andy82: I'm not sure what the problem is, but I would suggest simplifying the whole thing.  include only what you need and the solution may present itself.
18:24 andy82 I think I've had it for now, I've reverted everything the original code works
18:24 andy82 and i'm heading off
18:25 andy82 thanks for your help I'm sure the answer is there somewhere
18:25 andy82 though when I had this written up as a perl script it was working ok, the minute I got loops and stuff involved into the template things started to shutdown
18:30 sshaw andy82: you're returning from within the loop, maybe that's the problem
18:30 * sshaw states the obvious
18:31 andy82 sshaw: it worked in a script, I thought it would work here
18:31 jnap joined #mojo
18:33 andy82 regardless of the return in the loop it still fails
18:33 andrefs joined #mojo
18:35 sshaw andy82: have you tried setting $modulus to a constant?
18:36 andy82 sshaw: how so? without using the seal?
18:36 andy82 ceil
18:38 sshaw yes. $modulus = 5, or something.
18:39 andy82 yeah I hard coded it, not working either
18:40 andy82 I'm even echoing out the modulus into the logs and it gets if fine
18:42 sshaw well, that's all i got -sorry
18:43 andy82 that's fine, thaks for your help
18:44 andy82 I've thrown quite a few cocks at this code and clearly now it's began to shit it's seelf
18:44 andy82 every code does that some day
18:44 andy82 some day
18:44 d4rkie joined #mojo
19:13 mire joined #mojo
19:29 atmh joined #mojo
19:31 atmh hi there, is it possible to create a unix domain socket in listen mode inside of a websocket route ? I want for my websocket clients to be able to receive events generated by another perl process, how can I go about that? my attempt to create a unix socket via IO::Async::Listener inside the established websocket wasn't very fruitful
19:36 tempire atmh: use a third process to communicate between the two.  something like gearman, or maybe redis pub/sub
19:47 atmh tempire: oh okay, so I can't directly create the unix socket (listen) in the websocket part? Because I've tried and it creates the socket but I can't communicate with that socket from outside, or from anywhere really
19:50 chansen joined #mojo
19:50 phillipadsmith joined #mojo
20:15 tempire The problem is likely somewhere in the event loop.  It's possible that Mojolicious' own event loop is interfering with it.  You could try making Mojolicious use IO::Async as its event loop.
20:15 tempire Or you could not worry about all that and use a third party.
20:17 sri tempire: http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#Event_loops
20:18 tempire was just looking at that
20:22 atmh I was actually trying to use IO::Async::Loop as the backend for events in Mojolicious following the link above
20:37 atmh testing with IO::Async::Loop::EV creates the socket but when I speak to the socket from outside, I get an error "Attempt to use reference as lvalue in substr at Stream.pm line 370", when I use IO::Async::Loop to create the loop object, I get nothing
20:39 atmh this is to say Mojolicious needs to use IO::Async::Loop::EV as a backend, not IO::Async::Loop ? .. and the error is probably not related to Mojolicious too
20:40 sri in this case Mojolicious and IO::Async share an EV backend
20:42 sri IO::Async::Loop::EV is still pretty new, i would be surprised if it didn't have bugs
20:42 sri besides timers i've not tried anything with it yet :)
20:44 atmh sri: I'm sure I'm not the first to try something other than timers with it either :)
20:47 atmh a separate test of IO::Async::Loop::EV to create unix socket and communicate through that socket works but when used in Mojolicious I get the error mentioned :(
20:54 gryphon joined #mojo
21:27 * tempire switches to the fish prompt for a bit
21:35 andrefs joined #mojo
21:38 jnap joined #mojo
21:47 lukep joined #mojo
21:55 GitHub151 joined #mojo
21:55 GitHub151 [mojo] kraih pushed 1 new commit to master: http://git.io/xt1enA
21:55 GitHub151 [mojo/master] added Heroku deployment recipe - Sebastian Riedel
21:55 GitHub151 left #mojo
21:55 sri tempire, marcus, crab: good idea, bad idea?
21:57 sri no big explanations, just the commands to get started on heroku
22:36 jnap joined #mojo
23:00 * tempire swings
23:00 jnap_ joined #mojo
23:01 mattastrophe joined #mojo
23:03 rem_lex| joined #mojo
23:06 * chansen dance

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary