instruction
stringlengths
71
95.1k
I view users by city using this SQL query: SELECT ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], Id AS [User Link], Reputation FROM Users WHERE LOWER(Location) LIKE 'sulaimani, iraq' or LOWER(Location) LIKE 'erbil, iraq' ORDER BY Reputation DESC; This works. I don't like the repetition of t...
I have created this interface as part of my C++ learning path. This post inspired me a lot. The idea is to use its concrete implementations to perform some actions before and after any change of the wrapped variable. In the same fashion, by overriding getValue() a mock can be created for unit testing. For instance an i...
Problem Statement Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target. The answer is guaranteed to fit in a 32-bit integer. Input: nums = [1,2,3], target = 4 Output: 7 Explanation: The possible combination ways are: (1, 1, 1, 1) (1, 1,...
I found interesting the way Python's requests library does the status_code data structure initialization (see code here). I am reusing it in a hobby project, but instead of using just one configuration variable I want it to initialize a few of them, code below: from .models import LookupDict # Copying Requests data s...
Made this basic calculator for travel visa calculation since I was tired of doing it by hand multiple times and online calculators gave mixed results. It prints every day the visa is valid and displays how many days are left. The basic rules: You start out with 90 days. After using (traveling) a day, it'll only become...
I work on asp.net core 2.2 web API using C# language I need to rewrite function below with best syntax and with best practice web API below get Excel file from upload and return Excel file it working without any issue but I need to rewrite it with best syntax and practice some points I need to changes : concatenate pat...
I am attempting to extract the absolute differences image between two input images and then enhance the intensity (brightness) channel in HSV color space with the given times. The workflow is like below. The processing of a batch of files is considered. Thus, the input is path strings input_path1 and input_path2. The ...
I created some tooltips using javascript but after writing the code I found it a lot more complicated and hard to read/understand is there any way to shortened my code and make it more logical and efficient. var tooltip = (function () { 'use strict'; const PREFIX = 'data-tooltip'; const SUFFIX = ['pointer-d...
For parsing astronomical datasets (mostly images) I have written a parser that reads .fits files in C# .net5.0. The content part of the file basically constists of a blob (byte array) that holds all the datapoints in a certain order. What this parser does is read in all those values from the content part. However, sinc...
I am learning JavaScript and this is a simple todo application I made which uses local storage. It is currently running at: https://koraytugay.github.io/vanillatodo/#. The code is as follows. I am open to any suggestions on how the structure / architecture or implementation details should/can be improved. Can be cloned...
I tried to make a calculator using the Strategy pattern in ASP.Net Core MVC (following an example from the Internet) Please review my code and tell me what could be wrong and how to make it better? My interface: public interface ICalculator { double Calculate(double FirstNumber, double SecondNumber); }...
I'm using the following code to grab user info from my MySQL database via PHP by using exec to invoke a Python script. <?php $username = $_GET['username']; // Clean the username to prevent XSS & hacking attacks $cleaned_username = htmlspecialchars($username); // Connect to mysql database via python & return user info ...
This is my first non-trivial program in my Python. I am coming from a Java background and I might have messed up or ignored some conventions. I would like to hear feedback on my code. import nltk import random file_name = input() file = open(file_name, "r", encoding="utf-8") # nltk.trigrams returns a list of 3-tuples...
Take the following INSERT query. Using knex (JS) just for abstractions function addUser() { return knex.insert({username: 'newuser'}).into('users') } Now, by default, knex will internally create a connection to execute this query. But there may be situations where I want to reuse a connection (e.g: transaction) in...
SecureADODB is a very instructive VBA OOP demo. I have played with SecureADODB for a while and plan to integrate it into the prototype of my database manager application. In my previous post, I showed ContactEditor's class diagram with the ADOlib class encapsulated into the DataTableADODB backend. The ADOlib class con...
A DNI (Spain's National Identification Document) is formed by 8 digits and a letter, and they are related to one another as follows: number % 23 -> letter_index Where the sequence of letters to be indexed is TRWAGMYFPDXBNJZSQVHLCKET The following program allows calculating the letter given the number, finding some mis...
todo(1) is a program that lists the next tasks in decreasing order of urgency (most urgent tasks first). "Next" tasks are those which are not blocked by a task it depends that is still not set as done. I think I'm using a convoluted solution, because I create five different data structures in the program. First, I coll...
I want to locate urls without protocols in the text, and then add the protocol before them. This means I don't want urls that begin with http(s):// or http(s)://www., only the kind of example.com. I'm aware that I might accidentally match with any text1.text2 if I forgot to add a space after a period, so I came up with...
Can I get a review of my code which compares 2 dictionaries and display unique changes. import time from random import randrange temp_data = [{"Name":"SuperFish","KeyID":"SecretCodeFish"}, {"Name":"CowMan","KeyID":"SecretCodeCow"}] def check_data(Names): temp_key = "SpecialKey" temp_list = [] ...
(See the next version.) The following data structure implements a hash table based set for int values: com.github.coderodde.util.IntHashSet package com.github.coderodde.util; /** * This class implements a simple hash set for non-negative {@code int} values. * It is used in the {@link com.github.coderodde.util.Linked...
I'm new to Python and just started to learn about scraping and pandas library. Here is a little scraper I wrote. I'd like to know what's a professional code for this would look like. I have a sense my code has a lot of redundancy but I don't know where to improve. import pandas as pd from bs4 import BeautifulSoup as bs...
In python, I sometimes write a while statement like i = 0 while <condition that involves i>: i += 1 The goal is, of course, to check the number of time the condition is true. I was wondering if there's a more simple, pythonic way to do it ? something like i = while <condition that involves i>, maybe with the walru...
Here's a function save_document(), that polls the pressing of a Extract PDF button in an external program and saves a tmp PDF file in a USB drive. import time import os import shutil def save_document(): print("\n\nPreparing to save the document...", end = "\r") TEMP_PDF_DIR = "C:/Users/TUN/tp3/workspace/tmp...
I am looking for some feedback on my implementation of binary search tree in rust and I would appreciate someone taking the time to go through it and suggest any improvements or corrections as they see fit. More specifically I am concerned about if I should have Clone derives in the BST and Node structs since I am not ...
This is my first big project that I started after completing the Pygame Shmup guide put together by KidsCanCode. I'm starting to feel like it's very close to being finished so wanted to post my code here to find out what could be improved or what isn't up to standard. Brownie points for whoever can figure out why the a...
I'm new to elixir and would really like some feedback on my code. MY background has been node -> laravel -> ruby / rails -> go -> elixir. I'm building an SMTP client and would like to make sure I'm using common patterns before I continue. Any feedback would be appreciated. defmodule Client do @moduledoc """ Documen...
As a follow-up to this question that was an attempt to add basic translation capabilities in an old c++98 program for the sake of the community, I'm posting here the first iteration of my code after applying some of the points that emerged from the previous question: #include <string> #include <iostream> // Not nested...
I am a network engineer and started playing with Python as a way to supplement some downtime in the job. We have no automation at the company so I was playing around with making a GUI to run simple commands to our equipment and give the output in a separate window. The main window (root) stays active the whole time so...
I'm in no way a skilled developer (or even a developer at that!) but I did want to take a go at writing a script that fetched one endpoint's data, extracted some data, sent if off to be geocoded, then saved both the original (with geocodes) and the geocoded data to file. On subsequent requests, it would look up the geo...
(See the previous version.) (See the next version.) After incorporating changes in the previous post, I came up with this implementation. However, I left hashing as it is. com.github.coderodde.util.IntHashSet: package com.github.coderodde.util; /** * This class implements a simple hash set for non-negative {@code int...
I have this program in GitHub. It is used for switching to directories via custom tags. Here is the tag engine: com::github::coderodde::ds4mac::DirectoryTagEntry.h: //// ///////////////////////////////////////////// //// // Created by Rodion "rodde" Efremov on 19.11.2020. // //// /////////////////////////////////////...
In this post, I present the bash script for installing the ds4mac: #!/usr/bin/env bash script_magic="alias ds='source ~/.ds/ds_script'" echo "Installing ds..." grep "$script_magic" ~/.bashrc if [ $? != 0 ]; then echo "$script_magic" >> ~/.bashrc echo "~/.bashrc updated!" else echo "~/.bashrc is alre...
I'm programming a checkers game in typescript. I'd like to explain some important details to understand how the following code works. In my game coordinates are a string, like "b4". I want to get the neighbors of a piece coordinates, but only the neighbors that make sense depending on the player and if the piece in the...
I work at a major Swedish insurance company. I'm in charge of a service that matches bank payments with invoices. I will not show the details of that match logic. But one outcome of the match is that amount on payment differs from amount on invoice. We have a IAmountDeviationStrategy that is tagged on each invoice. Her...
My code snippet represents a way of handling chained errors. I need a code-review to understand whether my way is idiomatic and relevant for the 2021? My personal requirements: I want each package of my project to have an errors.go file with defined sentinel-style errors. This, in my opinion, hugely improves readabil...
Here's the problem. Return a copy of x, where the minimum value along each row has been set to 0. For example, if x is: x = torch.tensor([[ [10, 20, 30], [ 2, 5, 1] ]]) Then y = zero_row_min(x) should be: torch.tensor([ [0, 20, 30], [2, 5, 0] ]) Your implementation should use redu...
This is the question I tried Leetcode: String Compression Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group's length is 1, append the character to s. Otherwise, append the character fol...
Input consists of 2 lists Products: [[20, 'discount1', 'discount2']], [15, 'discount2'], [10, 'NONE', 'discount1']] Discounts: [['discount1', 1, 30], ['discount2', 2, 5.5]] = = = Each product list consist of [product-price, discount-name, discount-name, ....] Each discount list consist of [discount-name, discount-type,...
Preface I have been trying to find out "How to make Client-side Prediction and Server Reconciliation" from scratch with an easy-to-understand code in C#. So I decided to make my own implementation of Client-side Prediction and Server Reconciliation. The Client-side Prediction and Server Reconciliation system I want to...
I do not receive files on holidays; I only receive files on regular days—i.e., non-holidays. I want to skip 2021-09-06 since that's a holiday (Labor Day) and I know I will not receive any files. Instead, I want to get a new file on 2021-09-07, since I will receive a file on that day. I created an automated skip logic f...
I've just created a fully working calculator for my portfolio, and I would like to get a code review. Does that code looks good, or maybe I should refactor it? Is it good enough to be a part of a portfolio of Junior Front-end Developer? Here is the working page with it: https://prmk01.github.io/Calculator (There is an ...
I'm learning how to use DynamoDB and various AWS services, so I decided to write a simple hit counter application for my education of how to use DynamoDB. This application deduplicates hits from the same client for the same page by storing a hash of their user agent and ip address. It also stores 1 entry of hits per da...
I am trying to use Selenium for website automation testing tasks and I am new to Selenium testing framework. The the situation I faced is to wait the website components loading and then do the related operations with the target components. The WaitFor method with xpath and waitingTimes input parameters are designed as ...
(See the previous version.) Now I have this: com.github.coderodde.util.IntHashSet: package com.github.coderodde.util; import java.util.HashSet; import java.util.Random; import java.util.Set; /** * This class implements a simple hash set for non-negative {@code int} values. * It is used in the {@link com.github.code...
It is a classic problem to handle ever changing requirements in a cleaner way without using too many nested if statements. Here is my current code in JavaScript. fetchApiData(url){ //log before start Logger.logFetchStartedEvent(); try { data = backendApi.get(url); Logger.logFetchSucceededEvent(); return...
I'm learning C and I just had the exercise to write a function that checks for the lower one of two floating-points. So I thought, I either could use pointer and also return the pointer of the lower value - otherwise, I simply could use the values and return the lower value. double* pointer_min_value(double* first, dou...
I'm new to C++, and I wanted to add a way to log in a fancy way. As such, I created a small bit of code to do so, but I'm wondering how I can improve my code, especially the fact that DebugColors consists of two files, and regarding my use of templates, as I don't think the adder method(s) of the Debug struct is the be...
I've written this little helper function, that will block the current thread until any of a given list of signals is emitted by an object or until an optional timeout is reached. It can be used to synchronize network communication or the likes. I'm not happy that you have to explicitly specify std::tuple on the call si...
It appears that 7z can't write to a pipe, so I wrote the following bash function to emulate this functionality. I know this is a simple problem, but this is my first bash function and I feel like it's really easy to write faulty code in bash, so any feedback is appreciated. function 7z2pipe () ( local out_dir=$(mkt...
Since I have barely used inheritance in Python, I wanted to make something that would make use of it so I have attempted to create a game of chess, where each piece uses inheritance. I also did this just for fun. I have not added anything related to Checks, Turns (you can move any piece of any colour), game over condit...
var fs = require('fs'); const requestHandler = require('../validations/requestHandler'); exports.index = (req, res) => { try { requestHandler(req); var options = { 'method': 'GET', 'hostname': 'products.torrent.com', 'path': '/torrent/product', ...
I am writing a program that takes user input and writes it to a CSV file. I am also checking to see if what they have input is a duplicate of whatever is in that CSV file. So far, the flow of this code snippet is: Get user input -> Iterate through the CSV file and assign it to a list -> If the list is empty (null) or ...
I have an order model and a client model. A client has many orders, an order belongs to a single client. In the client model I keep track of how much money a client paid (total_generated_revenue), how many orders he has cancelled (orders_cancelled), and how many of his orders were completed (orders_got). In the order m...
This is the implementation of the Assembler required to parse source code written in the Hack Machine Language and output it to a 16-bit binary file. After writing one go in Swift, I decided I wanted to give it a go writing it in C as a challenge to myself to become more comfortable with the language as well as taking ...
One year ago I learned some Python 3 in Highschool, but I haven't really programmed anything since then. I decided to start a new project to try and practice a bit before entering the first year of an IT degree. I tried to create my own cloud storage system in a console application using the Socket library, i.e. a prog...
I have a file of the form - >SDF123.1 blah blah ATCTCTGGAAACTCGGTGAAAGAGAGTAT AGTGATGAGGATGAGTGAG... >SBF123.1 blah blah ATCTCTGGAAACTCGGTGAAAGAGAGTAT AGTGATGAGGATGAGTGAG.... And I want to extract the various sections of this file into individual files (like here I wrote the following code, but it runs too slow, as c...
Note: this is not the solution for the "Character Picture Grid" problem from Automate the Boring Stuff. Instead, this is an expansion of that problem simply for the sake of understanding nested loops, lists within lists, and iterating through values in order to print a picture on the screen. Thanks to anyone who takes ...
As I was writing, I realized I have multiple classes polling for file descriptors in its own thread - lots of duplicate code like, synchronization, creating array of pollfds etc. I've decided to remove the duplicate code by writing the following class, which takes care of polling fds in the background. Any thoughts? te...
The class in this post returns a directed cycle in a financial loan graph. A financial loan graph consists of nodes and directed arcs. If there is an arc \$(u, v)\$ with weight \$w = w(u, v)\$, then we interpret it as that \$u\$ has lent \$w\$ number of resources to \$v\$. Since in a dense directed graph with \$n\$ nod...
I've started learning Python several months ago. This code uses Google API to send URLs to Googlebot. I appreciate it if someone can review my code, and advice better practices in classes/method structure, sending requests and logging responses. How to start the program (link GiHub) import json import re import httpli...
I have User entity that has relationship to other entities(Order,Profile) When I assemble entity from dto and back I need assemble order and profile entity too. User entity: @Table(name = "user_info") @Entity @Getter @Setter public class User implements Serializable { private static final long serialVersionUID = 17...
I recently got fascinated by the world of micro controllers, and chose to do a simple clock project to see what is what. First attempt I used .Net nanoframework since I'm a C# coder by day, but I haven't been able to figure out how to make it execute fast enough. I ported my code to C++ and used PlatformIO to build and...
Any sequence of characters starting with a non-whitespace character and ending with any of the following is considered to be a sentence by this program :- a full stop '.' followed by whitespace an exclamation mark '!' followed by whitespace a question mark '?' followed by whitespace end-of-file Also, any sequence of ...
I am attempting to make three-dimensional discrete cosine transformation spatial frequency components illustration. The 3D cubes is used to present the level of each coefficient. The more bright the cube, the higher value of its coefficient, and vice versa. The 3D inverse discrete cosine transformation is used here and...
I have a higher-order function to create another function given a regular expression: export function createParser<T extends { [k: string]: number }>( regExp: RegExp ) { return function (content: string): T { const matchArray = [...content.matchAll(regExp)]; if (matchArray.length === 0) { throw new E...
I've implemented a custom trait on std::path::Path (and by extension std::path::PathBuf) with a method which turns the struct into a file url and a trait on std::path::PathBuf which constructs a PathBuf from a file url. Would love some feedback on the code, especially any violations of naming conventions, best practice...
Given a vector <Vec<usize>> of indices indicating where to split a string as follows: println!("{:?}", idxs); [2, 1, 6, 2, 5, 2, 2, 1] And the following string (The Series column in the Bureau of Labor Statistics' data): let mut sstr = "JTS000000000000000JOR"; I wrote a recursive function to split the string as follow...
Please be gentle with me-- I just began learning to code a few weeks ago as a hobby in order to support my other hobby of learning general relativity, so this is the first bit of code I've ever written. I would love to keep getting better at coding, though, so any feedback on ways to improve my code would be much appr...
I finished LeetCode 05 with simplified (for ease of implementation) Manacher's algorithm. IMHO it should keeps \$\mathcal{O}(n)\$ time and space complexity. However, LeetCode's benchmark ranked my solution as worst 5% and 30%. What causes such poor performance (time and space)? Can anybody help me diagnose where it we...
I have a class representing meter readings: public class MeterReading { public double AccountId { get; set; } public DateTime MeterReadingDateTime { get; set; } public double MeterReadValue { get; set; } } I also have a collection of MeterReadings called MeterReadingParseResult: public ...
I'm playing with the Real mode and was trying to code something when suddenly I exceeded the 510 boundary (.org 510) of the 512 boot sector size for BIOS and as warning popped out: code.s: Assembler messages: code.s:<line num>: Error: attempt to move .org backwards So I started reading about how to split the code into...
I obtain strings that contain chat messages, and they sometimes have formatting codes imbedded in them. A formatting code is a § followed by a character, and this character then defines how the code will affect the following text. Colour codes can occur at the very end of the String, a common case of a message would be...
I'm making a program that can add 2 terms that the user types. I think I've got identifying or evaluating the terms down. I used classes because I just recently learned it and I also heard it was good practice in order to make your programs shorter. But, when it comes to adding 2 terms together (which is the code under...
The Wikipedia page on Disjoint-Set data structures presents \$4\$ distinct algorithms for finding the root node of the tree, and \$2\$ distinct algorithms for performing the union operation. In this post, I will present all \$4 * 2\$ combinations: com.github.coderodde.util.disjointset.DisjointSet: package com.github.co...
I have recently learned about using PDO. I created a db class which could handle common actions like create, update, delete and select. Is this method a correct way to connect to the database using prepared statements? <?php class Db { private $db_host = DB_HOST; private $db_user = DB_USERNAME; private $db_pass = DB_...
Hi, I asked this question over on stack overflow. However, they closed the thread and suggested to ask it on code review. So here I am :) The code below is an updated version of my original code, incorporating suggestions made on stack overflow. I'm currently trying to improve my C skills and am practising with some tu...
Here is a template class to calculate various CRC checksums. I go out my way to achieve a good C++ encapsulation for a C style code . Any advice or suggestion is welcome. //crc.hpp #ifndef __CRC_HEADER_H__ #define __CRC_HEADER_H__ #include <array> #include <mutex> template <typename T, T POLYNOMIAL, T INITIAL_REMAINDE...
I have this type of table: $this->data = [ 0 => [ 'reference' => 'ABC123', 'title' => 'lorem', 'parent' => 12, ], 1 => [ 'reference' => 'ABC456', 'title' => 'ipsum', 'parent' => 42, ], 2 => [ 'reference' => 'ABC789', 'title' => 'dolor', 'parent' => 36, ], 3 => [ 're...
As the title states, I am building a pre-loader for Wordpress running on PHP 7.3.5+ that will deliver performance boosts in loading, as well as metrics such as Google Page Speed. This is something that we do at work, and I could quite easily copy what has been used there but feel it is 'stolen knowledge'. I could be wr...
Given a rectilinear path, find if it has a loop. A rectilinear path is made up of made up of alternating horizontal and vertical segments. Input => Ordered set of points representing ra ectilinear path. Points have been sanitised to ensure that they represent alternating horizontal and vertical segments. This means the...
I am trying to solve the Climbing the leaderboard problem on Hacker Rank. My code passes all the test cases except Test Cases 6 to 9, which I assume are using large data sets. I'm using binary search to find the optimal insertion point for each score and using the index as the rank. I know there are loads of solutions ...
I am just beginning to learn Python, this is my own take on a Caesar cipher just looking at Python docs. I would like to know how I could have made it better and how would you rate this. Is it any good? #caeser cipher import string message = str(input("Enter the Message you want to encrypt: ")) shift = int(input("Ent...
I'm getting into backend with postgresql and I would like to know how much of my example would fit for a real website database, just for storing and then displaying it on website. create table clients ( id BIGSERIAL PRIMARY KEY, first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50) NOT NULL, age INT CH...
This code was done to allow a user to input, edit, search, delete and print a report of all the products in the company. Is there any way to improve my code? public class Admin /** * @param args the command line arguments */ public static void main(String[] args) { String menuTask, exit; ...
I have the following algorithm to calculate certain ratios of "work", "low work" and "no work" over a set date range (startDate, endDate). The algorithm works fine, but when I increase the date range it obviously runs slower because it has to loop over every day of that range for every minute. Is there a way to improve...
I am writing a function that I would use to handle parameters with options for use later in another project. A sample input would be similar to this: foo bar --baz con str --w=1920 --h=1080 From the example above I would expect foo and bar to be not part of any flag and baz would contain con and str and w with the val...
Task You are at position [0, 0] in maze NxN and you can only move in one of the four cardinal directions (i.e. North, East, South, West). Return true if you can reach position [N-1, N-1] or false otherwise. Empty positions are marked .. Walls are marked W. Start and exit positions are empty in all test cases. I kno...
We are using Dapper as our ORM and have chosen the repository pattern for organizing our operations. This has worked very well for us but I'd like to confirm that this configuration is capable of sharing and disposing of SQL connections properly. Startup.cs services.AddScoped(_ => new DeploymentManagerDbConnection( ...
Introduction I've started to learn C programming a bit and wanted to create a simple 2D console game. Let me first introduce you to the game level/map structure: (1) ################# (2) ################# # # # # # v S ^# # S # ...
Please can you suggest a better / Optimized logic or code for the question. It has been asked that when you find a zero value in a matrix, make that element the sum of its upper, lower ,left, right value and make the upper, lower ,left, right elements zero. I assume to the matrix provided has at least 2 rows and 2 colu...
I made this small program which takes some inputs (emails) and after looking if they exist it looks for the respective id and delete it. It works (I use it with crontab) but seems redundant. I had several problems with split and decode function, mainly because decode gives me lists of strings spaced by a tab. I woul...
I am working on a machine learning problem with object detection. For now, I am trying to find GPS coordinates that are close to other GPS coordinates. If they are close, I want to make note of it by index. So in my example below, with test data, these two areas are not actually close to one another, so their 'close_po...
description I'm using influxDB, I need use Java to generate a query command. The TestingTag struct maybe missing 0-3 fields. code: public List<FluxTable> getAggregatedValueWithTag(String type, String fieldName, String func, TestingTag tag) { queryApi = influxDBClient.getQueryApi(); String flux = ...
Please critique my implementation of Quicksort in python 3.8: import random from typing import List def quicksort(A: List[int], left: int, right: int): """ Sort the array in-place in the range [left, right( """ if left >= right: return pivot_index = random.randint(left, right - 1) sw...
I have written this small program in Python to calculate decimal places of \$\pi\$. I tried to code it as readably as possible, but since this is a bit calculation heavy, it is reasonable to think about performance optimizations. The program calculates the first root of the cosine function using the Newton–Raphson meth...
This is a script that can convert any numerical value to any arbitrary radix representation and back, well, technically it can convert a number to any base, but because the output is a string representation with each a character as a digit, and possible digits are 10 Arabic numerals plus 26 basic Latin (lowercase) lett...
There is a string "abcdebfkj", we need to transform this string to the below array: expected o/p:   ["a", "a.b", "a.b.c", "a.b.c.d", "a.b.c.d.e", "a.b.c.d.e.b", "a.b.c.d.e.b.f", "a.b.c.d.e.b.f.k", "a.b.c.d.e.b.f.k.j"] I am able to do that, but was looking for more promising solution if any. I did that in O(n) time com...
How should I structure this code to create a maze, solve it with breath-first-search (BFS) and to provide basic navigation movements by 1 step within maze with number of moves required to navigate? Use move along the path, Up, Left, Right, Down. Below is some code that I mangled together on how to think / approach and ...
I would love some criticism on the design and get feedback on how easy the python library cira is to use. Cira is a Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets. Cira is available on pip. pip install cira I have made a tutorial but the example that I have used a lot is building a sim...
I just finished my Tic-tac-toe AI, and would be very grateful for opinions and comments on that project. I would like to add it to my 'entry level Python developer portfolio'. README: Simple AI that plays tic-tac-toe with itself. At the beginning it choses moves to play randomly, every possible move has the same probab...