Newest Questions
77,883 questions
7
votes
2
answers
228
views
Find the nearest school to you
I have created a text-based program that finds the nearest school using your coordinates.
The CSV DataFrame is available through LimeWire.
I'd like to know how I can improve it.
...
5
votes
2
answers
267
views
MinMaxStack - tracks minimum and maximum values
I'm implementing a MinMaxStack<T> in C++20 that tracks minimum and maximum values. The class needs T to support ...
4
votes
2
answers
211
views
Transform dataset coordinates from Lambert Conformal Conic projection to WGS84
I am trying to convert a dataset which has a Lambert Conformal Conic projection to the classic WGS 84 with Python. Unfortunately, the dataset does not have a defined EPSG code, but the general ...
5
votes
3
answers
685
views
Bash script for manually cleaning up the Traefik access log file and limiting it to a maximum of 50 MB
I have written a short bash (or POSIX-compliant) script to clean up the Traefik access log file and limit it to a maximum of 50 MB. I would like to know what you think of it. Any suggestions are ...
-1
votes
0
answers
41
views
Optimize ArcPy Code [closed]
I have the following ArcPy code, which I need to run on very large datasets. Are there any suggestions for making it run faster? It's taking upwards of an hour and half to run the section I posted ...
5
votes
3
answers
577
views
News API in Python - Take II
From my previous post, I tried to take into account all of the nice answers made by Kate, Chris, J_H, Booboo and mudskipper
Changes made
In short, I attempted to apply all of the following:
API key ...
8
votes
5
answers
1k
views
News API in Python
Why I made it
I’m building a voice assistant and thought it would be great if it could deliver news updates.
What it does
It cleans up the user’s query, determines whether it refers to a news category ...
-3
votes
0
answers
41
views
Websocket integration for High frequency trading [closed]
I’m currently building a trading platform that requires streaming real-time price updates to the UI. I’ve implemented a WebSocket gateway and added handling for common issues such as:
Ghost/...
0
votes
0
answers
37
views
Streaming messages for Chrome MV3 Web extensions
Explainer
Problem
No standardized Web Extension API to send or transfer TypedArrays or ArrayBuffers or
...
4
votes
2
answers
258
views
Create Frame Widget with Pygame
I developed two custom UI components with Pygame: a Button widget and a Frame widget. After placing the Button inside the Frame, I encountered an issue with the Button’s collision detection.
...
4
votes
2
answers
381
views
A tiny Java framework for gathering running time statistics - Take III
From the previous post, I have incorporated the nice answers made by Chris and Chip01.
Code
...
4
votes
2
answers
443
views
A tiny Java framework for gathering running time statistics - Take II
Intro
(The previous version is here.)
(The next version is here.)
Now I have incorporated nice answers made by Chris and Chip01.
What changed:
Fixed the computation of median,
...
4
votes
1
answer
160
views
Unofficial School News Website between Friends
Why I made it
I built a small news-style website in Secondary 3 to publish monthly recaps of everything happening in my friend group. My friend’s pen name was Salmon (Who is also the one who designed ...
4
votes
3
answers
433
views
A tiny Java framework for gathering running time statistics
Intro
(See the next iteration A tiny Java framework for gathering running time statistics - Take II.)
I have this tiny Java framework that allows users to gather running time statistics of a piece of ...
5
votes
4
answers
476
views
Substitute patterns with values from lists
I was looking at a Stack Overflow question and got somewhat carried away with improving the solution, well beyond the scope of that question.
In summary, we have a string such as
...
-4
votes
0
answers
53
views
Feedback on small C++ database project [closed]
I'm fairly new to C++, and I'm trying to improve my skills.
I'd appreciate it if you could take a look at my project and share any feedback or suggestions.
It's a small database implementation written ...
1
vote
1
answer
98
views
A Java program for compressing/decompressing files via Huffman algorithms (version 1.1.1)
Intro
(See the version 1.0.0.)
(See the GitHub repository.)
This time I have got rid of some generic classes and adapted the entire code base to deal with byte ...
6
votes
3
answers
638
views
ASCII-based Lightweight Browser with Clippy-Style Helper in Python (Updated)
This question used to contain a mistake in the code, so I had to debug and reformat it. This is the correct version.
Why I made it
A friend and I wanted to make a lightweight browser, since our ...
2
votes
1
answer
102
views
Forward Euler's method
Are there any improvements I can make to my code for forward Euler's method on Matlab?
...
1
vote
2
answers
120
views
ASCII-based Lightweight Browser with Clippy-Style Helper in Python [duplicate]
Note that this is the original version which has not been formatted to comply to PEP-8 and contains an error in the code. Please visit the updated version instead to post answers, comments and/or cast ...
7
votes
3
answers
806
views
Optimizing real-time ASCII playback in Python when each frame is fetched as a PNG via GET
Why I made it
I wrote this script for one simple purpose: to Rickroll my friends.
How it works
This is the workflow:
It fetches a .png frame from a PHP endpoint on a website I own. The frame number ...
0
votes
0
answers
47
views
Remove error from Inputfield when user input value in field in React
After submission if there are any error, on user inputfield typing wants to remove that error.
My Approach.
...
6
votes
1
answer
111
views
Bash tool for automating Telnet/SSH commands with live interactive session takeover
I made this executable because I used to play on a MUD, which was essentially a server to which you connect to through telnet to play in a multiplayer world. What annoyed me was how difficult it was ...
4
votes
2
answers
679
views
Unicode-based platformer game in Python (Updated)
I already asked this question, but the script I provided was not compliant to PEP-8, so I rewrote the script for better readability.
I'm making a platformer game called Uni where this small character ...
6
votes
3
answers
1k
views
Unicode-based platformer game in Python
I'm making a platformer game called Uni where this small character has to go as high as possible, in which the player constantly has to choose between jumping (W) going left or right (A-D) climbing ...
5
votes
1
answer
463
views
A Java program for compressing/decompressing files via Huffman algorithms (version 1.0.0)
Intro
(See the version A Java program for compressing/decompressing files via Huffman algorithms (version 1.1.1).)
(The full repository is here. It contains also some unit tests that do not fit in ...
-5
votes
0
answers
84
views
Object oriented programming deque implementation (after another second thought)
After another second thought from the second thoughts series Object oriented programming deque implementation (after second thought) it turns out using static methods alternatively to method ...
0
votes
0
answers
41
views
WebSocketStream implementation, JavaScript runtime agnostic
References
WebSocketStream Explained
WebSocketStream API design
Source code
https://github.com/guest271314/websocket-stream-impl
Implementation
...
3
votes
1
answer
458
views
Term only, arrow-only category foundations in C
I am learning to write an arrows-only, Term only foundations in C, because I noticed Lean4 has types and terms, so I thought maybe it would be nice to have term as the basic building block.
Please ...
3
votes
5
answers
634
views
List folders with size
This code below aim to listing all folders in one directory and get size of each in byte. It uses only pathlib module for that.
...
1
vote
1
answer
150
views
A different way to create HTML elements
I created this module to help with the creation of HTML elements:
...
7
votes
3
answers
802
views
C++17/20 templated LRU cache : how should get* handle misses? (exception vs std::optional vs pointer)
I’m implementing a templated LRU cache in C++17 and C++20.
High-level design:
Recency: ...
0
votes
0
answers
61
views
Сreating a digital twin of the enterprise
I am creating a program to create digital twins of enterprises. I am using the Simpy framework for this purpose.
I'm creating a universal system that can model almost any enterprise, but I have a ...
0
votes
0
answers
41
views
Builder pattern with nested struct
I've been looking on how to use Builder pattern on rust with structs, but all examples I've seen only use primitive data.
Given the structs:
...
2
votes
1
answer
146
views
Huffman code builder in Java - computing prefix codes for arbitrary (generic) alphabets - Take II
Intro
(This is the continuation of HuffmannEncoder.java - computing prefix codes for arbitrary (generic) alphabets.)
(See the GitHub repository.)
This time:
I have fixed the misspelled ...
6
votes
2
answers
499
views
Implementation of a balanced binary tree
I never remember without looking how to write RB or AVL balancing.
but I wanted to make sure I would be able to still write a reasonable dynamically balanced binary tree. If it is asked of me in ...
4
votes
2
answers
357
views
HuffmannEncoder.java - computing prefix codes for arbitrary (generic) alphabets
(See the continuation of this post at HuffmanEncoder.java - computing prefix codes for arbitrary (generic) alphabets - Take II.)
I have this Java implementation of the Huffmann encoding. It looks like ...
3
votes
1
answer
735
views
"Frankenmallow" C code uses arc4 to choose flavors and coatings in arrays for mallow ideas, w/ switch cases, and countdown, functions: rngch ctdn
Is there any way to improve my spaghetti as a new C programmer? I'm both trying to make my program functional and nice, as well as easy to debug, and I've done a lot for this, can the codebase be ...
9
votes
2
answers
858
views
Arena Allocator in C
This is my first time doing any kind of serious coding in C. I watched a Youtube video on what an Arena Allocator should do and I tried my best to make an implementation for it.
As of now, we have the ...
2
votes
3
answers
1k
views
LeetCode 3542: Minimum Operations to Convert All Elements to Zero
I am working on this LeetCode problem where I have to count the minimum number of operations to make all elements in an array equal to zero 3542. Minimum Operations to Convert All Elements to Zero
...
7
votes
3
answers
787
views
Custom Error Exception Class in Python
I've written a class to handle my custom errors in Python. The idea is to simplify raising exception with custom messages, all you should do is raise the class and pass it a message.
Everything in the ...
4
votes
1
answer
228
views
Use z3py to solve one logic constraint puzzle
I decided to practice by modeling some simple, hand-solvable problems using z3py. Below is an example:
...
6
votes
4
answers
774
views
InsertOnlyHashSet in C++
First C++ project: write a hash set for a specific scenario where I only need inserts and containment checks.
This is not AI slop, everything except for the avalanche function is hand written. Please ...
7
votes
6
answers
789
views
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
Is there a more direct way (loop-free) to compute this number than computing a level and then going back?
...
6
votes
1
answer
470
views
Revised and documented version of a 6500-line parsing project
I'm finishing my parsing tool split into three libraries, the first two being:
https://github.com/pczarn/cfg
https://github.com/pczarn/gearley
I am working on PR https://github.com/pczarn/cfg/pull/...
4
votes
3
answers
84
views
Optimizing DataFrame iteration when generating large hierarchical text files
I have a custom object which stores dataframes in memory given a certain hierarchy, and I want to store this data in a file while maintaining the hierarchy. This hierarchy involved parents, children, ...
4
votes
1
answer
208
views
Weight balanced tree in OCaml
The objective was to create a weight-balanced binary search tree with a well-defined interface. Any critiques or suggestions for improvement are welcome.
...
2
votes
1
answer
116
views
Using a dynamic custom 404 template in Laravel
I have made a Laravel 8 blogging application that supports themes.
I had made a custom 404 template for every theme, the path to it being ...
8
votes
3
answers
128
views
Test to ensure CGI can be invoked on a local server
I am writing tests for legacy software which has a dependency on CGI scripts on a remote machine.
Mocking the dependency would entail modifying the code under test, which is a thing I cannot do at the ...
1
vote
0
answers
29
views
SvelteKit authentication hook with token refresh and request deduplication
I've implemented a SvelteKit handleFetch hook that manages authentication for API requests with automatic token refresh. The API provides a 15-second grace period where a refresh token remains valid ...