Perl 6 - the future is here, just unevenly distributed

IRC log for #rosettacode, 2015-05-19

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

All times shown according to UTC.

Time Nick Message
00:01 eugenia :) Got it. thank you!
00:01 eugenia Haven't contributed before, so was feeling shy.
00:02 eugenia will give it a shot!
00:02 TimToady good luck!
00:02 eugenia thank you
00:02 TimToady what language are you contributing to?
00:03 TimToady well, I can just go read the log when you do :)
00:03 eugenia I found a broken example in C#, so I thought I'd start by fixing that.
00:03 TimToady sure, go for it
00:03 TimToady that's a good way to get into it
00:04 TimToady adding new entries is slightly tricker, but only a little
00:04 eugenia :)
00:06 pdurbin I wonder how many broken examples there are that aren't known to be broken. :)
00:08 eugenia hm, yeah
00:08 eugenia Could be interesting to go through and test them
00:09 TimToady depends on the language, likely
00:09 TimToady I know we have some of the RC entries in the Perl 6 test suite...
00:09 TimToady I'm sure there bitrotten ones out there too though
00:09 TimToady *there are
00:10 pdurbin Having them in a test suite sounds good.
00:12 eugenia Rosetta Tests :P Rosetta Code but for testing things
00:13 eugenia >_< except nobody would use it...sad...
00:13 eugenia could be fun, though
00:13 bb010g joined #rosettacode
00:26 pdurbin meh, I don't mind writing tests
00:27 pdurbin You'd probably almost need a test runner per language for Rosetta Tests.
00:27 eugenia :) Same, actually
00:27 eugenia Yeah. It would be interesting
00:28 eugenia Could be a new task
00:28 eugenia e.g., "Unit testing"
00:28 eugenia even if it's just a hello world sort of unit test
00:28 eugenia using the built-in testing library for the language.
00:29 eugenia (if one exists, otherwise, the conventional one)
00:43 pdurbin could be
01:30 Coderjoe_ joined #rosettacode
01:31 fTnN hello
01:31 fTnN :)
01:54 fTnN someone here does competitive programming?
01:55 fTnN i just wrote a code to solve a problem, but it is not right for all the test cases... but i cant see a case where it doesnt work...
01:57 eugenia I have in the past.
01:57 eugenia Which language?
01:57 eugenia I'd be happy to look.
01:57 fTnN c++
01:57 eugenia sure! can you point me to a gist or a codebase?
01:58 fTnN https://icpcarchive.ecs.bayl​or.edu/external/68/6828.pdf
01:58 fedaykin http://rldn.net/89j
01:58 fTnN this is the problem
01:59 eugenia Ok!
01:59 fTnN http://pastebin.com/csQLTBsk
01:59 fedaykin "[C++] 6828.cpp - Pastebin.com"
01:59 fTnN my code
02:00 fTnN hmm i think i need to optimize my choice
02:01 fTnN what if i have a case like this
02:01 fTnN i'm choosing a parter for a guys who is sitting at time zone 12
02:02 fTnN there is two persons closes to it
02:02 fTnN one in -11
02:02 eugenia I haven't run it yet
02:02 fTnN and one in 11
02:02 eugenia but are you passing the base case?
02:02 fTnN yeah
02:02 eugenia sweet!
02:04 eugenia So do you mean something like: 4 \n 12 -11 11 1
02:04 fTnN well i think first i should look for a partner to everyone who is in the same time zone; then i try to find the best combination
02:04 eugenia can you please show me a test case you aren't passing?
02:05 fTnN idk
02:05 fTnN the website doesnt give me that
02:05 eugenia Usually when I'm doing competitive stuff, I write a bunch of my own test cases for these :)
02:05 fTnN i think 4 12 -11 11 11 goes wrong
02:05 fTnN i'll test it
02:05 eugenia ok :)
02:06 eugenia I think your instinct for the best combo is right
02:06 fTnN yeah
02:06 fTnN it went right...
02:06 fTnN so no clue to what case is wrong haha
02:11 eugenia real quick, there's no documentation on this - do you have a test file you are running?
02:11 fTnN yeah
02:11 eugenia ok
02:12 fTnN the website i'm testing the code is this
02:12 fTnN https://icpcarchive.ecs.baylor.edu/index​.php?option=com_onlinejudge&amp;Itemid=8​&amp;page=show_problem&amp;problem=4840
02:12 fedaykin "ACM-ICPC Live Archive" http://rldn.net/5ph
02:12 fTnN and my tests cases are http://pastebin.com/1SYMdw9K
02:12 fedaykin "[Bash] testcases - Pastebin.com"
02:13 fTnN the answer should be 5 12 0 4 0 4 1 1
02:14 eugenia does it take a long time to run?
02:14 fTnN na
02:14 fTnN its wrong answer
02:14 eugenia ok, it seems to be hanging then...
02:14 fTnN :/
02:15 eugenia I'm running on the command line with the test file you provided.
02:16 eugenia but it just sort of hangs without doing anything. I'd love to help :/
02:16 fTnN yeah these cases goes right... but there is a case that doesnt work
02:16 eugenia I can't know that though.
02:16 eugenia because it's unfortunately not running for me.
02:16 fTnN oh
02:16 eugenia maybe it's stuck in a loop somewhere.
02:17 eugenia builds fine, just running with the test case
02:17 fTnN maybe it i the librarie
02:17 fTnN ahh i got it
02:17 eugenia ?
02:17 fTnN what is not running for you
02:17 fTnN my code?
02:17 eugenia correct.
02:18 eugenia it just sort of hangs
02:18 fTnN maybe its the llibraries
02:18 fTnN i'll change it wait
02:18 eugenia builds just fine :)
02:18 eugenia no errors there.
02:19 fTnN are you building with g++ right?
02:19 eugenia yup
02:19 fTnN like
02:19 fTnN g++ 6828.cpp -o  6828
02:20 fTnN then ./6828 <testcases
02:20 fTnN maybe there is a number missing
02:20 eugenia yeah, you're right, I think it was a number. thanks!
02:22 fTnN hmmm
02:23 fTnN i think i did something wrotn
02:23 fTnN on my second for
02:23 fTnN naa nvm
02:23 eugenia yeah you're passing the test cases.
02:23 eugenia I think you just have to come up with some nastier test cases
02:23 fTnN yeah thats what i'm looking for :)
02:24 fTnN do you have one in mind?
02:24 eugenia N can be up to 1000
02:24 eugenia I gaurantee they're going to throw 1000 numbers at you
02:24 fTnN yeah for sure
02:24 eugenia that's ACM ICPC's style :P
02:24 eugenia but you don't have a test case for that
02:24 eugenia so I think starting with bigger numbers might be a good diea
02:24 eugenia see how it plays with 20
02:24 eugenia then 100
02:24 eugenia then 200
02:24 fTnN na
02:25 fTnN it doesnt get closer even to long int
02:25 eugenia ?
02:25 eugenia I'm not sure what you meant by that
02:26 fTnN even if i get a test case that in everycase i add 12 in answer the answer should not pass 12*500
02:26 fTnN you know what i mean?
02:26 eugenia no
02:26 eugenia I meant in terms of N
02:26 eugenia you should have a larger input set
02:26 fTnN yeah there is 1000 persons
02:26 eugenia you are testing on toy data
02:26 eugenia but ACM ICPC isn't testing on toy data
02:27 fTnN the far a person can be from another is 12 hours right?
02:27 eugenia yes
02:27 eugenia but you can have 1000 persons
02:27 eugenia which means you could be getting a string of 1000 numbers.
02:27 fTnN if u make 500 couples with 12 hours the answer gonna be 12*500
02:27 fTnN that is the max value for answer
02:27 eugenia but what if it's not 12 distance
02:28 eugenia you can fail if your program takes too long, btw.
02:28 eugenia even if its output is correct.
02:28 eugenia So if you're taking longer than say, 60 seconds (because of all those nested loops), you could be correct but too slow.
02:28 fTnN yeah you are right. if that was the problem i would get time limit exceeded
02:28 eugenia yup.
02:28 fTnN not wrong answer
02:29 eugenia so test it
02:29 fTnN ok
02:29 eugenia I'm trying to think of some other corner cases for your question.
02:29 fTnN ok
02:29 fTnN thanks :D
02:32 eugenia np!
02:32 fTnN well i tested it and it went ok
02:33 fTnN that code is somehting about O(n*logn) right?
02:36 fTnN ahhh
02:36 fTnN i think i found my error
02:36 eugenia ?
02:36 eugenia ooo what is it
02:37 eugenia I mean, if N is 1000
02:37 eugenia your first for-loop will go through them all
02:37 fTnN the sort goes from the lower to the greater
02:37 eugenia mm
02:37 fTnN or that doest make diference at all
02:37 eugenia I don't know
02:38 eugenia it seems to be working fine with your other cases
02:38 eugenia I need to get back to work on my own project :) but good luck
02:41 fTnN well thanks for your time!
02:41 fTnN i'm glad to meet ppl like you here
02:41 fTnN hope we can talk more later :D
02:43 eugenia good luck with the competition, friend!
02:43 eugenia wishing you all the best.
03:42 Rainb joined #rosettacode
03:55 eugenia Question: is this too specific because of the example messages, or because of the use of the TcpListener / TcpClient?
03:55 eugenia http://rosettacode.org/wiki​/Distributed_programming#C.23
03:56 fedaykin "Distributed programming - Rosetta Code" http://rldn.net/62Z
03:57 eugenia :) I have a fix with TcpListener ready that's more general,  and I have one with sockets.
03:58 eugenia However, the description says raw sockets are not the preferred method.
09:40 lambdabot joined #rosettacode
09:51 lambdabot joined #rosettacode
10:31 Rainb joined #rosettacode
15:10 fTnN hey eu genia :D
15:42 TimToady joined #rosettacode
16:24 Architect joined #rosettacode
18:00 Eugenia[RCo] joined #rosettacode
18:00 Eugenia[RCo] Hello! http://rosettacode.org/wiki​/Distributed_programming#C.23 this example is tagged incorrect but I think I have a fix for it
18:00 fedaykin "Distributed programming - Rosetta Code" http://rldn.net/62Z
18:01 Eugenia[RCo] I asked this last night but had to log off, sorry. Just wanted to check if the issue with the existing answer was the use of TcpListener (versus say, raw sockets)
18:01 Eugenia[RCo] I have a version that is more general purpose with TcpListener, and I can write a version that's an HTTP server, whatever you feel is better!
18:01 Eugenia[RCo] even both :)

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