Camelia, the Perl 6 bug

IRC log for #rosettacode, 2012-01-16

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

All times shown according to UTC.

Time Nick Message
00:37 deltree_ joined #rosettacode
01:46 mwn3d_phone joined #rosettacode
01:59 mwn3d_phone joined #rosettacode
05:29 beta0x64 joined #rosettacode
05:29 beta0x64 Hello, anyone here?
05:31 mwn3d_phone Usually but we may not be quick to respond depending on our timezones. What's up?
05:32 sorear Please state your issue and we'll return your call as soon as possible.  *BEEP*
05:33 beta0x64 Hi there
05:33 beta0x64 I found an error in someone's code on the website
05:34 beta0x64 Basically, I rewrote the whole thing, making it OOP and completely solved. I needed to use a JAR, Apache Commons, to be exact.
05:34 beta0x64 Did I do this right? I couldn't find any rules or anything. http://rosettacode.org/wiki/R​educed_row_echelon_form#Java
05:34 fedaykin "Reduced row echelon form - Rosetta Code" http://rldn.net/7ewj
05:34 sorear We're just the moderators, we don't speak most of the languages or understand most of the problems
05:34 beta0x64 That's cool, I understand
05:34 beta0x64 there's far too many to know
05:35 beta0x64 but I know I know Java and I know this solution works with the example and more
05:36 sorear just skimmed your solution ... I have only two comments
05:36 beta0x64 It's long, it's Java
05:36 beta0x64 I know
05:36 sorear 1. it's not (I don't think it is) normal to sign your name on solutions
05:36 beta0x64 OK, I'll remove that then
05:36 sorear 2. Why are you using Fraction instead of language-provided doubles?
05:37 mwn3d_phone beta0x64: if someone's code is wrong then you can add "{{incorrect}}" to the top or fix it yourself. If you make a new solution I think it'd be best to add it in addition to the old one marking the old one incorrect if it does the task wrong.
05:37 beta0x64 Because of a rounding error involving 1/3, 2/3 etc.
05:37 beta0x64 Basically, where 3 should have been used, 2.99999999997 was used
05:38 sorear Even if you wouldn't do it in practice, if it makes the code easier to read it might be worth doing
05:38 sorear I dunno
05:38 beta0x64 sorear: if I wouldn't do what ?
05:38 mwn3d_phone If the old example still does things basically right but you take another approach then add yours in addition to the old one and try to explain the difference
05:38 beta0x64 mwn3d_phone, but the second example in my main() function does NOT work in the original
05:39 beta0x64 it is wrong. I tested it on my Ti-83+ Silver and several online matrix RREF calculators
05:40 mwn3d_phone For rounding errors like that I think it would be ok to just say that the rounding errors might occur in certain situations but the code was done to be more readable
05:40 beta0x64 Well, you simply get a wrong answer
05:40 mwn3d_phone I think people understand that there are problems with double math in general
05:40 beta0x64 I was planning on using their code for a Chemical Equation Balancer
05:40 beta0x64 However, I got a completely wrong answer based on their code
05:41 beta0x64 So, now I have solved it and then some.
05:41 mwn3d_phone Is 2.999999999997 "completely wrong" to you when the answer is 3?
05:41 beta0x64 No, see
05:41 beta0x64 2.999999999997 was the complement to a number
05:41 beta0x64 that threw off the whole matrix
05:42 beta0x64 where the final row should all be zeroes, you get straight 1's
05:42 beta0x64 and you don't have any free variables
05:43 mwn3d_phone Oh
05:43 beta0x64 Maybe I'm not explaining correctly. To RREF a matrix, you have to take each number above and below a pivot and multiply it by another row and a number to make it a complement (so the numbers above and below are 0)
05:43 beta0x64 well the complement they ended up with would need to be 1/3
05:43 mwn3d_phone Well if it gave super wrong answers like that then yeah get rid of it
05:43 beta0x64 well
05:43 beta0x64 some number + my pivot * some complement
05:43 beta0x64 so x + 1 * 1/x
05:43 beta0x64 where x is 3
05:43 beta0x64 and it eventually rounds out to 2.999999 whatever
05:44 beta0x64 throwing off the whole answer
05:44 mwn3d_phone Heh yeah I get the propagation
05:44 mwn3d_phone I just wanted to know how bad it was in the final answer
05:44 mwn3d_phone And it sounds like its bad
05:44 mwn3d_phone So its ok to replace it
05:44 beta0x64 it's just not included in the sample to test
05:44 beta0x64 plus now it is more readable in my opinion
05:45 beta0x64 before it was just one big function in one big class called RREF()
05:45 beta0x64 mind you, this was a python translation. but I am all about Java
05:45 beta0x64 so I fixed it
05:45 beta0x64 I would have liked to message the maintainer of the code to tell him "hey guy you had a big woops"
05:46 beta0x64 that's why I add my email
05:46 sorear It's... a wiki.
05:46 sorear You're supposed to just fix stuff when you see it.
05:46 beta0x64 sorear, I did
05:47 sorear You did the right thing
05:47 mwn3d_phone There's no real "maintainer" for anything except the actual website
05:47 beta0x64 well if you find something wrong with it
05:47 beta0x64 you can email me
05:47 beta0x64 and I will know what my code does, and I will fix it for you
05:47 mwn3d_phone Did you sign up for an account?
05:47 beta0x64 Yes
05:47 mwn3d_phone Ok
05:47 sorear You say that *now*
05:48 mwn3d_phone People will put things on your talk page
05:48 mwn3d_phone If they have problems
05:48 mwn3d_phone You'll get an email when that happens
05:48 sorear When I haven't touched a piece of code for four years, I tend to not want any more obligations on it
05:48 beta0x64 sorear, well I was hoping to use this in my own programs dealing with the oodles and oodles of applications of matrices
05:48 beta0x64 that way I can say to my potential employers one day, I reinvented the wheel but at least it was round and turned correctly this time. Also, spinners.
05:50 mwn3d_phone Just be aware of the implied licenses on RC
05:50 mwn3d_phone I don't know a damn thing about them but people seem to be really concerned about them
05:50 mwn3d_phone And for some reason there was a limited window of opportunity to change them before
05:51 beta0x64 Well, maybe I don't want to fix it then
05:53 mwn3d_phone I don't think the licenses restrict changes
05:53 mwn3d_phone Just uses
05:53 beta0x64 I simply want credit for the work that I did
05:53 mwn3d_phone You have it
05:53 mwn3d_phone Its in the history of the page
05:53 mwn3d_phone And in your user contributions list
05:53 beta0x64 I don't want money, I want people to re-use it if they have a use for it
05:53 mwn3d_phone Right
05:53 mwn3d_phone That's exactly what you have now
05:54 beta0x64 well then, I'll keep it this way
05:54 mwn3d_phone There's a "history" tab at the top of the page
05:54 mwn3d_phone That shows who made edits to the page, at what time, and gives diff options
05:55 mwn3d_phone Then there's a "my contributions" link on top of the page when you sign in
05:55 mwn3d_phone That shows all of your edits
05:55 mwn3d_phone Just like wikipedia
05:56 beta0x64 alright, well that's fine
05:57 beta0x64 I'm going to post it on my website probably then I'll do some more work with the chemical question thing
05:57 beta0x64 equation*
05:57 mwn3d_phone And if you want to suggest extra test cases for that task you can try adding a section to the talk page for the task
05:57 beta0x64 I guess I should
05:57 mwn3d_phone To do that just click the little plus sign at the top of the talk page there
05:57 beta0x64 I just wanted to fix that particular code. Maybe all the other code works. Maybe it doesn't, but it's not skin off my back
06:00 mwn3d_phone It might help the overall quality of the task though
06:00 beta0x64 sigh
06:00 beta0x64 I hate being a team player, fine
06:00 mwn3d_phone Heh
06:02 beta0x64 oh geez you're gonna need solutions too
06:02 beta0x64 I guess I can just run my program :P
06:03 mwn3d_phone Let the robot do it!
06:03 mwn3d_phone (And by "robot" I mean "your program")
06:04 beta0x64 I just like writing code :(
06:04 * beta0x64 is a big ol' nerd.
06:06 mwn3d_phone Well you can participate as much or as little as you like. Just respect other people.
06:06 mwn3d_phone And if you have ideas we would like to hear about them and discuss them.
06:06 eMBee if you explain what was wrong with the old java version on the talk page that's about all that's needed.  others can then pick up the hint to check their examples too.
06:08 beta0x64 I find it sad that I could not find any code to do an RREF
06:08 beta0x64 I couldn't even find any good pseudocode that anyone agreed on. The pseudocode given at the top of the article is not the pseudocode in the wikipedia article now. and even the wikipedia article has a comment saying ("this is a bug blah blah")
06:08 beta0x64 I seriously whipped out my textbook from last semester and wrote out steps 1-5
06:09 eMBee you are not the first one to solve a task for work, that's perfectly fine :-)
06:09 eMBee interesting
06:09 beta0x64 solve a task for work?
06:09 beta0x64 I am a cashier unfortunately :(
06:10 eMBee oh
06:10 beta0x64 yea
06:10 beta0x64 I was just doing this because I like matrices
06:10 eMBee ah, i misread the potential employer one day
06:10 eMBee sounded like you were talking about current work
06:11 beta0x64 I mean, I would have really liked to just grab this RREF code from Rosetta (the only place I could find with RREF) and plug it into my chemical equation balancer but after a few chemical equations I noticed I was getting wrong answers. It wasn't me; it was the RREF code.
06:12 beta0x64 Unfortunately, Jama and even Apache Commons Linear Algebra does not have RREF or even most basic matrix operations
06:12 beta0x64 which is odd...
06:12 beta0x64 it has more advanced things like decompositions
06:12 beta0x64 I just want to do a gaussian-jordan elimination
06:12 beta0x64 nooo
06:12 beta0x64 can't do that
06:13 beta0x64 gotta do a LU Decomposition -_-
06:15 mwn3d_phone Oddly enough I think we have that task too
06:15 mwn3d_phone Let's try it...[[LU decomposition]]
06:15 fedaykin http://rosettacode.org/wiki/LU_decomposition
06:15 mwn3d_phone Yep
06:16 beta0x64 see but Jama and Apache Commons both can do that
06:16 mwn3d_phone Library solutions are just as acceptable as scratch solutions in most cases
06:16 beta0x64 I want to cover all the basic crap that's useful for, let's say, balancing chemical equations or describing the general flow pattern
06:16 beta0x64 of a network
06:16 mwn3d_phone We usually put them along side the scratch ones
06:17 beta0x64 http://commons.apache.org/​math/userguide/linear.html
06:17 fedaykin "Math - The Commons Math User Guide - Linear Algebra" http://rldn.net/95y
06:17 beta0x64 it would be so simple :(
06:24 beta0x64 wait wait
06:24 beta0x64 can I put this on github?
06:27 mwn3d_phone As far as I know you can do whatever. mikemol what do you think?
06:27 mwn3d_phone (He runs the site...he knows more about the license restrictions)
06:28 mwn3d_phone Its also 130AM where he is (and where I am). He might be in bed.
06:29 mwn3d_phone My gut feeling is that since the code is yours anyway you're good to go with whatever you want to do with it.
06:31 mischi joined #rosettacode
06:42 eMBee beta0x64: the code you wrote is your own, you can publish it any way you want
06:42 eMBee if you use other peoples code from RC then you need to follow the GFDL 1.2 license
06:44 eMBee unless there is an exception. if you publish your code on github, you could add a link to that from the RC solution so people who want to use it can find your version
07:03 GlitchMr joined #rosettacode
08:56 mischi joined #rosettacode
09:03 mwn3d_phone1 joined #rosettacode
09:52 GlitchMr42 joined #rosettacode
10:03 Hypftier_ joined #rosettacode
10:05 crc_ joined #rosettacode
10:07 mbishop_ joined #rosettacode
10:11 FireFly joined #rosettacode
11:17 mikemol beta0x64, mwn3d_phone1: eMBee stated the scenario correctly.
11:17 mikemol Re 'double' vs 'float' ... I haven't looked at the code in question, but is it Java? Didn't they add generics support recently?
11:17 mikemol er. double vs fraction.
12:26 mwn3d_phone joined #rosettacode
12:55 mischi joined #rosettacode
14:38 mwn3d_phone mikemol: generics wouldn't really help there. The rounding errors happen in doubles too. I'm pretty sure the original was using doubles.
14:39 mikemol mwn3d_phone: I assumed generics behave like C++ templates; the type is specified where a function is called, rather than in the function body.
14:39 mwn3d_phone Yeah that's pretty much how they work
14:39 mikemol So you'd call the function specifying 'double' or 'fraction', depending on the precision you demanded.
14:39 mwn3d_phone But no type would really help there
14:39 mwn3d_phone Since the original type was a primitive type
14:40 mwn3d_phone If the code has "a + b" in it you're stuck with primitives
14:40 mwn3d_phone No operator overloading
14:40 mikemol oh
14:40 mwn3d_phone And there's no arbitrary precision primitive
14:43 mwn3d_phone also generics don't work on primitive types. So to use doubles or floats you'd have to use the wrapper objects but again you lose the ability to say "a + b" in the function. You'd have to have something like "a.add(b)" and you'd need the right type restrictions and it'd get really complicated.
14:43 mwn3d_phone Basically generics in java aren't the same as generics in C++
14:44 mwn3d_phone Because as far as I can tell from internet comments about the implementation...java did them wrong
14:44 mwn3d_phone For the sake of compatability with old code
14:45 mwn3d_phone I came on to the java scene after generics were in place so I don't really know why they're wrong
14:46 mikemol because they're not like C++'s templates. :P
14:47 mikemol Well, I won't defend the C++ template syntax. I don't know any other, but I've seen enough people complain about it.
14:51 mwn3d_phone Yeah I think it comes down to personal preference. Though it would be nice to be able to use primitives in generics.
14:59 * Hypftier hands mwn3d_phone C# :P
15:00 mwn3d_phone :p
16:10 bleakgadfly joined #rosettacode
16:59 kpreid joined #rosettacode
17:35 GlitchMr42 joined #rosettacode
18:15 mwn3d_phone1 joined #rosettacode
18:18 mwn3d_phone joined #rosettacode
18:22 mwn3d_phone1 joined #rosettacode
18:52 mwn3d_phone joined #rosettacode
19:05 mwn3d_phone1 joined #rosettacode
19:06 GlitchMr joined #rosettacode
19:21 robbrit joined #rosettacode
19:32 nimdAHK joined #rosettacode
19:33 nimdAHK hey mikemol, are you there?
19:33 mikemol yeah
19:33 nimdAHK I've been uploading LabVIEW solutions, but I'm afraid that I might be doing it wrong...
19:33 mikemol how so?
19:34 nimdAHK LabVIEW is entirely graphical, so I've been using the third-party "code capture tool"
19:34 nimdAHK but of course you can't simply download-and-run
19:34 nimdAHK you would need to type it in by hand
19:34 nimdAHK furthermore, the Case structure hides certain code from view
19:34 nimdAHK so I would need to upload multiple screenshots of the same code.
19:35 mikemol Unfortunately, there is no good solution for LabVIEW. What do the saved labview files look like, compressed?
19:35 mikemol e.g. with 7zip?
19:35 mikemol I know they can be big uncompressed.
19:35 nimdAHK uncompressed, the Animation.vi is 10KB
19:35 nimdAHK let me compress it
19:35 nimdAHK LZMA2, Ultra?
19:35 mikemol Only 10KB? Bah. that's nowhere near as large as I thought.
19:36 nimdAHK it compressed down to 8KB
19:36 nimdAHK but... that's a small code
19:36 mikemol yeah, and most of that's going to be the compression header.
19:36 mikemol At least for the really heavy compressors.
19:36 nimdAHK recursive solutions generally require an icon included
19:37 nimdAHK so my recursive Factorial subVI is 25 KB
19:37 nimdAHK Here, look at this one: http://rosettacode.org/wik​i/Repeat_a_string#LabVIEW
19:37 mikemol nimdAHK: I'd suggest using the 'file upload' capability of MW, and linking to that file next to your screenshots.
19:37 fedaykin "Repeat a string - Rosetta Code" http://rldn.net/13cBZ
19:38 nimdAHK can I upload vi's?
19:38 mikemol Use compressors like zip, gzip or 7z to try to keep the file size under 50-100KB.
19:38 nimdAHK Permitted file types: png, gif, jpeg, svg.
19:39 mikemol I'll have to work on that. I can add more supported file types, but I want to enable the right ones. :)
19:39 mikemol I wish MW were more inspective than simply matching extensions.
19:39 nimdAHK I would be fine with uploading .vi's alongside the screenshots
19:40 nimdAHK p.s., LabVIEW is really cool
19:40 nimdAHK I acquired a license through the FIRST Robotics program
19:40 mikemol Cool
19:41 nimdAHK LabVIEW only had 6 solutions before I started, so there's scores of tasks I can solve
19:41 nimdAHK I just wanted to make sure I was doing it correctly, since LabVIEW is unconventional.
19:41 mikemol You're not the first person to start pushing LabVIEW on RC.
19:42 nimdAHK The other person only solved 6 tasks?
19:42 mikemol We had problems coming up with a good presentation format.
19:42 nimdAHK mm...
19:42 mikemol One way or another, LabVIEW is going to be a bit unconventional in how it's viewed and edited on the site.
19:42 nimdAHK I seem to recall some LabVIEW feature where the code is embedded inside a png file
19:42 nimdAHK that would be optimal
19:43 mikemol Hey, if that's supported, then by all means go that route!
19:43 nimdAHK oh yeah, re: upload problem -- I just set Chrome to block rosettacode from using Javascript
19:43 nimdAHK and it works perfectly
19:43 nimdAHK OOH! http://zone.ni.com/devzone/cda/tut/p/id/9330
19:43 fedaykin "Use VI Snippet to Store and Share Reusable Code Sections - Developer Zone - National Instruments"
19:43 mikemol That shouldn't be necessary; I disabled AJAX uploading serverside a while ago.
19:43 nimdAHK they're called snippets
19:45 nimdAHK hmmm... I'll solve the FizzBuzz task and make a snippet
19:48 nimdAHK The D looks good
19:57 nimdAHK LabVIEW snippets upload fine
19:57 nimdAHK The FizzBuzz one is 21KB
19:59 FireFly joined #rosettacode
20:00 nimdAHK hey mikemol, one more question
20:00 nimdAHK How does this sound? "The following image is a [http://zone.ni.com/devzone/cda/tut/p/id/9330 VI Snippet]. You can drag-and-drop it directly from your browser onto the block diagram to run it."
20:01 nimdAHK perhaps the "directly from your browser" is incorrect; seems only IE is supported.
20:02 mikemol nimdAHK: I decline having an opinion at this time.
20:02 nimdAHK perhaps "The following image is a [http://zone.ni.com/devzone/cda/tut/p/id/9330 VI Snippet]. You can drag-and-drop it from Windows Explorer onto the block diagram to run it.""
20:02 mikemol I suggest you put the text up, and if anyone has better ideas, they'll change it or put something in a talk page (yours or the page's) somewhere.
20:02 nimdAHK mikemol: should I put it on every solution?
20:02 mikemol It sounds like something appropriately cookie-cutter, yeah.
20:03 nimdAHK OK.
20:03 mikemol Might even make sense to drop the text in a template, and transclude that.
20:03 nimdAHK how would I do that?
20:03 mikemol Edit [[Template:VI snippet]], and then put {{VI snippet}} in various places.
20:04 fedaykin http://rosettacode.org/wiki/Template:VI_snippet (Doesn't exist.)
20:04 nimdAHK hey, it works!
20:04 nimdAHK I downloaded it and dropped it.
20:04 nimdAHK OK, I'll do that.
20:07 nimdAHK http://rosettacode.org/wiki/FizzBuzz#LabVIEW
20:07 nimdAHK beautiful. Thanks for the help.
20:07 fedaykin "FizzBuzz - Rosetta Code"
20:15 GlitchMr42 joined #rosettacode
20:39 mwn3d_phone joined #rosettacode
21:11 robbrit left #rosettacode
21:26 pat_js joined #rosettacode
22:24 mwn3d_phone1 joined #rosettacode
23:17 bleakgadfly joined #rosettacode
23:19 mwn3d_phone joined #rosettacode

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