« first day (800 days earlier)      last day (3200 days later) » 

8:00 PM
You forgot to set the radix on your parseInt()
You should always set it
If the value you enter is, for example, 019 it will return in NaN
Why?
 
@Phrancis has asked 3 questions. @skiwi has asked 2. I have asked... none :O
 
Because 019 will be interpreted as octal, due to the missing radix, and 9 is an invalid octal number
You should always call parseInt(... , 10);
 
Do you all want this one? The code works, sort of: stackoverflow.com/questions/31391940/…
(It's the most recent duga question)
 
Nevermind, self deleted.
 
8:06 PM
Yeah, really nice question...
 
@IsmaelMiguel It's a pretty terrible question but it is a complete program with "working" code that he's asking for advice to improve it
 
Hello.
 
If IE's codebase was put for a review, it would be closed as "containing code that doesn't work"
@durron597 Did you see the print-screen?
 
Sorry to interrupt, I'm having difficulty locating an English speaking C# room, can anyone help?
 

 C#

General discussions about the c# language, Squirrels | gist.gi...
 
8:09 PM
@SeventhSon Depends. Is it to review the code quality or is it to debug?
 
@IsmaelMiguel I did but I don't understand why it's relevant
 
@durron597 That is the question you linked
And the reason why I said "Yeah, nice question..."
 
3 mins ago, by durron597
Nevermind, self deleted.
I might be a CR noob but I do have 10k on SO :-P
 
Yeah, but did you see the formatting of the content?
 
Thank you Durron, I don't know why I couldn't locate it...
I have a debugging issue.
 
8:11 PM
@IsmaelMiguel I dunno, you must've just had a css loading error
 
@SimonAndréForsberg Sorcery!
Classic | Spell | Common | Paladin | Colseccati | 4 | Destroy a minion. If it survives, draw a card.
I love these cards
 
This may be a good candidate for CodeReview@StackExchange.com — Thomas Matthews 40 secs ago
 
@SeventhSon You're probably better off over there, then. Though you would probably be best off writing an MCVE and asking on stackoverflow.com/questions/ask
 
OK.
 
@durron597 I have a cache problem: IE doesn't respect it's limits. I've set it to use only 150MB of cache, and it uses 256MB (on a 256MB RAMdisk)
 
8:13 PM
@ThomasMatthews No it isn't, Code Review is for working code. — durron597 14 secs ago
 
@Mast Here you have your ALL minions
Basic | Minion | Free | Neutral | Nong of Mishines | 1 | 1 | 2 | <b>Deathrattle:</b> Give both players the power to ALL minions this turn.
 
@skiwi That's really begging for death
 
0
Q: Delete item in List A will also delete corresponding items in List B

sw2I have these classes: Branch class: public class Branch { private String loc; private String branch; public Branch() { } public Branch(String loc, String branch) { this.loc = loc; this.branch = branch; } public String toString() { return "(" + loc + ") - " + branch; } public St...

 
I didn't know you knew Groovy @janos :o
Didn't you in your Grails answer specifically say that you didn't know it?
 
8:26 PM
elcome
Welcome, even
 
Monknoon
 
0
Q: How to maintain proper encapsulation for singleton created with data?

RDSpinzI have a singleton networking class as well as a singleton object that needs to persist throughout my app. The singleton is initialized based on data retrieved from a web call, so right now my code works, and I have the following in my singleton networking class: - (void)initializeObjectWithSucc...

 
@skiwi Perhaps @janos knows how to google and learn himself stuff?
 
@SeventhSon - FYI, that C# room you are in is linked to the portugese Stack Overflow, so, no, not likely much english in there.
 
8:42 PM
@janos @rolfl anyone interested:
0
Q: A Groovy Election

Simon André ForsbergImplementing the July 2015 Community Challenge seemed relevant considering it is election time. I decided to go with the strategy pattern as this can be implemented in many different ways. I did my own implementation of this first, and then later also added a "PascalElection" strategy, as that c...

 
What does it take to get put on the weekly voters list? I've voted plenty this week, but I do not see myself there.
 
@SimonAndréForsberg Reading it already
 
Of course you are :)
 
DVLR reached, though, the Pascal looks interesting too
 
the Pascal implementation wasn't really structured how I like my code to be. it relied heavily on resetting the file pointer and reading the data over and over again. I like my things in memory.
Of course, Pascal and Groovy are also a bit... different...
it was helpful to have previous Delphi and Pascal experience when translating it.
 
8:44 PM
1
Q: A Groovy Election

Simon André ForsbergImplementing the July 2015 Community Challenge seemed relevant considering it is election time. I decided to go with the strategy pattern as this can be implemented in many different ways. I did my own implementation of this first, and then later also added a "PascalElection" strategy, as that c...

 
I'm teaching bitmasking..
 
@SirPython Don't know, sometimes it just takes a bit for things to sync.
 
I need your help
I've made a question, and it was answered
But the answer introduces a bug
But again, it is a very cleaver answer and helped me a ton
How should I handle this?
 
0
Q: Date Range Tree

ChaosPandionpublic struct DateRange : IEquatable<DateRange>, IComparable<DateRange> { private readonly DateTime _min; private readonly DateTime _max; public DateRange(DateTime min, DateTime max) { if (min.CompareTo(max) > 0) throw new ArgumentOutOfRangeException("max", "C...

 
9:14 PM
What's your specific issue? other than is.even() should return its result, not print it, which is breaking things. If you want a general code-review, post on CodeReviewsmci 36 secs ago
 
So, @janos, tomorrow is the big day?
 
0
Q: Recursive download articles and dump to MongoDb in python

toyThis is a simple code that uses to recursively download articles from public wordpress api. import requests from pymongo import MongoClient client = MongoClient() db = client.wp payload = { 'number': 100 } url = 'https://public-api.wordpress.com/rest/v1.1/sites/{site_id}/posts' response ...

 
@IsmaelMiguel point it out!
if the answer introduces a bug it's probably unintended
the answerer will know better how to solve it in the context of that answer...
 
@IsmaelMiguel Leave a comment.
 
-1
Q: Singleton networking class

RDSpinzI have a singleton networking class as well as a singleton object that needs to persist throughout my app. The singleton is initialized based on data retrieved from a web call, so right now my code works, and I have the following in my singleton networking class: - (void)initializeObjectWithSucc...

Why is this off-topic?
 
9:24 PM
> I don't know how to initialize all the properties I need on my singleton CPList without setting them
--> smells featur-request
basically it's working as intended, but not encapsulating as planned.
though it seems like OP is having a basic misunderstanding problem about how encapsulation works.
 
@rolfl @janos What's happening tomorrow? (are you talking about the election?)
 
@SimonAndréForsberg Janos get's legendary if he caps one more time
 
ohhh, shiny
 
Site-badge-rankings is my next site-goal, if I can inspire folk for that
 
9:29 PM
@rolfl what do you think, when will the elected mods get their diamond?
 
we need more editors.
@Vogel612 Probably within minutes (about 15 minutes) of the election close.
 
@jacwah what @Vogel612 said. If you interpret the question differently, please let us know your interpretation
 
sheeesh, that's blazing fast
 
The mods will need to accept the mod agreement before they can get access to the mod tools though
I expect I will lose my diamond at about the same time.
 
Then you can start flagging.
 
9:30 PM
I have doctors appointments from 4pm to 5:30 with my kids.
the eclection ends at 4pm for me ;-)
So, I won't be around to welcome in the new folk
 
How do you guys cap?
 
janos answers lots of questions with really good answers.... works for him ;-)
 
@Hosch250 who's "you guys"??
 
I've capped just 4 times, and had 197 once.
 
Janos is answering across at least 3 high-volume tags
with multiple answers each day
 
9:31 PM
rolfl and Janos, it particular.
 
rolfl answers tricky questions, gets a pimp on them and collects the cash :D
 
@SimonAndréForsberg I don't know objective-c, which is why I decied to skip the review. I'll leave interpretation up to people who do. I was unśure about the reason, that's why I asked.
 
I have a hard time answering all but the easy questions.
 
@Hosch250 THere are three distinct "phases" for code review, for me, @Hosch250
in the early days, I was answering a lot of zombies, and pimping.
5 zombies a day at +4 was good for a cap.
 
I see.
 
9:33 PM
then, after that I would just answer a few questions a day, and make them really comprehensive.
Now I don't pimp my stuff (well, very rarely), but, I go through "burn weeks"....
 
You pimped a fair amount when you were getting close to Legendary.
 
I now try to hit hot questions, and, if it looks like I am close to cap, I find lots of small things to give small answers to.
@Hosch250 3 times.... I think
 
I thought it was more than that.
Maybe it was just suggestions, not pimps.
 
@rolfl What does +4 mean?
 
@SirPython 4 upvotes, net.
 
9:36 PM
downvotes are still unusual on CR
 
@Vogel612 Is that good?
 
depends... if the quality remains high to justify it, then it is good.
because then it's a "symptom" of healtyness
if the quality declines it's a problem, because the votes don't reflect the quality
 
2 mins ago, by Hosch250
I thought it was more than that.
^^^ depends on your definition of pimping
I somewhat casually mentioned my progress, which inspired people to pay attention
 
@Vogel612 @Hosch250 I've already pointed it out and already left a comment. But still, it was massively upvoted even having there those points described in the comments
 
@IsmaelMiguel linkey?
@EthanBierlein ...
I feel like you're falling back into the "newsfeed" mode ...
 
9:40 PM
Shudders I just found a quadruple-nested for loop.
 
It's nice that you answered that python question ... but.
I personally only check back in chat when an answer of mine has gone "unrecognized" for a while now..
 
? linkey?
 
Your answers are good in quality, and they should fare well without pimping, don't you think?
@IsmaelMiguel link...
 
I guess, yeah...
Hmm. I just realized I'm three away from 100 answers.
 
I understand what code review is... This code also works. However it only works because I am using the CPList class inside of my CPRequest class. I would like a way for this function to not use the CPList Class and still have my shared instance properties be set. The question is about reviewing the encapsulation. Therefore I need someone to review the code — RDSpinz 2 mins ago
somebody mind chiming in there?
 
9:43 PM
@Vogel612 It's on the 2nd monitor translator
 
@Vogel612 I consider that question to be on topic...
was hoping that @nhgrif would find it, though
 
I think it's a "feature request" based on a misunderstanding of the LoD
 
@IsmaelMiguel looks good to me... they even replied...
I think there's not much more that you can do.
 
The bug is still there, the answer hasn't been changed, the poster only answered to the comment
 
9:50 PM
@IsmaelMiguel You can always downvote, and you don't need to accept it.
 
^^ that.
 
But the answer is helpful
Downvoting would be degrading it's value
 
then retract your checkmark..
 
<button onclick="calculateProratedRefund()">Calculate</button>
<!-- Error: 'calculateProratedRefund' is undefined -->

<script type="text/javascript">

function calculateProratedRefund() {
  // stuff
}

</script>
^^ WTF
JavaScript causes many WTFs per hour.
 
meh... that shouldn't happen
 
9:55 PM
It was working just a bit ago, too.
 
else three quarters of the code I'm working on would stop working..
 
@rolfl I barely understand what he's asking right now. I'll look again when I get home. Right now I'm sort of thinking off-topic, but I'm not voting yet.
 
@Phrancis But the function is defined after it is referenced? Is that legal?
 
@jacwah sure it is.
js scoping is a mess
 
@jacwah Like I said, it was working earlier
 
10:05 PM
@Phrancis you sure didn't add "use strict;" somewhere?
 
Inside the function itself
 
From everything I've heard about JS on here, I don't think I'll ever touch it
 
(but it was working earlier even with that :| )
 
evening
 
@jacwah there's worse.
there always is.
 
10:06 PM
@DJanssens evening
 
JS is just a mediocrely scoped, ducktyped callback hell without proper numbers
 
I just hear something new about JS everyday
 
it's the same things over and over.
 
Ugh. I was missing one damn opening brace
2
 
10:08 PM
sounds so much like JS
@IsmaelMiguel RSA
 
@rolfl I hope so! It's not an exact science, you know ;-)
 
Welcome to Javascript
 
@janos My "experience" is that it will be awarded within moments of you crossing 200 the next time.
 
yeah, I remember that from yours. I just hope I'll be able to cross tomorrow
 
Good luck!
 
10:10 PM
Thanks!
 
What is your question? If the code is working correctly, then this is more suited for CodeReview than StackOverflow. — Turing85 50 secs ago
 
@Hosch250 you gotta be patient though. I learned really a lot while doing this. It took time. But here's a tip: after crunching through chapters of Code Complete, most notably chapter 6 about class design and chapter 7 about high quality routines, suddenly I was able to give better concept answers. The rest of the chapters are great too, but after these a felt a very noticeable boost for code reviews
 
Got to get that book somehow.
 
it's worth every penny, but it's not too hard to find a free PDF on the interwebs just buy it
 
I will - as soon as I get a job.
If my internship pays, I'll get it next summer.
 
10:15 PM
hmm I still got two coupons...
imb4 strange r question
 
@Vogel612 @Jamal took care of it
(someone else's code)
ttgtb
 
^^ dito.
'niters @all :)
 
@EthanBierlein - that question's description is very hard to follow, still not sure what the code is supposed to do:
0
Q: Simple "artificial intelligence"

Ethan BierleinI've thrown together this simple "AI", and while it works. I think it could certainly use some improvement. Here's how it works. Obtain user input by removing all punctuation from the input string, splitting it on whitespace, and converting it into a set. Loop through a list of possible input s...

 
@rolfl Okay.. I thought it was fairly clear. What aren't you understanding?
 
Hmmm.... a number of things.
 
10:24 PM
Like? ...
 
Well, you don't describe the problem you are solving.... just the way you solve it.
there's no "name" for it.
 
I agree
 
then, you describe things as inputs and input subsets, but then the inputs are outputs.
Finally, your use of the word "set" seems to be unconventional.
And another finally, i don't see an AI.
 
It's not an actual AI, it's more of an "AI"
 
    """
    Obtains user input. This function
    removes all punctuation, lowers text,
    splits on whitespace, and returns a
    set of all the unique elements. An
    example input value could be:

        "Hello, hello, there, there"

    And the return value would be:

        ["hello", "there"]
    """
Ahhh, you fixed the Set part.
 
10:28 PM
@janos what book were you speaking of? I tried to look it up in the convo but can't find the reference. :)
 
code complete
 
0
Q: Collatz Conjecture

user3514864I am new to the R programming language and want to sorry for this kind of easy question and have dealed with the code of the collatz conjecture in R. Actually, I have fully understood Part 1 and Part 2, but I dont understand the logic of the while loop in Part 3 and what is the need of n.total <-...

0
Q: Simple "artificial intelligence"

Ethan BierleinI've thrown together this simple "AI", and while it works. I think it could certainly use some improvement. Here's how it works. Obtain user input by removing all punctuation from the input string, splitting it on whitespace, and converting it into a set. Loop through a list of possible input s...

 
@EthanBierlein how does it work for input like 'Hi, what is your name?'
 
@DJanssens Just a sec, I'm gonna test it.
 
and why a subset for "hi" and "hello"?
 
10:34 PM
Meh. It breaks.
 
what about using some decent natural language processing library like nltk, which has a lot of funky stuff.
 
Maybe.
I also deleted the question too.
 
Aw :D was writing an answer :D
 
Oh sorry. It was broken though, so it would've been off-topic.
 
Wouldn't call it broken, more like some corner cases that you did not check ;)
 
10:39 PM
Lol. Maybe.
Okay. You can answer it now. I undeleted it.
 
You seem to want a review of your CPList class, yet you haven't included that class at all. You've simply provided some context code, in which you access your class within code from a popular iOS library (AFNetworking). If you want your CPList class reviewed, you need to include that. — nhgrif 3 mins ago
 
btw @janos thanks for the codility reference. You already made me spend my entire day there.
 
Voted to close for "Include code to be reviewed"
 
@Jamal Dude, you partially murdered the English in my question
"The idea is that chat will be augmented" --> Really nice English
 
Are you referring to the chatroom itself being augmented?
 
10:51 PM
5m
Yes, THE chat
 
uh, Jamal didn't change the words in that sentence?
 
He did
 
All he did was remove the break?
 
TTQW
 
@nhgrif Original: The idea is that the chat will be augmented, in a certain way, to add meanings to certain words or sentences.
 
10:55 PM
This is a code review. There is a site for thatBorodin 20 secs ago
 
Jamalized: The idea is that chat will be augmented, in a certain way, to add meanings to certain words or sentences.
 
I'm sorry
Can you highlight the different?
Oh, he took out the word "the"?
 
Yes, and makes me sound like a Russian
(No offense to the russians here present)
 
No it doesn't.
Jamal's version reads fine.
 
"The idea is that chat"...
 
10:58 PM
The difference is so insignificant that a native English speaker had to read it 10 times before he noticed the difference.
 
@EthanBierlein I've never seen the '->' constructs before in a function definition? What are those, I can't even google it :/
 
What language?
C-based?
It's usually the dereferencing operator.
 
Python
 
In C++, for example:
 
def obtain_user_input(prompt: str) -> set:
 
11:00 PM
Monking
 
Hmm, no idea for Python.
In C++:
foo->bar
// same as:
(*foo).bar
 
I know the c++ version, but thanks @nhgrif :)
I just never saw this in python before :D
seems like the return type to me.
 
97
Q: What does -> mean in Python function definitions?

KrottonI've recently noticed something interesting when looking at Python 3.3 grammar specification: funcdef: 'def' NAME parameters ['->' test] ':' suite The optional 'arrow' block was absent in Python 2 and I couldn't find any information regarding its meaning in Python 3. It turns out this is corre...

Improve your Google-foo.
2
 
@DJanssens a member of a struct if struct refereed with a pointer can be accesses as a->b rather than `a.b' in C
@nhgrif 2nd this
 
11:03 PM
@DJanssens Oh... Python, have no idea
 
I'm getting lots of upvotes on this.
 
seems Google lacks some skills when I try to query symbols: "->"
Pretty cool, I wasn't aware this existed in Python
 
@nhgrif Only one post can get populist on a question.
otherwise it would be great
 
0
Q: What about this C# solution

Edson Alcalábefore everything I want to thanks in advance for help. I want to explain what I'm doing and show my code and I hope you guys can give me some advice. Basically I have to show a select control of students with event information Where Monday, Tuesday, Wednesday, Thusday and Friday are Events. ...

 
@IsmaelMiguel, just commenting onto JosephTheDreamer's answer, you can use ().format() to format strings rather than concatenating strings, like in html.replace line: See here for more info
> I would like your help hehe.
 
11:13 PM
@CaptainObvious What about it?
 
@Jamal Eww, screenshotted HTML/JS
 
Why must I be out of votes...
 
@DJanssens They're called function annotations.
 
lol @Phrancis, that title
 
0
Q: Creating instances of all subclasses in Python

Max RosettI have a superclass with several subclasses. Each subclass overrides the "solve" method with some a different algorithm for estimating the solution to a particular problem. I'd like to efficiently create an instance of each subclass, store those instances in a list, and then take the sum (or aver...

 
11:25 PM
@Quill Not bad eh? :)
 
@Phrancis I like it ;-)
@CaptainObvious His solve functions just return integers o.O
 
How clear is my answer here? codereview.stackexchange.com/a/96836/57656
OP is asking for clarification, but I'm not sure what to add. Am I assuming too much knowledge of how regexes work, or what?
 
@o11c Ask him yourself :P @IsmaelMiguel
@EthanBierlein, your posts are increasing in quality to the point where soon you'll make zombies :P (well done, this is a compliment)
 
This answer falls pretty short. While callStackSymbols is the correct property to look at, the problem being solved in this question also requires being able to catch an exception. In Objective-C, we can use an unhandled exception handler and access the callStackSymbols of the NSException instance we caught. See this example. But how do we go about catching NSExceptions (or anything) in Swift so that we can grab the callStackSymbols that actually capture the instance of an exception? — nhgrif 32 secs ago
 
I did in a comment, but I'm wondering how much is answer-related and how much is his understanding specifically
 
11:37 PM
@Quill Thanks! :D
 
@o11c @IsmaelMiguel is a chatter here sometimes.
 
Speaking of zombies, I'm feeling that I would be the best person to write a response to that C++ Variant question, but I don't even understand my own code without a lot of thought a couple years after I wrote it ...
 
0
Q: Using DRY principle for camera intents and onActivityResult (camera intents, and file manipulation)

AndyRoidSo this is an ugly piece here, I am building an Android application and there are five Activity classes or if you're familiar with the MVC pattern they would usually be the Controller classes. Specifically a User will enter one of these 5 Activity classes (by navigating throughout the app) and ...

 
11:53 PM
Not sure if it's any useful, but I tried to answer you @EthanBierlein :)
 
Very useful. Thanks! :)
 
ok Im fixing this now, hehe — Edson Alcalá 3 mins ago
This user and hehe, jesus
 

« first day (800 days earlier)      last day (3200 days later) »