instruction
stringlengths
71
95.1k
I have integrate aad authentication using react-adal client and secure paths using private routes method I'm not satisfied with the code structure so I would like to improve it. Here's the code index.js import { runWithAdal } from 'react-adal'; import { authContext } from './auth.js'; const DO_NOT_LOGIN = true; runWi...
I am a beginner at coding with Python. I am excited because I wrote a program that works in JupyterLab, but I know I can make it shorter. For example, I feel I should not need to write so many boolean operators, and print statements. Also, I am not sure if the break I put at the end is ideal. Can you advise me? Purpose...
I am trying to deal with some calculations on nested vector data in C++. The nested vector data may be like std::vector<long double>, std::vector<std::vector<long double>>, or std::vector<std::vector<std::vector<long double>>>. I want to focus on summation here, and the calculation of summation could be done with the S...
I have this task where I have to make my robot find the shortest way when I enter a destination point. I've created some functions to assign numbers (distances) for each square and counts its way back to my robot by deleting the other options. Then the robot should only follow the numbers. Here's also a screenshot of t...
This is a problem from Hackerrank (https://www.hackerrank.com/challenges/2d-array/problem). We're given a 6x6 (always) 2D array and asked to compute the sums of all the hourglass patterns in the array. An hourglass pattern is of the shape 1 1 1 1 1 1 1 where the 1's form the hourglass. In this case the sum is 7,...
I'm a beginner developer and I'm building a calendar for smartphones. I'm using HTML, CSS and JS. I'm not entirely done with the project yet, however, I have the feeling that I'm making a messy code. I'll be posting the link to the git + the code in here, so you can better read it/clone, and help me with design pattern...
I have an algorithm that I use to render a text GUI using Swing's Canvas, it looks like this in practice: My goal is to reach 60 frames per second for a full HD grid with 8x8 (in pixel) tiles. Right now a full-screen grid composed of 16x16 tiles (1920x1080) renders with 60, but 8x8 tiles have abysmal speed. I profiled...
This code takes a user input number which is a positive integer, and outputs a string representation of the number in binary. For example, input 2 outputs '10' and input 25 outputs '11001'. As far as I can tell it works correctly. Please review it for good style and organization, and I'm especially looking for a crit...
I don't know if this is acceptable, but I would love to thank the community for their advice concerning my previous post on this project This is a beginner's project. Library management system aims to handle the basic housekeeping of a functional library, so far I have implemented the BookItem class and with advice fro...
I have a neural network that I am training on a loss function composed of two terms (i.e. loss = loss1 + loss2). Ideally, I would like for both loss1 and loss2 to simultaneously decrease. Although I am wondering, is there any way to ensure neither loss1 nor loss2 increase during training, i.e. while minimizing loss is ...
This program is a project out of Udemy course. Kindly request you to review my code and suggest insights to better it. It takes your password hashes (sha1) and then sends hashedpassword[:5] to https://haveibeenpwned.com/ website. Gets the response and checks whether our hashed password is present in the response got fr...
First, thanks so much for looking at my code. Over the past decade, I have tried every task management apps imaginable. I finally realized that the only way I would ever find my perfect productivity system is if I build it myself. To this end, I am creating ClearHeadTodo, a productivity app that seeks to bring the GTD ...
i'm self learning programming and following CS50 course on Youtube. Below is my attempt to solve the PSET 3 Tideman. The program "seems" to work, as it doesn't produce any errors or warnings, and it seems to produce the result correctly for a few test cases(3 to 5 candidates with 8 or more voters). What I would like to...
This program allows users to manage questions and quiz users from years of historical events. I'm looking for suggestions on how can I better organize my code, maybe apply OOP for functions and avoid using global variable data_filename. #!/usr/bin/env python3 # -*- coding: utf-8 -*- from enum import Enum import os imp...
Motivation Previously, on the Emacs stack exchange: In Org mode, when I open a link (C-c C-o) [...] [that] contains a wildcard, such as file:3_o*.pdf, Emacs opens it through dired instead [...] within Emacs. I would instead have it open the first match of that pattern in the system application … The handling of file:...
I am creating one library for encryption/decryption using AES-256 with GCM Mode(With Random IV/Random Salt) for every request. Code I have written is(reference : AES Encryption/Decryption with key) : public class AESGCMChanges { static String plainText1 = "DEMO text to be encrypted @1234"; static String pl...
Simple script that asks you to think of a number between 1 and 63 then offers list of numbers and asks if your number is in that list. Can this be refactored further? Are there better ways to create lists? Any improvements? x= [xx for xx in range(1,64)] num_i = [i for i in range(1,64,2)] num_ii = x[1::16]+ x[2::16]+ x[...
This is the follow-up question for A Summation Function For Arbitrary Nested Vector Implementation in C++. The following code is the improved version based on Zeta's answer. I am trying to enhance this the sum function which can deal with iterable things which has begin() and end() (such as std::array) of various types...
The following code simply prompts the user to choose from a menu, and then it displays the choice made by that user. It only accepts input consisting of a single digit between 1 and 6, inclusive. Anything else will be considered as being invalid. Questions While it considers Ctrl-D as an invalid choice, should it be ...
I'm wondering and actually playing in typescript playground with generics functions. The question is, is the code below readable? If not what kind of approach I could use to make it more typescript way and more readable? Working example here I implemented some basic functions like foldl, map and filter to experiment ge...
The goal of the function is to find and print the minimum number of swaps (bribes) in what was initially a sorted array of ints - https://www.hackerrank.com/challenges/new-year-chaos/problem I have passed this problem with the following code: def minimumBribes(q): bribeCount = 0 simulated = list(range(1, len(q...
Please see my previous post in the below hyperlink I've updated my .htaccess file to account for an HSTS, along with many of the recommended changes. See the snippet below. I'd like to stress that implementing an HSTS is not to be taken lightly for anybody else new to it. With that said, I'm looking for advice on what ...
Write a C program that will implement the basic operations of table processors. The input will be text data read from a .txt file, operations will be defined using terminal arguments, and the output will be in a .txt file as well. Program should be run the following way: ./main [-d delimiter] [name of the function for ...
In a recent toy project, I made heavy use of calculations involving polynomials in Z[x]. As an experiment, I decided to try out implementing expression templates - and it did seem to provide drastic speed-ups in my primary use case, with minimal changes to the consumer code. (In case it might be useful to see the con...
I have a slow query on a wordpress site. How can I rewrite this to make it faster? I'm not having much luck. The query takes about 0.900 seconds I have both the query and the explain below, my goal is to modify this query to make it execute faster, thanks. This is the query: SELECT wrapper_featured_colorways.id, ...
I was recently introduced to the wonders of TPL Dataflow and thought it would be a good exercise to create a wrapper class which wraps around an ASP.NET WebSocket object and processes the input and output streams using dataflow blocks, to make it easy to pipe inbound and outbound messages to data processing pipelines. ...
I made a program to find words in a word grid. It will find words that are horizontal, vertical, positive sloped and vertical sloped, all in both forwards and backwards. Here is my code: with open('grid.txt', 'r') as f: lst = [[a for a in l.strip() if a != ' ' and a!= '\n'] for l in f.readlines() if l] # Convert fi...
I have a program which goes through your drive and does two things: For every file extension it creates a file "file of extension_name" and whenever it encounters a file with that extension, it writes the path of it to its appropriate file. Once it finishes going through every file, it goes through every file created ...
I wrote this code in python and it works fine for me but I do know that the code is not optimised and a lot of refactoring needs to be done. So I need review on how this code can be improved. I started writing this when WGET library was not working for me and I wanted a light weight script for my other projects. I am a...
Recently I became interested in implementing a FORTH language interpreter. That led me to read about memory models etc. which led me to write this custom memory allocator in c++. It's very dumb as memory allocators go but it seems to be working as intended. I'd like you to confirm that it is and tell me if there is ...
This all started when I wanted to make a simple program that takes in a c or c++ file and outputs all the comments found. After doing that I thought why not expand the program to other programming languages which was mostly easy except for rust as it allows nested c style comments. However after completing that and add...
I needed a simple parser that could do both logical and math operations expressed in a string, as well as being able to use variables stored in json. None of what I found online seemed to do all of the above, so I came up with my own. Below is the source code for my ExpressionParser as well as my JExpressionParser, in ...
I've been learning MASM64 over the last few days and written a simple demo, so I can get feedback on my understanding of x64 assembly programming. It's really basic: it asks the user for their name, greets them, and then reverses the name string. The point of this question is to get a confirmation I understand the basi...
This code write to determine a way to place the N horses into the K stables, so that the total coefficient of unhappiness is minimized. I use python to write a code and I want to reduce the running time and memory used. Or maybe shorten the code. What should I do? My memory used is about 67,000- 80,000 KB. My running t...
I am trying to code a sin wave with 5 sliders: frequency, amplitude, phase change, number of data points, and time. I am currently trying to link my phase change slider with my graph so that it updates it when I move the slider. I realize that my code is probably quite messy and could be more concise but I can adjust t...
This is a game for children 3years+ to learn Hand-Eye Coordination with Mouse Movement. Goal is to catch all dinosaurs in the jungle, get the egg reward and then repeat the game. I tried to add sounds but unfortunately chrome rules say if the user doesn't interact with the page (aka click, etc.) no sound play is allowe...
I need to parse simple DSLs in a few projects. Since I don't know BNF or other grammars, I figured an alternative would be to use a simple parser generator. I'm looking for improvements to the lexer/parser in order to be able to use it to parse more complex languages in future projects while keeping a relatively simple...
Any critique of my implementation of Merge sort would be much appreciated! I tested it using a driver function (shown below), and everything works. However, it still feels unwieldy, I am a beginner so I really want to hear any criticisms, constructive or not :) def inplace_merge_sort( lst, start = 0 , end = None ): ...
Can you please give feedback on my C++ code so I can get better at writing code? I want a code that is well written. This Code uses the cstdio include for good performance and cstdint include because it has the int8_t data type to save memory. What this code does is if you type a number it will output something like I ...
This is a Hackerrank problem (https://www.hackerrank.com/challenges/sparse-arrays/problem). We're given an array of strings and an array of queries, and have to return an array of the number of occurrences of each query in the array of strings. For example: s = ['ab', 'abc', 'aba', 'ab']. q = ['ab', atr', 'abc]. We nee...
Library management system is a object oriented program that takes care of the basic housekeeping of a library. This is the third part of a series. The first iteration of the project is found here and the second iteration is also found here The major actors are the Librarian, Member, and the System. Major Concern I made...
How can I make this code run faster: for a in range(1,1001): for b in range(1, 1001): for c in range(1, 1001): if pow(a, 2) + pow(b, 2) == pow(c, 2): print(str(a) + "," + str(b) + "," + str(c))
I had an interview task where I had to output customers who live 100km within a particular latitude and longitude and then output them to a file with their username and ID. The customer file looks like the following: {"latitude": "52.986375", "user_id": 12, "name": "Christina McArdle", "longitude": "-6.043701"} {"latit...
I'm practicing some python exercise and I have some doubts about the solution of reversing a number. Example, 42 -> 24, -314 -> -413. The book has this solution: def reverse(x: int) -> int: result, x_remaining = 0, abs(x) while x_remaining: result = result * 10 + x_remaining % 10 x_remaining //= 10 r...
So what I'm trying to do is to get "bad" ip's from this page https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt Then I made a script that replaces ipsets to block, by replacing old ipset with one that holds the ip numbers from above mentioned place. Was long time ago I wrote it. Now I came back to it. An...
I use the following method to scan and index video files and pass data to an array. I get video file duration, file name, files size. Is there any better method, or do I need to improve? public static void load_Directory_Files(File directory) { File[] fileList = directory.listFiles(); if(fileList != null && fil...
I'm diving into "modern CPP", with wide usage of templates and containers, So I started with FIR filter. In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of finite duration, because it settles to zero in finite time. This is in ...
I am working on a Document Writer that writes documentation for software deliveries. It all works in its current state but I am needing to refactor a C# method. The app reaches to TFS and pulls down a work item and writes it in Word. This method deals with writing the headings for sections and subsections of the docume...
I wrote this java Class to solve a standard 9x9 sudoku board. It uses backtracking to solve each field of the board. I am really interested in feedback for the "isValid" and "isBlockValid" Methods, because they are redundant. Here is my code on github. Also here is the code: public class SudokuSolver { private boo...
I just started to use WordPress to start building a website, but as I need to use the get_header() function to retrieve the <head> content and I have a very large project, I wanted to put a CSS file depending on the page that is being displayed. After a few tries I came up with a solution, but I think that I can do it ...
Story I was trying to solve a hard problem from Project Euler earlier today (continued from yesterday) and I wanted to graph some things up and play a little bit with fractions. To work with fractions, I decided to implement a little OOP-ish fraction class. I was hoping to brush up whatever little knowledge of C++ I ha...
Here is a project that I have been working on for the past few days. I have used the SFML library in C++ to make a flappy bird game of my own. I made this as a step towards learning GUI in C++. The program is Object-Oriented as I believe this made it a little easier to maintain. Although this isn't my first time lea...
I have a react native native app and I am fetching the state of the toggle buttons from an API and then putting them into redux state. I do not like the way I have implemented it cause it seems very messy and was wondering if anyone would have any suggestions on how to refactor the code. Below is screen that calls my r...
This is the follow-up question for A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++. Besides the summation case, I am trying to implement a Max function which can find the maximum value in various type (comparable) arbitrary nested iterable things as the further step. The recursive ...
I am trying to create this API endpoint that will accept JSON payload and will calculate quote based on provided factors and their ratings. I have Entities that contain information about: age postcode ABI code ratings. These AgeRating, PostcodeRating and AbiRating entities implement RatingFactorInterface to force imp...
I have a small blog backend in Rust with Rocket and Diesel on Postgres. It reads and writes to and from the database fine, but to get to where it is I used a lot of clone() calls on strings. I feel like it could be written more efficiently with lifetimes, but my grasp of lifetimes in Rust is quite tenuous and I get a l...
Hypothesis There is a paid parking lot, with the following rates: $1 for the first hour and $0.5 for every subsequent hour. The parking capacity is of 10 spaces. Required Make an activity management system for the Parking with the following characteristics: Any parking interval is rounded up, to the nearest hour. When...
I have some directories with artifacts in them, and I want to clean them up by deleting them. The requirements are: Keep the 3 most recent directories Keep only one snapshot folder Keep only one rc folder Delete everything else The print commands should be written to a log file for posterity This code is in the root ...
I was recently set Task 2 as seen below and I realise someone answer the question on this site here but I wanted a fresh opinion TASK 2: Allows two players to enter their details, which are then authenticated to ensure that they are authorised players. Allows each player to roll two 6-sided dice. Calculates and outpu...
I recently came across the need to allow consumers to prevent further execution of methods and I utilized an event driven system that allows the consumer to specify if the execution should cancel. I've tested it in a multi-threaded environment and everything is working as expected so as a simple solution it works as in...
I've been playing around with the coroutines implementation in gcc 10.2.0 (Debian build) based on the sparse documentation at https://en.cppreference.com/w/cpp/language/coroutines . The target, for now, was to see how to use the functionality to enable creation of Python-style generator functions. So here's what I hav...
I'm posting a solution for LeetCode's "Encode and Decode TinyURL". If you'd like to review, please do. Thank you! Problem TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design the encode and dec...
I have a young friend of mine who is starting to learn Python in school and asked me to give him a little assignment. I am in no way a teacher nor a Python expert, but I accepted. At first I thought it would be fun to start with a bit of parsing for the operation's input, like: Enter your operation : 3+3 But it seemed...
I'm currently making a game using C++. I eventually needed a logger, but I wasn't satisfied with any of the existing solutions. After a while, I wrote my own header called log.h: #include <iostream> #include <iomanip> #include <string> #include <ctime> #include <fstream> #include <sstream> class Logger { private:...
I am trying to recode some c functions myself. This is an my implementation of realloc function, any updates or suggestion about how to improve it are welcomed. void *ft_realloc(void *old_ptr, size_t old_size, size_t size) { void *new_ptr; if (size == 0 && old_ptr != NULL) { free (old_ptr); ...
I would like to create a small virtual PLC application, where the user may choose from a variety of logic gates and put them together to form a boolean program. I just have written the logic gates, which all work as intended. May you give me some tips in regarding programming style? My class Gate uses a static int vari...
Purpose of this program is to calculate the velocity of ng = nxnynz particles at the Lagrangian points from the values at regular grid nodes. How can i speed up this calculation? I hope to receive suggestions on this following code: #include <iomanip> #include <omp.h> #include <vector> #include <cmath> #include <ctime...
write an algorithm for: x / 2 + 100 * (a + b) - 3 / (c + d) + e * e knowing that: a, c - word, b, d - byte, e - doubleword, x - qword mov eax, dword [x] mov edx, dword [x + 4] ; edx:eax = x mov ebx, 2 idiv ebx ; eax = edx:eax / ebx = x / 2 mov ebx, eax ; save the result in ebx so we can do the other...
I'm trying to find a faster way to copy specific rows of a sheet to different sheets. Iterating through them as done in code below takes too much time it leads to timeout. Some information about origin sheet: Has already a blocked header Has around 5000 rows Column A has a header "Project" Sheet is sorted by Column A ...
We follow atomic design principle. More here I have a react app where we put small components like button, label etc and call it atoms. In that I have made loading and Error component responsible for displaying loading bar and Error alert respectively. Then I created a molecule status which contains both these componen...
I'm getting throw exception and need your review The main function bellow trying to allocate memory several times and then throw the exception on the upper level. #include <iostream> #include <memory> struct MiserlinessClass{ char * pMemory; int memory_len; const int max_size = 10; Miserliness...
What do you think of this code? I want to keep an unified interface (treat filepath or image interchangeably) but i have heard try except is the prefered way, how would you do? def rotate_img(imageref, deg): """ Rotate from [deg] degree the input image param imageref: can be imagepath or ndarray image param deg: numbe...
Im writing a serializer that will do serialization/deserialization as fast as possible, and that uses templates so that i dont have to create a ton of functions for every data structure, This is the part of it that pre-calculates the size of the data to be serialized I have only tested this on MSVC and GCC So this cod...
I am somewhat new to python (yes I know, a cliché statement) and I wrote this code to scroll through a tuple of strings using the arrow keys. I know that the code is sloppy but I don't know how. Any feedback would be greatly appreciated. import keyboard from os import system from time import sleep class Menu: def...
I was wondering if you'd be able to review my basic C++ Grade Calculator I based off the following scenario. I would like to know what I've done well vs what I haven't done well. Many thanks in advance. Program Requirements The client has asked you to create a program that can calculate the average grade for 8 student...
Uncaught TypeError: document.getElementById(...) is null I have a single JavaScript file that is connected to multiple pages. The below snippet is a function that is used for a single page. The above error appears when the user navigates to one of the pages that does not use the below function, and it references the do...
I have a program for finding shortest distance/path and I got a correct answer but I am getting an issue i.e., "Function 'shortestPath' has a complexity of 9. Maximum allowed is 6." This is the algorithm: const graph = { start: { A: 5, D: 8 }, A: { B: 9, C: 3 }, D: { C: 4, E: 6 }, C: { B: 5, E: 2 }, B: { end:...
My code is void utf8_append(UChar32 cp, std::string& str) { size_t offset = str.size(); str.resize(offset + U8_LENGTH(cp)); auto ptr = reinterpret_cast<uint8_t*>(&str[0]); U8_APPEND_UNSAFE(ptr, offset, static_cast<uint32_t>(cp)); } This works but seems ugly. Maybe I am overlooking a simpler approach? R...
I've been working on a solution that allows a set of buttons to reveal divs that slide down from above on-click. I needed each button to toggle an active state for itself, but also if the user were to click on one button, reveal a div, and then go on to click another button, that the initially revealed div transition b...
code It is necessary from this piece of code const rectPos = { x: 0, y: 0 }; const currPos = { x: 0, y: 0 }; const mouseEvent = () => { canvas.onmousedown = (e) => { const start = { x: e.offsetX, y: e.offsetY }; canvas.onmousemove = (e) => { currPos.x = getXPixelRatio * Math.round((rectPos.x + ...
For practicing designing systems I created a simple bank ATM system. I didn't want to make it to complicated so I left out things like cash bin per ATM and opening cash trays, etc. I also wanted to neglect APIs to validate pins, etc. (it's just a function that will always return True). I wanted to focus on classes and ...
I'm learning ASP.NET and I've created a few simple APIs, so I can consider myself maybe an intermediate beginner. I've decided to create a tutorial serving two purposes: to solidify what I've learned and to fulfil a demand for beginner tutorials in my language. I just created a very simple API with CRUD functionalities...
I was bothered with existing matrix allocation methods that take variable rows and columns, so I made a small class that only needs one memory allocation. template <typename T> class Matrix{ T* data; size_t rows, columns; public: Matrix(const size_t rows, const size_t columns) : rows(rows), columns(column...
This is a Hackerrank problem: https://www.hackerrank.com/challenges/crush/problem You are given a list of size \$N\$, initialized with zeroes. You have to perform \$M\$ operations on the list and output the maximum of final values of all the \$N\$ elements in the list. For every operation, you are given three integers...
I have made my own malloc implementation using this resource as a guide https://danluu.com/malloc-tutorial/ I was hoping to receive some feed back on how I can improve upon it, and If I did any major mistakes. I know my implementation has a lot of fragmentation and I pretty much no idea on how to fix it. TLDR Feed bac...
I have this code employee = this.identityService.me; employeeToken: Observable<string> = this.employee.pipe(map((e) => e.token)); currentHead = new BehaviorSubject(localStorage.getItem('head')); What I need to do is to change the currentHead if the local storage is empty. So I do this in the ngOnInit ngOnInit() { ...
This is what I've come up with to construct a name using a javascript object and immutable.js: const getFullName = ({ user }) => { if (!user || !user.get('response')) { return ''; } return `${user.getIn(['response', 'firstName']) || ''} ${user.getIn(['response', 'lastName']) || ''}`; }; As ...
I'm trying to refactor some code so that it does not have so much repetition to it. What I'm trying to do is create an input for a multiple channel/input neural network. The features that are being considered come from two different sources completely and the inputA here is a 2D array and has to be kept in this format....
I have a set of classes across multiple packages, and I want any logging from within a single "com.name.root.xxx" package and all its child packages, to be logged to a different file. e.g: //Package Name Log To \\ //-------------------------------------------\\ com.name.root.router C:\com...
This program is used to create a random bank card number. Card number is created using account type and client location for the first eight digits and the remaining 8 digits are completely random. I'm new to this site, but I believe it's just for code review to get opinions on code. If i'm incorrect please let me know ...
I've written a 3-SAT solver based on this prompt: Alice recently started to work for a hardware design company and as a part of her job, she needs to identify defects in fabricated integrated circuits. An approach for identifying these defects boils down to solving a satisfiability instance. She needs your help to wri...
I'm mainly looking for error checking / type safety advice. main.cpp #include <iostream> #include <string> #include <cmath> #include <numeric> void binaryToDecimal(); void decimalToBinary(); int main() { std::ios::sync_with_stdio(false); bool running = true; int ans; while (running) { st...
This is the follow-up question for A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++ and A Maximum Function For Various Type Arbitrary Nested Iterable Implementation in C++. In the summation and the maximum cases, the recursive technique is used for iterating all elements. The simila...
I'm currently going over Robert Sedgewick's Algorithms book. I implemented a Symbol Table using two parallel array one for keys and one for values. The keys array is ordered and the Symbol Table uses binary search to find the position of the elements in the array. In the practice section, the implementation of the dele...
I'm learning Clojure and am a rank n00b at it, trying to learn from books and online tutorials (but I'm sometimes concerned that I am picking up bad habits or at least not all the good habits). For exercise I did the Breaking the Records problem on Hackerrank. TL;DR problem description: For a list of scores (in histori...
I'm currently going over Robert Sedgewick's Algorithms book. I implemented a Symbol Table using two parallel arrays one for keys and one for values. The keys array is ordered and the Symbol Table uses binary search to find the position of the elements in the array. In the practice section, the implementation of the del...
with open('things.txt') as things: urls = [url.strip().lower() for url in things] async def is_site_404(s, url): async with s.head(f"https://example.com/{url}") as r1: if r1.status == 404: print('hello i am working') async def create_tasks(urls): tasks = [] async with aiohttp.Cli...
Problem statement is from CSES This is a standard question where we are given a list of numbers and a number of queries. For each query, you have to give the sum of numbers in the given range. My implementation in python: def solve(): n,q = [int(a) for a in input().split(' ')] arr = [int(a) for a in input().spl...
I'm very new to jQuery and I managed to make this code work but I'm pretty sure that it could be made in a more efficient way. For example, it should be a way to send the id as a parameter instead of writing the same code for each id. But beside of that, are there other things that could be made in a better way? // s...
I'm working on setting up an app backend that's deployed automatically using infrastructure-as-code and a ci/cd pipeline. As a result of that I need the app server to gather DB credentials automatically. This is my first time working with the AWS Go SDK and I want to get the code as close to production ready as possibl...