« first day (2818 days earlier)      last day (1200 days later) » 

12:00 AM
RELOAD! There are 7275 unanswered questions (89.6365% answered)
 
 
1 hour later…
1:01 AM
@CaptainObvious 1 more VTC needed
 
1:12 AM
TTQW
 
 
3 hours later…
4:01 AM
0
Q: Refactor code in Go

Mohammad Ghifari YusufI have this function and need to refactor it Please refactor the code below to make it more concise, efficient and readable with good logic flow func findFirstStringInBracket(str string) string { if len(str) > 0 { indexFirstBracketFound := strings.Index(str, "(") if indexFirst...

 
4:43 AM
Monking
 
5:17 AM
0
Q: Refactor code in PHP

Mohammad Ghifari YusufI have this function and need to refactor it Please refactor the code below to make it more concise, efficient and readable with good logic flow function findFirstStringInBracket($str){ if(strlen($str) > 0){ $firstbracket = strstr($str, '('); if($firstbracket){ $fi...

 
 
3 hours later…
8:30 AM
possible answer invalidation by Sᴀᴍ Onᴇᴌᴀ on question by Peilonrayz: codereview.stackexchange.com/posts/250088/revisions
@cpoDesign If it works as expected then you should post this question on codereview instead. — Peter Csala 20 secs ago
 
 
1 hour later…
Kaz
9:33 AM
@pacmaninbw Ah, good to know. I'll check it out. Thanks.
Separate Question.
Does anyone have any experience with Microsoft Power BI?
I've only just come across it, and I'm pretty certain it contains things that would be absolutely transformative to what I do, if only I knew what they were.
So I was hoping to pick somebody's brain.
 
10:40 AM
possible answer invalidation by Peter Csala on question by Jacob: codereview.stackexchange.com/posts/254970/revisions
 
0
Q: Optimize binary classification model

mikolajsI've created binary classification model from scratch, just to understand intuition behind that. However when I compare my implementation to model from tensorflow/pytorch with the same parameters and configuration I noticed that my model achieved similar results in about 3 000 epochs but tensorfl...

0
Q: How to code a minimization problem with constraints and indices into PSO within MATLAB?

atco35I have a GAMS code that represent a mathematical model which depends delay (i,p) for each job i and the period of day p. So, I have indices for represent delay and objective is minimizing of summing these delays. I have equality constraint, greater than or equal constraint and absolute function c...

 
While this solution is clever, it's horrible because it requires creating and instantiating objects for the mere goal of avoiding scopes. I'd refuse this in any code review based on the fact that it's confusing and overkill, performance-wise. — Olivier Grégoire 22 secs ago
 
11:10 AM
-1
Q: CSS bubble effect, why :hover is taking all <canvas>?

Federico MiguelettoThe problem is that every time I hover over the <canvas> it fills the entire element, I have already tried applied padding or even resizing, but I can't solve it, they are supposed to be small bubbles, an effervescent effect Here is the code "use strict"; const canvas = document.getElementBy...

 
11:45 AM
 
12:01 PM
0
Q: Vertical Order Traversal in Binary Tree - Amazon Interview

shubhamprasharWhat is Vertical Order Traversal? read here - LeetCode I wrote the following code according to the logic I made after seeing some tutorial however it is not outputting the correct result, what is wrong with this code? class BinaryTree(): def __init__(self,data): self.data = data ...

 
12:18 PM
1) Asking for software recommendation is not an appropriate question for Stackoverflow, 2) Stackoverflow is not a code review site. — Sam Varshavchik 9 secs ago
 
0
Q: Theory-based quiz grader using similarity

theProgrammerI wrote a fairly simple program that grades theory-based quiz. It is fairly straightforward. I would love to get insights and ideas on how it might be improved. consine_similarity.py """This module uses consine distance to check the similarity between two sentences""" from nltk.corpus import sto...

 
12:51 PM
0
Q: Implementing basic polynomial interpolation

QuasarI am self-learning some numerical algorithms from the book Numerical methods in Scientific computing by Dahlquist/Bjorck. Problem 4.1.2 asks to write a program that finds the coefficient vector c for a polynomial interpolant. I think my math is correct, but the polynomial so generated is, fits th...

 
1:16 PM
0
Q: Rewrite php script

RmageI have written one script in PHP which is defined here: Click Here to See Code I am improving the code quality and readability. For example splitting it into multiple functions, use PHP predefined variables, use PSR naming conventions etc. class nextcrontime{ //Get Single argument passed function...

 
This question might be more appropriate for the code review SE: codereview.stackexchange.comTrivialCase 55 secs ago
 
1:43 PM
@Lurch Did not change much of anything.
 
2:14 PM
Greetings, Programs.
 
Working solutions that might need refactoring are better suited for Code Review. — El_Vanja 15 secs ago
If the code already work as you expected, Code Review might be more suitable. Make sure that red read their help center before asking, however — user202729 29 secs ago
 
2:37 PM
That is more likely a question for codereview — mplungjan 31 secs ago
 
2:50 PM
Thanks @El_Vanja, I didn't know about Code Review. Definitely more suited there. — Rob 11 secs ago
 
Time to burn my CentOS 8 server....
 
0
Q: How to keep keep track of failed status?

vesiiI have the following class for the statuses: class JobStatus(models.TextChoices): SUCCESS = 'SUCCESS' RUNNING = 'RUNNING' FAILED = 'FAILED' WAITING = 'WAITING' Everytime I run a job, it will have one of those statues. The problem is when the job failed, there could be more than o...

 
Even if it may be working, it definitely wouldn't survive a code review. — Martin Zeitler 26 secs ago
 
3:22 PM
0
Q: Display nested list within Angular app

Pi314I'm looking to optimise this code. Items [{ "quantitySold": 1, "totalAmount": 0, "totalDiscount": 0, "categories": { "_id": "6008158fb3ea7e42477ef591", "categoryId": "5fc53d63ac5f5923149eb36b", "name": { "fr": "Hors-catégories", ...

0
Q: Checking if an array of dates are within a date range

RobI created a dates_in_range() function which checks if all of the dates passed to it ($dates array) are within $start_date and $end_date. If they aren't, it'll return false. The code works fine, but I'm wondering if there's a way to refactor it better using something like array_filter? Or does thi...

 
3:39 PM
Ugh, the IPKVM for my datacenter host is garbage, and I can't upload ISO's anymore
 
1
Q: N-Queens without recursion (but with one goto)

KioquCompared to the recursive version e.g. on Rosetta, this is 5-10% faster and uses 50% less instructions (for N=12). Only problem is the goto. Can it be avoided without using a function? The two outer for-loops don't do much in terms of loop control. But this is how I could make it work. Is there a...

 
4:13 PM
0
Q: Why according to python -a(b+c) != a(-b-c)?

cavallo rossoI was coding on python (Anaconda) and while working with sympy I noticed this issue: import sympy as sym a = sym.Symbol('a') b = sym.Symbol('b') c = sym.Symbol('c') -a*(b+c) == a*(-b-c) Out[190]: False Why is this happening?

 
4:23 PM
@Edward Didn't see the pull request until just now.
 
@DerKommissar Obligatory 'CentOS is going EOL' comment.
Dec 29 '20 at 17:23, by Edward
https://arstechnica.com/gadgets/2020/12/centos-linux-is-gone-but-its-refugees-have-alternatives/
 
Yeah I know, I have to swap it out for Debian so that I can start using it for production work
 
4:40 PM
@pacmaninbw I tried to make minimal changes so you could see if you like it.
 
Monking
 
Monking
 
5:18 PM
This might be better suited to the sibling site for code review. codereview.stackexchange.comBasil Bourque 26 secs ago
 
-1
Q: Add firewall rules over PowerShell from data in Excel

Win FanI need to create new firewall rules from a long list from excel file. I'm going to use PowerShell and ImportExcel module for that purpose. Considering I'm noobie in Windows and PowerShell I need help in how to actually do this. First column from excel represent IP and ports, I need to block and a...

0
Q: Segmentation fault in C program built from C++ Program

Sidney SandersI've written a c++ file that opens a file, generates 20 random numbers, and then reads the file into the console. This file works correctly, the Second part of my assignment is to Re-create it in C and I've run into some problems. I am getting a Segmentation error when running the code. this is m...

0
Q: xplain the weakness in the design of the Server

LiamSo firstly this is not exactly homework ... but it is a question on a past exam paper and I am studying for the exam and can not figure this one out. (Ignore any imports which are not here) Also I know that Double is a very bad name for the class not only is it a built-in type but not very descr...

 
5:34 PM
If the code works, this is probably more on-topic at Code ReviewJim Garrison 54 secs ago
 
6:05 PM
possible answer invalidation by Rob on question by Rob: codereview.stackexchange.com/posts/255002/revisions
 
6:19 PM
0
Q: Is this usage of the dynamic keyword an indicator of a design fault?

user3780004I feel like I'm likely violating a design principal or two here so I'd appreciate any mistakes or antipatterns being named and pointed out. I'm attempting to map a system in code which represents a decision tree, so based on the users input would provide them the next choice they can make, then f...

0
Q: Optimizing solution of Sum of Pairs: Codewars in Python

Luca BrasiI need help in optimizing my code for huge lists with approx. 10000000 elements . Is there a way to improve my algorithm or should I try to build new one using a completely different approach? ''' def sum_pairs(ints, s): lst1 = [] for n in ints: if n in lst1: return[s-n, n] lst1.a...

 
6:30 PM
@CaptainObvious Poster obviously didn't read the manual.
 
If the code is working, you should post this over at Code Review StackExchange instead. StackOverflow is meant more for helping solve small, self-contained, specific errors. — 0x5453 35 secs ago
 
@CaptainObvious @Donald.McLean RBA.
 
7:09 PM
0
Q: Sudoku Graph in Julia

OsoI'm building a graph coloring sudoku solver in Julia, so the first thing i'm tackling is the graph implementation. I have the bare structure completed, meaning I can create the graph with all of the right edges. In terms of efficiency, it's currently at @timev s = SudokuGraph(3); > 0.001573 seco...

 
7:19 PM
In code review, I would be asking WHY you think you need to do this? What difference does it actually make to your final code? Seems like a lot of operations (24 functions calls a day for 30 days a month; 600 reads and write each hour, 24 times a day for 30 days a month; possibility of document collisions, etc etc), so it better be damn critical to your system design, and then I would question your system design. — LeadDreamer 1 min ago
 
0
Q: Remove scroll back to answer textarea on clicking "run code snippet" when creating answer

Blindman67When creating an answer that has one or more code snippets (usually at the bottom of the answer) and I click "Run code snippet" The page scrolls back to the answer textarea meaning each time I test the code I need to manually scroll all the way back to where I was. This does not happen when editi...

 
possible answer invalidation by Luca Brasi on question by Luca Brasi: codereview.stackexchange.com/posts/255014/revisions
possible answer invalidation by Jacob on question by Jacob: codereview.stackexchange.com/posts/254970/revisions
 
0
Q: Performance of Find and Replace in folder and subfolder files Java

Abdessamad BenI have a java program that do find and replace ( like when you do it in a text editor for example notepad++ ) in files of a folder and all sub-folders well what i did is i created 4 functions the first function has folder path in the parameters so it listed all the sub files if it's a folder then...

0
Q: Is there anything that should be removed that is "uselesss" in this code?

X3GoldenSo this is a blackjack game, any feedback or tips on what I should remove from the code that is not needed is very appreciated. Note: some of the names of classes or variables are in Swedish but it should not interfere with understanding the code I think. Blackjack.java import java.util.Scanner; ...

 
8:09 PM
Consider visiting Code Review for a style review. — Tom Gebel 42 secs ago
 
8:50 PM
-1
Q: Connect Four Game Derived from Tic Tac Toe Game

poggeezerkingI'm a beginner at Python and barely have any experience in programming. Anyways, as the title suggests, is it possible to derive my tic tac toe code into a 7 x 6 board of Connect Four? Below is my code for tic tac toe: """ Author: Victor Xu Date: Jan 12, 2021 Description: An impleme...

0
Q: Avoid functions chain

user3378165I Have the below code that gets urls of PDF files, send them to a convert function and returns them as images, is there a way to make this code more readable? import PDFtoImages from '../PDFtoImages' export async function convertPDF(file, category) { const images= await PDFtoImages(file.data...

 
9:41 PM
-1
Q: Determine whether a number and its square are both the sum of two squares

Kevin KooTo ensure that n = sum of squares , To determine if n^2 = sum of squares , I need to input 4 integers : 5881, 2048, 2670, 3482 #To define the sum of squares def sumSquare(n) : i = 1 while i * i <= n : j = 1 while(j * j <= n) : if (i ...

 
10:04 PM
Might be a better question for the Code Review exchange. Have you tried looking at a style guide? google.github.io/styleguide/cppguide.htmlGetFuzzy 55 secs ago
 
10:22 PM
 
 
1 hour later…
11:28 PM
If the above code works I would suggest posting this on codereview.stackexchange.comNkosi 51 secs ago
 

« first day (2818 days earlier)      last day (1200 days later) »