Camelia, the Perl 6 bug

IRC log for #mojo, 2012-10-26

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

All times shown according to UTC.

Time Nick Message
00:09 good_news_everyone joined #mojo
00:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lNdI6w
00:09 good_news_everyone [mojo/master] test tweaks - Sebastian Riedel
00:09 good_news_everyone left #mojo
00:09 * sri commits
00:21 Averna joined #mojo
00:58 dvinciguerra joined #mojo
01:00 laouji joined #mojo
01:28 Adura joined #mojo
01:36 xaka joined #mojo
01:42 d4rkie joined #mojo
02:06 * tempire phears commitment
02:06 * tempire stashes
02:26 rem_lex|pivo joined #mojo
02:35 noganex joined #mojo
03:12 tempire this is kind of neat http://aozora.github.com/bootmetro/
03:12 pie Is parse/build;compile;interpret* the right pattern for using Mojo::Template? Or did I miss something?
04:10 rem_lex| joined #mojo
04:15 bluescreen joined #mojo
05:05 laouji joined #mojo
05:08 ovnimancer joined #mojo
05:10 Foxcool joined #mojo
05:35 marty joined #mojo
06:34 dpetrov_ joined #mojo
06:40 michaelfung joined #mojo
06:54 mpgutta joined #mojo
06:54 jwang joined #mojo
07:19 Mike-PerlRecruiter_ joined #mojo
07:20 pau4o joined #mojo
07:22 Britzel joined #mojo
07:26 jamesw joined #mojo
07:40 batman joined #mojo
07:47 arthas_ joined #mojo
07:54 cosmincx joined #mojo
08:01 judofyr joined #mojo
08:11 pierrick joined #mojo
08:21 Vandal joined #mojo
08:37 spleenjack joined #mojo
08:44 ver joined #mojo
08:48 pau4o left #mojo
08:50 Mike-PerlRecruiter_ joined #mojo
08:58 michaelfung #mojo
08:59 michaelfung left #mojo
08:59 michaelfung joined #mojo
09:01 kitt_vl left #mojo
09:18 nic I like the idea of bootmetro -- does it let you configure your own custom bluescreen
09:26 migo joined #mojo
09:44 GabrielVieira joined #mojo
09:44 Britzel_ joined #mojo
09:45 Vandal joined #mojo
10:09 marty joined #mojo
10:11 nic ooh, I didn't know about the IcoMoon font icon set http://keyamoon.com/icomoon
10:45 nic diegok: Do you ever need to manipulate resque queues?
10:46 nic something like "remove all jobs that match this profile ..."
10:47 nic I can think of a few different ways of doing it, but none of them is pretty and I'm thinking I'm not the first person to be here
10:49 judofyr nic: two separate queues; pop from one, push if it not matches?
10:51 asarch joined #mojo
10:52 nic put it back to the end of the queue?
10:52 nic but then I'm putting the queue into an unpredictable order if you leave workers consuming while you do this
10:59 nic one option is to move the entire queue to a 'static' key (that no workers consume) while you manipulate it
11:07 diegok nic: what judofyr said.
11:08 diegok If you manipulate one queue you have one problem.
11:08 nic diegok: Do you stop workers or just accept a mix-up of ordering?
11:08 diegok you can pop-push from the same, but you can have more elements added in the middle
11:08 diegok so it becomes hard
11:09 diegok I never stop workers
11:09 nic In Soviet Russia...
11:09 diegok :D
11:09 diegok why you need to remove jobs?
11:09 judofyr nic: maybe you can shift instead?
11:10 judofyr shift from one queue, unshift into another
11:10 diegok can't you signal workers to do nothing with those in some way?
11:10 diegok so you keep processing normally?
11:11 nic another option is to use a 'marker' job -- when workers see that on the front of the queue it means 'do not disturb'
11:11 nic like those silly signs telling you you can't use the public toilet while it's being cleaned
11:11 diegok what I do is I have different queues separated by what can make jobs to be deleted so I just remove the queue.
11:12 diegok But in my case is too many
11:13 diegok not too many
11:13 nic I have them aligned by simple priority: emergency, fast, normal, slow, optional
11:13 nic I'm thinking I'll trial moving the queue aside while workers are trying to consume, to see whether the workers die or lose connection
11:14 nic if the workers stay happy then that'll be an ok solution
11:14 diegok so, you rename queue?
11:14 diegok that will work
11:14 nic yeah
11:14 diegok you rename, new jobs keep going to the re-created old queue
11:14 diegok and you can look all jobs left and re-queue
11:15 pierrick joined #mojo
11:15 diegok my only concern is you need to peek at redis to do that (I think I have no command for that)
11:16 nic why do I need peek?  (not disagreeing, just not seeing it yet)
11:17 sri marcus: you want to change the Mojo::Template design? https://github.com/kraih/mojo/issues/404
11:19 asarch joined #mojo
11:21 ki0 joined #mojo
12:17 Gedge joined #mojo
12:21 * sri yawns
12:48 * augensalat has a question about uploads: Bigger uploads are stored in the directory specified by Mojo::Asset::File->tmpdir. Esp. for big uploads I would like to have the temporary file in the same directory as the eventual file, so Mojo::Asset::File->move_to() would do a rename instead of copy&delete. How can I do that?
12:52 augensalat addendum: The eventual upload directory is not a constant, it is specified by a parameter in the same request.
12:59 marty joined #mojo
13:19 jnap joined #mojo
13:23 Lucas1 joined #mojo
13:26 rem_lex|pivo joined #mojo
14:25 gryphon joined #mojo
14:27 inokenty joined #mojo
14:29 knshaum joined #mojo
14:40 marty joined #mojo
15:21 d4rkie joined #mojo
15:24 Lucas1 joined #mojo
15:38 * sri releases
15:49 Lucas1 joined #mojo
15:58 judofyr_ joined #mojo
16:05 labrown joined #mojo
16:09 xaka joined #mojo
16:21 bluescreen joined #mojo
16:47 batman joined #mojo
17:16 oldiie joined #mojo
17:16 oldiie llo, can someone help me with getting something with Mojo::DOM
17:16 oldiie <div class="txt-block">
17:16 oldiie <h4 class="inline">Opening Weekend:</h4>
17:16 oldiie €2,137,456
17:16 oldiie (Italy)
17:16 oldiie (15 April 2012)
17:16 oldiie (420 Screens)
17:16 oldiie </div>
17:16 oldiie I just want to have "€2,137,456 (Italy) (15 April 2012) (420 Screens)"
17:17 sri oldiie: i told you already, please do not paste into an irc channel!
17:17 sri it is considered extremely rude
17:22 sri $dom->at('#txt-block')->text
17:22 sri ops
17:22 sri $dom->find('.txt-block')->pluck('text');
17:46 oldiie and what if I use while ($dom->find('div[class="txt-block"]')) { }
17:46 oldiie for those <div class="txt-block"> </div> blocks because they are there serveral times...
17:59 gryphon joined #mojo
18:16 sh4 joined #mojo
19:07 oldiie noone?
19:16 Mad_Dud joined #mojo
19:18 Mike-PerlRecruiter_ joined #mojo
20:04 sh4|2 joined #mojo
20:11 xaka joined #mojo
20:28 sh4 joined #mojo
20:28 jberger joined #mojo
20:29 * jberger is going to try to lurk here more often
20:30 jberger sri: I do have a question though
20:31 jberger if I am trying to implement a handler like EPRenderer for a LaTeX template
20:31 jberger certainly I could clone EPRenderer and amend it
20:31 jberger but other options might be allow EPRenderer to take an optional template class
20:32 jberger so that I can subclass Mojo::Template (I'm calling it MojoX::Template::LaTeX) and allow EPRenderer to instantiate that rather than Mojo::Template
20:33 jberger in the first case (clone) it might be handy to have a function which generates the helper strings for the prepend
20:33 jberger because that is what might get out of date should I go that route
20:35 sri jberger: https://github.com/kraih/mojo/blob/ma​ster/t/mojolicious/twinkle_lite_app.t
20:36 Adura That's a lot of cursing in that template.
20:37 jberger I understand that, my concern is repeated code
20:37 sri don't think i want to go further than that
20:37 jberger I want to have a MojoX::Template::LaTeX (possible now thanks to escape)
20:38 jberger but I would have to pass all the same default options to EPRenderer as are already built into MojoX::Template::LaTeX
20:38 jberger I want MX::T::L so I can use it outside of a webapp
20:41 sri for now it's better you clone the plugin imo
20:42 sri we've had bad experiences with dependency injection
20:42 GabrielVieira2 joined #mojo
20:42 sri if i allow that suddenly we can't change the methods the plugin calls... adds a whole new layer of trouble
20:43 jberger https://gist.github.com/3961368
20:43 jberger I understand
20:44 sri and be careful when cloning, EPRenderer may use private APIs when talking to EPLRenderer
20:44 jberger would it be possible to let EPRenderer (or some other class) have a method to generate the string that does the helper string creation?
20:44 sri their relationship may change
20:44 jberger right that's what I'm worried about
20:44 jberger it why I would rather use this framework
20:45 jberger honestly I will probably go the twikle route
20:45 sri ifraid i'm also not very keen on that
20:45 sri s/i/a/
20:45 jberger and just repeat the template tag code in two places
20:45 sri that's all stuff i like to change a lot
20:46 jberger you see my point though right?
20:46 sri of course, but i hope you see my point too
20:47 jberger definately
20:47 jberger just making sure I was being clear
20:47 sri i still hope to merge EPLRenderer into EPRenderer at some point
20:47 * jberger hates when he sees a spelling error he made in the IRC log
20:48 sri EPLRenderer only exists for backcompat
20:48 jberger good to know
20:48 jberger it did seem oddly coupled, the way it passes the handling off assumes there is an epl handler
20:48 jberger I could have guessed that was in the works
20:49 sri i kinda forgot about it :)
20:49 jberger see, aren't you glad I'm here :-P
20:49 sri \o/
20:49 jberger ok, well this one I can leave alone
20:50 jberger I'm not opposed to a small amount of repeated code as I would rather let EPRenderer handle it
20:51 sri there's also a ripple effect
20:51 jberger ?
20:51 sri there are more plugins that have a template option... and would be inconsistent without a template_class
20:52 sri those would also have to be extended, and tested
20:52 jberger gotcha
20:53 sri like JSONConfig... on which other plugins on CPAN are based, like YAMLConfig
21:01 sri jberger: what does your subclass of Mojo::Template do anyway?
21:02 jberger just defines all the different tags and marks
21:02 jberger nothing special
21:02 jberger it would just save repeated code
21:02 jberger let me make a gh repo for my local code
21:02 sri ok, that's very little repeated code :)
21:02 jberger right
21:03 sri no point cloning EPRenderer for that
21:04 sri just make a plugin that sets up a custom EPRenderer with your template hash and name
21:05 sri sub register { my ($self, $app, $conf) = @_; $app->plugin('EPRenderer' => {name => 'lt', template => {...}, %$conf}) }
21:05 jberger https://github.com/jberger/Mojolicious-Plugin-​LaTeX/blob/master/lib/MojoX/Template/LaTeX.pm
21:06 jberger will it merge the conf hashes?
21:06 jberger I can look into that
21:06 sri no deep merge of course, but ye
21:07 jberger I did give an impromptu lightning talk on Mojo::Template last night at Chicago.pm
21:07 jberger kinda fun
21:10 sri ooooh, notifications api for github
21:10 sri http://developer.github.com/chang​es/2012-10-26-notifications-api/ # fun!
21:16 sri i really should use the github api more for examples :)
21:16 sri mojo get https://api.github.com/legacy/issue​s/search/kraih/mojo/closed/jberger /issues/0/title
21:17 jberger haha, nice
21:21 jberger yeah, thats a good thing to use for examples, I agree
21:23 sri this one is neat too
21:23 sri mojo get https://api.github.com/legacy/r​epos/search/mojo?language=perl /repositories/0/description
21:26 jberger now I've learned something
21:26 jberger I didn't know about json pointers
21:26 jberger looks kinda like xpath?
21:26 sri don't get too used to them, the RFC is not yet finished :)
21:27 sri they keep chaning the escaping
21:27 sri *+g
21:28 jberger again I ask, why wouldn't you want your web framework to come with all this built in
21:28 sri not quite xpath, they just identify one endpoint
21:28 * jberger doesn't really know xpath either
21:28 sri there was some kind of jsonpath, but it never got close to a spec
21:29 sri JSONPointers were made for JSONPatch, nother RFC in the works
21:30 jberger its cools stuff for all the built in REST stuff
21:30 sri yea, i have a hunch jsonpointers will get used a lot in the future for all kinds of json rest apis
21:31 sri couchdb was using it too afaik
21:33 sri the escaping is a bit funny though ~0 = ~ and ~1 = /
21:34 jberger really?
21:34 jberger ick
21:44 jberger https://github.com/jberger/Mojolicious-Plugin-La​TeX/blob/master/lib/Mojolicious/Plugin/LaTeX.pm
21:44 jberger https://github.com/jberger/Mojolicious-Plugin-​LaTeX/blob/master/lib/MojoX/Template/LaTeX.pm
21:44 jberger yeah, some repeated code, but I can live with it
21:44 jberger just thought I would ask is all :-)
21:45 jberger now some compiler handling and I'm on my way to webapps that can deliver PDFs
21:46 jberger (or LaTeX source)
21:46 jberger via respond_to I would imagine
21:46 sri :)
21:48 sri https://github.com/jberger/Mojolicious-Plugin-LaTe​X/blob/master/lib/Mojolicious/Plugin/LaTeX.pm#L22
21:48 sri that line needs to be moved up a little
21:49 jberger oh, yeah
21:49 jberger what other conf might someone send to EPRenderer
21:49 jberger ?
21:50 sri a name surely
21:50 jberger (referring to your snippet above)
21:50 jberger oh
21:50 jberger I get it
21:50 sri then you can have multiple with different tags
21:50 jberger so this really would become a wrapper for EPRenderer that way
21:51 sri a rather sane wrapper yea
21:51 jberger there may be other non-EPRenderer configuration though
21:51 sri which reminds me that i was never actually happy with the template option :p
21:51 jberger for example controlling the MIME type
21:51 * jberger runs away with fingers in ears
21:52 sri :D
21:52 jberger if you weren't this isn't CPAN yet (and likely won't be for a while)
21:52 jberger I want to get the PDF handling in before I would do that
21:53 sri put it on CPAN, it's a good example
21:53 sri DO IT!
21:53 jberger AAAAAAAAAAAAAAAAA
21:53 jberger ok, PDF can wait
21:53 jberger 8)
21:54 jberger interacting with TeX compilers is annoying
21:55 jberger hopefully CPAN will have something for me there
21:55 jberger and I'm 95% certain that it cant compile in memory, so I will need temporary directories and there will be server-side file IO etc
21:55 jberger so this isn't going to be high-throughput
22:00 jberger ok like I said, I intend to lurk more often
22:00 jberger thanks again!
22:00 jberger o/
22:01 jberger have a good weekend all!
22:01 sri \o
22:05 Adura How can I make $c->rendered let me do non-to-browser code after the request is finished? Is there after_after_dispatch?
22:34 Adura $c->tx->on(finish => sub { ... }); Seems sufficient.
22:39 jzawodn joined #mojo
23:51 sri or just $c->on(finish => sub {...});
23:56 Adura Ahkay.

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