Camelia, the Perl 6 bug

IRC log for #mojo, 2012-10-29

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

All times shown according to UTC.

Time Nick Message
00:04 memowe joined #mojo
00:27 jberger sri: I wish there was a good way to start hypnotoad from an installed app script
00:27 jberger $ galileo start hypotoad
00:27 jberger vs hypnotoad `which galileo`
00:30 jberger I can start a server of course, but I don't get the argument handling
00:30 jberger I would have to copy that code from your scripts
00:35 good_news_everyone joined #mojo
00:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WXhF5A
00:35 good_news_everyone mojo/master 402d089 Sebastian Riedel: modernized tests
00:35 good_news_everyone left #mojo
00:36 jberger done_testing++
00:37 * sri changes his style again
00:38 sri done_testing is way more convenient
00:39 jberger it really is
00:40 jberger I read a blog post lately about how a test plan really doesn't help anything anyway, encouraging done_testing
00:40 sri re hypnotoad... just don't go there
00:40 jberger I think I have asked about it before, I'm not really asking you to do anything
00:40 jberger just a statement
00:40 sri i'm asking you not to do anything either :)
00:40 jberger k
00:41 sri the restarting makes it really tricky
00:41 laouji joined #mojo
00:41 sri small mistake and things fail in very strange ways
00:42 jberger Mojo::Server::Hypnotoad->new->run($0);
00:42 jberger in a small command?
00:42 jberger seems essentially what the hypnotoad script does
00:42 sri sorry, but i'm not gonna support that
00:42 sri it's bound to end in tears ;p
00:42 * jberger likes to avoid tears
00:43 sri maybe read the hypnotoad source first
00:43 jberger and I realize I'm WAAAY out of my depth on things as complicated as the hypnotoad
00:43 jberger right
00:44 jberger all hail the hypnotoad
00:44 sri eeeep, we lost purl again
00:44 jberger anyway, just an idle curiosity as I watch football
00:45 sri ALL GLORY TO THE HYPNOTOAD!
00:45 jberger drat
00:46 jberger I really do need to learn some deep magic of the style of hypnotoad at some point though
00:46 sri https://github.com/kraih/mojo/blob/mas​ter/lib/Mojo/Server/Hypnotoad.pm#L192
00:47 sri that's basically the core
00:47 jberger I need to try to make the job control on zoidberg optional, so it can run on windows
00:47 * jberger looks
00:48 jberger yep, theres the problem
00:48 sri fork+exec+fd inheritance
00:48 jberger L41
00:48 sri ye
00:48 jberger I concede
00:49 jberger re zoidberg: wouldn't it be cool to have a cross-platform, mostly posix compliant shell
00:49 sri unix is awesome for making crazy stuff like that possible though
00:49 jberger no kidding
00:49 jberger and its way beyond me
00:50 jberger what is "fd" in that chain?
00:50 * sri doesn't believe in cross-pltform
00:50 sri file descriptor
00:51 jberger I'm afraid to ask, but where does that come in? I see the fork and the exec ...
00:51 sri we flag listen sockets to allow them to survive exec
00:51 sri https://github.com/kraih/mojo/blob/m​aster/lib/Mojo/IOLoop/Server.pm#L52
00:53 jberger sounds terrifying
00:53 sri %ENV lock/pid files and a few file descriptors is what we can pass along
00:53 sri *+,
00:54 jberger I'm very glad someone understands this stuff
00:55 jberger every time I think I know most of what Perl can do, I find out that I'm very wrong :-P
00:55 sri haha, same here ;p
00:56 jberger btw I love the Plugin::Config architecture
00:59 jberger add one line in my main file and that config value is available everywhere, even in the commands
00:59 jberger really handy
00:59 sri the design has grown over time
01:01 jberger I have a command that writes out a config file, but it basically uses the one that already exists in the app's defaults
01:01 jberger feels delightfully recursive
01:01 jberger https://github.com/jberger/Galileo/blob/​master/lib/Galileo/Command/config.pm#L25
01:02 sri ah,app->config is actually still pretty recent, before it hypnotoad had its own config files
01:03 sri glad we merged everything
01:04 jberger meaning you couldn't use app->config under hypnotoad? I'm not sure I follow?
01:04 SmokeMac_ joined #mojo
01:04 sri nono, just being nostalgic :)
01:04 jberger k
01:04 sri here's a command style change you might want to pick up too though https://github.com/kraih/mojo/blob/mas​ter/lib/Mojolicious/Command/get.pm#L41
01:06 jberger I have thought about that, actually I'm more likely to have a small configuration app that will setup all the options and the DB connection stuff, much like when you setup Joomla
01:07 jberger originally there weren't very many options to set
01:07 jberger but as that set is growing, having either an interactive or command switch interface feels limiting
01:08 jberger s/limiting/overly confusing/
01:10 jberger anyway, I will definitely keep it in mind
01:11 jberger a change in this behavior is on the front of my mind
01:13 jberger but again, it comes down to, I don't want to force my users to enter their passwords in clear text
01:14 jberger so I'm going to need either a prompt for that, or enter it in an HTML obscured field
01:29 zpmorgan joined #mojo
01:30 vishwanathms joined #mojo
01:30 vishwanathms_ joined #mojo
01:33 dvinciguerra joined #mojo
01:44 d4rkie joined #mojo
01:49 xaka joined #mojo
02:14 abra joined #mojo
02:14 ten00 joined #mojo
02:15 ten00 left #mojo
02:18 stocks joined #mojo
02:42 good_news_everyone joined #mojo
02:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/jlyahA
02:42 good_news_everyone mojo/master 52686a1 Sebastian Riedel: recommend IRC for discussing ideas
02:42 good_news_everyone left #mojo
02:44 good_news_everyone joined #mojo
02:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/zngFeA
02:44 good_news_everyone mojo/master 9404d07 Sebastian Riedel: fixed reference to IRC channel
02:44 good_news_everyone left #mojo
02:46 good_news_everyone joined #mojo
02:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/D52rlA
02:46 good_news_everyone mojo/master 1b63613 Sebastian Riedel: small POD tweak
02:46 good_news_everyone left #mojo
03:04 crab oh god my eyes
03:06 xaka hell yeah, it looks like a new year tree with all those candles and other stuff on it
03:20 crab what the hell is a new year tree
03:23 omega Its a christmas tree where all the needles have fallen off
03:23 xaka omega: +1
03:24 * sri wonders if he missed something
03:25 good_news_everyone joined #mojo
03:25 good_news_everyone [mojo] none pushed 3 new commits to master: http://git.io/Nd5_UQ
03:25 good_news_everyone mojo/master 52686a1 Sebastian Riedel: recommend IRC for discussing ideas
03:25 good_news_everyone mojo/master 9404d07 Sebastian Riedel: fixed reference to IRC channel
03:25 good_news_everyone mojo/master 1b63613 Sebastian Riedel: small POD tweak
03:25 good_news_everyone left #mojo
03:25 xaka sri: does your irc client work in monochrome mode? )
03:25 sri xaka: as a matter of fact yes
03:26 sri did i enable colors in the github bot?
03:26 xaka why do you think everyone is complaining? )
03:26 sri the last one was ok again?
03:26 xaka aha
03:27 xaka i'm not against the colors, but the palette it has is awful
03:28 xaka i barely see who is the commiter
03:42 Foxcool joined #mojo
03:43 good_news_everyone joined #mojo
03:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/44aY8g
03:43 good_news_everyone mojo/master 0432925 Sebastian Riedel: added another FAQ answer
03:43 good_news_everyone left #mojo
03:49 noganex_ joined #mojo
04:09 batman joined #mojo
04:55 amirite joined #mojo
05:29 laouji joined #mojo
05:37 marty joined #mojo
06:20 spleenjack joined #mojo
06:22 ovnimancer joined #mojo
06:43 kitt_vl left #mojo
06:49 dpetrov_ joined #mojo
07:19 Mike-PerlRecruiter_ joined #mojo
07:21 ver joined #mojo
07:33 michaelfung joined #mojo
07:41 AmeliePoulain joined #mojo
07:51 daxim joined #mojo
07:58 pierrick joined #mojo
08:21 spleenjack joined #mojo
08:22 michaelfung left #mojo
08:27 batman joined #mojo
08:55 pau4o joined #mojo
08:55 Vandal joined #mojo
09:28 vishwanathms joined #mojo
09:28 vishwanathms_ joined #mojo
09:44 vishwanathms joined #mojo
09:44 vishwanathms_ joined #mojo
09:44 Britzel joined #mojo
09:54 yakudza joined #mojo
10:01 cosmincx joined #mojo
10:09 vishwanathms_ joined #mojo
10:09 vishwanathms joined #mojo
10:11 amirite joined #mojo
10:15 batman joined #mojo
10:23 pau4o left #mojo
11:03 bogdan_agafonov joined #mojo
11:03 bogdan_agafonov left #mojo
11:04 bobishh joined #mojo
11:05 memowe joined #mojo
11:11 sunson joined #mojo
11:12 bobishh Hi there guys, i'm a newbie, started to playing around with mojolicious::lite not so long ago, and now i got a small question - Can anyone tell me why does links to host/smthn doesn't work right and only when i put path ended up with '/' , like 'host/smthn/' mojo picks js and css files up ? i'm not a native speaker and neither a web developer so i had troubles with even trying to explain this situation to google
11:13 sunson <%= seems to encode the html entities (like ' becomes &#39;). How do I print raw?
11:14 marcus I'm like steven colbert, I don't see color.
11:15 bobishh whoa
11:15 sunson bobishh: in my understanding, mojo only serves out resource 'files'.
11:15 sunson bobishh: if they are in the public directory, that is.
11:16 daxim poor dude is achromatopsic
11:20 sunson bobishh: but it can definitely serve out files without extensions. you need to put it in the 'public' directory.
11:26 sunson never mind, figured we can use <%== to prevent xml_escape.
12:00 ObseLeTe joined #mojo
12:22 bobishh sunson: and i figured out what to do with my files though ) files was already stored in public, some  time ago i supposed that each template takes as root it's own folder in /public/, i.e test.html.ep takes /public/test/ folder
12:51 vishwanathms_ joined #mojo
12:52 vishwanathms joined #mojo
12:57 amirite joined #mojo
13:08 gryphon joined #mojo
13:22 bluescreen joined #mojo
13:25 scrooby joined #mojo
13:27 rem_lex| joined #mojo
13:30 Foxcool joined #mojo
13:31 scrooby Hi sri, I solved my problem yesterday thanks to your tips.
13:33 vel joined #mojo
13:38 ObseLeTe joined #mojo
13:53 sunson joined #mojo
13:54 trone_ I have a controller that render in 20+ second... the log says all gone well, but browser don't show anything. There is a cut off by Mojolicious or browser that you know?
13:54 trone_ If I render all with render(json => {} ) all is showed …
13:56 marty joined #mojo
13:58 Akron joined #mojo
13:59 trone_ http://mojolicio.us/perldoc/Mojolicious/Gu​ides/FAQ#What_does_Inactivity_timeout_mean find it
13:59 trone_
14:00 inokenty joined #mojo
14:00 gryphon_ joined #mojo
14:28 Mike-PerlRecruiter_ joined #mojo
14:31 Britzel trone send an empty http response and a status 204 after the json reply.
14:31 sh4 joined #mojo
14:42 yko joined #mojo
14:44 knshaum joined #mojo
14:46 yko joined #mojo
15:10 Britzel Any suggestions for a search engine which integrates nicely into a Mojo app? textual data to searched exists as static HTML files, some as DB records.
15:14 ObseLeTe joined #mojo
15:54 labrown joined #mojo
15:54 abra joined #mojo
16:04 xaka joined #mojo
16:07 davido joined #mojo
16:09 baton8 joined #mojo
16:11 davido joined #mojo
16:24 d4rkie joined #mojo
16:29 Ulti if I have Mojolicious running through CGI is there something special I need to do to get logging?
16:38 Britzel Ulti: If a 'log' directory exists, Mojo does logging there.
16:39 Britzel The standard directory structure made by 'generate' creates this directory.
16:40 Britzel see http://mojolicio.us/perldo​c/Mojolicious/Lite#Logging
16:48 geira joined #mojo
16:54 SirG I need to log peer IP on requests in prod. Is there a cleaner way, than a monkey patch of Plugin::RequestTimer? Can I disable Plugin::RequestTimer?
17:05 sri if your log level in production is debug, you're doing it wrong
17:13 sri ah, done_testing() didn't ship with perl 5.8.x
17:13 sri something for jamadam to watch out for in the backport
17:20 sri jberger: i see you're using "END{ done_testing(); }" in Galileo
17:20 sri i think that might be an anti-pattern
17:20 sri perl -MTest::More -E 'ok 1; exit 0; ok 1; END{ done_testing() }'
17:45 memowe_ joined #mojo
18:13 stocks joined #mojo
18:16 xaka sri: +1, https://github.com/schwern/test-more/issues/151 (good description why END{ done_testing() } is bad)
18:34 sri :)
18:58 gryphon joined #mojo
19:06 bluescreen joined #mojo
19:24 jberger sri: yeah, I hadn't really thought too much about the implications of that one
19:25 jberger I just liked having it at the top, like one used to have with plan
19:28 jberger perhaps B::Hooks::EndOfScope?
19:29 jberger nope not that either
19:32 jberger but if thats the worst thing you have to say about my test suite then I'm happy :-)
19:33 oldiie joined #mojo
19:33 oldiie hey guys
19:33 jberger o/
19:35 oldiie http://pastebin.com/9qZsP3is
19:36 oldiie if have tried serveral ways but I don't get any kind of list as I need or something similiar to a list :|
19:36 oldiie would be nice if someone could help me a little bit
19:37 jberger your data doesn't line up with your spec
19:38 oldiie yea shit
19:39 oldiie your right
19:39 oldiie copy the info from different film
19:39 oldiie USA 18 January 2009 (Sundance Film Festival)
19:39 oldiie Germany 6 February 2009 (European Film Market)
19:39 oldiie USA 20 March 2009 (limited)
19:39 oldiie I want a list like this
19:39 oldiie ;p
19:40 oldiie but nevermind, it shoudl be clear that I want a list from the given htmlcode
19:40 oldiie htmlcode and list in example has just different names :D
19:41 jberger I don't want to sound mean, but if this were stackoverflow you would be getting the "what have you tried" comment
19:42 jberger using mechanisms similar to what we showed yesterday, it really shouldn't be too hard to knock this into a Perl data structure
19:42 oldiie $rls=$dom->find('td')->pluck('text_after'); and $rls=$dom->find('td')->pluck('text');
19:43 lukep joined #mojo
19:43 jberger I would focus more on the <tr> element
19:43 jberger for this case
19:45 oldiie hmm your right
19:46 oldiie but if I try it with find('td') and text || text_after it got no output :|
19:49 oldiie just whitespaces
19:52 jberger I'm working on an example
19:53 oldiie $rls=$dom->find('tr')->pluck('all_text'); <-- output it like a list but also many more things from the site which I don't need :p
19:54 oldiie maybe there is a better way
19:54 oldiie okay thanks :)
20:08 xaka joined #mojo
20:12 jberger https://gist.github.com/3976227
20:12 jberger yeah, you were on the right track there
20:13 jberger getting rid of empty elements was a little harder than expected
20:16 jberger and you can use Data::Dumper rather than Data::Printer (DDP) if you want
20:16 jberger I usually change that for examples, but for some reason I got lazy
20:21 sh4|2 joined #mojo
20:21 rhaen_fork joined #mojo
20:21 rhaen_fork hep!
20:21 rhaen_fork Good evening everyone.
20:23 oldiie jberger, thanks :)
20:23 oldiie :>
20:23 oldiie will give it a try
20:23 jberger no prob
20:34 oldiie jberger: I', also getting things like this
20:34 oldiie $VAR78 = [
20:34 oldiie 'Trailers',
20:34 oldiie 'Plot summary',
20:34 oldiie 'Box office and business'
20:34 oldiie ];
20:35 Adura Five lines at once, will we?
20:35 jberger oldie: if its not in your sample data, how can I help you with it?
20:36 oldiie yea I forgot it :/ damnz
20:36 jberger I'm sure you can handle it
20:36 oldiie yo
20:37 jberger an exercise left to the reader might be to parse out the <th> columns and use it to build hashes from each row
20:39 jberger oldie: get really comfortable with CSS selectors and Mojo::DOM gets much easier
20:39 jberger a good reference is: http://www.w3schools.com/cssref/css_selectors.asp
20:40 Adura w3schools is good now?
20:40 jberger these are all the things that you can pass to 'find' to get a collection from a dom
20:40 sri oldiie: please no more pasting into the channel, this is the third and final warning
20:40 jberger Adura: I've never had a problem, should I be worried?
20:41 Adura http://w3fools.com/ Probably.
20:41 jberger that particular reference is something I like because it is concise
20:43 geira joined #mojo
20:43 jberger I do use MDN on occasion too
20:45 oldiie any way to find a </table> ?
20:46 jberger use 'table' as your first element in 'find' to limit your results to what is in the table
20:48 oldiie <tr><th class="xxxx">Country</th><th class="xxxx">Date</th></tr>
20:48 oldiie I would search for the </th>
20:49 oldiie because this is only used once there and <table> is before and if I can search <th> I would get what I want easily :p
20:50 oldiie or can I define when it should stop search, f.e. if there is a <h5>
20:53 jberger oldiie: the internal structure of a DOM is a tree, so you shouldn't need to explicitly search for the end tags. just by being under the begin tag you know you are before the end tag
20:56 jberger Adura: ok, so I can see their point on w3schools not being authoritative, but still, they present the (possibly incorrect) information in such a readable way, why cant someone who is more committed to correctness copy and improve it
20:57 jberger They themselves say: "An oft-repeated mantra in OSS (and a critique we've already received) is that you shouldn't criticise something unless you're willing to put your money where your mouth is and build something better. It's an admirable ethos, but not really applicable here."
20:58 jberger I disagree with their conclusion. They have put a lot of thought into their critique of w3schools, if they were to just put that amount of effort to making something better, we might have it by now
20:58 Adura I don't think that'd make w3schools go away.
20:59 jberger probably not, but I would have a comparably readable reference with more correct information
21:00 jberger try going to MDN and think to yourself, "I would like a complete list of CSS3 selectors" and try to find it
21:00 jberger I'm not really disagreeing with you, I'm just playing devils advocate
21:01 Adura So it seems, heh.
21:04 jberger plus, as I read a lot of the nits on the critique site, many are semantics or esoterica, but since all I'm looking for is a reference
21:05 jberger for example, presenting a common idiom as the only option, like lower case tag names
21:05 jberger ok its not the pure spec, but I won't write incorrect code by doing so
21:08 jberger but then they argue that they shouldn't include frames, because frames are bad. So what is it? Should w3school teach all the allowed semantics or teach common idioms/best practices
21:08 jberger ?
21:08 jberger just saying, its hard to write a good reference site, and I think w3schools does a decent job
21:08 jberger from what I've used it for
21:13 * jberger likes to play good devils advocate m/
21:14 sri jberger: the spec is pretty good http://www.w3.org/TR/selectors/
21:15 jberger sri: wow that is the most readable "actual spec" I think I've ever seen
21:15 sri i implemented Mojo::DOM::CSS pretty much only using the spec
21:16 jberger sri: for implementing a parser engine, I would expect that you would. My argumentative position is that a reference site need not be perfectly semantically exact as long as what they do say is correct (if incomplete or benignly oversimplified)
21:16 sri the HTML5 spec is also really good
21:16 asarch joined #mojo
21:16 * sri likes many whatwg/w3c specs
21:17 jberger perhaps I should consider using those docs more directly in the future
21:18 jberger my comment really is on the fact that this group (w3fools) chooses to hammer on another site, rather than do something about it, combined with the fact that most of their critiques seem rather "harmless"
21:18 sri i think there's a correlation between number of actual examples in the spec and readability :)
21:19 jberger no I wouldn't implement a browser from w3schools, but I think the w3fools guys are rather harsh
21:19 jberger I love that the css3 spec has an overview table
21:19 jberger that is exactly how all specs (everywhere) should begin
21:19 jberger thanks for pointing that out!
21:20 * sri agrees
21:30 SmokeMac_ joined #mojo
21:35 dabudabu joined #mojo
21:48 gryphon joined #mojo
22:22 SmokeMachine joined #mojo
22:31 whee joined #mojo
22:42 jzawodn joined #mojo
22:49 vel joined #mojo
23:19 duncanthrax joined #mojo
23:19 rem_lex|pivo joined #mojo
23:34 Averna joined #mojo

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