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

IRC log for #mojo, 2015-09-18

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

All times shown according to UTC.

Time Nick Message
00:00 asarch joined #mojo
00:07 good_news_everyon joined #mojo
00:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnTp6
00:07 good_news_everyon mojo/master 0cd1aa3 Sebastian Riedel: another Mojo::DOM example
00:07 good_news_everyon left #mojo
00:17 Ptolemarch joined #mojo
01:11 Ptolemarch joined #mojo
01:18 asarch joined #mojo
02:00 ajmrch joined #mojo
02:04 bpmedley I just got a 500 error with google.. :)
02:05 asarch__ joined #mojo
02:05 jberger :o
02:05 Ptolemarch joined #mojo
02:16 ajmrch joined #mojo
02:18 good_news_everyon joined #mojo
02:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnkCK
02:18 good_news_everyon mojo/master ecaadeb Sebastian Riedel: explain the difference between elements and nodes
02:18 good_news_everyon left #mojo
02:19 sri maybe that makes the inner workings of Mojo::DOM a little more clear
02:19 jberger sri++ that's great
02:20 jberger something to link to when that comes up
02:35 bpmedley jberger: Do you recall the banter about reoccurring processes via cron and making sure only one process was running at once?
02:36 jberger one cron process or one task process?
02:36 Grinnz sri, i like that explanation, that part took me a while to get the hang of
02:36 jberger because one cron process was the hard thing for me, I have two servers that might be the cron host, depending on if the primary one failed over or not
02:37 bpmedley jberger: Gotcha.  I couldn't remember what the issue was.  How did you solve it?
02:37 jberger mostly we have pushed that stuff into either minion or other mechanisms
02:37 bpmedley Understood.  So, it's an outstanding issue?
02:37 jberger don't have a 100% solution for things that really need to be cron'ed though
02:37 jberger yeah
02:46 thela joined #mojo
02:47 thela left #mojo
02:47 bpmedley I wonder if something like https://bitbucket.org/snippets/bpmedley/69xeM would work.
02:48 jberger bpmedley: sure
02:49 jberger most of the "only run one instance of this process via cron" stuff works the same way
02:49 jberger request a scarce resource first or else check something
02:49 jberger its just a pain in the arse to do
02:49 bpmedley Gotcha
02:49 noganex joined #mojo
02:55 bpmedley I wonder if using run-parts and cron.d would make it easier to bundle cron entries and check for the scarce resource before calling run-parts.  Does that make sense?
02:57 jberger I've never used run-parts
02:58 jberger there was a script someone (from here I think) showed me that forces only one process running at a time by first holding open a socket then execing the process
02:58 jberger I can't remember it anymore though
02:58 jberger I do remember it used a perl command switch I'd never seen before
02:58 jberger but that's hard to google for
02:59 Ptolemarch joined #mojo
03:01 kaare joined #mojo
03:07 cpan_mojo Mojo-Webqq-1.4.7 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.4.7
03:53 Ptolemarch joined #mojo
04:09 disputin joined #mojo
04:14 Adura joined #mojo
04:16 inokenty-w joined #mojo
04:43 Oleg joined #mojo
04:48 Ptolemarch joined #mojo
05:41 Ptolemarch joined #mojo
05:58 dod joined #mojo
06:01 melo joined #mojo
06:03 dod joined #mojo
06:13 marcusr -_-
06:14 davido_ joined #mojo
06:34 panshin joined #mojo
06:36 Ptolemarch joined #mojo
06:55 panshin joined #mojo
07:01 gorfel joined #mojo
07:01 panshin joined #mojo
07:06 gorfel I'm getting the following error when calling url: <name-of-site>/rfc_show/999 "Can't call method "stash" on an undefined value". Here is the code:  http://pastebin.com/UkaWPCNM ... I don't get it.
07:06 Repaster Repasted text from gorfel: http://fpaste.org/268765/56000414/
07:07 buu gorfel: => != =
07:07 buu s/>//
07:07 buu ==========
07:09 gorfel Sorry, where?
07:10 buu line 7 in your paste
07:11 gorfel Haha.. I was totally unable to see that. Thank you very much buu!
07:14 eseyman joined #mojo
07:14 buu np
07:19 AndrewIsh joined #mojo
07:20 trone joined #mojo
07:29 Vandal joined #mojo
07:30 Ptolemarch joined #mojo
07:31 bobkare batman: cool. mine is actually a bit more complicated because one of the places I use it has a lot of process and filehandle management logic so I needed it to be even more isolated, so I double-fork and kill -0 the parent pid to check when it should do the cleanup.
07:33 bobkare batman: Oh, one other line of code mine has is $DB::CreateTTY = 0 since I didn't want extra xterms popping up when running my tests in the debugger
07:33 ashimema joined #mojo
07:41 irqq joined #mojo
07:55 batman bobkare: i would love to have your additions in my code. care for a PR?
07:55 batman bobkare: also, if you want we can add support for (drop_from_child => 2) which use your doublefork code instead of my simple version (1)
07:56 batman another generic question is: what do you think about the API? would it be useful to you? something missing? something weird?
08:00 sue joined #mojo
08:00 bobkare batman: Here's the guts from our version: http://pastebin.com/rjMN7AxZ
08:00 Repaster Repasted text from bobkare: http://fpaste.org/268774/63227144/
08:03 batman cool. i guess no PR then...? :)
08:04 batman i don't get template1 vs template0... can you explain?
08:04 bobkare Not sure if I'll have the time to do one today at least
08:05 bobkare It blew up whenever I ran tests in parallell. If I recall correctly the problem was when one process tried to create a database while a user was connected to template1
08:07 batman yeah, i've seen it complaining about the same thing, but it still seems to be able to clean it up :)
08:08 bobkare for me at least that didn't cause any problems with cleanup but with creating the database in the first place which naturally caused the test run to fail
08:09 batman ok. i think i will leave the code as is for now... currently focusing on mysql
08:11 bobkare API mostly looks sane. I do wonder if it would be simpler to not send in a URL and parse that when what you actually need is a dbi connstring.
08:12 bobkare Oh, btw, if you end up using any of that pasted code any attribution belongs to Easy Connect AS :)
08:14 batman bobkare: the issue with passing in a dsn, is username/pass, attributes... with an URL, it's always just a single string which can be parsed with default tools.
08:15 batman i will create a new branch, and you can confirm the attribution if you think the code makes sense :)
08:19 bobkare yeah, it gets to be quite a few parameter to pass around
08:20 batman i will also take a PR for passing in various formats, but i'm sticking with URL for now. i think it's a *universal* format ;D
08:20 bobkare yeah urls are nice. means the module needs explicit support for every single db engine though
08:24 batman yeah. but it's open source, so anyone can make it better :)
08:24 Ptolemarch joined #mojo
08:36 absolut_todd joined #mojo
08:41 batman bobkare: what URL do you want the attribution to link to? do you want your name there?
08:44 bobkare http://easyconnect.no/ and sure, add my name if you want
08:52 bc547_ joined #mojo
08:53 inokenty-w1 joined #mojo
09:00 kivilahtio joined #mojo
09:07 meshl joined #mojo
09:18 Ptolemarch joined #mojo
09:21 batman bobkare: what do you think? https://github.com/jhthorsen/dbix-tempdb/pull/2/files
09:46 bobkare batman: s/Connect AS/Easy Connect AS/ :)
09:46 batman ah. will fix it now. anything else?
09:46 bobkare still looking
09:49 bobkare looks good :)
09:50 batman \o/
09:50 batman bobkare++
09:52 batman thanks for battle tested code :)
09:52 cpan_mojo DBIx-TempDB-0.04 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/DBIx-TempDB-0.04
09:56 bobkare np, hope it's useful to people :)
09:58 batman yeah. i think the module (not sure about double fork though) will have a great impact on my test code, if it actually works like i hope
10:03 meshl joined #mojo
10:12 Ptolemarch joined #mojo
11:06 Ptolemarch joined #mojo
11:08 neilhwatson joined #mojo
11:14 irqq joined #mojo
11:24 dod joined #mojo
11:39 coolo joined #mojo
11:45 jberger Check out @PerlTricks's Tweet: https://twitter.com/PerlTricks/status/644839206091685888?s=09
11:45 pink_mist nice
11:46 jberger (Also, I've just seen that the Twitter app's copy function adds leading text)
11:46 pink_mist heh
11:47 bpmedley jberger: Very impressive.  Sometimes OCD is a boon.. ;)
11:50 pink_mist jberger: one slight issue; the logo you're using seems to imply one can click it to download the latest Mojolicious :P maybe make it so you can :P
11:57 gorfel This is probably really simple, but I've yet to find an answer. How do I access data in get_data section of my stash from a template? See here: http://pastebin.com/trybj4BK
11:57 Repaster Repasted text from gorfel: http://fpaste.org/268845/77457144/
11:59 gorfel I mean the 'rfc_get' section.
11:59 jberger gorfel: your paste doesn't have a get_data section note did it include how you try to access it
11:59 jberger Ok that's one down
12:00 jberger How are you trying to access it?
12:01 jberger http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#stash
12:01 Ptolemarch joined #mojo
12:01 jberger Accessing the stash is a rather central concept, have you read the tutorial and guides?
12:02 cpan_mojo DBIx-TempDB-0.05 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/DBIx-TempDB-0.05
12:02 batman chansen: SQLite support ^^
12:02 jberger batman++ # TEST ALL THE THINGS!
12:02 batman :)
12:03 chansen batman++ # Nice!
12:03 batman i made a whole lot more sense after Grinnz explained how Mojo::SQLite works and it also revealed a bug, so... :)
12:03 batman i = it
12:07 chansen jberger++ # Nice article on perltricks.com
12:07 nicomen batman: ooh nice, I am doing this now
12:07 batman yeah, the pertricks article was very good!
12:07 nicomen batman: how is it temporary? or, can I use this for more permanent dbs?
12:07 batman nicomen: let me know if you run into some issue
12:08 batman nicomen: it drops/deletes the database when the DBIx::TempDB object goes out of scope or the process stops.
12:08 nicomen ah right, nice ;)
12:09 batman so... if it was for permanent dbs, then it would probably be called DBIx::PermantDB ;)
12:09 batman *Permanent
12:10 batman nicomen: "issue" = bug, weird api, missing features ...
12:10 nicomen hm, I thought ->execute() in DBI didn't really support more than one statement
12:11 nicomen batman: sure
12:11 bobkare nicomen: I think that's up to the underlying driver/db engine
12:12 nicomen I remember having troubles using it for dumps years ago, maybe that has improved. In tha case I can drop using command line to import fixtures..
12:12 batman nicomen: at least DBD::SQLite, ::Pg and ::mysql supports that. if not, the Mojo::x::Migrations modules would have to be a lot more complex
12:12 nicomen great
12:12 good_news_everyon joined #mojo
12:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnLQu
12:12 good_news_everyon mojo/master 215f56b Sebastian Riedel: no need to canonicalize the path twice
12:12 good_news_everyon left #mojo
12:13 bobkare batman: Oh, just remembered a feature I've missed in our module. Sometimes I'd like to leave the database around for debugging, maybe there could be an environment variable or something to skip the cleanup?
12:13 batman nicomen: it could be a max upper limit on the length of a SQL command though... no idea really :/
12:13 nicomen batman: we will find out when I try out the tempdb thing ;)
12:14 batman bobkare: DBIx::TempDB::Maybe ? ;) yeah... i was expecting that request to come. i'll add it now.
12:15 bobkare especially with the double-forked version it's really hard to stop it from dropping the database :)
12:15 Jonis oh, nice module
12:16 bobkare yeah, batman++
12:16 nicomen if skipping the cleanup, leaving a dsn to use would be wise too
12:16 batman nicomen: just do diag +($tmpdb->dsn)[0];
12:17 nicomen ;)
12:19 t4nk971 joined #mojo
12:19 t4nk971 hello, please, what is a right syntax for mojo usar agent to perform post with specified headers and nonblocking?
12:20 coolo joined #mojo
12:20 batman t4nk971: $ua->post($url, \%headers, sub {});
12:21 sri jberger: nice article, odd image use
12:21 batman t4nk971: it's literally in the documentation! https://metacpan.org/pod/Mojo::UserAgent#post
12:21 sri a screenshot of the website would have worked better
12:21 jberger I didn't pick the image
12:22 nicomen t4nk971: $ua->post($url, { header => 1 ... } => form => { a => 'b' ... }, $nb_callback_ref)
12:23 nicomen batman: is there really a post() with both form values, body string AND a callback there?
12:24 batman sorry. i missed out on the form part in the question.
12:24 nicomen (the docs could be slightly clearer that no matter what params, it will check if there is a subref as the last one, or something like that)
12:25 batman "You can also append a callback to perform requests non-blocking" <-- i thought that was good enough :/
12:25 nicomen also, wether it's possible to create a full body to post too
12:25 batman append = push(@args, $cb) in my head
12:26 nicomen batman: you are right, but then the example is replacing the previous examples ;)
12:26 nicomen I mean the subref is replacing the previous examples' params
12:27 nicomen This could make it even more intuitive I think: "$ua->post('http://example.com' => sub {"   ==>   "$ua->post('http://example.com' => form => {a => 'b'} sub {"
12:28 nicomen + =>
12:31 good_news_everyon joined #mojo
12:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnLh6
12:31 good_news_everyon mojo/master 2bc31ae Sebastian Riedel: more diverse callback examples
12:31 good_news_everyon left #mojo
12:31 sri i'm fine with more diversity
12:33 nicomen sri++
12:33 sri btw. i'm still interested in feedback on this from users https://github.com/kraih/mojo/commit/ecaadeb8d2934cb444d084dbd62ab1eb7324c26f
12:34 nicomen But only nodes of the
12:36 nicomen "But only nodes of the type C<tag> are considered elements." => "\nElements are nodes of the type C<tag>" ?
12:40 batman t4nk971: sorry for being harsh.
12:54 cpan_mojo DBIx-TempDB-0.06 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/DBIx-TempDB-0.06
12:54 kanishka joined #mojo
12:55 Ptolemarch joined #mojo
13:00 ajr_ joined #mojo
13:00 panshin joined #mojo
13:00 mudler joined #mojo
13:13 Grinnz batman, (it doesn't usually seem tobe a problem) but i would recommend creating a tempdir and not just a tempfile for a temp SQLite db, as SQLite creates its own tempfiles alongside the db
13:14 Grinnz the only tricky part with that is you then need to keep the tempdir in scope as long as you use it
13:14 Grinnz also, SQLite does not normally support more than one query per execute
13:15 pink_mist 0_o sqlite creates its own tempfiles alongside the db?? I've never seen it do that
13:15 pink_mist ever
13:15 Grinnz i set it so it can for migrations, btu that only works because migrations use no bound parameters
13:15 Grinnz https://www.sqlite.org/tempfiles.html
13:16 Grinnz the WAL is persistent as long as something is connected, the others only tend to show up during operations
13:16 pink_mist huh, ok then
13:17 pink_mist guess I've not paid close enough attention
13:17 Grinnz thats why using a SQLite db in a dir you can't write to can be problematic in some cases...
13:17 Grinnz (always, if using WAL, unfortunately, but WAL is worth that IMO)
13:36 bpmedley What's the best way to read in a configuration file and retrieve it's contents as a hash in a script or library that is not directly connected to a Mojolicious app?
13:37 panshin joined #mojo
13:37 Grinnz depends on the format
13:37 Grinnz if it's JSON, that's easy :P
13:38 bpmedley Something compatible with Mojolicious::Plugin::Config.
13:38 gryphon joined #mojo
13:38 Grinnz in that case, either execute the perl code yourself (if you aren't using references to the app and such), or load an instance of the plugin
13:38 bpmedley I'd like to use the same config file for my app and scripts that support the app.
13:38 Grinnz or load an instance of the app with Mojo::Server
13:39 bpmedley How do I just load the plugin outside of an app?  Sorry for my confusion.
13:39 batman Grinnz: ok... i will try not to fix that issue yet...
13:39 Grinnz https://github.com/Grinnz/PYX-Mojo/blob/master/script/pyx_load#L24
13:39 Grinnz i ended up loading the whole app for that one
13:39 batman i've given up on "i won't do that", since it seems like that always bring me more work anyway, haha
13:39 Grinnz but it's a tiny app :)
13:39 Grinnz batman, lol
13:40 batman ...since i can't resist fixing it
13:41 batman nicomen: "master" in dbix-tempdb will warn you about the (not) temp db when DBIX_TEMP_DB_KEEP_DATABASE=1 is set (will probably make a release tomorrow)
13:43 PryMar56 joined #mojo
13:48 bpmedley Grinnz++ # very succinct way to load the app 'n it's glory.. :)
13:49 Ptolemarch joined #mojo
13:49 Grinnz in that case i loaded the whole app so i could directly use a helper or two (which depend on config)
13:50 t4nk971 i setup it and call it async, but when testing with nc -l, nc will print nothing and halt. it seems that connection is made, but data are not send
13:51 nicomen batman: \o/
13:51 batman :)
13:56 Grinnz t4nk971, you have to keep a reference to the $ua around until you get the results, and you have to run the event loop to wait for the results
13:59 t4nk971 yeah that's right with the refence, it's not soo easy :(
14:01 t4nk971 ideal for global variable!
14:05 t4nk971 please last question, what will be happen whan i do NOT call rende_later and do async calls?
14:06 Grinnz t4nk971, it will try to render a template automatically, and otherwise render a 404, instead of waiting for the async results
14:07 Grinnz t4nk971, usually the delay helper is useful for delayed rendering: https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Synchronizing-events
14:07 Grinnz https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#delay
14:07 Grinnz it handles render_later and exception handling for you
14:08 t4nk971 so if render is not depends on async call results, it will be ok?
14:08 Grinnz sure, if you render before the async, you don't need to call render_later
14:09 Grinnz in other words, if you render before the async render_later will have no effect
14:15 vanHoesel joined #mojo
14:17 vanHoesel1 joined #mojo
14:18 t4nk971 and the before is mandatory?
14:19 t4nk971 i just made some async calls and don't care about results and let the rest of code end as default
14:22 jberger so without using a job queue, is it possible to reply to a request immediately and then continue processing the request?
14:22 jberger its a ridiculous problem I grant you
14:23 jberger that or I need a FIFO queue that I can run as separate process
14:27 Grinnz_ jberger: why not?
14:27 Grinnz_ the event loop is still running
14:28 Grinnz_ isn't a "queue to run as a separate process" kind of a job queue :P
14:34 jberger I need to be sure of ordering
14:35 Grinnz_ it's not too hard to reinvent if you dont need anything complicated tbh, just add to a database table and have a process watch the database table, i have one thats a bit complicated which i wrote before Minion :P
14:36 bpmedley https://bitbucket.org/snippets/bpmedley/5Rx6d <-- jberger, will this work?
14:36 Grinnz_ also, i havent been able to convert it to mojo yet because it needs stdout/stderr callbacks
14:36 Ptolemarch joined #mojo
14:38 jberger bpmedley: I suppose that does get it outside of the req/res path
14:40 bpmedley However, it sounds like it doesn't do what you want?
14:41 Kogurr joined #mojo
14:45 jberger as long as it responds to the client quickly, it might be
14:45 jberger I just have never done that particular thing before
14:45 jberger feels like abusing the server's loop
14:45 jberger but I guess not
14:46 Grinnz_ as long as it's not blocking it should be fine
14:46 jberger I could fork_call and forget
14:46 Grinnz_ right, fork_call if it is
14:46 meshl joined #mojo
14:48 PopeFelix So if I wanted to create a proper Mojo::UserAgent::Mockable, in the style of LWP::UserAgent::Mockable, where should I start looking?
15:28 mattastrophe joined #mojo
15:44 panshin joined #mojo
15:46 sh4 joined #mojo
16:08 kivilahtio_ joined #mojo
16:20 Ptolemarch joined #mojo
16:25 sri jberger: how about this? http://imgur.com/nw3ftI3
16:26 sri clous doesn't look nice without text
16:26 sri s/s/d/
16:27 sri without anything http://imgur.com/cheiDKv
16:28 sri pixelmator healing tool is the best
16:32 sri btw. re nodes vs element comments, i do not like the proposal made by nicomen :S
16:32 dod joined #mojo
16:33 sri especially the "i just skimmed through the section looking for something about elements" reasoning worries me
16:33 sri it's important to know that everything is a node
16:34 PopeFelix sri, how long ago did I ask that?  Or did the subject come up in another wise?
16:35 dod joined #mojo
16:37 jberger sri: nice
16:37 sri PopeFelix: what do you mean?
16:37 PopeFelix sri, did I not ask that question in here?
16:38 PopeFelix at some point I asked how to talk about a node with children and a node without, or something like that, in documentation.
16:38 PopeFelix Discussion followed.
16:39 sri i'm talking about https://github.com/kraih/mojo/commit/ecaadeb8d2934cb444d084dbd62ab1eb7324c26f#commitcomment-13309826
16:41 PopeFelix oh, ok.
16:50 good_news_everyon joined #mojo
16:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnqbL
16:50 good_news_everyon mojo/master ef009da Sebastian Riedel: highlight nodes a little more
16:50 good_news_everyon left #mojo
16:58 bpmedley https://github.com/brianmed/Minion-Backend-mysql/commit/19fdc553b31ae78f658ac4fc30b22de73611b0ee <-- Any thoughts on this pub/sub commit for Minion::Backend::mysql?
17:05 cpan_mojo Minion-Backend-mysql-0.03 by BPMEDLEY https://metacpan.org/release/BPMEDLEY/Minion-Backend-mysql-0.03
17:06 sri does it reduce latency?
17:07 bpmedley sri: Quite a bit, in my rudimentary testing.
17:07 sri neat
17:09 bpmedley It really is.  I changed something like 10 lines of code and get near real-time notification with Minion.  Thanks for all the hard work on this stuff.
17:36 Ptolemarch joined #mojo
17:37 panshin joined #mojo
17:48 stephen joined #mojo
17:51 trone joined #mojo
18:10 punter joined #mojo
18:16 Ptolemarch joined #mojo
18:19 panshin joined #mojo
18:21 jberger sri: article picture updated
18:21 jberger Thanks
18:25 jabberwok joined #mojo
18:26 sri \o/
18:26 chansen https://www.reddit.com/r/perl/comments/3lfepm/how_to_send_verification_emails_using_mojolicious/
18:30 * chansen wonders how mrbig4545 code looks like
18:31 sri that's the big question... "as opposed to?"
18:31 sri to be fair, the lite app is a little too big for my taste
18:32 sri i can see how someone who doesn't know about growing could get a bad first impression
18:33 chansen thats true, I posted a comment asking if he could be more specific
18:34 njlg joined #mojo
18:36 Grinnz batman, does git-ship use the cpanfile to generate prereqs in Makefile.PL?
18:41 irqq joined #mojo
18:43 chansen One thing that annoys me is the 76 characters per line, knowing this the code could be formatted in a more readable way
18:43 * chansen forgot to mention context, ^^ <http://perltricks.com/article/193/2015/9/18/How-to-send-verification-emails-using-Mojolicious>
18:45 * sri nods
18:49 * chansen would also have used 'or' instead of '||' in couple of places to increase readability, beyond that I think the article is very good
18:54 asm35 joined #mojo
18:54 SmokeMachine Does any one here use Paw to test (I am not talking about automated tests) Mojo services?
18:55 SmokeMachine https://luckymarmot.com/paw
18:56 SmokeMachine I am asking because I am writing a code generator plugin for paw to generate Test::Mojo code...
18:59 SmokeMachine it's far to be ok, but if some one gets interest: https://github.com/FCO/Paw_Test_Mojo_codeGenerator (it doesn't have a README yet...)
19:04 dod1 joined #mojo
19:16 chansen This is how I would have formatted the perlticks.com article, <https://gist.github.com/chansen/e30e56fd992ea0629294>
19:16 pink_mist s/ticks/tricks/ .. heh, though
19:17 jberger chansen: you are a line-up-all-the-arrows guy then eh?
19:19 lb if $c->users->{$username};
19:19 lb no!
19:20 jberger lb: ?
19:20 chansen jberger: I think it's increase the readability, but it's my POV and it's very subjective :)
19:20 lb i just quouted from chansens code, that he clearly doesn't line up ALL the arrows
19:20 jberger ah
19:20 jberger line-up-many-of-the-arrows then :-P
19:21 jberger sure we all have our own styles
19:21 lb chansen: you need better critic policies
19:23 jberger I've taken to putting my postfix if/unless onto another line except for VERY short cases
19:23 chansen lb: Perl::Critic and Perl::Tidy isn't part of my (or my clients) toolchains, we use documented policies
19:23 lb Perl::Critic::PolicyParameter::Hypocrite -- follow most of the rules most of the time
19:24 * chansen there is no chance in XXX I will sprinkle '# no critic' in my code
19:24 lb chansen: i'm just joshing, i don't believe in ::tidy, and ::critic often annoys me
19:24 chansen lb =)
19:25 meredith # no critic ...  # bad critic  ... # i'm not angry, i'm disappointed, critic.
19:25 jberger tidy drives me crazy, I really only use it for mojo (because policy) and when I find some especially horrific stuff in my work's codebase just as a way to get started
19:25 lb sub proxy { my $foo = shift; do_stuff(@_) if condition($foo) } # THIS IS NOT CONTROVERSIAL, P::C
19:27 meredith chansen++ #article
19:27 chansen Perl::Tidy is either banned by me or my clients, it completely mess up blame
19:27 lb that too
19:28 lb but my whitespace is not a trifle thing to mess with in general
19:28 chansen meredith: me? you mean jberger!?
19:28 lb has anyone ever seen jberger and chansen in the same location?
19:29 sri the line length in the article is a little unfortunate indeed
19:30 meredith oh!  guess i was in scan mode.    jberger += 2   ;)
19:31 chansen meredith: no worries, I like karma ;oP
19:31 lb karma chansen
19:31 jberger lb: chansen wrote a time module, that's how you know we aren't the same person ;p
19:31 pink_mist no longer any karma bot in here
19:31 pink_mist since purl went awol
19:31 lb i know :)
19:31 pink_mist not that purl would even be allowed in here under the current rules ... purl can be a bit ... rude :P
19:31 lb jberger: so you claim
19:31 chansen jberger: lol :)
19:32 jberger pink_mist: the swearing restrictions have been (slightly) eased under the new code of conduct
19:33 jberger purl might not get immediately banned :D
19:33 Grinnz batman, URI pr sent, and i learned a lot about URI::db in the process, i might use it in Mojo::SQLite too :)
19:34 Grinnz to handle ->from_string better
19:36 lb jberger: phew, i was worried i'd get banned for dropping the occasional fucking f-bomb
19:36 lb oops
19:37 pink_mist lb: don't do it like that. jeez.
19:38 lb i'm a terrible person
19:38 chansen sri: did you ban purl?
19:38 sri nope, she vanished a few weeks ago i think
19:38 jberger /whois purl: No such nick: purl
19:39 chansen :o(
19:39 lb she's still here, invisibly collecting all ++'s
19:39 chansen sri: We need a new purl written in Mojo!
19:39 lb a karma chameleon, if you will
19:40 sri possibly got sentient and noped out of irc
19:40 chansen sri: I demand it!!!
19:40 lb o_O
19:41 jberger chansen: there are several half-formed mojo-based irc bots laying around github
19:42 lb i wish people were required to groan at terrible jokes
19:42 lb weak coc
19:42 njlg joined #mojo
19:42 chansen jberger: I want a purl clone! I like karma!! ;o)
19:43 Grinnz yes, i need to finish my bot and you can add a Karma plugin :P
19:44 pink_mist I vote it should be named zoidberg
19:45 chansen Grinnz: Please, and be sure to sync the karma level with purl before deploying it! I like karma!! ;o)
19:45 sri why not...oh
19:45 sri chansen: but do you like karma?
19:47 chansen sri: It's not my fault that your karma level overflowed the size of signed 32 bit integer and mine is currently higher than yours ;o)
19:49 lb chansen++ # because this will bother him more than not getting it
19:51 Onigiri Huh, my sql manager tool got an update today... it now generates queries with named params like ?FOO instead of :FOO.
19:56 jberger pink_mist: zoidberg is a thing already
19:56 pink_mist oh :/
19:57 pink_mist what is it?
19:57 jberger a perl shell
19:57 jberger I happen to maintain it
19:57 jberger its got some cool features
19:57 pink_mist ahh, cool =)
19:58 chansen jberger++ # zoidberg is really nice
19:59 jberger I didn't write it, I just fixed some tests and cleaned up the installation process
19:59 jberger and for that got comaint
19:59 chansen I know
20:02 lb jberger: consider the irc bot another option of zoidberg
20:02 chansen jberger: It's sri fault that I joined this community in 2004!
20:02 lb in the proud history of unix tools. can it send mail?
20:03 jberger if I had more systems knowledge I would LOVE to make the job management optional and get it somewhat working on windows
20:03 jberger lb: its just a shell, so sure
20:04 chansen jberger: Is Windows support important for your software?
20:04 jberger I like to do it where possible
20:05 jberger see also Alien::Base
20:05 jberger that was essentially started by a desire to get PerlGSL::DiffEq running on windows
20:07 lb chansen: i can't remember when catalyst started, but i remember trying to grok maypole pre- and post-sri :)
20:07 good_news_everyon joined #mojo
20:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnYLp
20:07 good_news_everyon mojo/master 4c9f7e8 Sebastian Riedel: use a more verbose example for cookie filtering
20:07 good_news_everyon left #mojo
20:07 nicomen sri: I think you misunderstand me, I didn't want to say that nodes are less important than elements. I tried to say that it was hard for me to find what elements are in that text, specially given that the title said ELEMENTS AND NODES
20:08 chansen jberger: All of my modules works correctly when perl is compiled with ITHREADS, you don't want to to know my personal POV on ITHREADS ;)
20:08 bpmedley https://bitbucket.org/snippets/bpmedley/7RxM4 <-- Is this a sensible way to tail a file and at the end of every line queue up a bunch of POST requests to process these lines?
20:08 jberger chansen: if you can fix this, ForkCall should work on windows, which would be awesome: https://github.com/jberger/Mojo-IOLoop-ForkCall/issues/5
20:09 nicomen sri: but there was a discussion on the patch itself, and I +1-ed zoffix's suggestion
20:10 sri nicomen: my point is that nodes need to be the focus
20:10 nicomen sri: good point, which I haven't argued against
20:10 chansen jberger: I'll take a look at it tomorrow, to tired and to many whiskeys today!
20:10 sri the title is now NODES AND ELEMENTS btw.
20:10 nicomen ah, hehe
20:11 sri but i've made "Elements" the first word of the second sentence
20:12 chansen lb: =)
20:13 nicomen I think the rewrites a while ago, unifiying things were great, it took me a while to memorize what was nodes and what was elements, and considered so, so I love that addition of docs.
20:16 nicomen sri: thanks
20:17 sri been wondering if all node types should be shown in the example, but it might be a bit verbose
20:20 chansen sri: where did gabb go, is he still around the p5 community?
20:20 sri chansen: he reappeared in the early days of mojolciious, but vanished again soon after, not seen him since
20:21 marcus sup chansen ;)
20:21 sri 2011 according to the channel log
20:22 chansen sri: ok, I also miss Jester pedantic english corrections :/
20:22 chansen marcus: I'm fine, how are you?
20:23 sri me too, every time there's a doc patch i wonder what jester would have to say about it
20:23 chansen marcus: How is your company evolving?
20:23 marcus Tried to convince jester that mojo was the future when I met him in NYC. I kinda failed tho ;)
20:24 marcus chansen: evolving into nothing, I think.
20:24 chansen marcus: why?
20:24 marcus chansen: I've been working for Oslo University since november last year.
20:24 marcus chansen: we ran out of money, and didn't want to go back to doing consulting.
20:25 sri making web apps people want to pay for is so hard :(
20:26 marcus There's actually some movement on output.digital now. We've got an old friend who wants to try to do some sales for us.
20:26 marcus That's mostly how we failed, a bunch of product designers and developers, not doing enough sales.
20:27 lb classic
20:28 chansen marcus: Was consulting a unattractive business plan?
20:29 lb consulting is comfortable while it works, but it doesn't scale and it's not secure
20:29 lb says i after 12 years doing it
20:30 marcus ^^^ Also I find you don't get to make strategic decisions, which bore me
20:30 marcus You're brought in to fix a problem, and the "solution" is predetermined to a large degree
20:30 lb i don't work like that, but i see what you mean
20:31 lb i very much push the project the way i want it
20:31 meredith i quickly learned i'm too lazy / dont have the work ethic for consulting. ;)
20:31 meredith yeah i freely exercise my right to just leave as a consultant
20:31 marcus Anyways, I'm really enjoying working in operations now
20:31 marcus Not being expected to code day to day makes into a super power ;)
20:32 chansen lb: In Sweden it still works, a lot financial institutes and telecom industries still uses Perl but want to migrate to a different language
20:32 marcus chansen: It works in Oslo too, I could have continued with consulting, I just didn't want to.
20:32 lb copenhagen as well, i have lots of job offers on stand-by
20:33 lb currently un-php'ing nic.dk
20:35 chansen marcus: I want to join you, I'm tired of "babysitting" and want to do something different!a Invite me to your headquarters and we can do crazy things, like in the early days of Catalyst when we didn't have any barriers!
20:36 * lb enjoys converting old crufty code into new code using perl
20:37 Grinnz_ if it's PHP, it could be new crufty code
20:37 lb true
20:37 lb the previous project i turned c# into perl
20:37 lb and the project before that i turned CA Ideal into IBM EGL (using perl)
20:38 marcus chansen: That would be fun. I don't actually have headquarters anymore though. As I said, I'm working at university of Oslo ;)
20:38 lb (admittedly that was turning old crufty code into new cruftier code)
20:38 marcus chansen: http://www.usit.uio.no/om/organisasjon/it-drift/td/gap/ansatte/marcusr/index.html
20:38 lb oh no, marcus was arrested :(
20:38 Grinnz_ lol
20:39 lb mmm Kristen Nygaard
20:39 lb lovely guy
20:40 marcus part of my work responsibility is managing one of the largest rt instances out there :p
20:40 lb oh no, marcus is being tortured :(
20:41 chansen marcus: That can't be fun, It's a safty point! We had visions, what happened to those!?
20:42 lb chansen: kids
20:42 marcus My oldest started school this fall ;)
20:42 chansen lb: kids doesn't mean you can't explore your dreams! It means you are limited!
20:43 chansen marcus: FFS!
20:43 marcus chansen: that seems contrary to me.
20:44 chansen marcus: /msg me your address, I'll come and lecture you about the old days!
20:45 * marcus needs to get up and hunt for more alcohol.
21:35 jberger http://www.theregister.co.uk/2015/09/18/microsoft_has_developed_its_own_linux_repeat_microsoft_has_developed_its_own_linux/
21:41 sri :O
21:41 PopeFelix yeah.
21:41 PopeFelix :O
21:43 PopeFelix So I need a little insight here from those who know.
21:43 PopeFelix I've been tasked with developing Mojo::UserAgent::Mockable for work. And I'm not sure what I need to intercept to make that happen.
21:43 bpmedley alter table dhcp_cache add unique(`mac`);  <-- make sense?
21:44 bpmedley doh
21:48 Ptolemarch joined #mojo
21:59 disputin joined #mojo
22:04 vanHoesel joined #mojo
22:13 jberger PopeFelix: I don't think any of us knows what the other module does
22:14 PopeFelix jberger, Oh, I didn't realize.
22:14 jberger and also, didn't you already make a mocking websocket
22:14 jberger s/websocket/useragent/ # i'm wayyyy too burned out for this
22:15 Grinnz_ if my guess is correct, you're talking about the LWP module that pretends to make successful requests but doesn't actually connect to anything?
22:15 PopeFelix jberger, what I ended up doing was creating a nice way of creating a single-scalar Mojo app.
22:15 PopeFelix Grinnz_, you are correct.
22:15 Grinnz_ i feel like there's a way to do that with Mojo::UA itself but i dont know what it is if so
22:15 jberger but it started with making a useragent that talks to the simple app rather than the outside world
22:15 PopeFelix It allows you to record and play back an HTTP transaction.
22:16 PopeFelix jberger, I've been sort of wandering all over the place on this, but I'm looking at Test::Mojo now.
22:16 * PopeFelix thinks there might be some insight there.
22:16 jberger Test::Mojo just wraps Mojo::UserAgent
22:17 PopeFelix Yeah, but that wrapping might give me an idea. I don't know.
22:17 Grinnz_ it doesn't actually affect what Mojo::UA requests to
22:17 PopeFelix oh, I see.
22:17 jberger if you actually needed to capture the incoming traffic, you probably need to attach to the read callbacks (progress? or somethign)
22:17 jberger Grinnz_: almost
22:17 Grinnz_ though it keeps an app around to request to
22:17 jberger right
22:17 jberger relative requests go to ua->server
22:18 jberger which is a mojo app instance
22:18 PopeFelix yeah, i mean i might could create an app that plays back a recording.
22:18 Grinnz_ doesn't really help with mocking absolute requests
22:18 PopeFelix Grinnz_, but I already have a thing that will rewrite absolute requests.
22:18 jberger Grinnz_: sure, but with a start event handler you can rewrite it
22:19 Grinnz_ ah ok
22:19 Grinnz_ there you go then :)
22:19 * PopeFelix can capture absolute requests all day long.
22:19 jberger PopeFelix is already that far, I'm not sure about this record/replay
22:19 PopeFelix I don't know why i'd spend all day capturing absolute requests, mind.  ;)
22:19 jberger you are just going to have to look at the events that are available and attach to them
22:19 good_news_everyon joined #mojo
22:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vnY5c
22:19 good_news_everyon mojo/master 6998ff3 Sebastian Riedel: more verbose examples for case-sensitivity in Mojo::DOM
22:19 good_news_everyon left #mojo
22:20 PopeFelix jberger, I have been.  Still am, in fact.
22:21 bpmedley https://bitbucket.org/snippets/bpmedley/7RxM4 <-- Is this a sensible way to tail a file and at the end of every line queue up a bunch of POST requests to process these lines?  (from earlier)
22:21 PopeFelix If I attach a listener to an event, does that blow away any previous listeners on same?
22:21 Grinnz_ no
22:21 Grinnz_ https://metacpan.org/pod/Mojo::EventEmitter#unsubscribe to do that
22:22 sri you can always overload Mojo::UserAgent::start, if you want to brute force it
22:23 PopeFelix Grinnz_, thanks.
22:23 sri bpmedley: i'm no expert, but i think a sensible tail implementation involves seek
22:23 Grinnz_ bpmedley: i can't say how reliable that is, tailing a file can be complex especially to make it portable, it would be a cool thing for someone to write for Mojo, take a look at https://metacpan.org/pod/IO::Async::FileStream
22:25 bpmedley Thx
22:29 jberger I worked on this for a while, it should work in simple cases: https://github.com/jberger/Mojolicious-Plugin-TailLog/blob/master/lib/Mojolicious/Plugin/TailLog.pm
22:32 bpmedley Hrmm, I do seek at the beginning.  Would there be a need to seek any other time?
22:35 sri actually, you can safely ignore me, i've really not taken a close enough look :)
22:36 PopeFelix I think recording should happen in Mojo::IOLoop::Stream, in the 'read' and 'write' events.
22:36 Grinnz_ PopeFelix: seems sensible to me
22:36 PopeFelix Now, the question becomes how can I get to those events?
22:37 PopeFelix I see how to get to the global IO loop singleton.
22:37 sri there's different ioloops for blocking and non-blocking too
22:39 * PopeFelix nods.
22:39 PopeFelix It's still an instance of Mojo::IOLoop::Stream in both cases, though, isn't it?
22:39 sri https://github.com/kraih/mojo/blob/master/t/mojo/user_agent.t#L407
22:39 sri that might be of interest
22:40 PopeFelix oooh
22:40 PopeFelix yes, yes, i think it might. :)
22:40 Grinnz_ thats what i was thinking, ua => start event => tx => connection event, then you get the connection which lets you find the stream
22:42 PopeFelix yeah, that's probably where i want to do recording.
22:42 Ptolemarch joined #mojo
22:44 Ptolemarch joined #mojo
23:08 PopeFelix And I think for playback I want $tx->on('request')
23:12 PopeFelix no... that's not right.
23:24 bpmedley https://github.com/brianmed/Mojo-IOLoop-Tail <-- Would anyone test this?
23:33 jberger bpmedley: you test for eq "\n" ?
23:33 bpmedley Hrmm.  That's not very portable, is it?
23:34 Grinnz just a bit slow to read 1 byte at a time
23:34 bpmedley However, an answer to the question is, yes: I do.  The reason is so I can emit a "line" event.
23:34 jberger Oh you're reading by character?
23:34 shadowpaste "PopeFelix" at 217.168.150.38 pasted "Playback!" (22 lines) at http://paste.scsys.co.uk/498900
23:34 jberger No that's a byte not a character
23:35 Grinnz right
23:35 bpmedley Yes.  I don't believe the async nature guarantees line oriented i/o.  Is that a mistake on my part?
23:35 Grinnz that's correct, but it's faster to read more at a time and buffer it up
23:35 bpmedley Hrmm.. I wonder how I can do that \n test portably.
23:36 Grinnz https://metacpan.org/pod/IO::Async::Protocol::LineStream may give you some ideas
23:40 jberger I can't remember why, but I had to open a pipe from tail -f to make it work correctly
23:41 Grinnz that's also not very portable :P
23:41 jberger No certainly not
23:41 jberger But it was the only thing that worked
23:41 Grinnz it's definitely doable with the existing stream, but there are a lot of edge cases to account for when doing it manually
23:43 Grinnz like whether to check if the file gets moved (i.e. watch on original filename, or -F option for tail), what happens when the file gets truncated or rewritten, etc...
23:45 jberger Oh I remember
23:45 jberger Because I was watching the log file
23:45 jberger I was trying to watch a file I was also sometimes writing to
23:45 jberger And sometimes other process were
23:45 ajr_ joined #mojo
23:47 Grinnz i don't think that would be a huge problem unless you were watching it on the same handle you were writing with
23:48 jberger How else?
23:48 jberger You are in the same process
23:52 meshl joined #mojo
23:58 ZoffixWork joined #mojo
23:59 ZoffixWork batman, do you see anything wrong with this app, launched with morbo, http://fpaste.scsys.co.uk/498901 ? For some reason AssetPack doesn't minify stuff and this is what I get in output http://fpaste.scsys.co.uk/498902 but if I set MOJO_MODE=production then it works fine :/
23:59 * ZoffixWork has one too many brews to debug this confidently today

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