Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-23

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

All times shown according to UTC.

Time Nick Message
00:52 sri hmmm, i'm actually warming up to the idea of socks support in core
00:53 sri with IO::Socket::Socks it wouldn't be too much code
00:59 sri adding support to Mojo::IOLoop::Client would be a quick hack
01:06 laouji joined #mojo
01:14 basic6 joined #mojo
01:17 good_news_everyone joined #mojo
01:17 good_news_everyone [mojo] kraih tagged v4.50 at d10bb41: http://git.io/8hL3Cg
01:17 good_news_everyone left #mojo
01:18 sri anyway, time to get this released
01:20 * sri deletes xcode
01:21 sri i've only been using it as a 5gb updater for the command line tools, AND IT DOESN'T EVEN DO THAT ANYMORE!!!1
01:25 dvinciguerra joined #mojo
01:43 jberger joined #mojo
01:46 jberger I always like releasing a new version of one of my earlier modules
01:46 jberger Mojolicious::Plugin::PPI 0.04! \o/
01:47 * jberger is cleaning up tools towards a slightly nicer Mojo-based presentation software
01:59 d4rkie joined #mojo
01:59 inokenty joined #mojo
02:13 gtodd jberger: that runs anywhere perl can run :)
02:14 gtodd unlike powerpoint .....  do you see it as sort of a "client" or desktop application that is embedable in an always online server application or ...
02:16 jberger gtodd: its just a webapp :-)
02:16 jberger and btw, its nothing graphical
02:16 jberger I come from the beamer world
02:16 gtodd I'm trying to think how I would create a sort of universal media thumbnailer and viewer .... and use it on large screens :)
02:16 gtodd hehe
02:16 gtodd beamer
02:17 jb360 joined #mojo
02:17 jberger https://bitbucket.org/rivanvx/beamer/wiki/Home
02:17 jeffblack360 joined #mojo
02:17 gtodd I like how larry wall just uses vim and his desktop
02:18 jberger http://mojolicious-introduction.herokuapp.com/
02:18 jberger ^^ I wrote the first version for this talk
02:19 jberger this version is going to have a little more bootstrap under the hood I think
02:19 jberger no need to keep reinventing the wheel
02:43 thomason joined #mojo
02:46 thomason Incredibly enough, I have a viable solution for my earlier question about calling one template from another. But I'm not sure if I'm exploiting a bug (either in mojo or in TtRenderer). Can anyone confirm?
02:46 thomason Here's some sample code - http://pastebin.com/ExPXHQLH
02:46 thomason It works great, but feels wrong...
03:00 D4RK-PH0ENiX joined #mojo
03:24 crab it sounds like you want 'include;
03:24 crab s/;/'/
03:25 crab or something. i don't really understand the problem.
03:25 crab "which is why I'm hesitant to set the values at the model/controller level and just pass it through to the default template" <- this is the part i don't understand more than all the other parts i don't understand
03:32 thomason It's strictly a formatting issue during display. This is a generic CRUD controller. Say I have an arbitrary object, with a key called 'year' on it. I want to print it out as a header in my template as 'Purchase Year' (or whatever).
03:33 thomason So something needs to keep a mapping of "The header for column 'year' is 'Purchase Year'". Since it's strictly used for display in the template, I'd rather define those mappings at the template level.
03:33 thomason encapsulation and separation of concerns and all that.
03:34 thomason And yes, an include is what I want, but I don't want to hardwire the string "list.html.tt" anywhere. I just want the template "list" and to have mojo spit back "list.html.tt" to me. I need the full name on disk for TT's include, which is what I'm trying to get around.
03:35 thomason The ->render() call with partial does exactly what I want to do, so I don't need any private APIs exposed to do it that way, IF that's not actually a bug that's being exploited.
03:37 preflex_ joined #mojo
03:37 tianon thomason: to further back up what crab's pointing out: http://mojolicio.us/perldoc/Mojolicious/Gu​ides/Rendering#Including_partial_templates
03:38 tianon 'include' is the proper way to handle templates inside templates
03:38 tianon and the "render" method is documented there, also ;)
04:02 d4rkie joined #mojo
04:04 damaya Quick question... Is there any way to say that if a param is not sent it's ok, have an action if it's not...
04:05 damaya get '/takeownership/:location/#owner' => sub { my $self = shift; if ( !$self->param('owner') ) { stuff; } else { stuff } };
04:05 damaya something like that
04:08 damaya my current way of doing it is a bit lame, but it works... just wondering if there's a better way than what I am doing. What I am doing is assigning a default of ' ' to owner, then saying if owner =~ /\w+/ do stuff, else do this other stuff.
04:11 damaya One other question: I set an EventSource on a page, an a timeout of 300 seconds. Now, basically I want the page watching for events as long as people are looking at it. If say no event happens for 4 hours, then suddenly an event is emitted, will people who've been viewing the page for 4+ hours see that event, or has it timed out?
04:38 allison joined #mojo
04:50 dqw19 joined #mojo
04:51 damaya Arg
04:52 damaya Is there any way to not convert HTML entities with params? For example, > becomes &gt;
04:56 damaya Where does one go to get help with Mojolicious?
05:27 rem_lex| joined #mojo
05:51 d4rkie joined #mojo
06:16 trone joined #mojo
06:19 dpetrov_ joined #mojo
06:32 marcus xcode-select --install
06:36 d4rkie joined #mojo
06:41 Vandal joined #mojo
06:56 Lee joined #mojo
07:14 fhelmber_ joined #mojo
07:24 dod joined #mojo
07:34 dod joined #mojo
07:37 denisboyun joined #mojo
07:48 trone joined #mojo
07:50 Caldrin_ left #mojo
08:13 dod joined #mojo
08:15 hrupp joined #mojo
08:50 basiliscos joined #mojo
08:57 russum1 joined #mojo
08:57 ladnaV joined #mojo
08:58 alnewkirk joined #mojo
08:58 abhishekisnot1 joined #mojo
08:59 rem_lex|pivo joined #mojo
09:18 basic6_ joined #mojo
09:21 rem_lex joined #mojo
09:27 jpn joined #mojo
09:42 iSlug joined #mojo
09:47 arthas joined #mojo
10:05 rem_lex|pivo joined #mojo
10:12 * sri yawns
10:16 sri oh, apple has their own ssl/tls implementation... that's why they don't upgrade openssl :S
10:21 dqw19 joined #mojo
10:22 punter joined #mojo
10:38 odc so i have this problem: 2 mojolicious servers communicating with each others with simple http requests. The 2nd server is a Queue server which takes a long time to answer. I store the connection ($self->tx) in a hash for later use in order to be non-blocking. Later, i take-back $tx from the hash, and i call $tx->resume to close the connection with the first server. For the first few hours it works as expected, but then it fails: the 1st server never gets his answer
10:38 odc and timeouts.
10:39 odc how would you debug this?
10:40 maxhq joined #mojo
10:44 moritz with print statements
10:44 odc heh
10:46 odc the thing is, the 1st server receives nothing (so there is nothing to print), and on the 2nd, i can't know if or why $tx->resume fails
10:51 sri storing $tx in a hash sounds wrong
10:53 odc sri, yeah, but my Queue server is mono-process (and has to be), so i didn't see any alternative
10:55 maxhq joined #mojo
11:04 rem_lex| joined #mojo
11:18 d4rkie joined #mojo
11:20 thomason_ joined #mojo
11:22 dvinciguerra joined #mojo
11:33 d4rkie joined #mojo
11:50 denisboyun joined #mojo
11:52 d4rkie joined #mojo
11:56 dod joined #mojo
11:59 dqw19 joined #mojo
12:14 thomason_ Way back from last night, re: using include. I'm not using embedperl for my templates, I'm using Template::Toolkit.
12:16 thomason_ Doing a partial render inside of a template does work fine, but it feels like globals are leaking and being exploited. The main thing I'm trying to confirm right now is if I should be expecting the behavior I'm seeing (which I want!) or if it's a bug that might go away.
12:29 yakudza joined #mojo
12:31 ver joined #mojo
12:31 ryozi joined #mojo
12:32 D4RK-PH0ENiX joined #mojo
12:39 rem_lex|pivo joined #mojo
12:41 crab thomason: i don't know why you feel "globals are leaking and being exploited".
12:41 crab but i don't see anything you're doing that is so horrible or accidental. you're calling render(partial=>1, ...) from inside a template. that's a bit unusual, but ok.
13:03 thomason_ Set a variable inside the parent template. Call render partial from within the parent template. The subtemplate picks up the value of the variable set in the parent template. I'm unclear as to how the subtemplate gets the value set in the parent, the two things don't seem like they should be linked.
13:07 saurabh_abhishek joined #mojo
13:08 sri marcus: does xcode-select --install also keep it updated or just reinstall the current version anyway?
13:08 denisboyun joined #mojo
13:11 sri oh, it bails out with an error Oo
13:14 traci joined #mojo
13:27 iSlug joined #mojo
13:30 bowtie_ joined #mojo
13:33 d4rkie joined #mojo
13:46 bluescreen joined #mojo
13:49 jpn joined #mojo
13:50 Vandal joined #mojo
13:52 mire joined #mojo
14:05 btyler joined #mojo
14:17 d4rkie joined #mojo
14:21 traci joined #mojo
14:28 iSlug joined #mojo
14:28 Dandre hello,
14:28 Dandre is there any tag helper similar to tr, th, td of CGI.pm?
14:31 arthas joined #mojo
14:34 trone Dandre: http://mojolicio.us/perldoc/M​ojolicious/Plugin/TagHelpers <-
14:35 trone Dandre: you can use t/tag
14:38 Dandre ok but with CGI->td I can do td([1,2,3]) to output <td>1</td><td>2</td><td>3</td>
14:38 Dandre I haven't seen anything comparable. I may be wrong
14:38 sh4 joined #mojo
14:42 trone Dandre: indeed. No similar thing in plain mojolicious helper.
14:43 Dandre do you know other taghelper plugin?
14:49 sh4 joined #mojo
14:53 tba_ joined #mojo
15:09 bluescreen_ joined #mojo
15:21 sri hmm, IO::Socket::Socks doesn't actually install atm... i guess that settles it ;p
15:21 * sri was actually tempted to try support in Mojo::IOLoop::Client
15:28 denis_boyun joined #mojo
15:30 r0b3rt joined #mojo
15:35 sh4 joined #mojo
15:38 d4rkie joined #mojo
15:42 dod joined #mojo
15:46 gryphon joined #mojo
15:49 basiliscos Hello! I store my server runtime information in database (Redis). It changes infrequently. How to notify all workers (running under hypnotoad) to re-read the information from database?
15:50 basiliscos e.g. some call "/update/database" would lead to all workers update theirs infos with db.
15:51 dod1 joined #mojo
15:51 asarch joined #mojo
15:52 dod joined #mojo
15:56 crab why not just always read it from redis?
15:56 crab you want an in-memory cache of an in-memory cache?
15:58 sri haha
16:02 basiliscos well, I'm writing some variant of "queue", and Mojo will just put new jobs into redis or decline, if some "feature" is available or not. "Feature" availabilty changes may be once per week, and the flow of jobs could be very hight.
16:03 odc err, mojolicious can server http and websocket on the same port right?
16:04 basiliscos i.e. having $feaute = 1 or $feature = 0 in perl process seems to be much cheaper, than to ask redis every time
16:08 tianon redis is pretty inexpensive (that's the whole idea) :)
16:09 tianon but if you do absolutely need your perl to be notified of some external change, using the redis pub/sub feature might interest you - there's a great example of that in the SYNOPSIS of the Mojo::Redis module docs
16:13 crab or if it's really as infrequent as you say, then just send USR2 to hypnotoad.
16:16 sh4 joined #mojo
16:18 sh4|2 joined #mojo
16:18 basiliscos tianon: Thanks. But it seems in Mojo::Redis, that subscription works only during '/messages' request serving. Probably the best is to subscribe at startup phase, and then emit USR2 to hypnotoad, catch it and re-read the config
16:18 basiliscos crab: thanks. Seems to be what I need.
16:22 beyondcreed joined #mojo
16:24 btyler joined #mojo
16:29 stephan48 basiliscos: you would need one connection for pub/sub and one for normal redis manipulations
16:30 basiliscos stephan48: Yep. I know that limitation of redis protocol. Thanks.
16:32 odc ERROR> Event "drain" failed: Not a CODE reference at /usr/local/share/perl/5.14.2/Mojo/EventEmitter.pm line 63
16:32 odc ??
16:40 bluescreen_ joined #mojo
16:45 d4rkie joined #mojo
16:47 odc sri, no idea? ^
16:48 odc my websocket client receives undef and i see this on the server
16:51 odc nvm found it (one cannot $tx->send(json => $hash))
16:56 basiliscos odc: May be it should be $tx->send({json   => {test => [1, 2, 3]}}) (perldoc Mojo::Transaction::WebSocket) ?
16:58 punter joined #mojo
17:00 odc basiliscos, yeah, apparently it depends from which type of object you call send
17:00 odc $self, $ua... these examples are confusing
17:01 sri the mailing list could use a little more moderation
17:02 sri odc: which example says ->send(json => ...)?
17:03 odc oh god, it actually says send({ json => $hash })
17:04 odc my eayes :/
17:05 odc but writing send(j($hash)) works
17:06 sri no it doesn't
17:07 sri you get double encoding issues
17:07 sri i think that guy on the list is trolling me now
17:14 odc haha he knows PERL
17:17 sri i lost it at "I have written several operating systems in PERL"
17:18 tianon wait wat
17:18 tianon []+[]==''
17:20 odc not for me
17:38 zackiv31 joined #mojo
17:40 sh4|2 joined #mojo
17:49 mauke joined #mojo
17:55 trone joined #mojo
17:56 mire joined #mojo
17:57 marcus PERIL
17:57 * sri locks marcus into washing machine
17:58 sri UserAgent.pm is down to 277 lines once all deprecations are removed \o/
17:58 marcus sri: we parents like to call it 'the wet ride'.
18:13 gryphon joined #mojo
18:47 jim joined #mojo
18:48 jim who is robat/viking? and where is the pie? i only saw the rainbow and unicorn:-D
19:01 iSlug joined #mojo
19:14 Mike-PerlRecruiter_ joined #mojo
19:42 denis_boyun joined #mojo
19:45 gtodd tempire: ...  mojolicious videos still running?
19:46 gtodd I wonder how if http://www.codeschool.com/  has a strict policy regarding perl :)
19:48 gtodd some of the courses seem pretty basic without complicated video production ... just some html5 / javascript a clean shirt ....
19:48 gtodd some good lighting ...
20:27 iSlug joined #mojo
20:41 denis_boyun joined #mojo
21:02 * sri wonders if the connection cache could be shorter/more elegant https://github.com/kraih/mojo/blob​/master/lib/Mojo/UserAgent.pm#L151
21:03 duncanthrax joined #mojo
21:06 duncanthrax2 joined #mojo
21:13 maxhq1 joined #mojo
21:18 duncanthrax joined #mojo
21:44 duncanthrax joined #mojo
21:47 duncanthrax joined #mojo
21:50 duncanthrax2 joined #mojo
22:19 inokenty joined #mojo
22:36 sri mojolicio.us might be unreliable for a bit, i'm moving it to a different server
23:25 bpmedley So.. I've attempted to create a reverse http proxy that supports websockets.  Is it possible to point the clients in the Mojo test suite to it's ip and port so that the proxy can then talk to the test servers.  Does that make any sense?
23:26 punter I'm having trouble making Mojolicious read the parameters from this request. Does this request seem fine to you? http://pastebin.com/nTimKdsy
23:26 punter Semicolons aren't missing from the request's headers
23:27 punter there's only one parameter, basically
23:27 punter it can't read it ($self->param('sex') returns some false value)
23:27 bpmedley punter: Where is the boundary?
23:28 punter There should be a boundary? I did some AngularJS trickery to create this request, I obviously fucked up there, didn't I?
23:28 bpmedley http://www.w3.org/TR/html40​1/interact/forms.html#h-17.13.4.2
23:28 punter I'm not familiar with form-data, just learned about them today. I'll read your link.
23:29 punter ok thanks a lot
23:29 bpmedley np
23:35 punter bpmedley: That was it. Now it's fixed
23:38 dvinciguerra joined #mojo
23:52 russum joined #mojo
23:52 abhishekisnot joined #mojo
23:52 phillipadsmith joined #mojo
23:53 tempire joined #mojo
23:55 memowe joined #mojo
23:56 bpmedley joined #mojo
23:56 Lee_ joined #mojo
23:56 mauke joined #mojo
23:56 punter joined #mojo
23:56 d4rkie joined #mojo
23:56 allison joined #mojo
23:56 Dandre joined #mojo
23:56 cfedde joined #mojo
23:56 jnbek joined #mojo
23:56 odc joined #mojo
23:56 gtodd joined #mojo
23:56 phips joined #mojo
23:56 moritz joined #mojo
23:56 tokuhirom joined #mojo
23:56 preaction_ joined #mojo
23:56 DaniBunn1 joined #mojo
23:56 omega_ joined #mojo
23:56 sivoais_ joined #mojo
23:56 graf joined #mojo
23:56 Ralesk joined #mojo
23:56 firnsy joined #mojo
23:56 bc547_ joined #mojo
23:56 rhaen joined #mojo
23:56 Phil21 joined #mojo
23:56 rafl joined #mojo
23:56 caeles joined #mojo
23:56 bobkare joined #mojo
23:56 mikegrb joined #mojo
23:59 asarch joined #mojo

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