Perl 6 - the future is here, just unevenly distributed

IRC log for #rosettacode, 2013-10-19

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

All times shown according to UTC.

Time Nick Message
01:46 _ilbot joined #rosettacode
01:46 Topic for #rosettacode is now Rosetta Code: Coding in  (∞ - 1) languages ; http://irclog.perlgeek.de/rosettacode/today ; Pop  a tab and stick around! ; Account creation issues? Send an email with  your desired username to bureaucrats@rosettacode.org.
01:46 kpreid joined #rosettacode
02:35 RRR2 joined #rosettacode
02:45 Kumul joined #rosettacode
05:23 mwn3d joined #rosettacode
08:09 BenBE joined #rosettacode
09:28 shortcircuit joined #rosettacode
09:43 RRR2 joined #rosettacode
10:25 Koen_ joined #rosettacode
10:26 Koen_ joined #rosettacode
10:56 mikemol|zoe joined #rosettacode
10:59 bearophile joined #rosettacode
11:00 bearophile Hello
11:00 bearophile Now there's a D implementation of this Task:  http://rosettacode.org/wiki/​ASCII_art_diagram_converter
11:00 fedaykin "ASCII art diagram converter - Rosetta Code" http://rldn.net/56CJ
11:00 bearophile I hope some Scheme or Lisp programmer will create an entry in their language.
11:00 bearophile See you later.
11:01 Hypftier I'm still a little at a loss what that task is actually about. Parsing that diagram? Parsing data that corresponds to that diagram?
11:11 ttmrichter Looks like it's supposed to be parsing the diagram itself.
12:21 RRR2 joined #rosettacode
14:15 RRR2 joined #rosettacode
15:09 mwn3d1 joined #rosettacode
15:26 Koen_ joined #rosettacode
15:46 mwn3d joined #rosettacode
17:16 DannyNYC joined #rosettacode
17:17 DannyNYC Hi guys, I'm trying to solve a codility.com demo problem. The one about intersecting discs, anyone familiar with that?
17:17 fedaykin "Automated tests of programming skills. Assessment of software developers. Recruitment software. Codility"
17:20 DannyNYC All the discs are aligned in the X = 0 axis, so just Y can vary and the radius for each disc is stored in an array that my function receives. So to check if one discs intersects (has a common point) with another disc, I just thought of doing this formula:
17:21 DannyNYC if (radius_of_disc1 + radius_of_disc2 >= distance_between_the_center_of_the_discs) intersect == true;
17:22 DannyNYC I get a score of 75/100 by using that solution, but I get an arithmetic overflow error and a few other problems when they are using Big values int he array
17:24 DannyNYC I see that the solutions online are very different to mine, but I wanted to see if I could slightly improve by simple solution to get rid of the arithmetic overload problem
17:25 kpreid perhaps (distance - radius1 >= radius2)? provided the values are in range for signed numbers
17:25 kpreid and assuming we're talking integer, not float, arithmetic
17:26 DannyNYC yup its integer arightmetic
17:26 DannyNYC arithmetic
17:27 kpreid as another general suggestion (not for this particular comparison), you might find it useful to check which of two numbers is larger and do something oppositely, to avoid overflow in some cases
17:30 DannyNYC got ya, i was a ssuming that distance was always a disc with a greater value, got ya! thanks :)
17:33 kpreid oh, well, if you forgot the abs() in your distance computation that would be problematic, too. but that's not what I meant -- I mean doing the computation differently in a way which avoids overflow in each case but both cases are 'mathematically' the same (if you weren't using overflowing arithmetic)
17:39 DannyNYC I see, thanks a lot for the tips kpreid, very informative
17:40 kpreid oh, here's another random tip: sometimes you can have overflow but not care because the answer ends up being right anyway
17:41 kpreid that's not as common, but it's nifty when it works. and don't forget to explain in comments!
18:08 Kumul joined #rosettacode
19:03 BenBE joined #rosettacode
19:50 mwn3d1 joined #rosettacode
19:59 BenBE_ joined #rosettacode
20:04 BenBE joined #rosettacode
20:04 BenBE joined #rosettacode
20:07 RRR2 joined #rosettacode
21:35 utkarsh joined #rosettacode
21:39 RRR2 joined #rosettacode
22:14 mwn3d joined #rosettacode
23:16 mwn3d joined #rosettacode
23:22 mwn3d joined #rosettacode
23:32 mwn3d1 joined #rosettacode
23:33 mwn3d1 joined #rosettacode

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