instruction
stringlengths
71
95.1k
Given a list of elements, each with own width, and a max-width. I need to find how many elements can be fit inside that max-width, keeping the order of the elements. Some examples: elements: { width: 10 }, { width: 20 } max-width: 30 result count should be 2, because both elements can be fit in this max-width elem...
I'm using an interface IloadPattern on deriving 3 classes from it LinearLoadingPattern , JointsLoadingPattern , AreaLoadingPattern. At some point, I'm creating a list all the objects created from those classes. At a later point, I want to retrieve list of a particular object (JointsLoadingPattern) from the above list,...
I'm new here. I'm trying to teach myself programming by learning Python. I have assigned myself the following task. There's a game I'm playing (Rocket Valley Tycoon) where the goal is to basically place an Extractor to gather resources, then use Factories to transform the resource into a good, which then usually gets p...
My aim with the following is to have a way of registering a list of classes, which represent plugins. In the end, I want a boost::hana::set that contains type objects for all plugins' classes. I want everything to be as loosely coupled as possible: Basically, I should be able to just delete a plugin's files, and everyt...
So its my first time using Kotlin, and for now I am converting old Java code to Kotlin. I took a simple function to parse a JSONArray from a JSONobject with a key. Here is the code: fun getJSONArrayFromObject(jsonObject: JSONObject, key: String): JSONArray { var array = jsonObject.optJSONArray(key) if (array =...
I had to sort a list of objects - {name:'name', email:'email} by their keys, ex. by email, so they all be rendered with email key/value pair as a first key/value pair and I was surprised about the solution i came up to - Object.assign() when i loop through array and assign email key/value pair to each object: objects =...
I posted the same question at StackOverflow then I got an advice to post it here. Original question: https://stackoverflow.com/questions/49998297/fast-insert-unique-container I have to store elements (struct State) in a 2D vector container and each element must be unique. I store the elements like this: std::vector<std...
I've been looking for a while for the right code to encrypt/decrypt files with AES in vb.net. I created the code below. Is this the right way doing AES encryption/decryption nowadays? Public Function EncryptFile(ByVal plainFilePath As String, ByVal encryptedFilePath As String, ByVal EncryptionKey As String, ByVal SaltV...
Here is an attempt I made at a simple Substitution based cipher machine, it shifts input characters by an amount then returns an unreadable string which can then be decrypted back to its original self: package Pack; import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.HashMap; import ...
I'm asking in arbitrary sense to avoid going into any unwanted specifics. Suppose we're to put balls in baskets. If the there are <6 balls, they don't get to go in any basket. If there are between 6-12 balls they take up 1 basket. But if the balls are >12, they take up 2 baskets. Following is WORKING FINE: if (count($b...
I'm writing a mechanism to retry any failed downloads that respond with certain http error codes, I've noticed the server I'm downloading from will unexpectedly throw these codes to me and when I manually visit the URL it appears to be fine. It also seems that its fine when trying to download for a second or (rarely) t...
This is a random access iterator that stores an index and a reference to a container. It iterates over any container with indexing operation. It does not have copy assignment / move assignment operations. This is because I cannot re-assign the reference to a container to reference to another container. The iterator sto...
I'm working on a sort of distributed build system. The system allows execution of snippets of scripts as build steps. I need to be able to hash these snippets of code in a way that comments and doc strings don't affect the hash. I'm getting part way there by using the ast module to parse the code, then doing an ast.dum...
I recently coded a game of hangman and wanted to know, A: Are there any places it could be more efficient? B: Are there any things that are distinctly wrong with it, since I know people seem to say to avoid using GOTO and SLEEP? C: Is there a way to have it generate words randomly or a database the code could access? I...
Our company consumes a lot of telemetered data from sensors which we consume via an API. So I wrote a method to consume them a bit easier for internal applications. I didn't add a generic to the method, mostly because JSON.NET didn't always build the object correctly. I'd like to remedy that in the future, but as it...
I have been working on creating my own implementation of an RBAC system for the purpose of: learning to use an OOP approach instead of procedural switch from using mysqli to PDO and to learn how to use dependency injection DB Connect File: <?php $config = include '../config.file.php'; try { $db = new PDO('mysql...
I've been working on a personal project for a while which simply extracts some information from a website and save them as JSON files. Then I've decided to move those scraping functionalities to the server and write simple js application which sends GET requests to extract that information. Before I start, I'd like to ...
After implementing some logging in my system, I got tired of digging through very long files trying to determine where specific runs started/stopped to look for differences, so I began adding a date/time stamp to the file name so I'd get a new log file each time the processing kicked off. This was wonderful, but solvin...
I have a method which allows to create user account. It contains some conditions to control empty fields, wrong format of email, weak password, etc. errorSet = false; @FXML private void createAccount() throws IOException { if (!lastNameField.getText().isEmpty() && !firstNameField.getText().isEmpty()...
Project Euler Problem #12 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: ...
I have just attended a code test of some code testing site, and I think one question seems easy but I didn't get a high correctness, so if anyone can review this code snippet, I would appreciate it. In summary: Given an array A, with dimension N, 1<=N<=100000, A[N] within range of [-100000, 100000]. At first there is a...
I'm working on a simple General Game Playing AI library. The idea is that it should work with almost any kind of game, with a minimum of configuration. At the moment, I have it working on 2 player turn based games like Tic-Tac-Toe, Connect 4 and chess. And it works quite well. It uses the Monte Carlo Tree Search algori...
This code (Windows Forms) shows a series of timers so that the user can manually time a series of tasks. I decided to put this together today because next weekend I want to go through an activity (about 4-5 distinct tasks) and see how long it takes. The main window is where all the action takes place. The task button...
I've implemented a stack using a singly linked list and would like to know if there are any things I could improve on. StackList.h: #ifndef STACKLIST_H #define STACKLIST_H #include <iostream> class Node { public: Node() : data(0), next(nullptr) {} Node(int theData, Node *newPtrToNext) : data(theData),...
I have written the below bubble sort code in Python. def bubble_sort(): num_list=[] list_cnt=input("How many numbers you would like to sort:") for i in range(int(list_cnt)): ### need to convert the value returned by input() num_list.append(input("Enter " +str(i)+" number:")) ##here we are using appe...
This is a revision of the code posted here. It's a Makefile that I want to use for compiling Sass files to CSS in web projects. For this, I typically have two folders css and scss in a theme's top level directory. The full Makefile has other duties (such as optimizing images), and needs to be run from that directory. I...
My program intends to capture video streams (in mjpeg) with OpenCV and upload the captured frames into Google Cloud Storage for later processing. I am expecting to capture ~15-20 frames per second and expected to upload nearly all frames within a second. The trick is, the script is running on Raspberry Pi 3, Model B, a...
In one of my React components, I want to use props when creating a styled-component to determine which tag to use. Specifically I am looking for what's in props.headingLevel to decide which heading level to create. E.g. h1 or h2. All of the styled-components examples show components being created outside of the React c...
I encountered a pesky error in Code::Blocks: the conversions functions (stod, stof, stoi, ...) are not linked correctly. I wanted to learn how to convert double or floats starting from a string. I started writing down a version of it, but I couldn't get it right even if I had understood the concept. Then I came upon th...
Just to enjoy, I want to implement selection and bubble sorts algorithms without looking any implementation by my own efforts . Is there any redundant/lack part(s)? After improved their implementations, I think to try to write them down as recursive, can I ?, any hint? class Sorts { public static void main(String[...
Task : Implement Insertion Sort in Python. def insert_sort(a): """ Fuction to sort a given list a """ if len(a)==0: print "Please give valid input" for i in range(1, len(a)): current = 0 while current < i: if a[i] < a[current]: a[current], a[i]= a[i] , a[curre...
I wrote a program which gets two sorted arrays a and b (with sizes m and n respectively), and calculates the median value of these arrays without merging them. Here is my code: #include <iostream> using namespace std; int findMedian(int a[], int b[], int m, int n); int max(int a, int b); int min(int a, int b); void ...
Here it is my program. I'm especially worried about the main because I know that one must be careful while instancing vectors of "inherited" objects. The code I have works fine (as far as I can see) but I saw the original program made by my teacher and his implementation of the vector in the main uses new and iterator....
I am redirecting mobile devices from the root index.php to mobile.php file. I only allow access to mobile.php file only when that if statement is true. This is how I do it: Detect Devices and store them into variables If a mobile device (see variables) accesses the web application redirect to mobile.php In mobile.php ...
I'm removing outliers from a set of data using the method described here. The method removes the outliers and returns the quartile values of the set after all outliers have been removed. (Quartiles is a class I wrote with properties for Q1, Q2, Q3, and the Inter-quartile range, IQR. The .Quartiles() returns these value...
Given this question, which simply can be explained as follows: Given the number of nodes and the number of edges in a graph, find the size of the largest connected component of the graph. If this number is K, then return the Kth prime number. I used two approaches here: BFS: I did a BFS over all the unvisited nodes,...
I don't need a lot and I don't need for my code to handle everything. Even now, I'm just looking at handling serialization. I'm pretty much building on it as needed. I am trying to support vectors right now and am looking for an idea on how to extend what I have a little to support this. Basically I've created a pr...
I have designed the Control Unit of the CPU in VHDL. It works properly and produces the expected simulation waveforms. Nevertheless, I feel that my existing code can be improved considerably. My control unit essentially consists of three processes: operation decoder (this is the lengthiest process. I explicitly speci...
I am trying to pick up Haskell! But I feel like my code is a bit painful to write and read. Do you have any pointers on how to improve its readability / style? main = do contents <- fmap tail . fmap lines . readFile $ "testInput" let input = map pair_to_tuple .(map (map read)) . map words $ contents :: [(Int,In...
This code should partition a list into two subsets of the given list that add up to the same number: for example [15, 5, 20, 10, 35, 25, 10] -> [15, 5, 10, 15, 10], [20, 35] would be a valid solution. I'm looking for any tips to improve code style (be more Pythonic) or performance (mainly improvements to the algorithm ...
I'm writing some Python 2 code with which to analyze the compressibility of random bitstrings. It's working pretty well right now, and now I'd like to request some help making sure it follows PEP 8 and is in other ways pythonic. # -*- coding: utf-8 -*- """ Created on Wed Feb 21 14:34:38 2018 Takes bitstring, makes dict...
I am currently learning swift 4 and would like to ask you to correct my code. (I would like to have a pattern for learning the "beautiful code"). My code gets data from the server in JSON format and creates a loggedUser object. Then I open the tabbed view controller with the correct application. I'm trying to write an ...
Description: Write a method mergeMeetings() that takes a list of multiple meeting time ranges and returns a list of condensed ranges. The integers represent the number of 30-minute blocks past 9:00am. Do not assume the meetings are in order. The meeting times are coming from multiple teams. Code: import java.util.Arr...
I wrote code for my needs (i.e. collecting YouTube links from a page) and it is simple, but now I just want to know what can I do just to make it a better and properly written one. For example, I think I should have try/catch blocks/exceptions in my methods, or get/set properties. What tests can I write to test the cod...
I'm quite a beginner with Java and just this month started learning about GUI and JFrame so naturally the first thing I wanted to do was build a Minesweeper Game. Apparently that's a common thing for beginners. However, I may have bitten off more than I can chew. The game works fine and all, but when you click the Star...
I found this problem from leetcode.com. We are asked to find the longest increasing path in a matrix. I finally came up with a recursion to achieve this but I found that when I increase the rows and columns to a large size then my program takes a long time to run. I am wondering if there is any way I can optimize my co...
This is a very simple problem to see if my understanding of basic Python is correct Problem: Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] Output: [1,3,2] Solution: # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self...
Problem Background MIDI is a serial representation of control signals to a sound generator. Typically, a noteOn message initiates the attack phase of a sound at a given pitch. The note will continue through decay and sustain phases until later, a noteOff message initiates a release phase to terminate the sound. Beca...
Two years ago I wrote a short vector optimized dynamic array type (std::vector), for use in an image analysis library. I don't think boost::small_vector existed at the time. The use case: Images in this library can have any number of dimensions. But obviously images with two or three dimensions are going to be most com...
I just found a whole bunch of plane tickets that only have a start and destination on them. I also know the route started in a certain city. I would like to recover the (alphabetically) first possible route a person took using these tickets. I added some examples in the doctests. from collections import OrderedDict, de...
I have a form with two date (in format "YYYY-MM-DD") input fields 'Invoice sent'/'Payment received' and each of them has two checkboxes "pending"/"obsolete". If one of the checkboxes is clicked, then the input field should be filled with '1111-11-11' or '0000-00-00' and the sibling checkboxes should be disabled. This c...
I want to perform the following procedure: I have two vectors x=[1,2,3] and y=[5,7,9] I want to take first element of x and then add each element from y to it, then I want to take second element from x and add each element from y to it and so on... Finally, I want to save each result from each step of this procedure in...
I'm working on a little project and although it all works, I think I might be doing it in an incorrect way. The front end consists of a simple form that gathers input data (make and color) and once submitted, it sends the input data to a POST endpoint in express via AJAX and gets filtered to return the items I need in ...
The code should enter an integer between 5-95 and calculate how many coins, coin values are 50, 20, 10 and 5. My concern is the CalcChange function and whether that is acceptable C code. #include <stdio.h> #define TRUE 1 #define FALSE 0 void GetNum(int &amount) { printf("Enter an integer between 5 and 95 inc...
I provided an answer to a question on SO about a generic linked list. I just had the curiosity of having my code peer-reviewed as I wrote the code specifically for the answer. That is, I have not implemented a generic linked list before, and would like to see if there are minor issues with the code: #include <stdio.h> ...
Recently I started fiddling around with pathfinding. I created a WayPoint component to determin a possible way to another actor which is defined over other waypoints. My grid is looking somewhat like this: The goal was to find a way to the red circled waypoint. A waypoint can have up to eight neigbours. I didn't inclu...
I am picking up good Haskell practices! In this instance, I wanted to pick a file which contains a title in the first line and then every line is a string. Each string represents a number in base equal to the number of distinct characters that appear on the string, but we do not know what characters correspond to each ...
I'm fairly new at programming and made a tic tac toe game to see if I could handle it. I managed to get it to work but I feel like my code is faaaar from perfection. I wanted to ask for some advices on how to improve it class Game: def __init__(self): self.board = [0, 1, 2, 3, 4, 5, 6, 7, 8] self.w...
EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two external services (namely api.ipstack.com and geoip.nekudo.com) to determine the country by IP. As services has their lim...
I'm trying to optimize some VBA that I put together. I know that using Select a lot slows down performance quite a bit so I've been trying to cut that out where I can. Is there anything else in my code that I can change or do differently to improve performance? Thank you in advance! Sub PP_Formatting_Saving() Applica...
This is my first Rust program. It parses a string into a λ-term using a very simple grammar. Please evaluate style and use of ownerships / borrowing. // λ-Terms are either lambdas, variables or applications. #[derive(Clone, Debug)] enum Term { Lam {bod: Box<Term>}, Var {idx: u32}, App {fun: Box<Term>, arg: ...
This is the "largest" VBA project I've worked on, but perhaps not the most complicated. The meat and potatoes of it basically copies and pastes data from 2 source tabs into 1. A large piece of the code was broken out and refactored into sub procedures. Variables such as "DEM_Name" are dummy names. The main sub is calle...
I'm implementing the compareTo method to set the natural order of an object. My object has three fields that make up a name. fName, lName, middleInitial. The natural ordering should be by lName, fName, middleInitial. I was wondering if this is an efficient way of implementing the compareTo. @Override public int com...
I wish to have code that returns the center items of a 2d grid. Because I need an average value. The code I came up with does what I want (see the unit tests beneath it). But I think the code is ugly and have the feeling it can be optimized. However, I do not see a way. Could this code be optimized by your mind? If so ...
I wrote some code to upload multiple files to a server with PHP and JavaScript. I'm happy with the form and JavaScript, below. <form method="post" enctype="multipart/form-data"> <input type="file" name="files[]" multiple> <input type="submit" value="Upload File" name="submit"> </form> <script> const url = ...
I am trying to compare two vectors which are of size of multiple of 4. Each vector block has a unique number it e.g {0,0,0,0}, {0,0,0,1}, {0,0,0,2} or {0,0,0,0,0,0,0,1,0,0,0,2} and {0,0,0,2,0,0,0,1} so on. I first divide the vector in block of 4 and than compare it and save the block which is not present in another vec...
I'm interested in reducing the repetition in the doPost() method of my servlet. Specifically, I don't like the loop and error handling repetition. Any other refactoring advice will also be helpful. protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map p...
I wanted to make a GUI-ish (a TUI) thing in the terminal as I have no experience with PyGame or the like. It works, but how can I improve this? import os, colorama from msvcrt import getch from colorama import Fore, Back, Style colorama.init() def newGame(): print("Sorry, currently not a feature") def cont(): ...
What is an efficient way to implement the Mergesort algorithm in Java such that it meets the following criteria: Must be multi-threaded. Must retain the Mergesort time complexities. Must be in-place implementation, no copying arrays. Must use Java Collection classes, not an array. Must work on any Java Comparable. My...
I'm trying to improve my C++ Enigma Machine, either by shortening the code or finding more efficient ways to complete certain things. Be aware I have very basic C++ vocabulary. Are there any major flaws in my code? Also, would anyone happen to know how I could do decryption properly? I asked on Stack Overflow and it wa...
I studying for a Python course. I was finished working on task about creating a file class which can read, write lines to file. This class also needs magic methods (__add__, __str__, __iter__, __next__) Can you review code and give a tip about improvements using the DRY principle (for example, how avoid to copy/paste w...
Task You should create an abstract Shape class that contains the stuff that would be similar across all shapes, and change Line and Rectangle so that they extend Shape. Then, in the DrawingModel class, you should be able to create a single array of Shape objects and add both lines and rectangles to that list. In your ...
It's from a Java-course I'm enrolled into. The classes "Instructor" and "Book" are already provided. You got to write the different constructors of "Instructor" as well as the methods "getMostRecentBookTitle" and overloaded "updateBook". Here's are the final classes expanded with my additional code: // ------- Class ...
This was my code challenge for a Junior JavaScript Developer position. The app is mostly running error-free, but I was rejected for the role, so I assume there were major issues with my code and have no idea what they were. I know this is a long piece of code, but as it already runs, I'm not asking for a fix - more f...
I have written a recursive function to generate the list of all ordered permutations of length X for a list of chars. For instance: ['a', 'b', 'c', 'd'] with X=2 will give [['a', 'a'], ['a', 'b'], ['a', 'c'], ['a', 'd'], ['b', 'a'], ['b', 'b'], ..., ['d', 'd']] I'm not sure about its algorithmic complexity though (at l...
This is my peak finding algorithm. I try to split the 2D array in half and find the maximum element in the middle column. After that, the algorithm will check whether there are any other element bigger than it on the left or the right side. If there is any, the matrix will slice in half depending on the position of the...
I've gotten fed up of writing boilerplate code for managing Ajax calls, and this is the manager class I've come up with The concept is that it standardizes the interface for RESTful calls, prevents duplicate calls from firing via a request key, also simplifies waiting for a call to complete. function AjaxManager() { ...
I have a lot of code (probably about 1/2 of all of my 891 lines) dedicated to just making players and teams. Here's the code that makes the players and teams: private void makeTeams() { toPlay = maps.get(random.nextInt(maps.size())); // I have a method that I shortened to make maps pName = toPlay.islands().get...
I am working on a ADDIN that works on 3D drafting program. This ADDIN has historically grown and now I am doing a big rewrite. During this rewrite I came across a issue. I have 2 (fairly similar) types of models I am trying to edit using the same code block ADDIN. They both have a property name (inside the 3D drafting ...
We have a client that handles three different sort of licenses. These are up for renewal every year and upon renewal they need to check between 15-20 rules to see that everything is okay. They do this manually today but everything they check is within their business system so they have all the data. If any deviations s...
Im creating a class that has all of my data in and can see it would quickly become messy. I feel that there must be a way of making it neater rather than making a new method each time For example. I have a character that out of the huge skill list each with different values for different things, they just have 1h weapo...
I have implemented this simple unbounded ObjectPool based on a ConcurrentLinkedQueue of WeakReferences. I have a thread-unsafe object that is pretty expensive to create, and most of the time it will be used from one or two concurrent threads, but it should support any number of threads concurrently. The object has also...
With the idea of gathering the biggest hockey's individual stats dataset ever, I've started with the big league, the NHL. Using Selenium, I've been able to scrape this NHL's statistics page. To explain the workflow simply, I extract the data from the standing's table. It's basically a big string with a lots of "\n" to ...
The input is a product code. I want to pull out the "percentage" portion of that code. For example, if the code contains the substring BIO, I want all the numbers that follow it until I hit another non-numeric character. You can see from the PATINDEXs the other situations - it probably doesn't add much typing them in E...
So I saw a need for and came up with a class implementation to group constants, which I'm calling a Constant Class. I wondered if there existed other similar implementations or if there is a flaw in what I'm doing. My team is currently finding it fairly useful and thought we should see what other people thought. Also t...
If I draw something in Illustrator and extract it with AI2Canvas I want it to be customizable so I wrote this simple program. It adds two variables: one to resize and one to shift the path coordinate. #include <fstream> #include <regex> #include <string> int main(int argc, char *argv[]) { std::string path = argv[1];...
The code below works pretty well - it takes about 4 seconds (this seems too slow for me) to find a group that's located in the tail area of the text file I'm searching. The text file has ≃ 250,000 lines with 20 elements per line. I cut my teeth on other programming languages and picked up Python just for this current p...
This program orders the lines of a text file alphabetically and prints them out to a new text file. Usage: java Arranger input.txt output.txt Is this the best and especially the most performant way? import java.io.File; import java.io.FileReader; import java.io.BufferedReader; import java.io.FileWriter; import java.io...
I am currently applying to many Software Engineer positions, and have been asked to complete several coding challenges. The most recent was an equation evaluator, written in C++, that was supposed to evaluate equations. The criteria given were as follows: Each equation is specified on a separate line LHS is the left h...
Currently, some library features are not in std that comes with the compiler, but may be in std::experimental or may not be present at all but Boost has a version. This is not a new problem: once upon a time it was std, std::tr1, or Boost. I expect the general idea will continue, with new libraries arriving on the bl...
I recently wrote a piece of code to convert between two bases of X, (Where 26 > X > 0). I was mighty proud that I did this. And then I started wondering, am I using modern coding conventions/practices? The code can be found here. And some sample outputs are shown: // syntax: convertBase(input, inputBase, outputBase) co...
This code attempts to solve a suggested challenge by myself a while back on meta, transcribed here for simplicity. Allocate resources efficiently on a work environment The company Code42Review demands that their employees are able to handle work items as efficiently as possible. Those work items are assigned according...
I would like to know if there's a more efficient way of querying items than this (that works, though): Imports Microsoft.Exchange.WebServices Public Class ExchangeTools Private Shared Function Items( target_folder As Data.Folder, Optional recurse As...
I made a merge sort and wanted to ask for code review. It passed all of the unit testing. The idea behind the classic Mergesort algorithm is to divide an array in half, sort each half, and merge the two halves into a single sorted list. Examples: merge_sort([2,7,5,9,8,9]) -> [2,5,7,8,9,9] merge_sort()([7,1,8,2]) -> [1...
How does my HTML and CSS look? I'm a beginner so I have no idea if this is good design or not. Is there an easier way to copy and paste code here? Everytime I paste my code in here and use CTRL+K, only a few lines at the top of my code are formatted, and for the rest I have to go down with a spacebar constantly which i...
This is my first Powershell script ever so bear with me. I'm trying to replace values in a sharepoint list from a CSV file: Param( [Parameter(Mandatory=$true)][string] $csvFileName = $null, [Parameter(Mandatory=$true)][string] $sharePointWebUrl = $null ) $isError = $false cls $csvFileName = $csvFileName.Tr...
I have been writing a javascript calculator for about a few weeks. It uses a shuntyard algorithm to do order of operations. Some unit tests I have not finished yet and there is some functionality missing (e.g. no display limitations, some display errors) but the core logic behaves as expected. My goal was to practice f...
I am trying to create a CAPTCHA image on ColdFusion. ColdFusion will be producing REST services and hence will have to push the image via JSON. I want the image to be self contained. I don't want to expose any of the servers paths, so I am going to encode the image and push that via JSON. Last but not least, Vue.js wil...
I want to implement an Either computation expression in F#. The computation executes a function inside a while loop, and this function's return type is Result<int, string>. The function might return an Error<string> if some condition is met, and then the whole computation expression should be stopped. This is the code ...
I've implemented a student administration with MVC pattern (Tutorial: Link). I've decided to divid the students in "SingleStudentModel" and "MultipleStudentModel", but I'm not sure if that make sense in my case. In general, I'm not satisfied with my solution. Is it possible to handle single student and multiple student...