« first day (1172 days earlier)      last day (2861 days later) » 

10:01 AM
I can't do this
it violates the idea of code review to just write answers like that
the result is something like
<code> wrong, <code> wrong, <code> wrong
 
<everything> wrong
 
10k + only:
what happens when I try to write crap answers
 
@N3buchadnezzar It happens. We all get downvotes once in a while.
 
it... it hurts
 
@Pimgd So, write good answers instead?
 
10:05 AM
@Pimgd I did that with the hangman answer. Every time I thought he had written something decent, it turned out to be sub-optimal at best.
 
takes too much time to explain everything that is wrong with the code
 
@Mast No, no. This means war.
@Pimgd Burn it, start from scratch?
 
The only way to really beat a downvote is to write an even better question next time.
 
1
A: Simple C# Interest Calculating Program

MattLooking at your code I see the following. Why are principle, interest and numYears public? There are no comments in the code. I think it would be better if most of the code was in a class and main was in Program on its own. There is too much static stuff. Its a matter of preference, but you cou...

yay, someone else did it
 
hardly a good review
> There is too much static stuff.
> (..)
> It causes confusion and can introduce problems so isn't a good idea.
> (..)
> I don't think this is a good idea
> (..)
> Its a long time since I though about the reason why, but for loops are quicker (I think)
no explanation, no reasoning, guessing, vague
 
10:16 AM
It's a start, but doesn't finish.
 
I can't review that code
it's just...
there's a underlying flaw
which is that the program can quit at any time
and it basically ruins everything
and combine it with while loops everywhere
and input output logic twisted together with calculation logic and flow logic
and the whole program is a mess
recommend reeducation of programmer
 
goto exit
 
and then a total rewrite
@Mast pls no
 
Python should really not have implemented quit()
 
10:20 AM
@Pimgd Are you riding this train?
 
probably
but it's not nope
it's just blehhhhhh
Like half stale bread
 
@JeroenVannevel ... what happened to " else if"
 
@N3buchadnezzar I thought it was only accessible from IPython and the likes?
 
did you forget programming
help I'm stuck in grumpy rant mode
 
10:23 AM
what else if
That's 3 nested if's deep
 
@N3buchadnezzar This might interest you then, ;P Python exit commands - why so many and when should each be used? There should only be os._quit() and SystemExitIMO
 
@JeroenVannevel Please make it die.
 
                    if (inlineArrayCreation != null)
                    {
                        amountOfFormatArguments = inlineArrayCreation.Expressions.Count;
                        goto placeholderVerification;
                    }

                    // If we got here it means the arguments are passed in through an identifier which resolves to an array
                    // aka: referencing a variable/field that is of type T[]
                    // We cannot reliably get the amount of arguments if it's a method
 
You have 5 votes left for today
 
There are 2 more if levels above that
 
10:24 AM
                    if (inlineArrayCreation != null)
                    {
                        amountOfFormatArguments = inlineArrayCreation.Expressions.Count;
                    } else if (hasObjectArray)
                    {
                        return;
                    }
Fiiiiixed.
 
Just doing the lords work, mam.
 
                    if (inlineArrayCreation != null)
                    {
                        amountOfFormatArguments = inlineArrayCreation.Expressions.Count;
                        goto placeholderVerification;
                    }

                    // If we got here it means the arguments are passed in through an identifier which resolves to an array
                    // aka: referencing a variable/field that is of type T[]
                    // We cannot reliably get the amount of arguments if it's a method
fiiiiiiiiiiiiiiiiiiiiiiiiiiiixed.
once you make it an else if that is.
 
@JoeWallis Even then, those should only be used by experienced programmers imho.
 
the goto expresses intent much clearer imo
 
@N3buchadnezzar Well no-one should really use os._quit(), and SystemExit is good for when you need to say the program failed... Which are both things novices won't be doing
 
10:26 AM
Exactly =)
 
The only reason that a goto is helping your code be "much clearer" is because it's a long winded section of checks without explanation anyway
 
@Pimgd Now make it a PR.
 
your guardclauses have taken over your code
 
@JoeWallis Well quit() should just make a hand appear out of the computer, and slap whoever tried to write it.
3
 
It's for use in IDLE... the design rational makes sense...
 
10:28 AM
Not good enough.
 
It does make sense in IDLE and IPython and the likes, but it should be highly illegal in actual code.
 
@Mast python -s file.py ;P
 
> Don't add user site directory to sys.path.
How does that solve anything?
Did you mean -S perhaps?
That should disable the imports.
 
Yeah -S
 
0
Q: Dynamic wrappper used to unit test ASP.NET Core MVC Controllers that return anonymous objects

NkosiOriginally created for this answer on SO, I thought there was still room for improvement on the initial basic idea. Also thought about using an extension method to make using syntax simpler. public class DynamicObjectResultValue : DynamicObject, IEquatable<DynamicObjectResultValue> { privat...

0
Q: Better way to write a function with if else?

LiamIm trying to learn how to write better, more efficient JS and wanted to run this function I'd written by here and see if people can suggest an improved method... It's basically a people filter based upon 2 variables, Demo... http://codepen.io/liamgallagher/pen/AXVRAg It works fine but if additi...

 
10:40 AM
Ahh, I love in-the-zone days
 
@CaptainObvious Better way to write a title?
 
@DanPantry It's more like an in-de-zon day here
 
@skiwi Punny!
@Mast 5 votes left
 
ha
Im going to be getting a mac for work, but our help ticket system only works in IE
 
@DanPantry I thought you were about to move jobs?
 
10:50 AM
I'm applying for Riot but the job is not confirmed yet @Mast
 
Takes them long enough.
 
Well, the interview process isn't over yet
I have another interview today, potentially another one after that. BUt after that, it's verbal offer time.
 
:-)
Good luck!
 
@DanPantry Why so many interviews?
 
Riot is very thorough @N3.
@Mast Thank you :)
 
10:52 AM
Do you have to write FizzBuzz in more and more obscure languages?
 
Actually I haven't been asked to write a single line of code so far because the position isn't technically a code position
In the technical interview I was asked far more technical questions related to itsec and netsec than code
 
Be sure not cause a riot during the interviews though and good luck!
 
lol :) This is the last but one, I've already had loads. At this point I believe the final interviews are a formality
 
> it is often better to go ahead and do an operation, then choose to inhibit or ignore some or all of the results, than try to conditionally perform the operation. The usercmd_t generation relates to this (and other messes related to the interaction with game over bindsets), where the usercmd_t are only generated when they “need to be”.

The way we have traditionally measured performance and optimized our games encouraged a lot of conditional operations – recognizing that a particular operation doesn’t need to be done in some subset of the operating states, and skipping it. This gives bette
interesting thought
 
@DanPantry Perhaps they gather the two best candidates and make them duel to death.
2
 
10:59 AM
@JeroenVannevel Sounds like a problem with side effects being where they shouldn't be instead of a performance thing
 
sure, but side effects are inevitable in a realistic scenario
so a pragmatic approach to prevent these issues is going this route
 
I'm not saying avoid side effects, but if you get yourself into a situation where not calling a method breaks a side effect on the other side of the app, always calling it isn't the right solution
The problem there is that either your documentation sucks or your code is factored badly
 
@DanPantry Why not? It will solve the problem in 100% of the cases
 
because it sweeps the dust under the rug :\
 
@Pimgd Many are jumping on that calculator question.
 
11:03 AM
@JeroenVannevel though to be fair I can't say much without being given an example of code in question
 
There will always be dust though. The idea behind this is to embrace it, take the (small) performance overhead and pitch that against the (almost) guarantee that there will be less bugs than if you tried to be super clean the entire time
 
Monking
 
@Vogel612 Monking! Sorry about the star wall.
2
 
@N3buchadnezzar @DanPantry If they do that, watch out for how you use your snowballs.
 
eh why?
 
11:06 AM
He's all over it.
 
@Mast you mean the kind with rocks in them?
 
@Vogel612 No.
 
@Mast wat?
Sorry, I don't get the joke
 
Footage (11 seconds) @DanP @Vogel
They got a rematch. It happened AGAIN.
 
YouTube is blocked in work unfortunately, so I'll take a look when I get home
 
11:09 AM
What happened, basically, is during the All-Stars 2015 they held a couple of 1v1 matches.
If you throw a snowball on a player, you can activate it again to swoosh into your enemy.
 
@Mast More interested in watching super smash brothers melee unfortunately. More fun to watch for me personally =)
 
If that enemy happens to be recalling, you'll swoosh into your enemy base.
Insta death.
 
was that before snowballs did damage?
 
@N3buchadnezzar Tough to find good opponents though :-)
 
@Mast Ahhh. I thought you meant the ARAM snowballs
@Vogel612 yes
 
11:11 AM
Yes, this is one of the reasons why they made snowballs do damage IIUC.
 
/r/leagueoflegends is leaking
 
To interrupt the recall.
 
@Mast We play at uni, my friends are hella good compared to me. Nothing compared to the international level though.
Well people watch soccer without playing it themselselves.
 
@N3buchadnezzar I'm Diamond - top 0.5% - and I'm still nothing compared to the international level. Pros are ridiculous. I've played against Febiven in the mid lane (my main role, in a favourable matchup for me) and I got toasted.
 
11:20 AM
wow... Generics are kinda out of hand....
 
did anyone bookmark our conversation yesterday?
 
@Malachi This one?
 
@Vogel612 Nothing special to see here
 
Is this really how one should C#?
using (var gp = new GroupPrincipal(pc))
using (var ps = new PrincipalSearcher(gp))
using (var psr = ps.FindAll())
Looks odd.
 
@Mast Yolo, bro.
 
11:26 AM
Isn't this working around the scope limitations or something?
 
Where's your brackets?
 
@Mast looks completely reasonable
though you might prefer to pack it into one statement
 
@Mast Nope, though it probably violates SRP.
 
@Mast lol, yeah I bookmarked it. I was able to find it
how do I get to the IL tab of LinqPad?
 
click on the IL tab
 
11:31 AM
is that something that comes with the paid version?
 
don't think so
just make sure you've compiled the code
aka press Play
"Register online!"
"but first call us and pick up a PIN code at the office. Then go home to register"
 
@JeroenVannevel same thing with my bank
I wanted to reset my PIN
went online, through the FAQ etc to reset my PIN
told me I had to either go into store or call them up
and at neither place would they ask me for any more ID than I would have given online anyway (i.e, they didn't ask for a passport)
it's dumb
 
At my bank I have to ID myself for just about anything. The moment you need to speak with a cashier is the moment you need to ID.
I think I can reset my PIN and nuke my card over the phone, but they won't tell me anything over phone.
You'll get a letter with a pin, a letter with a card, etc.
 
@N3buchadnezzar what calculator question
 
@Pimgd The one you complained so much about. Do not tell me you have already forgotten about it?
 
11:47 AM
I kinda had?
I don't like remembering blehhh things
5
 
Don't we all?
 
@Pimgd Anyhow it now has three (that is 11 for you binary folks out there) answers and a non-empty set of votes.
 
I like it when my vote sets are non-empty.
 
Dont we all?
 
2 more suggested edit reviews till badge.
 
12:00 PM
[Zomis/Monopoly] Zomis created repository
 
Get off my lawn queue!
@Duga @EBrown How's yours going? Let me know if you need an international beta-test.
 
Monking
 
Monking @syb0rg
 
@syb0rg Learning a machine how to hangman should be easy right?
 
12:16 PM
@N3buchadnezzar Mmmm, depends on how you approach it
I dunno about easy... but there are certainly harder things to do in the world
OP put in effort to fix up question, needs recognition: codereview.stackexchange.com/questions/135194/…
 
@N3buchadnezzar Don't teach a machine how to hang. They do that out of their own plenty of times already.
2
@syb0rg Yea, encountered it in the re-open queue already.
3 more to re-open, or a hammer.
Crowbar?
 
@syb0rg As a start it would just need to be tested at the letter frequency right?
Then have some node thingies with word tuples that ofter appear togheter
^ Me not knowing **s about machine learning.
 
possible answer invalidation by Mathias Ettinger on question by Lin Ma: codereview.stackexchange.com/posts/135245/revisions
 
@N3buchadnezzar Well first you would need a game's API to use, then you need some way to gauge how close it is to winning (for the cost function)
This type of answer isn't allowed, right? codereview.stackexchange.com/a/135261/27623
 
@syb0rg doesn't add anything new, eh?
 
12:21 PM
How close it is to winning should be simple right? Just check how many blank words are remaining. Blanks / words total
 
@Vogel612 OP only implemented half of my advice ಠ_ಠ
and definitely nothing new
 
lol free downvotes and NAA Flags...
 
@Duga Nah.
A fragment of a powerpoint slide I got with a book today:
 
What about like for once: comment? I am looking at you
 
My eyes!
 
12:25 PM
Please do not post an answer to incorporate feedback from answers, doing so goes against the Question + Answer style of Code Review. This is not a forum where you should keep the most updated version in your question. Please see what you may and may not do after receiving answers. Asking a followup question for an example, however is very much welcome =) — N3buchadnezzar 39 secs ago
> Posting a self-answer
> If you want to show everyone how you improved your code, but don't want to ask another question, then post an answer to your own question. Selfie answers are acceptable on Stack Exchange sites, and even encouraged: there is a self-learner badge you can earn for that. Selfie answers can even be upvoted, downvoted, or commented on in their own right. However, your answer must meet the standards of a Code Review answer, just like any other answer:
- Code-only answers that don't actually review the code are insufficient and are subject to deletion.
- Describe what you changed, and why. (see above point)
 
@Pimgd Omnomnomnom. Must have moar questions.
 
"We are pleased to inform you that your rebate, with the Basic you selected has been processed and approved on 07/19/2016.
Your MasterCard® will be mailed within 5-7 weeks."

How hard is it to ship a gift card lololol. Rebates are always insane.
 
- Give credit to any other users who may have helped you
 
@Mast Ugh, not with that code tho
 
The answer:
> According to syb0rg's suggestion
credit given.
> I refactored the main() and calc_bspline_surf() as below:
> define a struct Surface to reduce the number of arguments of calc_bspline_surf()
> using the temp = calloc(c, sizeof(double)); to replace for-loop for (r = 0; r <= c - 1; r++){temp[r] = 0.0;}
sounds like he described what he changed and why.
It's not code only.
Why are we hating on this again?
 
12:27 PM
Arigato, senpai Pimgd.
 
Because if that user clicks that link and reads that text and goes through that checklist I get the feeling they'll be just as confused as I am right now
 
@Pimgd I tried to find your suggested edit in the "Frequently posted comments", however could not find it. Do you mind posting it there for later?
 
I added a comment;
I think it's perfectly fine to post this answer as "look, I changed my code based off feedback". However, it could do with a bit more explanation in the "why I did this" category. — Pimgd 1 min ago
@N3buchadnezzar what suggested edit
 
Even if it happens to be okay as an answer, it still isn't a good review of the code
 
I also totally agree with you. Should I delete my comment? As far as an answer it is subpar. And is better off as it's own follo-up question imho.
> If you want to show everyone how you improved your code, but don't want to ask another question, then post an answer to your own question. Selfie answers are acceptable on Stack Exchange sites, and even encouraged: there is a self-learner badge you can earn for that. Selfie answers can even be upvoted, downvoted, or commented on in their own right. *However, your answer must meet the standards of a Code Review answer, just like any other answer:*
- Code-only answers that don't actually review the code are insufficient and are subject to deletion.
 
12:31 PM
Well what you've got here is a case of what seems to be contradictory policy
 
@Pimgd While he does give credit, to me I think it's NAA because it doesn't elaborate on the reasoning, the why, how it improves it. Just posting an update doesn't do anything. Saying you did XYZ doesn't answer the question. If he explained reasoning, provided facts, and specifically referenced exact points of change and how it benefits the code to either make or ignore the suggestion, it might be an answer. Just my opinion.
 
That's what we'd call "crap answer"
 
@Pimgd Imho code only is not an answer.
 
@N3buchadnezzar It wasn't code only, but I do agree. There is almost nothing there so it pretty much is code only.
 
@throck95 I think that is what is implied with the wording code only.
 
12:35 PM
Code only is for code only
where the answer is a block of code
 
So if I write "Here is the code" then the code, then my answer is technicaly not code only?
Waa
This seems like a very silly distinction.
 
@N3buchadnezzar With interpretation, you have to look at things in a very black and white perspective. While you and I may agree that what was said doesn't qualify as valid not-code input, others may disagree and it leaves too much room for argument.
 
Splitting hairs over an answer which we all agree really should not be.
 
my reaction is this aggressive because of @Vogel612 remark
> lol free downvotes and NAA Flags...
no.
It's not that clear and it's not an opportunity to heap on as a pile, like you'd do with spam
 
@N3buchadnezzar Pretty much. But it's that split hair that has to be taken into account because if it get's reviewed, it's these things that will be asked.
With a change of topic, though, @Pimgd seems bored
 
12:40 PM
@Pimgd meh. there's that one critical puzzle piece missing.
lemme check meta, brb.
 
I'm not bored because I'm not writing silly stuff in here as usual
 
13
Q: Self-accepting own answer when competing answers exist

PhrancisIt came up in chat that one particular user seemed to be in the habit of: Posting a good question; Receiving good answers; Posting his/her refactored code as community answer, after adapting some things using advice from answers, sometimes with little to no explanation about what they did diffe...

> The problem comes in when you only implement the advice given to you by other answers
the point is that the answer provides absolutely no new information or insight
 
Oh hey, I'm the top answer to that meta post...
 
@Vogel612 Not completely viable though. He still has the original AA accepted
 
@throck95 correct, but that doesn't make the point much less valid
 
12:42 PM
He didn't change to a selfie just because he posted an update
@Vogel612 agree - just thought I'd make the point that will undoubtedly come up
 
> The problem is when your selfie is not actually a review. If you just implemented the advices given in one or more other answers, that's not a review. As such, it's not an appropriate answer on this site. And if it's not an appropriate answer, then it certainly shouldn't be the coveted accepted answer, and you can expect it to get downvoted.
^^ Janos' answer
maybe that should be made more clear in the "what to do when you got an answer" ...
 
@Vogel612 It doesn't really apply to that though. It sort of does, but sort of doesn't. IMO, it might be better to explain that on a self-answer post.
 
sorry to interrupt, but check this out, I thought it was funny, I found a similar post somewhere on Twitter --> github.com/monokal/Shellshock
 
BTW - refreshing so my new name takes effect, always hated this name
 
0
Q: Java password encryption based on time and string

theblindprophetI have a program that: Takes a user specified string Creates password from the string and previous, current, and next day Encrypts the strings Chops some middle characters from the strings (needed to be shorter password) Returns a JSON object with 3 passwords My main concern is that everythin...

 
12:46 PM
A script to display SEE YOU SPACE COWBOY whenever you logout of your terminal. #CowboyBebop https://gist.github.com/danielrehn/d2e6f2129e5f853c3166 http://t.co/itYigB0GWj
 
meh it'll change eventually
 
Horse not found?
 
@Pimgd got quiet :P - guess he wasn't bored
 
@throck95 I have actual work to do, kthx
 
@Pimgd what is this "work"
 
12:49 PM
I'm out
back in whenever
when I get bored again, apparently
seee yaaaaaaaaaaa
 
Please define work! Use it in a sentence! lol
 
@Taztingo They ask "Do you have any opinion to improve ... ?" and that is code review. They ask "Can I save .. ? I mean ..." and that is unclear what they are asking. They give a large amount of badly formatted code which is not a Minimal, Complete, and Verifiable example. — AdrianHHH 39 secs ago
 
Question for those who live outside the US... Here in The Netherlands it costs €16,50 to send a tracked letter internationally (and €11,50 within Europe), isn't that insanely high?
 
@skiwi So that's like 20 USD roughly - tracked letter meaning just shipping tracking right?
 
@skiwi in germany it will add €2,50 to the default fee for international
 
12:59 PM
@throck95 Yep
For reference, a 20-50 gram letter without tracking costs €2,50 sent internationally
 

« first day (1172 days earlier)      last day (2861 days later) »