instruction stringlengths 71 95.1k |
|---|
I need to implement in Python the formula in the image. The set B is a set of real numbers \$-1 \le t \le 1\$. Also, \$\mathbb{F}_2\$ is a set with the elements 0 and 1. \$y_i\$ is the \$i\$-th element of \$y\$. This formula is part of an iterative part of my program. The number of iterations is about 10K (over x) and ... |
I used recursion to generate fractal and got the desired result but I think my code can be better
I started using MATLAB a few days ago and since than trying and learning new things.
Now this code generates the fractal exactly as I wanted but I feel like it can a little bit neater.
Any suggestions are welcome (even off... |
So I've decided to practice I will turn all my scripts etc into GUI apps. So my 36 loc guess the number game turned into 136 loc. It's not the best looking, but it does work and on hard it's actually hard to beat computer sometimes. What are your thoughts guys? After finishing it I am not sure if my approach was right.... |
I was struggling to make the RadioButtons widget look presentable. Either the circles were not round, or the frame had a totally wrong shape, or both (see pictures below, and also this question on SO). So I had created a function that draws a reasonably good-looking one. It works (I have tested for the different number... |
I would like to optimize the way that I save files.
Each second I save lots of strings in different files. What I want to do is bunch up these IO tasks so they happen in bursts, instead of spread out randomly.
I want to write files, but without performing too many IO operations at the same time, so I don't put the disk... |
I am reinventing the wheel to write a function that serializes a (nested) data structure human readably. The default output is deliberately similar to that of json.dumps(var, indent=4), and I did my best to mimic the format of jsons output.
But the output is fundamentally different from json. More specifically, the dat... |
I am/we are using the observer pattern for many things in our application. I think it's time to create a reusable base class for these situations. Most implementations I could find only do something like this:
class Subject
{
public:
void AttachObserver(Observer* observer)
{
observers.push_back(observe... |
I have been working on this question, https://open.kattis.com/problems/sequences.
You are given a sequence, in the form of a string with characters ‘0’, ‘1’, and ‘?’ only. Suppose there are n ‘?’s. Then there are 2ⁿ ways to replace each ‘?’ by a ‘0’ or a ‘1’, giving 2ⁿ different 0-1 sequences (0-1 sequences are sequen... |
we have a RESTful API that includes an endpoint for search
apiserver/v5/search?q=[search text]
for any query, it passes it off to solr and returns the result like
{code:200,results:[{..},{...}]}
if q parameter is omitted, it returns:
{code:412,message:"parameter q is required"}
if q parameter is EMPTY, eg ?q= then i... |
This is a follow-up question for Calculate distances between two multi-dimensional arrays in Matlab and Mean and variance of element-wise distances in a set of multi-dimensional arrays in Matlab. For avoiding calculating distances and average twice, I am trying to propose a different implementation which is to calculat... |
Hi I am a beginner and l would love to hear your opinion on my first C project, how can it be improved in any way, for example dynamic memory allocation isn't used in the program because I didn't quite understand where to allocate it, also I couldn't figure how to solve the problem that if input isn't an integer the pr... |
I have written a function to choose randomly with weights from very large data sets in which the weight of elements can be several thousands.
The input of the function is a flat dict, the keys can be any object and the values must be positive ints, and the values represent the count of the element within the data set, ... |
See Serializing (nested) data structures in a human-readable format for more details.
This is the latest version, I have fixed all bugs and now this piece of code works completely as intended.
And I have added many more test cases. So far all tests are successful. I think I can't find an edge case that will cause the c... |
I've ran a few tests, not extensive though, and it apparently works. Like many standard binary search algorithms, if the number returned is < 0, you can take the complement (~) of the returned value to find the insert point, eg const ix = bs(arr, 5); // ~ix is the insertion point
interface bsRange {
min: number;
... |
This script is to calculate the Spearman correlation of genes that are stored in rows of a pandas dataframe. The original df has around 2000 row names. With my current code, this requires 2000*2000 iterations to compute the correlation value for each possible comparison row-wise. I would like to get some hints in order... |
This is my first time coding! My intent for this program was to be able to give my technicians a flash drive that will pull system info and email it to me. Currently everything is working, but I was hoping for suggestions or tips on what I can improve on or add to it. I'm sure there is a lot of messy code that I got fr... |
The problem is to count number of appearence of the number k in (n*n) Multiplication table
I just wrote this code to solve this problem
Is there a faster way to solve this problem?
long n = in.nextLong();
long k = in.nextLong();
long count = 0;
for (long i = 1; i <= n; i++) {
if (k % i == 0 && k... |
I have been trying to write a small test program and I was trying to think of any potential optimization I could do, especially if there is any chance to avoid some of the for loops.
The program has Dad class, a Child class and a DadChild class that holds the IDs of the Dad and Child objects that are associated based o... |
There is the following method that should get record from the database, apply new data, and if at least one value has been changed, update database and send event
We don't use EntityFramework, it uses CosmosDb SDK in the repository.
I'm not sure how is the proper way to implement hasChanges.
public async Task<Unit> Han... |
I just asked this question over Stack Over Flow on how to improve my code and reposting it here as someone on Stack Overflow recommended this platform.
I have written two python functions and they are correct, but I believe this is not the efficient way to write them, and I am wondering if some can give their input on ... |
I recently saw a youtube video on printing even and odd numbers from 0 to 100 in Java. https://www.youtube.com/watch?v=eRNTx8k5cmA
Thread 1 prints even numbers and thread 2 prints odd numbers. Both the threads print the numbers till 100.
I tried to write something similar in C++. But C++ does not have synchronized keyw... |
This is my first post here, so I apologize if anything is incorrect.
I have created an endless arcade stacker game (like the stacker games at the arcade, but when you hit the top the grid resets and you continue endlessly). My intention in the code was to separate out the core game logic (i.e. the code that moves the s... |
Take input n1 and n2 and check if they have the same greatest factor. If they do, print that factor. If they don't, print "No".
example:
input:
6
9
output:
3
input:
15
27
output:
No
n1=int(input())
n2=int(input())
l1=[]
l2=[]
for i in range(1,n1):
if n1%i==0:
l1.append(i)
l1.sort(reverse=True)
cf1=... |
I started my cs50 course this week and I will be trying to make little projects alongside to reaffirm what I've learned thus far. Here I have made a very basic budget and savings calculator, I am hoping to increase the complexity as I improve.
Where could I improve this in terms of simplicity & structure/slickness? Als... |
So I have a file of errors, there default meanings and also it's hierarchy in terms of indentation
BaseException General for all errors of any and every kind.
SystemExit Called for when the system wants to exit.
KeyboardInterrupt Called when an operator interrupts an action.
GeneratorExit Called when the system request... |
I made a somewhat simple vector implementation in C. Right now I only have around 5 features (making a vector, adding elements, removing elements, changing elements, deleting the vector). I'm proud of it but I know it needs a lot of work so I came here to see what you think I could improve. There are 3 files, main.c (t... |
My teacher gave us this problem to solve so basically N is the number of user names in a list T with 1>N<9
Generate another list called TID containing the name of the user but changed a bit. Do the next steps for each user in the list T
Take the first two letters from the user's name
The index of the user name in t... |
I wrote a program that, given a 2D array representing pixels in a birds eye view image, it returns the number of Objects in the image.
Pixels that are connected in the up, down, left, and right directions are a single object.
Example:
grid = [
[0, 0, 0, 1, 0],
[0, 1, 1, 0, 1],
[0, 0, 1, 1, 1],
[1, 1, 0... |
I learnt a function to display the imaginary part of a complex number & that is .imag
But when I was practising it, look what I found:
print(5-5j.imag) #>>>0.0
print((5-5j).imag)#>>>-5.0
print(2+4j.imag) #>>>6.0
print((2+4j).imag)#>>>4.0
What's happening with the output in the 1st & 2nd case?
|
I'm reading "Modern C++ Design"(A. Alexandrescu, 2002) and practicing basic TMP in chapter 3. Typelists. Since the book is quite dated, I revised example codes in C++17-esque manner.
Feel free to comment anything!
#include <cstddef>
#include <iostream>
#include <utility>
#include <type_traits>
// defining a typelist
... |
I use the Emgu.CV wrapper to create a grayscale image. The data of this image are to be copied into a 2D byte array. Is there a more elegant solution than mine?
I'm asking here at CodeReview because my code works and the question is therefore not suitable for Stackoverflow.
If you want to reproduce this: You need the f... |
I made a CSV class which manages CSV files. Is this good?, I'm beginner btw. It's probably bad but can you give me some tips!
Header file:
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <map>
#pragma once
class CSVFile {
public:
//Debug opening mode. Prints a debug message if s... |
I want to implement a function (or several) that must run exactly once when the program terminates, no matter how this termination came about1.
Below is my best attempt at doing this. Specifically, the code between the ####...#### dividers is the most succinct2 implementation of this functionality I have managed to co... |
As an exercise to learn more about multi-threading and atomic operations work in C++, I decided to implement a latch class in C++11 loosely based off of std::latch class from C++20 and would like to know whether this implementation is flawed in any sort of way or form and how I could improve upon it:
#include <cstdint>... |
This question follows up on this question.
After turning the while-loop into a conditional wait using std::condition_variable, I would like to know if there are still any flaws/problems with this code which implements the std::latch class from C++20 in C++11:
#include <condition_variable>
#include <cstdint>
#include <a... |
I'm learning PowerShell for professional development, but decided to do a bit of a silly project to help learn scripting in more depth, and chose Conway's Game of Life. This is the first PowerShell script I've written besides a small toy that I wrote for an Active Directory assignment previously.
An example start:
PS C... |
I started to write a terminal based text RPG in python. Its mostly bug free now but I really want to know how I could improve my code and how to implement things better. I know it's a lot of code so I really want to thank you, if you're patient enough to review it.
I uploaded the code to github. You only need classes.p... |
I would like a little help with the implementation of my SDL2 engine. It's actually not a real engine nor does it strive to be but I don't have a better word to describe it.
The purpose of this project is to serve as a base for other things to be built on, like a visualization of fractals for example, so i would like t... |
See Serializing (nested) data structures in a human-readable format for more details.
In the last two days I have significantly improved my function, and wrote seven implementations of it.
I have written an updated version of the original function, updated function with list appending replaced by list comprehension, an... |
I try to block all websites in Hebrew because I want to give more time on websites in other languages.
Given that many webmasters don't add <meta name="language" content="Hebrew"> meta attribute to all webpages of their websites I can't use it to block websites which appear in a certain language.
According to one work ... |
I was assigned the following problem:
You've gone back in time to 500BC Athens and Socrates wants you
to build him an app to help classify animals.
Build the classes Animal, Cat, and Bug.
Define the properties color and leg_number on the
relevant and necessary classes. Have them be initialized
within a constructor.
A... |
So a little context to understand the code:
This is a helper function to solve a bigger problem here
Quick summary: A Knight is in a dungeon/2D grid of Ints, starts at 0,0 and must reach the last cell at the bottom right to find the princess
The purpose of this helper function is to return all neighbors of a given sta... |
I've been working on a program that should find the color red on the screen and then send out an alert. The issue is that the red color moves around a lot and the color finder moves too slow on the screen to find the color accuritely and in time before the color dissapears to another location on the screen.
Is there a ... |
This is a follow-up question for A recursive_count Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++. A function recursive_depth for calculating depth of nested iterables is mentioned in G. Sliepen's answer. I am trying to implement recursive_depth function in this post.
Given... |
Created a MongoDB client which is handling the retry in case of server connection failure. Please review and how I can improve further.
package db
import (
"context"
"errors"
"log"
"time"
"go.mongodb.org/mongo-driver/event"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-dri... |
I am attempting to re-implement a postponed sieve algorithm for generating prime numbers in Rust. I am able to make a solution that works, but I have to use a couple of .clone() calls which I believe are killing my performance (the Rust solution ends up ~8x slower than the Python solution).
I would love some advice on... |
This is a programming challenge in Czeck. My translation follows.
Does anyone know what the time complexity of my code is?
Input: The first line contains 2 integers: the number of animals 1 ≤N ≤100 and the number of their potential sponsors 1 ≤M ≤200. The following are N lines with information about each animal: the un... |
I am new to using interfaces and abstract classes. The team I am working with came up with an implementation of what they call a base class that will be implemented by all view model classes. This is what they came up with:
public interface IBaseViewModel<T>
{
#region public properties
string Message { get;... |
Yesterday I posted my first solution to an interview problem here. I am now aware that I have many weak spots in Java and need to do extensive review before tackling any more interviews. Having said that, piecing together what people on here mentioned, I have come to what I hope is a good solution, and am asking to ha... |
I'm relatively new to Python have been writing for a few months now. I've started a Pandas Numpy project that starts with parsing large and somewhat sloppy formatted textfile, its not exactly csv but its pretty close.
...
Basetime: 2021102206Z
Forecast Hours: 0hr 1hr... 144hr
Sfc Prs(mb): 1002... |
I'm new to programming and have been teaching myself to code for about 6 months. Since I have no one to ask about any of coding-related questions, I may have developed bad habits in the meantime, but I can't tell myself. As such, I wrote a simple blackjack game in Python, to demonstrate how I usually code, and to find ... |
The task is to test the the benefits of a Move-To-Front Linked List vs. a standard Linked List. It was also meant to practice inheritance and pointers.
The standard functionality is in LinkedList, the derived MTFList replaces contains() to move the target to the front.
As I was late submitting my solution, I am not sur... |
I have a function that takes a specific number and a range, and re-scales it to the corresponding number in a different range.
/**
* @param int number The number to adjust.
* @param int oldMin The old minimum value.
* @param int oldMax The old maximum value.
* @param int newMi... |
See this method:
HRESULT CChristianLifeMinistryHtmlView::CustomContextMenu(const POINT* ppt, IUnknown* pcmdtReserved)
{
IOleWindow* oleWnd = nullptr;
HWND hwnd = nullptr;
HMENU hMainMenu = nullptr;
HMENU hPopupMenu = nullptr;
HRESULT hr = 0;
INT iSelection = 0;
... |
I solve problems to prepare for interviews. Now I have written the algorithm of finding K largest numbers in array. Various solutions are described here: https://www.geeksforgeeks.org/k-largestor-smallest-elements-in-an-array/. Initially, I came up with the solution myself and looks my solution corresponds to that desc... |
I'm wondering if the nested "try/except/else" structure (in the main function) is a good practice in Python. Right now, the structure is not that deep but I could continue on and on with additional conditions in the "else" part. Is there a better way to implement this ?
My code written in main.py:
import logging
import... |
I have a ListView that displays every customer (class Cliente in my code) of a company.
Every Cliente object has a specific id (piva in my code) that is necessary to make a third party API call.
My goal was to press a button in the template that makes an API call for every Cliente object in my ListView queryset.
To acc... |
One of the most exciting new functions in C++20 is std::format. I have never liked the ways that strings are formatted in C++ and have been guilty many times of using sprintf and such.
Since std::format is not implemented by any of the major compilers at this time, I thought I would try out my own very basic implementa... |
I have this method that returns an IEnumerable list , it takes 5 seconds to execute , so I want to know how can I optimize it side performance time of response.
private IEnumerable<dynamic> GetData(IEnumerable<dynamic> listD)
{
List<dynamic> data = new List<dynamic>();
foreach (var item in listD)
{
... |
Im using a bunch of ACF fields for my WooCommerce email templates and for this example Im calling these in my email_header template. Im using this with WPML, and need to call each language settings. The code works, but seems like it should be a way to write this better.
This is used to set and fetch the correct languag... |
So the kata/problem was: "Simple, given a string of words, return the length of the shortest word(s)."
Example test: findShort("Bitcoin will maybe save the world")
And my solution was:
function findShort(s){
// convert string to array
const strArr = s.split(' ');
// loop through array and find length... |
x and y are two-dimensional arrays with dimensions (AxN) and (BxN), i.e. they have the same number of columns.
I need to get a matrix of Euclidean distances between each pair of rows from x and y.
I have already written four different methods that give equally good results. But the first three methods are not fast ... |
Items.cs, Creates dictionaries, enumerators, and classes for every type of item.
using System;
using System.Collections.Generic;
public class Item {
// Medical
public static Dictionary < Medical, ItemMedical > Medicals = new Dictionary<Medical, ItemMedical>() {
{ Medical.bandage, new ItemMedical() { name =... |
I have been writing this piece of code for a while now, and I was wondering, is it possible to run this code multiple times on my pc? For example could I make the code solve all the numbers from 1 to 1000 and all from 1001 to 2000 at the same time? And, if this is possible, could I use multiple computers to solve it in... |
putting the if-else block outside of a function looks clutter to me, should I just put it inside a function and then inside the useEffect ?
Purpose of the if-else block: Render the cards base on the value pass from index.js
Below is my displayItem code
displayItem.js
import React, { useState } from "react";
import { Ca... |
Orcish
Large volumes of unlabelled data are hard to visualize when debugging; I find it difficult to keep track of the pointers in memory. I have used this code to assign Orcish names, (it's a name because I capitalized the first letter.) I use it initialized in the data type itself (orcish), or based on a pointer valu... |
Here is my wheel. strmap - C string hash map.
Main goal - create usable and simple alternative to hcreate_r, hdestroy_r, hsearch_r GNU extensions.
I am looking for general review of my code.
But any other suggestion and criticism (functionality, usability, code style, performance, memory usage, ...) are welcome.
Compil... |
I'm pretty new to learning Python. I wrote a very basic script that takes your pizza order and recites it back when you're done placing your order:
available_toppings = ['mushrooms', 'onions', 'green peppers', 'pepperoni', 'pineapple', 'extra cheese','sausage','spinach']
requested_toppings = []
size = input("Would you ... |
I need to check if times A cross with times B using integers and a 24hour clock. Times that are the same don't count as crossing, but meeting.
For example: 16, 20 and 14, 18 (startA, endA and startB and endB) would return true as these times do cross, however, 14, 16 and 16, 20 meet but don't cross so they would return... |
I tried to write a simple entity component system for my game engine. Each scene will have an EntityManager. It will create entities and add or remove components from them. An entity will be destroyed if its isAlive flag is set to false.
Example usage
class Position : public Component
{
Position(float x, float y, f... |
I'm implementing something of a thread janitor in modern C++. What I've got works, and while it's not organized in the way I'd like yet, I'd like some feedback on the fundamentals. Thank you in advance for any and all pointers. =)
All of the threads (including main() in order to signal program end) share data via this:... |
First let's introduce the problem:
I have a list like [{10,18}, {19,25}, {26,50}] and i have an input (n), when (n) inside one of objects in a list i will get this object and when (n) not higher then all objects in a list I want to get the higher object.
Take this list for example List<MyObject> list = [{10,18}, {19,... |
Given a list of strings paragraphs and words. Check each paragraphs's item for containing words's item as a substring. In the case of positive, replace all characters of this substring on 'x'.
I do it in the following way:
// In production, words.Length ~500
var words = new List<string>
{
"technology",
"word",
... |
We have a list of string arrays i.e. List<String[]> (which we got from a csv)
which follows the hierarchy:
0000
3000
5000
5000
5000
.
.
.
3900
3000
5000
5000
5000
.
.
.
3900
.
.
.
9999
As you can see, it will always start with 0000 and end with 9999 (think of them as head... |
This script is designed to help solve sequences in Sudoku puzzles with variant constraints (ex: Thermometer, Renban, etc.).
Summary
The user specifies the constraints they want applied as well as the sequence length.
All sequences of that length are then generated and the code eliminates the ones which violate any of ... |
This is a follow-up question for A recursive_depth function for calculating depth of nested types implementation in C++ and A recursive_count Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++. I am trying to follow G. Sliepen's answer to implement another version of recursive_c... |
I am doing the codecademy course and had to do a rock paper scissors game as a project. Rather than following the instructions I tried Doing it on my own. How I could make the code more efficient?
//Only outputs 1-3
const COMPUTERCHOICE = (min=1, max=4) => {
return Math.floor(Math.random() * (max - min) + min); };
/... |
There is a sequence of integer values, and a separate integer.
I was required to write a method to get all numbers from the given number sequence which can be divided exactly by the given separate integer.
Example
number sequence = 6, 12, 34, 96, 72, 16
separate integer = 8
result = 96, 72, 16
The code
/***************... |
This is my best attempt so far at a bash script argument parser written without GNU getopt or bash getopts
the first two functions, usage and err can be more or less ignored, but I plan on adding the ability to specify an exit code when calling err.
Now for the first section of code in the main function:
shopt -s extgl... |
I'm learning and want to improve as much as possible. In doing so I have written this custom block that has an image on one side and an inner block on the other. It's using ACF to get the variables and comments should state most of the items.
I'm looking for recommendations to improve, readability, functionality, or se... |
The goal is to write a decorator that allows you to define "indexer proxies", which define properties with __getindex__ instead of normal method calls, like loc and iloc in Pandas dataframes.
To that end I ended up with a descriptor constructing an inner class with the transformed __getindex__, an instance of which is ... |
I created a service for Connection Pooling. And PluginAuth Class will handle those transaction to be send in the server. Is my code structure correct?
public class ConnectionPoolingService {
private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionPoolingService.class);
public static final Strin... |
This is the code I came across in our repository. This performs search in-memory and is invoked on service layer code.
In our front end operators like EQUAL_TO and so on are passed with field name and field values are passed as list of parameters in the query.
This is autowired and passed in the service calls like so
r... |
I want to read \n terminated, UTF-8 encoded lines from a network connection and process each full line. I cannot use fgets, because that function does not support nonblocking IO, which I want to use.
I currently have the following code, but it looks a bit too confusing to me. Some tips on how to simplify the code would... |
Would love some feedback on this simple API implementation with Ruby on Rails. Have I used proper naming conventions, readable/manageable code, optimal approaches, etc? As I'm still learning Ruby on rails, I'd love to hear what other fellow engineers have to say about this :)
A simple Register API:
require 'net/http'
r... |
So I am using i3 an Linux window manager to manage my windows. In addition this is run on a laptop that is frequently mounted to several output-displays. This is handled by the following lines in my i3 config file
set $firstMonitor DP-2-1
set $secondMonitor DP-1-2
set $laptop eDP-1
workspace 1 output $firstMonitor $la... |
I have already posted this program and got some good recommendations on how it can be improved but I would like to further know what can
be improved for example:
Should dynamic memory allocation be used and if yes, where should I allocate it ?
How can I replace system("cls") in the program ?
Should I get rid the globa... |
I'm not familiar with how data transmission works, but I gave my best shot trying to code a server and client-side JSON packet transmitter via Python. Essentially client.py generates random JSON packets and sends them to server.py which binds a port using a socket and listens for a JSON packet, which then stores the JS... |
I have created a program where it contains the IP of the user and uses it to connect to a Philips Hue Bridge. I've just recently started python so I understand my code may be terrible.
from phue import Bridge
from tkinter import *
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8",... |
Given a real number a and a natural n, calculate the sum 1 + a + a² + … + aⁿ, without using the formula for the sum of a geometric progression. The running time of the program must be proportional to n.
My solution:
#include <iostream>
using namespace std;
int main()
{
int s = 1, i, n, m;
double a;
cin >> ... |
I'm writing Minesweeper implementation in Java. I have little experience yet, so I need some advices:
about improving code, making it more readable and flexible
about coding style
about common mistakes that newbies usually do (I suspect I have some in my code)
about code structure (for example, I'm not sure about wher... |
This is following up on this question
In this part, I wanted to be able to choose arguments by index and have a placeholder for the format of the argument. As usually happens, my initial implementation was pretty much straightforward. Unfortunately, things get a bit ugly from here…
#include <charconv>
#include <iostrea... |
I am learning Vue.JS and I'm creating a simple todo app, where each list has a unique id. I am iterating through all of the list to create a Vue instance:
<div id="todo-list-1" class="todo-list">...</div>
<div id="todo-list-2" class="todo-list">...</div>
<div id="todo-list-3" class="todo-list">...</div>
// main.js
doc... |
C++ Event class
From the desire of having a callback function which includes a void* userdata argument, I've made this generic event class.
It is tested and working, but some desired features are missing
Allow to have a parameter less event with no userdata
Allow to specify a TResult template argument, for example to ... |
I wrote this basic CRUD app + simple report so I could practice talking to a db directly. I purposefully avoided repository pattern and Entity Framework and only used a library to show the coming data a bit more readable.
Having that in mind, I'd love to get some feedback, particularly in regards to bad practices that ... |
Problem Statement:
I am working on this simple dataset from Kaggle. I have provided a snippet of data with only required columns in below table. Dataset is quite simple, it has all IPL (cricket) matches listed with teams who played each match (team1 and team2) along with winner of that match.
Now I am trying to get tot... |
It's an exercise from a RSpec-course, which I'm currently doing.
Task:
Create a compound expectation, which asserts the string sportscar starts with the substring "sports" and ends with the substring "car".
Create a compound expectation, which asserts that the number 30 is even and that it responds to the times metho... |
I wrote a simple linear/polynomial regressor based on my previous matrix project (https://github.com/frozenca/Ndim-Matrix).
#include <Matrix.h>
#include <algorithm>
#include <concepts>
#include <cctype>
#include <functional>
#include <stdexcept>
#include <numeric>
#include <ranges>
#include <string>
#include <vector>
... |
I've created a simple score game. The goal is improving my knowledge about OOP.
This is my Main method:
using System;
namespace Snake
{
class Program
{
static void Main()
{
while (true)
{
Process.UI();
}
}
}
}
It's very simple and... |
Implementation of a Caesar cipher is a popular exercise and there are many implementations posted here on Code Review.
My version is intended to be efficient and portable (subject to some limitations, below).
#include <algorithm>
#include <array>
#include <cctype>
#include <climits>
#include <cstdlib>
#include <iostre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.