instruction
stringlengths
71
71.9k
Is this a proper C# implementation of the Fisher–Yates shuffle? //Fisher–Yates shuffle en.wikipedia.org/wiki/Fisher–Yates_shuffle //for i from 0 to n−2 do //j ← random integer such that i ≤ j < n //exchange a[i] and a[j] int count = 52; int[] deck = new int[count]; for (byte i = 0; i < count; i++) deck[i] = i; Rand...
The code is just to check user session. 'use strict'; import Cookie from 'js-cookie'; import _ from '../helpers'; module.exports = (event) => { const spCookieName = 'sp'; const suCookieName = 'su'; try { const e = event || {}; let sp = Cookie.get(spCookieName); let isNewDevice = 1; if (sp) { ...
From this Stack Overflow answer, I learned that C++17 will have __has_include, which can [make] migrating from experimental to std almost seamless This still leaves the question of how to do it. Doing something like namespace std { using namespace std::experimental; } is undefined behaviour, so I came up with this m...
Let's say you want to display something like: One Two Three Four 1 2 3 4 And since you hate the idea of predefining the widths of the columns you want to print it with something like this: public static void main(String[] args) { new Columns() .addLine("One", "Two", "Three", "Four") .add...
I use the following code to find if there is duplicate value in property path: return new Promise((resolve, reject) => { var data = []; Parser.parse() //configObj is the value from the screen shot .then((configObj) => { configObj.forEach((provider...
I have large amounts of sometimes massive Subversion repositories I'm trying to scan to find the number of additions, deletions, and files changed, similar to what GitHub does. Because of this, the diff operation using SVNKit is very slow. This, combined with 1000-4000 entries on many branches within, 750+ repositories...
I'm learning Python by implementing commonly used data structures. My primary language is Java, thus would like to know if I'm being Pythonic enough. Any means to better up will be appreciated. class Node: def __init__(self, value=None, next=None): self.value = value self.next = next from node impo...
This is first time I code reviewing and would like feedback on coding in industry standards and optimum code. This program adds number in array in two formats: Adds adjacent numbers in a serial manner as proof for the actual sum to refer to the required output. Adds the last and first variables in the array. import ...
I am new to OOP principles and best practices. People often say I write "unpythonic code," so give me your perspective on how to do things better. class TodoList(object): def __init__(self, title=None): self.title = title self.items = list() # depend on _list, accepts _list index numbers d...
This question is a follow up to the question posted here. From the answer in that question, I've improved my implementation and would like another code review. I've made a myriad changes including but not limited to the use of unique pointers, adding constructors for Node and fixing the destructor. I would still like...
I have some filenames, and they each have data contained in them at specific locations in the string. I want a function that returns the value of the data specified by field. The doctest illustrates. I'd like a nicer, easier-to-understand way to do this. If possible, but secondarily, I'd like to be able to give the dat...
I have a Rails app where doctors score patients on diagnosis - their score is the model Baseline. Each Baseline has a user id and a patient id and there should only be one baseline for each patient by a user. Very occasionally I have noticed that a user may create a new baseline (at which point he is then redirected to...
In C#, I could check if any of the nested List collection has a value. Example of such structure Check a List[]> contains a value using Linq List<int> a= new List<int>(){ 2, 2, 3, 4, 5}; List<int> b= new List<int>() { 2, 2, 2, 6 }; List<List<int>[]> c = new List<List<int>[]>(); c.Add(new[]{a,b}); // checking if the v...
I created a small program that hides arbitrary files in png images using steganography - it encodes the files in the two least significant bits of every channel, so using a 4-channel png we can encode one byte per pixel. I also wanted to hide the presence of secret data by encrypting it, and, in effect, making it indis...
Depending on the name of the first argument, self.__sup or cls.__sup behaves like super() in Python 3, while this code is written in Python 2.7. It works for both ordinary methods and class methods(static methods don't use super()). See my code for detailed examples: class mySuper(object): def __init__(self, cls): ...
I aimed at making fully functional (real) Tetris, in the shortest way possible in C. The result is a terminal game for Linux, that uses ncurses. I made it for my friend, who wanted to play it on his Arduino with LED matrix. Before doing it, I browsed for the shortest Tetris code so far. I found the 140-bytes (buggy) JS...
I'm working on creating a new jQuery modal plugin. I'm pretty good at jQuery but still pretty new to the whole object oriented plug-and-play style of plugins so I used a different plugin I found online and ripped it apart using it as a foundation to build mine. However, I don't feel like I'm taking full advantage of it...
So someone requested a Regex Builder / Assistant for Rubberduck and since my CS class had been covering the topic only recently I was thinking to myself: "This sounds interesting, you should do this". Long story short, a day of designing and a weekend of implementation (and some more polishing) as well as a few reviews...
I am trying to get all the master nodes in an elasticsearch cluster using this code. Can I reduce/simply this or optimize further? #!/usr/bin/env ruby require 'elasticsearch' client_node = ARGV[0] client = Elasticsearch::Client.new host: client_node clients = client.nodes.info process: true clients['nodes'].each d...
I have been learning Ruby by reading books and tutorials, and practising some problems on Codewars to level-up my new skills, when I had an idea for a little Ruby code project. It will store programmes you like watching on the BBC iPlayer website, and list upcoming episodes, using an API (link is in 2nd line of code). ...
In the process of teaching myself JavaScript. Starting to branch off into OOP designs and did not want to continue until I knew I was doing it correctly. Is this a common or accepted way of formatting an object in JavaScript, along with its constructor and methods? I have seen many different ways of doing this (at leas...
I need to replace the windows EOL "\r\n" with just "\n", and I want to this in the fastest way possible, as the software will have a lot of files to upload, many of them with a few thousands lines. My current approach is: UnicodeEncoding uniEncoding = new UnicodeEncoding(); using (MemoryStream newStream = new MemorySt...
I wrote this in C++ in February and am planning on adding a generator to it. Before I do that, I'd like to get input on how to improve what I've done thus far. The goal was to be able to solve every Sudoku I throw at it. This includes the ones that reach a point where you can no longer assign numbers based on what they...
I am getting all the answers correct. But still the solution is not accepted as only 4/5 tests cases are passed. I have not posted the whole problem statement but the problem is similar to this. I want to know if there are any more optimizations possible. import sys class Queue(object): input_array = [] def...
I wrote a code to calculate a series of summations and products for a maths assignment I'm doing. The equation is shown below. $$E(\sigma)=[1-(P(\text{$1^{st}$ rejects}) \times P(\text{$2^{nd}$ rejects}) \times \ldots \times P(\text{$n^{th}$ rejects}))] \times \frac{\frac{n(n+1)}{2} - \frac{(n-j)(n-j+1)}{2}}{j}$$ where...
I have a simple program which ciphers text using a 2D array. You specify what letters to replace with what and it does it. I understand the code is very repetitive and that I should probably use functions somehow, but I'm not sure how exactly to do that. Guidance (especially using code examples) would be much appreciat...
The question states: Given an integer A, and two indices Li, Ri. Find if the number from A which is bounded by the two indices is divisible by 7? For example if A = 357753 indices Li = 3, Ri = 4, then the number is 77, which is divisible. My program give a time limit exceeded when executed for larger numbers. Are ...
The problem is to print an N*N array and fill it with numbers(starting from 1 at (0,0)) in the rectangular/circular/spiral fashion, going inwards, ending at the N*N value. Also find and count the indices where the values are divisible by 11, in the circular fashion only.[(0,0) will always be an index] What improvements...
I'm creating a simple MVC framework for a new version of my website I'm working on. Currently I have simple routing, such as /about-us etc ... I've just implemented 'my version' of dynamic routing. I have no idea whether or not my implementation is idiotic or not. I made it up as I went along, so I've no idea if this i...
It's been quite some time since I got my eye on the multi-threading, today I decided to create a really simple application which runs 2 while loops simultaneously and prints the current progress of the thread to the console window, each thread's run time is taken as an input from the user i.e one thread can run for 5 s...
This is a follow-up question of this other one, where I was trying to use the Decorator Pattern in a Python example. I figured, that Java might be a better language for this exercise, so I ported my implementation. While I appreciate any suggestion or remark related to the code below, I am first and foremost looking fo...
I was in a discussion about mechanics of the X-Wing miniatures game where we were discussing a couple of the ways to improve attacks and I put together this small C# console application to determine which method was move effective. The program rolls a specified number of the game's attack dice and then compares if a Fo...
The task: sort the characters in a string, as provided by the ICU UnicodeString. This is because I want to be able to find anagrams using the suggestion from "Programming Pearls", which is, find "signatures" for each word in the dictionary, then sort according to these. It is enough if it works for the European languag...
I am trying to solve a programming problem on a coding platform. When I execute it on my PC, it works perfectly, but when I submit the code on the coding platform, it throws a "Time Limit Exceeded" error. Can someone check my solution and help optimize it? In a social network, a person can invite friends of his/her fr...
I am currently solving the Similar Destinations challenge on HackerRank and am in need of some assistance in the code optimization/performance department. The task is to take a list of up to 1000 cities, each with up to 200 tags, and list the cities that have tags in common, starting with the groups of cities that hav...
I'm new to JavaScript OOP and still playing around with it. I have put together a few specific questions over specific details throughout the code that are bothering me. I wanted my Library class constructor to be optional, the option to add a single book, multiple books or none at all, when creating the object. Is th...
I was working on this problem for a few hours last night and finally came up with a brute-force solution. The task is to report the minimum work necessary (sum of weight × distance) to relocate gold produced at n mines to k of those mines. The first line of input contains n and k; subsequent lines give the location and...
This is a script designed to make an inventory file which records the contents of a directory allowing verification that a backup has the same data. The same script can also A full github repo is available at https://github.com/mikedlr/backup-tools including various test cases using python behave. This is written as a...
I've built simple math expression facet which ignores any character except numbers and operators listed below: plus, minus, multiply, divide, degree, left bracket, right bracket, assignment I'm worrying about hardcoded values of the operators and numbers. I believe that loop from '0' to '9' will not fail since most c...
I am trying to solve a programming problem on a coding platform. When I execute it on my PC, it works perfectly, but when I submit the code on the coding platform, it throws a "Time Limit Exceeded" error. Can someone check my solution and help optimize it? Given a number N, the program must print the pattern as descri...
I was creating a view with Django that would create a user profile for a website and this is what I came up with: if (request.POST): required = set( ['username', 'email', 'first_name', 'last_name', 'password', 'address_1', 'city', 'state', 'zip_code'] ) if (not (required <= set(request.POST))): ...
My question/refactor is similar to what is found here: Laravel controller for form validation skinny However, I feel that the answer is for 5.0 and not 5.2. This question does not pertain only to one controller but considering that I am making a RESTful API I believe 1 example is sufficient so I can propagate this: cla...
I'm practicing writing my own simple version of a Java HashMap. I don't have much experience with generics in Java. public class HashMap<K, V> { private class Entry<K, V> { private K key; private V value; private Entry next; Entry(K key, V value) { this.key = key; t...
I have written two versions of a sudoku solver. Both can solve 9x9 sudoku boards in <200 ms. One of the implementations uses numpy. I am looking for feedback on both, but particularly on why my version using numpy is ~50% slower than the one using a list of lists. Regular: from time import time from itertools import pr...
This code: Copies a value from "Sheet1" Pastes special (as a number) in another sheet "Sheet2" Jumps to the next line I already: Disabled screen refresh Wrapped the code with Application.EnableEvents = False and Application.Calculation = xlCalculationManual 1 made the calculation a little faster, but 2 didn't seem ...
Ok this is the first makefile I've ever written. I it works and that's about it. Things that I was wondering if if I can specify where the object files go. It looks really bad with all the .o files cluttering the working folder. I was thinking a src folder and maybe a obj folder? Is there a better naming convention for...
My MySQL query is loading very slowly (over 30 secs) and I was wandering what tweaks I can make to optimize it. The query should return the last post with the string "?" of all threads. SELECT FeedbackId, ParentFeedbackId, PageId, FeedbackTitle, FeedbackText, FeedbackDate FROM ReaderFeedback as c LEFT JOIN (SELECT max(...
I am using react-native-router-flux to organize the routes for my application. Using Firebase, I am able to call onAuthStateChanged() in the componentWillMount function to determine whether or not a user is logged in. If a user is logged in, the state: loggedIn is set to true and the appScenes routes are loaded. Likewi...
I am creating a simple Mp3 Files Arranger the Project is on Github Questions: How can I optimize this app? Am I violating any OOP principle? Is it readable? How can I make it better? GUI.java package Mp3Arranger; import static Mp3Arranger.Util.getSystemYear; import static Mp3Arranger.Util.spitError; import com.mpatr...
I solved this stack problem in Swift. Looking for any feedback on my code: import Foundation /// Returns an integer read from one line of standard input. func readInteger() -> Int { guard let line = readLine() else { fatalError("Unexpected end of input") } guard let i = Int(line) else { fat...
I wrote a Priority Queue that is stored using a doubly linked list. The queue can return the head and tail of the list, and contains a print function that is only used for testing purposes. I'd like a critique of the general style, correctness, efficiency, exception handling, algorithm and any other areas I may have m...
Is there any better (and shorter) way to get index of a regex match in Python? import re sstring = """ this is dummy text which starts with nothing and ends with something """ starts = re.finditer('start[s]?', sstring) ends = re.finditer('end[s]?', sstring) for m in starts: print (m.start()) for m in ends: p...
I just wrote a Tetris game and I'd like to humbly request for code review especially in terms of code transparency, code efficiency (whether something can be coded in faster way using less resources) and bad coding habits. The game is complete and working and hopefully without any serious bugs (at least at this point I...
I'm trying to write regex to validate the password for the given rule. Passwords must be at least 8 characters in length and contain at least 3 of the following 4 types of characters: lower case letters (i.e. a-z) upper case letters (i.e. A-Z) numbers (i.e. 0-9) special characters (e.g. !@#$&*) I was going through th...
I created a simple 4x4 matrix class (column-major). I would like it to be efficient and to use C++14's full capabilities. Can I improve it? #include <array> class mat4 { public: constexpr mat4() noexcept : matrix() {} constexpr mat4(const std::array<float, 16> &m) noexcept : matrix(m) {} constexpr mat4(st...
I've made this function for to be used while testing. // ----- THE ACTUAL FUNCTION ------------------------- // Returns a string consisting of random alphabetic // characters. // @param { string } separator - Char which shall be // used to separate the single chars. // @param { number } min - Minimal length o...
I'm trying to group by keys in an Array of Hashes in the following form and add their totals. Maybe with #map and #reduce/#inject. I know there is a more compact way to do this. Given I have codes_and_totals = [{'1001' => 153, '212' => 153}, {'212' => 1}] When I run process_codes_and_totals(codes_and_totals) Then the...
For my web application I have written AuthenticationFilter which validates each request to check against CSRF attacks, Browser Checks, Session Validity etc. Instead of putting multiple if else blocks I thought it can be implemented as following. Please let me know if I can improve this. public interface IValidator { ...
This is a Bash script I wrote to email me when updates are available for my server. I'm new to bash programming, so I don't know if I've done this well. #!/bin/bash # Copyright 2016 FlyingPiMonster # # THIS SOFTWARE IS RELEASED "AS IS", WITH NO WARRANTY OR GUARANTEE OF FITNESS FOR A PARTICULAR PURPOSE. THE DEVELOPER I...
I am utilizing an API module for interacting with virustotal.com in order to get AntiVirus results based of SHA256 hashes. The code I have is working but I feel like it can be improved greatly. I think that I am brute forcing my way to some of the text fields I am looking for. Any suggestions on optimization would be g...
There is a main page with this macro assigned to a button. Once the button is pressed it asks if you wish to continue and mentions it takes a while to run the macro. I'm looking to speed it up some if possible. Sub Picture11_Click() Dim sht As Worksheet If MsgBox("Do you wish to print summary pages? Will take approxi...
I am taking a user input which consists of a from date and a to date. Those dates are compared against 4 cells in a row - a post date, pause date, resume date, and a close date. My goal with this code is to generate an array of rows with dates active within my date range. Primary concern is if I followed the most effe...
I'm pretty new to JavaScript, and I'm trying to created a text-based game. I've written a few scenarios and based on the player's decision I have different scenarios written out. As of now I have the code written and it works but I feel like I can be more efficient with an if else statement in my js. Here's what I have...
I've got list of points: List<Point> seedPoints. Each Point contains x and y coordinates pointing to certain double value (let's call it pointValue). I would like to display how many times each pointValue is referenced in seedPoints list. To do so I've created following lambda expression: seedPoints.stream() .colle...
In number theory, the totient φ of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n. Given an integer n (1 ≤ n ≤ 106), compute the value of the totient φ. For the code written below, this is giving TLE. How i can optimize this code or should i prefer so...
I am writing automated functional tests for my application. To interact with the application, I use the SQL database to retrieve data and validate data. One of the challenges that I'm facing is that some data that I need to pull at run time can take 5 minutes to execute a SQL query (specifically this query GetAccessio...
Below is a simple class with two methods: the first calls open() to read in a file. The second calls the first method and does error handling. There is also a corresponding test class that tests the first methods returns data as expected and the other methods test the error handling of potential exceptions thrown by o...
Based on JSON data I receive, I am trying to track a team's home and away games. The JSON data is stored in $scope.gameSchedules and has "team1" for home games and "team2" for away games. I need to initially create an object with each team's name and the only way I can get all the teams' names is via the "team1/team2" ...
I'm building a web app that pulls data from a ticketing system via REST API. I'm currently able to pull all of the data I need just fine but the loading process is really slow. I'd love any feedback regarding the optimization of my code. <?php include 'schedule.php'; $curl = curl_init(); foreach ($onsites as $value){...
August 2016 challenge The Rainfall Challenge Problem description is copied verbatim from the linked Code Review question: Problem Statement A group of farmers has some elevation data, and we're going to help them understand how rainfall flows over their farmland. We'll represent the land as a two-dimensional ar...
Basically, you just run main and it allows the client to "log in", and extract their number from a map, increment their own number, and log out. It all compiles and works fine, but how can I decouple this code, and make it more composable? I'm finding it's difficult to separate concerns, ex between the logic, and the ...
I want to convert my website into a single page app. This function does the trick: $(document).ready(function(){ $("body").delegate("a", "click", function(){ var href = $(this).attr("href"); $.get(href,function(data){ var newDoc = document.open("text/html", "replace"); ...
So I have some code here: First a simple random # generator and a array-choosing function: function Rand(min,max) { return parseFloat(Math.floor(Math.random()* max-min+1)))+parseFloat(min); } function Choose(arr) { //Returns an element from an array at random. return arr[Math.floor(Math.random()*arr.length)...
Created this drawing app with JS / canvas. JSHint is throwing errors but the app works just fine. Need help with code clean up / refactoring as I'm fairly new to JavaScript. JSHint in Atom is fine but using codekit to compile and minify the JSHint freaks out - 31 errors: changeColor is defined but never used (and many...
Problem Implement a relatively naive acronym generation. I was trying to implement a solution without using regex. Portable Network Graphics => PNG. Ruby on Rails => ROR. HyperText Markup Language => HTML. Complementary metal-oxide semiconductor => CMOS. Origin is from code exercise site, exercism.io. Implementation ...
Here is my Python code for finding the permutation index of a given digits and a target number. And by permutation index I mean, for example, given digits [1, 2, 3, 4]. find the index of 3124, meaning the position of 3124 in all permutations. This code finds that. However I have suspicions about it efficiency and imple...
I have seen this question asked around a bit, such as this Code Review question in Java: Write an optimal program that would determine the total number of stops a elevator has taken to serve X number of people. There is a elevator in a building with M floors. This elevator can take a max of X people at a time or...
The intro is a bit long. If you're not interested, then please read the update, and have a look at the specific parts I'm highlighting. I'm very interested in any improvements, but you can assume that all calls starting with psspy. are correct and can't be changed. Also, the calls to psspy that are inside a loop have ...
I have to handle an Action (Modify) about my web application. The app working with SMTP Email, ActiveDirectory, External System (Biztalk, CRM, FTP, others WCF Services) and Internal System (WebServices and Databases SqlServer-Oracle). The main action checks several conditions in several entities. There are duplicate c...
I made a function that would automatically generate official receipt for POS. it is able to accept format such as xxx, xxx-xxx, xx-xx. But my code is really messy and horrible and it needs review. I would really appreciate for corrections, recommendations and critiques to improve this. The flow would be: Get the last...
One of the questions that is presented in Chapter 3 for Cracking the Coding Interview is this: Describe how you could use a single array to implement 3 stacks I've implemented a solution to this problem in C++. My assumption is that the array is a static array that is not growable (unlike a dynamic array). I would lik...
In an attempt to learn Java and SHA-2 I created a very simple String-to-SHA512 generator. Here is the code: package main; import java.util.Scanner; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class SHA512_String_Hash { public static void ma...
TLDR: Rendering is too slow when having lots of custom fields and rules. So I need help to improve this javascript code. #9606: Trac ticket about issue I have a trac 1.0.8 installed on a ubuntu machine with DynamicFields 1.2.6 installed (compiled from latest revisions 0.11 folder). I have more than 100 custom fields ...
Wikipedia has an example of a decorator pattern here: https://en.wikipedia.org/wiki/Decorator_pattern#Second_example_.28coffee_making_scenario.29 I was trying to solve this using functional style using Java 8 just to compare the Oop style and functional style of solving the same problem. The solution I came up: 1.Coffe...
I'm a bioinformatician and mainly use python, but I'm trying to learn Haskell. So far I like this language because it's beautiful and fun, but my Haskell scripts usually end up being much slower than my Python equivalent. Here is my latest attempt: -- Define type synonyms for fields in a fastq record. type Name = Strin...
This series is similar to Fibonacci Series defined as : a[0] = a[1] = 0 and For n > 1, a[n] = a[n - 1] + f(n), where f(n) is smallest prime factor of n. for N in (1 < N < 10^7). Spoj Link for this problem . I have solved this problem in c & Python. But due to long range, I am getting Time Limit Exceeded in Python. Fo...
I'm learning Unity with C# programming and am trying to learn game design. I know the that the best way to learn games programming is to recreate some existing games, and this is my code to create Tic Tac Toe. It's not 100% complete yet but it will be eventually. However, my question is regarding writing decoupled code...
TreeNode* firstCommonAncestor(TreeNode* root, TreeNode* q, TreeNode* p){ if(root == p || root == q){ return p; } if(root == NULL){ return NULL; } TreeNode* temp = firstCommonAncestor(root->left,q,p); TreeNode* temp1 = firstCommonAncestor(root->right,q,p); if(temp1 != NULL && temp1 != p){ return temp1; } ...
I am implementing a binary search to retrieve all matches of a specified value. Instead of a regular binary search that would just return the first match, I want to get that first match AND all matches above and below it in the set of objects. For example, I have an array of objects that are sorted by the name property...
Here I have implemented a queue. Is this a correct, efficient queue implementation? what issues are there if any and what can be done to make it better? import java.util.*; public class Queue2{ private int amountInQueue; private int[] queue; private int rearIndex; private int frontIndex; public Qu...
I have a dataset with 16 million rows and may increase upwards of 30 million. I am using the parLapply to run across three cores in R. But it's taking two days to run to completion. When I try smaller datasets of about 60,000 it takes less than 5 minutes to run, what may be cause of this disparity. Desktop Specs : Core...
We have a class which acts as a time interval, containing a LocalDate and two counts of minutes since midnight. One of the methods on this class converts these values into two DateTimes. Since DateTime has time zone information built-in this conversion might fail if the time is in the daylight savings time "gap", i.e. ...
I wrote a small program in Python that finds primes (how original) up to some limit. I tried to produce very clean code, so I'd be vary grateful if you could point out any improvement I could do to make it more pythonic and more readable. I'm also interested in knowing whether or not it can be sped up (with the same me...
def Ana_exc(): global global_dic, missing_key_w, out_put_defult, ffd_ana_exception_path_w, ana_exc_input_path, ana_5min_input_path, min_flag count_path1 = 0 count_path2 = 0 meow2 = '' ana_exc_time = '' ana_ffm_track = [] ana_exc_missing = [] time_track = [] ana_exc_ffm_header ...
This is my solution to the Equal Stacks problem on HackerRank. I thinks it's really messy and slow. could you give me some thoughts about how to optimize given code and algorithm(i'm pretty sure problem can be solved way effectively) import java.io.*; import java.util.*; import java.util.stream.*; import java.text.*; ...
I created a small ruby script at work to recreate a text file I use for a test in the Java application we are supporting. I'm still really new to the ruby paradigm and wanted to know if that small script respect most of the spirit of it. The content of the file doesn't need to make sense since the only requirement I ha...
I'm learning kotlin and java. As a code-kata I wrote the roman to decimal converter. I'd be very grateful for code review. I was trying to keep things simple and funcional. I'd especially appreciate any comments on the functional style (e.g. the non-purity of some mappings). Converter tests: package roman import ...
I learned HTML, CSS, JS, and Bootstrap then I grabbed a PSD and tried to code it from scratch (to get experience and something for my currently-non-existent portfolio). Here's the result. I need someone to look at my code and tell me if there's something wrong with it. You know, did something the wrong way or used too ...
So having used the SE API multiple times, I like how all responses are in a Wrapper object, and for my own API design I figured it was a good method to follow. Of course, I also wanted to abstract everything out so that common actions could be handled in a simple manner, so that I wouldn't need to write the same boiler...
I am looking to make the following code more efficient since it it rather lengthy. However I need to include in the code constructor classes that include accessor methods for the container number, height, radius 1, radius 2, and a method that computes the liquid that the container can hold. So I am looking to leave the...