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

IRC log for #mojo, 2016-04-21

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

All times shown according to UTC.

Time Nick Message
00:49 bpmedley http://bmedley.org/mojo.pdf <-- I added another section using sri's Blogging app
01:06 s1037989 bpmedley++  That's AWESOME!!!
01:06 s1037989 I will read it in detail soon.
01:09 bpmedley s1037989: thanx, any comments and critiques welcome
01:12 trwww joined #mojo
01:55 cpan_mojo Vero-API-v0.1.2 by CARLOS https://metacpan.org/release/CARLOS/Vero-API-v0.1.2
02:11 Lee_ joined #mojo
02:34 noganex joined #mojo
02:42 tchaves joined #mojo
04:34 asarch joined #mojo
05:46 inokenty-w joined #mojo
06:28 dod joined #mojo
06:31 sebbe joined #mojo
06:33 dod joined #mojo
06:35 salva joined #mojo
06:56 dod joined #mojo
07:24 * sri_ wonders why laptops suddenly get 12" displays
07:25 trone joined #mojo
07:41 Vandal joined #mojo
08:11 jberger sri: does the t/mojo/reactor_ev.t pass for you?
08:31 osfabibisi joined #mojo
08:33 sri jberger: don't remember the last time it didn't
08:34 jberger strangely I'm seeing it fail for me and I just had Exodist try on his computer and it failed for him too
08:34 jberger specifically line 138
08:34 jberger https://github.com/kraih/mojo/blob/master/t/mojo/reactor_ev.t#L138
08:35 jberger I've now tried on a clean perlbrew install
08:35 sri also passes on travis
08:37 sri but i can see how there might be a timing problem if your box is fast enough
08:37 sri my dev box is too slow to debug it :(
08:38 jberger well I'm glad to hear that there could be some reason
08:38 jberger I'll try to attack it
08:38 sri since it's a recurring, there is a 0.0001s delay with EV
08:38 sri which can clash with the next_tick, which does not have a delay
08:39 sri don't forget to update the reactor_poll.t tests too, they are supposed to be all the same
08:39 jberger ok
08:40 sri this bug is a subtle hint for me to upgrade my macbook ;p
08:40 jberger I can second that notion, sounds like a business expense to me :D
08:41 trone joined #mojo
08:42 sri gonna have to wait for the new rMBPs i suppose
08:43 sri until then you're responsible for performance sensitive bugs ;p
08:46 * sri almost ordered a 12" macbook... but just couldn't get past the upgrade prices
08:46 jberger in the meantime, we (Exodist and I) can proceed with Test2 testing
08:48 sri this is it btw. https://github.com/kraih/mojo/blob/master/lib/Mojo/Reactor/EV.pm#L61
08:49 sri EV is opinionated regarding recurring timers, it doesn't allow 0
08:50 jberger interesting
08:50 jberger is that the minimum granularity?
08:50 sri it does allow a 0 non-recurring timer though
08:51 jberger could we install a timer and recurring?
08:51 jberger seems a little overkill perhaps
08:51 sri i'm sure there are unlimited possibilities for tests that work
08:52 sri should be trivial to find something better when you can test it
08:52 ladnaV joined #mojo
08:57 sri like, just test the next_tick with a $next_tick++ and have a timer stop the loop or so
08:57 sri endless scenarios that achieve the same test coverage
09:00 jberger will do, we have the Test2 meeting right now, so it'll be just a bit
09:07 sri wow, opera is finally doing something interesting with their browser again https://www.youtube.com/watch?v=OgOsu2PipmE
09:24 sri completely forgot i opened this pull request https://github.com/makamaka/JSON-PP/pull/10
09:24 sri JSON::PP is really badly maintained
09:25 Lee sri: https://twitter.com/lee_a_j/status/719866557342621696
09:31 jberger Lee: we have someone here at QAH who is in contact with makamaka
09:31 Lee excellent
09:31 jberger shall I ask this question?
09:31 Lee i think it's worth asking, yes
09:49 McA2 joined #mojo
10:00 McA joined #mojo
10:03 inokenty-w joined #mojo
10:14 kaare joined #mojo
10:24 CHYC Mojo::Pg developers, may I please ask that you look at the following proposal?: https://gist.github.com/chy-causer/cd1a151db9b21c278a10f8a2f363868b
10:31 sri CHYC: i actually thought about something like that before :)
10:33 CHYC Was there a show-stopping flaw  when you thought about it originally?
10:33 sri the interface would be consistent with other Mojo modules though
10:33 sri $pg->expanders({}) and $pg->add_expander(foo => sub {...})
10:33 sri like we do for everything in mojolicious basically
10:33 sri big show stoppers might be performance
10:34 sri and code complaxity
10:34 sri s/a/e/
10:34 CHYC I actually modelled $pg->expander on the stash!
10:34 CHYC But I'm happy to go with $pg->add_expander :)
10:35 sri yea, the api is a very minor concern
10:35 sri https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Results.pm#L42
10:35 sri the current version is already very complex
10:37 CHYC Hmm, yes I agree.
10:37 sri so to sum it up, i'm neutral on the proposal
10:37 sri my vote will depend on the quality of the code
10:38 sri right now i only really care about json personally, but if pluggable expanders make the code better, i'd give it a +1
10:39 sri jberger recently brought the topic up for booleans
10:39 sri and someone started with all the different number formats... that got me a little nervous
10:39 sri because there's also the problem of where to draw the line
10:40 sri like, what should DBD::Pg handle and what should Mojo::Pg handle
10:41 CHYC Difficult call, but if you "$pg->add_expander( bigint => sub { 0 } );", that's your lookout.
10:41 sri CHYC: btw. i appreciate the detailed proposal
10:41 sri i'm sure jberger will have something to say about the topic later too
10:42 CHYC OK thanks, I will wait for jberger's input.
10:46 Vandal joined #mojo
11:06 jberger I didn't need to progress with booleans because I could do it in my query to export it as json
11:06 jberger select to_json(table.aboolean)
11:12 jberger from there mojo-pg notices it as json and gives me true and false literals
11:12 jberger (by literal I mean Mojo::JSON::true/false)
11:29 jberger Lee: can you join #perl-qa to discuss makamaka?
11:30 Lee jberger: done
11:39 dod joined #mojo
11:55 asarch joined #mojo
12:47 gizmomathboy joined #mojo
12:48 CHYC jberger: Sure, that's one way of doing that. Perhaps one that's harder to workaround is "SELECT 9223372036854775807::bigint". This will be returned as a string. Anyone doing arithmetic work on that will have loss of precision. Much better to have the query return a Math::BigInt object.
12:57 tchaves joined #mojo
13:00 Atog joined #mojo
13:02 ramortegui joined #mojo
13:06 Kripton joined #mojo
13:14 cpan_mojo Mojo-Webqq-1.7.8 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.7.8
13:17 PryMar56 joined #mojo
13:19 cpan_mojo Mojo-Weixin-1.1.1 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.1.1
13:23 good_news_everyon joined #mojo
13:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwWsm
13:23 good_news_everyon mojo/master f49a33a Sebastian Riedel: fix a few timing bugs in tests
13:23 good_news_everyon left #mojo
13:23 sri jberger: giving it a try since you're not doing it, but can't test
13:23 jberger I can run them, sorry I've been in discussions on things
13:25 jberger yes that fixes it
13:25 jberger sri++
13:57 punter joined #mojo
14:02 sri good
14:25 sri hmm, i sometimes want to have custom descriptions for minion workers
14:25 sri to mention stuff like the queues they watch
14:26 sri can be hard to differentiate them when you have more than one on a box
14:29 punter Has anyone used Ubuntu 16.04 ?
14:30 jnbek I haven't used Ubuntu since 7.04
14:30 punter what do you use jnbek ?
14:31 jnbek I am an ardent Arch Linux and FreeBSD user. Arch for the desktop, FreeBSD for the server.
14:33 punter In what ways is that better than Ubuntu?
14:41 sri had this in my minion fork, but used it so much that i think it belongs in mainline too https://github.com/kraih/minion/commit/bab73c2354d18dd39f4155e79202ff77247d09dd
14:42 marty joined #mojo
14:47 nicomen punter: sure since january or so, why?
14:48 punter nicomen: I had difficulty enabling bash autocomplete, but found it: I should install the bash-completion package
14:50 jberger sri: oh I like that optional argument mechanism
14:50 jberger or $3 is null
14:50 jberger I might start using that at $work
14:50 nicomen punter: ah
14:51 nicomen punter: even for simple auto-complete? or just for more advanced stuff?
14:51 punter nicomen: for more advanced stuff, like autocompletion of the parameters of git
14:51 nicomen ah ya
14:52 punter All that, on Ubuntu server
15:00 lluad joined #mojo
15:19 bobkare joined #mojo
15:33 asarch joined #mojo
15:47 a6502 hmm.. quick question: in a Mojo::Pg query callback, how do I check for sqlstace 40001 or 40P01.. I now have a quick hack matching the error string but that does not feel very future proof..
15:48 sri jberger: i was very happy when i discovered that postgres can just optimize that out for the query plan :)
15:49 jberger oh nice
15:49 jberger a6502: sqlstace?
15:50 a6502 eh.. sqlstate.. $sth->state in plain dbd::pg
15:51 Grinnz_ a6502: $results->sth->state
15:54 a6502 ah... looking at the code $results should always be defined there..
15:54 a6502 Grinnz_: thx
16:56 dod joined #mojo
17:11 disputin joined #mojo
17:28 marty_ joined #mojo
17:39 user_5458 joined #mojo
17:42 plicease joined #mojo
17:46 user_5458 https://nopaste.me/view/e580b8ce
17:46 user_5458 Mojo::Reactor::Poll: I/O watcher failed: Can't call method "res" on an undefined  value at C:/Perl64/site/lib/Mojolicious/Controller.pm line 222.
17:47 user_5458 return $self->render(json => 'Error #2'}, status => 404) if not defined $result;         <-- never triggered but $result is not defined.
17:47 user_5458 I cant find the problem ?
17:48 batman could it be the classic $ua out of scope issue?
17:48 sri http://mojolicious.org/perldoc/Mojolicious/Controller#tx
17:49 user_5458 $ua is global defined
17:52 user_5458 i don't think the code has an error actually
18:09 trone joined #mojo
18:22 user_5458 i think something else is out of scope, but i have no clue
18:23 mspo left #mojo
18:38 good_news_everyon joined #mojo
18:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwlnH
18:38 good_news_everyon mojo/master 5685407 Sebastian Riedel: much better sponsorship section
18:38 good_news_everyon left #mojo
18:49 user_5458 Copied this from the tutorial
18:49 user_5458 https://nopaste.me/view/23d88b3c
18:49 user_5458 it gives error
18:58 mcsnolte joined #mojo
19:03 user_5458 .$tx is the problem
19:05 user_5458 but how can i fix it
19:15 pink_mist copied from which tutorial?
19:16 punter joined #mojo
19:19 pink_mist http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Backend-web-services doesn't do what you
19:19 pink_mist 're doing
19:21 user_5458 It was not entirely copied, I figured out the problem is  if($tx->success) { $self->render(text => ..); }
19:22 user_5458 But I'm looking for an answer to understand why it doesn't work
19:22 pink_mist it's $self->render() that needs access to $self's ->tx, but that one has already been destroyed because it is a weak ref. you need to take a strong ref to it.
19:23 user_5458 so it's an out of scope problem
19:25 pink_mist before the callback, do: my $ctx = $self->tx; and inside the callback, make sure you use $ctx in some way, for example by undef'ing it: undef $ctx;
19:25 pink_mist (don't do that until the end though!)
19:31 user_5458 Thanks for the info, the error is gone
19:31 user_5458 But it's does not render with $self->render?
19:32 pink_mist what do you mean? it certainly should
19:32 sri because your browser closed the connection, that's the real problem
19:33 pink_mist d'oh
19:33 sri the transaction vanishes with the connection, as the docs i linked to earlier say
19:33 user_5458 it's right you showed the docs, but i still did not understand it
19:34 user_5458 so what's the solution for this? Do not render inside if($tx->succes) { }?
19:34 user_5458 set a var which is checked outside and then render?
20:07 basic6_ joined #mojo
20:15 ZoffixMobile joined #mojo
20:15 jabberwok i am working with a front-end guy, we are trying to create a single-page-web-"app" that has screens that require login.
20:16 jabberwok because the front-end and the Mojo back-end are coming from different hosts, it seems we can't use cookies.
20:17 jabberwok he says oauth2 should work, but ... i can't understand how it all works.  http://wlindley.com/20160421-notes.html are how far i have gotten.
20:17 jabberwok and then i discover Net::OAuth2::AuthorizationServer does not implement the "implicit grant" that it looks like we need?
20:17 jabberwok or am i completely doing this wrong
20:18 Grinnz_ that sounds super overcomplicated. why are they coming from different hosts?
20:18 jabberwok because we want one backend to serve multiple frontends
20:19 jabberwok without playing footsie with dns
20:19 sri jabberwok: and you can't just use CORS?
20:19 Grinnz_ playing with dns would end up being far simpler IMO
20:19 jabberwok sri: i implemented cors, but apparently code served from server "A" can't access cookies coming from server "B"
20:20 sri xhr.withCredentials = true; and Access-Control-Allow-Credentials: true?
20:21 sri (i've not done that)
20:22 Grinnz_ https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials
20:22 Grinnz_ maybe?
20:23 jabberwok thanks Grinnz_ that may help significantly.
20:32 user_5458 $c->delay is what i needed
20:57 good_news_everyon joined #mojo
20:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwl9r
20:57 good_news_everyon mojo/master 5038a1b Sebastian Riedel: allow Mojo::Server::Daemon to log when a connection has been closed prematurely
20:57 good_news_everyon left #mojo
20:58 sri this might be great or terrible
20:58 sri not sure yet
20:59 sri it has become such a common problem
20:59 sri and i don't like how people just throw delays at it without understanding what's going on
21:05 good_news_everyon joined #mojo
21:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwlHb
21:05 good_news_everyon mojo/master 4573fdc Sebastian Riedel: just log directly
21:05 good_news_everyon left #mojo
21:12 genio sri: http://gizmodo.com/a-liquid-cooled-2-in-1-and-the-other-coolest-shit-acer-1772318891 see any new machines there you like?
21:13 sri lol
21:14 * genio is still trying to understand the point of a liquid cooled laptop
21:15 sri less noise than fans?
21:15 Grinnz_ genio: quieter, usually
21:15 Grinnz_ also more flexibility for heatsink placement
21:15 genio but there's not enough radiator room to make it purposeful.
21:15 Grinnz_ yeah, dunno about that
21:15 genio you end up with really hot water and no transfer
21:15 genio s/water/liquid/
21:16 sri they are all ugly too
21:17 PopeFelix Bragging rights?
21:17 Grinnz_ i mean, yeah, it sounds cooler :P
21:18 * Grinnz_ will stick with liquid cooling his deskto
21:18 Grinnz_ +p
21:18 PopeFelix As for delays, I've only ever used them artificially.
21:19 PopeFelix So I've a decent idea of how it works in the artificial context I created, but that's it. :)
21:21 disputin joined #mojo
21:21 good_news_everyon joined #mojo
21:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwldI
21:21 good_news_everyon mojo/master ebed13f Sebastian Riedel: fix link to event
21:21 good_news_everyon left #mojo
21:22 genio As for good news, Mr. Robot comes back on July 13th.  Only a few months!
21:25 good_news_everyon joined #mojo
21:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vwldy
21:25 good_news_everyon mojo/master c7cea5f Sebastian Riedel: remove deprecated xss_escape function from Mojo::Util
21:25 good_news_everyon left #mojo
21:36 disputin joined #mojo
22:27 sri jberger: please review https://github.com/kraih/mojo/commit/5038a1b7bb395a840d78ca21839e9981f110221b
22:28 jberger ?
22:28 jberger there isn't much there
22:28 sri easy review then :)
22:32 meshl joined #mojo
22:33 disputin joined #mojo
22:44 marty joined #mojo
22:47 sri jberger: mostly wondering if it's the right solution
22:49 jberger oh simply logging vs something else
22:52 disputin joined #mojo
22:54 disputin joined #mojo
22:54 marty joined #mojo
22:59 marty_ joined #mojo
23:00 jberger sri: ping to query
23:06 bpmedley http://bmedley.org/mojo.pdf <-- Anyone have time, and can skim this?
23:07 bpmedley I added a chat app.  So, there are three apps and some introductory material.

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