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

IRC log for #mojo, 2014-12-04

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

All times shown according to UTC.

Time Nick Message
00:00 dvinciguerra joined #mojo
01:01 dotan joined #mojo
01:04 d4rkie joined #mojo
01:04 absolut__ joined #mojo
01:05 Gedge_ joined #mojo
01:05 bc547 joined #mojo
01:05 augensalat joined #mojo
01:05 callumgare joined #mojo
01:05 mattp_ joined #mojo
01:05 noganex joined #mojo
01:05 ryanc joined #mojo
01:06 bpmedley joined #mojo
01:06 memowe joined #mojo
01:08 Snelius joined #mojo
01:09 jkramer joined #mojo
01:09 ashimema joined #mojo
01:24 * jberger is finally home!
01:31 sri o/
01:36 sri or am i missing something? https://github.com/kraih/minion/issues/6#issuecomment-65522921
02:01 klapperl_ joined #mojo
02:26 akhasanov joined #mojo
02:29 zivester joined #mojo
02:47 odc joined #mojo
02:49 zivester joined #mojo
02:59 klapperl joined #mojo
03:14 zivester joined #mojo
03:20 noganex_ joined #mojo
03:51 nicomen joined #mojo
04:23 zivester joined #mojo
04:30 zivester joined #mojo
04:42 * jberger uses the excel backend all the time
04:43 * jberger ducks
04:44 akhasanov joined #mojo
04:53 * nicomen gooses
04:59 * dabudabu turtle doves
05:21 Snelius zoo channel
05:21 * Snelius facepalm
05:21 purl Oh geez, not this shit again.
05:31 zivester joined #mojo
05:42 zivester joined #mojo
05:52 akhasanov joined #mojo
06:06 rem_lex| joined #mojo
06:09 tianon purl: botsnack!
06:09 purl :)
06:55 ver joined #mojo
07:01 dod joined #mojo
07:25 marmez joined #mojo
07:28 jamesaxl joined #mojo
07:30 Eke- joined #mojo
07:31 absolut_todd joined #mojo
07:31 sugar joined #mojo
07:33 denis_boyun joined #mojo
07:43 sugar_ joined #mojo
07:44 absolut__ joined #mojo
07:48 sugar__ joined #mojo
07:54 basiliscos joined #mojo
08:01 eseyman joined #mojo
08:10 cosimo joined #mojo
08:17 trone joined #mojo
08:21 Vandal joined #mojo
08:34 dotan joined #mojo
08:56 amon joined #mojo
08:57 denis_boyun joined #mojo
09:10 wim joined #mojo
09:25 cosimo joined #mojo
09:30 wim joined #mojo
09:41 wim joined #mojo
09:49 nicomen downloadin atom editor, 60mb, did they include internet in it too?
10:03 wim joined #mojo
10:04 fhelmberger joined #mojo
10:05 zivester joined #mojo
10:20 neyasov joined #mojo
11:25 alnewkirk joined #mojo
11:27 woz joined #mojo
12:03 neilhwatson joined #mojo
12:04 cosimo joined #mojo
12:26 denny joined #mojo
13:11 jamesaxl joined #mojo
13:19 bwf joined #mojo
13:25 dvinciguerra joined #mojo
13:37 romkaspb joined #mojo
13:37 romkaspb hi
13:37 purl bonjour, romkaspb.
13:38 romkaspb need your help, guys. i want to detect, was request for static file (i mean, for example /img/file.png), or dynamic? (/catalog)
13:39 ignacio_ joined #mojo
13:39 romkaspb i havent found somthing about it in google
13:39 romkaspb (
13:42 romkaspb in my case, i have dbi connection if before_dispatch hook
13:43 romkaspb and i got a functions, that detects 301 redirect (from table in mysql)
13:43 romkaspb i want to skip connect|disconnect in my logs if request was for static file
14:00 Lee_ joined #mojo
14:02 Lee joined #mojo
14:03 tbushell joined #mojo
14:03 tbushell left #mojo
14:29 * sri yawns
14:31 genio stop it.  robots do no such thing
14:32 * genio pushes purl down the stairs
14:32 purl Hey! *thump* ow! *bang* argh! *bam* son of a *thump* *crunch* whimper...
14:33 Lee left #mojo
14:33 Lee joined #mojo
14:33 asarch joined #mojo
14:37 marty joined #mojo
14:59 Grinnz romkaspb, i had a similar problem, i ended up making a parent route (using ->under) to put all my dynamic routes under
15:00 Grinnz static files would not go through that route
15:01 romkaspb i'
15:01 romkaspb i'll try, thanzx
15:39 davido_ joined #mojo
15:41 Eke- joined #mojo
15:50 Adura joined #mojo
16:16 Ptolemarch joined #mojo
16:24 Grinnz_ this may sound a little crazy, but is there any way i can start my mojo app within a fastcgi script and call a certain controller? kind of like one would do with Test::Mojo, but without the testing stuff
16:25 Grinnz_ basically need to duplicate some functionality between the mojo app and fastcgi scripts for the next month or so...until other people have time to migrate
16:37 stephan48 would it be possible to create a wildcard route?
16:55 lb yes, depending on what you mean
16:56 Grinnz_ sure, /*whatever, and set whatever => '' in to()
17:00 jamesaxl joined #mojo
17:01 stephan48 joined #mojo
17:03 hoppie joined #mojo
17:05 hoppie Hi all. I have tried unsuccessfully to ++ed various Perl modules I've used. Is there some steps one must follow to ++ed perl modules on CPAN?
17:06 sri you want to ask #metacpan
17:07 hoppie sri, thank you
17:17 axlrose joined #mojo
17:22 jamesaxl joined #mojo
17:31 mattastrophe joined #mojo
17:32 sh4 joined #mojo
17:34 Ptolemarch joined #mojo
17:35 wim joined #mojo
17:36 axlrose joined #mojo
17:46 dod joined #mojo
18:07 Ptolemarch joined #mojo
18:11 hoppie left #mojo
18:28 neyasov joined #mojo
18:57 sri this looks cool https://github.com/citusdata/pg_shard
19:11 akhasanov joined #mojo
19:47 sugar joined #mojo
19:59 sugar_ joined #mojo
20:01 mgrimes joined #mojo
20:01 sri any other opinions about what Minion should be optimized for? https://github.com/kraih/minion/issues/6#issuecomment-65689395
20:02 denis_boyun joined #mojo
20:10 sri looks like pg_shard is the real deal :o http://www.databasesoup.com/2014/12/whats-this-pgshard-thing.html
20:38 dod joined #mojo
20:46 tempire um
20:47 tempire I can't seem to get "The signatures feature is experimental" to go away.
20:47 tempire I must be missing something simple.
20:55 genio use experimental 'signatures'; ?
20:55 tempire doesn't stop the warning
20:56 sri you goober
20:57 sri i bet you did the same thing i did, and accidentally re-enabled warnings afterwards ;p
20:58 sri always put "use experimental 'signatures';" last
21:01 linagee joined #mojo
21:02 linagee is there a way to provide Oauth2 from Mojolicious?
21:10 tempire linagee: there are plugins that make it easier
21:22 tempire yep.
21:22 tempire That was it.
21:22 * tempire goobs
21:30 dvinciguerra joined #mojo
21:36 mgrimes joined #mojo
21:43 mgrimes joined #mojo
21:56 linagee with Mojolicious::Lite, how do I match routes on two different things? (so it matches if the last thing is there or not)
21:56 linagee /:database/:table/:key   (and I want :key to be optional)
21:59 linagee like this maybe? my $subthing = sub {...}   get '/:database/:table/:key' => \$subthing; get '/:database/:table/' => \$subthing;
21:59 marty joined #mojo
21:59 marty joined #mojo
22:03 firnsy linagee: http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Optional-placeholders
22:04 Grinnz_ (it is rather unintuitive that setting a default makes a placeholder optional, but it works)
22:05 sri Grinnz_: you're welcome to propose something more "intuitive"
22:05 Grinnz_ if i knew that, i would propose it ;)
22:06 firnsy Grinnz_: unintuitive for some ;) ... i can't see any wiggle room in that reference for misinterpretation
22:06 sri also, why have a default value if a placeholder is not optional?
22:07 sri personally, i find it very intuitive
22:08 Grinnz_ it makes sense when you think about it, but that's not the same thing as intuitive
22:08 linagee Grinnz_: I wish I understood that. I'm just a mojolicious newb. :(
22:09 linagee Grinnz_: controller and action are beyond my limited Mojolicious::Lite vocab
22:09 sri http://mojolicio.us/perldoc/Mojolicious/Lite#Optional-placeholders
22:09 Grinnz_ linagee: i think you may have meant someone other than me, i didn't link anything :P
22:10 linagee sri: AHA. thanks!!!
22:10 linagee Grinnz_: ah yes. firnsy originally.
22:10 firnsy Grinnz_: we'll have to agree to disagree :P
22:10 firnsy ...  use enough languages and you'll see the same pattern of setting a default value to make it optional
22:11 Grinnz_ firnsy: i've never encountered that pattern
22:11 firnsy Grinnz_: you need to get out more
22:11 Grinnz_ Getopt::Long for example... doesn't do this
22:12 Grinnz_ can't think of many other places it would be applicable :)
22:12 firnsy any method implementation in most languages?
22:13 firnsy python ... def info(object, spacing=10, collapse=1):
22:13 Grinnz_ ah, they're fun in PHP, since you can make required parameters after optional ones ;)
22:14 firnsy so you _have_ seen the pattern
22:14 Grinnz_ i don't use PHP voluntarily so it didn't come to mind :P
22:14 Grinnz_ and never used python...
22:15 firnsy well signatures in 5.20 will give you the same power, so maybe you'll see it more often
22:15 Grinnz_ either way... $var=default is very different-looking from $var ... somewhere else... var => default
22:15 firnsy same thing can be done in c++
22:16 Grinnz_ but in this case, the name is in the route string, so defining defaults in there could get messy :P
22:17 firnsy a "hello world" example can get messy
22:18 Grinnz_ '/:var=asdf/...' possible, but limits your defaults to strings...
22:18 Grinnz_ and doesnt make much sense with stuff after it
22:20 firnsy Grinnz_: you're overthinking it
22:20 Grinnz_ hmm?
22:21 firnsy ... or perhaps i misunderstood what you consider the unintuitive part
22:21 firnsy setting a default to make it optional == intuitive
22:22 firnsy how do i set a default value == hmm, new framework let me look that up
22:22 Grinnz_ perhaps
22:22 firnsy ... "wow! this framework has DOCS!!! winning!!!!!!1one!"
22:22 Grinnz_ i know if i saw /:var=asdf i would be a little clearer on what's going on
22:23 Grinnz_ but idk... just seems weird in the context of URLs, i guess
22:23 good_news_everyon joined #mojo
22:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ISTeOw
22:23 good_news_everyon mojo/master 7572622 Sebastian Riedel: fixed parent combinator bug in Mojo::DOM::CSS
22:23 good_news_everyon left #mojo
22:25 Grinnz_ i don't know if there's a way to represent "optional parameter in URL" that would be totally intuitive
22:26 sri i want my default value to be undef
22:26 Grinnz_ that would be the problem with the in-string default :P
22:40 jberger sri: '/:thiny=@{[undef]}'
22:40 * jberger runs
22:41 jberger sri: got another case of "t/mojo/bytestream.t ........................ Undefined subroutine &Sub::Util::set_subname called at /Users/lconrad/.cpan/build/Mojolicious-5.68-gqRFx3/blib/lib/Mojo/Util.pm line 127, " today
22:42 jberger :-(
22:43 sri you goober
22:44 sri i kinda like saying that
22:46 sri jberger: now try finding out how you actually got there!
22:46 jberger working on that
22:46 sri don't just reinstall
22:46 Grinnz_ lol
22:46 sri like, does weaken actually work with that perl
22:47 jberger so obviously the line is: https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L31
22:47 jberger but should it eval require a specific version
22:47 jberger namely 1.40
22:47 sri why?
22:47 jberger my $NAME = eval 'use Sub::Util 1.40; 1' ? \&Sub::Util::set_subname : sub { $_[1] };
22:48 sri Sub::Util never existed without it
22:48 jberger https://metacpan.org/pod/Sub::Util#subname
22:48 jberger https://metacpan.org/pod/Sub::Util#set_subname
22:48 jberger since 1.40
22:48 sri the whole module is 1.40+
22:49 jberger cpanm -f Sub::Util fixed it
22:49 sri ...
22:49 jberger it was a coworker and he had done that before I could stop him
22:49 * Grinnz_ pictures jberger doing a slo-mo "NOOOOOOOOOOOOOO!" leap across the room
22:49 jberger leap across the interwebs
22:50 sri my theory is that some goober upgrades perl without reinstalling xs modules
22:50 rem_lex joined #mojo
22:50 sri a test if Scalar::Util::weaken works would have confirmed that...
22:51 jberger Scalar::Util::weaken has been around forever, no?
22:53 sri the important part is weaken requires XS, and both share the same XS file http://api.metacpan.org/source/PEVANS/Scalar-List-Utils-1.41/ListUtil.xs
22:55 Grinnz_ the C code! i'm blinded!
22:55 jberger my guess would be a vanilla installation of 5.16.3
22:56 jberger my new coworkers don't seem to be the "upgrade-perl-in-place" type
22:56 sri now we'll never know :(
22:58 sri actually could also be a funny dual-life module thing
22:58 sri like, it loads the 1.40 .pm file and the 1.3x XS
22:58 sri (no, i don't have a clue how somethign like that might happen)
22:59 davido__ joined #mojo
23:00 jberger my $NAME = eval 'use Sub::Util; \&Sub::Util::set_subname' || sub { $_[1] };
23:00 sri if we knew weaken wouldn't just fail in strange ways i might agree with that change
23:01 sri but -1 on guessing
23:01 jberger same
23:01 jberger ok, well, now I have a clear idea of what to do the next time I see it
23:01 jberger I'm guessing its not going to be the last time
23:01 Grinnz_ reinstall all the things before anyone can debug it!
23:02 sri upgrade the perl in place to see what happens ;p
23:02 sri or even downgrade
23:02 jberger sri: if your theory is right (1.4 pm, 1.3 xs) then probably weaken is fine
23:05 sri and it will report to be 1.4
23:06 sri in any case, we would know
23:06 sri either a) screwed anyway, or b) the workaround works
23:09 jberger my (semi-)proposed fix would work, if the symbol exists, use it, otherwise don't
23:11 jberger hmmmm, though, now I'm not sure
23:11 jberger my $NAME = eval 'use Sub::Util; Sub::Util->can("set_subname")' || sub { $_[1] };
23:13 jberger in fact, you don't even need string eval in that case
23:13 jberger my $NAME = eval {require Sub::Util; Sub::Util->can("set_subname")} || sub { $_[1] };
23:15 good_news_everyon joined #mojo
23:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/HNnIGw
23:15 good_news_everyon mojo/master 24166be Sebastian Riedel: mention that ojo changes the MOJO_LOG_LEVEL environment variable
23:15 good_news_everyon left #mojo
23:16 sri no point guessing
23:25 linagee In Mojolicious::Lite, is it possible to get a hash of all params?
23:28 linagee $self->params seems to return out an array of values. What if I don't want to have to then run $self->params('each_value')
23:31 Grinnz_ its usually a bad idea to get "all params" regardless of framework
23:32 cfedde slight syntax difference between $hash{'param'} and $self->params('param');
23:32 linagee Grinnz_: so its going to hidden and abstracted to me? arghhhh
23:32 Grinnz_ didn't say that... it might still have an easy answer, but its still a bad idea :P
23:33 Grinnz_ try $c->params->to_hash
23:34 Grinnz_ or rather... $c->req->params->to_hash
23:34 cfedde my $hash  = $c->req->params->to_hash; # from the doc
23:35 cfedde https://metacpan.org/pod/Mojolicious::Controller#req
23:36 punter joined #mojo
23:36 denis_boyun joined #mojo
23:38 firnsy linagee: what is $self in the context of your question?
23:41 good_news_everyon joined #mojo
23:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/VhsOPg
23:41 good_news_everyon mojo/master 1bb1a25 Sebastian Riedel: more diverse parameter examples
23:41 good_news_everyon left #mojo
23:41 Ptolemarch joined #mojo
23:50 * linagee tries to just dump $self. hehehee. :-D
23:56 callumgare_ joined #mojo
23:58 linagee haha!
23:58 linagee my %test_hash = @{$self->req->params->params};
23:58 linagee found it. :-D
23:58 Grinnz_ erm... what was wrong with to_hash?

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