« first day (2484 days earlier)      last day (42 days later) » 

12:00 AM
RELOAD! There are 6385 unanswered questions (90.1353% answered)
1 hour later…
1:20 AM
possible answer invalidation by Tlomoloko on question by Tlomoloko: codereview.stackexchange.com/posts/237378/revisions
possible answer invalidation by Tlomoloko on question by Tlomoloko: codereview.stackexchange.com/posts/237523/revisions
1:44 AM
Q: Java Cryptography AES/GCM/NoPadding without IV

recke96I'm implementing a PAKE-protocol as university project and one step of the protocol involves sending encrypted data from a key created via a hash function (I'm using SHA-256). I want to use AES/GCM but do not have an IV so I'm using HKDF to expand the key into an IV and key with the following imp...

Code Review is a more appropriate site to get advice on coding style for working code. — Barmar 5 secs ago
2:25 AM
Q: Simple Unity program for a research experiment

Richard RobinsonI'm developing a small C# Unity application to display stereoscopic images as part of a wider research study. Since the experiment consists of unique stages (Start, during a trial, between trials, and End), I decided to use the State Design Pattern to make a State Machine for code readability. ...

Q: Matrix Multiplication in Typescript

PerplexityyI would like some help on making my solution more functional. At present, I rely heavily on using indexes in my map functions. I am also seeking general feedback and advice, thanks. export const getMatrixColumns = (a: number[][]) => { return a[0].length; }; export const getMatrixRows = (a: nu...

2:45 AM
Q: Is there a way that I can write these if-else statements cleaner than I've written before?

learn2codeso I wrote a code that has a lot of if-else statements and achieving what I need to accomplish but then I saw it was a complete mess and I want it to rewrite in a much cleaner way but I don't know how to rewrite my code into a cleaner one. Below is the code that I wrote a while ago. Any recommen...

3:12 AM
What you are asking is for a code review which is off topic here. Delete this and ask, instead, on codereview.stackexchange.comRob 8 secs ago
I'm voting to close this question as off-topic because what you are asking is for a code review which is off topic here. Delete this and ask, instead, on codereview.stackexchange.comRob 16 secs ago
4:08 AM
Q: Download image from URL, save to directory and send to user

lockwiseCould you please find out if this code is optimal and does it create a double load? I need to simultaneously save the image to the server and immediately give it to the user. router.get('/', function(req, res) { let img = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_...

4:48 AM
Q: How to refactoring function when I've to do many things in one function

AchI always want to improve my code by refactoring but when I've to work with complicated function that have many thing to do . How can I refactoring them. Here is my data for example I get data from request My DB structure look like this DB id PK blog int date_end string date_...

5:32 AM
I'm voting to close this question as off-topic because it belongs on Code Review. — Solar Mike 35 secs ago
6:09 AM
Q: Optimizing the speed/performance of the Openpyxl program

briiipoI made the code using Openpyxl. But it took really long to complete. Could someone advise me how to optimize that? Is that too many for loops in the code? import openpyxl import os import glob path = os.getcwd() data=[] x=input('name:') + '.xlsx' target_xls = os.path.join(path,x) for file i...

2 hours later…
7:55 AM
possible answer invalidation by Linny on question by Philip Jay Fry: codereview.stackexchange.com/posts/237470/revisions
8:08 AM
Q: Reduce the redundancy in my pandas highlight function

tonywangAfter a lot of browsing and experimenting I have managed to achieve to read excel file as a Dataframe, apply some style to it and export it to html. My main concern is that the highlight_max function looks a bit redundant. The rows I want to highlight are already predetermined and are not just si...

Q: LeetCode: Longest String Chain (Java)

togepi(1) For the question, I had a pretty messy solution so I would like some advice on how to better use Java to make the code a bit cleaner. (2) Also, a semi-hack that I did that I'm not proud of is checking if words.length == 0 at the beginning and returning 0 if so, so that I can initialize int lo...

@Duga Rolled back.
@mplungjan Not if it's going to be posted on Code Review. Different rules apply. — Mast 13 secs ago
Ok. Never used CodeReview — mplungjan 42 secs ago
@mplungjan In that case, please take a look at their FAQ on asking questions before making recommendations. — Mast 38 secs ago
@Mast I could not find anywhere they disallowed a reproducible example. There are even people suggesting stacksnippet codereview.meta.stackexchange.com/questions/2392/…mplungjan 1 min ago
8:53 AM
I assume someone wants you to ask at codereview? — mplungjan 10 secs ago
9:09 AM
@mplungjan That discussion is surprisingly unrelated. This is more relevant. Details matter, don't leave out the details on Code Review. An MCVE is stripped down too far. — Mast 20 secs ago
9:24 AM
I suggest it's better to post something like this on CodeReview codereview.stackexchange.comRanielle Canlas 56 secs ago
10:00 AM
possible answer invalidation by jcf on question by jcf: codereview.stackexchange.com/posts/237439/revisions
10:28 AM
Off-topic on StackOverflow, should be moved to Code Review SE. — Toastrackenigma 9 secs ago
10:52 AM
Q: BigInt class in C++

SrivathsI made a BigInt class that supports almost all functions an int would. The code seems too bulky and there might be a few bugs lurking here and there. I would like to simplify my code as much as possible and increase performance. #include <iostream> #include <algorithm> class BigInt { public: ...

11:12 AM
Q: PPE object detecion with tensorflow and opencv with rtsp streams

Demeter MártonI am working on an object_detection API implemented in tensorflow 1.14 and opencv 4.1, where my task is to recognize personal protection equipment weard by workers at various construction site gates. We are using RTSP streams, where I am already using threading to minimize latency, but still some...

11:32 AM
Q: ASP.NET Core Web API - Async implementation for converting files

Ryan ThomasFirstly I'd like to apologise if this is not the correct place to post this, but I have come from StackOverflow as I don't believe that is the correct place to post it. Brief background, I am an experienced desktop developer so coming over to ASP.NET Core Web API I want to know if the process I ...

Please create a codesandbox with lengthy code reviews like these — Rawrplus 47 secs ago
11:52 AM
Q: Generating PNG barcodes from a CSV

CoedRhyfelwrI wrote the following code to generate a series of barcodes given a csv with a list of ISBNs in the first column and titles in the second, using the python-barcode library (which itself requires pillow to generate PNGs and JPGs). I am fairly new with python and have had little formal training, an...

12:33 PM
Q: Script to push data from one database via api to another

TimI'm still a beginner so any pointers to make this code more professional/production ready are appreciated. The tokens and database connections have been anonymized. The script is working, its goal is to copy prices from one database and push them via api into another database. The catch is tha...

12:44 PM
MIT finally did what has been thought possible for a long time but wasn't done succesfully yet:
1 hour later…
2:14 PM
Q: Using auto vs decltype(vec.size()) in for loop to process vector of strings

DanTeaching myself some of the particulars in using vectors and strings. To do this, I'm taking a paragraph typed into the standard input, storing each word in a separate element in a vector of strings for processing. I understand there may be better ways to actually process text information, I'm ju...

Q: Advanced for-loop understanding

Adrian_GI once copied a line of code from stackoverflow: clusters = [x for n, x in enumerate(vecarray) if x not in vecarray[:n]] I understand what it does, but not how. It gives me all the unique rows of the array 'vecarray' and saves them in 'clusters'. I do have basic understanding of normal for loo...

3:14 PM
Q: HugeInt division using base 2^32 implementation

Richard MaceI previously submitted my code for a HugeInt class here. That version lacked a long division implementation. I have now implemented (long) division using Donald Knuth's algorithm D, following the code that appeared in Hacker's Delight fairly closely. Since the algorithm relies on some a priori n...

3:35 PM
Q: "Smart" sudoku brute-forcer

mindoverflowAfter running my C-brute-forcer for two days on a 25x25 sudoku, I decided to re-write in Java so that it would solve it in an acceptable time frame. The idea: Make smart fields that contain all possible values for that field, and then let the bute-forcer only loop through these, hopefully reducin...

4:10 PM
possible answer invalidation by Srivaths on question by Srivaths: codereview.stackexchange.com/posts/237690/revisions
Q: Reduction of time for matrix multiplication of pixels

Ankit JaiswalThis part of my code is taking 30 minutes to multiple 300 RGB and Depth images pixel by pixel. How can I reduce this time? This is just a part of big code but this taking lot of time. def depth_to_xyz_and_rgb(uu, vv, dep): # t1.tic() # get z value in meters pcz = dep.getpixel((uu, vv...

possible answer invalidation by Greedo on question by Greedo: codereview.stackexchange.com/posts/229656/revisions
4:42 PM
If your code works and you want someone to review it, you might be better off at codereview.stackexchange.comkhelwood 13 secs ago
possible answer invalidation by Ryan Stone on question by Ryan Stone: codereview.stackexchange.com/posts/226473/revisions
1 hour later…
5:55 PM
I'm voting to close this question as off-topic because working code examples asking for improvement advice belong on codereview.stackexchange.comTaplar 21 secs ago
6:08 PM
6:36 PM
Q: Implementing OOP concepts

ArchibaldRajsI have started programming a couple of months ago and have recently applied for an internship. One of the assignments was to create a console application, the assignment can be seen here - > HERE My implementation is this: I have created an abstract class called DiscountCard which holds all the...

6:57 PM
Q: updating the navbar on scroll

user12940211I'm trying to change the navbar content when scrolling. What I have so far $(function() { var header = $(".navbar"); isSmallWindow = $(this).width() < 768; $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 100 && $(window).width() >= 1024) { he...

Q: Ruby on Rails AR: Nil error in integer type when comparing against either positive or negative value

Charlie T Leeproblem: service requests days are counted against a service level agreement days. If service request overdue is positive, then the service request is overdue, and management needs to be notified. Console error: NoMethodError: undefined method `between?' for nil:NilClass Code Class Sr < App...

Q: Learn polymorphism Menubar(begginners)

NursultanI didn’t use polymorphism before but I wanted to start practicing, but when dividing the code into separate files, BorderPane does not accept the argument. When I combine everything into one file everything works fine. public class NursMenBar { public MenuBar nursMenuBar() { Menu fileMenu =...

7:37 PM
Q: JS - Simple Roguelike built to learn basic OOP

BitsNBytesA little background: I am really new to programming in general, I started doing some react/Angular stuff, and have moved into more backend node stuff, and figured i would start a small project for fun that was mostly in JS in order to sharpen my skills I'm still working on a lot of things, I eve...

7:57 PM
Q: My second hangman game (Hangman in C++), how to avoid nested while-loops? How to stick to the SRP?

SAJWHere I already asked for tips, and I wrote another hangman game with the tips I got. My questions are: is int game() doing too many things that I should split further into smaller functions? And how to avoid those nested while-loops? Or are they ok for what I intent(to make it possible to repla...

8:17 PM
Q: Python: Find pairs of numeric palindromes that sum up to another palindrome

maverickI am trying to identify and print pairs of 4 digit palindromes that sum up to a 5 digit palindrome. This is what I have so far def isPalindrome(x): return str(x)==str(x)[::-1] palindrome = [x for x in range(1000, 9999) if isPalindrome(x)] for x in palindrome: for y in palindrome: ...

You might consider posting what you've got to Code Review to get feedback - there are a lot of things that could be improved upon. Generally eval is not such a good idea - you can enter weird things like insert a: __import__("sys").stdout.write("consider your computer compromised"). (Also, ax+by+c=0 looks like the equation of a line to me :)). Mathematically, I'm not sure what you're trying to achieve. Why turn things into floats if you want to do exact computation? Better to keep things as fractions or integers in my opinion. — Izaak van Dongen 1 min ago
8:58 PM
Q: What is a maintainable way of trading many variables between functions?

enthdegreeI want to write a script experiment.m that will call a complicated function I'm going to write called encoder(...). I expect encoder to involve a lot of settings that experiment.m is going to choose at runtime. At some point in experiment.m, the settings which the encoder should use are created a...

9:18 PM
Q: Pandoc batch conversion

BlincerI wrote a simple bash script in order to batch convert markdown files via pandoc (and it is working). But I have the feeling the code is dirty. Could you help me improve it? #!/bin/bash rm -r out; mkdir out for f in src/*.md do filename=$(basename "$f") filename="${filename%.*}" ec...

9:30 PM
possible answer invalidation by maverick on question by maverick: codereview.stackexchange.com/posts/237717/revisions
9:54 PM
If your code works and you want to optimize it then maybe the right place to post it is codereview.stackexchange.comeyllanesc 10 secs ago
Q: Factoring and solving a quadratic polynomial

MahdeenSkySo i code stuff for my fx-cg50 calculator's micropython as I'm an a level student and a python beginner, and i need help pointing out the bugs and some programming tips to further improve my code, and i can't use sympy or numpy since they cant fit in my calculator's measly 16 MB so i have to make...

10:30 PM
Thinking even more, You might want to delete this question and re-ask at Code Review. If the code functions correctly and you only want to improve it, Code Review is a better fit. If you have a bug or two you want squashed, make it clearer in the question. — user4581301 just now
10:43 PM
This might be more of a code review than a problem, I'd recommend simply returning a value from the function, and then catching an exception rather than returning False would be cleaner in my personal opinion — jamylak just now

« first day (2484 days earlier)      last day (42 days later) »