« first day (1268 days earlier)      last day (1188 days later) » 

12:00 AM
RELOAD! There are 2883 unanswered questions (92.5245% answered)
12:21 AM
"Ape commanders will likely have to keep tactics simple." Of course, the ape commanders would be using gorilla tactics. — Kys yesterday
12:51 AM
i assume if I've written python wrappers around existing programs would also be on-topic here if I want a general "How could I make it better" kind of thing?
1:07 AM
Q: Extablishing a TCP connection with async & await

DaveDevI'm not really super experienced async/await and working with tasks, so I thought I'd ask for some other opinions. I'm working with code written by someone else that establishes a TCP connection. It works most of the time. But sometimes it just doesn't, and the connection gets dropped and we don...

Q: Python wrapper script around `dig` for easier TSIG signing of queries

Thomas WardI wrote this Python script as a utility script for me. It's something that could be achieved in a simple shell script or alias, but it wasn't 'verbose' enough for me in that format, or customizable. This script, basically, is just designed to take and process whether a specified DNS TSIG keyfil...

^ i'm expecting to be crucified because it's something that could be done so easily in a Bash script or something xD
1:28 AM
@CaptainObvious Is code that works "most of the time" considered working code?
@ThomasWard Why did you prefix your function names with an underscore, out of curiosity?
1:49 AM
OMG this is actually working!?
@Phrancis I'm going Lego shopping. Lol
Gonna be sweet.
class CommentListContainer extends React.Component {

  constructor(props) {
    this.state = {
      data: [],
      pollInterval: 2000
Does it make any sense to make pollInterval time as a state of the component object? Should it be a constant instead? Or a normal data member?
Having it as part of the state kind of implies that it is expected to change during the lifecycle of the component
Decisions decisions... @EBrown how would you do it? ^
@Phrancis Config parameter of some sort.
2:04 AM
So leave that value out of the class altogether and put it somewhere else along with other config thingies?
What is doing the polling? The class?
Yeah, it's a container that checks an array and updates what is displayed in the browser with new data
Then it goes in that classes constructor as a parameter.
@EBrown ^^ see
Then it's a property of the class.
2:08 AM
@Phrancis I was just about to tell you to fix the spacing.
Yeah now that it's working, I can make it look OK
import React from 'react'
import CommentList from '../components/CommentList'
import comments from '../data/comments'

class CommentListContainer extends React.Component {

  constructor(props) {
    this.state = {
      data: [],
      pollInterval: 2000
    this.loadComments = this.loadComments.bind(this)
    this.startPolling = this.startPolling.bind(this)
    this.poll = this.poll.bind(this)

  componentDidMount() {
    this._timer = setInterval(this.poll, this.state.pollInterval)
You have the amounts of space reversed--use the smaller space between the commentor name and comment.
That's the class as I have it now^
@Hosch250 Part of the issue is that I used a Header for the commenter name and P for the comments. I'll just make something a bit more custom
It's easy to change and style with React since I only have to change the component's render method in one place
const Comment = (props) => (
  <div className="comment">
    <h4 className="commentAuthor">
Q: Find the shortest whole repetitive substring (part 3)

Lin MaThis is a new discussion from this post (Find the shortest whole repetitive substring) and since it is totally new code, I post as a new thread here. The major initiative of posting a new thread is, RobAu has posted a smarter idea, and there is no implementation, and I implemented the ideas and ...

2:50 AM
Q: Using C++ to check if string s is subsequence of string t

Jeniffer PanSo the problem I want to solve is very simple: Given a string s and a string t, check if s is subsequence of t. there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) string, and s is a short string (<=100). Example 1: s = "abc", t = ...

3:27 AM
Go Cubs!
3:59 AM
Q: Temporary state function naming

PeteThe problem I had was creating a component that keeps a temporary state and commits this state when the user presses the "Apply" button. Initially, I had the component clone the original object and work with that, then pass this cloned object through an event back to the service to update any com...

Q: public boolean hasStraight(String hand)

user120993public boolean hasStraight(String hand) Checks whether the given 5-card poker hand, given as a String of length 10 as in Lab 2, contains a straight, that is, five cards of different consecutive ranks. Again, the cards can be listed in the hand in any order. For simplicity, you don’t need to check...

Q: PREJS: Pre-Processing in JavaScript client side

tkelleheIntro So, I have spent the day working on this "tiny" library for JavaScript. The concept is pretty simple, applies simple pre-processing directives on the client side in order to help with creating the right code for that browser. Question What I am interested in obtaining from asking this ...

4:23 AM
Q: Is there a cleaner way of doing this?

Braxton FairArgs is an array, and can have any integer amount (0, up until whatever the limit is).. is there a cleaner way to check this? if(args.length != 2 || args.length != 1) { #do something }

4:57 AM
Q: Find The Triangular Number With More Than N Divisors

DunkaMy code is a general solution to the following problem from Project Euler: What is the value of the first triangle number to have over five hundred divisors? MY CODE #include <iostream> int generate_triangular(int n); int enumerate_divisors(int n); int main() { std::cout<<"You want to ...

5:09 AM
Q: Can someone tell me why my function only run once on resize event?

user2734550I need to run the code when resize event happens. Can anyone tell me why the function doesn't run when resize is triggered? var Util = (function() { function equalHeight(el) { this.elems = document.getElementsByTagName(el); this.max = 0; }; equalHeight.prototype = { constructo...

6:02 AM
Q: sum game solution for advice

Lin MaWorking on the problem of sum game. Suppose we have consecutive numbers from 1 to n, and an expected sum number, there are two players, and each player tries to select one number in turn (once a number is selected by one player, the other player cannot select it again), and the selected numbers a...

@Phrancis Been a force of habit lately to prefix things local to the script or class with underscores ("protected" in a nonenforceable manner of speaking) but other than that no real reason.
right bed calls, good night.
1 hour later…
7:30 AM
possible answer invalidation by Lin Ma on question by Lin Ma: codereview.stackexchange.com/posts/144973/revisions
8:20 AM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Splitting text into individual characters for animation
1 hour later…
9:35 AM
Maybe you could post some code? On Code Review, perhaps? — TigerhawkT3 9 secs ago
9:50 AM
If your code is working, you might get a better response at Code Review (but you should make sure you explain more clearly than you did here, if you do want to ask there). — Aurora0001 1 min ago
10:09 AM
Q: Check if strings are substrings of another string in Python

AdamMy problem starts with a list A (length around n=100) of big strings ( around 10000 caracters each). I also have another q=10000 strings of length 100. I want to check if each string is a substring of any element of the list A. I've tried to do this using inor any but it is still taking too much...

1 hour later…
11:15 AM
Gotta love Windows...
> Your PC will automatically reboot at 13:28, please saved any unsaved work or restart now.
Okay, it was just after boot and it was current time plus 15 minutes, but wtf, no delay option?
And it just decided to reboot at 13:23, wow.
11:30 AM
Q: activation mail function mysql --> mysqli

jedan_likCan anyone this function "function activate($ email, $ email_code)" in mysql write or convert to mysqli? I have problem with this convert. function activate($email, $email_code) { $email = mysql_real_escape_string($email); $email_code = mysql_real_escape_string($email_code); if (mysql_resu...

Q: can anyone help me

shnanui am making a webpage and some how i cannot get all these images in a single line. can anyone help me find out my mistake in the code here <html> <body> <style> body{ background-color:grey; } #mainT{ width:100%; height:70px; background-color:black; color:white; font-family:verdana; font-size...

11:44 AM
Q: "Spinning wheels" - Animated logo with SVG and Sass-CSS

mizechI've made this little animation by using SVG, CSS-keyframes and a bit of Sass. html, body, .wrap { height: 100%; } body { background-color: #efefef; } svg { max-width: 500px; width: 100%; height: 400px; position: absolute; margin: auto; top: 0; left: 0; bottom: 0; right...

And it's the Windows Anniversary update, screw me.
12:08 PM
Q: Pythagorean Triple ( first code )

SnuKiesI've got an assigment where I have to print all the Pythagorean Triples smaller than a given 'n'. Even though I could print them directly in pythagoreanTriple function, I decided to structure everything, as I want to go deply into programming structure.(my teacher does not teach us a lot, so I'll...

12:21 PM
And then it shows a message with "Click here to view update details" and when I hover over it it just disappears
12:44 PM
Q: Prerelease code for fingerprint viewing

RafazZI wanted to start contributing to the Open Source community, and decided to release some of the Python tools I have written awhile ago. The problem is that I am not really familiar with good practices, and would really appreciate any advice and/or pointers you guys could give me. The code below ...

12:58 PM
Q: PLease help me to solve this is urgent

al momin farukProblem Set: Your employer is now working on an education institute’s software and he asks you to design a Student class for his work. For each and every student there are several information and they are following: • Student name • Student id • Student address [for example just Uttara] • ...

@CaptainObvious Wow, such urgent, such help
needs more vtc
1:17 PM
Q: Project Euler #12 - Highly divisible triangular numbers (Scala)

bsaI generally work in Python for programming competitions, but I'm teaching myself Scala. As an exercise, I've attempted Project Euler problem #12 in Scala. I hope that somebody familiar with Scala can point out anything I'm doing which is not idiomatic in "functional style" Scala. My code produces...

@Duga is dead until someone can tell me how to properly set the environment to production when doing ./gradlew build because right now I'm (%U/)"==)!¤RPWFjifoö FED UP!
1:34 PM
@SimonForsberg What environment variable does it use?
@Mast Yeah, that's what I'm trying to figure out...
@CaptainObvious Y you still open?
@SimonForsberg I assume you've already read this?
I have found several different documentations saying different things about how to build the war for PRODUCTION, but it ends up always being something else
@Vogel612 @Mast I have flagged it, but not enough points to VTC yet.
@SimonForsberg I'd say it's JAVA_OPTS.
1:38 PM
@Mast That's not what I'm trying to do.... I'm trying to set the Grails environment. Which is an enum of test/dev/prod. It always gets set to dev for me for some bloody reason
But I'm not building the war with the grails command, I'm using gradle
Perhaps using gradle has the limitation of setting it automatically to dev.
@skiwi Didn't we run into something similar?
OGNext used gradlew to build as well.
Was OGNext made with Grails as well?
@SimonForsberg Yes
@Mast but it should be possible to configure...
Not around to help directly right now, but maybe the repository can be of help
1:47 PM
@skiwi Looks like you're building with the grails command which unfortunately does not help me.
@Mast ohhhhh my god that's adorable
more reasons to get an office cat.
Obsolete documentation should be illegal.
I hate Grails
2:18 PM
obsolete or old?
@Vogel612 Not quite sure what the difference is but the end result is the same: It doesn't work
old may be relevant for legacy maintenance.
as such it should be almost required.
sure it's a tad annoying to still get java 6 javadoc results when googling, but better that way..
obsolete is basically: You can't even create something depending on that documentation, because it was either wrong from the start, or there's mandatory updates, or ...
Well, okay.
And in fact, I'm not even sure if comments in Github issues like this deserves to be called "documentation"
2:40 PM
Q: Taxi Meter App Business Logic Using TDD

VimdeThe following problem has been written using TDD. Please review the following: Unit tests OOP Design Principles (SOLID) Cleanliness and naming Anything that could make the program better. Problem Statement: Taxi Meter Company has to develop an app for their business. The app calculates the b...

3:00 PM
@SimonForsberg True, definitely should.
Knowing the docs though, finding how to do it could take a while.
It's not something obvious, obviously.
3:19 PM
Q: Flattening nested Observables in Angular 2

KarimI'm new to Observables. I'm using them to check if the user is logged in or not in the constructor of my root page. I have nested many Observables in order to do this, and they are working fine, but I think that there is a way to flatten all of these nested Observables. I just want you to revie...

3:58 PM
Q: Polynomial Multiplication of two variables (X and Y)

Nasim Hamid Islamx^4 + 2x^3y + 3x^2y^2 + 4xy^3 + 5y^4 -->> Polynomial P x^2 -2xy + y^2 -->> Polynomial Q Save the result in Q itself.

Q: C - Basic memory pool, alignment, thread safety

Isty001I'm trying to implement a basic memory pool where I have given number and sized blocks that I can allocate at once, and reuse them multiple times. Basically I have a linked list, each node containing a pointer of fixed size. I'm not sure if my it is right. I'm also confused about how should I tak...

@CaptainObvious wat
Go away.
4:27 PM
Q: A semaphore implementation by file locking in bash script

JustinThis implementation is inspired by POSIX functions sem_wait() and sem_post(). I try to get rid of busy loops in the code. It appears to work after some simple tests have been done. But code involving concurrency is hard to make it right. Hopefully, there are no race conditions and/or deadlocks in...

Q: Rust: Python-like enumerate and join

ShaunNew to Rust and trying to convert some python to Rust. I have the following in python >>> v = ((0, 0), (1,1), (2, 2)) >>> strings = "\n".join(("%s: (%s, %s)" % (i, val[0], val[1]) for i,val in enumerate(v)))) >>> print(strings) 0: (0, 0) 1: (1, 1) 2: (2, 2) I'm trying to find the best/smartes...

4:46 PM
Q: Count Character frequency in a paragraph and print it in lexicographical order c++

SM RiadI was trying to solve this problem by the code given below in an online contest. But got wrong answer. Seeking your help to find the bug. Input Format: A paragraph will be given as input. Output Format: If the letter is present in the paragraph display the letter in Capital followed by a " : ...

4:56 PM
aight... three of my tests don't even compile anymore
way to go, tearing the design to pieces
5:14 PM
Q: Recovering permutation from its image sequence

Kuntal MajumderRecently while practicing I came across this problem , here is an excerpt from it, A permutation of the numbers 1, ..., N is a rearrangment of these numbers. For example 2 4 5 1 7 6 3 8 is a permutation of 1,2, ..., 8. Of course, 1 2 3 4 5 6 7 8 is also a...

5:25 PM
Q: Is this PrimMST algorithm correct for a adjacency matrix graph?

nbroI've implemented the prim algorithm to find the minimum-spanning tree of a graph represented as an adjacency matrix, but I'm not sure it's correct. Here's the function: PrimMatrixGraphMST prim_mst(MatrixGraph &g) { PrimMatrixGraphMST mst(g.size()); // 1st vertex picked first for the M...

5:41 PM
@Vogel612 just delete the tests that are failing #ProblemSolved
@Phrancis Code not working? Delete it too, more problems saved!
Less lines of code equals less chance on bugs. No code at all equals no bugs!
@skiwi Try this
while (bugs) { linesOfCode.delete() }
> If a caller fails to provide valid arguments, it is wrong and must be punished.
@Phrancis Basically, yes.
Only valid code survives :-)
I like pre- and post-conditions a lot, but I don't feel like they should be in the method by itself
Should be like an extra column where you could put those constraints :P
5:49 PM
hrngh ...python is being helpful ...
"Syntax Error"
That's Pythonic for "you're doing it wrong".
detail message: "invalid syntax"
I wouldn't have ever guessed that
You probably missed a semi-colon somewhere.
In Python?
Full colon, what are they called?
Those thingies.
5:51 PM
colon ..
that said 'twas a missing paren
really helpful to put the error onto the next statement tho
You get used to that.
If you get an error on a line that looks fine, the previous line likely didn't end well.
Ever tried debugging OpenGL/DirectX shaders? :D
I ain't touching those.
I debugged a game engine once, never again. Things like that get too high-level for me very fast.
5:54 PM
why is there so little documentation ...
Or whatever you call it if a file links a file links a file links back to a file links a file links a file.
6:25 PM
Q: Basic memory pool, alignment, thread safety

Isty001Mainly for practicing purposes, I'm trying to implement a simple, yet efficient memory pool. It's basically a linked list that is able to grow, with fixed sized members. Each node has a flag if it's free or not. I'm not sure if I'm doing it the right way, and especially confused about how to deal...

Q: Udacity AI for Robotics translating Python code to C++

JackSilverI've been learning C++ for about a week now. My primary language is Python, so I thought I would find some code to translate to figure out how the pieces fit together. Please let me know any simplifications/best practices! There is an assignment on a unit of Udacity's "Artificial Intelligence fo...

6:57 PM
@Vogel612 It all got smoked up...
@Knowledge32 I have no rest of the code. I just posted a quick code review of your code. What error do you have? segfault or no insertion ? — Franck 30 secs ago
Q: Parsing XML files in Python

BaigI am new in Python and still learning it in order to Parse XML files using Beautifulsoup. I am extracting data from html tags inside more than 3000 XML files and creating unigrams by using Regex. There are more than 8 million unigrams being created using nltk regrex using below code: textDict= [...

Q: Solving producer-consumer using only 2 sempahores

stlsaintI am looking to reduce the number of semaphores down within the following code. The way I see it I can move the slots semaphore into another function (unsure how though, very new to C). I don't see how I can remove items nor the mutex. Any pointers on implementing this? #include <xinu.h> void p...

7:16 PM
> I give up! Set prod datasource to dev environment as I'm stuck there
That's so sad it's funny.
Q: text-based lottery written in Java

q1612749My problem is: why if I enter a negative input or a number > 100 no error is thrown? Thank you for your help. import java.util.Scanner; public class Test { public static void main(String[] args) { System.out.println("This program generates a number and if you check it, you win: ");...

7:39 PM
Q: C# WPF XML settings file read/write Design Patterns

Vad ZeleninI'm new to C# and would like to create a WPF app with xml config file. I have a certain setting file written by using System.Xml.Linq;. And I'd like to write else block to read data from the file if it exists. I'm a static struct instead of class. public struct Settings { public static int...

Q: Is this enumeration contruct and assigment allowed?

Ralph_ESIn the LoRa Gateway Stack hosted at Github I found the following construct in loragw_hal.h enum lgw_radio_type_e { LGW_RADIO_TYPE_NONE, LGW_RADIO_TYPE_SX1255, LGW_RADIO_TYPE_SX1257 }; #define LGW_RF_CHAIN_NB 2 /* number of RF chains */ and then in loragw_hal.c static enum l...

7:56 PM
I'm voting to close this question as off-topic because it belongs on codereview. — James K Polk 17 secs ago
@CaptainObvious OT.
@Duga Possibly incoming, not a great fit.
Q: Hash-like sort with complexity based on magnitude of numbers, rather than amount

leonzI've been messing with hashes in Java recently and thought of this simple sorting algorithm. CONS: Can only sort positive numbers and only integers You must know the maximum size of integers that need to be sorted PROS: Small space and time complexity, both depending on how large is the l...

@CaptainObvious I edited it to make the question sound better, but I'd like a second set of eyes to make sure it's not too intrusive...
8:20 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Redis rate limiting in Lua
Q: OpenVPN Authentication Script

Starfox64I wrote a shell script to authenticate users connecting to an OpenVPN server. When a user attempts to connect, OpenVPN executes the script with the username and password variables sends. The script then sends an HTTP request to a web server that either returns a status code of 202 upon success an...

Q: Looking for Constructive Feedback, thanks

platypus87The program asks for a user to set the max number of the range. That number is used to set the max range of a randomly generated number. The program keeps track of the number of guesses. I have taken a couple classes recently on different programming languages. I wrote a Hi/Low program in C a whi...

Q: Using getters and setters to change another variable C#

Vad ZeleninIs it a bad practice to use getters and setters this way? Below is my code: public struct Settings { public static int workMinutes { get { return Properties.Settings.Default.workMinutes; } set { Properties.Settings.Default....

All things considered, I don't think the iPhone 7 is really all that bad.
@EBrown I'm sure it's pretty good, if you don't mind Apple things
It's not bad, really.
I don't like the home button, but everything else is tolerable.
When my main PC was a MacBook the iPhone worked really well with it. Not so much with this Windows PC.
8:30 PM
It's got a smaller screen than my Lumia 950, but when it's in the Otterbox it's the same size.
I really don't want to have to install this behemoth of a program that is iTunes, just so I can interact with my phone :(
Seems pretty responsive.
Except when entering a passcode.
It's got a little switch on the side to send it to silent mode.
If you have working code, you may ask for improvement at SE Code Review. But I heavily doubt your question won't be too broad for the c++ tag at Stack Overflow. — πάντα ῥεῖ 9 secs ago
@EBrown Yeah, all iPhones have that :p
@Phrancis I don't remember that being a feature a few years ago.
8:40 PM
I have an iPhone 4 and it has it
Oh, well then.
I do like that better than Samsung's side buttons, which I constantly press by accident
Well the Otterbox makes accidentally pressing buttons hard.
It also makes purposefully pressing them hard but that's a different issue.
I can't stand Otterbox cases, they take all the fun out of having a smart phone in the first place
Q: 2D Vector: Loading values from .txt file

dserresI've written a program that runs through a matrix of numbers, ranging from 0 to 2, and stores the results in a 2D vector. I'm using the values in the 2D vector as the profile for a tile map for a game engine. I want this to be optimal, and as this is my first attempt at it, I doubt that it is ...

8:45 PM
@Phrancis You mean the high fragility? :P
I have a small Bodyglove wrapper for the phone that I really like
Doesn't cover the screen or the buttons, but still protects it pretty good against falls
So unless something directly hits the screen, it shouldn't break
Q: How is this implementation of a Location object, to be used in building a text-based adventure game?

Rock Anthony JohnsonBased on responses to my question posted here, I've built a full implementation of a Location object. Such an object can be used to build a map for a text-based adventure game. Feel free to review the code, leave some comments about the good and the bad of what you see. Thinks to notice Object...

9:05 PM
I'm voting to close this question as off-topic because it belongs on Code Review after you have read their faq. — PeeHaa 36 secs ago
The SE iPhone App is way better than the Android one.
They seemed pretty identical to me...
It's a lot smoother, that is.
I have a Love/Hate relationship with CSS
Every time I'm not writing CSS, I think CSS is great. But whenever I have to write CSS, I tend to get pretty grumpy.
If this is working code that you think could be improved, see Code Review. Otherwise, read How to Ask and be clearer about the problem. — jonrsharpe 17 secs ago
9:17 PM
Hello, all!
@Edward Hey!
I got tired of working on an OpenGL project and decided to waste time here instead. :)
I'm getting ready to post some JS code for review
I'll post the OpenGL code (it's in C++ with SFML) when I get it working.
Are you using any framework or raw JS?
I'm using React.js (along with Node of course)
I have to say I really like React, though the initial learning curve is pretty steep
9:25 PM
Yes, it makes me think that the next time I need Javascript, I'll hire somebody.
I found the learning curve pretty steep for d3.js
React certainly makes for some maintainable code once you get the hang of it
Q: Structure of app for system that will load ad reports

user121046I need object analysis for this problem, since I am new to OOP and this is basically my first project, i want to know if i am doing it right. I think it should work as it is stated in assignment(methods for ad_campaing, ad_groups are missing, and maybe few others, it doesn't matter now), but my q...

@Phrancis Probably the same if I ever wrote any that needed maintaining.
4 hours ago, by skiwi
Ever tried debugging OpenGL/DirectX shaders? :D
@skiwi I avoid DirectX like the plague.
9:37 PM
@Edward What I like the most about React so far is JSX syntax, that alone changes the way your program JS completely
@Edward Yeah, just mentioning DirectX for completeness sake as I wouldn't use it myself either :P
Q: Passing object back to Windows Form button event

Tomáš PaulI have windows form application. One button event starts the script via object called ScriptStarter. The status of object is used to pass message and color to UI (toolStripStatusLabel1). I'm not sure if this is good practice. Could you please give me advice or suggestion how to better set up the ...

@Phrancis It looks a little like PHP.
@skiwi At the moment, I just need to try to refresh my memory on OpenGL generally. I have something that kinda works but it's ugly.
9:55 PM
possible answer invalidation by platypus87 on question by platypus87: codereview.stackexchange.com/posts/145033/revisions
@Duga Need assistance to handle things here
Whoopsie, I broke my web page again
OP posted broken code
Got an answer
While editing to post actual worknig code
Can someone provide guidance ?
Looking it over now
Q: C++ Tree Object Class

Oliver YasunaI'm writing a class that acts as the base for almost all objects in my project. I know this class technically doesn't represent a tree structure, because it can have more than 2 children. What should I change? Should I be using smart pointers? I'm a self-taught C++ programmer, so I've got much mo...

9:58 PM
Thank you for the feedback. I like your ideas and I am going to try to put them into practice in the next edit. — platypus87 1 min ago
Welp, seems like it will soon become worse
@MathiasEttinger @Jamal took care of it
But this version is broken
At least 4 times
We can still close the question for being off-topic
But the edit was legit, I mean, it's what we expect poster to do when they post broken code, right? Fix it before we answer.
I personally don't think the edit actually invalidates the answer
I have a feeling the OP may become frustrated though, as this is not the way it's supposed to work
@MathiasEttinger OP went ahead and accepted the answer, I think this will be OK, hopefully they learn not to post broken code in the first place for next time
10:12 PM
I’m still puzzled at @Jamal 's decision. I mean, considering the 3 VTC, the question will likely be closed as off-topic. And the only way to get it repoen would be to edit it to provide working code. Which means posting the actual code which has nothing to do with the original post… which means… invalidating the answer?
It's quite frustrating, OP had the right move posting it's actual code instead of the broken version. But an answer came seconds before and it feels like a mess…
There's not really a "right" fix, unless we deleted the answer, then reapplied the edit and reopened the question... which I think would be worse, as likely it would offend the answer's author
I'm voting to close this question as off-topic because it's better suited to codereview.stackexchange.com (where it will get a drubbing). — ceejayoz 59 secs ago
You're right though, it's pretty messy, and may require some mod intervention
Actually, I just read the answer and the edit side by side, and it truly does not invalidate the answer at all... @MathiasEttinger do you agree?
Point 1. 3. and 4. applies to both versions
Point 2. is irrelevant for the edit
since there is no function named guessLoop anymore.
@Phrancis I think I’ll let the night pass and see how things went tomorow morning.
Thanks for the support
10:29 PM
That may be best. I was thinking of reverting back to version 6, but for this one I'd rather a moderator assist ...
Found JavaScript documentation on MSDN... strange
@Phrancis That's JScript to you
Microsoft couldn't have it be named JavaScript. That sounds too open source!
If yours is working code, you should better ask your question on codereview.stackexchange.comphaberest 19 secs ago
If it's JScript why do they call it JavaScript...??
> /s
OH. lol.
10:33 PM
They used to call it JScript because they had proprietary extensions to it
like extensions that allowed you to use the windows script host which was never going to be a bad idea. /s
Why would you ever want to do that
BTW @DanPantry do you feel that it's acceptable to have a date formatting function inside of a "dumb" React component?
(since date formatting is related to displaying/rendering, rather than handling the data)
@Phrancis I'd say that should be fine
it would just be implementation detail of teh component
There is a code review stack exchange, but on Stackoverflow your post is off-topic. — a3f 49 secs ago
I'm voting to close this question as off-topic because it belongs on another site in the Stack Exchange network, namely Code Review — if it belongs anywhere. Even then, a link to GitHub is probably not an acceptable way of presenting the question. You need to read the About and How to Ask pages before posting more questions. — Jonathan Leffler 42 secs ago
const Comment = (props) => {
  function formatTimestamp(timestamp) {
    var options = {
      weekday: "long",
      year: "numeric",
      month: "short",
      day: "numeric",
      hour: "2-digit",
      minute: "2-digit"
    return timestamp.toLocaleTimeString("en-us", options)
  return (
    <div className="comment">
      <p className="commentText">
      <span className="commentAuthor">
        - {props.author}
      <span className="commentTimestamp">
@DanPantry ^^ thoughts?
10:50 PM
Looks fine, although you may not be able to TDD that
I would put the formatTimestamp format in a different file
at least that way you can test it in isolation
Uh yeah it's broken
> TypeError: timestamp.toLocaleTimeString is not a function
props.timestamp is a Date right?
Well, here's the weird thing
It works fine initially loading my pre-loaded data and formatting it correctly, it's when I enter a new comment and submit it that I get that error
10:58 PM
pretty sure then that timestamp.toLocaleTimeString is not a date
er, timestamp even.
Is this on GH?
I just moved that function into the utils directory, the rest above is in components/Comment.js
And the Date value that's passed as a prop originates in containers/CommentForm.js
okay, i'll take a look now
Q: C# OOP pong game in WinForms - looking to make well written code

Jam0131I want to learn C#, I have started off with making simple Pong game, I would like to ask you whether the approach I took is corrrect, as in it is readable and fits the conventions/standards. Maybe some of the implementations I have made (more like for sure ;)) are far from optimal or not complete...

Q: Need help finding max NetBean

user7027598This is my coding. I am having issue with my getMax method. Can someone please help? Scanner input = new Scanner( System.in ); String cont; double grades=0; double min = 55; double max=100; do{ System.out.print("Please enter a number of grades between 1 and 99:"); int num = input.nextIn...

kinda confused, where do you pass the timestamp to the Comment component..>?
It's pretty confusing
11:06 PM
CommentContainer component, I mean
The timestamp goes like this: CommentFormContainer -> data/comments.js -> CommentListContainer -> CommentContainer -> Comment
hm. I'm not sure, sorry
that is a weird one
I'd definitely make sure that you are indeed passing a Date instance, bu that's all I can think of
Yeah... that would at least make a bit of sense from that error
You should try getting the react chrome addon
It might help track down data flow bugs like this
Q: Data structure (Map-like implementation) in C++

J. DoeI wrote this code to implement a data structure in C++. It works perfectly, however, I am looking to improve its efficiency. Also, I'm just getting started in C++ so using code to explain your suggestions would be incredibly helpful. Here is the class that implements the data structure: class k...

11:16 PM
I found the problem
  handleSubmit(event) {
    var author = this.state.author
    var comment = this.state.comment
    var timestamp = Date.now()
    if (!author || !comment) {
      id: 42,
      author: this.state.author,
      text: this.state.comment,
      timestamp: timestamp
      author: '',
      comment: '',
      charsLeft: CHARACTER_LIMIT
var timestamp = Date.now() returns a number, not a Date object
Of course it does.
Because JavaScript.
Even I missed that, sorry.
Yeah, Date.now() returns the number of milliseconds since january 1970
Because you know, why the heck not.
And, fixed
11:40 PM
Q: Red Black Tree in Java

Andi GuI wrote a red-black tree in Java, having it inherit from a generic binary search tree I wrote. I was wondering how the structure of my inheritance, along with the code's quality (disregarding actual logic) looks to more experienced developers. I'm looking for suggestions on conventions, code read...

Code review item: your variable names don't follow Java Naming Conventions which makes your code more difficult to read. Please name variables starting with lowercase so that they don't appear to be class names. — D.B. 16 secs ago

« first day (1268 days earlier)      last day (1188 days later) »