instruction
stringlengths
71
71.9k
Last night I was messing with image programming in C# and I tried to make a program that takes an image and transforms it into another image, built with emojis. EmojifyEngine.cs /// <summary> /// Holds all methods involved in transforming a image into a emojified version of the image. /// </summary> static class Emojif...
I'm currently working on implementing overloaded operators for simplifying pop() and push() operations. Check out the //how can avoid this? comments. I've had some troubles understanding how to return a certain value without causing memory leaks due to unassigned free space: so far the only dirty and inelegant idea I'v...
I'm new to Haskell, and am trying to learn the basics with a simple function that will calculate the list of primes up to a given value (using the Sieve of Eratosthenes). Here is my code so far, which has the problem of becoming very slow for large inputs nmax: primes :: Integer -> [Integer] primes nmax | nmax <= 2 =...
I was trying this problem from a competitive forum: Remove the repeated characters from the input string and output the resulted string. Input string: "abcabd" Output string: "abcd" The minimum test cases are passed. Please provide your comments. string input = "abcabd"; string output; int len = input.length(); ...
I need to turn a lot of html elements as editable elements. You will double click on the element to edit, press enter to validate (send a PUT to the RESTapi), press esc to undo. I've written this piece of code. Are there any performance improvements to be made? var editable = (function() { var DELAY = 300, ...
I've made an IDE in Java, using swing. It uses a couple of resources (prefs.json and help.txt) and some imported .jar files for reading the JSON. I know the code's quite long, but the answer doesn't have to be a very detailed one. package io.j4cobgarby.github; import java.awt.BorderLayout; import java.awt.Component; i...
This code seems surprisingly fast at checking if a number is prime. def is_prime(number: int) -> bool: """Checks if a number is prime or not""" # number must be integer if type(number) != int: raise TypeError("Non-integers cannot be tested for primality.") # negatives aren't prime, 0 and 1 aren'...
I have a self referential database table: CREATE TABLE category ( id INT PRIMARY KEY, name VARCHAR, parent_id INT REFERENCES category (id) ); And the following INSERTS: INSERT INTO category (id, name, parent_id) VALUES (1, 'Programming', null); INSERT INTO category (id, name, parent_id) VALUES (2, 'Python...
Original code: Getting name from user, and handling any errors in C I fixed the bugs. Is there anything else to consider? #include "stdafx.h" #include <stdio.h> #include <string.h> #include <ctype.h> #include <stdbool.h> #define BUFFSIZE 10 /*Checks to see if name contains actual characters and not just whitespace*/ ...
I have implemented my own Observer pattern. I want to post my events in a new thread. This thread would simply call all the the observers/listeners with the posted event. public class EventManager { private ArrayList<Observer> observerList = new ArrayList<>(); public void post(Object event) { new Th...
The mall management is trying to figure out what was the busiest moment in the mall in the last year. Each data entry includes a timestamp (seconds in Unix Epoch format), an amount of people and whether they entered or exited. Example: { time: 1440084737, count: 4, ActionType: "Entry" } How can I refactor th...
I just want to know what can be done to make this code smaller in a nice and easy way. Tests using System; using Vegan.Test.TestClass; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Data.Entity.Validation; using System.Linq; namespace Vegan.Test { [TestClass] public...
I've written a simple module that creates a fully connected neural network of any size. The arguments of the train function are list of tuples with a training example array first and an array containing its class second, list that contains a number of neurons in every layer including the input and the output layers, a ...
I spent an hour or so this morning compiling this, and since I have started reading Clean Code and The Pragmatic Programmer I figured I would let you help me get slightly better at this. Due to some crappy limitations with the specifics I was forced to work in Excel VBA instead of Access (someone doesn't want to build ...
I've created a function that takes an integer greater than zero as an input and converts it into its corresponding Roman numeral. If you're not familiar with Roman numerals, you can read about it on Wikipedia. I've tested this code with some examples, so it should be working correctly. I'd be interested in hearing ab...
In my Server class, I have a few methods that handle different queries to be sent to the database. Everything works fine, but I really want to DRY up this class, because I feel like it could be much better written than it is now. The class is designed to strictly handle all client to server interactions by having all p...
I want to test a simple controller and I want to know if this unit test covers all cases: Controller: @RequestMapping(method = RequestMethod.GET) public List<Tags> getAllTags(@RequestParam(value = "query", required = false) String query, @RequestParam(value = "limit", required = false) Integer limit, @R...
This class was inspired from Microsoft's array_view. It intended to use with mmap-ed memory for easily check bounds and so on. I probably will need to throw exceptions, but this is not my usual way of working. Any comments are welcome. #include <cstring> class BlobRef{ public: BlobRef(const void *mem, size_t const...
I was doing some sample example which were perfectly fine. But, when I read about SOLID design principle, I had to change my code. I have implemented DIP and DI (Constructor Injection) in my code. Please let me know whether I have implemented successfully or not. Old code before SOLID design principlss: class Program {...
I've inherited an Access database and am looking to start using it to do reporting. I've written a query that gets me the information I'm looking for, I'm just hoping someone can have a look over it and tell me if I'm doing it the wrong way or not. Anyway, the query takes information from 3 tables: sites - more detail...
I've been a developer for many years, but have always put together files of lists of functions to do everything that needed to be done (instead of using classes/objects like I should be). I've recently started forcing myself to try to get into more object-oriented programming. I wanted to get some feedback on whether ...
Below is a Python implementation of the quicksort algorithm using parallelism. It takes about 1 second per every 10 items in the list, which is hilariously unacceptable. Why is it so slow? from multiprocessing import * def quicksort(lyst, connection=None): if len(lyst) > 1: pivot = lyst.pop(len(lyst)-1) ...
I have made a RESTful API built with Node.js, Express, Basic-auth and Mongoose. it will respond JSON. This is the folder structure: . ├── index.js ├── lib │   ├── middleware │   │   ├── Authentication.js │   │   └── index.js │   ├── routes │   │   ├── Account.js │   │   └── index.js │   └── schemas │   └── Account...
Here is exercise 2.6 from SICP: Exercise 2.6: In case representing pairs as procedures wasn’t mind-boggling enough, consider that, in a language that can manipulate procedures, we can get by without numbers (at least insofar as nonnegative integers are concerned) by implementing 0 and the operation of adding 1...
Can anyone suggest any improvements? I already applied here the suggestions that was made for my first program (Guess the Number) that I posted. import java.util.Scanner; public class Temp { // convertion of fahrenheit to celcius and vise versa public static void main(String[] args) { double celcius, fah...
I'm working on Tic Tac Toe and I want do it for any ROW x COL board with any WIN_SIZE (e.g. 4x4 board requires 3 to win). I've done the hasWon method already but I'm not sure is it done right. Can you check what can I do better here? public boolean hasWon(Seed theSeed) { int count = 0; for (int col = 0; col < ...
I am currently working on a C# WPF project following the MVVM design pattern. I am using Autofac and Prism as core frameworks in the design. For unit testing I am using Xunit and Moq. I am also using the Automock Moq extensions in unit testing to help ease the creation of my models. For a prism event, I am to running a...
I order to speed up opening of a file (which contents are displayed in a series of tabs), I made it so that tab content is generated only when the user first clicks on the tab. If user never opens the tab, code never executes. The problem is I could not any find any TabPage events that would trigger when that tab is se...
I'm quite new to programming and was hoping you wouldn't mind taking a look at my code and giving some points as to how I could clean it up. Assignment guidelines: Create a program that reads multiple choice questions from 1 file and gives 10 random questions to the user. Do Not uses classes. Example of how the que...
I want to find if 'N' numbers are even or odd in the fastest way possible. Here's the following code which produces the desired output, but I do not know how efficient it is. int main() { int N,x; scanf("%d",&N); while(N--){ scanf("%d",&x); x&1 ? cout << "No" << endl : cout << "Yes" << endl; } return 0; Can th...
The following code books one appointment for one or more slots. I have never used database before, but have seen so many warnings regarding SQL injections. Since it has never affected me I have not paid attention. <?php include('php/connect.php'); if(isset($_POST['slots_booked'])) $slots_booked = mysqli_real...
I have been working on a script that can be used to automatically pull the batch ids that were processed 4 days ago and which need to be processed tomorrow on the server. The batch IDs from 3 days ago need to be processed the day after tomorrow, etc. The script only needs to output the processing dates for all batch ID...
I have written a very basic bandwidth usage monitor in C++/winpcap. I would like to get some feedback, regarding design choices, implementation, style, correctness. (Or anything else you care to mention for that matter). Win TaskManager schows 0% CPU usage and 1,7MB RAM, and the program runs and updates the files as ex...
I've inherited an existing application which is a WPF implementation of toast notifications. This application is installed to multiple client PCs across the estate and, once installed, runs in the background. The notifier then works regardless of who is logged onto the machine. One of the improvements I have been asked...
My code is as follows : import React, {PropTypes} from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import { filter_names } from './filterActions'; import Price from './price'; import Year from './year'; import Make from './make'; import Model from './model'; import Mileage from './...
I'm still learning C++ and also algorithms. So I'm expecting to do a lot of refactoring. Here's my code #include <iostream> #include <vector> #include <iterator> std::vector<int> mergesort(std::vector<int> &); std::vector<int> merge(std::vector<int> &, std::vector<int> &); std::vector<int>::iterator get_midpoint(std::...
I have been asked by a client to program a bot which searches Google and will show how many no of results I get. Note: I know about Google Custom Search API and it will not produce the exact output produced by the real google since it is searching only in particular domains My Code (With GUI): # SWAMI KARUPPASWAMI THUN...
Am I using the best conventions or are there better ways? static void makePigLatin(String text){ String[] textArray = text.split(" ") String buffer, translated for (int i = 0; i < textArray.length; i++) { buffer = "" translated = "" for (int j = 0; j < textArray[i].length();...
Here is my generic method for creating linq expression based on field name of a type, operator (as enumerations of operators generated from XSD) and value of field private Expression<Func<T, bool>> GetCriteriaPredicate<T>(string fieldName, OperatorRef selectedOperator, string value) { PropertyDescriptor ...
Here is a Battlehips game in F#. Now, before you start jumping up and down on my code, please understand that, for all its awesomeness, F# has a serious limitation: Its compilation is linear, and the solution structure cannot have folders. Any code that uses other code must be below the other code, whether in the sam...
I needed Line and LineF for the next stage of a project I'm working on, so I developed them. I also needed to determine if two lines intersected, preferably as cheaply as possible. (Lots of physics calculations.) So, I built Line. Then I built LineTests, then LineF. The intersection code is my favourite part, essential...
I wrote a program in Python and in Java to search for the smallest integer solution of the equation: $$a^5+b^5+c^5+d^5=e^5$$ (expected output is \$133^5 + 110^5 + 84^5 + 27^5 = 144^5\$) Powers and roots are either computed directly ("direct calculation" method) or computed and stored in an array ("power lookup" method)...
I have not yet developed a satisfying coding style in Haskell. In the code snippet below, there is a lot wrong to my taste: Helper functions which should be local to showEngFloat are defined outside. let ... in indentation madness More than 80 columns Can you show me how this same code can be written in a less indent...
I can have one of the following strings: var username = "i:0#.f|myprovider|domain\\myuser" var username2 = "myprovider|domain\\myuser" var username3 = "myuser" I always want only the myuser part of the string! I tried the following in JS var n = username.lastIndexOf('|'); var domainandusername = username.substring(n +...
I'm trying to solve this problem from the Australian Informatics Olympiad here. (These are past questions which I'm completing for the purpose of revision, if you are worried about the integrity of the competition, and unfortunately the organisation doesn't provide answers). Basically, when given an input with: a list ...
I have wrote a small C++ class that provides some basic serial I/O functionality (it uses the standard GNU/Linux API). At this stage is working fine, before adding new functionality I want to get some feedback for the current code. I structured the classes like this: There's a pure virtual class called AbstractIOHandle...
The code below is a working excerpt from a larger application that I am re-factoring. My question focuses on the performance aspect of using (or not using) objects in this case. I have a medium-ish size data set on a worksheet (6500 rows by 12 columns) and am building an application to merge (mostly) new data records w...
I've got a basic python function that I've been tasked with finishing in a class. It's already fulfilling all the requirements for an A as it's an introductory course to Python, but I'd like to get some advice on it still as it's taking quite some time to execute. I've got a few years of experience with general progr...
I have implemented the following logic: a base class, Animal, has a vector, friends. A derived class, Dog, then inherits from Animal. I then want to implement a set_friends() function that can be passed a Dog object and then fill its friends vector. I then want to be able to call print_friends() from the base class to ...
I've created this code (used the validation creation section from here) which creates dependent dropdown lists based on data which is in a pivot table style arrangement. The idea is that picking a client gives the options of what projects relate to that client, and picking the project gives options of milestones based ...
I have recently been trying to build a parser. After a month of trying and getting nowhere fast I decided, like I should have at begining, to research how parsers work and what they do. After a little research, I learned that parsers create a tree like structure of the language grammar, official called a abstract synt...
I have had an assignment to construct a movie knowledgebase and ten specified queries in Prolog. This is my first ever Prolog program, so I would appreciate any pointers toward how I could improve. We were instructed to not define any additional predicates than the three specified in Movie, and print_query_true and pri...
This is for homework but the deadline is over and I know the implementation is correct because it concurs with the math. At this point I just want to check my implementation for potential optimizations in terms of speed, memory usage, clarity, modularity, and anything else you guys might think of. (I know there is gene...
I have a little experience working with .hl7 data (format for transmitting health data), so I decided to try and write an .hl7 parser using fparsec. A standard .hl7 segment is a single line with: First 3 chars are the header Next 5 chars are the separators (typically |^~\&) Fields / repetitions delimited by pipes A s...
Given an unsigned integer \$N\$, I want to return \$P\$ with \$P\$ being a power of two such that \$P \ge N\$. Examples: 1 -> 1 2 -> 2 3 -> 4 5 -> 8 The goal is to provide a very fast implementation. This code is supposed to target a specific platform and we can make the assumption that the intrinsics used are suppor...
Recently I started focussing on semantic HTML. And strangely I still find it quite hard. Could you guys please check this file and give me some tips on what I can do better? Also Is it bad to use the "form" tag for only 1 input? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> ...
LifeTracker.h #ifndef _LIFETRACKER_H_ #define _LIFETRACKER_H_ #include <vector> #include <algorithm> #include "MySIngleton.h" class LifetimeTracker { public: LifetimeTracker(unsigned int x) : longevity_(x) {} virtual ~LifetimeTracker() = 0; friend bool Compare(const LifetimeTracker* p, const LifetimeTr...
I needed a way to make a CLI based script a bit secure. So, I thought of the following workflow: the client will get the MAC of the user, sha256 it and put it in a file at a specific location then in my program, I'm also doing the same thing, check to see if the sha256 of the MAC is present in the file (and if it matc...
Recently I have been wanting to get better with Python, in particular with Python 3.x features and Python OOP, so I wrote what I thought at first would be pretty simple, a TicTacToe game, which turned out to become pretty complex after adding all that I wanted. Some of the features I added, besides the basic game logic...
Following this question, I've rewritten my module as follows: ;(function(ns) { //anonymous and auto-executing function for the module definition //default options for addEditEvents() var defaults = { element: $("body"), selector: "li", url: "", idInUrl: "", idAttr: "", ...
I have a standard Edit action in Asp.Net MVC 5 and I want to avoid throwing the unhandled exception when is made a get request without the id like ~/food/edit, so I did this. public ActionResult Edit(int id = 0) { if (id == 0) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } stri...
I have written a JS code to modify the structure of the table by parsing the webpage for particular table class and store the rows of the tables in an array. And use the array for the constructing a new table. The codes are below. (function() { 'use strict'; var headElements = new Array(); var bodyEleme...
I wrote a generic Queue that could with work any data type you give it. The Queue can do any the basic operations that you would expect a Queue can do such as enqueue, dequeue, peek and so on. I would like you to critique me on: My general style My ability to properly deallocate memory so that there is no memory leaks...
In the slow progress of the project that generated my all-but-tumbleweed previous question I've needed to make sum-unions (any better term?) of simple objects where key:value is sizeClass:tally -- I need the union of all sizeClasses, summing their values where they're the same. I came up with this and I wonder whether...
"ONE" and "ZERO". The basis of this project is in this video -> links to his code can be found in description In it the speaker asks you to check his math; I wrote my own code and then compared it against his. It is also in the other GIST i am adding to stack-exchange -> Credit for that code goes to MATT PARKER. TL;DR...
So Stackoverflow Documentation has added "Contributor Breakdown". For any given topic (and example) people can display who contributed in which way. That page is only available if you know the link though. And it's not linked publicly in any way. Since I like these hidden pages, but I keep forgetting the correct URLs ...
#include <iostream> #include <vector> #include <algorithm> template <typename T> int copy_max(T& to, T& from, unsigned char delim, size_t limit) { typename T::iterator pos = std::find(from.begin(), from.end(), delim); typename T::iterator prev_pos = pos; if(pos == from.end()) { return -1; ...
def mergesort( array ): # array is a list #base casee if len(array) <= 1: return array else: split = int(len(array)/2) #left and right will be sorted arrays left = mergesort(array[:split]) right = mergesort(array[split:]) sortedArray = [0]*len(array) ...
I'm looking to improve it in brevity, readability, and simplicity. Basically, I'm just looking for a more elegant solution. What improvements can I make? i=0 while true; do OUTPUT="$(docker inspect --format='{{json .State.Health.Status}}' su-apache)" if [ $OUTPUT = '"healthy"' ]; then echo break ...
I was wondering if there is any way to make this code smaller/condensed. It is for a school project which says it has to be as small as it can be and I am not sure whether it can go any smaller. num1 = float(input("Give first number "))#Get first number num2 = float(input("Give second number ")) #Get second number ans ...
I am using the following function to make a specific filter passing the $scope.searchParams in this way: <tbody ng-repeat="user in users | customFilter:searchParams "> ... $scope.updateSearch = function() { var searchParams = {}, loginArr = [], nameArr = [], statusArr = [], accountsArr = [...
I'm aware I am probably reinventing the wheel somewhat here, but I am trying to teach myself simple bash coding by completing simple tasks such as parsing files. To that end I am looking to learn what elephants in the room I could be missing or if there are better ways to use the core functionality of bash without inst...
This code load a 40MB txt into a dictionary. It runs in about 40 seconds (sometimes 20, no idea why). Is there a way to make it run under 4 seconds, or hopefully in 1 second? Sub ScriptDic() Dim FileNum As Integer Dim DataLine As String Dim tmp As Variant Dim Dict As Object Dim duplicatecount As Object Dim key As Stri...
I've created the following app in Python 3.5. The app uses pyowm and will take a location and return weather information. I've also built a GUI with tkinter for it. Keen to find out some tips to improve my coding style. import tkinter as tk import pyowm import datetime, time class WeatherInfo(tk.Tk): def __init_...
I have been working my way through the exercises in the book Cracking the Coding Interview. I wanted to get feedback for the following exercise. Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end to hold the additional characters and that you a...
I made this code for take some data from a .txt file. The text file is a large list of data from temperature with a format that is repetitive and have some lines at the beginning with the station reference. I took the first ten lines but only one time, then I jump to line 12 to take the headers and then I have a mark t...
What would you improve at the following code, except: The problems I'm already aware of, marked as TODO Line width of at most 120 characters (I've run flake8 over it and it's fine) Using decorators (I know about them, they don't fulfill my requirements in terms of how new commands should be written) I'm using Python ...
I have solved the problem and it gives me the right output when the BigInteger has the smaller value, however it kept running for more than 20 minutes with the larger value without printing out an answer. So I'm thinking that there should be a faster algorithm for this program. The problem states: The prime factors o...
As junior java programmer I am working with Euler project and I would like to create a general purpose class which generates all the combinations from the length and number of choosen elements. The class returns a list of boolean arrays with length of length. Each array has choosen true value which highlight the chosen...
I try to implement the encryption by Columnar transposition. Input: key_secret and Text_to_encrypt, both of them are in lower. Output: encrypted_text. The code works fine but I have some questions: it warns: "Function 'begin' could not be resolved", Function 'end' could not be resolved, Function 'copy_if' could not be...
I have this code which migrates HTML elements to the word chunks by bracketing each element. Here, chunks is the list of word chunks to be processed and dom is to access the given HTML source. This returns a list of processed word chunks. Could you suggest any improvements to this : def _migrate_html(self, chunks, dom)...
I have this code to translate text using the Google Translate mobile site. Currently, text size is limited by the request method. Everything else seems to works just fine. I am also about to post this on PyPi but I don't know how I should name the package, the file and the function. Basically today you must do: import ...
Inspired by Monday's Reddit daily programmer challenge, I wrote a function to check whether two strings are anagrams. It doesn't take the same input as the challenge, though, since I don't want to handle user input (yet). For the lazy ones, the task is to write a function that checks whether the letters in the first w...
This is a function to detect cycles in a back-trace. For example a cycle ('b', 'c', 'd') proceeded with 'a' could be: >>> __cycles_detection(['a', 'b', 'c', 'd', 'b', 'c', 'd', 'b', 'c', 'd']) (('b', 'c', 'd'),) Args - funs (List[str]): functions list Returns - list: the different cycles present in the back-trace Ca...
The idea of this code is to poll the server every 15 seconds to check for and update the notifications indicator. However, I'm not convinced I've done it right, as sometimes it seems to take an unusual amount of time to propagate across tabs and some users have reported that notifications "get stuck" and don't update a...
I started learning factory pattern, and also implemented factory method pattern. My factory-method pattern classes are as follows: There are two major parts, an interface "Document.java" and and abstract class DocumentCreator.java which has an abstract method createDocument. Classes XMLDocumentCreator and ExcelDocumen...
In an Azure Function, I have a c# program that processes tab delimited data into JSON entries. I'd like to improve it in terms of performance and the connection management. I want to remove personal data from each line.* As each line gets prepped for turning into JSON I perform this function for two values.** I need to...
All the usual stuff. Style, substance, algorithm please! I'm vaguely considering plugging it into a bot, hence the lacklustre catching of exceptions right now. import requests import sys def get_num_syllables(value): try: res = requests.get("http://www.thefreedictionary.com/" + value) except requests....
I wrote this code to write the log file every 5 seconds to avoid excessive disk I/O (which can cause HDD temperature to increase or SSD to wear off): var fs = require('fs'); var logText = ''; function log(){ fs.appendFile('c:/log.txt', logText, (err) => { if (err) throw err; logText = ''; }); }...
I am attempting one of the questions from Cracking the Coding Interview: "Design a chess game using object oriented principles." The solutions are in Java and below is my attempt to create something similar in C++. This has brought up a few issues and gaps in my understanding. The below code compiles and gives me the d...
Let me start off by saying that the question specifically implies using std::list<int> and not anything else AND you are allowed to iterate over the list only once. Taking this into account, we assume the target sum value to be 10. The task is: You are given a list of integers (std::list<'int'>). Iterating over the li...
What would be a cleaner way to write the following? // Check if add user was attempted if ($params['submit']) { // Verify all fields are filled in if (Utilities::checkAllFieldsNotEmpty($params)) { // Make sure username is not taken if (Admin::checkUsername($params['username'])) { // ...
I wrote a little class that will calculate 6 business days from today. The reason it's in a class is because it will be used as a part of a bigger program. I would like a way to refactor this class and make it a little more object oriented along with a little prettier. from datetime import datetime, timedelta class B...
I need to optimize the below code, as much as possible in: using less resources as possible being as fast as possible What the code does is simple, it splits the string by words and only if a word is equal or bigger than 40 characters it will add spaces every X characters to the word that was too big: <?php $text = ...
Inspired by this question, I went on with the following version. My goal was to focus on pure functions, to avoid mutable variables and to be strictly functional. I have ignored the computer player part - as it will not change the overall design. An issue may be that an unchanged player survives from one game state to ...
I wanted to learn some new language so I developed a really simple vb.net "console application" (was that the right type?) that takes text input, looks at it and multiplies it if it's even and then reads each result into a msgbox. test.txt = 1 2 3 4 5 6 7 8 9 result should be an array {1 4 3 8 5 12 7 16 9} This would...
I've wrote a little iPad app with Xamarin.Forms. What I'm trying to do here is send some support tickets via a request to my server. I'm also keeping the "Failed" tickets in a collection so that I can try to send them in an other thread at app start. Can I improve my code or is it hopeless? public void SendFailedTi...
I'm writing a Minesweeper clone. I needed a function that returns everything located at a certain tile, and ended up with an atrocious mess. I'd like help making it cleaner and more idiomatic. The main state of the board is represented by a Field record: (defrecord Field [dimensions ; Pair: [width height] in cells ...
I have a class, and it does one thing, It adds numerals to the numerals array. In doing so it uses a number of private methods and has ended up looking a little bit sickening... brace yourself... require './lib/number_interpreter' require './lib/numeral_adders/m_adder' require './lib/numeral_adders/cm_adder' require '....
This function generates a unique id for my files, which will be stored in the database to reference them. It returns the id if unique, if not, it generates a new one. My separate file server can then use these ids to locate and retrieve a file. I'm planning on storing thousands upon maybe millions of files uploaded by ...