« first day (2567 days earlier)      last day (1433 days later) » 

12:00 AM
RELOAD! There are 6608 unanswered questions (90.0217% answered)
 
0
Q: Is this stack implementation OK?

BaftekI've recently started teaching myself basic C++ and decided to implement a simple stack with pointers. #include <iostream> using namespace std; struct StackElement { char value; StackElement* next; StackElement(char value, StackElement* next) : value(value), next(next) {} }; stru...

 
I’m voting to close this question because this was posted to stackoverflow instead of code review - there is no specific question. — Maarten Bodewes 49 secs ago
 
12:28 AM
@MaartenBodwes This would be off-topic on CR because OP isn't sure if it works correctly. Also, please don't use the existence of the Code Review site as a reason to close a question. Evaluate the request and use a reason like needs focus, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?Sᴀᴍ Onᴇᴌᴀ 39 secs ago
 
12:41 AM
This might live better in code review, as stackoverflow is not a code writing service - codereview.stackexchange.com — Eric Jin 45 secs ago
 
@SᴀᴍOnᴇᴌᴀ That was a bit of a weird warning towards me. Clearly the guy is wanting a code review, and a single run shows that the application works as intended; I would not have recommended it otherwise of course.
 
1:27 AM
@MaartenBodewes OP wrote "I don't know if it is quite right."... that borders on the Authorship of code rule...
one of the questions an OP should ask before posting here is To the best of my knowledge, does the code work as intended?
you might have been able to tell - I modified an auto-comment
 
Sorry, it's really unclear what you're asking. This seems more like an analytical design question, rather than a programming question. If so, maybe try the stack exchange network sites code review or software engineering. In either case, you'll need to post the code you've tried - there aren't any "please write my code for me" sites. Hope this helps! — Michael Delgado 23 secs ago
 
2:30 AM
0
Q: (Javascript) Please check my code for Sudoku validation

IvanI was working on this Codewar Kata called "did I finish my sudoku". I couldn't find any problems but apparently there is a bug somewhere. Can you help me find it please? function doneOrNot(board){ var result = "Finished!" var checkerRow = {} var checkerColumn = {} var checkerRegi...

 
Try to implement the answer from codereview.stackexchange.com/q/145757 tried it and it works! — Bermylle Razon 1 min ago
 
2:53 AM
0
Q: Delphi pascal error

MohaI am using a function submitted by the user @ Andreas Rejbrand. Thanks to the user I can write a program that does not accept special characters in a string the issue is when putting this into another program it compiles successfully but stops at the first write line.Here is the code. Any help wo...

0
Q: Return a default object unless you get Some( Ok() )

Evan CarrollDoing this Rustlings I find I'm unhappy with the code I wrote, let person: Person = args.next() .unwrap_or_default() .parse::<usize>() .map_or_else( |age| Person{ age, name }, || Person::default() ); What I want is something like let person: Person = args.next() .unwrap_or_default() ...

 
3:17 AM
0
Q: I made a quiz on xcode and I want to create a score that display after finnishing the quiz

user13474225I am still beginner learning swift so I really find it hard to make my own logic. I created a quiz and I want to add a results points on correct answers. I created another viewController to display the result there. I am thinking to use an if statement but I am confused how to use to make it righ...

0
Q: Speeding up a recursive Cantor pairing function

HomeworkHopperThe Cantor Pairing function is a mathematical function which takes two integers and combines them into a single integer that is unique to that pair. This single integer can later be "unpaired" back into the two original, separate integers. Further information on this function can be found here an...

 
3:29 AM
Ask this in different domain https://codereview.stackexchange.com/Uday Chauhan 54 secs ago
 
 
1 hour later…
4:35 AM
possible answer invalidation by Harris on question by Harris: codereview.stackexchange.com/posts/242156/revisions
 
4:52 AM
I’m voting to close this question as off-topic because requests for feedback on working code belong on Code Review, not here. — Joseph Sible-Reinstate Monica 43 secs ago
Stack Overflow is for broken code. For improvements to working code I suggest you ppsting your question to codereview.stackexchange.com ;) — Roberto Caboni 5 secs ago
 
5:37 AM
0
Q: Finding the string from the list of array objects

Nɪsʜᴀɴᴛʜ ॐTA.ServiceProxy.RoleManagement.GetSubPrivilagesResponses subPrivilagesResponses = GetSubPrivilagesFromPrivilageCodeStatic("Authoring01"); if (subPrivilagesResponses != null && subPrivilagesResponses.SubprivilagesList != null) { for (int j = 0; j < subPrivilagesResponses.SubprivilagesList.Leng...

 
6:00 AM
0
Q: why this compiler shows error '{' this but i make it solve but it regularly show this?

puneet patel public class Hello World { public static void main(string[] args){ System.out.println("Hello World!"); } } this code shows me the error expected error but i make shure that everything ids oky.... how to show this problem solved?

 
@AluanHaddad I suppose you could do that, but I don't think that would pass one of my code reviews :) — Alex Wayne 47 secs ago
 
6:47 AM
0
Q: Java Spring Boot Web App

jman25I recently built a Java Spring Boot web application as an educational project that fetches and displays data returned from NASA's Mars Weather Service API. The project is essentially an attempt to reverse engineer this page: https://mars.nasa.gov/insight/weather/. Here is a link to the GitHub rep...

 
7:15 AM
possible answer invalidation by Harris on question by Harris: codereview.stackexchange.com/posts/242156/revisions
@alexrnov Thank you for code review — Odilbek Utamuratov 16 secs ago
 
7:57 AM
0
Q: C linux command

user224231I have the following code made in C language which reproduce the functionality of the mv (move) command from linux. The problem is that the code is very inefficient. How I can optimaze or make the code more efficient without changing the structure to much? #include <limits.h> #include <fcn...

 
8:20 AM
0
Q: Bugs - Program that Creates a Directory in C

JoanaBjatBunI have the following code that creates a directory in C. I tested it multiple times, reviewed it a few times and it looks fine at the moment (from my perspective atleast). What I really wanna know is what bugs does it have and how can I fix them ? (comparing it with the mkdir command from linux...

 
0
Q: PHP get minDateTime from array

DasBenI've written a function to get the smallest date from an date[ ] and check for null. If null == infinity /** * @param DateTimeInterface|null ...$dates * @return DateTime|null */ public static function minDateTime(?DateTimeInterface ...$dates) { $dateList = []; ...

0
Q: Service Locator w/ Lasy Loading Support

Teddy KI am experimenting with the ServiceLocator pattern. I'd like to support lazy loading of items. protocol Resolver { func resolve<T> () -> T } protocol Register { func register<T>(instance: T) func register<T>(reference: @escaping () -> T) } final class LazyServiceLocator { enum ObjectR...

 
9:30 AM
0
Q: Line Editor LinkedList Optimization

Darnoc ElocHow may the code below be optimized to minimize runtime? A linked list it utilized to implement a line editor which is designed to read inputs (line by line) from the user in the form of space delimited strings, edit specified lines of inputs, search specified lines of the inputs for matching li...

 
10:17 AM
-1
Q: what is the better way to write this - Python lambda and map

RAMMURTYa = [0 for I in range(20)) map(lambda x: a[x-1]+=x, range(20)) I know we cant assign item in lambda, how do I get this done. Please help.

-1
Q: can anyone transfer high stars gihub repositary owner?

schellong the question :can anyone transfer high stars gihub repositary owner ? its very helpful that if you have about 200+ stars repositary you want to transfer. or you want to sell it . thank you

 
I pasted in code review but it is downgraded without any reason.Not sure what i am missing — Vicky 24 secs ago
 
10:40 AM
0
Q: Best practice for Python private variables in a class

Jakov KusićI was reading about private variables and functions in Python and I managed to get almost everything except one thing. Is it recommended to write underscore before variables defined inside a function? Here is the code so it can be more clear: Version 1: class House(): def __init__(self):...

 
11:03 AM
0
Q: C++ - a header only library for CSV

matsuragoI started to learn C++ after programming for some years in Java, and this is my first (header-only) library. When switching from another language, it is always difficult not to project the old habits into the new medium, and thus I wonder how idiomatic my C++ code is, so it would be awesome if so...

 
11:21 AM
@SᴀᴍOnᴇᴌᴀ Authorship no way. You can reach for broken, but I'm not really sure it's off-topic. Does the code work on the surface?
 
0
Q: Always initialise C++ class method local variables before class data members?

user2023370I often create and observe C++ class methods which conclude by setting data members of the class. Frequently, local variables are initialised with values used later to assign class data members. Something like this: auto myclass::mymethod1(...) { auto myvar = foo(); // intermediate code usin...

 
11:50 AM
0
Q: MultiDictionary implemtation C#

RoQuOTriXBecause C# .NET does not come with a MultiDictionary, I implemented one based on this StackOverflow answer. The MultiDictionary should be able to hold multiple values for one key and remove the key, if no value is assigned to the key anymore. I wanted to implement nearly all methods, which the ...

 
12:28 PM
And learn to join properly - no one should be joining using the old-style syntax via the where clause. Nor do you need to COUNT at all - that is just a generally wasteful. Use EXISTS to determine if rows actually exist. Statement terminators are also a good habit to develop; eventually they will be required. Seems like it time to start learning best practices and doing some serious code reviews. — SMor 10 secs ago
 
0
Q: Rust Code for simple Readability Check

vaengI'm new to Rust and would like to know if my code is using the language well, if there are big improvements and if the code in general is rust-like. At the moment it feels very C. I haven't yet developed good feeling on how to incorporate the match function or how to check in a range of chars. Th...

 
1:00 PM
0
Q: Computer class exercise

xioacd99I am trying to design a computer class.I want use a function named Work to check the state of each hardware.But it failed when used in Dell/IBM class(it works when just used in PC class).I can't figure out why it failed. it can be complied successfully. the Work() is in line 117,which has a FIX...

 
1:20 PM
possible answer invalidation by Kh Ahmed on question by Kh Ahmed: codereview.stackexchange.com/posts/206615/revisions
 
0
Q: Getting segmentation fault in swap Kth node from beginning and Kth node from end in a linked list

Disha KhattriIf I get the linked list input as: 1->2->3->4 and K=1,num=2 The desired output for the given question is 4->3->2->1 Swapping of data is not allowed and I am given head pointer, the value of K, and num as arguments of the function. I am getting segmentation fault despite checking all corner cas...

0
Q: Linked List implementation in Ruby

Steven AguilarI was working on Leet code design a Linked List problem. My solution with a @tail pointer, althought it added complexity it made adding to tail O(1), also having a variable size @size made it easier to counter edge cases. Here are some of the stats: Success Details Runtime: 100 ms, faster tha...

 
1:46 PM
0
Q: Duplicated classes caused by relations seems smelly

user224257This is my first time developing .NET app all by my own and I think the architecture I applied seems wrong and I would like to change it until it isn't too late. I have 4 kinds of Posts, so created 4 classes PostA, PostB, PostC, PostD (real names are different) and my ORM (Entity Framework) creat...

 
sigh. ... can someone remind me why it's not possible to switch over types in java?? ...
 
2:20 PM
Because no one wrote an RFC for it yet?
 
2:33 PM
0
Q: Reading String data into a Tree like nested grid structure (like Sudoku Board)

ReduContext The original idea is to create an efficient grid structure for a Sudoku like board but this can be applied many such grid structures (like wavelet transform on images, JPEG2000 etc). This particular one is basically a 9x9 Board which is made up of 3x3 Blocks where each Block is is made u...

0
Q: Menu for X11 using Xlib in C

barthooperI am learning the xlib library and I made a xmenu utility in order to practice it. It receives as input a menu specification where each line is a menu entry. Each line can be indented with tabs to represent nested menus. Each line is made of a label and a command separated by tab. When you selec...

 
Ryan Donovan on May 14, 2020
After interviewing several developers, a pattern started to become clear: great developers share a lot. This takes different forms for different people, but is very often a blog. But for many top developers, their sharing mindset came before their success, and was the direct cause of it, not the result of it.
 
2:52 PM
This seems like a better fit for codereview.stackexchange.comitsme86 13 secs ago
@itsme86 code review does not provide performance improvement. — Deepak Mishra just now
 
0
Q: Network colormap based on length of routes (Pyhton, osmnx, networkx)

DPMCurrently I have a plot that shows all the shortest paths between all the nodes in my network and my target: Now I would like to make a colormap, where I would color the origin nodes and the edges based on the distance of the shortest path. Can anyone help me? Here is what I have: import netw...

 
3:31 PM
@Peilonrayz Ah check - thanks for correcting me. I was confusing close reasons - the link I was thinking of is on the CNWAI reason
 
> but I don't know if it is quite right.
This can mean a lot of things, that it doesn't work correctly, that it's not following best practices
 
@MateiAnghel "I tried somethingh but it's messy and tangled, and I can't figure out a cleaner way" If you tried something, it works correctly, and want to improve it, consider asking on codereview.stackexchange.com. As is, your question seems like you want us to do all the work, without attempting to do it, yourself. — Algirdas Preidžius 33 secs ago
 
4:29 PM
1
Q: Ising model simulation using metropolis algorithm

Kartik ChhajedI am new to this community; I have tried my best to respect the policy of the community. I have written the Monte Carlo metropolis algorithm for the ising model. I want to optimize the code. I have tried my best. I want to optimize it further. The following is the code: (I have used tricks like ...

 
5:16 PM
-1
Q: 162,000,000 Cycle crashes Excel every time

TKE-439PasteBin Link I've got a code that has a "master sheet", a "value sheet", and a "non value sheet" (as well as about 100 other "store specific" sheets that are part of the process before this, but have no importance here). The master sheet is a data-set of store numbers (column "A"), Barcodes ...

 
@Reed Asking for a library recommendation is off-topic. If you have working code, then that's also off-topic - it may fit better at Code Review. If your code does not work, then you need to clearly explain how it doesn't work ("it's ugly" doesn't count) — mason 5 secs ago
Code Review absolutely can help with performance. See What topics can I ask about here? where it says "If you have a working piece of code from your project and are looking for open-ended feedback in ... Performance … then you are in the right place!" Seeking feedback about performance for a working piece of code sounds like a pretty good description of this question. Note that both sites have a performance tag that would be appropriate, too. — BACON 32 secs ago
 
5:39 PM
0
Q: One of my first Bash scripts - checking for best practice and error handling

Daveh0I have a Bash script that resides on Remote Server A and transfers files from Remote Server 1 to Remote Server 2. Remote Server 2 is a Dropbox folder so in this script, I call another script (that's not mine) to interface with the Dropbox API. This is one of my 1st forays into the Bash-scripting...

 
6:24 PM
 
6:49 PM
Totally irrevelant but out of my respect to your knowledge and approaches could you please have a look at this. I will garbage collect this comment later. — Redu 48 secs ago
@robmayoff Perhaps this could have been placed in code review. Im more so concerned about maintaining declarative API, given that async tasks are handled in start. New to combine and felt like this was a hack, but if potential risks are repeated calls and memory leak that i can fix, perhaps this implementation is fine. — J. Doe 57 secs ago
This is a codereview question. — bitmask 28 secs ago
 
@Duga there is not enough garbage collection happening here :[
 
7:12 PM
-2
Q: What's wrong with this stack implementation?

throwaway142My CS teacher sent me the following code for implementing the stack. I've been programming for a few years in higher-level languages, but have rather weak experience with C++. I mean, this code just doesn't seem right to me. What's wrong? #include <iostream> using namespace std; struct stackEl...

0
Q: Counting Balanced numbers in a given array

srkI am trying a code challenge. Here is the problem description When an element is deleted from an array, the higher-indexed elements shift down one index to fill the gap. A "balancing element" is defined as an element that, when deleted from the array, results in the sum of the even-in...

-1
Q: Code crashes Excel. Can it be optimized in any way?

TKE-439Below is my code that checks 900 lines on one sheet ("Value") against 90,000 lines on another sheet ("Master") then repeats the process for a second sheet ("Non Value"). The code runs without any actual errors, but the strain of running through such large datasets crashes Excel. The image shows...

 
7:36 PM
0
Q: MCU (Embedded C): Use nested if/elses or use an ugly function?

Minh TranI'm writing driver code for the SPI peripheral (as part of a tutorial) on a Nucleo64 (STM32F446RE). The instructor recommends writing this code: // General macros #define EnableStatus uint8_t #define DISABLE 0 #define ENABLE !DISABLE void SPI_EnablePeripheralClock(SPI_RegDef_t *pSPI,...

 
7:59 PM
0
Q: Huffman Encoding in Javascript

FlatAssemblerSo, I've implemented Huffman Encoding in JavaScript, you can see it live here. Here is the code: var letters,maxX,maxY,minX,maximumDepth,inputString; function onButtonClick() { inputString=document.getElementById("input").value; if (inputString.length<2) { alert("Strings of lengt...

 
8:47 PM
If the question is "how do I write this code more elegantly", that's not really on-topic for Stack Overflow - try codereview.stackexchange.com. Otherwise you'll need to be more specific about what exactly you're trying to figure out. — Karl Knechtel 42 secs ago
 
9:29 PM
I’m voting to close this question because it is a good fit for codereview.stackexchange.comHarshal Parekh 21 secs ago
 
1
Q: Can I make this code amendment shorter, and still efficient or more efficient?

barlopThe method blah_all() is the code I am starting with. It just lists all files in "c:\windows". I want to adjust it to list only the first 10 files (if there are as many files as that there). I can see that Directory.GetFiles(sDir) returns an array of string. The original method blah_all(), tak...

0
Q: Trading application

ColatI am currently trying to create a trading application via pyqt5 and pyqtgraph. To display the chart I use the example code given in the pyqtgraph examples. import pyqtgraph as pg from pyqtgraph import QtCore, QtGui ## Create a subclass of GraphicsObject. ## The only required methods are paint(...

 
9:44 PM
I’m voting to close this question because it belongs on codereview.stackexchange.comEmile Bergeron 59 secs ago
@HarshalParekh Codereview needs the actual code to be directly embedded in the question. — user58697 29 secs ago
 
10:06 PM
how long does it generally take for a basic question to get answered on this site? i see it seems slower than superuser
 
@barlop it depends on the tags/langauages/frameworks... generally has decent coverage...
I see your question currently has 2 votes to close with the reason that there isn't enough context
 
@barlop It might also be better if the function names were a little more real rather than blah_.... Variable names could probably be better as well. We like to see real code.
 
@barlop did you read the post (and answers) in the comment I left??
 
@SᴀᴍOnᴇᴌᴀ One of the VTC is mine.
 
@pacmaninbw okay- I left comments on the post to get OP to improve title
 
10:24 PM
@SᴀᴍOnᴇᴌᴀ I saw that, the code is more of a problem than the title. It seems hypothetical.
 
@pacmaninbw okay - you could leave a comment about that...
 
@SᴀᴍOnᴇᴌᴀ So commented.
 
@pacmaninbw thanks!
 
NP
@Mast is going to have a lot of close votes to look at when he rejoins us.
 
perhaps...
sometimes I lose motivation to go over them...
 
10:37 PM
I start my day at 6AM PDT looking at the queues, think how I feel.
@barlop VTC retracted. You might want to fix the indentation on that second Console.WriteLine().
 
@pacmaninbw sometimes I check it mid-morning and throughout the day...
maybe we would be less-stressed if people read the instructions...
~ trying to find updates about the SE question wizard~
maybe we should get the modal instructions updated ^^
it sounds too coupled to the SO instructions
interesting ... it seems login is a pre-requisite for asking on SO but not CR...
 
10:58 PM
It would be good if asking required login on CR as well.
@SᴀᴍOnᴇᴌᴀ ^^^
 
apparently that modal has only been out for a couple months...
70
Q: The new ask page is now live on the network!

JNatAfter rolling it out to the International Stack Overflow sites last week, we're rolling out the new ask page to the whole network today. The new page was designed with the goal of helping new askers by more readily presenting them with tips on how to improve their question. This is a combination...

 
11:17 PM
Come on, what if he started coding yesterday? Also this is not code review stackexchange you know that very well — Józef Podlecki 17 secs ago
 
11:29 PM
1
Q: Looping over a map requiring casting and instance checks

karvaiThe following method works. I am looking for advice to make it more readable. To see if I could avoid any unneccesary checks / casting and the instance of check. Also not a fan of having to recreate the initial String with every loop but not sure if there is a way around it. Things to note....

 
0
Q: Let's update the modal for new askers

Sᴀᴍ OnᴇᴌᴀThe Issue The SE Meta post The new ask page is now live on the network! mentions the following: The /questions/ask/advice page has been replaced by a new modal for first-time askers, and the flow is now broken down into two steps: drafting the question, and reviewing the question — so no mor...

 
in questions, why do you want working code from a project? you can't possibly run it if it's just taken out of a project
and there'd be tons of stuff in there that wouldn't be relevant to the question they are asking
and OK sure there may be flaws in their code that they aren't aware of, so that may be a reason for it to be from a project. But you can't possibly run it if it is just taken out of a project.
so trying to improve it algorithmically would be tough.
 
11:44 PM
@barlop There are actually ways to test the code, however, we can check the algorithms visually and find things that can be improved. Just FYI, while your code compiles it doesn't really run because you haven't called either function in main().
The code would be better if the 2 function definitions weren't in Main() but listed in the class.
 
Ouch. That would never pass a code review in any of my projects! — ADyson 31 secs ago
 
@Duga Perfect timing.
@barlop I think this question would have been better on asked SO.
 

« first day (2567 days earlier)      last day (1433 days later) »