Camelia, the Perl 6 bug

IRC log for #mojo, 2011-09-04

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

All times shown according to UTC.

Time Nick Message
01:09 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Shamekagtxsw http://twitter.com/Shamekagtx​sw/status/110157535100665856
01:09 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Elouiselaewc http://twitter.com/Elouiselae​wc/status/110157606479347712
01:09 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Renitalzlpm http://twitter.com/Renitalzl​pm/status/110157608358391808
01:29 shonorio joined #mojo
01:41 alnewkirk joined #mojo
01:50 perlrocks Twitter: "Mojolicious 1.96: The Web In A Box! http://t.co/c0607r9" --lordnaastik http://twitter.com/lordnaast​ik/status/110167750118346752
02:07 SmokeMachine joined #mojo
02:10 preflex_ joined #mojo
02:33 shonorio joined #mojo
02:41 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Patienceyuccb http://twitter.com/Patienceyu​ccb/status/110180654041399296
02:41 gshank joined #mojo
02:51 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Marikoysqmu http://twitter.com/Marikoysq​mu/status/110183138063417344
02:51 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Mabellecfmec http://twitter.com/Mabellecfm​ec/status/110183140240265216
02:55 elb0w_ joined #mojo
02:55 elb0w_ sri: how do I handle images that are posted to me?
02:55 elb0w_ any docs?
03:01 alnewkirk elb0w_, what do u mean?
03:04 elb0w_ I want someone to post an image to me
03:04 elb0w_ so I can store it
03:13 elb0w_ alnewkirk: any idea?
03:13 purl well, any idea is welcomed.
03:14 alnewkirk elb0w_, like uploading?
03:14 elb0w_ yes, do I need File::Temp?
03:15 elb0w_ http://hawkins.id.au/notes/perl/s​nippets/mojo-and-lwp-file-upload
03:15 elb0w_ looking there
03:15 elb0w_ that ok?
03:15 purl NO, it isn't
03:16 alnewkirk looks fine to me
03:19 elb0w_ ok
03:26 elb0w_ alnewkirk: how can I render an image in a lite app? Do I need to make it bits?
03:30 alnewkirk elb0w_, https://metacpan.org/module/Mojoliciou​s::Guides::Cookbook#Streaming-Response
03:30 elb0w_ ty
03:30 alnewkirk for large files otherwise its easy
03:31 elb0w_ wait not what I mean
03:31 elb0w_ I want someone to go to myserver.com/dog
03:31 alnewkirk oh
03:31 elb0w_ and it render a file /tmp/dog.png
03:31 elb0w_ from my machine
03:31 elb0w_ do I need to load dog.png into data and render it as png?
03:31 alnewkirk thats simple enough
03:32 alnewkirk yes
03:32 elb0w_ I know non lite apps have a public folder
03:32 alnewkirk make sure to set the format properly and the browser will handle the rest
03:33 elb0w_ what is the proper way to break a image down?
03:33 elb0w_ base64?
03:33 purl base64 is just uuencode with some extra shit attached eh? or described in an RFC somewhere, presumably. or MIME::Base64 will default to pure perl if xs no worky or simple, but designed to cope with really-legacy character sets
03:38 Cside joined #mojo
04:04 xaka joined #mojo
04:12 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Jolenewuoce http://twitter.com/Jolenewuo​ce/status/110203616618487808
05:27 Cside joined #mojo
05:51 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Londakbqzp http://twitter.com/Londakbqz​p/status/110228460168945666
05:52 Cside joined #mojo
06:16 Eugene joined #mojo
06:34 Firkin joined #mojo
06:45 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: One thing about developing stuff with Mojolicious is to start the development server by hand...." --Maryjanexqlfw http://twitter.com/Maryjanexq​lfw/status/110242014611775488
06:45 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: One thing about developing stuff with Mojolicious is to start the development server by hand...." --Glindawzzgl http://twitter.com/Glindawzz​gl/status/110242014775349248
06:52 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Jenneferpvnxu http://twitter.com/Jenneferpv​nxu/status/110243790970830848
06:56 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Renatenfren http://twitter.com/Renatenfr​en/status/110244942554742784
07:04 perlrocks Twitter: "Morbo as a service on MacOS X - pkgbox: Sebastian (sri) did a fantastic job in writing morbo, the development server for Mojolicious...." --Wintermhdjo http://twitter.com/Wintermhd​jo/status/110246731807072257
07:08 preflex joined #mojo
07:13 * sri yawns
07:19 sugar joined #mojo
07:21 plu joined #mojo
07:50 trone joined #mojo
07:55 marcus morning
07:57 marcus sri: very nice about the improved hypnotoad controls.
08:36 cstamas hi
08:36 marcus cstamas: oh hai
08:36 cstamas is there way to preserve expensive to generate data between page hits? (if I run the app with hypnotoad?)
08:37 cstamas I query ldap and the query and other stuff takes 5-10 sec
08:37 cstamas I want to preserve this data for some time if another request comes
08:37 cstamas can I make some long live object with mojolicious or something like that?
08:39 cstamas so if the next hit comes I can just serve it immediately
08:39 cstamas or the only thing I can do is to write it to disk?
08:39 cstamas TAI
08:46 marcus heh
08:46 marcus cstamas: use memcached
08:51 cstamas hmm, ok
08:53 cstamas the reason why I asked this because if there is some long lived context then I can keep the cache uptodate
08:53 cstamas I can refresh it before it expires
08:54 cstamas which I can do it by other means without special support in the framework
08:55 cstamas just some ideas...
08:55 cstamas marcus: thx. for the answer
09:07 tempire elb0w: if you haven't already figured it out, you can serve static files from the public directory in both regular and lite apps.
09:08 tempire or you can encode them in a template with base64: http://mojolicio.us/perldoc/Mojolicious/G​uides/Rendering#Base64_Encoded_DATA_Files
09:28 kaare_ joined #mojo
09:40 abra joined #mojo
09:48 sromanov joined #mojo
09:54 plu joined #mojo
10:07 plu joined #mojo
10:09 Eugene joined #mojo
10:45 plu joined #mojo
10:50 sugar joined #mojo
10:54 perlrocks Twitter: "Mojolicious::Plugin::YamlConfig 0.1.2 (Freeware): Look at Mojolicious::Plugin::JsonConfig and replace \"json\" w... http://t.co/I496MZb" --Softepic http://twitter.com/Softepic​/status/110304618940071937
11:07 Eugene1 joined #mojo
11:11 shonorio joined #mojo
11:18 Eugene joined #mojo
11:29 sugar_ joined #mojo
11:31 preflex_ joined #mojo
11:38 noganex_ joined #mojo
12:10 alnewkirk at a glance, and for some odd reason, it seems that I can't call a helper from within another helper
12:14 diegok alnewkirk: I am doing that...
12:17 diegok alnewkirk: https://gist.github.com/1192781
12:18 Kulag joined #mojo
12:18 alnewkirk it works?
12:21 diegok alnewkirk: yes
12:22 diegok I'm on 1.90, letme update and run tests...
12:25 diegok ^ yup!
12:25 diegok alnewkirk: see how model helper calls schema one...
12:26 alnewkirk yes
12:53 shonorio joined #mojo
13:06 alnewkirk morbo don't env vars like referrer and remote_addr etc get populated by  morbo?
13:14 diegok alnewkirk: ^ http://search.cpan.org/dist/Mojoli​cious/lib/Mojo/Message/Request.pm ?
13:15 diegok alnewkirk: $self->req
13:16 alnewkirk diegok, meaning what?
13:16 diegok referrer is a header in the request
13:17 diegok It is sent by your agent
13:18 alnewkirk have you tried it?
13:18 purl You know, the workings of perl lend themselves to empirical research.
13:19 diegok alnewkirk: nope :(
13:19 diegok isn't there?
13:19 alnewkirk try it
13:19 diegok ok...
13:25 diegok alnewkirk: in $self->req->as_string I can see the Referrer
13:26 diegok alnewkirk: I'm not finding how to get only that header on the docs...
13:27 abra joined #mojo
13:30 alnewkirk diegok, well for me, $self->req->env returns {}, and %ENV doesn't have some of the things web servers normally sey
13:30 alnewkirk set*
13:30 alnewkirk which make it hard to test certain things without breaking out apache
13:31 alnewkirk like a route with a specific-referrer condition
13:31 alnewkirk for .e.g
13:32 shonorio joined #mojo
13:32 diegok $self->req->headers->to_string;
13:34 diegok alnewkirk: hm, I don't use env, I expexct to interface with the external world thru request and response
13:34 diegok that should work the same on every deploy.
13:34 elb0w_ joined #mojo
13:36 diegok ok, find it and it works: $self->req->headers->referrer
13:36 alnewkirk oh word, ... sassy
13:36 alnewkirk :}
13:36 alnewkirk find me the remote_addr env_var
13:36 diegok alnewkirk: http://mojolicio.us/perldoc/Mojo/Headers#referrer
13:37 alnewkirk referrer != remote_addr
13:37 diegok alnewkirk: well, it should be there in the docs :)
13:37 diegok remote address isn't a header
13:37 alnewkirk diegok, i never said it was
13:38 alnewkirk you completely missed the point
13:39 diegok ^ $self->tx->remote_address
13:39 diegok alnewkirk: didn't you ask for referrer and remote_addr?
13:40 alnewkirk no
13:40 alnewkirk I asked ...
13:41 alnewkirk [09:07] <alnewkirk> morbo don't env vars like referrer and remote_addr etc get populated by  morbo?
13:42 alnewkirk I meant to type, morbo doesn't populate %ENV, ... .e.g. CGI or others
13:42 alnewkirk morbo, mojolicious, mojo etc
13:44 diegok oh :)
13:44 diegok well, probably it doesn't
13:45 diegok but, you should get those values thru the mojo api anyway ;-)
13:46 alnewkirk why, would they be any different otherwise?
14:27 elb0w_ joined #mojo
14:30 diegok sri: is it ok to send debug messages from  a plugin?
14:30 sri diegok: of course
14:31 sri the request timer plugin's only purpose is sending debug messages ;)
14:52 abra joined #mojo
14:55 perlrocks Twitter: "Taking a breath of fresh air with some #mojolicious coding for #LaTeXML after submitting my Master's thesis. Life is good again :)" --dginev http://twitter.com/dginev/​status/110365476126867456
14:57 preflex joined #mojo
15:39 elb0w_ How can someone upload a file to me? By just posting to a url
15:39 elb0w_ without a form
15:41 alnewkirk sure
15:41 alnewkirk link
15:44 elb0w_ if someone posts data to me
15:44 elb0w_ without coming from a form
15:45 elb0w_ I'm trying to get a byte array posted to me
15:45 elb0w_ how do I capture it?
15:45 elb0w_ is there like a misc param?
15:48 preflex joined #mojo
15:53 marcus wassup homies
15:55 elb0w_ Ok so I'm trying to get this image thats being posted to me, I dumped self and am pretty sure this is it. How do I access it? http://pastie.org/2481282
15:56 elb0w_ I tried getting $self->param("Filedata")
15:56 elb0w_ but that didn't do it
15:59 elb0w_ argh
15:59 elb0w_ :/
16:02 marcus elb0w_: ->req->upload('Filedata')
16:03 marcus returns a Mojo::Upload object
16:03 elb0w_ ok will check
16:03 elb0w_ $self->req->upload('Filedata')?
16:03 marcus yes
16:05 elb0w_ marcus: ty
16:05 diegok Anyone using DBIC with mojolicious?
16:05 marcus elb0w_: you are welcome.
16:06 marcus diegok: yes
16:06 diegok marcus: I'm putting together a plugin :)
16:06 marcus my $schema=My::Schema->connect; $self->helper(db=>sub { $schema });
16:06 diegok letme push, would you check?
16:06 elb0w_ marcus: should I use file::temp to save it?
16:06 marcus don't see why you need a plugin :)
16:06 diegok marcus: you'll see :p
16:07 marcus diegok: I like the fact that Mojolicious has no glue for databases.
16:07 diegok marcus: well, or not ^
16:08 diegok I've just got together some things I had around for auto load / deploy
16:08 marcus elb0w_: the Upload object should provide all the methods you need, depeing on what you want.
16:09 marcus diegok: that isn't mojo dependent tho :)
16:09 diegok :)
16:14 diegok https://github.com/diegok/Mojolicious-Plugin-DBIC
16:20 marcus diegok: yupp, this is not something I need. Might be useful for others tho =)
16:20 diegok marcus: ^ I've doing some really small apps puting some mojo on top of DBIC and this is taken from what I'm using. Not sure to upload to CPAN.
16:28 * elb0w_ is using mojo as a backend to a mobile app and having a blast
16:28 marcus elb0w_: \o/
16:32 diegok ^ but yes, that code probably belongs to the schema class tho. It just make sense to my weekend needs :(
16:32 elb0w_ there a mojo way to do sftp?
16:34 marcus elb0w_: not afaik
16:34 marcus elb0w_: Net::SFTP?
16:34 purl Net::SFTP is notorious for die()ing when it should croak() and full of warn() messages (that should actually be carp()s) you can't suppress
16:34 elb0w_ think I'm going to just mount a system with sshfs
16:34 elb0w_ and use the move_to
16:35 marcus sounds smart
16:44 elb0w_ marcus: does move_to return true or false?
16:45 * marcus checks the source for elb0w_
16:46 marcus elb0w_: move_to return the asset
16:46 marcus dies on failure
16:46 elb0w_ lmao
16:46 elb0w_ ok
16:46 elb0w_ ty
16:48 marcus elb0w_: (asset == Mojo::Asset::File btw)
17:01 elb0w_ ok cool
17:01 elb0w_ I'm just assuming its working
17:01 elb0w_ :P
17:14 sugar joined #mojo
17:18 abra joined #mojo
17:21 Foxcool joined #mojo
17:54 xaka joined #mojo
18:13 kaare_ joined #mojo
18:13 tempire diegok: you should put a readme in your github repos
18:49 bzero joined #mojo
19:12 elb0w_ joined #mojo
19:19 Firkin left #mojo
19:41 sri oh, we reached 100 tags on github :)
19:43 perlrocks Twitter: "Mojolicious-Plugin 0.3 for OAuth2 MRAMBERG - http://t.co/nc8E7sV" (af) --cpan_new http://twitter.com/cpan_new​/status/110437828424499200
20:16 Kulag joined #mojo
20:23 perlrocks Twitter: "Mojolicious-Plugin-YamlConfig 0.1.3 by DATA - http://t.co/1fsjwH7" --cpan_new http://twitter.com/cpan_new​/status/110447894410182658
20:24 * sri bonks DaTa_ on the noggin
20:25 sri i saw that changelog entry :)
20:26 Drossel joined #mojo
20:27 sri DaTa_: oh sorry, didn't realize you actually subclassed JsonConfig :(
20:30 sri but now that i think about it, not sure it could have been handled differently
20:31 sri empty JsonConfig class isn't an option, no deprecation path
20:31 sri damn those case insensitive file systems
20:35 sri but if anyone sees a way we can consider it a bug and deprecate it properly
20:36 marcus And if it hadn't been for those pesky kids, I would have gotten away with it too...
20:37 * sri waves fist
20:42 marcus scary, I sent mail from the mojolicious mail plugin without config, and it arrived in my gmail :o
20:43 sri :o
20:44 elb0w__ joined #mojo
20:45 rwstauner joined #mojo
20:57 perlrocks Twitter: "Test::Mojo – Intro into testing with CSS3 selectors - pkgbox: Testing with Mojo is great fun. The Mojolicious framework provides an ..." --Zoejhghc http://twitter.com/Zoejhghc​/status/110456413477814273
21:05 Kulag joined #mojo
21:12 elb0w__ do I have access to Mojo::JSON and UA from Mojo lite self?
21:12 elb0w__ or do I need to import it?
21:21 marty joined #mojo
21:22 Kulag joined #mojo
21:35 Kulag joined #mojo
21:39 Drossel joined #mojo
21:45 marcus elb0w__: app->ua
21:45 elb0w__ oh nice
21:45 elb0w__ what about json
21:47 elb0w__ app->json?
21:47 elb0w__ I guess
21:47 elb0w__ lmao
21:48 marcus elb0w__: don't think you have an accessor, but Mojo::JSON should be imported. If you're getting the JSON from http, you can always do res->json to get it decoded.
21:49 elb0w__ ok
21:49 elb0w__ i imported xs
21:49 mattp joined #mojo
22:08 marty_ joined #mojo
22:52 Cside joined #mojo
22:58 perlrocks Twitter: "Test::Mojo – Intro into testing with CSS3 selectors - pkgbox: Testing with Mojo is great fun. The Mojolicious framework provides an ..." --Aleshaowdnv http://twitter.com/Aleshaowd​nv/status/110486994370568192
22:58 perlrocks Twitter: "Test::Mojo – Intro into testing with CSS3 selectors - pkgbox: Testing with Mojo is great fun. The Mojolicious framework provides an ..." --Barabarafzzki http://twitter.com/Barabarafz​zki/status/110486996870381569
23:56 blabos joined #mojo

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