instruction
stringlengths
71
95.1k
Why did I make this? I'm building an interactive data structure visualization, and when certain errors are thrown from certain parts of the code, they are displayed on screen for the user. I have not included that displaying logic. The if checks seem somewhat smelly to me, but they might be simple enough to the point t...
I am a beginner and trying to send data from AWS DynamoDB to Azure Queues. Note that this code will be invoked 10,000 and alot more. Can you guys review it once. using System; using System.IO; using System.Text; using Newtonsoft.Json; using Amazon.Lambda.Core; using Amazon.Lambda.DynamoDBEvents; using Amazon.DynamoDB...
For a long period of time I worked on this code, mostly trying to understand it. That is the main reason for needed review. Second reason is simply that I would like to optimize it in any way you can find. Side note: I have shortened the code as humanly possible. Compilation of the below code: g++-8 -O2 -std=c++17 -Wal...
I made this simple program that can solve every set of linear equations in two variables. You just need to enter two linear equations of the form ax+by=c (without any unnecessary spaces) where 'a' is a positive integer (i.e. x should not have a negative coefficient) and b and c are just integers. The program can also s...
This is the first time that I have tried programming in such a general way using c++. I have tackled this pattern before in other languages such as golang, but this is my first attempt with cpp. Subscriber template // class template for a subscriber that wishes to be informed of the // occurrence of a particular even...
This is a program that can decrypt the codes that have been encrypted using the algorithm that my previously posted encryption program follows, you just need to enter the encrypted text from that program. I got a lot of suggestions from people on the encryption post, I have tried to make this program as short as possib...
I often see very long code lines like this: <input type="email" name="email" autocomplete="email" id="email_address" value="<?= $block->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-mage-init='{"mage/trim-input":{}}' data-validate="{requ...
This is code for finding if inequality \$abc > 2(\text{area of triangle})\$ where \$a\$, \$b\$ and \$c\$ are the sides of any triangle. The below, and repl, code work as intended. However they take a long time. Can the performance be improved without reducing max_tries? import random import math hn=100000000 num=0 ma...
The data are in a file called test.txt, which is available at https://drive.google.com/file/d/1g0ffvH5oP5C4Cp6ciEp_L1Rst6WeTuYG/view?usp=sharing. There are some odd formatting things about it which I cannot replicate by putting on this website, hence I'm hosting it on my Google Drive. It is just simulated data, so ther...
I've built out a section on a page that contains multiple instances (why I'm using querySelectorAll()) of this Request Brochure form. They are using Campaign Monitor so much of the form code has been removed for this post. Operation On page load an event handler that calls preventDefault on click events is added to e...
I have a RadioStation class file and a view controller where I create two station objects based on this class, one for FM and one for AM. I created both of these station objects from within the same required init method. I'm not sure this was this the best way to do this, for example can you imagine if you wanted 8 su...
I've decided to implement a simple case of the Observer pattern. I've gone about this considering you can only register 1 single observer in the Observable, instead of allowing multiple ones. I would really like feedback about what'd be the proper way to return the listener in the run method while still yielding value...
I am dealing with a large amount of XML files which I obtained from here https://clinicaltrials.gov/ct2/resources/download#DownloadAllData. The download yields around 300.000 XML files of similar structure which I eventually want to load into a single dataframe / csv. The code gives the result that I want: Each row is ...
So I wrote this a while ago and yesterday I was going through it and trying to remember every line of code and how it works. Well, the program simulates a online bank account as well as an ATM. You register your account, you are able to withdraw, deposit, and transfer money. There is a limit to the amount you can trans...
I just started programming a week ago. Online tutorials aren't my thing, so I decided to just start projects and learn what I need for the project. My first project is a guess the number game. The user is asked to guess a number between 0 and 20. If the user's guess is too high, they will be told it's high and likewise...
I am trying to migrate from request to axios, since request has been deprecated. Suppose that the URL 'https://www.example.com' receives a post request with formdata that contains login information, and also suppose that I need to maintain the current session across multiple requests (for that I need a cookieJar). Usin...
I have an application developed in ASP.NET Core C#, where according to a configuration it must replace certain urls of a text when an http request is made and the text must be returned as soon as possible in response, the text can change on each request. At this moment the code I have is working well, but I would like...
Its been a while since I have written PHP or HTML for a project, so I could use some thoughts on improving the code below. I wrote all of this going off of old knowledge, so I imagine its really sloppy and can be written a lot cleaner. All of the code below works. Here is the link to the project on GitHub <!DOCTYPE h...
I am using Python 3.8 with ArcGIS Pro 2.5. This code creates a joined table where I match values for plant greenness in the current month with rainfall X number of months into the past. Each loop iterates through about 600 files (the number of files in ws1 and ws2). The code works perfectly but slowly, taking approxima...
Python script that can download images and videos of the user, like Gallery with photos or videos. It saves the data in the folder. How it works: Log in in instragram using selenium and navigate to the profile Check the availability of Instagram profile if it's private or existing Gathering urls from images or video...
I am creating web page in which I get user location and store it in an input field of a form using javascript. But perfomance is slow.Review my code and provide a better way. var LocArrayForPerfomance = []; LocArrayForPerfomance["longitude"]=document.getElementById("longitude"); LocArrayForPerfomance["latitude"...
I followed a video on YouTube to create a custom user model, this is my attempt: # Django Imports from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.db import models # The Custom (UserManager) Class class UserManager(BaseUserManager): # Defining A Function That Will Be Used To Cre...
After just learning a bit of Python I tried coding something myself. I attempted to do a game of Blackjack, which is far from perfect, and still doesn't have some rules a real game has (in my game an ace is always 11 points, whereas in reality it can also be counted as 1 point). There is however an issue that I'm havi...
I have a PHP CodeIgniter website that collects volunteer registrations. One thing I have noticed is that the controllers are getting really big. The controllers have many methods, and each method is fairly long. I believe this could be a code smell, and I would like some help and advice on how to refactor the code. The...
I wrote a program to insert a checksum into a Game Boy cartridge. Here is a spec of the cartridge header, but I'll include the relevant information here, as well. The header checksum is defined as the sum of the bitwise-NOT of the 52nd through the 76th bytes of the file, inclusive. The global checksum is defined as the...
I use the following code to add tree item to vscode extension, Im getting the data and build the tree according to the entries I got, the code works. As I new to typescript I appreciate your feedback's, if the code looks good let me know either :) thanks export class TaskTreeDataProvider implements vscode.TreeDataPro...
I am relatively new so any help would in improving this and future codes. The code involves basic file management for two different files, one for buses and another for the employees and I am not very experienced with file managing so expect some beginner errors and mistakes #include<stdio.h> #include<stdlib.h> #includ...
A friend gave me the following riddle: Given n people with n distinct names, you place n names tags on a round table with n seats. If the n people now sit at those seats randomly such that exactly one person sits correctly (in the seat with the correct name tag with their name one it), can we rotate the table such tha...
I'd like you to take a look at those extension functions I made in kotlinjs (version 1.3.61): inline fun <reified E : Element> Element.queryHtmlSelectorOrNull(selectors: String): E? { return this.querySelector(selectors = selectors) as E? } inline fun <reified E : Element> Element.queryHtmlSelector(selectors: Stri...
So I attempted to write Conway's game of life on an Arduino and display using the FastLED library. I use a custom bitset class to manage the game board state. I'm looking for feedback on performance, and general code style towards embedded systems. I should note that my led strip is a little bit weird see diagram below...
I'm trying to preprocess a large text document. I've written a text normalization function which takes a disproprtionate amount of time and memory. How can I format the function to lower these two? The time result below was for this example. t = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod t...
The N-Queens puzzle can be solved in many ways. One is by a depth-first-search backtracking algorithm. Below is my generalized version using mutual recursion: let dfsBacktrack initialValue solved getNextItems = let rec procCurrent path = match solved path with | true -> Some path | false -...
The natural logarithm can be approximated by the following formula: $$ln(x) = 2\sum_{k = 0}^{\infty}\frac{(x-1)^{2k+1}}{(2k+1)(x+1)^{2k+1}}$$ I've implemented this formula using Java. Parameter n is the amount of iterations to approximate the natural logarithm. static double lnApproximation(double x, int n) { ...
everybody. It took a tree of squares for my web game. I wrote a preview using Typescript. I would like to hear from you tips on how to improve the code (I just started writing in Typescript). First of all, I would like to improve performance. I have a couple of ideas but I don't know how to implement them: What if yo...
My target website is Indeed. I tried to implement the scraper such that it is convenient for the end user. I am introducing my code in the readme file on my github repo. I am somewhat a beginner in programming so I am looking for guidance on things such as if the libraries that I used are approriate, the code itself an...
The full repo is here, but I'll post the most important extracts below. Background I'm trying to get the hang of blockchain and public key cryptography, so I thought it would be fun to create a program for drawing up and promulgating government decrees - the government in question being one that I've just made up. The ...
I have a list of rule names coming from .xml file. These rule names needs to be validated against rule names in database (Validator.cs). If valid, then Id of these rule names are used to fetch user data from database (ExportService.cs). I am using a Dictionary object to save name, Id pair from database - Validator.cs...
I have this method that attaches the year and year's rowspan for a TD and Quarter and a Quarter's rowspan for the TD. Year and Quarter are 2 columns in an Angular Material Table which are calculated from an array of objects one of which property of the object is a date string. Here is a demo for the code: https://stack...
I have written this code as a college assignment fot the famous job sequencing problem. Please tell me any improvements if possible. Oh, for algorithms.h header file, refer my github repo The code: #include "algorithms.h" struct Job { int index = 0; int time_slot = 0; int profit = 0; public: Job() = ...
I was working on making a cache in bash and I found this link - But this guy is attempting to generate new bash functions by introspecting their source and generating a new one as a cache. This seems to me, way overkill. Here is my implementation and it works just fine: cache() { local file file="/tmp/$(printf "%s"...
Please check the following the LRU cache implementation. Thanks for the valuable comments import java.util.HashMap; import java.util.Map; public class LRUCache { HashMap<Integer, Node> lruHashMap = new HashMap<>(); private final int DEFAULT_CACHE_SIZE =5; int capacity = 0; class Node{ int v...
I'm a very new Haskell programmer, and I've written the following code for loading TSV files. I think it can be improved, but I'm not sure how. I feel like the giant "do" block in loadData is inelegant, and that there's likely a better way to approach this. I think I'm trying to avoid the IO monad because I'm not sure...
Problem A non-empty array A consisting of N integers is given. Array A represents numbers on a tape. Any integer P, such that 0 < P < N, splits this tape into two non-empty parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1]. The difference between the two parts is the value of: |(A[0] + A[1] + ... + A[P...
I'm trying to come up with a design for a chess engine in Kotlin that hides implementation details, and that ensures that such an implementation cannot accidentally become spaghetti. Client side example code I envision that a client would access the chess engine with something like: package chessprototype import chess...
I implemented a compiler that compiles a dialect of BASIC known as SimpleBASIC into Simpletron Machine Language to be run by the Simpletron simulator. I wrote the manual for the SimpleBASIC compiler in troff, it contains the commands of the SimpleBASIC language and some example programs. simple(6) ...
The following code uses dynamic approach to solve 0/1 knapsack problem. (I know the maximum profit function I have used is not as good as the one I have defined here and I still am working on that . Are any optimizations possible for the following code? #include "algorithms.h" struct Item { int index = 1; int ...
As a hobby I am working on a game engine in order to learn C++ and graphics programming, now I have completed my first iteration of my camera system using OpengGL and GLM. Because I am mostly self taught I am searching for some feedback. I am mostly searching for feedback regarding the following points: Is the API eas...
This is the first time I am posting here, so please go easy on me : ). I am also writing for the first time python code which uses async / await for streaming web-socket information. My main goal is to: Connect to a web-socket Stream info from web-socket Continuously save the streaming info somewhere (to DB for exampl...
As I was streaming I had a brilliant visitor suggest we write a blockchain in Python. So we did. Note that there is no validation or voting simulated here. Here's the results, in package/blockchain.py: from __future__ import annotations # https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports from oscr...
I have a part of code that is loading a dataset and normalizing property values to [0, 1]. My implementation is: import pickle import numpy as np # -- load data prop_1 = list(np.random.rand(10)*20) prop_2 = list(np.random.rand(10)*10) prop_3 = list(np.random.rand(10)*30) # -- normalize l_bound = [] l_bound.a...
The following snippet of C includes implementations for both Windows NT and POSIX-compliant systems to get the time (with microsecond resolution) since the Unix epoch. In the case of Windows NT, the time is registered as 100-nanosecond ticks since the NT epoch (1/1/1601), so it requires a bit of conversion. I feel like...
I am a beginner in python. This is the Nested Lists problem from HaackerRank. Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, o...
I started learning python online and I wrote a blackjack game as my first little project. I would like to get some review on it if possible. (how to make it better , simpler , etc) from random import choice cards = ['A', 2, 3, 4, 5, 6, 7, 8 , 9,'J','Q','K']*4 def get_card(name): card = choice(cards) cards.remo...
Introduction I am recently learning Rust by reading The Rust Programming Language (a.k.a. the book). I have finished the first three chapters so far, and this is my attempt for the first exercise listed at the end of Chapter 3, which has a simple description: Convert temperatures between Fahrenheit and Celsius. My p...
I've created some controller for handling clicked links statistics. Does this class meet Single Responsibility Principle? class StatisticsController { protected $statisticsQuery; public function __construct(StatisticsQuery $statisticsQuery) { $this->statisticsQuery = $statisticsQuery; } pu...
I do not have an intention to ask for an answer, but I want to know if my answer is good for a two-week Python beginner? Question: (Automate the Boring Stuff with Python/ page 102) Comma Code Say you have a list value like this: spam = ['apples', 'bananas', 'tofu', 'cats'] Write a function that takes a list value a...
I'm trying to replicate Android's GenerateViewId() to assign a unique Tag to dynamically created UIViews in Xamarin.iOS. internal static class LayoutExtensions { // A tentative to mimmic Java's AtomicInteger used by GenerateViewId() // https://android.googlesource.com/platform/frameworks/base/+/master/core/java...
I developed this small code to make my life easier when I work with remote machines over ssh tunnel crossing a bastion host. I would like to publich it so others could benefit/learn from it. So I would appreciate your opinions for improvement or maybe I overlooked some issues in this approach. Goal: I have a postgres ...
EDIT: Added a block with the raw code at the bottom (suggested by a friendly user) First post here. I sincerely hope that I am doing everything by the book. Also, I want to thank you in advance for any help and assistance that you may be able to provide me. I have been coding VBA for 2 weeks. Problem: What can I do to ...
I'm switching my neural network library over to using ArrayFire for performance. One of the features I am losing moving from ndarray is ndarray_einsum_beta, as such I need to write my own function to carry out what I was using einsum for. This function needs to be as fast as possible. This is the function: fn arrayfire...
In a particular social network friends are automatically allocated to users by the system and users cannot add friends of their choice on their own. There are currently N users on the social network, labeled from 2 to N+1. For every ith user (where i ranges from 2 to N+1), the system allocated all the users labeled wit...
I made a C# console math project where the user answers addition, subtraction, multiplication, division, power or square-root questions based on the difficulty they choose! However, I am struggling to refactor one part of my code. Here is my code: using System; using System.Collections.Generic; namespace mathstester {...
On a Manhattan grid, find the intersection of two paths closest to the origin. input_3.txt can be found here and the prompts can be found in the original problem statement. import re with open("input_3.txt", "r") as f: coordinates = [wire.split(",") for wire in f.read().splitlines()] class Point: def __init_...
I have a list of about 55k Accounts that I am cleaning up. 95% of them are from US/Canada which is what I'm most concerned with. I am going through record by record and will perform various checks and fill in or correct City, State, Zip, Country. I have a table with every City, State, and Zip for US and Canada that ...
The following is my attempt at parallelizing (I learned about parallel computing over the last weekend, so I'm very new to it) and making more efficient the code in my previous question Block Bootstrap Estimation using Java. The text file text.txt can be found at https://drive.google.com/open?id=1vLBoNmFyh4alDZt1eoJpav...
I am learning python by solving python module from HackerRank. This problem is Find the Percentage. You have a record of N students. Each record contains the student's name, and their percent marks in Maths, Physics and Chemistry. The marks can be floating values. The user enters some N integer followed by the ...
Recently I wrote a validator for some objects. To increase usability the validator gives the user hints on how to fix some of the found issues. Since the application is around something programmatic, and that many of the issues wouldn't make sense without identifying a path to an object; I decided to build a navigator....
i am trying to create a semicircle menu with animations and texts. Currently i try to position the texts in the semicircle which is only working with a specific window-width and browser. This is my current approach: https://codepen.io/Jxner/pen/xxGBKYJ .menu { padding: 0; list-style: none; position: relative; m...
I need some pointers on how I can speed up my code, as of now it is incredible slow for larger inputs. The way the code works is that the file Loc_Circle_50U.txt contains the true locations of 50 vehicles while the files in ns3_files contain some erroneous locations. I analyze these differences which are stored as erro...
The following is a simple class for establishing multiple http connections, mainly for downloading a list of small files: #include <cpprest/http_client.h> #include<string> #include<vector> #include <mutex> #include <cpprest/filestream.h> using namespace utility; // Common utilities like string conve...
I wanted a simple code review for improvement to increase the efficiency of my text generating model. This model is taken from the official TensorFlow site but is being trained on different datasets. I am using TensorFlow 2.0 (beta1) GPU version and Keras. I was training this on a Harry Potter book but I found that the...
I've spent the last few days learning the beginnings of how to implement a simple neural network. I've gone through chapters 1 and 2 of this book and have tried to write my own NN with referrals to the code given when I had some trouble. I am working with the mnist dataset. At the bottom of my question I have listed th...
Exercise: Design a Stack A Stack is a data structure for storing a list of elements in a LIFO (last in, first out) fashion. Design a class called Stack with three methods. void Push(object obj) object Pop() void Clear() The Push() method stores the given object on top of the stack. We use the “object” type here...
I am working with a project of using modern C++ on the Game Boy Advance (repository is here, code under the MIT license). Being a fairly limited platform (288 KB of RAM maximum, no memory controller), I try to avoid as best as I can the use of dynamic memory allocation (malloc and friends). Since now I could get away w...
I have written a few C++ functions that should: take in a string transform it based on index transform it based on number of alphabetic characters seen return the transformed string Example first, detail after: $ rotn_a("Hello, World!") > Igopt, Exbwp! $ rotn_a("aaaaaaaaaaaaaaaaaaaaaaaaaaa") > bcdefghijklmnopqrstuvw...
I build database called MessageBoard and created StoredProcedure GetHomeView that return data for HomeView. I am completely new in this area. Stored procedure contains next fields: Id - Key fied. ForumId - Field that should be in result query because it is need to know, which forum should be loaded if user will open ...
For a project I am using the yelp dataset (found here: https://www.yelp.com/dataset) to create a Hashset of all verbs, nouns and adjectives found in the restaurant reviews. I have it up and running using the stanford nlp pipeline, however it is quite slow (takes about 1 hour to process 10000 reviews) and the dataset co...
This is my first time writing an authentication system. Here's how it works, first client needs to send credential within authorization header like { Authorization : 'Basic ' + credential } through API. I encoded the credential with base64 encoder ('username:password') and then if the authentication is successfully it ...
I have written some Python code that opens files one by one, does some work, and writes data onto the filesystem. I figured, I want to make use of my cores.I've refactored the program into this. from multiprocessing import Pool import glob def work(file_name): # do work pass if __name__ == "__main__": poo...
The code returns a string ready to seed at sites like sudoku-solutions.com. It works great but as I couldn't find other simple examples for my level I hope for some insights on this and ways to correct what is wrong. let sudoku = []; function shuffle(a) { for (let i = a.length - 1; i > 0; i--) { const j ...
I'm not certain if my implementation is correct, it appears to be, but looking for any feedback as far as readability and efficiency goes. Obviously using dictionaries isn't particularly efficient space wise, but how else could you achieve O(1) lookup? import os def get_suffixes(string): return [string[i:] + "$" f...
I have a business requirement where I have to read excel files and match each cell with a given keyword list and find the matches and write it into a dataframe. I have written the code, but when the excel size is increasing (7 MB - 5 sheets, 30k * 9), the code is taking unusually long time (40 minutes), and I know that...
This is an extension of Block Bootstrap Estimation in Java - Part 2. The text file text.txt can be found at https://drive.google.com/open?id=1vLBoNmFyh4alDZt1eoJpavuEwWlPZSKX (please download the file directly should you wish to test it; there are some odd things about it that you will not pick up through even Notepad)...
I created a dynamic insert function for PDO. It does work, but I want to be sure that it is secure and well coded. function insertNewRows($pdo, $table, $fields, $placeholders, $values=''){ if($values){ $result = $pdo->prepare("INSERT INTO $table ($fields) VALUES ($placeholders)"); $result->execute(...
I am assigned to a task of creating a function int logBase10Estimate(int n) that returns the log of a number base 10. The answer is integer part only.(w/o using the Math class) Is this okay? static int logBase10Estimate(int n){ int count = 0; for(int x = 10; ;x*=10){ if(x < n){ count+=1; ...
I am working on a Code Kata // There is a queue for the self-checkout tills at the supermarket. // Your task is write a function to calculate the total time // required for all the customers to check out! // input // customers: an array of positive integers representing the queue. // Each integer represents a cu...
I wrote a program where the computer guesses a random number. To do this, I implemented a form of binary search. This correctly handles any edge-cases that I know of, including 0 and std::numeric_limits<int>::max(). This doesn't handle negative numbers (since rand will never return one) but that could easily be fixed. ...
The gist of my program is to simulate the growth of some virus. I used (attempted) OOP concepts to break down the problem into chunks and have the chunks talk to each other. Not sure if my implementation is effective but it seems to work pretty good. Currently, the bottleneck seems to be in the plotting. I'm still le...
I'm trying to develop a web application for documentation.. The tool is functional.. Please review the code & help me with performance tuning & simplifying the JavaScript part.. Any suggestions or comment most welcome. Thanks in advance! Note: Please type something on the <textarea> to see the live preview $(functio...
I wanted to try and learn multi-threading, so I thought it would be good to make a small program normally first and make it multi-threaded, so I made this prime finder. from time import sleep def prime_finder(num: int) -> bool: """Checks to see if a number is prime""" if num == 2: return True divi...
I use zypper to download and install for openSUSE Tumbleweed (much like everyone else of course). Unfortunately it downloads packages serially, and having about a thousand packages to update a week, it gets quite boring. Also, while zypper can download packages one-by-one in advance, it can't be called concurrently. I ...
https://leetcode.com/problems/search-a-2d-matrix/ Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of the previous row. Example 1: ...
I finally finished my Conway's game of life in c++ project and i'd love to find out how to improve the code. main.cpp #include "Engine/Engine.h" int main() { Conway::Engine Engine(1280, 1024); Engine.Run(); return 0; } Engine.h #pragma once #include <SDL2/SDL.h> #include <memory> #include "Board.h" //...
I have two tables with a 1-many relationship, Device and TestResult. My application has a filter builder front-end that allows a user to retrieve TestResults based on whatever filters they specify. This generates queries similar to this: SELECT d.id, d.serialNumber, d.createdAt, r.id, r.tes...
I had a coding assignment task(interview) for a senior data engineer role, JSON data validation. Every record in the input json indicates a customer record, I need to write a script to validate that all records confirms to few business rules and few more field type/length restrictions. I used object-oriented, meta-data...
I am attempting to animate the series of button presses in the simon game I am creating with tkinter. The animate method is called for each button that needs to be pressed in the series. It currently presses all of the buttons at the same time rather than in a series as it is meant to. from tkinter import * from random...
I'm trying to recreate the method inject (Works like Reduce) from ruby Enumerable Module. Using Rubocop (A Linter) I got the error: Cyclomatic complexity for my_inject is too high. [7/6] The code is: module Enumerable def my_inject(*args) list = to_a if Range reduce = args[0] if args[0].is_a?(Integer) o...
I've built a simple Book list app. It allows users to enter the name, author and isbn of a book into a form. Then when this is submitted successfully, the details get added to a new row in the table. I've tried to make the code as optimal as possible. Any feedback would be greatly appreciated. const bookList = document...
I've always wondered what's the most elegant way of implementing PrintLn in C++. I have not yet come with perfect conclusion. This is my shot. Shortcut for std::cout, std::cerr and std::clog "print line" version. So you can type CoutLn << "Hello world!"; instead of std::cout << "Hello world!" << '\n'; CoutLn, CerrLn, ...
Wrote my first mini-script to get data from the german football league table and save the data to a csv file. Do you like the approach or could I be more efficient? Thanks in advance! from bs4 import BeautifulSoup import requests import csv url = "https://www.bundesliga.com/de/bundesliga/tabelle" r = requests.get(url...