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

IRC log for #mojo, 2013-12-05

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

All times shown according to UTC.

Time Nick Message
00:14 nicomen joined #mojo
00:15 dsteinbrunner_ joined #mojo
00:34 d4rkie joined #mojo
00:53 Dandre joined #mojo
00:55 d4rkie joined #mojo
00:57 crab someone remind me how to call form_for such that it doesn't have any $cb, only $content?
00:59 jamesw joined #mojo
01:03 laouji joined #mojo
01:07 Adura joined #mojo
01:11 laouji_ joined #mojo
01:24 dsteinbrunner joined #mojo
01:41 jberger_ joined #mojo
01:42 jberger_ sri: does any of this look troubling for a Mojo::Reactor:: ?
01:42 jberger_ https://github.com/joyent/libuv/blob/master/include/uv.h#L1134
01:44 jberger_ sounds like a lot of conditions
01:53 ka2u joined #mojo
01:56 russum joined #mojo
01:56 crab wasn't there some "all you need to know about unicode and perl" sort of article? anyone remember it? i want to point someone at it
01:57 jberger_ there is tchrist's epic SO answer :-)
01:58 jberger_ also one of the YAPC::NA talks
01:59 jberger_ https://www.youtube.com/watch?v=X2FQHUHjo8M
02:01 jberger_ http://stackoverflow.com/q/6162484/468327
02:02 crab ok. if i hit him with tchrist's answer, he should stay dead ;-)
02:23 jberger_ HAHAHAHA
02:23 purl LOLCON 4 reached.
02:23 jberger_ HAHAHAHAHA
02:23 purl LOLCON 5 reached.
02:23 jberger_ nice
02:23 jberger_ purl botsnack
02:23 purl thanks jberger_ :)
02:41 jberger_ the more I read the libuv.h file, the more I want to reimplement Perl5 using it :-)
02:41 Adura Ask that witch/warlockhunted guy to.
03:02 sri jberger_: you will like moarvm :)
03:02 sri https://github.com/MoarVM/MoarVM # it's on libuv now
03:03 sri and no, i don't think any of that matters for the reactor
03:04 sri only sockets on windows is a bit curious, but may have to do with iocp use there
03:04 * marty just got websockets working with a tailable mango cursor.   Yeeeee Hawwwww  o/
03:04 jberger_ Do I need to think about the "only one watcher" thing?
03:04 sri doubt it
03:04 sri \o/
03:05 jberger_ marty++
03:07 jberger_ sri: perhaps you want to make a Reactor hook for getaddrinfo?
03:07 sri perhaps
03:07 jberger_ or can you think of some other clever way of doing this?
03:08 sri nope, getaddrinfo hook is an open problem
03:08 sri new ideas are more than welcome
03:09 jberger_ maybe just a Mojo::Util::getaddrinfo which could detect the IOLoop, but the blocking vs nonblocking would be tough
03:09 jberger_ there is an oddity about how the info is returned
03:09 sri it gets a bit complicated since we have to work with IO::Socket::INET too, not just IO::Socket::IP
03:09 jberger_ it has a special "free" function for it
03:09 sri so we have platforms without getaddrinfo
03:10 sri on the other hand... we always have a blocking fallback with those modules
03:10 jberger_ (re:free) might make things tough because of the ffi stuff
03:10 jberger_ right
03:10 sri so default could be a noop hook
03:10 sri "try to resolve this, but it's ok if you can't"
03:11 jberger_ maybe we need a can_non_blocking_getaddrinfo
03:11 sri that makes it harder
03:12 jberger_ then would it always present a non-blocking style interface (ie with a callback)
03:12 jberger_ and it would just block if it had to?
03:13 sri sub Mojo::Reactor::getaddrinfo { my ($self, $name, $cb) = @_; $self->timer(0 => sub { $self->$cb($name) }) }
03:13 sri no, it would pass the name through, so the blocking resolver we have anyway takes care of it
03:14 * jberger_ trusts sri :-)
03:14 sri TRUST ME I'M FROM THE INTERNET
03:14 jberger_ I really am out on the edge of my knowledge on some of this
03:14 jberger_ HAHAHAHAHA
03:14 purl LOLCON 5 reached.
03:14 jberger_ drat, I was shooting for 6 and I miscounted
03:15 sri it's not the cleanest solution... but sure beats manually fuzzing with the blocking getaddrinfo
03:17 sri oh... but i forgot something
03:17 sri meh
03:17 sri multiple results
03:19 sri anyway... it's not urgent
03:19 jberger_ I know
03:19 jberger_ none of this is really
03:19 jberger_ even if I get all of this to work, its not likely to be used much, since nothing else is written for it (unlike AE)
03:19 sri you'd want to fit async dns modules from cpan into that hook too
03:21 sri well, if you're after something with a BIG future, i'd aim for EV api compatibility
03:22 sri (which itself got its api from Event)
03:23 jberger_ I have no idea what I want from this
03:23 jberger_ I like making tools
03:23 jberger_ sri challenged someone to make this one
03:23 * jberger_ tries
03:23 sri :)
03:24 laouji joined #mojo
03:25 jberger_ on a completely different note, ::ForkCall has the strangest CPANTesters results
03:26 jberger_ it has passes on every platform,
03:26 sri jberger_: oh, re nothing is written for it https://metacpan.org/pod/IO::Async::Loop::Mojo
03:27 sri you can go the opposite direction with targeting too
03:27 jberger_ but it has failures on a few select cases, with no pattern, and really odd failure messages
03:28 jberger_ what the heck is that interface?
03:29 jberger_ wouldn't you want to do Mojo::Reactor::IOAsync?
03:29 jberger_ rather than the other way around?
03:29 sri it doesn't really matter
03:29 jberger_ I guess not, but it seems odd (might be too close to the other side of the argument)
03:29 sri reactor is a little light on some features, but that can usually be worked around
03:30 dsteinbrunner joined #mojo
03:31 sri jberger_: only two of those failures look odd to me
03:32 sri EV and ithreads is clear, same for panic
03:33 sri 208 pass and 5 fail is a damn good result for tests that fork
03:33 jberger_ :-0
03:33 sri and EV/ithreads errors can be avoided
03:34 jberger_ skip if?
03:34 jberger_ or actually tell it not to do something?
03:34 sri BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }
03:34 jberger_ in the tests?
03:34 sri yea
03:34 jberger_ right
03:35 jberger_ that makes things easy
03:35 sri you can't load EV and fork on windows
03:35 jberger_ oh, yeah, that jogs something in the deep recesses of my memory
03:36 * jberger_ avoids that platform as much as humanly possible
03:37 jberger_ then again, I was pretty happy to see the tests passing on windows
03:57 davido joined #mojo
03:57 jberger_ is there some way to tell if a handle is a socket or not?
04:09 davido ->isa()?  (I don't know, but...)
04:18 sri jberger: -S
04:19 davido bingo. Sometimes it's too simple. :)
04:19 jberger_ -Seriously?
04:19 * jberger_ was pouring over IO::Handle doc
04:20 davido But this did what I expected: perl -MIO::Socket -MScalar::Util -E 'my $s = IO::Socket->new(); say "Yes" if $s->isa("IO::Socket");'
04:21 davido Oh, disregard the Scalar::Util part; I was checking reftype too, which just comes back as a GLOB.
04:27 jberger_ sri: would you expect that uv_os_sockt_t is an int :-/
04:28 preflex_ joined #mojo
04:31 davido A signed int? uv_...._t ought to be unsigned.
04:32 KindOne joined #mojo
04:36 jberger_ probably
04:36 jberger_ except that fd is an int
04:36 jberger_ https://github.com/joyent/libuv/blob/master/include/uv.h#L1175
04:40 russum1 joined #mojo
04:40 russum1 left #mojo
04:43 bzero left #mojo
04:55 sri jberger_: why wouldn't it be an int?
04:55 jberger_ I can't find the definition of uv_os_socket_t
04:55 jberger_ that is all :-)
04:55 sri oh :)
04:58 sri wow, there's at least a dozen new features woth mentioning in a 5.0 announcement already :o
04:59 jberger_ wow! highlights?
04:59 sri validation ;p
05:01 sri csrf, socket compression, cheap helpers, many new dom methods, non-blocking bridges, around_action hook, SO_REUSEPORT....and and and
05:01 jberger_ \o/
05:02 sri and i was worried that we were out of ideas after 4.0 :D
05:03 jberger_ hehe
05:04 jberger_ one of the best (meta) things about mojo is the pace
05:05 sri you'd think it has to get slower at some point
05:06 jberger_ the io/watcher Reactor methods don't map very nicely to uv :-/
05:06 jberger_ you would think so right?!
05:06 beyondcreed joined #mojo
05:07 jberger_ watch would call uv_poll_init and io would call uv_poll_start, except that the mask goes on uv_poll_start :-s
05:10 davido jberger_ Did you find where it's defined? I'm not seeing it either as I trace back through the #includes.
05:11 jberger_ no, I stopped looking (though rather quickly)
05:11 jberger_ thanks for looking though! davido++
05:13 laouji joined #mojo
05:30 ka2u joined #mojo
05:35 laouji joined #mojo
06:02 russum joined #mojo
06:09 espent joined #mojo
06:34 Vandal joined #mojo
07:04 bowtie_ joined #mojo
07:10 dpetrov_ joined #mojo
07:18 KindOne joined #mojo
07:26 denis_boyun joined #mojo
07:45 KindTwo joined #mojo
07:53 trone joined #mojo
07:56 cooper joined #mojo
07:58 highflying joined #mojo
08:01 dod joined #mojo
08:14 dod joined #mojo
08:29 basiliscos joined #mojo
08:50 Mad_Dud- joined #mojo
09:03 Dandre joined #mojo
09:08 preflex joined #mojo
09:15 tianon joined #mojo
09:40 denisboyun joined #mojo
09:44 Mad_Dud joined #mojo
09:45 themage joined #mojo
09:57 marty_ joined #mojo
10:07 fhelmber_ joined #mojo
10:12 hummeleBop joined #mojo
10:14 preflex_ joined #mojo
10:36 maxhq joined #mojo
11:04 dsteinbrunner joined #mojo
11:09 Adurah joined #mojo
11:12 dod joined #mojo
11:12 chansen joined #mojo
11:15 Mad_Dud- joined #mojo
11:23 ver joined #mojo
11:26 athenot joined #mojo
11:26 womble joined #mojo
11:28 denisboyun joined #mojo
11:32 hrupp joined #mojo
11:33 womble I'd appreciate any comments on this pseudo-design for a Mojo app to schedule sequences of shell scripts: http://pastie.org/pastes/8530450/text?key=xkedooae8zeexhbbppl9va
11:34 womble doing some reading about Mojo::Redis, it seems like a good way for external worker processes to talk to the controller, but I'm not sure exactly how to do it
11:35 womble any comments includes "you are crazy"
11:41 womble "Update Clients" means update data in a table presented to clients via websocket for "real time" feedback of progress of the set of scripts to run
11:56 * crab mopes miserably after discovering that he has to have a root canal excavated tomorrow.
12:00 marcus crab: I feel for you, buddy.
12:01 womble I had a root canal ~12 years ago.. it didn't hurt, hasn't ever since, and I got a blinging NHS gold cap to show for my troubles :-)
12:01 womble s/gold/"gold"
12:02 mire_ joined #mojo
12:04 * marcus has some gold fillings.
12:07 d^_^b joined #mojo
12:08 nic womble: prob worth looking at https://github.com/diegok/resque-perl
12:10 womble thanks, I've played with it and looks perfect
12:11 womble wondering if I should just get the worker process to talk back to the controller via a websocket vs using redis
12:12 nic redis is nice for the looser coupling, eg if controller is down or too busy
12:15 nic for my own needs it's required that the worker is robust, lightweight (eg no moose), and more sophisticated (context switching), while the controller needs a scheduler, and exceptions need to be monitored/communicated externally
12:15 nic but I started all that a year ago and still nothing ready for publication (even though a version is masquerading in our 'production' env :) )
12:18 odc joined #mojo
12:20 [1]womble joined #mojo
12:20 d4rkie joined #mojo
12:22 womble nic: on the controller side, do you have something like a separate loop that waits on reads from redis?
12:22 womble shame i can't sponge off your code :(
12:22 KindTwo joined #mojo
12:23 crab why can't you?
12:23 crab oh, presumably because nic isn't diegok and his code isn't resque-perl
12:24 diegok oh!, i'm here :)
12:25 crab kind of you to have the same nick as your github username. makes things much less confusing. ;-)
12:28 womble diegok: don't suppose you've ever looked into integrating resque-history with resque-perl?
12:28 diegok crab: :-)
12:29 womble i guess it's a completely separate affair, i tinkered with the ruby version and it's really nice to see all your job history in resque-web
12:30 diegok womble: no, I've never done that... but i was requested to make resque-perl pluggable with roles and I did it but then no one ever used that feature...so I guess you can give a try
12:30 diegok It's on my list to remove that support and move all resque thing to Moo instead of Moose.
12:31 diegok unless it proves to be useful to anyone
12:33 womble I decided to store the history in SQLite, if the option had been there to hook into something like resque-history with resque-web I might've taken the shortcut though
12:34 d4rkie joined #mojo
12:34 womble I hope they said thank-you at least :)
12:40 diegok womble: https://github.com/diegok/resque-perl/issues/5
13:00 jaiballistic joined #mojo
13:04 womble diegok: if you look at that link I posted earlier, I would really probably be much better off storing the state of these jobs in redis. my solution probably won't be very reliable. hooking into the plugins would be much better, but harder
13:07 womble i think with my implementation job sets will just get hung if there is any message loss, which is better than carrying on blindly
13:22 denisboyun joined #mojo
13:33 diegok womble: it's really easy to plug into Resque::Job and then you can access redis server (an instance of Redis object) and do what that plugin must do :)
13:34 hummeleBop joined #mojo
13:51 hummeleBop joined #mojo
14:00 [1]womble joined #mojo
14:00 mire_ joined #mojo
14:03 hummeleBop joined #mojo
14:04 denisboyun joined #mojo
14:04 sh4 joined #mojo
14:23 denisboyun joined #mojo
14:29 gryphon joined #mojo
14:39 nicolaas joined #mojo
14:39 meshl joined #mojo
14:47 bluescreen joined #mojo
14:52 hummeleBop joined #mojo
15:10 arthas joined #mojo
15:17 btyler joined #mojo
15:20 asarch joined #mojo
15:21 d4rkie_ joined #mojo
15:21 dotandimet joined #mojo
15:28 * crab wonders where dot and dotandimet met
15:29 jovial_chat judging by ip address, israel
15:31 crab all i knew was, it couldn't have been turkey.
15:57 KindOne joined #mojo
15:58 dotandimet crab: who's do?
15:58 purl i heard do was just a loop where something controls/constrains it to execute once or de do do do de the da da
15:58 dotandimet I meant dot :(
15:59 crab dotandimet: i'm misparsing your nick as "dot and i met"
16:00 dotandimet LOL!
16:01 crab might be because i'm doped up on painkillers. ;-) i did actually know what your name is.
16:10 dotandimet crab: So you're after the root canal ?
16:10 crab no, sort of in-between. some prep work done today, will be completed tomorrow.
16:12 dsteinbrunner joined #mojo
16:13 * sri has been there too, the waiting sucked but it didn't hurt much
16:14 dotandimet crab: well, at least it'll be over fast ... ? I also remember a lot of waiting.
16:16 crab dotandimet: i think it's supposed to take about half an hour. or forty-five minutes.
16:16 sri the wait between sessions
16:17 dotandimet that
16:17 crab maybe if i pretend to be panic-stricken, they'll give me a whiff of nitrous ;-)
16:17 nic don't just accept a standard filling; ask what other plugins are available
16:18 crab haha
16:22 jovial_chat i've never had a root canal, i'm sure it's coming
16:22 jovial_chat had 3 wisdom teeth removed
16:22 jovial_chat they pretty much injected my gums
16:22 jovial_chat got out a screwdriver
16:22 jovial_chat and i'll let you imagine the rest
16:23 laouji joined #mojo
16:23 jovial_chat in the US they seem to give opiates for the pain
16:23 sri all 4 here... it really really hurt
16:23 jovial_chat here they gave me an unimpressed look
16:23 jovial_chat and sent me on my way
16:23 jovial_chat with a bit of cotton jammed in there
16:23 jovial_chat i never had that sort of pain
16:23 jovial_chat didn't even hurt that much while they were doing it, although one she had to put her full weight on the screwdriver, which was adorable
16:23 jovial_chat 5ft polish lady desperately trying to tear my teeth out
16:25 nic My genetic line has been optimised to minimise dental bills -- born with only 3 wisdom teeth (ok, so only 25% optimised)
16:25 jovial_chat me too nic, I was born in a free country ;)
16:26 crab i saw my wisdom teeth in the x-ray today. one of them points _upwards_
16:27 sri i think these days they just knock you out completely for wisdom teeth around here
16:27 jovial_chat haha my last remaining one points sideways out of my cheek
16:27 jovial_chat sri: oh man i wish laughing gas
16:27 jovial_chat my friend's had that in the UK
16:27 jovial_chat but literally all i've ever had is an injection into the gum
16:28 jovial_chat and into the roof of the mouth
16:28 jovial_chat that is the most painful bit, the roof
16:28 crab even with topical anaesthetic before the needle?
16:28 jovial_chat haha never had that either
16:28 nic it's actually a really crappy design; why would you put the teeth needing the most dramatic surgery in such an inaccessible place?  Reminds of some laptops I've worked on
16:29 nic [proof there is no Grand Design]
16:30 jovial_chat pretty much!
16:30 jovial_chat also tonsils
16:30 jovial_chat that was more painful than anything else i've ever done
16:30 jovial_chat they cleaned my ears out at the same time so violently they bled
16:30 jovial_chat so i woke up unable to speak, unable to hear with blood coming out of both places
16:30 jovial_chat and it was a couple days before i could eat without it really hurting
16:31 jovial_chat fuck wisdom teeth, they're trivial by comparison D:
16:31 jovial_chat oh hey i swore, so much for the politeness
16:31 nic there, crab, feeling better now? :D
16:35 jovial_chat how much does a wisdom tooth removal run you guys anyhow?
16:35 jovial_chat assuming at least some of you are insured
16:35 sri the moral of the story, don't forget to floss!
16:36 sri jovial_chat: free
16:36 jovial_chat literally never flossed, but i'm british so we're not as crazily obsessed with perfectly white teeth as you guys
16:36 crab what is this "you guys", btw?
16:36 jovial_chat americans/canadians
16:36 jovial_chat usually the majority of irc
16:36 crab not here
16:37 jovial_chat o rly? i heard we were short on brits
16:37 * sri hasn't had any dental problems in years (ever since he started getting ocd over flossing)
16:37 jovial_chat what's the demographics like here?
16:37 crab ah yes. brits and americans, the two kinds of people in the world ;-)
16:37 jovial_chat well when you think 'primary english speaking nations'
16:37 jovial_chat they certainly come first
16:37 jovial_chat india would be next, and i would expect to see them represented
16:37 crab o/
16:37 sri india is almost british
16:37 jovial_chat haha i wouldn't say that near indians
16:38 jovial_chat my coworker has some very strong feelings
16:38 jovial_chat on exactly what part of india is british haha
16:39 * sri doesn't know much about india
16:39 jovial_chat sri: as brits we basically stole everything of value, brutally treated their people
16:39 jovial_chat and then just sorta said 'yeah you have nothing more of use, go be a country we have divided beyond measure'
16:39 Adurah At least they have flag now.
16:40 jovial_chat think the USA and any other country basically
16:40 jovial_chat you learned all you needed to know about horribly oppressing a populace from us guys, and we're very sorry about that
16:42 sri http://wac.450f.edgecastcdn.net/80450F/thefw.com/files/2012/11/coloniesQuickmeme.jpg
16:43 jovial_chat sri: have you seen cbgrey or whatever his youtube nick is on the UK territories?
16:43 jovial_chat it's quite informative
16:43 * sri gets all his education from memes
16:43 jovial_chat https://www.youtube.com/watch?v=rNu8XDBSn10
16:44 jovial_chat well worth a watch
17:07 crab sri: a question about form_for. the way the arguments are constructed, it's not possible for it to get both $content and $cb, right?
17:09 crab i.e. if ref $_[-1] eq 'CODE', then there's no string before it.
17:09 crab ok, i guess that has to be true
17:20 marty_ jovial_chat:  awesome video.  very informative.   you guys have almost as many territories as the US does foreign military bases.  FIX ALL THE EMPIRES!
17:21 jovial_chat marty_: it really is, there's a number of others he does that are very useful
17:21 jovial_chat like when people are confused as to 'how the queen works'
17:21 marty the queen works?  I had no idea
17:21 jovial_chat i'm not exactly a royalist, but i'm not a republican either, and americans are very confused by this
17:21 jovial_chat she does indeed work
17:21 jovial_chat she's allowed us to have party based politics but without the ludicrous situation obama finds himself in
17:22 jovial_chat because she acts a symbolic figurehead and brings us hundreds of millions in revenue at the same time
17:22 marty I agree that our situation is ludicrous.  But I would scoff at "being allowed" by any person who is simply born into power.
17:23 jovial_chat indeed, but then you have to ask what the benefits are
17:23 jovial_chat for example, the crown MUST remain non partisan
17:23 jovial_chat instead of Obama who is clearly a democrat
17:23 jovial_chat we have the Queen, who must show no favour
17:24 jovial_chat we also have the house of lords, which is not directly elected and is hard to bias in one way or the other
17:24 marty The only truly non partisan people I know of are dead.
17:25 jovial_chat haha that's very true
17:25 jovial_chat but at least in the case of the crown, their allegience is to the people
17:26 marty Then why need a crown?
17:26 jovial_chat the alternative is an elected head of state, ie a president
17:27 marty that is one alternative (which is no better) but I am sure some day, a better one will arrise
17:27 jovial_chat sorry, door went
17:28 jovial_chat well several european countries have equally symbolic leaders
17:28 jovial_chat but there's not really a viable argument to switch to that system
17:28 jovial_chat when something has existed for more than a millenia, you need a very good argument to get rid of them :)
17:30 marty That argument will come when a royal family member comes to power who is batshit crazy and starts abusing their power (in the name of the children) .
17:30 jovial_chat marty: their power is symbolic only
17:30 jovial_chat they essentially can ask questions and hold up legislation
17:30 marty then again, why do you need them?
17:30 jovial_chat but the actual job of making law is delegated
17:31 jovial_chat the same reason any country has a figurehead
17:31 jovial_chat one could argue why does the US need Obama, why can't the house/senate just rule directly
17:31 marty I would agree with you on that
17:32 marty I'm not going to argue for the limitations of our current system.  it sucks, bad
17:34 sri marty: they make money
17:34 jovial_chat they do but it's relatively inconsequential
17:35 jovial_chat the real power they have for the UK is notability
17:35 jovial_chat everyone knows who "The Queen" is
17:36 sri i don't think that's true
17:36 jovial_chat which part?
17:37 marty Isn't the queen one of the Kardashian sisters?
17:37 sri think i misread
17:37 jovial_chat marty: ;)
17:38 jovial_chat sri: well my argument is just: all they do is promote the UK's interests and function as an ultimate check on power, if they are to be replaced, those properties have to be matched up
17:38 jovial_chat and i can't think how that is possible
17:38 bluescreen_ joined #mojo
17:38 jovial_chat if you end a millenia or more of history, you gotta have an insanely good replacement
17:39 jovial_chat the special weirdness is that she's also the head of the anglican church, which annoys a lot of atheists
17:40 sri http://www.youtube.com/watch?v=bhyYgnhhKFw # how much money the royals are worth
17:41 jovial_chat yeah that's a particularly decent summation
17:41 marty Just cuz something has existed for millennia does not meat is it "good" or even the best option.   It could me it was in place by oppression.  like um, british colonies.
17:41 jovial_chat also you see it briefly in that video, but check out our awesome new coinage: https://upload.wikimedia.org/wikipedia/en/a/a8/New_British_Coinage_2008.jpg
17:41 jovial_chat marty: oh it certainly was put in place by oppression
17:41 jovial_chat violence and horror in huge measure
17:42 jovial_chat but the point is that it still exists, the UK is as free or freer than most other nations and still prosperous and a global power
17:42 jovial_chat that's one hell of a difficult challenge, and the system still works and is still going strong
17:43 jovial_chat so perhaps it's not good, nor the best option, but it's effective
17:43 marty so is water boarding
17:43 jovial_chat and they don't hang people in the tower anymore, so i'd argue that these days it's pretty good too :)
17:43 sri yea, those coins are awesome
17:43 jovial_chat marty: right but we don't permit water boarding
17:43 jovial_chat and there have been a number of scandals over just having UK staff in the same room
17:44 jovial_chat so i think that's an unfair comparison
17:44 jovial_chat sri: darwin about to be removed from our £10 note though :(
17:44 sri :(
17:44 jovial_chat not politically motivated though, but a point of pride for us
17:44 marty no, but I guess if anyone gets out of line you could limit the sale of salt to government entities only. that will show those bastards!
17:45 jovial_chat marty: the thing is the only power the Queen really has is to effectively dissolve the government, she can't directly rule, only reign
17:45 jovial_chat so there are checks on both sides in that respect
17:45 jovial_chat parliament can't pass laws that would be oppressive to the populace (in theory)
17:45 marty I'm sure our southern population is cheering the removal of Darwin.  :(
17:46 jovial_chat and the queen cannot arbitrarily make law without consent of parliament
17:46 jovial_chat marty: oh i'm sure it'll be all over creationist websites and conservapedia
17:46 marty effectively dissolve the government?   No Power?  Did I miss something?
17:46 jovial_chat marty: that is the power the queen has, to select parliament
17:47 jovial_chat in an election, we elect a party
17:47 jovial_chat and that party must form a majority
17:47 jovial_chat that majority must then seek the queen's assent
17:48 jovial_chat it's certainly possible for fascist parties to get democratically elected
17:48 jovial_chat so in principle this functions as an additional check
17:48 jovial_chat someone who's only concern is the continued wellbeing of the UK is not likely to permit a fascist party to form a government
17:49 jovial_chat it's pretty complex, but it's been around for so long that's a natural consequence really
17:49 marty Like i said, when a batshit crazy becomes king and says "I hearby do not assent to the parties  and therefor dissolve all future parties (becuase of terrorism)" things will change
17:50 jovial_chat they can't 'therefore dissolve all future parties'
17:50 jovial_chat i mean someone could try
17:50 jovial_chat but good luck
17:50 purl You'll need it.
17:50 jovial_chat now that's funny ^
17:50 marty just come with a new reason each time
17:50 jovial_chat it would lead to revolt
17:50 jovial_chat the ultimate power still is vested in the people
17:51 jovial_chat besides, the chances of a truly mad king are pretty insignificant these days
17:51 marty ok fine.  moral of story is.   Monarchy is no better than all current alternatives.
17:51 jovial_chat the best we've got is charles, who's a new-age hippy type
17:51 jovial_chat it has parts that are better, parts that are worse imo
17:51 jovial_chat i just don't see a convincing reason to change it
17:52 jovial_chat i would argue that the biggest problems in the US are procedural
17:53 jovial_chat anyway this is all getting pretty off topic, time for another nick change
17:54 jovial_chat can't find a pithy enough synonym
18:01 marty damn.  tailable mango cursor locks everything up when the cursor reaches the last record.
18:02 sri marty: that doesn't sound right
18:03 marty I've tried with both await_data 1|0 and still get the same thing.  I'll see if I can create a lite app that demonstrates the problem.
18:04 marty It's probably something I am doing wrong.
18:14 mire_ joined #mojo
18:21 dod joined #mojo
18:24 dvinciguerra joined #mojo
18:35 sri marty: certainly, considering there's a unit test for tailable cursor and cocnurrency ;p
18:42 zackiv31 joined #mojo
18:53 tba joined #mojo
18:53 tba hi all
18:54 tba got a mojo routing question :) probably a stupid question, but its baffled me!
18:54 dsteinbrunner joined #mojo
18:54 tba if I have /:something, where something can be one of two things (same pattern, say girls names or boys names) - but I want it to go to a different controller/action, how?
18:55 tba atm I have a bridge with placeholder /:something, and the bridge works out from db what type of thing it is, but how do I get that to go to a controller/action (not sure how I'd attach a ->to on the end)
18:56 tba or put more simply, i need two routes to two controllers, but both have the same route pattern, only being able to decide in the bridge which type it is
18:58 tba (something like this: https://gist.github.com/ian-kent/7811154 - atm both route to one controller and its handled in the template, which is horrible)
18:59 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Conditions
18:59 rem_lex joined #mojo
18:59 tba ahh damnit, thought i'd read that guide properly lol
18:59 tba thanks sri
19:04 abra_ joined #mojo
19:12 fhelmbe__ joined #mojo
19:15 tba next stupid question (sorry!)
19:16 tba should $c->continue work in a condition to restart the dispatch chain (using non-blocking mango from the condition)
19:18 sri no
19:18 tba ah...
19:18 sri you should have said that earlier... non-blocking rules out conditions
19:18 tba sorry
19:19 tba is there another 'right way to do it', or is delegating to template a reasonable option?
19:19 tba (well I say reasonable... 'acceptable')
19:20 tba hmm... can i put non-blocking code in a bridge (to work out what :something is), then attach ->over after that?
19:33 tba seems not :(
19:34 highflying joined #mojo
19:38 laouji joined #mojo
19:38 cfedde joined #mojo
20:06 mire_ joined #mojo
20:15 dotandimet joined #mojo
20:28 cooper joined #mojo
20:55 cooper joined #mojo
21:37 sri marcus: some inspiration in case you decide to work on a mojo-admin https://github.com/gterrono/houston
21:38 * sri would love a mojo-admin for mango
21:38 dsteinbrunner joined #mojo
21:44 meshl joined #mojo
21:55 KindOne joined #mojo
22:01 marcus sri: Interesting. I was actually thinking about that today. How to do the schema reflection and stuff in a schemaless database. And also that this seems like a perfect case for bootstrap.
22:01 sri i assume there is no schema reflection
22:02 sri your create form would have to be dynamic, maybe "add new field" button with "select type of new field"
22:03 womble joined #mojo
22:03 sri you could also select the first document and use it as a blueprint for the default
22:04 sri oh, maybe steal ideas from the mongohq admin interface :)
22:05 sri afair they make you enter mongodb commands with javascript syntax
22:06 sri lots of room for creativity
22:08 mire_ joined #mojo
22:08 womble If I want to subscribe to events from Redis with Mojo::Redis immediately at startup of my Mojolicious::Lite app, do I need to create an additional loop with $redis->ioloop->start ?
22:09 womble In the example on CPAN - http://search.cpan.org/~jhthorsen/Mojo-Redis-0.9920/lib/Mojo/Redis.pm - there is standalone use of Mojo::Redis, or inside a route in Mojolicious::Lite
22:10 womble I don't think I want to use a route though (re: "immediately at startup") so how it fits together is not clear to me
22:45 batman womble: you can't have an ioloop in the main application. the ioloop is run by all the children
22:45 womble experimenting says $redis->ioloop->start is stupid before app->start
22:46 batman womble: yes. that is very stupid.
22:46 womble :)
22:46 batman womble: i don't think you want what you're asking for.
22:46 womble so how do you basically have an infinite while loop popping messages from redis?
22:46 batman you run a worker beside your web app
22:47 batman next to. as in a separate process.
22:48 batman and then you do $redis->blpop('queue', 0, sub { ... });
22:50 womble so... how can the separate process communicate with the web app? basically i want my mojolicious::lite controller to submit jobs to resque with resque-perl, and have the resque workers callback the controller when finished, so controller can update a database
22:50 womble i thought the resque worker -> controller comms should use redis
22:50 womble but it sounds like the logic for updating the database now might need to lie with the separate worker to pop from the queue
22:51 batman you check for status updates in the database on a request
22:51 batman you have no control on how long a mojo worker will live, so a long running while-whatever is always a really bad idea
22:52 womble after resque worker has completed its work, i want the controller to push out an update to html tables on all clients via websocket
22:52 dsteinbrunner joined #mojo
22:53 batman that's simple enough: let the ws connection do blpop from the "message:$pid" list or something
22:53 womble so the controller knows about the connected clients, how does the "pop" worker tell the controller what happened to the resque worker job?
22:53 batman it doesn't.
22:53 womble ws in controller or pop worker?
22:53 batman it tells the database about the status, and then the controller pops the status and hands it to the client
22:53 batman it tells = the worker job
22:54 womble but how will the controller know the database has updated? timer polling?
22:54 batman no! blpop ffs
22:54 batman you're using redis don't you?
22:54 womble haha sorry
22:55 batman http://redis.io/commands/blpop
22:55 * batman gives up
22:55 batman Zzzzz
22:56 womble I have tried to warn people on here I am very stupid. sorry
22:57 marcus womble: do you usually wear a sign? :-)
22:58 batman womble: saying you're stupid only makes you dumber
22:58 batman but i would say you're a bad listener / reader
22:58 marcus http://uphillwriting.org/2011/10/25/hate-stupid/im-with-stupid/
22:58 batman you need to pay attention. that way you can learn how to make clever questions.
22:58 batman marcus: sorry for not converting wirc today.
22:59 marcus batman: Still on a deadline?
22:59 batman been working like a crazy man.
22:59 marcus sounds moderately fun.
22:59 batman no, but i kind of fucked up a lot today while doing the release :P
22:59 marcus oopsie :)
22:59 * womble hands out rotten fruit for throwing at him
23:00 batman yeah. good think i'm faster than lucky luke at fixing stuff ;)
23:00 batman and most of the oopsie's i made was before pushing stuff to prod
23:00 batman renaming-- # stupid little mistakes
23:00 marcus <3 Stage
23:01 marcus let's rename everything! :)
23:01 batman that's what i'm doing :)
23:01 marcus I was talking to a nerd at oslo.pm who was worried about mongo performance btw
23:02 batman the problem was that i thought all was ready for production, but then something wasn't so i had to start cherry-picking....... *bad idea*
23:02 marcus he was running some other setup now, with a postgresql backend, and about 300 channels....
23:02 marcus oh, yeah, that can be scary :)
23:02 womble batman: main problem is I don't understand the terminology you used in your explanation - "you check for status updates in the database on a request" - request from whom?
23:02 batman oh.
23:02 batman marcus: wtf?! 300 channels?
23:02 womble "the controller pops the status and hands it to the client" - in what loop does the controller do the blpop?
23:03 batman womble: requests are (client --> server)
23:03 marcus batman: Yeah, I don't think he's the use case we should optimize for ;)
23:03 batman THERE'S NO FUCKING LOOP!
23:03 * womble slaps forehead
23:03 batman womble: read up on blpop. and then read it again.
23:04 batman marcus: still. i don't get how mongodb is too slow
23:04 womble when i say controller, i am talking about the thing i app->start (mojolicious::lite app)
23:04 marcus Then you will see, it is not the spoon that bends, it is only yourself.
23:04 womble i understand that blpop does nothing until a message is pushed onto the queue
23:04 womble but WHERE does the blpop go in the controller?
23:05 batman womble: where do you think? ***think harder****
23:05 marcus batman: yeah, I'm not sure it will be an issue either. And I certainly don't want to maintain multiple backends..
23:05 batman tip: where you have your ws code
23:05 womble I can see in your example it could go under a route
23:05 laouji joined #mojo
23:05 batman womble: OF COURSE IT HAS TO
23:06 womble but my understanding is the code in a route only activates when a request is made to the route
23:06 batman the websocket route will do the blpop and server the response to the client/browser/whatever
23:06 womble and i want it to blpop from startup inifinitely
23:06 batman marcus: i think talking about performance when you don't have ONE MILLLION USERS is just stupid.
23:07 batman womble: NO YOU DON'T.
23:07 purl Oh yes I do
23:07 batman womble: want me to tell you that again?
23:07 womble obviously i don't want the main loop to block
23:07 batman marcus: unless you're running mojo on a commodore 64...
23:08 marcus batman: well, we were taxing the shit out of my little vm :)
23:08 batman womble: you're not even close to figuring this out.
23:08 marcus batman: mostly ioloop tho
23:08 marcus womble: what do you want to happen when bl pops?
23:08 batman womble: i would hire a consultant to do the job if i was you.
23:09 batman marcus: that's because the vm was running on the c64 hardware :P
23:09 batman it was like 64MHz CPU and 1k of ram...
23:09 womble update a database table, send some <td>'s to all clients that previously connected over a websocket
23:09 marcus xen-on-c64
23:09 marcus batman: actually a c64 has a 1mhz cpu and 64k ram
23:09 batman i know.
23:10 batman 1MHz of pure awesomeness!!!!
23:10 womble batman: i sincerely apologise for frustrating the sh1t out of you and thank you for trying
23:10 dvinciguerra joined #mojo
23:10 marcus batman: well, it has a lot of great supporting chipsets too :)
23:10 batman marcus: after all... 64K is all you'll ever need ;)
23:10 marcus I thought that was 640k
23:11 batman it was?
23:11 * marcus used to tweak the shit out of his dos config to run memory hungry demos
23:11 batman i've been living a lie :(
23:11 marcus batman: yeah, bill gates didn't run c64
23:11 batman crap. it's 60 minutes past bedtime.
23:11 batman marcus: hahaha. true that.
23:12 batman if he did, he would probably know a thing or two about optimizing ;)
23:12 batman see you around! stay smooth.
23:13 marcus 640K ought to be enough for anybody. Often attributed to Gates in 1981. Gates considered the IBM PC's 640kB program memory a significant breakthrough over 8-bit systems that were typically limited to 64kB, but he has denied making this remark.
23:13 marcus (https://en.wikiquote.org/wiki/Bill_Gates)
23:13 * sri wouldn't be too worried about mongodb performance for wirc
23:13 marcus sri: Good
23:13 sri when i was considering the irc archive i had a dual collection design in mind
23:16 sri one collection type you archive all messages to, and one capped collection where you insert the same messages, hypnotoad workers would have one global tailable cursor on the capped collection and distribute realtime messages to websocket subscribers
23:16 womble joined #mojo
23:17 sri capped collections small enough to fit into ram
23:19 marcus Yeah, that's pretty much what we had in mind as well.
23:19 marcus I think you have to use capped collections to have tailable cursors, right
23:19 sri yes
23:21 marcus I'd really like to buy Bee, but I think it's a bit expensive for a github issues desktop client...
23:21 billy-whiz joined #mojo
23:21 * sri is moving away from all kinds of desktop clients and tries to live on the web :)
23:21 marcus (http://neat.io/bee/)
23:22 marcus I've moved away from textmate now, back to vim
23:22 sri blasphemy!
23:22 jovial_chat vim or bust
23:23 jovial_chat sri: bought a chromebook?
23:23 * sri hugs his macbook air
23:23 jovial_chat tempted to buy my mum one, cheaper than a phone, can be lost or dropped etc
23:23 jovial_chat haha so much for moving away from the desktop
23:23 jovial_chat with a $2500 laptop
23:23 marcus desktop clients..
23:24 jovial_chat yeah but without desktop clients you don't need big ssds, or i7 processors etc
23:24 marcus starting at $1099
23:24 jovial_chat ya but nobody buys the $1099 one
23:24 sri ssds and i7 processors are great for running tests and compiling shit
23:24 jovial_chat sri: ya but i just do that on a dedi box
23:24 marcus jovial_chat: I never want to have a machine without ssd again
23:24 jovial_chat marcus: oh no doubt but i like chromebook style
23:25 jovial_chat little 16gb ssd or whatever
23:25 jovial_chat 100gb space on drive
23:25 marcus jovial_chat: chromebook seems like the most useless laptop every
23:25 marcus the chromebox pixel is kinda pretty hardware-wise tho
23:25 jovial_chat marcus: if you don't use desktop apps, why would you need anything more than chromeos?
23:25 jovial_chat that's why i figure it'd be nice for my mum
23:26 marcus jovial_chat: I actually think chrome is the most cpu/memory hungry beast on my mac :)
23:26 sri can confirm, chrome is a beast
23:26 jovial_chat marcus: maybe so but blame modern websites for that, my old 2.8ghz c2d can barely keep up with some sites
23:26 jovial_chat in ff or chrome or chromium or anything
23:26 jovial_chat drives me mad
23:27 sri the fact that chrome now has adb support and can talk to android devices made me chuckle
23:27 jovial_chat but yeah i have a really expensive laptop i got for free, and i just hate using it
23:27 jovial_chat it's too big, it's too annoying
23:27 sri (natively without sdk)
23:27 jovial_chat i bought an asus tf101 a few years ago
23:27 jovial_chat it's slow as balls and fairly underwhelming
23:28 jovial_chat but i don't ever really want a 'proper' laptop again
23:28 sri back on topic... vim project search still sucks...
23:29 marcus sri: I use ack on the command line, and ctrl+p
23:29 jovial_chat i'm cheap, i grep/ack
23:29 sri yea, doesn't cut it for me
23:29 jovial_chat what are you looking for exactly?
23:29 marcus search and replace ? :)
23:30 sri http://i.imgur.com/EbM6gWN.png # need real find in project, same reason i can't stand sublime text 2/3
23:30 sri something comfortable
23:30 sri i search in project *a lot*
23:31 jovial_chat and i assume by 'in project' you mean 'in current dir' or something more specific?
23:31 sri current dir with subdirs
23:31 jovial_chat looks like just that but i don't use textmate or apple stuff in general
23:31 jovial_chat sri: i'm slowly adding to my vim config so will keep an eye out
23:32 sri i'm a vim user too
23:32 marcus sri: Ever tested http://www.vim.org/scripts/script.php?script_id=69 ?
23:32 sri just not primarily
23:33 marcus All three Nordaaker coders are vimming now.
23:33 sri don't care about sidebar/organization, crtlp is navigation enough for me, what i need is quality find in project
23:34 marcus sri: That thing had find in project, but I think maybe it's a bit rudimentary
23:34 marcus based on http://vim.wikia.com/wiki/Find_in_files_within_Vim I guess.
23:35 sri and i hate searching code with regular expressions ;p
23:35 sri ESCAPE ALL THE THINGS
23:36 jovial_chat m## best perl feature
23:36 jovial_chat potentially :D
23:37 Jonis http://www.vim.org/scripts/script.php?script_id=2438 might do what you want
23:39 sri if there was anything as good as i would expect i think janus would include it :) https://github.com/carlhuda/janus
23:41 jovial_chat i was wondering why my config wasn't working locally
23:41 jovial_chat i'd installed 'ack' instead of 'ack-grep'
23:42 jovial_chat ACK is a highly versatile Kanji code checker/converter.  ACK can do
23:42 jovial_chat reciprocal conversion among Japanese EUC, Shift-JIS and 7bit JIS.
23:42 jovial_chat not so useful!
23:54 basiliscos joined #mojo

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