« first day (2758 days earlier)      last day (1556 days later) » 

00:00
RELOAD! There are 7116 unanswered questions (89.7387% answered)
 
2 hours later…
02:11
0
Q: Best combination of a sum between two parameters in an array of objects

Aliosh rI am trying to build a simple algorithm to achieve the best combination of values based on two params in an array of objects. The whole code is available here First I have an array holding objects. The items which will be analyzed and packed into volumes together. All of the values are in percent...

 
7 hours later…
08:46
0
Q: TicTacToe object-oriented game with minimax algorithm

theProgrammerThis program is a simple console-based tic tac toe game that uses minimax algorithm to get the best move for the computer. I have no major concerns and would appreciate a general review. board.py # board.py class Board: def __init__(self): self.board_size = 3 self.board_arr...

09:35
0
Q: OpenSSL Cryptography - code in C++ for Signature Verification

Zeeshan TariqI am trying to verify a signature using OpenSSL in C++. The code is below: bool verifySignature(QString updateInfo_file_signature, QString uInfo_file_hash) { RSA *rsa = NULL; BIO *keybio; FILE *file = fopen("pubkey.pem", "rb"); fseek(file, 0, SEEK_END); long fsize = ftell(fil...

10:00
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/252392/revisions
10:13
@Duga Oh ffs
That's a closed question.
With an accepted answer.
This is bad.
But it's apparently on request, so sure, let policy be damned.
It's not too late to fix this question to get it reopened. Just tell us more about what this code is designed to accomplish ("AI to control a Pong paddle", maybe?) and retitle the question accordingly. Add some detail about what this and _b are supposed to represent. — 200_success 1 hour ago
10:47
It is quite bad idea to not create POJO for such task in Java. If I would see such attempt during code review I would ultimately reject it and return it back to creator to fix it. — Jurass 46 secs ago
 
1 hour later…
12:03
-1
Q: How can I reduce the TIme Complexity. of the python program

Hazrat aliI have 7000 CSV files that I want to do operation on. but the problem is that it takes to much time like it takes 13 seconds to process these files. What I need to know is which operation take more time. Opening and closing the files? Reading data from these files? I want to convert this progra...

12:28
1
Q: Mapping column names and values of a csv using another csv

AdamantoisetortoiseI have two csv files, pricat.csv which contains objects I need to populate my DB with, and mapping.csv which specifies how the value in pricat.csv must be displayed in my DB, for ex: 'NW 17-18' in pricat.csv has to be 'Winter Collection 2017/2018' in my DB. Here the csvs, first row in both are th...

13:17
0
Q: Small Counter by typescript with React

jacobcan118I am learning typescript with React and come up with this small program that each button count how many time by clicking and record which button got click. Please help me to take a look if all the code are the best practice. import * as React from "react"; import "./styles.css"; interface Button...

0
Q: OMP Sections fails with lastprivate

KaiyahaThe programme with the lastprivate option specified for the sections directive crushes throwing an exception: Run-Time Check Failure #3 - The variable 'n' is being used without being initialized. The code is as simple as that: #include <iostream> #include <omp.h> int main() { int n = 0; #pr...

14:06
0
Q: Java Threading and Measuring Latency

Bad CoderI want to do Benchmarking for my database, so for that i have written a java code to run the queries, so my code does the following: There N number of queries and each query will execute 1000 times and with a maximum concurrency of C. I am measuring the the query execution time using ConsoleRepor...

14:30
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/252392/revisions
0
Q: Countdown click in JavaScript

bona-petiteI did a small countdown clock challenge in JavaScript. Please review it, thanks. const timeControls = document.querySelector('.timer__controls'); const timeLeft = document.querySelector('.display__time-left'); const endTime = document.querySelector('.display__end-time'); let interval; functi...

0
Q: How to implement simple Date class in C++?

milanHrabosI would like to know how can I improve my simple Date class in C++. I am reading https://www.amazon.com/Exceptional-Engineering-Programming-Problems-Solutions/dp/0201615622 and the very first example handle with a Date object, but provide no implementation. So I tried to implement it myself: Date...

 
2 hours later…
16:28
I posted one more question to codereview.stackexchange.com/questions/252458/… can you pls explain the difference ? @Gordon Linoff — Henry 37 secs ago
1
Q: Understanding the difference in output for finding Revenue by Store in Sakila Database

HenryI am trying to find the Revenue by Store in Sakila Database(Demo Database from MySQL). Sakila Structure I am doing this : SELECT store.store_id, SUM(payment.amount) as total_revenue FROM rental INNER JOIN payment on rental.rental_id = payment.rental_id INNER JOIN staff on payment.staff_id = staff...

To get it working, include a minimal reproducible example here, not the whole code. Then, present your code at codereview.stackexchange.com. — Ulrich Eckhardt 24 secs ago
16:46
@CaptainObvious Code not working as expected.
16:59
1
Q: Cropping binary image based on pixel counts in python

Nolan CardozoI have a numpy binary masked image that looks like the following: I want to automatically crop this image like the following: Can I achieve this using some sort of image processing rather than building a bounding box regressor? The method should also work if the image is horizontally flipped. I...

 
1 hour later…
18:09
For anyone that VTCed this question the issues have all been corrected.
 
2 hours later…
19:54
@pacmaninbw Just encountered it in the queue.
 
1 hour later…
21:01
Monking
21:31
0
Q: Repeated DB connection at max user connections

Tomáš KretekI am trying to create class with connect to mysql database. And if there is max number of connections I want to wait and try it again. I figured out, how it can works, but I am not sure, if its the right way of doing it. So, my code looks like this: <?php class DbConnect { private $attemps = ...

21:56
0
Q: SQLite api with create table statement and default rows

SourceI'm using Swift in an iOS to implement a CREATE while inserting some default rows. Default rows will only be inserted if CREATE statement returns SQLITE_OK, otherwise it means the database was already created and is already populated with default rows. I'm also attempting to reuse statement varia...

22:46
0
Q: Converting a string into an array and returning the values spelled in reverse

stupidQuestionsI must create a function that accepts a string of names all separated by a comma. Example: "Jack,Matthew,John,Sam" And return the string of names in the same order but spelled in reverse. Expected output: "kcaJ,wehttaM,nhoJ,maS" I completed the function with an inner for loop but I would like to ...

23:21
would belong to codereview site, but maybe would be downvoted there... — Jean-François Fabre ♦ 16 secs ago
23:37
0
Q: How to do a while loop with counter

Rajaa MonnapillaiI want to make this clean and shorter and I was wondering how I can do it? While loop would be best but how do i implement it? if line.startswith('ACME'): if counter == 2: compname, value = line.split('(') value = float(value[0:-14]) products[f'{compnam...


« first day (2758 days earlier)      last day (1556 days later) »