« first day (406 days earlier)      last day (3612 days later) » 

6:01 PM
I could not resist the community bulletin caption "Should we kill Santa?", and following that link eventually ended up here
 
I knew that title would interest many people. Are you getting yourself more familiar with the site?
 
Excellent, it works.
2
 
I knew it! Hi @HugoRune, welcome to CR!
 
yeah, I signed up for this site quite a while ago, but I never got around to checking it out until now.
 
@HugoRune Allow me to join in welcoming you to our little niche (so to speak).
 
6:10 PM
OK, what am I missing here....
Hugo, that's a nice question, by the way.
I could answer that ... ;-)
 
0
A: Checklist for how to write a good Code Review question

user1601638The check-list is a good one (Did I satisfy all requirements in my most recent post? I must check) and I endorse the Dagg comment but for an odd reason: the Rule of Three. The Rule of Three is that any list should contain three and only three items. If detail is necessary, each item should have t...

Interesting answer...
 
@rolfl Unfortunately, there seems to be a limit on the length of an answer I can post here. :-)
 
@Jamal seems more like a very long comment to @DaggNabbit's answer..
 
And a ramble
 
flagged as NAA - it's not attempting to answer the question, ..it really belongs as a comment under Dagg's post I think.
might be too long to take as is though
it's a nice comment though.
hmm was cropped.
 
6:34 PM
I edited out some of the fluff. It fits now.
 
nice
 
6:56 PM
0
Q: Preventing IF Statement In Loop

DrazickI have the following MATLAB Code which I want to optimize. It's related to image matrix (2D) which I want to filter. The problem is I'm trying to access neighbors of the pixel which might cause problems at the boundaries of the image matrix. vWeightsCoeff = zeros((2 * numRows * numCols), 1); we...

 
user image
3
does this make sense?
 
@Mat'sMug I'd say it looks reasonable, yes.
 
0
A: Checklist for how to write a good Code Review question

Mat's MugPerhaps something like this could help situate CR in StackLand:

 
7:24 PM
Monking
@skiwi What kind of AI do you want? What kind of game?
 
@SimonAndréForsberg More or less an AI that creates a game, as opposed as to being an opponent
And what game... Maybe somethign text-based, but gotta be quite simple and attractive
Don't know if you've ever played text-based browser MMORPG's
 
@skiwi An AI that creates a game? How do you mean?
@skiwi I haven't played them, but I can imagine them.
 
Hey all
 
@SimonAndréForsberg mmorpg.com/showFeature.cfm/loadFeature/8533/page/1 You should read this :)
 
@AlexL hi!
 
7:27 PM
Got quite some inspiration from that
 
@Mat'sMug That goes in the direction but is not quite what I had in mind
 
0
Q: Javascript Class-Definition Comparison

majaWhenever I needed something similar like a "Class" in Javascript, I wrote it like this: function Point(x, y){ var self = this; self.x = x; self.y = y; self.dist = function(){ return Math.sqrt( (self.x*self.x) + (self.y*self.y) ); } } var p = new Point(10, 20); p.x = ...

0
Q: Would this be considered bad coding style in the corporate world?

Magister LudiI am very new to programming and this is my first time posting a question on Stack Overflow so please tell me if I am doing something wrong. I wrote this program: #include <stdio.h> #define printS for(i=0;s[i];i++){printf("%c",s[i]);} int i; char s[] = "Hello World!\n"; void main() { printS...

 
8:05 PM
> Should we even go one step up and make a flowchart on how to use the SE network during programming to get people to better understand when to post on CR?
 
@Mat'sMug: Yeah, but I meant something with decision points like: Did I research the problem on google for more then 15min? No -> Do some more research
 
oh, right. I'll edit.
 
@Nobody So like a flowchart?
 
@AlexL: As I have written in the text that @Mat'sMug cited :)
 
@Nobody Oh sheesh, I didn't even see that!!
 
8:13 PM
0
Q: Uniqe Key Having 8 length

ni3.netHello guys I have to generate the unique key having length 8 which should be comprised with some set of character {B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z,2,3,4,5,6,7,8,9} Now I have written a program that will generate it. but I am not sure it will generate the unique key. could you please re...

1
Q: Room for improvement on this Text Analysis web page?

Arron GrierFor a homework assignment, I made a web page that has a text area. The user inputs some text, hits the analyse button, and the output is supposed to be a list of the frequency of words of a given number of characters. For example, "one two three" would be two words of three characters and one wor...

 
One more upvote for this new user?
2
Q: Would this be considered bad coding style in the corporate world?

Magister LudiI wrote this program: #include <stdio.h> #define printS for(i=0;s[i];i++){printf("%c",s[i]);} int i; char s[] = "Hello World!\n"; void main() { printS; } It outputs exactly what I want it to but I have no clue if this would be acceptable to use if I were working for a company. Would this ...

 
@Jamal: did you seriously advice to printf a string by looping over the characters?
what about printf("%s", s);?
 
@Nobody No, I didn't mention that specifically. I just used his function code as is.
 
Yeah but that would have been my biggest review point (besides the macro)
 
You could post an answer, then.
 
8:19 PM
@skiwi Indeed a good read. Very interesting.
 
@SimonAndréForsberg So I'm wondering in what way it could be used :)
 
@skiwi I'm first of all wondering how it works. Or rather... if it works well enough to be used.
 
@SimonAndréForsberg That'sf or me to ensure ;)
TTG
 
@Jamal: Done
although I feel like my tone is a bit too harsh
As I am no native english speaker I really have trouble to detect how hard the tone is (apart from some signal words), especially in written form
 
@Nobody "Why on earth" does seem a bit rough...
 
8:32 PM
I think the tone is perfectly fine if someone is going to code like that in a company ^^
 
@Nobody Probably so, and you can edit it out if you wish. Either way, +1
 
@skiwi That's true, I voted it up anyways because it was a good answer
 
To be honest, I would've just reserved the "why on Earth" for the macro. :-)
 
@Nobody I'd say it's more overexcited than harsh
i can picture your face turning red while you say it
"never use macros" -> "don't use macros"
"never do this unless it is absolutely needed" -> "don't do this"
 
@DaggNabbit It certainly did ^^
 
8:37 PM
"Why on earth do you print the string by calling printf for every single character" -> "there is no need to call printf for each character"
idk, that's more like how I'd write it
 
While for a review your suggestion is more appropriate I am genuinely interested in why the OP did so in the first place
 
I honestly didn't know that you could just print an array with puts() in C. I'm way too used to C++...
 
@Jamal: It is a C-String and of course there are simple output functions for strings :)
 
+1 nobo
 
That is true. Gotta brush up on more basics. Were this for C++, apart from using std::string, I would've used std::copy plus ostream.
 
8:41 PM
@Jamal: This would have been overkill again. C-strings nicely interoperate with C++ streams
 
I was just about to correct myself there. Ugh, I'm slow today.
 
altough, if it were C++ I would have recommended using std::string
 
Obviously. I am glad this wasn't tagged as , though.
 
hmm, i still need to post some c++ code for review
 
:D
@Nobody: It looks like that question has become hot.
 
8:58 PM
@Jamal: Our voting policy is breaking SE's hot list ^^
 
And we need as much question-hotness as we can get. :-P
 
@Jamal: I think there is enough influx, we need as much stickiness as we can get
should we put superglue on our exploding bear traps?
 
I approve!
 
evening all
 
@Nobody: New C++ question incoming, and this one looks a bit messy.
 
9:05 PM
@Jamal: OP states that code is incorrect:
> One thing I notice is that if I enter an expression like '1000000000000000000000000000000*100000000000000000000000000000', I get some result that is obviously incorrect.
 
@nobody he don't ask to fix it, only a confirm if iot comes from the doubles
 
0
Q: Simple C++ Calculator Which Follows BOMBDAS Rules

Sky LightnaThis was my first attempt at making a C++ calculator. The user basically inputs an expression (I'll use 1+1*(9*(11-1)) as an example) and the program searches for and creates vector for parentheses (which is a class i made which records its position in the string), like so: String: [1][+][1...

 
gray zone ;)
 
yep, I would get this checked on SO
 
you could give him a review, as java guy I clearly see already he need it
bad formatting, many comment lines
 
9:08 PM
@chillworld: go for it, I am busy and wanted to be in bad for an hour now
 
@Nobody lol, I'm not up to give a complete review in c++
and just an answer for comment lines, formatting and maybe var names is a little stupid in mine eyes
 
@chillworld: I don't think so and maybe you find even more when having a closer look
 
@Nobody I don't think so, if it was me I shoot him for this (if it was java)
expressionString[index] == '+'
but no clue if it is legit in c++
 
it is
though not very nice
 
9:28 PM
0
Q: Need to provide an interface (for plugins) for taking input Type A, and returning output Type B

user986697public interface IMyInputProviderPlugin { IMyOutput Provide(IMyInput data); } This is an interface I need to provide so that I can dynamically load the dlls and not have them bound to my implementation. However, upon reading this, it seems like this is an anti-pattern? http://blog.ploeh....

 
2
Q: What makes for a good answer?

ckuhn203I found myself looking for someplace to point a new user on why his answer wasn't a good answer. I couldn't find anything except the fairly unhelpful Help page's "How do I write a good answer. So, I'm putting it to the community. What makes for a good Code Review? What are the essential parts? ...

 
@CaptainObvious Programmers (or just closure)?
 
if off see you later all
 
bye @chillworld
@Jamal I'd try programmers
 
> Body is limited to 30000 characters; you entered 37316.
:(
 
9:36 PM
@DaggNabbit Been there, done that!
 
i guess nobody will ever see this code but me
user image
3
 
@Simon - for the record, there is a special place for you on Code Review....
long questions/answers get auto-flagged...
you have the most.
 
they do?
don't write too much, it's suspicious!
i suppose the unit tests can go
and the makefiles
 
@DaggNabbit: Yeah, and too many links are also not okay:
22
Q: Ideone paste prevention bug?

NobodyWhen I was answering this question I wanted to insert a link to ideone.com - where the code I wrote was used as a demonstration - and I encountered a message that said: Please make your answer complete by including relevant, formatted code inline(don't just link to ideone.com): Screenshot: ...

 
9
A: Since when was "Post excessively long" a flag reason, and what should I do about it?

jmort253Length is but a symptom of an actual problem with a post. Short posts are not bad, for instance, but oftentimes they miss critical details that make definitively answering a post extremely difficult. It's not that short is bad; it's a symptom. Likewise, posts that are long may not be bad simply...

 
9:40 PM
@rolfl I am not surprised feel proud!
 
@rolfl because conciceness and brevity is always the best policy. Always.
crap, the unit tests weren't in there
 
> Yet, posts that are long are more likely to lack the focus that accompanies conciseness and brevity. Long posts sometimes tend to be long because they contain unnecessary information, or because they contain more than one problem.
 
i cant post this
 
Or because they contain a couple of classes...
 
You should also probably know that we routinely just decline those flags.
CR is not SO
 
9:42 PM
@rolfl Yup, that I knew already.
@DaggNabbit I actually removed a class from my latest question and just wrote a summary about that class instead. For big(ger) code projects, it's impossible to include everything..
 
i imagine there are plenty of sites on the network where detailed questions or answers would be appropriate
@SimonAndréForsberg that's not a bad idea
 
@DaggNabbit - it cuts both ways on CR... long posts are a double-edged sword.
 
I have a feeling that my next question will also be excessively long, which will be about my Minesweeper probability calculation code (which I bet @rolfl might be quite interested to have a look at by now)
 
@rolfl how so?
 
You are going to get either partial reviews (small reviews on a subset of the code), or, you may get some general comments about the overall design, but not much detail.
 
9:45 PM
i just say whatever i have to say, idc how short or long it is
 
@rolfl Or you may end up paying a bit fat bounty on it to draw enough attention to it.
@DaggNabbit funny you should use "idc" as an abbreviation there.
 
case in point ;)
 
For long questions, when they are 'dense' like Simon's normally are, it takes a large amount of background investigation to understand the context of the question... I have to 'immerse' myself in the problem.
 
yes
sometimes that is what the asker wants
 
(I have to do that for short reviews too).
But, I cannot afford to immerse myself in these big problems all the time.
 
9:48 PM
true
 
The SQL review I did yesterday was probably the most detailed review I have done in a month.
 
Well, I am done with my problem so good night @everyone
 
@DaggNabbit If your question is in Java (or another reasonably understandable language) and it is about an interesting problem, then I am quite likely to review it. (It may take some time, but still)
Night @Nobody
 
@SimonAndréForsberg c++, but it's too long to post
 
C++? Then count me out. Or should I say, "Count me as C--"?
 
9:50 PM
lol
it's not that hard to understand i think
i mean i wrote it and i have no clue what i'm doing so i kept it simple
 
I wonder if this is also where user-retention comes into play. If it's a "simple" review (like the question I've just reviewed), it'll take less time for someone to know how to answer. But for longer questions, it'll take more discipline (more of a "code review spirit" if you will) to read through the question and write a review. So, the user-retention issue may just be a core issue of ours, at least in terms of posting answers.
 
I can usually read C++ code, but I can't really review it. C++ is just full of magic to me.
 
@SimonAndréForsberg Same with Java, to an extent. So far, I can only understand the aspects that relate to C++.
 
@Jamal this is why i'm really detailed with the questions that are important to me
 
Simon, I had reason to browse my tag scores the other day. Despite earning 'generalist', I have only 1 language tag in my top 10 (Java), and my 'second' language is SQL at #12, and then, amusingly, I have C# at #13.
 
9:52 PM
i hope that whoever takes the time to read and understand it will leave a great answer
doesn't matter if i need to wait a year for that answer
 
@Jamal But a "complicated" review (like my questions usually require) can be very valuable for the asker. And can also be helpful to the answerer (perhaps they learn a thing or two while reading the code).
@rolfl Is Android a language-tag? If not, I need 11 more C# upvotes.
 
@DaggNabbit Unfortunately, we may still be judged on the time it takes for a question to receive its first answer.
 
yeah but that's no excuse for a half-assed answer
 
Android is tag #15 for me.
 
@SimonAndréForsberg I agree. Again, it comes down to discipline. Many users may just want fast results, which we cannot always fulfill. That alone may drive some away, even though our intention isn't to have others want a long time.
 
9:55 PM
@Jamal Stats are not important, only reviews are important. And that we will graduate before PCG, of course.
 
the point of the site is to help people, right, not to justify its own existence just for the sake of it
 
^^^^ depends on your perspective
 
@DaggNabbit I agree that the point of this site is to help people.
 
^^^^ depends on your perspective
 
@rolfl what perspective is there other than users of the site?
 
9:57 PM
The owners of the site.
 
@SimonAndréForsberg That may still have to do with graduation. Of course, Grace Note can clarify that if needed.
 
the owners of the site definitely don't seem to be going out of their way to justify its existence
 
@rolfl Just a couple of days or weeks after I joined the site and this chatroom, I was told (by @Mat'sMug) that we, the users, own the site. In a way, I still believe that.
 
we do?
i want my cut of ad revenue
 
Nov 19 '13 at 1:00, by retailcoder
@SimonAndréForsberg Well hello, welcome to CR chat! I was kinda scared to post anything on SO chat, but here.. it feels like we freakin' own this site! Actually, we do!
Actually the first message @Mat'sMug sent to me.
 
10:01 PM
Ultimately, of course, SE owns the site. But they don't define it, unlike us. We're still responsible for keeping it active and healthy.
 
In a sense, we do.... ^^^ that.
 
Yeah, OK, he said "it feels", but still :)
@Jamal Exactly.
 
Up on my soap-box:
I have to say that the (regular) users on Code Review are fantastic.
13
With access to discussions with other mods about the crap they put up with..... which is just not here on CR.
One of the big differences between CR and other places is that this is not a 'quick-draw' place
 
(soap-box = list of pinned messages)
 
You can't do a quick throw-it-up question (we shut those down fast).
 
10:10 PM
not being able to post this question is bothering me now =/
30k seems too restrictive
all it does is encode and decode json
 
I actually think 30k is a good limit
Can you try and remove a part of it from the question that you think are clean enough, and then explain what that part does?
 
i'd really like a second set of eyes on all of it, since i have no idea what i'm doing
 
If you have the code on github or elsewhere, then provide a link to that code
Is it possible to split up the question in two?
 
maybe
part of it is a variant class
that could probably be its own question
without that file, it's just under 30k
no room left for explanation though
eh, i'll probably post this and get "just use the variant from boost" or something
 
Explain in your question what variant class you're using
 
10:20 PM
it's my own
 
If you don't want the comment "just use the variant from boost", then say that you're using your own variant class. If you have a good reason for why you're using your own, then say so. If reviewers may or may not agree with your reason.
 
well, the real reason is because writing this was a learning excercise
and i only wanted to use stuff from standard library
 
Just make it clear that you're aware of the existing libraries and that you know that those should be used. Surely that should keep people off your back about it. Worked for my recent question where I massively recreated the wheel... :p
 
hmm, that should work
it's also very closely tied to ES5 spec since it's a JSON thing
so for example it treats comparison operators in the same way, as closely as possible
i'm not sure a generic variant would really have been any better
 
The limited domain and the specific operators might actually make it worth having your own variant then. Although, one could easily still say that it should just be a wrapper around boost::variant :p.
 
10:31 PM
yeah, i went back and forth on that
 
I actually wrote my own variant fairly recently too for some bencoding with regards to torrent files. boost::variant just seemed way over kill compared to a glorified union :/ lol
(Well, that and I didn't want to have a boost dependency for 1 thing)
 
pretty much the same reasons i did it
this code is all pretty tightly coupled, i'm not sure i can rip anything out in a meaningful way
and i think it needs to be... the whole thing builds to a single header
the idea is you can just include the header and use it with no additional fuss
 
Yeah, seems like a boost dependency would be a bit of a hassel then.
 
yeah it would have broken the single-header design
the source tree is a bunch of headers and cpp files but it "builds" to a single header by just replacing #includes with the contents of those files
then i run it through a bunch of unit tests under valgrind
 
I'd be interested to hear Jerry or Loki's thoughts on it. There's still a little part of me saying "but... but... but... boost!" I think that's just because SO (and to a lesser extent CR) has drilled in my head "if a boost version exists, you should always use it."
 
10:36 PM
hmm, that is what i should do
i should send Jerry a gift basket or something =p
and then get him to review it
 
And in all honesty, a boost version probably is going to be better than anything either of us is going to write. It's just a question of if it's worth it.
Hahahaha
Instead of a nice little note, the card just has a URL on it to a github repo :p
 
last time i had some weird stuff i needed reviewed he was awesome about taking a look at it
 
It's gonna be really funny if he sees the question later or sees later conversation about it and immediately is just like "you should use boost::variant"
lol
 
nahhh he knows what's up ;)
 
:p
 
10:41 PM
but really, it wouldn't work as designed with boost
you can't just drop the header in and go
 
yeah :/. it would completely ruin the 1-simple-header aspect of it.
hrmmm... most people have boost installed anyway if they're doing any kind of c++ development, so you could just have it as an implicit requirement
still keeps it fairly simple. worst case just apt-get install libboost-variant
 
that is true... how much of a pain is that on windows though?
 
well since it's header only, they'd just have to download a zip, unpack it and tell teh compiler to add that to the include path
 
yeah that sounds like a mess
go on the web, download stuff, move it around or run an installer
 
Yeah, definitely kills the vibe of "just include it!" lol
Idk... You should post your variant, and that will tell a lot about if boost is worth pursuing.
I remember being surprised how hard it was to code a standards compliant variant. All kinds of alignment issues :/. Thank god for C++11 and it's aligned_struct or whatever it's called.
 
10:45 PM
lol Jerry just snuck out
 
Haha, I saw that too
 
my variant kind of cheats
since it's only dealing with a few primitive types, it just has a different member for each type
 
Ah, yeah. In that case, I'd definitely not use boost.
boost is clever and uses at most max(sizeof(T1), sizeof(T2), ...) space, and it's stack based (except recursive variants).
 
Aarrrgghh .... stupid modem
 
But just a few wasted words shouldn't matter unless you really care about space
 
10:48 PM
yeah, efficiency wasn't a huge concern ;)
 
I'm kind of tempted to post my variant now too. variants can become the new linked lists! ;)
 
hmm, i'm interested to see it
i looked at the code for boost's variant for about 5 seconds and said screw this
had no clue what was going on
 
Hrmm, I'll have to find it and clean it up a bit. Coded it about a year ago, so who knows how gross it will be in hindsight :p
 
yeah this thing was about 2 years old, just got done cleaning it up :)
 
not as bad as i remember it, but it could certainly use some clean up :/ lol
 
10:58 PM
@Corbin: Care to take a crack at that C++ calculator question? It's quite messy, and I don't have the energy (nor the number of monitors) to give a very thorough review.
 
@Jamal hadn't seen it yet, but I will certainly seek it out and give it a shot :p
Oooo, actually I did see that when I first woke up this morning....
(and by morning I might mean mid afternoon... lol)
 
I'm writing a review now, and I guess I might as well submit it when it's finished. It'll by no means cover everything.
 
Blerh... I'm not sure if I can muster the motivation for the beast at the moment.
Maybe I'll post an answer of obvious things and update it later
 
I'll mention my part soon. I think a few of the C++ reviewers can each take it apart. :-)
 
11:16 PM
@Mat'sMug Awesome, I was just thinking about doing that on my Windows 8 machine and see how it works
 
@Corbin: Okay, it's been posted. I did not mention everything I can, but I'd like to see others fill in the gaps.
 
@Jamal if someone else doesn't beat me to it, I'll write a little bit about the design of it at some point....
 
Yeah, the design is a big problem here (at least the OP acknowledges that). Someday I'll get two monitors, which should make it easier to handle larger reviews. All I have now is my laptop and trackpad. :-/
 
Ouch. I can't stand not having a mouse :( lol
 
I can handle it for smaller code, but not quite this. I also cannot print this out now.
 
11:30 PM
Yeah. This is quite a wall of code....
 
The OP has accepted my answer, but I've told him to wait a bit. I'd rather lose the accept now instead of later. :-P
If it weren't so fragmented, I could easily edit it into separate blocks.
 
Yeah. And the spacing is a bit atrocious. I can't stand when things are horizontally crazy
 
Eh, it could be much, much worse. If there was no proper spacing and inconsistent indentation, this may literally look like the aftermath of a hurricane.
 
lol
 
11:49 PM
Perhaps if Loki shows up, there won't be a need to provide another answer. ;-) He'll just tear it to shreds in one hit.
 
Haha, yeah. He tends to write pretty thorough reviews.
 
0
Q: Converting any PHP function toString() like in JS

GRIGORE-TURBODISELIn javascript, any function is basically an object on which you can call (function(){}).toString() to get it's underlying code as a string. I'm working on a function aimed to do the job in PHP. Looks like this so far: function fn_to_string($fn, $strip_comments = true) { static $contents_c...

 

« first day (406 days earlier)      last day (3612 days later) »