The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-06-02

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

All times shown according to UTC.

Time Nick Message
00:08 mire__ joined #mojo
00:11 cpan_mojo Mojolicious-Plugin-BlogSpam 0.08 by Nils Diewald - http://metacpan.org/release/AKRON/Mojolicious-Plugin-BlogSpam-0.08
00:23 sri ok, this is funny
00:23 sri perl -Mojo -E 'x("<br< abc abc abc abc abc abc abc abc<p>Test</p>")'
00:23 sri even that results in the warning
00:36 disputin joined #mojo
00:44 sri hmm, i have a fix, but no fricking idea how it works :o
00:47 good_news_everyon joined #mojo
00:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/I7m6Cg
00:47 good_news_everyon mojo/master dfd89c6 Sebastian Riedel: fixed bug where Mojo::DOM::HTML could not handle certain broken tags
00:47 good_news_everyon left #mojo
00:49 sri http://static.fjcdn.com/pictures/I_5e5ac3_2480125.jpg
00:50 sri jberger, tempire, marcus, crab: your mission is to find out what that does :)
00:54 good_news_everyon joined #mojo
00:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/6ghw7g
00:54 good_news_everyon mojo/master 8355762 Sebastian Riedel: moved a few tests
00:54 good_news_everyon left #mojo
00:54 laouji joined #mojo
00:55 marty joined #mojo
00:56 meshl Could someone gently let me know how to force a text file download when clicking on a link using Mojolicious::Lite?
00:59 sri it's not very reassuring when half of the few grep.cpan results for "{0,32766}" have cargo cultet a line from Mojo::JSON :S
00:59 * sri needs a regex wizard
01:02 meshl found this: http://bighow.net/4030812-How_to_Mojolicious__Lite_static_file_downloader_.html
01:04 sri meshl: Content-Disposition
01:08 meshl Is it better than content_type("application/x-download") ?
01:10 preaction yes
01:10 preaction lying about the file's content-type is not a good idea
01:13 meshl so... better like this? $self->res->headers->content_disposition("attachment; filename=foo.zip");
01:14 preaction isn't it a text file?
01:14 preaction wouldn't you want foo.txt in that case?
01:14 preaction but Try It And See. i imagine that will work though
01:15 meshl getting a 404 for now...
01:18 meshl OK works great
01:50 klapperl_ joined #mojo
01:52 shmuel joined #mojo
01:58 * sri kinda wants to allow results for jobs in minion, at least for testing
01:58 sri opt-in... with a manual $job->finish($some_result) call
02:23 cpan_mojo Mango 0.41 by Sebastian Riedel - http://metacpan.org/release/SRI/Mango-0.41 (depends on Mojolicious)
02:25 laouji joined #mojo
02:32 jberger sri yeah that regex is ... well ...
02:34 * jberger whistles and walks away
02:37 * sri nods
02:38 sri pluggable minion backends are done btw.
02:41 asarch joined #mojo
02:43 crab so now one has to write a MInion::Backend::Foobar class and it'll just work if you pass in the right sort of uri?
02:43 sri nope, i've changed it again
02:44 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/Minion#SYNOPSIS
02:44 sri almost the same though
02:47 crab "nope" to which part exactly? (sorry, i don't see anything in the SYNOPSIS that seems to disagree)
02:48 sri Mango is the backend
02:49 crab right. so i was imagining something like plugin Minion => {Foobar => 'foobar://...'}, right?
02:49 sri sure
02:49 crab cool
02:49 sri here's a first draft of the backend api http://mojolicio.us/perldoc/Minion/Backend
02:57 crab yep. read.
03:01 disputin joined #mojo
03:02 sri currently looking into ways to reduce latency, but it doesn't look good
03:40 laouji joined #mojo
03:48 basic6_ joined #mojo
04:01 disputin joined #mojo
04:10 laouji joined #mojo
04:13 kryptonite joined #mojo
04:33 sri so, i brought back pub/sub to minion for now https://github.com/kraih/minion/commit/d921556aad08593417b1e57fe8a17d81b14c1d15
04:38 laouji joined #mojo
05:03 marty joined #mojo
05:09 cpan_mojo Statocles 0.007 by Doug Bell - http://metacpan.org/release/PREACTION/Statocles-0.007 (depends on Mojolicious)
05:39 irq joined #mojo
05:50 irq joined #mojo
05:58 wait4it joined #mojo
06:18 Eke- joined #mojo
06:22 Vandal joined #mojo
06:37 denis_boyun joined #mojo
06:42 dod joined #mojo
06:48 rawler joined #mojo
06:50 irq joined #mojo
06:57 eseyman joined #mojo
06:58 batman sri: what does "(?:(?:$ATTR_RE){0,32766}){0,32766}+" do compared to the (...)* regex?
07:02 wait4it batman: have you ever used compass with sass?
07:04 wait4it I got a hard time using sass with compass using assetpack
07:04 wait4it And I'm not sure I understood the compass concept
07:05 batman wait4it: no. i couldn't make it work either :(
07:06 batman though i didn't really try really hard :/
07:06 batman i was very surprised it didn't "just work"
07:07 wait4it yeah
07:07 wait4it I think it may be the way I imported compass into my sass files that is wrong, but I can't figure out what is the right way.
07:08 batman i feel your pain...
07:08 wait4it I've just copy the content of https://github.com/chriseppstein/compass/tree/stable/frameworks/compass/stylesheets/compass into my filetree in the public folder
07:08 batman please let me know if you figure it out, and i will add it to AssetPack documentation
07:09 wait4it ok
07:09 wait4it what kind of problem did you ran into?
07:11 wait4it this is what I got: http://pastebin.com/pt5VmCRh
07:14 wait4it I'll let you know once I've this fixed
07:14 wait4it By the way I haven't given up on the idea of doing a mojolicious guided tutorial.
07:15 wait4it I did update mojomber to make it more modular and working with mojo 5: https://github.com/13pass/mojomber
07:17 batman i can't really remember... but i think i was missing a lot of mixins.
07:18 batman hehe. cool :)
07:18 batman jberger: "who was eager to host me" -- sounds needy, hehe (mojoconf recap blog)
07:19 wait4it But now I think it may not be the best app case to make a tutorial on websocket and non-blocking stuff.
07:20 batman wait4it: i think the app i fun, which might be very important to learn new stuff
07:21 wait4it true, anyway nothing has been decided yet
07:21 wait4it I'm still thinking about what tutorial could be best for it
07:21 batman make sure you keep it simple
07:21 wait4it I mean what tutorial app
07:22 wait4it Yes that's what I wanna do
07:22 wait4it I did use you bootstap3 plugin in mojomber
07:23 Bravo13 joined #mojo
07:23 batman yeah, i saw that. i'm not sure if you need to though...
07:24 wait4it It is not really useful at the moment but I have some improvement in mind that would use it to make it prettyer
07:24 wait4it anyway I'll let you know about it
07:32 Negor joined #mojo
07:33 irq joined #mojo
08:10 wait4it joined #mojo
08:12 basiliscos joined #mojo
08:13 irq_ joined #mojo
08:20 neyasov__ joined #mojo
08:21 irq_ joined #mojo
08:22 Dandre left #mojo
08:22 Dandre joined #mojo
08:28 neyasov__ joined #mojo
08:43 fhelmber_ joined #mojo
08:47 edestler joined #mojo
09:09 oetiker joined #mojo
09:56 ver joined #mojo
10:10 denis_boyun joined #mojo
10:32 dotandimet joined #mojo
10:52 alnewkirk joined #mojo
10:53 Jonneh joined #mojo
11:00 laouji joined #mojo
11:06 edestler_ joined #mojo
11:11 neyasov__ joined #mojo
11:15 d4rkie joined #mojo
11:38 d4rkie joined #mojo
11:47 jberger wait4it: o/
11:47 jberger batman: I can change the wording
12:06 batman jberger: no problem :)
12:06 batman maybe you could add a link to the youtube page..?
12:25 dpetrov_ joined #mojo
12:26 cpan_mojo Mojolicious-Plugin-PlackMiddleware 0.31 by Sugama Keita - http://metacpan.org/release/JAMADAM/Mojolicious-Plugin-PlackMiddleware-0.31
12:28 neilhwatson joined #mojo
12:42 shmuel joined #mojo
12:45 Akron joined #mojo
12:59 odc ** one might want to claim a Mojolicious channel on http://runnable.com/ **
13:00 hydrauligsepp joined #mojo
13:02 risugg joined #mojo
13:02 jberger_ joined #mojo
13:02 jberger_ wait4it: btw you don't need _message_to_json anymore
13:03 jberger_ There is built-in JSON over websocket
13:04 jberger_ http://mojolicio.us/perldoc/Mojolicious/Lite#WebSockets
13:05 jberger_ http://mojolicio.us/perldoc/Mojo/Transaction/WebSocket#send
13:06 wait4it jberger:thanks
13:07 wait4it jberger:I'll update it once I'll have a round to it
13:09 jberger_ No hurry, I just happened to notice
13:09 jberger_ You are using the "on json" event
13:10 jberger_ So that's cool
13:19 zivester joined #mojo
13:24 * sri has removed notifications again from minion https://github.com/kraih/minion/commit/5a6d04ae52d5d9344168f8bb4d5052e303c48529
13:25 sri it's not working out so well
13:27 sri still tempted to do optional task results though
13:31 ryozi joined #mojo
13:34 jberger__ joined #mojo
13:35 sri mongodb pub/sub has a bit of a problem, every connection eats 5%+ cpu :o
13:35 Dandre joined #mojo
13:35 genio ouch
13:35 sri it's an open issue on their bug tracker
13:36 jberger_ joined #mojo
13:36 sri batman: i don't know what exactly that regex does :D
13:37 sri Celery sticks with conservative polling as well
13:38 maze joined #mojo
13:38 sri a primitive i might streal though is wait_for(), just to see how people use it
13:39 sri my $result = $minion->wait_for($job_id);
13:43 sri also still need a method for interating through all jobs in the queue
13:46 hydrauligsepp left #mojo
13:59 btyler joined #mojo
14:00 _Dave joined #mojo
14:08 riche` jberger's mojoconf blog got perlbuzz'd
14:12 riche joined #mojo
14:18 asarch joined #mojo
14:25 eugen joined #mojo
14:30 shmuel joined #mojo
14:31 gryphon joined #mojo
14:33 gryphon_ joined #mojo
14:49 sri allright, i think the minion backend api is now complete https://github.com/kraih/minion/commit/5f3abfe8d77dfa940e0341d42eae1da78529f63b
14:49 sri couldn't think of a better design for listing all jobs, so i just went with what's convenient for Mango
14:50 sri skip/limit should work rather well for paging on a web ui
14:51 riche sri: don't you sleep?
14:51 sri nope
14:55 neilhwatson sleep coding?
14:59 odc sri, so on the worker's side, we're supposed to do our own polling?
14:59 sri odc: please elaborate
15:02 riche b
15:02 * riche missed C-x
15:04 Dandre tu peux même utiliser vi et ant
15:04 Dandre oups sorry, wrong channel
15:13 sri hmm, guess i'll make job_info also optional non-blocking
15:13 sri so it gets cheaper to poll for the state of your job from within the webapp
15:13 sri and possibly a result
15:13 odc sri, i mean if i want to write a program which waits for job sent through mongodb, do I need to call $worker->dequeue in a loop myself?
15:14 sri odc: i still don't follow
15:14 odc wow
15:14 odc maybe i don't understand what minion is
15:24 jberger__ joined #mojo
15:43 sri ok, this allows for a very basic $minion->wait_for($job_id) with polling https://github.com/kraih/minion/commit/18b8a800a11fd34d126a3a4953a90c769f201e87
15:43 sri which would mean a backend requires two non-blocking operations
15:44 sri enqueue and job_info
15:44 sri (of course you can emulate it)
15:53 neyasov__ joined #mojo
15:53 beyondcreed joined #mojo
16:02 dotan I was getting attached to having the job queue completely separate from the results of the processing. It felt cleaner and less liable for abuse.
16:04 sri everybody is complaining
16:06 sri with results or without, someone will always be unhappy
16:07 basiliscos joined #mojo
16:08 sri anyway, playing with a basic wait_for method now https://github.com/kraih/minion/commit/33a0a2dde81b19b408ca49dd1735451fffe90565
16:09 sri there's two classes of tasks now, results are opt-in http://mojolicio.us/perldoc/Minion#SYNOPSIS
16:14 sri word of warning, if there's no consensus or nobody cares, i'll just go back to the pure mango version i started with, since it's all *i* need
16:15 sri everything i've changed over the weekend were just experiments
16:21 nic sri: odc's link looks interesting as a Mojolicious showcase: http://runnable.com/publish
16:23 odc argh! i thought i could use Minion to dispatch jobs on several machines
16:23 odc the new api look good anyway :) @ sri
16:24 dotan odc: why not? you can run workers on each machine, the Mongo backend stores workers' pid and host name
16:25 marty joined #mojo
16:25 odc dotan, then how does the worker get notified of a new job?
16:25 dotan odc: polling :(
16:26 disputin joined #mojo
16:26 dotan (that frowny does not reflect my own preference, only the potential disappointment I assume on your behalf)
16:27 odc i little bit yes, but if i understand correctly, it's a MongoDB bug right?
16:29 dotan odc: the bug referred to earlier is that mongodb has problems with many clients and its capped collection/tailable cursor feature.
16:29 dotan otherwise that would have been a neat way to do notifications.
16:30 dotan Other backends like maybe redis or message queues might work better there.
16:30 odc oh ok
16:30 dotan I'm fine with polling, we use damn cron jobs for backend processing :(
16:31 wait4it joined #mojo
16:33 russum joined #mojo
16:34 odc dotan, how do I create a minion worker? (on the other server) and listen for new jobs?
16:35 jberger__ sri: I have a half complete back end using dbm deep
16:36 odc i just do Minion->new and call dequeue in a loop?
16:36 jberger__ I should get it working tonight so we can see what a second backend looks like
16:36 dotan odc: there's a command for that - https://github.com/kraih/minion/blob/master/lib/Minion/Command/minion.pm
16:39 dotan It assumes your app is installed on all your servers - minion jobs run tasks defined in your app code, the job queue stores the task name and its arguments
16:40 odc dotan, thx, i'm starting to understand
16:42 sri if you don't like polling make your own backend ;p
16:43 sri but i believe polling is better here
16:47 sri i'm still on the edge about results, on the one hand it's what people are going to do anyway, so we might as well make it suck a little less and benefit from it in tutorials... on the other it does require another backend method to support non-blocking
16:53 wait4it batman:I finally figure out how to fix preprocessing sass files using compass.
16:53 wait4it batman:I've submitted a pull request but let me know if you have any question about it
16:56 sri btw. Celery from python is all polling too
16:56 sri the only big job queue i could find with pluggable backends
16:57 batman wait4it: cool. i will have a look.
16:58 batman sri: it's funny that you changed the regex, without knowing why :)
16:58 batman i was not expecting that, hehe
16:58 sri batman: oh, i know why
16:58 sri i just dont know *how* it works
16:59 batman ah! that makes sense :)
16:59 sri what i know is that it works around the recursion limit somehow
17:00 neyasov__ joined #mojo
17:00 sri jberger_: what i'm most interested in atm is feedback on the result stuff
17:00 neyasov__ joined #mojo
17:01 sri the $job->finish($result); and my $result = $minion->wait_for($job_id);
17:01 neyasov__ joined #mojo
17:02 jberger_ I will be interested to see how dbm deep backend works, there is nothing like Nonblocking for that
17:03 sri just emulate it with a Mojo::IOLoop->next_tick(sub { $self->$cb(undef, $id) });
17:04 sri hmm...now i want to remove the result stuff again :S
17:07 nic I can see the pros for job results, but I'm not yet seeing the cons
17:08 batman wait4it: responded on the pr
17:08 nic If I wanted to completely disable logging (even to console) is the cleanest way to monkey-patch Mojo::Log::log to be a noop?
17:09 batman wait4it: i can make the change and let you review it if you like...
17:09 batman not sure what is best
17:09 nic this is for yon benchmark site, and they say logging must be disabled, which might be why Mojolicious currently shows as complete failure
17:12 denis_boyun joined #mojo
17:12 nic (I know we're not overly concerned about playing benchmarking games, but showing as a complete bomb-out is bad publicity)
17:12 batman marcus: do you get this: http://www.cpantesters.org/cpan/report/721b6f8e-e9af-11e3-ac77-a3a0e0bfc7aa ?
17:23 wait4it batman:sure
17:23 batman ok
17:36 marty joined #mojo
17:36 dod joined #mojo
17:45 sri nic: the cons are that the job queue adds quite a bit of latency
17:47 sri so having support for it is likely to encourage bad design
17:56 wait4it left #mojo
18:03 dod joined #mojo
18:17 asarch joined #mojo
18:44 sri yea, bye bye task results... just doesn't feel right https://github.com/kraih/minion/commit/2399f7b94be5a2e611b17df2c6b8e3b5eba040cb
18:46 sri OMG, new programming language from apple :O
18:48 fhelmber_ joined #mojo
18:54 jnbek joined #mojo
19:08 riche sri: pls post link
19:09 dod joined #mojo
19:09 riche or are you listening to the live stream
19:09 go|dfish http://www.reddit.com/r/apple/comments/274src/new_programming_language_swift/
19:10 riche oh my lord, there goes my weekend
19:12 neyasov__ joined #mojo
19:16 marty joined #mojo
19:21 riche page 48 - creepy
19:21 purl Sorry, I don't know 48's email address.
19:23 riche declaring constants and variables with anything unicode characters, that's going to make for some interesting times
19:24 denis_boyun joined #mojo
19:42 tempire what, no chatter about swift?
19:50 sri https://developer.apple.com/swift/
19:51 sri playgrounds look ridiculously fun
19:52 sri "Rust: SHIT"
19:54 berov joined #mojo
19:58 good_news_everyon joined #mojo
19:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1W7SXQ
19:58 good_news_everyon mojo/master fca0586 Sebastian Riedel: fixed typo in example (closes #630)
19:58 good_news_everyon left #mojo
20:01 mad_hatter joined #mojo
20:03 sri https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/LandingPage/index.html
20:04 mad_hatter so when writing dashboard web apps...do they have to be a part of a website?
20:04 sri feels like a scala without the crazy
20:05 btyler think apple will open source swift?
20:12 neyasov__ joined #mojo
20:15 tempire swift created a collective gasp in the room
20:16 tempire talk about misdirection. everyone's talking about the iphone and no one saw this coming
20:19 russum joined #mojo
20:23 russum joined #mojo
20:24 mire__ joined #mojo
20:28 tempire looks like functional reactive is built into swift
20:29 tempire “Property observers are called every time a property’s value is set, even if the new value is the same as the property’s current value.”
20:33 dotandimet joined #mojo
20:36 priodev joined #mojo
20:37 jnbek^dt joined #mojo
20:37 sivoais joined #mojo
20:40 russum1 joined #mojo
20:49 fhelmber_ joined #mojo
21:05 sri think i'll release a new minion soonish
21:10 riche tempire: did you hear anything about when swift will be unleashed for consumption?
21:13 neyasov__ joined #mojo
21:15 riche just surprised they didn't coordinate the announcement with an xcode update
21:16 sri xcode 6 beta is out
21:18 riche got it ... this just updated an hour ago https://developer.apple.com/library/prerelease/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_6_0.html
21:21 neyasov___ joined #mojo
21:30 cpan_mojo Ado 0.45 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.45 (depends on Mojolicious::Plugin::DSC)
21:40 cpan_mojo Minion 0.10 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-0.10 (depends on Mojolicious)
21:55 oetiker_ joined #mojo
21:56 romel joined #mojo
21:58 avenj joined #mojo
22:02 neyasov____ joined #mojo
22:06 good_news_everyon joined #mojo
22:06 good_news_everyon [mojo] kraih tagged v5.03 at e7ffa97: http://git.io/dQE32w
22:06 good_news_everyon left #mojo
22:07 good_news_everyon joined #mojo
22:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1PBUVA
22:07 good_news_everyon mojo/master 7696e17 Sebastian Riedel: bump version
22:07 good_news_everyon left #mojo
22:08 cpan_mojo Mojolicious 5.03 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.03
22:16 nicomen sri: the regexp fix for Mojo::DOM::HTml did that trigger a segfault/recusiveness error?
22:17 sri the old regex did
22:20 nicomen ok, I remember a similar issue some years ago
22:20 basiliscos joined #mojo
22:21 sri that would be Mojo::JSON, few years back
22:22 nicomen no no, in my own endeavours
22:22 nicomen the fix was very familiar
22:22 sri ah
22:22 nicomen this is fixed in perl > 5.14?
22:23 sri no
22:23 nicomen oooh
22:24 sri the workaround actually only works in newer perls
22:24 sri 5.8.x will segfault
22:24 nicomen https://rt.cpan.org/Ticket/Display.html?id=42441
22:24 nicomen hah ;-)
22:28 nicomen they didn't fix it really, just avoid the problem
22:28 sri i have yet to meet someone who understands the "fix"
22:29 nicomen sri: your fix?
22:29 sri yes
22:29 nicomen sri: it will still fail with large fails, I don't love the fix
22:29 nicomen *large files
22:30 nicomen but
22:31 jberger_ joined #mojo
22:31 nicomen {0,32766}+ <-- I don't understand the + though
22:32 sri take it away and the test hangs :)
22:33 nicomen ohkeeeey, that makes perfect sense (not)
22:33 nicomen what I also don't understand is how the test triggers that bug
22:34 sri try it
22:36 sri the tests are pretty much idiot proof, you can't change the regex to anything else without triggering some bug
22:37 nicomen sri++
22:47 meshl joined #mojo
22:49 fhelmber_ joined #mojo
23:07 elik joined #mojo
23:13 d4rkie joined #mojo
23:30 Akron joined #mojo
23:41 Akron (?:(?:$ATTR_RE){0,32766})*+ works for me, too.
23:41 Akron nicomen: The + is the possessive operator.
23:42 nicomen LMGTFM
23:42 nicomen oh
23:43 nicomen This feature can be extremely useful to give perl hints about where it shouldn't backtrack. For instance, the typical "match a double-quoted string" problem can be most efficiently performed when written as: /"(?:[^"\\]++|\\.)*+"/
23:46 Akron Jepp. It works with all quantifiers and in the old version this was the operator for the boundary expression. But to me it seems that in the outer bracket the possessive kleene star works fine.
23:47 Akron But I didn't test with different perls. And I'm still puzzled by the nesting.
23:52 sri hmm
23:53 sri i guess *+ might be the better choice
23:54 good_news_everyon joined #mojo
23:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-IYJFg
23:54 good_news_everyon mojo/master 73b6911 Sebastian Riedel: small optimization
23:54 good_news_everyon left #mojo
23:54 sri either way, i'd like to try it, just to see how it goes :)
23:54 Akron :) Yes - I'm curious as well.

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