All Questions

Filter by
Sorted by
Tagged with
3 votes
3 answers
1k views

Rock Paper Scissors Game feedback

I made this Rock Paper Scissors game using C++. This is my first time doing it and it took me around 3 hours. I know that since I am unexperienced, there is probably a much easier and shorter way of ...
Dalha Dalha's user avatar
2 votes
1 answer
93 views

Simple priority task scheduler implementation

My project I am working on requires the following functionality for the processed messages: each message has a priority messages with higher priorities should have precedence over the ones with lower ...
Alexei's user avatar
  • 1,816
2 votes
1 answer
35 views

Looking for feedback on a flavour of Radix tree I wrote. This is version 2 of the class original posted on this forum

My project explores some ideas i've had regarding alternate data structures to the unorderd_map and map, and aiming the exploration to key sets with a non uniform distribution and key sets with common ...
ver2's user avatar
  • 61
2 votes
1 answer
45 views

A selenium web scraper to package NBA data

I'm building a selenium web scraper for basketball-reference.com that takes a player name and returns data in either a JSON format or Pandas DataFrame object. The class in question is one of many that ...
BluffShove's user avatar
2 votes
1 answer
72 views

Scene Hierarchy with Translation, Rotation and Scale

This code represents an Entity Component that holds and manipulates an entity's local and world transforms, dealing with hierarchy and translation/rotation/scale transformations. The code is written ...
Daniel Marques's user avatar
2 votes
4 answers
658 views

Adding Node to Linked List

I've been programming for 3 months now, and I've just come across Linked List, and I'm not gonna lie, I've been struggling a little. I wrote this code to practice on Linked Lists. The purpose is to ...
fraber's user avatar
  • 179
4 votes
4 answers
1k views

Creating an O(n) algorithm for an array of integers

To avoid plagiarism in my university, I am going to modify the problem. Henry likes to jump from building to building. The heights of each building are given as a list of H numbers. We also number ...
Duckycodes's user avatar
4 votes
1 answer
62 views

Parsing command line arguments with CLI

I'm new to rust, and this is my very first rust program. I'd like to write a simple CLI app to help me running some Git command on multiple repositories. Since my goal is learning rust, I force myself ...
Marcus's user avatar
  • 41
4 votes
1 answer
72 views

Terminal based game: Part 3 (Using templated game)

Working from previous posts In this post: Terminal based game: Part 2 I introduced the concept of a Game object. To build a game like Terminal Base Snake you could ...
Martin York's user avatar
  • 95.1k
5 votes
2 answers
93 views

A shell function to copy files and directories, preserving directory structure

For a script, I came up with a shell function that might be generally useful. Before I add it to the code base, I’d like to hear someone’s opinion on this. I don’t write shell scripts often and had to ...
Bolpat's user avatar
  • 233
2 votes
2 answers
306 views

Minimal AlphaGo algorithm implementation for game 2048, connect4

I'm writing tutorial code to help high school students understand the MuZero algorithm. There are two main requirements for this code. The code needs to be simple and easy for any student to ...
user281935's user avatar
2 votes
2 answers
72 views

Form in the Epicor ERP environment

I've written this code for use on a form in the Epicor ERP environment. The code is doing what I need, but since I'm still learning I would imagine that there are better ways of coding. I'm here ...
DaShMa's user avatar
  • 21
1 vote
0 answers
63 views

WikiGameKiller.java - a program for solving Wiki game instances

Intro I have this GitHub repository. Basically, it is a command-line utility for searching automatically for shortest link paths in the Wikipedia article graph. The game in question is sometimes ...
coderodde's user avatar
  • 28.2k
3 votes
1 answer
56 views

PowerShell Script for Parsing JSON PyPI Package Data and find the latest version

Following this post, I have a PowerShell script that aims to interact with the Python Package Index (PyPI) to find the latest release of a specified package that is compatible with the current Python ...
Foad's user avatar
  • 361
2 votes
1 answer
57 views

Autocompletion trie for English words in zig

I am trying to write a program that creates a Trie from a list of all English words, and then when run provides completions for a given prefix. Basically for each node I allocate a list of 255 null ...
Joe Liotta's user avatar
7 votes
1 answer
956 views

Python Breakout game

I came from C# background with strong OOP approach. I've decided to learn Python and Breakout game is a way to cover the basics of Python. I'll be really glad for any feedback and general opinion ...
NeverDoomedEnough's user avatar
7 votes
1 answer
241 views

Colorful Subgraph Dynamic Programming Solution and a Naive One

Given a graph \$G(V, E)\$ with vertices \$V\$ and edges \$E\$, where each vertex is associated with a single color from a set of colors \$C=\{1, 2, ..., k\}\$, we define the following problem: Problem ...
FluidMechanics Potential Flows's user avatar
0 votes
0 answers
13 views

N Queens Puzzle in Dart

I have already written two solutions to the N Queens Puzzle problem, so I might as well write another one. This one is in Dart: ...
FlatAssembler's user avatar
4 votes
1 answer
118 views

Finding the earliest time we can schedule

We have a list of \$j \in \{1,\ldots,N\}\$ jobs with a processing time \$p_j\$ and a demand \$d_j\$ between 0 and 1. These are real numbers. Jobs require the fixed demand over the entirety of their ...
Titan's user avatar
  • 41
4 votes
1 answer
69 views

Terminal Base Snake

Based on this Framework Terminal based game: Part 2 A game that uses std::cout to print the board and std::cin to get keyboard ...
Martin York's user avatar
  • 95.1k
4 votes
1 answer
80 views

Terminal based game: Part 2

Follow up to: Terminal based game Finished up the framework. Still sticking with the X-Term based version. As I want a very simple framework to use for teaching (not this part initially). But my next ...
Martin York's user avatar
  • 95.1k
4 votes
2 answers
286 views

Simple version of NEAT

I have wrote my own simple version of NEAT and want to improve the code for mainly performance (training and runtime of a generation). This simple version of NEAT aims to perform somewhere near as ...
coder's user avatar
  • 121
2 votes
2 answers
502 views

Using java streams to handle incoming API requests

I am using the java stream API to handle incoming requests my employee service. A few questions I had are: Does using the streams API in the way I'm using it below affect the performance of the ...
Brandon Bryan's user avatar
4 votes
1 answer
81 views

Java classes for downloading all in-coming/out-going links of an article in the Wikipedia article graph

(The entire project is in GitHub.) Introduction This project provides facilities for generating in-coming or out-going links in a given Wikipedia page. Code ...
coderodde's user avatar
  • 28.2k
1 vote
0 answers
39 views

React based Quiz Website

I have recently worked on a quiz application using the MERN stack. The application incorporates various features such as user authentication, quiz creation, scoring functionalities, and data ...
Ultimate's user avatar
  • 143
4 votes
1 answer
149 views

Last Stone Weight Problem in Haskell using list `insert`

Background Saw this problem on TheJobOverflow which seems to be a LeetCode question. It bothered me that the "challenge" of this problem was to recognize the need for a specific data-type (...
WesAtWork's user avatar
0 votes
0 answers
29 views

Thread pooled bidirectional breadth-first search in Java for graphs with slow node expansion - part II/II: fluent APIs for builders

Intro This post follows Thread pooled bidirectional breadth-first search in Java for graphs with slow node expansion - part I/II: the algorithm. Basically, these are build patterns leveraging fluent ...
coderodde's user avatar
  • 28.2k
0 votes
0 answers
38 views

Thread pooled bidirectional breadth-first search in Java for graphs with slow node expansion - part I/II: the algorithm

(This post has part II/II.) Intro This time, I have this GitHub repository. The idea is that if the graph node expansion is slow (for example, in the case where you ask a web server to return some ...
coderodde's user avatar
  • 28.2k
1 vote
2 answers
88 views

simple Text Table utility

A small utility to print data in an ascii table TextTable ...
Martin Frank's user avatar
  • 2,838
0 votes
0 answers
32 views

Add a new sheet for all files in folder, pull data from multiple reports for each one, save PDF/xlsx summary

I'd appreciate any help people can offer to make this process more efficient and less goofy. I've created a process to loop through a folder of approximately 100 files, add a new sheet with a base ...
Kris's user avatar
  • 1
4 votes
2 answers
128 views

Game of life code in C++

Does my code for game of life look good enough? What changes can I make to optimize the code? I am a beginner to java and I've coded the Game of Life! For those not familiar, the game entails creating ...
ap0calypse's user avatar
6 votes
2 answers
2k views

Terminal based game

Looking to build a terminal based game. I am assuming X-Term like terminal. This means: I can use the X-Term control codes to clear and move around the screen. I can use ...
Martin York's user avatar
  • 95.1k
5 votes
3 answers
676 views

Rust: Command line menu in ASCII table

Specific areas in which I'd love to get feedback: Is it good to have the Command struct own the Strings (...
m01010011's user avatar
  • 153
4 votes
0 answers
62 views

Google App Script to take form responses submitted by teachers on their students and produce formatted PDF student reports

I'm not a programmer but, with help, I managed to make a Google Apps Script which takes reports, submitted by teachers on their students, to the Form Responses Sheet, and then selects all responses ...
StreetSavvypub's user avatar
3 votes
0 answers
66 views

Sum all numbers touching symbols in 2D grid (Advent of Code 2023 Day 3, Part 1)

Please offer suggestions to my below Rust approach for solving AoC 2023 Day 3, Part 1. The code is functionally correct, so I'm interested in understanding how I could have solved it in a more ...
naivedeveloper's user avatar
2 votes
1 answer
48 views

Benchmarking putchar_many vs puts Performance for the Same Byte

Whilst writing an interpreter for Brainfuck, I had collapsed sequences of .......... to a single instruction OP_PUT (10) (Note ...
Harith's user avatar
  • 5,834
5 votes
3 answers
86 views

Time based cache for single element

The container should be thread safe and provide lazy load of data, and cache the data for set period of time. ...
trolkura's user avatar
  • 151
2 votes
3 answers
114 views

Further developing calculating crude death rates and age-standardised death rates

This script is a further development of Finding crude death rate and age-standardized death rates from data. In reflection to the kind reviews I created a module for the data; saved the data in ...
Attila Vajda's user avatar
1 vote
0 answers
23 views

User Management System: a web app for management of user records (Part II: Frontend)

Note: It's Part II of the User Management System project, focused on the frontend. See Part I here. Here's the frontend part. I want to note that I realized even back then that copy-pasting a huge ...
Sergey's user avatar
  • 541
1 vote
0 answers
26 views

User Management System: a web app for management of user records (Part I: Backend)

Note: It's Part I of the User Management System project, focused on the backend. See Part II here. I made this app about a year ago. I was a fledgling developer who didn't have a lot of clues to what ...
Sergey's user avatar
  • 541
4 votes
1 answer
128 views

Longest spell to cast from pages of spellbook follow-up

This question is from the PCTC 2022 R2 Past Paper and is a follow-up on my previous question. Previous question I have implemented several solutions suggested, such as creating an array with pages ...
helielicopter123's user avatar
1 vote
2 answers
102 views

Compiler grammar and parser are disconnected

In the process of creating my first toy language, I have created the base grammar for it (which can surely be improved upon, feel free to comment). I am emitting C at the moment. \begin{align} ...
Tsaras's user avatar
  • 147
4 votes
0 answers
142 views

tbf - A Brainfuck Interpreter and Transpiler in C

Language: The Brainfuck programming language consists of eight commands: ...
Harith's user avatar
  • 5,834
2 votes
1 answer
100 views

Combinations of elements in array

I wrote this code to get all possible arrangements for an array containing 3 elements: ...
John's user avatar
  • 47
3 votes
2 answers
171 views

Finding crude death rate and age-standardized death rates from data

How can I improve this code's readability and function, for finding crude death rate and age specific death rate? Given are the death rates from chronic pulmonary obstructive disease in 2019, the ...
Attila Vajda's user avatar
4 votes
1 answer
72 views

Simple Redis implementation in Rust

This is a very tiny implementation of Rust that uses redis serialization protocol (RESP). I implemented it as one of code crafters challenges. I have less than a few month experience in Rust, so it ...
Amir reza Riahi's user avatar
6 votes
4 answers
557 views

Longest spell to cast from pages of spellbook

While practicing for a school coding challenge, I came across this problem. My code got the right answers but exceeded the time limited. Any tips for how to reduce the time complexity? https://pctc....
helielicopter123's user avatar
2 votes
1 answer
220 views

Graphs for distributing rewards

I want to be able to distribute a total reward among referral network, where the distribution diminishes according to the depth of the network but the total sum of distributed rewards equals the ...
Bob's user avatar
  • 149
3 votes
1 answer
81 views

Gaussian Fisheye Image Generator Implementation in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++ and Three dimensional gaussian image generator in C++. I am trying to make a ...
JimmyHu's user avatar
  • 4,708
1 vote
2 answers
155 views

Strings to array

I've written a simple text tokenizer in JavaScript which works in my specific case, but I do not think it is maintainable (for example, if the requirement ever changed to allow newlines when ...
FromTheStackAndBack's user avatar

15 30 50 per page