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

IRC log for #mojo, 2014-10-23

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

All times shown according to UTC.

Time Nick Message
00:08 klapperl joined #mojo
00:12 preaction joined #mojo
00:15 neyasov_ joined #mojo
00:18 klapperl_ joined #mojo
00:23 klapperl joined #mojo
00:29 d4rkie joined #mojo
00:35 Averna joined #mojo
01:12 Mso150 joined #mojo
01:18 klapperl_ joined #mojo
01:35 machz joined #mojo
01:50 jberger marmez: you can serialize the object and unserialize in the subsequent request
01:50 jberger works for most objects, unless they are doing something really tricky
01:54 marmez jberger: Thank you for answer. I have no previous experience with object serialization and unserialization. Is this PerlMonks page right for me?
01:54 marmez http://www.perlmonks.org/?node_id=8070
01:57 jberger marmez: I guess that is a reasonable place to start
01:57 jberger you have to realize the limitations of serialization though
01:58 jberger imagine that what you really are doing is storing the internal data of the object as some kind of "written" form
01:58 jberger so things which you can't express in a simple written form (like subrefs for example) usually don't make the round-trip
02:00 marmez Ok, I am now reading the page I linked above and trying the examples...
02:01 jberger marmez: what kind of object are you looking to store
02:03 marmez My and colleague's module for word search game.
02:06 marmez jberger: Basically it is object with grid, grid width, grid height and words in grid properties.
02:06 jberger sounds like a good use for a session table in a database tbh
02:07 jberger but you can give it a try
02:08 marmez Now I don't want to use database, it is really simple and naive, say only just for fun...
02:08 jberger is it a single server?
02:09 jberger i.e. just using daemon and not hypnotoad?
02:09 zivester joined #mojo
02:09 marmez No, I am using Hypnotoad
02:09 jberger if so, then just store the data in memory (or using DBM::Deep) on the server
02:09 jberger marmez: what kind of load do you expect?
02:11 jberger actually, it might be a cute use of DBM::Deep
02:11 marmez Hm... A few requests per day and night, I suppose.
02:12 jberger then hypnotoad is way overkill, but either way DBM::Deep would work (with locking => 1)
02:14 sri jberger: locking => 1 is the default
02:14 marmez I am looking at DBM::Deep now.
02:14 marmez http://search.cpan.org/~rkinyon/DBM-Deep-2.0011/lib/DBM/Deep.pod
02:16 jberger sri: ah, I see that now
02:16 jberger would be nice if it said that in the locking section
02:17 * jberger reads tfm
02:18 jberger marmez: anyway, its about the simplest way to do persistence that I know of
02:22 marmez jberger: Ok, if I have the right clue, then I should serialize the object I want to store, then store it with help of DBM::Deep (not default Mojolicious session) and with next request I should retrieve it back from DBM::Deep and unserialize it. Am I right?
02:25 nicomen joined #mojo
02:26 marmez left #mojo
02:26 marmez joined #mojo
02:28 marmez left #mojo
02:29 marmez joined #mojo
02:33 jberger you store the object on the server side and just keep some token on the client side for retrieval
02:34 jberger client side in this case means the session data
02:36 marmez jberger: Ok, I think I get it.
02:42 marmez joined #mojo
02:44 jberger persistent storage really is better
02:45 jberger imagine that you lose your game because you accidentally do something silly on the client side
02:45 jberger clear your cookies or wait too long
02:45 noganex joined #mojo
03:05 good_news_everyon joined #mojo
03:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/mw0t4g
03:05 good_news_everyon mojo/master 8881290 Sebastian Riedel: added test for invalid config file
03:05 good_news_everyon left #mojo
03:32 basic6_ joined #mojo
03:51 KCL joined #mojo
04:02 irq joined #mojo
04:03 * sri just noticed mojolicious now has exactly 8888 lines of code :)
04:05 tempire creepy
04:16 rem_lex joined #mojo
04:20 nicomen1 joined #mojo
04:49 firnsy creepy AWESOME!
05:08 sujithm joined #mojo
05:17 fhelmber_ joined #mojo
05:18 sujithm_ joined #mojo
05:21 sujithm joined #mojo
05:22 sri joined #mojo
05:25 sri joined #mojo
05:26 sujithm_ joined #mojo
05:28 Vandal joined #mojo
05:28 sri joined #mojo
05:29 sri joined #mojo
05:34 tudorconstantin joined #mojo
05:42 sujithm joined #mojo
05:46 Gedge joined #mojo
05:48 marmez joined #mojo
05:49 Mikey joined #mojo
05:50 marmez left #mojo
05:51 marmez joined #mojo
05:51 marmez left #mojo
05:51 marmez joined #mojo
06:10 sujithm joined #mojo
06:13 sujithm_ joined #mojo
06:15 bjoernfan joined #mojo
06:17 tempire joined #mojo
06:25 sujithm joined #mojo
06:29 sujithm_ joined #mojo
06:38 basiliscos joined #mojo
06:40 Mso150 joined #mojo
06:42 sujithm joined #mojo
06:43 dod joined #mojo
06:44 sujithm_ joined #mojo
06:51 sujithm joined #mojo
07:05 sujithm_ joined #mojo
07:15 sujithm joined #mojo
07:19 sujithm_ joined #mojo
07:22 trone joined #mojo
07:34 ashimema joined #mojo
07:35 rawler joined #mojo
07:39 sujithm joined #mojo
07:39 jamesaxl joined #mojo
07:43 neyasov_ joined #mojo
07:46 sujithm_ joined #mojo
07:47 hgw joined #mojo
07:50 hgw left #mojo
07:50 hgw joined #mojo
07:51 sujithm joined #mojo
07:52 hgw left #mojo
07:52 hgw joined #mojo
07:53 hgw joined #mojo
07:53 hgw left #mojo
07:54 hgw joined #mojo
07:55 D4RK-PH0ENiX joined #mojo
08:11 xevz joined #mojo
08:24 irq joined #mojo
08:35 arthas joined #mojo
08:38 dotan joined #mojo
08:50 Mso150 joined #mojo
08:53 meshl joined #mojo
08:53 axlrose joined #mojo
09:02 neyasov_ joined #mojo
09:09 rem_lex joined #mojo
09:15 jamesaxl joined #mojo
09:20 axlrose joined #mojo
10:28 denis_boyun joined #mojo
11:14 jamesaxl joined #mojo
11:52 jamesaxl joined #mojo
12:02 d4rkie joined #mojo
12:22 d4rkie joined #mojo
12:39 lipizzan joined #mojo
12:50 dvinciguerra joined #mojo
12:57 ignacio_ joined #mojo
13:14 zivester joined #mojo
13:28 Kripton joined #mojo
13:57 marty joined #mojo
14:00 franzkafka Hi all, given this data structure: http://pastebin.com/BAhpcWuQ
14:02 hernan what about it
14:11 nicomen franzkafka: ?
14:16 dabudabu Maybe he is trying to
14:24 hernan work hard or die tryin
14:26 tbushell_ joined #mojo
14:28 tbushell joined #mojo
14:28 tbushell_ joined #mojo
14:29 tbushell joined #mojo
14:30 tbushell joined #mojo
14:31 tbushell left #mojo
14:33 meshl joined #mojo
14:33 tbushell_ joined #mojo
14:36 Leucomelas joined #mojo
14:36 Leucomelas Hi
14:41 sh4 joined #mojo
14:44 ignacio__ joined #mojo
14:59 franzkafka Sorry, I decided to try and figure it out some more before asking.
15:00 franzkafka I'm just trying to map short_name to the first array element in types for street_number, route, locality, and administrative_area_level_1, and if any of those are undefined then have the value be BLAH_NOT_DEFINED (e.g., ROUTE_NOT_DEFINED).
15:00 franzkafka But I think I'm pretty close with my ugly solution
15:07 klapperl joined #mojo
15:18 davido_ joined #mojo
15:20 Dandre left #mojo
15:21 Dandre joined #mojo
15:22 mr_pants joined #mojo
15:46 mr_pants Say, I have 4 to 3 different divs, and I want to update some HTML content in them. How I do that? I tried using stash with helper function, but returned all HTML in text format.
15:46 dvinciguerra joined #mojo
15:51 KCL_ joined #mojo
15:52 suy joined #mojo
15:59 rem_lex|pivo joined #mojo
16:03 Leucomelas joined #mojo
16:33 Mso150 joined #mojo
16:41 good_news_everyon joined #mojo
16:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/7mPczg
16:41 good_news_everyon mojo/master 27a3518 Sebastian Riedel: process config files more efficiently
16:41 good_news_everyon left #mojo
16:42 sri there is no internal use of the Mojo::JSON oo api anymore, so we could deprecate it
17:05 Mso150 joined #mojo
17:07 marmez joined #mojo
17:14 jamesaxl joined #mojo
17:15 human39 joined #mojo
17:24 denny joined #mojo
17:26 good_news_everyon joined #mojo
17:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/j_TuwQ
17:26 good_news_everyon mojo/master e9e69af Sebastian Riedel: deprecated Object-Oriented Mojo::JSON API
17:26 good_news_everyon left #mojo
17:26 sri speak up if you have objections!
17:37 disputin joined #mojo
17:37 sri hahaha... so complicated and yet no authority whatsoever http://nodejs.org/about/advisory-board/
17:38 sri stay classy joyent!
17:40 marty I object... But only cuz I use it. :D
17:41 sri so, that's not a real objection?
17:42 marty No.  I use it a lot but I'm assuming we can still get at everything in Mojo::JSON
17:43 sri the functions actually have more features
17:46 * marty reads up on new goodies
17:46 Ptolemarch joined #mojo
18:00 irq joined #mojo
18:02 trone joined #mojo
18:04 Mso150 joined #mojo
18:29 Mso150 joined #mojo
19:02 Kripton joined #mojo
19:02 Ptolemarch joined #mojo
19:05 Mso150 joined #mojo
19:09 Ptolemarch joined #mojo
19:18 neyasov_ joined #mojo
19:19 meshl joined #mojo
19:39 jberger_ joined #mojo
19:40 jberger_ My $0.02 is that an oo interface let's you have optional configuration, then the functional wrapper can just be for common usage
19:41 jberger_ Like if the / should be escaped
19:41 sri the parser and generators are completely functional internally
19:41 sri s/s//
19:42 sri the oo api doesn't even have the functionality of to_json/from_json
19:46 sri as far as i'm concerned, the deprecation is a done deal
19:46 sri if you want to bring it back you have to sell it as a new feature
19:47 mst might I suggest documenting the currying approach to making a wrapper-with-config?
19:47 mst has _encoder => sub { my $config = { ... }; sub { encode_json($data, $config) } };
19:47 mst or whatever
19:47 jberger_ If we ever wanted to add a configurable parameter, it would have to be done with package variables :o
19:48 jberger_ mst that's what I would suggest too
19:48 mst I think that one example probably provides 99% of the utility of having an OO API
19:48 jberger_ Oh
19:48 * jberger_ needs to think about that
19:48 sri jberger_: if we need it it can be brought back
19:49 * mst thinks "here's how to write a closure" is sufficient
19:49 mst others may disagree
19:50 sri we are not as free with the api design as it might seem
19:50 sri people monkey patch JSON::XS into Mojo::JSON after all
19:51 sri which is why my strategy has always been, "have the best defaults for 99% of all use cases, and for everything else recommend JSON::XS"
19:52 Mso150 joined #mojo
19:53 * jberger_ understands ^^
19:53 Kripton joined #mojo
19:53 * sri still remembers the sorted hash key feature request
19:54 ua1 joined #mojo
19:55 ua joined #mojo
19:57 sri funny thing about the \/ feature, i think it's as easy as helper to_javascript => sub { Mojo::JSON::to_json(pop) =~ s!/!\\/!r };
20:05 * marty quietly steals the to_javascript helper
20:05 sri it doesn't actually work ;p
20:05 sri there's at the very least a "g" missing
20:05 mst sri: should've been !gr for a start
20:05 mst hah
20:05 marty what?  Blasphemy!  you posted it so it must work.
20:05 sri :)
20:05 * marty holds sri responsible
20:06 * mst holds sri homoerotically
20:06 marty well, I was going to do a helper anyway so that gives me motivation.  :)
20:06 sri :o
20:06 fhelmber_ joined #mojo
20:11 hesperaux joined #mojo
20:16 ignacio_ joined #mojo
20:28 nicomen oookey
20:57 Ptolemar_ joined #mojo
21:20 Ptolemarch joined #mojo
22:01 good_news_everyon joined #mojo
22:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/w_0D8Q
22:01 good_news_everyon mojo/master 9b0d80e Sebastian Riedel: fixed chunked transfer encoding bug in Mojo::Content
22:01 good_news_everyon left #mojo
22:20 basiliscos joined #mojo
22:49 sri muhahahaha
22:49 sri that is some impressive marketing http://www.rubyraptor.org/
22:50 good_news_everyon joined #mojo
22:50 good_news_everyon [mojo] kraih tagged v5.54 at 699595a: http://git.io/YsGf1A
22:50 good_news_everyon left #mojo
22:50 meshl joined #mojo
22:51 good_news_everyon joined #mojo
22:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/IjDFCw
22:51 good_news_everyon mojo/master e1de917 Sebastian Riedel: bump version
22:51 good_news_everyon left #mojo
22:52 sri hmm, i want to release version 5.55 with 8888 lines of code :D
23:04 disputin joined #mojo
23:46 hesperaux joined #mojo
23:48 marty joined #mojo
23:52 good_news_everyon joined #mojo
23:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pGTWuQ
23:52 good_news_everyon mojo/master 8379a27 Sebastian Riedel: fixed typo in README
23:52 good_news_everyon left #mojo
23:53 * sri wonders if it should be "object-oriented" here https://github.com/kraih/mojo/blob/master/Changes#L5
23:57 zivester joined #mojo

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