Camelia, the Perl 6 bug

IRC log for #mojo, 2011-09-15

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

All times shown according to UTC.

Time Nick Message
00:18 noganex joined #mojo
00:40 diegok Is there support for the method overriding thingy, or is it possible to implement it on a plugin?
00:47 driller_work joined #mojo
00:49 sri the what?
00:58 sri hmm, mailing list sheriffs on vacation? :S
01:00 * sri pokes tempire and crab
01:00 jmmills could anyone give me a hint as to why this doesn't issue a basic auth prompt when using the helper and no auth info has been input: http://pastie.org/2534807
01:01 jmmills it is getting to the headers section
01:02 jmmills the idea being that in development mode the app will take care of auth but in production basic auth is taken care via upstream proxy
01:04 jmmills am I attaching the helper in the wrong place or something?
01:04 perlrocks Twitter: "The question of the day, convert #RestMQ to #tornadoweb or to #mojolicious" --rbucker http://twitter.com/rbucker​/status/114142530425208832
01:05 sri jmmills: did you forget to call ->rendered?
01:05 sri i would do ->rendered(401)
01:06 sri or render(text => 'lalala', status => 401)
01:07 * jmmills tries
01:08 jmmills sorry if this is all newbie stuff, but I've only been playing with mojo for the last few days
01:09 jmmills negative
01:09 purl negative is, like, appropriate
01:10 SmokeMachine joined #mojo
01:12 jmmills nothing in output headers either
01:13 tempire I'm only the irc sheriff
01:13 tempire I'm only a spam cleaner for the mailing list
01:15 xaka joined #mojo
01:16 vel joined #mojo
01:17 tempire what's wrong on the list?
01:22 sri that guy nobody understood sent the same question like 5 times
01:23 sri guess we could use more list sheriffs
01:35 jmmills okay some progress, it looks like the response object is getting clobbered between the helper and the ->render call
01:36 tempire oh that dude.
01:36 purl rumour has it that dude is just a confused person
01:37 jmmills ah, got it.
01:38 tempire he was quite demanding.  quite the sense of entitlement.  and 2-3 people popped up in here to deal with him.
01:38 jmmills sri, the error was in the call to the helper function... I was calling it from the context of 'app' rather than the controller
01:38 jmmills okay so next step will be figuring how to "blanket" the entire app with an auth check that inflates a user object
01:39 jmmills no auth -> ask for auth : got auth -> provide a helper with user object
01:41 tempire jmmills: bridges.  http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
01:41 tempire or in m::lite, under
01:42 jmmills ah
01:42 jmmills under would be the one for me
01:42 jmmills this is a lite app
01:42 jmmills but it's always good to know both ways
01:42 * jmmills looks for doc's for under
01:43 sri watch the screencast ;)
01:44 jmmills screencasts OoOO
01:44 jmmills linked on the wiki?
01:44 sri linked on frontpage
01:44 jmmills looks like under sub {} matches everything where as under <route> sub {} matches only <route> matches
01:45 jmmills cool
01:46 jmmills setting a stash variable is in an application wide context, right?
01:46 jmmills flash is request context?
01:46 jmmills or in reverse?
01:47 noganex joined #mojo
01:47 sri you should invest a few hours in documentation reading, it's all in there ;)
01:47 jmmills :P
01:47 jmmills I need a usb port for my brain
01:48 sri flash is growing guide and stash is basically everywhere
01:48 sri usb is like so last year!
01:48 jmmills thunderbolt
01:48 purl hmmm... thunderbolt is mini displayport but for other things too
01:49 sri !
01:49 jmmills ;)
01:49 jmmills just have to wait for devices to support it
01:49 jmmills anyways thanks for the help, I'm going to afk - then when I get back read a bunch of docs
01:49 sri at least you're hip… until next year
01:52 noganex_ joined #mojo
01:52 j3nnn1 joined #mojo
01:57 noganex joined #mojo
03:37 driller_work say I'd like to write an API with an authentication module. I am quite confused as I don't know if I should just authenticate their first connection and then let them do their thing or if I should authenticate every request? is it "normal" to ask the requester to authenticate for every request he does?
03:53 metaperl sri you had been wondering what the PAR people had to say about __FILE__. Here it is - http://www.livingcosmos.org/2011/09/__file__-p​seudo-literal-breaks-parpacker-executables-2/
03:54 metaperl summary - __FILE__ will not work under PAR executables
03:54 driller_work no one? :P
03:54 xaka joined #mojo
03:55 sri metaperl: interesting
03:55 sri metaperl: did you see my change to the detection code?
03:55 metaperl sri - no in Mojo::Controller? I wll go git fetch now
03:55 sri it's now all centralized in Mojo::Home, you can easily overload it
03:56 sri since it's used in multiple places
03:56 sri https://github.com/kraih/mojo/bl​ob/master/lib/Mojo/Home.pm#L108
03:57 sri driller_work: try the growing guide
04:00 metaperl driller_work: its not normal to auth every request
04:01 metaperl driller_work: look at mojocast.com ... mojocast #3 and use the under directive to require auth for certain paths
04:01 metaperl the Mojolicious::Plugin::Authentication to control access to those paths
04:03 metaperl sub mojo_lib_dir { File::Spec->catdir(dirname(__FILE__), '..') }  # hmm i'm not sure how that changes things
04:05 sri it allows you to overload it with your own detection code for PAR
04:08 metaperl this is the difference here - our $EXCEPTION = $H->slurp_rel_file('exception.html.ep');
04:08 metaperl our $DEVELOPMENT_EXCEPTION =
04:08 metaperl this is profoundly different
04:10 metaperl oh now I see
04:10 metaperl because mojo_lib_dir is a sub
04:10 metaperl you can override it
04:10 driller_work thanks sri, that explains a few things
04:11 driller_work although still I am worried on how to build this rest service, I thought XML/JSON etc could be just passed into a rest service without calling the exact uri with stuff, so eg instead of /add/user/<id> I thought I could just do a /add/user and then pass a XML/JSON/TXT/whatever in a easy-way which does the same thing
04:13 vel joined #mojo
04:15 tempire driller_work: http://shop.oreilly.com/product/9780596529260.do
04:16 tempire will clear up all your rest questions, and set you straight on urls
04:30 driller_work ack.. I see what I am missing for mojo :P http://advent.perldancer.org/2010/8
04:34 sri please read the documentation before saying something is missing
04:49 mantovani joined #mojo
04:49 mantovani hi
04:49 purl salut, mantovani.
04:49 mantovani I'm usding Test::Mojo
04:50 mantovani using*
04:50 mantovani and I have a redirect
04:50 mantovani can I do something like
04:50 mantovani $t->get_ok('url')->max_red​icts(...)->status_is(200)?
04:50 mantovani or something like ?
04:50 purl something like what, mantovani?
04:50 mantovani purl: karma me
04:50 purl mantovani has karma of 66
04:51 Foxcool joined #mojo
04:52 tempire ok, so I was wrong before
04:53 tempire but this time I'm right
04:53 tempire new season of fringe starts on friday
05:15 osprey joined #mojo
05:39 sromanov joined #mojo
05:44 cstamas joined #mojo
05:50 intervoice joined #mojo
05:51 intervoice Does anybody knows how to view channel messages log?
05:52 driller_work try the topic
05:52 driller_work http://irclog.perlgeek.de/mojo/today
05:56 GabrielVieira joined #mojo
05:59 intervoice thanks driller_work
06:00 AmeliePoulain joined #mojo
06:01 Eugene joined #mojo
06:02 Kulag joined #mojo
06:10 sri tempire: hope you're right this time -.-
06:18 koban joined #mojo
06:19 osprey which man I must read to kno more about forms like check_box, text_field etc&
06:20 osprey ok, found -Mojolicious::Plugin::TagHelpers
06:20 sri http://mojolicio.us/perldoc/M​ojolicious/Plugin/TagHelpers
06:20 sri oh, 5 seconds too late :)
06:21 osprey yeah
06:27 cstamas joined #mojo
06:29 osprey How to pass to check_box value from controller?
06:29 osprey like this:
06:29 osprey $self->param('active') = 'yes'; # wrong
06:37 bzero osprey: $self->param(active => 'yes') ?
06:38 tks joined #mojo
06:39 osprey ok
06:39 osprey ty
06:43 cstamas joined #mojo
07:12 Firkin joined #mojo
07:13 grim_fandango joined #mojo
07:17 arthas joined #mojo
07:29 judofyr joined #mojo
07:41 cosmincx joined #mojo
07:46 driller_work ffs...
08:01 mantovani guys, what in Mojo::DOM is the same as HTML::TreeBuilder "->as_HTML" ? (get the html from the content) ?
08:03 mantovani ?????????????
08:09 marcus mantovani: did you look at the synopsis? :) print $dom
08:09 marcus mantovani: or ->to_xml if  you prefer
08:09 marcus perldoc Mojo::DOM is pretty clear on this
08:11 Alias_ joined #mojo
08:15 driller_work is it not possible to do a get '/create/paste/?url=:url' or such? I want to pass multiple parameters to it but seems that I can't without having to do it like this: /create/paste/:url
08:15 marcus driller_work: huh?
08:15 purl huh is it hard to put a generated Makefile.PL into git?
08:16 marcus driller_work: query params are available in $self->param('url')
08:17 driller_work marcus: hmm how would that work? say I'd like people to hit my rest service like this: api.url.com/create/product?n​ame=something&type=inventory
08:17 driller_work wouldnt a get '/create/product?name=:name&type=:inventory do that for me?
08:17 marcus driller_work: well, to be honest I would say you should probably use a post request for creating stuff, not a get
08:18 marcus creating stuff with get == evil
08:18 marcus and also likely to get you into trouble with crawlers and stuff
08:18 driller_work yeah you are totally right, im just playing around right now but seems like I cant get the uri to work like I want :| doubt switching to post will do it
08:18 marcus uh
08:18 marcus not sure what you can't do
08:18 marcus you route /create/product to an action, and then use $self->params to access query or post params
08:19 marcus in the action
08:19 driller_work but the $self->params are fetched from me using :name or :id in the "uri"? or am I getting this wrong wrong?
08:19 driller_work I mean, the params wont be there unless I specify eg a :id in the uri
08:20 marcus you're getting it wrong
08:20 marcus ou don't need to specify the params part in the routes
08:20 marcus you
08:20 driller_work wow now that's even more confusing for me hehe
08:21 marcus routes are only for the path part of the url
08:21 judofyr driller_work: $self->param both returns params from the route, and query/post params
08:21 marcus yeah
08:22 marcus if you *only* want the post/query params, you can get to them like $this->req->params->to_hash
08:22 marcus where $this is your controller
08:22 driller_work ok I think I am just not getting the logic on how to fetch read the parameters; and how does the code know what is what? eg. if someone calls /create/product/something/inventory -- how do I know what "something" is and what "inventory" is? since I only specify a post '/create/product'
08:22 mantovani thank you marcus
08:23 marcus well, you specify it as /create/product/:something/:inventory
08:23 driller_work yeah exactly
08:23 driller_work that I got
08:24 driller_work but say for example that I dont want to use /create/product/<param 1>/<param 2>/<param 3> but instead something like: /create/product?name=<param 1>&type=<param 2>&price=<param 3> ?
08:24 driller_work just not sure how to structure it properly, maybe I am doing it the wrong way
08:24 judofyr driller_work: the query params are *not* a part of the path
08:25 judofyr so you route it to /create/product and can access $self->param('name') etc. inside there
08:25 driller_work but marcus was saying I'd need the :something and :inventory in the uri path for that? or?
08:25 sri in REST terms, query parameters do not change the REST endpoint
08:26 judofyr driller_work: only if you want /create/product/something/inventory
08:26 driller_work ahaaa so we're talking about two different things here, now I follow
08:27 judofyr driller_work: the router doesn't care about query params. first you specify the path you want to route, *then* you can handle query params inside the controller.
08:27 driller_work so, me doing it with ?name=blabla&something=else is a different story? is there a way to set the allowed parameters and then fetch the actual value of within that parameter?
08:28 judofyr you'll have to manually handle allowed parameters (I think at least).
08:29 judofyr my $name = $self->param('name'); my $foo = $self->param('foo'); if (defined($name) && defined($foo)) { do shit } else { fail }
08:29 driller_work but the way you are describing things it sounds like what I am trying to accomplish is either a built-in function already (like $self->param('name)) or such ?
08:30 driller_work yes but doing that still means that I have to use :something in the uri path for that? kinda how I understood that at least
08:31 marcus driller_work: typically you use some sort of validator to validate input. I use vti's Input::Validator
08:31 marcus you can pass the request parameters to it.
08:32 judofyr driller_work: no $self->param('name') will look up the query parameter "name" if you haven't defined it in a route
08:33 driller_work ahhaaaa
08:34 driller_work now that explains it, but how would I go on with using the "name" query parameter then? by doing a &name=test in the URL?
08:34 driller_work I mean, by simply just adding &name=something in the URL to see if it works?
08:34 marcus yes
08:35 driller_work ok bingo, got it
08:35 driller_work thanks guys, i'll give it a shot
08:35 judofyr :)
08:37 driller_work perfect works exactly as I wanted it to
08:37 driller_work thanks, you two saved me a lot of headache :=)
08:41 marcus driller_work: I really recommend checking out respond_to for the rest bits - http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Rendering#Content_Negotiation
08:41 marcus in general, the guides are really worth reading in full
08:42 spleenjack joined #mojo
08:50 stderr joined #mojo
08:58 judofyr any reason why $self->session(foo => {}) won't set the session-cookie at all?
09:01 judofyr there's no Cookie-header when I run "curl -I localhost:3000", although I explicitly call $self->session(foo => {})
09:01 judofyr although it's in a helper…
09:01 judofyr oh
09:02 stderr joined #mojo
09:03 judofyr I actually called ->session on the application, not the controller
09:03 marcus I thought there was only a sessions method on the application object
09:04 sri it calls the helper
09:04 judofyr so where is that session set? :S
09:05 sri golden rule, if you can always call stuff on the controller, application should be last
09:05 judofyr ah "Call helper with fresh controller"
09:07 judofyr sri: in what cases is it useful to call a helper on an application? (i.e. a fresh controller)
09:07 driller_work thanks marcus; i recall that sri suggested that earlier as well... will certainly look into that
09:07 sri all kinds of application helpers
09:07 sri config is shared for example
09:07 judofyr ah
09:08 sri also testing
09:08 sri you can use oneliners to test helpers quickly and the like ;p
09:08 sri perl -Mojo -E'say a->text_field("whatever")'
09:09 judofyr sri: it would be helpful if $app->session/cookie/redirect_to etc. raised an exception though
09:09 sri that would be inconsistent
09:09 judofyr sure, but that's because they explicitly work on the current request/response
09:10 sri once you're aware of the context implications i can't think of reasons why people could get it wrong
09:10 sri just use the most specific context
09:10 judofyr sri: it was just a simple typo here
09:11 judofyr ($self vs $this)
09:11 sri nobody says $this in perl ;p
09:12 judofyr it's just because I need access to both (one is the app, one is the request)
09:12 judofyr s/request/controller/
09:12 sri use $self and $app
09:12 judofyr but it's probably better to rename them, yes
09:12 osprey how can I do redirect in _controller_ not by router?
09:13 judofyr osprey: $self->redirect_to
09:13 osprey oh, thanks
09:13 judofyr sri: which reminds me: is there a simple way to use $self->redirect_to to do a 301-redirect?
09:14 sri ->redirect_to->rendered(301)
09:14 judofyr ah, it's okay to call ->rendered twice?
09:14 sri or ->redirect_to->res->status(301)
09:14 judofyr (since ->redirect_to already calls it)
09:14 sri yes it's ok
09:15 judofyr great
09:15 sri we even depend on it for streaming and the like
09:17 judofyr doesn't seem to work here
09:17 judofyr still get a 302…
09:19 judofyr and ->res->status(301) gives me a Can't locate object method "status" via package "Mojo::Message::Response"
09:19 andrefs joined #mojo
09:19 sri perl -Mojo -E'a("/" => sub { shift->redirect_to("http://mojolicio.us")->rendered(301) })->start' get -v /
09:20 sri or
09:20 sri perl -Mojo -E'a("/" => sub { shift->redirect_to("http://mojolicio.us")->res->code(301) })->start' get -v /
09:20 judofyr could it be because I'm testing it with "curl -I"?
09:21 judofyr (which does a HEAD)
09:21 sri perl -Mojo -E'a("/" => sub { shift->redirect_to("http://mojolicio.us")->res->code(301) })->start' get -v --method HEAD /
09:25 andrefs joined #mojo
09:25 sri the get command is built into your app, use it ;)
09:25 sri ./myapp.pl get -v /
09:25 judofyr ah :)
09:26 crab hi
09:26 purl hello, crab.
09:26 judofyr HTTP/1.1 302 Found :(
09:27 crab not here
09:27 judofyr sri: this is my code: http://d.pr/KOeN
09:27 sri obligatory screencast link http://mojocasts.com/e2#Get%20command
09:27 * sri waves
09:28 sri tempire: guessing the anchor sucks a bit though
09:32 andrefs joined #mojo
09:39 judofyr sri: gah. it still won't work. I'm doing this in a callback if it makes any difference. if I just call $self->res->code(301), I'll get a 301 response. if I add a $self->redirect_to('/') at the top, the status code will *always* be 302, even though $self->res->code return 302
09:39 judofyr ehm, I meant 301 the last time
09:41 judofyr if I move the $self->res->code out of the callback, everything works fine
09:41 judofyr if the redirect_to is inside the callback, it's still broken
09:45 judofyr sri: perl -Mojo -E'a("/" => sub { my $s=shift;$s->render_later;Mojo::IOLoop->timer(0, sub {$s->redirect_to("http://mojolicio.us")->res->code(301) })})->start' get -v --method HEAD /
09:45 judofyr that gives me a 302 redirect
09:46 driller_work marcus: you mentioned "to_hash" earlier, how exactly does this work? I read the docs but cant get my head around it. I take it as there's a way to create a hash out of all parameters available?
09:48 driller_work I noticed I need to pass all parameters and its values to a function, this function will return a set of data, but instead of calling the function like a dummy eg. some_function(param1,param2,param3,param4) I'd just like to pass it as a hash, like some_function(%hash) ((which I think the to_hash functionality is for?))
09:53 sri judofyr: could be a bug, don't have time to investigate though
09:57 sri oh, i know
09:58 sri you have to set the response code before calling redirect_to
09:58 sri because redirect_to will trigger a streaming write
10:05 sri or actually you can't
10:05 sri gonna have to think about a solution later or tomorrow
10:07 sri but i consider it a bug
10:07 * sri vanishes
10:12 marcus driller_work: look at Mojo::Parameters documentation
10:14 marcus bug \o/
10:14 judofyr sri: I'll give a broken test case
10:15 driller_work marcus: hehe yeah I did that but still not getting it lol, even tried the thing but nope.. but I guess that it's a replacement so I don't have to use the $self->param stuff yeah?
10:15 driller_work maybe I just got the entire hash thing wrong though, I got it to read the parameters properly but couldnt output the array in a template
10:16 marcus driller_work: sounds like it
10:16 marcus driller_work: I think it returns a HASHREF
10:16 driller_work yeah, like a decrypted code of some kind -- which didnt do me good since I needed the actual values, figured that it did what I thought it would but no hehe
10:18 driller_work I wanted to create a parameter list (one liner, instead of $self->param etc etc...) and then create an @array out of the parameters which I then pass to a function
10:18 driller_work I'm gonna give it another shot... gave up too easy on it and I think it could be ideal for what I need from it once I get a handle on how it works
10:23 marcus driller_work: seems like you need to need to read up on basic perl data structures
10:23 marcus and references
10:23 purl rumour has it references is not myisam, only innodb, eh
10:27 driller_work marcus: ok, but is there no quick way to render an array? printing doesnt work and rendering it doesn't do it either :|
10:30 andrefs joined #mojo
10:30 marcus driller_work: array?
10:30 andrefs_ joined #mojo
10:30 marcus driller_work: keys %$params
10:31 marcus will give you an array of the keys of the hash
10:31 andrefs joined #mojo
10:31 andrefs_ joined #mojo
10:31 andrefs__ joined #mojo
10:32 driller_work marcus: umm that sounds just weird, where can I read up on the docs in regards to that?
10:32 andrefs joined #mojo
10:32 marcus driller_work: perldoc perldata
10:33 driller_work ..
10:34 andrefs joined #mojo
10:35 marcus :P
10:36 driller_work just cant print the damn thing within the template
10:36 driller_work eh, enough is enough.. thanks for the help marcus
10:37 marcus driller_work: you're using ep?
10:37 driller_work yep
10:37 marcus driller_work: <%= dumper($self->req->params->to_hash) %> or something
10:41 driller_work that did the trick, starting to see how the templating system works now... one last thing: my $params = Mojo::Parameters->new(product => 'default', type => 'default_type'); <-- doesn't this mean that the DEFAULT value of the parameter 'product' is 'default'?
11:08 crab default value? what?
11:08 purl default value is probably reasonable
11:13 driller_work if it sets a default value to parameter "product" which in the above example would be "default" -- how I understood it at least
11:26 crab i don't understand where the question of a "default" value arises
11:27 crab Mojo::Parameters->new(product => 'default', type => 'default_type') creates a Mojo::Parameters object with two parameters: product and type. their values are "default" and "default_type" respectively.
11:27 crab but there's no "default value".
11:27 crab and i have to wonder if you're doing something wrong, that you're using Mojo::Parameters at all.
11:29 driller_work crab: what I wonder is that if I do a Mojo::Parameters->new(product => 'default', type => 'default_type') and dump the contents then none of these should be empty, right?
11:29 crab right.
11:29 driller_work eg. if I don't call product or type they should have their default values there
11:29 crab i'd put it as "if i don't change the values, the values will remain as they are", but yes.
11:30 driller_work hmm yeah so I wasn't wrong, but the wierd thing is that "<%= dumper($self->req->params->to_hash) %>" doesn't print out the default values, I have to specify something in order for it to print it out for me
11:30 driller_work hence my question, kinda confused me
11:32 crab where do these default values come from?
11:32 driller_work from Mojo::Parameters->new(product => 'default', type => 'default_type') as I understood it?
11:33 driller_work why else would it let me set a default value if it doesn't exist when printing it? :o
11:33 crab i'm talking about this now: "<%= dumper($self->req->params->to_hash) %>"
11:34 driller_work as I understood that just prints all parameters I have available
11:34 crab right.
11:34 crab but are you expecting some parameter to have a "default value" if the browser didn't submit a value explicitly?
11:34 perlrocks Twitter: "Toying with backbone.js and Mojolicious, looks like I have a lot of weekend fun ahead!" --freekey http://twitter.com/freekey​/status/114301175398006784
11:35 driller_work yeah exactly
11:35 crab because, well, no.
11:35 driller_work no? doesn't work like that? :/
11:35 crab nope.
11:36 crab $self->req->params is initialised using the contents of whatever the browser submitted.
11:36 driller_work so I should instead just set a default value, eg $self->param('product) = "my default value" ?
11:37 crab more like: my $product = $self->param('product') || "my default value";
11:38 driller_work OK, but out of curiousity, why does the Mojo::Parameters module let me set a default value to a parameter?
11:39 foomator joined #mojo
11:48 marty joined #mojo
11:50 diegok sri: ^ I was wondering on simulate PUT/DELETE passing the '_method' parameter...
11:53 judofyr sri: you could probably hack it with a before_dispatch-hook + $self->req->method($self->param('_method'))
11:53 judofyr oops
11:53 judofyr diegok: ^
11:58 marcus driller_work: there is no mention in perldoc Mojo::Parameters of a 'default value'. no idea where you got that from
11:59 diegok judofyr: yup!, I was thinking on something like that :)
11:59 marty joined #mojo
12:50 metaperl What a sharp webpage! http://knockoutjs.com/
12:56 Kulag joined #mojo
13:05 andrefs joined #mojo
13:05 andrefs joined #mojo
13:06 andrefs_ joined #mojo
13:36 elb0w Whats proper way to stop a server? kill -"QUIT" `cat pidfile` ?
13:36 elb0w I guess I can test that actually
13:36 elb0w lmao
13:36 elb0w sorry
13:38 spleenjack joined #mojo
13:39 SmokeMachine joined #mojo
13:39 judofyr elb0w: just unplug it
13:41 elb0w wa
13:41 elb0w cant tell if fancy mojo lingo ... or trolling :P
13:42 judofyr :D
14:14 perlrocks Twitter: "sharifulin's posterous – Mojolicious и Dancer http://t.co/53RRgLUS" --geekspot_ru http://twitter.com/geekspot_​ru/status/114341426829070337
14:18 vel joined #mojo
14:26 koban left #mojo
14:28 kaare joined #mojo
14:28 metaperl joined #mojo
14:32 perlrocks Twitter: "mmm.  #mojolicious gets a lot nicer when you figure out how to make helpers. oh, yea, that hits the spot." --jasoncrowther http://twitter.com/jasoncrowt​her/status/114345962054483968
14:36 amoore joined #mojo
14:54 abra joined #mojo
14:57 alnewkirk joined #mojo
15:01 KayT3 joined #mojo
15:02 Akron joined #mojo
15:03 vel joined #mojo
15:05 Akron How can I render (with normal ->render) content and close the client connection, when afterwards I want to do some background work? I want to achieve the same functionality as with chunks (see https://gist.github.com/1216847) but including content length.
15:09 crab Akron: just send the response and create a timer or whatever to do your other work independently
15:10 Akron crab: Another Mojo::IOLoop?
15:12 crab why do you need another one?
15:19 Akron crab: So in that case I have to use Mojo::IOLoop->singleton? How can I then start my other work?
15:21 judofyr Akron: Mojo::IOLoop->timer(0, sub { do other work here })
15:23 crab yeah
15:24 Akron Wow - it's that simple??? Damn! Thank you! crab++ judofyr++
15:24 Akron (It's working!)
15:27 GabrielVieira joined #mojo
15:29 KayT3 mojo is sick... will put perl back into prime time tbh. Rails who?
15:29 crab is "sick" a good thing now?
15:32 KayT3 yes
15:37 KayT3 now I just have to see if mojo will install to our solaris 5.9 sparc III dev server to see if I can use our existing servers for my webservice or if I need to clone my ubuntu server vm which uses ActivePerl 5.14
15:37 KayT3 are there any benchmarks out there for using an older version of perl over the newer versions?
15:40 rwstauner joined #mojo
15:44 stephan48 sick as in super awesome?
15:58 perlrocks Twitter: "Mojolicious Mojocast #3: Authentication, Helpers, and Plugins: http://t.co/0g8RLyAg" --dpavlin http://twitter.com/dpavlin​/status/114367448215597056
16:01 kaare joined #mojo
16:18 mattastrophe joined #mojo
16:35 ispy_ joined #mojo
16:51 tabbi joined #mojo
16:51 tabbi left #mojo
16:58 perlrocks Twitter: "Import data from your #garmin device in #gnome http://t.co/X0k5XQlR - add upload feature with #mojolicious #perl" --jhthorsen http://twitter.com/jhthorse​n/status/114382488025038849
17:00 andrefs joined #mojo
17:07 d4rkie joined #mojo
17:15 rwstauner joined #mojo
17:34 tempire sri: what's wrong with the anchor?
17:34 tempire works for me
17:34 DaniBunny joined #mojo
17:34 tempire the performance is somewhat dependent on the browser, though.  nothing can be done about that at the moment.
17:35 Eugene joined #mojo
17:37 shonorio joined #mojo
17:45 minimalist joined #mojo
17:49 minimalist is there a way to create a route with an optional capture? for example /user/:id to catch both /user and /user/123, where in the first case id will be undef.
17:50 doug joined #mojo
17:53 rwstauner joined #mojo
17:55 tempire minimalist: http://mojocasts.com/e2#Optional Placeholders
17:55 tempire er, http://mojocasts.com/e2#Optional%20Placeholders
17:56 tempire or a wildcard placeholder, depending on your need
17:56 minimalist thanks
18:01 elb0w tempire: what font is that?
18:01 tempire in episode 2?
18:01 elb0w y
18:01 elb0w ya
18:01 tempire menlo
18:01 tempire ep 1, 2 is menlo.  ep 3 is monaco
18:02 elb0w wonder if I can get menlo on ubuntu
18:03 elb0w oh its like dejavu sans
18:11 elb0w man if this mobile app blows up itll be good for mojo / perl publicity
18:11 elb0w may have an investor too
18:11 elb0w :d
18:17 metaperl joined #mojo
18:19 marcus BOOM
18:22 marcus sri: seems like https://metacpan.org/module/hypnotoad is a bit lacking compared to --help
18:22 mspo mobile app?
18:23 marcus sri: also, It would be nice to support hypnotoad --reload as an alternative to sigusr2?
18:37 Kulag joined #mojo
18:43 sri marcus: no it wouldn't http://mojolicio.us/perldoc/Moj​o/Server/Hypnotoad#DESCRIPTION
18:44 sri tempire: i don't see any anchors, so it seems like i have to guess if i want to paste it somewhere
18:45 sri KayT3: older perls are pretty much always slower
18:45 KayT3 sri thanks
18:46 KayT3 anyone here use Rose::DB at all? And if so do you like it? (I am specifically interested in Rose::DB::Object )
18:46 sri the best you can get performance wise is 5.14.1 atm
18:48 KayT3 cool sri I just installed mojo yesterday on ubuntu 11.04 with ActivePerl 5.14 and have a mojo lite app hitting one of our oracle databases :)
18:48 sri judofyr: the test case you sent will never work
18:48 KayT3 it seemed pretty fast, tho we use sun sparc IIIs for production and they only have 5.8 :(
18:49 sri 5.8 is pretty bad :/
18:49 sri has bugs that might allow people to kill your web server with the right request
18:53 elb0w hey by default morbo on a full app puts its logging to the log folder correct?
18:54 Akron elb0w: If there's a log folder - yepp.
18:54 elb0w So shouldnt morbo act like hypno in that sense?
18:55 elb0w instead of just waiting there or needing to be nohuped
18:56 elb0w I either need to run two shells
18:56 elb0w or nohup it to view the logs
18:57 Akron elb0w: Delete the log folder and everything is logged to stderr or stdout - don't know.
18:59 elb0w eh
19:01 Firkin left #mojo
19:11 GitHub123 joined #mojo
19:11 GitHub123 [mojo] kraih pushed 1 new commit to master: http://git.io/qQsU2w
19:11 GitHub123 [mojo/master] fixed small redirect_to bug - Sebastian Riedel
19:11 GitHub123 left #mojo
19:12 grim_fandango joined #mojo
19:14 KayT3 sri our solaris perl is 5.8.5... but I could actually just put ActivePerl on our server, build install rose::DB and mojo into that install via ppm and then compile DB
19:14 sri tempire: btw. you're wrong about fringe
19:14 KayT3 DBD Oracle into that
19:15 sri tempire: it starts next week
19:15 KayT3 as long as I put the path at the top of the perl file to the active perl it should all be good right?
19:15 sri we don't support 5.8.5
19:15 sri 5.8.7 is the hard requirement
19:17 elb0w THATS WHAT SHE SAID
19:19 GitHub162 joined #mojo
19:19 GitHub162 [mojo] kraih pushed 1 new commit to master: http://git.io/E8rtHA
19:19 GitHub162 [mojo/master] cleanup - Sebastian Riedel
19:19 GitHub162 left #mojo
19:23 GitHub182 joined #mojo
19:23 GitHub182 [mojo] kraih pushed 1 new commit to master: http://git.io/rOCeGw
19:23 GitHub182 [mojo/master] better test - Sebastian Riedel
19:23 GitHub182 left #mojo
19:32 LV joined #mojo
19:39 LV hi there! I just found mojo... and I think I just found a bug :D
19:40 LV what's the preferred nopaste in this channel?
19:40 * sri waves
19:40 sri if you found it you can keep it ;p
19:40 sri whatever paste works best for you
19:40 LV haha i'd rather it be fixed or help fix it
19:41 sri that's fine too
19:41 LV http://nopaste.snit.ch/81630
19:42 LV the bug is, instead of the "correct" link being found, the attempt to match an attribute whose value is a literal '0' is incorrectly matching *all* links that have the specified attribute, regardless of value
19:43 sri yes, looks like a bug
19:43 LV otoh ->find('a[attribute^="0"]') doesn't match anything.
19:43 SmokeMachine joined #mojo
19:43 LV err in my example it's a[accesskey^="0"] but yeah
19:45 LV ACTUALLY... does the mojo useragent support fetch followed by post_form, without having to supply the actual form, like WWW::Mechanize does? cuz I couldn't find that in the docs and ended up using Mech for the login phase of my client script...
19:45 Eugene joined #mojo
19:47 sri no, there is no mechanize layer
19:48 LV ok.
19:57 tempire sri: To get the chapter links, you have to "copy link url" on the chapter link
19:58 tempire I clear them from the url programmatically, 'cause there's unintended side effects
19:58 tempire for example
19:59 tempire if you link to a chapter hash, and then it updates the hash when it gets to the next chapter, and then you copy & paste it somewhere else, you don't necessarily expect it to jump to that updated chapter
19:59 tempire generally, they want the link to the whole video, or to the original chapter
19:59 tempire but keeping the original video in the url breaks the consistency of the entire functionality
20:00 tempire so you gotta copy link url
20:00 tempire since I figure the only people who will do that is ops in this channel, I don't think it's a problem
20:00 GitHub6 joined #mojo
20:00 GitHub6 [mojo] kraih pushed 1 new commit to master: http://git.io/GesiiA
20:00 GitHub6 [mojo/master] fixed small attribute selector bug in Mojo::DOM::CSS - Sebastian Riedel
20:00 GitHub6 left #mojo
20:00 sri LV: and fixed
20:01 sri defined bugs are my nemesis -.-
20:02 sri so hope i can soonish use the // operator
20:03 marcus sri: but stop is already using the signals, no?
20:03 marcus oh, I see
20:04 marcus sri: that's not documented in --help tho :)
20:04 sri but everywhere else ;p
20:05 marcus well, not in man hypnotoad either
20:05 marcus which is basically useless
20:05 marcus man / perldoc
20:06 alnewkirk joined #mojo
20:06 marcus sri: btw, I love that rerunning the command does a hot deployment, very clever
20:07 sri tempire++ # he came up with it
20:07 LV ok, git newbie: how do I make my current copy current w/ github, is it just "git clone" again?
20:07 marcus LV git pull origin
20:08 LV ah, thanks!!
20:10 marcus sri: I agree, // ftw
20:11 marcus $5.10 //= less bugs
20:19 marcus nice, google+ api just in time
20:19 sri google what?
20:19 purl somebody said google was trying with VP8 or terrible for finding perl info, in general or more useful than me
20:20 * sri pretends google+ doesn't exist
20:20 marcus I just need it for login
20:20 marcus google's other api doesn't support displayName even
20:20 marcus just email
20:23 KayT3 just bought intermediate perl and learning perl ebooks off of o'rielly.com :toasts to my new found love in perl and mojo:
20:23 sri good choice
20:24 marcus 'message' => 'Access Not Configured', # well, that amost worked
20:24 marcus we can play more tomorrow, google!
20:24 sri hope i can soonish forward tweets to google+
20:26 Properler joined #mojo
20:26 marcus hurrah, google+ doesn't give out any of my emails
20:26 marcus so I can choose either displayname or email \o/
20:27 marcus guess I can just do two api calls
20:30 metaperl joined #mojo
20:34 stderr joined #mojo
21:02 mattastrophe joined #mojo
21:05 perlite_ joined #mojo
21:08 alnewkirk joined #mojo
21:46 stderr sri: is there a documentation for the semantics of url_for() Mojolicious::Controller's POD has the syntax only and I can't make sense of it
21:47 stderr *url_for() ?
22:14 tempire stderr: http://mojolicio.us/perldoc/Mojoli​cious/Guides/Routing#Named_Routes, http://mojolicio.us/perldoc/​Mojolicious/Lite#Route_Names
22:23 tempire If someone wants to make a name for themselves, they should use the google+ to make a small service with mojolicious that takes posts made to a particular circle, say, twitter, and post it to the appropriate social thingy.
22:23 tempire would be relatively easy, and everyone would jump on it.
22:23 tempire ok go.
22:23 tempire *google+ api, I meant: http://googleplusplatform.blogspot.com/20​11/09/getting-started-on-google-api.html
22:25 stderr tempire: you mean to make the whole social[tm] thingies even more self-referential than they already are? hmf.
22:25 tempire Solve the problem of where to post.
22:25 tempire It's one of the biggest issues right now.
22:26 tempire and it's a low hanging fruit that anyone could solve.
22:28 stderr At least selecting your media can keep the torrents of twits' twittering in check a bit. I'm not sure I'd want to read the result 8}
22:30 stderr tempire: oh,  just noticed you answered to my question! Well, I've read these.
22:30 stderr The problem is: what does each invocation listed for url_for *do*?
22:30 tempire not sure what you mean
22:31 tempire it references a named route
22:32 stderr As it looks, $app->url_for() and $c->url_for() should be equivalent. For one, they ain't. $app->route_for() returns an empty string while $c->url_for() apparently returns the app's deployment URL. It could also return the currently active URL in a controller, right? That's what I mean by semantics
22:33 stderr then, url_for(name) is not mentioned at all in the docs but it seems to be the only one that actually works.
22:34 tempire I don't know anything about $app->url_for or $app->route_for
22:34 tempire not sure what the purpose of them would be
22:34 stderr I have a route to "domain#list", named "domain-list". url_for("domain-list") returns the correct URL.
22:35 stderr url_for(controller => 'domain", action => 'list) returns an empty string
22:36 tempire the intended usage seems pretty clear to me, $self->url_for(named route) within the controller.
22:36 stderr No idea what url_for('named', controller => 'domain", action => 'list) is supposed to be doing as it seems to work only for named routes anyway, url_for(named => 'domain-list') also returns an empty string
22:37 stderr Well, url_for is a helper method so you *can* call it on app. If it doesn't work in that case it should be documented as "don't use, this is just available as a side-effect of being a helper menat to be called in templates" or so
22:38 stderr Wel, if there's five different examples and only one is how it's meant to be used, I'd say don't even mention the ones that don't work.
22:38 Skylos joined #mojo
22:39 Skylos lol.  they want a perl programming DBA in orange county, CA for slavery wages.  That recruiter's got his work cut out for him.
22:44 sri stderr: don't just make assumptions, please read the documentation
22:44 sri because you're very very wrong
22:45 sri perl -Mojo -E'say a("/foo/bar" => "baz")->url_for("baz")'
22:45 sri a quick demonstration
22:45 noganex_ joined #mojo
22:45 sri i suppose you totally screwed up your application since route_for does not even exist in core
22:53 ispy_ joined #mojo
22:53 tempire stderr: you can also see all the named routes, generated or otherwise, with "./appname routes"
22:54 sri which is also documented
22:54 purl okay, sri.
22:54 * sri pokes purl
22:54 * purl pops and flies about the room... phphmmbhbpthhhphthhhh*blat*
22:54 sri :o
22:55 tempire I really hate when research papers are behind a paywall
22:55 tempire isn't the purpose of academia to share information?
22:58 GitHub160 joined #mojo
22:58 GitHub160 [mojo] kraih pushed 1 new commit to master: http://git.io/cN0Zyw
22:58 GitHub160 [mojo/master] improved application helper explanation - Sebastian Riedel
22:58 GitHub160 left #mojo
22:58 sri that should make it more clear
23:02 andrefs joined #mojo
23:12 sri oh my, that new sarah michelle gellar show will not get a second season...
23:27 tempire dernit
23:27 tempire I was wrong about fringe
23:28 tempire sarah michelle gellar had a new show?
23:28 tempire huh
23:36 ispy_ joined #mojo
23:44 osprey left #mojo
23:52 ispy__ joined #mojo
23:57 k-man joined #mojo

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