« first day (2245 days earlier)      last day (1774 days later) » 

12:00 AM
RELOAD! There are 6164 unanswered questions (89.8016% answered)
"I'd like you to review my code and tell me if i missed anything" - StackOverflow is not a code review site. This belongs on CodeReview instead. — Remy Lebeau 28 secs ago
StackOverflow is not a code review site. This belongs on CodeReview instead. — Remy Lebeau 37 secs ago
 
1:03 AM
0
Q: Unisex Bathroom problem without semaphore

PavelCould I ask you to evaluate my solution to Unisex Bathroom problem? I tried to solve also a starvation issue and I think I succeeded. Besides all what is the necessity of semaphores that the problem is related to? Why can’t size be simply compared to capacity as I did? public class Bathroom { ...

 
 
1 hour later…
2:03 AM
0
Q: Parse date format in Pandas using Python

Axle MaxI have a column in a Pandas Dataframe containing birth dates in object/string format: 0 16MAR39 1 21JAN56 2 18NOV51 3 05MAR64 4 05JUN48 I want to convert the to date formatting for processing. I have used #Convert String to Datetime type data['BIRTH'] = pd.to_datetime(data['BIR...

 
2:24 AM
0
Q: NZEC error in a simple python code to predict the winner using combinatorial game theory

Jasminedef calculateMex(Set): Mex = 0 while Mex in Set: Mex += 1 return Mex def calculateGrundy(n,k): if 0 <= n <= k: return n Set = set() for i in range(1, k+1): Set.add(calculateGrundy(n - i,k)) return calculateMex(Set) ...

 
3:14 AM
@RemyLebeau No, it definitely does not because Code Review reviews working code. — L. F. 9 secs ago
 
 
1 hour later…
4:26 AM
Monking
 
4:47 AM
0
Q: Python: Selection sort

coderAfter impelemrnting suggestions from here(Python: Insertion Sort). I have written this code. Help me to improve this code. def get_input(): input_str = input("Enter elements to be sorted: ") lst = list(map(int, input_str.split())) return lst def selection_sort(thelist): for i in...

 
5:08 AM
-1
Q: How to refactor JavaScript code?

tesicgThe code was written in Vue.js application and looks as following: onIsogdDocumentSelected (selectedDocument) { this.sectionData.Document = selectedDocument this.sectionData.documentId = selectedDocument.id this.sectionData.projectDescription = `The project ` + `${selectedDocument.ord...

 
 
1 hour later…
6:29 AM
0
Q: Death Battle game with Javascript

Steve NgaiI have completed this simple death battle game with Javascript. Basically, the game will have 2 characters who will be attacking each other until one dies. That's it. Just wondering, how can I refactor my code further to reduce the repeat code in this program? var superman = { lif...

0
Q: Thread-per-connection and pthread_attr_setstack() in a MMO game server

SvtyrosI am reverse engineering a game server binary as a hobby project and noticed they use the thread-per-connection approach, this way: static uint8_t CommunicationThreadStacks[0x44c0000]; static int16_t FreeCommunicationThreadStacks[1100]; static pthread_t LastUsingCommunicationThreadStacks[1100]; ...

 
7:05 AM
I wouldnt call that approach "correct". Yes, it works, but it is far from I would accept in a code review ... — GhostCat 7 secs ago
 
 
2 hours later…
9:18 AM
so is SO the right place to ask this question or should i move it to Codereview? — Dr.Death 42 secs ago
 
9:39 AM
It is hard to say whether your code works as expected or not. 90% of it seems to suggests that it is, but the last 3 lines suggests that it cannot compile. Please make it clear whether the code works or not. If it doesn't work, make it the primary topic of the question and provide the code for reference after introducing the issue first. If it does work, you’re welcome to post on Code Review. — Mathias Ettinger 41 secs ago
 
9:52 AM
0
Q: Trying to add walljumps in a game

Russell356I am trying to add a Unreal Tournament style movement to a game called Tesseract (tesseract.gg). void slideagainst(physent *d, vec &dir, const vec &obstacle, bool foundfloor, bool slidecollide) { vec wall(obstacle); if(foundfloor ? wall.z > 0 : slidecollide) { wall.z = 0; if(!wall...

 
10:05 AM
Please post [mvce]. Alternatively consider stackoverflow code reviewc0der 34 secs ago
 
 
2 hours later…
11:40 AM
possible answer invalidation by Pavel on question by Pavel: codereview.stackexchange.com/posts/223033/revisions
Code Review is a better place to ask for improvement suggestions for working code. — Barmar 1 min ago
 
12:34 PM
0
Q: C++ Arraylist Implementation

SirTrashytonI am a new C++ developer who, coming from Java, am having issues in understanding some of C++'s key memory management features. Below is my attempt at an ArrayList implementation and I would really love criticism and ways to improve. Problems I noticed: Compilation error. Can not create an Array...

 
1:33 PM
@CaptainObvious Poster acknowledges code does not compile.
 
1:55 PM
0
Q: Android RecyclerView Popop Activity - 5 second popup time

Rafay KalimSo I've been working on a RecyclerView recently that's in a popup, and it takes a few seconds to popup with around 100 items. I want to make this faster, so any improvements on my code is appreciated :) layout/activity_supervisor_order_popup.xml <?xml version="1.0" encoding="utf-8"?> <androidx....

 
2:12 PM
I think this can be closed completely unless there is merit in re-framing it as "where can I get my code reviewed". Meanwhile it was reviewed and completely refactored with the help of awesome code reviewers. — user1747281 15 secs ago
 
0
Q: Compiling all Exception messages into a string

DelfinoBelow is a recursive function I've written that's responsible for compiling a string consisting of a Exception's message, and also each of that Exception's InnerException messages. I've tried to condense everything to one line, but am unsure if this is the most efficient way of approaching this ...

0
Q: Solve Project Euler #5 in Javascript

LukeFeel like I went about this the wrong way, but my gut said to check if a number divided evenly by each number up to 20 and when it did, return it. function isDivisible(number) { for (d = 1; d <=20; d++) { if (number % d === 0) { continue; } else { retu...

 
2:36 PM
0
Q: Policy based generic Adc monitor/notifier

Daan TimmerI've tried to make a generic class that reads an Adc value and, depending on the policies of the class, notify its observers when either the value is too high and or too low. Most of our objects are Subjects or Observers and for this specific implementation I was looking for a generic way to mak...

 
 
1 hour later…
3:57 PM
0
Q: Improving rendering performance of 3D Voxel Game

MinkizzImproving rendering performance of 3D Voxel Game Technical features added: Perlin Noise Generator 3D Explorable World (You can't break or place blocks) Free camera, you can fly and go through blocks Quick overview of implemented optimizations: Asynchronous (Multi-threaded) chunks system. R...

 
Monking
 
4:16 PM
If the code is complete and works, it should be on Code Review, not here. This site is primarily for fixing broken code, — Carcigenicate just now
 
0
Q: Iterating and validating palindromes in pari-gp

Vepir My question is if I can improve this code, performance wise? And perhaps also in some other way you can recommend? I just recently have started to try to use pari-gp and am still in the process of getting familiar with it. I want to search for numbers palindromic in three consecutive n...

 
4:37 PM
0
Q: Sentence editor

Константин ПисаныйI wrote a simple sentence editor which capitalises first word, deletes redundant spaces and adds a dot in the end unless another sign of punctuation is already present. Please help me to improve my code, maybe by using some libraries. def correct_sentence(text: str) -> str: """ return...

 
4:58 PM
0
Q: Ruby Exception Handling

Rajkaran MishraI have created a method, which is raising the same exception in case of any error: def fetch_aws_instances region_name = 'us-west-2' ec2 = Aws::EC2::Client.new(region: region_name) describe_regions_result = ec2.describe_region ... ... rescue Seahorse::Client::NetworkingError, Aws::Erro...

-1
Q: Just started OOP in JS can you guys please give me a feedback

claudiuI just started learning OOP from Mosh on youtube and I looked for easiest exercises to practice. Can I get a feedback on my code please? What I did wrong and what I should change? Also where is the best place to find JS exercises? In the code there are two exercises: the first one is a temperatur...

 
5:37 PM
This question is probably better suited for SE Code Review. — πάντα ῥεῖ 1 min ago
How can I move this to SE Code Review? Or should it move someone else? — PiMathCLanguage 20 secs ago
 
-1
Q: Memory pool for multithreaded environment

SvtyrosI am engineering a game server binary as a hobby project and came up with the following approach: static uint8_t CommunicationThreadStacks[0x44c0000]; static int16_t FreeCommunicationThreadStacks[1100]; static pthread_t LastUsingCommunicationThreadStacks[1100]; static uint16_t NumberOfFreeCommun...

 
This seems like it should be put on codereview.stackexchange.commackycheese21 18 secs ago
I found a one-liner in code review. I'll close — MacItaly 12 secs ago
 
@Mast To make matters worse I'm playing in two universes lol
 
5:58 PM
0
Q: Is my code fine in the areas of read and write?

ii69outof247What: This is a code that when executed simply writes packet to certain file types. Packet is very simple and contains things like: description, partCount, price... Please: Ignore the usage of namespace std; as this is for educational purposes, mostly. It will most likely not be reproduced...

 
6:19 PM
0
Q: Parsing data from API in pandas

Dawid I made a little program to parsing data from API. I do not have experience with Pandas. That working but I have a question how to do that better and more efficient class Albion_data(): def __init__(self,item): self.location = f'Bridgewatch,Thetford,FortSterling,Martlock,Bridgewatch,Lymhurst'...

 
6:39 PM
1
Q: Send / receive wrapper for System.Net.Sockets - follow-up

TaininI recently posted a question about improving thread and socket safety in my NetworkEndpoint class. previous post I have implemented the changes suggested in the answer I got there. When I asked for a second look to confirm my changes I was told to post another question. Included below is the co...

 
6:59 PM
1
Q: Predefined values for some values in a template function like with a #define macro (e.g. template<int foo, typename bar>)

PiMathCLanguageI want to overload an operator (e.g. operator<<) with different types, but also change only 1 or 2 values in the function itself. I want to get some fancy output of a vector with the primitive integer types. I have tried to create a template function like template<int width, typename T> operator<<...

 
7:09 PM
@skiwi Misery loves company.
 
7:40 PM
-1
Q: output - code of finding a pair of items the list in a given list whose sum is equal a given integer

galikI have been trying to write a program which checks if there are any two items in some list L whose sum is equal to a given integer S, and prints those two items found. The program provides an error message of "!ok" when there is no solution available. Input: On the first line there will be an in...

 
8:20 PM
1
Q: Binary Trie in F#

Henrik HansenI have this little exercise writing a binary trie in F#. In C# it can be done in few lines, but here it became more complicated than I had expected (especially the add function): open System type BitTrie = | BitTrie of Zero:BitTrie * One:BitTrie | NullTrie module BitTrie = let u...

 
This question might be more appropriate at Code ReviewLGSon 9 secs ago
 
@CaptainObvious Code is broken.
 
9:01 PM
0
Q: Animation of adding / removing nodes from VBox

Michal RamaHello, public final class Cart extends javafx.scene.layout.VBox { ... public FadeTransition hide_old_show_new(ArrayList<Text> nodes) { var transition = new FadeTransition(); var size = getChildren().size(); if (size > 0 && !getChildren().get(0).equals(nodes.get(0))) { transit...

2
Q: Avoiding repetition when using the "snprintf idiom" to write text

CarcigenicateI'm writing a function to stringify a nested struct. I'm using snprintf to pre-calculate how much space I'll need to allocate. The problem is, it's extremely repetitious, and will only get worse if I ever need to add more fields to any of the structs. The duplication also creates more of an oppo...

 
@Progman I don't have any problems. I simply want to see if it's a clean approach or in a code review, someone would frown upon that approach. — Sam 47 secs ago
 
9:21 PM
0
Q: Python Script that sends emails to a list of people and their emails and attaches specific documents (w/ tkinter menu)

rmcknst2This is my first python project. Any tips on making it more efficient, less cluttery, and could you think of some cases that I havent in which my code will break. For clarification the vendor list csv file is set up like this: [vendorname][email1][email2]...[emailn] *There is also probably some...

 
 
1 hour later…
10:22 PM
0
Q: Database connection and DataMapper

fabrixFollowing my previous question Database interface and PDO adapter, I wrote a new simple class to connect to Database and run a query returning a PDO statement. <?php namespace System\Database; use \PDO; /** * Database connection class */ class DB { protected $pdo; /** * Conne...

 
possible answer invalidation by sds on question by user45891: codereview.stackexchange.com/posts/223024/revisions
 
10:42 PM
0
Q: Counting days of the week using the modulus operator (%). Composing functions. Unit testing to make sure negative integers work too

Gabriel SalesI'm new to programming and I'm reading a book called How to Think Like a Computer Scientist. On the program below, you'll find two scaffolding functions that I used to test a function. Then, you'll find 3 function definitions: day_name(), day_num() and day_add(). I'd like someone to take a look...

 
11:03 PM
0
Q: Find the largest product of an array

thadeuszlayThis task is taken from www.interviewbit.com Given an array of integers, return the highest product possible by multiplying 3 numbers from the array Input: array of integers e.g {1, 2, 3} Example: [0, -1, 3, 100, 70, 50] => 70*50*100 = 350000 NOTE: Solution will fit in a...

 
11:23 PM
0
Q: Easy-Medium Sudoku solver written in Python - No recursion/ brute force

emadboctorI'm very new to software developing, I wrote this Sudoku solver in Python, it's not the best approach ever I know and that is I guess because I started taking courses in Python and programming a month ago, of course there are much much better versions of Sudoku solvers out there and maybe written...

 
11:36 PM
probably portal Code Review can be better place for your question. — furas 59 secs ago
 
0
Q: Python - automatic import and install script

ShellZeroIn the following script, I am trying to infer if the modules are managed by a conda environment or not and based on that, I am trying to auto install and import the modules. [I skipped around 5 to 6 imports to keep it short for the sake of this example]. It would be great if someone can give me ...

0
Q: Managing various printing conditions cleany?

A. DandelionI have this code here which prints the data I have available that currently imo looks bad and cluttered: has_printed = 0 output = '' is_banner_printed = 0 if time.time() > next_print_time: output = output + (' ' + datetime.now().strftime("%I:%M:%S %p") + ' ----------------------------------...

 

« first day (2245 days earlier)      last day (1774 days later) »