« first day (2893 days earlier)      last day (200 days later) » 

12:01 AM
RELOAD! There are 7485 unanswered questions (89.4865% answered)
 
12:38 AM
0
Q: php login system not working

codingturtleI have been learning and creating a login system with PHP and mysqli this week but have ended up stuck on the login aspect if (isset($_POST['login'])) { $username = $_POST['username']; $password = $_POST['password']; if (empty($username)) { array_push($errors, "...

 
1:02 AM
0
Q: Ti-84+CE Reverse Polish Notation Progam

vikarjramunA few weeks ago, I wrote a Reverse Polish Notation program for my Ti-84+CE calculator. It was a successor to a program I wrote in TI-BASIC a while back, but since that one had too much input lag to be usable, I decided to write this one in C and compile it to native z80 assembly. I wrote this pro...

 
1:20 AM
I am wondering can I get some feedback for this Makefile: codereview.stackexchange.com/questions/259066/…
 
I am wondering can I get some feedback for this Makefile. I think I did a better job. codereview.stackexchange.com/questions/259066/…Node.JS 48 secs ago
 
 
1 hour later…
2:38 AM
0
Q: Rails: What route to let show one resource but submit to another?

anon_sweI'm sketching out a data model for a Rails app that lets users submit answers to technical questions. For example, the prompt might be: Write a SQL query to determine the number of unique visitors last week My models would look like this: class User < ApplicationRecord has_many :submissions en...

 
 
2 hours later…
4:38 AM
0
Q: Is my implement of the correctness of Bellman-Ford algorithm wrong?

LnzI am following this tutorial: Bellman-Ford Algorithm by Jessica Su and implemented the Algorithm 2 as follows: def negative_cycle(adj, cost): """ detect negative cycle in a graph reference: https://web.stanford.edu/class/archive/cs/cs161/cs161.1168/lecture14.pdf param adj: list o...

 
5:26 AM
0
Q: Undo/Redo Functionality in DataGridView c#

Gökhan ŞAHANI have looked at many topics related to this topic, but I could not find or understand for datagridview table. Finally I made the undo / redo implementation myself using datatable lists. This solution is valid for small tables, I think. I don't know if it will work efficient on tables with lots o...

 
5:50 AM
0
Q: Avoiding Duplicated Code Fragments Graphene in FastAPI

akuaniHow can I avoid repeating code fragments between the mutations and types with graphene in a FastAPI app? I really want to avoid repeating any codes for obvious reasons. graphql\mutations.py import graphene from models.customers import CustomerLogin, CustomerLogin_PydanticIn from graphql.types i...

 
6:02 AM
Neither am I doing the price calculation correctly? nor Is there a simple way are specific. You're asking for a code review, which is what codereview.stackexchange.com is for. — Panagiotis Kanavos 22 secs ago
This is still a code review question. And the answer is still not in the Product class. For How can I implement the buy 1 get 1 free logic and discount logic in the same function? the answer is You don't. To How do I pass a list of lists like the question requires, it's use a specialized class like Basket or CheckoutPanagiotis Kanavos just now
 
0
Q: Grocery cart price calculation using OOP

coder1532I am trying to solve the following problem: Return total price based on items and certain conditions. For example, take this array [['oranges', 1], ['apples', 2],['grapes', 7]]. Based on this array return total costs if second array property is a quantity and product is first array item. If say...

0
Q: Async download of files

QHarrThe following code is an async beginner exploration into asynchronous file downloads, to try and improve the download time of files from a specific website. Tasks: The tasks are as follows: Visit https://digital.nhs.uk/data-and-information/publications/statistical/mental-health-services-monthly...

 
6:20 AM
Hello, stranger! Funny running into you here. This question was flagged for closure because it’s asking for, at least in part, design guidance. Once you’ve worked past the syntax issues, the design questions are better suited for Code Review Stack Exchange—which is a lovely community that I think you’d enjoy. Until then, I’d recommend editing the question to focus exclusively on the narrower syntactical question so it doesn’t get closed. Hope you are well! — Jeremy Caney just now
 
 
5 hours later…
10:51 AM
0
Q: How should I structure my post if my code is over 400 lines?

JensBMy code is around 480 lines and consists almost entirely of headers and implementation files, with a very short main.cpp. Should I put all my implementation into my header files when I post it on Code Review? That would shorten the number of lines a bit and I figured it might make it easier to go...

 
11:18 AM
I'm not sure what you're asking. Does this code work and you just want a code review, or is there a part that's not doing what you want yet? Code review questions are best asked at codereview.stackexchange.com, but if there's a part not working for you yet, you should be more explicit about the difference between what your code does and what you want it to do. — joanis 26 secs ago
If your code works, and this question is about optimisation, then this question is a better fit for Code Review. — trincot 7 secs ago
 
11:55 AM
2 earthquakes in the last hour in Los Angeles, not the best way to start the day.
 
Monking
 
12:24 PM
Asking about best practice seems more inline with Code Review. Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Stackoverflow is more on-topic for questions about problems and algorithms. — lorem ipsum 13 secs ago
 
 
1:09 PM
Sure but the problem is complex already, there's no problem in having a complex but maintainable solution. BTW, if your question does not get answered here, you can also try your luck at Code Review StackExchange, if you provide them with an already working piece of code of what you want to achieve — Yassin Hajaj 30 secs ago
 
1:47 PM
I’m voting to close this question because this question is more likely to get an answer on Code Reviewj3ff 15 secs ago
 
0
Q: Counting the number of unique IP addresses in a very large file

chptr-oneI made a test job to the position of Junior Java Developer. I did not receive any answer from the employer, so I would like to get a review here. Task description A simple text file with IPv4 addresses is given. One line is one address, something like this: 145.67.23.4 8.34.5.23 89.54.3.124 89.54...

 
2:03 PM
Ryan Donovan on April 05, 2021
Git branches! They allow you to keep different versions of your code cleanly separated. Here’s a look at how they work and why you should know about them.
 
 
1 hour later…
3:30 PM
Greetings, Programs.
 
Should I close this question? Based on the lack of response, I am concluding it is off topic. Is that accurate? codereview.stackexchange.com/questions/255339/…
 
@Donald.McLean Monking, are you anywhere near Los Angeles?
@user64742 One of the problems with it is that it is C and there are no variable declarations that I can see.
 
3:54 PM
Monking
@Mast closed
 
0
Q: Bash Script for healthcheck linux

kulfiI have below bash script which i have written to check the health of different storage component and then creates an incident through service-now tool. This is script is working fine for me but i think this can be improved as i written this while learning through different google sources. I would...

 
@pacmaninbw Not even close. PA
For a number of reasons, it would take an exceptional justification for me to ever be near LA, except possibly on vacation.
 
4:18 PM
@pacmaninbw Some compilers allow it and declare with 0 as initial value if not declared manually.
Considering gamemaker is for people that want to get things done quickly and don't mind it getting dirty, I'm tempted to guess that environment is one of those.
 
@Mast The C compilers I'm familiar with don't auto initialize anything on the stack.
 
@pacmaninbw That's because you and I like to use proper tools, not toys.
 
4:47 PM
0
Q: immediately invoked function inside for loop

ProClasicfor( let i = 0, j = 10; i < 5; (() => { i++; j++; })() ){ console.log(i, j) } so my question is that does it recreate the function everytime or it just create it once and use it again?

 
If you don't have any other test cases, you have to make some. We also expect that you will profile your code -- use a tool or do something to show where your code is slow. Otherwise, you're asking for a wholesale code review, which is a different site (StackExchange.CodeReview). — Prune just now
 
@CaptainObvious AOC - asking for explanation
 
5:13 PM
You'll get better responses posting this in codereview.stackexchange.comWoodford 30 secs ago
 
6:00 PM
0
Q: C++ overloading += operator in custom string class better implementation

Kostas LetrosI am trying to learn C++, so I started coding a custom string class (using only c-style strings) to get familiar with concepts like operator overloading etc. in the case we have a pointer attribute. I wanted to know if there is a smarter/better/neater way to implement the += operator (or the othe...

 
6:20 PM
@pacmaninbw what are you talking about. It’s not C?
 
14
Q: Does my code example need to be compilable/runnable?

Faheem MithaI'm thinking of posting a question here, but am unsure how I should do so. The question is about comparing the performance of a piece of pure Python code vs a hybrid Python/C++ piece of code, glued together with Boost Python. Now, I could (probably) create a minimal working example (MWE), but it...

9
A: Does my code example need to be compilable/runnable?

Gareth ReesYou'll get better answers if you post code that's runnable. Code that's runnable can be tested for bugs, timed for performance, stepped through in the debugger, and so on. For example, this detailed performance analysis and refactoring would not have been possible if the code had not been runnabl...

 
Hmmmm
how does one upload files to stack Exchange...
 
good question...
 
@user64742 usually not at all
 
I don't believe it is currently possible, unless it is an image
 
6:27 PM
Dang
 
it's not supported for anything but images
 
you could perhaps provide a like to a file though
Like this post does:
 
isn’t it against policies and etiquette to link to an external site?
 
1
Q: Parsing glider data from IGC files

NoNameI have to do a program in PHP that reads IGC files like this IGC file and gets records about the glider. For now I came up with something like this: <?php class Pilot { public $name; public $gliderType; public $competitionId; public $gpsDat...

 
@user64742 depends on what for :)
 
6:28 PM
@user64742 see responses to this meta post
46
Q: Can I put my code on a third party site and link to the site in my question?

Simon ForsbergIs it OK if I write a question and include a link to GitHub/Pastebin/other similar site instead of putting the code here on Code Review?

 
Oh no I meant in general. I thought on ANY website, you should never link people off-site. I’ve always considered it rude.
 
(sorry for double ping - apparently my copy failed)
 
Bleh, pings are free. Who cares. :)
 
some people in this room might
I guess if one edits 3 times, which leads to a quad ping, people might get bothered
May 21 '20 at 20:34, by Peilonrayz
The quad ping, save me!
 
LUL
 
6:36 PM
If the code is working, and you are now just trying to optimize it, then you should ask on CodeReview instead. — Remy Lebeau 55 secs ago
 
6:49 PM
0
Q: Delete last node in singly linked list

Andy Sukowski-BangIn a TED talk Linus Torvalds made a point about “good taste” at approximately 14:10 in the interview. I read through his examples of “bad taste” and “good taste” and wanted to implement the same principle for a function that deletes the last node in a singly linked list. I also followed his codin...

 
@user64742 That's pretty much the rule of thumb, yes. Everything should be in the post itself, not on a third-party website.
 
7:10 PM
@Mast ok. I will figure out how to put the entire code in the post then.
 
@user64742 How much code are we talking about?
Do you have a line and character count?
 
0
Q: Trying to flip coin 5 times, and find probability of 5 Heads, but a variable is unexpectedly always 0

SamiThe below code is supposed to simulate (flipping a coin 5 times) n times, based on the users input. If there are 5 Heads, then a variable FiveHeads increases by one. The result should be the experimental probability of getting 5 Heads, however: FiveHeads is always equal to 0. Note: Coinflip is se...

 
@Mast i don’t know.
And it’s not in a text file.
@Mast no but probably several thousand.
 
@user64742 Lines or characters?
 
Lines
 
7:20 PM
Could become a bit much, but might fit.
1
Q: Posting a whole project, ready for public review

Oliver YasunaSay I have an open source project hosted on GitHub or wherever, currently in the public review, testing, and bug reporting phase. The Asking page says: ...feedback on a specific working piece of code from your project... That tells me that it must be a piece of code not a whole project. Bu...

 
A bit much to fit in a stack exchange post you mean?
 
Code Review is a bit different than most Stack Exchange in the aspect of Post Length
 
The hard limit is 65,536 characters.
 
I am still catching up to chat
 
That's including description of the project and all, excluding title and tags.
 
7:22 PM
I’m confused what that meta post is regarding.
 
@Mast isn't that for newer users, I thought that Trusted users could do more?
 
@Malachi That's news for me.
 
Maybe I am making things up.... or hoping???
 
@user64742 The meta explains how to get a large project reviewed.
If it doesn't fit in 1 question, perhaps it can be split up. But not all projects are easily split up, it could cost you in how understandable the whole thing is.
2
 
@Mast My review isn’t that large though...
 
7:23 PM
You just said thousands of lines.
 
Yeah, there are thousands of lines in the entire program.
 
I am going to go back into Lurk mode, ping me if you need anything. I am trouble shooting some automation I am working on
 
I need to include all code needed for compilation within the review post, correct? Even if I didn’t write it?
 
@user64742 Third party libraries don't have to be included (some of them can't be included even, licensing).
7
Q: How do I properly write a question that involves third-party libraries?

User319I am preparing to submit a small OpenGL program for review. I've included some source files from this GitHub repo to handle some image stuff I don't want to deal with. I'm not asking for a review of these files, but they are necessary to build the program. So the project structure is something li...

However, if the code is unreadable without it, that might be troublesome.
 
@Mast they aren’t libraries
 
7:32 PM
You're not giving us a lot of information. I can't answer the specific question without more specific information. Language, character count, is everything in one file or properly separated, that's all relevant to knowing whether you can upload it and in what form.
If the libraries are easily downloadable, just provide a link. Again, assuming the code is readable without it.
 
0
Q: Writing car buffer in integer variables using c++. How to avoid writing the same piece of code for every variable?

HatuxI am trying to convert a char buffer into multiple int variables. This is what i got so far after a day of trying. ZeroMemory(buf, 4096); int bytesReceived = recv(sock, buf, 4096, 0); if (bytesReceived > 0) { /*for (int i = 0; i < bytesReceived;...

 
@Mast I linked the specific question being discussed.
Here I will link it again
0
Q: Nintendo Nightmare [any%] Speedrun Bot (17:37)

user64742This is a long review to get into, and as of writing this portion I suspect it will be about a week before I actually finish writing this question. I say this to forewarn anyone that my description here is my attempt to summarize what is going on, but I am more than likely missing crucial descrip...

 
possible answer invalidation by chptr-one on question by chptr-one: codereview.stackexchange.com/posts/259119/revisions
 
8:13 PM
0
Q: 2021 Moderator Election Q&A - Question Collection

CatijaCode Review is scheduled for an election next week, 12 April. In connection with that, we will be holding a Q&A with the candidates. This will be an opportunity for members of the community to pose questions to the candidates on the topic of moderation. Participation is completely voluntary. Her...

 
8:34 PM
My suggestion is that you ask this on codereview? — evolutionxbox just now
 
8:51 PM
0
Q: My first DFS using Adjancency lists - I'm not sure if I got it right

Octavian NiculescuI don't know if this is the perfect place to post this, but I'm desperate because I can't figure it out myself. If this is not the perfect place for this please offer some guidance on this topic anyway. I understand how DFS works on paper but I find it hard to implement. I have no problem impleme...

0
Q: Generic Wrapper class for HTTPClient methods

chiru1983I am trying to using HttpClient for making API calls from a different domain and for that purpose I have created the following service class after doing some research. It is 4.7.2 framework and not a .NET core system. I have created library class for this with following classes. Please give me yo...

 
9:02 PM
0
Q: When making a modification to a program, what do we include in the review?

user64742In this question here I made a modification to a program: Nintendo Nightmare [any%] Speedrun Bot (17:37) Am I required to include the entire program’s source as part of the code to be reviewed? Furthermore, how do we include all the code in a large project? Do we have to attach the files somehow...

 
that's probably not appropriate but about the post you just deleted and your number guessing game, you probably want to post your code on codereview.stackexchange.com it's really helpful ;) — Loïc 58 secs ago
 
9:24 PM
Code Review might be a better place for this. — Mike Sherrill 'Cat Recall' 12 secs ago
Fun project! However, I think the Code Review board is a more appropriate place for this sort of question. — Paul M. 42 secs ago
 
10:04 PM
0
Q: Graph dfs-related code passes almost all test cases, fails on a few

Владимир КирилинI have a following problem and corresponding code: You have a rectangular field of size NxM. You have K marked cells. N,M,K and marked cells coordinates are read from an input file. Two marked cells are considered adjacent if they share a side. The task is to compute the number of connected compo...

 
10:28 PM
0
Q: 16yo's Python PacMan - Being more Pythonic, Good Coding Practice, Extension tasks

Kevin WI have been coding 'PacMan' with my 16yo, a hopefully not to boring project to help improve his Python coding. We have just moved the 'Ghosts' into a Class which was a good first introduction to objects for him. My coding is far for perfect, and especially not in Python which was only just being...

 
 
2 hours later…
11:59 PM
 

« first day (2893 days earlier)      last day (200 days later) »