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

IRC log for #mojo, 2015-03-24

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

All times shown according to UTC.

Time Nick Message
00:08 Ralesk joined #mojo
00:10 meshl joined #mojo
00:12 frederico joined #mojo
00:16 marty joined #mojo
00:51 * phillipadsmith gets a notification… http://libraries.io/cpan/Mojolicious/6.04
00:51 phillipadsmith That's useful.
00:55 Zoffix Yeah, got one too
01:20 cpan_mojo HTML-ExtractText 1.001003 by Zoffix Znet - http://metacpan.org/release/ZOFFIX/HTML-ExtractText-1.001003 (depends on Mojolicious)
01:26 nicomen I have enabled linear nano-highlighting, and it works quite ok actually, so more mobile than ever dragging my nanorc around ;) (copying it to wherever I am is faster than starting emacs, or esce-esc-esc-esc:q! out of vim)
01:26 nicomen og backlog buffer lag
01:53 sri this is actually quite annoying https://github.com/kraih/mojo/issues/770
01:54 sri every fix i can come up with sucks big time
02:04 sri without monkey_patch we would be losing set_subname support
02:08 klapperl_ joined #mojo
02:15 good_news_everyon joined #mojo
02:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hxic
02:15 good_news_everyon mojo/master 5adf558 Sebastian Riedel: fix warnings in Mojo::Base
02:15 good_news_everyon left #mojo
02:16 sri i hate it
02:16 mst sri: isn't that just a circular require problem?
02:16 mst yep
02:16 sri possibly, the warnings are very useless though
02:16 mst it is
02:17 mst and Mojo::Util doesn't use has()
02:17 mst so you can 'require' it rather than use-ing it
02:17 mst oh, wait, no, that still won't quite help
02:17 mst feh
02:17 mst sri: gimme a minute
02:18 sri nope, the import enables strictures
02:19 mst oh, of course
02:20 sri it doesn't even break anything, just dumb warnings
02:20 mst circular require stuff can easily break things later though
02:21 sri curious how "Mojo::Util::monkey_patch $caller, 'has', sub { attr($caller, @_) };" causes "Useless use of a constant ("has") in void context at lib/Mojo/Base.pm line 39."
02:21 sri i guess Mojo::Util::monkey_patch is not yet defined
02:21 sri triggering that oddity
02:21 mst and so you parse it as indirect object notation
02:21 mst $caller->Mojo::Util::monkey_patch(), 'has', ...
02:21 sri oh shit... of course... indirect object notation
02:22 sri *facepalm*
02:22 mst which is what ciruclar requires cause, which can easily break things later, which is why I went "ew" at this
02:22 mst Moose::Util::TypeConstraints predeclares its subs for exactly this reason
02:22 nicomen can indirect object notation be turned off somehow?
02:22 mst nicomen: 'no indirect;' will complain about it
02:22 sri i guess i can predeclare monkey_patch
02:23 mst you can't yet disable it in the compiler
02:23 mst right
02:23 mst sub monkey_patch;
02:23 nicomen yeah like, so Java is over, we don't need new Foo; anymore, bye-bye, no?
02:23 mst sorts it out
02:23 nicomen dang
02:23 nicomen ah I forgot Javascript...
02:24 sri hmm... not sure which solution sucks less
02:25 crab «There are still some valid reasons for it (e.g. pgbouncer), but certainly it is not a setting most people should adjust until they find a strong and specific reason to.» -- GSM
02:25 mst sri: thrown a chunk of log onto the issue so at least other people know what's going on
02:26 Grinnz "thrown a chunk of log onto the issue" sounds like a euphemism for either a fireplace or a toilet
02:28 good_news_everyon joined #mojo
02:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hx1L
02:28 good_news_everyon mojo/master 175b3c7 Sebastian Riedel: mention why monkey_patch is split between Mojo::Base and Mojo::Util
02:28 good_news_everyon left #mojo
02:33 sri or i just revert the whole thing... not sure 2% performance is worth it
02:34 mst setting a precedent of actually handling circular requirement problems would be nice
02:35 mst or adding a test to make sure you don't have any
02:47 marmez joined #mojo
02:55 hshong joined #mojo
03:07 uma joined #mojo
03:09 noganex joined #mojo
03:12 davido_ joined #mojo
03:15 Ralesk joined #mojo
04:18 uma joined #mojo
04:29 uma joined #mojo
04:42 uma joined #mojo
04:48 basic6_ joined #mojo
04:51 cpan_mojo Mojolicious-Plugin-Model 0.04 by Andrey Khozov - http://metacpan.org/release/AVKHOZOV/Mojolicious-Plugin-Model-0.04
04:52 inokenty-w joined #mojo
05:10 cpan_mojo MojoX-Redis 0.88 by Sergey Zasenko - http://metacpan.org/release/UNDEF/MojoX-Redis-0.88
05:13 woz joined #mojo
05:32 irq joined #mojo
05:56 uma_mahesh joined #mojo
06:22 Anon021 joined #mojo
06:34 csson joined #mojo
06:49 dotandimet joined #mojo
06:52 dotandimet joined #mojo
06:53 dod joined #mojo
06:57 dod joined #mojo
06:58 inokenty-w joined #mojo
07:16 batman sri: why couldn't you just replace "use Mojo::Base -strict" with "use strict; use warnings; ...." in Mojo::Util?
07:43 marty joined #mojo
07:44 drzz joined #mojo
07:55 irq joined #mojo
08:01 juikuen joined #mojo
08:02 AndrewIsh joined #mojo
08:03 bramirez joined #mojo
08:11 Vandal joined #mojo
08:16 eseyman joined #mojo
08:26 cpan_mojo Mojolicious-Plugin-Breadcrumbs 1.001002 by Zoffix Znet - http://metacpan.org/release/ZOFFIX/Mojolicious-Plugin-Breadcrumbs-1.001002
08:35 trone joined #mojo
08:45 fhelmber_ joined #mojo
08:46 marcusr hmm
08:48 Shaeto joined #mojo
08:48 damaya joined #mojo
08:48 damaya Hey all
08:48 Zoffix hey
08:48 damaya question, in terms of design
08:48 damaya :D
08:48 damaya I designed a site using preaction's statocles
08:49 damaya just wondering what you all think of it
08:49 Zoffix Visually?
08:49 damaya http://www.despairbear.com
08:49 damaya yeah, visually
08:49 Zoffix GAH MY EYES! MY EYES!
08:49 damaya hahaha
08:49 Zoffix just kidding
08:49 * Zoffix looks
08:49 damaya thanks Zoffix :)
08:50 damaya I've been designing themes for Statocles like crazy. I fricking love Statocles at this point.
08:51 damaya There's no content there yet, really. I was just wanting input on design. I was thinking the noose on the cover was too much. The nuke cloud on the belly is probably enough.
08:51 woz joined #mojo
08:52 Zoffix Looks fine visually, but usability-wise I feel it could be improved. It's not entirely intuitive to know that the vertical bar means end of the book or that the triple bars at the top is the menu. I felt lost quickly. Started clicking the "previous page" button in hopes to go back, until I got to the first page and the button was not there anymore.
08:52 Zoffix I'd put breadcrubs or nav at the top.
08:52 Zoffix *breadcrumbs
08:52 damaya ok, I was thinking the same thing
08:53 damaya my wife got lost on it too
08:53 damaya yeah, the navigation is not really intuitive at this point
08:54 damaya out of curiousity, what browser are you using?
08:54 Zoffix Palemoon
08:54 damaya whoa, that's a new one to me
08:55 damaya does it render ok in palemoon?
08:55 Zoffix Yeah. It's essentially Firefox for people that can't stand Australis UI update :)
08:55 damaya ok, I imagine so since it's a fork of FF. I'm using Iceweasel and it renders fine.
08:57 woz joined #mojo
09:01 dod joined #mojo
09:16 denny joined #mojo
09:17 ZadYree joined #mojo
09:51 jb360_ joined #mojo
09:53 tianon joined #mojo
09:56 danejx_ joined #mojo
10:16 trone joined #mojo
10:16 melo joined #mojo
10:19 frederico joined #mojo
10:32 alnewkirk joined #mojo
10:42 bramirez joined #mojo
10:56 bramirez Hello! Someone can help me? I have a transaction inside another transaction. The nested one is in charge of downloading a large file. How can I report the downloading progress to the other transaction?
10:56 bramirez Thanks!
10:59 Snelius With another http request for progress
11:08 bramirez Snelius: You suggest to store the progress and ask for it with another request, aren't you?
11:10 Snelius yes, i think it's task for frontend - check state
11:19 bramirez Snelius: Ok, thanks!
11:20 cpan_mojo Mojo-MySQL5 0.02 by HARRYL - http://metacpan.org/release/HARRYL/Mojo-MySQL5-0.02
11:20 cpan_mojo Mojo-mysql 0.08 by HARRYL - http://metacpan.org/release/HARRYL/Mojo-mysql-0.08
11:29 marmez left #mojo
11:52 bramirez joined #mojo
12:04 neilhwatson joined #mojo
12:05 neilhwatson joined #mojo
12:14 punter joined #mojo
12:20 mattastrophe joined #mojo
12:24 icjs i'm back again :) so in the NYTProf of our app, i see  Mojo::JSON being called quite a bit/time spent in this - what can i do to optimize this?
12:25 icjs a quick googling mentioned Mojo::JSON::Any - is this a "drop-in replacement" that uses the JSON::XS lib (which we have installed).
12:26 icjs we're a little unsure how to leverage it in our mojo app
12:26 icjs btw a gain for us was replacing YAML with YAML::XS (something also highlighted by NYTProf)
12:28 frederico joined #mojo
12:38 jberger icjs: https://metacpan.org/pod/Mojo::JSON::MaybeXS
12:44 Flying_Squirrel joined #mojo
12:48 icjs jberger, thanks we were rtfm'ing too. looks like as long as we put Mojo::JSON::Any in our mojo app script (the one that contains "Mojolicious::Commands->start_app") - then we'll benefit from JSON::XS that is already installed
12:49 jberger icjs: that's the idea, yes
12:50 nicomen icjs: also, when is it called, are you perhaps parsing body of HTTP requests needlessly?
12:54 batman ribasushi: we got some more details on what's going on now: https://www.mojoconf.com/2015/register # you can click on each of the tickets to get more information
13:05 zivester joined #mojo
13:23 frederico joined #mojo
13:27 dotan joined #mojo
13:29 nicomen batman: looking good ;)
13:30 batman nicomen: thanks :)
13:30 tianon joined #mojo
13:44 Grinnz icjs, not to self-promote but you should use Mojo::JSON::MaybeXS, that other module will not work properly
13:45 batman Grinnz: you should self-promoto if you have made something awesome! :)
13:46 Grinnz heh, that one was mostly sri's idea :P
13:46 batman as in "icjs, to self-promote -- you should use..." :D
13:56 jb360_ joined #mojo
14:04 icjs Grinnz, it's good advice - we measure a 350% increase in reqs/sec using it :D
14:04 icjs (along with YAML::XS and JSON::XS that is)
14:19 gryphon joined #mojo
14:20 mattastrophe joined #mojo
14:39 nicomen one question I have regarding the ::Any and MaybeXS Mojo::JSON modules, why don't you make sure they return the same as Mojo::JSON?
14:40 nicomen I'm afraid of using those because we might be checking for "wrong" values
14:45 genio I'm not quite sure I get the reasoning for escaping / in Mojo::JSON.
14:49 cpan_mojo Mojolicious-Plugin-ValidateTiny 0.14 by Viktor Tuskyi - http://metacpan.org/release/KOORCHIK/Mojolicious-Plugin-ValidateTiny-0.14
14:49 Grinnz_ nicomen: because JSON::XS and Cpanel::JSON::XS are not maintained by sri
14:50 Grinnz_ nicomen: in most cases you won't see a difference, unless you are depending on stringification of objects or similar
14:52 Grinnz_ nicomen: Mojo::JSON::MaybeXS doesn't do anything more than monkey-patch Mojo::JSON's encode/decode/etc to use Cpanel::JSON::XS's encode/decode, any further processing would probably defeat the (significant) speed benefit
14:54 nicomen Grinnz_: but I would think that a wrapper module would wrap values? or is that making everything slow again?
14:54 nicomen ah right
14:54 nicomen so basically aliasing then
14:55 Grinnz_ yes
14:59 Grinnz_ https://metacpan.org/source/DBOOK/Mojo-JSON-MaybeXS-0.007/lib/Mojo/JSON/MaybeXS.pm it's pretty simple, JSON::MaybeXS just returns an instance of whichever JSON module is available (preferring Cpanel::JSON::XS)
15:04 Grinnz_ genio: https://github.com/kraih/mojo/issues/693
15:06 amon joined #mojo
15:19 genio ah.  Yea, I should have thought about that a bit more
15:38 sh4 joined #mojo
15:39 icjs are we missing a trick by not enabling keep_alive in LWP::UserAgent
15:41 denny joined #mojo
15:42 arthas joined #mojo
15:44 hummeleBop joined #mojo
15:46 asarch joined #mojo
15:54 disputin joined #mojo
15:58 ioann joined #mojo
15:59 marcusr icjs: why not Mojo::UserAgent?
15:59 disputin1 joined #mojo
16:03 icjs marcusr, as we understand it, using that would require some rewriting of our app. or does that sound odd and we can use it as a "drop in replacement" for Mojo::UserAgent
16:03 icjs marcusr, our app is blocking (call to solr, wait for results, shove them back to requester) all over HTTP
16:08 Grinnz_ icjs: it's not quite "drop in", but it can certainly be used blocking
16:08 Grinnz_ icjs: my $tx = $ua->get($url); then check $tx->error or $tx->success
16:09 Grinnz_ whenever there isn't a callback provided it will be blocking, and return $tx
16:09 sri and yes, no keep-alive can be very costly
16:09 sri Mojo::UserAgent does keep-alive by default
16:09 icjs ah ok, interesting...
16:14 sri batman: how is "use strict; use warnings;..." better than the current solution?
16:14 Grinnz_ sri: i think he meant to remove the dependency on Mojo::Base
16:15 sri i know
16:16 sri but why does that solution suck less than declaring monkey_patch in Mojo::Base? or predeclaring it in Mojo::Util before using Mojo::Base?
16:16 sri it is certainly the most verbose choice
16:17 Grinnz_ it's more straightforward, IMO
16:18 marcusr I don't understand how it's more straightforward.
16:18 marcusr it does seem more verbose.
16:19 uma_mahesh joined #mojo
16:19 Grinnz_ because instead of compensating for the circular require, it removes the circular require
16:20 Grinnz_ thats just my usual approach though
16:20 sri umm
16:20 sri the current solution also removes the circular require
16:20 sri in fact, only the predeclare solution doesn't remove it
16:21 Grinnz_ true, but by moving a Mojo::Util function into Mojo::Base
16:22 marcusr monkey_patch kind of feels like a better fit for Mojo::Base anyways.
16:22 ioann joined #mojo
16:22 sri and you want to duplicate Mojo::Base functionality in Mojo::Util
16:23 batman sri: Did you seen my comment about strict/warnings earlier?
16:23 * Grinnz_ shrugs
16:26 batman Ah. Sorry.
16:28 batman sri: Maybe I've missed out on a commit, but I thought the monkey patch code was duplicated in ::Base and ::Utilities now?
16:28 batman Crap. Auto complete :(
16:29 sri https://github.com/kraih/mojo/compare/v6.04...master
16:29 uma_mahesh joined #mojo
16:31 batman Right. So warnings+strict would be two lines of diff, instead of... A lot?
16:32 sri so you've verified Mojo::Util doesn't need anything else?
16:33 batman sri: no. But I don't see how it would need Mojo::Base
16:33 batman *why
16:33 batman It's just my opinion.
16:34 sri http://mojolicio.us/perldoc/Mojo/Base#DESCRIPTION
16:34 bramirez joined #mojo
16:35 bramirez1 joined #mojo
16:36 batman That does not convince me.
16:36 sri actually, you made a proposal, so you need to convince me ;)
16:37 sri and at this point i'm not actually taking it serious because you've not even verified your assumptions
16:38 batman sri: I'm currently not in front of a computer
16:38 batman So I guess I loose.
16:38 sri like, are you sure nothing depends on the implicit "use IO::Handle" in Mojo::Base? https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L234-L240
16:39 batman sri: What I meant is "don't use Mojo::Base in Mojo::Util"
16:41 frederico joined #mojo
16:42 uma_mahesh joined #mojo
16:49 uma_mahesh joined #mojo
16:50 Oleg joined #mojo
16:52 disputin joined #mojo
16:55 icjs batman: "I'm currently not in front of a computer" - just curious, some android irc app?
16:56 disputin1 joined #mojo
16:57 icjs sri, a little guidance on wrk if i may: if my mojo/hynotoad app is workers=24/clients=1 what should my wrk settings be to properly exercise it?
16:57 icjs or doesn't it matter as longas my wrk test is consistent after every change?
17:01 uma_mahesh joined #mojo
17:01 tianon joined #mojo
17:05 dod joined #mojo
17:17 Grinnz_ icjs: shouldnt matter as long as the wrk test has enough concurrency
17:27 uma joined #mojo
17:28 tianon joined #mojo
17:30 batman icjs: convos.by
17:30 ioann joined #mojo
17:34 ioann joined #mojo
17:35 icjs batman, wow, the screenshot is you and sri talking in this channel
17:36 Grinnz_ hehe
17:36 batman icjs: yeah. we speak from time to time ;)
17:39 dbr joined #mojo
17:40 icjs i was reflecting earlier that it's amazing that i have this access to the authors of the software we use, thats the power of opensource i guess. imagine we used some closed source software and had trouble with it? we'd have to pay a lot of £££ to have that kind of access
17:40 icjs so, thanks Grinnz, sri and mst
17:41 icjs and The Batman
17:41 purl the batman is good.
17:41 Grinnz_ heh, you mentioned using JSON::XS though... opensource doesn't help you with access to the author there :P
17:52 sri jberger, tempire, crab: got an opinion on which Mojo::Base fix to use?
17:53 crab sri: not really, i'm ok with what you committed.
17:55 sri to sum up the solutions again, a) what is currently in master (_monkey_patch in Mojo::Base), b) revert to 6.03 version with 2% less overall performance, c) keep the circular require and predeclare monkey_patch (sub monkey_patch;), and d) do not use Mojo::Base in Mojo::Util (switch to manual "use strict;...")
17:57 Grinnz_ given the potential for future issues, i think d) is not feasible
17:58 Grinnz_ if you think the monkey_patch code in Mojo::Base is okay that seems fine to me
17:58 sri c) also seems a little risky, someone just needs to use another Mojo::Util function in Mojo::Base and the same happens again
17:59 sri (avoiding circular require seems easier to manage)
18:00 Grinnz_ i agree, and the comment that is there will help to avoid future issues
18:00 sri a) has the downside that Mojo::Base is not as pretty as it used to be with b)
18:01 sri well... s/pretty/simple/ ;p
18:01 sri https://github.com/kraih/mojo/blob/v6.03/lib/Mojo/Base.pm
18:01 sri vs https://github.com/kraih/mojo/blob/master/lib/Mojo/Base.pm
18:13 uma_mahesh joined #mojo
18:15 dbr left #mojo
18:15 good_news_everyon joined #mojo
18:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/jvRU
18:15 good_news_everyon mojo/master bc94863 Sebastian Riedel: it was not just warnings
18:15 good_news_everyon left #mojo
18:16 sri perl -Ilib -E 'use Mojo::Util; use Mojo::UserAgent'
18:16 sri that actually broke in 6.04
18:21 mattastrophe joined #mojo
18:26 Grinnz_ haha... github's context for that commit makes it look like the previous change is "  - Improved Mojo::Reactor::EV and Mojo::Reactor::Poll to fail more"
18:27 genio moar fail
18:33 punter joined #mojo
18:37 uma_mahesh joined #mojo
18:46 ioann joined #mojo
18:52 kopekru joined #mojo
18:53 uma_mahesh joined #mojo
18:53 sri hmm, this one is odd https://github.com/kraih/mojo-pg/issues/3
18:56 berov joined #mojo
19:17 sri the dbi trace ends with "Waiting for old async command to finish"
19:19 sri and it starts with "Early return for async query    <- execute= ( '0E0' ) [1 items]"
19:20 sri but when i call ->pg_ready it returns false
19:29 sri DBI_TRACE=5 shows *a lot* of information
19:31 * sri starts to suspect a DBD::Pg bug
19:38 sri maybe a postgresql expert can chime in? https://github.com/kraih/mojo-pg/issues/3#issuecomment-85663329
19:40 sri haha, i can't wait for someone to tell me that event loops are not actually supported by DBD::Pg
19:40 sri awaiting a response like "you have to call $dbh->pg_ready over and over in a loop"
19:40 Grinnz_ heh
19:41 Grinnz_ will have to get someone to write a Mojo::MySQL5 for pg
19:42 batman Grinnz_: why is d) not an option?
19:42 frederico joined #mojo
19:43 dbr joined #mojo
19:43 Grinnz_ batman: it's an option, but it makes Mojo::Util independent of updates to Mojo::Base, pragmas/imports having to be managed manually
19:43 kaare joined #mojo
19:43 Grinnz_ it doesn't seem ideal to me
19:43 batman Grinnz_: what does it really affect..?
19:44 Grinnz_ that's what would have to be determined
19:44 batman right... so because something might happen, you decide on not doing something...? that's not quite the same as "not feasible" imo
19:45 Grinnz_ say you include exactly what is imported by -strict currently, then some new pragma becomes useful to import globally in mojo
19:45 batman what do you mean "globally" what ever "use ...." you have in Mojo::Util applies to Mojo::Util.
19:45 Grinnz_ true, i guess it just adds more possible maintenance overhead
19:46 sri batman: bullshit
19:46 batman Mojo::Util export utilities. Mojo::Base export sugar and/or pragmas.
19:46 Grinnz_ Mojo::Base -strict import is used throughout Mojo
19:46 Grinnz_ right, we're talking about what Mojo::Util imports
19:46 batman Grinnz_: sure. but i'm not suggesting a change to Mojo::Base.
19:46 sri to give one example, lets say we add signatures to Mojo::Base, to maybe test how it affects the mojolicious codebase... with d) we might overlook the effect in Mojo::Util
19:47 Grinnz_ it is an extra consideration if Mojo::Base is changed in the future
19:47 sri and Mojo::Util does in fact use prototypes, that's a fatal conflict we would miss
19:47 batman sri: what effect are you talking about? it's a utility package.
19:48 Grinnz_ i feel we are talking past each other
19:48 sri yea, no clue what batman is talking about
19:48 * batman drops out.
19:52 sri i think that means we can safely dismiss option d)
19:53 * sri wonders if he has to remove the query queue from Mojo::Pg
19:53 Grinnz_ did you get any response from postgres people?
19:53 sri fun fact, everything works fine if you just do $pg->db->... for every statement and use a fresh handle from the cache
19:53 mattastrophe joined #mojo
19:54 sri Grinnz_: i have no contacts besides crab
19:56 sri i suspect the pg_socket doesn't become readable again because postgresql already sent a response in the blocking ->execute() call
19:56 sri and the response is queued somewhere inside DBD::Pg
19:57 sri but it needs a few pg_ready calls to process it
19:57 Grinnz_ pg_prod
19:57 sri perhaps even clean up state from the previous async query
19:57 Grinnz_ pg_poke ?
19:58 sri in my tests i only use selects, which seem to be slow enough to always work
19:58 sri so, it may only be very fast queries, like inserts that trigger this
19:59 disputin joined #mojo
20:01 sri it's a breaking change, but what can you do if DBD::Pg doesn't want to play along
20:02 sri $db->query('...' => sub {...}); $db->query('...' => sub {...}); will die in the future, instead of putting the query in a queue
20:02 Grinnz_ :/
20:03 neilhwatson joined #mojo
20:05 sri and i've confirmed my theory in code
20:05 sri https://gist.github.com/anonymous/8e00eadab8c84ed442ee
20:06 sri it prints like 50 NOT READY and then switches to READY
20:07 Grinnz_ huh
20:08 sri the trace https://gist.github.com/anonymous/caca1feec561781f85f9
20:09 Grinnz_ in essence, same restriction as with DBD::mysql then; each db handle can only have one outstanding async query
20:09 sri that was always the case
20:09 sri but it's not outstanding
20:09 Grinnz_ ah
20:10 Grinnz_ its just not ready immediately when the socket says it is?
20:10 sri right
20:11 sri i bet the DBD::Pg async internals are as sketchy as the docs
20:23 sri the really odd part is that the first query works, even if it is an insert too
20:24 sri liek this https://gist.github.com/anonymous/6ec9822376016aed9486
20:24 ioann joined #mojo
20:25 sri even a ping in between makes no difference
20:26 sri NOT READY for at least 20 calls, and pg_socket is never readable again
20:35 ZoffixWork joined #mojo
20:38 ZoffixWork Hey, would anyone know why ->add on cookie jar doesn't seem to add my cookies in this code: http://paste.scsys.co.uk/470220
20:38 ZoffixWork the map seems to produce proper Mojo::Cookie::Response objects, but when I call $jar->all, I get nothing
20:39 trone joined #mojo
20:42 Grinnz_ looking at the source, it doesn't get added if it doesn't have a proper domain, path and name
20:42 Grinnz_ or if its value is over the max_cookie_size
20:44 Grinnz_ parse() most likely doesn't error out when missing some of those things
20:44 ZoffixWork Well.. the names are invalid... >_<
20:44 ZoffixWork I hope that's not it...
20:46 Grinnz_ i would do a dumper of the Mojo::Cookie::Response objects to see what got parsed
20:46 * ZoffixWork is doing it right now
20:47 Grinnz_ https://metacpan.org/source/Mojo::Util#L391 is where they get parsed
20:50 ZoffixWork The domain is missing from a parsed cookie, but I've no idea how to add it :S
20:50 Grinnz_ the cookies need either a domain or an origin, it doesnt look like those get set
20:50 Grinnz_ where are these cookie strings from?
20:51 ZoffixWork From our shitty website :) I'm basically saving them into file and the next time the program starts, I load them back up again to make another request to the site (and for it to think that I'm still logged on).
20:53 ZoffixWork Well.. I see a way to do that I want: parse one cookie, then create another cookie and call ->domain, ->path, ->etc methods on it and insert values from the parsed cookie.
20:53 ZoffixWork ->parse does something weird that I can't call ->domain afterwards :S
20:53 Grinnz_ eh? it's just an attribute
20:54 ZoffixWork I know!!
20:54 Grinnz_ what do you mean by "can't call"?
20:54 ZoffixWork "Can't call method "domain" on unblessed reference at"
20:54 Grinnz_ uh... that's not an object
20:54 ZoffixWork And if I dump that reference, I get proper object..
20:54 * ZoffixWork makes a paste
20:55 Grinnz_ oh that's because parse doesn't return the object
20:55 Grinnz_ it returns an arrayref of objects
20:55 ZoffixWork Ahhh... I'm blind
20:55 ZoffixWork Grinnz_++
20:57 ZoffixWork And yes. The missing domain is why they weren't being added to the jar \o/ All works now
20:57 ZoffixWork Grinnz_++ # Thanks! :D
20:58 Grinnz_ cool
20:58 Grinnz_ i wonder why the domain isn't included in the output
20:59 ZoffixWork *shrug*  This is how I save them to the file:  encode_json [ map $_->to_string, @{ $self->_ua->cookie_jar->all } ]
20:59 ZoffixWork where $self->_ua is Mojo::UserAgent
20:59 Grinnz_ maybe it's expected that domain is set from the origin
21:01 ZoffixWork Grinnz_++ # another one for showing me where cookies get parsed; I'm gonna have to modify that to allow invalid commas in values :)
21:02 Grinnz_ heh... sounds fun
21:04 ZoffixWork And I may have found another bug in Mojo::CSS :P
21:05 ZoffixWork Or at least this selector isn't doing anything for me:    'html body.BodyGeneral table tbody tr td.MainTable form table tbody tr td table.CartH1 tbody tr td.CartH1Data font'
21:05 ZoffixWork (works in the browser)
21:08 sri ZoffixWork: please elaborate
21:09 ZoffixWork sri, it's likely due to this code being rotten tag soup. I'm currently making a test case. If it still fails on valid markup, I'll submit a bug report.
21:10 sri no, i mean is it a case sensitivity issue?
21:10 purl okay, sri.
21:10 sri purl: forget i mean
21:10 purl sri: I forgot i mean
21:10 sri purl: forget sri mean
21:10 purl sri, I didn't have anything matching sri mean
21:10 Grinnz_ lol
21:10 * sri kicks purl
21:10 * purl blocks!  Paint the fence!
21:11 jberger you know what is even better than going away on vacation?
21:12 ZoffixWork Drinking at home?
21:12 marcusr never not working?
21:12 jberger going away and then having it snow 6 inches back home!
21:12 ZoffixWork sri, no idea, I've used Firefox's Firebug plugin to generate that selector from the page and I'm trying to get text from within that element, but I'm not getting anything...
21:13 jberger ZoffixWork: does the selector return an element?
21:13 ZoffixWork jberger, still testing. The way I discovered it was with HTML::TextExtract :P
21:14 ZoffixWork (which uses Mojo::DOM under the hood)
21:14 ribasushi jberger-- # weak, can't take 6 inches
21:14 ribasushi (I thereby grant permission to be quoted out of context ;)
21:14 Grinnz_ <_<
21:14 ZoffixWork :)
21:15 frederico joined #mojo
21:16 sri likely just broken html that firefox repairs differently than Mojo::DOM::HTML
21:16 jberger ribasushi: hahahahaha
21:16 purl LOLCON 5 reached.
21:17 marcusr TIL ribasushi can take 6 inches easily.
21:17 ZoffixWork interesting...
21:17 ribasushi in soviet russia... ok I should stop here
21:18 marcusr :D
21:21 ZoffixWork sri, it's not recognizing `html` selector. Essentially that's it, but what's weird is that if I used that full selector without "html" bit, I get what looks like two matches.
21:21 ZoffixWork And that's with valid markup (except for <font> being obsolete)
21:23 ZoffixWork sri, Oh, never mind about "two matches". I shortened the selector >_<
21:25 ioann joined #mojo
21:28 ZoffixWork Well, here: https://github.com/kraih/mojo/issues/771   you decide whether it's a bug or not :)
21:28 sri ZoffixWork: not a bug
21:28 sri Mojo::DOM docs are pretty specific about that, it only parses fragments, not documents
21:29 ZoffixWork Ah
21:30 sri parsing documents would require a new method that activates the addition of html, head, body elements
21:30 sri and a list of all elements that are allowed in the head section
21:31 ZoffixWork True.
21:31 sri it's not hard, but i never cared enough to do it
21:34 ZoffixWork Yeah, it's not something that's got a lot of use.
21:34 ZoffixWork And actually, in my original issue, it does look like Firefox is just interpreting errors in a different way, so that's why the selector in Mojo isn't matching.
21:35 sri not surprising, Mojo::DOM::HTML respects the HTML5 spec, but doesn't implement the official parsing algorithm
21:36 sri would be too slow/big to be usable
21:36 ZoffixWork And I'm parsing broken tag soup from 1999 :P
21:46 berov ZoffixWork: ++
21:46 ZoffixWork berov?
21:46 purl berov is at home or not so good at this but you make Module Task::*
21:47 ioann joined #mojo
21:47 berov ZoffixWork: for parsing broken tag soup :)
21:47 ZoffixWork lol
21:47 berov I know what it is
21:48 ZoffixWork I actually tried doing this about 6 or 8 years... using HTML::TokeParser::Simple >_<
21:48 ZoffixWork (I mean this website I'm parsing right now).
21:48 berov zzz
21:49 berov at my previous work we were doing this with regexes, do not ask
21:49 ZoffixWork :O
21:51 sri you killed Zoffix
21:51 ioann joined #mojo
21:51 berov sorry
21:52 marcusr tell that to the judge and jury
21:53 Grinnz_ it was berov, in the irc, with parsing html with regexes
21:54 berov then tryed to introduce Mojo, but... what the hell is this
21:54 berov in 2013
21:54 tianon joined #mojo
21:58 berov sri: I know Mojo::DOM::HTML does the same :) hehe :))
22:30 marcusr just with a lot of unit tests.
22:32 berov marcusr: sure, do not understand me wrong - my wholehartedly respect!
22:51 gryphon joined #mojo
22:59 atom joined #mojo
23:00 atom for doing authorization roles, is there a mostly best way to do this?  Is Mojolicious::Plugin::Authorization considered a legit good way?
23:07 woz joined #mojo
23:27 atom12 joined #mojo
23:29 * sri signs up for slack to test it
23:29 sri this seems ridiculous http://thenextweb.com/insider/2015/03/24/slack-is-quietly-unintentionally-killing-irc/
23:30 Grinnz i dunno, it won't replace IRC in the "general chatroom" aspect, because you can't just jump in
23:30 Grinnz it's definitely well designed for business chats, though
23:31 Zoffix Slack? Never heard of her.
23:31 Grinnz it's pretty much a web2.0 version of IRC, without all of IRC's ancient strangeness
23:31 Grinnz it even has IRC and XMPP interfaces
23:32 Grinnz oh, there are public slack teams... i guess that could be a thing
23:34 Grinnz there's somethign to be said for "just hosting an irc network yourself", but really, nobody does that anymore
23:34 sri damn, the design is so damn polished
23:34 Grinnz yeah, it's seamless
23:34 sri http://i.imgur.com/FLpLyti.png
23:35 hernan604 but convos can do sort of the same
23:35 hernan604 i started a slack clone https://github.com/hernan604/Web-IRC \o/
23:36 sri search is interesting http://i.imgur.com/ttwhAVF.png
23:36 Grinnz the slack homepage is still very business-oriented, it's not intuitive to sign up a personal account or join public teams
23:36 sri but damn does it look good http://i.imgur.com/2lixap5.png
23:36 Grinnz yes the search is very nice
23:37 sri Grinnz: yea, i have a feeling slack might be turning into a twitter for group chat
23:37 sri in the next two years
23:37 Grinnz if they can make it more generally accessible definitely
23:39 Grinnz sri, can you/did you make that team public?
23:40 sri not intentionally at least :)
23:40 Grinnz i seem to be only able to create an account for a specific team
23:41 berov hernan604: ++
23:41 sri hmm, looks like you can only switch between invite only and limtied to email domains
23:41 Grinnz strange
23:42 sri hernan604: you clone slack and don't even include a screenshot? Oo
23:42 hernan604 i will do. this weekend i will try to progress more with it
23:45 sri yea, doesn't look like you can actually make a team public
23:46 sri even adding gmail.com is not allowed
23:47 Grinnz wonder what the "public" wordpress team is about then
23:49 sri don't get it
23:50 sri maybe they all have an @wordpress.org email address?
23:50 sri i can limit it to cpan.org email addresses, but that seems ridiculous
23:53 Grinnz lol
23:57 sri how they make you fill out the survey is quite clever
23:57 sri "asnwer these 4 questions and get $50 credit"

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