Camelia, the Perl 6 bug

IRC log for #mojo, 2012-10-11

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

All times shown according to UTC.

Time Nick Message
00:00 baton8 joined #mojo
01:01 laouji joined #mojo
01:16 d4rkie joined #mojo
01:16 d4rkie joined #mojo
02:16 noganex_ joined #mojo
02:32 Foxcool joined #mojo
03:01 ask joined #mojo
03:12 tempire clap clap clap
03:12 tempire clap clap snap
03:13 Freman joined #mojo
03:14 Freman so... internal redirects/forwarding...
03:14 Freman not natively possible so I've read, but I have a use case
03:15 Freman we have a form displayed with a get route, then when submitted it posts to a different action
03:15 Freman there isn't code shared between the two actions.
03:16 Freman I'd like to be able to redirect back to that initial page if the user screws something or something goes wrong maintaining the existing inputs
03:16 Freman redirect_to doesn't do that
03:17 Freman ie: get('/edit')->to('some#form'); post('/edit')->to('some#action');
03:19 buu Freman: You could just do: return $self->Foo::Some::form(); .. ?
03:19 tempire I presume you want to internally redirect because you want to populate the form with the submitted information?
03:20 Freman yes
03:21 tempire the best way to accomplish that is to validate your information via javascript before a submit.
03:21 tempire and if you need server communication, use an ajax call.
03:21 Freman assuming we support javascript
03:21 tempire yes, I am making that assumption.
03:22 Freman we dpm
03:22 Freman we don't, it's definitely not a preference to be using javascript at this stage
03:23 Freman buu, I tried return $self->form(); but it just complains "Nothing has been rendered, assuming delayed response. then Inactivty timeout.
03:23 tempire what's your reason for not using javascript?
03:24 Freman why complicate our issues with javascript.
03:24 buu Because it makes it easier for your users?
03:25 Freman provided they have it turned on
03:25 buu uh
03:25 tempire it's the better option.  use something like jquery validation plugin.
03:25 Freman yeh I know.
03:25 tempire if your concern is about progressive enhancement fallback...your form will still work as expected.
03:26 tempire it won't be a seemless user experience, but if someone has javascript turned off, that's not their main priority anyway.
03:26 Freman no it won't
03:27 tempire at any rate, internal detachment isn't supported because it's not restful, and it promotes unmaintainable design.
03:27 Freman and dropping over to a different language entirely is?
03:28 tempire what, restful?
03:28 Freman promoting a maintainable design
03:29 tempire yes.  if you're trying to create a seemless user interface for the user, using the language that gives you direct control over the user interface is part of the game.
03:29 Freman catalyst manages it
03:30 tempire yep.  using detach.  not restful, and considered an early on design mistake.
03:30 tempire it's ok if you don't agree.  I'm not trying to convince you, just giving you the reasoning behind the design decision.
03:31 Freman not a whole lot of point to using the tag helpers than.
03:32 tempire not sure how that applies...
03:32 Freman to reload the form values
03:33 tempire for that situation, you are correct.  unless you want to pass those values via query string.  or in the session.
03:41 Freman http://pastebin.com/UsiYAuGd - adding it wasn't hard
03:50 xaka joined #mojo
03:51 Freman I'm firmly of the belief that when it comes to forms, forwarding is useful and javascript is the hack.
03:59 buu Can anyone ppoint out what idiocy is going on in my part here: http://nopaste.dk/p14623
03:59 Mike-PerlRecruiter_ joined #mojo
04:02 buu tempire: pingy~~
04:03 Foxcool joined #mojo
04:09 buu Oh
04:09 buu That's what was going on
04:28 rem_lex| joined #mojo
04:35 Leandr joined #mojo
05:24 Britzel joined #mojo
05:24 laouji joined #mojo
05:39 ovnimancer joined #mojo
06:23 alex_K joined #mojo
06:31 spleenjack joined #mojo
06:58 Vandal joined #mojo
07:13 yakudza_ joined #mojo
07:22 Mike-PerlRecruiter_ joined #mojo
07:24 Averna joined #mojo
07:31 batman joined #mojo
07:39 * marcus waves from cyprus
07:39 Topic for #mojo is now Mojolicious real-time web framework 3.0 🌈 http://mojolicio.us 🌈 http://irclog.perlgeek.de/mojo/today
07:41 pau4o joined #mojo
07:46 dpetrov_ joined #mojo
07:54 diegok joined #mojo
07:55 heytrav joined #mojo
07:58 yakudza_ joined #mojo
08:05 fhelmber_ joined #mojo
08:06 amirite joined #mojo
08:07 fhelmber_ joined #mojo
08:18 ilbot2 joined #mojo
08:18 Topic for #mojo is now Mojolicious real-time web framework 3.0 🌈 http://mojolicio.us 🌈 http://irclog.perlgeek.de/mojo/today
08:22 basic6 joined #mojo
08:31 buu MOJOJOJO
08:31 purl MOJOJOJO is that awesome monkey from powerpuff girls, but that's equally hilarious ribasushi
08:31 buu thanks purl
08:38 Adura joined #mojo
09:28 alex_K joined #mojo
09:47 * sri yawns
09:48 sri Freman: internal forward is useless, just look at the growing guide for a restful form validation example
09:49 sri no javascript needed at all
09:51 sri you have one action that accepts get *and* post, and which keeps rendering the form until it has been submitted successfully
09:51 sri and when it was successful you redirect to a different endpoint after the resource has been created
09:52 sri http://mojolicio.us/perldoc/Mojolic​ious/Guides/Growing#Final_prototype
09:54 sri tempire: he is not correct
10:22 Foxcool_ joined #mojo
10:33 daxim joined #mojo
10:35 Foxcool joined #mojo
10:40 drift joined #mojo
11:02 rem_lex|pivo joined #mojo
11:22 laouji joined #mojo
11:36 sunson joined #mojo
11:38 GabrielVieira joined #mojo
11:48 sunson I'd like to use Mojo::UserAgent in a separate shell-based application to login and use the logged in "session" to access something else. I see that $ua->get returns a "tx". But calling $ua->get again acts totally stateless. how do I make useragent remember the "session"?
11:49 sunson s/to login/to login to my mojolicious web application/
11:52 nyamned joined #mojo
11:56 sri that's not correct, the cookiejar stays around for all requests unless you clear it manually
12:39 sunson sri: if my web app is doing a redirect after auth, will ua follow it automatically? doesn't seem to be (I see response having "location" header). Am I required to follow it?
12:41 bjoernfan sunson: I guess you want to set $ua->max_redirects(1) or something
12:42 sunson bjoernfan: actually, when I did MOJO_USERAGENT_DEBUG=1 I see the classic morbo error page.
12:49 Lucas1 joined #mojo
12:50 sunson bjoernfan: I figured. login had actually failed (my app redirects to /login ultimately with 'flash' message). login failed because I used $ua->post. and not $ua->post_form
12:50 sunson what is the difference? is there some more descriptive documentation / examples of Mojo::UserAgent?
12:50 sunson What exactly does "Do Not Track" do?
12:51 Adura Whatever the server wants to do with it?
12:54 bjoernfan sunson: I'm guessing post_form has data, and post's just a POST request. I'm sure there's a reason for not combining them.
12:54 bjoernfan sunson: http://mojolicio.us/perldoc/Mojo/UserAgent#post
12:56 bjoernfan sunson: I think DNT only kindly asks the server to not track you, and it's up to the server to respect (or to not respect) this request.
12:58 d4rkie joined #mojo
13:00 sunson bjoernfan: cool
13:02 cosmincx joined #mojo
13:07 alex joined #mojo
13:11 bjoernfan :)
13:23 sri DNT has become mostly a joke
13:24 sri recently a representative from some marketing organization in the working group asked if advertising could be added to the spec as an exception where tracking is ok -.-
13:26 sri http://lists.w3.org/Archives/Public​/public-tracking/2012Oct/0115.html # lulz!
13:31 bluescreen joined #mojo
13:45 gryphon joined #mojo
13:45 bannaN joined #mojo
13:48 gryphon joined #mojo
13:49 bannaN Does anyone use the I18N module with url detection? I have problems making the overridden url_for method work. For me its not overwriting the default one, any tips?
13:53 jnap joined #mojo
13:59 sri you can only override the helper, not the controller method
14:03 sri that part of the plugin is not very well thought out
14:09 bannaN oh, okey
14:11 bannaN When i looked in the tests for this module, it seems like the tests for the url_for method is like you execute a request and then see what response is printed back to see if the url_for method works. Is it possible to call the url_for method provided by a plugin ( or any method provided as helper by a plugin ) directly, so you can unit test them
14:11 Jason__ joined #mojo
14:24 Leandr joined #mojo
14:29 sunson Is build_tx followed by $tx->req->cookies({...}); the only way to make cookies? Can't I build up a cookie jar and keep it around?
14:31 sunson I'd actually like to construct the user agent, filled with cookies, in a general 'init' part of the code and use the UA for any thing (get / post / whatever tx)
14:36 cosmincx joined #mojo
14:41 bannaN left #mojo
14:52 knshaum joined #mojo
14:52 jnap joined #mojo
14:58 sh4 joined #mojo
15:20 sunson can someone explain the difference between a Mojo::Cookie::Request vs Mojo::Cookie::Response ?
15:23 sunson I'd basically like to save cookies and reuse them. what is the best way?
15:25 crab Mojo::Cookie::Request represents a Cookie
15:25 crab Mojo::Cookie::Response represents a Set-Cookie
15:27 crab i guess you want a Mojo::UserAgent::CookieJar object and fill it with Mojo::Cookie::Rsponse objects from the server
15:27 crab there's no way to make the cookies persist, but you could subclass the jar and add a method to save/restore cookies. or something.
15:28 crab maybe just have a separate function that takes a cookiejar and writes it to disk, and one that returns a cookiejar (or modifies an existing empty one by loading from disk)
15:30 sunson crab: oh
15:30 crab oh?
15:31 sunson crab: you mean to say cookiejar object must be persisted?
15:31 sunson crab: isn't there a cleaner way?
15:31 crab well, it sounds like that is what *you* want.
15:31 sunson crab: I wanna persist each cookie. I don't mind persisting the object itself using Data::Dumper or somesuch...
15:31 crab "cleaner" way to do what, exactly? if you want cookies to persist between independent runs of your program, you have to store them somewhere.
15:32 sunson crab: yes.
15:32 sunson I wanna save the cookies alone. something "cleaner" than serializing the object.
15:32 crab whether you store the cookie as text, or the cookie object using storable or the dumper output or the cookiejar or whatever, it's all the same in the end.
15:33 crab you have to be able to take a cookie from the server and write it to disk in some form, and then read it back and feed it to the cookiejar of your useragent.
15:34 sunson crab: that is exactly what I want. not "store the object".
15:35 sunson because then we may run into deep cloning issues.
15:35 sunson I simply wanna know what fields are there and what to store. possibly a RESTful service that does just that ;)
15:36 sunson but Mojo::Cookie::Request has only two methods - name and value. how do I get the "domain" of the cookie? of course, i can imply it from the URL from where I made the request... but that needs context.
15:37 * sri doesn't understand a word sunson said, but wonders if Mojo::UserAgent::CookieJar should have a method that returns all response cookie objects to allow them to be serialized
15:37 crab Mojo::Cookie::Request is the wrong thing to look at.
15:38 crab sri: yes, it should do something to make it easier to dump/reload cookies, i think
15:38 crab but i'm not sure how it should look
15:39 sunson sri: precisely.
15:39 sunson crab: precisely.
15:39 crab sunson: precisely.
15:39 * crab likes this new game.
15:39 sri i'm open for suggestions, but can't think of a good method name
15:39 sunson it ends here :P
15:40 sri just give me a pretty method name and semantics
15:41 crab sunson: btw, i'm not sure where you got the impression that i was advocating anything that could lead to deep-cloning problems etc. i was in fact thinking of just storing the value of the Set-Cookie field from the response to disk and re-parsing it before feeding the resulting object to the cookiejar.
15:43 sunson crab: right now I just dump the entire cookie jar object. but obviously that may lead to deep cloning problems.
15:44 sunson (assuming Mojo::UserAgent::CookieJar increases in complexity)
15:55 jnap joined #mojo
15:59 * sri is waiting
16:01 jnap_ joined #mojo
16:03 GabrielVieira joined #mojo
16:07 xaka joined #mojo
16:08 sri well, then i will make up something silly ;p
16:08 good_news_everyone joined #mojo
16:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Hy542w
16:08 good_news_everyone [mojo/master] added all method to Mojo::UserAgent::CookieJar - Sebastian Riedel
16:08 good_news_everyone left #mojo
16:09 sri sunson: that should do
16:09 * sri pokes crab
16:40 yakudza_ joined #mojo
17:25 inokenty joined #mojo
17:37 marcus sri: seems good.
17:37 * marcus is drinking blackthorn at the pitstop bar.
17:38 * sri is drinking beck's
17:39 sri marcus: btw. i think your segfaults in UV may have been fixed
17:39 marcus Sweet. I love going on vacation. :)
17:40 sri vacation++
17:40 * marcus just read jnap's catalyst roadmap post.
17:41 ObseLeTe joined #mojo
17:42 * sri starts reading it
17:47 ObseLeTe joined #mojo
17:49 jnap is not a roadmap, just really trying to provoke conversation
17:50 jnap might be more marketing/bizness speak than some people want to hear but I'm happy to get even loud, angry comments :)
17:50 sri towards the end it doesn't sound like you're really after a product statement for catalyst, but a vision
17:50 Adura Roadmap... codemap?
17:50 jnap I guess I sorta see it similarly, but I don't need to quibble
17:50 sri the apple comparison is funny... steve always called it "that vision thing" :)
17:51 Adura Insanely great.
17:51 marcus Jnap: I agree about the engine thing on the homepage, it was written in a different time, before psgi.
17:52 Jason__ joined #mojo
17:53 jnap yeah, is not really something special to catalyst anymore, although I do think catalyst had some influence on bringing that kind of feature to Perl in mainstream use
17:53 sri we made the engine layer before wsgi and rack existed :)
17:54 jnap yeah we did that but we then ceded innovation :(
17:54 jnap something I don't think we can afford to do much
17:54 * marcus remembers porting mason apps from mod_perl to fcgi, no fun.
17:55 jnap shutterstock is all on mason for the core code, I got it running sorta on psgi but there's still a lot of broken stuff, so I sympathize
17:55 marcus Sri: I am interested in your full stack ideas still, but are you sure mongodb is the right way to go?
17:56 sri marcus: i keep asking myself the same, but what are the alternatives?
17:59 Adura MojonoSQL?
17:59 sri a new ORM is also in the cards, but then i would want to use all the cool postgresql specific features...
18:00 Adura MojoSQL?
18:00 Adura To no or not to no.
18:00 sri MongoDB 2.4 should be pretty damn cool with fulltext indexing
18:03 Adura Native JSON support in postgres 9.2... interesting
18:08 marcus Postgres specific sounds better to me imo
18:08 marcus <3 PostgreSQL.
18:09 marcus 💖💖💖
18:10 sri going non-blocking with postgres also seems a little messy
18:10 marcus But totally worth it, ;-)
18:11 marcus They also have a key/value addon now?
18:11 sri you either reimplement the wire protocol or use DBD::Pg with async flag and accept that it's less responsive
18:15 marcus Wouldn't reimplementing the wire protocol in pp be slower tho?
18:15 sri i doubt it would matter much
18:15 sri it's just a bunch of pack() calls
18:16 sri does it matter for redis? :)
18:16 sri postgres has way more latency
18:17 * tempire didn't enjoy his experience with mongo
18:18 tempire also, someone tell me what a yammer conference could possibly consist of
18:18 tempire 21 breakout sessions.
18:18 * tempire wonders what a breakout session is.
18:19 Adura How much blocking would be a problem with Mojolicious?
18:19 sri problem is relative
18:20 batman $_->(@_) for @{$self->subscribers(shift)}; # can we change this, so i don't need to do local $_ inside my sub?
18:20 sri blocking on db queries can actually be good, since it automatically throttles for you
18:21 Adura I have each request connect to the mysqld, so blocking is a problem only when the mysqld is clogged.
18:23 batman actually... of course it's not me that is messing around with $_ - it's a colleague of mine :P
18:23 batman nevermind. i would rather have people not doing stupid things instead of you having to change the loop
18:23 sri batman: why should we care?
18:23 sri hehe, yea
18:24 batman :)
18:24 sri $_... for ... is everywhere, he better get used to it!
18:24 batman i totally agree. manipulating $_ outside of map, grep, for ... is just evil
18:25 sri and now back on topic!
18:25 batman and... actually: now i can change the subscribed methods inside the callback ;) $_ = $my_new_sub; ;)
18:25 sri i'm rather surprised everybody is in favor of postgresql support
18:25 * batman shuts up
18:26 Adura I think traditional SQL is just fine, throw in some caching and you're good.
18:27 sri postgres would also mean that we need a migration layer
18:27 sri which i find absolutely terrible
18:28 Adura So, this'd be Mojoliciousql or... Mojolicious::ql?
18:30 sri i'd prefer to go more into the Meteor direction, with a little less happening on the browser side
18:32 Adura Meteor's site is pretty without cookies enabled, heh.
18:32 tempire I'm ok with postgres being the star, rather than mongo
18:32 sri tempire: but are you really ok with all the downsides?
18:32 tempire what are they?  I've avoided databases for the past year.
18:33 sri like a migration system
18:33 tempire not sure what you mean by that.
18:34 sri http://guides.rubyonrails.org/migrations.html
18:34 Adura But yeah, this'd not be the core Mojolicious, right? Rather something you could use with it?
18:34 sri DBIC is not very good at that, but to me it's a must have from the start
18:34 tempire ah
18:34 tempire yeah, dbic has some addons that kind of work.
18:35 tempire this is actually huge.  everyone has the problem and businesses tend to ignore it.
18:35 sri we don't do "kind of work" :)
18:35 tempire I've adopted your perspective, I think.
18:35 tempire I just don't like databases.
18:35 sri they're all terrible!
18:36 tempire It feels like we're in the dark ages of data storage technology.
18:36 jnap for what its worth if you are talking about DBIC and migrations I tried to do a sort of full stack approach with DBIC::Migrations.  The tutorial is Catalyst centric, but I'd love to get Mojolicious in there as well, for examples.
18:36 sri actually, what i like most about postgresql is dependability, in the sense that it won't get bought and destroyed by oracle
18:37 tempire I like that it seems to have everything now.
18:37 tempire maybe it always did.
18:37 sri scaling out with postgresql seems not so nice
18:37 sri replication is ok these days, but sharding...
18:38 tempire what I really want is a database designed around version control.
18:38 tempire something that does away with the archaic concept of update and delete.
18:38 sri couchdb has versions
18:38 sri append only btree at its core or so
18:39 sri and you compact every now and then to get rid of old versions
18:39 tempire hmm
18:40 tempire haven't looked at couchdb since the early days
18:40 * tempire reads
18:41 tempire native json parser
18:41 sri jnap: looking at it for the first time, i'd really like some actual examples in the synopsis for a migration
18:42 jnap I need to figure out a good way to represent that in a way that makes sense.  I sorta tried to do it with DBIC::Migration::Features but who looks there the first time?
18:42 sri when i think about migrations i see a sweet little DSL, not thousands of configuration parameters :)
18:43 jnap the problem is DBIC:Migration is the engine but DBIC:Migration::Script is the interface
18:43 jnap or the dbic-migration command line really, which is a tiny runtime for DBIC:M:Script
18:43 jnap yeah I need a boiled down version of the tutorial in the most obvious place
18:45 sri oh
18:45 sri http://api.metacpan.org/source/JJNAPIORK/DBIx-​Class-Migration-0.034/examples/MusicBase/share​/migrations/SQLite/downgrade/3-2/001-auto.sql
18:45 sri it's actually sql?
18:46 sri guess that explains the lack of DSL examples ;p
18:46 jnap its built on DBIC:DeploymentHandler, so yeah it creates actually sql for the targeted databases
18:47 jnap when I just want to auto deploy when developing and don't need to worry about versions I generally just use Test::DBIx::Class to deploy a sandbox locally for each run.
18:51 sri tempire: what problems did you have with mongodb anyway?
18:52 tempire computer shut off.  database would not start.
18:53 sri i think you just need to run a repair command in those cases
18:53 tempire yeah.  it was fixable.  but I don't like that I had to learn about that just for basic usage.  I understand why, it's just the principle of having to worry about that.
18:55 tempire especially thinking of it from a beginner's perspective.
18:55 sri learning about a repair command or having to plan all your tables and migrations in advance ;p
18:56 sri well, your mongodb instance could be running in the cloud at mongohq or so too ;)
18:57 tempire The reason I liked riak is because you could choose between consistent and eventually consistent on an object level.
18:58 sri pretty sure you can do the same in mongodb
18:58 sri with the w parameter
18:59 sri "2+= wait for slaves"
18:59 tempire maybe my problem is that I'm expecting the database itself to play the role of a service provider.
19:00 tempire after all, real hosting isn't easy either, but abstracting it away to heroku makes me happy.
19:00 sri i kinda like riak, but it has so many problems too
19:00 tempire yeah.  The more I used it, the less I was in love with it.
19:01 sri like bitcask, all keys have to fit into RAM
19:01 sri horrible config files
19:02 sri inconsistent APIs between HTTP and protocol buffers
19:02 sri i'm generally not a fan of protocol buffer
19:03 sri basho rather randomly removing big features like luwak
19:03 tempire I knew erlang, and it still bothered me that I had to know erlang to be efficient with things.
19:03 abra joined #mojo
19:03 tempire that's probably changed quite a bit, I would guess.
19:04 sri not as far as i can see
19:07 sri i wish someone would just pay me to write a default model layer for mojolicious and make the decision for me :D
19:08 tempire sounds like a suggestive tweet
19:09 Adura What does Stackato use for DB?
19:14 ObseLeTe joined #mojo
19:18 Adura Hmm, mention of mysql.
19:19 Adura Ah, postgres and mongo are there it seems.
19:21 Mike-PerlRecruiter_ joined #mojo
19:28 batman joined #mojo
19:35 dvinciguerra joined #mojo
19:41 * marcus is watching the best drag show in Cyprus.
19:42 marcus According to the ads anyways.  But it ain't bad.
19:50 * nic recommends drag racing
20:41 sri marcus: i've looked some more into DBD::Pg and i'm almost certain it can't perform well when used async
20:52 rhaen joined #mojo
20:54 rhaen joined #mojo
20:55 rhaen moin
21:37 tempire racing would be difficult in high heels
22:17 * sri wonders what's the most awesome sql abstraction
22:21 jzawodn joined #mojo
22:21 sri i guess linq is pretty cool
22:42 rem_lex|pivo joined #mojo
22:51 tempire I like the idea behind linq
22:51 tempire though I wonder about an almost-sql
22:53 tempire but I like the idea of treating sql as a functional interface more than trying to push the data into objects.
22:54 sri i want to like ARel too, but it's sooooo complex
23:00 * tempire looks up arel
23:00 sri it's what rails uses to generate sql
23:25 sri http://blog.mongohq.com/bl​og/2012/10/10/new-mongohq/ # pretty neat
23:26 Averna joined #mojo
23:45 sri i've been reading up on the postgres wire protocol, it's actually rather simple (if you ignore stuff like kerberos auth)
23:53 * sri still tends towards mongodb though

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