instruction
stringlengths
71
95.1k
A simple terminal blackjack game written in Python. Follows basic blackjack rules: Blackjack pays 3 to 1, Hit, Stick, Double Down and Splits Dealer hits until 17 Keeps track of some data Wrote it for working on my object-oriented programming, i am recently new to coding, if anyone takes a look please comment could be d...
So I have made 2 games without any internet when on vacation. I have used turtle because I did not install pygame. I was wondering how I could improve my games. Here is the code: Pong: from turtle import * from time import sleep import random, keyboard, math setup(width=800, height=700) if(input('Do you want to have ...
I'm self-learning and pretty new to coding and created a Mastermind game in Ruby. Any general feedback or advice whatsoever would be greatly appreciated. The game is completely functional right now, and has a simple AI. At the beginning the player chooses which role they want to choose (codebreaker or code maker). Chee...
Getting my feet wet with Game Development, and was wanting to see where I could improve in my usage of Rust as well as Game Development concepts. use rand::Rng; use sfml::graphics::{Color, Font, RectangleShape, RenderStates, RenderTarget, RenderWindow, Text, Transformable, Shape}; use sfml::system::Vector2f; use sfml::...
Im finally done with my project and im going through my code and optimising it and trying to cut down on the chunky lines of code, how would i optimize this, it a series of if statments that matches text and adds value to a corresponding text box private void btnfinalize_Click(object sender, EventArgs e) { ...
I am building a tool that interacts with a batched stream of incoming data. This data needs to be processed and the result returned. To split up the work I have created a class that has inbound (_in) and outbound (out) queues and workers that are getting, processing, and depositing the work. This example takes an itera...
The code below if launched on the command line is a simple guessing game. A random character 'a', 'b' or 'c' is chosen, and the user is prompted until they guess correctly. It's arguable that invalid input and a win is not necessarily exceptional. Should exceptions be used in this manner? I am not sure what's a sensib...
Simple star designer for HTML canvas. Allows you to change every variable about how to draw the star. This can be used to create squares, triangle, circles, hexagons, etc. But isn't an efficient way to create them and is only recommended for creating star shapes. Note! the rotation is purely for show and isn't included...
I use Java8, I have a subclass of Thread called DelayedThread which wraps a Runnable and executes the Runnable after certain amount of time. It has a method called cancelOnlyIfStillSleeping() which interrupts Thread.sleep but I don't want to interrupt it once Runnable has been called because I'm afraid of interrupting ...
Currently, I have a code which downloads a file from FTP to local hard disk. It then uploads a file in chunks to Azure. Finally, it deletes the file from local and ftp. This code is very slow though. Just wanted to know how to improve it. private async Task UploadToBlobJobAsync(FtpConfiguration ftpConfiguration, Bl...
I'm brand new to Ruby. The function takes in a string of any number of words, and reverses the order of the words. Also, for each word, it takes the vowels and moves it to the end of the word. It also downcases everything. Thus, Hello World! would become wrld!o hlleo. I am trying to use some Ruby features, hence why it...
I've just finished implementing a Generic RecyclerView adapter in my Android app, written in Kotlin. BaseAdapter.kt: import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView abstract class BaseAdapter<T>( private var dataList: ArrayList<T> ) : RecyclerView.Adapter<BaseViewHolder<T>>() { ...
Recently I've been learning about concurrency/parallelism and I decided to implement the Michael&Scott lock-free Linked queue (PDF) as practice. I'm not entirely sure how to test this data structure or even if my implementation is concurrency safe, but any feedback is appreciated. #![crate_name = "cqi"] //! # cqi //! ...
I'm looking to simplify controller logic where multiple validation steps will either result in redirecting the browser or re-rendering the current view. Overall I'm looking to: Avoid excessive nested if statements Avoid multiple calls to Controller::redirect with the same arguments Avoid using "return $this->render();...
From HackerRank "Repeated String" challenge: Lilah has a string, \$s\$, of lowercase English letters that she repeated infinitely many times. Given an integer, \$n\$, find and print the number of letter a's in the first \$n\$ letters of Lilah's infinite string. For example, if the string \$s=abcac\$ and \$n=10\$, the ...
I've written working LZ77 algorithm implementation which uses linked lists (they help to look for matching substrings faster). I'd like to get some feedback on my code's quality and also information about mistakes and dubious places in my program (if I have any). #include <iostream> #include <fstream> #include <cstring...
An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j]. Return true if and only if the given array A is monotonic. public class MonotonicArray { public boolean IsMonotonic(int[] numbers) { if (numbers == null || numbers.length ...
Posting my code for a LeetCode problem, if you'd like to review, please do so. Thank you for your time! Problem For an undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called minimum hei...
I have built a website in Django in which I tried for the first time to create a complex app. It's an app that scrapes weather conditions on a peak in mountains, which are 17. I wanted to show a detailed forecast in separate templates, so I have 17 views which look almost the same. Only 4 views: class KasprowyWierchFor...
I am creating a social network and I want to know if this is a secure way of uploading pics/gifs and videos. if(isset($_POST['post'])) { $uploadOk = 1; $imageName = $_FILES['postToUpload']['name']; $errorMessage = ""; $picdate = date('Y-m-d_H-i-s'); if($imageName != "") { $targetDir = "ass...
ceil_constexpr is is based on: https://stackoverflow.com/questions/8377412/ceil-function-how-can-we-implement-it-ourselves/8378022#8378022 ceil_constexpr2 is a simpler version that takes advantage of truncation. WARNING 1: Both ceil functions uses from c++20. WARNING 2: ceil_constexpr uses bit_cast - a c++20 function ...
Seeking to learning and have fun, I wrote out this script (what I expected to be) self explanatory and would appreciate some comments on that. I published it as a gist and tried to do my best on what I understand about object-orientation, documentation, code readability and python best practices, so to speak. The idea ...
On Linux there is the cat command which outputs files concatenated but on Windows there exists no such command. As a result I decided to attempt to recreate a simple version of it but with challenge which was that I could not use any part of the C runtime library. #include <windows.h> /* global variables */ HANDLE std...
I was inspired by this answer to make this. ex[0] = 1; ex[n_] := ex[n] = ex[n - 1] + 0.5^n/n!; The double assignment in the second line is very important. This causes all function calls to be evaluated only once. Once it has been initially evaluated, it will be saved in ex[n]. After a little research, it looks like ...
#include <functional> template<typename return_type, typename... argument_types> struct stateful_function_pointer { using function_type = std::function<return_type(argument_types...)>; using function_pointer_type = return_type (*) (argument_types..., void*); function_pointer_type callback () { ret...
I need to set different __table_args__ for the mapped class depending on the backend DBMS, e.g. mssql and mysql - and this attribute cannot be set after the class definition, e.g. class Repository(Base) has been evaluated. Ideally, my db/models.py module would take a parameter db_type, when it's imported, but this is n...
You can find my original post here on SO. I was very surprised that I couldn't find a pre-coded function doing a mean square error between a signal (array A, size a) and a pattern (array B, size b<a) in a sliding window fashion. Thus I made one... and obviously it needs a lot of code improvement. I don't really know ho...
I'm trying to create a setup script for our projects in an ubuntu server. This is what I have now, but I don't know if its correct, or can I do it differently/better ? If someone could take a look pls. Thanks #!/usr/bin/env bash set -e # ================== # Step Functions # ================== # create_user() { # ...
I am working on a small internal app that works along an external API for provisioning purpose. The code essentially is comprised of a series of forms where the user inputs data, this data is then sent to the API to register new customers. This is somewhat quite a linear process I will try to explain: Contact Creation...
I have a block of code that is re-used and I want to use functional programming to remove this duplication. My code takes an array of items, splits the items into batches of 500 and then does some kind of work on them. In the first function it deletes items from a database: Delete function: const deleteDocuments = asyn...
I was looking for a solution for a way to easily merge maps of serialized Yaml and came up with this. Reference to a similar question (not asked by me): https://stackoverflow.com/questions/25773567/recursive-merge-of-n-level-maps Here is my take on how to handle this. MapUtil.java: import java.util.*; static class Map...
I want to get my code cleanner and more efficient. This code gets variables form a PHP file and filters it to show the selected user name, all available usergroups on a list box and the groups he is currently into in another. <script> function saveGroup(type,id){ $('#useridgr').attr('placeholder', '').va...
I work as a front-end developer, mostly with Typescript. But now i decided to learn Elm as well, more out of curiosity than for any practical reason. My first program is a Connect 4 game, and in the code below i have implemented the following: Initialize a 7x6 grid of numbers (7 columns, 6 rows) In the grid, 0s repres...
(Also, see the next iteration.) I have this small program for terminating processes via their respective process image names (.exe files): #include <stdio.h> #include <windows.h> #include <TlHelp32.h> int main(int argc, char* argv[]) { if (argc != 2) { puts("processkiller.exe PROCESS_NAME"); return...
I'm a beginner at C. I'm currently implementing atof to build a raytracer, however I'm still learning how to efficiently write programs. Assignement Instructions The program takes a scene description file as argument to generate objects. Some of these paramaters are float. Example of the file. I'm parsing through the...
I saw a guy who fit snake in a qr code and I wanted to do the same thing but with minesweeper. The maximum amount of data a qr code can hold is 3kb. My c program, without any compiler magic, takes up 58kb. A tiny bit over the limit, haha. So before I started performing alchemy with the compiler and compression program...
I'm looking for critiques to see what I could have done better or different ways I could approach writing a script for finding even or odd numbers. I am new to programming with JavaScript, and programming in general. This is one of the first challenges I wrote for finding even or odd numbers. var numList = []; ...
I am looking for any feedback for this first script I have written. It is a mix of openpyxl and pandas, where it takes employee times from different Excel workbooks, then creates a weekly sheet for each person in a new workbook, and fills in the individual sheets. Somewhere else that I had asked about this code suggest...
I am trying to create an application that on the front end presents the user with a text editor to input code into and then I will run that code and return the result. I thought it would be a fun project to try and build my own version of leetcode as a learning project. Right now this is what I am doing to run the prov...
In order to learn web server programming in Node and JavaScript, I decided to implement a simple web server that only does one thing: Display data of the HTTP request as an HTML table. The actual data to display is arbitrary. In this example I'm displaying the contents of the header, along with the method, url, and h...
I wrote a B-Tree implementation in C++20, based on my previous Red-Black Tree implementation. Unit Test Demo : https://wandbox.org/permlink/Brw6TgAhdy89OIyj Any feedback will be welcomed! #include <algorithm> #include <cassert> #include <concepts> #include <cstddef> #include <functional> #include <iostream> #include <i...
This bit of code is looking for the pair of integers that make up a product. You can input any integer and it returns the pairs of numbers that, when multiplied together, make it up. I have done a pretty bad job at explaining this, but the code it pretty simple. All comments welcome. num = 498 num_1 = 1 while num_1 < ...
Similar to this question, I implemented the independent cascade model, but for a given networkx graph (including multigraph with parallel edges). My focus is on readability, pythonic-ness, and performance (although the problem itself is NP-hard). I cannot wait to hear your feedback! def independent_cascade_model(G: nx....
Any improvements to this welcome, I have got it working and I'm happy with it. I'm not really all that proficient with bash shell scripts though. Problem: AWS can copy multiple files pretty much as quickly as it can copy one file, so if you have a lot of large files then the best way is to get Amazon to copy them in p...
Description I've written the snake game using C++ and FLTK. For simplifying the use of FLTK, a built-up library written by Bjarne Stroustrup was used. Bellow located main parts of the code written by me, a whole project can be found on GitHub: https://github.com/WumpusHunter/Snake-game. Source.cpp /* Snake game ...
I'm refactoring functions trying to do more of a in-line aproach. private int GetRandomNumberHigherThanHalf() { double randomNumber= Random.NextDouble(); if (randomNumber < 0.5) throw new Exception("randomNumber is lower than 0.5"); return randomNum...
A day ago I started a c# project where I bruteforce passwords. Passwords can be both integers and strings. In the code I check how many characters the password has. Whilst this is kinda cheating it would take too long to crack otherwise. I am posting it here to see if it's good enough. using System; namespace Hacking_...
I have a requirement where I get totalAmount and how much parts to divide that amount into as inputs. For the outputResponse I am using builder pattern and also avoiding null fields. Total amount is a big decimal (if null or less than 0, throw exception) and number of inputs can range between 1-3 (if outside of this ra...
I has div block feedList which contains feedItems. Now to fill feedList with data (feedItems) i am using while loop. In future it will js which get data from backend dynamically. I created 2 buttons, which is used to border num of feedItems in feedList. One is "5", another is "10". To border num of feedItems i use func...
In another question the user was determining the probability of having a streak of 6 heads or 6 tails in 100 coin flips. To find the probability they would generate 100 random coin flips and determine if there was a streak. They would test 10,000 such sequences of 100 flips to find that there was about an 80% chance of...
This is citty.py, part of the citty repository. It's formatted using black, so I'm not super worried about small style items. I'd like a review with suggestions for other, better practices -- choice of technologies or implementations (e.g., "use xml instead of json", or "use goodpackage instead of badpackage"), approac...
This exercise is from jshero.com. Write a function parseFirstInt that takes a string and returns the first integer present in the string. If the string does not contain an integer, you should get NaN. Here is my working solution. I'm posting in hopes of receiving pointers on how I could have written the code more effec...
I programmed a tic-tac-toe game using pygame. It's the first game I make. I'd really appreaciate any comments you have about the coding style and any improvements that could be made. import pygame import graphics # External module graphics.py import logic # External module logic.py # Setting up window HEIGHT = 600 ...
Code review scope My goal with this review is to receive big-picture observations and suggestions for improving the efficiency / ease of writing the front end of a web application with this basic framework. I want to focus on what it looks like it should do rather than the details of what it may or may not unintentiona...
My code writes data and then receives data back. I want to log that this has happened, and I also want to inject a delegate so that I can get a callback to trace the data that is going in and out. This is example of the classes for reading and writing data in a request-response style. public class IOExample { priva...
The following codes purpose is to generate an array of bytes that represents some user defined data. This array of bytes will later be used for sending over a network. WelcomePacketWriter is a concrete subclass of PacketWriter. Subclasses of PacketWriter can use methods provided by PacketWriter to write to the list of ...
I was working on writing a fast implementation of a simple Huffman code compression of text. The idea was to write it using only the standard library, but I can't seem to find a way to make it faster. I am also looking for advise on how to write it more "Pythonic", without sacrificing speed. I am aware that if I want s...
(See the previous (i.e. first) version of this tool.) (See the next follow-up.) After taking into consideration all the advice by Martin R, I ended up with the following tool for terminating all the processes with given process image names: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <TlHelp32....
The question is: Given a non-negative int n, compute recursively (no loops) the count of the occurrences of 8 as a digit, except that an 8 with another 8 immediately to its left counts double, so 8818 yields 4. Note that mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) by 10 removes the right...
I've been writing a modular sandbox that has a web front end. Modules are discovered with reflection and could have parameters to them. When parameters are presented to the UI, I pass them through a set of JavaScript utility methods that map them to display elements which utilize Bootstrap 5 for styling. function creat...
I recently gave a coding test for a job which failed. It had two problems and one of them is shared in this question along with my solution. Problem: Get balance of all transactions in a given category within specified period. This is how a typical transaction looks like: { id: 123, sourceAccount: 'my_account', t...
I have decided to create a program that can factor and solve quadratic expressions in micropython, where the standard library is limited, and i have no idea how to implement external modules onto it, so i had to bake this program from scratch. The simple premise is, that it can factor and solve most quadratic expressio...
I would like a code-review. Not so much on if the implementation is good or effecient, it's probably not, more on code style and readability. import java.lang.Exception import java.nio.ByteBuffer import java.security.MessageDigest import java.util.* import kotlin.math.abs fun main() { val filterSize = 1_000_000 ...
I am working on a turtle project where the user can draw their own avatar. The thing is, I want the user to be able to decide whether the turtle they drew will be filled, or not. The filled part is simple, as by default, the polies will get filled, but the only way I know how to avoid filling is to retrace the lines so...
Using only Python 2.7 and the standard library (no imports): Determine if a point is inside the rotated rectangle. Test point 1: 670831 4867989 Test point 2: 675097 4869543 Rectangle: Vertex 1: 670273 4879507 Vertex 2: 677241 4859302 Vertex 3: 670388 4856938 Vertex 4: 663420 4877144 Can th...
To learn the ropes of Node.js and Express, I'm trying to implement a very simple REST API. The API says what it should do instead of doing it, so I can focus on the framework's structure. The requirement for the API is the following: Mock API for a question and answer game. /qanda endpoint: Repository of all question-...
I am writing a lambda function to make a request and fetch data from API. I am using as a class based approach which I think could refactor it and write in correct way. May be we can change this class based approach if required. Below is the approach which I have implemented. app.js const apiService = require('./apiSe...
I have three main questions: Am I using std::unique_ptr correctly here? Using std::move and get? Is there any way for me to make my _insert and _delete functions iterative? I'd like for it to be something similar to my search function. Do I need a destructor? Or since I am using automatic memory management, will all...
Before you read the code below, note the following explanation: I have three classes: Driver, Vehicle, and Itinerary. They have attributes Driver.behavior, Vehicle.pRange, Vehicle.pBattery, Itinerary.destinations, and Itinerary.startTime. The function findCand takes all these class attributes as input and returns as an...
I have overridden setAnchorView() of MediaController class to display full screen option icon using below code.The code seems to be working fine in devices I tested but I have few doubts for which I need review- The class assumes the anchor view is a FrameLayout to position full screen imageview. Should I use try catc...
I tried to parse command line arguments. The program requires four arguments. I iterate over the arguments. If the argument is an option, I process the option. Otherwise the argument is one of the required arguments. In order to read the required arguments I need some kind of state machine. In the first case the first ...
The code below will store a base64 image on another website and create an event to display the image on a Vue page in real time. It works fine and all. My question is, is this a good way of doing it or there's a better way to structure the code? I've thought about placing the logic in a listener but it doesn't seem tha...
I'm working on my first Rust project of any particular size, a rudimentary IRC bot. So far I've found solutions to most of the problems I've encountered, but something I'm now getting tangled up in as the project grows is my attempts to apply DI/IoC principles for testability. (I'm coming to Rust from PHP, so I may be ...
I'm learning Rust and have decided to code up a toy YANG parser as an exercise. In case it's relevant, I mainly work in C and Python. While working on the tokenizer/lexer, I tried to make it Rust-y, but have ended up with some rather clunky-looking match statements. They're of the form: match fn_which_returns_result_my...
A Sudoku solver that works recursively. I'd appreciate your comments about coding style, structure and how to improve it. Thank you very much for your time. Code structure The Solver works by accepting a string of 81 digits for the Sudoku puzzle input. Zeros are taken as empty cells. It parses it into a 9x9 Numpy array...
I got this test online last week. here is an example: given this array: { 1 , 2 , 4 , 5 , 1 , 4 , 6 , 2 , 1 , 4 } on condition that index(x) < index (y) find the number of possible pairs (x,y). where x = y. the answer would be: count = 7 - (0,4), (0,8), (4,8), (1,7), (2,5), (2,9), (5,9) Edit3: added picture to cl...
I stumbled upon a post on Reddit a few days ago and I thought I make my own! It's a program to extract from a movie file (.mkv, .mp4, etc.) and stack them horizontally next to each other and make one picture of all the frames available in the movie file. how can I make it more pythonic, readable, and sufficient? Also, ...
Was a tiny bit bored reading authentication protocols. Needed to clear the mind and read some base64 encode text. So I implemented these iterators that will encode or decode base64 text. Not sure about: Interface is there a better way Iterator Implementation (its been a while since I did one) How easy to make this wor...
Over on Stack Overflow, I read an answer asserting that Insertion Sort was inferior to Selection Sort for array data (as opposed to linked list data) on account of the larger amount of data movement that insertion sort performs on average. This claim was new to me, running counter to many assertions I have read and ac...
I'm currently implementing permissions into an application and are trying to save this onto a database using Hibernate. There are modules with commands and the permissions are also categorized using possible-null role, text channel and role+text channel. Therefore I want to achieve the following: You can either deny/a...
I implemented concepts for container and allocator types. I referenced type requirements from here for container and here for allocator. For the sake of simplicity, there are a lot of type aliases declared in the template because concept itself does not allow declaration. I'm also concerned that many parts of the code ...
I wrote a Compressor utility class to generate 7zip files containing everything in a specific directory. The problem is that it's an order of magnitude slower than both archiving the directory using the native Windows 7zip.exe AND archiving to a .zip file using a ZipCompressor that uses the same algorithm but with the ...
I am working on an e-commerce website. In this specific scenario, people can upload their CV to apply for a job. The job application is sent to ApplyForJob action method: [HttpPost] [ValidateAntiForgeryToken] public async Task<JsonResult> ApplyForJob(JobApplicationViewModel jobApplicationViewModel) { if (ModelState...
I'm new to java and I have just finished my very first game - Arkanoid. I would appreciate, if anyone could look at this and tell me some advice and tips how can I optimize my code. Thank you. :) I have 5 classes - Breaker, BlockBreakerPanel, Ball, Paddle, Block. Look: This is the main classs: public class Breaker { ...
The flask endpoint is supposed to take a table name as a parameter, and then return the entire contents of the table as JSON. The table has 200,000 rows and I was wondering if there is any way to improve the response time which is currently about 7 seconds. @app.route('/tableToJson') def retrieve_dataset(): ''' ...
I'm working on a menu for my poker game console app. I've conceptualized the menu(s) as a class with menu items that have their own position. I would like to get pointers on how I could improve on what I have done as I would like to add a settings menu in the future. Here's a gif of how the menu works: <blockquote cl...
I have currently 600 CSV files (and this number will grow) of 50K lines each i would like to put in one single dataframe. I did this, it works well and it takes 3 minutes : colNames = ['COLUMN_A', 'COLUMN_B',...,'COLUMN_Z'] folder = 'PATH_TO_FOLDER' # Dictionnary of type for each column of the csv which is not string ...
I'm writing login system in Go(Golang) using cookies.I think it's isn't safe enough. Can you provide some suggestions on how to improve the security. Main file: package main import ( "fmt" "golang.org/x/crypto/bcrypt" "html/template" "math/rand" "net/http" "strings" "time" ) var ( rune...
I am currently implementing this paper on generalised end to end loss: https://arxiv.org/pdf/1710.10467.pdf A batch of N speakers and M utterances are fed to the model which outputs an embedding vector of size P for each utterance. The first step for calculating loss is constructing a cosine similarity matrix between e...
I really liked the close tray program that CD-ROM drivers programs used to include in MS-DOS days. Since I live in a place where even getting an internship is impossible, I've decided to learn by myself. I implemented this "Hello World" C# script to do that with a twist. It will check the optical drive status and if op...
This small piece of code shows the value of different fields of an array. I'm looking for a way to improve this nested ternary function. An if statement solution would be obvious, so I'm wondering if there is something more elegant to solve it. <button type="button" onclick="myFunction()">Check</button> <p id="demo"></...
I want to get my code cleaner and more efficient. This code gets variables form a PHP file and filters it to show the selected user name, all available usergroups on a list box and the groups he is currently into another. Currently it's working great but it has a lot of delay between the modal shows up and the groups b...
I'm a new Rust programmer, primarily coming from Ruby experience. I started working on a small project to scrape vehicle specifications from https://carfolio.com I chose to write it in Rust and actually got the code working, but I had some questions regarding async, performance, as well as code organization and abstrac...
Playing around with pointers in C++, implemented an adjacency list graph. Am I going too far/extreme trying to place data onto the heap? graph.h #include <memory> #include <unordered_map> #include <forward_list> #include <utility> template <typename TKey, typename TWeight> class Graph{ struct Adjacent { T...
I come from a C++ background, and I recently got into C, and one of the first things I made was a double linked list since I though it would be good practice for me with pointers and memory allocation. It isn't too complex though, it's just with some basic functions. Here's the overview of my list: #include <stdlib.h> ...
How's my code? Works perfectly for what I'm trying to do :) #include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> #include<fstream> #include<assert.h> using namespace std; inline void keep_window_open() { char ch; cin >> ch; } int main() { int sum{ 0 }, number; vector<int>...
Here is the chess class for my very own chess game. Everything is in this class. Generating moves, getting a move from the computer, printing the board etc etc. This is a follow up question to C++ generator function for a Chess game. these are the values for each piece in the board, also used in the int board[8][8]; pa...
Our monolithic WinForm application is getting a face lift. One current challenge that we are restructuring how we setup events. I rolled my own event manager class to handle the subscriptions and unsubscriptions to prevent leaks whenever developers write code. I ran into several challenges with storing generic values...
In the past I created a compile-time base64 converter which I enjoyed doing as a challenge. As a result I wanted to do the challenge again causing me to create a compile-time Morse code translator. here is the code: #include <iostream> #include <numeric> namespace morse { template<std::size_t N> struct FixedSt...
So I am currently doing an Assignment where I have to make a code that when someone opens the page, they input the weight of an egg and it comes back with what "size" it is. I got the code working and I sent it to my teacher for feedback. However, she came back with telling me I should make the code more "Elegant and E...