« first day (2636 days earlier)      last day (1380 days later) » 

12:00 AM
RELOAD! There are 6847 unanswered questions (89.8471% answered)
 
0
Q: a c++ ScopeGuard

user222866The idea of a defer statement or a ScopeGuard has for a while been something I have wanted in c++ but up until recently I had always assumed that c++ did not have it. However, that's when I found std::experimental::scope_exit but it had a problem. Which was that it had not been implemented in any...

 
 
1 hour later…
1:17 AM
0
Q: To make the decision structure loose or structured?

nonopolarityI would write the code this way: function getPayAmount() { if (isDead) return deadAmount(); else if (isSeparated) return separatedAmount(); else if (isRetired) return retiredAmount(); else return normalPayAmount(); } but a person with a different opinion insists the more proper way is: ...

 
 
2 hours later…
3:05 AM
Stack overflow is not the right forum for this. I suggest you take a look at CodeReview. — Aaron 45 secs ago
@chux-ReinstateMonica Then why is this apparently endian-dependent? — user13783520 59 secs ago
I’m voting to close this question because code reviews are not on-topic for Stack Overflow. But there is Code Review a specialized sibling site. — Klaus D. 6 secs ago
stackoverflow is for not working code, if your code works just fine and you need a code review - welcome to another stackexchange sitevasily.sib 17 secs ago
 
 
1 hour later…
4:19 AM
Asking for "more Pythonic" for more than a snippet is on the order of a code review -- which is more fitting for the CodeReview site. — Prune 30 secs ago
Obviously, creating your own class doesn't warrant down-vote and closure. That's from multiple questions, lack of of specificity, and asking for a general code review. Move the code review portion to the proper site, then divide and clarify the other questions, and I'll be giving up-votes instead. — Prune 8 secs ago
 
4:41 AM
This question is really more asking for a code review rather than about a specific problem. It may be on-topic (and you may get better answers) at codereview.stackexchange.com, but please review the requirements for questions in that community before posting there to ensure that your question is on-topic. — Ryan M 14 secs ago
This kind of question should be on codereview.stackexchange.com. — Geoff just now
 
1
Q: Seeking Revision or Advice to Develop Higher Level Programming Skills

Chris JaurigueI am new to coding/programming. About four months ago I decided to develop my skills using Python. After several books and a lot of assistance from this awesome community I developed the first part of my "Pizza Order System" program. Explanation of my program: When the program in ran, the user is...

 
5:51 AM
Monking
 
6:03 AM
@SᴀᴍOnᴇᴌᴀ Curious, why did you write this as a second answer instead of adding it to your existing one?
 
6:14 AM
@user13783520, in that code, you reinterpret 8-bit data as 64-bit data. This is often the case when using pointer casts, but in your case it's done by copying 8 bytes into one 64-bit (=8-byte) word using memcpy(). In that case it matters in what order your cpu reads/writes the bytes into the word (i.e. the endianness). In this answer no such conversions are performed, all byte operations are manually coded. — wovano 59 secs ago
 
Monking
 
Monking
 
6:55 AM
0
Q: JSON parsing form React gets Type Error

Neslihan BozerI have a JSON file that is used from PostList.js class but while rendering it I am getting a type error. How should I suppose to parse this? Thanks. { "categories": [ "1", "2", "3", "4" ], "questions": [ { "question": "What is your eye color?", "category": "1"...

 
 
1 hour later…
8:01 AM
So if a command fails, whole sequence is retried, or undone, thus rolling back to initial starting point. Am I understanding this limitation correctly? commands are expensive and shouldn't be repeated, unless specific error indicates. Thus i have the need to rollback to perform auth/, and skip ahead to resume last command, where session was lost. I have provided one approach here, but i dont think this is good design. — J. Doe 32 secs ago
 
8:44 AM
@DoxTheaugbey Stack Overflow is not for posting code that you have not tested just to get feedback. If you want feedback on your code, you should post in codereview.stackexchange.com. This is based on your comment "just want to check if my code is correct, maybe you can pointing if there is any wrong from my code, im not testing it yet." — Kurt Friars 41 secs ago
@KurtFriars If the OP has not tested the code then it is off-topic on Code Review. — Peilonrayz 30 secs ago
 
0
Q: Define cd so that it changes a variable (as it does already with PWD, OLDPWD, ...)

Enrico Maria De AngelisMy target is to have an environment variable being set to a leading substring of $PWD and to be unset when $PWD does not start with that substring. So I decided to override cd like this (here I'm assuming the substring is just my home directory /home/enrico, but in general is fine for me that it ...

 
 
1 hour later…
10:13 AM
It would be a more appropriate to ask this on [code review[(codereview.stackexchange.com) — RiggsFolly 8 secs ago
 
10:32 AM
0
Q: simple Flask REST api to a mongodb

amos-baronI'm writing a simple REST api to my mongodb using pymongo, each collection has its route where you can get all documents and add a document, for every collection you could get a specific document, I feel like my code isnt D.R.Y enough but cant think of how to make it better. from flask import Fla...

 
 
1 hour later…
11:45 AM
possible answer invalidation by iAmOren on question by Menai Ala Eddine - Aladdin: codereview.stackexchange.com/posts/245762/revisions
 
12:08 PM
2
Q: A Level Statistics Calculator/Helper For A Casio Fx-CG50 Calculator's MicroPython

Chlorox Bleach69I have made a program for my calculator's micropython, that can solve various a level statistics questions for me. However due to the limitations of the micropython's standard library, i had to reinvent the wheel on some functions and could not rely on external modules to do the tasks as they don...

1
Q: upload multiple images and resize

retqioI'm written PHP code to upload multiple images to server. this function process maximum 10 images at one time and if the image width or height bigger than 2000px it will be resize , but the code is slow little bit . so, i want your opinion of this code? and if there is way to make it more fast an...

 
Maybe what you really want is a code review? Then you might ask on Code Review. — mkrieger1 45 secs ago
 
@Duga sigh
 
12:57 PM
0
Q: Checking if a string contains all unique characters

E-SetPrimeEpsilonI am currently reviewing CTCI(Cracking the Coding Interview) The question is asking me to implement an algorithm which checks whether the characters in a string are all unique however they do not want me to use any auxillary data structures My Algorithm is relatively straight forward, I employ tw...

0
Q: RFC 1951 "Inflate" (de-compression)

George BarwoodMy exploration of Rust continues. I'm quite pleased with the 2-step table lookup for decoding variable bit-length codes here, for some reason I found this tricky to work out, but now it's done I like it. InputBitStream has a required "lifetime parameter", it seems these are not given meaningful n...

 
1:09 PM
I’m voting to close this question because I believe this question would be a better for Code Review as the code works but the op wants pointers on how to make the code "better". — Igor 25 secs ago
Write code that works. That's the important part. Then look at it and find out what could be done better or post it for a code review. — f1sh 17 secs ago
 
@CaptainObvious Man making an effort.
 
1:26 PM
@Mast How many suggested edit votes are required to block an edit?
I know the OP overrides every thing
 
@pacmaninbw Ordinarily 2.
I'm not sure, but I've always suspected the suggestion remains visible for the OP longer than for others, allowing them to apply it anyway.
 
Should we roll it back?
 
@pacmaninbw shrug
It's not invalidating anything, is it?
 
shrug
 
If this is how OP wants it and it doesn't invalidate answers, there's no harm done.
At worst it's giving the editor the wrong idea.
 
1:34 PM
I’m voting to close this question because it belongs on codereview.stackexchange.comfreedomn-m 55 secs ago
possible answer invalidation by Vasanth on question by Vasanth: codereview.stackexchange.com/posts/245833/revisions
 
@Duga Fine, but next time, do that in first iteration, ok? Test before posting.
2
 
2:23 PM
This belongs in CodeReview. — Mansoor 53 secs ago
 
2:34 PM
0
Q: Generalised NxN Sudoku solver using heap

lucieonMy implementation of a Sudoku solver. It isn't done using the most naive way but still it does an exhaustive search with some assistance from a heap. The only constraints I have used is the basic rules of Sudoku (a number can occur only once in a row, column and it's box). There probably are more...

0
Q: What should be returned in this JavaScript code?

k-driveShould I return true or country? Both work. Both return false and both return true if I remove the space from "Great Britain". Should this code be written differently altogether? var arr4Every = ["Great Britain", "Germany", "Italy", "France", "Portugal", "Albania"]; var results4Every = arr4Every...

 
I'm not sure, depends on what you want to know. If you'll ask "what is the best way" or "best practice", it certainly stays closed ... The rules are effectively filtering this type of questions out, since answers would be either opinion-based, or tutorials, which both are not fitting well to the Q&A format. If you'd show a specific use-case say two different ways, and asked which to choose, a question about working code might get suggested to migrate to Code Review (which is not a good place either). — Teemu just now
 
2:58 PM
-1
Q: Tetris game. func(pieces) = height of tetris board

meowliciousExample 1: Input: "I0,Q4" Output: 2 Explanation: piece I is placed at 0, piece Q is placed at position 4. height of board is 2. Example 2 Input: "Q0,Q2,Q4,Q6,Q8" Output: 0 Explanation: 2 full rows get removed and height is zero There are not rotations ect for the scope of the problem. class Tetri...

-1
Q: Created a paperfold like effect with css + js/jquery

Nico ShultzI am trying to recreate a neat effect that I saw posted on SO as a gif (https://media.giphy.com/media/d55DvGHjLFm1T8KDsi/giphy.gif) I am trying to recreate this with css and javascript and I have created a similar effect with a button press. I know the way I position the divs is not correct since...

 
3:41 PM
Monking
@Mast I believe it can stand on its own
41
A: Short answers and code-only answers

200_successI'd like to describe what I would like to see on this site, rather than the current practice. As noted in Answering Guidelines (answer length), there is a desire for cultural change on this site. Allowing shorter answers should improve the answer rate by lowering the barrier to contribution, an...

I know 200♦ isn't active here much lately but his advice is still valid, right?
 
0
Q: (Improved) get-release npm module

Khushraj RathodImproved version of the original question I've created a simple npm module and CLI program to get the latest GitHub and Bitbucket release from their APIs using Node.js. Please tell me if there's anything to improve! GitHub npm Improved module code #!/usr/bin/env node const fetch = require("node-...

 
@SᴀᴍOnᴇᴌᴀ anyone can be wrong. You have to look at the score to know if it's 'valid'. And at a net 41 score I think it's safe to assume it is
Note if you start posting lots of small answers on one post we may come after you
 
noted - thanks!
I've noticed suggested edits have been lingering longer than in the past...
sometimes I leave them for stewards-to-be unless I feel there is a need to help push one way or the other
 
4:00 PM
Monking
 
the 'dupe' question has far more informative answers
that is to say, the limit is 65K
So it feels wrong to vote to delete the question with the more informative answers.
"Change My Mind" ;)
 
@konijn VTD? That's a VTC link
 
@SᴀᴍOnᴇᴌᴀ Just because it can stand on its own doesn't mean it has to, right?
Personally I'm not a fan of fragmenting answers.
Only if there are wildly differing suggestions between the parts would I consider splitting them up.
 
Fine fine, I will post an answer on the other one
 
As in, say one suggests an OO approach and the other one an FP one.
That would warrant different answers because they go in a different direction.
 
4:09 PM
@konijn What's that in reply to?
 
I added the 65K limit to the original post, but as a comment, it wasnt worth an answer
 
@Mast This I agree with. IIRC it's also how the post I linked to got handled
 
4:26 PM
Welcome to Stack Overflow. If you want feedback on your code, you can visit codereview.stackexchange.com — Chris B. 11 secs ago
@ChrisB. At Codereview they provide the code being real production code, a practice project doesn't fulfill the requirements. — Teemu 39 secs ago
 
@ThomasWard Welcome, how can we help you today?
 
5:23 PM
0
Q: Rails model for aggregate data instead of a real table

KNejadI have a rails app with a Project model. Each project has usages which is numeric data. I need to get all the usage for each month and year. I also need to get usage for specific months and years across multiple projects. Instead of writing one large service file with raw SQL queries to handle th...

 
Welcome to Stack Overflow! It's hard to answer multiple questions made in one post. I've deleted the unrelated requests for code-review. You may be interested in posting your (working!) code to Code Review. — Shepmaster 47 secs ago
 
6:06 PM
@bruno yeah sorry about that. I was busy writing to another commenter on code review. I'm so used to see such warnings as I solve such problems that I just ignore them if there are 0 errors. Thanks for your time! I have much to learn. — lucieon 5 secs ago
 
0
Q: Powershell script to verify Linux-generated md5sum file

EdwardI'm moving some files from a Linux machine to a Windows machine over a low-speed, possibly buggy experimental communications channel that I want to test. One of the tests is to transfer large numbers of large and small files and verify their cryptographic hashes at the receiving end. On the Lin...

 
6:33 PM
Opinions on whether the answer is acceptable now?
-2
A: Finding the position in a triangle for the given challenge

hackvoip========== Triangle ========= 11 7 12 4 8 13 2 5 9 14 1 3 6 10 15 ====================== Explanation First column 1,2,4,7,... which can be formulate as (x(x-1)/2)+1 Second column 3,5,8,... which can be formulate as ((x+1)x/2)+2 Similarly 3rd column can be formulate as (x+2)(x+1)/2)+3 Final fo...

I think it's still poor, but I can't say with certainty whether it's acceptable as an answer now or should be removed entirely.
 
@Mast I think so
I'll give it a little tlc and I think it should be fine
 
Ok, I'll come back to it later and see if it warrants an upvote in its revised state.
 
6:54 PM
@Mast edit = posted
 
7:30 PM
Awesome. Looks good enough to get started for OP. As a code review: wrap arguments in self.quote_*(). WIll award bounty when I can and thanks for shedding some light on corners that sadly don't come up often anymore. — Melvyn 20 secs ago
 
@Peilonrayz Nice, much better.
Perhaps that user will come back, see how it's done and become a valued contributor.
 
Hopefully :)
 
Monking!
 
7:48 PM
-1
Q: Was an interface the right design for enemy classes? C# Unity

MikeRI helped make a game for the Game Maker's Toolkit Game Jam a couple weekends ago and made an interface for the four different enemies, allowing the player to hit an enemy without worrying about what enemy they're hitting. The interface is as such: public interface IEnemyCombat { string Name()...

 
 
1 hour later…
9:00 PM
You could checkout code reviewJacques 47 secs ago
Sounds like you want a Code Review. — Fred Larson 15 secs ago
I’m voting to close this question because reviews of working code belong on the Code Review StackExchange. — ShadowRanger 51 secs ago
@abel0910: That's exactly what Code Review is for. — Fred Larson 58 secs ago
 
10:11 PM
This belongs on Code Review plus please don't post links to pictures of code just copy and paste the code into the question and format accordingly. — Jab 1 min ago
What do you mean review? If you have working code you think could be improved, see Code Review. But it sounds like it isn't working, so put a minimal reproducible example in the question. — jonrsharpe 1 min ago
 
0
Q: Weather map GUI application needs performance improvement

BennyI am writing a python GUI application that plots weather data on a map for a specific region. It plots temperature, dewpoint, wind data, and icons that represent the sky conditions. It extracts the data for longitude/latitude from text files. I timed out how long it takes for the program to plot ...

0
Q: LeetCode 124: Binary Tree Maximum Path Sum

EmmaI'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the pare...

0
Q: LeetCode 124: Binary Tree Maximum Path Sum 2

EmmaI'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the pare...

 
11:00 PM
possible answer invalidation by Emma on question by Emma: codereview.stackexchange.com/posts/245894/revisions
 
0
Q: CSS Alphabetizer

RedDragonWebDesignIn another Code Review, it was recommended that I alphabetize my CSS. So I made a tool to do this quickly in JavaScript. Because CSS has two levels (selector on the outside, parameters on the inside), and they both need to be alphabetized, alphabetizing it is not as easy as just doing array.sort(...

 
11:28 PM
@Mast alright I will merge the advice into the first
 
11:50 PM
Because that isn't valid syntax at all. In any case, there is no reason to do what you are doing, your for-loop is fine, aside from the fact that you are iterating over a range for no good reason, instead, iterate over your list directly: for c in list_of_letters: if 96 < c[0]) < 123: num_of_abc +=1, of course, with indentation. Stop trying to cram everything into a one-liner. That is bad. That's the sort of thing that will get you eviscerated in any competant code review, or for that matter, would be a huge red-flag in any sort of code sample for a job application — juanpa.arrivillaga 23 secs ago
 

« first day (2636 days earlier)      last day (1380 days later) »