Camelia, the Perl 6 bug

IRC log for #mojo, 2012-09-25

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

All times shown according to UTC.

Time Nick Message
00:08 mandreacchio joined #mojo
01:04 laouji joined #mojo
01:14 abra joined #mojo
01:32 mire joined #mojo
01:47 buu So.. I've got a design problem. Not mine though. I'm trying to parse some html that essentially looks like: <tablecrap> <td> 1 <a>bar</a><br> 4 <a>baz</a><br> 3 <a>etc></a>... and so on. This isn't too tricky, the problem is that in the middle of all that is a <div>foo stuff</div> and I need to know which items are after that div in the list.
01:48 alnewkirk xpath
01:49 l3l1p joined #mojo
01:50 d4rkie joined #mojo
01:51 buu alnewkirk: Uh
01:51 buu How does that help?
01:54 alnewkirk buu: you need to match elements after <div> correct?
01:54 buu I need to separate the elements before and after the <div>foo</div>
01:55 alnewkirk separate?
01:56 alnewkirk ... as in split into two sections? or did you mean something else?
02:08 l3l1p joined #mojo
02:19 l3l1p joined #mojo
02:35 phantom joined #mojo
02:37 noganex joined #mojo
03:39 vishwanathms joined #mojo
03:39 vishwanathms_ joined #mojo
03:44 tinx joined #mojo
03:47 Foxcool joined #mojo
03:59 laouji joined #mojo
04:22 Foxcool joined #mojo
05:02 mandreacchio_ joined #mojo
05:03 mandreacchio joined #mojo
05:20 kitt_vl joined #mojo
05:35 davido joined #mojo
05:47 spleenjack joined #mojo
05:55 l3l1p joined #mojo
06:11 dpetrov_ joined #mojo
06:26 Britzel joined #mojo
06:33 andre joined #mojo
06:40 vishwanathms joined #mojo
06:40 vishwanathms_ joined #mojo
06:48 arthas_ joined #mojo
06:48 davido joined #mojo
06:50 arthas joined #mojo
07:07 rem_lex| joined #mojo
07:17 Vandal joined #mojo
07:27 daxim joined #mojo
07:30 vishwanathms joined #mojo
07:31 vishwanathms_ joined #mojo
07:39 fhelmber_ joined #mojo
07:39 vishwanathms joined #mojo
08:00 pau4o joined #mojo
08:01 mandreacchio_ joined #mojo
08:03 nour how do i test if a route/path is valid from within a controller ? i.e. before redirect
08:07 memowe joined #mojo
08:15 crab there's no easy way.
08:16 crab you'll have to go matching your target route in $self->app->routes if you really want.
08:17 crab i too wanted a way to check if a given path matches some route, but my use case wasn't compelling enough to convince sri it was worth adding (or so i recall, vaguely)
08:18 crab but anyway, it's not hard to write a thingy to look at ->routes and see.
08:21 dpetrov_ joined #mojo
08:34 yko joined #mojo
08:42 Netfeed building a rest api, if you would like to get a list of countries, would you rather have /geo/country and /geo/country/:id or /geo/countries and /geo/country/:id ?
08:43 nic I prefer the singular
08:44 nic but I think I'm outnumbered, with the majority preferring plural for the list and singular for the individual
08:44 nic I prefer the consistency of just sticking with the singular
08:44 Netfeed oh, that was a good point, plural for lists
08:46 nic there's a presentation somwhere in which someone gives a good argument that plurals (endings) are so random that computer creatures should stick to singular whenever possible/practical
08:46 crab because irregular endings are bad for the health?
08:46 nic irregular is bad for the health
08:47 andre left #mojo
08:48 nic and then you get the irregular irregulars
08:48 nic eg schema -> schemata
08:48 nic then someone says "I can't find schemas"
08:49 daxim that's perfectly cromulent english
08:49 Netfeed i can see a reason to use either
08:51 nic I'd bet some money that if you stick to singular for your paths, you'll end up glad you did
08:51 nic by all means use plurals in page titles, but it's a headache easily avoided putting it in your topology
08:52 ObseLeTe joined #mojo
08:53 ObseLeTe Hi
08:53 Netfeed i can see a point for the plurals as it's for our geo-service, /geo/countries/:continent-id could work for getting countries for the continent while /geo/countries would give you all of them, same as /geo/cities/:country-id would give you cities for that country, or would a design like /get/country/:id/city ro something work better for that?
08:53 nic diegok: Is it intentional to have no $Resque::VERSION?  Or is there a plan to have one later?
08:54 crab netfeed: what are you trying to do?
08:55 nic Netfeed: the latter
08:55 purl the latter is better
08:55 batman joined #mojo
08:55 Netfeed crab: thinking a bit loudly about designing a compeletly new rest api for us
08:55 nic With the former, what do you do when you want to give a region id instead of a country id?
08:55 Netfeed that's true
08:55 diegok nic: No intention
08:56 nic ENOVERSION!!
08:56 diegok nic: :)
08:56 nic diegok: How can I say which Resque version my code relies on?
08:57 nic Or if I write about it, how can I say which version my lies relate to?
08:57 diegok nic: ok, I'll add one next "version" :)
08:57 diegok for me, version is what dzil says :p
08:57 diegok and cpan
08:57 nic oh, that's a valid answer
08:58 nic hm, but still my code can't check it has an ok version
08:58 nic I'll wait for the next versioned version
08:58 diegok nic: sure, if you need it, then I'll place it :)
08:59 * nic neeeeeeeeeeeeeeeeeds it
08:59 diegok nic: but let me see how to make dzil to handle it
08:59 diegok nic: patches welcome ;-)
08:59 * nic no know nuthin bout no dzil
08:59 diegok :)
09:00 nic diegok: Is it worth having a Resque version that relates to the ruby Resque version it's based on?
09:00 nic Or mentioning in the docn how the two version streams relate?
09:02 ObseLeTe What's your preference for database? DBIx::Custom?
09:02 nic I'm guessing the current iteration is based on v1.21
09:02 nic ObseLeTe: We have no preference
09:03 nic but that's a decent place to start
09:05 batman zpmorgan: did you avoid global destruction errors after the pull?
09:05 Netfeed nic: you have  a great point about it, /geo/country/:id/city would probably work much better, thank you
09:05 zpmorgan batman, so far. I'll try to trigger one again.
09:06 batman zpmorgan: sweet
09:06 Netfeed and adding more stuff you could pickup wouldn't be too hard after that, :id/region :id/area and so on
09:06 nic yep, looks good
09:06 nic Netfeed: Just one question, which is probably too late to ask...
09:07 nic Have you considered using iso codes in place of country id?
09:07 nic or are you already doing that?
09:07 Netfeed yes, and it will probably be used for countries, but can't be used for cities and so on
09:07 nic sure
09:07 Netfeed or it depends on consistency too
09:07 Netfeed if everything else is an int..
09:08 nic yeah
09:08 * tempire just cheated his way past a decent algorithm with a memorizing template block
09:09 * tempire rebels against purity with practicality
09:09 tempire at least for today
09:11 ObseLeTe https://github.com/yuki-kimoto/DB​Ix-Custom/wiki/Connect-to-SQLite <-> you make this code into a db.pm ?
09:14 ObseLeTe I created a lib/DataBase/Connect.pm with this code.
09:20 Netfeed nic: made a design decesion, it's fairly trivial to support both iso-codes and our own ids without too much hazzle in the same structure :)
09:20 crab i'm puzzled. what is this API for?
09:21 diegok nic: dzil is placing a version on it
09:21 Netfeed we are apperently developing an ipad app for charter travel atm, and we need an json-api for that
09:21 Netfeed it was dumped on my desk this morning :)
09:22 cosmincx joined #mojo
09:22 crab so this is the backend to a specific app?
09:23 Netfeed no, "for all future apps"
09:23 Netfeed mostly for external developers
09:25 crab i don't know enough about your data or apps to comment in detail, but i would strongly recommend implementing only the very minimum you can actually use, rather than adding things because it's "fairly trivial" to support them.
09:26 crab especially if things are going to be used by external developers in future in ways you can't anticipate now
09:27 Netfeed i agree, but an my $id = $self->param('id') =~ /\d+/ ? $self->param('id') : look_up_id($self->param('id')); isn't really that hard
09:27 crab oh, and try to avoid having multiple URLs representing the same resource
09:27 crab netfeed: i'm not saying it's _hard_, i'm saying it's _bad_
09:28 Netfeed but i'm just in a design stage right now, nothing is set in stone
09:29 Netfeed but i will take that under advicement
09:43 nic crab: It's not bad to have multiple ways of discovering the same object as long as it's clear which is the canonical way of addressing it
09:45 pau4o joined #mojo
09:47 nic For example, one design is that /geo/country/044 is the canonical for bahamas and /geo/country/bs redirects you there
09:56 Kwa sri, crab: should type attribute be removed from javascript/stylesheet taghelpers? http://google-styleguide.googlecode.​com/svn/trunk/htmlcssguide.xml?showo​ne=type_attributes#type_attributes
10:05 * nic reads that style guide and stops writing "<br />"
10:10 Kwa I can't get my head around not closing <tr>, <td>, <li> etc.
10:38 ObseLeTe Can't locate DBIx/Class/Schema/Loader.pm <-> http://pastebin.com/L8yKfKtK
10:41 ObseLeTe I've installed DBIx::Class
10:42 good_news_everyone joined #mojo
10:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/j8PluA
10:42 good_news_everyone [mojo/master] improved javascript and stylesheet helpers to not generate type attributes - Sebastian Riedel
10:42 good_news_everyone left #mojo
10:42 sri Kwa: seems sensible :)
10:43 Kwa Nice. :)
10:43 dpetrov_ ObseLeTe: you h ave to install DBIx::Class::Schema::Loader
10:44 zpmorgan batman, I'm still getting garbage collector errors which make no sense to me
10:44 ObseLeTe yes: sudo curl -L cpanmin.us | perl - DBIx::Class::Schema::Loader -> Successfully installed DBIx-Class-Schema-Loader-0.07033 --> not okay
10:46 dpetrov_ sucessfully installed? not okay? :) did it successfully installed or not
10:46 ObseLeTe he say that's successfully, but he can't use ...
10:48 dpetrov_ ObseLeTe: so it probably cant locate it
10:48 dpetrov_ btw line 18 is not correct
10:50 dpetrov_ ah my mistake sorry
10:50 dpetrov_ but you have to quote it 'Schema'
10:50 dpetrov_ actually nope :D
10:50 dpetrov_ so try to figure out where did you install Schema Loader
11:03 * sri gives up on that dolmen guy, he does absolutely no research... https://github.com/kraih/mojo/i​ssues/326#issuecomment-8846656
11:05 crab what he's saying is not entirely without merit, but it also seems like he's nitpicking for the sake of nitpicking
11:06 crab personally, i think html entities are a mess, and i prefer to just use utf-8 on output (as i notice that style guide recommends).
11:08 sri crab: we have xml_escape, which we use exclusively for everything, Mojolicious only uses entities for unescaping
11:09 sri html_escape is only there for testing, we could even remove it
11:13 nic ObseLeTe: I strongly recommend getting cpanm installed locally
11:13 nic "cpan App::cpanminus"
11:14 pau4o joined #mojo
11:14 nic Then you can easily test builds using eg "cpanm -l /tmp/dbic DBIx::Class DBIx::Class::Schema::Loader"
11:15 nic If you're not worried about download quotas, it's the easiest way to check you like it before installing it somewhere permanent
11:16 nic and local::lib gives a quick way of temporarily adding it (/tmp/dbic/{bin,lib}) to your paths
11:24 crab how is it different from "use lib '...'"?
11:25 crab (i've always been a little confused about local::lib)
11:25 nic yeah, till recently I was the same
11:26 nic the main difference is it sets PATH and PERL5LIB in a semi-smart way
11:26 nic Within code I always use "use lib '...'" and still haven't figured out why people use local::lib inside code
11:27 nic if you care about /tmp/../bin and have a non-trivial PATH, local::lib is great
11:27 nic You spawn a new shell, eval local::lib, test, do whatever, close shell
11:31 bjoernfan perlbrew is sweeeeeeeet
11:31 bjoernfan Sweat... that is...
11:32 nic Noooooo -- stay away from the perlbrew
11:32 nic It's like absynth, you think it's good for you till you realise it isn't
11:33 crab why isn't it?
11:33 nic I have abs no idea why folks confuse local::lib and perlbrew
11:33 crab without absinthe, i wouldn't be half the painter i am!
11:33 nic true
11:33 nic Re local::lib...  http://perladvent.org/2011/2011-12-01.html
11:34 crab (how much of a painter i am: i have some colour pencils in a box in the cupboard somewhere)
11:36 nic Well, I actually have a laptop back with me in the office stuffed to seams with coloured pens (thanks to $daughter doing some repacking I didn't know about)
11:36 nic fortunately she left the laptop in there
11:36 nic ^laptop bag
11:37 nic Re living without perlbrew... http://larig.wordpress.com/2012/0​9/13/build-your-own-custom-perl/
11:37 nic but you don't need to read it, the short version is "just download and compile perl yourself instead of asking perlbrew to do it; you'll end up with less of an inflexible mess"
11:39 * sri hugs perlbrew
11:39 crab hmm. i've been using perlbrew for a longish time, and it's not caused me any particular pain.
11:39 * nic quickly wipes the bits he spat on so sri doesn't get wet
11:40 nic crab: sure, if you're not bothered about what it does then it's fine
11:40 nic but don't try to customise it; customise a simple build instead
11:41 bjoernfan nic: It works nicely for testing 5.10.1 on my debian testing, that's all I wanted for now. :)
11:41 nic surely you have a stock v5.10.1 on debian testing?
11:42 nic the caveat is that for v5.10.1 and below, customising the 'simple' build is also a pain in the neck
11:43 nic but for 5.12.4 and above it's a dream
11:43 Netfeed debian testing has 5.14.x
11:43 nic I had given up on it years ago till sri prompted/reminded me to sort out my test env
11:43 nic and was really surprised how simple the 'normal' download & build has become
11:44 nic ah yeah, it's debian stable that has v5.10.1
11:45 bjoernfan nic: Customising the simple build of what?
11:45 bjoernfan "That other" version of perl?
11:45 migo joined #mojo
11:46 nic any version of perl
11:46 nic For some unexplained reason, the main perl pages direct you to perlbrew and it's quite obscure to get the normal download page
11:47 nic ... which is http://ww.perl.org/get.html and then click on "Perl source code"
11:48 bjoernfan Oh. Yeah, okay. Not really what I'm using perlbrew for then. :)
11:49 nic surely the only use of perlbrew is for fast switching between perl versions?
11:49 nic (which I do with ". /etc/perl/perl-5.12.4.env")
11:50 bjoernfan I'll let someone else answer that for you. ;)
11:51 bjoernfan Is that by using local::lib?
11:51 nic mst mentioned fixing the perl pages so perlbrew is pushed in the face of people who are better off without it
11:51 nic ^isn't
11:51 sri nic: you do sound a bit like "perlbrew is bad because i can do the same with just a little more work manually too" ;p
11:51 nic no, again, why would you confuse the two
11:52 nic perlbrew for switching perl
11:52 nic local::lib for temporarily augmenting your paths, eg to try out a release
11:53 bjoernfan This is the first time I'm hearing about local::lib, and I'm new to perlbrew as well.
11:53 nic sri: That page is about getting customisations (install paths, @INC, etc)
11:53 nic doing that with perlbrew would be much much longer
11:53 sri why would you do that with perlbrew in the first place?
11:54 nic look at the perl pages and the perl fora, perlbrew is the route most quoted for how everyone should be installing perl
11:54 sri and that's good
11:55 bjoernfan I'm using perlbrew right now for trying out other releases of perl... so it sounds like they both do the same thing, for my intents and purposes anyway...
11:55 sri perlbrew is not just about switching between versions but also about making the installation of a non-system perl trivial
11:56 nic what's non-trivial about "make; make test; make install"?
11:56 sri you also have to customize it for installation in your home directory
11:57 sri that's shit i really don't want to deal with
11:57 nic "./Configure -des -Dprefix=$HOME/perl && make && make install"
11:57 sri yea, stay away from me with that
11:57 sri that is not friendly at all
11:58 nic sri: What's the path to your perl binary?
11:58 sri perlbrew install perl-5.16.1
11:58 sri /Users/sri/perl5/perlbrew/​perls/perl-5.16.1/bin/perl
11:58 nic before that you need to install perlbrew, perhaps telling it where to go and which space to use
11:59 sri nope
11:59 nic sri: Think how much more beautiful your life would be with /Users/sri/perl/5.16.1/bin/perl :)
11:59 sri start perlbrew with system perl, the rest just works
12:00 sri my perlbrew install process was something like "mv perlbrew /usr/local/bin"
12:00 sri and whenever perl gets a new release i don't have to worry about anything
12:01 sri just perlbrew install perl-foobarbaz
12:01 nic nor I
12:01 sri you have to look up the configure options again
12:01 nic nope
12:01 sri and write a new switching script
12:01 nic nope
12:02 nic one evening last week I built v5.12 to v5.17 on 8 boxes across 3 archs
12:02 nic needed almost no manual anything once I had my Policy.sh from the first build
12:02 sri maybe you're smarter than me, or have more free time for perl installations ;p
12:04 * sri has no time for devops work and wants things to just work without additional work
12:04 nic say you want to check inside a pm, you'd view /Users/sri/perl5/perlbrew/perls/​perl-5.16.1/lib/perl5/IPC/Run.pm when you could just have view /Users/sri/perl/5.16.1/lib/IPC/Run.pm
12:04 sri why would i care about that?
12:05 nic if you enjoy pointless typing it's not a problem at all, it could be a sport
12:10 Kwa Obviously you could symbolic link the perl dists if you really care about where they're located.
12:11 nic yeah, you could maintain a link to whichever one is the current 'global'
12:12 Kwa "Get busy living or get busy dying."
12:12 nic which would avoid caring about the env a particular script is picking up
12:12 nic and give you an easy rollback if some code doesn't like the new perl
12:19 sunson joined #mojo
12:21 nic marcus, batman: can undef be a valid return value from redis?
12:21 marcus nic: I sure hope not.
12:22 nic if a get finds nothing, should it return ''?
12:23 nic (just thinking about what my error checking should be doing)
12:24 nic shhh, just seen I don't need to do any, thanks to on_error
12:34 d4rkie joined #mojo
12:43 ObseLeTe joined #mojo
13:25 bluescreen joined #mojo
13:30 good_news_everyone joined #mojo
13:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/63pDXA
13:30 good_news_everyone [mojo/master] show how to start the reactor in synopsis examples - Sebastian Riedel
13:30 good_news_everyone left #mojo
13:46 * crab has a vision of homer at the reactor controls
13:57 inokenty joined #mojo
14:04 sri :D
14:13 * Kwa has 5 kids to feed
14:15 gryphon joined #mojo
14:24 Leandr joined #mojo
14:26 Britzel_ joined #mojo
14:34 ryozi joined #mojo
14:40 vishwanathms joined #mojo
14:40 vishwanathms_ joined #mojo
14:46 Jason__ joined #mojo
14:55 jnap joined #mojo
15:28 crab Kwa: what do you feed them?
15:29 Kwa crab: Mars bars
15:29 purl Mars bars are made by Mars :)
15:29 * Kwa drumfills
15:31 Kwa Actually, is Benny in the new Total Recall?
15:46 labrown joined #mojo
16:00 Lucas1 joined #mojo
16:03 xaka joined #mojo
16:12 tolid_air joined #mojo
16:19 batman left #mojo
16:30 jzawodn joined #mojo
16:31 knshaum joined #mojo
16:34 daxim joined #mojo
16:34 pau4o left #mojo
16:37 mire joined #mojo
16:59 ObseLeTe joined #mojo
17:10 davido joined #mojo
17:22 ObseLeTe joined #mojo
17:28 jnap joined #mojo
17:45 andrefs joined #mojo
18:02 jnap_ joined #mojo
18:03 jnap joined #mojo
18:25 ObseLeTe joined #mojo
18:52 tempire perlbrew FTW
18:52 tempire I too have no interest in devops
18:52 tempire I grew tired of such things before devops was a word.
18:53 tempire this is why I'm a developer and not a sysadmin.
18:54 xaka every developer is sysadmin by default :) because you need to manage/configure/support apache, nginx, mysql, whatever your project requires
18:58 jnap joined #mojo
19:14 pertze joined #mojo
19:23 pertze hey
19:23 pertze got some silly newb problem
19:25 pertze https://gist.github.com/fa2a9d9352e57fdeeb55
19:25 pertze some simple imap client, to display uids in the first step
19:26 pertze "problem" is the post request
19:26 pertze connecting to imap, search some mails, loop through the uids
19:26 pertze display them
19:27 pertze but
19:27 pertze in morbo log, the post request is hitting twice
19:29 pertze logfile here: https://gist.github.com/a49279c1a82002207e79
19:30 pertze o0 why is that?
20:07 xaka joined #mojo
20:35 mattp joined #mojo
20:37 mattp joined #mojo
20:50 mire joined #mojo
21:13 ObseLeTe joined #mojo
21:19 jnap joined #mojo
21:20 perlite joined #mojo
21:36 memowe joined #mojo
21:38 ObseLeTe joined #mojo
21:39 lukep joined #mojo
21:58 davido joined #mojo
23:03 tempire bah.  no more sysadmin here. the new age is google apps and heroku.
23:03 ObseLeTe I hate DBIx :)
23:04 ObseLeTe </cry>
23:05 buu You mean DBIC?
23:07 ObseLeTe DBIx::Class
23:07 purl i guess DBIx::Class is a resultset-driven ORM with a Class::DBI compatiblity or http://lists.scsys.co.uk/m​ailman/listinfo/dbix-class or see 'dbic repo' or http://dbix-class.shadowcatsystems.co.uk/ or discussed on #dbix-class or a bit like handing an automatic rifle to a squirrel. or ilmari's mro orm or known to be slow at startup
23:07 ObseLeTe what's the alternativ of dbix?
23:08 Adura DBI
23:08 ObseLeTe rose-db is good?
23:09 buu My point was that it's not abbreviated 'dbix::class'
23:09 arthas joined #mojo
23:09 buu er
23:09 buu dbix; heh.
23:09 chansen joined #mojo
23:09 buu There's a bunch of ORMs on CPAN, one of my previous coworkers wrote one a little while ago..
23:09 phillipadsmith joined #mojo
23:12 mandreacchio joined #mojo
23:12 ObseLeTe mojolicious must to add a movie tutorial for sql connection :)
23:13 Adura Eh?
23:13 Adura Wouldn't that seem... biased towards sql?
23:14 buu And we hate biases.
23:18 ObseLeTe exist an module for make a model of database and generate it?
23:31 chansen joined #mojo
23:31 phillipadsmith joined #mojo
23:38 Adurah joined #mojo
23:47 davido Just because its documentation is non-trivial doesn't make it a bad solution.  Spend some more time with the docs, and experimenting with one-off scripts so that you don't have to try to conflate the learning curve of both Mojolicious and DBIx::Class simultaneously.  Put the two tools together after you've had a chance to learn each in isolation.
23:48 davido DBIx::Class is a powerful tool, but it does require that you learn how to use it.  (not to express any bias...)
23:52 Averna joined #mojo

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