instruction
stringlengths
71
95.1k
I'm learning OOP and also trying to learn and implement some design patterns. This question is a follow-up of Stopwatch interface OOP (Vanilla JS) The app is available in https://nacho-p5.github.io/ Here's the code: Repo: https://github.com/nacho-p5/nacho-p5.github.io The community gave me good feedback and I made the ...
I'm a new programmer who is currently working on a personal project. It is supposed to be a login program which stores user data in a SQLite database. I was wondering if anyone could look at my code and provide any constructive criticism. Please contribute, regardless of how insignificant the flaw may seem. Anyway with...
I need to download a fairly large xml (up to 2 GB) then load it into memory or possibly an empty db on a stand alone machine on a semi-regular basis. I need to grab a large amount of very specific data from the xmls for a statistical treatment. I realize ETLs like this are usually a one time deal for migrations and the...
How could this Firestore function be improved, please? This is a question to help us learn to write better code. So by improved, I don't mean made shorter... I mean made clearer as to what it is doing, more efficient in terms of its operations, easier to understand and maintain. I found getting this code working very f...
I recently build a simple image editor in Python. There is nothing specific that I am dissatisfied about regarding this code. I am just asking for general criticism to help me improve. import pygame import random import time x = input("Do you want to edit an image?") if x == "yes": image_url = input("please ente...
I was trying to solve a problem that was briefly mentioned at the beginning of the "The Algorithm Design Manual" by Steven Skiena (Ch 1, Problem 26). It took me some time to build a working program from the pseudocode, and I think I've got it pretty close to the described idea. However my C++ knowledge is lacking, and ...
This is part of a larger c++ project that I want to migrate to rust (a pdp11 emulator). This is one of the gnarliest bits of the c++ code so I thought I would start with it - its also self contained and relatively small. Its purpose. It maintains a queue of tasks to be run at some time in the future (typically less tha...
I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem Storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations. The game is represented by a grid of size m x n, where each element is a wall, floor, o...
This program implements the back propagation algorithm of neural network with an example. Can we make it more efficient? from setuptools.namespaces import flatten import numpy as np import math inputvalues = [0.1, 0.9, 0.5, 0.2] initialweights = [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.7, 0.8]] hidden_initial_weights...
This is my 2nd attempt at this game, I took advice and tips on the last one from here. I took tips on how to not let memory stack overflow and to write a bit better story. Do suggest on how I can improve my code in general ? Thank you. import time #added to enable pause #A text based vampire survival game #possible a...
First post. Can you please review my code and help me improve my coding. Please also suggest improvements if there is a miss in this post. Problem Statement Given two sorted arrays X[] and Y[] of size m and n each, merge elements of X[] with elements of array Y[] by maintaining the sorted order. i.e. fill X[] with fir...
After watching Tom Scott explain Huffman coding in this YouTube video, I wanted to implement it myself. I want to use this project to further my understanding of Python. Additionally this tool should be easily usable on the command line e.g. normally input is read from stdin and output is written to stdout. Did I miss ...
I am looking forward to an answer to improve this code? Thanks. Test class package test; import main.algorithms.LargestSumContiguousSubarray; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class LargestSumContiguousSubarrayTest { LargestSumContiguousSubarray largestSumContiguousS...
I've seen few similar post about dynamic array in C released as macros, but I tried a new approach to make it looks more like a template, wrapped in a big macros. However I need a review for suggestions or improvements also. Here is the trivial implementation: dynarray_t.h #ifndef DYNARRAY_T_H #define DYNARRAY_T_H #inc...
I was looking at a code review of a Tic Tac Toe game in Python when I recalled a talk about not using classes, and I wanted to see if I could write a readable, working implementation of the game without classes. In order, I am interested in improving the code's: readability, simplicity, idiomatic ("Pythonic") usage. ...
This is an alternative parser based on the specifications from this question. Briefly stated, the input file is a text file which has at least 33 fields separated by semicolons. If the fourth field begins with either a T or an E, the line is valid and a subset of it written to the output file. Specifically, fields as...
I am learning Dynamic Programming and tried to solve the nth ugly number problem using it. Here's my code for the problem in Java: import java.util.HashSet; public class UglyNum { //using DP bottom up public static int getUgly(int n) { HashSet<Integer> u = new HashSet<>(); if (n < 6) ...
As a preface, I'm very new to coding (self-learning) so if you notice any bad habits please let me know, it would be GREATLY appreciated. I'm self-learning Ruby so I don't really have a frame of reference of if my coding is appropriate, easy to read, difficult to read etc... so I'm thankful for any feedback you guys ha...
I'm posting a follow-up code on this question, which seems to be a version of Sokoban. If you'd like to review, please do so. Thank you for your time! Problem Storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations. The game is represented by a grid of size m...
I am a beginner programmer trying to go past the simple tutorials like Codecademy. I decided to make a rock paper scissors game to get some practice in making projects. Any feedback is welcome! using System; using System.Reflection.Metadata.Ecma335; using System.Runtime.CompilerServices; namespace ConsoleApp1 { cl...
I have developed the following short JavaScript function to convert numbers to the Indian Numbering System formats; both the Official Numbering System and the Common-Use System (i.e. using the Lakh-Crore System) using the method of converting the number into strings of Siptlets and Duplets. Based on this wiki article t...
This is a Bash script that runs commands which builds code using the parameters given. Code The task: I have multiple instances of websites which need to be build individually using individual yarn commands and then copied out of a build folder and placed into their own individual folder. I found this very repetitive a...
I have implemented a depth first search using a stack (in a separate class). Any suggestions please on improvements for the below code: class Stack: """(LIFO) queuing policy implemented using python list.""" def __init__(self): self.list = [] def push(self, item): """Push 'item' onto the s...
I'm learning Python and would appreciate any (and all) feedback to improve myself. input/output example: >>> list_of_words = ['deltas', 'retainers', 'desalt', 'pants', 'slated', 'generating', 'ternaries', 'smelters', 'termless', 'salted', 'staled', 'greatening', 'lasted', 'resmelts'] >>> sort_anagrams(list_of_words) [...
I need to run over all the IP addresses on the CIDR 10.96.0.0/12 network. There are 1,048,574 IP addresses. I created a multi threaded program in Go to do it, but even when I use 100 threads it takes lots of time (didn't check exactly but it is more than 10 minutes). Is there are way I can do it more efficient? By the ...
Context of the Problem I am running a discrete event simulation where at the end of each event I store the state of the system in a row of a dataframe. Each simulation run has a clock which determines which events are run and when, all the simulation have the same initial clock (0) and the same end clock (simulation en...
I have implemented some meta functions to create sequence for exponents of 2. I would love to know if there is any way to make the code more optimized. Note: int main() should not be modified. From the requirements of my school: This program must implement three definitions: sequence<Ts...>, print() and printing_type(...
I wanted to learn C and Win32 so I thought the best way to start would be to create a simple game to get familiar with the language, so I made Snake. The games works perfectly except for sometimes seeing the game window flash for a split second, don't know what causes it. Code: #include <stdio.h> #include <windows.h> ...
I'm rehashing some of the basics of c++ and I just want to find useful points along the way of things I can do to improve my coding. This program has the user enter a number, then the computer try to guess it, with some higher/lower logic. #include <iostream> #include <cstdlib> #include <ctime> int main() { srand(...
So i read about simple series for Pi named Leibniz Series for Pi. Here is its Link:- Series . I made a program for it and soon realised that it converges very slows . So i did Euler accelerate for Alternating Series https://en.wikipedia.org/wiki/Series_acceleration#Euler's_transform and made this recursive program:- im...
I am solving a problem on Leetcode that requires me to design a hash set. I intend to solve it using linked lists where each linked list would represent a bucket. I am intending to implement this: However, I am failing in one large test case. This is my solution that failed a test case mentioned below: class MyHashSet...
When asked to increment / decrement a particular value I usually create specific functions to handle this functionality. Like this: const increaseQuantity = index => { const currentItems = [...stock]; currentItems[index].quantity += 1; setStock(currentItems); }; const decreaseQuantity = index => { ...
I coded a registration form and was wondering if anyone could give me feedback on whether I'm lacking any major security mechanisms. I've done loads of reading around the topic and feel it should be secure but expert feedback would be great. Registration script <?php // User/pass only used locally $host = 'localhost';...
I wrote code to filter for duplicate elements in an array. I'd like to know your opinion, whether it's efficient at all, or if there's too many objects created, use of both array and list. That's in preparation for an interview. I'm not interested in lambdas (distinct) or helper methods, I'd like to see where I can imp...
I started learning programing with C++. It runs perfectly, but I wonder what things I can improve following the principles of class inheritance, access, overwriting, virtual functions and destructors, and why. #include <iostream> // allows program to output data to the screen using namespace std; struct Base { v...
Back with another Reddit bot. This one provides games of Hangman to an arbitrary number of players simultaneously. Users interface with the bot by mentioning it for a new game. Once that game is started, the user guesses continuously and the bot replies until win, loss, or forfeit. A user is limited to playing only the...
I wrote this little hook so I could fetch some remote resources: import {DependencyList, useEffect, useRef, useState} from "react"; export default function useAsyncValue<T>(cb: () => Promise<T>, deps?: DependencyList): T | undefined { const [value, setValue] = useState<T | undefined>(undefined) const nonce = u...
I would like to transform the input elems = [a, b, c] terms = [t1, t2] @spec contains?(term, elem) :: boolean def contains?(term, elem), do: #implementation to either of %{t1 => [a, b], t2 => [c]} or %{t1 => [a], t2 => [b, c]} where t1 |> contains?(a) #=> true t1 |> contains?(b) #=> true t1 |> contains?(c) #=> fals...
I have implemented a customized memory allocation class template for an assignment. Codes are commented; Hopefully it's clear. I would love to know if there is any way to make the code more optimized. Note: int main() should not be modified. From the requirements of my school (Must be adhered to): Implement an alloc c...
I made a helper function for drawing the map(OpenLayers). Then I made another helper function for fetch(axios.get) the map URL. So my question is should I switch from from .then() (loadMap_before()) to async/await (loadMap()) ? Which way is better? Or option3 is the best where loadMapUrl() helper is totally unneces...
FEN strings are compact representations of chess board positions which allows you to derive the necessary information to start playing a chess game from that position. This includes things like the pieces on the board, castle statuses, etc. More information here: https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_No...
I have a class as follows, where I want the user of the class to know that setting the Slug property to null is supported, and its getter will still return a valid value: public class Post { public string Title { get; } public Post(string title) { Title = title; } private string? slug; ...
I'm trying to write a script that would (a) fetch StackOverflow questions and (b) update a markdown table with new entries. With github actions I automated this script to run daily. Idea borrowed from simonw Code: import re import requests from pathlib import Path from datetime import datetime URL = "https://api.stac...
I'm implementing a kind of 'heartbeat pattern' with websocket in JS. The idea is: the server keeps a dictionary holding a Websocket object for each uuid (an uuid is a client). const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 8080 }); const DELAY_TO_DECLARE_DEATH_CLIENT = 15000 let websocketsDi...
I have a class that opens a text file and reads out its content. This class has a member function that will extract a substring between two given delimiters. My application needs to extract between 6000 and 7000 substrings of this text file content on start up. Even though speed is not the most important concern, the w...
I have implemented a zigzag array which will sort smaller greater smaller and goes on... For example : 3 7 4 8 2 6 1 is a valid ordering. The relationship between numbers is 3 < 7 > 4 < 8 > 2 < 6 > 1 3 smaller than 7 7 greater than 4 4 smaller than 8 8 greater than and so on the ordering always has to be "smaller tha...
I have a List that I want to compare to an Enum. If a.Value is found in the Enum we return true. I feel that I should be able to make this a single line, but have struggled. private bool IsFound(IEnumerable<SomeAttribute> attributes) { foreach (AttributesInMethod option in Enum.GetValues(typeof(AttributesInMethod))...
I have an Excel file containing a free-form text column (that sometimes is structured like an email), where I need to find all first and last names and add an extra columns saying TRUE/FALSE to these fields. I do not need to extract matched data (i.e. note it down in an adjacent column), although that could be an advan...
Description A class representing an undirected graph. At the moment, it supports integer values as vertices. An example of the type of graph represented is shown in the following diagram: It is represented internally as an array of adjacency lists. Each index of this array corresponds to a vertex number, and contains ...
I have implemented a solution for finding all anagrams. Are there any other suggestions for improving the solution? package main.algorithms; import java.util.ArrayList; import java.util.List; public class AllAnagrams { // Sliding window public static void main(String args[]) { // s: "cbaebabacd" p: "a...
I have a script that makes a bunch of api calls (xml) and it's not adhering to DRY because I am repeating a lot of the code in the functions, what would be the best way to clean this up and reduce the amount of repeat code? def get_api_key(hostname, username, password): url = 'https://' + hostname + '/api' valu...
So I started this question, I believe i have synchronized the methods correctly, need some insight on whats wrong and what should be done. I have to modify ths class Purse so that the method AddCoin is synchronized and implement a synchronized RemoveCoin method with a Coin argument, I believe that is done just fine. ...
I decided that in order to get better at programming, I should focus on building and improving simple projects. I have made a library program that contains collections of unique books of varying quantities. Although this runs as expected, I am not satisfied with the potential of expanding it to complexities. What are t...
I would like your opinion of my PowerShell function. Does it follow conventions, and what could can I do to improve it. It is made to create LDAP friendly username from a full name in Serbian language. function Get-UsernameFromFullName { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory =...
I wanted to make a script that would parse a main file (with int main()) look in its #include "..." local headers, and if they were not in the current dir, then find those headers, then its source files and provided them as implementation in g++. In other words, I wanted to have a script-helper, that would watch for de...
I write code in a Test-Driven way and I often build my functions starting with tests for the easy edge cases. For example, given a flat array of Items that have a category property, return an array of Groups, each built with all the items for one of the categories in the input. One edge case I find helpful to test firs...
I have two Python lists, label and presence. I want to do cross-tabulation and get the count for each block out of four, such as A, B, C, and D in the below code. Both the lists have values True and False. I have tried Pandas' crosstab function. However, it's slower than my code which is below. One problem with my cod...
I've created the following SEDE query which calculates the reputation averages of users on a particular site. It also optionally excludes "new" users (users with rep of 1 or 101 so note 100% accurate). DECLARE @exclude_new_users INT SET @exclude_new_users = ##ExcludeNewUsers:int?0## DECLARE @excluded_rep_table TABLE (...
I have a numpy array called contour of \$N\$ coordinates (x,y) of dimension (N, 2). For each point in this table, I would like to create a square centered at that point and perform a test on the square formed. My current code is slow, probably due to the for loop. Can the execution speed be improved? My code: def neigh...
In Python 3.7, I frequently find myself writing something like this in __init__: self.foo: Optional[Foo] = None For example: window = Window() # do some more setup here before going to user path = get_path_from_user() window.build(path) class Window: def __init__(self): self.image: Optional[Image] = N...
The challenge is to sort an integer array containing only ones and zeros with the lowest complexity possible. As always, I am interested in any improvements suggested but in this question I am most interested in whether the complexity that I have assigned to the algorithm is correct (as well as the lowest possible). I ...
I just completed the first release for my first game on Python, called Dungeon Ball. I'm looking for people to test out the app and give me some feedback and constructive criticism. I'd like to use this project as a way to improve my programming skills and hopefully learn some efficient programming practices. The game ...
This is mostly an exercise for me to try to understand the differences between semaphores and locks. It's a long and rambling because it took me quite a few tries to understand the concepts. Please bear with me. I am hoping you can either confirm that the lesson I learned was correct or pointing out my misunderstanding...
I've written a python code for finding the distribution of the leading zeros of SHA-1. Using random inputs and hashing-then-counting. Normally it is expected to fit the n/2^i curve where n is the number of trials. After this, a plot is drawn. import hashlib import random import matplotlib.pyplot as plt leading = [0] *...
I use the following code which works as expected. The code uses open ID connect to login user. Because I'm pretty new to node and express, it will be great if I can get some tips for the async usage- e.g. if I’m doing it and the error handling correctly. The code is doing connect via oidc layer https://en.wikipedia.org...
I have a Spring service that calls a few methods to @Service @RequiredArgsConstructor @Slf4j public class CarService { private final CarRepository carRepo; private final Mail mail; public void syncCars(Set<CarInfo> carInfos) { carInfos.forEach(carInfo -> carRepo.findByCarI...
Previously, I built a scraper to get ranking data for ATP # 1 over the years. See Webscraping tennis data, and follow ups. Now, I use the data to rank the players on the basis of how many weeks they've spent at #1. I'd appreciate general feedback on code style and structure. The Scraper class is unchanged, so really ev...
When I first tried to implement std::function I thought it would as easy as creating a class that holds a function pointer. Consequently, I quickly figured out that I was wrong when I tried to use it with a capturing lambda and got an error message. As a result, I quit and until recently I wondered how std::function wa...
Purpose. Provides a background task queue so that code can ask for a function to be run at a specified point in the future. They indicate what to run (a closure) and when to run it (also a name just used for tracing). My use case is typically 2-3 items queued at any time, typical items are very fast (think read 100 by...
I am using the library geoip2 to get Geolocation of many IP adderesses """ input: str: IP output ordered list: [0] str: City, State, Country [1] tuple: (Lat; Log) [2] str: Postal """ for i in pd.unique(df_to_print['requesterIp']): res = reader.city(i) # NOTE: Second snippet is added...
I am trying to extract and save images from a Dicom dataset. It is taking approximate 4-5 hours to process 1000 files. (Also, I am reading and saving files in an external hard drive so there is a time lag due to this factor too) Is there a way to expedite the program as I have more than 10k files and it'll take me fore...
Client From a POST request I get a mixed structure of an array and JSON. To handle multiple type of elements I am using var_dump to get the passes. For $_POST I get this: array(2) { ["json_data"]=> string(677) "[{"firstname":""},{"lastname":""},{"email":""},{"countryCode":""},{"phone":""},{"i_signup_password":""},{...
I have a set of connections and protocols for which I am writing unit tests. Their purpose is to assess 2 vectors for validity and consistency; that is there must be not any elements that have been lost, received out of order or are invalid. Vector to send is always sorted. I came up with a naive function to make such ...
from enum import Enum from fastapi import FastAPI app = FastAPI() Hi Defined a route and a Enum Class for the same but the Enum Class looks ugly. class Subjects(str, Enum): path1="AcceptedEventRelation" path2="Account" path3="AccountChangeEvent" path4="AccountCleanInfo" path5="AccountContactRole" ...
This question is abut coding style. I'd like to see how would you improve this code look considering readability as well. Feel free to upvote others solutions you find good. #1 Initial version: SELECT greatest( 0, least( 500, (SELECT g.c_daily_limit * ( SELECT count(*) FROM rivals.t_rival_gr...
I have a React functional component where users can add a movie from a list to their dashboard. I'm displaying a toast (Material UI Snackbar) to show the result. The result can be good: movie has been added, or bad: movie is already added to your watchlist. const addMovie = (movie: IMovie) => { const isMovieDuplicate...
Microcontroller receive data on uart and call parser_i2c function when user presses enter e.g. parser_i2c(I2C scan) I want to parse following input from user communicated through uart I2C scan I2C read read_adress I2C Write Write_address data I have wrote following code void parser_i2c(unsigned char str[20]) ...
I am working on script to a upload image files Securely. can anyone please review my code and suggest improvements on security. <input type="file" name="images[]" id="image" multiple="multiple"> check if request method is POST and request was made from same domain and form was submitted with submit btn if (is_post_requ...
I have implemented a LinkedList removal fo duplicates class by using HashMap. Looking forward to your reviews. Thanks. package test; import main.algorithms.LinkedListRemoveDuplicates; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class LinkedListRemoveDuplicatesTest { LinkedList...
This is my first proper-ish project I've made. This was my first time using classes as well. I know that I made really stupid decisions, this is extremely far from being anywhere close to optimal, and probably made my future life hell if I decide to add things to this one day, but that's why I'm asking for help. I star...
The below is the C# implementation for the a function for given parameters int a, int b - both represent characters 'A' and 'B' respectively, where the function should return a string containing both characters 'A' and 'B' occurring a times and b times respectively but neither 'A' nor 'B' repeating consecutively for mo...
I'm trying to insert data from ArrayList to HashMap<String, Language> optimally. Many items may have the same languge_name (code below), so I need to group items having the same language in Language class and store languages in a HashMap with the name of the language as a Key. Item String name; String language_name; L...
I need to perform some expensive calculation, such as determining a Fibonacci number: /// Calculate the Nth Fibonacci number (inefficiently) func fib(n: Int) -> Int { n > 1 ? fib(n: n-1) + fib(n: n-2) : n } My project contains a number value types that need to perform calculations like fib based on their properti...
Writing a double-linked list seemed like a good practice for understanding it. I tried to fix all the errors that were pointed out to me in the last question, as well as add new functionality. In General, I will be happy to receive new optimization tips and answers with instructions for bugs or memory leaks. #include <...
I have implemented the topological sort. Is there any suggestion for optimizing the solution? Thanks. package src; import java.util.Iterator; import java.util.LinkedList; import java.util.Stack; class Graph{ int V; LinkedList[] edges; public Graph(int vertices){ V =vertices; edges = new L...
This is Merge Sort that i implemented, i feel i can make it better esp the combination function. So i split the code into functions because i don't like seeing a bunch of spaghetti code in a single function. I have the combination logic which combines the left and right array such lower elements go first. def combine(l...
I have to implement some business logic that will round a number (typically a double) upwards. Given that this number comes from a third-party and I don't know how they come to calculate it I'm anticipating errors in it. My proposed routine to mitigate rounding errors (like Math.ceil(1.000000000000002) = 2) is as follo...
I can't find an answer to this question either because it doesn't exist or because I am incapable of searching for it correctly. Consider this code which prints out the numbers from 1 to 12 ad infinitum: month = 1 while True: print(month) month += 1 if month == 13: # month >= 13 ? month > 12 ? ...
I am new to programming. I tried to write a valid Sudoku solver with backtracking, the performance is disappointing. So, I tried to generate a valid Sudoku generator without backtracking. The white paper implementation is 1/3 of the required numbers of strategy to generate valid Sudoku without problem. The other 2/3 is...
This set of questions are related to a project I've published for converting characters, or strings, to Hex based Unicode; eg... toUnicode.fromCharacter(''); //> 1f34d toUnicode.fromString('Spam!', '0x'); //> ['0x53', '0x70', '0x61', '0x6d', '0x21'] Questions Are there any mistakes, such as unaccounted for edge-case...
Problem statement Ping-pong The ping-pong sequence counts up starting from 1 and is always either counting up or counting down. At element k, the direction switches if k is a multiple of 7 or contains the digit 7. The first 30 elements of the ping-pong sequence are listed below, with direction swaps marked using brack...
I am trying to improve upon a VBA code created through recording a macro. Can the code below be optimized (I was informed to avoid .Select as much as possible)? The code itself works fine for me though. Sheets("DataExport").Select Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Rang...
I'm working on a program that uses the RIOT API League of Legends for collecting player data and calculate how skilled a player is by using a grading system (as of right now it just the average of the last ten games for each skills). Realize I used a lot of class, what is a better way to do it? import requests #ASKI...
Context I would like to receive feedback on my code for the question which can be seen here. Problem This is another C# implementation for the a function for given parameters int a, int b - both represent characters 'A' and 'B' respectively, where the function should return a string containing both characters 'A' and '...
If you look at ImportAndPreload method, it looks bad because: MovingAverageConvergenceDivergence, StochasticRSI, RelativeStrengthIndex and ExponentialMovingAverage. They are all indicators, they all inherit from IndicatorBase. What would happen if I wanted to pass a few more indicators? There would be 10 indicators pas...
It is my solution from a challange from edabit.com named "Drunken Python". Thats the task: You need to create two functions to substitute str() and int(). A function called int_to_str() that converts integers into strings and a function called str_to_int() that converts strings into integers. I hope you can tell me thi...
I'm writing start/stop module for my application. I have a class that manages application life cycle and I called it Work. Work uses WorkState class that contains 4 states the application can be in, that's: INITIALIZING (state between NOT_RUNNING and RUNNING) RUNNING FINALIZING (state between RUNNING and NOT_RUNNING) ...
I've written a 'fast & dirty' PowerShell script to harvest a system inventory of Windows client and\or server operating systems to streamline case note documentation. $NewLine = "`n" $FileName = Join-Path $Env:USERPROFILE 'Desktop\System Inventory.txt' # Current Date $TimeStamp = Get-Date -Format F $SystemInventory ...
I've been going through some 2019 AoC challenges and decided to solve Day 6 in Haskell with the help of Data.Tree. In summary, the puzzle provides a list of orbits (edges) as input, resembling: COM)B B)C C)D D)E E)F B)G G)H D)I E)J J)K K)L K)YOU I)SAN where COM is supposedly the centre of all orbits (i.e. the root). W...
I have Java (or C#, Python, Kotlin, or other similar language) class that will be used to communicate with client over network. Protocol used by this application allows many different ways to create connection (TCP, unix socket, serial port, …) and perform handshake (plain connection or TLS, with or without authenticat...