Camelia, the Perl 6 bug

IRC log for #mojo, 2013-04-15

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

All times shown according to UTC.

Time Nick Message
00:08 egopro joined #mojo
00:26 Mad_Dud joined #mojo
00:28 d4rkie joined #mojo
00:29 Zmodem joined #mojo
00:41 shmuel joined #mojo
00:43 d4rkie joined #mojo
01:01 Adurah joined #mojo
01:01 hesperaux_ joined #mojo
01:02 anaio joined #mojo
01:06 memowe joined #mojo
01:20 jb360 Dump question: How do I assign my session 'user' to a variable in an ep template?
01:21 jb360 for example: <% my %usrobj = session 'user'; %>
01:21 ka2u joined #mojo
01:46 jberger jb360, what is stored in `session 'user'`? if its a hash reference then you need to either store to a scalar or dereference to a hash
01:46 jberger perldoc perlreftut
01:51 jb360 jberger: Thanks.  I got it!
01:51 jb360 <% my $usrobj = session->{user}; %>
01:52 jb360 jberger: The tricky thing for me was 'session' doesn't have a sigil
01:53 jb360 jberger: The helper doc mentions it.  From there it was trial and error.  <%= dumper ... %> was the big help.
01:54 cy joined #mojo
01:54 jb360 jberger: I'm stuffing my authenticated 'user' object into session.  I wanted to only display 'logout' link if the user is in session.
01:55 jb360 jberger: By the way: I watched your youtube video from yapc about baby xscode.  Nice work.
01:55 jberger thanks
01:56 jberger session 'user' should work too I thought
01:56 jb360 jberger: It's given me the incentive to try my hand at xscode
01:56 jberger what may not show from that talk was immediately after my other talk, so my head was swimming a bit
01:56 jb360 jberger: you mean .... <% if ( session 'user' ) { ..... }?
01:57 jberger or even assignment, as you had it
01:57 jb360 I think I gave that a whirl but believe I was getting undef when I used dumper.  I'll try it again from the kicks.
01:57 jb360 for kicks*
01:57 jberger I'd be curious
01:58 jberger https://metacpan.org/source/SRI/Mojoliciou​s-3.95/lib/Mojolicious/Controller.pm#L318
01:59 jb360 you're right!  That works too.
02:00 jberger as I remembered, the helper 'session' returns a hashref if given no args, or uses one arg as a hash key, or two for assignment
02:00 jberger very clever, so use whichever you like best
02:00 jb360 jberger: <% my $usrobj = session 'user'; %>
02:00 jberger I was just concerned if the arg method wasn't working as I remembered
02:00 jberger glad its all working :-)
02:02 Zmodem I have read over the doc's and find my self slightly puzzled, for practice im converting a perl CGI app to Mojo and cannot for the life of me figure out the "proper" place for something like a nav bar. Should it be a template or a layout
02:02 jberger Zmodem, if its going on many pages then maybe layout, otherwise template
02:02 jb360 Zmodem: I'm using Twitter Bootstrap
02:02 Zmodem Same here jb360
02:03 jb360 Mine is a layout
02:03 Zmodem kk *back to reading*
02:03 jberger layout is just meant to avoid repeating
02:03 jb360 As I was telling jberger I'm adding code to only show the logout link when I have an authenticated user in session.
02:04 Zmodem I am just starting to get my feet wet.... I am a sysadmin that can write some perl so jumping into Mojo is all new to me ;)
02:04 jberger you can always look at the source for Galileo :-p
02:04 jb360 What is Galileo?
02:04 Zmodem Galileo - A simple modern CMS built on Mojolicious
02:04 jberger my cms
02:05 jb360 is on github?
02:05 jberger and CPAN
02:05 Zmodem https://github.com/jberger/Galileo
02:05 Zmodem yup ;)
02:05 jb360 Thanks I will
02:05 jberger its meant to be 100% CPAN installable CMS
02:05 Zmodem I have read a little bit of source code from around the intenetz and its like drinking from a fire hose
02:05 jb360 Nice jberger
02:06 jb360 jberger: Are you speaking at YAPC:NA in Austin this year?
02:06 jberger Zmodem, be careful, it can be addicting
02:06 jberger jb360, sadly I'm not going this year
02:06 jberger I would have loved to
02:06 jb360 I've never been to one.  I may try to go this year.
02:06 jberger but I am just finishing up my Ph.D. and I just couldn't make plans for this summer
02:07 Zmodem I attempted to look over https://github.com/tudorconst​antin/Mojolicious-Boilerplate
02:07 jb360 Zmodem: Give youtube a whirl if you haven't done so.
02:07 Zmodem but that setup was meh IMO
02:07 jb360 Great Perl stuff out there -- and others
02:07 Zmodem lots of very static content
02:10 Zmodem in CGI world I just wrote a .pm file that had all my repeated code and would just call it a &print_nav; now trying to get it done the Mojo way ^_^
02:10 jb360 Zmodem: \o/
02:10 jberger Zmodem, you might want to make a helper which does partial rendering of some smaller template
02:11 jb360 jberger: Did you switch out your template engine or use EP?
02:11 jberger I <3 EP
02:11 jb360 I've had experience with TT over the years but thought I would stick with EP to learn it.
02:11 jb360 Is that a Mojo specific template engine?
02:12 jberger ep is just a thin layer over Perl, if you know Perl you can know ep in minutes
02:12 jberger which is why I like it
02:12 jberger TT I had to learn another whole language
02:12 jberger which I always forget
02:14 Zmodem Looking at "helpers" I see the content seems like what I might need correct jberger ?
02:15 jb360 jberger: Good point.  Referencing the 'session' in the template has been my biggest hurdle.  I think the rest should be a breeze.
02:15 jberger content is useful to let you abstract most of your really boring HTML out to the template
02:16 jberger the stuff that really will get repeated every time
02:16 jberger jb360, enjoy!
02:16 jb360 TY
02:16 jb360 Of course you'll be around when I have questions right?
02:16 jberger I'm around a lot
02:16 jberger but the doc is good too
02:17 jb360 I noticed you're on here a great deal
02:17 jberger read the doc for Mojolicious::Lite (its kinda the tutorial) and then the guides in order from the website
02:17 jb360 Agreed.  I think the docs are well done.  Django is perhaps the best I've ever seen but Mojo is very well done too.
02:18 jb360 I have read most of them.  I reference them regularly.  I also use tempires stuff on github as a reference.
02:18 jberger though I got through writing my thesis, I still have the defense coming up in a couple weeks
02:18 jberger so I may not be as responsive as usual
02:20 jb360 What is your thesis on?
02:20 jb360 Good luck with it
02:20 jberger you can watch my other yapc talk :-)
02:20 jberger thanks
02:20 jberger in a nutshell: fun with lasers and electron microscopes
02:21 jb360 I will.  What subject?
02:21 jberger physics
02:21 jb360 Sounds geeky!
02:21 jb360 ugh.  I had physics in high school and didn't do so good.
02:21 jb360 Good luck to you sir.
02:21 jberger thanks
02:22 jb360 yw
02:22 jb360 Working on any special web projects now?
02:22 jberger once I'm done with this, I have more plans for Galileo
02:23 jberger and I have a friend writing a webcomic
02:23 jberger and I might have my first real client for a webapp, depending on how long it takes me to get a real job, it might be nice to have that in my back pocket
02:24 jb360 I'll give Galileo a look this week.  Thanks for telling me about it.  I'm always interested to learn from other's code and architecture.
02:25 jberger its still rather simple, but it gets the job done
02:25 jb360 Have you had the chance to use the async stuff yet?
02:25 jberger galileo uses websockets a lot
02:26 jb360 I'm thinking about putting something together at my day job to use it for queries against our Oracle db
02:27 jberger I'm of the opinion that websockets+json is a really useful paradigm for async
02:27 jb360 I need to learn more about how to apply the two with tangible projects.
02:28 jberger see how galileo stores changes to things like pages and users
02:28 jb360 I'm going to clone it tomorrow at work. :)
02:29 cy joined #mojo
02:29 jberger :-)
02:29 jb360 We're at the end of a release cycle at work so I'll have something more to fill my day.
02:30 jberger glad I can provide you with something better than "yahoo games" :-p
02:31 jb360 :)  Thanks!
02:32 jb360 I have my project I'm writing with Mojo too.
02:33 jberger good luck with that
02:44 preflex_ joined #mojo
02:46 moltar joined #mojo
05:03 ka2u joined #mojo
05:13 rem_lex|pivo joined #mojo
05:15 ka2u joined #mojo
05:19 rem_lex| joined #mojo
05:38 Meiermann joined #mojo
05:59 ver joined #mojo
06:22 denisboyun joined #mojo
06:33 dpetrov_ joined #mojo
07:01 arpadszasz joined #mojo
07:05 arthas joined #mojo
07:06 dod joined #mojo
07:08 Vandal joined #mojo
07:12 rpaz joined #mojo
07:22 dod joined #mojo
07:28 suy joined #mojo
08:53 ObseLeTe joined #mojo
08:54 judofyr joined #mojo
08:55 nelio joined #mojo
09:02 mrphilov joined #mojo
09:08 egopro joined #mojo
09:50 ka2u joined #mojo
10:12 arpadszasz joined #mojo
10:40 Britzel_ joined #mojo
10:51 ka2u joined #mojo
10:59 cy joined #mojo
11:06 mire joined #mojo
11:29 asarch joined #mojo
11:48 cy joined #mojo
11:57 D4RK-PH0ENiX joined #mojo
11:58 arpadszasz joined #mojo
12:32 dod joined #mojo
12:37 heytrav joined #mojo
12:40 mire joined #mojo
12:42 heytrav joined #mojo
12:43 Kripton joined #mojo
12:44 moltar joined #mojo
13:00 bowtie joined #mojo
13:09 bluescreen joined #mojo
13:09 maxhq joined #mojo
13:31 robinsmidsrod joined #mojo
13:44 mire joined #mojo
13:50 kbenson joined #mojo
14:06 gryphon joined #mojo
14:13 whitebook joined #mojo
14:25 heytrav joined #mojo
14:30 denisboyun joined #mojo
14:33 sh3 joined #mojo
14:36 cstamas hi
14:37 cstamas I have a table full of checkboxes (as input in a form)
14:37 cstamas all have a common value of "somekey"
14:38 cstamas I tried to get this as an array $self->param('somekey')
14:38 cstamas but does not seems to work this way
14:45 cstamas to correct myself it is actually 'check_box "somekey"' multiple times
14:47 heytrav joined #mojo
14:54 marty cstamas:  Maybe this will help...  http://mojolicio.us/perldo​c/Mojo/Parameters#to_hash
14:59 cstamas marty: okay, I am in Mojolicious::Lite how can I access the parent object?
15:04 cfedde How do I send a file from somewhere in my file system?  I thought that ->render_static would do this.
15:06 marty cstamas:    %= dumper $self->req->params->to_hash;   # will show perl data structure
15:07 cstamas marty: thx
15:08 cstamas marty: thx, it is exactly what I need
15:08 marty cfedde:  Only if the file is located in a directory that mojo can serve from....  http://mojolicio.us/perldo​c/Mojolicious/Static#paths
15:09 cfedde marty: ah,
15:09 cstamas marty: is this some kind of internal interface or it is documented?
15:09 cfedde marty: Is there some other solution?  maybe stream from an open file handle?
15:10 marty cstamas.  It's documented and public.
15:12 marty cfedde:  dunno.  I always just push a directory I need to serve from onto the array.
15:12 cfedde marty: maybe so.
15:12 cfedde maybe that is the best way even
15:20 sh4 joined #mojo
15:38 mire joined #mojo
15:38 asarch joined #mojo
15:41 egopro joined #mojo
15:47 two_tired joined #mojo
15:47 mrphilov joined #mojo
16:09 btyler joined #mojo
16:11 basiliscos joined #mojo
16:12 xaka joined #mojo
16:16 asarch joined #mojo
16:21 Akron joined #mojo
16:38 arpadszasz joined #mojo
16:45 mattastrophe joined #mojo
17:10 heytrav joined #mojo
17:22 inokenty joined #mojo
17:36 nelio joined #mojo
18:12 sh3 joined #mojo
18:34 mire joined #mojo
18:49 cy joined #mojo
19:08 dod joined #mojo
19:26 KindOne joined #mojo
19:32 good_news_everyone joined #mojo
19:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JPqPKg
19:32 good_news_everyone mojo/master 3ac894c Sebastian Riedel: mention a few more features in user agent and web server descriptions
19:32 good_news_everyone left #mojo
19:32 alester joined #mojo
19:47 mattastrophe joined #mojo
20:01 cy joined #mojo
20:22 basiliscos joined #mojo
20:22 phillipadsmith I'm seeing a lot of these in the logs, should I be concerned? [Mon Apr 15 13:07:11 2013] [info] Worker 28995 has no heartbeat, restarting.
20:36 njlg joined #mojo
20:52 nic phillipadsmith: your workers are dying!!!
20:52 nic you're probably washing them at too high a temperature
20:52 phillipadsmith nic: thanks
20:52 nic an example of how you can kill workers is mistakes in directory permissions
20:53 nic eg not letting them write into the dir that manages pid files
20:54 phillipadsmith nic: okay, um, so… I shouldn't be using the default settings?
20:54 nic no, whichever dir you've set them to write to, you have to give the appropriate user write privs
20:55 phillipadsmith I think that the app has the right write privs, because it's working fine most of the time
20:55 nic a quick way to test whether that's the problem is to set /tmp to be the pid dir
20:55 nic (since everyone can write there in a default cfg)
20:55 phillipadsmith e.g., [Mon Apr 15 13:52:04 2013] [info] Creating process id file "/var/home/foo/bar/www/hypnotoad.pid".
20:56 phillipadsmith clearly it can write to the dir in question
20:56 nic If the app can serve reqs then it's not likely to be a perms problem
20:56 nic so it's an exercise to the reader to track down how you're killing your workers :)
20:57 sri http://mojolicio.us/perldoc/Mojolici​ous/Guides/FAQ#What_does_Worker_3184​2_has_no_heartbeat_restarting_mean
21:07 diegok joined #mojo
21:26 whitebook joined #mojo
21:36 lukep joined #mojo
21:47 reneeb joined #mojo
22:06 ka2u joined #mojo
22:08 cy joined #mojo
22:27 cy joined #mojo
22:44 moltar joined #mojo
22:47 good_news_everyone joined #mojo
22:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/nO-csw
22:47 good_news_everyone mojo/master 8bbfc77 Sebastian Riedel: highlight a few more features
22:47 good_news_everyone left #mojo
22:51 * sri wonders where to draw the line when listing features... there are so many :S
23:12 ka2u joined #mojo
23:14 cy joined #mojo
23:24 human39 joined #mojo

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