« first day (3305 days earlier)      last day (40 days later) » 

12:01 AM
REFRESH! There are 8070 unanswered questions (89.3154 answered)
12:44 AM
Q: How do I make this jQuery not wait for document

sevenkaderI'm trying to not make the document wait until it's completely finished loading, I just want the code to run normally, how can I modify this code so that the document isn't waiting? <script> jQuery('body').css('display','none'); jQuery(document).ready(function() { jQuery('body').f...

1:09 AM
Q: Maze generator in Python

scripter2021import numpy as np import random def dig(r, c): pixels[r, c] = 255 maze_width = int(input("width: ")) maze_height = int(input("height: ")) width = maze_width * 2 + 1 height = maze_height * 2 + 1 pixels = np.zeros((height, width), dtype=np.uint8) paths = [] all_positions = maze_width * m...

Q: Dart Ioc Container

Christian FindlayThis package is on pub dev here It's on Github here class IocContainer { final Map<Type, Object Function(IocContainer container)> _map; IocContainer(this._map); T get<T>() => _map[T]!(this) as T; } class IocContainerBuilder { final Map<Type, Object Function(IocContainer container)> _map...

1:59 AM
Q: Integer array to string

cgoatesThis function creates takes an int * buffer and creates a neatly formatted string (useful for printing the contents of an array). Is the code easy to follow? Is it efficient? Am I allocating and freeing memory properly? Bonus question: is there an idiomatic way to do this in C, such as through a...

5 hours later…
6:57 AM
Q: Getting "Cannot invoke "String.equalsIgnoreCase(String)" because "this.a" is null" error

user258898enter code here package practice; import java.util.Scanner; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.safari.SafariDriver; import io.github.bonigarcia.wdm.WebDriverManager; pu...

7:39 AM
I’m voting to close this question because it belongs on code review, as OP rightly noted. — Mad Physicist just now
I’m voting to close this question because it belongs on code review — Mad Physicist 35 secs ago
Q: How to properly reimplement my script that draws reflective properties of ellipse using NumPy

Ξένη ΓήινοςFor more context visit: https://stackoverflow.com/q/72313270/16383578 I spent the last two days to solve exactly what I asked, and I made a fully working implementation. Results: Code: import math import matplotlib.pyplot as plt from random import random from matplotlib.patches import El...

8:36 AM
Q: Scala & Kafka: Getting the producer and consumer offset difference and log it

sojim2I'm looking to compar kafka's producer and consumer offsets, get the delta of that and sum it per topic. The code iterates through each topic & partition -- each topic has many partitions. Each partition has an offset value. I'm looping thrice on offsets: Get TopicPartition & offset Get TopicPar...

2 hours later…
10:51 AM
Thanks - correct the email was encrypted originally but now this is left unencrypted for the query - other personal data is encrypted. I removed the duplicate select statement - code updated above. To fix the $post vulnerability you suggest bind in your post here - codereview.stackexchange.com/questions/230940/… - is this therefore the fix i require? — OnTarget 47 secs ago
11:04 AM
Q: Multithreaded tcp server accepting two clients with task factory and graceful shutdown

Arturas an exercise from multithreading and networking I have decided to create my own implementation of TCP server accepting connections from two clients (which is I think a pretty common case e.g. chess online games). The works as I wanted it to. Clients are connecting to server, messages from one c...

I’m voting to close this question because this type of question belongs to Code Review. Stack Overflow is for code that doesn't work as expected, not unexpected performance. — Thingamabobs 48 secs ago
11:29 AM
Q: Recursively search directories and their subdirectories for images and videos, except system or locked folders

DanielSearch directories and their subdirectories for images and videos, except: Windows system folders, locked folders, and folders selected by me. For example, as a developer I have dozens of Visual Studio folders with folders named bin and debug in them. The goal was to write the program in a smar...

11:45 AM
12:26 PM
Unfortunately this is the wrong site for code reviews. However, there is another site in the Stack Exchange network: codereview.stackexchange.com - you'll need to read the guidelines to see what's expected, but... that site seems like a much better fit. — David Makogon 40 secs ago
@DavidMakogon - Can I publish this code on codereview.stackexchange.com? — Amir Motefaker 43 secs ago
12:43 PM
Q: changing the attributes of a program

DaveI wrote a program that changes the attributes of a file. How can I make the program more efficient? Please find program problems. How can I improve the program? #include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <...

12:53 PM
There's a site dedicated to code review: Code ReviewForceBru 41 secs ago
1:08 PM
Q: Project Euler - Problem #1 - Multiples of 3 or 5 - Python

Amir MotefakerThis is my solution for problem 1 of the projectEuler with python: import time start_time = time.time() #Time at the start of program execution def multiple_3_or_5(n): if n % 3 ==0 or n % 5 ==0: return True else: return False sum = 0 for i in range (1,1000): # print (

1:36 PM
@MadPhysicist Please keep in mind that on Code Review the code must be working as expected before we can review it. There is a how to question in the post that makes it off-topic for code review. This question has already landed in the Close Vote Queue on CR as well. We can't tell the OP how to save the image at a higher size than their screen resolution. — pacmaninbw 5 secs ago
1:57 PM
Q: pending signals using the sigpending() function

LorandI used the sigpending () function in the next program to check the signals waiting at 1s intervals and display their numbers, then it ends with SIGTERM. Please criticize the implementation in terms of performance, optimization as well as performance, possible further developments, bugs etc #defin...

2 hours later…
4:25 PM
Q: How to make code readable?

GeorgeI have the following part of code. I dislike this, because if I need to add additional validation rule, I have to make changes in loop and create a varaible to store boolean result. For example check age. $nums = []; $linesState = []; $wrongCardNums = []; foreach ($lines as $index => $columns) {...

5:06 PM
5:30 PM
@user3386109 Cool, will look into code review — Eeshan 36 secs ago
6:09 PM
Welcome to Stack Overflow. Please read How to Ask and stackoverflow.com/help/on-topic and stackoverflow.com/help/dont-ask. We don't take code review requests here; try Code Review, but keep in mind that you will still need to ask a much more specific question than "what are your thoughts about this code?". — Karl Knechtel 34 secs ago
2 hours later…
7:42 PM
If the code is working correctly it might be better on Code Review StackExchangeRichard Critten 58 secs ago
2 hours later…
9:47 PM
Q: How do I cut down lines of working function that calculates the least amount of notes a ATM will dispense for a given amount

Brendan AhernThis is the code currently and it works. Currently have a DB with the type of note and the amount of that note available. This will, later on, remove the amounts of notes from the DB. I am happy with this solution I was just hoping there was a more clean way of writing this part of the code to cu...

10:11 PM
Q: Using Kotlin coroutines, is this the proper way to schedule a task whose result you don't care about inside a suspend function?

JustAnEuropeanI'm kind of trying to simulate getting cached stuff from some cache and then update the UI and the cache with a webservice call. I'm wondering if this "skeleton" of doing it is fine. Is it fine? I'm not sure what will happen to errors when I'm just going to call it inside of some Looper-like thin...

10:36 PM
Q: php flock with two instances

swissrockieI am calling this script as "php flock.php" while logged in from ssh. for the past couple of days I've been trying to get the "Can't run, sorry" from one instance but both just wait and I see "Done" from both. What's the missing piece here? <?php class ProcessLock { private $lockFilePath = 'up...


« first day (3305 days earlier)      last day (40 days later) »