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

IRC log for #mojo, 2015-04-19

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

All times shown according to UTC.

Time Nick Message
00:38 nikke joined #mojo
00:46 nikke is this channel usually this quite?
00:55 nikke Hi guys, is there an updated version of Mojocast?
00:55 go|dfish nikke: I don't believe so
00:56 nikke just wondering what would be the best way to learn Mojolicious?
00:56 nikke I have some knowledge of Perl...
00:57 nikke Have been using the LAMP stack all along and now I am ready to move to Mojolicious
00:58 go|dfish http://mojolicio.us/perldoc#TUTORIAL
00:59 nikke go|dfish, thanks a bunch! I just landed there! Love the mojocast, but I hope the author will put more updated videos...
00:59 pink_mist I really like the mojocasts for learning
00:59 pink_mist just be aware of the outdated bits
00:59 nikke wish there was a CookBook as well!
01:00 nikke pink_mist, yeah best videos ever.
01:00 pink_mist https://github.com/kraih/mojo/wiki#screencasts <-- easy reference for the outdates bits of the mojocasts =)
01:01 nikke pink_mist, thank you!! Wish I have seen this before :)
01:06 Lee joined #mojo
01:14 Lee_ joined #mojo
01:23 Ptolemarch joined #mojo
01:32 klapperl_ joined #mojo
02:07 noganex joined #mojo
02:26 nikke Is there a way to run my apps in command line other than using morbo & a web browser?
02:27 nikke sorry very dummy level question!
02:48 go|dfish nikke: you can test it from the command line e.g. perl app.pl get /
03:00 asarch joined #mojo
03:00 preaction there's a whole bunch of commands your app gets too
03:00 preaction just do "perl app.pl" and see them
03:12 Ptolemarch joined #mojo
03:28 basic6 joined #mojo
03:31 nikke thanks go|dfish!
03:31 nikke thanks preaction!!
03:35 nikke How can I assign the output of the following into an array? $ua->get($url)->res->json->{x}{x};  I try to use @results = $ua->get($url)->res->json->{x}{x};
03:35 nikke getting some compiler error. Can I not mix and match mojolicious with regular perl expressions?
03:35 nikke I mean assignments
03:35 buu What exactly is the error?
03:36 nikke Global symbol "@myres" requires explicit package name at user_agent_json.pl line 17.
03:36 nikke @myres = $ua->get($url)->res->json->{x}{x};
03:37 buu Try declaring it with 'my'
03:38 nikke same error...
03:38 nikke my @myres = $ua->get($url)->res->json->{x}{x};
03:38 buu You have an error above that line.
03:40 nikke $ua->get($url)->res->json->{x}{x};
03:40 nikke my $myres = shift;
03:40 nikke This works..
03:41 buu so?
03:41 purl so is probably Ah, so!
03:42 buu ->{x}{x} will never return a list by the way.
03:42 buu So assigning it to an array is a bit odd.
03:42 nikke my $myres = $ua->get($url)->res->json->{x}{y}; works :)
03:42 buu Sounds like you changed something else.
03:42 nikke Insted of the @ I put a $
03:43 nikke though my json is suppose to return an array of text... I just consume it into a $myres variable
03:43 buu buu@hs:~$ perl -le'use strict; use warnings;my $ua; my $url;   @results = $ua->get($url)->res->json->{x}{x};'
03:43 buu Global symbol "@results" requires explicit package name at -e line 1.
03:43 buu buu@hs:~$ perl -le'use strict; use warnings;my $ua; my $url;   my @results = $ua->get($url)->res->json->{x}{x};'
03:43 buu Can't call method "get" on an undefined value at -e line 1.
03:43 buu You changed something other than the sigil.
03:45 nikke buu... is it ok if I put my entire code here?
03:45 buu purl: paste
03:45 purl paste is probably http://paste.scsys.co.uk/
03:46 nikke my $ua = Mojo::UserAgent->new;
03:46 nikke my $url = Mojo::URL->new('http://api.metacpan.org/v0/release/_search');
03:46 nikke $url->query({q => 'mojolicious', sort => 'date:desc'});
03:46 nikke for my $hit (@{$ua->get($url)->res->json->{hits}{hits}})
03:46 nikke {
03:47 buu DON'T
03:47 buu PASTE
03:47 buu HERE
03:47 nikke I am trying to change the @{$ua->get($url)->res->json->{hits}{hits}} into an array
03:47 nikke buu sorry
03:48 Grinnz you may want to take a look at perldata, perlreftut
03:48 Grinnz perldocs
03:48 purl perldocs is installed on my system (if perl's installed).
03:49 nikke Thanks Grinnz
03:50 Grinnz http://qntm.org/files/perl/perl.html for a good overall reference
03:51 nikke Grinnz... that was a fantastic link!
03:54 Grinnz it's one of the better overall tutorials i've seen
03:55 Grinnz mojo certainly makes use of standard perl practices in general, with a good understanding of references and data structures you should have a better idea what's going on there
03:57 nikke Grinnz, I have been using PHP for so long and I think I am getting confused here between the two :)
03:58 nikke Also, I am not used to asking question on IRC :) bit of catch up to do here...
04:01 Grinnz php has been known to cause quite a bit of confusion on its own ;)
04:01 nikke don't know about that :)
04:01 nikke it could be a "USER" error on my part too!!
04:09 nikke buu now I do understand the paste.scsys.co.uk part. Next time for sure :)
05:01 Ptolemarch joined #mojo
05:26 NikitaTropin joined #mojo
05:36 Oleg joined #mojo
06:23 kaare joined #mojo
06:29 irq joined #mojo
06:50 Ptolemarch joined #mojo
07:24 coolo batman: I'm curious. what's the reason for your Changes file to have a different format in https://build.opensuse.org/request/show/297985 ? different tool chain?
07:25 chorny joined #mojo
07:28 irq_ joined #mojo
07:53 Vandal joined #mojo
08:16 amon joined #mojo
08:18 berov joined #mojo
08:18 ace joined #mojo
08:34 sh4 joined #mojo
08:39 Ptolemarch joined #mojo
08:39 ace Please let me know how to set the referer by Test:::Mojo?
09:06 trone joined #mojo
09:31 ToApolytoXaos joined #mojo
09:41 romel hello. how do you guys build Mojo::Pg query strings when, depending on some conditions, query may contain extra WHERE clauses and number of bind variables is unknown
09:42 romel i know it's rather dbd::pg related question but still :)
09:52 romel seems SQL::Abstract is a solution
10:10 dotan joined #mojo
10:11 Snelius joined #mojo
10:23 jabberwok batman: in Sprites POD:  s/constains/contains/;
10:28 Ptolemarch joined #mojo
11:01 wariat joined #mojo
11:35 cpan_mojo Mojolicious-Plugin-SemanticUI-0.16 by BEROV https://metacpan.org/release/BEROV/Mojolicious-Plugin-SemanticUI-0.16
12:16 berov batman, marcus: https://github.com/marcusramberg/Mojolicious-Plugin-OAuth2/issues/46
12:16 berov can someone reply?
12:17 Ptolemarch joined #mojo
12:32 sh4 joined #mojo
13:14 misty_g3ar joined #mojo
13:40 ajr_ joined #mojo
13:46 punter joined #mojo
13:50 melo joined #mojo
14:01 misty_g3ar joined #mojo
14:03 melo1 joined #mojo
14:03 sh4 joined #mojo
14:05 Ptolemarch joined #mojo
14:23 asarch joined #mojo
14:34 kaare joined #mojo
14:56 melo joined #mojo
14:58 rwp joined #mojo
14:59 jabberwok batman: working on Mojolicious::Plugin::AssetPack::Handler::ResponsiveImage which will create multiple images (thumbnail or whatever sizes are configured) and appropriate CSS for media queries
15:02 jabberwok probably requires a configuration method to take list of hashes:  [{thumbnail => {height => 150, width => 200}, ...}] — if sprites make one asset from several, no reason this can't create several browser-callable assets from one, right?
15:07 batman coolo: I changed to using the standard Changes format in git-ship.
15:07 batman coolo: https://metacpan.org/pod/CPAN::Changes::Spec
15:08 batman jabberwok: Thanks for the typo. Hope I remember to fix it later...
15:09 batman berov: Did you read the error message?
15:10 berov batman: yes, I actually set it to 1. is that enough?
15:10 batman berov: Yes.
15:10 berov ok, thanks
15:11 berov but it is not clear what it is for
15:11 batman I broke back compat. That's why it's needed. I was hoping that was exactly what the error message said :/
15:12 berov batman: now If I think it, is enough
15:12 batman jabberwok: That's interesting. I think I'm going to break the API pretty soon. Just need to understand how it should work first...
15:19 berov batman: so now it seems enough to call $c->oauth2->get_token($provider,{redirect_uri=>'http://example.com'});
15:19 berov I mean no other args, because they are guessed?
15:20 berov this is after the user visited consent screen
15:34 cpan_mojo Mojolicious-Plugin-Notifications-0.9 by AKRON https://metacpan.org/release/AKRON/Mojolicious-Plugin-Notifications-0.9
15:37 jabberwok starting circa 2007 i write a WordPress plugin https://github.com/lindleyw/autonav for resizing and thumbnails; it feels wonderful to bring the concept of "just specify a base image and this handles the rest" ... into the modern age
15:54 Ptolemarch joined #mojo
16:15 sri if anyone wants a hearthstone duel, i'm available :)
16:34 dotan joined #mojo
16:49 berov1 joined #mojo
16:59 * jberger challenges sri to a plumbing duel!
16:59 * sri declines
17:00 jberger hahahahaha
17:00 purl LOLCON 5 reached.
17:01 mst jberger: Super Smash Bros ? :)
17:02 jberger I think Mario makes the point, no?
17:02 jberger sadly no mushrooms for me
17:03 jberger I do have some rather manly wrenches though
17:03 jberger (spanners if you are of mst's way about things)
17:27 oalders joined #mojo
17:43 Ptolemarch joined #mojo
17:53 asarch joined #mojo
18:01 ajr_ joined #mojo
18:20 wariat joined #mojo
18:47 wariat_ joined #mojo
18:47 berov joined #mojo
19:32 Ptolemarch joined #mojo
19:35 cpan_mojo Mojolicious-Plugin-BasicAuthPlus-0.08 by BLR https://metacpan.org/release/BLR/Mojolicious-Plugin-BasicAuthPlus-0.08
19:44 odin22 joined #mojo
20:11 dod joined #mojo
21:10 basic6 is encode('UTF-8', ...) the correct way to deserialize an object (stringified with JSON.stringify)? http://paste.debian.net/167705
21:12 Grinnz no, decode_json is
21:13 Grinnz which j() should do
21:13 Grinnz if you need an extra decode then it must be getting double encoded
21:13 Grinnz oh, thats an encode...
21:13 basic6 Grinnz: if i leave the encode out, it does not work for unicode characters.
21:14 Grinnz the UTF-8 is getting decoded when you read the parameter
21:14 Grinnz use from_json
21:14 basic6 i think j() takes bytes and param() returns characters so chars need to be converted into bytes first
21:15 Grinnz just use from_json, no reason for the extra steps
21:15 Grinnz the thing is, query parameters are supposed to be UTF-8 encoded, and JSON is supposed to be UTF-8 encoded, so it probably is supposed to be double encoded
21:17 basic6 oh i didnt see from_json, that's just what i need
21:17 basic6 looks like it works perfectly, that's better than j(encode(... thank you for the tip!
21:18 Grinnz in general, if you need from_json, you're doing something wrong, but in this case as long as you know what's going on :)
21:19 basic6 Grinnz: well as i said it looks like j() wants bytes (not characters) and param() returns characters, which usually makes sense, but not in the case of json.
21:20 basic6 as you say, if the parameter is text and you use encode(), you're probably doing something wrong :)
21:21 Ptolemarch joined #mojo
21:48 punter joined #mojo
22:00 DesertFox joined #mojo
23:10 Ptolemarch joined #mojo
23:22 absolut_todd joined #mojo

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