|
Thermopyle posted:I wonder if they're like a lot of really smart guys in professions that use programming rather than being in a profession about programming. Take the typical1 code written by a scientist...yuck. That tends to be the case. I have a friend who's doing some .NET work in order to automate some of his network administration tasks, and he doesn't care about the quality of the code as long as it does what he needs.
|
# ? Jul 2, 2012 15:25 |
|
|
# ? May 17, 2024 16:10 |
|
Thermopyle posted:Take the typical code written by a scientist...yuck.
|
# ? Jul 2, 2012 16:11 |
|
Thermopyle posted:I wonder if they're like a lot of really smart guys in professions that use programming rather than being in a profession about programming. Take the typical1 code written by a scientist...yuck.
|
# ? Jul 2, 2012 16:22 |
|
Plorkyeran posted:They focus on recruiting people who are good at functional programming and are willing to learn finance stuff, not finance people willing to learn to program, and their open source replacement for the OCaml standard library is fairly high quality. Not all companies will be alike. I doubt we'll ever see an actual reflection of coding practices vs. outcomes, but I bet there are a huge number of approaches that all work about as well as each other.
|
# ? Jul 2, 2012 16:38 |
|
beoba posted:Going by my profs in college, a lot of scientific code is pretty much a one-off whose useful lifespan ends once a paper gets published. There may occasionally be useful fragments that get copy/pasted later, but that's about it. And the wheel is reinvented (poorly) annually. Paid for by your tax dollars.
|
# ? Jul 2, 2012 16:38 |
|
Modern Pragmatist posted:And the wheel is reinvented (poorly) annually. Paid for by your tax dollars.
|
# ? Jul 2, 2012 16:48 |
|
beoba posted:Going by my profs in college, a lot of scientific code is pretty much a one-off whose useful lifespan ends once a paper gets published. There may occasionally be useful fragments that get copy/pasted later, but that's about it. There's a huge problem in science right now where it's extremely difficult to replicate others work because code isn't available or the exact environment the code was used in isn't documented well. This sort of thinking doesn't help that problem.
|
# ? Jul 2, 2012 17:36 |
|
Thermopyle posted:There's a huge problem in science right now where it's extremely difficult to replicate others work because code isn't available or the exact environment the code was used in isn't documented well. “In the good old days physicists repeated each other's experiments, just to be sure. Today they stick to FORTRAN, so that they can share each other's programs, bugs included.”
|
# ? Jul 2, 2012 18:33 |
|
Thermopyle posted:There's a huge problem in science right now where it's extremely difficult to replicate others work because code isn't available or the exact environment the code was used in isn't documented well. That's not totally bad, though, given the nature of science. The LHC has two very different detectors designed and built by two totally separate teams because it's not only good but necessary to have more than one viewpoint in order to confirm findings. Bugs in the One True Implementation Used By Everyone could produce erroneous results that don't get caught for years and then take even more years to work out of the working knowledge base.
|
# ? Jul 2, 2012 18:46 |
|
Munkeymon posted:That's not totally bad, though, given the nature of science. The LHC has two very different detectors designed and built by two totally separate teams because it's not only good but necessary to have more than one viewpoint in order to confirm findings. Bugs in the One True Implementation Used By Everyone could produce erroneous results that don't get caught for years and then take even more years to work out of the working knowledge base. Sure, but the solution to the problem isn't "gently caress it, let's make it as hard as possible to replicate", it's to make the code open.
|
# ? Jul 2, 2012 19:26 |
|
Thermopyle posted:Sure, but the solution to the problem isn't "gently caress it, let's make it as hard as possible to replicate", it's to make the code open. TBH that actually isn't the hard part - people have problems in the scientific community even if you give them the source code. Just making sure all the libraries/etc that you could have linked against are present and that your build environment is reproducible is pretty tough when you don't test how easy it is to replicate your build environment (and you don't really know what you're doing).
|
# ? Jul 2, 2012 20:51 |
|
Your academic worth and survival is a function of your publication record: publish or die. There is no incentive to produce nice code or cleaning it up and releasing it in public. As much as I try to produce clean code or systems, my codebase has been mangled from years of modifications and experiments that were due yesterday. The academic community needs to include code publishing standards as part of journal articles and conference proceedings. Next step is to also consider the code when accepting/rejecting a paper.
|
# ? Jul 3, 2012 12:09 |
|
Beef posted:Your academic worth and survival is a function of your publication record: publish or die. There is no incentive to produce nice code or cleaning it up and releasing it in public. As much as I try to produce clean code or systems, my codebase has been mangled from years of modifications and experiments that were due yesterday. As someone who has published an open source program linked to a publication, this isnt exactly true. Spending the time to make sure it will work for anyone with half a brain and a Python interpreter without any native libraries has paid huge dividends in citations and grant money. Although I agree more standards for releasing code in papers can only be a good thing. Edit: Especially since it would provide enough fodder for this thread for all of eternity. OnceIWasAnOstrich fucked around with this message at 14:10 on Jul 3, 2012 |
# ? Jul 3, 2012 13:56 |
|
Depends on how you get your grant money I guess. I'm much happier now at a lab that understands the need to code and do a good job at it. The group is getting some flak because our quantity of publications is not on par to other groups. Cleaned up code also encourages lab mates to pick up and continue the work. A common research platform can do wonders. Now I only need to find my notes that explain this horror: code:
Beef fucked around with this message at 14:40 on Jul 3, 2012 |
# ? Jul 3, 2012 14:33 |
|
IMGO the value of publishing code associated with a paper isn't so other people can use it, it's so that other people can inspect it and find bugs that could influence the results.
|
# ? Jul 3, 2012 14:37 |
|
code:
Please tell me I'm stupid and there's some bizarre case where this makes sense.
|
# ? Jul 3, 2012 16:36 |
|
Mr. Crow posted:
I frequently do that (in Ruby) to handle values that could be either a datetime or date.
|
# ? Jul 3, 2012 18:53 |
|
That discards the time portion of the DateTime. The comment seems dumb, but it's often a perfectly sensible thing to be doing.
|
# ? Jul 3, 2012 18:58 |
|
So I found out one of my ex-coworkers was using Django templates to do JSON formatting....code:
|
# ? Jul 3, 2012 19:54 |
|
ultramiraculous posted:one of my ex-coworkers Where are you headed next?
|
# ? Jul 3, 2012 20:05 |
|
Suspicious Dish posted:Where are you headed next? Nah, I mean he doesn't work here anymore
|
# ? Jul 3, 2012 22:25 |
|
Did the guy, like, EVER have a read through the django documentation? Considering how often serialisation is mentioned in it you'd think he would have noticed.
|
# ? Jul 3, 2012 23:31 |
|
php:<? //make sure this cron isn't already running exec("ps aux", $output); $num=0; foreach($output as $eachProg){ if(strpos($eachProg,"exportToFastpick.php")!==false){ $num++; } } if($num>1){ die; }?>
|
# ? Jul 4, 2012 01:38 |
|
quote:I don't know how to feel about this. At first I was thinking "Well, at least it gets the job done, even if it kind of sucks". Then I noticed that it was checking $num>1.
|
# ? Jul 4, 2012 01:48 |
|
Zamujasa posted:At first I was thinking "Well, at least it gets the job done, even if it kind of sucks". Then I noticed that it was checking $num>1. It works if you actually execute the correct unix commands: `ps aux | grep exportToFastpick.php | wc -l` !
|
# ? Jul 4, 2012 04:52 |
|
Zamujasa posted:At first I was thinking "Well, at least it gets the job done, even if it kind of sucks". Then I noticed that it was checking $num>1. The script counts itself, so $num > 1 is "correct." The real problem is that two instances can both decide that the other was started first and exit without doing whatever work they're supposed to do.
|
# ? Jul 4, 2012 04:57 |
|
I don't think this was posted here yet:quote:The general case Quoted from http://timetobleed.com/the-broken-promises-of-mrireeyarv/ I rather like this guy's style. E: code:
Munkeymon fucked around with this message at 05:34 on Jul 4, 2012 |
# ? Jul 4, 2012 05:10 |
|
For those of you who were curious like me, Java solves this problem with JNI by creating a temporary object registry before calling a native method, and adding GC visible references to that registry for every object passed to the native method or returned by a JNI function called by the native method.
|
# ? Jul 4, 2012 05:34 |
|
Munkeymon posted:I don't think this was posted here yet: Looking at that C code, it looks perfectly valid to me. What's the problem?
|
# ? Jul 4, 2012 05:43 |
|
Yeah, I don't understand either.quote:The return value of gzfile_read_raw_ensure (an address of a ruby object) is stored in rax. gzfile_read_raw_ensure looks like it returns a boolean (or int) to me . I understand that Ruby is doing conservative stack scanning to implement the GC, but otherwise you'd have to root/unroot every single object, which is super annoying and error-prone.
|
# ? Jul 4, 2012 05:54 |
|
gcc doesn't bother writing str to the stack because it is local to gzfile_read_raw_ensure() and doesn't escape. So str lives in %rax for the entire time gzfile_read_raw_ensure() is using it. In the AMD64 psABI, %rax is not preserved across function calls -- if the current function cares about its contents, it has to save the register itself. gzfile_read_raw_ensure() doesn't bother saving str to the stack when it starts calling other functions because by that time it's done with the variable and doesn't need it anymore. The only pointers to str that exist (those created by RSTRING_STR() and RSTRING_LEN()) point to within the RString object, not to the beginning of the object, and the GC doesn't considered internal pointers to be valid. Edit 1: OK, the Ruby VM does consider machine registers to be GC roots, but it does it in the most retarded way possible -- it calls setjmp() and assumes the resulting buffer contains the actual register values. Edit 2: Changed my explanation to actually be correct. Edit #1 is no longer relevant to this particular bug, but still amusing. pseudorandom name fucked around with this message at 06:56 on Jul 4, 2012 |
# ? Jul 4, 2012 06:01 |
|
Yeah, so the guy just doesn't understand conservative stack scanning. Given that the register is swamped before the GC is called, I don't see any other way around it, other than taking an explicit root. So it's not a fundamental problem with Ruby's object model, it's that one of GCC's optimizations makes the assumption that a program should not need to scan the stack and find valid results like that. You cannot compile such programs that do fancy (but completely valid) tricks with those optimizations.
|
# ? Jul 4, 2012 06:49 |
|
Apparently the Ruby GC isn't conservative enough and doesn't consider addresses pointing inside an object to be object references, otherwise %rax + 0x10 and %rax + 0x18 would be sufficient.
|
# ? Jul 4, 2012 07:01 |
|
tef posted:“In the good old days physicists repeated each other's experiments, just to be sure. Today they stick to FORTRAN, so that they can share each other's programs, bugs included.” Cool, but I think this is probably my favorite Dijkstra quote: EWD898 posted:These were internal complications. For a better understanding of the external pressures we had better view our topic for a moment in the wider context of science and society in general. Because computers appeared in a decade when faith in the progress and wholesomeness of science and technology was virtually unlimited, it might be wise to recall that, in view of its original objectives, mankind's scientific endeavours over, say, the last five centuries have been a spectacular failure. It's a pity he didn't live to hear Kurzweil talking about how the Singularity will make him immortal.
|
# ? Jul 4, 2012 09:16 |
|
Suspicious Dish posted:So it's not a fundamental problem with Ruby's object model, it's that one of GCC's optimizations makes the assumption that a program should not need to scan the stack and find valid results like that. You cannot compile such programs that do fancy (but completely valid) tricks with those optimizations. It's a pretty fundamental problem with Ruby if it effectively requires your entire stack to be declared volatile in order for it not to read from freed memory. I have a dream that one day people will code in C realising that they're effectively working in an abstract VM where any resemblance to the machine it's running on is purely coincidental.
|
# ? Jul 4, 2012 11:29 |
|
that awful man posted:Cool, but I think this is probably my favorite Dijkstra quote: Ray Kurzweil is perhaps the most talented masturbator to have ever lived, show some respect!
|
# ? Jul 4, 2012 17:37 |
|
Zombywuf posted:It's a pretty fundamental problem with Ruby if it effectively requires your entire stack to be declared volatile in order for it not to read from freed memory. Uh? It doesn't, that's the thing. The patch they submitted was a hack. The implementation of conservative stack scanning in Ruby's GC is incomplete. That's still not a problem with Ruby's object model. It's a fixable bug.
|
# ? Jul 4, 2012 17:53 |
|
Suspicious Dish posted:Uh? It doesn't, that's the thing. The patch they submitted was a hack. The implementation of conservative stack scanning in Ruby's GC is incomplete. Urgh, the real horror is trying to automagically garbage collect C.
|
# ? Jul 4, 2012 18:01 |
|
Zombywuf posted:Urgh, the real horror is trying to automagically garbage collect C. It's not trying to do that? Conservative stack scanning is about convenience, so that you don't have to explicitly root/unroot objects you're using from the C API. I don't know the Ruby API, so I'll use Mozilla's JSAPI instead: C++ code:
C++ code:
It's not an insane thing like the Boehm GC.
|
# ? Jul 4, 2012 18:27 |
|
|
# ? May 17, 2024 16:10 |
|
Boehm GC is insane now? The API is five functions and there's no add/remove root stuff like that. I guess I just don't know what you really mean.
|
# ? Jul 4, 2012 18:57 |