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

IRC log for #mojo, 2014-11-25

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

All times shown according to UTC.

Time Nick Message
00:23 Averna joined #mojo
00:26 jamesaxl joined #mojo
00:47 KCL_ joined #mojo
00:59 Inter joined #mojo
01:12 dotandimet joined #mojo
01:16 Dandre joined #mojo
01:20 sri hmm
01:20 sri Getopt::Long::Configure actually returns the old configuration
01:21 sri so it could be used to safely reset it
01:21 sri but it's undocumented :(
01:24 sri used all over the Getopt::Long code though
01:25 hasan hey. could somebody help me with this please? http://nopaste.info/6a1dc907c6.html
01:26 hasan I am trying to figure out how to listen for notifies on psql, get them, $self->send them to the client and then listen for new ones.
01:26 good_news_everyon joined #mojo
01:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Jx2ICw
01:26 good_news_everyon mojo/master 4f3142c Sebastian Riedel: improved Mojolicious::Commands to reset the global Getopt::Long configuration more safely
01:26 good_news_everyon left #mojo
01:26 hasan this code does a recurring every second, so when a message reaches me, I get x times the seconds passed until the first message got in.
01:27 hasan and thus x times the same message.
01:27 hasan so when I pg_notify and wait 10 seconds, and notify again, I get ten times the same message.
01:28 sri still seems better than just resetting Getopt::Long to the defaults
01:36 sri guess the oo api might work, it seems to reset the configuration
01:36 sri what a shitty api
01:38 phillipadsmith Just me, or does Minion require PostgreSQL 9.2+ (w/ the JSON type) ?
01:39 sri it does
01:40 phillipadsmith sri: I couldn't find that actually documented anywhere…?
01:40 sri i guess it isn't
01:41 phillipadsmith Cool. Just checkin' ;)
01:41 sri i could add a note saying that it only supports the latest stable postgres version
01:42 sri i don't want to write 9.2+, or we are trapped with not being able to use new features
01:42 sri 9.5 will be a required upgrade, with SKIP LOCKED support, game changer for job queues
01:42 phillipadsmith Might be worth mentioning. IME, postgres is a PITA to upgrade and I've been holding off on that jump. Minion makes it worth it, however…
01:43 phillipadsmith In the meantime, the File backend seems to be working nicely.
01:44 phillipadsmith What's the ETA in 9.5?
01:44 sri 2015/2016
01:44 purl 0.999503968253968
01:44 meredith oh good to know, i've been fooling around with a 9.4 container but wheezy is still 9.1 (and jessie is frozen for 9.4)
01:48 sri ok, added https://github.com/kraih/minion/commit/9d0b2626ce136f9a8528558fa2350560a991ea67
01:49 sri if you want to support a specific version, feel free to fork the backend class
01:50 sri backends are pluggable, you can just make your own
01:51 sri (don't think there will be a need for 9.4 specific changes though)
01:51 sri jsonb doesn't gain us much i believe
01:52 sri in fact, might even be worse for our use case
01:52 sri but i REALLY REALLY!!!1 want SKIP LOCKED from 9.5 :S
02:05 phillipadsmith sri++
02:13 klapperl joined #mojo
03:21 good_news_everyon joined #mojo
03:21 good_news_everyon [mojo] kraih tagged v5.65 at 53da6c0: http://git.io/JEoaSQ
03:21 good_news_everyon left #mojo
03:22 good_news_everyon joined #mojo
03:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/UpzNLw
03:22 good_news_everyon mojo/master 190153f Sebastian Riedel: bump version
03:22 good_news_everyon left #mojo
03:59 s1037989 I have html,body,table,tr,/tr,tr,/tr,/table,/body,/html and want to remove the trs and get html,body,table,/table,/body,/html.  How can I accomplish this?
04:00 nicomen find all the tables, and dump their content?
04:01 basic6_ joined #mojo
04:02 s1037989 I'm finding that I can get the inside, but I can't get the outside without the inside.
04:02 nicomen for my $table @(Mojo::DOM->new($html)->find('table')->each()) { print $table->content; }
04:02 nicomen ah
04:04 sri ->find('tr')->map('strip')
04:05 nicomen that one will keep the tds etc though
04:05 sri or ->map('remove') if you don't want to preserve the content
04:11 s1037989 Mojo::DOM->new($htm)->find('body div:first-child table:first-child tr')->map('remove') gets me the table element repeated for every tr that it removed.  And the outer html isn't contained in that...
04:14 sri think about what you're actually doing there
04:15 sri and note the deprecation warnings
04:16 sri they are there because you're doing something very very wrong
04:16 * sri is glad we deprecated that stuff
04:16 s1037989 :)
04:17 s1037989 I will be once I learn it all better...
04:24 s1037989 I seem to just be getting a collection of tables, one table with no content, for each section of tr.  So where there was one table and 66 trs, I now have 66 tables and not outer html,body
04:24 sri take a step back
04:24 s1037989 Mojo::DOM->new($htm)->find('tr')->map('remove')->join("\n")
04:25 sri look what every method you call does
04:25 s1037989 They all return a collection, which is not what I want.  I want the original dom with a portion removed.
04:26 s1037989 Oh...!  I need to do an each?
04:26 s1037989 Will that modify the dom object then?
04:27 s1037989 I'm not sure what I said that any more.  each is still a collection.
04:31 sri typical american xmas card? https://pbs.twimg.com/media/B3QnVgaCcAEAqAt.png
04:32 s1037989 That Ferguson?  It's about 20 minutes from here...!
04:32 preaction yeah
04:33 preaction it's apparently not going well since the announcement
04:33 s1037989 No.  Airports, schools, universities...  All closed.  Burned stores, burned police cars, gun shots...
04:34 sri this one is very iconic too https://pbs.twimg.com/media/B3QnxrHIQAABGFe.jpg
04:35 preaction "So lock the door, and hit the floor, cuz Santa Claus comes tonight!"
04:38 jberger murica
04:40 preaction FUCK YEAH!
04:40 purl I SAID FUCK YEAAAHHH!!!  (http://www.penny-arcade.com/comic/2005/04/22)
04:42 s1037989 If map returns a collection of inner DOM objects, how can I use it and also get the outer DOM?
04:55 s1037989 Success!!  Mojo::DOM->new($htm)->find('tr')->map('remove')->root
04:55 s1037989 You guys have too much faith in me...  :D
04:59 s1037989 ->first->root, actually.
05:00 basic6 joined #mojo
05:09 woz joined #mojo
05:21 davido__ joined #mojo
05:57 rem_lex| joined #mojo
06:42 batman joined #mojo
06:55 dod joined #mojo
06:56 KCL_ joined #mojo
07:13 dotandimet joined #mojo
07:51 woz joined #mojo
07:55 dotandimet joined #mojo
07:59 dotandimet joined #mojo
08:15 sugar joined #mojo
08:30 trone joined #mojo
08:31 Vandal joined #mojo
08:43 sugar_ joined #mojo
09:04 sivoais_ joined #mojo
09:16 sugar__ joined #mojo
09:37 dotandimet joined #mojo
10:14 denis_boyun joined #mojo
10:22 dod joined #mojo
10:25 jkramer sri: Is there a special selector in Mojo::DOM::CSS that allows me to select comment nodes?
10:27 nicomen don't think so but you can look at http://mojolicio.us/perldoc/Mojo/DOM#all_contents
10:29 jkramer Yeah, I'm using that currently but it's kind of annoying :)
10:30 Averna joined #mojo
10:30 jkramer I thought since there's :empty, it would be nice to have similar special selectors that are commonly used
10:31 jkramer Or maybe just one selector for the node type, e.g. ":type(comment)", ":type(pcdata)" etc
10:38 dod joined #mojo
11:09 dod joined #mojo
11:11 Guest-quest joined #mojo
11:11 Guest-quest hi-tec guys!
11:12 Guest-quest Why did this happen? http://paste.ofcode.org/KtSLgrCUW9bYN7ztfjw3qv
11:15 dod joined #mojo
11:24 Guest-quest left #mojo
12:01 alnewkirk joined #mojo
12:20 basiliscos joined #mojo
12:22 basiliscos Hello all! I use DBIX::Class to store my objects, and JSON::XS to store complex structures in fields. That fields come from tx->res->json
12:24 basiliscos So, the following code: JSON::XS->new->encode({ value => Mojo::JSON->true}) leads to error
12:24 KCL joined #mojo
12:24 basiliscos Runtime error: encountered object '1', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled ...
12:26 basiliscos is is correct that JSON::XS cannot encode json-structure after Mojolicitious decoding?
12:27 crab have you looked into the allow_blessed, convert_blessed, or allow_tags settings?
12:34 Nei you might need to replace Mojo::JSON with the XS variant
12:35 basiliscos crab: https://metacpan.org/pod/JSON::XS#SERIALISATION . It seems niether is OK, unless Mojo::JSON::Bool supports FREEZE/TO_JSON
12:36 Nei you could  replace your application's Mojo::JSON with JSON::XS equivalent constants
12:38 basiliscos Nei: is it possible to tell Mojo use JSON::XS project-wide instead of Mojo::JSON?
12:38 Nei that would be something I'd attempt instead of mixing two modules
12:39 basiliscos Nei: thanks!
12:40 basiliscos Although it would be nice to have Mojo::JSON be compatible with JSON::XS
12:40 Nei it's more than surface-incompatible
12:46 jberger both Mojo::JSON and JSON::XS support using \0 and \1 for false and true
12:52 basiliscos jberger: thanks for information, but that will not in my situation, as I do: JSON::XS->new->encode($tx->res->json).
12:58 neilhwatson joined #mojo
12:58 jberger basiliscos: why are you doing that?
12:58 jberger just keep the response body
12:59 basiliscos well, it's simplified. Actually I store sub-set of json.
12:59 basiliscos which is "transparent" to application
13:00 jberger basiliscos: if you are having trouble, then use xs throughout
13:01 basiliscos Yep, I think I should anywhere use either Mojo::JSON or JSON::XS to avoid such a troubles.
13:25 ver joined #mojo
13:31 ignacio_ joined #mojo
14:23 fhelmber_ joined #mojo
14:25 sugar joined #mojo
14:36 ignacio_ joined #mojo
14:37 sri jkramer: which spec defines css selectors like that?
14:42 Ptolemarch joined #mojo
14:58 tinypig joined #mojo
14:58 tinypig left #mojo
15:15 ignacio_ joined #mojo
15:19 Ptolemarch joined #mojo
15:21 sugar_ joined #mojo
15:26 sugar__ joined #mojo
15:33 sri it's crazy how many ways people find to get monkey patching Mojo::JSON wrong
15:33 sri https://groups.google.com/d/msg/mojolicious/a4jDdz-gTH0/Exs0-E1NgQEJ
15:34 sri someone please make a CPAN module from that!
15:34 sh4 joined #mojo
15:36 sh4 joined #mojo
15:39 asarch joined #mojo
15:50 Ptolemarch joined #mojo
15:53 tencendur joined #mojo
16:08 jkramer Does :empty consider Tags that contain only whitespaces ("<div>\n\n</div>") empty?
16:13 Grinnz_ sri: that would be cool. right now i am just using $renderer->add_handler(json => sub { do stuff using JSON::MaybeXS });
16:14 Grinnz_ (most of the application is already designed to work with those objects)
16:14 Grinnz_ i considered switching to using \0 and \1, but those don't overload to true and false by themselves
16:15 Grinnz_ nor do they overload numerically to 0 and 1, which i use for database queries
16:17 sugar joined #mojo
16:21 Grinnz_ sri: actually JSON::MaybeXS should work pretty well as a drop-in in that module, for more choice, just change to "JSON->new" and JSON->true / JSON->false
16:28 jamesaxl joined #mojo
16:29 Grinnz_ sri: i'm going to give this a try, i only need to use the monkey patch module in the application class, right?
16:34 sri Grinnz_: no, you need to load it before mojolicious
16:35 sri those functions get imported a lot
16:35 Grinnz_ aha, that did it
16:42 sri this annoys me so much https://github.com/kraih/mojo/issues/693#issuecomment-64425543
16:43 sri issue has been open forever... but you post an essay opposing the change right after it has been accepted
16:43 Grinnz_ heh
16:45 sri the author has been very anti mojolicious in the past though, so motives may be questionable
16:45 Grinnz_ nothing like "I am changing this now" to spurn people into action, though
16:47 sri i actually wouldn't be surprised if that change was used to critisize security in mojolicious
16:47 sri i've voiced the same false sense of security concern before
16:48 * sri shrugs
16:49 Grinnz_ it does seem like "embedding JSON in html" should be its own separate process, but as i've said..  as long as it still generates valid json it doesn't matter to me, cause i won't be doing silly things like embedding JSON in html :P
16:49 axlrose joined #mojo
16:50 mst j/w 41
16:50 sri if there's blowback we will have to rethink the voting process
16:51 sri marcus, tempire, jberger, batman, crab: thoughts?
16:51 sri that change passed with one vote from marcus, i'm not sure it should have
16:53 mst the change appears to make certain classes of the wrong thing less likely to break, without breaking any classes of the right thing
16:53 mst assuming that's the case, I see no reason for it needing a second vote
16:53 Grinnz_ i'm guessing the opposition is because it makes the serialized JSON look different. or something
16:54 jkramer What's wrong with this line? $dom->all_contents->grep(sub { $_->all_text !~ /\S/ })->map('remove');
16:54 jkramer I'm trying to delete all tags that don't have any text but whitespaces somewhere below them. But it seems like this deletes everything.
17:09 sri jkramer: you've found snother bug ;p
17:09 sri :empty is not supposed to be affected by comments and processing instructions
17:09 sri not that it helps you here
17:11 tempire sri: I agree with you. It's too late for that particular issue, but he can open a new one.
17:11 tempire However, mst, there's not need for that comment.
17:12 tempire It's mean.
17:13 tempire Also, I just blew up some eggs in my microwave.
17:13 Grinnz_ mean? heh
17:19 mst tempire: I've maintained the internals of the Catalyst dispatcher
17:19 mst tempire: I am fucking allowed to have a vomit reflex to misuse of attributes at this point
17:20 mst tempire: blame sri :P
17:20 * sri agrees, that comment crossed the line
17:21 mst ok. deleted.
17:21 purl deleted is a pseudo table. During the evaluation of the trigger, it contains the rows that are being deleted.
17:21 mst you have fun with the idiot.
17:22 sri please be nice around here
17:26 sugar_ joined #mojo
17:31 good_news_everyon joined #mojo
17:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/QgVpQw
17:31 good_news_everyon mojo/master 1d89d3c Sebastian Riedel: fixed bug in Mojo::DOM::CSS where the :empty pseudo class would not ignore comments and processing instructions
17:31 good_news_everyon left #mojo
17:34 sri whitespace however does affect :empty
17:59 neilhwatson joined #mojo
18:00 * Trelane reads Alex's comments on #693
18:00 * Trelane files bug report on Text::MiniTmpl
18:01 Grinnz_ heh
18:14 Ptolemarch joined #mojo
18:14 berov joined #mojo
18:28 denis_boyun joined #mojo
18:31 mgrimes joined #mojo
18:32 dod joined #mojo
18:42 sri lol
18:44 tempire OH OH
18:44 tempire I've got the best idea for a talk
18:45 tempire sri, after your new 6.0 thing, someone needs to give a talk, or a series of talks, about how to use each of the new features in detail
18:45 sri i'm not doing the 6.0 thing this time :o
18:45 tempire why not?
18:46 sri the mojo internals talk got all the votes
18:46 tempire You know, you could do both.
18:46 sri i wish i could, but i'm not there yet
18:47 tempire meaning, speaking-wise?
18:47 sri yea
18:47 tempire k
18:48 tempire What if you prepared it, and I delivered it?
18:48 sri preparing a foreign language talk is also quite a bit of effort for me
18:48 sri i guess that's the bigger problem
18:49 tempire I'm not so concerned about what specifically to say, I'm more wanting the slides and the content
18:49 tempire And the listing of points you think are important.
18:50 tempire Or maybe not even the slides
18:50 tempire Just the relevant images associated with the important points
18:51 sri giving you the important points is no problem, images i don't know
18:51 tempire Well I'll rely on the former then. And hopefully you'll have inspiration for the latter as the time draws near.
18:52 sri some big features like Net::DNS::Native support would be rather hard to illustrate
18:53 sri some 5.0 features also came after the talk :)
18:55 sri like support for listening on random ports, ability to perform blocking and non-blocking requests with the user agent at the same time, new number detection in Mojo::JSON
18:58 sugar__ joined #mojo
18:59 sri i guess the 1.0 releases of Mojo::Pg and Minion would actually get most of the time if i did a 6.0 talk :S
18:59 sri not too many big features
18:59 sri could show SOCKS support with Tor or so
19:02 sugar joined #mojo
19:05 tempire !@#$
19:05 tempire yapc is the same dates as wwdc
19:07 sri SOCKS, Net::DNS::Native, nested helpers, ioloop reset, ETag/Last-Modified content negotiation, n function, pluggable session serializers, RFC 3339 support in Mojo::Date, the serious security issue with wantarray, from_json/to_json, the whole Mojo:DOM deprecation dance, entities.txt in DATA...
19:07 sri i guess there's a few topics after all
19:10 sugar_ joined #mojo
19:18 disputin joined #mojo
19:19 disputin joined #mojo
19:23 Grinnz_ sri: https://metacpan.org/source/SRI/Mojolicious-5.65/lib/Test/Mojo.pm#L261
19:23 Grinnz_ this should be $self->send(...) if i'm not mistaken
19:23 Grinnz_ "Can't locate object method "send" via package "Mojo::Transaction::HTTP" at /usr/local/perl/5.16.1/lib/site_perl/5.16.1/Test/Mojo.pm line 261."
19:24 Grinnz_ or rather... it should be send() from the controller object
19:24 Grinnz_ or the ua? in this case
19:25 Grinnz_ oh wait... it should be a Mojo::Transaction::WebSocket, not Mojo::Transaction::HTTP
19:26 Grinnz_ so then why is $ua->build_websocket_tx creating a Mojo::Transaction::HTTP object?
19:27 good_news_everyon joined #mojo
19:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-6VA9g
19:27 good_news_everyon mojo/master 650220d Sebastian Riedel: link to both types of transaction objects
19:27 good_news_everyon left #mojo
19:29 Grinnz_ (I'm just doing the $t->websocket_ok(...)->send_ok(...)->... like in the example in Guides::Cookbook)
19:40 dotandimet joined #mojo
19:44 Ptolemarch joined #mojo
19:45 basiliscos joined #mojo
19:47 good_news_everyon joined #mojo
19:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/3brXkQ
19:47 good_news_everyon mojo/master 49790e4 Sebastian Riedel: improved send_ok method in Test::Mojo to be able to fail gracefully
19:47 good_news_everyon left #mojo
19:51 KindOne joined #mojo
19:55 Grinnz_ joined #mojo
20:22 howitdo joined #mojo
21:02 amon joined #mojo
21:03 Grinnz_ sri: want me to put in an issue for the websocket thing? (you haven't said anything...;)
21:34 woz joined #mojo
21:36 rem_lex|pivo joined #mojo
22:04 sugar__ joined #mojo
22:10 sri Grinnz_: see commits
22:11 Grinnz_ saw that :)
22:11 sri i often don' say anything or give only hints to see if people can figure this stuff out themselves, and if not or there's a real problem commit doc updates/fixes
22:17 panzana` joined #mojo
22:18 dvinciguerra joined #mojo
22:21 dotandimet joined #mojo
22:29 disputin joined #mojo
22:35 good_news_everyon joined #mojo
22:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/0LkyXw
22:35 good_news_everyon mojo/master baf1429 Sebastian Riedel: let Test::Mojo fail a little more gracefully in general
22:35 good_news_everyon left #mojo
22:55 Ptolemarch joined #mojo
23:00 denis_boyun joined #mojo
23:04 dotandimet joined #mojo
23:04 disputin joined #mojo
23:07 Grinnz_ if I want to store an object global to the application (not per request) should I just use a global var? or is there a better way to store something arbitrary in the app?
23:08 * berov is proud to share that Ado 0.75 supports "Sign in" via Facebook and Google thanks to Mojolicious::Plugin::OAuth2
23:08 cfedde Grinnz_: that's a common technique.
23:09 Grinnz_ ok. just not sure about what perl does with closures, etc.
23:09 davido__ joined #mojo
23:09 cfedde the other is to hide it in a singleton which "is considered harmful"
23:09 Grinnz_ yeah that probably amounts to the same thing
23:10 Grinnz_ i was just thinking, if i could store it in the app somehow, then i could retrieve it via $c->app
23:10 Grinnz_ and there would be no closure going on
23:11 Grinnz_ anyway, not a big deal.
23:12 cfedde perl will not keep you from doing that.
23:12 Grinnz_ well, sure, but thats hacky ;)
23:12 cfedde :-)
23:19 tempire http://www.springfreetrampoline.com/
23:22 disputin joined #mojo
23:30 disputin joined #mojo
23:34 cfedde that was an interesting diversion.
23:34 cfedde Now back to the datamines.
23:35 sri for the rest of thr day we will only talk about trampolines
23:36 cfedde unfortunately for me my kids are too old and as yet I have no grandkids.
23:47 rem_lex|pivo joined #mojo
23:54 disputin joined #mojo

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