Newest Questions

0 votes
1 answer
91 views

2D line-of-sight recalculation code causes lag whenever a door is opened [closed]

My 2D video game recalculates into a cache the line-of-sight from every tile to every other tile and whether that line-of-sight provides clear shot, cover, greater cover or is blocked. Each time a ...
Petr Hudeček's user avatar
5 votes
1 answer
243 views

Parsing Markdown with bare hyperlinks: Hoping to find a way to workaround the "noscript" workaround

The following example shows how to use markdown-it to parse and render Markdown. It works, but there is a dirty trick there, which I absolutely don't like: to ...
jsx97's user avatar
  • 227
3 votes
1 answer
104 views

Time series prediction by LSTM model

I have a collection of TEC data. My data sample for example: day1, day2, day3, day4. Case1: I have the following task to do: Training by the consecutive 3 days to predict the each 4th day. Each day ...
S. M.'s user avatar
  • 123
7 votes
3 answers
1k views

Naive attempt at implementing a dictionary in C. Stack-based and O(n)

I am a C++ programmer trying to learn C. Please critique my C code here. I am trying to make a small "hash table" that's \$O(n)\$ lookup. But, it is stack-based and so should be no slower ...
ijklr's user avatar
  • 397
5 votes
1 answer
83 views

Histogram Class Implementation for Image in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++, histogram Template Function Implementation for Image in C++, Histogram of ...
JimmyHu's user avatar
  • 7,028
1 vote
0 answers
37 views

SwiftUI NavigationSplitView three-column layout

For getting familiar with SwiftUI NavigationSplitView, I created a prototype, which implements a three-column view. Screenshot: Code (View): ...
michael.zech's user avatar
  • 4,814
5 votes
0 answers
136 views

FractalRendering on GPU with CUDA

I am doing a fractal renderer using CUDA, SFML, C++, recently optimized it to eat less memory, now I am going to optimize the actual fractals, because for some reason, it is the most holding back ...
NeKon's user avatar
  • 396
1 vote
1 answer
77 views

React component

The code makes unnecessary API calls because there are two useEffect hooks that both fetch data. The first useEffect runs on mount and fetches data for page 1, while the second useEffect runs whenever ...
Tomasz Waszczyk's user avatar
5 votes
2 answers
169 views

Design By Contract Library in C++

I asked this question on StackOverflow, and got exactly the answer I needed at the time. I am now here to ask - Is this a good design? The motivation for writing up this library: my shop writes ...
jdc's user avatar
  • 153
4 votes
0 answers
73 views

Correct abstractions/organisation of a NodeJS GraphQL API

I recently did a quick take-home test for a potential job opportunity. It included building a GraphQL API with nodeJS. I am not an expert in node (mostly use Python at work) but I have used it for ...
Sajomancer's user avatar
1 vote
0 answers
99 views

Runtime function overloading / dynamic dispatch for Python (2nd revision)

Second revision of the original post: Function overloading / dynamic dispatch for Python TL;DR: Improved version of this library[^1] based on previous reviews and criticism. It provides runtime ...
HernanATN's user avatar
  • 379
3 votes
2 answers
152 views

Numerical integration using Gauss and trapezoidal methods [closed]

I have written a code that performs numerical integrations—one using the Gauss method and the other using the trapezoidal method. For the Gauss method, I have five separate text files containing the ...
X-SimE's user avatar
  • 33
1 vote
1 answer
87 views

Creating functions that send and receive atomic messages in Rust paradigm

I'm converting a library from C to Rust, and I want to see if this is the optimal way to implement network communication. This ...
Jonathon Anderson's user avatar
1 vote
3 answers
218 views

fibonacci sequence generator

I have a piece of code that attempts to reduce the work and span in making a Fibonacci sequence. My approach is to parallelize the code as much as possible, along with doing matrix multiplication and ...
Droid's user avatar
  • 119
4 votes
1 answer
343 views

Optimizing Image Processing in OpenCV: Using cv::Mat with Reference Counting Mechanisms and C++ ref qualifiers

I have questions regarding this code: As the cv::Mat copy constructor involves only pointer copying due to the reference counting mechanism, in the ...
sam's user avatar
  • 227

15 30 50 per page
1
5 6
7
8 9
5174