archived stringclasses 2
values | author stringlengths 3 20 | author_fullname stringlengths 4 12 ⌀ | body stringlengths 0 22.5k | comment_type stringclasses 1
value | controversiality stringclasses 2
values | created_utc stringlengths 10 10 | edited stringlengths 4 12 | gilded stringclasses 7
values | id stringlengths 1 7 | link_id stringlengths 7 10 | locked stringclasses 2
values | name stringlengths 4 10 ⌀ | parent_id stringlengths 5 10 | permalink stringlengths 41 91 ⌀ | retrieved_on stringlengths 10 10 ⌀ | score stringlengths 1 4 | subreddit_id stringclasses 1
value | subreddit_name_prefixed stringclasses 1
value | subreddit_type stringclasses 1
value | total_awards_received stringclasses 19
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
True | kenkirou | null | #define while if | null | 0 | 1318924562 | False | 0 | c2se74v | t3_lfsfk | null | t1_c2se74v | t1_c2sdbrp | null | 1428192153 | 14 | t5_2fwo | null | null | null |
True | AReallyGoodName | null | Well I guess it should have some maximum considering rand() ultimately only has a limited number of states it can ever be in although it could still be exceptionally high. If there's even as little as 64bits worth of state behind the scenes of the rand() function then that's enough to allow for potential very long chai... | null | 0 | 1318924615 | False | 0 | c2se78i | t3_lfsfk | null | t1_c2se78i | t1_c2se4f0 | null | 1427747419 | 2 | t5_2fwo | null | null | null |
True | runedk | null | Please distinguish between constructor injection and field/method injection. The former is a bad name for a good design. The latter is a painfully fragile design where the programmer is using (semi)global variables, just not being honest about it.
Concluding that DI in itself is beneficial for testing is wrong. Modula... | null | 0 | 1318924787 | False | 0 | c2se7m6 | t3_lf1px | null | t1_c2se7m6 | t1_c2s661q | null | 1427747418 | 1 | t5_2fwo | null | null | null |
True | urmyheartBeatStopR | null | From what I've heard, I'm probably wrong, but functional languages doesn't have mutable state, especially something as purely functional such as Haskell, so doing IO is painful? All their stuff are immutable.
Please correct me if I'm wrong, and examples would be nice. | null | 0 | 1318924832 | False | 0 | c2se7q6 | t3_lfm1k | null | t1_c2se7q6 | t1_c2sacmj | null | 1427747419 | 0 | t5_2fwo | null | null | null |
True | bloodredsun | null | Having a static factory in a class breaks object encapsulation since you are effectively referring to some global state variable. This is highlighted when you want to mock the object that you get from a factory, either you have to create delegate methods for all your static calls or it's byte code manipulation or simil... | null | 0 | 1318924854 | False | 0 | c2se7ry | t3_lf1px | null | t1_c2se7ry | t1_c2sa4qd | null | 1427747419 | 2 | t5_2fwo | null | null | null |
True | snakepants | null | Thanks for the info! I tried adding strict fields before (that's the * syntax right) but I didn't see large gains so I gave up. I also tried the LLVM backend which was slightly faster.
> shading (and casting child rays) could be deferred until you have the closest hit.
I agree. But isn't the whole point of a funct... | null | 0 | 1318924877 | False | 0 | c2se7to | t3_lfm1k | null | t1_c2se7to | t1_c2sdskx | null | 1427747423 | 5 | t5_2fwo | null | null | null |
True | adrianmonk | null | > If you've written a Haskell program that runs, it's highly likely to be a correct solution
I have heard claims like this before, and, frankly, they leave me dumbfounded.
What's worse, every time I've heard this sort of statement made about Haskell, it is stated without further support, as if it is uncontroversia... | null | 0 | 1318924945 | False | 0 | c2se7zn | t3_lfm1k | null | t1_c2se7zn | t3_lfm1k | null | 1427747421 | 44 | t5_2fwo | null | null | null |
True | bo1024 | null | What do you recommend? Is boost's random number generator good enough? | null | 0 | 1318924949 | False | 0 | c2se7zz | t3_lfsfk | null | t1_c2se7zz | t1_c2sds29 | null | 1427747421 | 2 | t5_2fwo | null | null | null |
True | doublereedkurt | null | Correction accepted :-)
I only wish my co-workers made the same distinction as you do between scripting languages and dynamically typed interpreted languages. | null | 0 | 1318925107 | False | 0 | c2se8cv | t3_lde7w | null | t1_c2se8cv | t1_c2s6plt | null | 1427747426 | 2 | t5_2fwo | null | null | null |
True | runedk | null | We also use Mockito in our projects and find it incredibly valuable! Which is why I pointed out that interface extraction is not required for mocking:
> Being artificially forced to extract interfaces for every one of your classes is not a benefit. And doing so is not a prerequisite for mocking an object for a unit... | null | 0 | 1318925216 | False | 0 | c2se8k9 | t3_lf1px | null | t1_c2se8k9 | t1_c2s6mrs | null | 1427747428 | 1 | t5_2fwo | null | null | null |
True | lpsmith | null | >> you need to add strictness annotations to your Vec3 record and compile with -funbox-strict-fields, for starters.
Sure, that may sound like greek, but consider some alternatives:
>> You need to add a bitmap index on this column and vacuum your tables
>And people wonder why SQL is hard to learn or ... | null | 0 | 1318925280 | True | 0 | c2se8p2 | t3_lfm1k | null | t1_c2se8p2 | t1_c2sdvkq | null | 1427747429 | 24 | t5_2fwo | null | null | null |
True | eric_t | null | I don't see how this can be called plagiarism, when I clearly cite (and even praise) my sources. | null | 0 | 1318925474 | False | 0 | c2se944 | t3_lew0f | null | t1_c2se944 | t1_c2sd0x3 | null | 1427747434 | 2 | t5_2fwo | null | null | null |
True | eric_t | null | You are probably right. I did this not just to compare performance, though, I was attempting to grasp at the difference in outcome when approaching a problem from an imperative mindset vs a functional mindset. So even ignoring the performance, I think it was a useful exercise. | null | 0 | 1318925695 | False | 0 | c2se9kk | t3_lew0f | null | t1_c2se9kk | t1_c2s9bap | null | 1427747439 | 1 | t5_2fwo | null | null | null |
True | Excedrin | null | lol funny | null | 0 | 1318925755 | False | 0 | c2se9p4 | t3_lf038 | null | t1_c2se9p4 | t1_c2scz2y | null | 1427747441 | -1 | t5_2fwo | null | null | null |
True | Iamien | null | so, what is wrong with rand($lowbound, $highbound); ? | null | 0 | 1318925821 | False | 0 | c2se9tq | t3_lfsfk | null | t1_c2se9tq | t3_lfsfk | null | 1427747443 | 0 | t5_2fwo | null | null | null |
True | wnoise | null | The difference from uniform can be quantified, and for N << RAND_MAX it's tiny. (In fact, it's O(N / (RAND_MAX+1)). Yeah, it's worth knowing about, but for the typical discrete case it's not worth worrying about. | null | 0 | 1318925906 | False | 0 | c2se9zm | t3_lfsfk | null | t1_c2se9zm | t1_c2sciw6 | null | 1427747445 | 5 | t5_2fwo | null | null | null |
True | antonivs | null | It's for asynchronous communication between parts of a system.
Imagine a system with two components A and B - they could be functions in the same program, separate programs, separate machines, or whatever. Instead of A producing some data, calling B with that data, and waiting for a response, A can just put the dat... | null | 0 | 1318925942 | False | 0 | c2sea23 | t3_lff3n | null | t1_c2sea23 | t1_c2se3qk | null | 1427747445 | 11 | t5_2fwo | null | null | null |
True | ReturningTarzan | null | [More of this sort of thing.](http://pouet.net/prodlist.php?type[]=32b&type[]=64b&type[]=128b&type[]=256b&type[]=512b&order=views) (Much, much more.) | null | 0 | 1318926017 | False | 0 | c2sea80 | t3_lfqqr | null | t1_c2sea80 | t3_lfqqr | null | 1427747448 | 2 | t5_2fwo | null | null | null |
True | jkff | null | Functional programming discourages violation of referential transparency, which is not the same as disallowing side effects or mutable state altogether, there are plenty of ways to have both, but in a referentially transparent way — monads, unique types, effect systems etc.
Haskell uses monads. You are, too — the semic... | null | 0 | 1318926085 | False | 0 | c2seada | t3_lfm1k | null | t1_c2seada | t1_c2se7q6 | null | 1427747450 | 12 | t5_2fwo | null | null | null |
True | eric_t | null | Great, this is exactly the kind of comment I was hoping for! Your changes are clear improvements. Would you mind sending me this as a pull request on bitbucket so you can get properly credited? | null | 0 | 1318926315 | False | 0 | c2seat3 | t3_lew0f | null | t1_c2seat3 | t1_c2scgva | null | 1427747455 | 1 | t5_2fwo | null | null | null |
True | doidydoidy | null | > Why do we need a confusing name to describe "not choosing the class you're going to use at compile time, but dynamically at run time".
I don't expect you to read [Martin Fowler's 2004 article](http://martinfowler.com/articles/injection.html), but at least look at the table of contents. Note that he contrasts "dep... | null | 0 | 1318926490 | False | 0 | c2seb5q | t3_lf1px | null | t1_c2seb5q | t1_c2s7zeh | null | 1427747460 | 3 | t5_2fwo | null | null | null |
True | jkff | null | It is not exactly hard, it is *unexpectedly* hard for someone who expected that he will not have to re-learn optimization techniques when transitioning to a language with a completely different evaluation model.
That said, I must agree that the evaluation model does indeed often make it very hard to find bottlenecks i... | null | 0 | 1318926529 | False | 0 | c2seb8c | t3_lfm1k | null | t1_c2seb8c | t1_c2sdvkq | null | 1427747461 | 22 | t5_2fwo | null | null | null |
True | elperroborrachotoo | null | The cowards answer is "it depends on your application".
boost.random is good simply because it offers **different generators**, and they should get some scrutinity.
If you need something that "looks random to a human", rand() certainly is good enough. Beyond that, there are certain factors, some of them are:
- d... | null | 0 | 1318926535 | True | 0 | c2seb8v | t3_lfsfk | null | t1_c2seb8v | t1_c2se7zz | null | 1427747461 | 8 | t5_2fwo | null | null | null |
True | perlgeek | null | What worries me about this kind of response (which you see quite often in Haskell performance discussions) is that Haskell works really hard to abstract away the machine for you, and then you *still* have to chose particular ways to things to have them fast.
That feels so wrong. Many of Haskell's abstractions make it ... | null | 0 | 1318926856 | False | 0 | c2sebv6 | t3_lfm1k | null | t1_c2sebv6 | t1_c2sdmlu | null | 1427747469 | 21 | t5_2fwo | null | null | null |
True | how_gauche | null | > Anyway, I'm with snakepants, it's either really hard to get good performance out of Haskell, or really hard to figure out how to do so.
It isn't that hard, actually -- the knowledge has unfortunately not been published in a single place. This is something that needs to change.
Effectively, what you're saying is:... | null | 0 | 1318927072 | False | 0 | c2sec95 | t3_lfm1k | null | t1_c2sec95 | t1_c2sdvkq | null | 1427747474 | 18 | t5_2fwo | null | null | null |
True | sierra1bravo | null | If I understand this correctly, the challenge here was not the beauty of the Julia set itself, but that the whole thing could be done small enough to fit in on a Master Boot Record (512 bytes). The program can thus be loaded into the MBR of a floppy disk or USB drive and a machine will boot from it and run it (without ... | null | 0 | 1318927149 | False | 0 | c2secer | t3_lfqqr | null | t1_c2secer | t3_lfqqr | null | 1427747476 | 4 | t5_2fwo | null | null | null |
True | wot-teh-phuck | null | Something like this for Java programmers would be a nice addition IMO. :) | null | 0 | 1318927313 | False | 0 | c2secpq | t3_lg1xx | null | t1_c2secpq | t3_lg1xx | null | 1427747480 | 1 | t5_2fwo | null | null | null |
True | how_gauche | null | OMG, I would upvote you twenty times if I could. | null | 0 | 1318927353 | False | 0 | c2secst | t3_lfm1k | null | t1_c2secst | t1_c2scuqd | null | 1427747481 | 2 | t5_2fwo | null | null | null |
True | shevegen | null | Exactly why I stopped using Haskell. But I gave up earlier.
All the "script languages" were much more rewarding much more easily.
I realized I am too dumb to master Haskell.
But I also don't care. The old vim vs. emacs war is where there are only two losers. Since then I use a SIMPLE editor and I am still productive... | null | 0 | 1318927523 | False | 0 | c2sed3j | t3_lfm1k | null | t1_c2sed3j | t3_lfm1k | null | 1427747485 | 4 | t5_2fwo | null | null | null |
True | sporkexec | null | > I could have saved hours of frustration – and worrying about scalability – if someone had told me how easy this would be instead.
There is nothing special about queues that suddenly make your app scalable. Queuing drops your latency to approximately zero at the cost of having no clue about when or if the work get... | null | 0 | 1318927617 | False | 0 | c2sedag | t3_lff3n | null | t1_c2sedag | t3_lff3n | null | 1427747488 | 7 | t5_2fwo | null | null | null |
True | chonglibloodsport | null | To make fields strict you probably want to use [Bang Patterns](http://www.haskell.org/ghc/docs/latest/html/users_guide/bang-patterns.html). You might also want to consider looking at the [accelerate](http://hackage.haskell.org/package/accelerate) and [repa](http://hackage.haskell.org/package/repa) packages. If you can ... | null | 0 | 1318927626 | True | 0 | c2sedbg | t3_lfm1k | null | t1_c2sedbg | t1_c2se7to | null | 1427747488 | 3 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1318927724 | 1381683526 | 0 | c2sedha | t3_lf1px | null | t1_c2sedha | t1_c2sbur9 | null | 1427747491 | 3 | t5_2fwo | null | null | null |
True | kamatsu | null | > I wish Dijkstra were still around.
Me too, me too.
> I mean, if 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself "Dijkstra would not have liked this", well, that would be enough immortality for me.
Also, he's de... | null | 0 | 1318928153 | False | 0 | c2seea1 | t3_lfm1k | null | t1_c2seea1 | t1_c2scu1z | null | 1427747500 | 4 | t5_2fwo | null | null | null |
True | Brian | null | >Basically the worst case complexity isn't nice.
What do you mean - it's clearly a fixed number of states regardless of the input - technically that makes it O(1) :-) | null | 0 | 1318928398 | False | 0 | c2seeqa | t3_lfsfk | null | t1_c2seeqa | t1_c2se78i | null | 1427747507 | 3 | t5_2fwo | null | null | null |
True | Excedrin | null | ML family has mutable state. Scheme has mutable state. Erlang doesn't, but IO is ez in Erlang (it's impure).
Haskell has mutable state, but it's made explicit. IO is also explicit. That's fairly different from other languages.
C:
int fact(int n) { if (n<=1) return 1; return fact(n-1) * n; }
main() {
... | null | 0 | 1318928416 | False | 0 | c2seerf | t3_lfm1k | null | t1_c2seerf | t1_c2se7q6 | null | 1427747508 | 9 | t5_2fwo | null | null | null |
True | wnoise | null | Using a higher-level language implemented in C.
(Halfway kidding, but halfway serious. Of anything near its niche, C is my favorite. But it's not the only niche.) | null | 0 | 1318928547 | True | 0 | c2seeyx | t3_lc090 | null | t1_c2seeyx | t3_lc090 | null | 1427747510 | 1 | t5_2fwo | null | null | null |
True | kamatsu | null |
> Memoization takes an unreasonable amount of effort, for instance.
*What?*
Use [this library](http://hackage.haskell.org/packages/archive/memoize/0.1/doc/html/Data-Function-Memoize.html) and memoizing a function's results is simply a matter of typing:
memoizedFib = memoize fib
>but due to laziness and ... | null | 0 | 1318928551 | False | 0 | c2seezb | t3_lfm1k | null | t1_c2seezb | t1_c2sdwsi | null | 1427747515 | 2 | t5_2fwo | null | null | null |
True | artsrc | null | >> No one thinks about the whitespace in Python because it's easy to get the whitespace right.
> This is plainly false. Google python indentation and variations on that theme and you will see the reaction.
I personally don't consciously think about indentation in python.
Where as to take advantage of a r... | null | 0 | 1318928592 | False | 0 | c2sef1s | t3_lfm1k | null | t1_c2sef1s | t1_c2scr5v | null | 1427747515 | 6 | t5_2fwo | null | null | null |
True | chonglibloodsport | null | It's hard to get the types right in most languages, it's just that most of them don't force you to do so and leave you to figure out the (potential) errors on your own. | null | 0 | 1318928602 | False | 0 | c2sef2i | t3_lfm1k | null | t1_c2sef2i | t1_c2scgln | null | 1427747513 | 3 | t5_2fwo | null | null | null |
True | iconoklast | null | Gauss is rolling in his grave! | null | 0 | 1318928614 | False | 0 | c2sef37 | t3_lfsfk | null | t1_c2sef37 | t1_c2scfrz | null | 1427747513 | 2 | t5_2fwo | null | null | null |
True | AeroNotix | null | I think you're over analysing the upvote/downvote counter. Given enough well thought out posts, you will more often than not invite insightful discussion. Especially in subreddits that are aimed at the more technical subjects.
Keep trying, eventually the trolls leave you alone and you can get some real discussion out... | null | 0 | 1318928640 | False | 0 | c2sef4u | t3_lfm1k | null | t1_c2sef4u | t1_c2sd2rd | null | 1427747513 | 1 | t5_2fwo | null | null | null |
True | artsrc | null | And I don't consciously think about whitespace in Haskell which also has significant whitespace. | null | 0 | 1318928818 | False | 0 | c2seffx | t3_lfm1k | null | t1_c2seffx | t1_c2sef1s | null | 1427747517 | -4 | t5_2fwo | null | null | null |
True | dobryak | null | I'm really not into any kind of language wars on the web; moreover, I do understand that Haskell's strengths can be seen as weaknesses (and vice versa), depending on the way you look at it. :) Guess we misunderstood each other. | null | 0 | 1318928860 | False | 0 | c2sefih | t3_lfm1k | null | t1_c2sefih | t1_c2scpmr | null | 1427747517 | 1 | t5_2fwo | null | null | null |
True | kamatsu | null | Well, on one extreme, you have super strong type systems like that of Coq or Agda, which are very expressive and correspond to a logic. In these type systems, any property of code (all of those error categories except "errors in understanding the specification") can be eliminated. In the case of Haskell, it's not as st... | null | 0 | 1318928869 | False | 0 | c2sefj5 | t3_lfm1k | null | t1_c2sefj5 | t1_c2se7zn | null | 1427747519 | 8 | t5_2fwo | null | null | null |
True | chellomere | null | With the main difference that most aren't PC master boot records. | null | 0 | 1318928950 | False | 0 | c2sefoj | t3_lfqqr | null | t1_c2sefoj | t1_c2sea80 | null | 1427747525 | 3 | t5_2fwo | null | null | null |
True | chonglibloodsport | null | I think when people make that statement, they are assuming the programmer hasn't made any of the errors you listed and are referring only to classes of errors that differ between programming languages. | null | 0 | 1318928951 | False | 0 | c2sefol | t3_lfm1k | null | t1_c2sefol | t1_c2se7zn | null | 1427747525 | 3 | t5_2fwo | null | null | null |
True | Excedrin | null | > Memoization takes an unreasonable amount of effort, for instance.
Where are you coming from that memoization is ez? | null | 0 | 1318928984 | False | 0 | c2sefqx | t3_lfm1k | null | t1_c2sefqx | t1_c2sdwsi | null | 1427747521 | -2 | t5_2fwo | null | null | null |
True | dmpk2k | null | That's a low bar though. | null | 0 | 1318929130 | False | 0 | c2seg0g | t3_lfm1k | null | t1_c2seg0g | t1_c2scogj | null | 1427747524 | 10 | t5_2fwo | null | null | null |
True | kamatsu | null | By default, the "easy way" to write Haskell is with immutable data, however you can use references with the IO monad if you like mutable data. | null | 0 | 1318929377 | False | 0 | c2segfm | t3_lfm1k | null | t1_c2segfm | t1_c2se7q6 | null | 1427747530 | 2 | t5_2fwo | null | null | null |
True | moolikeacow | null | >There is nothing special about queues that suddenly make your app scalable.
Doesn't that depend on how crummy a system you're starting with? If previously you're limited to one process accessing a database - I know, terrible design aside - and now you can have multiple processes running across as many machines or ... | null | 0 | 1318929424 | False | 0 | c2segi8 | t3_lff3n | null | t1_c2segi8 | t1_c2sedag | null | 1427747531 | 2 | t5_2fwo | null | null | null |
True | tragomaskhalos | null | It's like in "Learn you a Haskell ..." we find out how to apply a list of partial functions over a list of numbers (using <*>) so that every partial function is applied to every number - in a single line of elegant code.
The trouble is, in 30 years of software development, I have never needed to do anything rem... | null | 0 | 1318929445 | False | 0 | c2segjl | t3_lfm1k | null | t1_c2segjl | t1_c2sd7qp | null | 1427747531 | 11 | t5_2fwo | null | null | null |
True | Waitwhatwtf | null | For iOS devices, you're going to want to start [here](http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619), this will get you familiarized with the NeXtStep family of jive turkeys, followed up with [a more formal introduction to Objective-C](http://www.amazon.com/Programming-Objective-C-2-0-Stephen-Kochan/... | null | 0 | 1318929463 | False | 0 | c2segkh | t3_lf038 | null | t1_c2segkh | t1_c2s8ld9 | null | 1427747531 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | > errors due to failing to consider error conditions
I think this is the single one where they have a case. You can encode a hell of a lot of this into your types, and then check that you've catered for it at compile-time.
*shrug* the rest you're perfectly right about though. | null | 0 | 1318929470 | False | 0 | c2segkz | t3_lfm1k | null | t1_c2segkz | t1_c2se7zn | null | 1427747531 | 7 | t5_2fwo | null | null | null |
True | ElencherMind | null | It's actually a backtick ` then single quote '. Personally I use double-backtick `` which does the same thing but faster. | null | 0 | 1318929558 | False | 0 | c2segqq | t3_lfblq | null | t1_c2segqq | t1_c2sc0h9 | null | 1427747541 | 1 | t5_2fwo | null | null | null |
True | ElencherMind | null | Personally I use double-backtick `` which does the same thing but faster. | null | 0 | 1318929570 | False | 0 | c2segrj | t3_lfblq | null | t1_c2segrj | t1_c2sb7j9 | null | 1427747534 | 1 | t5_2fwo | null | null | null |
True | artsrc | null | We agree that humans don't see the difference between tabs and spaces. That is why Python bans mixing them.
This human being does see the effect of the white space. That is why I like significant white space. I look at the indentation, so compilers should too.
if (something); {
doSomething();
}
A... | null | 0 | 1318929667 | False | 0 | c2segxw | t3_lfm1k | null | t1_c2segxw | t1_c2scngj | null | 1427747536 | 1 | t5_2fwo | null | null | null |
True | ElencherMind | null | Some vi users consider it to be cheating, but I find it convenient to use "visual mode" when selecting odd chunks of text - hit v to start highlighting what you want, then y to copy or d to delete the selection. | null | 0 | 1318929694 | False | 0 | c2segzl | t3_lfblq | null | t1_c2segzl | t1_c2s9egu | null | 1427747537 | 2 | t5_2fwo | null | null | null |
True | antonivs | null | I think what you might be missing is that having, and effectively using, a powerful type system actually can go a long way to addressing many of the kinds of bugs in every single one of the categories you listed.
I could write lots of words about why that's the case, but I'm not sure how convincing it would be. It ma... | null | 0 | 1318929761 | False | 0 | c2seh46 | t3_lfm1k | null | t1_c2seh46 | t1_c2se7zn | null | 1427747538 | 33 | t5_2fwo | null | null | null |
True | [deleted] | null | I'm going to graduate this year with an Electrical Engineering degree. But I find that I really don't like most of the work I do, I'm mainly just interested in software. I was considering going back, maybe after a year or two to get a Masters in Information Technology. It's hard to get a software job as a just an El... | null | 0 | 1318929830 | False | 0 | c2seh88 | t3_lf038 | null | t1_c2seh88 | t1_c2s5dsc | null | 1427747542 | 1 | t5_2fwo | null | null | null |
True | dobryak | null | > One simulation I wrote ran almost as quickly as the equivalent in C++; but due to laziness and lack of manual management, its memory usage was prohibitively high.
Yes, a program using GC can be more lenient in its use of memory (compared to the one that uses malloc/free and stack allocation). So, it is a valid co... | null | 0 | 1318929832 | False | 0 | c2seh89 | t3_lfm1k | null | t1_c2seh89 | t1_c2sdwsi | null | 1427747542 | 2 | t5_2fwo | null | null | null |
True | Not_sure_about_that | null | How do YOU know you don't enjoy chopping your balls off?
Also, most people have "bad traits", but as long as they don't disturb others, that ought to be only their personal business. | null | 0 | 1318929997 | False | 0 | c2sehix | t3_lfrt9 | null | t1_c2sehix | t1_c2sci3m | null | 1427747544 | 0 | t5_2fwo | null | null | null |
True | sidneyc | null | > Basically the worst case complexity isn't nice.
It is rather hard to calculate the worst-case number of repeats given a certain PRNG, but I agree that it won't be pretty. Contrary to your earlier statement though, there will be an upper limit. Also, the average-case complexity can be made rather acceptable. | null | 0 | 1318930076 | False | 0 | c2sehnp | t3_lfsfk | null | t1_c2sehnp | t1_c2se78i | null | 1427747546 | 2 | t5_2fwo | null | null | null |
True | LordFreaker | null | Appreciated! I have used Codeacademy before, fantastic website. I'll be sure to give the other one a try. | null | 0 | 1318930219 | False | 0 | c2sehvy | t3_latsk | null | t1_c2sehvy | t1_c2re50p | null | 1427747550 | 2 | t5_2fwo | null | null | null |
True | aaronla | null | > Not to mention the solution (run rand() till you get a number in range) presented has no upper bound on its complexity
True, in practice you'd want to put some hard limit on it, and bail out (after having made the bias extremely small). Each iteration, you square the bias term, which is a fraction and can be made... | null | 0 | 1318930277 | False | 0 | c2sehzi | t3_lfsfk | null | t1_c2sehzi | t1_c2sdurs | null | 1427747551 | 5 | t5_2fwo | null | null | null |
True | taejo | null | A partial function is a function that is not defined on all possible input values. You seem to be talking about partially-applied functions. | null | 0 | 1318930422 | False | 0 | c2sei91 | t3_lfm1k | null | t1_c2sei91 | t1_c2segjl | null | 1427747554 | 13 | t5_2fwo | null | null | null |
True | slurpme | null | Good for you... I'm not you and I personally don't like that type of thing... | null | 0 | 1318930543 | False | 0 | c2seig1 | t3_lfm1k | null | t1_c2seig1 | t1_c2segxw | null | 1427747562 | -2 | t5_2fwo | null | null | null |
True | skew | null | GHC is pretty smart, but not enough to redo your algorithms. One big problem is guessing at compile time how much things cost, and whether it's worth doing more calculation up front to save memory, or the other way around - so those tradeoffs are usually left as written. Simon has said the goal is to eliminate penaltie... | null | 0 | 1318930596 | False | 0 | c2seijq | t3_lfm1k | null | t1_c2seijq | t1_c2se7to | null | 1427747557 | 13 | t5_2fwo | null | null | null |
True | adrianmonk | null | > which are very expressive and correspond to a logic.
So what if they correspond exactly to logic? *Correctly* writing down a description of something in formal logic is far from a trivial task.
As a matter of fact, isn't that one of the big gotchas of logic-based AI systems, that you try to write down a bunch o... | null | 0 | 1318930705 | False | 0 | c2seiqd | t3_lfm1k | null | t1_c2seiqd | t1_c2sefj5 | null | 1427747560 | 16 | t5_2fwo | null | null | null |
True | aurath | null | The cool thing here is this program runs entirely without an operating system, and is contained within the MBR sector on the hard disk. Normally the MBR part of the hard disk only contains a small amount of code to point to wherever the actual operating system is installed, but this is so tiny that it never needs to le... | null | 0 | 1318930779 | False | 0 | c2seiuk | t3_lfqqr | null | t1_c2seiuk | t1_c2se4y0 | null | 1427747561 | 9 | t5_2fwo | null | null | null |
True | [deleted] | null | > The trouble is, in 30 years of software development, I have never needed to do anything remotely like this (even if you factor in the fact that partial functions would not have been part of my mental toolset). And if I did ever need to do it, I'd actually prefer to use something a bit more longwinded that was more... | null | 0 | 1318930924 | False | 0 | c2sej2w | t3_lfm1k | null | t1_c2sej2w | t1_c2segjl | null | 1427747564 | 36 | t5_2fwo | null | null | null |
True | unpopular_opinion | null | There are non-trivial APIs (< 1000 symbols organised in modules) that I can use and integrate in my programs in minutes, but it depends on how large the API at hand is, how well documented it is and whether someone sane built it.
Can you dump a list of books you recommend? E.g. like a determined mind could also st... | null | 0 | 1318930991 | True | 0 | c2sej78 | t3_lf038 | null | t1_c2sej78 | t1_c2sb940 | null | 1427747566 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | > Any property? So this type system can prevent me from writing an infinite loop, which means it has solved the halting problem? I know you don't mean that, but aren't you exaggerating when you say "all of those error categories"?
No, Coq does not have a halting problem (it is not Turing complete). Coq is strongly... | null | 0 | 1318931171 | False | 0 | c2sejho | t3_lfm1k | null | t1_c2sejho | t1_c2seiqd | null | 1427747570 | 4 | t5_2fwo | null | null | null |
True | eric_t | null | Oh, and the bug can be fixed by setting the initial upper right point to (-1,-1) instead of (0,0). Good work on catching that. | null | 0 | 1318931685 | False | 0 | c2sekbk | t3_lew0f | null | t1_c2sekbk | t1_c2scgva | null | 1427747589 | 1 | t5_2fwo | null | null | null |
True | bysse | null | > JavaScript is already there.
C has been around about 40 years. | null | 0 | 1318931700 | False | 0 | c2sekcc | t3_l9ygm | null | t1_c2sekcc | t3_l9ygm | null | 1427747589 | 1 | t5_2fwo | null | null | null |
True | ReturningTarzan | null | Alternatively, if you want something that runs in constant time (although probably slower overall), you can make the distribution error arbitrarily small by concatenating the results of multiple calls to rand(). | null | 0 | 1318931725 | False | 0 | c2seke6 | t3_lfsfk | null | t1_c2seke6 | t1_c2sd9tj | null | 1427747582 | 2 | t5_2fwo | null | null | null |
True | jkff | null | Downvoter, care to explain the issue? | null | 0 | 1318931758 | False | 0 | c2sekfu | t3_lfm1k | null | t1_c2sekfu | t1_c2seada | null | 1427747582 | 4 | t5_2fwo | null | null | null |
True | [deleted] | null | Looking over your code, you missed out quite a bit of low hanging fruit in terms of simple optimisations. For instance, you're using "data" everywhere, instead of the more performant "newtype" (the constructor is deleted in a newtype at compile time, whereas the data constructor hangs around). Similarly, there's no s... | null | 0 | 1318931871 | False | 0 | c2sekle | t3_lfm1k | null | t1_c2sekle | t1_c2scyjm | null | 1427747583 | 5 | t5_2fwo | null | null | null |
True | [deleted] | null | > That feels so wrong. Many of Haskell's abstractions make it hard to argue about performance, and seem to require a mental model of the compilation process (or result) -- which is much harder than in C (and derived languages), which is just a thin layer over the machine.
C is not a thin layer over the machine. A ... | null | 0 | 1318931981 | False | 0 | c2sekru | t3_lfm1k | null | t1_c2sekru | t1_c2sebv6 | null | 1427747586 | 7 | t5_2fwo | null | null | null |
True | sreguera | null | Yes, it sounds awfully like [logical cohesion](http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29) that is the worst kind of cohesion. | null | 0 | 1318931994 | False | 0 | c2seksj | t3_lf1px | null | t1_c2seksj | t1_c2sdx23 | null | 1427747586 | 1 | t5_2fwo | null | null | null |
True | adrianmonk | null | > so what's the problem?
Understanding that in the English language, "or" is an overloaded operator that sometimes means logical "or" but sometimes means "and equivalently". :-) | null | 0 | 1318932773 | False | 0 | c2sem14 | t3_lfsfk | null | t1_c2sem14 | t1_c2sdoey | null | 1427747603 | 9 | t5_2fwo | null | null | null |
True | Timmmmbob | null | Yeah. In fact it shouldn't be that hard; all we need is to make a custom project template... I don't think the actually modifying QtCreator is something I have time for, or is really worth the effort, but I am going to try making a decent project template. | null | 0 | 1318933029 | False | 0 | c2semfl | t3_lf57z | null | t1_c2semfl | t1_c2se5f7 | null | 1427747608 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1318933048 | False | 0 | c2semgl | t3_la9ma | null | t1_c2semgl | t1_c2r4lno | null | 1427747609 | 2 | t5_2fwo | null | null | null |
True | perlgeek | null | So what's the real solution? Rejection testing, but with an upper limit of the largest multiple N <= RAND_MAX, and then doing `result % N`?
int factor = RAND_MAX / N;
int MAX = factor * N;
int r;
do
r = rand();
while r < MAX;
return r % N;
(please excuse my clumsy C code, hav... | null | 0 | 1318933121 | False | 0 | c2seml1 | t3_lfsfk | null | t1_c2seml1 | t3_lfsfk | null | 1427747610 | 4 | t5_2fwo | null | null | null |
True | adrianmonk | null | True, but the points the article makes will apply equally well to functions which aren't `rand()` but which still give you numbers from a range you can't control.
For example, suppose I have a random number generator which isn't `rand()` and which furthermore has the amazingly awesome property that I can call a functi... | null | 0 | 1318933154 | False | 0 | c2semmn | t3_lfsfk | null | t1_c2semmn | t1_c2sds29 | null | 1427747611 | 1 | t5_2fwo | null | null | null |
True | deong | null | > Having rand() as the only API is a poor API design choice which under serves a large number of customers in the worst case possible, by failing silently and subtly.
I'd be rather surprised if the number of people who are actually suffering detectable harm from
(unsigned int)((double)rand() / RAND_MAX * n)
i... | null | 0 | 1318933254 | False | 0 | c2sems9 | t3_lfsfk | null | t1_c2sems9 | t1_c2sdm0l | null | 1427747613 | 5 | t5_2fwo | null | null | null |
True | mfukar | null | Alternative title: When you perform arithmetic with types of different width, shit happens. | null | 0 | 1318933281 | False | 0 | c2semto | t3_lg59j | null | t1_c2semto | t3_lg59j | null | 1427747613 | 53 | t5_2fwo | null | null | null |
True | adrianmonk | null | The problem I have with it is that if it's really a pseudo-random number generator, I can't be guaranteed that there are no cases where it creates an infinite loop. At least without looking into what the pseudo-random number generator actually does.
Put another way, all pseudo-random number generators with a finite s... | null | 0 | 1318933421 | True | 0 | c2sen2t | t3_lfsfk | null | t1_c2sen2t | t1_c2sd3ua | null | 1427747617 | 2 | t5_2fwo | null | null | null |
True | ReturningTarzan | null | True, but they're basically the same level code (very few use any DOS APIs). You could more or less add an MBR header to them and there wouldn't be any difference at all. Except I think some of them are way more impressive given a 128-byte or 256-byte constraint, as opposed to the 446 bytes going spare in the MBR. | null | 0 | 1318933424 | False | 0 | c2sen2x | t3_lfqqr | null | t1_c2sen2x | t1_c2sefoj | null | 1427747617 | 2 | t5_2fwo | null | null | null |
True | djhworld | null | I think my only gripes with haskell are the state of the libraries on Hackage.
....and the fact that I still can't quite get my head around Monad Transformers just yet, although that's my own fault and it punishes me daily (hence why I can't quite understand things like the Snap framework etc) | null | 0 | 1318933428 | False | 0 | c2sen3f | t3_lfm1k | null | t1_c2sen3f | t3_lfm1k | null | 1427747617 | 3 | t5_2fwo | null | null | null |
True | slurpme | null | If you fancy an alternative to emacs (and are on Windows) I can recommend Komodo Edit... I moved from emacs to it a few years ago... | null | 0 | 1318933491 | False | 0 | c2sen79 | t3_lfm1k | null | t1_c2sen79 | t1_c2sed3j | null | 1427747618 | 2 | t5_2fwo | null | null | null |
True | kdeforche | null | Facebook, Twitter and Google. Basically the sites from whom you would expect to have credentials for the average Internet users.
They are all moving to OAuth 2.0 actually. | null | 0 | 1318933621 | False | 0 | c2senf7 | t3_lfhyw | null | t1_c2senf7 | t1_c2s9ewf | null | 1427747622 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | Especially if you try to negate unsigned integers.
> Conclusion: You should avoid using unsigned data types to store negative values.
No shit, sherlock ;) | null | 0 | 1318933729 | False | 0 | c2senlx | t3_lg59j | null | t1_c2senlx | t1_c2semto | null | 1427747623 | 47 | t5_2fwo | null | null | null |
True | adrianmonk | null | > Well I guess it should have some maximum considering rand() ultimately only has a limited number of states it can ever be in
This could also work in your favor, but it could also work against you in horrible ways. What happens if you got through a whole cycle of the state of the random number generator and you d... | null | 0 | 1318933820 | False | 0 | c2senr8 | t3_lfsfk | null | t1_c2senr8 | t1_c2se78i | null | 1428192152 | 1 | t5_2fwo | null | null | null |
True | ivosaurus | null | I'd regard quotation marks, broadly, as either ', " or `. | null | 0 | 1318933872 | False | 0 | c2senu0 | t3_lfblq | null | t1_c2senu0 | t1_c2segqq | null | 1427747626 | 2 | t5_2fwo | null | null | null |
True | Brian | null | I don't see how this says anything that contradicts the circle being those that "get the job done" (== "code that works"). That's saying the haskell circle is smaller than the set of working programs / approaches. Ie. there are 4 classes here:
1. All programs (working or not) : The rectangle.
2. Working programs ... | null | 0 | 1318933872 | False | 0 | c2senu1 | t3_lfm1k | null | t1_c2senu1 | t1_c2sd6zc | null | 1427747626 | 1 | t5_2fwo | null | null | null |
True | bitchessuck | null | Yeah, pretty weak article overall. | null | 0 | 1318933930 | False | 0 | c2senxf | t3_lg59j | null | t1_c2senxf | t1_c2semto | null | 1427747637 | 2 | t5_2fwo | null | null | null |
True | Dagon | null | 446 bytes, if you take a partition table into account. | null | 0 | 1318933989 | False | 0 | c2seo0y | t3_lfqqr | null | t1_c2seo0y | t1_c2secer | null | 1428192151 | 3 | t5_2fwo | null | null | null |
True | anttirt | null | That's why you always use ptrdiff_t for pointer offsets. | null | 0 | 1318934435 | False | 0 | c2seoqw | t3_lg59j | null | t1_c2seoqw | t3_lg59j | null | 1427747640 | 8 | t5_2fwo | null | null | null |
True | MarshallBanana | null | A Tausworthe generator is small, fast and good enough for every task where you don't already know you need something better.
uint32_t s1,s2,s3;
void SeedRandom(uint32_t seed)
{
s1=seed*1664525+1013904223|0x10;
s2=seed*1103515245+12345|0x1000;
s3=seed*214013+2531011|0x100000;
}
uint... | null | 0 | 1318934743 | False | 0 | c2sepa4 | t3_lfsfk | null | t1_c2sepa4 | t1_c2se7zz | null | 1427747646 | 6 | t5_2fwo | null | null | null |
True | AeroNotix | null | I mean a full application really, along with a cross-platform toolchain. From what I can gather the arduino build process is well-documented (I might be mistaken!) and I was thinking building an application around that but without all the little niggles I have with the default IDE.
What are you meaning with templates? | null | 0 | 1318934772 | False | 0 | c2sepbe | t3_lf57z | null | t1_c2sepbe | t1_c2semfl | null | 1427747647 | 1 | t5_2fwo | null | null | null |
Subsets and Splits
Filtered Reddit Uplifting News
The query retrieves specific news articles by their link IDs, providing a basic overview of those particular entries without deeper analysis or insights.
Recent Programming Comments
Returns a limited set of programming records from 2020 to 2023, providing basic filtering with minimal analytical value.