instruction stringlengths 71 95.1k |
|---|
I am working on script to a upload image files Securely. can anyone please review my code and suggest improvements on security.
<input type="file" name="images[]" id="image" multiple="multiple">
check if request method is POST and request was made from same domain and form was submitted with submit btn
if (is_post_requ... |
I have implemented a LinkedList removal fo duplicates class by using HashMap.
Looking forward to your reviews.
Thanks.
package test;
import main.algorithms.LinkedListRemoveDuplicates;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class LinkedListRemoveDuplicatesTest {
LinkedList... |
This is my first proper-ish project I've made. This was my first time using classes as well. I know that I made really stupid decisions, this is extremely far from being anywhere close to optimal, and probably made my future life hell if I decide to add things to this one day, but that's why I'm asking for help. I star... |
The below is the C# implementation for the a function for given parameters int a, int b - both represent characters 'A' and 'B' respectively, where the function should return a string containing both characters 'A' and 'B' occurring a times and b times respectively but neither 'A' nor 'B' repeating consecutively for mo... |
I'm trying to insert data from ArrayList to HashMap<String, Language> optimally.
Many items may have the same languge_name (code below), so I need to group items having the same language in Language class and store languages in a HashMap with the name of the language as a Key.
Item
String name;
String language_name;
L... |
I need to perform some expensive calculation, such as determining a Fibonacci number:
/// Calculate the Nth Fibonacci number (inefficiently)
func fib(n: Int) -> Int {
n > 1 ? fib(n: n-1) + fib(n: n-2) : n
}
My project contains a number value types that need to perform calculations like fib based on their properti... |
Writing a double-linked list seemed like a good practice for understanding it. I tried to fix all the errors that were pointed out to me in the last question, as well as add new functionality. In General, I will be happy to receive new optimization tips and answers with instructions for bugs or memory leaks.
#include <... |
I have implemented the topological sort.
Is there any suggestion for optimizing the solution?
Thanks.
package src;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Stack;
class Graph{
int V;
LinkedList[] edges;
public Graph(int vertices){
V =vertices;
edges = new L... |
This is Merge Sort that i implemented, i feel i can make it better esp the combination function.
So i split the code into functions because i don't like seeing a bunch of spaghetti code in a single function. I have the combination logic which combines the left and right array such lower elements go first.
def combine(l... |
I have to implement some business logic that will round a number (typically a double) upwards. Given that this number comes from a third-party and I don't know how they come to calculate it I'm anticipating errors in it. My proposed routine to mitigate rounding errors (like Math.ceil(1.000000000000002) = 2) is as follo... |
I can't find an answer to this question either because it doesn't exist or because I am incapable of searching for it correctly.
Consider this code which prints out the numbers from 1 to 12 ad infinitum:
month = 1
while True:
print(month)
month += 1
if month == 13: # month >= 13 ? month > 12 ?
... |
I am new to programming. I tried to write a valid Sudoku solver with backtracking, the performance is disappointing.
So, I tried to generate a valid Sudoku generator without backtracking.
The white paper implementation is 1/3 of the required numbers of strategy to generate valid Sudoku without problem. The other 2/3 is... |
This set of questions are related to a project I've published for converting characters, or strings, to Hex based Unicode; eg...
toUnicode.fromCharacter('');
//> 1f34d
toUnicode.fromString('Spam!', '0x');
//> ['0x53', '0x70', '0x61', '0x6d', '0x21']
Questions
Are there any mistakes, such as unaccounted for edge-case... |
Problem statement
Ping-pong
The ping-pong sequence counts up starting from 1 and is always either counting up or counting down. At element k, the direction switches if k is a multiple of 7 or contains the digit 7. The first 30 elements of the ping-pong sequence are listed below, with direction swaps marked using brack... |
I am trying to improve upon a VBA code created through recording a macro. Can the code below be optimized (I was informed to avoid .Select as much as possible)? The code itself works fine for me though.
Sheets("DataExport").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Rang... |
I'm working on a program that uses the RIOT API League of Legends for collecting player data and calculate how skilled a player is by using a grading system (as of right now it just the average of the last ten games for each skills). Realize I used a lot of class, what is a better way to do it?
import requests
#ASKI... |
Context
I would like to receive feedback on my code for the question which can be seen here.
Problem
This is another C# implementation for the a function for given parameters int a, int b - both represent characters 'A' and 'B' respectively, where the function should return a string containing both characters 'A' and '... |
If you look at ImportAndPreload method, it looks bad because:
MovingAverageConvergenceDivergence, StochasticRSI, RelativeStrengthIndex and ExponentialMovingAverage. They are all indicators, they all inherit from IndicatorBase. What would happen if I wanted to pass a few more indicators? There would be 10 indicators pas... |
It is my solution from a challange from edabit.com named "Drunken Python". Thats the task:
You need to create two functions to substitute str() and int(). A function called int_to_str() that converts integers into strings and a function called str_to_int() that converts strings into integers.
I hope you can tell me thi... |
I'm writing start/stop module for my application.
I have a class that manages application life cycle and I called it Work.
Work uses WorkState class that contains 4 states the application can be in, that's:
INITIALIZING (state between NOT_RUNNING and RUNNING)
RUNNING
FINALIZING (state between RUNNING and NOT_RUNNING)
... |
I've written a 'fast & dirty' PowerShell script to harvest a system inventory of Windows client and\or server operating systems to streamline case note documentation.
$NewLine = "`n"
$FileName = Join-Path $Env:USERPROFILE 'Desktop\System Inventory.txt'
# Current Date
$TimeStamp = Get-Date -Format F
$SystemInventory ... |
I've been going through some 2019 AoC challenges and decided to solve Day 6 in Haskell with the help of Data.Tree.
In summary, the puzzle provides a list of orbits (edges) as input, resembling:
COM)B
B)C
C)D
D)E
E)F
B)G
G)H
D)I
E)J
J)K
K)L
K)YOU
I)SAN
where COM is supposedly the centre of all orbits (i.e. the root). W... |
I have Java (or C#, Python, Kotlin, or other similar language) class that will be used to communicate with client over network. Protocol used by this application allows many different ways to create connection (TCP, unix socket, serial port, …) and perform handshake (plain connection or TLS, with or without authenticat... |
I have the following tables in MySQL:
create table PostSchema
(id int not null primary key auto_increment,
categories int not null,
title varchar(50),
status varchar(20),
comments bool,
body varchar(255),
filename varchar(255),
date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
create table commentSchema (
id... |
During development I needed to design a state machine with decision which runs to completion and performs state transition without the need to wait for events. So i come up with the following implementation that I want to share.
So the state machine is described with the following Enum
public enum PnoBarringState {
O... |
Core Guidelines mention a type synchronized_value<T>, which supposedly pairs std::mutex with the internal value. I couldn't find any implementation both in GSL-Lite and MS GSL libraries.
The SV class stores T value coupled with std::mutex. It implements pointer and dereference operators which create a temporary object ... |
I recently finished chapter 8 of Rust's book, and below is my solution to the third exercise:
Using a hash map and vectors, create a text interface to allow a user
to add employee names to a department in a company. For example, “Add
Sally to Engineering” or “Add Amir to Sales.” Then let the user
retrieve a list of al... |
@Effect()
createQuiz$: Observable<Action> = this.actions$.pipe(
ofType<quizAction.CreateQuiz>(quizAction.CREATE_QUIZ),
switchMap((action) => {
return this.quizService.createQuiz(action.payload)
.pipe(
map(() => {
return new quizAction.CreateQuizCompleted()
}),
... |
This is my first time requesting a code review. This is code I wrote in Python to create a DNA sequence analyzer. This is for the Harvard CS50 course.
I was really hoping to get some constructive criticism on this code I finished for the DNA problem in Problem Set 6. This code passed all tests and is fully functional a... |
I've made a simple food inventory manager in Python3
Please tell me what can be improved
import os
import pickle
import time
remaining_ingredients = {}
dishes = []
class Dish:
name = ""
required_ingredients = {}
def __init__(self, name: str, required_ingredients: dict):
self.required_ingredients... |
I'd like to know how to improve this code because I think that the main_func is too big and I can not split it into other functions or classes.
Also, I want to know if I can or should use classes to make it cleaner.
import random
import string
def starting():
print('HANGMAN')
print('Set game mode:')
print... |
The goal of this code is to allow temporary RHS variables to be used in a span, specifically as an argument to a function, to be deleted later after the function completes, allowing the passing of temporaries to such span accepting functions.
How would I improve this code? Can I make it smaller and more readable? Is th... |
I have made a Snake clone using Java 14 and JavaFX 14. My game uses an anonymous instance of the AnimationTimer class as the game loop. The basic UI for the start screen uses FXML, but all of the UI elements in the actual game Scene were added programmatically.
The game board is stored as both a GridPane and as a 2D ar... |
Given:
G is an arbitrary graph
partitions is a list of its edges divided into (in this case) 3 sets.
Color generation:
Its purpose is to generate one distinct color for each partition.
The function turns a number between 0 and 1 into an RGB color.
For the given example, with 3 partitions, it would be called with 1/3... |
For learning purposes, I have written a small calculator app on Python, tkinter.
I want to check if my design is on best practices for OOP, And seek advice on Nested functions
For easy readability, I have only included the Addition functionality, same logic can be applied to Subtract, Multiply etc..with few changes to ... |
i get an array of authors from json response and i have to display authors name in TextView(android) in proper format like =>Viraj, Chetan and George R. R. Martin
my code work fine, but it's a mess....
public class SeprateAuthors {
public static void main(String[] args) {
String[] authors0 = {"a", "b"};
String[... |
bool is_prime(int num)
{
if(num < 2)
return false;
int sq = std::sqrt(num);
for(int i = 3; i <= sq; ++i, ++i)
if(num % i == 0)
return false;
return true;
}
We only need to check upto square root.
Proof -> https://scienceparv.blogspot.com/2021/07/mathematics-if-one-diviso... |
I want to transform a UCI-move into bitboard.
for example a2a3 -> 32768, 8388608
I need to assign [7,6,...,0] to [a,b,...,h] so that for each letter i have the assigned number(n) to calculate 2^n
Which I can then left shift by the value in uci[1] or uci[3] *8 depending on start- or endfield.
This is my approach and it ... |
I have written a simple expect script to tell me if a passwordless connection is set up.
#!/usr/bin/expect -f
if {[llength $argv] < 2} {
puts "usage: test-nopass user server"
exit 1
}
set user [lindex $argv 0]
set server [lindex $argv 1]
set pwd_prompt "*assword:"
set prompt "*$ "
set rc 0
log_user 0
spa... |
I started reading Robert Martin's Clean Code. I'm trying to "translate" all his examples into Python, so I can understand them better since my knowledge of Python is greater than that of Java.
This class formats a count in into a natural English sentence:
Java original code of the book
public class GuessStatisticsMess... |
The Challenge: Given a string, return a string where each word is reversed individually without changing its position. EDIT: (i.e.: the input "hello world I am a frog?" should produce the output: "olleh dlrow I ma a gorf?")
Thoughts and questions: Perhaps I was cheating the spirit of the challenge by using string build... |
It is a practice from the site edabit.com and you have to check if the input is valid. That is the original task:
Given an RGB(A) CSS color, determine whether its format is valid or not. Create a function that takes a string (e.g. "rgb(0, 0, 0)") and return True if it's format is correct, otherwise return False.
The ... |
I implemented the heaviest stone algorithm, but I am not sure about its time complexity. I'm doing sort which is O(nlogn), but it' inside a while loop.
Problem:
We have a collection of stones, each stone has a positive integer weight.
Each turn, we choose the two heaviest stones and smash them together. Suppose the st... |
This code is designed for my 30 LED NeoPixel clock, the reason for not using the ds3231 library is due to the fact that I use codebender to download programs to my Arduino, I wanted some critique on things that could be improved and any glaring problems that should be fixed.
/*This code is for a 30 LED NeoPixel Clock, ... |
I have a list of 2,888,991 channel objects. Each object has a name and a sample rate. I am trying to put them into a QTreeView. Each channel name is split on ':' '-' and '_'. If the name is H1:IOP-LSC0_DCU_ID and the sample rate is 16.0 then it should go into the tree as:
H1
IOP
LSC0
H1:IOP-LSC0... |
I need some opinions about method naming and single responsibility principle.
First of all, let's talk about method naming. The class below was created to provide a connection pool and whenever a pool is needed the get_pool is called. In the end get_pool will return a pool but the method will do more than only one resp... |
Made an Angular app using Firebase, RXJS and NGRX.
@Effect()
createQuiz$: Observable<Action> = this.actions$.pipe(
ofType<quizAction.CreateQuiz>(quizAction.CREATE_QUIZ),
switchMap((action) => {
return this.quizService.createQuiz(action.payload)
.pipe(
map(() => {
return new q... |
I need some help with making my code run faster. It currently works by going through all cells in a 201x151 table. If the value in a cell is not equal to zero, then it will return the row number, the column number, and the actual value, and put it in a different table.
Here is the code:
function rearranger() {
var... |
I'm solving a problem on HackerRank where I'm required to implement a simple stack.
It's passing all the tests except for the last 4 where it fails due to surpassing the time constraint of 10s. These 4 failing tests are running 200,000 operations on the stack.
How can I optimize my code below:
# operations of the for... |
I just created my first GTK+ 3 app with Python using PyGObject. It is very nice to be able to make GTK applications using Python, as I love that language. I'm not completely sure if the way I designed the code is the most conventional and efficient way, so would like some people with more experience to take a look at i... |
I'm working on some stuff that works better with (immutable async) linked lists such as this:
{ value: 'one', next: async () => { value: 'two', next: async () => null } }
Here next is an async function that returns either null or the next linked list. But I'd also be able to convert from and to iterables. So here is m... |
Task:
Write a function which returns true if a given substring is found within a given string. If the substring isn't found, then return false.
My implementation:
#!/usr/bin/env ruby
def custom_include?(string, substring)
len = substring.size
last_feasible = string.size - len
for i in 0..last_feasibl... |
This is an implementation of a dictionary (hash map) in Rust. It is loosely based on Python's dictionary implementation, using the same "random" probing and capacity/size management. Does it use too much memory or waste too many CPU cycles? Is it documented enough to be easily understood? I tried to mitigate the use of... |
In what way can I improve this? Be that performance, readability, etc.
I'm thinking implementing NumPy would improve performance.
Usage: Calculate* the nth factorial of n 1s in a row.
*No need for a precise calculation. Magnitude and leading digits is enough.
Examples:
2nd factorial of 11. (11 x 9 x 7 x 5 x 3 x 1)
3rd ... |
I started to code in c++ recently and my goal is to develop games using c++. After learning basics I tried to implement my own version of snake console based game in c++ with the help of some online tutorials. I used OOP approach. I would like to hear ideas about this code and what mistakes i have made or ways to impro... |
Based on this question:
Heaviest Stone algorithm time complexity
Problem:
We have a collection of stones, each stone has a positive integer weight.
Each turn, we choose the two heaviest stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:
If x == y, both sto... |
I started learning programming about a year ago, starting with Python. Half a year ago, I moved onto C++ and this is my first large project with that language. Have I understood the basics of the language?
In Main.cpp:
#pragma warning(disable : 4996)
#pragma warning(disable : 4244)
#include <memory>
#include <stdlib.h... |
I made a random maze generator that is also playable. The performance is crap and I'd like to improve it. I'll be working on this for a few more days to make it run better myself, but just thought I'd leave this here if people want to help.
import random, sys, time, pygame
from fractions import gcd
from pygame.locals i... |
The Huffman-Algorithm
The Huffman-Algorithm, named after David A. Huffman who first published this algorithm in 1952, is a algorithm for lossless data compression. As most encoding-methods, the words for often used symbols are shorter than the ones for not so commonly used symbols. The algorithm returns a binary code-w... |
Looking for a most elegant way to copy dictionary type alias to original collection.
using System;
using System.Collections.Generic;
public class SmallDictionary: Dictionary<string, JToken>
public class NestedDictionary : Dictionary<string, SmallDictionaly>
using System.Collections.Generic;
using System.Linq;
using Mi... |
This code below converts number from decimal to fraction. I don't know if there's a better way or better methods to do this job so any advice would be appreciated.
const toFraction = (inputNumber) => {
// Only two digits after decimal point
inputNumber = inputNumber.toFixed(2);
// destructure number
let [int, ... |
I've been working on my Rust a bit and want to know how idiomatic my rust code is for the following Project Euler problem:
What is the largest prime factor of the number 600851475143 ?
I'm not looking for ways to improve efficiency or how to improve the strategy, but purely what I can improve with my Rust technique. Th... |
So I have been working on this Chess project and for that I need a move generator. I wish to know if I can improve my code for the move generation for the Knight. Here is my current code;
Let me tell a few things so you can better understand it. I am using vector<vector<int>> for the main pseudo moves. I use add the mo... |
I am writing some code that takes and returns interfaces following the patterns in Effective Java Third Edition. I understand the principle - we want to take in interfaces because in many cases we don't really care about the discrete implementation but rather just the features of this interface. We return interfaces fo... |
I have an app whose sole purpose is to seed data files and add the data to different CSVs which are zipped and exported by the user. My application controller is filled with lines that all look like this:
def export_tips
@appointments = Appointment.order('service_id')
send_data @appointments.to_csv_tips, file... |
Wrote this program out of curiosity after initially solving the Word Chains puzzle. Explanation of puzzle in link below.
http://rubyquiz.com/quiz44.html
NWordChains#find_word_chains will take in a number as an arg and return that amount of random word chains from a given dictionary. Initialize NWordChains.new and then ... |
I have just written this code that takes an initial coordinate and returns a new vector depending on a user-supplied range and bearing.
The calculation of the new position is done using Complex Numbers. I am sure there are easier ways to do this, but I wanted to play around with complex numbers. Any thoughts on these w... |
The spreadsheet can be found just above the references section at this link.
https://www.sciencedirect.com/science/article/pii/S1872497316301429
It's a publication for STR DNA locus frequencies to calculate match probabilities. I'd like to build a match probability calculator and scale it up to do hundreds of thousands... |
I've been trying to learn java recently and I finally finish my first code. Any suggestions on where I can improve? Also, is it possible to send an argument to a class using something like an init function in python and are there any good and bad habits that I should keep in mind?
class LIFO {
//Create an empt... |
(Sorry for my bad English)
Hi, I'm interested in getting feedback of my own implementation of Conway's Game of Life.
Some details:
Uses gloss for animation
Uses rio for shorter dependency list
My implementation suffers from performance issue when the population grows larger than 2000 cells.
My code:
Main.hs:
modul... |
I have implemented the following program below for an assignment for practice on STL templates and algorithms. All I'm doing is implementing the code for the printing of empty files, un-empty files, etc.. I would love to know if there is any way to make the code more optimized.
Note: From the requirements of my school ... |
https://leetcode.com/problems/my-calendar-ii/
Implement a MyCalendarTwo class to store your events. A new event can
be added if adding the event will not cause a triple booking.
Your class will have one method, book(int start, int end). Formally,
this represents a booking on the half open interval [start, end), the
ra... |
Description
I have created a darkroom timer, which is used for enlarging and developing film.
It has four separate timers, and can toggle mains via a relay to turn on the enlarger for a specified amount of time. Something like a mix between a triple timer for development and an enlarger timer.
For this project, I used ... |
Is there a way to rewrite these last 2 recursive functions with fewer arguments (preferably 2) while keeping them recursive?
The entire code can be seen here: https://github.com/GirkovArpa/hutton-typescript
Maybe it's perfectly standard to have so many arguments. I don't know.
Also, the encrypt and decrypt functions a... |
I've written a .NET Core console application to monitor the operation of a sensor network and I'd like a review of the task scheduling performed by the main program loop. There are three tasks that are all declared as public static async Task that perform the following operations:
CheckGateways.CheckAll connects to an... |
I am new to python, I made a calculator but I need to make it calculating unlimited numbers and to shorten the code more, how can I improve it?
Any help is appreciated.
while(True):
print()
try:
nums = int(input("How many numbers you want to calculate?\n"))
# x = float(input("Enter the first number:... |
I wanted to do a very little project of a team scrambler. There are two teams of 5 players. Each player has a unique color (in his team) from a limited pool. You can use 2 actions :
Scramble the teams which mix all players between the two teams
Request new color for a team which reassign new color for each player of t... |
I have written a script which does parsing to the input file and take out some values from them with respect to the node and print the data accordingly.
Below is my script, and it works as expected:
#!/usr/bin/perl
use strict;
use warnings;
use Time::Local 'timelocal';
use List::Util qw(reduce);
use POSIX qw( strftim... |
I'm practicing algorithms, and I just can not come up with a faster solution to this problem, but I'm not hitting the benchmark.
Problem: In a large list of large integers, I must find the one element, that is present in odd numbers. E.g. [1,1,1,1, 2,2, 3,3,3, 4,4,4,4].
I wrote several solutions, but I can not increase... |
I am asking this, because after studying I am confused that it is necessary to declare base class object, then declare derived class object and then store reference of derived class object in base class in c++ to use polymorphism.
But what do you think, did I use polymorphism in Accounts, CurrentAccount, SavingAccount ... |
I am still learning PowerShell and I would like your opinion on my folder deployment PowerShell function. It basically check if a defined folder exists and creates it if it does not and writes it actions to log and console.
<#
.SYNOPSIS
Creates folder if it does not already exists.
.DESCRIPTION
This function check if d... |
Here is MIPS code to return 1 if a number is even, 0 otherwise:
isEven:
andi $t0, $a0, 1
li $t1, 1
sub $v0, $t1, $t0
jr $ra
My question is whether this can be done in fewer instructions. I could implement isOdd in two instructions (by eliminating the li and sub), but I don't see a single-instruction way t... |
I wrote this login system in the evening and i would like to know what should I fix / change, if should I use classes and, about readability, if this code is OK.
I'm a begginer in coding so made this small project only for exercising, but good to know wether if i'm things doing right or wrong.
import os.path
credentia... |
Mind that this is my first actual program in C++ and I tried to prepare for any possible input. Also the reason I included static_cast<void>(generator(range)) is to throw away the first random value because I read on LearnCpp.com that throwing away the first is a common practice to produce more random results. Anyway... |
I solved this exercise on jshero.com but I know the solution can be written more cleanly, I just don't know how.
Here are the directions:
Write a function addWithSurcharge that adds two amounts with surcharge. For each amount less than or equal to 10, the surcharge is 1. For each amount greater than 10 and less than or... |
This is my code, which chooses a random number from 0 to 10 for the user to guess.
//guess the number game
//my code
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
unsigned int secretNumber;
int guess;
int maxNumber = 10;
int maxTries = 4;
int nu... |
I reimplemented cat(1) for fun. I followed the Open Group Base Specifications (Issue 7, 2018 edition), not the GNU variant and its command line arguments.
Buffered and -unbuffered behaviour
While the specification defines the behaviour for -u, it doesn't define how the arguments should be concatenated when the -unbuffe... |
Goal
Return a deep copy of a double LinkedList.
Each node also contains an additional random pointer, potentially to any node or null.
Code to start
data class Node<T>(
var data: T?,
var previous: Node<T>? = null,
var next: Node<T>? = null,
var random: Node<T>? = null
class LinkedList {
// TODO: ... |
I'm finding it difficult to decide on the best architectural pattern for a SwiftUI app but, for the moment, I'm sticking with MVVM as I found this a good fit conceptually.
I'm trying to avoid the SwiftUI layer knowing too much about the business logic and navigation structure but am struggling to decide how best to ach... |
For the sections between count=1s and the start and end; combine overlapping positions and output the median of the counts.
Input
chr start stop strand count
chr1 0 13320 - 1
chr1 13320 13321 - 2
chr1 13321 13328 - 1
chr1 13328 13342 - ... |
I have written the following method that allows me to import from another API all the items stored there using Feign.
The only issue is that the external API provides a size limit of 2000 and therefore I need to take pagination into account to get all the records.
I think that my solution is not very clean and maintain... |
I'm using NumPy to find out langrage polynomial interpolation. I'm using 2 for loop to find out langrage polynomial, but I want to reduce 2nd for loop so that my code time complexity can be less. Can you guys please suggest me how I can cut a for loop to increase my time complexity.
import numpy as np
import matplotlib... |
I would like to get any feedback about my implementation of Dijkstra algorithm in Rust following this youtube video.
Please be aware that this my first code in Rust as well as my first Dijkstra implementation in any language.
type Vertex = char;
#[derive(Debug)]
struct Connection {
peers : (Vertex, Vertex),
... |
I am still learning PowerShell and I would like your opinion on my log writing function. It creates a log entry with timestamp and message passed thru a parameter Message or thru pipeline, and saves the log entry to log file, to report log file, and writes the same entry to console. In Configuration.cfg file paths to r... |
I made a project, that scrapes images asynchronously and saves them in container. I have access to them through volume. Scrapy finds images on given web page.
Any tips will be good. But first I would like to focus on docker-compose I would appreciate tips on how to improve it.
files tree
My project looks like that. cel... |
I have a pivot table of approximately 2 millions lines coming from a dataframe with the same structure as below:
raw = pd.DataFrame([[123456,datetime(2020,7,1),'A',10 ],
[123456,datetime(2020,7,1),'B',25 ],
[123456,datetime(2020,7,1),'C',0 ],
[123456,datetime(202... |
This is my first ever c# script. I have played around a little and I think this is some proper c# code. Since it's my very first c# ever, I'm assuming there's a few mistakes, things that could be better, bad conventions and such. If you see any, please let me know so I can improve!
using System.Collections;
using Syste... |
This program will ask for user to insert summoner and base from the last 20 games of said summoner, it will give avg stats and see if good or not by wins in last 20 games(a simple grading system).
import requests
from getId import idcollect
from games import GAME
from wins import win_calc
#Key for riot API
Key = '****... |
I am currently practising using the SOLID principles in C#/.NET
I have made a little example, but i am not sure if i have followed it correct.
Its a simple example where i have an API controller that calls a method to get a list of users from an database and returned as DTOs.
To use the method i need to submit an IUser... |
so I am playing with Rawg.io 's API.
U can sort their game list by their release date, however there are just too many games. In their website, there's an option called "Popular only", which only shows games that are being followed by at least 1 people.
I implemented this feature by sorting the elements I get and creat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.