The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-12-27

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

All times shown according to UTC.

Time Nick Message
01:15 sk joined #mojo
02:04 Grinnz [16:01:24] <jberger> OMG WHY is <reply> http://makeameme.org/media/created/WHY-OMG-WHY.jpg
02:04 Grinnz [16:01:29] <jberger> purl
02:04 Grinnz [16:01:29] <purl> yes, jberger?
02:04 Grinnz [16:01:38] <jberger> purl: OMG WHY is <reply> http://makeameme.org/media/created/WHY-OMG-WHY.jpg
02:04 Grinnz [16:01:38] <purl> i already had it that way, jberger.
02:05 Grinnz when conversations with bots are more polite than with humans
02:11 sri pasting into a channel is very impolite
02:25 inokenty-w joined #mojo
02:26 Grinnz oops... i blame this head cold ><
02:27 sri puny human
02:28 Adurah You've disturbed the silence, how dare you!
02:28 Grinnz silence will fall
02:34 tempire ugh
02:34 tempire Never thought I'd run into a situation where postgres wasn't as flexible as mysql
02:35 Grinnz there's a few of those, because mysql throws in any feature they want and in postgres it generally has to make sense
02:53 buu_ joined #mojo
02:54 klapperl joined #mojo
02:55 jberger tempire: curious, what is the situation?
03:33 tempire can't return columns not included in a group by
03:38 tempire There are other solutions, it's not a big deal. It's just another thing to learn.
03:48 noganex_ joined #mojo
03:57 asarch joined #mojo
04:38 Eke- joined #mojo
06:42 Eddy joined #mojo
07:25 franck34 joined #mojo
07:25 franck34 hi, i probably missed something in the doc, i can't read a json attribute from a json post data
07:25 franck34 https://gist.github.com/eviltik/30f92cf68aa8f25ea14d
07:26 franck34 where is my mistake ?
07:26 Grinnz uhm... $data is a hashref
07:30 franck34 i'm new to perl, i'm reading hashref stuff now
07:30 buu_ franck34: perldoc perlreftut !
07:30 buu_ Is good
07:30 Grinnz ^
07:30 Grinnz also perldata, and perlref, etc...
07:31 preaction http://p3rl.org/REF
07:32 franck34 ok so
07:32 franck34 $self->app->log->info($data -> {username});
07:32 franck34 sound ok
07:32 franck34 thanks for show me the good keyword
07:32 preaction no. you need two things to make a hashref
07:32 franck34 ha
07:32 preaction ohh, sorry, yes
07:32 franck34 ha
07:32 preaction i thought that was => not ->
07:32 Grinnz lol
07:32 preaction we usually don't put spaces around ->
07:32 dotandimet joined #mojo
07:32 preaction $data->{username}
07:32 franck34 yep
07:33 Grinnz and this is why adding a -> scalar operator probably would be a bad idea
07:33 franck34 fixed
07:33 preaction because we usually do put spaces around =>: $data => "username"
07:33 denis_boyun joined #mojo
07:33 franck34 i see
07:33 Grinnz that's when forming a hash or list though. not accessing
07:34 preaction right, they're two different operators
07:34 buu_ franck34: In short, perl uses -> like c++ instead of . like c
07:34 buu_ ok C also uses ->
07:34 Grinnz C is confusing dammit
07:34 buu_ haha
07:34 franck34 i'm coming from js so json object is simply myData.myAttribute
07:34 preaction yeah, they all have the same meaning: dereference a (pointer|reference)
07:35 franck34 have a good day men, see you !
07:35 franck34 thanks
07:35 buu_ SEXIST
07:36 Grinnz who you callin men
07:36 denis_boyun joined #mojo
07:36 buu_ jinx
07:38 franck34 joined #mojo
07:38 franck34 me again :)
07:39 denis_boyun joined #mojo
07:39 franck34 i don't know perl world. Do you have suggestion to make webservices documentation ? like http://apidocjs.com/ example: http://apidocjs.com/example_inherit/#api-User-PutUser
07:40 franck34 (a common perl tool ?)
07:40 preaction i've never seen it
07:41 preaction but if i had to do something like it, i'd probably use http://www.getpostman.com/features#home
07:42 franck34 thanks
07:54 Vandal joined #mojo
08:24 franck34 directory and route question https://gist.github.com/eviltik/16439b7c34296afcd3b7
08:26 franck34 best practice ?
08:26 purl best practice is not being an idiot.
08:26 franck34 purl: mmMMMmmmoOOOOOOOO
08:26 purl franck34: sorry...
08:26 franck34 purl: .I.
08:26 purl franck34: excuse me?
08:27 preaction you can specify a namespace or a controller instead of going all the way down to the method
08:28 preaction the routing guide should explain
08:28 franck34 thx, never use namespace for the moment
08:30 franck34 great
08:41 franck34 does "under('/')" is supposed to work ?
08:44 preaction probably? though i believe you can just set the namespace on the route object itself if you're doing that
08:45 preaction i don't know that much about mojo's router, because my apps have been tiny enough where i just add callbacks
08:46 franck34 ok i'm rtfm :)
09:03 sugar joined #mojo
09:39 sugar_ joined #mojo
09:39 dod joined #mojo
09:51 amon joined #mojo
09:58 sh4 joined #mojo
10:04 dod joined #mojo
10:40 dotandimet joined #mojo
11:02 dotandimet joined #mojo
12:26 basiliscos joined #mojo
12:44 dotandimet joined #mojo
13:03 dotandimet joined #mojo
13:38 dotandimet joined #mojo
13:55 alnewkirk joined #mojo
14:48 dod joined #mojo
15:26 jegade joined #mojo
15:35 dod joined #mojo
15:38 dod joined #mojo
15:53 punter joined #mojo
16:14 sri oh, you can get the mastering perl ebook for free atm. http://www.oreilly.com/pub/get/prognews?imm_mid=0c924a&amp;cmp=em-prog-na-na-newsltr_20141227
16:26 cfedde that's nice to hear.
17:07 dotandimet joined #mojo
17:09 dotandimet joined #mojo
17:12 sri (and some other books)
17:12 * sri got the c pointer book
17:15 sh4 joined #mojo
17:15 dod joined #mojo
17:16 dod joined #mojo
17:52 dod joined #mojo
17:53 Adura joined #mojo
18:07 jberger has anyone made a book called "pointers about pointers" yet?
18:15 tempire A whole book about ios geolocation
18:15 sri the list is a little python heavy
18:17 * tempire teeters etween android and ios game dev
18:17 tempire oh, 2012
18:19 tempire What's the consensus on 0mq?
18:19 tempire Yay or nay?
18:19 purl Yay or nay is misspelled.
18:20 sri meh
18:20 jberger tempire: I used it at $old_job to reasonably good success
18:20 jberger preaction might have a stronger opinion
18:20 preaction i'm not allowed to have opinions
18:21 jberger speak brother, you are safe in the circle
18:21 preaction i say it solves most problems with regular sockets, though with mojo's websockets that effect is diminished
18:23 mst I think zeromq is a really useful encapsulation of a bunch of common ways to do network communication between processes
18:24 mst it's basically a bunch of patterns wrapped up in a nice uniform interface
18:24 sri i like the idea, but in reality i'd just use redis pub/sub instead
18:26 sri (since postgresql is not as good as redis for super high concurrency)
18:28 mst that seems like for the purposes zmq is designed for it'd be slower without gaining you anything; am I missing something or is it more that you have zmq filed as an optimisation if redis isn't scaling sufficient?
18:28 sri i'm lazy, redis is simple
18:30 sri and if i gave searching metacpan for an async client a try... this is where i would give up https://metacpan.org/pod/AnyEvent::ZeroMQ
18:31 sri no docs, abandoned in 2011, zeromq looks dead for async
18:33 Grinnz i don't think that module was ever non-abandoned, look at cpantesters lol
18:33 preaction ZMQ::FFI is what you want
18:34 sri preaction: does not appear to be shipping event loop bindings
18:34 sri and reverse deps look poor https://metacpan.org/requires/distribution/ZMQ-FFI?sort=[[2,1]]
18:34 preaction you get a file descriptor and wrap it in whatever event loop you want
18:35 preaction what? so?
18:35 sri my point is that with redis i'm done in 5 minutes
18:35 preaction so use redis!
18:35 sri :D
18:36 sri actually i'll use postgresql, since  i don't need super high concurrency ;p
18:36 Grinnz lol
18:38 * Jonis just used the Mojo::Pg migrate thing
18:38 Jonis I like
18:38 sri there's ways around the postgresql concurrency problem though, you can use one connection per worker process and pipe *all* notifications through that
18:38 sri and then just redispatch inside the worker process
18:49 mst I thought zeromq was neat for things like logging where throughput is essential but if you lose a few entries, fuckit
18:49 mst but I think filing it under 'possible optimisation' by default is pretty sane too
19:09 dotandimet joined #mojo
19:30 cfedde that was the thinking behind syslog.
19:36 sri re migrations in Mojo::Pg
19:36 * sri wonders what the ideal table layout for the mojo_migrations table would be
19:37 * sri tends towards (name text unique not null, version bigint not null check (version >= 0))
19:39 sri right now it's (name varchar(255) unique, version varchar(255))
19:39 sri which is certainly not ideal
19:43 mst your 'tends towards' looks right to me.
19:43 mst forcing people to use integer versions for that sort of thing is usually a win
19:44 cfedde text is way better than varchar most of the time. bigint and uuid are my two favorite schemes for godel numbers.  uuid having the advantage that it will be unique across all the u.
19:47 cfedde uuid having the disadvantage that it is not ordinal.
20:10 Kripton joined #mojo
20:22 denis_boyun joined #mojo
20:26 Eke- joined #mojo
20:59 Grinnz joined #mojo
21:47 asarch joined #mojo
21:47 Eke- joined #mojo
21:57 franck34 joined #mojo
21:58 asarch Why did you pick up '<%' and '%>' as the default template tags?
22:09 Eke- joined #mojo
22:09 sri asarch: why not?
22:12 asarch I've seem then in some Python frameworks and in the JSP
22:12 asarch :-)
22:13 mst sri: based on previous questions from him, I think asarch is genuinely just curious why you picked that particular set
22:13 mst i.e. was there a specific reason for that choice, or did you just experiment until you decided you liked that one, or did you roll a d20, or ... :)
22:14 asarch Yeah!
22:14 asarch Why?
22:14 asarch I mean, was there a specific reason for them?
22:15 asarch I have to build a project for a friend of mine in JSP
22:16 asarch And its project structure resembles a lot the structure of a Mojolicious project
22:17 asarch So I was wondering last night about the reason of '<%' and '%>' in Mojo
22:20 sri it's the most commonly used syntax
22:21 sri mason and erb (rails) use it too
22:24 sri ASP too
22:27 sri and of course tons of javascript engines... from underscore.js to ejs
22:36 asarch That's great

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