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

IRC log for #mojo, 2015-04-14

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

All times shown according to UTC.

Time Nick Message
00:38 asarch joined #mojo
01:12 dvinciguerra joined #mojo
01:14 dtscode joined #mojo
01:14 dtscode hey guys... i just did cpanm Mojolicious, but now im not sure how to install Mojo::IRC via cpan. how would i do that?
01:15 Grinnz dtscode, cpanm Mojo::IRC
01:15 Grinnz ...
01:15 dtscode Grinnz, that doesnt work
01:15 Grinnz define "doesn't work"
01:16 dtscode it cant find the module "Mojo::IRC"
01:16 dtscode oh wait
01:16 dtscode never mind
01:16 dtscode odd
01:32 frederico joined #mojo
01:39 klapperl joined #mojo
01:51 jb360 joined #mojo
02:03 disputin joined #mojo
02:06 Lee joined #mojo
02:12 noganex joined #mojo
02:23 hshong joined #mojo
02:25 mattastrophe joined #mojo
02:56 irq joined #mojo
03:04 mattastrophe joined #mojo
03:04 davido___ joined #mojo
03:05 basic6 joined #mojo
03:17 asarch joined #mojo
03:24 inokenty-w joined #mojo
03:49 kaare joined #mojo
04:17 kaare joined #mojo
04:38 kaare joined #mojo
05:39 berov joined #mojo
05:39 bjoernfan joined #mojo
05:50 nicomen */win 15
05:58 coolo that's your way to say it's boring in here? :)
06:03 nicomen typo
06:03 preaction yeah, you actually wanted */win 18
06:04 * Grinnz wonders what the ratio of * to win is
06:07 batman i don't get why https://github.com/jhthorsen/mojolicious-plugin-assetpack/blob/master/t/plugin-with-assets.t is failing. http://www.cpantesters.org/cpan/report/d823a8c4-e1e7-11e4-aa87-ef25c6d6a91f
06:07 batman i would very much appreciate if anyone could help me out with that one
06:08 batman to me it, it seems like @READ_ONLY is not really made read-only...
06:11 dod joined #mojo
06:12 eseyman joined #mojo
06:19 bramirez joined #mojo
06:24 Shaeto joined #mojo
06:31 dod joined #mojo
06:53 melo joined #mojo
07:04 AndrewIsh joined #mojo
07:20 ace joined #mojo
07:21 ace how to control the 'referrer' by redirect_to?
07:23 ace someone help me
07:26 Lee ace: http://mojolicio.us/perldoc/Mojo/Headers#referrer
07:30 ace It was a silly question
07:31 ace thanks.
07:42 odc joined #mojo
07:48 melo joined #mojo
07:50 trone joined #mojo
07:53 bramirez joined #mojo
08:04 ace I can't modified referrer in the following code.
08:04 ace $self->req->headers->referrer('test referrer'); $self->redirect_to('http://test');
08:05 ace Do you know the cause?
08:05 purl the cause is e08998bf6 - which did some fixes to sort order without regenerating the file
08:13 Vandal joined #mojo
08:17 ace me?
08:17 purl i guess ace is at http://www.cs.wustl.edu/~schmidt/ACE.html or the Adaptive Communication Environment, a high-level C+ + toolkit for writing sophisticated, concurrent, parallel and distributed applications. or has a FAQ at http://www.cs.wustl.edu/~schmidt/ACE.FAQ.html or Doug Schmidt is boojum's hero or at http://members.aol.com/kevinesin/esin/ace.html or some shitty compression software or rimmer's cooler alter-ego
08:19 Lee shutup purl
08:19 purl "Mind your own business, Mr. Lee! I'm tired of your half-breed interference!"
08:30 LordVorp joined #mojo
08:38 batman ace: what do you expect to happen?
08:39 damaya joined #mojo
08:40 ace I want redirect & non-referrer
08:40 damaya if there is a redirect in my $ua->get, how can I get the url from the redirect? $tx->req->url gives me the url that was requested, not the url redirected to.
08:45 ace redirect url from the parameter as follows.
08:45 ace get '/redirect' => sub { my $param = $self->req->params->to_hash; my $image = $param->{'destination'}; ....
08:45 ace I want redirect to the $param->{'destination'} with non-referer
08:46 damaya my bad, had I looked at the output I would have noticed I was getting the path, not the url :D
08:49 batman ace: i don't get it. i thought referrer was set by the client..? Do you see a referrer in the HTTP response from the server..?
08:50 batman damaya: $tx->res->headers->location
08:50 batman damaya: but you won't see it if you have set $ua->max_redirects(...), since then Mojo::UserAgent will handle the redirects by itself.
08:52 damaya Yeah, I set max_redirects, but still seeing the original URL in $tx->req->url, so something else may be wrong.
08:54 batman why is that wrong?
08:55 batman it holds the URL you requested, right..?
08:56 irq joined #mojo
08:58 damaya ok, figured it out...
08:59 damaya I was doing something like this `my $url = Mojo::URL->new('http://www.site.com')->path(resources/chatbox.4893/download?version=21000);
09:00 damaya I modified that so that it's this: Mojo::URL->new('http://www.site.com/'.resources/chatbox.4893/download?version=21000);
09:00 damaya and now it works
09:01 damaya Using path and saying the URL, it the ? became %3F
09:02 ace I summarizes the my problem on the Google Docs. Could you review it please?
09:09 ashimema anyone about..
09:09 * purl hides> (the bodies)
09:10 marcusr ashimema: o/
09:10 ashimema I'm trying to use $self->home->rel_file('/thing/stuff.ext'); to get a file relative to the app install path
09:10 ashimema this is forn inside a controller..
09:10 ashimema but..
09:11 ashimema I'm getting 'Con't locate method "home" via package...' errors
09:11 ashimema any idea's what I'm doing wrong?
09:12 marcusr ->app->home
09:12 ashimema ack..
09:12 ashimema I had a feeling it might be somtihng as simple as that..
09:16 ashimema yup.. works nicely with that.. thanks
09:18 marcusr np
09:32 ace joined #mojo
09:48 mattastrophe joined #mojo
09:53 dotan joined #mojo
09:55 amon joined #mojo
10:00 kaare joined #mojo
10:08 ace Sorry for the confusion. My problem was solved as follows.
10:08 ace $self->tx->req->headers->referrer('test referer'); my $data = $self->ua->get('http:'.$image)->res->body; $self->render('data' => $data, format => 'jpg');
10:09 ace Thank you for your cooperation.
10:17 marcusr ace: I think you probably wanted to say thank you for your help :) cooperation sounds like something the police would say.
10:18 romel hi everyone. is this logically correct to perform render from within a plugin and just call $self->helpername inside controller's method?
10:21 ace okey
10:21 ace Thank you for your help!
10:50 bramirez joined #mojo
11:01 bc547 marcusr: robocop would say that line
11:22 marcusr bc547: most likely
11:22 purl I doubt it
11:22 * marcusr pushes purl down the stairs
11:22 * purl attaches herself to marcusr using suction and a ham straw
12:05 neilhwatson joined #mojo
12:06 batman i want to call a non-blocking method every three seconds, but not before the last non-blocking call is returned, and i want to do that for 30 seconds... any idea if there's a module that does something like that?
12:07 batman i might create Mojo::Recurring if not... though i'm pretty sure that's not a very good name for a non-core module
12:14 bramirez joined #mojo
12:15 buu batman: 3 seconds after the last call or 3 seconds from the last call starting?
12:15 buu *finishing
12:15 batman starting
12:15 purl starting is thread is really quite hard.
12:16 batman maybe Mojo::AtInterval is a better name
12:17 buu So what happens if the method takes 4 seconds to complete?
12:23 batman Then the next call is run at once, or you get an
12:23 batman $err.
12:23 batman Not sure yet...
12:23 marcusr SPLOSIONS
12:27 batman Might have a variable that tells how long is left, so the callback can decide.
12:27 Kripton joined #mojo
12:29 marcusr batman: are you sure this is a good architecture?
12:34 batman marcusr: I'm doing something similar to "ping"
12:35 batman I thought what I'm describing is what ping did...
12:36 marcusr I think ping just send out icmp every second and prints the responses whenever they come in.
12:36 marcusr icmp_seq tells you if they are out of order
12:41 mattastrophe joined #mojo
12:47 batman yeah. but still. a command is called on an interval...
12:47 marcusr batman: intervals are well supported in mojo::ioloop :)
12:47 jberger batman: can you use a delay with a the second timer in parallel?
12:47 batman what would you do? what i'm really doing is checking an oid in a SNMP tree for tracking traffic stats
12:47 jberger three second
12:48 marcusr batman: I'd use collectd :)
12:48 batman jberger: i've tried going down the delay path, but i don't see how delay can help me here
12:48 batman marcusr: hehe
12:49 dvinciguerra joined #mojo
12:52 ace joined #mojo
12:55 powerman joined #mojo
12:56 powerman Hi. Is there any protection against output buffer overflow for Mojo::IOLoop::Stream?
12:56 powerman I.e. what if client connects to EventSource (or WebSocket), but didn't try to read anything sent by server?
12:57 powerman Will server send more and more data to that malicious client until Out Of Memory happens or there are some ways to detect this situation and close connection to that client?
12:59 powerman At a glance I see only (surely wrong) way to do this: manually check length($stream->{buffer}) before each next $stream->write().
13:01 batman powerman: how is that buffer overflow?
13:02 jberger batman: http://pastie.org/10091776
13:02 marcus also, why would it run out of memory?
13:03 batman jberger: oooh! push @{$delay->remaining}, __SUB__ # nice :)
13:03 jberger :-)
13:03 powerman batman: EventSource server as per example in mojo cookbook if affected by this issue.
13:04 batman i think you failed to answer my question... let me try a different question.
13:05 batman who are subject for buffer overflow? the server or client?
13:05 powerman it is doing $c->write() endless, which in case client won't read from socket effectively mean just $c->...some_stream...->{buffer} .= "new data" endlessly, with out of memory as result
13:05 powerman the server
13:05 purl the server is ignoring me...
13:05 batman to me... i use "buffer overflow" in memory context. like when someone hacks your apache web server... i don't see how it's related here
13:06 jberger powerman: I don't believe that Stream is high level enough for that, however: http://mojolicio.us/perldoc/Mojo/Transaction/WebSocket#max_websocket_size
13:06 batman powerman: why does it mean that..? it will write(). the data is flushed by the kernel or an error is returned.
13:06 jberger the transactions and messages have size limits
13:07 powerman jberger: this is for websockets, but what about eventsource and usual $c->write()?
13:08 jberger powerman: that was an example
13:08 jberger I haven't used event source
13:09 powerman batman: there will be no error from kernel, at least not soon enough. first $c->write() will send data to kernel, but next $c->write() will just append to internal $stream->{buffer} and wait until EV get notice from kernel you can send more, which never happens if client won't read
13:09 jberger and you did ask about websocket btw
13:10 batman powerman: so... why would the server wait for the client? i don't get why the data is not sent over the network and fill up the buffer on the client side.
13:12 jberger powerman: I think I agree with batman, if the client can't keep up, is that really the server's concern? and even if it is, event source is rather low-level too, you could build in your own limiting mechanism
13:12 powerman jberger: actually I'm not sure this max_websocket_size will protect against this issue - at a glance it apply to single message, but I may be wrong about this
13:13 jberger I'm not sure I understood your issue
13:13 jberger I though you meant for incoming
13:13 batman powerman: i'm very sure you're wrong.
13:13 jberger since I usually care about outsiders DOSing my server
13:13 jberger not the other way aroud
13:13 powerman Issue is very simple. If malicious client does connect() to streaming server and just wait without trying to read() then server eventually get out of memory.
13:14 jberger ?
13:14 batman powerman: but read() is a system call, it doesn't care about network and routers
13:14 jberger powerman: you are forgetting about transport
13:14 batman so if you write to a socket, that data is sent over the network, if the client is connected
13:14 powerman To avoid this server usually force close() connection to client if outgoing buffer to that client grows to large.
13:15 batman but... it will be stored on the local server until the kernel decides to flush it to the network.
13:15 batman but that happens rather frequent.
13:15 jberger you know, I'm going to bow out of this one, I don't know the details involved so I shouldn't be trying to answer
13:15 batman 1) i don't understand what you're saying 2) it's complete nonsense
13:16 * batman goes back looking at jberger's example.
13:16 batman thanks again jberger. i guess unshift() will dot the same trick as push()...
13:17 powerman Okay. Let me implement example code. When this nonsense will eat all memory we'll continue, yeah? :)
13:17 jberger powerman: please do
13:18 jberger batman: I guess so, there should only be one in there right?
13:20 batman jberger: yeah. and the current $step is shifted off before being called.
13:20 batman powerman: i'm up for that. i can start the server at my laptop and connect to the client side on your laptop
13:21 batman or... your *whatever*
13:21 batman powerman: just keep it small, so i don't miss any system("rm -rf /") in the code ;)
13:21 powerman :)
13:25 jb360 joined #mojo
13:28 powerman batman: got it
13:28 powerman server is:
13:28 powerman perl -Mojo -E 'a("/" => sub { my $c = shift; $c->inactivity_timeout(3600); $c->res->headers->content_type("text/event-stream"); $c->write; Mojo::IOLoop->recurring(0.01 => sub { $c->write("x" x 1000000) }); })->start' daemon
13:28 powerman client is:
13:28 powerman nc --send-only localhost 3000
13:29 batman powerman: localhost != network
13:29 powerman type to nc:
13:29 powerman GET /<Enter>
13:29 powerman <Enter>
13:29 powerman run it on network if you like
13:29 powerman this doesn't matter
13:29 batman i don't have two servers i can use.
13:29 powerman thing is, server will earn memory. fast.
13:30 powerman you can run server and say host:port to me and I'll run nc for you :)
13:32 batman that's like saying my server uses a lot of memory because i do $_ .= slurp "big.file" while 1;
13:32 batman i will stop now, because you probably have a point i'm not seeing.
13:32 powerman sort of. except you've control over $_ size while doing slurp, and I can't find way to control same thing in mojo
13:33 batman crap... i can't shut up :(
13:33 batman so... the server might use a lot of memory because it can't flush the x 1MB chunks you're trying to write fast enough.
13:34 powerman exactly
13:34 batman but i think that's it. it's not because the client doesn't read
13:34 powerman and problem is server can't know is it writes too fast because it depends on how fast client read… if it read at all
13:34 batman that's where i think you're wrong.
13:35 batman it's just because you create too much data too fast.
13:36 batman $_ .= "x" x 1e6 and usleep 1e3 while 1; # this will also eat up memory over time
13:37 powerman Heh. I did a lot of low-level I/O in last 15 years. I wrote support for epoll in perl when where was no cool EV module. Here is my own variant of Mojo::IOLoop::Stream: https://metacpan.org/pod/IO::Stream Believe me, I know what I'm talking about.
13:38 batman okidoki
13:38 LordVorp joined #mojo
13:39 powerman I'm not 100% sure about kernel internals, but I suppose if client won't read, then kernel may not return any errors to server for _days_. So even if server will write slowly to that non-reading client - server anyway will go out of memory eventually.
13:41 asarch joined #mojo
13:42 batman but the kernel doesn't keep all that data in memory. it's passed over to the nic and kernel on the client side, which will do *whatever* with it.
13:43 batman anyhow... you won't have any "buffer overflow" even if you run out of memory
13:43 batman http://en.wikipedia.org/wiki/Buffer_overflow
13:43 powerman yeah. first small part of data will be transferred from mojo server to server's kernel, then to client's kernel, but then it stick at this point
13:44 batman so you seriously expect the kernel on the server side to wait for the network?
13:45 powerman ok, sure, it's not THE "buffer overflow", but it is "buffer" "overflow" - because we've single buffer on server and it grows too much over any reasonable limits. you know better term how to name this?
13:46 powerman yeah, I do
13:46 powerman kernel on server side won't notify (by epoll/EV) mojo app what data was sent and it can send more - until it will be really sent
13:47 powerman actually that's not exactly true, kernel has some buffers on it's own, so mojo app may be able to send about 256K until that situation happens
13:50 batman but this is not in the application layer. the kernel only waits for a tcp ack from the client before it can send more data.
13:50 powerman yep. but as result - it's a DoS on that application
13:51 sri fyi. powerman is wrong
13:51 powerman few years ago was a breaking news about this attack on many webservers - client which read 1 byte at a minute effectively DoS apache and probably even nginx, not sure
13:52 batman sri: are we both wrong or am i right?
13:52 sri both
13:53 sri it is a problem, but an alredy solved one... solved years ago
13:54 powerman https://metacpan.org/pod/AnyEvent::Handle#wbuf_max-bytes
13:54 powerman this is what I'm talking about
13:54 purl hmmm... talking about is "Yeah, you're alway talking and talking and talking. Shut up and code."
13:54 powerman where is same setting in mojo?
13:55 powerman or how to protect against this DoS in another, mojo-way?
14:02 batman powerman: yeah, so i guess i was right on the network layer, but you was right in mojolicious (kind of) because of the error handling: https://metacpan.org/source/SRI/Mojolicious-6.08/lib/Mojo/IOLoop/Stream.pm#L101
14:03 gryphon joined #mojo
14:05 powerman batman: this isn't error handling at all (it's usual non-error codes for non-blocking I/O), and it's in read() while I was talking about $c->write()
14:06 sri i don't want to give powerman anything to quote in more negative blog posts... so i'll stay out of it
14:07 powerman negative blog posts?? what you mean?
14:08 powerman I've a couple articles about mojo in russian, but they ain't negative, at all. I like mojo, use it, recommend it…
14:10 * marcus is confused too.
14:11 marcus sri: citation needed? =]
14:11 sri this is not a friendly article http://habrahabr.ru/post/227493/
14:11 powerman I honestly think doc is sort of incomplete and policy about backward compatibility is… not nice. But it's just my personal opinion, everyone has one. And I'm trying to solve at least first issue in my articles by providing information which I feel missing in official docs.
14:12 sri you're free to voice your personal opinion, and i'm free to avoid discussions
14:14 marcus I can see why sri doesn't like that article, powerman. it's not exactly a recommendation.
14:14 powerman That's sad. I didn't see anything unfriendly in this article, but if you take any bit of critique as "unfriendly" then you probably right, it contains some critique about mentioned above two things. But that's not main idea of article, main idea actually is "no matter of these two issues it's worth using!".
14:16 genio Maybe it's the translation, but it doesn't come off as very nice... nor do the comments.
14:16 sri what bugs me is not actually criticism, but that it wasn't brought up through the proper channels first
14:16 Grinnz powerman, "a bit of a critique" is quite different when it's a public article
14:17 Grinnz one that undoubtedly comes up in google searches
14:17 powerman Maybe it's because of translation. I'm sure there are russian-speaking people here, you can ask what they think if you like.
14:17 sri instead, all i see is a negative blog post in a language i don't speak
14:17 btyler eh, yeah. it comes off as more or less even handed to me (russian speaker, but non native)
14:17 sri and native russian spakers keep telling me it is not very nice at all
14:18 btyler certainly some "I don't personally like X very much, but it works like this"
14:18 romel sorry for repeating but i am still wondering :) is this logically correct to perform render from within a plugin and just call $self->helpername inside controller's method?
14:19 btyler although there are some passages where it does come on a bit strong, for sure, and probably google translate doesn't help
14:19 jberger romel: sure
14:19 Grinnz romel, sure, i have a few "rendering" helpers that do that
14:19 sri romel: literally a cookbook recipe http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
14:19 jberger I often name them render_<<something>>
14:19 Grinnz same
14:19 jberger so that I clearly see it when used
14:20 batman jberger: why not "reply.whatever" => sub {}?
14:20 jberger https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Perl/mojolicious/app.pl#L29
14:20 jberger reply.<<something>> works too now I suppose
14:20 romel oh my. i should re-read guides :) thank you guys
14:22 Grinnz render_<something> makes more logical sense to me, it's a helper designed to render a certain way... i leave "reply" to the default ones
14:25 jberger Grinnz: I don't really see any difference in semantics, one true difference is that nested helpers aren't available in templates (directly) and since you would never want to render inside a template using reply.<<something>> is a little more clever
14:25 Grinnz jberger, since i don't use .ep for anything, that doesn't much matter to me
14:25 jberger oh
14:25 batman Grinnz: what do you use?
14:26 Grinnz TT, usually
14:26 Grinnz i do technically use a .ep template on small projects but i don't use helpers in them
14:27 batman ok
14:28 vmb joined #mojo
14:28 powerman sri: Well… you know, I'm really surprised. I've many articles about different software. And I write only about software I really like. And actually this article about Mojo is the _only_ one which contains a lot of superlatives (if I'm using this English term correctly here) - words like "delightful". I never say anything like that in other articles, it's actually not a words I use at all, but I like Mojo so much so I've said so. So, I can't ever expect so
14:29 Grinnz powerman, perhaps the intention was good, but most people skim articles, and the majority of that article is criticism
14:30 Grinnz also your message cut off after So, I can't ever expect so
14:30 powerman So, I can't ever expect someone will read this as something against mojo.
14:31 sri i think 3 native russian speakers have told me by now the article is very negative
14:31 powerman Probably that criticism was just an attempt to compensate too positive emotions and make article looks more balanced.
14:31 marcus it seems like it starts out with a lot of negativity and then balances out towards the end.
14:32 marcus powerman: How would you accurately translate the title of the article to english?
14:32 btyler marcus: literally the second word is "delightful" :P
14:32 sri in fact, some say it sounds worse in russian than after google translate
14:32 powerman marcus: It starts out with word "delightful" - that's first word after "Mojolicious", and only then it moves to criticism.
14:34 powerman Title was named after the PC game "Fable - The Lost Chapters"
14:34 sri still doesn't change the fact that none of the negative stuff has been brought up in a constructive way, in a language we understand, so...
14:34 Grinnz ok, that bit was definitely lost in translation :)
14:34 powerman It's "Mojolicious documentation - The Lost Chapters"
14:36 powerman I can translate it myself, that will be better than Google, but I'm afraid it this article will show in google search results in English this will make sri even more angry, and I didn't like this.
14:36 powerman *if this article
14:37 sri the blog post never made me angry, just disappointed
14:38 sri what made me angry was that mail with the snarky comment about backwards compatibility
14:38 genio powerman: It seems like you didn't mean for it to come across in a negative manner.  But, I think (as you are doing now about your earlier question) it would be appreciated if you brought up criticisms in the proper channel rather than writing about them.  Doing it that way is always going to put the author of something a bit on edge as they haven't had time to address the issues before some article appears.
14:41 ace joined #mojo
14:41 batman genio++
14:44 powerman genio: I don't see any "proper channel" to discuss backward compatibility policy - it's a policy, mojo developers are happy with it, users (including myself) live with it, so I don't see a way to discuss it in "constructive" way. It doesn't looks like something which may be changed with help of discussion.
14:45 powerman Same is about doc - mojolicious doc is very good, but it's all around examples. This is good for newbies, but I lack full reference - without it I have to look every second question in sources. This is author's style of writing doc, and examples and cookbook are really perfect. And I don't think it's possible to change author's style by discussing this.
14:46 powerman So, I may take it as is, or not. I think mojo is really cool, so I've choose to ignore these issues and use it as is.
14:47 marcus we're defintively interested in constructive discussion about improving our documentation even further.
14:48 powerman But sometimes, especially after spending two full days updating several mojo projects to 6.0 compatibility, I wrote something like that email in maillist. I'm just a human, after all.
14:48 genio powerman: I've seen a great number of times where the author has practically begged for help making the documentation better.  If there are things lacking in the docs, write something up and send them his way.
14:49 genio maybe a slight exaggeration.  sorry.
14:50 punter joined #mojo
14:50 sri and the people you're criticizing are just human too
14:50 mst powerman: there's now an Upgrading doc in the wiki
14:50 mst powerman: maybe you could try helping contribute to that in future
14:51 trone route A redirect to route B using redirect_to('B', add_this_param => value ); I would also to pass the A query param to the redirect to B. There is a nice way to do with url_with or similar? Currently I think to have to get the A query_params and pass them as redirect_to args. Hints?
14:51 powerman But I honestly unable to see how all these things about me and articles stop you from talking about this DoS issue. I can promise I won't blog about it, no problem. It's much more important to be protected from DoS than blog about it (for me, at least).
14:53 powerman mst: sure
14:53 sri powerman: i avoid discussions with most people i've had negative interactions with actually
14:53 marcus except for those really bad ones, like mst and I.
14:53 * marcus hides
14:54 genio heh
14:57 sri and i put the most effort into discussing stuff with folks that help others around here
14:57 sri or at least i'm trying to balance it that way
14:58 mst I do wonder if there's a language thing here - in the same way as germans often come off blunter in english than their words would in german, russians tend to come across more negative
14:58 mst and auto-translation likely magnifies that effect, because it can't adjust for tone as it goes along
14:59 sri mst: funny thing, that's what i assumed after google translate, but then native russian speakers told me otherwise
14:59 vmb joined #mojo
15:00 vmb joined #mojo
15:01 sri the language problem is very apparent with github issues too
15:02 sri "wow, this sounds very rude"..."oh, russian"
15:02 Grinnz_ sri: clearly you need to drink more vodka
15:03 mst there's a group of russians working on a better version of GIN indices for postgres
15:03 mst they are, indeed, calling them VODKA indices
15:03 Grinnz_ hah
15:03 cfedde "It's not Klingon without a threat of violence."
15:03 mst when I first heard that I assumed the person was just making a pun
15:03 mst but, no, actually happening
15:03 mst \o/
15:04 sri wait a minute... wasn't this the github issue i reset to the original question after dozens of edits and deletes? https://github.com/kraih/mojo/issues/762
15:04 Grinnz_ yes
15:05 sri did he really edit it again?
15:05 Grinnz_ seems so
15:05 sri i told him he would get a permanent ban from the project if he didn't stop
15:06 batman ok if i delete all my comments?
15:06 sri does someone have the original question?
15:06 marcus can't we just delete the issue?
15:07 marcus seems easiest
15:07 Grinnz_ hello. I asked in GG but got no answer, sorry for repeating myself, but i'm very-very curious.
15:07 Grinnz_ Why Mojo::IOLoop::Delay uses Hash::Util::FieldHash ? And how it fulfil this: "stored outside the object to protect from circular references".
15:08 Grinnz_ it's funny how locking an issue does not prevent edits
15:08 sri guess i have follow through on my word and block him
15:08 sri first person to ever get a permanent ban :(
15:08 batman Grinnz_: how did you get that?
15:09 Grinnz_ i have the emails from that issue thread
15:09 batman cool
15:12 batman sri: can i delete my comments?
15:12 sri it's terrible how edits can be used to circumvent locked issues
15:12 sri batman: i don't know what to do with it
15:13 batman is that the same as "no"...?
15:14 mst sri: I think at this point "delete the issue because clearly it's not going anywhere constructive or useful so let's just stick a fork in it and call it done" doesn't seem like a bad choice
15:15 sri well, you can't actually delete issues
15:15 Grinnz_ oh?
15:15 batman sri: i would like to delete all comments and change the title/description to *abuse* or something
15:15 Grinnz_ so they have no history tracking on edits, and no way to delete them, wonderful
15:16 sri batman: seems reasonable
15:16 batman ok. i'll do that then.
15:16 mst change the title/description to 'deleted' I think
15:16 purl mst: that doesn't look right
15:16 Grinnz_ goddammit purl
15:16 mst no use using it to continue having a pointless argument
15:18 sri heh http://irclog.perlgeek.de/mojo/2015-03-17#i_10294510
15:19 batman done.
15:19 sri what kind of title is that?
15:20 * batman edited the title again
15:20 batman i think that's the best i can come up with...
15:21 batman sri: better?
15:21 batman *is it
15:22 * sri edits
15:22 batman :)
15:37 jberger it is certainly the same one, I think I have only ever locked on issue
15:37 jberger one
15:46 sri oh, laravel is getting a micro framework http://lumen.laravel.com/
15:47 sri hehe, it has a growing path to full laravel apps
15:55 sri (the one php framework i actually like)
15:59 vmbrasseur joined #mojo
16:06 sh4 joined #mojo
16:16 nicomen is there some way I could pass a sub to respond_to so that a struct to say json => doesn't need to be generated?
16:20 ZoffixWork joined #mojo
16:21 ZoffixWork I just convinced @management to convert our 11 company sites to Mojolicious :D
16:21 nicomen oh that actually should just work
16:21 * ZoffixWork passes around champagne in celebration
16:22 nicomen given that the callback does the rendering..
16:24 Mikey congrats, ZoffixWork
16:25 Mikey cheers :)
16:25 ZoffixWork :)
16:26 sri \o/
16:30 jberger ZoffixWork: woooo hoooo \o/
16:30 ZoffixWork :D
16:30 Mikey i am in the process of trying to get university tech commercialization to release under an open source license.
16:31 Mikey it pains me to say this but i am leveraging perl's unpopularity now to lower the codebase's perceived value
16:31 ZoffixWork lol
16:31 Mikey there's lots of good data and no shortage of articles
16:32 Mikey there's a blue blood who's been skulking around the university looking for projects to "fund" and he's keen on this one.
16:32 Mikey im in a tough spot :(.  i really dont wanna end up working for this guy.
16:34 powerman left #mojo
16:37 Oleg joined #mojo
16:40 jberger Mikey: ick
17:24 * sri wonders when there will be mojoconf news again
17:29 * sri still wishes he had picked the http/2 talk
17:49 phillipadsmith Hmmm, not sure what to think of this: http://techcrunch.com/2015/04/14/popular-javascript-package-manager-npm-raises-8m-launches-private-modules/
17:53 hernan604 i am not sure neither.. but will it affect opensource ?
17:57 dod joined #mojo
18:01 berov joined #mojo
18:02 _dave_ purl ... it's "I'm SICK of your half-breed interference". :)
18:02 purl _dave_: sorry...
18:12 phillipadsmith hernan604: No idea, but I'd be pretty irked if some company behind CPAN went that way…
18:12 * phillipadsmith is speaking from his arse, as he really doesn't know much about how NPM is run...
18:14 disputin joined #mojo
18:23 irq joined #mojo
18:33 sri phillipadsmith: hypocrite!
18:33 purl hypocrite is i'm rubber you're glue whatever you say bounces off of me and bashes your frickin' brains in
18:33 phillipadsmith :)
18:34 * sri hugs github
18:34 phillipadsmith true enough...
18:35 _dave_ so "decamelize" takes a string of the form "MULTIApp" and turns it into "m_u_l_t_i_app" :)
18:35 Grinnz gotta support what businesses need
18:41 dvinciguerra joined #mojo
18:41 hernan604 Thats why i created Git::Crypt.. so i can encrypt my ultrasecret top apps, host in github and be sure only authorized people have axx
18:42 hernan604 all that while keeping it opensource, just encrypted
18:42 mishantil How do you people usually deal with forcing refresh of css/js-assets in mojo-apps? The usual "append mtime of file as GET-param"-thing?
18:42 Grinnz i think that's more like "sorta open source"
18:43 Grinnz mishantil, yeah we append ?version=xxx
18:43 Grinnz and bump the version whenever the css/js is going to change on production
18:43 hernan604 i think he means autoreload like JS
18:43 sri also https://metacpan.org/pod/Mojolicious::Plugin::AssetPack
18:43 hernan604 like node*
18:43 Grinnz ah, dont know about that
18:44 mishantil Grinnz: Thanks for the input. :) We have css/js changing _constantly_, so manual bumping is sort of out of the questions. But good to know that the old trick is still golden.
18:44 sri like in nodejs? wat?
18:44 mishantil sri: I'll have to look into AssetPack. Thanks.
18:45 hernan604 in node, they use an auto reload for webpages.. its like a watcher for files changed. Then, there is an injected js script on dev app and when a JS file gets changed, the injected script reloads the page
18:45 mishantil hernan604: I most certainly did not mean autoreload. Unless it was the other me speaking, then I'm not so certain.
18:45 sri how is that nodejs specific?
18:45 hernan604 then nevermind
18:45 sri you can do that with any language
18:45 hernan604 sri: because i have seen everyone doing it in node
18:45 hernan604 yes!! but first time i saw that was in node...
18:46 hernan604 havent seen it in mojo, but yes, it can be done in any lang
18:46 mishantil It is a cool thing though.
18:47 hernan604 If someone enlighten me on whats the best way to implement it, i would gladly do it..
18:47 Grinnz autoreload is what morbo does for the perl files
18:48 hernan604 it reloads the backend
18:48 Grinnz right
18:48 hernan604 maybe it could trigger a reload on frontend
18:48 hernan604 as an extra plugin
18:48 Grinnz if you're assetpacking that's probably simpler
18:49 hernan604 assetpack can do it ?
18:49 Grinnz https://metacpan.org/pod/Mojolicious::Plugin::AssetPack#MOJO_ASSETPACK_NO_CACHE
18:50 hernan604 jesus , i would like to work with professional mojo developers!
18:50 hernan604 i must know this mojo land
18:50 hernan604 so much coolness im not aware of
18:51 hernan604 im avaliable for hire if anyone is interested \o/ and only interested in long contracts
18:52 sri i imagine client-side reloading is super trivial, just keep a websocket open, if the websocket gets closed, assume server has restarted
18:53 batman mishantil: Also ?version=1234 is not very cache friendly
18:53 batman Not as in "going to be cached", nor "will always be refreshed"
18:53 sri no need to change anything in morbo, it should be doable with like a dozen lines of code
18:53 batman Depends on system and browsers.
18:54 batman sri: Oooh! I have to make that plugin :)
18:54 sri :)
18:54 mst neat idea
18:54 batman Crap. I'm stuck in making-plugin-land, when I really want to make apps
18:54 Grinnz lol
18:54 mst in develop you're probably not going to get a noticeable number of false negatives either
18:54 hernan604 sri: you mean, 1) load a javascript. 2) create a websocket endpoint 3) reload page when websocket disconects
18:54 Grinnz make an app Mojo::UseAllPlugins
18:55 sri should be as easy as "plugin 'ReloadOnChangeHelper';" and "%= reload_on_change" or so
18:55 batman I think I will add it to assetpack...
18:56 hernan604 how can i contribute :P
18:56 sri plugin makes a websocket endpoint that regularly sends a ping or so, helper inserts some javascript that waits for the websocket disconnect and then reloads the page
18:59 sri oh yea, and tie both to development mode i guess :)
18:59 sri so you can leave it in for production and becomes a noop
19:00 hernan604 yeah
19:00 batman I think it will work well for addotions, but i'm bør sure how it will work for removal
19:01 hernan604 batman: huh?
19:01 batman Guess you better not make any globals :)
19:01 batman Crap. Norwegian autocorrect
19:01 Grinnz batman, you seem to have some norwegian stuck in your sentence
19:01 Grinnz hahaha
19:02 sri batman: location.reload(true)?
19:03 sri https://developer.mozilla.org/en-US/docs/Web/API/Window/location
19:03 batman If a.js defines window.foo = setInterval(...); and you load b.js, then window.foo will still run.
19:03 mishantil batman: wasn't cache-busting with url-parameters an issue with older browsers? Or is it still a problem?
19:03 mishantil Need to resort to having it as part of the filename?
19:03 batman sri: I was thinking just reloading the assets. Not the windows.
19:03 sri oh, even after a hard reload?
19:03 hernan604 why is that a problem ?
19:04 * sri was expecting a hard reload
19:04 batman sri: think I have to support both.
19:04 hernan604 yeah hard reload lol
19:04 Grinnz mishantil, perhaps, we only support IE 10+ and the other browsers that dont suck, heh
19:04 batman It's very smooth just reloading the new CSS, withouth doing a hard reload.
19:05 batman mishantil: Not sure. But AssetPack simply avoids the whole issue
19:05 sri if you can do both i don't care, but personally, i'd want hard reload
19:05 batman About v=123 ^^
19:05 batman sri: I'll do EVERYTHING!!! :)
19:05 sri ALL THE THINGS \o/
19:06 batman Anyhow. Need to go now... Thanks for the idea. Going to make it tomorrow.
19:06 batman I'll add it to assetpack.
19:06 batman *bbl*
19:06 sri o/
19:06 hernan604 gotham city time
19:07 hernan604 thank nodejs for the idea =p
19:07 batman Ok..
19:08 * Grinnz has been replaying arkham asylum, after binge-watching daredevil last weekend
19:08 sri i doubt that's where the idea originates
19:17 mishantil batman: How does AssetPack avoid the issue?
19:19 Grinnz mishantil, i believe in the way it generates the packed file
19:19 Oleg mishantil: https://metacpan.org/release/Mojolicious-Plugin-TagHelpers-NoCaching
19:23 asarch Just the case you need a new host: http://www.webhost.discount/55-off-all-hostgator-hosting-plans/
19:25 wingfold_ joined #mojo
19:39 jberger joined #mojo
19:40 jb360 joined #mojo
19:40 mattastrophe joined #mojo
19:40 mishantil Oleg: Thanks for the tip. I'll look into that as well.
19:41 mishantil And I'm curious to learn how AssetPack has solved the whole issue of (modern)IE and Chrome being bastards when caching.
19:42 mishantil Maybe I'll have to go code-surfing.
19:42 zz_Foxcool joined #mojo
19:44 jberger if we have a module that uses anyevent condvars and we want it to run inside of a loop, is there any sane way to do that?
19:46 preaction jberger: need more info. is there a callback you're waiting for? if so, you might need to create your own condvar too
19:48 mishantil Anyone here from Berlin by any chance?
19:49 jberger preaction: looking into that
19:49 jberger this is the module: https://metacpan.org/pod/Asterisk::AMI
19:50 jberger hmmm, perhaps there is a continuation-passing style api in there too
19:50 jberger this is old code I'm looking at for the first time
19:51 preaction yeah, looks like the callback style will be your best bet
19:56 martin joined #mojo
20:02 jberger hmmmm, but we are actually using Asterisk::AMI::Common which is "convenient" blocking interface to common functionality
20:02 jberger bastards
20:02 * purl kills kenny
21:04 batman mishantil: It does it by generating a unique file name
21:04 batman Like foo-124272515eab24.css
21:04 batman The unique part is the MD5 of the input files
21:07 hernan604 Hey batman, are there any other super heros that use perl ?
21:07 hernan604 or what are they using
21:22 punter joined #mojo
21:23 mishantil batman: Ah. Right. That was what I was contemplating doing myself. Might just use AssetPack then. No use reinventing the wheel _every_ time.
21:23 mishantil batman: Anyway, thanks for making it. :)
21:52 mattastrophe joined #mojo
22:19 vmb joined #mojo
22:55 frederico joined #mojo
23:04 mattastrophe joined #mojo
23:45 mattastrophe joined #mojo

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