« first day (2621 days earlier)      last day (1379 days later) » 

12:00 AM
RELOAD! There are 6800 unanswered questions (89.8760% answered)
 
 
1 hour later…
1:22 AM
0
Q: I know I should convert switch statements too Factory's, is that what I should do with this messy switch?

TerryIn react I have a HTML Element Factory, it allows several different types of form elements to be created most with the same onChange but some have specific uses. I have been capturing them in this switch, but its time to refactor, what should an onChange() switch be converted to, should this too ...

 
1:46 AM
0
Q: How to solve problems with rerenders in React?

cuomoI have been trying to solve this problem for almost 3 days now but am losing all hope. When 'FormBusiness' shows on my app, many many rerenders will occur. I tried console.log and most of them come from 'TimeGridBusiness' component. There are 3 different useEffects there and I have tried pretty m...

0
Q: AdBlock Syntax Highlighter (Part 1 - AdBlockSyntaxLine Class)

AdmiralThrawnI created a syntax highlighter in JavaScript. The language it highlights is AdBlock Filter Syntax, the language used to write filters for ad blocker extensions in browsers. Shown here is the AdBlockSyntaxLine Class, which is the core class that dices a line of text into categories. These categori...

 
 
1 hour later…
2:59 AM
0
Q: Reversing a doubly linked list in C

PyWalker27Looking for feedback on this code to reverse a double linked list. Things I am potentially looking for but missed -> redundant operations, extra / unnecessary arithmetic, improvement in code style. Thank yoU! typedef struct Node { int data; struct Node* next; struct Node* prev; } Nod...

 
3:47 AM
0
Q: Python: Database efficiency with peewee

SaelythI have this code to get a lot of records from different databases of peewee but I feel it could be improved a lot. Any feedback? from peewee import fn as sqlfunc def search_records(self): """Request a list of records from the database, providing a list of specific conditions.""" # Query ...

 
 
1 hour later…
5:01 AM
1
Q: Paassword generator project in Python

KadragonA few days ago I posted my password generator project to help me learn and become more comfortable. I got a lot of great replies from that and I've sense updated and would love another look at the program. I've made it so that I can import it and use it to generator a password. I've also added su...

 
If the code works, you should post it in the code review Stackoverflow doesn't provide feedback or code reviews — sinanspd 20 secs ago
 
5:49 AM
This might be a fantastic question for Code ReviewC.Nivs just now
I’m voting to close this question because it belongs on Code ReviewTrenton McKinney just now
 
6:23 AM
For the macro, it's one of the most commonly used ones by competitive programmers and it's quite simple -- You are missing the point. First, this is not a competitive programming site. Second, you are asking someone to look at your code, and having to figure out every time we see "loop(n)" what that means, regardless of how "simple" it is. This loses focus on looking at the flow of the program. Third, usage of such macros wouldn't pass any code review. — PaulMcKenzie 9 secs ago
 
 
2 hours later…
7:58 AM
Monking
 
8:12 AM
Probably a better question for codereview.stackexchange.com. Though please make sure you read their help first — Liam 31 secs ago
 
0
Q: Is this good OOP design for Producer Consumer?

J.OlufsenDoes this code github.com/J-Olufsen/producer-consumer follow common best practices? Among other criteria, the following aspects are quite interesting: Design and use of Spring IoC to comply with SOLID Design of exception handling in Runnable implementation. Clean Code / Cognitive complexity of t...

 
Monking
 
8:33 AM
Monking
@SᴀᴍOnᴇᴌᴀ And piste ratings.
5 stars is missing too.
@SᴀᴍOnᴇᴌᴀ @Peilonrayz Closed.
 
0
Q: Is this a good way of selecting changes from a temporal table?

Nathan CooperI'm using Temporal Tables on postgresql (https://github.com/arkhipov/temporal_tables). I've written a way of recovering "changes", rather than just a list of "history" (I'll explain what that means in the question). Is it any good? Context. Here's my setup: I have a table with the current entity ...

 
9:03 AM
0
Q: Why empty signals before waitpid() call then block them after?

MaryI was wondering how strace was working so I looked some source code to understand a little better how it worked. Now I almost understood the whole code, I still have a question. I would like to understand what is the point of empty signals before calling waitpid(), then block signals after its ca...

 
9:51 AM
0
Q: Any suggestions about this two simple javascript functions? (beginner asks)

mister nobodyI'm building up a simple blog from scratch. I've noticed that the blog needs JS to update the new posts section and to update some descriptive meta tags. I like to set up meta tags properly so when somebody shares the page, they get some details along with the URL. So the two functions I've writt...

 
10:21 AM
This seems to be better moved to codereview.stackexchange.comzwcloud 53 secs ago
@zwcloud This question would be off-topic on Code Review as it is asking about generic best practices. Please familiarize yourself with what is on-topic and our guide to Code Review for Stack Overflow users. — Peilonrayz 30 secs ago
 
11:04 AM
-1
Q: Optimised approach for subsequences in java

PRANATHI GI came across this question in a coding competition and I got TLE. Can I know how can I optimise this Unique Subsequences: You are given a randomly generated string of characters ranging from a to z. You are required to determine the number of unique subsequences that can be formed equal to this ...

 
11:28 AM
0
Q: Ruby calculator for a grocery store

Abhinav SinghI have been working on this code to meet the best OOP standards for production. The code is working but I wish to make this a more efficient code. Could someone help me out here to make this efficient using best practices of ruby. class Item @@items = {} def initialize(name, price) @@item...

 
11:58 AM
I’m voting to close this question because the code works, and OP is asking for code improvement/reviews. It is therefore better suited on Code Review instead. — Terry 8 secs ago
@Terry Don't use the existence of Code Review as a reason to close a question. From now on evaluate the question and use a reason like; needs focus, primarily opinion-based, etc. This question would be off-topic on Code Review as it is missing context. Please familiarize yourself with what is on-topic and our guide to Code Review for Stack Overflow users. — Peilonrayz 39 secs ago
 
12:17 PM
0
Q: Optimised approach for prime factorisation

PRANATHI GFour Functions Given four functions A(x) = Number of i where 1 <= i <= x and gcd(i,x) = 1 B(x) = Sum of A(d) where d divides the number x C(x) = Sum of exponents of each prime in the prime factorization of B(x) D(x) = Sum of C(i) where 1 <= i <= x If B(x) = (p1 ^ a1) * (p2 ^ a2) * (p3 ^ a3)----...

 
12:41 PM
-1
Q: How to get out of if/else hell and avoid casting from nullable to non-nullable types?

FretsI have a method called GetActionCode() which sets a new action code (A, C, R or D) for a user based on: userState which has a active or term value accountExpiresOn which is a DateTime value udf7 which is an optional DateTime method parameter employeeIdentifier is an optional string parameter and...

 
1:13 PM
This probably belongs on Code Review, perhaps without the first paragraph. — kabanus 29 secs ago
Probably a question better suited for code review instead of SO. — Brian Thompson 16 secs ago
This question would be better suited for Code Review. — AndrewL64 18 secs ago
 
1:54 PM
0
Q: How would you refactor this class? Interview task

andreossI want to improve this code sample which I use for interviewing. Backstory: A small java core (hence no extra dependencies) application leaves a file with content at exit, and picks it up at start up. Sometimes we want to skip all non-ASCII content from it, when the application was started in non...

0
Q: Simple Tic Tac Toe game inside terminal. Made in C

FrankforkHello fellow programmers. I started learning C last week and today I wanted to see if I can make a working program, so I made this game: /* * TESTED IN LINUX - 2020 */ #include <stdio.h> #include <stdlib.h> int player = 1, choice; int places[10] = {'o', '1', '2', '3', '4', '5', '6', '7', '8', ...

0
Q: C++ reactor bad implementation

slaventosfolks. I have recently started writing software using Modern C++ 11-14. I have been developing software for more than a decade and just wanted to broaden my skillset. I am practicing building some simple design components using Modern C++. I dont have any friend or a colleague who knows c++ and n...

 
2:18 PM
0
Q: Items with LoadMore Buttom, filter and the detail of first item or clicked item in react hooks

BibekI am building the list of items (TEST) with loadMore bottom with filter and want to have loading state in LoadMore bottom and items itself. After Loading the item I want to fetch the detail of the first item for first time and after that load the detail of the test. If the Item is clicked again ...

 
2:43 PM
0
Q: Mergesort (using vectors) and some questions about memory

Minh TranBack from a long C++ hiatus. I thought to implement mergesort from memory, using containers and not based on CLRS's pseudocode and arrays. The compiles and runs ok on the test cases. One thing I don't completely understand is memory management, especially for the vectors created in Mergesort(): ...

 
This belongs on Code Review, not Stack Exchange. — Todd A. Jacobs 50 secs ago
There is quite a lot to go through here - and as said above, it probably belongs on the code review board, not StackOverflow (which is intended for objective solutions to a problem, not subjective opinions about code quality). — Tom Lord 49 secs ago
@ToddA.Jacobs What does that even mean? You do know there is a Code Review Stack Exchange right? — Peilonrayz 35 secs ago
 
3:02 PM
Monking
 
This question might be a better fit at codereview.stackexchange.comspickermann 21 secs ago
@spickermann This question would be off-topic on Code Review as it is missing context. In the future please link to the help center when recommending Code Review. Take, This may be on-topic on Code Review. Please check [if it is on-topic](//codereview.stackexchange.com/help/on-topic) and [how to post a good question](//codereview.stackexchange.com/help/how-to-ask) before posting there.Peilonrayz 8 secs ago
 
3:50 PM
This question will probably do better at codereview. See codereview.stackexchange.comScootCork 21 secs ago
@ScootCork when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". For one thing the title should describe what the code does instead of review goals... — Sᴀᴍ Onᴇᴌᴀ 21 secs ago
 
4:03 PM
There is a Beatles song that applies to me today, When I'm 64
3
 
Is it someone's birthday today? 🤔
 
@ToddA.Jacobs You @ed the wrong person, but I got what you meant. codereview.stackexchange.comTom Lord 42 secs ago
Oh... And weirdly, OP actually already posted it there but X-Posted the question here! — Tom Lord 24 secs ago
 
@Peilonrayz Yes, normally I would be in Las Vegas, but Corona has put a damper on that this year.
 
Happy Birthday @pacmaninbw
 
7/7 seems a good day to roll the dice.
Thanks!
 
4:12 PM
lol. Corona, man :(
 
I'd likely rather have a 7&7 than a corona
 
:)
When I drink beer, it is Dos Equis (or more often Sierra Nevada Pale Ale).
New Castle is also good.
 
Monking
 
And sometimes Guiness is called for.
Sometime today I'm going to pull out my bottle of Macallan 21 and have a shot, but it's only 9:17 AM here.
 
I like the New Castle 1554.... the brewery in CO is fun to bike to, since the town (i.e. Ft. Collins) has a free bike library
 
4:19 PM
@SᴀᴍOnᴇᴌᴀ Do you bike all the way from Portland?
 
@pacmaninbw hehe no, flew to Denver, then drove up there for a wedding .... wow that was 10 years ago...
 
Time flies when you're having fun.
 
If you are trying to improve code that is already existing and working, you should probably post on CodeReview instead of SO. — GrumpyCrouton 48 secs ago
@GrumpyCrouton In the future please link to the help center when recommending Code Review. Take, This may be on-topic on Code Review. Please check [if it is on-topic](//codereview.stackexchange.com/help/on-topic) and [how to post a good question](//codereview.stackexchange.com/help/how-to-ask) before posting there.Peilonrayz 42 secs ago
 
@Peilonrayz how do you find the comments so fast?
 
The autocomments? I've made a DSL to make them, I talked to Mast about it here (some context below and above) but I have it on GitHub too. In this case I just had a very similar command entered previously so it was faster
Or do you mean find in a different way?
 
4:40 PM
No, you answered my question.
 
4:55 PM
@spickermann I appreciate the suggestion, but I am more asking a general question about what is the best practice for this kind of thing (ie where to move the methods, file structure, etc). My code is stripped down to demonstrate the question easier.. i dont see how this question fits the need for actual code review. — Rigs just now
You should ask this here: codereview.stackexchange.com Stackoverflow is more suited for specific coding problems. — Roland Deschain 21 secs ago
@RolandDeschain In the future please link to the help center and use wording that shows the post may be off-topic when recommending Code Review. Take, This may be on-topic on Code Review. Please check [if it is on-topic](//codereview.stackexchange.com/help/on-topic) and [how to post a good question](//codereview.stackexchange.com/help/how-to-ask) before posting there.Peilonrayz 13 secs ago
 
5:21 PM
I’m voting to close this question because it is better suited for Code Reviewmustaccio 35 secs ago
@mustaccio Don't use the existence of Code Review as a reason to close a question. From now on evaluate the question and use a reason like; needs focus, primarily opinion-based, etc. — Peilonrayz 56 secs ago
 
5:33 PM
0
Q: Primitive calculator code

imgeek_So, the problem task is: Given an integer 𝑛, compute the minimum number of operations needed to obtain the number 𝑛 starting from the number 1. And here is my code for doing this: #include<bits/stdc++.h> #include<algorithm> #include<vector> using namespace std; int main() { int n; cin >>

 
@CaptainObvious CNWAI
 
5:58 PM
Requests to improve working code are more suitable for codereview.stackexchange.com. — chepner 8 secs ago
 
-1
Q: Very Simple JavaFX Calculator

Pratham SarankarI am a mere beginner in java, with just two months spent with it. I finally made a calculator, which do simple calculations. I used Javafx with FXML to build it. It has a calculator class, by what I mean Model(tell me if I am wrong.) It add, subtract, multiply, and divide two digits. Moreover, A ...

1
Q: Find Invalid User Relationships in User to Manager Map (validate map as valid tree structure with no circular relationships)

Kevin VandyWe have a new service where an admin can upload a spreadsheet of new users they want to add to our application. During our processing we make a union map of all the users both existing and new additions, and check to make sure that the users will still be in a valid tree structure(s) after the up...

0
Q: Discord bot with Psycopg

Jason JonesI've made a Discord Bot in Python that uses the Psycopg module to make calls to a PostgreSQL database in order to display information. https://github.com/Chombler/cardbot Specifically, I call this function when a user calls the bot: def pullCardRecord(recordName): success = True try: ...

 
6:16 PM
 
0
Q: JTextPane with line-numbers

Philipp WilhelmWhat I wanted to do For a bigger (and yet not finished) project, I needed a little text-editor with line-numbers that looks like - well a typical simple text-editor: My solution import java.awt.Color; import java.awt.Font; import java.awt.Dimension; import javax.swing.JScrollPane; import javax...

 
@pacmaninbw Congratulations!
 
6:47 PM
0
Q: Optimizing script to move files

GollI wrote a bash script to move certain files within a group of directories with filenames that match certain conditions to another group of directories, but it is very cluttered. If possible, I want some help and tips regarding optimizing it: #!/bin/bash #Asks for user confirmation echo "This wil...

0
Q: Tool for converting OEIS sequences into Desmos lists

CascadeIllusionhttps://github.com/CascadeIllusion/DesmOEIS Recently began work on a Python project called DesmOEIS to build up my portfolio. It's a simple console program that looks up integer sequences from the OEIS, parses them, and converts them into Desmos lists using the Desmos API. The program works fine,...

 
1
Q: Is "review and guide me" on topic?

RaildexI am writing a pooled memory management. It works to some degree (well, you can allocate and deallocate) but it is missing some crucial parts like avoiding/reducing fragmentation and safety checks. I basically want to be guided on how to go further (and also how to improve the code itself). None ...

 
7:11 PM
0
Q: Am I missing a trick here?

user227305I have a function that checks if a file exists, if this file does not exist the function then checks a dir for all files older than 30 minutes. Each file in the dir belongs to a set, which is identified by the first 32 chars in the filename. The set containis two init files that end in .gcc and ....

 
7:37 PM
If you want code to be reviewed then codeReview stackexchange is probably a better place: codereview.stackexchange.comJonasH 18 secs ago
 
8:13 PM
It has been reposted on CR; I'm voting to close as needs focus since it is beyond the scope of this site. — Sᴀᴍ Onᴇᴌᴀ 52 secs ago
 
8:24 PM
0
Q: I made basketball program using Java that runs on console

fosionefI made a simple console basketball game using Java. /* * Java Basketball * by Clint * 2020.07.08 | 3:59AM * This Java program let's the player play basketball in console. */ import java.util.Random; import java.util.Scanner; public class Basketball { static String[] shoot = {"1 POINT!"...

0
Q: tic tac toe code in c++ with two players

عبد الرحمن احمدMy main problems are making draw case and any player can choose a place which is chosen by another player here is the code : #include <iostream> using namespace std; char board[3][3] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}}; static int turnnumber = 1 ; bool winner = false, flag = fal...

 
9:03 PM
this question might be a better fit for codereview.stackexchange.com . — Dan O 42 secs ago
Thanks I didn't know that existed. I'll just post my answer as the solution and move to codereview.stackexchange — Nelo 41 secs ago
 
10:12 PM
cf. this, this, this, and this. the "shrinking domain" aspect of it doesn't apply but the "n nested loops" does. — Will Ness 30 secs ago
 

« first day (2621 days earlier)      last day (1379 days later) »