« first day (366 days earlier)      last day (3949 days later) » 

20:00
mhhh strange
The code could use a review though, perhaps that's what the SO folks are thinking.
@chillworld unfortunately, not.
Indentation is incorrect, and he's using A, B, C and D variables.
@SimonAndréForsberg maybe just reopen and give a real answer on what we do here :)
seems he need it
@chillworld that might be sending the wrong message though
I wonder the % of SO askers posting a "wall of code" with a "where's my bug?" question, that get sent over here...
20:02
@Mat'sMug Yes, I think we're seeing that increasingly often.
A.setText(answerA[currentQuestion++]);
B.setText(answerB[currentQuestion++]);
C.setText(answerC[currentQuestion++]);
D.setText(answerD[currentQuestion++]);
@chillworld As long as he's asking for how to fix the error, I won't vote to re-open. If his code would look the same, but without implying in the question that there's an error in it, then I'd vote to re-open.
wtf 4 times raising the int?
he shall be soon oput of questions
@chillworld Wouldn't surprise me if that's why the app crashes.
wtf_per_minute++;
20:04
++currentQuestion looks better to me :D
one time
I once reviewed code that contained
`a = 5;`
`a = 5;`
Programmer's explanation was "a *really* needs to be five here..."
@chillworld that wouldn't be getting the same index, at least not in C#
I think some of the SO users when they direct users over here is fully aware of what we do here, but they expect the poster to ask for how to clean up their code rather than coming here with the exact same question
@Edward The paranoïsm...
@SimonAndréForsberg added in the comment, so he can reflect on what he is doing
20:07
@skiwi Maybe he was just using the compiler he wrote. :)
and at the end a nice if else if else if else block in stead of using switch
@SimonAndréForsberg if I do _x = a++; and _y = ++b;, when both a and b are 0, does _x == _y in Java?
0
Q: Is this a correct way to preload images/stop loading images?

Tony FireI have a site that displays 1 animated GIF, where the source is assigned by a variable: image_url[current_url]. When a user clicks next, this image is replaced by another source: image_url[current_url + 1]. To boost user experience, I also decided to preload the next 2 images: image_url[current_u...

@Mat'sMug yes. they both will become 1 I assume.
In C# this:
            var a = 0;
            var b = 0;

            var x = ++a;
            var y = b++;

            Console.WriteLine("a={0}\nb={1}\n\nx={2}\ny={3}", a, b, x, y);
            Console.ReadLine();
outputs..
20:11
@Mat'sMug depends on how you set the comparisation
a=1
b=1

x=1
y=0
@Mat'sMug _x == 0 and _y == 1, so nope (side effects: a == 1 and b == 1 of course)
_x = a++ == _y = ++b is not true :D
@Mat'sMug same as C or C++
so Java and C# behave the same with pre- and post- increment
20:12
@Mat'sMug Is var the same as auto? And do people look weird when you declare very obvious types automatically in C#?
@Mat'sMug Oh, sorry, didn't see the difference before. Java does the same as C# there.
@skiwi I don't know auto, but probably - it's implicit typing, var a = 0; is the exact same compile-time thing as int a = 0;.
I see
The word “implicit typing” hurts. It's “type inference”, please.
@amon Right, and it's the same as in C++
20:18
And I assume using implicit typing does not play together well with complicated structures? Because Java uses the compiletime type (which you here hide with implicit typing), to infer the type of the expression of a complicated stream, if I'm correct
@amon type inference is more like how the generic type parameter is inferred from usage in db.MyEntities.Where<TEntity>(entity => entity.DateCreated ... - MSDN calls it "implicit typing".. msdn.microsoft.com/en-us/library/bb384061.aspx
but yeah it says the type is inferred, .. meh, a == b ;)
0
Q: Counting data comparisons for Java quick sort

NiuI'm trying to count the number of data comparisons in this quick sort algorithm, but am surely incrementing too often as my expected output is much lower than what I am currently getting. Here, i've incremented in partition's for loop and also every time recQuickSort is called. What am I missing?...

3
Q: Stream with sorted() before findFirst() is no longer lazy

Muhammad HewedyI have a list of elements, I need to find the first element that satisfy the condition then exit using Java 8 streams. I think the following code unfortunately evaluate all available element which doesn't what i need, I need to evaluate items one by one and stop (break) when find the first match...

I like the response of a Java developer at Oracle to the question of how he knows it is a bug:
@Eran Well, I looked at the source code (SortedOps.java, lines 301-308) to see that it unconditionally pushes all the elements downstream after sorting them. This seems wrong since findFirst is supposed to be short-circuiting. Then I asked the guy who implemented it and he said "Yeah, it's a performance bug." :-) — Stuart Marks 2 days ago
@CaptainObvious fraying with off-topic...
@Mat'sMug well, type inference is the CS term, and what it's called in the ML family (which is more or less where C# got the idea from). The term implicit typing could also be understood to mean dynamic typing. Interesting that MS is a bit sloppy with it's vocabulary.
20:24
@amon good to know, I'll use type inference from now on ;)
@Mat'sMug I think it's pretty clearly offtopic, the code isn't working as intended he explains
@amon "implicit typing" is, in my experience, what a language like Python does. If an function needs an int, it attempts to interpret the argument as an int.
@Edward sounds like duck typing..
like, if "123" can qwack like 123, ...it's 123 ;)
I'd calling "dynamic typing" but it could also be "monkeys typing"
5
@Edward yes. That's normally referred to as “dynamic typing”, where values, not expressions or variables have types – that would be static typing. Duck typing is a specific kind of dynamic typing.
20:26
@Edward WHY AM I OUT OF STARS?
6
I'll put it on your tab, mate.
@SimonAndréForsberg Because today it's raining stars
"Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. Such questions may be suitable for Stack Overflow or Programmers. After the question has been edited to contain working code, we will consider reopening it." <-- This may need an update to implicitely include code that is not working as intended? (From author's perspective that is not always the same as "broken code")
and back to define "it works"...
Excellent – Every site needs a solid group of core users to assist in moderating the site. We recommend:

150 users with 200+ rep (currently 1,363 users with 200+ rep)
10 users with 2,000+ rep (currently 66 users with 2,000+ rep)
5 users with 3,000+ rep (currently 44 users with 3,000+ rep)
One thing that may confuse new people is that on SO, we like small, concise, redacted code containing only the bug. Here the code tends to be longer and complete but working. Is that described in a FAQ yet?
@all I'm going to search some alcohol and settle myself before the tv
back in max 9hrs :)
@chillworld Careful with the TV. That stuff can kill you.
Wow, Jon Skeet managed to get 871 rep in one day on SO, try to beat that.
<squinting> Hey, where's the decimal point?
The last time Jon Skeet was not maxed out on SO was 8 June 2010
20:39
@Mat'sMug D:
Hey @Doorknob
didn't take me long to get this on SU
> You've earned the "Civic Duty" badge. See your profile.
@Doorknob Came to congratulate us? ;-)
I've been summoned via ping. :P
0
Q: Navigation bar using php

Mike M.<?php $nav_normal = array("1. Home","2. Read Me","3. License Agreement","4. General Information","5. Database Installer","6. Create an Account","7. Create Config","8. Successfully installed" ); $last_normal = array_pop(array_keys($nav_normal)); foreach($nav_normal as $name){ if($Nav_I...

I can never decide if answers that are technically correct but absolutely terrible code quality should be downvoted on SO.... It's just bleh when someone--especially a high rep user--post a correct answer, but it's just so... ewww.
20:45
You could also post your own correct and good quality code answer.
@Edward Worth noting, however, that C++ doesn't have the capabilities of full Hindley-Milner type inference. Not sure, but I doubt C# does either (but ML does, and Haskell not only has full H-M, but adds the ability to arbitrarily constrain types as well).
@JerryCoffin Bah. I use Forth and assembly language. Who needs types?
@Corbin I think it depends heavily on how the code quality is bad. For example, I frequently post answers there with names like "your_string" that have no place in real code, but (I think) help clarify the intent in context.
@Edward the problem is that they're usually terrrible questions that shouldn't be answered to begin with. :/
@JerryCoffin Yeah. I mainly just mean non-idiomatic, non-best practices x.x
@Edward You do. That's why you define them in assembly language, and prefer an assembler that checks them too (and if necessary, I'm pretty sure I can find a quote of you saying so too... :-)
20:49
@JerryCoffin Well.... OK. But I never inhaled.
The source of my bitching: stackoverflow.com/q/23481294/567864
@Corbin I have no trouble at all with downvoting code that (for one example) says: "use new like this....". It may be technically correct, but the description of down-voting doesn't say "wrong", only "not helpful".
Every day, I get on my computer, I open up SO, and I think to myself, "maybe it will be better today!" Then I browse, and I browse, and I browse. And I come across countless terrible questions and countless terrible answers :/
@JerryCoffin That's a good point. I always think of downvoting a meaning wrong, not unhelpful.
@Mat'sMug what is that cool syntax called with the fun ? marks in it?
@Corbin I don't even agree with the "technically correct" part. His while (file.good()) is not really correct.
20:53
I've also found that you have to meet the OP halfway (or more). If it's a C++ question and you start throwing complex templated functions with lambdas, etc. they simply might not know enough yet to make use of the answer.
Yeah, especially since operator>> isn't verified. I don't understand why no one checks that....
@Edward Oh definitely. The C++ community has this huge problem of "oh, well what you really need to do it fully template this and make it 40 times more complex!"
There's certain idioms and best practices that are simple and should be learned early on. The streams stuff falls under that in my opinion, but probably 85% of answers on SO handle them wrong.
@Corbin Not necessarily any more complex, but may be so much different the OP can't figure out how his code mapped to the new code at all.
Yeah, that's a good point
Oh my god. He updated it, and it's just as terrible: stackoverflow.com/a/23481439/567864
That's amazing.
0
Q: Check database for item and create it if it doesn't exist

user1206480Is there a more efficient approach to this code: // save associated tag let saveTag question = if question.Tag = null then () else let tagCount = query{ for row in db.Tags_Tags_Tags do ...

Sometimes I think all I do anymore in The 2nd Monitor is bitch and gossip about SO. I should try to actually answer some CR questions today... lol
20:59
@Corbin I think that part of the problem is that many university professors seem not to want to teach C++ in a way that resembles how real programmers actually use the language.
It's as though things were frozen in time in 1993 or so.
I agree wholeheartedly with you except I would replace "seem not to want" with "don't know how" :/
@Corbin Could be, but it's not clear whether they don't know C++ or that they don't know how to teach it.
Could be both.
Of the 5 or so C++ using classes I've had in the past few years, I truly believe the professors didn't know any better (not that I blame them). It's one thing if students were picking up the bad habits on their own via googling and whatnot, but professors would give out handouts with terrible examples, and write terrible, terrible code on the board. And their "solutions" to things were always technically functional, but pretty meh in terms of quality.
I think the problem is just that academia typically means writing a program, getting the data you need and never returning ever again to that program. Couple that with the "I already know it well enough," mentality, and you end up with 95% of C++ programmers needing to unlearn 80% of what they've learned to be worthy of being let anywhere near a non-trivial code base.
But I'm also just cynical and bitter :p.
@Mat'sMug I answered you question as well!!
0
A: Fluent Interface for a XmlQueryBuilder

MalachiThis might be a fun Pipe Dream but I was thinking that with this public override string ToString() { var parent = _xDoc.Element("queryxml"); if (parent == null) throw new InvalidOperationException("root node was not created."); parent.Add(_queryNode); return _xDoc.ToString(); } ...

@Corbin But you're GOOD at it. :)
21:05
If there's one thing I'm good at, it's cynicism and bitterness. Especially if it's on the internet! :D
lol
@Edward I think a lot is that it doesn't fit the intent of the class. For better or worse, they treat the C++ class as the introduction to low-level programming (or something similar). To fit that, they prohibit using (nearly) the entire standard library, and anything else that departs from using C++ as a warped version of assembly language.
@Corbin If I were teaching C++, I'd use Stroustrup's book. Not only does it teach the language well, it also has explanations for why one should do or avoid certain things.
@Edward I've never actually had a class use a straight-up C++ book. It's always some kind of data structures/algorithm/etc book and we just used C++. Kind of odd. I guess foundations I might have though. Didn't take it.
Where is @BenVlodgi? I pulled a Classic Ben there with that answer to Muggy's question
21:09
> It's the tasteless, odorless, non-toxic, biodegradable, politically correct choice.

Hahaha. That shouldn't amuse me as much as it does. I think your post is right though. That's definitely the feel at my university. No one cares enough to fight for it, and Java "is used in the real world," so it *must* make sense!
@JerryCoffin At the local Uni (my alma mater) one of the required undergraduate courses for Computer Engineering is this course which starts from gates and logic and works up to C.
@Corbin I certainly found that one amusing to write. Unfortunately, I'm quite certain that if that question were posted on P.SE today, it would be closed before anybody could write an anwer.
Yeah. The question seems a little flame-bait-y in all honesty. Still a very interesting question though when approached non-dogmatically.
@Edward Sounds like a decent course. Keep in mind: I've nothing at all against teaching low-level programming. What bothers me is conflating "C++" with "low level", and (usually) doing both poorly.
@JerryCoffin Yes, I understand. I've seen evidence of that from job applicants and on SO.
21:14
morning
@Yuushi Hello.
@Yuushi Good morning.
The other thing about academia is that it takes a sufficient mass of proficient people to actually create a course and to teach it. Doing new course prep is a lot more work than dusting off last semester's notes.
@JerryCoffin Ah, that post made me chuckle
@Edward ..at least when you try to do it well.
@JerryCoffin The professors I know tend to be in that category, but I know of exceptions of course.
@all got to go. See y'all later.
21:19
@Edward Later.
@Edward later
@Edward later
Goodbye NPN
@JerryCoffin Thank you so much for recommending NTL! Thank you, thank you thank you! :D
@TheDoctor I transist, that you may compute. :)
4
21:21
@hichris123 Oh, you're certainly welcome.
@Corbin Can't auto-star. Out of stars.
Hi
@Simon did someone pull a Malachi while i was out?
@Corbin I like the discussion you had there. I totally agreed with you both :P
@TheDoctor Yes, today is a day full of star-worthy messages.
HAHA i have some
And for the right price...
21:31
@Corbin You're (probably) too young to be so bitter and cynical :P
@SimonAndréForsberg Seems we're all cynics in here :p
@Yuushi I'm a grumpy old man in spirit
Haha
@skiwi I have now added 259 cards to my Hearthstone code. I have not tested all of them all though. And currently, I even have 4 failing test cases.
21:45
Phew, all tests working again.
Dang it @Mat'sMug I don't even have the Query Library on this machine?
21:59
Good night folks!
0
Q: Recursive WITH statement in SQL that calculates a recursive factorial?

user3491862This sql code was given to me by a coworker on a project. All it does is takes a table that has one colomn and figures out the factorial of it and outputs a table with the running total of the vactorial along with the number of iterations. To me it is really confusing and it uses a recursive WIT...

Thank you, captain obvious.
haha
22:45
Cool userscript: r=Math.random;w=$(window);setInterval("$('<b>★</b>').css({color:'yellow',positi‌​on:'fixed',top:r()*w.height(),left:r()*w.width()}).appendTo('body').animate({font‌​Size:0},3e3)",9)
Run in JS console
perfect for this room
Actually, better gold: r=Math.random;w=$(window);setInterval("$('<b>★</b>').css({color:'gold',position‌​:'fixed',top:r()*w.height(),left:r()*w.width()}).appendTo('body').animate({fontSi‌​ze:0},3e3)",9)
Borrowed from @Doorknob
OMG, @TheDoctor - Gangrene?
What????
No????
NOOOO!!!
Excuse me.
hehehehe .... excuse him while he puts his dog-face on
23:07
Is it back?
In the sidebar...
in Charcoal HQ, 46 secs ago, by hichris123
fixes everything
Refresh .... and ......
Yay!
That has happened before
I think it was @hchris123
@TheDoctor Don't change your chat parent user to A51 again.
Or, alternatively, update your profile on A51.
23:11
@TheDoctor Nah, I just fixed it. I changed your chat parent user to CG, so... if you want that different, change it.
I didn't. did you? Maybe it's because i was committing to Puzzling and Advertising.
Hmm
in Charcoal HQ, 1 min ago, by TheDoctor
Time to relax... Doge catastrophe averted
23:37
Pimping my answer (from two hours ago) just because I'm 3 rep away from 11K. Feel free to look at the other answers as well.
Hi, and welcome to Code Review. This answer is not really a code review. It does not explain why this code is more readable, and does not explain why isPrime and generatePrimesBelow are not optimal. Can you elaborate? — rolfl ♦ 9 secs ago
Ho Ho Ho .... answering 2yr old questions ... hmmmm.
@Jamal napalm'd... and now ! :)
Thanks, Santa!
@rolfl I wasn't too sure about that one, but at least it isn't a total non-answer.
New user, figured he needed the new-user brief.... to make the next one better.
I might test his later on, and maybe give an upvote if it works (unless he adds more detail before then).
13
A: What's a Zombie? And what are the many other memes of Code Review?

Mat's MugMeme: We could really use your ammo Originator: syb0rg Cultural Height: Side-effects of The Mission? Background: Activity on CR has recently taken a hell of a spike. 40 votes/day isn't enough ammunition to shoot at all the good answers that are thrown at all incoming zombies. Increased activit...

^^ explicitly added tag to this answer ;)
@Malachi just looked up ... and yup, fanciful or impossible plan or hope, alluding to dreams produced by smoking an opium pipe sounds like it - good call on the delete, I didn't want to downvote (although that would have fixed my OCD)...
Now you have to do [meta-tag:out-of-ammo]
Is there such a question?
it's ... perhaps deserves an entry in the memes list all by itself...

« first day (366 days earlier)      last day (3949 days later) »