« first day (345 days earlier)      last day (3678 days later) » 

6:00 PM
@Hellovart yes, but its weird :)
@Hellovart congrats on getting that right on your exam
 
@BenVlodgi it doesn't like the ElseIf statement, when I switch to Release it doesn't set the string.... I might just try an Else statement there
 
@Malachi just endif, and make a separate #if
 
@BenVlodgi right now there is only two options but I like that idea too
it doesn't like this RELEASE ???
 
@Malachi wat?
 
the Debug worked the way you had it, but the Release has to be written like this
CONFIG = "Release"
??
 
6:08 PM
@Malachi are you using precompiler instructions? There's a DEBUG and a TRACE constant optionally defined, ...the code otherwise builds assuming a RELEASE mode...
 
@Malachi just say if... else
dont use if release
@Malachi thats my bad
 
@Mat'sMug so I just specify the Release connection before the if statement
 
@Malachi or in the #else
 
well if I want to add other build configurations then I need to use the CONFIG = "BuildType" for everything else right?
brb
 
I've never done that with precompiler instructions. I used 2 config files instead, app.config.debug and app.config.release.
 
6:13 PM
I am going to have to try it sometime. but I think that these mini functions are going to be the fastest way at the moment. this is a small app it's like one Module (probably should be more)... 250 Lines of Code with all the Comments that I added
 
6:27 PM
man I am making this code all sorts of clean now. (as clean as code can be without semicolons)
3
 
6:38 PM
1
Q: Conway's Game of Life in C++

TwooeyThis is my attempt at Conway's game of life. It works! It's the most complicated program I've made to date. Though I'm sure it's pretty poorly done. Any idea's on how I can improve on it? #include <iostream> #include <cstdlib> #include <algorithm> const int gridsize = 75; //Making this a globa...

 
wow, the activity feed is more active than this chat
 
No More STARS?!!!?
7
@Nobody I am actually writing code at work, that is probably why
 
35 more upvotes on my answers before I get a silver language badge.
 
@Malachi: Given that there are 24 people in this room it should not solely depend on you :)
 
Does anyone in here have experience with libsndfile?
Probably not, but it's worth a shot.
 
6:48 PM
@Nobody but that's not the issue right now, I am out of stars, and @Nobody cares!
 
you already got three of them
how many do you want?
 
enough to fill the sky!
 
@Nobody I think that may be a new record ;-)
 
@rolfl TS or TP?
 
@Malachi: if we pin one to each of your foveas that might suffice to "fill the sky" and everything else :)
 
6:50 PM
TP = Theoretical Pin
 
@rolfl: What may be the record?
 
Not toilet paper?
 
foveas???
 
Why is there so many new python CR questions!?
 
last I remember as being the HWM for chat was 18
(HWM -> High water mark)
 
6:51 PM
@skiwi: Maybe because noone knows how to program in it correctly?
 
is Python a type of language that is being used for quick and dirty stuff?
 
@Nobody ^^^^ RSA
 
rsa?
 
Real Star Applied
 
@Nobody Real Star applied
 
6:52 PM
Am I not good enough for your stars? :(
 
I always think of this guy when I see those letters
http://forums.thinkingwithportals.com/member/HMW/
 
13
A: What's a Zombie? And what are the many other memes of Code Review?

Mat's MugMeme: TS | RSA Originator: SimonAndréForsberg (TS), rolfl (RSA) Cultural Height: star-power Background: The 2nd Monitor is quite a star-happy chatroom. How many of you know that there's only a number of times you can "star" a chat post - a star cap (like the rep cap and the vote cap, a star ca...

 
@skiwi: It is my alternative for bash, because I always feel bash is not as powerfull (although it probably is)
bash cannot import antigravity though
 
perl should be your when-bash-is-not-enough option
 
@rolfl @Malachi: now that you say it the meaning comes back to me :)
 
6:53 PM
I wrote 20 short programs in Python yesterday.  It was wonderful.  Perl, I'm leaving you.
3
 
@rolfl: each time I saw per l and read about it I came to the conclusion that it is an utter mess
 
And python is not?
 
@rolfl: Not as far as I can tell
 
that wasn't the comic I was looking for but it will do.
 
Aaah, I click on the (1) icon left button if I've been mentioned and then I won't get alerted, cool
 
6:57 PM
Alright @skiwi. It's on!
 
@Malachi: Did you search for this:
We lost the documentation on quantum mechanics.  You'll have to decode the regexes yourself.
2
 
@skiwi Alternatively, you can actually say something, and clear the notifications
 
@Nobody no but that came up too
 
@rolfl But for that I'd need to say something meaningless
 
I was looking for the one where everyone is fighting about the best language.
 
6:58 PM
Cool @Vogel612 !
You already have a main method, which I don't
 
@Malachi: I only know this then:
Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.
2
 
0
Q: Automatically run doctest every time program is run

githubphagocyteI would like this to happen every time I run a program from the command line. Is my approach Pythonic? I'm interested to know whether there is any problem with readability or correctness. Any general advice on better ways of doing things or potential problems are also welcome. Although the main ...

 
@Nobody TS TS TS that is the one I was looking for
 
the last panel totally kills me everytime :)
 
I like the hover text and the last panel...lol
 
7:01 PM
The thing with the hover text is: Why would you need to talk about it then? It already happened 13 Billion years ago
however, the butterfly might work ^^
 
Come on CR
dont die on me now
 
@janos I'm worried I may upvote too many of your answers all at once. :P
@Jamal 200 more!
 
@syb0rg haha, I knew something was up ;)
 
:D
20 more upvotes, essentially.
 
@janos But seriously, I don't want all of that rep to get reversed :)
 
7:14 PM
definitely not
 
This one got some votes and answers pretty quickly. It may become hot.
 
link?
 
link?
 
L
 
L
I
N
K
?
 
7:16 PM
7
Q: Conway's Game of Life in C++

TwooeyThis is my attempt at Conway's Game of Life. It works, and it's the most complicated program I've made to date. I'm sure it's pretty poorly done. Any ideas on how I can improve on it? #include <iostream> #include <cstdlib> const int gridsize = 75; //Making this a global constant to avoid arra...

 
ZELDA!
 
At least it's not another Data-Structure-That-Must-Not-Be-Named.
 
I suddenly feel the urge to ask a linked list question
5
 
@rolfl You know when 2 people say the same thing, you are supposed to form an L on your front head ;)
Jinx or something
 
well, I am off
 
7:19 PM
bye @Nobody!
(saying that always feels somewhat awkward...)
@Jamal don't tempt me to create (synonym of ) ;)
3
 
Sadly, it's over 25 characters.
 
Oh..... learned a new Formatting trick in markdown, by mistake.
Type this in to a dummy answer/question:
    this is a list

    1. item 1
 
lol
 
Then press shift-enter....
 
oh
 
7:25 PM
and you get
 
bananas?
 
    this is a list

    1. item 1
    2.
 
well that's cool!
 
this is a list
^its empty
 
no it's not
;p
 
7:27 PM
:P
 
this is a list:
 
this is a list:
 
Just learned that the next eight weeks of my life will be spent supporting another team's trash JavaScript project. Kill me now.
 
public class LinkedList<E> {
    public LinkedList() {
        add(new LinkedList(Arrays.asList(this)));
    }
}
 
@syb0rg I hope that was not you again ;-)
if you like JavaScript, check this out: alexnisnevich.github.io/untrusted
 
7:32 PM
@janos Nope, I've placed a temporary ban on your posts until 3:00 UTC.
 
@JeffGohlke I feel your pain
 
Don't take too much offence to that, it's for your own good ;)
 
haha, actually it might come to my advantage
 
@JeffGohlke I don't think I've ever actually seen a maintainable JavaScript project. I've heard stories--rumors--of them, but... I'm starting to wonder if they're just a mythical dream.
 
@janos In the long run.
 
7:34 PM
@syb0rg looks like I'll hit the daily cap anyway
 
I need to bling some answer so it can get some more recognition.
 
Just to mention that CR now has all their 20K and 10K users, and that last week CR got +1 in the 2K cluster (and so many more coming up!), PCG 0. Mwahahahaha! — retailcoder 7 secs ago
 
@Mat'sMug Yeah, no big worries, though I am not 100% sure you did
 
I usually skip those edits...
(hence I don't have a [badge:reviewer] yet)
 
@Corbin Genuinely, this project has identical code copy-and-pasted all over the place. So fixing a defect requires you to do the exact same change in seven different places.
@Corbin I said I wanted to fix the references and consolidate them into one file, and was told "we don't have time to refactor the code".
 
7:40 PM
Whaaaaaa....
That's just... Eww.
 
@JeffGohlke lol, I just spent the last 3 days applying a "small tiny little change" in shit code that was copy+pasted literally 40 times.
 
Ugh.
 
These structs aren't really reviewable...
-1
Q: How's this approach for game rendering?

2013AskerI'm writing simple 2D games in order to learn more about how they work. For Tetris, rendering was pretty simple. But now I'm making a platformer and I feel like I need more abstraction. My idea is to have a render queue and use the following structures to allow every object to draw itself. Are t...

 
@Mat'sMug So do I, but I haven't written it yet. I'm still getting rid of the old code. I'll post it too once it's done. — 2013Asker Apr 11 at 18:04
 
All because some brilliant higher-up was like "You know what would be a great and totally realistic idea? If we rewrote every single application we have from C# into HTML-5/JavaScript in six months."
 
7:41 PM
@JeffGohlke couldn't you just extract the duplicated code into a method?
 
@syb0rg close?
 
@Mat'sMug Under what reason? Too broad?
 
@janos Yeah, that's what I want to do. But it's all meshed in there with about a thousand different frameworks, like AngularJS and Rho and Require and about a thousand other things, so actually hooking in a new file takes a feat of a small demigod.
 
"Broken" code close reason also states "Or code that's not yet written"
 
@JeffGohlke ouch, too bad then
 
7:43 PM
Woah! Large answers from a new user:
0
A: Conway's Game of Life in C++

user16770Two major suggestions: First, lets try speeding everything up by taking advantage of the nature of Conway's game of life and the way C++ handles pointers. When you evaluate Conway's game of life it's a two part process, first you copy all of the entries into a new array, then you do your computa...

 
bring ammo!!
that answer could use some MathJax I think
4
at least some backtick-formatting
 
This right there is probably what will keep new users here
plentiful voting ;)
and invites to the 2nd room
 
Not even a StackOverflow user. I wonder how people like that stumble into CR.
4
 
DAMN. 10 votes in just a few minutes. Why can't we do that kind of voting more often?
2
 
7:51 PM
Welcome to Code Review! If only all new users were like you!! Keep reviewing and you'll quickly accumulate imaginary internet points and privileges - feel free to wander our meta site and to come say hi in The 2nd Monitor! Hope you stick around ;) — Mat's Mug 5 secs ago
 
Fastest nice answer in the west
3
 
Yeah, this question has gotten HOT.
 
one vote short:
9
A: Conway's Game of Life in C++

janosconst int gridsize = 75; //Making this a global constant to avoid array issues. Not at all clear what you meant by this comment. Also I think it's better to use all uppercase letters for global constants. Instead of: if(grid[a][b] == true){ you can write simply: if(grid[a][b]){ In yo...

well actually that one too
9
A: Conway's Game of Life in C++

JamalOne major thing: do not pass C-arrays to functions as they will decay to a pointer. In C++, you should use storage containers instead of these arrays, which are safer and more intuitive for such uses. You may consider an std::vector of bools. In this case, it would have to be 2D: std::vector<...

 
they're all close
 
:)
 
7:52 PM
I'm sure to napalm-strike that question tonight!
hey thanks Santa!
 
That certainly made for an additional answer or so. 12 votes to 10K.
9
A: Conway's Game of Life in C++

ChrisWIf you're going to do it in C++ the you might as well use a class. For example if grid were a data member of a class, and the various functions were methods of the same class, then you wouldn't need to pass the grid as a parameter to each of the various functions methods. a and b aren't bad vari...

Almost there!
 
The moderators have had a discussion, and we are proposing new guidelines for posting follow-up code. Specifically, we would like to end the practice of letting the OP append revised code to a question. Since this is a departure from past practice, please read and provide feedback. We plan to upgrade this to status soon.
11
8
A: How to handle code review iterations?

200_successYou have several options for follow-ups: If one of the answers gives you good advice with clear directions for improving your code, just accept the best answer and upvote any other answers you feel were helpful. The checkmark that you confer is the best way to show appreciation on this site, a...

 
@janos: Thanks for the String.intern() hint, I guess we could change a complete String cache/pool to it in some legacy code.
 
@Jamal Wow, that's the best answer I've ever seen from a new user. I hope he sticks around.
 
sure @palacsint, just mind the PermGen space limits
guys, don't upvote me today anymore, I already overshot... (you could save the sentiment for tomorrow though, that would be nice ;-)
 
8:08 PM
@janos It seems that it has been changed in Java 7: stackoverflow.com/a/16298053/843804
 
half-way through Java7, mind you.
 
man, so hard to keep track of these things...
 
:-)
 
@Corbin Me, too! And it was accepted.
 
Oh, that's awesome
 
8:13 PM
well deserved
 
And we're still at the very top of the hot list. It should get plenty of exposure.
 
That's actually not a bad idea to game the system and get more visibility. Just everyone wait in the chat room, choose a question, and simultaneously upvote everything. Haha
 
It only works with new questions, though.
 
Serial chatroom upvoting
 
110 to 10K and 70 to repmax.
 
8:20 PM
That doesn't add up.
 
They're both separate.
 
see you guys tomorrow
 
later!
 
Later!
 
... which means I have max potential for today
 
8:29 PM
Them being both seperate, is exactly the problem.
 
@Vogel612 thanks!
 
probably my best shot at destroying someone's UoW+Repository code with EF: codereview.stackexchange.com/a/47180/23788
ok gone now - later!
 
nice UML
 
Anonymous
;_;
 
last I checked C# wasn't doing so hot either
although, here is something to remember
Tiobe reaches its assessment by looking at how often languages are searched on in popular search engines and sites such as Google, Bing, Yahoo, and Wikipedia.
the top 4 languages are so easy to break, which is why people are searching for them
mobile dev is the reason for objective c on the rise
@PatoSáinz maybe Perl devs are just getting smarter?
 
9:03 PM
@Corbin Out of curiosity, I wrote a query to see whose first-ever answer had the highest score. Sadly, the score correlates poorly with quality.
 
Aww :(
 
Maybe I should rename the query to "Beginner's Luck".
 
Anonymous
@BenVlodgi no!
 
@200_success Yep. :-/ Many of those top answers are lousy reviews.
 
on lousy questions
 
9:10 PM
if you guys want to put me on that list... feel free to do so ;)
 
That too.
 
I think it was alright for my first
http://codereview.stackexchange.com/a/43418/38054
more of a helpful rework than a review
 
Even more discouraging, the good score on the first answer hasn't translated to particularly high reputations in the long run, in general.
 
it is encoraging to get some rep on your first post though.
 
Maybe. But look at the data!
 
9:18 PM
My first SO answer was me going back to an unanswered post that I eventually found an answer to... 2 weeks later it was accepted, and I got interested in posting more , so I did.. then realized how much SO sucks and somehow wound up on here
 
9:54 PM
0
Q: Longest palindrome in a string

bazangPlease be brutal, and judge my code as if it was written at a top 3 tech company, straight out of college. (The method signature, and input parameter is given by the problem, so don't worry about that) Worst case complexity: \$O(n^2)\$ Space complexity: \$O(n)\$ Time it took me to solve this: ...

 
10:07 PM
@Mat'sMug Nice invite to that new guy!
I'm going to see what I can do about @rob0t now
@rob0t is online.

 CR Answers

RSS Answers Feed
I should probably rewrite @rob0t in a language that I am proficient in...
 
10:24 PM
@200_success That top-scoring answer was migrated from SO ... it may have gotten the votes before the migration
 
New (sort of minor) answer:
0
A: Is there any problem with this insertion sort implementation?

JamalSome minor (but important) things beyond what @sepp2k has mentioned: main() should have a return type of int. Unless this was some copy/paste error, not having a return type indicates that this code wasn't even compiled, otherwise it would've failed. Do not use global variables: int array1[SI...

 
10:59 PM
0
Q: C++ - Insertion Sorting

matheussilvapbFrom Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there. It repeats until no...

0
Q: Improving binary search with heurisitcs or something else

gramme.ninjaCurrently I'm using a binary search algorithm to search an index of a tree that represents an XML file. Can I use heuristics to improve the search? What can I do to improve this search function? Here is my search function, in php, so far: http://pastebin.com/5aaTkpt1 The reason I haven't paste...

 
11:18 PM
I have a new question prepped for reload.
 
11:29 PM
> Unless this was some copy/paste error, not having a return type indicates that this code wasn't even compiled
Kids these days…
 
You know, Jamal is one of them ... right?
 
Now ... GET OFF MY LAWN!
 
11:55 PM
1
Q: optimize RecvData wrapper

user3238714it is my first post just want to ask how can I improve the string RecvData() can someone give me hand in how to improve it my code ? std::string Socket::RecvData() { std::string strBuffer; do{ char buffer; int recvInt = recv(s_, &buffer, 1, 0); if (recvInt == INVA...

 

« first day (345 days earlier)      last day (3678 days later) »