instruction stringlengths 71 95.1k |
|---|
Here is a rundown of the situation
This is a .Net Core (2.1) application with a console and web front ends.
For simplicity this question focuses only on the console end although
the web end has the same issues.
Serilog is the logger of choice. We use 2 sinks (i.e. output sources): Console and MongoDB
Security is a co... |
I have a function that sorts and groups items inside an array and then adds a corresponding jsx element to the page.
I've already refactored it from 100 lines of code to 44, but I'm sure that its still unreadable pile of spaghetti code. I've tried filtering individuals and groups separately but that just bloats my code... |
Original code review: Project Euler #11 Largest Product in a Grid | Cache-optimized + sliding window (C++14)
Source: HackerRank & ProjectEuler.net
Problem: Largest Product in a Grid
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 ... |
I have this function (wb is a public workbook variable):
Function GetTiersAccount(TiersName As String, Clients As Boolean) As Long
If Clients = True Then
On Error GoTo ERRRRR
GetTiersAccount = WorksheetFunction.VLookup(TiersName, wb.Sheets(1).Range("A1:B13"), 2, False)
Exit Function
Else
On Error GoTo ... |
I would value your opinion on the following piece of code. I am rather new to both Python and Monte Carlo analysis, so I was wondering whether the routine makes sense to more experienced and knowledgeable users.
import numpy as np
import scipy.optimize
from scipy.optimize import curve_fit
from scipy.stats import kde
d... |
(I was suggested to post here from stack overflow so hey guys!)
I have been given a problem where fractions between 1/2 - 1/1000 have to be added to create the longest sequence of all unique unit fractions.
The rules on constructing these fractions:
Let create a set: D , D is only to hold unique unit fractions , sub-fr... |
I have created a LinkedList in Ruby and was wondering if anyone had any input on efficiencies that I could add or deficiencies I could remove.
module LinkedList
class List
attr_accessor :node
def initialize
self.node = nil
end
def add(node)
if self.node.nil... |
I'm just looking for someone to review this and see if it all works, here you go.
I must mention that once you start this code adventure, all answers to questions must be in single quotes (i.e. ') and lowercase.
import time
items = ['backpack','deagle','stick','mushrooms']
stupid = 0
backpack = 0
deagle = 0
stick = 0
d... |
I'm a first year computer engineering student and would appreciate feedback on some code.
I've created a linked-list with an iterator to be able to range for loops like: for (int i : list) {} where list is Linked_List<int> list;.
Flaws I already know of but choose to ignore because of how the teacher in class implement... |
I've already made all the changes suggested here. Here is the link for round 2: Linked list implementation along with unit test [Round 2]
I want to see how other people think of my code, so here it goes. This is my first time writing a unit test. I'm wondering if there needs to be more tests for the LinkedList class an... |
I need to optimize this javascript method because it is a bit slow, I don't want to use the flat() command, as for some reason my angular6 app does not understand the vanilla flat() command, or display some annoying warning messages.
So check the below:
my original object
my result object desired
my slow solution (wo... |
I'm posting here to ask for some help improving myself using python since I'm fairly new to it and come from C#.
The main functionality of this bot is parsing the Wargaming API for player related information.
Project structure:
project
| main.py
└───ENV
│
└───data
| classes.py
| dbcontext.py
| ... |
I wrote the following code for Radix Sort algorithm for number sorting. Any review is highly appreciated.
You can also view and run/test the code here Radix Sort
#include<iostream>
using namespace std;
int getNumberAtPosition(int num,int position){
return (num/position)%10;
}
void radixSort(int array[],int leng... |
The game is hosted here.
GitHub repo
This is my first Phaser 3 game/project and I'm still pretty new to Javascript so I'm sure there are many things I could be doing better. The number 1 thing that I would like to improve about my code is the performance. Then code effectiveness and readability, but performance is the ... |
I'm implementing the singly linked list data structure and functions to work with it. In particular I'm concerned about prepending and removing nodes. Currently I defined linked list as follows:
typedef struct string_list_node{
int id;
const char *value;
struct string_list_node *next;
} string_list_node_t;
... |
I have read the book "C++ concurrency in action" and understood the thread_pool implementation. I have changed a few things according to my project requirements.
I have used std::variant to support heterogeneous work-queue to store different task arriving on a epoll-event loop. Currently In my project I have only two ... |
The task:
Given an array of integers in which two elements appear exactly once
and all other elements appear exactly twice, find the two elements
that appear only once.
For example, given the array [2, 4, 6, 8, 10, 2, 6, 10], return 4 and
8. The order does not matter.
Follow-up: Can you do this in linear time an... |
Given a string taken from the following set:
strings = [
"The sky is blue and I like it",
"The tree is green and I love it",
"A lemon is yellow"
]
I would like to constuct a function which replaces subject, color and optional verb from this string with others values.
All strings match a certain regex patt... |
I have two variables that could be the same. In such a case I am assigning one of them to be undefined. Is this code the best way I can write it?
let folderOwner = $("#change-folder-owner").val();
let folderUser = $("#user_name_alias").data('value');
folderOwner = (folderOwner === folderUser) ? undefined :... |
The question itself should be fairly self-explanatory. My method takes in value, max_digits, and decimal_places, and returns a formatted decimal number string. The code:
from decimal import Decimal, ROUND_DOWN
def format_to_decimal_string(value, max_digits, decimal_places):
"""Formats a decimal number to the given... |
Edit 1: changed a few portions of the code to hopefully make it runnable code and more understandable. If something is still incorrect please let me know.
Edit 2: just remembered I am doing this in python 2.7 because I am required to. If that causes any issues again please let me know.
I am trying to create 4 symbolic ... |
I have a VBA script that does the following and I am trying to see if I can have it perform faster than 44 seconds:
start with ~138k rows of data on sheets("Data")
concatenate each cell in the row into a temp string variable
temp string will look some like this if my row are columns A:D, "I am cellAI am cell BI am c... |
I have the following log4j2.properties file:
status = info
name = my-app
# properties
property.name = my-app
property.basePath = log
property.filename = ${basePath}/${name}.log
# console layout
appender.console.type = Console
appender.console.name = console-logger
appender.console.layout.type = PatternLayout
appender... |
I’ve written a program for solving a problem using standard single-threaded code. However, it looks like it could be recast as a multi-threaded problem using divide & conquer. Since this is a first attempt at multi-thread programming (and debugging), I thought it might be advisable to separate the problem itself from t... |
Here is the link to the next round of code review: Linked list implementation along with unit test [Round 3]
Here's the link to the previous code review:
Linked list implementation along with unit test
Implementation
/******************************************************************************************************... |
I do not know how to do this without four nested for loops.
I'd like to apply a function to every possible combination of subsets for hour and day, return that value, and then pivot the data frame into a square matrix. However, these for loops seem excessive so I'm looking for a more efficient way to do this. The data... |
The task:
Given a real number n, find the square root of n. For example, given n
= 9, return 3.
My solution:
const findRoot = n => n >= 0 ? n ** .5 : void 0;
console.log(findRoot(9));
Is this some kind of trick question? What's there to solve? Did I miss something?
|
When I used to use a PC I was familiar with py2exe, the mac equivalent I saw most people talking about was py2app — which compiles python to .app files, not .exec files. I was familiar with compiling C files to execs on mac, and I had heard of cython (but I had never used it before), so I figured I could write somethin... |
I've written a java application that can handle operations on big integers implemented with array list of digits.
I have a difficulty with the way I implemented the divide method, because when the difference between the two numbers is high, the operation can take a huge amount of time.
I'd like to hear your thoughts ... |
My model called Customer contains a method called generate_fields which creates records based on its return values.
def generate_fields
words.map do |word|
numbers.map do |number|
content = find_content(word, number)
next if content.nil?
{
kind: word,
value: content
}
... |
I implemented a stable marriage problem in Haskell few month ago. It's not optimized at all and I'd like to know how to make it better from performance and readability perspective.
data Sex = Male | Female deriving (Eq, Show)
data Virtue = Intelligence | Appearence | Kindness deriving (Eq, Show, Enum)
data Parameter ... |
Context and initial idea
I'm trying to teach myself the CQRS and Event Sourcing patterns by developing a simple ASP.NET Core application, loosely following Greg Young's example CQRS implementation on GitHub.
Once a command has been handled and the resulting events have been persisted to the database, I want to have any... |
I hope this is the right way of doing things: I've previously posted a request for a code review and gotten feedback. Now I have new improved code that I would like a code review on again. Old: C++ linked list iterator implementation
Known issues:
Sentinel node contains a value
I haven't yet learned how to implement ... |
I made a palindrome checker that's supposed to be designed to be simple and easy to read. Please let me know what you think. I believe the time complexity is \$\mathcal{O}(n)\$ but I'm not too sure about that:
Challenge: You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn ev... |
I want this method to be completely understandable just from looking at the code and comments only.
def add_error(error_dict, key, err):
"""Given an error message, or a list of error messages, this method
adds it/them to a dictionary of errors.
Doctests:
>>> add_error({}, 'key1', 'error1')
... |
My code recovers all sent messages (ending with "\r\n") in function read_message. I would like to improve this code, make it more efficient? If it's possible, I am open to all reviews!
Code
static char *read_message(char *data)
{
static char *buffer = NULL;
char *message = NULL;
char ... |
I could have any value in milliseconds like:
1040370
I must alert a specific converted time format : _m_s (ie:17m20s)
Here is how I do it:
function ms(a){
var m = a/1000/60,
s = Math.floor(('0.'+(''+m).split('.')[1])*60);
m = (''+m).split('.')[0];
alert(m+'m'+s+'s');
}
ms(1040370);
What do you think?
Is it sat... |
As many of you know goto is usually signs of code smell. However I thought this could be an appropriate case, and would like confirmation or criticism.
Unnecessary section such as the called functions were removed. Every non-standard function returns an int as status, 0 is "OK"; except linkedlist_open() which returns a... |
I have a C# app that receives the following commands, via tcp sockets.
{
key = "foo",
value = 1.6557,
}
I'm currently using this method to get the key-value pairs and store them to a classes auto properties.
private Regex _keyRegex = new Regex("\"(.)*\"");
private Regex _valueRegex = new Regex(@"\d*\.{1}\d*");
privat... |
In my final project for my Python course, I am required to create a calculator program. I really need someone to look over my code and tell me if I have met all the requirements for this project.
Here are the requirements:
For the final project, you are to write a calculator program in Python
with the following char... |
I made a project in Python 3.7.1 that includes classes to create Yu-Gi-Oh cards. This isn't the entire game; it is just the cards itself. I will create the entire game later. I want feedback on how to improve my code.
class Deck(object):
def __init__(self, main_deck):
self.main_deck = main_deck
def add... |
I'm studying SVMs and wrote a demo in MATLAB (because I couldn't get a quadratic programming package to work correctly in Python). Right now it's simple and can only do linearly-separable cases (nonlinear kernels will be implemented later). This is the first MATLAB program I've written outside of a MATLAB seminar I'm t... |
Goal of Program
Consider a template file template.txt with double brace variables, intended to be replaced by values:
hello there {{ MY_VAR1 }}
some other stuff
some other stuff
foo: {{ MY_VAR2 }}
{{ MY_VAR2 }} is the value of MY_VAR2
and assume you have defined and exported those variables:
export MY_VAR1=val1
export... |
I would like to know if this code follows recommended practices and standards for AJAX/PHP calls. Can this AJAX + PHP code be improved in terms of security, performance, etc.?
ajax.js:
function getTableData() {
const xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.read... |
I'd love for someone to review my code. It works fairly well, but I'm still getting the hang of PHP and want to make sure I've got an iron-clad system that isn't hilariously vulnerable. I'm also open to better ways to handle registering/logging in and out. I know the general answer is to not do this yourself, but I'm i... |
I have created an employee object to be immutable.
package com.immutable.ex01;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
impor... |
I have created a Spring Boot Microservice for playing Rock Paper Scissrors. I have tried to follow best practices, but still would appreciate some critique on my code. Thanks.
@RestController
public class RockPaperScissorsController {
@Autowired
private PlayerService playerService;
@Autowired
private HttpServ... |
A function which replaces an unicode character in a string:
void replaceAllOccurences(std::string& source,
const std::string& replaceFrom,
const std::string& replaceTo)
{
std::vector<std::uint8_t> data(source.begin(), source.end());
std::vector<std::uint8_t> p... |
I am writing a simple game with pyGame.
Structure-wise, I have separated my game into several files:
main.py # the main runner, it loads up the environment
class_tank.py # it defines the player-controlled tank class
class_shell.py # it defines the shells that shoot from the player's tank
class_mob.py # it defines the ... |
I have written a simplified version of the Mars Rover challenge in Ruby. Please review it for best coding practices.
A rover’s position and location is represented by a combination of x and y co-ordinates and a letter representing one of the four cardinal compass points. The plateau is divided up into a grid to simpli... |
I've been looking for a solution to the may readers one writer in Java.
I was intrigued by this question posted here and I read the Wikipedia entry about it.
So far, I've reached a fine solution, or at least that's what I think. I've set up a new GitHub repo to put the code to be used in another project if people want.... |
So i have written this code to save and load data for my C++ game to a file, this way I don't have to hard code every single room and item for the game. Essentially here's how the game works: So you have a Map, and a map consists of rooms. A room contains tiles and items. there are 32x18 tiles in a room, and a tile is ... |
I have written this code to simulate Ising Model at one particular temperature in presence of magnetic field to observe hysteresis effect using the metropolis algorithm.
While the code runs and gave me a desired output, it is a badly written code(I feel so) because of my lack of coding experience. Could you help me out... |
I have been developing a cross-platform game based on open C libraries (mainly glfw) with a direct focus on Windows development. The beginning of my programming career taught me familiarity in Objective-C, however I've been using pure C for the past few years in embedded applications.
Now that I'm trying to return to ... |
I referred to the post here but it does not address the question that I have with regards to my implementation. I have a C# implementation of an in-memory database that I came up with during a recent interview. I was told that my code was okay in terms of getting the job done but could be more efficient dealing with tr... |
I have created a program that calculates pi using a Monte Carlo method. It also animates the process and displays the value as it is updated to show how it gets closer and closer to the actual value as more time passes. It is made with HTML canvas. I would like some feedback on my program.
"use strict";
function hy... |
I've tried to solve the kattis-challenge called Watchdog. My code works just fine, but it was too slow on the last test. I'm wondering if anyone sees any big algorithmic performance issues.
A short description of the task: First line from .in states number of test-cases.
First line in each test-case gives length of a ... |
Exercise 6: Rewrite the program that prompts the user for a list of numbers and prints out the maximum and minimum of the numbers at the end when the user enters “done”. Write the program to store the numbers the user enters in a list and use the max() and min() functions to compute the maximum and minimum numbers aft... |
I have built a basic shopping cart simulator. All it does is add and remove items between two different basket (i.e. aisle vs basket).
While working on the problem I started to think about the approach and would love to hear what people think.
Avoid initializing the state empty state in the constructor. However, I had... |
I have a small C# program that validates Swedish social security numbers ('Personnummer').
I chose to use Regex as there are many different ways it can be input.
using System;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
namespace Personnummer
{
/// <summary>
/// Class u... |
I have written this custom hashset and though it isn't completed yet, I would like to know if there is anything I am overlooking in terms of clean code conventions. My aim was also to apply generics to it. So, would also want any input regarding that.
public class CustomHashset<T> {
private static final int SIZE... |
Originally asked on Stack Overflow
I recently had an interview where interviewers asked me to
Rewrite following code with SOLID principles.
Add a new file handler (PriceFileHandler for example).
Add supporting stream parsing (to one parser implementation)
Here is the code which I had to change:
<?php
class FileHandl... |
I have an assignment to solve this problem. However, I have exceeded the time limit required, can anyone suggest where to improve my code?
Cats like to sit in high places. It is not uncommon to see cats
climbing trees or furniture in order to lie on the top-most area
within their feline reach. Rar the Cat is no ex... |
I must to model Document class. I receive document as bytes array.
I can receive pdf, zip, text and xml documents. After few operation I must store documents. If document is in xml format I can get some nodes or transform it by xlst and then store.How can I improve my code? Is it good idea to use here builder or factor... |
I tried to solve a symmetric tree problem
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1
/ \
2 2
/ \ / \
3 4 4 3
But the following [1,2,2,null,3,null,3] is not:
1
/ \
2 2
\ \
... |
This is my rewrite of the program posted here, based on janos's comments. I also added the ability to read from stdin.
I've also included a test script. I wanted something lightweight I could easily re-run, but didn't want a dependency or full test framework like bats. Comments on the test script are also welcome.
N... |
I would like to optimize the below traceback function. This function is part of an elementary step of the program and is called a lot...
import numpy as np
def traceback(tuple_node, tuple_node_alt):
"""
Compute which value from tuple_node_alt comes from which value from tuple_node.
Return a dictionnary whe... |
The task:
Given a list of elements, find the majority element, which appears
more than half the time (> floor(len(lst) / 2.0)).
You can assume that such element exists.
For example, given [1, 2, 1, 1, 3, 4, 0], return 1.
My solution:
const lst = [1, 2, 1, 1, 3, 4, 0];
const findMajorityElem = lst => lst.reduce((acc... |
I have some code, that works fine. However, I know there is a lot of code duplication and C-style programming. In the code example there only is a DeviceOneDispatcher, in reality there are more child classes and case options.
The question is how to optimize/refactor this code best following c++11-c++17.
I believe a b... |
This code that I wrote is supposed to read/write a pipe-delimited file line by line to a new file with some simple text manipulation. (It also adds two new columns) and publishes a "Status Update" ever 100,000 lines to keep me updated on how close it is to completion.
I previously posted this code on StackOverflow to ... |
I'm new to Python and I just finished a school assignment where I had to make a tictactoe game with focus on OOP. I would love to get some pointers on how I can clean up my code (especially my Tictactoe class) as it's pretty messy right now.
What I've done so far is comment as much as possible to make it understandable... |
I'm trying to find the local maxima in a 3D numpy array, but I can't seem to find an easy way to do that using numpy, scipy, or anything else.
For now I implemented it using scipy.signal.argrelexrema. But it's very long to process large arrays, and only works on separated axes.
import numpy as np
from scipy.signal impo... |
I've recently answered a question about reading elements from an array of arrays. A way it could be interpreted is that the OP wanted to read a range that could span over multiple subarrays of the 2D array like so :
let a = [["5", "3", ".", ".", "7", "."],
["6", ".", ".", "1", "9", "5"]]
a.lazy.flatMap{$0}[1.... |
I have an ASP.NET Core controller I am creating. The controller endpoint looks something like this right now:
[HttpPost("")]
public async Task<ActionResult<Thing>> AddThing([FromBody] string otherThingId)
{
// First I perform some validation here (null check, proper ID, etc).
// Next I get OtherThing to make... |
This is a first version of an implementation of std::optional it is supposed to compile under C++14. The public interface of the class is complete, but there are still quite a few things missing. Only a few of the constructor availability traits are checked, none of the noexcept clauses are implemented, no non-member f... |
I found some months ago that I could generate Hamming multiples of 3 and 5 multiples (3^x & 5^x) in one list comprehension. There are many fewer 3 and 5 Hamming multiples in a Hamming sequence. I did not have to be concerned with duplicate multiples as it is 2 disparate lists.
All I needed to do was add the Hamming 2 m... |
I have a set of classes that have similar funcionality but very different interfaces. I created two interface classes with polymorphic methods so I can operate over then. When creating calling the methods, I have to pass a set of parameters, in this case a JSON file, that is also different for each class. Is there a wa... |
This is just a little number guessing game. I know it's simple but I am a newbie in C and I think such a little example can be enough for finding simple design flaws that can than be eliminated.
If you know how parts of the code can be written more beautiful and more safe, please let me know!
/*
* In this program the ... |
This is a problem I find a lot!! Can I achieve this goal without consuming so much time?
My code below achieves what I want it to achieve. However, I believe it could be a lot more efficient and Pythonic.
PROBLEM:
I want to extract summary data from a larger dataset and I only know how to do so utilizing nested For lo... |
A user wrote an issue asking if inside the bio (or any arbitrary tag), any tagged accounts can be automatically linked like on Github.
I gave them this function:
<script>
let bio = "The coolest company to work for is @github! There is also @aws and @microsoft.";
let linkedBio = "";
let found = false;
... |
I'm setting up new API to Setup LocalAccounts and need your advice on how to design the API with CQS
some background :
LocalAccount Is Account that related to private customer or corporate customer and contain Debit or credit Account details with one or more cards (plastic and 1 virtual )
Example of LocalAccounts : Pr... |
One of my friends was creating an app with following requirements and having been someone with slightly more coding experience, I wanted to help:
Create a calculator that does one arithmetic operation at a time and
prints the result to the screen.
Prompt the user for a number.
Prompt the user for an operation (+ - ... |
Given a dictionary where 1:a , 2:b ... 26:z. I need to find all the possible letter combinations that can be formed from the three digits.
Either each digit should translate to a letter individually or you can combine adjacent digits to check for a letter. You can't change the order of the digits. For example -
121 tra... |
It is my first use of classes in Python. I wanted to create something useful and try some new things as I learn this cool language: strategy pattern, testing with nanoseconds precision, curve/poly fitting, and making a graphic presentation. The budget was 150 lines of code: 50 for five Fibonacci number calculations, 50... |
I wrote a solution to the Mali problem on Kattis:
Given inputs a1, a2, a3, …, an and b1, b2, b3, …, bn, determine n pairings (ai, bj) such that each number in the A sequence is used in exactly one pairing, each number in the B sequence is used in exactly one pairing, and the maximum of all sums ai + bj is minimal.
Inp... |
I am trying to solve this question:
Given a list of integers, verifies if any two numbers from this list add up to another number in the same list.
I came up with:
def func(l):
sum_set = set() # using a set to store sums of two numbers.
for index in range(len(l)-1):
counter = 1
while counter ... |
I was given this problem in a mock interview. I would appreciate a review of my implementation.
Shortest Cell Path In a given grid of 0s and 1s, we have some starting
row and column sr, sc and a target row and column tr, tc. Return the
length of the shortest path from sr, sc to tr, tc that walks along 1
values ... |
I am trying to consume a REST endpoint by using the RestTemplate Library provided by the spring framework.
The endpoint also demands a Bearer Access Token as its authorization header, which is only obtained as the response from a user authentication endpoint, which in turn expects an encoded Basic Auth in its Header.
T... |
I have this algorithm that generates waypoints to fly over a specified area.
I would like to get some feedback to the coding inside the method, not about the structure of interfaces, I think this is pretty good here.
Despite any feedback is appreciated:)
public class RectangleWaypointGenerator implements WaypointGener... |
The problem is this:
A company supplies widgets in a set of pack sizes:
250
500
1000
2000
5000
Customers can order any number of widgets, but the following rules apply:
Only whole packs can be sent and …
No more widgets than necessary should be sent and …
The fewest packs possible should be sent
Some examples showi... |
I use this to set language session for navigation. Someone said that this switch is too cumbersome. Why? Is there an easier way?
$defaultLang = 'it';
if (!empty($_GET["lang"])) {
switch (strtolower($_GET["lang"])) {
case "en":
$_SESSION['lang'] = 'gb';
break;
case "tr":
... |
This is the "Increasing Number problem", where we are looking for all numbers with \$n\$ digits where each digit is bigger than the digit before it. Or in Mathematical therms where:
$$\mathit{IncreasingNumber} = c_n \times 10^n + c_{n-1} \times 10^{n-1} + \cdots + c_1 * 10 + c_0$$
and \$c_i < c_{i-1}\$.
Examples: 1234... |
Since my last question related to this I have managed to create a working base and to understand how MVC works.
I'm writing RESTful APIS in PHP, they serve the purpose but I see that my code is repeating.
For example, for each action, I have a controller, a service... etc and a lot of that code can be reused not that ... |
I recently had to code an algorithm that will, for an input of: matrix of up to 5x5 size and a defined path length, find a path of this given length from the first top left matrix element (0, 0) to the last bottom right element (n, n). The desired path is the one which maximizes the sum of matrix elements along the pat... |
I saw this question and wondered how it'd be best to accomplish this using Ramda.
I'm new to the library so I thought it'd be an interesting learning exercise.
I have a working solution but it seems overly complicated and verbose. I'd be grateful for any suggestions on what other ways it would be possible to achieve th... |
I created a very simple multiple choice math practice game in C for a fun project. Essentially the user first enters how many questions they want, then they enter what operation (+, -, *, /) they want to practice. The game then presents a set of 4 multiple choice answers. The user enters which choice thy think is corre... |
As part of an insurance claims system we have created, the claims managers can log incoming telephone calls relating to a claim.
The claims manager must validate the caller by asking a number of 'Data Protection' questions that are generated dynamically from information stored against the claim in a database. I believ... |
I implemented a Hangman/guess the word clone in Python. This is my first attempt at making an actual interactive app instead of just a list of functions or a static program. It is also the first time I try to actually implement classes since I've been having a hard time wrapping my head around them. It's probably not t... |
Generate a linked list of any type using macros. The linked list contains functions for adding and removing elements to both ends and also at the middle. You can also add elements relatively to a list node. It also comes with an iterator that can go back and forwards through the list.
Macros that generate a linked list... |
The "nasty implementation" I mentioned is within the void calculator() inside of calculator.cpp. Everything goes well as long as user don't type in the erroneous syntax. But I think this isn't the good idea to implement it this way.
Can I do it the other way around with more reasonable implementation without losing the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.