instruction
stringlengths
71
95.1k
For a Django-Server I use several custom Error-Codes, error-titles and descriptions, possibly other fields might follow. I'm using right now a basic global dictionary. errordict = {'512': { 'errorno': 512, 'errordescr': "Database Down", 'toDo': "Restart the database, Server: "+serveradr ...
I am trying to implement message encryption/decryption with password in java. Here is the code I'm using: import java.security.MessageDigest; import java.security.spec.InvalidKeySpecException; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; impor...
Here's my open source project: https://github.com/Skewjo/SysLat_Software. The hardware controlled by this software can be found at https://syslat.com/. This is the 3rd question in a series of questions to get the code production ready. The other questions are Tuning the data class 1 the follow up to the tuning the data...
I have several static variables in my dialog class that I'm declaring in the header and then defining immediately in the cpp file. They are being used in an application with 2 threads, and these particular variables are mostly shared between both threads. This is the fourth question in an effort to get the program read...
A Few years back I used to opt the below method to run the shell program in a Parallel way to open multiple ssh session at a time to get a quick result. I know there are various other good utilities available, however due to some pressing needs I've to use this way, this dirty piece of code works well however I would l...
I'm currently working on an uncrafting tool for minecraft and got a neat output working that shows all the materials needed in a tree. I wonder if the code used to print that tree could be improved somehow. I only have the recursion depth as a measurement and the ArrayList gets filled in the same order as seen in the i...
I'm not very experienced with OOP and Python and I've been wanting to kind of professionalize my way of writing code, etc. My question is; in what departments can I improve? Main.py (how I interact with the other files/classes) from datetime import datetime, timedelta import coins import plot end_date = datetime.toda...
Application context I am working on a game I call "Apes and Snakes". So far the code only allows players to connect to a host using a room code and WebRTC. Players and the host send messages back and forth to each other over WebRTC. When a player receives a message, it is passed to a "handler". This kind of pattern is ...
I have two dataframes I need to map over and combine into one. The first data frame contains NBA players. The headers are 'Date', 'Player', 'Team', 'Position', 'Salary', 'Pos_ID', 'Minutes', 'FPTS', 'USG'. I then have a second dataframe that's the first dataframe but grouped by date and team. The headers for this df ar...
This question is an extension of this other question from Stackoverflow. The objective is to limit the input of characters read by fgets to up to a certain number of characters. And in the following code, that I've come up with as a solution, we are working with a limit of 10 characters as an example: #include <stdio.h...
I have a nested object and I would like to calculate the number of times the property 'error'. I am able to go n levels deep and find the count. Is there a better solution than mine? const data = { "item1": { "value": 88, "error": false }, "item2": { "value": 651, "error": false }, "item3": ...
I know embarassingly little about asynchronous programming in C#, so decided to start catching up. It would help me a lot if anyone checked this basic example I've created. Assumption: we're creating a simulation where the time passes turn by turn with predefined minimal interval, e.g. 1 second. However, if any importa...
I'm trying to teach myself assembly via MASM, below is my first implementation of the recursive form of the fibonacci sequence. I timed it against an equivalent C implementation in release mode and the C implementation was much better optimized. What can I do better? I haven't gotten the hang of how the various side ef...
Wrote a function to calculate the square root. Magic from: https://tour.golang.org/flowcontrol/8 The result is almost always the same as math.sqrt. Difference percentage is always around 10%. All difference (if any) is almost always in magnitude e-10. How can the function be more accurate? Does is even need to be more ...
I'm doing some work with Vulkan, in this I need to pass a set of values of various types. Currently I'm using std::array<std::variant<>> in my interface, but I must pass Vulkan a void*. To convert to the void* I use this function: template <uint32_t Size> void* voidArray(std::array<std::variant<uint32_t,float>,Size>& a...
I have this rails controller which works fine but a lot of business logic is confined in the controller which I believe is not a good practice. class MoviesController < ApplicationController before_action :set_movie, only: [ :edit, :update, :destroy ] rescue_from ActiveRecord::RecordNotFound, with: :render_404 ...
I am trying to make logger class with debug, info, warn and error methods that "extends" basic log method. However it is not written using DRY principle, how can I make it DRY, not WET? Code snippet const logLevels = { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error', 'debug': 0, 'info': 1, 'warn': 2, 'er...
I have a question about something maybe not so much important, but every time when I have to decide, I feel it can write in another way. Imagine I am developing and system about authentication and then I have to receive a pin after sending my phone number. So I am writing some UseCase and, in this case, I have an inter...
I'm beginner in django and python. I have models : class Employee(models.Model): full_name = models.CharField(max_length = 64) title = models.CharField(max_length = 64) def __str__(self): return f"{self.full_name} ( {self.title} )" class Skill(models.Model): name = models.CharField(max_length...
I want to be able to persist context to local storage. My router looks like: import React, { useState } from 'react'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import { Login } from './routes/login'; import { ResetPassword } from './routes/reset-password'; import { ResetEmailSent } from './routes...
I created this tiny script to full fill a repeated request from audit. I want to expand it but ran into an issue with file creation. This code will create the $attachment in the directory it is run from. When using ISE it stores the $attachment to the system32 folder. When run from the script repository it leaves the f...
I have a bunch of large XML files that I have to parse and store in Postgres. I have done a lot of procedural code but I want to think in terms of objects and reap the benefits. Any help in that direction is greatly appreciated. The XML itself is fairly straightforward - Each Person object has employer, employer office...
Pretty simple 2-Dimensional Vector template with operators and two utility functions making use of C++20 concepts. Header-only templates, function inlining and operator overloading, etc. is not exactly my strong foot, so that's why i wrote this hoping to get some feedback. #pragma once #include <cmath> #include <type_...
I need to read a vector of e.g. integers from a stream, usually from stdin but sometimes also from a file. The input is always less than a megabyte, and is sometimes separated by commas and sometimes by newlines. I'm calling the code directly from my main function, so I'm more concerned with returning a human readable ...
def MinimumSwaps(Queue): MinSwaps = 0 for i in range(len(Queue) - 1): if Queue[i] != i+1: for j in range(i+1,len(Queue)): if Queue[j] == i+1: Queue[i], Queue[j] = Queue[j], Queue[i] MinSwaps += 1 ...
Compiler is g++ 4.2. I'm new to C++, but I've done a lot of data science, web scraping, and some socketing stuff in Python. This code generates the nth Fibonacci number, either with a naive implementation or with caching. #include <iostream> #include <string> #include <unordered_map> #define BIG unsigned long long int ...
I am making an RPG game using python. At the moment, I have programmed choosing your character and saving it. However, today I previously asked a question NameError: name 'character' is not defined on stackoverflow. Whilst I got my question answered and my program is now working, I received a comment on my question (fr...
How to choose the dark mode properly? {isDarkMode ? <ImageBackground source={require('../Images/bgndDark/bgGradient.png')} style={styles.container}> <Charter isDarkMode /> </ImageBackground > : <Charter isDarkMode={false} /> } Just feels wrong to duplicate "Charter"?
So I'm making a strlen function and I thought I would use SIMD instructions for it. It runs fine but when comparing it to std::strlen(), it falls a lot behind. Any ideas on how to make it faster would be much appreciated. inline size_t strlen(const char* data) { const __m128i terminationCharacters = _mm_setzero...
I am working with System.Array and I am trying to convert System.Array objects to array of specific type (such as int[]) in C#. A series of array downcasting methods is designed as follows. The experimental implementation The experimental implementation of array downcasters are as below. class ArrayDowncasters { pu...
I have a list of points (System.Drawing.Point) obtained from an edge finder function that scanned a bitmap for objects. Each point is guaranteed to be a part of an edge line. I need to split the list into a collection of lines so additional math can be performed on them. This is how I originally split the list: publi...
I have been testing a number of kernel builds and I decide to have a go at writing some Python code. The idea is to select which kernel to boot on the next reboot. I could have done it in Bash but fancied a new experience, hence I had a go at Python. I've been testing under bash under Linux(Debian) Would love some feed...
I wanted to build a Inverse Document Frequency function, because in my opinion was not easy to do with scikit and I wanted also to show how it works for educational reasons. Also reading this question on stack. So I build this function. It works, not sure about the efficency of my solution. Let me know what do you thin...
Overview of the Question I would like to ask for performance/scalability feedback on an R function that I recently wrote. I have a large 4-column dataframe (the lookup_dataframe; i.e., output of a simulation study). The first column contains an integer value and the other three columns parameter values that correspond ...
I run into a performance bottleneck in a program. I have to generate all permutations for a given sequence with size up to n=11. My code: #include <algorithm> #include <chrono> #include <iostream> #include <numeric> #include <vector> int factorial(int n) { if (n == 0) { return 1; } return n * facto...
Since Easter holidays are close, I have decided to develop my Android skills by writing an Android app that calculate that date for the Western and Easter calendars. The formulas were gotten from the Internet. It is a simple app where, you enter the year and you get the dates for both calendars in a TextView, I've use...
I have built a machine that juggles. An Arduino sends signals to stepper motor drivers that drive NEMA 23 size stepper motors. Video of the machine: https://youtu.be/-9zD_8erkck Currently, each arm makes one revolution and then pauses while the other arm makes one revolution. One arm starts before the other arm comes ...
I have tried to remove the duplicate elements from the array using c language, here I am using 3 for loops to remove the duplicate elements. How can this optimize the code? Are there any other simple methods to remove the duplicate elements? Please help. #include <stdio.h> #define MAX_SIZE 100 // Maximum size of the a...
I just completed Pset 2 about the Hangman game that was issued from OCW MIT. The Pset has no available solution so that any comment regarding code writing best practices would be greatly appreciated (especially about defining functions and linking them to each other). Thank you and have a nice weekend y'all. # Hangman ...
Here's the code I am trying to refactor. The same Http client is being used in each nested try with resource. I don't understand the rationale behind nesting client.execute() calls. The code tries to Post data to an endpoint if resource is missing and retries to Post to a backup endpoint if earlier call fails public vo...
I'm a fairly new programmer and have been learning c++ for about 8 months now. I've written a program that can take either binary, hexadecimal, and decimal inputs and convert them to the other two values. For example, if the user inputs a binary value, then the program will output both decimal and hexadecimal conversio...
This is a program which you can get the next "different", i.e. elements in A[] can be identical, permutation at each call. I've written a C++ program for the same purpose in 2018, but I found it unreadable, readability = NULL, so here is a new one. Any critical comment and answer will be welcomed :) next_different_perm...
I would like to use Julia to compute the hamming distance on a very large dataset. I need to get back a distance matrix between rows in order to run further analysis on this matrix. For my purposes, it is useful that the data are stored in a DataFrame type. using DataFrames The data looks something like this a = [1 0 ...
I was trying to code the phone keypad characters with its numbers. The first idea which came to my mind is using a HashMap. After trying various options I came up with the below Code. I want to know if the data structure and methodology which I implemented is good or does it need some more improvements. Things which I ...
I have the following code: const arr = Array.from({length: 5}, (_, i) => i + 1); const finalArray = []; for (let i = 0; i < arr.length; i++) { for (let j = 0; j < arr.length; j++) { finalArray.push(arr[i] + '-' + arr[j]) } } console.log(finalArray); Which creates an array of range 1 => 5, and returns...
The following script upgrades an existing, all core (no add ons) MediaWiki install. I run it with set -x for debugging (I avoid set -euo because I often run this script line by line and/or block by block and in case of typos or problems this terminates the session, which I don't want to happen). I have double tested th...
I was trying to make a sorting algorithm for an array of integers. Here's are the steps/theory: It turns an array into a HashSet, iterates over every integer value from the minimum value in the array to the maximum. It carries an array that starts with 1 element, the minimum. While iterating to higher values through in...
def T(n): if n <= 0: return 1 else: return T(n-1) + (n-1) * T(n-2) print T(4) I need an effective way to print out the output of the function T(n) generated using the recurrence relation above. Is there any way to make the above code more efficient? Sample output: 10
ApplicationDetail.txt: URL: https://www.abc.com applicationNo : 123456 Application Class: from dataclasses import dataclass @dataclass class Application(object): """ Binding Json Data to this Class """ Status: str ApplicationType: str StatusDate: str Location: str LocationDate: str Confirmati...
I'm a C noob and I'm learning about concurrency using C. I came across an exercise in a book asking me to find the approximate value of Pi using the Monte Carlo technique with OpenMP. I came up with the following: #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <math.h> #include <omp.h> int in_cir...
For an (completely optional) assignment for an introductory course to programming with C++, I am trying to implement a diagonal matrix-vector multiplication (?diamv) kernel, i.e. mathematically $$\mathbf{y} \leftarrow \alpha\mathbf{y} + \beta \mathbf{M}\mathbf{x}$$ for a diagonally clustered matrix \$\mathbf{M}\$, dens...
Below is my solution for the CTFP chapter 4 challenges which essentially involves composing partial functions (that don't have defined outputs for all possible inputs i.e. returning a Maybe). The challenge is to implement composition, identity(to satisfy category requirements) and try it out with 2 partial functions. A...
I'm trying to solve the problem given here. Arrange given numbers to form the biggest number | Set 1 Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are > {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers a...
I have been trying to improve my knowledge with Python and I think the code is pretty forward. However I do dislike abit the coding style I have done where I use too much try except in a content there it might not needed to be at first place. My goal is basically to have a ready payload before scraping as you will see ...
I made an brute force algorithm to find the longest palindrome within the string. This palindrome is a substring of the input. Below is the code. def generate_substrings(string): """ avg time: O(len(string) * len(string)) avg space: O(1) amortized time: O(len(string) * len(string)) amortized...
Similar to Partial Function composability in Haskell, I've attempted to implement partial function composability in C++20 via C++ concepts. More details about the problem(for which my solution is available below) from the linked post: Below is my solution for the CTFP chapter 4 challenges which essentially involves co...
atcoder.jp Problem Statement: There is a grid with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left. For each i and j (1≤i≤H, 1≤j≤W), Square (i,j) is described by a character \$a_{i,j}\$. If \$a_{i,j}\$ is ., Square (i,j) is an empty s...
My java code for CSES Introductory problem Number Spiral gives TLE for large inputs, like Input : 100000 170550340 943050741 121998376 943430501 689913499 770079066 586095107 933655238 … (First line/number being the number of inputs) My code is as below: import java.util.*; public class numberSpiral { public static...
Please can you check if the code I have written follows 4 rules of OOP well enough, if there is anything that could be improved or is just wrong I am happy to change (very new to C# sorry if it's awful). The code implements the "Dhond't Method" which is a polling system. https://www.bbc.co.uk/news/uk-politics-27187434 ...
I am styling my react native component according to some conditions, here the code, The question is how do I make this cleaner? functional style? const configColors = (isSingle, isDarkMode) => { let colors = {}; if (isDarkMode){ colors = { ...colors, configAxisLabelColor : Colors.white, confi...
I have recently tried converting a singly linked list from a C program into my own python program. I have tested the code myself but I am still unsure if the program has been converted properly. I would like someone to peer review my code to see if there are any errors in methodology, too many methods, any missing meth...
I'm trying to solve the LeetCode question where you need to find out the area of the container with the most water. I have created the solution that seems to work in my testing but it fails for being too slow when I try to submit it on LeetCode. My idea is that I create a dictionary of (x, y) tuples from the input list...
This function adds up an array pairwise. It runs fast enough and appears cache-friendly; I've tested it for correct output. It's in C++ (farther down in the file there's a function that takes a vector), but looks like valid C as well (but I haven't tried it in C). How easy is it to understand? double pairwisesum(double...
Given a square grid of size N, each cell of which contains integer cost which represents a cost to traverse through that cell, we need to find a path from top left cell to bottom right cell by which the total cost incurred is minimum. From the cell (i,j) we can go (i,j-1), (i, j+1), (i-1, j), (i+1, j). Note: It is assu...
Module for generating a PWM signal. The req_value_i input gets a duration value of the signal. Furthermore, the module can be stopped by deassertion of the enable_i input. `timescale 1ns / 1ps module pwm # ( parameter integer PWM_COUNTER_WIDTH = 8 ) ( input logic clk_i, i...
//Program To Input Values Into An Array And Sort Them In Ascending Order #include<stdio.h> //Function To Print The Array Values void print(int tab[],int n) { int i; printf("The Values Are : \n"); for(i=0;i<n;i++) { printf("%d ",tab[i]); } printf("\n");//Line Jumping For Better Output...
I am practicing Rust by creating data structures, such as this N-dimensional array. The purpose of this structure is to easily define and address into arbitrarily-deeply nested arrays without having to write out Vec<Vec<Vec<T>>> and incur the performance penalty coming from this (although performance is not a priority)...
I am implementing a class to mimic dynamic array as a part of my learning process of data structures. I have written the following class which works as a dynamic array data structure. I have gone through some video tutorials and also read some code from Java's ArrayList implementation to understand how to code it in a ...
You probably know the following problem: You have written a small program that runs in your console and want the user to enter something. of course, it is very inconvenient when the user types the wrong things, so we have to prepare for any small child hacking like a madman on the keyboard. Most functions wait for a va...
I am working on a Reinforcement learning project, where I have to gather a lot of data using a TensorFlow model. During the data gathering, the weights of the model do not change. So, I am using concurrent.futures.ProcessPoolExecutor to parallelize this work-flow. The following is an MWE of my implementation. import te...
I created the following function, permutations, to produce all permutations of a List[A]. Example: scala> net.Permutations.permutations("ab".split("").toList) res3: List[List[String]] = List(List(a, b), List(b, a)) Code: object Permutations { def permutations[A](str: List[A]): List[List[A]] = str match { ...
I am working on a part of an IoT project where I have been given a task to develop a mechanism to store data locally when there is no network coverage or if the network is down for some reason. Our application is architected such that, every hour we store the feed/sensor data to a bucket i.e.local storage and we have a...
I've created program like in the title. Actually I know I could use regex to create pattern and then do some actions from it, but I think my code is clear enough (at least for me :P). There is a little thing to correct which is InputMismatch exception that isn't handled. What do you think about my code? import java.uti...
I'm a beginner programmer and i'm looking for interesting projects to improve my low skills. I tried one day to improve my skills by trying to create a small game in which a user owns a cat, and has to feed it and clean it. My main aim of the game(which yet has many illogical things like the never decreasing happiness ...
I am writting an API backend application using .NET Core and Visual Studio. Here is the solution structure: [ProjectName] - Solution [ProjectName].API - API project containing Controllers, DTOs, AutoMapper etc. [ProjectName].Core - Class Library project containing services and business logic [ProjectName].Data - Class...
I have a 2D array of fixed size and I've implemented a FIFO function. So, the array will always be full before it reaches the FIFO function, then the FIFO will remove the oldest array, move all of the arrays up by one and then add the newest array to the other end. Basically a queue. Now, this code will actually be run...
Six month ago I started studying C as my first programming language and a couple of weeks ago I decided to write snake as my first program. The program is written with ncurses and contains four modules: main, layout, controls and gameplay. I haven't added any features yet (score, pause, welcome screen etc.). Since it i...
This is a modification of my previous version. I would like advice on improving a FIFO algorithm for a 2D array that I've developed in ANSI C. I have written code that uses this algorithm for test purposes. Random numbers are put into an array until all elements are full. The program then asks the user what numbers nee...
Some methods of this library require some improvements (see this description): In the constructor I am trying to create the possibility that the user modifies the colors of the output. I think it can improve but I do not know if there is any standard or good practices in this regard, or if there is any way to optimize...
I'm working on an app to compare SDKS (their churn and acquisiton rates). I have created an API with two separate endpoints. The first, compares one sdk to ther other and spits out that data for each sdk. The second, simply gets general information about a single sdk. I'm merging these objects into one, so that all inf...
I would like to know if my registration system is secure. I'm not sure if it is secure, as I'm new in development, and I'm afraid that the system is flawed Also, I'm not experienced in object oriented programming, I would like to know if my script looks a bit like OOP or is simply a set of procedural programming with o...
I have an implementation of an edit text to show line numbers and also highlight the current line. I think it needs more optimization because when I scroll through the edit text with about 500 lines of code, it lags, yet when I comment out the code, the scrolling is smooth. I need help optimizing this onDraw method in ...
I've made a Discord bot, and (to my knowledge) the code is pretty good. However, I've mostly taught myself Python and discord.py (the discord library for Python), so I was wondering if there's any improvements to be made. The only thing I can discern right now is that I could probably do with a few more comments, but o...
First, this is my first post on this stack exchange site. So please be patient with me. If there is something wrong or you miss something, please let me know. I will add it asap. I am currently working with the SOLID principles and trying to achieve a practical implementation. I have seen Tim Corey's practical videos o...
Here's an RPG I'm working on that uses only standard C++ libraries. I'm having trouble conceptualizing a coordinate system for characters spawned in a map, and the inventory/item system is only a shell at the moment. However, I've created a small demo including some of the features that will be present in the full prod...
I am a beginner coder and was wondering how to improve my c# console code. It makes a tic-tac-toe game. using System; namespace TicTacToe { class Program { static string[] options = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; //stores the variables to change static bool Playing = true;...
I love the "projections" introduced by the ranges library, and I would like to use them in algorithms that haven't been rangeyfied yet. I had the idea of using them through a function like this: #include <utility> #include <functional> template<typename TFn, typename TProj = std::identity> auto constexpr proj(TFn &&Fn...
Similar Word Finder I created this similar word finder for fun. (word.txt are words from http://www.mieliestronk.com/corncob_lowercase.txt) Is there any way to make this better or more accurate? import java.util.*; import java.io.*; class Main { public static void print(String text, int times) { for (int i...
I put a backtracking algorithm around the Farmer, Wolf, Goat and Cabbage problem - to see if there are any interesting branches, besides the (two) 7-step solutions. WGC Problem: A Farmer with a wolf, a goat and a giant cabbage has to cross a river on a tiny boat that can only carry him plus one of the three cargo loads...
My first client-server application. It's a simple Python script that gets a list of running processes from Server_1 and writes it to a datetime-named file on Server_2, every 5 seconds. I am planning on refactoring this code into one or two functions, maybe one for securing the connection and one for implementing the lo...
I have a simple task. Array of people object comes in, up to a thousand. Need to iterate over it, and create a custom payload for external service. I have created a working solution, but I would like to see if I am totally off course, and what changes should I make. I have reduced non-important details from the code ...
The program transfers a data array from a Zynq-7000 PS DDR to a BRAM IP (block RAM) memory in a PL part of a FPGA due to a PL AXI DMA IP. Inferring a xilinx axi dma driver (not scatter-gather mode), an interrupt controller and the vendor's printf function the data array is carried from the DDR to the BRAM. main.c #incl...
Problem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find" minute 0 15 30 45 hour 0 day of month 1 15 month 1 2 3 4 5 6 7 8 9 10 11 12 day of week 1 2 3 4 5 command /usr/bin/find Code /...
In order to learn Rust I'm going through The Rust Book and did the implemented a program for the following exercise: Print the lyrics to the Christmas carol “The Twelve Days of Christmas,” taking advantage of the repetition in the song. I have decided to use lookup tables for the repeating lines of the song and ordin...
I have been working on a function which I call report. What it does is that whenever I call the report function. I can give it a payload of my dict with some data and as well as reason where I can have custom message or the exception errors of whatever can happened. For now I have created something simple where I creat...
I've just started doing programming problems. https://icpcarchive.ecs.baylor.edu/external/58/p5880.pdf The code below works fine, but my run time is 2.715 seconds and the time limit is 3 seconds. How can I improve speed of this code? I've already started to use sys.stdin instead of input(). import string import sys w...
What do you think about this assignment "idiom"? template <typename ...A> constexpr auto assign(A& ...a) noexcept { return [&](auto&& ...v) // noexcept(noexcept(((a = std::forward<decltype(v)>(v)), ...))) { ((a = std::forward<decltype(v)>(v)), ...); }; } It seems a better alternative to me than the st...
I have a simple service class here which import csv or xml file into database using .NET Standard library C#. Do you have any comments? Are there any recommended techniques to use instead of the switch statement in the method ProcessPaymentFile? public class AbcPaymentService : IAbcPaymentService { private readonly...
I implemented an ExpireLRUCache class, which will clear the data when it times out. There are two ways to achieve this: Use a timer to clear the expire data Call the clean function in Add and Get If I use a struct in class, and it use the template typename, how to deal with this? I put the declaration of Node at the ...
Preamble This is an Alarm Clock app. The way it works is pretty simple: you change the time by pressing the +/- buttons and set the time by pressing the play button. When the time is up, the alarm will ring at which point you can stop it by pressing the pause button. This question is already long as it is so I won't be...