Camelia, the Perl 6 bug

IRC log for #mojo, 2011-03-30

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

All times shown according to UTC.

Time Nick Message
00:00 sri http://mojolicio.us/perldoc?Mojo/IOLoop#on_tick
00:00 sri there's an example
00:02 tjfontaine http://paste.debian.net/hidden/06689a6a/ are the pieces I've been working with so far
00:03 sri that error is proof that events are triggered
00:03 tjfontaine right, but I'm not sure what I'm missing that on_handler or on_websocket aren't fired
00:03 sri that listen stuff looks very very wrong
00:04 sri you're creating a random listen socket and throw it away
00:04 mikegrb tj is from the land of python
00:04 tjfontaine which part makes the random port listener?
00:04 tjfontaine daemon->new?
00:05 sri http://mojolicio.us/perldoc?Moj​o/Server/Daemon#prepare_ioloop
00:06 sri it is normally called from ->run, since daemons mostly block
00:06 sri $daemon->listen(['http://*​:5000'])->prepare_ioloop;
00:07 sri you want something like that
00:07 sri it's an unusual use case though
00:07 sri nobody really goes that low level
00:08 mikegrb heh tj has a very unusual use case :p
00:08 mikegrb it's for an Irssi script so it has to run under it's event loop
00:08 sri you could just start a Mojolicious::Lite app and start it in daemon mode
00:08 tjfontaine blazing trails
00:09 sri oh, that is unusual :)
00:09 tjfontaine I'm using Protocol::WebSocket but hates my freedom when it comes to ssl
00:09 tjfontaine so I decided to try what mikegrb suggested
00:10 sri no idea really how to do all that at the lower levels, it is absolutely possible but underdocumented
00:10 tjfontaine ok, so it prints out that I have a daemon available at :3000 but according to netstat I'm back to a random port number
00:10 mikegrb tjfontaine: what that means is, once you figure it out, you have to submit doc patches
00:10 tjfontaine (this is why I instantiated ioloop externally before)
00:11 tjfontaine mikegrb: I'll write documents and you format them, mmk?
00:11 mikegrb heh, k
00:11 sri the websocket code looks wrong too
00:11 tjfontaine 20:09 Server available at http://*:3000, tcp        0      0 0.0.0.0:39676           0.0.0.0:*               LISTEN      28565/irssi
00:11 sri quite sure you're skipping the higher level handshake code
00:12 sri it's prolly easier to hack up a Mojolicious::Lite app ;p
00:13 sri by replacing the app->start call with some Mojo::Server::Daemon magic
00:13 tjfontaine okey dokey, pointers on how to do that :)
00:13 sri doubt anyone has done it before
00:14 sri it is possible but you'll have to dig through code i'm afraid
00:14 tjfontaine is there a way I can just grab the ioloop from $app?
00:14 sri $app has no ioloop
00:14 tjfontaine ah
00:14 sri app doesn't know anything about the deployment environment
00:15 sri Mojo::Server::Daemon->new(app => app);
00:15 tjfontaine oh that's promising
00:15 sri then you move on to $daemon->prepare_ioloop
00:16 tjfontaine ok I shall traverse this path
00:16 sri and finish off with $daemon->ioloop->one_tick in your outer loop
00:16 Alias left #mojo
00:16 ok22 left #mojo
00:16 tjfontaine the running state that loop->start and app->start isn't used but to prevent multiple blocking calls?
00:17 sri can you rephrase that?
00:17 tjfontaine yup
00:18 tjfontaine the is_runnign method, that relies on the internal _running state, nothing else checks that state that's just to prevent multiple calls to ->start?
00:18 sri it's also for high level plugins to check if the environment is async
00:19 sri die "no async yadayada" unless Mojo::IOLoop->is_running;
00:19 sri like the cgi binding
00:19 tjfontaine ah ok
00:21 sri make sure to add a recipe to the wiki if you get it working :)
00:21 tjfontaine not a problem :)
00:22 twodollarz left #mojo
00:23 tjfontaine I still have that odd issue of the info output saying the port is 3000 but the real bound port being random
00:25 tjfontaine on the upside I get this nice warning when I try and connect to it http://paste.debian.net/112370/
00:27 sri tjfontaine: https://gist.github.com/893640
00:27 ok22 joined #mojo
00:27 sri a little working hack
00:28 sri just call one_tick repeatedly
00:28 * tjfontaine tweaks
00:29 perlrocks Twitter: "Mojolicious:: Static Base64 static files had been split into a separate file from the format. / 4b847d541991651b002a71d1905368ae54b58278 http://htn.to/mVc1en" (ja) --kits_ http://twitter.com/kits_/status/52890149209653248
00:30 tjfontaine hey I'm getting debug spew
00:30 sri :)
00:30 sri it's actually a fun little example, i should turn it into a recipe in the cookbook
00:31 tjfontaine 20:31:26:543 ==> Connected
00:31 tjfontaine werd
00:31 tjfontaine there's still this interesting side effect that I have
00:31 tjfontaine sudo netstat -alnp | grep irssi
00:31 tjfontaine tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      30430/irssi
00:31 tjfontaine tcp        0      0 0.0.0.0:47682           0.0.0.0:*               LISTEN      30430/irssi
00:32 sri no pasting please
00:32 tjfontaine sorry
00:32 sri time to step back and start with something simpler
00:32 tjfontaine k
00:32 sri take my example and embed it
00:32 sri then move on
00:33 sri maybe even make it a standalone app first and then embed later
00:34 tjfontaine I presume you're working with something passed what dh-make-perl pulled in from cpan as well?
00:34 Akron left #mojo
00:34 tjfontaine just want to make sure my environment matches
00:34 sri i'm on os x with latest github master
00:34 tjfontaine ok
00:35 sri unless your version is horribly outdated you should be fine (theoretically)
00:36 sri if my example doesn't work you're screwed :)
00:36 tjfontaine it pulled in 1.15
00:36 tjfontaine it's not that it's not working :)
00:37 sri time to sleep, good luck
00:37 sri nn
00:37 tjfontaine k
01:27 tempire I like public.  It's prettier than static.
01:30 esskar left #mojo
01:31 esskar joined #mojo
01:43 mateu i kinda prefer public as well over static.  I recently just called it files/ which is plenty lame, but it's blurry to me
01:44 mateu because you may have .js in public/ which is interpreted.
01:44 mateu public sorta implies non-perl-shit/
01:45 mateu client_side/
01:47 mateu the client can see the source, so public is about the best name I can think of.
02:05 perlrocks Twitter: "Please try it! RT @ hidenorisuzuki: Software Design to buy a Perl-based frameworks learned the Mojolicious. This is a nice easy it easily. I'll try to make some samples if you have time tomorrow dullsville." (ja) --gihyosd http://twitter.com/gihyosd​/status/52914240901754880
02:45 tempire I want to know more about the japanese word that directly translates to 'dullsville'.
03:28 tardisx the google translator has an option to show other translation options, but there are none for that word :-)
03:58 esskar2 joined #mojo
04:00 esskar left #mojo
04:25 oleber left #mojo
04:29 oleber joined #mojo
04:45 perlrocks Twitter: "By the way, WebSocket you first learned, Mojolicious was a guy" (ja) --hide_o_55 http://twitter.com/hide_o_5​5/status/52954605876822016
04:51 ysyrota joined #mojo
04:53 kaare joined #mojo
05:24 koban joined #mojo
05:29 trone_ joined #mojo
05:34 trone left #mojo
06:00 AmeliePoulain joined #mojo
06:07 kvorg left #mojo
06:25 cosmincx left #mojo
06:25 cosmincx joined #mojo
06:39 Christian joined #mojo
06:39 Christian left #mojo
06:40 Christian joined #mojo
06:40 Christian morning
06:59 koban hi ppl!
07:04 marcus hai
07:04 marcus can haz problmzt
07:21 perlrocks Twitter: "@qkenihan ha Mojolicious... I like that. So does that mean I'm the Beyonce of mojos?" --eddiepra http://twitter.com/eddiepr​a/status/52993825974661120
07:23 perlrocks Twitter: "@eddiepra Nah you're the Jay Z of Mojolicious  that gets to tap the ass of Mojoness until it's left screaming in an orgasmic heap." --qkenihan http://twitter.com/qkeniha​n/status/52994228367785984
07:28 breaker313 joined #mojo
07:41 Christian left #mojo
07:42 Christian joined #mojo
08:10 koban is it a bug when relaxed placeholder in route "/profile/(.login)" can't capture value with uri like "/profile/......"?
08:11 koban or just i misunderstood something?
08:33 baton8 left #mojo
08:36 baton8 joined #mojo
08:39 ok22_ joined #mojo
08:44 ok22 left #mojo
08:48 moritz koban: in my tests that works
08:49 moritz $self->param('login') =>  ......
08:49 snearch joined #mojo
08:49 koban how about $self->stash('login')?
08:53 moritz seems to work too
08:53 koban hmm
08:53 koban thanks!
08:54 moritz koban: I recommend to keep a minimal lite app around in some directory, and when you're not sure about how something works, just experiment with it in the minimal app
08:55 moritz that way you reduce the chances of it interfering with something else in the app you currently develop
08:56 koban thanks for advice
09:09 perlrocks Twitter: "Why I chose to build a Plack framework instead of using Mojolicious / No time to wait http://htn.to/n3THDi" (ja) --jamadam http://twitter.com/jamadam​/status/53020946692448256
10:03 perlrocks Twitter: "Mojolicious is changing the game - Sebastian Riedel about Perl and the Web http://htn.to/9zqaJM" (ja) --jamadam http://twitter.com/jamadam​/status/53034605086904320
10:15 breaker313 left #mojo
10:35 Christian how you catch wrong routes? with the not_found.html.ep site or with a route which redirect to the / automaticly (is that possible)
10:41 fmerges joined #mojo
10:52 trone_ is now known as trone
11:06 ka2u joined #mojo
11:07 ka2u left #mojo
11:09 ka2u joined #mojo
11:15 Debolaz Hmm, trying to call $self->app->languages ('no'); in a controller action, I get the error Can't call method "languages" on an undefined value at /home/debolaz/perl5/lib/perl​5/Mojolicious/Plugin/I18n.pm line 49.
11:27 breaker313 joined #mojo
11:36 Debolaz And nevermind, it was $self->languages :-)
11:45 moritz speaking of which...
11:45 purl it has been said that speaking of which... is there a date set yet?
11:45 moritz I plan to deploy my site to two different domains (hosted on the same server), with different languages
11:46 moritz what's the best way to do it? run a separte process for each domain?
11:47 moritz or do some magic that inferes the language from the host name?
11:53 Debolaz moritz: I'd probably do the latter since there's very little work involved in doing it.
11:56 moritz Debolaz: thanks
11:56 moritz it's an item quite far down my roadmap, though
11:56 Debolaz At least that's how I've solved similar problems in Catalyst.
12:32 snearch left #mojo
12:39 perlrocks Twitter: "Mojolicious Web Framework - Join the Perl revolution!: Http://mojolicio.us/" (ja) --javascriptalert http://twitter.com/javascripta​lert/status/53073845124468736
12:43 koban left #mojo
12:43 koban joined #mojo
12:48 koban left #mojo
12:49 koban joined #mojo
12:50 zakame left #mojo
12:59 oleber left #mojo
13:17 ok22_ left #mojo
13:19 perlrocks Twitter: "#perl How do we unit test a Mojolicious controller? http://goo.gl/XRH0D" --perloop http://twitter.com/perloop​/status/53083961223684096
13:30 ok22_ joined #mojo
13:45 marc joined #mojo
13:49 Debolaz sri: Btw, if you dont want to make the "something went very wrong" error page default, you could release it as a plugin. :)
13:56 vel joined #mojo
14:01 Drossel left #mojo
14:05 sri Debolaz: it is the default already ;)
14:05 Debolaz Woohoo.
14:06 * Debolaz luvs it
14:08 TheCritic joined #mojo
14:10 TheCritic http://pastebin.com/p30FiTBx
14:11 TheCritic I am using Mojo::Loader->load('MyApp::Kernel');
14:11 TheCritic and then PaymentCapturePro::Kernel->init($config);
14:12 TheCritic but, I get Can't locate object method "init" via "PaymentCapturePro::Kernel"
14:13 * sri doesn't see how that's a mojo question
14:13 sri you might also want to check for errors
14:13 ispy_ joined #mojo
14:14 TheCritic yeah, here is the mojo angel
14:14 TheCritic I assumed (I know) Mojo::Loader->load('MyApp::Kernel'); would let me PaymentCapturePro::Kernel->init($config); ...
14:16 TheCritic yeah, I changed that myapp trying to make it generic enough..., but point being... Loader works like this right... if I load my PM I can access it via ->init()
14:16 sri ok, why exactly are you using Mojo::Loader?
14:16 sri why not just "use"?
14:17 TheCritic I have a module that I want to load. It isnt a controler, it is more like a utility library
14:17 TheCritic it has shared db connection routines
14:17 TheCritic and keeps a DB handle
14:17 TheCritic ok, Ill try
14:18 sri those aren't reasons, without proper exception handling there is no point using Mojo::Loader
14:18 TheCritic understood... use works, thx
14:19 Christian why don't use helper? my db connnection will be created in a helper
14:20 marc sri: quick question -- why did you select the name 'mojolicious'? as i understand it, mojomojo and mojolicious are completely unrelated?
14:20 marc (sorry if this has been asked before)
14:21 Christian if you only want to load/start the shared db connection routines i think it is easier to use helper methods
14:21 AmeliePoulain Maybe plugins?
14:21 sri marc: http://www.activestate.com/blog/2011/02​/mojolicious-interview-sebastian-riedel # this interview might answer it
14:21 Christian helper plugins ;)
14:22 marc sri: thanks, i'll take a look
14:23 Christian nice evening to you all
14:24 marc sri: so how did Mojo relate to MojoMojo in 2008?
14:24 Christian left #mojo
14:25 sri when i started Mojo back in the days i asked for name suggestions
14:25 sri Mojo was the most commonly suggested one ;p
14:25 marc i see -- so there was never a connection with MojoMojo?
14:25 sri not yet
14:26 * marc nods
14:26 sri but i think marcus has evil plans
14:26 tjfontaine sri: btw your example script also spins up the random second port http://paste.debian.net/112422/
14:26 marc it's just a tad confusing -- given the naming, one would expect MojoMojo to be built on... Mojo (i.e., a wiki built on the Mojo meta-framework)
14:31 sri tjfontaine: poll mainloop?
14:32 tjfontaine sri: you mean singleton?
14:32 sri no, i mean IO::Poll based mainloop
14:33 sri it's harmless then
14:33 tjfontaine sri: I'm just trying to figure out why it has two open ports?
14:33 sri we use a random listen socket to allop poll to block for a short amount of time
14:33 tjfontaine hmm ok
14:33 sri *w
14:33 sri we support poll, kqueue and epoll
14:34 sri MOJO_IOLOOP_DEBUG=1 will give you some diagnostics
14:34 sri MOJO_DAEMON_DEBUG=1 too
14:38 AmeliePoulain left #mojo
14:55 perlrocks Twitter: "Mojolicious I own the Web server supports TLS. Starman Maybe this can also be used in combination with. Try Now. http://blog.kraih.com/mojolicious-101-tls-goodness" (ja) --hoyo1111 http://twitter.com/hoyo111​1/status/53108089087467520
15:01 koban left #mojo
15:03 cosmincx left #mojo
15:28 sri Alias_: what slogan would you like to see on a failraptor shirt?
15:34 karamorf sri: I figured out how the images were being curropted. I was including a module that had "use encoding qw(utf8);" in it. Apparently Perl was double encoding in certain cases, I was able to fix it by adding "no encoding" in my script. Not sure if this is useful in any way, but seemed like I hit something you hadn't seen before...
15:35 karamorf sri: (in reference to my question yesterday if you don't recall)
15:36 sri looks like use encoding changes PerlIO behavior
15:37 sri i've never seen "use encoding qw(utf8);" though... sane people do "use utf8;"
15:37 moritz 'use encoding' has several bugs and caveats
15:38 moritz document in... drumroll... `perldoc encoding`
15:38 sri i've not seen "use encoding" being used much
15:38 karamorf ha, I don't work at a sane place. and "use utf8" does work fine for both cases I found that messes with me.
15:38 moritz for example "This pragma affects utf8::upgrade, but not utf8::downgrade"
15:38 sri eww
15:39 moritz it's not lexically scoped
15:39 moritz not thread safe
15:39 sri EWWWW
15:39 moritz weird regex bugs for literals > 127 chars
15:39 moritz you get the picture
15:40 moritz avoid it like the plague
15:40 sri not lexically scoped is crazy
15:40 karamorf in summary: I should investigate removing the 'use ecnoding' bits from the code base. Fun stuff.
15:40 moritz karamorf: 'use utf8;' also automatically decodes your string literals
15:41 karamorf ya, thats going to be a much better choice overall
15:41 moritz and it's much better, and more often used (and thus better tested)
15:42 breaker313 left #mojo
15:46 Akron joined #mojo
15:53 ok22_ left #mojo
15:54 ok22 joined #mojo
15:57 dotan joined #mojo
16:06 ysyrota left #mojo
16:11 fmerges left #mojo
16:26 ispy_ left #mojo
16:47 ok22 left #mojo
16:50 spleenjack left #mojo
16:52 Kulag joined #mojo
16:53 yakudzo left #mojo
16:53 yakudzo joined #mojo
16:54 Akron left #mojo
17:14 sri suckerpunch is weird
17:16 sri the story has so much depth
17:17 trone_ joined #mojo
17:17 sri http://www.imdb.com/title/tt0978764/videogallery # you're missing so much if you're not watching the animated shorts
17:22 trone left #mojo
17:28 perlrocks Twitter: "ojo.pm + GraphViz graph to the # same myjourneytoperl https: / / github.com / dotandimet / myjourneytoperl / # mojolicious" (fr) --dotandimet http://twitter.com/dotandim​et/status/53146647873597440
17:29 dotan left #mojo
18:01 ispy_ joined #mojo
18:08 trone_ is now known as trone
18:57 GitHub135 joined #mojo
18:57 GitHub135 mojo: master Sebastian Riedel * 0bd1c6f (1 files in 1 dirs): added cookbook recipe - http://bit.ly/i7HGM3
18:57 GitHub135 left #mojo
18:59 perlrocks Twitter: "Added a fun little cookbook recipe for embedding #mojolicious applications in foreign event loops. http://t.co/zn6mEAG #perl" --kraih http://twitter.com/kraih/status/53169470797135872
20:27 tempire I don't understand the embedding recipe...
20:27 zamolxes left #mojo
20:27 zamolxes joined #mojo
20:27 tjfontaine tempire: it's because I want to do evil things like stick it in irssi
20:27 tempire like a bot?
20:28 tjfontaine I suppose if someone wanted to, my use case is for a different proxy so I can get multipresence irssi
20:29 tjfontaine have my screen+irssi running, but if I want to use irc with my existing scrollback I have a webui that uses a websocket and pulls in the context
20:53 ispy_ left #mojo
21:10 stephan48 tjfontaine: sounds cool :)
21:11 jamesw that would basically require a timer or something horrible
21:15 jamesw and isn't Irssi's timer limited to 10ms?
21:25 tjfontaine jamesw: it does currently require to hook into the timer, but you can also use input_add and it will do additional poll'ing
21:25 kaare left #mojo
21:26 tjfontaine stephan48: works decent enough, I was tired of regular irc or bouncers on devices like iphones and ipads
21:33 sigue joined #mojo
21:36 sri tempire: you've never combined multiple event loops?
21:37 tempire Apparently not, since the concept confuses me.  Or I understand it in different terms, maybe.
21:38 sri it's quite simple
21:38 sri instead of a blocking mainloop you call one_tick repeatedly from an external mainloop
21:39 tjfontaine it's quite common for apps to maintain their own loops, or if you're using something like gtk or qt which have their own and you can't stick your loop in a thread
21:39 tempire so the one_tick in the example would potentially be some other program or something.
21:39 sri exactly
21:39 tempire that makes sense.
21:39 sri you mean "while 1" i guess
21:39 sri but yea
21:40 tjfontaine what's the preferred way to route to a static file? right now I catch / and redirect_to('index.html')
21:40 sri suggestions for making it easier to grok welcome
21:41 sri redirect is fine, you could also do render_static
21:41 tjfontaine ah, excellent thanks
22:06 vel left #mojo
23:06 mattastrophe joined #mojo

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