Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-28

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

All times shown according to UTC.

Time Nick Message
00:05 ulf joined #mojo
00:06 ulf How do I used mojo::IOLoop with a unix socket?
00:07 jeen joined #mojo
00:29 Caelum what does dispatch return for a 404, undef
00:29 Caelum ?
00:30 anewkirk 2hrs later still fighting with Dotcloud
00:36 freman that's wack
00:36 freman (steady_time - ($self->{active})) = steady_time - but add brackets after steady_time() and it works as you'd expect
00:38 mire joined #mojo
00:47 Caelum why does the 404 handler clear $c->req->headers->header('Accept')
00:51 Caelum no LWP is just not sending it
00:57 Caelum I have an accept header but respond_to is not working
00:59 human39 joined #mojo
01:02 egopro joined #mojo
01:11 good_news_everyone joined #mojo
01:11 good_news_everyone [mojo] kraih pushed 2 new commits to master: http://git.io/OfnsKA
01:11 good_news_everyone mojo/master 9f46b15 Ashley Pond V: Errant semi-colon in synopsis.
01:11 good_news_everyone mojo/master 3b63392 Sebastian Riedel: Merge pull request #460 from pangyre/master...
01:11 good_news_everyone left #mojo
01:12 shmuel joined #mojo
01:14 KindOne joined #mojo
01:16 hlin joined #mojo
01:22 ka2u joined #mojo
01:59 d4rkie joined #mojo
02:03 Caelum anewkirk: ping
02:05 Caelum anewkirk: I was wondering, I'm doing lots of parameter validation for an API, would Validation::Class help me with that?
02:18 Caelum what the hell is eating my headers
02:26 Caelum is there something related to passing form-data and the wiping out of headers
02:34 KindTwo joined #mojo
02:47 D4RK-PH0ENiX joined #mojo
03:02 crab i'm sorry, i ate your headers. they were delicious.
03:09 Caelum so are crabs
03:14 Caelum though I prefer lobsters
03:16 Caelum for the one case where my headers were disappearing, I could write a test for it, though I don't know if that's the "correct" behavior or not
03:19 Caelum j
03:19 mattastrophe joined #mojo
03:36 d4rkie joined #mojo
03:39 sh4 joined #mojo
03:48 sri why the hell is travis testing mojo on a 64bit box and mango on a 32bit one :S
03:50 sri oh wait, they changed their whole worker pool
03:51 tempire joined #mojo
03:53 tempire joined #mojo
03:53 sri it's working now \o/ https://travis-ci.org/kraih/mango
04:02 egopro joined #mojo
04:10 tempire joined #mojo
04:11 tempire woo!
04:11 tempire irc bouncer on a new server
04:11 sri Bender: trust tempire
04:11 Bender But I don't trust you in #mojo, sri
04:11 sri :O
04:12 * sri kicks Bender
04:12 * tempire bends Bender
04:17 egopro joined #mojo
04:21 sri oh, travis has an os x worker too now
04:21 * jberger takes Bender out for a nice dinner and then NEVER CALLS HIM AGAIN!
04:26 sri oh my
04:26 * sri had no idea travis ci supports mongodb
04:34 mauke_ joined #mojo
04:35 freman so, $file->get_chunk(0, 231072) will return 231072 bytes of data from the file won't it if the file is at least that big? it's not one of those 'best effort' ones?
04:35 preflex_ joined #mojo
04:38 bpmedley How can I debug files taking 7 seconds a piece to transfer with morbo?
04:42 egopro_ joined #mojo
04:45 xaka joined #mojo
04:48 freman hmmm would have been awsome if mojo log supported outputting to a secondary file or I'd installed log4perl
04:54 crab joined #mojo
05:05 ka2u joined #mojo
05:10 ka2u_ joined #mojo
05:24 anewkirk Caelum, yes, it's particularly good a complex and prickly validation situations
05:28 Caelum anewkirk: I have lots of stuff like: my ($foo, $bar) = $c->required_params(qw/foo bar/); $c->client_error('foo must be int') unless $foo =~ /^\d+\z/; ... and then there are complex deserialized data structures which checking manually would suck even more
05:29 freman tinkering with my resume code...
05:29 Caelum well, I tried to reproduce my disappearing headers problem with a mojolicious test, but couldn't, must be something in my mess of plugins
05:29 freman $asset->get_chunk(0, $start) - is sending the entire file even though $start is only 100 bytes of it
05:30 freman s/sending/reading
05:30 anewkirk Caelum, the validation needs are easy, the vanishing headers is something else
05:32 anewkirk Caelum, https://metacpan.org/module/Valid​ation::Class::Simple#GUIDED-TOUR
05:32 anewkirk ... is probably a good place to start
05:37 Caelum anewkirk: that looks awesome :)
05:38 Caelum anewkirk: I want to write something where you could write an API spec and it would build the validation classes for you
05:40 anewkirk Caelum, actually, that's a great approach, and its easy to introspect the class configuration
05:42 anewkirk ... look into auto-validating methods (kinda like method signatures) and you can automate hell out of a RESTful API
05:42 bayashi_ joined #mojo
06:03 shmuel Sorry for the newbe question: in mojolicious lith, what is the difference between helpers and normal funtions?
06:04 shmuel both I can call with $self->func(), right?
06:05 anewkirk you mean what's the difference in calling them?
06:07 shmuel in their use, mostly.
06:08 anewkirk not much in my observation
06:10 shmuel maybe it is just about the templates? I can call a helper from a template, but not a sub?
06:10 shmuel (or I can call a sub? haven't tried)
06:20 spleenjack joined #mojo
06:25 Britzel joined #mojo
06:26 duncanthrax joined #mojo
06:57 ulf How do I used mojo::IOLoop with a unix socket?
07:07 Mike-PerlRecruiter_ joined #mojo
07:16 jzawodn joined #mojo
07:17 duncanthrax joined #mojo
07:24 duncanthrax joined #mojo
07:28 Vandal joined #mojo
07:32 duncanthrax2 joined #mojo
07:36 duncanthrax joined #mojo
07:40 Mad_Dud joined #mojo
07:43 mattastrophe joined #mojo
07:44 dpetrov_ joined #mojo
07:44 duncanthrax joined #mojo
07:51 Molaf joined #mojo
07:53 mattastrophe joined #mojo
08:08 kthakore joined #mojo
08:11 daxim joined #mojo
08:11 ObseLeTe joined #mojo
08:15 dod joined #mojo
08:16 suy joined #mojo
08:18 duncanthrax joined #mojo
08:29 ObseLeTe joined #mojo
08:33 dod joined #mojo
08:35 yakudza joined #mojo
08:41 berov joined #mojo
08:42 berov Hi all
08:43 ver joined #mojo
08:43 berov I Am not sure what is going on but whan I try to authenticate to a service using Mojo::UserAgent and I have the '#' character inside my password my password is cut off up to the '#' characterhere is an example
08:44 berov using MOJO_USERAGENT_DEBUG=1
08:44 fhelmber_ joined #mojo
08:45 berov say my password is 12#lala
08:45 berov I see the following: Connect (https:kberov:12\:443)
08:45 berov and it is https connection
08:45 berov any hint?
08:47 berov the tx->error is : (Couldn't connect)
08:47 shmuel try to url-encode it?
08:47 berov ah thanks will try it immediateli :)
08:47 shmuel # is %23
08:49 berov yep wil use Mojo::Util::url_escape()
08:50 ka2u joined #mojo
08:56 andrefs joined #mojo
09:06 berov shmuel: Thanks, worked fine.
09:07 shmuel have fun!
09:07 berov :)
09:19 n0n joined #mojo
09:35 n0n joined #mojo
09:40 egopro joined #mojo
09:46 rihegher joined #mojo
09:51 marcus good morning
09:52 jpn joined #mojo
09:56 ladnaV joined #mojo
10:00 Vandal joined #mojo
10:11 egopro joined #mojo
10:23 n0n joined #mojo
10:42 judofyr joined #mojo
10:42 judofyr MOJO MOJO MOJO
10:51 mugenken joined #mojo
11:03 rem_lex|pivo joined #mojo
11:08 rihegher left #mojo
11:10 Akron joined #mojo
11:16 egopro joined #mojo
11:20 Vandal joined #mojo
11:20 Akron Good morning!
11:20 Akron berov: Mojo::URL should url_encode authority automatically.
11:36 ryozi joined #mojo
11:40 Akron I have a plugin which implements a kind of "helper helper" - something in between a helper and a hook.
11:40 Akron The user can establish the 'helper' by passing a callback function and a plugin can use it, in case it is implemented. The main use case is: Datastore agnostic access to datastores / caching in plugins. The question is: Am I missing something in core for this usecase?
11:40 Akron Here's the plugin: https://github.com/Akron/Sojolicious/blob/ma​ster/lib/Mojolicious/Plugin/Util/Callback.pm
11:41 Akron Of course, one can rebuild this with a helper, but has always to check, if the requesting helper is established (or has to establish it empty first). Also it pollutes the controller and has not clear semantics.
11:41 Akron Of course, one can rebuild this with a hook, but has to pass a reference to the requested information to the hook instead of getting it as a return value.
11:43 tomi-ru joined #mojo
11:45 judofyr Akron: you could use events?
11:46 Akron judofyr: You mean hook events?
11:46 judofyr Akron: Mojo::EventEmitter
11:47 judofyr Akron: but I notice that Mojolicious doesn't actually inherit from EventEmitter
11:47 Akron Well - I can establish my own hooks, that are emitted events from EventEmitter as far as I understand - but I then have no return value, right?
11:48 judofyr Akron: oh you care about the return value from the callbacks? hm. I just don't quite see the usecase here. plugins can already accept "callbacks" by just accepting subs in the register-method
11:49 Akron Regarding hooks you have something like this: https://github.com/Akron/Mojolicious-Pl​ugin-PubSubHubbub#on_pubsub_acceptance
11:50 judofyr Akron: oh, I'm a bit more fan of `plugin 'FooBar', on_baz => sub { … }`
11:50 Akron Yes, I could establish these callbacks when registering, but maybe I have a different plugin for organising my datastore and want to establish it there.
11:51 judofyr Akron: then you can do: `plugin 'FooBar', on_baz => something_that_creates_a_subref`
11:54 Akron judofyr: And that's more elegant? ;) But ... I don't really understand what you mean. What's the difference? In that case I defintely need to define a callback in advanced and have to know, that I want to use it later in a plugin, right?
11:55 judofyr Akron: I just don't see why the *plugin* must support your special callback-style
11:58 Akron judofyr: That's why I would like to use something in core, but cannot find something really pleasant. But: If I have a plugin using the callback-plugin for data agnostic access to datastores or caching or whatever, the callback helper is established anyway and could be used by any other plugin that wants to provide the datastore access.
12:01 Akron That way, I could have a plugin 'Datastore::MySQL' and could use it - or I can change it to a plugin 'Datastore::SQLite' if I want to - and it will access the plugins using the same callback. I don't have to establish everything on registration.
12:02 Akron judofyr: Although I see your point regarding the registration establishement. That's a better solution than helpers or hooks ...
12:02 judofyr Akron: and how do you avoid conflicts between two plugins? (that's defining the same callback but using it differently?)
12:02 Akron judofyr: Similar to hooks there is the -once flag to disallow overwriting.
12:03 judofyr Akron: sure, but that means there are cases where I as a user can't use Plugin1 and Plugin2. it doesn't help me that one of them throws an error.
12:04 Akron judofyr: Sorry, can you explain this point a little bit.
12:06 Akron Why isn't this helpful and which use case does it prevent?
12:07 judofyr Akron: example: I've written plugin FooBar, you've written Datastore::MySQL. both depend on the Callback-plugin and uses it for callbacks. however, we both used the "expire_cache"-callback (or whatever) and *differently*. that means that these two plugins are incompatible with each other.
12:11 Akron judofyr. Ah ... that's a good point! And it's a different use case from what I meant. I didn't mean generic callbacks like "get_from_cache" and there's a generic chi-cache aware callback. The callbacks would be unique like hooks. But that's true: It's not clear from the description of the plugin.
12:11 judofyr Akron: what would an example callback anme be?
12:14 Akron judofyr: I don't know if that's the best use case ... but the first one I could find ... it's too special for a hook, unfortunately it's not well defined in the pod: https://github.com/Akron/Sojolicious/blob/ma​ster/lib/Mojolicious/Plugin/HostMeta.pm#L385
12:15 Akron The callback "get_hostmeta_from_cache" or whatever would return a document from the cache, if it is there. The host name would be passed.
12:16 Akron (Pretty bad example ... I will investigate further.)
12:17 egopro joined #mojo
12:19 Akron judofyr: That's a better one, as it is not just a cache request: https://github.com/Akron/Sojolicious/blob/master​/lib/Mojolicious/Plugin/PortableContacts.pm#L402
12:20 Akron This passes a portable contact request like: https://github.com/Akron/Sojolicious/blob/master​/lib/Mojolicious/Plugin/PortableContacts.pm#L366 to the callback and another plugin could provide a datastore implementation for SQLite or - more natively - a documentstore.
12:20 SmokeMachine joined #mojo
12:22 Vandal joined #mojo
12:24 Akron In that case I could do something on registration like: plugin(PoCo => { read_poco => sub { $c->my_read_poco(@_) } } ... but that's pretty ugly. I would prefer plugin 'PoCo'; plugin 'PoCo::DataStore'; or similar.
12:25 Akron How would you handle this case? You already convinced me that it's not the smartest idea to use a plugin like that. ;)
12:31 ladnaV joined #mojo
12:51 jberger alnewkirk, shmuel, the difference between a helper and a normal method (I'm assuming shmuel meant method), is that it is a method on both the application class and the controller class AND is a function in the template
12:54 phillipadsmith sri: Oh, FYI, the reason that I thought you had some dotcloud intel was because the skeleton Perl + MySQL template they present when creating a new project is a Mojolicious::Lite app
12:55 Vandal joined #mojo
12:56 jberger phillipadsmith, do you have the link for that handy?
12:56 phillipadsmith jberger: let me dig it up
12:58 phillipadsmith jberger: https://github.com/dotcloud/stack-perl-mysql
12:58 jberger thaks
12:58 jberger *thanks
12:58 * jberger looks
13:01 jberger yeah
13:01 jberger as I expected, it keeps the dbh in a lexical
13:01 jberger it really should be in an attribute
13:01 jberger the problem is attributes are kinda hard to use in ::Lite
13:01 jberger so most examples do it this way
13:01 jberger including mine
13:02 jberger https://github.com/dotcloud/stack-​perl-mysql/blob/master/app/app.pl
13:02 jberger oops
13:02 jberger https://github.com/dotcloud/stack-pe​rl-mysql/blob/master/app/app.pl#L32
13:02 berov Akron: my url looked like "https://user:password@host"
13:03 berov i do not know why it did not encode it
13:04 jberger berov, there is a decidability problem in that case I guess
13:05 jberger your password might also have an @ or a '.com'
13:08 jberger phillipadsmith, I also think its funny how that example reimplements the JSONConfig plugin
13:08 jberger https://github.com/dotcloud/stack-p​erl-mysql/blob/master/app/app.pl#L7
13:08 jberger doesn't show a deep understanding of the framework
13:16 berov jberger: I had '#' in the password
13:16 Akron berov: In that case you force Mojo::URL to accept an invalid url I guess. print Mojo::URL->new('https://host')->authority('us#er:password')->authority; works as expected.
13:17 ladnaV joined #mojo
13:17 berov jberger: thanks - good to know
13:17 egopro joined #mojo
13:18 berov actually this seems cleaner to me
13:18 jberger yeah I like that better too
13:20 phillipadsmith jberger: no doubt they would accept patches/pull requests. :)
13:20 jberger I'm sure
13:21 phillipadsmith good point re: JSONConfig
13:21 Akron berov: Sorry, it has to be Mojo::URL->new->authority('us#er:password@host')->scheme('https') of course ...
13:22 berov aha will take look definitely - this way will not have to take care of what passwords may contain
13:22 jberger Akron, I would think you could just parse the URL wo the credentials
13:22 jberger then use the authority attribute to add them
13:23 Akron jberger: Mojo::URL->new('https://host/')->authority('us#er:password') does not work.
13:23 jberger really?
13:23 * jberger checks
13:23 berov I will check too :)
13:24 Akron Mojo::URL->new('https:')->​authority('us#er:password@host') works however. The authority seems to stick to the host.
13:25 jberger that seems odd
13:25 jberger who knows, maybe that's by design, but it seems odd to me
13:25 Akron Don't know if this can be considered as a bug.
13:26 moltar joined #mojo
13:27 jberger looking at the code, it definitely seems to be by design
13:27 Akron I guess it is based on the wording of rfc3986. The host + port is part of the authority and so if there is none, it's overwritten.
13:27 jberger you could bring it up with sri though
13:27 jberger this seems like a useful functionality
13:27 jberger IMHO
13:28 jberger especially when there are odd characters in the credentials
13:28 Akron The patch could ignore port + localhost if it is not given, I think. Shouldn't break anything ... I'll try.
13:30 jberger wait
13:30 jberger using the wrong attribute
13:30 jberger user_info
13:31 jberger userinfo
13:31 berov :D - did I just helped  enhancing Mojolicious a little :)?
13:31 jberger perl -MMojo::URL -E '$url =  Mojo::URL->new("https://host.com/")->userinfo("us#er:password"); say $url'
13:31 tmirchev joined #mojo
13:31 jberger berov, almost
13:31 jberger :-P
13:31 berov :)
13:32 berov at least made you think about it :)
13:32 jberger the authority is the concatenation of several attributes
13:32 jberger set the credentials with userinfo
13:32 jberger berov, thats important too sometimes
13:32 berov actually Mojo::Url makes exactly what I did by hand this morning
13:33 berov tryed the snippet above
13:33 jberger I like that I can ->clone
13:33 Akron Oh - right!
13:33 jberger then set relative paths or query params for a specific request
13:34 jberger its really useful when doing lots of requests on one site
13:34 * jberger <3 Mojo::URL
13:34 Akron jberger++
13:37 aalecs joined #mojo
13:37 aalecs hello
13:38 Akron Hi aalecs!
13:38 aalecs i get this on an older snippet of code that i am trying to port to latest mojo. : Can't locate object method "process" via package "Mojo::UserAgent"
13:40 aalecs this is the problematic code: https://gist.github.com/alecs/5051186
13:40 aalecs issue at line 346
13:40 Akron Is this that old that it's deprecated before 1.0? (version 0.999930?)
13:41 aalecs 3 years old
13:42 Akron Use "start" method now.
13:43 aalecs thanks, i'm so tired that i didn't see that in the docs
13:43 aalecs :(
13:43 Akron aalecs: http://search.cpan.org/~sri/Mojoliciou​s-3.87/lib/Mojo/UserAgent.pm#build_tx - it's mentioned here: https://github.com/kraih/moj​o/blob/master/Changes#L2416
13:43 Akron np.
13:43 daxim joined #mojo
13:50 Britzel_ joined #mojo
13:51 aalecs we only have build_tx no matter the method, is that right ?
13:52 berov left #mojo
13:53 Akron The method? Well - there are shortcut methods for get and post etc. but you use build_tx to define whatever you want. There is now no more differentiation what kind of data you send - just use "json" or "form" as keywords.
13:56 aalecs Akron: yes, that i was asking, cause befoe this we had build_tx amnd build_form_tx
13:56 aalecs 10q
13:57 aalecs before*
13:58 Akron aalecs: Yes - just use => form => now.
13:59 aalecs i'm close to porting an older code for a twitter proxy to latest mojo
13:59 Akron The good thing is: "Changes" is very well documenting what you have to do.
13:59 Vandal joined #mojo
14:04 aalecs yeah, search works for now
14:04 aalecs http://91.208.213.13:3000/api/sear​ch.json?q=antis0cialul&amp;rpp=10
14:11 Akron You have to switch till tomorow for OAuth authentication?
14:12 aalecs i have to use a oauth proxy and am tired of using supertweet
14:12 aalecs oauth is implemented for years
14:13 Akron Ah, okay.
14:13 aalecs and also don;t want to use supertweet's software
14:13 aalecs so am building mine
14:14 berov joined #mojo
14:15 aalecs and my dumb twitter client does not auth and i got to figure a way to make him auth
14:16 Akron Why do you need to proxy?
14:17 aalecs because my twitter client does not know oauth
14:17 aalecs and i do not want to use another client, eventually based on air..
14:17 Akron Ah - so you proxy basic auth to oauth. Isee.
14:17 aalecs so i have to use a proxy that oauths and send the data for me
14:17 aalecs yes :D
14:18 egopro joined #mojo
14:18 aalecs and the rest of twitter clients for linux or dont't work or crash
14:18 aalecs i`ve got qwit for example
14:19 aalecs qwit is making a rhime with s*it
14:19 aalecs https://code.google.com/p/​qwit/issues/detail?id=158
14:20 Akron I used Choqok a long time but never really liked it.
14:21 sh4 joined #mojo
14:21 aalecs well, in my distro is not in the repos, i tried building it, it hanged, i gave away
14:22 aalecs uh it appears they built it, lemme try it
14:24 aalecs so this don;t know oauth also
14:24 aalecs wtf
14:24 aalecs bloatware
14:25 Akron Don't know oauth? Funny. Well - I now use Tweetdeck.
14:26 aalecs that;s air based no ?
14:26 Akron Browserbased.
14:27 aalecs HMAC(SHA1) is not supported!
14:27 aalecs KCrash: Application 'choqok' crashing...
14:27 aalecs KCrash: Attempting to start /usr/lib/kde3/bin/drkonqi from kdeinit
14:27 aalecs sock_file=/home/alecs/.kde4/soc​ket-rainsoul.wdu.ro/kdeinit4__1
14:27 aalecs bwahahahah
14:27 aalecs another piece of useless junk
14:27 Akron I did not recommend it!
14:27 aalecs i know :D
14:27 aalecs i remebered
14:27 aalecs :D
14:35 gryphon joined #mojo
14:38 n0n joined #mojo
14:39 sri \o\
14:39 sri /o/
14:40 Akron ~0~
14:40 aalecs ?
14:40 sri Bender: trust tempire
14:40 Bender But I don't trust you in #mojo, sri
14:40 sri :(
14:41 Akron That happens when harlemshaking the channel! ;)
14:42 toebu joined #mojo
14:44 bluescreen joined #mojo
14:46 dod1 joined #mojo
14:48 jberger when in doubt, add memes
14:48 jberger !!
14:48 jberger Akron, did you see the daily show's harlem shake
14:49 jberger best one
14:52 jberger ok I think I'm about ready for tonight
14:52 jberger http://joel.phy.uic.edu:3000/
14:54 Akron :)
14:54 Akron jberger: I don't know if it's necessary to mention the basic server.
14:55 jberger you mean daemon?
14:55 jberger why not?
14:55 Akron Yes.
14:55 jberger its the foundation upon which all else is built
14:55 jberger perhaps more importantly, it shows that it is in fact a command script itself
14:55 Akron I think it's more confusing for beginners. Or what's your target audience?
14:56 jberger because at the end I have things like eval, and routes which don't make sense under morbo
14:56 jberger this is for Chicago.pm
14:56 Akron Ah, okay. In that case everybody should be prepared.
14:56 bd jberger: hm, the baloon for "perl rocks" ... i envision a rock with "perk rocks" on it ;)
14:57 jberger bd, that graphic is lifted straight from mojolicio.us
14:58 aalecs jberger: nice pages :D
14:58 jberger Akron, the more I think about it, the more I think daemon is the only one that makes sense really, IMO morbo/hypnotoad are more confusing
14:58 jberger aalecs, thanks
14:58 rhaen joined #mojo
14:59 jberger I'm thinking of abstracting the mechanism into a plugin, so I can use if for other presentations
14:59 jberger the Perl code highlighting is already on cpan: Mojolicious::Plugin::PPI
15:00 Akron The presentation rocks.
15:00 aalecs yes it really does
15:01 jberger and all the code is rendered from actual example scripts, so I will live demo each one
15:01 aalecs pf if i'd just get this twitter proxy to work and request auth from the clients :(
15:01 Akron jberger: I don't agree. Everybody who wants to play with Mojolicious should know about morbo. Daemon is too limited I guess.
15:01 jberger the slides are like this btw: https://github.com/jberger/WCpm-Mojoli​cious/blob/master/presentation.pl#L40
15:01 ladnaV joined #mojo
15:02 jberger Akron, I understand, but the idea that the app is a script itself is important
15:02 jberger understanding how morbo/hypnotoad load and operate them is IMO hard to understand
15:03 jberger so yes I will absolutely tell them they should use morbo for dev and hypnotoad for deploy, I still think mentioning daemon is important
15:04 bd since we are on that, is there a way to synchronize data between hypnotoad childern? besides using a database.
15:04 jberger bd, not really
15:04 jberger message queue
15:04 Akron It's like a separated server. I don't think that's confusing. The "it's a command script" thing is there when telling about commands. And daemon is just a command ... (rarely used).
15:05 bd Akron: my app runs with ::daemon
15:05 jberger Akron, how about this for a reason, hypnotoad doesn't work on windows
15:05 Vandal joined #mojo
15:06 jberger or daemon is used for app servers, where they handle the worker pools
15:08 Akron Hmmm ... but daemon should not be encouraged for deployment. Is daemon better for deployment on windows than - say FastCGI?
15:08 jberger http://blog.kraih.com/post/43199102900​/mojolicious-in-the-cloud-hello-heroku
15:08 jberger Akron, I'm just asking here, not trying to sound condescending, do you know that morbo is just daemon with autoreloading?
15:09 Akron Maybe I'm wrong regarding daemon.
15:09 jberger and hypnotoad is just daemon, but preforked and worker pooled?
15:09 Akron Yes, I know that.
15:09 jberger ok
15:09 jberger I really was just checking :-)
15:09 bd Akron: cgi does not support ioloop
15:09 jberger cgi does not support websockets etc
15:10 Akron bd: Good point (although I was talking about fcgi. ;))
15:10 jberger so yeah, I would say daemon is better in that regard
15:10 Akron Yes, true.
15:10 jberger even fcgi doesn't
15:10 jberger all that said, I think its worth a one line mention :-)
15:10 Akron Valid arguments.
15:11 Akron jberger: Yes, I agree.
15:11 jberger of course I will encourage the morbo/hypnotoad use when possible
15:12 jberger as long as I have you guys here, do you have any other comments?
15:12 jberger I do go really fast through the basics cause I want to get to the interesting stuff later
15:13 jberger I will talk it though carefully
15:13 sri daemon is pretty good for cloud deployments on heroku and dotcloud
15:14 Akron Does heroku support websockets?
15:14 jberger Akron, you have to add them as an extra
15:14 jberger though it may be free
15:14 Akron jberger: The "web scale" on page 2 should be bold. :-P
15:14 sri their routing layer doesn't yet
15:14 nicomen cosimo: Happy birthday! ;)
15:15 Akron I always wanted to try websockets on Uberspace but didn't have the time ...
15:16 bd jberger: i am pretty new to mojo, so i don't think i can be of much help presentation wise
15:16 jberger bd, thats fine, I'm curious what a new viewer would think
15:16 sri morbo smooth self restarting and hypnotoad zero downtime deplyment are kind of big features though
15:16 jberger of course, in person I will explain and demo these, so I guess thats not quite the same here
15:17 jberger sri: I can change those wordings
15:18 Akron jberger: The presentation is great! I especially like the emphasis on tests!
15:18 sri a fun demo is also to run an ab stress test against a hypnotoad while zero downtime restarting it live
15:19 jberger sri: that does sound fun, it might be a little beyond the scope
15:19 jberger maybe I can show that off during the beer afterwards :-)
15:20 bd jberger: content wise it is fine. i'd prefer more contrast on the code though, but may depend on the beamer on location ...
15:20 jberger yeah, I'm going to check that when I get there
15:20 jberger thanks for reminding me though
15:20 jberger just css after-all
15:21 kitt_vl joined #mojo
15:22 bd now i really need to do my hours and write invoices ...
15:23 Akron Have to go too, bye!
15:24 jberger sri: http://joel.phy.uic.edu:3000/5
15:24 jberger bd, Akron: o/
15:24 jberger thanks
15:24 btyler joined #mojo
15:30 aalecs how can i send a http auth request, so the client knows to send auth ?
15:31 judofyr aalecs: you want to send a 401 Unauthorized and set the WWW-Authenticate header: http://en.wikipedia.org/wiki​/Basic_access_authentication
15:32 aalecs i send the 401 for nothing, the dumb client don't get it :(
15:32 judofyr aalecs: what does the server logs say?
15:32 judofyr aalecs: does it say "401 Unauthorized (0.123s)
15:33 aalecs yu[
15:33 aalecs yup
15:37 judofyr hm…
15:41 aalecs it would of been simple if the client sent the auth, but the only headers are user-agent, connection and host
15:43 aalecs i send him 401 and he don't give a s**t
15:43 judofyr well, then the client doesn't follow the HTTP spec ;)
15:46 aalecs i see even in the browser it does not appear :(
15:47 judofyr aalecs: then you're doing something wrong :)
15:48 aalecs hm
15:48 aalecs $self->res->headers->www_authenticate;
15:48 aalecs $self->res->code(401);
15:48 aalecs is not enough ?
15:48 judofyr aalecs: $self->res->headers->www_authenticate("Basic realm=Hello world")
15:50 stephan48 aalecs: are you using cgi?
15:50 mattastrophe joined #mojo
15:50 aalecs stephan48: no, daemon
15:51 aalecs ok, now the clients send what it has to send but i miscoded smth
15:51 aalecs 10q
15:53 aalecs and once again i realise how freaking easy is to just get data from http auth :(
15:54 aalecs but the twitter clients don't know ssl or oauth, so...
15:57 d4rkie joined #mojo
16:03 vervain joined #mojo
16:09 mattastrophe joined #mojo
16:13 Vandal is there a way to have var in template and dont get exeption if it no in stash?
16:14 jberger Vandal, just extract it manually from the stash
16:14 jberger if ( my $var = stash 'var' ) { ... }
16:14 jberger or else add it to the defaults, so that there is always a stash value
16:15 jberger app->defaults( var => 'this is the default value unless otherwise stashed' );
16:15 Vandal thanks
16:16 jberger np
16:19 sri perl -Mojo -E 'a({inline => q{<% no strict "vars"; %><%= $foo || "default!" %>}})->start' get /
16:19 sri don't do that ;p
16:21 jberger sri: is there a way to know what templates are available, especially those in a data section
16:21 jberger if there isn't thats ok
16:21 jberger just curious
16:22 sri internally we do, but there is no public api
16:22 jberger thats fine
16:22 sri we use it for handler detection
16:23 sri so you can just say render('foo') and it will figure out the rest
16:23 jberger is there a way to say render this template if it exists or else render that?
16:24 sri render('foo') unless render('bar')
16:24 jberger ah cool
16:24 sri it's a controversial feature actually
16:24 sri since some folks would expect a 404 if a template doesn't exist
16:24 jberger for doing presentations I'm kinda bastardizing the template sysmte
16:25 jberger system
16:25 jberger but it would be nice to know how many pages the presentation has
16:25 jberger or at least handle it nicely if you go past the end
16:25 sri we use that alternative rendering internally for 404, 500 and auto rendering though... so it couldn't really be changed even if we wanted :)
16:25 jberger but this is not a normal thing
16:27 sri and it's easy enough to do helper render_once => sub { my $self = shift; $self->render_not_found unless $self->render(@_); };
16:28 jberger sri: yeah thats a good recipe
16:29 jberger and so with that recipe, you can leave the system more flexible
16:29 jberger which is always good
16:29 sri what confuses people sometimes is that if no template could be found it falls back to assuming delayed rendering, and most likely the connection timing out, so it's a tricky subject
16:31 sri (you get the log messages telling you what's happening, but no response at all in the browser window)
16:31 jberger I don't think its that unexpected that not finding a template should do something different than not finding a particular page
16:31 sri kinda the downside of doing non-blocking as a major part of the framework design
16:32 jberger right, Mojolicioius is non-blocking, if this is the only downside, I'm ok with that :-)
16:33 sri it used to come up more often, but i guess the log messages got descriptive enough now :)
16:34 jberger it never confused me
16:34 jberger if thats any indication
16:34 jberger message made sense
16:36 sri oh, btw. you can of course make a list of all files yourself
16:37 sri just grab app->renderer->classes/paths
16:37 sri Mojo::Loader::data keeps all DATA files cached
16:39 sri the inflate command is a good example i guess
16:43 * sri really likes the classes/paths design, makes it so easy to ship templates and static files with plugins
16:54 aalecs one more q guys
16:55 aalecs im getting the authstring like this
16:55 aalecs my $authString = $self->req->headers->authorization
16:55 aalecs and doing this after
16:55 aalecs my ($username, $password) = split /:/, b($authString || "")->b64_decode;
16:55 good_news_everyone joined #mojo
16:55 good_news_everyone [mojo] kraih deleted stack_all_containers at 8294c06: http://git.io/sPP9fg
16:55 good_news_everyone left #mojo
16:55 aalecs but it does not work
16:55 good_news_everyone joined #mojo
16:55 good_news_everyone [mojo] kraih deleted monotonic_clock at 922f744: http://git.io/xVZ9Lg
16:55 good_news_everyone left #mojo
17:00 jberger sri: if I have a plugin with templates lets say its called Mojolicious::Plugin::SimpleSlides, where would its templates go?
17:01 jberger this is something I've never fully understood and I really should
17:01 labrown joined #mojo
17:01 * jberger tries to find answer himself
17:02 jberger oh nm
17:03 aalecs jberger: you found ?
17:03 jberger ok so I get confused sometimes because the controllers can have their own subfolder in the renderer path
17:03 jberger and I thought you meant that plugins had something similar
17:03 jberger but they just push another path onto the paths
17:03 jberger and that I understand
17:04 jberger I didn't know about classes though, thats coold
17:04 jberger cool
17:05 jberger I have taken to putting plugin templates in attributes though
17:05 jberger then partial rendering them inline
17:05 jberger means you can programmatically override the template
17:06 jberger then again, if I pushed onto the renderer paths you would override by providing your own template
17:06 jberger 6 <=> half dozen
17:10 dod joined #mojo
17:10 n0n joined #mojo
17:11 dod joined #mojo
17:11 sri inline templates are rather inefficient, avoid them if you can
17:11 aalecs what am i doing wrongish here my ($username, $password) = split /:/, b($authString || "")->b64_decode;
17:14 xaka joined #mojo
17:15 jberger sri: noted
17:16 jberger perl -E 'say for sort {$a <=> $b} qw/6 half_dozen/' hehe
17:29 dod joined #mojo
17:49 rwstauner joined #mojo
17:57 avkhozov joined #mojo
17:58 basiliscos joined #mojo
18:34 aalecs well, twitter proxy working ! need testers !
18:37 SmokeMachine joined #mojo
19:06 Mike-PerlRecruiter_ joined #mojo
19:06 btyler joined #mojo
19:23 n0n joined #mojo
19:40 asarch joined #mojo
19:40 tmirchev joined #mojo
19:40 tmirchev left #mojo
19:40 tmirchev joined #mojo
19:49 anewkirk phillipadsmith, I didn't have much luck with dotcloud
19:49 anewkirk the canned-stacks worked fine but my cusom app had much trouble
19:50 anewkirk ... and I was trying to deploy with plackup
19:57 ulf joined #mojo
19:58 ulf How do I use mojo::IOLoop with a unix socket?
19:59 Akron joined #mojo
20:02 ObseLeTe joined #mojo
20:04 anewkirk Caelum, I've been tickering with this which may help you on your quest, it's an API framework built around Mojolicious, MongoDBI and Validation::Class all nestled behind a Facade pattern -- https://github.com/anaio/LayerCake
20:08 good_news_everyone joined #mojo
20:08 good_news_everyone [mojo] kraih deleted fast_monotonic_clock at 9faa6b8: http://git.io/1gAl2w
20:08 good_news_everyone left #mojo
20:11 mattastrophe joined #mojo
20:11 good_news_everyone joined #mojo
20:11 good_news_everyone [mojo] kraih created monotonic_clock (+1 new commit): https://github.com/kraih/mojo/commit/8a373d9d0fa2
20:11 good_news_everyone mojo/monotonic_clock 8a373d9 Sebastian Riedel: added monotonic clock support
20:11 good_news_everyone left #mojo
20:12 sri that should be the correct way to do it, not gonna merge it into master, but we can keep it around for when Time::HiRes gets better
20:14 jberger never would have thought that it is so hard to keep a steady time
20:19 BeDa joined #mojo
20:24 travis-ci joined #mojo
20:24 travis-ci [travis-ci] kraih/mojo#312 (monotonic_clock - 8a373d9 : Sebastian Riedel): The build has errored.
20:24 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/commit/8a373d9d0fa2
20:24 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/5142766
20:24 travis-ci left #mojo
20:25 Caelum anewkirk: sweet
20:25 Caelum anewkirk: and now that sri is writing a mongodb driver that doesn't suck, it will be even more awesome
20:25 sri jberger: looks like it's even harder :S
20:26 anewkirk I've been following Mango's progress ...
20:27 anewkirk I'm not sure if friedo (per mongo driver maint.) is aware of it, maybe they might converge at some point
20:27 jberger sri: :-/
20:27 sri i've talked to friedo recently
20:28 jberger timing is hard, lets go shopping
20:28 sri reported a massive bug in the official mongodb driver
20:28 anewkirk I decided to phase out MongoDBI and split it into two separate modules (mapping and querying), one of which has already been released, MongoDB::QueryBuilder
20:28 sri he said he liked mango
20:29 anewkirk oh, nice, maybe he should turn over maintainership to you?
20:29 sri i would never touch it ;p
20:30 anewkirk :}
20:30 sri the code is bad, really really bad
20:30 anewkirk oh, I've never really looked
20:30 anewkirk I know the implementation has changes often
20:31 basiliscos joined #mojo
20:31 sri you prolly notice the new MongoClient class thingy where everything defaults to safe writes and stuff?
20:31 sri well... it's completely broken and still defaults to unsafe
20:32 sri in fact, it ignores your w and j settings
20:32 anewkirk I have noticed, not sure why when I know it gets released as _DEV and official releases?
20:41 sri https://jira.mongodb.org/browse/PERL-211 # the ticket makes it sound pretty harmless
20:41 bluescreen joined #mojo
20:41 n0n joined #mojo
20:44 basiliscos joined #mojo
20:54 rem_lex| joined #mojo
21:10 xaka joined #mojo
21:25 anewkirk ha, yes it does
21:34 jberger ok off to present at Chicago.pm
21:34 jberger o/
21:39 Akron jberger++ Have fun!
22:16 jpn joined #mojo
22:17 ka2u joined #mojo
22:27 lucs sri: Typo, Routing Guide, shortly after "route with children", s/it's/its/
22:30 good_news_everyone joined #mojo
22:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/QWDkMg
22:30 good_news_everyone mojo/master 6cf96e4 Sebastian Riedel: fixed typo
22:30 good_news_everyone left #mojo
22:30 sri lucs: thanks, fixed
22:44 gryphon joined #mojo
22:45 mugenken joined #mojo
22:50 lucs Um, in the Routing Guide, an example mentions  $inactive->route('/foo')->to('foo#none') , but the accompanying comment indicates that the routing will be  /foo -> {controller => 'foo', action => 'bar'} ; I was expecting the action to be "none" (is that a special keyword). What am I misunderstanding?
22:50 lucs s/keyword/keyword?/
22:53 good_news_everyone joined #mojo
22:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OhK3FA
22:53 good_news_everyone mojo/master 77498dc Sebastian Riedel: fixed format detection example
22:53 good_news_everyone left #mojo
22:54 sri lucs: :)
22:55 lucs sri: Er, is it a typo? (I'm just starting out, so I tend to believe almost everything :)
22:55 sri it was
22:55 lucs Aha, okay, thanks :)
22:58 sri jberger, marcus, tempire, crab: we should think about what we want to do with format detection in 4.0
22:58 sri like disabling detection by default, or getting rid of it
23:07 Caelum I have a request that takes 600ms, is that too slow for a mobile api?
23:12 hrupp joined #mojo
23:15 d4rkie joined #mojo
23:17 ObseLeTe joined #mojo
23:29 jpn joined #mojo
23:36 ObseLeTe joined #mojo
23:37 Kovensky 600ms *server-side*?
23:41 mattastrophe joined #mojo
23:49 ka2u joined #mojo

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