Newest Questions
77,891 questions
1
vote
1
answer
20
views
Create tags for potentially dirty git repository state
Note: The below is similar to this question (i.e. same motivation & general idea), but tries to be more careful: My version should never touch the repository state (to preserve staged files etc), ...
5
votes
3
answers
42
views
Maze Solver in Python inspired by Micro-Mouse Competition Logic
Why I made it
I watched this video by veritasium about Micro-Mouse maze-solving competitions, and found the logic to get to the center fascinating. Hence, despite not having a maze or a mouse, I spent ...
3
votes
1
answer
31
views
Image Perspective Transformation with CUDA in C++
This is a follow-up question for Image Stitching using SIFT Keypoint Descriptor in C++ and SIFT Keypoint Detection for Image in C++. In the previous post, the image stitching algorithm is implemented; ...
5
votes
5
answers
1k
views
Chess Clock Code
The code below I've made is supposed to act as a chess clock when uploaded to a compatible Arduino. I've written everything, but I just want another set of eyes to look over the code in case I've ...
5
votes
5
answers
946
views
Function in Python that encrypts and decrypts, taking string to list and the other way around
I'm new on Python, so I'm looking at these YouTube videos of Python projects to practice, and I saw this one of a Password Manager with encryption, but the encryption part couldn't use password, ...
0
votes
0
answers
26
views
Sending and receiving TypedArray's in Chromium Web extension messages
This is an alternative approach and follow up dealing with this issue Extension messaging uses base::Value (JSON) serialization but could use WebSerializedScriptValue (structured cloning), closely ...
5
votes
4
answers
404
views
Absolute-path Python function taking as argument a path relative to the directory of a script (.py) or Jupyter notebook (.ipynb) file
I'm currently still in the early stages of learning Python and Jupyter notebooks, and I wanted to ask if the following code for returning absolute paths relative to the directory of a script (...
5
votes
3
answers
542
views
Ping sweep of IP subnets
I made a ping sweep for the first time, and I want to do better. What do you think that I might be missing?
...
5
votes
1
answer
123
views
Breakout Game as a Bookmarklet in JavaScript
Why I made it
I wanted to experiment with javascript: bookmarklets and see how far a small injected script could go on any site by making a simple injectable game.
...
-4
votes
0
answers
25
views
Working with httplib in C++ and need libssl and libcrypto to support ssl [closed]
Trying to write code in C++ to connect with an API to pull data from a site. The issue I am having is that the site uses SSL and the relevant version of the command to work with SSL in httplib is not ...
1
vote
0
answers
145
views
Force Google Translate to translate text between <code....> and </code> tags on my webpage by replacing code with span and revert it after translation
Some browsers were not showing text on my webpage in bold so I put some text that was between <span> tags between ...
-5
votes
0
answers
38
views
Analyze a directory recursively what file types (file extensions) they contain [closed]
Aim
My aim is to analyze a (big) (sub)directory and just find out what file extensions all files have there (recursively).
Additionally, these conditions apply:
I am on Windows, but I could use WSL ...
7
votes
3
answers
857
views
Bash Backup script for password DB
Can you please comment on the script below? It backs up my local password database to a remote repository if a change is detected. It works as intended. I'd like some comments in terms of syntax, ...
5
votes
1
answer
131
views
On the absence of protected member concept in javascript
I wanted to create a protected member in a javascript (ES) class but, of course, there is no such concept. So I devised a way that would let me create a member or something that "no one could ...
9
votes
2
answers
604
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.
...
7
votes
3
answers
460
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 ...
5
votes
2
answers
235
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
730
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 ...
5
votes
3
answers
598
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 ...
1
vote
0
answers
56
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
272
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
404
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
465
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
171
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
452
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
487
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
...
1
vote
1
answer
110
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
656
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
105
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
128
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
821
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
51
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
121
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
692
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
471
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 ...
0
votes
0
answers
48
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
465
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
650
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
160
views
A different way to create HTML elements
I created this module to help with the creation of HTML elements:
...
7
votes
3
answers
817
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
66
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 ...
1
vote
1
answer
66
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
160
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
516
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
369
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
752
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
882
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
...