instruction
stringlengths
71
71.9k
I have been working on a simple calculator project in Java since November 2014 as hobby. Now I want to add complex number support and Matrices. I also wants to add support for symbolic computation in future. For this purpose I wrote a Literal class which is meant for to hold all types like Matrix class objects and Comp...
I've just started with the basics of OOP. At first it looked complicated, but once I just started with it, it seemed so easy and everything seems to work like a charm, and that's why I'm unsure if I'm doing this right. I'm creating a system to track actions: This is the Timer class: class Timer { private $_db; ...
There is this hackerrank question, where we need a rhombus of letters. As to my opinion it can be viewed as some fractal, or similar logic. Well I solved the question, but I am obviously disappointed with the code I come up with. Actually when I started writing I knew how I would end-up and I was ready to ask a questio...
I have the following code that converts a string that looks like aaa-bbb|ccc-ddd|eee-fff to two strings that look like aaa|ccc|eee and bbb|ddd|fff. var id = "HEL-CAS|MAD-STO|XXX-YYY" var splittedId = id.split('|'); var from = "", to = ""; $(splittedId).each(function(a,b) { from = from + b.split("-")[0]+"|"; to...
I'm a beginner in JavaScript and I want to improve my skills. I decided to write a simple application that adds a GUI to CanvasRenderingContext2D. I have just barely started and there are not many functionalities yet. I wonder however whether this is a proper way to write OOP in JavaScript? Will it be easy to maintain ...
I've written a data type to represent a word in the memory of a MIX computer. A MIX word has a sign bit and five six-bit bytes. So I created a data type and provided instances for all the common numeric typeclasses (that I could think of). Some questions that came to mind: A lot of my instantiations use dependencies i...
I am trying to grab the URL query of the URL which is in the browser's address bar, then append it at the end of the other URL and echo it to the browser. So, if I visit my script at: http://script.com/script.php?a=x&b=z and the other URL is: http://google.com/?c=v&d=u then the browser will display: http://google....
This is a for-loop which runs once for each step with i>1 and maybe for 0 <= i <= 1. var i; var prob_ = 3.5; for ( i = prob_; i >= 0; i -= 1 ) { if ( i > 1 || withProbability(i) ) { loadHttp(randomUrl()); } } with function withProbability(chance) { return Math.random() < chance; } JsLint gave me a...
I have a working code, but it has a lot of flaws. The main project is to get a value from a website. I need to complete this action million of times, so i download the webpage returned from the class method, and parse it afterwards. In case the page is already downloaded i just open that one up. This code is working, ...
In my C# program I am using Regular expressions to: Loop through a list of possible words in need of replacing. For each word, to find out if a string I am given has any matches. If it does, I perform some (slightly costly) logic to create the replacement. I then perform the actual replacement. My current code looks ...
I wrote a todo app with JavaScript and want to have it reviewed to see if I can make it better. I think my JavaScript is messy and can be improved a lot. Please share your thoughts and way to improve this (I think my JavaScript can be half of the code to do the exact same thing). Here is my app. var mainInput = docu...
Task: Create a class RPNStack which represents a stack of objects of type Node. Class RPNStack contains only one private field top of type Node. Objects of type Node represent data that are pushed on the stack: each object contains in its field val a double and in field next a reference to the next node (as in...
Will the below code work for adding Weekdays in all possible scenarios? eg, If I add 4 days to a "Thursday", the result should be next "Wednesday". Adding 1 day to a "Friday", "Saturday" or "Sunday" should be the next "Monday". I am trying to get the nth working day (weekday) after a given day. var addOneDay=function(d...
I am working on a codebase that operates in the following manner: /*========================================= = Table of Contents = =========================================*/ /* 00 - Initializer 01 - Summary 02 - Consumer Lead 03 - General Services 04 - Products 05 - Quote...
I recently wrote the following code for a codewars.com kata for evaluating mathematical expressions. I've been writing ruby for years, but almost everything I do is for personal use and isn't shared, so I've gotten essentially zero feedback on my ruby style. The following block of code (with more comments than usual...
HackerRank currently has '7 days of JavaScript' going, a quick intro into the JavaScript language. Every day a couple of challenges will be made available. One of the challenges of today was this: Task Write a JavaScript program to display the status (i.e. display book name, author name and reading status) of books. Y...
What I'm ultimately trying to accomplish is a tool in which I pour some documents. Then I mark #x documents as desired and #y documents as undesired. My tool now is to analyse and compare the documents and give me search strings that would find me many of the desired and few of the undesired. What the code at hand is s...
I have a method in which I am accepting a String clientid and that has below requirements: clientid can be a positive number greater than zero. But if it is negative number or zero, then throw IllegalArgumentException with a message. clientid cannot be a null or empty string. But if it is, then throw IllegalArgumentEx...
I'm trying to reach good understanding of how to build scalable modular application structure. Recently I've been practicing with canvas and rewriting one of the popular snake game realizations. I've decided to try to split its code to modules. The codebase is not big and it seems to be a pretty nice exercise to me. Th...
Given is a list of pairs. I want to replace the second element of all pairs with the median of the second elements of all pairs with the same first element. For example: [("a",1.0),("b",3.0),("a",2.0),("a",4.0)] -> [("a",2.0),("b",3.0),("a",2.0),("a",2.0)] The order of the elements in the resulting list is not importa...
This is the first time I've attempted writing something in bash, and would appreciate any feedback or criticism to make it better. #! /bin/bash macArr=( 0 0 0 0 0 0 ) for ((i=0; i < ${#macArr[@]}; ++i)) do let "byte=$RANDOM%255" # the first byte must have the least significant bits set to "10" # in order t...
VSDiagnostics has an analyzer that verifies whether or not a given identifier is following naming conventions. The following conventions are supported: UpperCamelCase lowerCamelCase _lowerCamelCase ICamelCase On top of simply verifying this convention is followed it also suggests a new name that does follow conventio...
Replace all c / C / v / V in stdin with lower case, upper case consonants / vowels respectively. All other input is passed through. Anything that can be improved? Looking at maintainability first, performance second. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> static const char lower_c...
I wrote a class to slightly customize the behavior of lxml.etree.ElementTree and I use it quite extensively. It works great, but there are a few methods that I'm not sure how I wrote, and there are a few other methods that seem awfully redundant. I'll elaborate on specific questions below, but first here's the code. im...
Below are a collection of classes that compose my buff/debuff system. The largest flaw in my design that I couldn't overcome is the base class Effect having an enum filled with the different types of buffs and debuffs. If there is a workaround that could clean up that part of the code I'd be really grateful. Otherwise,...
I'm the proud owner of the Vitsy programming language, which I've been working on for some time (except recently, because high school). It's only been used in PPCG so far, but I hope to expand it to more useful things. It is a top-access-only 2-dimensional stack-based language that moves in multiple directions through ...
To get a better understanding of objects/methods, I wrote a text-based, turn-based fighting game. I want to expand by adding new characters with new moves (one of which can alter the way other moves works - I'm thinking of using Decorators for this). Anyways, I'm open to suggestions, advice, constructive criticism, etc...
Creating my first program in Swing and I was hoping to get some feedback. I'm looking for constructive criticism and tips for my swing code and my code in general. Don't really know what I'm doing so any advice would be helpful. The program is a simple text editor like notepad. Everything works the way I want it to so ...
I have an array of nested objects: [ {_id:1, parent:0, name:'Z'}, {_id:4, parent:0, name:'A'}, {_id:2, parent:1, name:'H'}, {_id:8, parent:2, name:'G'}, {_id:5, parent:4, name:'M'}, {_id:6, parent:4, name:'N'}, {_id:3, parent:1, name:'Z'}, {_id:7, parent:2, name:'L'} ] I nee...
This is revised code for the previous question: Object-oriented implementation of a real-world scenario of using a bathroom Is there any object oriented way or design pattern I can use to make this code better? How can a User object access all private methods of Fitting instance? This is inspired from HeadFirst Object ...
I feel like there is a cleaner/simpler way of doing the following. Is there an existing software pattern that I should be using? I have an Assembler class that I use to assemble/process content rules MS-Word documents. There are many different types of Controls that are processed: ClearCellIf DeleteColumnIf DeleteLine...
I'm writing a function that returns all (nested) sequences reversed: (defn my-reverse-v1 [input] (let [head (first input) tail (rest input)] (if head (conj (my-reverse-v1 (vec tail)) (if (sequential? head) (my-reverse-v1 (vec head)) head)) []))) (defn m...
The question below came from C++ primer 5th edition. Read a sequence of words from cin and store the values a vector. After you’ve read all the words, process the vector and change each word to uppercase. Print the transformed elements, eight words to a line. I was just wondering if there is any way to improve ...
This question came from C++ Primer 5th edition: Q: Read a set of integers into a vector. Print the sum of each pair of adjacent elements. Change your program so that it prints the sum of the first and last elements, followed by the sum of the second and second-tolast, and so on. I was just wondering if there is...
I have an PHP endpoint used to mail me feedback or error logs from my sites here: https://github.com/kaihendry/vanilla-php-feedback-form/blob/master/feedback/feedback.php <?php switch ($_SERVER['HTTP_ORIGIN']) { case "https://example.com": header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']); ...
I came up with a caching decorator for pure functions. Is it ok? Could it be better/simpler/faster? def cached(f): def _(*args): if args in _._cache: return _._cache[args] else: result = f(*args) _._cache[args] = result return result _._ca...
I'm doing some boring math with lot of sums over lot of variables. So, instead of nesting for loops I have decided to use something like this: def combo(*limits): if len(limits) == 1: for l in range(limits[0]): yield [l] else: for l in range(limits[0]): for l2 in combo(*l...
Suppose you have several sequences: A: 1 2 3 4 5 B: 2 4 5 C: 2 1 3 4 5 D: 3 2 Here, some pairs of list contradicts each other, because they don't expose the same order for their similar elements: (A,C) (A,D) (C, D) What is an algorithm or a linq statements to find such pairs? Or just to say if my ...
I'm writing a program to split the words contained in an hashtag. For example I want to split the hashtags: #Whatthehello #goback into: What the hello go back import re,pdb words = [] # corncob_lowercase.txt contains a list of dictionary words with open('corncob_lowercase.txt', 'rb') as f: for read_word in f: ...
I have made a simple gender guesser for an app and thought that this simple bit of code may be useful to other developers. It takes in a string and returns an 'f' for Female and an 'f' Male depending on the name provided. I am not a PHP expert so I was wondering if anyone can give me some feedback on this code. The ful...
(function( d, w ){ function showClimb( e ){ var t = e.target; console.log( t.id ); while( t.id !== 'document-body' ){ t = t.parentNode; console.log( t.id ); } } d.body.addEventListener( 'click', showClimb, false ); }( document, window )) I just wro...
I just want your opinions about my code. How could I improve it? Is there a better method to do it? from sys import exit from random import randint print "Welcome to the PIN Game 1!" print "Tell me your name" user = raw_input('> ') #asks the user for an entry and prints what he has chosen def start(): print "%s...
I recently came across a email bot that would give you random problems to solve. Here is the problem. Please write a function in python which receives a natural decimal N-digit number (1 to 15 digits long) as an input and returns the minimal next N-digit number with the same sum of digits or -1 if there isn't one. Try...
This class combines multiple instances of Iterable into one and iterates through them in the order they are given to CombinedIterable. CombinedIterable.java: package net.coderodde.util; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashSet; import java.uti...
I've been trying to separate my button functions from my main GUI class The code works but as an programming beginner i want to hear if i'm doing things the 'proper' way. Point out what am i doing properly and what not. Thanks in advance. Frame class: GuiFrame() { setTitle("Aplikacija (bez imena) v1.0.1"); set...
Into my workbook I've the db of inventory, in another sheet I've one pvt and in the filter field I put the filed "Card". Now I want create one sheet for each "Card" usually I use this code for this operation: Sub cmdg2b2(control As IRibbonControl) 'genera una sheets per ogni card Application.ScreenUpdating = False App...
Breadcrumbs should look like this: Home > Mobiles & Tablets > Mobile Phones > Phone Super Duper every product belongs only to one category. e.g Phone Super Duper can be found only under Mobile Phones. This is just a sketch but i want to know your opinion if the direction is ok or i should change the strategy. ANY crit...
I want to search some or all public properties of a class and for this requirement I have implemented a Property Searcher. The Input for a Search is always a string. The Output contains the SearchString, the SearchContent in which the SearchString is contained and the searched Property.The Output is wrapped in a Searc...
I've got some if and else if statements to show and hide svg elements and it works the way it should but I wonder if I can shorten the code since it looks so repetitive. I'm not sure if it's possible since I'm not a JS/JQuery expert. If/else if code //Door type 1 if( id2 == "#Door1" && id3 == "#Grey") ...
I have create a functioning automated traffic light sequence using an array and if statements. It all work correctly but I am wondering if there is anything more I can do to improve my code without changing to structure or way it works, so without the use of dictionaries, etc. <!DOCTYPE html> <head> <title> Traffic ...
The statement of the problem is : If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? NOTE: Do not count spaces ...
Visual Studio generated this great route for me, where I can load an entity: // GET: api/Jobs/5 [ResponseType(typeof(Job))] public async Task<IHttpActionResult> GetJob(int id) { Job job = await db.Jobs.FindAsync(id); if (job == null) { return NotFound(); } return Ok(job); } Here's the Job...
This is a FizzBuzz program, designed to take parameter inputs for start and ending numbers, as well as a "fizz" number and a "buzz" number. The program then outputs the numbers one per line. If the number is divisible by the "fizz" number (normally 3), "fizz" is printed instead, the same with the "buzz" number. If the ...
Not confident enough if this would be the correct 'node way' of writing Promises: Essentially, there are two async database calls, the result from both of these calls has to be collected and used in rendering the view: Creating ... exports.getIndustryById = function(industryId) { return new Promise(function(resolve,...
I have a rating system where users can vote between 1-6. I'd like to normalize the votes a bit to better accommodate for extreme voting, where individuals tend to vote as high or as low as possible. To do this, I have the following algorithm which seems to work well. However, it's extremely inefficient and not very wel...
There's a lot going on here, but the background for why this is necessary is that there is a set schema, or 'core' set of tables that are prefixed with 'bu', and any core table can have a custom table of the same base name but prefixed with xb and has the same primary Key. I have no idea if a customer has created an ex...
I recently discovered the exponential search algorithm which can be used to find whether a value exists in an ordered range. An exponential search checks whether a value is smaller than the \$2^n\$th element of the range, then if the searched value is indeed smaller, it performs a binary search in the range \$[2^n, 2^{...
While the experience is limited in C#, it is not in OOP generally. While the Beginner-tag is used, relentless, harsh (but constructive) feedback is still wanted. It is more for you to get a grasp of the experience in C# so far. Would you want this code in your next AAA game title? If not, what are the problem(s)? That ...
I maintain our organizations intranet page as an additional duty. One thing that every department in the organization likes to use is calendars -- upcoming events, training, etc. At first I was only getting a few a month, and it wasn't difficult to create the calendars using cut-n-paste. I wrote the following to creat...
Following-up on my Linq-to-Sage implementation, I ended up implementing all CRUD operations, following the Sage 300 view protocols. So, the entities derive from classes that look like this: namespace SageAPI.Views.PurchaseOrders { /// <summary> /// Defines view and key field mappings for 'Purchase Orders' view....
For this next assignment, my job was to create a GUI with a button that changes text and color when clicked, and a slider that updates a label (with a TitledBorder) based on its value. Right now it looks like this: I've made GUI's before, but it's been a few years and I know that the language has updated since then. ...
Given the following event dispatcher code public interface IApplicationEvent { } public delegate void ApplicationEventHandlerDelegate<in TEvent>(TEvent @event) where TEvent : IApplicationEvent; public class ApplicationEventDispatcher { private bool _disposed; private Dictionary<Type, Delegate> _applicationEve...
I have the following code that converts a string that looks like: aaa-bbb|ccc-ddd|eee-fff to two strings that look like: aaa|ccc|eeeandbbb|ddd|fff The code works fine, but I am wondering if I probably missed some string/array functions that can makes the job in fewer operations / or with faster runtime. var id = "H...
In my current project I'm writing a C function to write a BMP-File. Internally, the function is split up into three parts: write header, write info header, write data. In some of these functions I do need to allocate heap space with malloc and actually write to disk with fwrite. These functions are doomed to fail from ...
I built a simple calculator that supports addition, subtraction, multiplication, and division. It can also chain operations. I'm looking for feedback on my code for places that could be done better in terms of either efficiency or best code practices. $(function() { 'use strict'; var calculator = (function() { ...
I've just started using Lazy.js, which is my first exposure to a "functional style" javascript library. I'm still utterly lost as to which of the hundred different functional javascript libraries to use, but so far I like Lazy.js, so I've used it to write a tag harvesting module for a blog engine project I'm working on...
Code works exactly how I want it to, but any simplification to the code that could be made would be much appreciated (granted this program uses almost everything within the scope of my C++ knowledge). // sum calculator #include<iostream> #include<string> //integer sum: 0 + 1 + 2 + ... + n int integer_sum(int a, int b...
My program does exactly what I want it to do and it works well. However, I feel like it's very clunky. I'd like my code to be more efficient. By that I mean, I'd like it to accomplish what it already can, but in the best way possible and in the least amount of code. Basically, optimized. I'd also like it to be easily u...
I'm using this method and I would likely have a code review. Also, I have one concern and is that source.Count() is executing synchronously and I don't know how to make it async in this context. public static class IQueryableExtensions { public static Task<PaginatedList<T>> ToPaginatedListAsync<T>(this IQue...
The code below was inspired by this post in Code Review. Here is how it was first intended by its author: I have the following code that converts a string that looks like : aaa-bbb|ccc-ddd|eee-fff to two strings that look like aaa|ccc|eeeandbbb|ddd|fff Somebody already proposed an answer, and I found it could b...
I have the following first-letter only alphabetical sorting algorithm: Note: FileManager is just a file I/O class that reads in the unsorted words from a textfile then writes the sorted ones back out). public class Sorter { static String list[]; public static void main(String args[]) { FileManager fm...
Alright, so my code is 'all over' and missing some fundamentals as regarding to the MVC design pattern.I should separate my concerns and I don't have a model layer and i'm clueless to how to implement it in the current situation. My two classes are : public class GuiPanel extends JPanel { public ImageIcon resource01;...
I have written this class to check internet connectivity on Android, while there are many instances when WiFi is connected is taken as an implication that internet is connected as well. I wanted to have a method which actually checks if internet is connected. One issue was to run the internet code in a background threa...
I've written this function for to check if two strings are equal. Can I improve it? Is there a better way to accomplish the task? // Compares two Strings concerning equality. // -- Parameter -------------------------------- // 1. String - The string to compare against. // 2. String - The string to compare with. //...
This is the perl code which compares the sequence in fasta file & maps the header. Though the code is working well, I still would like to make it more efficient. Since the files I compare has >100000 sequences it is taking huge time despite using hashes. Can you please suggest more efficient way ? Example: File1: >Seq1...
I have some nokia mobile models with some offers. There are two objects, one for nokia models with price, another one for offers. For example I have offers for these two models: "brandname": "Nokia" "model":"Lumia" "submodel": "Lumia 735 TS" "brandname": "Nokia" "model":"Lumia" "submodel": "Lumia 830" My expectation is...
I wonder if there exists a shorter/more elegant functional programming way than listing all the possible cases. Here, a function that determines positions of beginning/end of subintervals greater than threshold is coded. The idea behind the listed code is to mark and retain the beginning of such an interval, then to pu...
I got a function that has as input 2 strings, computes the string similarity of all the combinations and give back and output the highest similarity. For example, "you are" and "are you" will have 1 as similarity value. import itertools from difflib import SequenceMatcher import numpy as np def _compare_names(a, b): ...
I had done this program that takes an input from STDIN and processes it to check if it is a Latitude/longitude combo or a place's name. Then it uses geocoding and returns an address corresponding to the latitude longitude or returns a latitude and longitude if the input is an address. I am using Nomatim, I would like t...
In a web application I'm working on I have a class that Map objects to other (different) objects. It is implemented with something like: public interface IMapper { object Map<T>(T item); } public class Mapper { private static ConcurrentDictionary<Type, Delegate> cache = new ConcurrentDictionary<Type, Delegate>...
I built my portfolio page using Bootstrap and jQuery, but on lower performance computers the animations seem choppy. I am interested in JavaScript optimization and was hoping you all had some ideas on how to more efficiently execute my code. You can see it live here: bgottschling.github.io. HTML: <!DOCTYPE html> <html ...
I have just wrote a linked list implementation of disjoint sets in Java for the Rainfall Problem. Can you take a look and tell me if there is something missing and also make a judgement in performance? public class DisJointSet<E> { int rank; DNode<E> head; DNode<E> tail; public DisJointSet(E data) ...
I use a lot T4 templates and want to avoid extra code writing when it could be generated. Currently I have following class: class Recursion { private readonly string _function; private readonly Func<int, string> _appFunc; public Recursion(string function, Func<int, string> appFunc) { _function ...
I have posted a discussion on Math.SE regarding visualizing the complex space and effects of factorization methods on that space. A quick link to the paper is available here. I have 3 routines in that paper, the first is the complex space generator. It works, but it is very slow and would appreciate any suggestions ...
I'm writing a script that can grep the rows and columns from a text file that match a regex. I have an implementation but I'm looking to make it more elegant. input.tsv a b c d a 2 9 6 1 b 6 4 7 0 c 3 7 2 0 d 5 ...
I'm learning Clojure and I'm doing a little thing that reads direct messages from Twitter using twitter-api wrapper. The code doing that is below. (ns twitterbot.my-twitter (:require [twitter.oauth :refer [make-oauth-creds]] [twitter.api.restful :refer [direct-messages]] [clojure.edn :as...
What would be the most elegant way to refactor the following method? public void AddOrUpdateDesignCVT(DesignInformation designInformation, CommonTransformerProperties commonTransformerProperties, SecondaryWindings secondaryWindings, Ca...
This code basically calculates a few metrics based on numerators and denominators and then it bins the data into quintiles. This is a common operation that I perform for various data sets. My issue is that I always have to rename the metrics and columns. I have a feeling that I could create functions to make this more ...
I have my class DBFuntcions containing this 2 methods: The method for the connection to the database: Connection connection_db(String username, String password, String dbname, Connection c) { try { Class.forName("org.postgresql.Driver"); c = DriverManager.getConnection("jdbc:postgresql://localhost:5...
I'm trying to benchmark two variations of one of my functions. Namely, these functions are for displaying integer values on the command line. The first of these uses my own implementation and prints from high to low, this is it actually determines the first digit to print and prints it, in contrary to the second method...
I've figured out a way to switch threads in the middle of a method. The benefit of that seems super obvious to me: that's what everyone wants to do anyway, and splitting up methods, using callbacks, or lambdas, or whatever is just code bureaucracy to make it work. But if this is so obvious to me, Microsoft guys probabl...
I wrote this for a problem in one of the online contest at hackerearth. Problem statement is: Input: The first line contains the compressed string in form a2b4h5a2 Expanding it means aabbbbhhhhhaa. You have to sort the expansion in increasing order(a-z). ie. aaaabbbbhhhhh This is followed by Q that indicates the numb...
This selects a random student from a class list, stored in a .ss file: from Tkinter import Tk,Button,StringVar,Entry,Label import random, tkFileDialog, tkMessageBox root= Tk() root.wm_title("Random Student Selector") current=StringVar() kids=[] addKidName=Entry(root) def addkid(): kids.append(addKidName.get()) addK...
I got this basic script which I'll be using to check if the answer is right. The only problem is that I'll be using with many forms. That's why I need this code to be more like DRY code. function checkAnswer() { var answer = document.getElementById("answer").value; if (answer...
I need a LinkedList but unfortunatelly the one that the .NET provides didn't have the functionality I was looking for (not working with linq and the LinkedListNode is sealed). I created a replacement that works similar but is linq-compatible. The main class is a LinkedObject<T> that might be used on it's own but is bet...
Background For a piece of software that I need to get extensible, I wanted to design a simple compile-time "plugin" system in C++. My use case was that the program (actually a library) can accept several input formats at the same time according to a requested interface version. There is a factory that selects the right...
I've solved The trip from Programming Challenges. My solution suffers from lack of floating-point precision, though. The problem: Your job is to compute, from a list of expenses, the minimum amount of money that must change hands in order to equalize (within a cent) all the students' costs. Input Standard input...
I was wondering if there are any significant improvements that could be made in order to make the program more concise or efficient, particularly in the findmatch function. However there is a catch: I cannot use strings or array notation; working only with chars and pointer arithmetic. In short, the program accepts tw...
This is my implementation of Conway's Game of Life in Python. Now since I am a novice coder, naturally I have some key doubts: The usage of idioms and code redundancies - Are there any small fragments of the program which can be better written? The usage of sys.argv - Is my usage of system arguments acceptable? Eg: $ ...
So its a class that lets you make a 'Screen' which is a n x n grid of chars. Your able to move a cursor by chosing the row and which column in the row and using that you can insert into into that place and change the char thats there. #ifndef Screen_h #define Screen_h #include <vector> #include <string> #include <iost...