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

IRC log for #mojo, 2014-07-11

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

All times shown according to UTC.

Time Nick Message
00:00 d4rkie joined #mojo
00:25 HtbaaPi joined #mojo
00:57 good_news_everyon joined #mojo
00:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/2OuWxw
00:57 good_news_everyon mojo/master 1622b49 Sebastian Riedel: slightly faster pseudo classes
00:57 good_news_everyon left #mojo
01:02 laouji joined #mojo
01:05 Averna joined #mojo
01:13 d4rkie_ joined #mojo
01:17 nishttal2 joined #mojo
01:45 klapperl joined #mojo
01:45 good_news_everyon joined #mojo
01:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/K6YB6Q
01:45 good_news_everyon mojo/master 7d86af2 Sebastian Riedel: rewrite selector a little differently
01:45 good_news_everyon left #mojo
01:53 rGeoffrey_ joined #mojo
02:12 d4rkie joined #mojo
02:42 good_news_everyon joined #mojo
02:42 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ThnMjA
02:42 good_news_everyon mojo/master 639e5c8 Sebastian Riedel: small optimization
02:42 good_news_everyon left #mojo
02:49 JohnDRockefeller joined #mojo
03:18 Eke- joined #mojo
03:30 KCL_ joined #mojo
03:33 disputin joined #mojo
03:38 basic6_ joined #mojo
03:41 * firnsy wonders if the File backend for Minion would be better sitting under a Mojolicious::Lite app
03:42 firnsy ... then you could replace it with a Minion::Backend::Mojo
03:48 firnsy it would remove the existing blocking constraints of the ::File backend
03:56 sri the point of the file backend was that it's easy to get started
03:56 sri it was never meant to be really used for anything serious
03:58 gatitskiy joined #mojo
04:00 firnsy sri: agreed, and also usable in non-Mango environments right?
04:04 sujithm joined #mojo
04:21 sri that's not really a goal
04:21 sri the file backend does not scale at all... for anything else than tiny setups it's unusable
04:38 firnsy understood, i'll embrace my naivety and see where the idea leads me
04:49 good_news_everyon joined #mojo
04:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/K1rdng
04:49 good_news_everyon mojo/master f7ea445 Sebastian Riedel: simplify connection handling
04:49 good_news_everyon left #mojo
04:53 sri funny perl bug in the old code, that $new is never actually initialized https://github.com/kraih/mojo/blob/639e5c8675939fead12f27c36ad6a09176d6fc82/lib/Mojo/UserAgent.pm#L273
04:55 sri or is that not a bug?
04:56 sri i always assumed the $new declaration in the condition belongs to that block alone
04:58 sri i guess that's not true... interesting
04:58 sri perl -E 'use warnings; use strict; if ((my $x = 0) > 1) { say "test" } else { say $x }'
05:00 firnsy returns 0 for me, is that what you're expecting?
05:00 sri i did not, but that's what happens
05:01 firnsy ah you're saying you expected it to be contained to the "if" block and not the "else" blco
05:01 firnsy *block
05:11 gatitski_ joined #mojo
05:15 laouji joined #mojo
05:49 sri it might be an accidental feature
05:49 sri because
05:49 sri perl -E 'use warnings; use strict; if ((my $x = 0) > 1) { say "test" } else { my $x = 2; say $x }'
05:50 sri there is no declaration in same scope warning
05:51 sri and
05:51 sri perl -E 'use warnings; use strict; if ((my $x = 0) > 1) { say "test" } elsif ((my $x = 1) > 2) { say "tset" } else { my $x = 2; say $x }'
05:52 sri that one does produce a warning
05:53 sri looks like the if/esif conditions have their own shared scope above the blocks
05:56 gatitskiy joined #mojo
05:59 sujithm joined #mojo
06:10 good_news_everyon joined #mojo
06:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/cku5dA
06:10 good_news_everyon mojo/master 3805fc1 Sebastian Riedel: Mojo::UserAgent does not croak anymore
06:10 good_news_everyon left #mojo
06:24 Eke- joined #mojo
06:30 sujithm joined #mojo
06:39 denis_boyun joined #mojo
06:39 gatitskiy joined #mojo
06:46 gatitskiy joined #mojo
06:50 kyshtynbai joined #mojo
06:55 denis_boyun_ joined #mojo
07:03 dod joined #mojo
07:03 dod joined #mojo
07:04 sugar joined #mojo
07:07 rawler joined #mojo
07:07 denis_boyun joined #mojo
07:08 eseyman joined #mojo
07:10 denis_boyun_ joined #mojo
07:10 basiliscos joined #mojo
07:25 trone joined #mojo
07:25 chankey joined #mojo
07:26 chankey I have to find if any span tag's content has newline in beginning. I am trying this: $dom->find('span')->each(sub {if(shift->text =~ /^\n/){print "Found new line\n";}}); but this is not working, the reason I think is the autotrimming done by Mojo::DOM, how can I disable auto trimming?
07:28 dod joined #mojo
07:28 denis_boyun joined #mojo
07:31 denis_boyun_ joined #mojo
07:34 go|dfish chankey: ->text(0)
07:34 go|dfish http://mojolicio.us/perldoc/Mojo/DOM#text
07:42 denis_boyun joined #mojo
07:44 chankey go|dfish: Oh yes, thanks!
07:48 bobkare joined #mojo
07:48 gatitskiy joined #mojo
07:51 go|dfish chankey: each() also populates $_ in the sub for you, so you can do $_->text(0) instead of shifting
07:56 chankey go|dfish: ok
07:58 Insane could i include one mojo template in another? in sace if i want to render templateA which contains templateB contents with additional html
07:58 Insane case*
08:00 go|dfish Insane: perhaps you're looking for http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Including_partial_templates
08:05 sujithm joined #mojo
08:09 gatitskiy joined #mojo
08:12 Vandal joined #mojo
08:24 dod joined #mojo
08:26 igorsutton joined #mojo
08:29 Ralesk is it possible to use Hypnotoad with a non-Mojo PSGI / Plack::Builder kind of app, and, in particular, use Hypnotoad to serve HTTPS in this situation?
08:29 Ralesk I see that it takes configuration from the mojo app's config
08:32 Ralesk coworker wanted to do things low-level and w/o a framework, so that's what we have. recent Starman (which supposedly does TLS) however requires Module::Build::Tiny which has like 29384729384 dependencies I don't want to have to package for our distro x.x
08:36 ladnaV joined #mojo
08:46 sujithm_ joined #mojo
08:48 D4RK-PH0ENiX joined #mojo
08:53 sujithm joined #mojo
08:53 edestler joined #mojo
09:48 mr-foobar joined #mojo
09:49 denis_boyun joined #mojo
10:09 da5id joined #mojo
10:09 Jonis jberger: I came across your json_like gist, any reason it's not in Test::Mojo?
10:15 d4rkie_ joined #mojo
10:22 hahainternet joined #mojo
10:34 dvinciguerra joined #mojo
10:35 sujithm joined #mojo
10:37 meshl joined #mojo
10:38 _eugen joined #mojo
10:44 chankey I want to check if starting of span tag's content has newline or not. $dom->find('span')->each(sub {if(shift->text(0) =~ /^\n/sg){print "Found new line in $fname\n"; }}); doesn't seem to help. What wrong am I doing?
10:50 chankey it finds it on first file, but not in second, whereas both files have same content.
10:52 mr-fooba_ joined #mojo
10:54 neilhwatson joined #mojo
10:56 al joined #mojo
11:00 go|dfish chankey: well if it works on one file but not the other, that suggests the files do not have the same content
11:10 chankey go|dfish: yeah, one was created in windows, one in linux :/
11:11 go|dfish ah right, so it probably has '\r\n' not '\n'
11:11 chankey yes, did search and replace like this perl -pi -e 's/\R/\012/' and it worked
11:35 gatitskiy joined #mojo
11:38 TitanOfOld joined #mojo
11:47 jberger Jonis: no idea
11:47 purl hmmm... no idea is http://jays.net/images/noidea.jpg
11:49 jberger I think it was more like, we had to stop somewhere
11:49 jberger So we made it easier to do ephemeral methods
11:51 Jonis ah, ok
11:57 mr-foobar joined #mojo
11:57 jberger Could put it on the wish list
11:58 jberger Remember you can always just get the tx out of the test obj, and from there get the json and from there test anything you want
12:19 d4rkie joined #mojo
12:23 Jonis jberger: I've put it on the wish list, and that's what I ended up doing.
12:23 Jonis it's really more of a convenience to have it, but conveniences aren't bad if I'm not the only person who will find a use for it
12:41 d4rkie joined #mojo
12:45 tadamo joined #mojo
12:48 mishantil jberger: thats what we do currentlyg (grabbing the json from tx) and it works fine. Looks ugly though, compared to the other nicely chained tests.
13:05 Claudio joined #mojo
13:08 lipizzan joined #mojo
13:21 bluescreen joined #mojo
13:42 dvinciguerra joined #mojo
13:43 basiliscos joined #mojo
14:05 ryozi joined #mojo
14:06 btyler joined #mojo
14:09 john joined #mojo
14:10 john I'm having some trouble getting the flash/session to work
14:10 john Setting the flash in a stream read event callback doesn't want to play
14:11 john I dare say I'm doing something retarded, but would appreciate some clue
14:12 Lingo joined #mojo
14:13 john http://p.thorsen.pm/134462f8e626
14:13 john is my SSE code
14:14 bluescreen_ joined #mojo
14:14 bluescreen joined #mojo
14:23 john Would I be correct in thinking that long polling doesn't set cookies?
14:26 Mikey does a long poll send any headers before it waits?  it depends also on if the browser throws that response out or does something with the partial response.
14:28 john Dunno.
14:28 Mikey and i've never used long polling, i've used websockets and i've used periodic polling.  so i'm operating under the assumption that usually a long poll is timing out
14:29 Mikey and that the timeout drives the next connection.. this is "comet", right?
14:29 john I'm trying to save the session some time after it starts
14:29 john server side event, using eventsource in javascript
14:30 john not sure if that is comet
14:30 john I'll have a hack
14:33 basic6 joined #mojo
14:39 cooper joined #mojo
14:51 Kripton joined #mojo
14:59 sri Jonis: be more specific!
14:59 hahainternet sri: i have a serious issue to bring up with you
14:59 hahainternet every time i want to use Mojo
14:59 hahainternet someone else demands python
14:59 hahainternet and it's really getting on my tits
14:59 hahainternet please stop making Mojo so attractive
14:59 hahainternet thanks
14:59 genio slap them, tell them to shut up, call it a day
15:00 Ralesk :D
15:01 hahainternet i can't, i'm even doing hardware LED control in python
15:01 hahainternet luckily i have a tiny asterisk project of my own that Mojo is perfecto for
15:01 hahainternet a REST API without having to deal with django-rest-framework
15:02 hahainternet thank Odin
15:02 * genio shudders at the thought of another Django project.
15:02 hahainternet yeah seriously
15:02 hahainternet django itself is barely acceptable
15:02 hahainternet drf despite Tom's best intentions is frustratingly painful
15:03 genio To be honest, I like Python; it's a nice language.  I'm not a fan of Django though
15:03 hahainternet python is ok
15:03 hahainternet the problem i have is that they solve nothing from Perl
15:03 hahainternet they mandate a bunch of requirements, and it makes their language no faster, no more flexible, no nicer to write (imo)
15:03 hahainternet same for ruby
15:04 Mikey it makes newbs follow convention or else.
15:04 Mikey that was a good design decision.
15:04 hahainternet i disagree
15:04 hahainternet Mojo came out of 'DWIM' and timtoady
15:04 gatitskiy joined #mojo
15:04 hahainternet Django came out of 'there should only be one way to do things'
15:05 hahainternet i quite like Go's approach
15:05 hahainternet simply don't provide features that can be used to shoot yourself in the foot
15:05 hahainternet absolute minimalism
15:06 Mikey i'd rather read bad python than bad perl any day
15:06 hahainternet that's fine i'll take the bad perl, you take the bad python
15:06 hahainternet :D
15:13 gatitskiy joined #mojo
15:21 risugg joined #mojo
15:31 KCL joined #mojo
15:31 gatitskiy joined #mojo
15:34 gatitski_ joined #mojo
15:34 sh4 joined #mojo
15:42 punter joined #mojo
15:42 sujithm joined #mojo
15:47 good_news_everyon joined #mojo
15:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/OJ1Uqw
15:47 good_news_everyon mojo/master 0f054c7 Sebastian Riedel: WebSockets always get closed
15:47 good_news_everyon left #mojo
15:51 disputin joined #mojo
15:59 denis_boyun joined #mojo
16:03 Lingo joined #mojo
16:10 Vandal joined #mojo
16:11 denis_boyun joined #mojo
16:12 Dandre joined #mojo
16:18 condor66 hi all, I have a problem with mojo ua post request - it looks like it's passing (correctly) the POST params
16:18 condor66 $self->ua->post($url => $header => $content => $delay_getbalances->begin);
16:18 condor66 i've tried $content to be scalar as well as a hash
16:19 condor66 and I see those params being passed to the server, it looks like server can't see them (or sees them incorrectly)
16:19 condor66 if someone could give me a hand with that would be great
16:21 hahainternet condor66: you need to know that => is just a fat comma
16:21 hahainternet and the way you're using it there is ugly as heck
16:21 hahainternet yes => "hello"
16:21 hahainternet is the same as "yes", "hello"
16:21 hahainternet i guess mojo's examples show that
16:21 gatitskiy joined #mojo
16:21 hahainternet so i should shut up
16:21 hahainternet but god it's ugly lol
16:22 hahainternet but yeah, it all depends on what's in those variables you're sending, all the examples i can see include a 'form' or 'json' section yours does not
16:23 condor66 I know it sometimes differs => from , - no luck after changing it to ,
16:23 hahainternet no it's not that => will cause your problems, it just makes it harder to read what you intend, i realise now that the examples use it
16:23 hahainternet so i should not complain
16:24 condor66 I think using 'constants' with => doesn't work, where does with ',' - got cought on that one day
16:24 hahainternet the question is, what are your variable values
16:24 hahainternet the way => works is it quotes the lhs, and pretends its a comma
16:24 condor66 $content
16:24 purl well, $content is the ->body of the HTTP::Response
16:24 hahainternet so you can use it with barewords
16:24 condor66 $VAR1 = {
16:24 condor66 'nonce' => 1405095693,
16:24 condor66 'method' => 'getInfo'
16:24 condor66 };
16:28 meshl joined #mojo
16:29 condor66 http://pastebin.com/PHpkXMnk
16:30 hahainternet sry condor66 phone
16:30 hahainternet brb
16:50 gatitskiy joined #mojo
16:51 condor66 it's working with other servers this way (sending $content which are post params), it doesn't with one btc-e.com tho, I have a working cpan module for btc-e that's using www::mechanise and that one works - can't see how the params would differ between my code and the www::mechanize one
16:51 condor66 that one works: $mech->post($url, ['method' => 'getInfo', 'nonce' => $nonce]);
16:53 sri http://mojolicio.us/perldoc/Mojo/UserAgent#post
16:55 condor66 a ffsake!, had to define the data is in the 'form'
16:55 condor66 thanks sri, btw the descriptions under mojo methods could be a bit more descriptive
16:55 sri like?
16:56 condor66 it's obvious when you know it, just realized 'form' would give me '[]' enclosure (that could be included in the description)
16:57 sri i have no idea what "'[]' enclosure" means
16:58 condor66 sri: the www::mechanize that was working had post params enclosed in [] which led me to thinking it must be sent as a FORM (one of the post examples from mojo site)
16:58 sri no, i do not believe our documentation should explain mechanize-isms
16:59 sri also http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Content_generators
16:59 sri which also happens to be linked from the Mojo::UserAgent documentation
17:01 condor66 yes, I guess taking shorts when reading docs doesn't pay off, thanks again sri
17:03 * crab wonders why shorts have anything to do with reading documentation
17:11 rem_lex| joined #mojo
17:25 lb taking shorts off
17:28 Eke- joined #mojo
17:41 gatitskiy joined #mojo
17:48 crab mojo's documentation should come with a "please wear pants while reading" warning
17:49 rGeoffrey_ joined #mojo
17:51 gatitskiy joined #mojo
17:56 dod joined #mojo
17:56 gatitskiy joined #mojo
18:10 dod joined #mojo
18:10 disputin joined #mojo
18:23 denis_boyun joined #mojo
18:28 zrusilla1 joined #mojo
18:30 tchaves joined #mojo
18:34 dotandimet joined #mojo
18:35 JohnDRockefeller joined #mojo
18:41 tchaves Could someone point me to a good book about Mojolicious?
18:42 disputin joined #mojo
18:43 tchaves Hello. Could someone point me to a good book about Mojolicious?
18:44 bluescreen_ joined #mojo
18:45 bluescreen__ joined #mojo
18:48 genio tchaves: I'm not sure of a book, but there is the cookbook on the site.
18:48 genio And the documentation is pretty darn good, too.  What are you looking for?
18:50 tchaves Well, I try to learn everything necessary to develop applications with Mojo. Some indication for my learning?
18:58 genio tchaves: I think everything you need to get started is right there on the front page of the main site: http://mojolicio.us/
18:59 genio tchaves: I'm assuming, of course, that you're already somewhat familiar with Perl
19:05 zrusilla1 joined #mojo
19:05 tchaves All I need to know about Mojo's there? I mean css, database, javascript.
19:07 berov joined #mojo
19:13 genio Start with the information there, become familiar with the environment and then ask some specifics here.
19:14 lb tchaves: mojolicious docs will not teach you about css, database, javascript
19:21 tchaves is not to teach them to do but call them via mojo.
19:23 genio The documentation walks you through how to do templates.  If you can write HTML, CSS, and JS yourself, then you shouldn't have a problem.
19:24 genio but, rather than keep asking what the documents teach you, I suggest you just start reading the documents.  It's easy to understand and well thought out.
19:24 genio sri++
19:35 zrusilla1 joined #mojo
19:35 zrusilla2 joined #mojo
19:47 punter joined #mojo
19:53 Jonis sri: I will, tomorrow :)
19:58 dwierenga joined #mojo
20:02 disputin joined #mojo
20:07 genio So, yea, this just happened.  I was in a meeting where there was a discussion about an up-coming user group meeting for one of our products.  We usually go laden with lots of machines for people to use for the courses, etc.  Director says, "We don't need to take machines this year, just monitors.  Since everything's in the cloud now, we can just hook the monitors up to the servers out there."
20:08 stephan48 did you quit after he dropped that bomb?
20:09 genio Well, my boss, sitting right beside me somehow kept a straight face.  He replied, "well, we'll need to order a lot of really long cables to hook those monitors up to the cloud!"
20:10 stephan48 haha
20:12 genio This was the director over development for a suite of applications our company writes.  I'm baffled
20:21 crab maybe he was joking
20:24 genio nope. she was as serious as she could be.
20:26 stephan48 did you tell him that you will still need connection boosters for optimizing the access to the cloud?
20:35 zrusilla1 joined #mojo
20:37 zrusilla1 Hello
20:41 punter hi
20:41 purl hi, punter.
20:42 zrusilla1 I am considering writing a Mojo-based interface to the Gearman job server,  Is this something that would work well  as a Mojolicious plugin?
20:43 zrusilla1 Or does fall outside of the scope of what plugins are supposed to provide?
20:47 crab i think it falls outside that scope
20:47 stephan48 why?
20:47 crab but it's not entirely clear to me what a mojo-based interface to the gearman job server would look like
20:47 zrusilla1 Something along the lines of AnyEvent::Gearman, but without the dependencies on Moose, etc
20:47 crab specifically, does "interface" mean a web interface? or is it... oh.
20:47 zrusilla1 using Mojo classes  in place of the AnyEVent ones
20:48 stephan48 if its something like minion(i.e. submitting jobs, checking status), i would say its perfect, if its more like a dashboard/statusmanager maybe a app would be better
20:49 zrusilla1 perfect as a plugin?
20:50 zrusilla1 Ah yes. i see
20:50 zrusilla1 I'll definitely check out the source to that for more insight into plugin writing. Thanks.
21:11 disputin joined #mojo
21:15 punter sri, the code on the Mojolicious documentation webpages aren't as easy to read on Firefox/Linux as they are to read on other browsers (such as Chrome/Linux)
21:15 punter sri, here's proof: firefox: http://pasteboard.co/1s1iQ04r.png     chrome: http://pasteboard.co/1s1mzfQK.png
21:15 punter see the colors and size of the text
21:16 punter and weight
21:23 tchaves left #mojo
21:28 WildPikachu joined #mojo
21:29 WildPikachu would it be recommended to dispatch get and put methods to different actions?
21:34 berov How to easily find a route in $app->routes ?
21:34 WildPikachu berov, do you want to list the routes you have?
21:34 WildPikachu script/my_app routes  <= this command shows you the routes you defined
21:35 berov I want to find a root by name
21:35 berov may be $app->routes->lookup('foo');
21:35 berov ?
21:35 berov will try it
21:37 berov Yay! worked!
21:51 punter joined #mojo
21:52 berov sri: trying to not use private method from PODRenderer . So far got this http://paste.ubuntu.com/7782206/ is there a more elegant way?
21:54 berov or anyone who can recommend a way to replace the default page in PODRenderer :)?
22:00 berov WildPikachu: I am trying to replace the default page for /perldoc
22:01 berov I think this is the only proper way without hacking.
22:13 WildPikachu berov, I'm not that well versed to answer atm :)
22:13 WildPikachu I'm trying to figure out why my Accept: header is causing html to be rendered in a POST atm
22:14 berov that is too general :)?
22:16 WildPikachu I'm using application/json in an Accept: header to a POST , but render_to is no rendering json, its rendering html :)
22:17 meshl joined #mojo
22:20 mattastrophe joined #mojo
22:23 bluescreen joined #mojo
22:29 bluescreen_ joined #mojo
22:32 berov WildPikachu: :( not sure, sory
22:34 punter joined #mojo
22:34 berov just do http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering_JSON
22:39 bpmedley WildPikachu: Do you have a minimal Mojolicious::Lite example?
22:39 WildPikachu bpmedley, it was my fault :)
22:40 bpmedley Glad it’s working
22:40 WildPikachu I was returning render() a page up :(
22:44 zrusilla1 joined #mojo
22:51 dvinciguerra joined #mojo
22:56 rGeoffrey_ joined #mojo
23:22 gryphon joined #mojo
23:24 d4rkie joined #mojo
23:37 sri Jonis: oi! i demand quick answers!
23:37 sri jberger: i suppose you could answer as well!
23:40 d4rkie joined #mojo
23:41 dvinciguerra joined #mojo

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