« first day (3310 days earlier)      last day (713 days later) » 

12:03 AM
REFRESH! There are 8073 unanswered questions (89.3173 answered)
 
12:18 AM
0
Q: Langton's Ant cellular automaton in Java

plankinsI made a couple of little games and cellular automata in Java. For every new 'game', I used the same code as a base, except for the game logic of course. With every iteration of me customizing my existing code to my new idea, my coding skills have much improved and I added new things that I learn...

 
1:17 AM
@SᴀᴍOnᴇᴌᴀ The only difference is that the mmap call was tested for a result, which was also suggested in one of the answers.
 
1:42 AM
I'd recommend posting this to Code Review instead as these sorts of questions are better handled over there. — Ken Y-N 34 secs ago
 
1:57 AM
0
Q: Rust: Unsecure Static Once

DelfinI am basically a beginner, so I Wrote some code that implements a zero cost singleton, through it will crash your program if you have a MPU. use core::cell::UnsafeCell; use core::mem::{size_of, transmute, MaybeUninit}; /// This type is mean to Static allocation of variables that should life all t...

 
 
2 hours later…
4:00 AM
0
Q: Server code to save images. Need help to refactor it

Denis CherepanovIs there a way to beautify my code? It works but there repeated blocks and I am not sure that I'm using some functions in the right way. I'm not new to javascript but I want to improve it and get rid of Bad Coding Habits. Below is my code snippet that I'm using on the server to upload product ima...

 
 
5 hours later…
9:22 AM
0
Q: Rust vector iteration and integer conversions

Edvard FagerholmStarted learning Rust by solving LeetCode problems as they involve all the standard data structures of the language. I have the following standard hash table solution to the two-sum problem: use std::collections::HashMap; impl Solution { pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32>...

 
9:47 AM
0
Q: useActions hook function overload signature

slideshowp2Does the below TS type still need to be improved? I use actions: any as the more general signatures. Is there any better way? import { ActionCreator, ActionCreatorsMapObject, bindActionCreators } from 'redux'; import { useDispatch } from 'react-redux'; import { DependencyList, useMemo } from 'rea...

 
 
1 hour later…
11:15 AM
Thanks for your replays! I didn't know about Code Review... — Denis Cherepanov 21 secs ago
 
11:27 AM
this would be more suitable for code review stackexchange — Netwave just now
 
12:15 PM
0
Q: A collection of Python functions that fill a given region with rectangles

Ξένη ΓήινοςThese are what I was working on in the last few days, I wrote a bunch of functions that fill a given region with rectangles of different colors. The functions can: Randomly split a region into sub regions recursively based on n random points: one point (each region is split into four sub regions)...

 
12:32 PM
 
1:29 PM
0
Q: Sum square difference

Amir MotefakerProblem description: The sum of the squares of the first ten natural numbers is, 1² + 2² + … + 10² = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + … + 10)² = 55² = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of...

0
Q: Show different concentrations on scatter plots with different colors

MarkI have an app which parses data files on the clients browsers and displays a scatter chart. This is an example of a scatter chart with 10,000 data points: This is an example of a scatter chart with 1.4 million data points: My algorithm is crude and simple. I get the events in a correct format (...

 
 
1 hour later…
2:35 PM
No problem. If you'd like to make a post on CodeReview (StackOverflow sister site) I can give you feedback on your code: codereview.stackexchange.com/questions/tagged/office-scriptsBrian Gonzalez 59 secs ago
 
3:08 PM
0
Q: LeetCode 68. Text Justification

Chintamani ChavanI am trying out this Leetcode(Difficulty : Hard) Problem and I need your help to asses the code. I am pretty new to this. Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified. You should ...

 
Still the only option to reduce the clutter and embrace the Zen. It also moved text around, which isn't appreciated (by me). And in code review, testing, and similar situations, it's very clear that it's missing if you turn it off completely, which is good. — Henrik Erlandsson 10 secs ago
 
 
1 hour later…
4:12 PM
Monking
 
1
Q: Blackjack Python Code Feedback

Josh DickmanBeen working with python for a couple years on the side, looking to get feedback on this Blackjack game I made for some OOP practice. Code executes as expected (and I know the game is incomplete - no splitting, etc). https://github.com/josh9730/misc/blob/main/blackjack.py Code: from cards import ...

0
Q: Templatizing a Timer class

Alex CBI'm making a timer class in C++. This is the overview: #include <chrono> namespace ktp { class Timer { using Clock = std::chrono::high_resolution_clock; using TimePoint = std::chrono::high_resolution_clock::time_point; public: Timer(bool start = false) { if (start) Timer::start...

 
4:36 PM
@CaptainObvious It is tempting to down vote this, there is an excellent answer that states as the first line that the code doesn't work and can't work, then goes into more detail. Because of the answer I don't want to VTC.
I don't know whether to retract my close vote and down vote on this question or not, there is now a very good answer, and @SᴀᴍOnᴇᴌᴀ edit lets me remove my down vote, I still won't up vote it, and there is another VTC besides mine.
 
@pacmaninbw it appears the other VTC is for a different reason
 
@pacmaninbw The other downvote is mine so feel free to leave it.
I don't think code being similar warrants a question being closed.
As long as they're not too similar. As in, you can't just give the variables a different name.
 
4:59 PM
@SᴀᴍOnᴇᴌᴀ Why did greybeard VTC?
 
@pacmaninbw If you can't see, we can't tell.
Sorry.
 
@Mast Based on their comment, Code Not working. I can see that they VTCed in the history, but not the cause.
 
There have been votes for Authorship and CNW on it in the past.
 
I' consider greybeard a rather good member of the community due to all their activity.
 
Aye.
 
5:08 PM
@Mast The OP did add the test for mmap() and the calloc() implementation so it isn't completely the same.
I wish the census would ask about CR. I don't really care about SO.
^^^Developer Survey
 
Hah, yea.
The survey is very SO centred.
In the past it hardly acknowledged the rest of SE existed, so, has been worse.
 
I've retracted my VTC, but left my down vote. Also removed my comment about why I VTCed it.
@CaptainObvious All the code to be reviewed is in a GitHub repository. Authorship. The code included is an example of rules, but not specific to any project.
 
5:48 PM
Does your code work? If it does you may want to go to code review instead: https://codereview.stackexchange.com/drescherjm 34 secs ago
I’m voting to close this question because it belongs on Code ReviewChrisMM 49 secs ago
 
6:01 PM
0
Q: C++ Hash table, Hash function, benchmark vs std::unordered_set and std::hash

frozencaI wrote my own hash function and my own hash table. My hash function seems to work surprisingly well! Feel free to comment anything! Hash function: #ifndef __CLRS4_HASH_FUNCTION_H__ #define __CLRS4_HASH_FUNCTION_H__ #include <bit> #include <common.h> namespace frozenca::hard { using namespace ...

 
6:50 PM
0
Q: Trying to learn about OOP, specifically encapsulation, and use of static

Alexander DaleMy goal is to improve my coding skills, I am just looking for feedback specific to encapsulation, the use of static, and any other tips to make this "production quality". I don't feel confident the Solve method has been implemented correctly. By instantiating the object its contained within. Simi...

0
Q: bubble sort algorithm with nested loops performs better than with one loop JS

Ben_Sven_TenHere are 2 bubble sort algorithms: 1: function bubbleSort(array) { let i = 0; let startVal = array[i]; let comparingVal = array[i + 1]; let iterations = array.length; while (iterations > 0) { if (comparingVal === undefined) { i = 0; startVal = array[i] comparing...

 
7:27 PM
this is probably better suited for the Code Review site on this network — lagbox 55 secs ago
 
 
1 hour later…
8:29 PM
0
Q: Get ffmpeg command to encode video in x265 codec and downscale to `max_height` resolution

Spare-Spray6508I'm translating the python program video-diet to learn rust. The program is to recursively compress video files in a directory, but here I'm just preparing the ffmpeg command. I like to follow clean code principles. The problem I usually have is that I don't know how to make some functions smalle...

 
8:53 PM
0
Q: Locate Primitive Value in Nested Sequence Type - Iterative version is slower than equivalent recursive function

Quack E. DuckI'm looking for advice on how to improve the performance and/or style of these two search functions. This is just for fun and for practice: they are already fast enough for any application I would be using them in, and they don't have to meet any specific performance criteria, but I'm intereste...

 
 
1 hour later…
10:09 PM
Questions about improving otherwise working code may be better suited for Code Review, but be sure to follow their content guidelines and How to Ask to ensure an on-topic question. — jmoerdyk 19 secs ago
 

« first day (3310 days earlier)      last day (713 days later) »