instruction
stringlengths
71
95.1k
Description I'm not sure if it Covid-19 but lately it is impossible to book a tennis court in my area on time. It's always full or maybe just don't check enough :) To beat the queue and get notified earlier, I started making a scraper to ensure I can book a court on time. But because of iframe hell and the lack (to my ...
I was practicing python on codewars.com with this question: Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. For example: 12 ==> 21 513 ==> 531 2017 ==> 2071 But when I attempted my solution it said it was not optimized enough Can someone s...
I am currently a Python beginner, who just finished a script simulating collisions between circles (balls) in 2 dimensions. I would appreciate comments on overall structure, variable names and really anything else. There are bug present, such as a ball occasionally slipping out of a corner, but the code is functional N...
Since I am working alone on this, I would like someone who would take a look and point out any mistakes or things I could have done better. My questions: How could I improve this big switch statement? Is there any obvious beginner flaws? The executeModeration is a method I call when a command is an moderation command...
Trying to improve my Python skills by creating a small text adventure. I have used lists to access certain information, but I am not sure if I am using them correctly. For instance, I have used a list to store weapons but wasn't sure of the syntax for accessing them in an if statement. Also, if there is any advice on h...
The idea is to take a sequence of sequences (of the same type) and use tuples of [iterator, current index, sequence size] to keep track of the current state, such that the cartesian_product object can return one sequence at a time. General questions: bugs? (would hope not!) code quality ok? anything i've missed? is th...
Just created an overlay on hover following a Youtube tutorial - but I adjusted some css to make it responsive. I'd like to hear hear some reviews or suggestions where I can improve. #Projects .card { position: relative; overflow: hidden; } #Projects .card:before { position: absolute; content: ''; width: 80...
My solution to implement a status (string) from combining two other ones. I need to declare a function which takes two params (two strings) and needs to return another one based on the combination of those two strings. For ex: carStatus(status, secondaryStatus) => string where secondaryStatus can have multiple options...
I have a basic articles sorting application, the App component gets some articles and pass them to the Articles component which renders a list of the articles sorted by date or by upvotes. Each article is an object with id (string), title (string), upvotes (number), and date (string format YYYY-MM-DD) properties. By de...
I made the following code in C, which is supposed to create a list of booleans $n + 1$ long, such that the $i$'th element is true if $i$ is prime and $i$'th element is false if $i$ is not prime (starting the count from zero). So for n = 10, it is supposed to give [false, false, true, true, false, true, false, true, fal...
I'd like a recommendation on how I can improve the function unquoted_string below - specifically is there a better way to combine the parsers I have to achieve the desired goal? Strings in this language are defined by YANG RFC 7950 Section 6.1.3. The excerpt relevant to unquoted strings is: An unquoted string is any s...
I'm a 16-year-old so I never studied programming, although I do try to adopt the best practices I can when given the chance. I would like to clean up the code posted below by making it comply with SOLID principle, and any other general improvements that are offered. The class in question is the core entry point of my w...
Quick disclaimer. I've programmed Java for years but this is the first Objective C I've ever written. I've written some code which almost unfortunately works but frankly hurts my eyes with the number of lines of code and quality. Basically looking for the right way to convert the original string: <TUHandle 0x280479f50 ...
Summary I come from a Java background but I am trying to make a game in C++. This is my attempt at a state management system, which should allow me to easily switch between "states" (menu, game, scoreboard, etc.). The idea is that: When the program starts, I create an Application. The Application contains the game loo...
I have a scrollHandler function which contains all of my scroll event-listener logic. I've used multiple IIFE's inside to separate the logic: import skills from './json/skills.json'; let capToggle = false; let triggerCalculateHeight = false; let scrollEnd = false; function headingFadeIn(heading) { if (!heading) r...
Trying to learn a new skill at 40 without any prior related experience :-) Bought the book 'Python crash course 2e' and decided to freewheel a bit with after a week with what I've learned so far.. I put everything in a small program to order pizzas and I would love some feedback before I take up bad habits.. first off:...
The code adds approximately 1,720,000 different combinations of numbers to a file, some_other_file.txt. The numbers range from 2 digits long to 16 digits long. I add 500 numbers at a time to some_file.txt and upon hitting the 500th I move all the numbers to the end of some_other_file.txt. My code works. But it takes ag...
I wrote a simplified versions of Windows' tracert command as an exercise and to learn about TTL in packets. It shows the path that your internet traffic will (likely) take on the way to the given destination. Here's an example (some stuff is redacted out of paranoia): python tracert.py google.com -h usage: tracert.py ...
My experience is more general architecture and software design not code snippets like this. See any improvement to my code? var message = @"This is a test message 012345678901234567890123"; var output = Split(message, 20); output "This is a test", "message", "01234567890123456789", "0123" Max length of a line is 20...
The idea is to represent a hand as a list of cards and create a frequency mapping, which can then be used to identify what rank of hand you have and arrange your hand in a way that allows the Ord type class to compare hands of the same rank. My solution feels a little cumbersome, however this is a lot nicer than anythi...
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; namespace WebApplication1.App_Code { public class SqlHelper { public string connstring; public SqlConnection con; public SqlCommand cmd; ...
I've started Go for the last couple of months and I decided to challenging small projects, so I created this proxy requests script. It works well (in my opinion at least) but I'm looking for different ways of improving this further like being able to target all servers, or making this more concise and compact. To be ho...
I have solved the following Leetcode problem. Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric. Link: https://leetcode.com/problems/symmetric-tree/ I have made a simple iterative solution that takes \$O(n)\$ time ...
I made Password Generator on C#. It prompts the user for the length of the password, whether it contains numbers, lowercase letters, uppercase letters or symbols, and generates a strong password from randomly added numbers, letters, or symbols. There's the code: using System; namespace Password_Generator { class ...
How to flatten the nested try-catch block in F# for the following code? I am using EF Core with F#. The nested is required because I need to Rollback the transaction if there are errors in saving or committing the transaction! let createTenant (ctx: AppContext) (tenant: Db.Tenant) (firstUser: Db.User) = async { ...
I was looking to this exercise: Is Valid Binary Search Tree I tried to do the exercise by myself without looking to the solution and my code is "much simpler" than the code I found at the previous link. Is there anyone that can review this code or provide me some test cases for this problem? Generating test cases is wa...
This program might seem lazy, I also tried iterating through the vector but performance was poor so I used this lazy approach that has more performance #ifndef BINARY_HH #define BINARY_HH /************************************************************************** * Name: Binary.hh * Author: Samuel Oseh * Date: 27/0...
Required to know the performance overhead associated with DataSet and DataTable. When it comes choosing which data structure might be good and performance oriented what if single Result Set is returned from Stored Procedure what if more than one Result Set is returned from Stored Procedure Question may arise choo...
I currently working on CS50. There is a problem where we need to recreate half-pyramids using hashes (#). The hashes are to substitute blocks like in Mario. This is also the first time I'm using Python. I don't really know Python. So I just try to calculate myself based on my experience from C language. from sys import...
Input: Enter an integer number: 123456 [Any number of digits are allowed] Output: Completed integer number : 654321 I have solved this problem by following this strategy: #include <stdio.h> int main(void){ //put variables for further proceed int number=get_input_validation(); int value=find_out_the_number_of_digit(n...
Just as a learning exercise, I am implementing a poker game simulator. I am purposefully not searching for ready made tutorials showing how to do this, relying mostly on the python docs - that way I hope to learn in a more memorable, albeit slower, way. I'm looking for advice on how to code the comparison between cards...
The following is the web exercise 3.2.12. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a program that draws a vector field. A vector field associates a vector with every point in a Euclidean space. Widely used in physics to model speed and direction of a moving object or str...
I have a list of products, I would like to filter that products e.g. by number, price, type etc. using checkboxes, selects and inputs. I get my data from REST API - using query params in GET method. My code is working but I'm wondering how to make it better and cleaner. First, function in my component which connects wi...
I'm trying to get an object with ratings and titles properties: { ratings: [3, 5], titles: ['Movie1', 'Movie2'] } from the following two functions: const getMovies = () => { return new Promise((resolve) => { resolve([ { movieId: 1, rating: 3 }, { movieId: 2, ...
I am new to Java. My task is to create a SequentalWriter class and a SequentalReader class that implement the Runnable interface. They must provide a sequence of write-read operations (i.e., write-read-write-read-write-read, etc.). The task assumes only the use of "synchronized", "notify" and "wait". I would like to kn...
I have below route. I am using Laravel 8. Route::post('/update-crew', array( 'uses' => 'App\Http\Controllers\Directory\Crew\API\CrewAPIController@Update', 'as' => 'apiUpdateCrew', ) ); Is there any way to use namespace instead of writing the path in string. My route contains both uses and...
I need to convert my model to fit data in tableview cell finding better approach My Model class MyResponseModel { var question: String = "" var id: String = "" var answer: String = "" //Other variables also but not required to display init(fromDictionary dictionary: [String:Any]) { self.qu...
I am cleaning str columns in a Pandas dataframe (see below for an example), and I have been wondering if there are more concise ways or additional inplace methods to do so. What are the general best practices for cleaning columns in Pandas? import pandas as pd df = pd.DataFrame.from_dict({"col1": [0, 1, 2, 3], "col2": ...
Goal: Look for a substring match within a text for given Keywords. Keep the substring match if the levenshtein distance is smaller than the length of the Keyword divided by (x=10), else return an empty list. (First of all my apologies if the code is of lower quality. I am quite good in R but very new to Python.) Curren...
I'm doing assembly language problems on CodeWars, a website with practice problems. Problem https://www.codewars.com/kata/545991b4cbae2a5fda000158/train/nasm Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false. Solution In C To give you an idea what the a...
The following is the web exercise 3.2.27. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a data type that represents a particle undergoing a Brownian motion in two dimensions. Create a client program that takes a command line integer N, creates N particles at the origin, and s...
I have the following code, comparing two lists that contains equally structured tuples: list_one = [('id_01','aaa','bbb'), ('id_02','aaa','bbb'), ('id_03','aaa','bbb'), ('id_04','aab','bbc')] list_two = [('id_01','aaa','bbb'), ('id_02','aaa','bbb'), ('id_03','aad','bbd')] for tupl in list_one: for tup in list_two:...
I have the following implementation of the Fnv1a hashing for a string, which should be correct: public static uint Fnv1a(string toHash, bool separateUpperByte = false) { IEnumerable<byte> bytesToHash; if (separateUpperByte) { bytesToHash = toHash.ToCharArray().Select(c => new[] { (byte)((c - (byte)...
Sanity check needed, as I'm still very unfamiliar with the nuances behind async/await and how they relate to more traditional Task / TPL code. I have a high-level repository layer which is assembling a business object from various lower-level repositories. As a business decision, we are doing keyed lookups at the data...
This is for an assignment in my robotics class so the requirements I needed to meet was that it had to be in a while loop and the input numbers needed to be float point. I just want to make sure that I'm not using any bad practices and if there are any areas that can be improved. while (True): # Gets operator, conv...
I have two folders that contain multiple json files. The first folder contains game logs for all MLB teams and is structured like this. {"Team": "PIT", "Games": [{"Date": "Jul 24, 2020", "Opponent": "@ San Diego", "Results": "L", "Score": "7-2", "Line": "+128", "Over_Under": "O", "Total": "8", "Players": []}, {"Date": ...
Recently submitted a code assessment and I was wondering what other's feedback might be. What red flags can you see? I included gradle file if you're interested in running the application locally. Note that I used H2 to make it easier for the grader to run the app without having to worry about the DB they need install ...
I wrote a calculator that can solve equations with variables using matplotlib and sympy. I am looking for tips on performance and style. How can I improve on this calculator? Is it a good idea to use sympy for this purpose? Repl.it import sympy import matplotlib.pyplot as plt class Iterator: name, equation, val = Non...
I have built a To Do App in Javascript, using Webpack and some modules. The app lets you store projects (School, Sport, Grocery, etc.)... And inside these projects, you can store todo items... You can also edit the todo item, and click it do delete/finish it. The app should be built with OOP principles in mind, and tha...
It might help to check my previous question out, its part of the same application. The only minor changes are with the entity class names. They now each have their own entities, and I use interfaces for polymorphism so each site has its own entity, rather than ambious class names like ProfilePost, ProfileConnection, wh...
I'm currently working on a project which should create VDM files. Here's a basic example: demoactions { "1" { factory "SkipAhead" name "skip" starttick "1" skiptotick "3623" } "2" { factory "PlayCommands" name "startrec" starttick "4123" ...
I'm writing an AI in C++ for OpenTTD, and the first component is a path finder. If you'd like to run it yourself, it's on Github here: https://github.com/marlonsmith10/empire_ai. Currently, it will pick two random towns and build a road between them. The pathfinder class Path is used by calling find() repeatedly until ...
I am trying to see if anyone can help me in making this Excel VBA code a little faster in rendering the data from the weather site I am using. Maybe instead of getting all 14 days it includes in the site, could I get help in getting just 10 days? Any help is much appreciated. Thanks! Sub MiamiWeather() Dim HTTP As...
I have this Javascript which call the web api to see the available folder and then the available files. Any comment or code review on my code? var divFolder = document.getElementById("rootFolder"); var divFiles = document.getElementById("files"); function createFolderElement(data) { var li = docu...
I wanted an easy way to import a large database of crystallographic values into a program I'm working on. I installed Selenium and put together a simple script to scrape space groups and coordinates. There are a total of 230 space groups with a varying number of coordinates and possible translations to consider. Creat...
I tried to write Candy Land game in Haskell as a step to work on something bigger than those toy programs/functions I used to write. I wrote myself a python version first, with a functional mindset before I started working on the actual Haskell version, and it was a breeze and easy and I got it to work in a little bit ...
Note: I have a working solution, my question is about optimization and other approaches. Problem Description Hello, I'm re-writing an old program I made that solves nonograms. As part of solving it, I generate (for some of the lines) an array of all possible ways to fit the numbers in. I want to create a piece of code,...
I understand that creating public properties that control private fields is good practice because of coupling and encapsulation, although lately I have seen it as such a waste of boilerplate code for a simple entity class like below. Take this class for instance, public class PersonEntity { private string _firstNam...
I have some use-cases where I want the behaviour of the build-in any() function to be slightly different, namely to return True if the iterable is empty. Therefore I came up with the following override: _any = any # Alias built-in any. def any(iterable, *, default=False): """Generalization of the built-in any() ...
I have a component that shows the status of a customer's billing plan. There are about seven different states it can be in, with about six props each (I've simplified it down to two for this example). I'm trying to create an enum that I can get the props from, to be used like this: <PlanCard {...PlanCardProps.TrialPlan...
I am grouping lists within list together given they have one element in common. My input data is [[1, 2], [3, 4], [5, 6], [1, 2, 7], [8, 2], [9, 5]] My output is: [[1, 2], [1, 2, 7], [8, 2], [3, 4], [5, 6], [9, 5]] The code I am using to accomplish this is: mylist = [[1, 2], [3, 4], [5, 6], [1, 2, 7], [8, 2], [9, 5]]...
This is a Google foobar question. The gist of it is that I have to find the shortest path from top left to bottom right in a 2d array of 1's and 0's, where I can only traverse on 0's. However, the twist is that I can change one 1 to a 0. My code works for the first three test cases, but it fails the final two (not sure...
I was trying to solve this problem with Python 3.8. I couldn't find a way other than to brute-force calculate all the possible permutations then check which permutation was valid. The program works fine, but as it's O(n!) time complexity (I think) it takes extraordinarily long when the input has a length of, say, 1000....
Is this script sufficient enough to validate user email input? <?php //1 DATABASE CONNECTION $dbHost = "HOST"; $dbUser = "USER"; $dbPassword = "PASSWORD"; $dbName = "DATABASE"; try { $dsn = "mysql:host=" . $dbHost . ";dbname=" . $dbName; $pdo = new PDO($dsn, $dbUser, $dbPassword); $pdo->setAttribute(PDO::ATTR_E...
I have written an accumulate function similar to std::accumulate that works on a std::array. The goal is to remove the loop using fold expressions. This code currently works in c++17: #include <array> template<class U, class F> class array_accumulate_helper { public: array_accumulate_helper(U& u, F f) : r(...
I've recently been learning C on my own, and I thought I'd try my hand at writing a graph implementation. // graph.h #ifndef GRAPH_H #define GRAPH_H #include <stdlib.h> #include <string.h> typedef struct node node_t; typedef struct node { int value; node_t **links; int links_count; } node_t; node_t *cre...
In order to get more accustomed with classes in Python, I have written a genetic algorithm, which takes a level with a start and end point and searches for a route (not necessarily the optimal one). The output shows the basic level and when a solution has been found, the level with the route: Level: ############ O....#...
I'm working with TCP sockets in C, specifically only for client side HTTP(S) requests, and would like to get some feedback on my send and recv code. You can make some assumptions regarding my code, as it is, by no means a complete example but I'll try to make it reproducible. Assume sfd has been set to O_NONBLOCK Assu...
I want to know if my SCSS code looks correct. Note: Everything works as I expected. The Main Idea of this code is to generate Word Break Utilities for controlling word breaks in an element. using SCSS mean I can declare only css classes in html element. here is the result of my code : .break-normal { overflow-wrap: n...
I am trying to build this view model that has a ChildViewModel and this was the only way I was able to get it working. Any advice on how to make this code; cleaner, more effective, just overall better! It’s just the adding to view model that will need to be reviewed the other section is to create the mock up. stati...
I have made a program that sort of mimics YouTube trending, but only with videos from channels that I am subscribed to. It looks at each Subscription, converts the subscription to a Channel, gets the channel's uploads PlayList, converts each PlayListItem to a Video, and finally filters the videos to only include new up...
I have come across a situation where I feel running some code in parallel will greatly improve performance, but I am concerned about the implementation and am looking for some confirmation. Take the following controller resources [HttpGet] [Route("{id}")] public IHttpActionResult Get(int id) { return Ok(_context.G...
I have sorted ascending number if you do abs(arr) in below code, I am trying to search for index where sign got changed from negative to positive. Wrote this below code, but for some reasons, I believe we can improve it or optimize more. Any tips and tricks ? import numpy as np arr = np.array([-1,-2,-3, 4, 5, 6]) _cut_...
I made a placeholder for entry widgets from tkinter, so I was wondering how good it is. I just started learning Python a bit before, so please do correct me if I'm wrong or if I missed something, or some easy steps or where it loses the efficiency. Code: import tkinter as tk from tkinter import ttk class PlaceholderEn...
Problem I keep trying to use various todo lists. But I keep coming back to the same situation; not having an active todo list. This can come in two forms: I don't have a habit to open bespoke software. I've tried using Excel, notes and calendars as they're close to my current work flows. But I tend to always forget ab...
So this is a fun little project I am working on. This is my current progress with the game: import random import time import pygame pygame.init() pygame.font.init() pygame.display.set_caption('Parsel Tongue') MARGIN = 60 WINDOW_SIZE = (600, 600 + MARGIN) RED = (255, 0, 0) BLACK = (0, 0, 0) GREEN = (0, 255, 100) WHI...
I created a project for academic purposes that works on Twitter data. It should: Get all friends and follows of the user Store them in MongoDB Display them in a table I'm using django + plain HTML, but when trying on an account with only 230 contacts it took 3 minutes to load. The application is intended to be scalab...
I have written a k-means function in Python to understand the methodology. I am trying to use this on a more complex dataset with a larger value for k, but it is running super slow. Does anyone have any recommendations for how I can improve this? I have provided code below, along with loading in an example dataset and ...
I am sending a series of SOAP messages to a server and capturing the results of the SOAP transaction. The issue that I am having is that I need to perform five SOAP calls, and each call requires some data from the previous call. This has led me to create a Data Class that holds Strings accessible with Getters and Set...
I have this working code, but sendAndReceive function looks ugly/smelly to me. Eslint complains about using await inside a loop, and using true as conditional in while loop. Would there be a more elegant way to achieve this? I mean, "blocking" until a response appears in inbox before returning a response. This is neces...
See my original post: here. I have one html page and four php files that allow users to sign up for an email list. One of the php scripts is a cronjob that deletes unverified rows older than 24 hours, and it is not included below for the sake of post length. I use PDO for my prepared statements. Everything has been tes...
I've been trying to get into web development, so I made a quick Tic Tac Toe implementation. It feels messy to me, but I'm not sure what is really considered to be good practice and what not. Any poor practice in my code, or things I could improve? https://github.com/jason-shepherd/tictactoe //Get the board, record, a...
I have a personal website that I use to share videos and images with friends. Below is a media generator using JavaScript and HTML. Its main purpose is to display one image at a time at the click of a button, but any type of media can be displayed. My goal was to create a fast-loading page to hold all of my media. //...
I've found the following example of an infinite slider to use on a project but as I will have multiple instances I have converted it to a prototype. The original example https://medium.com/@claudiaconceic/infinite-plain-javascript-slider-click-and-touch-events-540c8bd174f2 My conversion function Slideshow(slider) { ...
I want to return a NumPy array of Element IDs with at least one Node being in the interesting Nodes list. I have: A list of interesting Nodes, Interesting_Nodes. The size is ~300,000 items. A list of sublists which represent Node forming an Element, Nodes. The size is ~1,000,000 lists of ~20 values. Nodes[i] contain ...
The purpose of this project is to generate an interactive Mandelbrot set. The user can specify the degree of magnification from the command-line and click on the produced picture to magnify the picture at that point. Here is a data-type implementation for Complex numbers: public class Complex { private final double...
I have a tree in my application from which I need to periodically take a snapshot. I've been using locks so far, but after running into a few deadlock issues I decided to create a lock-free implementation. I'm using a persistent Map implementation together with an actor. My goals were: Consistent snapshot from the Map...
I am trying to solve a problem, which requires me to output the xor of all coefficients in the product of 2 input polynomials. Having seen that the normal O(n^2) multiplication is not optimal, I tried to accomplish the same task by using the Karatsuba method which is equivalent to the one for numbers. It turned out tha...
I am trying to speed up the performance of this program. The only file we can change is dictionary.c The problem is basically to load a dictionary and then do a spell check on submitted text. The approach we used was to assume the dictionary would be already sorted (it is)and then create a hash table in a trie and lo...
Can this code be shortened or optimized, Written out this script to be used before node.js starts a few canvas elements and some vide streams. wondering if the initial checks can be shortend or optimized. is there any issues that I have not spotted or that could be reworked to be shorter. the code block that is inbetwe...
What are anagrams? An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “abcd” and “dabc” are an anagram of each other def anagram_check(string1,string2): list1 = [char1.lower() for char1 in string1 if char1 != " "] list2 = [char...
The main reasoning behind this PDO wrapper, is that I find myself using unique constraints quite frequently in my designs, and I have if ($ex->errorInfo[1] == 1062) littered throughout my code, and I thought there has to be a better way. <?php class PDOMysql extends \PDO { public function __construct($dsn, $usern...
I enjoyed the many headaches this project gave me as I learned a lot! I have been studying Java for less than a year and am new to programming in general. I read over the comments rules and hope I followed them correctly. I don't know many people that code and would love any feedback. This was a school project I worked...
Security threats in mind: SQL Injections!!! --- Solutions: Prepared Statements (PDO) and including $bpdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); in the database connection XSS Attacks!!! --- Solutions: htmlspecialchars(), Content-Security Policy (placed in htaccess). OS Command Attacks!!! --- Solutions: St...
This class is designed to decide if a ticket is qualified or not. A qualified tickets is one that is open and not assigned or if a ticket is a work in progress and assigned it can be taken over. It also validates if a ticket has proper ticket form is CSXXXXXXX. Any and all advise/ideas are wanted and appreciated! class...
Introduction As a Python neophyte, I implemented the Hangman game as a practice, which operates case-insensitively on the 26 English letters. My biggest concern at the moment is my use of bytearray to store the word, but I might have made other beginner mistakes as well. I'd like to locate them and improve accordingly...
I am looking for the best way to save regular data from a series of sensors to a CSV file. the program will be reading every sensor once a minute 24/7 and needs to report the results to a CSV file that can be accessed at anytime via ftp.. I also wish to create a new file each day. Is it best to; A: open the file at mid...
It's been a while since I did anything with JavaScript. I made a tile puzzle game to help me brush up. You can find it here: https://compucademy.net/tile-puzzle/ I would like some feedback on my use of JS, HTML and CSS. Anything would be helpful - structure, best practices, overall approach, suggestions for improvement...
The state machine has the below specifications (defparameter *test-machine* (make-fsm :alphabet '(a b) :table '((2 1) (0 2) (1 0)) :initial 0 :accepting '(2))) The FSM in the function is: [1]> (fsm-alphabet *test-machine*) (A B) [2]> (fsm-initial *test-machine*) 0 [3]> (fsm-accepting *test-machine*) (1) The tran...
I added type definitions to a simple npm package. I would love to get some feedback on ways to do better for the type definitions. The package exports a single function which returns a function that returns a promise: function request(httpsOptions, body) { return new Promise((resolve, reject) => { const req = htt...