« first day (2083 days earlier)      last day (1927 days later) » 

12:00 AM
RELOAD! There are 5837 unanswered questions (89.8337% answered)
 
@Duga [Sunday's percentage - i.e. 89.8589% answered] hasn't been that high since Sept. 30, 2018 :)
 
12:49 AM
This might be better on Code Review, but according to that link you should also use PriceRange = Range("Pricing_Range") etc rather than re-evaluate it multiple times within the loops. — Ken Y-N 9 secs ago
I'm voting to close this question as off-topic because Code Review is the place for getting help with refactoring working code. — Ken Y-N 6 secs ago
Im happy for you to do so. I did not know code review existed and it seems the right place to go — Tejkaran Samra 14 secs ago
@KenY-N In the future, please don't use the existence of the Code Review site as a reason to close questions. Evaluate the request & use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic and Flag it for Mod intervention. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 30 secs ago
 
 
2 hours later…
3:21 AM
0
Q: Hangman written in C

FarazI would like your feedback on any improvements that can be made to this Hangman game I have written in C. Specifically, improvements in terms of runtime and code organization. This game was a nice way for me to learn more about the features of the C language, specifically pointers, and thus I hav...

 
 
2 hours later…
5:14 AM
Monking
 
5:38 AM
Thank you (again)! And thanks for pointing out my code issues, maybe I will post it to Code Review again for input. I have the bad habit of getting my code to work first then cleaning it up later, but definitely would like to improve. — jhjanicki 13 secs ago
 
Monking
 
6:35 AM
possible answer invalidation by user3857802 on question by user3857802: codereview.stackexchange.com/posts/211526/revisions
 
@Duga rolled back
 
6:57 AM
-1
Q: What's wrong with my code?

Codito ergo sumI've written a simple code in c to convert Celsius to Fahrenheit: #include<stdio.h> int main(){ float cel, fah; printf("Enter tempreture in celsius.\n"); scanf("%f", &cel); fah=cel*(9/5)+32; printf("Tempreture in fahrenheit is:%.2f\n", fah); return 0; } The problem is in this part: fah=...

 
7:20 AM
possible answer invalidation by mdfst13 on question by user3857802: codereview.stackexchange.com/posts/211526/revisions
 
0
Q: Convert IEnumerable to html table string without using Json.NET and Datatable

IT WeiHanI expect to convert IEnumerable to html table string without using Json.NET and Datatable. Here's the code I wrote , it can generate html table strings well,but it depends on Json.NET. void Main() { var datas = Enumerable.Range(1,2); var array = datas.ToArray().ToHtmlTable(); //Run Suc...

 
8:10 AM
@marialopez Yes, if you do not use code review mechanisms like merge or pull requests, you can merge locally and the remote repostory might never see your feature branch, you will just push to develop, to which you merged the commits of your feature. Although not doing code reviews and pushing directly to devlop are genereally considered bad practice. — kowsky 33 secs ago
 
0
Q: Memory cache using ConcurrentDictionary

kalasantyBased on internet samples I've tried to create a simple cache mechanism using ConcurrentDictionary assumptions: - it has to work in sync/async mode - it has to be updateable Thank you in advance for any halp public class CacheStore<TValue> { private readonly ConcurrentDictionary<string,...

 
8:30 AM
Monking
 
8:44 AM
This question is a bit too broad for StackoverFlow. Ideally you provide us with a sample of something you tried that isn't working and an exact explanation of what you want to tachieve. Have a look here for more information on how to use DI in windows forms and open a new question when you have a specific question: codereview.stackexchange.com/questions/122238/…Kenneth 46 secs ago
 
Monking
 
9:31 AM
0
Q: Can this be called an insertionSort?

DeepeshkumarCan following code be called insertion sort? I tried implementation according to my underdtanding... #include<iostream> void insertionSort(int* array,int length){ for(int unsortedIndex=1; unsortedIndex<length;unsortedIndex++){ for(int sortedIndex=0; sortedIndex<unsortedIndex; s...

 
9:46 AM
0
Q: Ambiguous declaration of a variable name as a pre-defined function name in DXL scripts

Daemon PainterI have inherited the maintenance of a DXL script (for IBM Doors). In this, I came across various examples of stuff that make me scratch my head. Take this example: int key = 3 print key Running this in Doors, results in the expected output: 3. However, in the documentation, we see that key i...

 
This might be a better fit on code reviewCodeer 28 secs ago
 
10:00 AM
I'm voting to close this question as off-topic because questions asking to review working (and relatively high quality) code should go to codereview.stackexchange.comGhostCat 1 min ago
 
0
Q: map, filter, reduce is taking time compare with for loop is that true?

mariappan kIn Javascript ES6 we have map, filter,reduce function. I read one article in medium he mentioned those method taking little time for running comparing with for loop is that true? and he gave examples also. const numbers = [2, 4, 8, 10]; const halves = numbers.map(x => x / 2); for(var i=0;i<num...

0
Q: Using a large number of actors in one render scene with vtk python

shahriarI used vtk python examples to write this function where it produces two lines with respect to a reference point like [0, 0, 0]. This function will return an actor where it can be used later in a render scene. Here's my actor producer function (most of the code is not mine): import vtk import ran...

 
This is an assignment/code review, I suggest the same as codeer and GhostCatMuyide Ibukun 24 secs ago
 
10:27 AM
As suggested, I have put the question on code review. — Maclean Pinto 26 secs ago
 
-1
Q: Read .txt file with while(!feof()) but it gets stuck on a name on second name that you give

JesepySo i want to check if a name already exists in Names.txt so i run the while(!feof()) but the second time i put a name i think temp[] gets stack on a name it never breaks from the while.Please explain simple if you can find the mistake.Thanks. void testAsk() { FILE *file; char s[15],temp[...

0
Q: Family Relationship Tree

Maclean Pinto Developer Assignment - Family And Relations Going through the old stuff in his attic, Indiana comes across a chart which looks like a family tree of multiple generations which shows his ancestors. Excited by the discovery, he decides to digitize the family tree and utilize it to identify rel...

 
10:48 AM
0
Q: Evaluating expressions in "case" vs using "if/else if"

flawrI was just tempted to write a similar piece of code to the one presented in this answer on SO (posted below). The problem is having to discriminate between different cases where exactly one case is true. In my experience switch statements are usually use to match the value of an expression agai...

0
Q: Project Structuring Service Layer and Data layer , Domain & Separation c#

Billy WatsyMy Project is structured as follows . Project Domain Project domain contains POCO class as well as their relationship .in our case we have Product and ProductCategory namespace DOMAIN { public class Product { public int ProductID { get; set; } public int ProductCateg...

 
 
2 hours later…
12:27 PM
This is more suited for codereview.stackexchange.com as you have working code. But I think you can at least create lamba expressions in the switch, and handle the sort order outside the switch. — Wai Ha Lee 51 secs ago
 
0
Q: Efficiently aggregating nested data

Dominic CamposProblem Given the following data: [ { "users": [ { "id": "07bde76f-aff0-407d-9241-a12b323d4af8", "transactions": [ { "category": "purchase" }, { "category": "unknown" } ] }, { ...

 
12:51 PM
0
Q: Add variable columns to INSERT statement

Nahuel Varela BlancoI'm learning SQL using python library pymysql. I wanted to make an INSERT statement that will update 3, 5 or 10 columns using the same code by just passing the Database name, the Columns name and the Values. Thus I made this: def insert_statement(db,cols,values): separator = "," separa...

 
1:06 PM
0
Q: Calling functions in the implementation of a trait function

ArthurConsider the following example: I have a trait Foo with a function foo() and an associated type F, and a struct Bar which implements Foo. Bar's implementation of foo() is so complicated that I would like to have it call a smaller function func() to help structure the code. As I understand it, I ...

 
1:37 PM
0
Q: Knuth-Morris-Pratt over a source of indeterminate length

JodrellPlease review my generic implementation of the Knuth-Morris-Pratt algorithm. Its modified to search a source of indeterminate length in a memory efficient fashion. namespace Code { using System; using System.Collections; using System.Collections.Generic; using System.Linq; ///

 
2:11 PM
possible answer invalidation by potatoguy on question by potatoguy: codereview.stackexchange.com/posts/211557/revisions
 
2:22 PM
This question might be a better fir for the code review site: codereview.stackexchange.comJaa-c 1 min ago
I don't see an Rcpp question here. You may have a question for the Code Review stack exchange site, or some more general program design question. — Dirk Eddelbuettel 25 secs ago
 
0
Q: Question on hold as arguably being off topic

Amir KirshI have a question about my Code Review Stack Exchange post: Polymorphic implementation for == with CRTP Post was put on hold as off topic stating (mainly) that the use case is theoretic or not explained. Reading the actual reasons for off topic it doesn't seem that theoretical usage is a reas...

 
2:53 PM
@Duga Rolled back.
@Feeds User has made the required edit IMO so I've cast the first vote to reopen.
 
0
Q: Firestore data model design

stt106 What am I trying to do? I am modelling a game which can be single (player1 vs player2) or double (pair 1 vs pair 2, where each pair contains 2 players) and each game has a score. The game is group and date based e.g. Group A on date_n can contain n games, on date_m can contain m games. In fires...

 
@Zeta What's the difference between a single-sided and double-sided plane? From a CAD perspective I don't understand how planes can have width anyway. You take a plane, put a drawing on it and the drawing gets a width. Giving planes width is just, awkward?
 
possible answer invalidation by Saint-Martin on question by Saint-Martin: codereview.stackexchange.com/posts/211398/revisions
 
@Duga Partially rolled back.
In other news, the fire department went with 2 large trucks to a residence to find out it wasn't fire that was spotted, but a video of a fireplace projected on the wall by a beamer.
If it looks like a duck, quacks like a duck and moves like a duck, it might still be a projection of a duck.
 
3:08 PM
@Mast Or a projection of a rubber duck.
Greetings, Programs.
 
Beyond that, you could check at codereview.stackexchange.com/help/on-topic ... if your question should maybe go there. There are simply many aspects in your code that require "review" input. — GhostCat 56 secs ago
 
3:34 PM
Please read how (and why) to provide a Minimal, Complete, and Verifiable example. Your code is neither minimal, nor does it compile. And as already suggested, Code Review might be better for this question. — chtz 40 secs ago
Code Review is a good place to post working code and get comprehensive feedback. Read how to post before posting. — mickmackusa 45 secs ago
 
3:56 PM
-1
Q: Looking to see if there any improvements to make

legoMyEgoIt's a simple app that uses a public API to display data. It works as is, but Im seeing a lot of spaghetti code that my limited experience cant fix on its own. Looking for any advice, thanks! import React, { Component } from "react"; import Spinner from "./components/common/Spinner"; import "../...

 
This is the most generic title possible, applicable to all questions on this site. See How to Ask. — 200_success 1 min ago
;-)
 
posted on January 16, 2019 by CommitStrip

 
@Mast I don't have Blender at hand, but IIRC, planes in Blender are always 0-width. A non-zero width plane is either a cuboid (the width is embedded in the geometry) or a zero-width plane with a solidify modifier (which adds thickness around the existing geometry).
 
4:11 PM
0
Q: How to make this cypher more flexible and efficient

Ayush Upadhyayso I have been asked to make a cypher which can reverse the order of characters. Say "ajay" output "yaja" so far i have used a very basic botched up code #include <iostream> using namespace std; int main() { char a; char b; char c; char d; cout<< "enter word\n"; cin>>

 
AFAIC, a ray gets only reflected by a face if its origin stems from normal half-space, e.g. the space where scalar(normal, ray) >= 0. A cuboid has faces on both opposite sites, with opposite normals. A plane on the other hand has only a single face. If you turn the viewpoint around, you can end up in the wrong half-space (e.g. scalar(camera,plane_normal)<0 and therefore it will show up translucent.
But I'm not a frequent Blender user or even 3d designer, so take all of that with a grain of salt.
Eh, that should have been dotp instead of scalar.
 
4:33 PM
Monking
 
@GhostCat In the future, please don't use the existence of the Code Review site as a reason to close questions. Evaluate the request & use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic and Flag it for Mod intervention. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 28 secs ago
 
4:49 PM
@Zeta So a plane is more than just a plane.
 
@RMunroe lol
 
Monking
 
@Mast beamer ~== projector, right?
 
Beamer is a LaTeX document class for creating slides for presentations. It supports both pdfLaTeX and LaTeX + dvips. The name is taken from the German word "Beamer" as a pseudo-anglicism for "video projector". == Method == The Beamer class is not the first LaTeX class for creating presentations, and like many of its predecessors, it has special syntax for defining "slides" (known in Beamer as "frames"). Slides can be built up on-screen in stages as if by revealing text that was previously hidden or covered. This is handled with PDF output by creating successive pages that preserve the layout but...
Damn… everything makes sense now!
 
5:03 PM
lol
 
@MathiasEttinger I was hoping a BMW would be involved (。◕‿◕。)
 
@SᴀᴍOnᴇᴌᴀ Yes.
@SᴀᴍOnᴇᴌᴀ Technically those were bimmers, not beamers.
 
Unless it's a motorcycle, perhaps, but I'm a bit fuzzy on that.
 
darn Americanized spelling of slang names...
 
5:04 PM
But cars are bimmers.
 
If your code works and you're looking for feedback on any/all aspects of it and want to ultimately end up with code that's as good as it gets, consider putting it up on Code Review, with a description of what it does. I can think of several improvements, but FWIW no, I don't think there's any way around opening and saving-as-with-a-password, since adding a password involves saving-as. — Mathieu Guindon 48 secs ago
possible answer invalidation by Saint-Martin on question by Saint-Martin: codereview.stackexchange.com/posts/211398/revisions
 
@Duga C'mon man!
@Duga heh GhostCat has rep 88,888 currently on SO
 
@Duga Rolled back. Next time it's a mod flag instead of a rollback.
2
 
Wow
175
Q: Potential Employer Cancels Return Flight

SnahA company I was interested in just flew me out for an interview. It was on the other side of the country so they paid for my flight and hotel. Unfortunately, the interview went disastrously. I blew every question and I could tell that they didn't like me personally. When I got to the airport ...

 
5:28 PM
0
Q: Open encrypted PDF File without knowing the password

Sandro4912I wrote a program to encrypt a PDF File if the password is not known as an excercise. The resitrictions to unblock the password is, that a single english word (All capital or lower) was used to encrypt the PDF File. The Program uses a dictionary file to unlock the file. It looks like this: dic...

 
5:45 PM
possible answer invalidation by Saint-Martin on question by Saint-Martin: codereview.stackexchange.com/posts/211398/revisions
 
@Duga @Mast flagging it!
 
@SᴀᴍOnᴇᴌᴀ sigh
That's more of a rewording, now I'm tempted to simply roll back to rev 6 and mod flag (a mess is created regardless), but on the other hand I'm not sure this particular edit is mod-flag worthy.
Just when you think you've seen it all...
 
actually the latest revision appears to be clarification
It would help to add links to your previous question(s). Also, it's unclear what Concept.hpp is; without it, we can't tell what Concept::RESA is. ("RESA" is not an obvious acronym; and then you use it again in lresa_ and rresa_. I don't know what those identifiers are meant to signify.) — Quuxplusone Jan 13 at 1:26
Can you edit that into the question. Comments are not permanent. — bruglesco Jan 13 at 2:25
its too bad the OP didn't do that before the three answers came (~8-10 hours later)
 
I might just give up on C++...
84
Q: Why do we require requires requires?

BarryOne of the corners of C++20 concepts is that there are certain situations in which you have to write requires requires. For instance, this example from [expr.prim.req]/3: A requires-expression can also be used in a requires-clause ([temp]) as a way of writing ad hoc constraints on template ar...

@SᴀᴍOnᴇᴌᴀ Yes.
It's one of the reasons I rolled back partially the first time. But I'm not sure how to handle this except to keep an eye out and see whether it gets worse.
 
Monkey locked it
 
5:59 PM
-1
Q: Multiplying 2 arrays and code check

Patrik ŠoukalI would like to ask how to make my code more simple and effective. I know that this code can be 100% better. I am supposed to load number for each array and then take the 2 arrays (4*3 and 3*4) and multiply them into 3*3 array. Main points: Is the code working the right way ? How to make the s...

 
@CaptainObvious quite a bold statement...
> I know that this code can be 100% better.
 
@SᴀᴍOnᴇᴌᴀ Given the code provided, it's almost possible to say 100% of the code can be better, which is even grander.
100% better simply means doubling the quality (in whatever arbitrary measurement system).
 
.... which may be considered a rewrite
 
@SᴀᴍOnᴇᴌᴀ You picked up on that, didn't you?
 
6:04 PM
It's exactly the kind of code I expect from someone who has written C++ for just a few weeks, irregularly.
Walking through the examples of a book written 15-20 years ago.
@SᴀᴍOnᴇᴌᴀ I strongly suspect he'd been lurking here.
 
~nods head
 
Possibly helpful: Swift HackerRank Balanced Brackets on Code Review. — Martin R just now
 
0
Q: Performing GET request with axios and displaying data to HTML

BodrovI'm trying to use axios to perform a GET request on XML data. I've tried toying with different things and by moving stuff around, so I thought ask to get another pair of eyes. Here's my code: getListItems.js: function loadDATA() { axios.all([ axios.get(_[redacted].siteAbsolu...

0
Q: Blurring A Given Image using Moving Average in Python 3

Arhum IshtiaqSo, I've tried solving the following question, given to me through HackerRank: My Solution: import ast A = input() A = ast.literal_eval(A) def blur_image(a): result = [] for i in range(len(a)): row = [] for j in range(len(a[i])): total, count = a[i][j], 1 ...

 
@CaptainObvious ugh... we really need to change the name of this site....
Jan 11 at 18:15, by Mast
Perhaps we should change the title to something even more obvious, like Working Code Only Review
Maybe if the wizard UI is brought here it will help this problem...
 
6:20 PM
Maybe we should cooperate with some CI service and introduce a "project" snippet. Compilation fails? Automatic 3/5 close votes.
 
i think you want to ask this over at >> Code Review Stack Exchange — codereview.stackexchange.comLee_Dailey just now
 
I've lost hope on C++ long ago
Innovation is good, but it's just too complex
 
6:43 PM
@skiwi Agreed.
 
@skiwi Nah, it's fine *looks at template meta monster from last week*.
Truth be told, that monster could probably get simplified a lot with concepts. Or at least yield better error messages.
 
@Zeta Nightmare fuel
 
Eh. Substitution failure is not an error.
Heh. I guess C++'s SFINAE is Haskell's "A monad is just a monoid in the category of endofunctors, what's the big deal?"
Both make sense if you're used to the feature, but they are mindboggingly weird at start. Or later. Or in C++'s case: always.
5
 
Rendering an Excel table with HTML in a UserForm was done beforeMathieu Guindon 59 secs ago
 
@Duga Links to a VBA zombie posted in '17
 
7:17 PM
0
Q: Loop over whole array starting from any index

HenrikSI recently had to repeatedly iterate over an array but increment the index to start from each time. Since this is quite cumbersome in comparison to a normal for loop I made a small template function that does this for me: #include <algorithm> #include <iostream> template<typename TSize, typenam...

 
7:40 PM
possible answer invalidation by Patrik Šoukal on question by Patrik Šoukal: codereview.stackexchange.com/posts/211634/revisions
 
@Duga I feel like I am partly to blame :/
I could tell OP to add comments on the answers, though might not be able to, given reputation is under 50...
 
0
Q: Transfering Image Data with QTCPSocket

onur cevikIn my program I am transferring image files continuously through QTCPSocket for each frame I am creating new connection which I believe causes the performance problems. But I couldn't transform my code into single connection one. Everything works fine I can transfer images continuously but frame ...

 
@Duga Rolled back.
 
@SᴀᴍOnᴇᴌᴀ oh wait: "All users may comment on their own posts and any answers to their own questions." meta.stackexchange.com/a/19757/341145
 
7:58 PM
@CaptainObvious Why the downvotes?
 
8:51 PM
This question would probably be better suited for the codereview stackexchange. — Dillon Davis 56 secs ago
@DillonDavis some context is missing but it's not complete code. You have more rep than me on CR but anyway: CR asks that we don't habitually send questions there from SO. Performance optimization questions are still on topic here. — Andras Deak 16 secs ago
 
9:07 PM
0
Q: Trying to implement a singleton class to contain a DocumentClient instance, that can be overridden for testing

SlotharioThe DocumentClient is an object that accesses CosmosDb, but Microsoft recommends its kept as a Singleton class. I'm relying on System.Lazy to ensure thread safety. In addition, I want to be able to overwrite my DocumentClient when I need to test. Is this correct? public sealed class DocumentC...

 
That already fixed the error for me, thanks a lot! That's the problem with following too many different tutorials at once... I will try the other answer again later with your proposed changes and edit the question accordingly. Do you see any other things that might cause problems? Maybe I should post it to codereview.stackexchange after. — Niklas 34 secs ago
You are in dire need of code review. As far as this question goes, it would be much simpler if you posted only the piece of code where the error happens and also paste in the the full error message as appears on your screen. — Dharman 20 secs ago
 
9:28 PM
Sometime ago I answered a MATLAB vs numpy performance question on CR: codereview.stackexchange.com/q/17702/27783. But numpy performance questions are routinely answered on SO. — hpaulj 19 secs ago
 
9:49 PM
@200_success ¯\_(ツ)_/¯ I'm not sure the exact reasons but I could surmise a few reasons, e.g. the first version contained the question "Is the code working the right way ?" (which likely explains the VTC as UWYA), the tone sounds like the OP is asking for a rewrite of the code, etc...
 
10:09 PM
-1
Q: How to iterate through each url which has been read with python pandas

AskewI'm a beginner with Python and I'm trying to automate some tasks. What I cannot do is iterate through each url inside a large csv file after I read them with pandas and chunksize: import pandas as pd import urllib.request, json import csv pd.set_option('display.max_colwidth', -1) pd.set_option...

 
I think that Code Reviewers are sometimes way too harsh on questions that express some doubt about the code. Of course the author has doubts — that's what motivates them to ask for a review. (Don't we all doubt our own code sometimes?) The standard should be whether the code appears to work, not whether the question contains a forbidden phrase.
2
 
10:21 PM
Please check "Which site?" for general issues and "Code Review or not?"Prune 48 secs ago
You’ll probably get better answers to this kind of question over on Code Review SEMTCoster 41 secs ago
 
0
Q: Review one-by-one feature?

portonI am writing a library. It is mostly ready, but there are known bugs and ToDo stuff (including for example missing const specifiers for member functions which do not need to modify the object) and unittests are not yet done. I want to ask community opinion on some features. Should I produce one...

 
10:40 PM
possible answer invalidation by 200_success on question by Sandro4912: codereview.stackexchange.com/posts/211632/revisions
 
10:52 PM
@Duga its okay - just sample of sample file updated
 
0
Q: iterating 2D arrays in python, returns a simple list

XtracodeI have a 2D array say Mylist= [[200, 20], [30, 400]. I am trying to iterate, and normalise to get an output as : [[100, 10], [15, 200]] i.e. Mylist[0][0] is updated to 100, and all the other values change in proportion. def thelist(list): newlist=[] for i in range(len(Mylist)): f...

 
You might want to move this to Code Review as it's a better fit for what you're asking. — Nicholas Carey 6 secs ago
 
11:25 PM
possible answer invalidation by 200_success on question by Amir Kirsh: codereview.stackexchange.com/posts/211445/revisions
 
@Duga Thanks @200_success
hopefully OP doesn't give you any grief
 
0
Q: Repetitive Tic-tac-toe AI game with python 3

RobertI have a text based Tic-tac-toe game with a simple AI element that will take winning moves and block losing moves. The one piece of criticism I received was that I was 'hard coding' too much. I can see this, for example, in 'check_computer_win'. How can I use a dictionary to cut down on hard codi...

 
Former moderator here. I'm used to users giving me grief.
4
 
I figured you'd know how to deal with it
 
11:45 PM
possible answer invalidation by Jamal on question by Aditya: codereview.stackexchange.com/posts/211538/revisions
 
@Duga indentation fix on code
 
Code review are off-topic on this site. Try Code Review or edit the question to add an specific programming problem that you want to fix. — Rubén 36 secs ago
 

« first day (2083 days earlier)      last day (1927 days later) »