instruction stringlengths 71 95.1k |
|---|
I am solving some questions on HackerRank for practice purposes. This morning I solved one called Maximum sum of hourglass in an array.
Given an array:
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
the hourglass sum is 7 and we need to find the maximum sum of all hourglass in an array.
My imp... |
I have Dijkstra's algorithm:
# ==========================================================================
# We will create a dictionary to represent the graph
# =============================================================================
graph = {
'a' : {'b':3,'c':4, 'd':7},
'b' : {'c':1,'f':5},
'c' : {'f'... |
I am a CS student and I was wondering is this code looks clean. I tested it and it passed every tested but I think the delete(Node node) is a bit long, I did not find a way to reduce it
Node class
public class Node {
private int data;
private Node next;
Node(int data){
this.data = data;
... |
I have been working on creating a code solution for the Hungarian Algorithm, and from the testing, the slowest and buggiest part has been the bipartite matching. The most recent rendition is based on this GeeksforGeeks article, but, I removed the recursion since that was a stack-overflow waiting to happen for my inten... |
I have a piece of code that calculates the edit distance between words and works, but it's apparently not fast enough.
ClosestWords.java:
import java.util.LinkedList;
import java.util.List;
public class ClosestWords {
LinkedList<String> closestWords = null;
int closestDistance = -1;
public int dynamicEditDista... |
Yesterday, I asked this question because I was asked to implement a software that used variably sized matrices with C89's limitation, so I had to practise dynamic pointer-to-pointer allocation. After the useful answers I got, I started working on a solution to a problem that I was assigned as an exercise.
Here's the as... |
I'm working on a project for digital marketing, I want to automate the upload of pictures. The program itself isn't done but here I came up with a way to keep track of which and when pictures have been posted.
from os import listdir, rename
from random import choice
from _datetime import datetime
# The main directory ... |
Just an Rx wrapper around Kafka to represent topic consumption as IObservable<T>:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Confluent.Kafka;
using PM.TT.Live.Kafka.Rx.ConfluentKafka;
using Reactive = System.Reactive;
namespace PM.TT.Live.Kafka.Rx
{
public static class Cons... |
For my Networking class, we learned about subnetting and subnet masks.
I decided to write a little "calculator" (a generous term) that when given n-many network bits, generates a 32-bit subnet mask, then displays it as octets, and as binary with the leading 0s removed. Example main:
int main() {
int nNetworkBits = ... |
I have a standard tableview app that displays information from a data model array that uses a custom class. There is a UISearchController to filter the data.
A simplified version of the custom class is shown. I use a computed property for a string that is checked when searching the data.
class myObject: NSObject {
... |
hackerearth.com practice problem Can you solve it?:
Given an array 'A' consisting of 'n' integers, find the maximum value of the following expression:
\$\lvert A_i - A_j\rvert + \lvert i - j\rvert\$
where \$A_i\$ is the element of the array at the i-th position (0-indexed array)
My solution:
def solve(n,l):
ans... |
Before we get started I need to let you know a critical piece of information: Due to permissions within an offsite database I am NOT allowed to create tables even temporary ones within the database that I am getting the data from.
With that being said: All of the code below works as expected, but I would like a revie... |
I was curious how vectorization works and how to write suck code. To start simple I choose 7-bit encoding as my test suspect. I'm not expecting improved throughput in any way. My implementation works just fine, until we go over 2^31 due to compare not doing unsigned comparison. I would like to know how this could be ta... |
I need a unique_ptr and shared_ptr like structure, but instead of pointers, I would like to store some kind of reference to a resource. It is usually just an int and maybe some attributes. I would like to avoid using pointers, so these objects can be kept on the stack.
I usually use these containers in my OpenGL projec... |
I have a list of orders (each order is a dict) which looks like this (simplified version) :
[{'name' : XXX,
'id' : { 'order_id_local' : 'xxx_001'}},
{'name' : XXX,
'id' : { 'order_id_local' : 'xxx_002'}},
{'name' : XXX,
'id' : {}},
{'name' : XXX,
'id' : { 'order_id_local' : 'xxx_002'}},
{'name' : XXX,
'id... |
I used the minimum edit distance algorithm to find the bundle of the most similar strings in an array. So, I have to travel double for loop to compare all elements.
If the data is large enough, this algorithm is Inefficient.
Values have rules:
value's length is 10
value is A-Z and can't be duplicated
Is there a way ... |
I'm solving this simple challenge:
Given a vector A with N unique elements greater than 0 and lower or equal than N+1, find the missing element. Example:
A = [1,3,2,5] -> missing number 4
A = [1,3,5,4] -> missing number 2
I've come to the following solution. I'm interested in thoughts and ideas on how to write it as ex... |
Preliminaries
I am working on a software that controls CAEN digitizer. The current step is to provide an ability to save/load configuration to/from an external source (hereafter - "config file"). I decided config file to be a simple text file and consisting of lines like this one:
PARAMETER VALUE
For example, this is ... |
I have made a small Python script that will generate some test sets for my project.
The script generates 2 datasets with the same dimensions n*m. One contains binary values 0,1 and the other contains floats.
The script runs fine and generates the output I need, but if I want to scale to many dimensions the for-loop in ... |
Note: this code will be run using portable WinPython 3.7.6.0 (Python 3.7.6, package list here) on Win10x64. Installing new packages or upgrading the Python version are not an option for this project.
Disclosure: this code is heavily inspired by Janos' excellent answer here.
I've written a piece of crap that's going to... |
I've written up a key-value store that runs on SSTables in python.
import json
import tempfile
import time
import uuid
from contextlib import contextmanager
import attr
from sortedcontainers import SortedDict
TOMBSTONE = str(uuid.uuid5(uuid.NAMESPACE_OID, 'TOMBSTONE')).encode('ascii')
def make_new_segment():
f... |
This is a big script with a GUI basically. I have 4 page classes, that are children of the main Wizard class. I do most of the threading in Step3 and the scripts are simple - creating a new user, editing reg files and installing chrome. Everything works perfectly here, until the main window is dragged - then the app la... |
I'm not an expert in authentication, so I want to make sure I have done everything right.
I am using crypto.createCipheriv and crypto.createDecipheriv for authentication.
I will store the key in the database, and the initialization vector, IV, and encrypted data in cookies. When requested the server will try to decrypt... |
The initial problem that led me to learn VBA is as follows:
You have a table that can be up to 10,000 rows (several hundred pages) long in a Word document. The table has a title in the form of a paragraph above the first row. This title is styled such that it links to a Table of Contents (Style = "Caption"). The table ... |
I was recently asked an interview question with regards to algorithm design. The challenge is as follows:
Given a 6 or less digits positive integer (0 - 999999 inclusive), write a function englishify(number: int) that returns the full English equivalent of that number. Here are some samples of the structure you are ex... |
I'm trying to optimize the following function f, written in python.
It is a function of an integer k.
First it calls another function G(k), which gives back a long list of certain objects. We want to manipulate this list as follows: two elements a,b are equivalent iff the function H (which is a given function that can ... |
I want to use the android component autocomplete:
https://developer.android.com/reference/android/widget/AutoCompleteTextView
There are some possible values the user can select, but I also want that, the user starts typing and, if there is no match with any of the "possible" optionsm, then, the text the user wrote is a... |
I've a C# WinForms application that relies heavily on sending HttpWebRequests. I've build an HttpWebRequestBuilder, and WebRequestBodyBuilder.
public class HttpWebRequestBuilder
{
private HttpWebRequest _httpWebRequest; // The object that will be built.
public HttpWebRequestBuilder(string url) : this(url, Const... |
I'm looking for general feedback as how to improve my code. I wrote the program starting out with no functions, making it very difficult to adapt. When I separated the program into functions it became very repetitive.
How can I improve my code?
"""
A program for comparrison of triangulation (wave or skipping stones, no... |
I have written this code that connects to a mysql database. The function should be able to be used as a context manager - via with. It is working, but I am not sure if this is a great way of doing it.
conect.py
import os
import mysql.connector
from mysql.connector import errorcode
import contextlib
_CFG = {
'user': ... |
I wanted to know is this the best way to handle a SegmentedControl using the e.NewValue? Base on the selected segment I hide and select different data?
XAML
<telerikInput:RadSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Option One<... |
I made a very basic social network Java program. I was wondering if my design could be improved. I have 2 classes (+ 1 driver) : Person and Graph. I would like now to add a new method hasAccount(Person person) in the Graph class to check if a Person is on the graph. However, so far I don't have any data structure that ... |
I'm working on an audio player with a terminal interface. I'm designing it for eventual use on a Raspberry Pi with a 480x320px display.
I've broken the code into three main files with the intention of keeping the business logic (player.py) and graphics (view.py) separated and connected only through the main file. I've... |
I am trying to make a very simple event system for learning purposes, after seeing some much more complicated code on the internet I was wondering if what I am doing is fine of if it has major issues. The code works but I am not sure if it is fast and safe.
The part that worries me is that in my test Listener class (K... |
I'm working with thousands of large image files in a regularly updated library. The following script does the job (on average reduces my file size ~95%) but costs me around 25 seconds to compress one image. Obviously, I can just let the script run overnight, but it would be cool if I can shave some time off this proces... |
After a conversation with my math teacher about a base algebra (base 43 using all the algebra symbols) and finding it more than the 30 min of work I was looking for, I decided to make this instead.
import math
letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T... |
My mask translator is performing poorly in scenario where I have 30 masks and 10,000 ownerships. This is a bit field and similar to bit masks such as enum.IntFlag.
I though about creating a list with all combinations of masked values and names (1 - alex, 2 - ben, 3 - alex/ben, 4 - clark, 5,... sum from 1 to 30 = 465) a... |
this is my first code review post :) So I wrote this Black Jack game as part of an online Python course and would love some feedback about my coding style and whether or not I have correctly used a 'Pythonic' style in terms of the OOP.
Any general comments are also extremely welcome because I am making a move towards ... |
So I am attempting to scrape a website of its staff roster (https://www.milb.com/greenville/ballpark/frontoffice) and I want the end product to be a dictionary in the format of {staff: position}. I am currently stuck with it returning every staff name and position as a separate string. It is hard to clearly post the ou... |
Hello guys i wrote this function code:
function gematria(text){
var newText = text.toLowerCase(); // handle capital letters
var startValue=0; //initialize value to zero
for(let i=0 ; i<newText.length; i++){ // loop through every letter on the text
let currentCharValue = newText.charCodeAt(i) - 96; // get the... |
Helo everyone, I need to review on function swapNode in doubly linked list. It works but I want to make it clearer and better. Are there any errors like memory leak in my code?
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
struct node;
struct list;
typedef struct node node;
typedef s... |
Can anybody help me to minimize my hard coding? Also please give me any suggestions for improving my code for the future?
My Source Code:
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.border}>
<Image source={{... |
I know this code worked as I've tested it with the case tests commented below in the code, and even added a few of my own, but the developers who were testing me came back with the following critiques:
All in one file, no attempt to modularise or separate out concerns
No tests at all. You could possibly forgive an ent... |
I am trying to solve the Dynamic Array problem on HackerRank:
Create a list, seqList, of N empty sequences, where each sequence is indexed from 0 to N-1. The elements within each of the N sequences also use 0-indexing.
Create an integer, lastAnswer, and initialize it to 0.
The 2 types of queries that can be performed... |
This is my JavaScript function to get a break time taken. I have two times (time_start and time_end). And with these two times, I have to get my break time. (break time hours are 12:00-13:00 and 17:45-18:15). The code below works but it contains a lot of nested if and else. Is there any method to reduce them?
function ... |
I'd like feedback on my solution to the outlined programming challenge. Is numpy a good candidate module for this? What might be a more efficient or Pythonic solution?
Closest Enemy II
Have the function ClosestEnemyII(strArr) read the matrix of numbers stored
in strArr which will be a 2D matrix that contains only th... |
I have two database tables UsersDownload, Non-UsersDownload. There is also two model object and two service that take in the object and insert the data into the correct table. Is this the best architecture for this? or is there a better way to handle this? Would it be better to use an interface?
public class UserLog
{
... |
Overview
I've just written a package in Python (which I've named sibstructures) whose purpose is to assist staff in managing a coldstore, which is a warehouse-sized refrigerator holding (in this case) boxes of potatoes.
The code below is one file taken from that package, the file which defines the centrepiece Coldstore... |
In effort to learn OCaml, I'm going through some easy LeetCode problems and attempting to implement them. I arrive at the correct answer, but I'm still developing an intuition for canonical OCaml code. I'd appreciate any feedback on my implementation.
As mentioned, this is problem 1 on LeetCode. A quick summary of the ... |
EDIT: Refer this answer for improved solution with incorporated feedback and extended functionality. eg Automatically hexdump both parts of a stack/heap obj like std::string.
Inspiration / Motivation
Modern C++, certainly compared to C, provides a lot of abstractions which protects us from / hide from us the details ... |
I have a code to scrap data from webpage using selenium and python.
The code selects a URL the database and search it using selenium chrome driver and fetches the result and insert into a postgreSQL database.
Can anyone can review this code and let me know what I need to modify to make it better and organized.
The belo... |
I am attempting to learn Python. It was suggested to me to try a web scraper, so I thought to get myself to look at multiple Nagios instances. I have not programmed in Python before, but learned from other code reviews to adapt my standards to PEP8. The online checker says the code passes.
from bs4 import BeautifulSoup... |
I am learning to clean my code and make it more efficient, however I'm having trouble with my code, because most of the post about the subject are specified to a given code. The code below looks like a lot, but it's the same step for different sheets (the code below is for two sheets, there are five more sheets).
Sub F... |
I have a few hundred mp4 files (thanks android =/) that I need to convert. I only want to convert videos that are too large (>= 1080p) and I do want to keep the exif Information so the timeline is not broken.
I hope someone can look over the script to point me to some grave mistakes or give some improvement.
Anything I... |
Can you provide some advice on how I can simplify this code?
I am a beginner with Python, and I'm pretty sure that my code can be much simpler. I think the check() function is far too complex. But I have no idea how to simplify it, and still check which player has won the game.
def check():
win = 0
if gameTable... |
The code below takes a directory of XML files and parses them into a CSV file.
Right now parsing around 60 XML files is fast and the output is a CSV file that is around 250MB.
That is a really big file and the reason is because columns are being repeated. I'm repeating the columns for the reason that every element shou... |
I decided to split the SQL Part away from This Question.
Before we get started I need to let you know a critical piece of information: Due to permissions within an offsite database I am NOT allowed to create tables even temporary ones within the database that I am getting the data from.
With that being said: All of the... |
I'm creating a parser, and I have just finished my lexer. I wanted to ask if there is anything I should change, add, or reconsider in my code! (I don't think the grammars matter much, since it is only a lexer)
lexical_analyzer.h
#pragma once
#include <iostream>
#include <string>
#include <vector>
// kinds of lexemes ... |
I'm using my own Action-based Event Manager for a while and looking for ways to improve it.
Mainly it's used in game development, where excessive garbage generation can lead to severe consequences. That's why I'm trying to avoid any boxing which normally exists in such managers.
There are different event types (dozens,... |
I've a string as an input which is having some specific patterns and I'm trying to parse it into a desired json. Here is my code:
const input = "status:all,applied_date:2019-04-15--to--2019-04-15,screen_status:SR|NS";
const output = { and: {} };
const dateSeparator = RegExp("--to--");
function parseStr(s... |
Background
The code below is (obviously minimally) ripped out of a current live project. The project does reasonably sized data extraction, cleaning, analysis, clustering and visualisation (on a budget, and that's why we are not using graphistry or similar for the visualisation part).
So for our sins, we are using gra... |
I'm relatively new to programming as I've just started university. My assignment was to develop a program (by using a function and a linked list with pointers with integer elements) which does the following:
The function visits every element from the beginning. If the current element plus one is <= to the following el... |
After discovering Float Toy, my goal was to create my own version using Python and Tkinter. The results of the endeavor is shown below. Most of the functionality is complete, but the Equation widget does not automatically update itself yet. Does anyone have any simple suggestions for updating its labels?
#! /usr/bin/en... |
Problem
I am trying to convert my synchronous code to an asynchronous implementation. Using aiohttp I was able to almost get where I want. My problem is how to deal with synchronous requests. I have 3 types of functions:
Take argument, make one request (easy to turn async)
Take argument, make multiple, independent req... |
This is my first Objective-C++ code, so I'm a bit lacking in the knowledge of methods.
I need to resolve a macOS alias and get its original location. I have access to the C string, which is the file path (in a human readable form). It also needs to be verified in this code itself that it is a true alias, and contains b... |
Here is the Question. Find the largest GCD of the input variable with the values of an array.
Inputs are as follows:- First-line contains two integers, N and Q.
Second-line contains N integers which form the arr[].
Next, Q lines contain an integer M, the time in seconds she wishes to go back.
#include <stdio.h>
int ma... |
For testing purposes of a platform I'm working on, I must automate the process of initiating Dota 2, accepting an invite that shows on screen, choose the right spot for that player (team A or team B), wait until the game starts and then exit it.
All of that could be done with simple clicks on static coordinates but Ste... |
I have written this code and I wonder if there is a better way to do absolutely any of it. Also, if there is any way to optimise it or if there is a problem please also tell me preferably with fixed code as I am still sort of a beginner. It is one of my first school projects and I would like to show my teacher that I r... |
I have written this code which provides advice based on user's favourite YouTuber. I wonder if there is a better way to do absolutely any of it. Also, if there is any way to optimise it or if there is a problem please also tell me preferably with fixed code as I am still sort of a beginner.
The code is below:
import ra... |
Rust is one of my first forays on a strongly typed language, beginning to like it's strictness, and am looking to improve my comprehension.
Rules
Fizzbuzz is a programming challenge with the following rules for output;
n mod 3 => "Fizz"
n mod 5 => "Buzz"
n mod 3 && n mod 5 => "Fizzbuzz"
else n => n
Examples;
10 => "... |
This is a follow up to the code found here:
Multithreaded HD Image Processing + Logistic reg. Classifier + Visualization
Description:
This code takes a label and a folder path of subfolders as input that have certain labels ex: trees, cats with each folder containing a list of HD photos corresponding to the folder name... |
I am working on struts 2 based web application, where an Action Class render 7000+ records in UI. The query which fetches the record is already been optimized by the DB developer, but instead it took around 7+ seconds to load UI it also freeze the UI for a moment,on deep inspection I have found there is something wrong... |
I am using the least_squares() function from the scipy.optimize module to calibrate a Canopy structural dynamic model (CSDM). The calibrated model is then used to predict leaf area index (lai) based on thermal time (tt) data. I tried two variants, the first did not use the "loss" parameter of the least_squares() functi... |
I have a system of 49 equations and 49 unknowns (\$x_{1},...,x_{49}\$). All equations have the following form.
\$x_{s}\sum_{r=1}^{R}\sum_{t=1}^{T}a_{s,t}b_{rs,t}=\sum_{r=1}^{R}\sum_{t=1}^{T}a_{r,t}b_{sr,t}x_{r}\$
where \$s = 1,...,49\$ with \$S = R = 50\$ and \$T = 30\$. The \$a\$'s, the \$b\$'s and \$x_{50}\$ are kno... |
I do genetic programming. I have 5 parcours, the first on the left is the easiest parcour.
The first parcour can be solved by place one belt in the middle pointing downwards to solve the problem. If placed in the middle downwards, the puzzle is solved because the iron-ore flows downwards to the robotic arm. The roboti... |
Currently my solution for calculating wages based on average weekly hours and any other wages field is very long and elaborate. I think it can be concised and make more readable but when I try to do it it creates some nasty bugs as it is based on field changed. Any elegant refactoring suggestion would be much appreciat... |
Is this the best way to prefix all lines written by a Bash script to standard error?
#! /bin/bash
exec 3>&2
exec 2> >(sed 's/^/ERROR: /' >&3)
echo stdout
echo stderr >&2
I am wondering, if I have to close file descriptor 3.
|
I've created a tiny (723 bytes compressed + gzip) animation library. Is this a good way of animating arbitrary numbers?
const map = (value, x1, x2, y1, y2) => (value - x1) * (y2 - y1) / (x2 - x1) + y1;
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
// Courtesy of @gre from https://gist.github.... |
I've got such an input object, which I should modify in order to use it with some charts library.
const input = {
foo: {
bar: 'biz',
},
statistic: {
"2019-11": {
A: 11,
B: 11,
C: 11,
D: 11,
E: 11,
},
"2019-12": {
A: 12,
B: 12,
C: 12,
D: 12,
... |
I just got done coding this C program:
Read the description of a deterministic finite automaton from standard input.
The first line of input is the number of states in the automaton, n
n lines follow, each one describing a state. Each line is composed of the name of the state, followed by its transitions, colon-separa... |
I have been following along with a Udemy OOP basic course in Python. One of the sections prompted to make a banking system before watching the following videos. And so I have created a rudimentary banking system. I believe the system as is, is rather basic. I think there are some tweaks that can be made to it.
I have n... |
I was thinking of adding a very high-level implementation of the event/observer pattern to my project. The implementation would manage adding and removing observers as "needed". You can use an almost DLS-like API to define when an observer should be added or removed.
Here is an example of the API in use. We want to tra... |
Based on my answer to another code review question I wrote my own python script for DLA (Diffusion Limited Aggregation).
The DLA algorithm task:
Place seed at the center of the canvas.
Release a random walker from the edge.
Random walker sticks to the neighboring sites of the seed/previous points.
Repeat N(particles) ... |
Version 1 - Beginner web scraper for Nagios
Current version changes:
Moved NAGIOS_DATA dictionary to separate file (and added to .gitignore)
Used functions with DOCSTRINGS
Removed the multiple redundant print() statements
Actually read the PEP8 standards, and renamed variables to match the requirements
Again, beginne... |
We start off we the following Person class:
class Person:
def __init__(self):
self.moods = {
"happy": 5,
"angry": 5,
"sad": 5
}
def updateStates(self, stateUpdates: {}):
for mood, valChange in stateUpdates.items():
self.moods[mood] += valC... |
I was wondering what is the better way of writing? Having several variables to show the steps or rather do method chaining?
function count(string) {
const array = string.split("");
return array.filter(element => element === "a").length
}
function count(string) {
return string
.split("")
.fi... |
I have a set of code that calculates how well a templates fits a users details. It's kind of long, so I've cut out all the code that does it's job well and only included the bottle neck and surrounding code. My target here is speed!
A couple of notes on the variables:
Calculated at run time (changes each user):
TopSec... |
So I was coding Inversionless ECM using Prime Numbers: A computational perspective and when I finished and tried running my program it ran way, way slower than it is supposed to. I have no idea what I am doing wrong. The algorithm I'm coding is here and is algorithm 7.4.4(Ctrl-f it)
[Choose criteria]
B₁ = 10000; ... |
Here is the code to a progress bar component. Is there anything that you feel I should improve to it?
If I state that the progress prop is required, is it ok NOT to check in the code that progress is not null?
import React from 'react';
import PropTypes from 'prop-types';
export default function ProgressBar({ progress... |
Main Goal
My goal is to create a chat app for my company (they are all software developers). I first make a console version and if it is working fine, I will make a GUI version. The program will run on an exchange drive, so using networking features is not neccessary.
Project description
The software will consist of th... |
Here is a function that formats a phone number and adds a country code prefix if it is not included in it.
So, as an in input value it could be, for example, '23581010' or '4923581010' and in output it would become via the formatNumber function '(02) 358 10 10'.
Is the positioning of the let assignment ok in this code ... |
I'm using Flask along with Flask-SQLAlchemy and Flask-WTF.
I have a model:
class Trip(db.Model):
id = db.Column(db.BigInteger, primary_key=True)
author_id = db.Column(db.Integer, db.ForeignKey('users.id'), index=True,
nullable=False)
name = db.Column(db.String(2000), nullable=False... |
I recently faced an interview question where you have to find minimum needed items from an array that can added together to generate X value.
For example giving:
[1, 9, 2, 5, 3, 10] and the goal is: 13, => it should be [10, 3]
You can't use any number out side of array.
I have tried to sort items and take from the he... |
I made my first open-source project and wonder if I could do it better.
I'll give briefly description, ask some questions and then post whole code.
Open to any opinons and suggestions, thank you.
So, Aiohttp is asynchronous HTTP Client for Python. You can find it's documentation here. However all you need to know is t... |
As an exercise to familiarise myself with smart pointers, I implemented a template linked list class in C++, closely following the very good tutorial at: https://solarianprogrammer.com/2019/02/22/cpp-17-implementing-singly-linked-list-smart-pointers/, which I duly acknowledge and from which I borrow freely.
The code se... |
So on my checkout page when I push final checkout I want to store my users address and shipping address into a database. I am wondering if this could be shorter. Currently, users have multiple options:
Logged in where they use same or other shipping address.
Not logged in and they want to create account with same or d... |
Utility to generate sequences of predetermined addenda that add up to a given number.
There is also a function for orderly printing and one for converting list of lists in sequence of sequences.
The answer that Gurkenglas gave invites me to specify the objective that I set myself by defining these functions. The field ... |
This is my first working 2sum solver. It works by finding the difference for our target in s to determine if that 2sum exists.
Suppose our target is -5. I start with the first index in s and use subtraction, (-5-(-8) = 3), and the result is 3. The code will check the difference in s. If the difference exists in the lis... |
I am writing a textual chat app for exercise purposes. All Chatters using my program have access to a network directory, and there my program is stored. This chat app consists of three programs. The user management program allows you to create and delete users. The messaging program allows you to write messages. The vi... |
I recently had to submit my 12th grade final project in C++, so I decided to make a game engine! That panned out just as you would expect (I am not touching OpenGL until they touch OOP), so I switched and ended up making a project on graph coloring instead!
For context, in the actual project this was used to calculate ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.