instruction stringlengths 71 95.1k |
|---|
Im making this project from few days , and now i need little help because i am struggling.
The task says
II. Define a student booklet class CStudBook that inherits CStudent with a member data container of the student's grades. To implement a constructor with a filename parameter from which to initialize container and t... |
Is there a better way to loop item of an array using forEach and make repeat it using setTimout/Interval or something else?
I need that each item of the array was repeated each value of delay for some time (duration):
const arr = [
{ delay: 1_000, duration: 3_000, msg: "Hello World" }, //repeat 3 times msg for 3 sec
... |
I tried to make a simple recursive web scraper using Python. My idea was to grab all the links, titles and tag names.
Website: https://lifebridgecapital.com/podcast/
Course of Action:
Grab all the tags links from the Website.
tag_words_links(Website) --> [https://lifebridgecapital.com/tag/multifamily/][2]
My script fe... |
I've written a simple LRU cache class and I am trying to make it thread-safe. My thoughts are that I just need to wrap the code that updates the ordered dict in a lock so that if any thread is writing to the ordered dict, all other writes/reads need to wait. Is that correct?
Also, what is the best way to test that some... |
A while ago I decided to start working on a project that will keep me busy for a while and will help me sharpen my programming skills.
I do not underestimate the work behind apps like adobe xd, sketch.app, or figma but I just want to understand how those apps work and if I can do something similar.
The features of an a... |
I'm using MemorySharp to calculate the memory address from a pointer address and then inject values in memory.
The code works perfectly, but I was wondering if this would be the right way. I found a little dirty the way I'm calculating the memory address. Maybe there's a easier way that I'm not able to see.
Any advice,... |
Print all combinations from dictionary which will result in the number N
Input:
Dictionary { “flag”:4.5, “temp”:2 ,”foo”:9} and N = 11
Output:
temp*1+flag*2
flag*2+temp*1
foo*1+temp*1
temp*1+foo*1
code:
public class Combinati... |
I made very simple scripting language (interpreter) in C and now, I want to make my code better.
Here is my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TRUE (1 == 1)
#define FALSE (1 == 0)
#define FUNCTION_COUNT 2
#define MAX_FUNCTION_NAME_LENGTH 247
#define MAX_FUNCTION_ARG_LENGTH 127
#... |
A new version of this code based on the provided advice can be found here.
Latest improvement is found here.
I made a simple ThreadPool implementation in C++ using only atomics ( neither std::mutex nor std::condition_variable were used).
The idea is to have a threads_ready increasing to threads.size() until all thread... |
This is a follow-up question for Image Processing Median Filter in C. I am attempting to create a two dimensional gaussian image like below in C.
The formula is as follows.
The experimental implementation
base.h: Contains the basic type implementation
/* Develop by Jimmy Hu */
#ifndef BASE_H
#define BASE_H
#includ... |
I wrote a file sytem watcher class that is used to monitor file modification and then execute user-defined handler. Other file system events like moving or deleting don't need to be monitored. The usage is pretty straightforward:
const auto watcher = fswatcher.on_modify("file.txt", [] () {
std::cout << "Modifie... |
I want to show the battery icon given the status provided in props. I am trying to keep it simple but without writing too much code, i.e.: . if ... else, switchs statements...
Below code snippet works but it kinda looks forced, not sure.
import {
TiBatteryLow,
TiBatteryMid,
TiBatteryHigh,
TiBatteryFull
... |
First of all, I chose the nearest data points/training examples
import numpy as np
import copy
nearest_setosa = np.array([[1.9, 0.4],[1.7, 0.5]])
nearest_versicolour = np.array([[3. , 1.1]])
and then I labeled negative examples as -1, and kept the label for the positive example.
x_train = np.concatenate((nearest_seto... |
I'm trying to learn how to use logistic regression with Sklearn. After learning the theory, I tried implementing it using the Heart Attack Analysis datasheet from Kaggle.
Here's a snippet of the data:
I tried using just plain logistic regression after one-hot encoding two columns, and I got a score around 50%. The thi... |
What it does
Converts melting point and boiling point from degrees celsius to kelvin
These are in a dict which is in a tuple as no changes should be made to it
No user input
Purpose
Learning exercise to understand classes and OOP
What I need help with
Is this how you do classes?
Is this correct OOP?
Suggest any impr... |
I seek critique on a sorting implementation for a dynamic array data-structure.
Design decisions
Uses the quicksort algorithm.
Uses an optimized XOR swap for swapping the elements. XOR swap doesn't need
extra memory and is optimized to do the swapping in up to 512 bit chunks.
Takes the comparison method as a function ... |
This is a project to pull domain & IP blacklists from various sources and compile them into one list. There are some whitelists included that are applied when a blacklist is built.
It draws blacklist and whitelist source entries from this JSON document. The "rule" that gets applied is intended to reduce list entries in... |
What can I improve in this script? Do I read user's yes/no answers by right way? Should I write bash scripts so that to be compatible with POSIX?
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
if ! command -v zpool &> /dev/null || ! command -v zfs &> /dev/null; then
printf "ZFS ... |
Situation
I'm scraping data from a paginated list on a website to be sent out as notifications.
For the most part we'll only need to scape the first page and handle additions, deletions and duplicates.
When adding a page with items we've never seen before, we just store the page in memory.
local:
scrape: A B C C D E
... |
Motivation: I was solving an array based i/o problem and encountered Time Limit Errors, it was later found that the code for java ran roughly 10x slower than the python implementation.
Question: I would like to know which part of my code failed in the latter implementation (in Java) given that the algorithmic complexit... |
I've been trying to solidify my understanding of the binary number system by writing code. So, I tried to write a function with what I currently understand about the binary system that returns a string representation of the binary number representing the input.
Any feedback regarding how I may optimize the program is g... |
I've decided it would be best to break this project down into several parts. Consider this Part 1(GUI Design).
I'm looking for help making 2 main improvements:
Whenever I make a GUI, its always very repetitive to add JLabels, panels, buttons, adding panels to cards, etc. Is there a way to simplify this?
How can I Impr... |
I got this exercise on a job interview and i'd like to know how can i improve my code.
Exercise:
Create a function that returns a reduced version of a fraction.
Examples
Reduce("4/6") = "2/3"
Reduce("10/11) = "10/11"
Reduce("100/400") = "1/4";
Notes: a reduced fraction doesn't have a lowest common divisor (except 1) ... |
I know this works but I want to improve this code! I don't expect anyone to re-write this but if you have some "try this instead" then great!
import java.util.*;
public class Polynomial implements Iterable<Object>, Comparable<Polynomial> {
Comparator<Polynomial> compare;
private Term head = null;
//A const... |
Edit: An improved code based on feedback is available here.
As a kind of sequel to the previous question, here is an improved version( with clarified naming ). The Idea is the same: An integer threads_ready is increased to threads.size() until all threads are finished with the payload, and then back to 0 when all thre... |
I want to see if there's a better way to write this code, solely in Javascript.
There are two kinds of sets, the first set (C7, T7, C11, T11) have four options in the first select, and then up to two options in the second set.
The second set (14X, 17X) have eight options in the first select, and then up to four options... |
I am writing API code using SpringBoot, Spring JDBC Template etc. In one scenario, I am fetching list of Object from DB and storing it like this:
List<StudentDataVO> studentData = jdbcTemplate.query(sql, new ResultSetExtractor<StudentDataVO>(StudentDataVO.class), params);
Querying is working absolutely fine and studen... |
I'm trying to learn digital design this summer and currently going through this excercise of creating a 32-bit ALU based on this schematic:
Im using the + operator to create an adder, but I need to grab the carry out for use in my carry flag. Should I just hard code an adder instead of using the + operator? I pretty m... |
I am attempting to implement two dimensional bicubic interpolation algorithm in Matlab. The input is a two dimensional array and the output is the interpolated result.
The test input matrix:
input = [1 1 50 50
1 1 50 50
10 5 40 40
30 30 40 50];
The output result:
The experimental implementa... |
I have created a product configurator in VueJS and the whole functionality of it runs on one single function. I've put the word algoritm in the title in quotes because I don't really know if it is allowed that title. Anyhow, I have a feeling that the code I wrote is way to complicated and repeat a-lot of the same state... |
I'm programming a tool in Excel which reads two exported .csv files, performs some calculations based on Dates and Strings and populates a dashboard to be copied into a Google Sheet daily report.
Although the exported data would be no more than 150 rows (across two worksheets), I wrote a small routine to toggle "FastMo... |
I just wrote my first standard neural network with SGD gradient descent in c++, I am really interested if I have done anything wrong or inefficient, suggestions would help me a ton
(There is lots of CSV reading/writing code, because I like to plug CSV's to a website which converts CSV to Line graph to see how is my net... |
I'm trying to perform a decryption operation using RSA. I'm using the PolarSSl library. I have a char array key[] that contains RSA private key like the following,
N = D0C2ACDCF780B1E4846054BDA700F18D567247FE8BC5BA4FBCAB814E619DA63A20F65A58EE89FC0824DC9367C5725BDDC596065F1C8868E99C896F3A0CF7D7F0A785E668F2568F19BAFB8FF3... |
I'm writing a simple function to transform functions by logging the result before returning it.
The function as written by me:
function loggerise(f) {
return function() {
const r = f(...arguments)
console.log(r)
return r
}
}
(fiddle: https://jsfiddle.net/df54npug)
But I'm planning to use it qui... |
I am trying to find a way to pass a partial application as an argument of an other application with no overhead. I think I have find a way to do it (which might be dirty). The templated structure "partial_add" is kind of a partial version of add2. I am passing the type "partial_add" as template argument to another func... |
I am looking for best performance regarding this code point is I don't have a clear idea weather a map integrated in a for loop is a good idea, the problem is the array is a nested object coming from Db that I don't have any control of, could there be a better version ?
the code does the following
the for loop populate... |
I have the following code for the n queens problem described here: https://leetcode.com/problems/n-queens/
;; depth first permutations + early pruning
(define (left-diagonal-attack pos perm index n)
(if (empty? perm) #f
(if (= (car perm) index) #t
(left-diagonal-attack pos (cdr perm) (+ 1 index) n)))... |
After the amazing feedback from these questions; I have prepared a third version of the original posted code.
The Idea is the same: An std::size_t variable threads_ready is increased to threads.size() until all threads are finished with the payload, and then back to 0 when all threads are ready to execute again.
I eli... |
I have a macro written in word for transferring captions written in excel to a corresponding photograph in a word document. At the moment it runs however I am finding that it slows down over time the more captions it has to process. As such it is useful for up to approximately 200 photographs however I need it to proce... |
I tried making a music player with tkinter in python but there's an error about module not callable but I'm not able to fix it. Can someone help?
import tkinter as Tk
import pygame
import os
def __init__(self,root):
self.root = root
# title of the window
self.root.title("MusicPlayer")
# window geomet... |
Github repo
I've attempted a backend assignment in Go from geektrust Assignment Link.
I'm not sure the code that I have written is idiomatic in the go way. I need some feedback on this code based on its extensibility, proper use of data structures.
How can this code be more improved?
Main build function of the project.... |
I needed some help with Flex. I am trying to achieve something like this using flex but I cant seem to align all the items to the left for both. The code I provided below works just fine, but I'm sure there has to be a better way to do it but nothing seems to be working for me.
Here is a CodePen Link for anyone who wou... |
I am creating my first business application. Unfortunately, I do not have anyone experienced in .NET or c# to review my code, and this is my first time not only using SQL, but also creating code in a professional environment. As such, I would appreciate some form of criticism / review of my User class which, so far, us... |
I have the following implementation for the __lt__. Could you please check if it's okay to compare objects like that?
class Record(NamedTuple):
video_id: str
uuid: Optional[UUID]
mac: Optional[str]
s3_bucket: str
s3_key: str
reference_date: date
@staticmethod
def _lt(a: Any, b: Any) -> ... |
I am creating a command in my discord bot to send an announcement to every server it is in, and this is the only way i could think of doing it, but i know there is a more efficient way of doing it.
Can anyone help me in improving this code, as it stand ATM it works 100% (well i have testing in a local controlled enviro... |
I've only just started learning javascript and decided to try and make a simple app where individual countries can be selected, highlighting them, and the name appearing in the top corner.
The code works, but there as a novice I'm sure its far from the best way to do it! One thing I feel isn't the best is using a globa... |
I am trying to implement a small programming language, in Nim, as a way of improving my (close to non-existent) programming skills. The programming language is intended to have IF-GOTO, variables, and the ability to read from stdin. First, I wrote the VM, this thing:
import strutils
#Nim module for string handling
proc... |
I have the following class
class Dob:
def __init__(self):
self.welcome_text = ""
#Computes DOB
def calc_dob(self):
pass
#Get User Input
def get_input(self, msg):
pass
def __repr__(self):
print(self.welcome_text)
total_days = self.calc_dob()
... |
I'm struggling to solve this Kata. My code works but I can't pass because it's timing out. I have googled it and even tried other people's code but still doesn't pass.
Any suggestion on how can I make a faster solution?
The Kata:
https://www.codewars.com/kata/54eb33e5bc1a25440d000891/train/python
My little sister came... |
I got lot of suggestions for optimizing my neural network last post I made, now I wanted to post updated version of it were I got rid of most of performance eaters, now I would really appriciate neural network side help, because last post I only got c++ side stuff, program is working as excpected, but relu network dies... |
The exercise is asking to make wider stripes similar to the previous exercise. I've included the exercise and code from it along with code that I've been messing with to get the desired result.
I know it can be done easily with loops, but the point of the exercise is to use what has been already introduced in the book.... |
I'm don't know much about javascript, but and slowly learning through using other people's code. The below code I'm using is quite repetitive, with the only variance being the ID names. I feel like someone will know (and hopefully show) me how to do this show/hide function better.
$('#C7-Drawer-Shelf-Combo').on('change... |
I manage a fleet of IoT devices.
As for now, GitHub announced that the username-password authentication would be deprecative soon, so I have to change the password on each device to the GitHub access token.
I store the new token at AWS secrets manager. And those are the scripts to extract the new token and implement it... |
I made a small adaptive function that sorts vector:
template<class T>
vector<T> BubbleSort(vector<T> arr, bool (*compare)(T, T)) {
const int arraySize = arr.size(); //Size of vector. Is it ok to leave it const?
//int i = 1 - to be able to swap with previous(i-1) element
for (int i = 1; i < arraySize; i++) {... |
I started reading a book about python two days ago and today I wrote my first code. It's supposed to be a rock, paper, scissors game and from the tests I've done so far it works quite well.
However since I'm new I had to google a lot stuff and I'm 100% sure that there are a lot of things I could have done better, espec... |
As part of my testing, I have to connect to Unix server using putty and execute few unix jobs.
Feature file
Steps for test scenario:
Scenario Outline: Job execution in Unix
Given I logged into unix server
When I navigate to job directory "<job_directory_path>" and submit the job "<job>"
Then I validate job run status c... |
I have some performance critical inter-thread messaging code in C++. Multiple producers, one or more consumers.
Profiling dozens of iterations of this messaging code over several years of development, I'm usually fighting mutex contention. If not a direct mutex on a std::queue, then a heap mutex on the data pointed to ... |
This is a challenge I completed at CodeSignal.
You are given an array of desired filenames in the order of their creation. Since two files cannot have equal names, the one which comes later will have an addition to its name in a form of (k), where k is the smallest positive integer such that the obtained name is not us... |
I have two arrays, arr_of_frequencies and float_array, of the same length — around 500-800k values each. I have to get that down to somewhere between 200 and 300k values per array. Below is the code I've been using so far. It works but it will take around 15 seconds to run, which is about 14 seconds too long.
function ... |
This python program analyzes movie data by finding the average budget of films in a data set - it also identifies films that exceed the average budget calculated.
I need advice on my code in terms of (architecture, risks, opportunities, design) so that I can learn how I can code better & grow my skills.
# List of movie... |
To give a short contextual description: It is a poker game. I plan to add "cards" and a "pot"-object later on and then learn event-driven programming so that I can add a GUI. Essentially the player's placement in the game-objects "player" variable determines their seat.
My main questions are in regards to the placement... |
I made a FizzBuzz program in arm64; I print out the values in hex instead of decimal. This was the first arm64 program I made and I'm looking for advice on how I can improve it.
The code to print out the registers was taken from the textbook: Programming with 64-Bit ARM Assembly Language: Single Board Computer Developm... |
In this python program, I built a ticketing system with functionality such as keeping track of tickets sold and error handling in case there are any invalid inputs.
I need advice on my code in terms of (architecture, risks, opportunities, design) so that I can learn how I can code better & grow my skills.
TICKET_PRICE ... |
I'm getting the highest value and its respective from a dictionary and printing it out for the user.
Even though it's working, I'm wondering if I'm doing it in the cleanest way. Here it is:
People = {'Harry': 20, 'Ron': 19, 'Hermione': 21, 'Hagrid': 54}
print(max(People, key=People.get), max(People.values()))
# Resul... |
I'm new in React and state hooks.I'm trying to make a website about creating booklist and save it to local storage. Also uploading image to cloudinary. My problem is ; when i trying to save cloudinary image url to the localstorage, it saves previous url. I think i have a problem about useState,useEffect hooks but i cou... |
In this python program, I used lists and control flow to allow users to add items to a shopping list and display the list.
I need advice on my code in terms of (architecture, risks, opportunities, design) so that I can learn how I can code better & grow my skills.
shopping_list = []
# Add a function to allow users to ... |
I'm looking for feedback on my solution to the following prompt:
Given an array of ints, return the index such that the sum of the
elements to the right of that index equals the sum of the elements
to the left of that index. If there is no such index, return Nothing.
If there is more than one such index, return the le... |
In my previous question, one of the answers mentioned that I shouldn't be changing behavior based on the Event class
The whole point of classing is that you can get result without having to decide based on instance.
I don't disagree with this sentiment, and figured it was more in the acceptable realm due to Kotlin's ... |
This is a follow-up question for Two dimensional bicubic interpolation implementation in Matlab and Two dimensional gaussian image generator in C. Besides the Matlab version code, I am attempting to make a C version two dimensional bicubic interpolation function BicubicInterpolation here.
The experimental implementatio... |
I have this code, which counts only adjacent letters in a string and returns the count of each letter.
const inputData = [
'aabbc',
'xxxxvvhjh',
'PPPOM'
];
let output = [];
inputData.forEach(str => {
let strObj = {};
for (let i = 0; i < str.length; i++) {
if (strObj[str[i]] && str[i] === str[i - 1]) {
... |
I've written a small rust library that solves rust's problems with using recursive data types (e.g, linked lists).
using the library, you can use RecRef<'_, List>, and use it to travel up and down your list dynamically and safely at will.
It uses unsafe primitives but uses a clever trick to present to the user a safe i... |
I am not very experienced with T-SQL and feel this can be done better. The script changes ownership of all "user" (non-system) databases to sa.
Usage of a dynamic SQL expression seems unavoidable to me. Could I at least iterate the table names in a more elegant way — imperative code looks like a code smell in a SQL scr... |
I want to optimize my code for following question:
A company sells dumbbells in pairs. These are weights for exercising. They receive a shipment of dumbbells weighing anywhere from 1 unit up to a certain maximum.
A pair can only be sold if their weights are sufficiently close: no greater than 1 unit difference.
Given ... |
This is how I handle configuration in my python code, currently, but I guess it might look magic to people, and it is cumbersome to code. How can this be improved? Are there better solutions?
The purpose is to have a general working configuration stored in UPPER CASE in global variables at the beginning of the file. Wh... |
phoneNumberCheck() is using 2 helper function to check if a users input of a phone number is valid.
this is a client side check, if this code is ok should I check the same at the nodeJS back end?
is splitting the number validation function to validate length and another function to validate prefix consider as over en... |
This is my first asyncio/aiohttp web scraper. I am trying to wrap my head around Python's asyncio/aiohttp libs these days and I am not sure if I fully understand it or not yet. So I'd like have some constructive enhancement reviews here.
I'm scraping Spoonflower, which contains some public API's for design data and pri... |
I would like to return or save for later use in the ParallelSums function what I currently have printing out to the console in the findAllSubsetsRec function.
If I pass the ParallelSums function an int array of [16, 22, 35, 8, 20, 1, 21, 11] I currently get the console output from the findAllSubsetsRec of:
22 20 16 8 1... |
For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j].
Given two integers n and k, return the number of different arrays consisting of numbers from 1 to n such that there are exactly k inverse pairs. Since the answer can be huge, return it modulo \$... |
I'm using ManagementEventWatcher to monitoring some process. It works well but I think the code's kinda repetitive. I was wondering what would be the correct way for more than once single process, if I had more than two process it'd become a mess. Thanks!
private async void Form1_Load(object sender, EventArgs e)
{
s... |
I have various texts that are inconsistent in how paragraphs are formatted. Some texts use the <P> </P> tags to specify a paragraph, while others use two break tags (<br><br>). Sometimes the user forgets to close a <p> tag too. Also, a tag could contain whitespace. I need to "normalise" these texts so that they all spe... |
This is a follow-up question for Two dimensional gaussian image generator in C, Two dimensional bicubic interpolation implementation in C and A SubPlane Method for Generic Two Dimensional Data Plane in C#. Besides gaussian image generating and bicubic interpolation, I am attempting to make a C version subimage function... |
I have a test suite that queries a localhost-based server. The server process needs to be running in order for the server to work. The process may be running already for debugging work, but it might not be. If a server process is running, it's probably safe to assume it's the correct one. If we started the process, we ... |
I've just started learning python, mostly by some YouTube videos and other online tutorials.
Now I want to create a dictionary of callables (actions) asking for user input (a hotkey), but the user should also be able to pass more arguments to the actions.
My problem is, that my current solution doesn't seem very elegan... |
I've decided to rewrite the standard library list in a smaller version. This is similar to another question of mine, where my main concern is memory management. I allocate a new array each time the user wants to modify the list. I want to know if there are any memory leaks that I need to plug. I've been liberal using d... |
I was working in a class, but there are a lot of things that I'm not sure if they're a good practice or not. For example, the => instead of the { }. When should I use it? Also, I'm not pretty sure about the keywords const and readonly. For example, uriImage and key it's something that won't change. So, I assume it'll b... |
Here is a coroutine generator class... Just like Python yields. It was a bit tedious to support both co_yield and co_return (should manage the cases flow out of function body and co_return separately) but it works. I wonder if it's okay, especially from the point of view of undefined behavior and memory leaks.
#include... |
I have implemented a simple NFA that recognizes words in parallel. All the code is on GitHub, here.
A main recognizes method tells if a word (&str) is recognized by an NFA. Inside this method, I set up a thread pool and a channel and call a recognizes_in_parallel method.
The recognizes_in_parallel takes a word and a ... |
Created FilePickerComponent recently. I'm new to React/Web development. Could you please help reviewing this code -
export const FilePickerButton: React.FunctionComponent<FilePickerButtonFCProps> = ({
position,
ariaLabel,
ariaDescription,
disabled,
iconName,
toolbarButtonId,
acceptParams,
... |
This is a Python script that generates ngrams using a set of rules of what letters can follow a letter stored in a dictionary.
The output is then preliminarily processed using another script, then it will be filtered further using an api of sorts by number of words containing the ngrams, the result will be used in pseu... |
This is a Python 3.9 script that pulls data from a MySQL database and converts it to a list of named tuples and then passing it to PyQt6.QTreeWidget.
It has to be a list of namedtuples, because I am going to store lists of tags packed in strings dumped from json.dumps in single fields, then using json.loads to unpack t... |
No problem yet with the code.
Here is a function that can be saved as add in and used as UDF in Microsoft excel to convert a number to text. For example, 4556.45 to RUPEES Four Thousand Five Hundred Fifty Six & PAISE Forty Five (Defaults being set to Indian Rupee). But the function can be adopted to any currency throug... |
Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month.
The following variables contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate... |
This is a follow-up question for Two dimensional bicubic interpolation implementation in C and A recursive_transform Template Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++. Besides the C version code, I am attempting to make a C++ version bicubic interpolation function bicu... |
I have written a simple parser in Java for a study project. Can anyone see how I might improve the code below. I have been looking at the code myself for the last few days but I couldn't come up with anything.
int counter = 0;
int cacheCounter = 0;
for(Map.Entry<String, File[]> path : queriedCache.entrySet()) {
... |
I am working on detection the selfish node based on this equation Using awk File : (Node Communication Ratio) NCR= ((Get Route Request-(Get Route Request-Reply Route Request))/Get Route Request)*100
Is the code correct?
BEGIN {
ReqCounter=0;
RepCounter=0;
NCRCounter=0;
Normalcounter=0;
}
{action=... |
I made a trival snake game below to practice my C++ and Win32 programming skills.
/* g++ snake.cpp -o snake -lgdi32 -Wl,-subsystem,windows */
#include <deque>
#include <vector>
#include <cstdio>
#include <ctime>
#include <Windows.h>
#define ID_TIMER 1
constexpr int WND_WIDTH = 500;
constexpr int WND_HEIGHT = 500;
... |
I use the following code in order to assess the quality of an audio, which is based on this original-project: MOSNet. I call compute_mosnet_score() in a loop with a different audio file in each iteration.
import os
import scipy
import librosa
import numpy as np
import tensorflow as tf
from tensorflow import keras
from ... |
I created a rough implementation of a component that lists stuff based on data has the option to enable searching for that data. I've not used React all that much so it's probably a terrible way to implement it. I looked into passing state upwards and the most common way I saw was to do what I did and pass the setter f... |
In the process of trying to learn python, and also help my daughter with some elementary math practice over the summer, I'm trying to write a simple math quiz which will reinforce what she learned over the last year. I am using the following, which works okay:
import random
import operator
def quiz():
print('Welco... |
This script is my first-ever attempt at writing anything in python. Though I have an electrical engineering background and therefore got a little programming education in college, it was fairly limited and I am definitely no big-time coder, so much of this script may be very rudimentary. I've never touched a JSON fil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.