Camelia, the Perl 6 bug

IRC log for #bioperl, 2013-02-19

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

All times shown according to UTC.

Time Nick Message
00:12 census deafferret: i'm trying to test that i am identifying the correct url in my code.  how may i do that?
00:12 census obviously i could print it, but i'm not sure that would tell me too much.
00:13 deafferret census: I guess I don't understand your question. If you need to know something that's going on in your program, you'd print or warn it, to your screen or to a log file.
00:15 census I have a my $uri = where I'm trying to "guess" the correct uri.
00:15 census I input some variables.
00:15 census to a uri_escape
00:15 census join the terms from the inputted string
00:15 census and try to feed that into the uri
00:15 census but i'm not sure i actually have the correct uri
00:31 deafferret so... print it and look?
00:32 census print out the mech-request?
00:33 deafferret print the $uri before and after your conversions?
00:33 deafferret ... print out whatever you're "not sure" about :)
00:34 census how  can i print to the output file:  if the output is $o4, would it be: print ($o4, Dumper($content), "\n");?
00:34 deafferret I use the interactive debugger all the time, but most people don't. You could learn that if you want.
00:34 deafferret if you wanted to print $content, yes, that would work.
00:35 deafferret I think I told you yesterday I prefer    use 5.10.0;  say $o4 Dumper($content);
00:35 census the output file comes out blank . . .
00:35 deafferret open my $o4, ">", "outfile.txt" or die "Open of outfile failed: $!";
00:35 census open( my $o4, '>', 'out20.txt' ) or die "Can't open output file: $!";
00:36 deafferret it doesn't die? but nothing gets printed to it?
00:36 deafferret nopaste your code, results
00:37 census nopaste?
00:38 census k, it is outputting now
00:38 census thank you for that 5.10.0 suggestion
00:38 deafferret http://scsys.co.uk:8002   is one example of a "nopaste" service
00:38 deafferret you're welcome :)
00:40 census that dumping line did not give me anyting useful
00:42 census anyhow, i can look at the url, but that does not mean it is the "correct" url
00:43 census i mean it may or may not match what i see in firefox, but not matching does not preclude it from being correct, right?
00:44 deafferret i don't understand your questions. "correct" is whatever you say it is. You haven't told me what "right" or "wrong" are, or provided any examples or source code so...
00:59 census Please dont' be mad about functions
00:59 census (or however you referred to them as)
01:08 census here's the code
01:08 census http://scsys.co.uk:8002/231133?ln=on&amp​;tidy=on&hl=on&submit=Format+it!
01:08 census i'm referring to line 78
01:09 census i want to know that it is fetching url that i'm intending for it to fetch
04:30 census joined #bioperl
04:30 census deafferret: Hi!
05:22 github [bioperl-live] cjfields pushed 1 new commit to v1: https://github.com/bioperl/bioperl-live/comm​it/e37ae0d28300f7a3fce68eca5d63c2d3b53e586b
05:22 github bioperl-live/v1 e37ae0d Chris Fields: add v1 branch for CI
05:23 github [bioperl-live] cjfields pushed 1 new commit to master: https://github.com/bioperl/bioperl-live/comm​it/3f218f96e68910e275c9558a168558425f843fe4
05:23 github bioperl-live/master 3f218f9 Chris Fields: Merge branch 'v1'
07:43 ObseLeTe joined #bioperl
14:40 github [bioperl-live] cjfields pushed 2 new commits to v1: https://github.com/bioperl/bioperl-liv​e/compare/e37ae0d28300...c07503cbad4f
14:40 github bioperl-live/v1 d4ff18a Chris Fields: squash warning
14:40 github bioperl-live/v1 c07503c Chris Fields: Graph::Directed is giving warnings when using 'require', but using...
14:57 github [bioperl-live] cjfields pushed 1 new commit to v1: https://github.com/bioperl/bioperl-live/comm​it/af4159582821caa23d4ba6d008ba08ead810c0a6
14:57 github bioperl-live/v1 af41595 Chris Fields: HTML table parsing requires UTF8 decoding
15:57 github [bioperl-live] cjfields pushed 4 new commits to v1: https://github.com/bioperl/bioperl-liv​e/compare/af4159582821...eb8d5ef0b7e4
15:57 github bioperl-live/v1 7fc3bd3 Chris Fields: squash warning
15:57 github bioperl-live/v1 c7e3454 Chris Fields: squash warning
15:57 github bioperl-live/v1 7acaea8 Chris Fields: bulletproof test against remote data changes
15:58 github [bioperl-live] cjfields pushed 1 new commit to v1: https://github.com/bioperl/bioperl-live/comm​it/0c90a0d696637894f67032dbbc2a1ae23c903010
15:58 github bioperl-live/v1 0c90a0d Chris Fields: fix ID example
16:08 deafferret pong
16:14 github [bioperl-live] cjfields pushed 1 new commit to v1: https://github.com/bioperl/bioperl-live/comm​it/2e3eb594a7948c104ef58ba18539ae55e2f4179c
16:14 github bioperl-live/v1 2e3eb59 Chris Fields: LOCUS IDs no longer work, bad for swissprot-like IDs; need to come up with an alternative
16:22 github [bioperl-live] cjfields pushed 1 new commit to v1: https://github.com/bioperl/bioperl-live/comm​it/37eb121b1dbf83495d985049cd7552fb8719921f
16:22 github bioperl-live/v1 37eb121 Chris Fields: fix problems with remote data changes
16:23 github [bioperl-live] cjfields pushed 1 new commit to master: https://github.com/bioperl/bioperl-live/comm​it/573b3f6b57efdd407229665c51d36c408427eba9
16:23 github bioperl-live/master 573b3f6 Chris Fields: Merge branch 'v1'
16:28 carandraug joined #bioperl
16:28 carandraug joined #bioperl
16:59 census joined #bioperl
17:00 census hi! :)
17:11 deafferret census: hola
17:11 census sorry, i think i zonked out yeseterday
17:12 census you were kindly helping me deduce whether i'm fetchign the correct url ?
17:14 deafferret hey, good -- this looks pretty clean to me :) nice work
17:15 deafferret anyhoo,   on line 80    say $uri   would dump the uri to your screen and you could eye-ball it, right?
17:15 deafferret (http://scsys.co.uk:8002/231133?ln=on&​tidy=on&hl=on&submit=Format+it!)
17:15 deafferret what's your current question?
17:19 census yes, that.  thank you for finding all of that! :)
17:20 census may i don't know what to eyeball, but am i dumping the correct content to be looking at?  the current dump was not informative, i believe
17:22 deafferret census: stick line 86 up with the other use statements. line 4 would be my preference
17:22 deafferret now you can "say" instead of "print" on lines 36, 41, 43
17:23 deafferret on line 37, you should die "Login failed due to another session with the specified user";
17:23 deafferret not die on a separate line
17:23 deafferret so if Dumper($content) isn't helping, just say $uri instead.
17:25 census so, die "Login failed due to another session with the specified user"; instaead of die() on 37?
17:28 deafferret yup
17:32 deafferret so you probably want $uri->query_form( \%hash ) instead of your own mangling on lines 76-78
17:32 deafferret i think you'd be happier letting URI do that work for you instead of trying to do it yourself.
17:32 deafferret it has hundreds of tests, your code has zero. :)
17:36 census wait a second
17:36 census so that $uri line: "$uri->query_form( \%hash )" are you saying this will generate the $uri for me?!?
17:37 deafferret ya, looks like it.  https://metacpan.org/module/URI
17:37 deafferret let the modules do all the crazy parsing, squishing, if you can.
17:37 deafferret your code will probably be buggy if you don't.
17:38 carandraug deafferret, hi! You know who split Bio-SearchIO-Writer-BSMLResultWriter ?
17:39 carandraug and Bio-SearchIO-blastxml?
17:43 census I don't think I implemented the hash correctly
17:43 deafferret carandraug: no clue. the repos should tell you
17:43 census http://scsys.co.uk:8002/231213?ln=on&amp​;tidy=on&hl=on&submit=Format+it!
17:44 census Error: "my" variable $content masks earlier declaration in same scope at ancestryscrape .pl line 84.
17:44 deafferret query_form( \%args2 ), ya?
17:45 deafferret no my
17:48 carandraug deafferret, yes. But it's not so obvious because the split only took the commits from bioperl live, and the original commit authors are kept. Therefore no information on who made the actual split. Seems to be someone with the username pcantalupo but he doesn't have contact information on github. Do you know who he is? I don not wish to correct him on the public mailing list
17:49 deafferret ? i would think he would appreciate being corrected if he made a mistake
17:49 deafferret we all do
17:49 census the my goes where exactly?   my $uri->query_form(  \%args2  );
17:50 census i tried in front of query and in front of the \ and neither seemed to work
17:52 carandraug deafferret, yes, but I still believe it's not good to do it in public. Think of it as calling someone aside to correct rather than showing up when he's in a group of friends and do it in front of everyone. The rebuke may cause them to think twice next time they plan on contributing
17:54 deafferret oh? i suspect such a delicate person won't do much open source in any event. Anyhoo, did you try   Paul Cantalupo <pcantalupo@gmail.com> ?
17:59 deafferret census: So I'd roll like this https://github.com/jhannah/san​dbox/blob/master/census/uri.pl
18:03 census thanks!  and that goes in place of the last few lines?
18:11 carandraug joined #bioperl
18:11 deafferret census: I'll let you figure that out.  :)
18:11 deafferret carandraug: 17:54 < deafferret> oh? i suspect such a delicate person won't do much open source in any event. Anyhoo, did  you try   Paul Cantalupo <pcantalupo@gmail.com> ?
18:18 looper joined #bioperl
18:21 census that totally compiled!!
18:21 census :)
18:22 census however, i don't see anything from what i inputted into args to suggest that this url is correct.
18:23 carandraug deafferret, I just did. Thank you
18:25 deafferret carandraug: you're welcome. strangely I found that in a .patch file in my local clone
18:26 deafferret census: I am once again failing to understand your question.
18:27 carandraug deafferret, clone clone of what repo?
18:27 carandraug *local clone
18:27 deafferret carandraug: bioperl-live
18:30 census I have the line:  @args2{qw/gsfn gsln msbdy msbpn__ftp 83004002/} = split /,/, $line;
18:30 census I feed in information from an input.txt
18:30 deafferret carandraug: oh... here's lots of hits to that email address    bioperl-live$ git log | grep pcantalupo
18:30 census In the url that got printed, it should contain that information, but none of it is there.  Only the junk part of the url gets printed (potentially correctly. . . it looks reasonable that part)
18:31 carandraug deafferret, that file is only on your clone. I don't see it. But there's other .* files that seem to be committed by accident. Guess gitignore should have an update
18:32 deafferret carandraug: well don't hide the problem -- remove the files
18:32 carandraug I've been having the most hectic couple of days. I just slept for 25h (just woke up on the middle of the night to get some food)
18:33 deafferret wow. fever?
18:34 carandraug deafferret, nop. Just having a lot of work, been sleeping too little and then pulled 2 blank nights. I feel wrecked. And all the open source work accumulated this last days. Been writing e-mails for 3h now
18:35 deafferret wow. hope you get back to whatever your normal is!!  :)
18:43 census the url i'm getting is: http://scsys.co.uk:8002/231214?wr=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
18:44 census but that does not include any of the content that i'm inputting (e.g. the person's name)
19:12 deafferret census: show us your current code.
19:12 deafferret also, on line 67: say $line;
19:12 deafferret census: show us you output
19:13 census http://scsys.co.uk:8002/231218?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
19:13 census that was the code
19:13 census the output is: http://scsys.co.uk:8002/231214?wr=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
19:15 deafferret census: uh... why are you using my demo %args2 on lines 93,94? You need to understand what's happening in my demo and apply it to YOUR code. you can't just copy/paste and expect it to work
19:15 deafferret census: you're not doing a GET anymore. your GET is commented out.
19:15 deafferret it needs to be down on line 96.
19:23 census script = http://scsys.co.uk:8002/231219?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
19:25 census output = http://scsys.co.uk:8002/231221?wr=on&amp;ln=o​n&amp;tidy=on&amp;hl=on&amp;submit=Format+it!
19:26 deafferret explain line 94 to me
19:33 census i cannot.  didn't you suggest it?
19:38 deafferret census: don't blindly copy/paste my suggestions. I suggest things so you can (1) understand them and then (2) choose to use those techniques yourself, or not.
19:39 deafferret if you have questions look at the docs and ask in here
19:44 census well yes, i dont usually blindly copy.  but in this case i'm so wildly confused about the url
20:07 census but may i please ask what your suggestion is?
20:14 census do you mind please explaining my %args2 = (gsfn => 17, gsln => 12); ??  it does seem a bit random to me. and i'm not sure what i'd do to even start understanding what it adds . . .
20:24 deafferret did you run my demo program? Run and understand it before copy/pasting it.
20:25 deafferret that line of code simply creates a hash. Do you understand what hashes are and how to use them?
20:37 census no because i did nto realize that was a demo program
20:38 census in the meantime i went back to my old script (i hope with some of your suggestions included); it goes south with the say at lines 82-83
20:38 census http://scsys.co.uk:8002/231239?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
20:40 census_ joined #bioperl
20:41 census_ oy, my conection failed
20:49 deafferret census_: what's your question?
20:49 census_ why might @terms not get inputted into the my uri ?
20:50 deafferret why would it? which line of code were you expecting to have that effect?
20:52 census_ but putting $query into the my url in line 82-83
20:52 * deafferret nods
20:52 deafferret so here you need "" instead of ''
20:52 deafferret "" is interpolated, '' is not
20:53 census_ yes!!
20:53 census_ that is totally correct!!
20:54 census_ nt sure if that makes the url *correct* but at least plausible
21:00 census_ may i ask why the query terms might not be correctly appended although they are appended?
21:01 census_ i opened the url that the module printed int he command prompt window, and none of the query terms were effective
21:01 census_ i can tell that based on the screen
21:01 deafferret show me ALL your output
21:04 census_ i'm sorry this isn't pretty: http://scsys.co.uk:8002/231253
21:15 deafferret census_: so step 1 is fix those warnings. don't ignore them, they're trying to help you.
21:15 census_ yes i agree.  i could not figure out why those warnings were there;  so i've skipped them for now hoping i can get the url . . .
21:16 deafferret it says "line 68". you don't see anything strange on line 68?
21:16 deafferret it's frustrating when I feel like you're not even trying.
21:18 census_ i'm sorry about that one!  i don't know how i missed it
21:19 census_ i'm very sorry about that
21:19 deafferret it's ok.
21:25 census_ slight update: http://scsys.co.uk:8002/231284?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
21:26 census_ output: http://scsys.co.uk:8002/231285
21:26 deafferret census_++
21:26 deafferret so, another warning. do you see anything strange on line 85?
21:30 census_ yes and no
21:30 census_ yes because it is not good to do $my url twice
21:30 census_ no because i did it before to scrape this webpage and i did not get an error
21:42 census_ i've played aroudn the url a bit
21:43 census_ the problem--i think--is that the output is including some additional stuff like %2B before the gsln key, %3A before the value for it, and %20%2B afterwards and before the next key
21:43 census_ otherwise, the 2 urls are the same (or at least i've reduced them to similar terms)
21:46 census_ so i think that means the problem is in the uri_escape ?
21:57 census_ ok!! i nearly got it now :)
21:58 deafferret yay! code and output the next time you're stuck :)
22:08 census_ although it is not working :9
22:08 census_ the actual url and the ouputted urls look identical
22:08 census_ http://scsys.co.uk:8002/paste
22:08 census_ the first one is the url that i know works, which i generated from the site
22:08 census_ the second one is the one i'm getting returned . . .
22:11 census_ oops http://scsys.co.uk:8002/231286
22:15 deafferret so I'd add say Dumper(%args); and %args2 lines to see whats going on
22:15 census_ oops again!
22:15 census_ http://scsys.co.uk:8002/231301
22:16 census_ i see 1 difference.
22:21 census_ I GOT IT!!!!!!!
22:31 census_ although there is a BUT ....
22:33 census_ deafferret: may i please show you the updated code and ask about it?
22:33 census_ http://scsys.co.uk:8002/231302?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
22:33 census_ thank you so much for your suggestions!! THey totally helped, and I got it :)
22:35 deafferret what's your question?
22:35 census_ there are 2 but they are related
22:36 census_ i have one variable: birth place
22:36 census_ i need to create a .txt
22:36 census_ perl would go into that .txt
22:36 census_ and based on the value for the corresponding birth place, that parameter would get inserted into the url
22:36 census_ i do this after the args?
22:37 census_ but i need to do it in a way that it gets latched onto the $query or the @terms
23:24 census_ deafferret: may i ask you about retrieiving data from a .txt ?
23:25 deafferret census_: please just ask questions. don't ask to ask
23:27 census_ i'm not fully comfortable yet with the syntax for reading in data from a .txt
23:27 census_ i took at stab at lines 74-77 : http://scsys.co.uk:8002/231348?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
23:28 census_ what i'd like to do is: if $args{msbdy} equals a certain value, go to the .txt and pull out the corresponding # after the comma, and make that another variable.
23:31 deafferret you'll want to read ancestrylocationcodes.txt ONCE -- BEFORE your loop which starts on line 65. You need a while (<$b>) loop, like the two other places you read in files
23:32 deafferret you're reading in 2 files already. Add the 3rd.
23:38 census_ oh, so like i've had it already: http://scsys.co.uk:8002/231349?ln=on&amp​;tidy=on&amp;hl=on&amp;submit=Format+it!
23:40 census_ what i'd like to do is take the corresponding # from the string, and call it msbn
23:40 census_ and then join that msbn with the other terms on the query
23:44 deafferret yup
23:50 census_ how can i add it to the query as msbn ?
23:50 census_ like i have last name being added to the query as gsln because that is the key name

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