instruction
stringlengths
71
95.1k
i am writting a code to get all variants from shopify. as shopify has cursor -based pagination, i want to hit the api until i reach last page. i have write below code. please suggest if i am improve this or refactor this code in better way: public static List<productVariantShopify.ProductVariant> getallProductVariant(l...
I've implemented a solution to generate the worst-case scenario for QuickSort using the middle pivot strategy in Java. The goal is to rearrange an input array to produce the worst performance during sorting. Here's the code I've written: public class WorstCaseForMiddlePivotQuickSort<E extends Comparable<? super E>> { ...
I have a Vec<String> of all available versions of a particular piece of software (Godot), named VERSIONS in code below, where each version can be either "major.minor" or "major.minor.patch". These are manually scraped from tuxfamily. I also have a Vec<&str> of versions that are considered "supported", named STABLES in ...
I am learning C. As a task, I need to write a get_int function that will convert a char* to int. What parts can I improve here? I'm especially interested in how I can improve/rewrite the overflow checking. #include <stdio.h> #include <ctype.h> #include <limits.h> #define MINIUNIT_MAIN // https://github.com/urin/miniu...
This is my Laravel seeder for two database tables. I need to make this seeder more efficient and optimized. How can this be achieved? I would appreciate some tips. $userId = User::first()->id; // information of email template variable $emailTemplateVariables = [ 'user-create' => ['module' =...
Hello fellow developers I was wondering if anyone, with more understanding of javascript, is able to detect some potential flaws or performance issues with this recursive function. It works as intended but I have the feeling that there is room for improvement. Perhaps you can tell me better way of achieving the same fu...
I am attempting to solve Question 10 of Chapter 6 of the C programming: A modern approach book. The question asks to write a program that determines the earliest date from a sequence of user-inputted dates. The user will enter 0/0/0 to indicate that no more dates will be entered. An example of the program output is als...
I am working on an implementation of a concurrent_queue<T> and pf a ThreadPool, see beneath. The objectives are CPU performance and simplicity. I would be glad to have critiques, comments, opinions, suggestions. The context : I am multithreading a C++ code implementing the Monte-Carlo method : inside a loop are perform...
I am looking for a code review on the following code. Say I have a simple example class, something like the following: from dataclasses import dataclass @dataclass class MyClass: attribute1: int attribute2: int attribute3: int attribute4: int and a config.ini file that contains the following: [Default...
I’m using two ciphers in this code that are in this order- encrypt plain text with xchacha20-poly1305 then encrypt the resulting ciphertext with aes-cbc-blake2b hmac. I was told elsewhere rather than derive 2 keys from one key that’s derived from a password, it would be better to derive all the bytes from the password ...
I have a configuration (YAML) file used across related modules. I also have a few additional variables to be accessed globally in my modules. I want to have them at one place (an instance of a class in my implementation below but I am willing to change it). This implementation (based on recommendations from the web and...
The code retrieves the data from PBI API - it's my first one and I would like to learn how to make it pro. Here is the list of my questions: Can you please analyze 2 functions: GetReports and GetReportsUsers in accordance with the best practices? Should a table with metadata be added? Should a function responsible fo...
This is my first post. I'm trying to learn Rust and I recently finished reading the Rust Book. For further learning I decided to try to reimplement some GNU core utilities in Rust. This is my approach to echo. use std::{cell::RefCell, env}; struct Config { backslash_escapes: RefCell<bool>, trailing_newline: Ref...
Greetings. I'm a newbie python developer who just started using PyQt5 as his major GUI development tool. Because of this, I have started a side project known as NyvoAI, just for gaining more knowledge in the branch of GUI development with PyQt5. The main project goal was to gather multifarious Artificial Intelligence t...
My system is a .NET Core 7 console app, which starts some background threads. I need to pass some int values (counters, etc.) between the main and background threads, in a thread-safe manner. Although I can pass an int by reference (e.g. DoFoo(ref myInt)), I can't assign it in the background thread (e.g. I can't pass i...
this is the second version of the Terminal Based Game I'm working on thanks to @user673679 for the suggestions, I did not implemented everything you said but it was really fun working on your corrections and ideas. so a brief walkdown on what the game is about, I'm representing each entity with its own character: (floo...
I tried to implement the cubic spline algorithm in cython. I want to ask how I can make the code more efficient in terms of speed. Any suggestions or references would be very welcome. Does it make sense to use typed memoryviews from cython instead of numpy arrays? File cinterpolate.pyx import cython import numpy as np ...
I'm trying to implement Dependency Injection in one of my projects. It's a project that when I started I didn't had much experience with sotware development, but now I feel like it's time to do a bit of refactoring and improve it. I was going to start working with Unit Tests using PHPUnit, but the very first thing I sa...
I'm looking for feedback on some source code, I have everything documented and have corrected some errors. Looking to see what I did correctly, incorrectly, and what can be improved. /// <summary> /// Sets the password array based on the content of the <see cref="SecureString"/>. /// </summary> /// <exc...
I'm working on my final project, and it is a game made with Java Script in code.org's Game Lab. The code worked fine, and it was not slow at all, but as I worked on it, it became much slower! The character starts lagging and it eventually stops moving at all. I have tried optimizing it by combining the tasks of a few f...
Here is the Hackerrank problem which is related to dense ranking and below is my solution which didn't pass the time limit cases. Any better way to optimize this? def climbingLeaderboard(ranked, player): ranked_set = sorted(list(set(ranked)), reverse=True) result = [] print(ranked_set) for p in player: ...
For gaming applications, networking looks strange from the point of view of traditional approaches. Much of the game logic is based on "ticks"; Most often this is a mandatory item of operation. There is also a limitation from the "Epic EOS SDK" in the absence of thread safety, all "C" calls can only be made from one th...
This is a work in progress Rubik's Cube scramble generator with timer and list of solves. The list of solves is stored using localstorage so that it stays on page reload. A solve can also be deleted from the list. I used some basic boostrap for alignment and buttons. I also used jQuery to make the list of solves. I am ...
I have created a casino number guessing game in C++: #include <iostream> #include <random> void displayGameRules() { std::cout << "\nGAME RULES: \n" << "1. Choose any numbers between 1 to 100\n" << "2. If you win you will get 10 times the money you bet\n" << "3. If you ...
When I was a child, I used to play Ubongo board game, recently I discovered Pentomino puzzle and I wanted to create a custom solver in python for it. Here is what I got: import datetime def solve(height, width, pieces): sorted_pieces = sort_pieces_by_length(pieces) # this makes it faster as it sort also coords of ...
I've written a utility class BetterDict to help me on some of my other projects. I've implemented the &, +, and - operators. It extends from the base class dict so I can use all the builtin functions without having to rewrite them all. I would like some feedback on my implementation, best practices, more pythonic way o...
Given: j-g-h-i=0 a+b-c-j=0 c+i-d-e=0 e+g-f=0 And known: a=10 b=7 d=3 e=2 f=3 j=14 I want to solve this (or similar equations) with the Gaussian elimination algorithm, and wrote the following C++ code: #include <string> #include <vector> #include <sstream> #include <iostream> using namespace std; const int my_magic1 =...
Is my implementation of _read_contents (3 lines) fine, or does it create a potential problem (e.g. passing part of an object that has to be destroyed, or a connection that cannot be closed, etc.)? I don't need the review of the general design, only these 3 lines. import paramiko ######################################...
I am a beginner programmer who coded a simple Tic-tac-toe in Python for practice. Any feedback, especially regarding best practices and tidying up the code, is appreciated. import random board = {"a1": ".", "b1": ".", "c1": ".", "a2": ".", "b2": ".", "c2": ".", "a3": ".", "b3": ".", "c3": "."} #rando...
I am working on a Boid simulation with 10,000 boids. I've successfully utilized geometry shaders and an array<GLfloat[3], MAX_BOIDS> for vertices to enhance display performance. Currently, I can display 500,000 boids moving randomly at 60 FPS. However, the neighbor search is a bottleneck. With a naive search, I'm deali...
I'm currently working through the "Crafting Interpreters" book by Robert Nystrom. He uses Java to implement the visitor pattern in which the visitor functions return the Object type. C++ doesn't support an Object type so my solution was to create a polymorphic type in c++ using virtual functions and inheritance I'm jus...
Please review my code. I left some comments where I think something might be wrong, but any comment is appreciated. I am writing a package for a project I am currently building. Its purpose is simply to swap from one log file to another after some time has elapsed. It zips the log before creating a new one and if there...
The following is a simple cache that I have written in java. It uses the LRU replacement policy and also evicts items based on a refresh interval (default 5 secs). Right now, the class is not thread safe but would like to add that functionality in the future. class Cache<K,V>{ private final HashMap<K,V> cacheLooku...
This application is for restaurant patrons to know how long they have to wait in line. We would like to design a more sophisticated GUI interface, but do not know how to go about it. Please let me know if there are any appropriate libraries or other resources. import tkinter as tk from tkinter import messagebox as mess...
I'm kind of new to programming and I would need a suggestion whether there is a better way to solve this exercise. I need to write a function dict_of_numbers() that returns a dictionary with numbers from 0 to 99 as key, and the numbers spelled out as value for the relative key. This is the solution I wrote: def dict_of...
I have a data set that is of 300,000 rows approximately and two columns, each row contains a string, some might be larger than others. All in all, the data set in a pkl format is of 92Mb. It is a bit, but I reckon not too much either. This is the pre-processing function I have: import nltk from nltk.tokenize import wor...
I've been battling ChatGPT for hours now and can't get satisfied with this simple algorithm in TypeScript. These two (hopefully correct) TypeScript+ReactNative solutions should move the timestamp forward to the following Monday 10:01 AM. function computeUpcomingNotificationTimestamp( currentTimestamp: numbe...
I'm writing a script for a bioinformatics application in Python that iterates through several sequences looking for amino acids in specific positions to calculate their frequency in relation to a genomic database. However, I'm new to the area and I've been learning while developing the project, so a lot of what I've do...
i'm trying to learn backend with Next JS, and i'm using Prisma + MongoDB. I want to create a simple website with a user with a cart and some products. here my schema : model User { id String @id @default(auto()) @map("_id") @db.ObjectId name String nickname String password String @unique ...
Short introduction; recently I've completed a basic course on C but other than that I have no programming experience and I am a total beginner. As a practice project and to practice reading from and writing to files I've created this simple text encryption program in C. It basically asks the user for a text file to ope...
What do you think about this aggregator (DDD) for booking and cancelling tickets? Is it ok, or would you do it differently somehow? @Entity @Table(name = "screenings") @Getter @ToString(exclude = "tickets") public class Screening { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private Local...
I would like to ask your advice on the frontend code of todo app. Main functionalities: The app has authorization and authentication using backend. The CRUD functionality for managing tasks What may be improved so the code would better follows the best industry standards? The main component is TaskList: import React...
Well, I have this function which is called in the Unity Job system, I'm profiling it: The code: public static void LinearUpscale2DArrayInPlace(NativeArray<double> array, int width, int height, int anchorStepX, int anchorStepY, int min = 0, int max = 0) { // Interpolate columns where the anchor points a...
I implemented this generic ringbuffer over a const generic array with the usage of the MaybeUninit type. Is there something which is maybe unsound (having the lines with drop_in_place in mind) or which could be optimized? Thanks in advance #![feature(inline_const)] use core::mem::MaybeUninit; use core::ptr; struct Ri...
I am creating some small project for my portfolio. It will be an app written in .NET and React but for now I've done backend part and I seek code review. I wanted it to be aligned with DDD principles and clean architecture. Can you review it and tell me is there any areas to improve to make it more readable and scalabl...
This is a simple hash table I've written in C. It is a closed-addressing hash table with TABLE_SIZE number of buckets. The hash function is extremely simple and only sum up the characters of the key string. I've also implemented a REPL for it to be able to test it. I appreciate any type of suggestion to improve this co...
The exercise is to write a recursive method that takes a String and a char parameter and returns a String with each occurrence of the char doubled. Additionally, the number of doubling operations should be added at the end of the string. No "extern" variables outside the method are allowed to use. The String parameter ...
I'd like to have code review for backend of todo app. It has 2 main functionalities: Authentication and authorization using Spring Security and JWT token. CRUD for tasks In particular I'd like to focus on code quality and database design. https://github.com/redshift-7/todo-app REST controller for managing tasks: @S...
I was mad C++ did not have support for printing containers. I also could not find a header only library for printing containers so I decided to make my own. My goals were: 1) practicing templates 2) learn how to make a small library. I would also be very happy if some people found this useful and used it. What does thi...
I have a rectangle of . (platforms) and # (obstacles). I can start at any platform in the top row and go to the left, right or down to another platform. I cannot visit a platform twice. I need to find the longest path from the top row to the bottom row. Example input: #.....#... #......... ..#.....#. ..#....#.# ..###....
I was concerned about the approach in Morris traversal algorithm and came up with simpler solution that uses parent pointers in nodes. The constraints were following: Time Complexity: O(n) Space Complexity: O(1) Implementation: iterative Node structure: class Node: def __init__(self, data, left=None, right=None):...
This query selects the number of SO questions, the number of views and the number of unanswered questions for each tag (the list of the tags is the user input). It works fine when it works, but it times out with the error message Line 0: Execution Timeout Expired. The timeout period elapsed prior to completion of the o...
I am currently in the process of writing a system application that will be operated by multiple users. This will require individual users to access the application while limiting access to those that shouldn't be using it. The application will have several areas of access, which all users will not have access to. At th...
I am participating in this year's Advent of Code for fun. Challenge 1.2 states: The newly-improved calibration document consists of lines of text; each line originally contained a specific calibration value that the Elves now need to recover. On each line, the calibration value can be found by combining the first digi...
It's that time of the year again! Although there's no more Winter Bash, we can still have all the Bash we want in winter ;-) Part 1 To paraphrase the description: For each line in the input: Find the first digit. Find the last digit. Form a 2-digit number by concatenating the first and the last digits. Compute the ...
There is also a limitation from the Epic EOS SDK in the absence of thread safety, all "C" calls can only be made from one thread. And from the thread where the SDK was initialized. Based on the answer @G. Sliepen in my previous deferred-networking-eos. This is not an answer to its own question, because everything is ne...
Can anybody help me with examples of code? How is the approach to optimize code relative to my example with using "switch case" to "arrays"? Without changing its functionality, but reducing the amount of code by approximately 10 times. How will all this affect the performance of the code for the MIDI protocol? code des...
I was studying stochastic processes and thought to independently simulate a moving average process. # SIMULATING A MOVING AVERAGE PROCESS of order 10 import random import matplotlib.pyplot as plt error_list = [random.normalvariate(0, 1) for _ in range(5011)] ma_process = [] coefficients = [random.randint(-5, 5) for _...
Implemented a simple thread pool that executes task asyncly, and returns a simple future you can wait on. Can you please suggest improvements? #pragma once #include <iostream> #include <atomic> #include <cstdint> #include <queue> #include <thread> #include <functional> #include <mutex> #include <memory> #include <cstd...
I am (re)writing a project management CLI and want to put it on a solid foundation concerning the database connections and testing. My focus was to build a DB class which is easy to test and could be reused for any tables I would maybe add at some point. However I am not sure if the duplicate creation of the engine is ...
I want to write a simple binary file reader and writer class. The class below can read or write file. main.cpp read 500 bytes from tmp.bin and copy at the end of the tmp_copy.bin file. How can I improve my code? binaryfile.h #ifndef BINARYFILE_H #define BINARYFILE_H #include <fstream> #include <string> using uchar = u...
To paraphrase the puzzle, Santa takes a walk with an Elf, and they play a game involving a bag of colorful cubes. In each game, there is an unknown number of each colored cubes in the bag, and the Elf pulls out a number of cubes, for example: Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2: 1 blue, 2 gre...
problem for day 2 Part 1 You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile of leaves. It's quite cold, but you don't see much snow. An Elf runs over to greet you. The Elf explains that you've arri...
I made this script it works, I'm just looking for ways to make it better/reading to get better. #!/usr/bin/python3 import requests, logging, json, subprocess, re, smtplib from datetime import datetime, date # logger things log_file = '/var/log/pagerduty.log' ## logging things logging.basicConfig(level=logging.INFO, fo...
I am quite fresh to c# and creating programs. I wrote a very basic program which allows you to go through menu selections via up and down arrowkeys and select your selection along with sending you to a sub menu and back. I feel like it's kind of clunky and suspect there's definitely better practices to utilize but unsu...
This is a follow-up question for A Maximum Function For Various Type Arbitrary Nested Iterable Implementation in C++. Besides the function for finding maximum, I am trying to implement recursive_minmax template function which returns both minimum and maximum values. The experimental implementation recursive_minmax tem...
I'm using reflection in PHP to load a list of available Formatter classes that all have methods that do formatting of a value in a specific CSV column. e.g. for Phone numbers input=5554443333 output=(555) 444-3333 Here are three formatters as well as the base class with a static method to find all of them and return th...
To paraphrase the puzzle, Santa takes a walk with an Elf, and they play a game involving a bag of colorful cubes. In each game, there is an unknown number of each colored cubes in the bag, and the Elf pulls out a number of cubes, for example: Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2: 1 blue, 2 gree...
In following of this question, I would like to have a second review. The exercise is to write a recursive method that takes a String and a char parameter and returns a String with each occurrence of the char doubled. Additionally, the number of doubling operations should be added at the end of the string. No "extern" ...
I have a problem where we are given multivariate polynomials in variables like y_i and z_j and the goal is to express them as sums of products of terms of the form y_i-z_j with nonnegative integer coefficients (each of the factors of one of these products must specifically have a coefficient of 1 for one y variable and...
Yes I'll keep doing this until I cannot be bothered to do it in Bash ;-) (Well today is probably the last one ;-)) Part 1 To paraphrase the puzzle, given some input ("engine schematic") like this: 467..114.. ...*...... ..35..633. ......#... 617*...... .....+.58. ..592..... ......755. ...$.*.... .664.598.. The task i...
I have an API where users can retrieve a list of "venues". Every venue is a profile, but not every profile is a venue Venues can be "parents" of other venues (think hotel - floor - room) When a latitude and longitude is given, the list should be sorted by distance When a latitude and longitude is not given, the list s...
I am fetching arrow tabular data from an API. The content-type of the response is application/vnd.apache.arrow.stream. In my react code, I am trying to read the response as such. I am not sure if this is the optimized way of reading arrow data. function extractDataFromTable(table) { let extractedData = []; /...
A while ago I made a post about optimising the multiplication of every number in an array by 2. With everyone's help I was able to go from 1,500 ns (LINQ) to 30 ns. So I thought I'd try something harder. The conversion of an int to a Roman Numeral. I have already tried several algorithms one that tested if a numeral is...
I have two working solutions, one using an accessor (getSubscription()) and one using a member variable (subscription). Which one should I use? Which solution is correct? Solution 1: List<Client> myClient = new ArrayList<>(); public class Client { private final String firstName; private final String lastName;...
Yesterday I thought was the last day of Advent Of Code 2023 that I do in Bash. I was wrong. I'm not even sure anymore that today will be the one. We'll just have to see tomorrow! Part 1 To paraphrase the puzzle, given some input ("scratchcards") like this: Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53 Card 2: 13 32...
This is my first attempt at a real life app in Rust. I would mostly like to know if I am writing idiomatic Rust code, coming from Java and Python. I'll appreciate any pointers to improvements, though. The code uses tokio_tungstenite to receive messages from a websocket server asynchronously. The connection as well as t...
To avoid the use of magic numbers, I created a static class to store some integer values that are represented inside a database. I avoided using enums because I need to cast them every time I use them. To benefit from the clean approach of enums while also enjoying the type definition offered by classes. The Class Appr...
This is my code to solve the 5th Adventjs challenge. In that link you can read the instructions. How can I improve it? It's a bit messy... and I'm repeating some part of the code. All must be in just one function function cyberReindeer(road, time) { // Code here let theRoad = road; let roadNow = ""; let green...
So I'm making a logger for a program and it has 6 levels increasing severity and things I don't think its as memory efficient as it could be but I'm just getting into c++ and memory coding. I feel like if I want to put it in a file I cant view it with a text editor using something like JSON or XML. This is the code in ...
I am developing a simplified train dispatch system as a final assessment for my CS major, first semester. I have a user interface class, with the TrainDispatch instance as a UI class variable. Furthermore, I have one UserInputHandler class and a InputValidator class. I need some methods from the TrainDispatch system in...
I have several Spring Boot and Angular applications/microservices that form together a whole application. As it is tedious to start them via the terminal, I've written the following script to perform the starting of all. I've simplified the script a bit to remove some redundant parts. Note that I usally start this scri...
I was wondering if my code is good or maybe if it could be written better or simpler. The task was to implement a program that prompts the user for a fraction, formatted as X/Y, wherein each of X and Y is an integer, and then outputs, as a percentage rounded to the nearest integer, how much fuel is in the tank. If, tho...
Part 1 To paraphrase the puzzle, given the times and record distances of boat races like this: Time: 7 15 30 Distance: 9 40 200 That is, the first runs for 7 milliseconds, and the record distance so far is 9 millimeters. The way a race takes place is you hold your boat for \$t\$ milliseconds, and after re...
Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them into a two-digit number. The goal is to find the sum of all these calibration values. For example: 1abc2 pqr...
The code below copies large amount of data. It does so in 2 steps. I was wondering if both step1 and step2 can be done in parallel. <# The code below copies from a network fileshare to another share in the same location but to a different folder. Robocopy is used to do the file move of all the old files tha...
I have written a minimal matrix class. I would like to utilize the latest C++ features, follow best practices, and utilize multi-threading in some of the operations. I have also setup a GoogleTest environment with test cases like verifying matrix initialization and calculations but I am not sure what other test cases a...
In a project i am doing for AP CSP, I am attempting to make a calculator that can do sig figs, and there is always a ton of extra 0's after i round the number as seen in the picture i attached the code if anybody needs it is import math def find_op(): print("Sig Fig Calculator") print("Choose an operation") ...
I've written a wrapper for the mmap syscall. It's quite limited in functionality at the moment (there are lots of flags to support) but it's sufficient for mapping anonymous memory regions, which is what I need it for. It already satisfies clippy, so I'm keen to understand some more advanced improvements that use Rust ...
The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them into a two-digit number. The goal is to find the sum of all these calibration values. Note: sometimes there is only 1 digi...
I have a piece of equipment that I am interacting with. The manufacturer provided an SDK and some simple examples of how to interact with the device. However, I need to write an API for interacting with the device with proper error handling. The device returns a 5-digit unsigned integer to report the status of the oper...
Part 1 Today's task is to rank hands in a Camel Cards game and compute the total score. In Camel Cards, you get a list of hands, and your goal is to order them based on the strength of each hand. A hand consists of five cards labeled one of A, K, Q, J, T, 9, 8, 7, 6, 5, 4, 3, or 2. The relative strength of each card f...
I am implementing runtime configuration for a python package. I am doing this in mypkg.config.__init__.py. The idea is to load the configuration from a JSON file into a ConfigManagerClass that uses a Pydantic model to validate and store the configuration. The ConfigManager lets users of the package update the config fr...
The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them into a two-digit number. The goal is to find the sum of all these calibration values. Note: sometimes there is only 1 digi...
The task A file similar to the following is provided. RL AAA = (BBB, CCC) BBB = (DDD, EEE) CCC = (ZZZ, GGG) DDD = (DDD, DDD) EEE = (EEE, EEE) GGG = (GGG, GGG) ZZZ = (ZZZ, ZZZ) The first line will always be an alternating sequence of L and R characters, referred to as the path. The remaining lines describe a network. ...
I have a nodejs server with websocket which is pulling the new data from InfluxDB and send it to client. The piece of code is this: const ws = require("ws"); const { QueryAPI, Bucket } = require('../db/dao'); //insert data from rowObject to intoData //return the time of current series function insertData(rowObject, in...
I have an optimization problem. Be it about code, algorithm or maths, that, i don't know. My goal is to find pythagorean triplets satisfying a = b + 1 or a = b - 1. m and n are the triplets generators. The following code produces the desired output, but it's not fast enough from about the 11th or 12th item. #! /usr/bin...
I have a Dockerfile with ubuntu:22.04 as a base image and a manual Python installation(specific version i.e., 3.11.1) layer which takes a long time. Approach 1: Build a custom_image with ubuntu:22.04 as a base image and a manual Python installation layer. Create another Dockerfile with custom_image as the base image a...
Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them into a two-digit number. The goal is to find the sum of all these calibration values. For example: 1abc2 pqr...
Part 1 In today's task, a network of paths is defined like this: LLR AAA = (BBB, BBB) BBB = (AAA, ZZZ) ZZZ = (ZZZ, ZZZ) The first line LLR is instructions to follow to change position. When the current instruction is L, change position to the left value of the pair. For example at position BBB the left value is A...