instruction
stringlengths
71
71.9k
I just started watching some regex tutorials on Plural Sight just to learn how to write a proper regex expression. So far so good, it's been alright and I decided to test my knowledge on Hackerrank. Although, the tutorial explains how to use PCRE (Perl Compatible Regular Expressions) and ECMAScript engines but I'm comf...
I have written a form to collect some feedback, which is written to a CSV file upon an Ajax post. In my feedbackapi.php file I have sanitised, done checks and then written the feedback to a CSV file. I was just wondering if there were any improvements that could have been made for the API. My form: <form method="po...
Looking for style and speed review π PI An estimate is \$\frac{4}{1} - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \frac{4}{9} - \frac{4}{11} + \frac{4}{13} - \frac{4}{15} + \frac{4}{17} \$... The average of the last two is the current best estimate Is the estimate correct to a certain number of digits The answer has...
My function gets the Cartesian product of a list of lists of tuples. The function is correctly producing the list of lists, but it's a memory hog (and leads to a MemoryError for large data sets, with the mapping/casting line probably the biggest culprit) and I have very little experience optimizing code with memory in...
JavaScript has some inaccurate rounding behavior so I've been looking for a reliable solution without success. There are many answers in this SO post but none cover all the edge cases as far as I can tell. I wrote the following which handles all the edge cases presented. Will it be reliable with edge cases I haven't te...
After doing a lot of reading and practicing, I've come up with a simple program that implements multiple OOP techniques, principles and several design patterns such as Observers, Factories and Singletons. The program represents a vending machine with all the relevant actions and properties. The vending machine can be r...
I needed a method to generate all permutations of given elements, so I decided to implement "Algorithm L (Lexicographic permutation generation)" from Donald E. Knuth, "GENERATING ALL PERMUTATIONS" in Swift. The labels L2, L3, L4 refer to the steps in Knuth's algorithm: extension Array where Element: Comparable { ...
This is follow-up on On Knuth's "Algorithm L" to generate permutations in lexicographic order, where I presented the following method to enumerate all permutations of array elements in lexicographic order: extension Array where Element: Comparable { /// Replaces the array by the next permutation of its elements in...
This is designed to be a simple example of a RPG battle, for a talk I hope to give. The rules: Alice and Bob both have 5 hit points and inflict 2 damage. Each turn, Alice attacks Bob, and Bob attacks Alice. 3/4 of attacks hit their target. 1/2 of the attacks that hit their target are blocked, inflicting half damage. W...
I was interested in converting the following Haskell code, that does decoding of CBOR into Rust: module Main where import Data.Word import Data.Bits import Control.Monad.Trans.Except data Value = I Int deriving (Show) read_int xs size = f xs size 0 where f _ 0 acc = return (I acc) f [] _...
It's a basic principle in AI that different problem representations can either facilitate or impede a solution. Being able to readily switch data representations while programming in Common Lisp may therefore offer advantages, particularly during rapid prototyping. One common example is converting from a list to a vect...
In my implementation I have used Cell as an object to represent each cell in the board. I've used Flood Fill algorithm for finding the adjacent empty cells in the board, I would like my code reviewed emphasising on design and structure. Class Cell class Cell { char state; // keeps track of cells which are untou...
I am new to the divide and conquer paradigm. I wanted to verify that there's nothing wrong with this implementation of binary search. I ran it a few times and it does print the correct result, but I also wanted a sanity check and any possible improvements. def search(array, item): if len(array) == 1: if a...
Given all the times I need to perform LDAP searches in the work I do, I wrote a helper and I want to clean it up and publish it to Nuget. What are peoples opinions of the approaches used? namespace MyCompany.Directory.LDAP { using System.Collections; using System.Collections.Generic; using System.Collection...
The codility.com free test is as follows: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 52...
I have implemented in C# a stack data structure, without using any existing C#/.NET containers (data structures). I have used TDD technique to implement this requirements, so you can find tests, too. All my tests are passing, so I guess stack is behaving correctly. I would be very pleased to have a code review for thi...
I am trying to implement the solution for the problem "Max Min" in HackerRank. The solution runs for some test cases but for few test cases it pops out showing "Terminated due to Time Out" Problem: Given a list of \$N\$ integers, your task is to select \$K\$ integers from the list such that its unfairness is minimiz...
I found this exercise on the web and this is my attempt to solve it. Things i'm interested the most from this coding review Naming convention I don't comment the code that much. For you to faster review the code i did extra commenting.Should i comment the code this way ? Your professional opinion Things a i can use t...
The user is prompted to enter three numbers. The function finds the largest number and outputs it to the user. What do you think of my overall program flow and style? #include <iostream> using namespace std; int maxNumber(int num1, int num2, int num3); //function prototype/declaration int main() { int a, b, c,...
I've posted the code before, but this time I believe I fixed the bug with remove. The class implements a Binary Search Tree without rebalancing, since unbalanced tree is not an issue in my case. I implemented the basic functions to make it minimally functional: Add Remove Contains Remove any To string Size Code: pack...
Given a set of coins and amount, write an algo­rithm to find out how many ways we can make the change of the amount using the coins given. Exam­ple: Amount = 5 coins [] = {1,2,3} Ways to make change = 5 {1,1,1,1,1} {1,1,1,2}, {1,2,2}, {1,1,3} {2,3} The code I've written works flawlessly, but the time complexity is ...
I'm quite new to Go and I feel like this code could be smaller and cleaner. I would love any suggestions and/or hints about mistakes and conventional go things! func getBookTitle(client *http.Client) { rsp, err := client.Get(bookSite) if err != nil { panic(err) } html, _ := ioutil.ReadAll(rsp.Bo...
The aim of it is to be the quickest way to add to existing notes via SSHh. Is this code in Python style? Am I missing any methods that would make the code simpler or legible? #! /usr/bin/python3 #Maintain: myemail@mail.com #Purpose: A simple way to add entries to existing files #Usage: Write the name of the file you i...
I'm writing an MD-like simulation and I'm having some difficulties in making this code run faster. I profiled the code using callgrind and kcachegrind, and it appears I'm using about 30% of my time on calculating distances, 43% on setting up the linked-cell list and calculating my forces, 20% on malloc and free (I assu...
This is a continued discussion (from here => Group duplicate files) with new code and new thoughts/questions (see special question part for details for new questions), and I decide to make a new post. Here is my source code which group duplicate files together, written in Python 2.7. Any advice on smarter ideas to grou...
I'm rebuilding a Rails project from when I started developing, and I wanted to figure out how to really DRY my controllers out—without making them unreadable by doing half/all of the work in a before_action. (I've used CanCanCan's load_resource in the past, and it's a little too DRY for me.) So I wrote this module to e...
I wanted to create a type or class, which can be used to handle angles. I started with defining a class, to make it possible to store degrees in Integral, radians in Floating, etc... But I realized, that I will meet complex problems if I continue it so. For example handling the addition of two angles, like a Radian Dou...
This is a simple student project that calculates the return on an investment with a given investment amount, number of years invested, and annual interest rate. I know this is pretty basic, but I'm just looking for feedback for formatting and other general improvements I can make to the code. // Author: Joshua Ferrell...
Everything that I've read online says that the best way to open a file in python is: with open('<filename>') as f: for line in f.read().splitlines(): print line That way you don't have to worry about forgetting to close the file. But I put this in an assignment in my python class and my professor marked po...
ES6 syntax helps to write code in a declarative style, which is exactly what I am trying to achieve here. Any advice to make my code "more declarative" (and easier to read) is welcomed. const middleIndex = xs => Math.floor(xs.length / 2); const split = xs => { return { fst: xs.slice(0, middleIndex(xs)), ...
Please help to improve my Java 7 code. I would like a best code logic to achieve this. package main.java; import java.util.ArrayList; import java.util.List; public class Student { private int id; private String grade; private int age; public Student(int id, String grade, int age){ this.id = i...
I have a wrapper class for executing database queries from an ASP.NET application. Please provide suggestions on how I can improve this class. It is working fine. Anyone can use this class in their ASP.NET application. using System; using System.Collections; using System.Configuration; using System.Data; using System.D...
Once a project gets bigger than a couple pages you don't want to have to call up every single page and do find & replace every time there's a change in the database structure. At least, I don't! My solution has been to make a db handle class series that contains names as variables and queries as methods. But, I'm not ...
I first got introduced to coding with Ruby and now I am learning how to create games in C# with Unity. I am following a tutorial and I refactored the code to make it easier for me to grasp. I am really curious to know the opinion of more advanced programmers on the following code. Here is the initial code: using UnityE...
I would like to make my code "prettier" and also speed up the runtime of my implementation. Nodeinfo is literally just an object that holds its "parent node"(the node it came from) and its distance. i try to traverse the graph by finding the distance of the node i want to move to then adding it to a priority queue base...
fo=open("haproxyfile.txt","r") users=[] for lines in fo.readlines(): if 'user' and 'password' in lines: items=lines.split() #converts to list""" users.append(items[1]) #append the second item that is the username""" print users The content of haproxyfile.txt is below ssl-default-bind-ciphers EECDH...
I have developed this restful service using spring boot. Please look at the code if there is something to change to be more consistently. Resource @RestController @RequestMapping(value = "/api/cars") public class MuscleCarResource { @Autowired private MuscleCarService muscleCarService; @RequestMapping(val...
I have the following problem that I solved using Python (Numpy/Pandas) and the code is provided later on. I mainly program in Java and wrote this program for a job interview as Python developer. I eventually got rejected and got the feedback saying the effort is not satisfactory. So, I mainly look forward to the sugges...
I have devised what I feel to be a simple hash/salting algo for Java, and am looking for some feedback from people more skilled than myself. Please find below my code; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.Se...
Is this a valid implementation of Decorator Pattern? Are there any possible improvements? Also, it is possible to remove decorations in a simple way? public interface Enemy { void fight(); String shoutIdentity(); } public class UnarmedEnemy implements Enemy { @Override public void fight() { ...
I've made this function which returns a copy of a given array with no duplicated elements in it. /** * Returns an array with only unique elements. Based * upon an array which might possibly contain duplicates. * @param { array } arrayToCheck * @return { array } * @throws { Error } when given parameter is * d...
Going through some old code, I found this function. Given a string carrier and integer nsyms, it consumes nsyms distinct characters from the carrier string and returns a dictionary containing consumed characters and their respective counts, and the remainder of the carrier string. def enc_consume(carrier, nsyms): chr...
Since binary search is \$O(log(n))\$. Consider this example where I am searching for the existence of e and l and f in the word. Is this \$O(n log(n))\$ or \$O(3 log(n))\$ and thereby still \$O(log(n))\$? def search(array, item): if not array: return False if len(array) == 1: return array[0] ...
I have this data structure to which the user can add number or remove them, both in constant time. Also, there is a \$O(1)\$ operation for querying the standard deviation of the current contents of the structure: StandardDeviationNumberSet.java package net.coderodde.stat; import java.util.HashMap; import java.util.Map...
I know that some features overlap but this is because I added different functions to the code at different stages when I thought of them. Note: The code works on both Python 3 and 2. import random,sys Hangman = [''' +---+ | | | | | =========''',''' +---+ | | | ...
I have two local maven projects A, and B. B is dependent on A. A |- resources/log4j2.xml B |- resources/META-INF/log4j.xml |- Maven Dependencies |- A |- And other dependencies... Both A, and B exports the log4j xmls to jar. However, as I only need the B/resources/META-INF/log4j.xml to my final B.jar, I tried...
Here's some code I wrote which sends multi-dimensional arrays to a file, is there any way I can make a generic method? public void sendSevenToFile(int[][][][][][][] seven, String filename) throws IOException { ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(filename)); outputStream...
Today I had an interview, where I was asked to solve this problem: Generate nth prime number. Given a signature below, write python logic to generate the nth prime number: def nth_prime_number(n): # n = 1 => return 2 # n = 4 => return 7 # n = 10 => return 29 I wrote this code, but couldn't get through: def n...
template<typename T> class Vector { private: size_t size; size_t capacity; T* buffer; public: Vector(size_t s) { size = 0; capacity = s; buffer = new T[capacity]; } //Move constructor Vector(Vector&& rhs): size(rhs.size), capacity(rhs....
I have this piece of code where the class ExecutionMessage has three variants. The point is that the classes are autogenerated by Apache CXF and they do not have a common class. But all the three flavors have the same API. Is there a way to refactor the same using generics or Java 8 semantics to avoid the repetition of...
Could you please tell me how I did on my first website? I designed it using Bootstrap v3.3.7 Here is the code from the index file. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <title>Home - Nanticoke Chapter NSDAR</title> <meta ch...
I made the following class to handle 2D animation through GIF images. This is made using JME 3.1, Java 8 and this GIF library. Is what I'm doing optimal? Are there already other available libraries or methods that do this? public class Animation2D { private final GifDecoder decoder = new GifDecoder(); private ...
This is my first code using templates and I wanted to know if the code looks good? I have some doubts like what's the best way to report error to user (queue full/empty), I checked a link online http://www.cprogramming.com/tutorial/computersciencetheory/queuecode.html where they use assert() so I decided to use it in m...
I have recently coded my own authentication system and wondered if there was any way I could make it better? I coded it with Laravel 5.4. getView is called on Route::get and onPost is called on Route::post use Auth; use App\User; use App\Http\Controllers\Controller; use Validator; use Redirect; use Illuminate\Http\Requ...
I'm trying to make minesweeper similar to windows 3.1 minesweeper by using OpenGL / GLUT. The game still in early stage but playable. I would like to know, how can I improve it. EDIT 1: i added additional draw functions and fixed drawing order when player step on mine tile. here image for latest update: Edit 2: i have...
The problem my code solves is listed below. I know my code can be improved, it takes a while to run when bigger arrays are entered as input. "Problem - Given an array of integers, sum consecutive even numbers and consecutive odd numbers. Repeat the process while it can be done and return the length of the final array."...
The task is: Given an array A of size N, find all combinations of four elements in the array whose sum is equal to a given value K. The specific requirements are: The combinations must be distinct Each quadruple is separated by a delimiter "$", and must be printed in ascending order Here are some test cases highligh...
This is my solution to Google Code Jam 2008 round 1C problem B (Ugly Numbers). I think it's very elegant. However, I wonder if it's too concise. What could I improve here? The problem: Once upon a time in a strange situation, people called a number ugly if it was divisible by any of the one-digit primes (2, 3, 5 or ...
I want to avoid using multiple if and else condition here if (decode) { Imagepath = bucket + "/" + key; Result.pages.push({ Id: Processid, ValidTicket: decode ? true : false }); } else { ...
I often make changes on my code-base and manually using sed, awk or perl -pi -e is not always as efficient as having a simple alias: git pie. Furthermore, because I am working on Cygwin, I cannot do real in-place replacement without a temporary file that I have to manually suppress afterwards. Last but not least, sed...
I made a simple calendar in PHP 7.0, could anyone help with simplification? Any advice appreciated. It works, but I totally believe it can be improved. I am a beginner. <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $chosen_year = filter_input(INPUT_GET, 'cho...
The task was to write function that compare areas of two random generated geometric shapes (circle, square, rectangle) using base class with virtual function. Am I doing it right in terms of memory management? Will my figures generated inside generateRandomShape() by new Square() etc. last in memory outside this functi...
This is the problem: Airport Pretend we are operating a small airport with a single runway. We need to develop a data structure to help scheduling airplanes to take off and land from this runway. Each time a plane takes off or lands, it needs exclusive use of the runway starting 10 minutes before the schedul...
I get an object with categories, first category has 2 types. Both types are in the first and second position but sorting is not constant. I have to return category 1 with playLevel === 2 when bonusPlus is true and category 1 with playLevel === 1 otherwise. Here is the code: const getFirstCategory = (bonusPlus, prizeCat...
This Python function takes two arguments: chr_list which is a mutable sequence of characters c chr_counts which maps to each character c the number of occurrences n For each character c in chr_list, it inserts this character into the list before its last occurrence n-1 times, where n equals chr_counts[c]. The resulti...
Introduction I have wanted to develop this project for more than two years. I just started writing it a couple days ago. I use it to detect plant or residue pixels in crop row images but it provides a good example of how to detect green and red color. I could not find anything like this on Stackoverflow/Stackexchange, ...
To learn Python, I have implemented a function that creates a k-d tree from a list of 2-d Points. I would like to refer to this question where i asked about the k-d tree in C. However, the Python code takes about 14 seconds for 1 million points. So my question is, are there optimizations that I can apply to my code to ...
So I've written up what the title says. Obviously, I'm looking for speed, safety and ease of use. To achieve the perfect ratio I've made some functions straight away crash if the input is wrong (in debug mode only, otherwise UD). The design is inspired by the C++ counterpart. Will be glad to hear other opinions. (It'...
I asked a similar question yesterday and got a brilliant answer, but unsure how I could adapt these methods. The methods perform a BFS on a state and then store the values in a multi-dimensional array. You can see that the code is repeating itself, just with different array dimensions. Method 1: public void bfs2(in...
I always disliked how basic HTML tooltips are and often find myself employing modals to display more information, but it feels like the wrong solution from a UX perspective in most cases. To that end, I have put together the following solution. Due to the self-taught nature of my work, I fully expect there is a lot of ...
In a course I'm doing, I was given the task of finding the closest pair of points among the given points. The program that passed all test cases was the following: import math if __name__ == '__main__': n = int(input()) P = [] for i in range(n): line = input().split() x = int(line[0]) ...
I've posted my simple ciphers on Code Review several days ago (link: here). I refactored my code and tried to define a more general "cipher" function, according to Zeta's excellent advice. I've split the code to make it more readable. General cipher This function takes an encoding function, "zero", list of keys and lis...
(See the next iteration.) This question is an elaboration of my question. Just like the previous implementation, all operations (except clear) run in exact or amortized constant time. I have taken into account all points made by @Emily L., and my data structure looks like this: StatisticsNumberSet.java package net.code...
I would like to write a pseudo version of List.map with the help of the Event and Thread modules: open Thread open Event let rec tmap f ls = let c = new_channel () in match ls with | [] -> [] | h::t -> let _ = create (fun c -> sync (send c (f h :: tmap f t))) c in sync (receive c) Call...
Today I attempted an interview problem: Q: An n×n matrix contains numbers from 1 to n×n and is generated in the fashion: The first row is of numbers starting from 1 to n left to right, Second row is from n+1 to 2n right to left, 3rd row is from 2n+1 to 3n left to right and so on. Example n = 4 Matrix would look som...
I am new to C# and am leaning ASP.NET MVC and Entity Framework and I am trying to create an application where a user can manager Job Postings and Applicants where an Applicant can apply for many Jobs. I am trying to pull a list of Applicants, along with a list of the Jobs they have applied for. The following is the sol...
This is my third attempt to create a easy to use html builder because I wasn't really satisfied with the first one that wasn't extendable at all and even the one using dynamics wasn't much better. It was difficult to use due to everything being dynamic and had to be casted everywhere but what's worse it was hard to fin...
Here is my solution for the following task: Given an integer n, print the minimum number of operations needed to obtain the number n starting from the number 1, and the sequence of numbers towards the number n. The allowed operations are: multiply by 2; multiply by 3; add 1: def min_operations(x, y): visited = set(...
I am currently working through a python course about objected oriented programming. I was given this first assignment to work on: Create a simple class, MaxSizeList, that acts a little bit like a list, with a pre-configured limit on its size. Here some test calling code that imports the completed MaxSizeList and ...
Average time (without printBoard()) on Intel(R) Celeron(R) CPU N2840 of 100 runs: GCC 5.4.0 with -O3: 0.48885504s Clang 3.8.0 with -O3: 0.52578794s My ideas for further optimization were board reflection and rotation, but I don't know how to implement them. // Finds all distinct 8x8 chessboards where 5 queens attack/...
I've written a Twitter bot, @answering_yelp, which responds to another Twitter bot, @hard_to_yelp. They scrape yelp reviews for sentences which start "How hard is it to..." and my bot answer with some version of how hard it is. I recently refactored the code to handle changes to the source text as a list of command cla...
Long time coder, but very very new to C++. I'm trying to put together my first real-sized project and figuring out what I need to change about my script-kiddie style of C++ to get there. Below is my working code. #include <math.h> #include <vector> #include <iostream> #include <stdexcept> enum class Metric { Cosine, E...
I'm writing a pixel library to do an AJAX request so I'm not allowed to use any helper. function ajax(options) { var xhr = new XMLHttpRequest(); var opts = Object.assign({ withCredentials: false, method: 'GET' }, options); xhr.withCredentials = options.withCredentials; xhr.open(opts.method, opts.url...
I'm implementing alpha-beta pruning for a chess engine in TypeScript Here's the code: public static alphabetta(board: Board, player: Player = Player.CPU, move?: Move, depth: number = 0, α: number = -Infinity, β: number = +Infinity): EvaluatedMove { const { gameOver, winner } = board; if (gameOver) { ...
I'm currently writing a little tool to get into Go. As I'm not familiar with the language I'm especially looking for Conventional go stuff. utility.go feels wrong.Should I wrap the client and email/password into a struct in utility? What would you advice. Every critique on anything is very well welcome! Small info: ...
After taking a course in C++, I have written my first program and I'm looking for some feedback both on coding style and maybe algorithmic improvements. The code can also be found at GitHub. It compiles and runs fine but is not very robust for user input. I opted to try to emulate the game Minesweeper. My implementati...
I just started making a text adventure game in Haskell. Because this is the largest project I have done in Haskell, I wanted to ask about it here before I got too far on it. I am still pretty new to Haskell, so I would really appreciate any advice at all on how this could be improved. To compile the game, I just used g...
I'm trying to make a simple header only C++ library for interval arithmetic as a programming exercise. There are some subtle aspects of interval arithmetic (like floating point rounding mode) that I am deliberately ignoring for now. Eventually I want to templatize this thing, but that forces me to face a design questio...
I have a mesh generation script which initialises a mesh with vertices that represent my map tiles as quads. Then I pass the tiles that I wish to display on the mesh by setting my triangles for the vertices related to the tile. I was wondering if there is a more optimised way to approach this for Unity. I'm still learn...
Problem statement Given a binary tree, traversal the binary tree using inorder traversal, so the left child is visited first, and then node and then right child. Write an iterative solution as a practice of depth first search. Algorithm I like to practice the iterative solution of binary tree inorder traversal, sinc...
I am using WPF with Entity Framework 6 (DB first), Caliburn.Micro, and MEF. I am trying to implement IoC in my project. I am an absolute beginner in IoC, and unfortunately, I cant find too many examples where MEF is used with Repository Pattern. Here is what I have till now: All the generated entities inherit this inte...
My first 'large' project is to create an organizational tool. Right now, it's pretty basic, but nevertheless functional in terms of the intent of the current release (v0.3.0). My main question is: 'Is what I'm doing procedurally correct/is this the way I should be designing my GUI?'. This is my first time doing any GUI...
What I needed to do was check whether a given string matches a certain pattern. The pattern is this: 00:00:00,000 --> 00:00:00,000 Things to keep in mind: The 0s can be numbers from 0 to 9. The pattern must be alone in a single line; the line has to only consist of the pattern. I came up with this: "^(\\d\\d):(\\d\\d)...
VBA has built-in functions for repeating a single character: Function String$(Number As Long, Character) As String Function Space$(Number As Long) As String But neither are of any use when you need to repeat a string that has more than one character. You could repeat a string "abcde" 5 times by doing something crafty...
I am a beginner (with zero Python experience) working through the book Automate the boring stuff with Python. At the end of Chapter 4, the author provides a review problem. I was supposed to write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space,...
I have linq query that extracts a summary of my sales quantities item group wise. This query causes an sql timeout. From the what i have found out, timeout indicates that my query is poorly designed and needs to be optimized. Below is the linq query: (from inv in Dbcontext.tblSalesInvoices join det in Dbcontext.t...
I have this batch file using ffmpeg to add a logo to my videos and then add an intro but it's taking anywhere from 10 hours to a day depending on how many I have to watermark, is there a more efficient way to achieve this? The videos sometimes have different resolutions so I can't remove the conversion to the 1280*720 ...
A friend and I at IT school tasked ourselves with writing something just for the hell of it. Trying to simulate in a very basic way something that you may want to do in the real world. We thought of the following problem that we could solve ourselves. X, Y and X INC is in need of a program. They wish to promote the sal...
I have created 2.5 millions drivers dummy data, in this case lets say the drivers are moving around in the city. The driver's document look like this : { "_id" : ObjectId("58da18fb5f2caa20fffa8cf8"), "name" : "Barbara Clark", "status" : true, "location" : { "type" : "Point", "coordinates...
I have implemented in C# a graph data structure (undirected graph) using TDD technique, tests are provided upfront. This implementation provides common graph methods also it traverses graph using DFS algorithm. Tests are passing so I guess, implementation is correct. I would appreciate any test case that I might be mis...