|
MononcQc posted:Erlang only got SMP support in 2006 (R12B, if memory serves me right). The way it was done was by having a scheduler represented as an OS thread Aside: couldn't you just run one erlang vm per core before this to get smp like behaviour?
|
# ? Feb 2, 2010 12:56 |
|
|
# ? Apr 27, 2024 21:53 |
|
tef posted:Aside: couldn't you just run one erlang vm per core before this to get smp like behaviour? Yes. That was a way to gain parallelism from distribution. Now that you mention it, it could have been an acceptable alternative. The only problem is that you have useless overhead when needing to serialize every Erlang term into its binary representation and then deserialize it on the other side, on top of the memory overhead for multiple runtimes. Might not be THAT bad given Erlang is not really the best choice for CPU-bound tasks anyway.
|
# ? Feb 2, 2010 16:03 |
|
I'm sure this is a classic, though I never actually came across this gem before today:code:
|
# ? Feb 2, 2010 17:16 |
|
Parantumaton posted:I feel that I've put way too much effort on this whole debacle. Argh. Never before have I seen such effort put into completely missing the point. Nor such a hilarious misuse of a trendline.
|
# ? Feb 2, 2010 17:25 |
|
A complex exponential would have given a better fit to the data.
|
# ? Feb 2, 2010 18:04 |
|
Zombywuf posted:Never before have I seen such effort put into completely missing the point. Nor such a hilarious misuse of a trendline. Point was apparently missed, trendline was misused on purpose - it was a statistic, not an analysis. Apparently I should've cashed in and added the sarcmark to the graph's title to highlight that.
|
# ? Feb 2, 2010 18:25 |
|
nerdfish posted:This is a PhD student though, which leaves me a bit confused There's no guarantee that someone who is a Ph.D. student in computer science knows anything about real programming. (HCI students, I'm looking at you. ) I'm not going to touch the usual argument about how much programming ability is "right" or "appropriate" to be expected for someone in "computer science", but the coding abilities of CS grad students run the entire spectrum from "code wizard" to "what's a pointer". Sadly, the same goes for the professors.
|
# ? Feb 2, 2010 20:10 |
|
This is especially true in CS departments that are really just an offshoot of the math department, run by math professors. They'll show you proofs of algorithms all day long, but lord help you if one of them discovers a compiler. See: Most "AI" researchers.
|
# ? Feb 2, 2010 20:35 |
|
So, I don't know much about programming, but the boss heard I knew a bit and asked me to take a look at this php/sql inventory management system they've been having problems with. Apparently, the contractor they've got doing it is having trouble actually fixing bugs and was wondering if I might offer any insight.code:
Edit: And this: code:
JasonV fucked around with this message at 00:54 on Feb 3, 2010 |
# ? Feb 3, 2010 00:13 |
|
tef posted:Aside: couldn't you just run one erlang vm per core before this to get smp like behaviour? Yes, but Erlang does dirty tricks with shared memory that don't work with multiple vm processes.
|
# ? Feb 3, 2010 10:03 |
|
the talent deficit posted:Yes, but Erlang does dirty tricks with shared memory that don't work with multiple vm processes. AFAIK, the only shared memory you have is for atoms, which are stored in a global table that doesn't get garbage collected (this is being worked on by the Ericsson guys at the moment) and binary data over a certain size. The rest is never shared across other processes (even ets tables) because it would require some kind of stop-the-world garbage collection that would gently caress up the soft real-time requirements of the language. Shared-nothing allows them to individually GC processes when they're done or after they hit a certain size without messing with the rest of the world. What dirty tricks did you have in mind? E: maybe it's time to start a new Erlang megathread
|
# ? Feb 3, 2010 15:08 |
|
MononcQc posted:E: maybe it's time to start a new Erlang megathread
|
# ? Feb 3, 2010 15:30 |
|
MononcQc posted:AFAIK, the only shared memory you have is for atoms, which are stored in a global table that doesn't get garbage collected (this is being worked on by the Ericsson guys at the moment) and binary data over a certain size. The rest is never shared across other processes (even ets tables) because it would require some kind of stop-the-world garbage collection that would gently caress up the soft real-time requirements of the language. Shared-nothing allows them to individually GC processes when they're done or after they hit a certain size without messing with the rest of the world. Messages are just a pointer to the sending process' heap. If the message is just matched against, there is no copy. Even when there is a copy, it's often deferred until GC time. Exceptions exist, as always. Warning, this is as of R11, things are probably different by now.
|
# ? Feb 3, 2010 22:36 |
|
JasonV posted:Edit: And this: Just don't actually cat that file, or you'll probably invoke some tentacled beastie from the nether realms attracted by the rhythm of the 'Ifs'. I'll bet it's a procedural horror. Are they paying the contractor in office supplies?
|
# ? Feb 4, 2010 06:19 |
|
JasonV posted:So, I don't know much about programming, but the boss heard I knew a bit and asked me to take a look at this php/sql inventory management system they've been having problems with. Apparently, the contractor they've got doing it is having trouble actually fixing bugs and was wondering if I might offer any insight. you forgot one essential command: code:
|
# ? Feb 4, 2010 07:34 |
|
JasonV posted:
http://betterthangrep.com/ (okay so it doesn't provide any improvements in this particular use-case, but...)
|
# ? Feb 4, 2010 09:17 |
|
Supervillin posted:Saw this gem from a coworker today. IPs have been changed to protect the innocent. Spacing modified to hopefully protect the innocent forum tables. See? PHP doesn't need exceptions!
|
# ? Feb 4, 2010 13:24 |
|
Something appears to be missing.
|
# ? Feb 4, 2010 22:57 |
|
I just figured it was the worlds only example of good php code.
|
# ? Feb 5, 2010 01:39 |
|
geetee posted:Something appears to be missing. he just cut out the long part of the post...
|
# ? Feb 5, 2010 05:58 |
|
Ugh, this is what happens when you spend all day dealing with horrors at work. Sorry for being retarded.
|
# ? Feb 6, 2010 02:20 |
|
A couple of years ago I started making a compiler for a toy language. I ended up getting busy, so it got pushed onto the back-back-back burner. Usually that's where my projects go to die, but I really liked some of my ideas and wanted something to come of it. This weekend I finally found the time and the inspiration. I opened up the code and... hey, it's pretty good! It's well-commented and well-designed. All of my missing AST visitors are generating errors so I know exactly where I left off. I'll have no problem jumping back in and getting to work. Unfortunately, I lost the documentation for the language.
|
# ? Feb 6, 2010 06:05 |
|
This is more of an intentional comical horror but pretty cool to look at: Calculating pi to an arbitrary number of digits, in C#
|
# ? Feb 6, 2010 20:28 |
|
RedZone posted:This is more of an intentional comical horror but pretty cool to look at: Calculating pi to an arbitrary number of digits, in C# code:
|
# ? Feb 6, 2010 20:39 |
|
Null Pointer posted:Unfortunately, I lost the documentation for the language. This is why I put docs in source control with the code.
|
# ? Feb 6, 2010 23:01 |
|
This, it isn't terrible but it just unnerves me.code:
|
# ? Feb 7, 2010 01:40 |
|
Yakattak posted:This, it isn't terrible but it just unnerves me. This is considered safer in languages (like C and Objective-C, assuming by your example), where any expression is allowed inside an if clause. It's meant to prevent errors caused by accidentally using = instead of ==: code:
Technically it isn't necessary if the operator is !=, but the author is just doing it for symmetry's sake.
|
# ? Feb 7, 2010 01:44 |
|
Yakattak posted:In terms of working, that works perfectly, readability it's an abomination. Why does it have to be backwards? When did someone ever learn that way? I always read them as "If object is null" not "If nil is not object". I know that in Java, when I'm comparing strings I often type something like code:
code:
code:
|
# ? Feb 7, 2010 02:00 |
|
Ah java, was my_str == "foobar" really that hard.
|
# ? Feb 7, 2010 02:23 |
|
king_kilr posted:Ah java, was my_str == "foobar" really that hard. Yeah, considering that they overloaded + as a special case for Strings, I don't see why they didn't overload == and != as well. They can't very well argue some kind of purity when it comes to operators.
|
# ? Feb 7, 2010 02:34 |
|
king_kilr posted:Ah java, was my_str == "foobar" really that hard. Within the constraints of Java's lovely type system, making that the equivalent of "my_str.equals( "foobar" )" would just make problems worse.
|
# ? Feb 7, 2010 02:35 |
|
king_kilr posted:Ah java, was my_str == "foobar" really that hard. Operator overloading would be a godsend in Java, even if it would be limited to a very small subset of items. For example I've hit a snag where I was porting a legacy project to a new in-house library originally extracted from the said legacy project and while the class names were actually the same, packages and some methods were not so I had to create an adapter between the OldImportantThing and NewImportantThing. The problem was that I could only take the adapter so far without operator overloading, parts of the legacy application relied on the fact that ImportantThingProvider contained only a few of these ImportantThings at any given time so one could just compare the two by if(importantOne == importantTwo) { doStuffWith(importantOne); } . With the adapter the actual ImportantThing was still the same but since Adapter instances were created in everywhere where they were needed instead of the ImportantThingProvider which now was in the new library that obviously didn't work at all. Related refactorings were made but since the legacy application is partly Reflection-based there's no knowing if some "hidden" part still uses direct comparison instead of .equals(). So far we haven't seen any issues but we'll see what comes up in the future...
|
# ? Feb 7, 2010 10:40 |
|
Flobbster posted:This is considered safer in languages (like C and Objective-C, assuming by your example), where any expression is allowed inside an if clause. It's meant to prevent errors caused by accidentally using = instead of ==: What compilers these days don't warn about assignment in a conditional?
|
# ? Feb 7, 2010 18:48 |
|
Putting constants first is getting pretty close to jumping at your own shadow and biting the heads off chickens territory
|
# ? Feb 7, 2010 18:52 |
|
ehnus posted:What compilers these days don't warn about assignment in a conditional? Objective-C using gcc (since that was the example the OP used) doesn't seem to issue a warning, since the following is a very common initialization pattern: code:
|
# ? Feb 7, 2010 23:28 |
|
That's using -Wall ?
|
# ? Feb 7, 2010 23:43 |
|
gcc doesn't even have an option to warn about it. If such an option did exist, there's no way it'd be in -Wall, as that only includes warnings about things which are commonly considered objectionable and trivial to fix. [e] Oh, I'm stupid and looked at completely the wrong thing. Plorkyeran fucked around with this message at 00:43 on Feb 8, 2010 |
# ? Feb 8, 2010 00:21 |
|
Otto Skorzeny posted:That's using -Wall ? Ah, looks like -Wall gets it: code:
quote:Test2.m: In function '-[TestObject init]': Maybe I ought to start using -Wall Not for this, but all the other good reasons.
|
# ? Feb 8, 2010 00:23 |
|
code:
test.cpp: In function ‘int main(int, char**)’: test.cpp:4: warning: suggest parentheses around assignment used as truth value [code] That's gcc 4.4 if it makes any difference.
|
# ? Feb 8, 2010 00:25 |
|
|
# ? Apr 27, 2024 21:53 |
|
Not using -Wall is the real coding horror
|
# ? Feb 8, 2010 01:12 |