instruction
stringlengths
71
71.9k
The following code is an implementation of heapsort on an array public static void heapSort(int[] inputArray){ /* Creates an array A which will contain the heap */ /* A has size n+1 to allow 1-based indexing */ int n = inputArray.length; int[] A = new int[n+1]; int temp = 0; /* Copies the array...
I'm pretty new to C# and have decided that I wanted to make a program that calculate the multiplication table of a selected number to practice on loops etc. I'm pretty satisfied, but I wondered if there is anything I can do to make the code better and more concise. using System; using System.Collections.Generic; using ...
I am trying to learn how to tell if my code will be better off creating a class as opposed to using many functions. I am a new Python programmer trying to get the hang of when classes should be implemented. Determines whether the username is valid or invalid: def is_good_user(user): is_user_good = True if user ...
I'm making a game in Java with LWJGL and I just implemented jumping. I don't really think the code is particularly well written or very efficient. Here is the code of my Camera class: public void startJump(float height, float land){ jumpHeight = height; jumpLand = land; if(!falling && !jumping) jump...
I'm working on a random number guessing game. I'm done with the code and it's working, but there is a part that I want to make better. I declared an instance of a Guess class I created, and now how to make this part more efficient. int counter = 0; do { myGuess.UserGuess = GetUserGuess(); //read user...
I am relatively new to the Qt framework and I was wondering if I should delete pointers in my program. I know that, in C++, if memory is not return it could lead to memory leak, but I am not sure if the same applies to Qt. #include "mainwindow.h" #include <QApplication> #include <QTextEdit> #include <QPushButton> #in...
I'm more of an IT guy (no CS course) with a strong and passionate relationship with Unix and I love KISS. I'm writing an application to help my coworkers with their daily tasks. Every now and then I get request from coworkers to add functionality to help them. Most of the time I will turn an Excel spreadsheet to a form...
This code counts the number of nodes between any given two nodes in a circular linked list. Any feedback is appreciated: public class CountNodesBetweenTwoNodes { Node first; Node fifth; private class Node<Item> { Item item; Node next; } public static void main(String[] args) { CountNodesBetweenT...
I'm doing a lexical analyzer for my programming language and I don't know if I'm doing it right. Can anyone can help me with this or suggest a better way of doing it? #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<ctype.h> #include<string.h> struct node { char character; struct node *link;...
https://github.com/exebook/dnaof I created this simple inheritance tool for JavaScript, could any one with deep knowledge in JavaScript prototyped inheritance review it? Here is the library itself: kindof = function(K) { function X() {} if (K != undefined) X.prototype = new K X.can = X.prototype return ...
I did an implementation of the Tonelli-Shanks algorithm as defined on Wikipedia. I put it here for review and sharing purpose. Legendre Symbol implementation: def legendre_symbol(a, p): """ Legendre symbol Define if a is a quadratic residue modulo odd prime http://en.wikipedia.org/wiki/Legendre_symbol ...
I've been a PHP procedural programmer for several years but I'm trying to learn OOP and I'm getting a bit confused with some patterns and principles. I would appreciate it if you could give me some tips and advice. interface LoginAuthenticator { public function authenticate(UserMapper $userMapper); } class UserAut...
I made a function which creates Bezier curves of grade n. What do you think? float interpolate(float n1, float n2, float prec) { return n1 + ((n2-n1) * prec); } std::vector<Vector2f> make_bezier(const std::vector<Vector2f>& anchors, double accuracy=10000.0) { if(anchors.size()<=2) return anchors; ...
I have two snippets of code that I would like you to look at. I can't figure out which of the two is most efficient (or better practice, if applicable). I'm currently finding the row and column of a sprite in a sprite sheet in order to render it to the screen; which works find and dandy. However, I now have two algorit...
I need to test my new functionality by sending about 100 requests in one time. public class MyTest { // ... @Test public void test() throws Exception { Runnable[] runners = new Runnable[size]; Thread[] threads = new Thread[size]; for(int i=0; i<threads.length; i++) { ru...
I have this Python program for calculating Leibniz of 'pi'. I am not able to shorten it more. Can anyone here optimise/shorten it? s,a,b=0,[],[] for i in range(int(input())):a.append(input()) for x in a: for j in range(int(x)):s+=pow(-1,int(j))/((2*int(j))+1) b.append(s) s=0 for i in b:print("{0:.15f}".form...
def printTrg(rows): r1 = [1] r2 = [1, 1] trg = [r1, r2] r = [] if rows == 1: r1[0] = str(r1[0]) print(' '.join(r1)) elif rows == 2: for o in trg: for a in range(len(o)): o[a] = str(o[a]) print((' ')*(2-(a+1)), (' '.join(o))) els...
For a very simple databaseless website, I'm using an associative array to store logins like this: $logins = array( 'user' => 'password', 'user2' => 'password2', ); I check login attemps using this code: $user = strtolower($_POST['username']); $pass = $_POST['password']; if(!isset($logins[$user]) or $logins[$user] != $...
I am using the following code for calculating ranking and it is working great for not large data. But when it comes to large data, processing time takes almost a minute. Please can anyone suggest a better way or atleast a faster way to put the same mysql statement? SELECT id, Names, TOTALSCORE, Rank FROM ( SELECT...
As part of learning C++, with special emphasis on C++11, I wanted to implement the equivalent of Boost's Variant (located here). My code is available at variant.hpp, with the current version given below. How can std::aligned_storage be used portably? My current solution makes probably non-portable use of static_cast,...
I hacked together this little query on the Data Explorer The query finds questions where an answerer has posted two or more answers (which in itself is not necessarily a bad thing), it gives you the link to the question, information about which user posted the multiple answers, and how many answers by that user that wa...
I wrote a little command line nerdy game, which helps you learn the basics of binary numbers. I would be happy to hear your comments: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define CHARSIZE 10 void printbitssimple(int); void createbitshape(int, char[]); int guess_num_from_binary(...
I'm learning Python (coming from Java) so I decided to write KMeans as a practice for the language. However I want to see how could one improve the code and making it shorter and yet readable. I still find the code rather long. Also if you have comments regarding conventions or proper practices, I would really appreci...
I've been doing a simple implementation of a to-do list to learn how to use Knockout.js. I would like a general review of what I've done so far (not much). It's my first application in JavaScript and I've never been very good at Html and CSS, so feel free to give a lot general good things to do, or not to do. My appli...
I am working through K&R for review and I thought that I would write some of my own routines for conversion of binary strings to int and int to binary string. I realize this is reinvetning the wheel; I am just doing this for fun. Also, I am attempting to follow this coding style CodingStyle.txt. Any and all critiques a...
Looking at the code, is this a proper example of encapsulation? additionalComputer.php (class) <?php /** Counts up the Number of Additional PC Options * and stores them into an array then sends them to the view. */ class additionalComputer { protected function displayMenu() { $addtpcs= []; ...
I want to have a like system on my website on multiple pages like "news", "comments", "forum posts" etc. So I was wondering what was the best way to do it between: having like tables for each of my "modules" (news, comments...) having one table like : table: likes id (int) | page_id (varchar) | user_id (int) which wo...
For CS class, I had to reverse the digits of an integer from the input. This is my solution: System.out.println(new StringBuilder(new Integer(new Scanner(System.in).nextInt()).toString()).reverse().toString()); My main question is this: is this too golfed? Obviously I could simply add whitespace and comments, but is t...
I'd already asked for my code to be reviewed earlier here First Chess project) Full code Considering the suggestions put forth for that question, I spent a day and refactored my whole code. For those who have seen my previous question/code, could you you point out anything which I have as of yet not improved upon? For ...
I've been trying to understand the original MVC implementation (the Xerox Parc's one). I'm sure it has flaws, but it's simple code to practice/learn the original MVC. Working example View (index.html): <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Person</title> </head> <body...
I was just writing code, and wanted to make a piece that removes everything after the character ? if it's found within the URL. if (strstr($url, "?")) { $url = strstr($url, "?", true); } Can I make this any shorter? It doesn't feel right to type the "same thing" twice with strstr.
I've two working ways to do so, but which one should I use? Common part: var textarea = document.getElementById("textarea"); First way: function updateStatusBar() { var text = textarea.value; statusBar.value = "Words: " + (text ? text.match(/\b\S+\b/g).length : "0") + " Characters: " + text.replace(/\s/g...
Can anyone help improve the performance of my query? When I run it, it locks the database for 5 to 10 minutes. SELECT u.username, u.email, u.created_at, p.firstname, p.lastname, p.address, p.address_2, p.city, p.country, p.state, p.zip, p.phone, p.phone_...
I've recently made a set of interfaces/classes to work with converting a spreadsheet into an object but I utilise an empty interface in my design: I have my interface which defines what a spreadsheet object should have: public interface IParsedSpreadsheet<TEntity> where TEntity: IParsedRow { int Columns { get; set;...
I was assigned the task of copying some subsums from a given EXCEL-Sheet into the executing EXCEL-Sheet. This had to be done with an EXCEL-Macro, so non-programmers can easily use it. There was the need to compare the final sum of copied values to the sum of values in the given sheet, as it's about business critical f...
I am creating a service (FaultTolerantCommunication) that wraps a call to a (web) service. Its responsibility is to switch the endpoint URL in the event of a TimeoutException. Currently the web service is a soap web service but I am attempting to make it reusable for other remote services such as a JSON based web servi...
I wrote this simple HTML parser in Ruby. Basically I have a folder that has files. Every file has crawled web pages. The only addition within these files is before the HTML content there is a page metadata, #URL is one of them. What I am aiming is to have two files: 1)Will contain: currentURL, destinationURL, descripti...
I've implemented PeersContainer class with all operations that I need. I need something like multimap in concurrent environment, moreover I need remove entities automatically on timeout. So, I decide to use Cache<Long, BlockingDeque<Peer>> combined with Striped<ReadWriteLock>. Also I use two caches which can transfer...
I have a module (in file dialect.rb) defined as such: require 'dialect/generators/elements' module Dialect def self.included(caller) caller.extend Dialect::Generator::Element end def self.version "Dialect v#{Dialect::VERSION}" end end Then I have the file dialect/generators/elements.rb, which looks l...
I use the following code <div><?php echo $obj->text; ?></div> in while loop. Is this the best way? Is there a better way, either to optimize or replace this code? <?php $akhbarkotah1 = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10"); $akhbarkotah1->execute(); while...
C++11 is great. Probably one of the most beautiful features (in my opinion) is the so-called range-based-for-loop. Instead of for ( std::size_t i(0); i < range.size(); ++i ) { // do something to range[i]; } or for ( Range::iterator it(range.begin()); it != range.end(); ++it ) { // do something to *it; } or simp...
I am looking over some existing code (see below). The problem of grouping in the same place the presentation logic of some fields (like price, currency) was solved as extension methods on int, double, and so on... I do not really like this. What do you think? How could it be done more elegantly and even unit testabl...
This function updates the user last login date on the user collection. I guess there are too many brackets and much spaghetti. How can I shorten this code? (function () { 'use strict'; var database = require('mongodb'); var util = require('util'); var constants = require('../constants'); var dbh...
Here is my code: $sql = <<<END Select Sum(p)/Sum(w)*100 as present FROM attendance group by month END; $query = mysql_query($sql) or die($sql . ' - ' . mysql_error()); $names = array(); while ($row = mysql_fetch_array($query)) { $names[] = $row[0]; }
I have created a PHP login system based off of this site. My main concern is: Is it secure? I chose that because to me it looked secure, but a 2nd or 3rd opinion never hurts. The idea of the project is to have something I can just pull into a new project directory and start off from there depending on my needs so it s...
To learn Python, I've been working through Learn Python the Hard Way, and to exercise my Python skills I wrote a little Python Hangman game (PyHangman - creative, right?): #! /usr/bin/env python2.7 import sys, os, random if sys.version_info.major != 2: raw_input('This program requires Python 2.x to run.') sys...
I'm working on a WPF app which uses ReactiveUI and Rx, there's part of the workflow that watches two data sources (ReferenceData and PredictedData properties on a View Model) and an area of that data source (FocusArea property) which is used to show a line graph of that data. Sometimes there can be a lot of data (an...
In an effort to reduce the images being used on the page, I've manipulated box-shading, etc. to make a "vector" looking monitor/ipad look. This is great and all, gets the job done, however, seems there is still a large load draw on the box-shading rendering. Is there a better method or tweak to this method that would ...
I'm working through some exercises to sharpen my Ruby skills. The following code is how I solved this particular question. I'd like to know what other developers think of this solution. I'm self taught, which means: I'm not getting any feedback as I learn, so I just want to make sure that I'm learning the right way to ...
I use the following code: fetchAll and for($mich=0;$mich<10;$mich++). Is this the best way? Is there a better way, either to optimize or replace this code? <?php include("cache/phpfastcache.php"); phpFastCache::setup("storage","auto"); $cache = phpFastCache(); $products = $cache->get("product_page"); if($products == nu...
I'm new to PHP security and have made this login file: <?php header('Content-type: application/javascript'); $hostname_localhost = ""; $database_localhost = ""; $username_localhost = ""; $password_localhost = ""; $salt1 = ""; $salt2 = ""; $localhost = mysql_connect($hostname_localhost,$username_localhost,$password_l...
I submitted this problem for an interview, and I was wondering if I could have done better. My solution works, and I solved in about 12-15 minutes. I feel like I did a bad job with the code. Please be honest. Here is the question: Given a non-negative number represented as an array of digits, plus one to the number...
I wrote some Python code to solve the following problem. I'm curious to see if someone else can find a better solution, or critique my solution. How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in O(1) time...
I have a function that reads a string like this (AnimalCount+HumanCount) and the result of this function is an array of strings [ "(" , "AnimalCount" , "+" , "HumanCount" , ")" ] Now, I have done 2 functions in order to do this: The first one to check if a given char is "special" from the input string function Valida...
Here's a novel-length summary of the issue: I'm trying to write a VB.net program to help me collect remote site statistics from system-generated logs, but I'm a little like a carpenter who only knows how to use a hammer, and my project has turned into a bit of a monstrosity; as embarrassing as my code is, I would reall...
I've been reading Types and Programming Languages and I wanted to try to implement the first language in Haskell to understand it properly I have barely written any Haskell before and not used Parsec so I would grateful for any feedback on this code Here are some specific points I am unsure about Is my main function s...
I want to write code that does backward stepwise selection using cross-validation as a criterion. I have only started learning R a month ago and I have almost zero programming experience prior to that. Hence, I would appreciate any comments on the code. (I understand that there are issues with the backward stepwise sel...
I am a relative beginner to Python and as such I've been working on little things here and there in the office that strike me as something interesting that might be fun to try and code a solution. Recently, I was working with some cell phone data and decided to write a little script that would triangulate a cell phone ...
I'm trying to parse a CSV file into objects. I've already got a very efficient CSV parser (SuperCSV). The problem arises when trying to create the object with the data that is being read out. I've got a nested foreach that iterates firstly through a map (that represents a CSV row) and then through each key within the ...
My first crack at clojure... if you have time to provide input, I'd appreciate it. I'm as much interested in style as proper usage. I'm just getting started. The task to start with an vector of N zeros, and then "scramble" it by: Select 2 items in the vector. If one is less than 4, and the other is greater than -4, inc...
I've created this thin wrapper class for a socket project that I'm working on. Can someone review my class and give me some points on if I'm on right track? #include <iostream> #include <WinSock2.h> const int MAX_RECV_LEN = 8096; const int MAX_MSG_LEN= 1024; const int PORT_NUM = 1200; class Sokect { private: ...
This seems a bit redundant to me, but I'm not sure of how else I might be able to write this. Normally I'd use a switch statement, but I don't think that'll work here. I realize I could also do this in a for loop, but the main heart of the question is what's inside the loop itself. "arr" is an array, just in case it...
Can I make this program that extracts text data from a file (size in MBs) even better performance-wise? I need to reduce the execution time. import java.io.*; public class ReadData { public static void main(String[] args) { FileReader input = null; BufferedReader br = null; try { ...
Goal: Create a combination of emails based from inputted first name, last name, middle name, and a domain. Add in common separators. Then I'll check which one is correct with the rapportive API. This is the first part of the bigger script. If you are given the string variables {fn} {ln} {fi} {li} {mi} {mn} How would y...
I would very much appreciate a general review of my PHP code which grabs information from a mySQL database and also inserts some information into the database. Overview : Users go to /main.php and answer math questions. The 20 math questions are pulled from the database. The answers are pulled at the same time but the...
I noticed, that accelerometer and gyrometer sensor data tend to have problems. The gyrometer is not very precise and the accelerometer is getting problems with vibrations. I built a quadrocopter (to be honest more then one). My first one had a poor frame and the motors (very big ones) were vibrating a lot, because the ...
I am making a PHP script which fetches the data of the emails whose sending date and time has been reached and then send emails to those records. I am following the steps below and integrating it in an API, that is. GitHub code Steps: Get the communication records whose time has reached. Run the loop of above and get...
I was a PHP developer and I started writing a product in C# without studying the basic structure. Now, I have around 100+ views with similar code. After 1 year into development, I now realize that something is not right. How can I separate the server tags when they are so intertwined in the code? Is it okay to use serv...
Is it possible to simplify the code below? dynamic model = GetExpandoObject(); //model type of ExpandoObject var result = model.FirstOrDefault(x => x.Key == "node").Value; if (result != null) { result = ((ExpandoObject)result).FirstOrDefault(x => x.Key == "children"); if (result != null) { result...
I have a script that sends multiple commands after logging in a remote machine via SSH. Problem is, it's barely readable. I've tried quoting everything with "", but it's terrible (everything appears in pink), and here documents are just as bad (everything appears in gray). I'm using Gedit as an editor, but I tried Emac...
I sent a PR to a repo the other day and want to make sure I have the right idea for URI validation. function validateURI(files) { //... // files can be either a string or an array of paths // validates the relative path exists or is an http(s) URI // returns a filtered list of valid paths // (e.g.) ...
According to my lecture notes, there are benefits to refactoring the code from original code to refactor code. Reasons for refactoring: Replace Temp with Query You are using many temporary variables to hold the result of an expression This can result in long methods, since the (temp) values are available only in ...
I have multiple models which all have the same functions in my framework. I decided to create one "parent" model and all of my other models would extend and inherit its functions like this. My other models would be like this: class Games_model extends MY_Model { protected $table = 'games'; protected $_default_...
Can someone help me further optimize the following Cython code snippets? Specifically, a and b are np.ndarray with int value (range(256)) in them. They are one dimension arrays with dynamic length. resultHamming is a one-dimension array with float value in it (dynamic length). bits is an int list (size 256). The fun...
I've decided to make an implementation of the C++11 class function. I was checking that I have done everything correctly and have not missed anything: template < typename > class function; template < typename _Ret, typename... _Args > class function<_Ret(_Args...)> { public: typedef _Ret result_type; typedef f...
I started to learn PHP OOP recently and searched the web for some practical exercises and I found one that said to build a select input that is generated and populated with options by the object. I just want to ask for some opinions on code quality. Could it be done better? What is the biggest flaw? The class: clas...
I'm writing a pretty complicated piece of UI with angularjs. I've been using angular for about 2 weeks. I'm going to post the controllers I feel are the most confusing to read, and am wondering the following: Could these be more "angular" (done in a more angular way?) Is it normal to have this much logic in controller...
I'm learning Ruby and working through some exercises. I completed the following exercise without truly understanding why and how it works. I know that's an embarrassing thing to say but I feel like my subconscious mind wrote the code and conscious me (or maybe unconscious me you could say) is having trouble understandi...
I'm interested in optimizing my code. Can someone help me understand the best way to trim this code down with DRY methodology? So I've got these two classes here preforming WMI queries on two separate Win32 classes. My questions are: Should I keep them separated in different classes based on the Win32 class for organi...
I have a checking function that checks the correct type for a class Check_Annotation, I was wondering if there is a better way to implement this, my current code right now is: def _check_list_or_tuple (self, param, annot, value, check_history): assert isinstance(value, type(annot)), "AssertionError: 'x' failed ann...
I have an array of objects. Each object has two properties, id and quantity. I wrote a function to add an object to the array. But the function must check if the object already exists within the array. If it does exist the function must increment the quantity property. Otherwise it must add a new object. Is there an id...
This is a Windows service that will run on about 600 machines. It is used to track the job server that a user is connected to (pushed through some kind of load balancer, not my area). I store this information in a SQL table and want to make sure that I don't have any SQL leaks. this grabs information from the users c...
I have been trying to wrap my head around all the new options in ECMAscript 6 and to do this I tried to develop a simple setup which would allow me to place absolutely positioned <div>s on the page. main.js: import {Screen} from './objects/screen'; import {Position} from './objects/position'; var welcomeScreen = new S...
I need some advice to see if my simple Windows socket class is good enough to be used in a simple chat application. #include <iostream> #include <string> #include <Windows.h> class Socket { private: WSADATA wsaData; SOCKET hSocket; sockaddr_in service; std::string addr; US...
I will preface by saying that this data set is much larger than what I have here. I'm having to loop through an XML file to get data and display it on a site with jQuery. I have to use jQuery because I'm working within a framework that I can't edit so I'm having to manipulate the data after the fact. This is causing th...
I've been going through LPHW (learn Python the hard way) lessons and I am now at exercise No36 where I have to create a similar game. Could you please review it and point out beginner mistakes? from sys import exit inventory = [] ground = ['Bones', "Commander's Key", 'Security Code', 'Shipment Report'] turrets_activ...
I am initializing a PHP array as follows $newArray = array(); $newArray['2014-13-03']['SMD']['IMPR'] = 5; $newArray['2014-13-03']['SMD']['CLICK'] = 10; I just wanted to check if you think this is a wrong way to insert data into an array. It is working just fine, but I still wanted to check from an optimization standpo...
I designed a program that calculates the square root of a number using Newton's method of approximation that consists of taking a guess (g) and improving it (improved_guess = (x/g + g)/2) until you can't improve it anymore: #include <iostream> #include <iomanip> using namespace std; template <class Y> Y sqrt (Y x) { ...
I've been studying C# for about 6 months and am trying to make a simple example for an n-tier application. I want to learn to do things in the most proper and professional way. This example uses a table in the database called "Settings" where various application settings can be persisted to the database. I figure once ...
Here is my solution to this problem; please be brutally honest/strict, if I would have written this code, in a 45 minute interview, what would you think? (I am aiming for Google,Facebook). Here is the problem I solved: *Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If...
Here is my attempt at the UTTT code-challenge (in response to the the Weekend-Challenge Reboot). Here is what I would like critiqued: I tested the code a few times for bugs, but I may have missed some. I feel like I have duplicated code in some places (with only minor changes being the difference), refining them down...
I'm trying to do a SPOJ problem called twosquares where you check whether the current number can be obtained by adding two squares together. However, I'm getting a "time limit exceeded" message. I'm creating a Sieve of Eratosthenes program. If the number n is prime and n ≡ 1 (mod 4) then the number is a sum of two ...
I've decided to implement a simple smart pointer: #pragma once //simple and basic reference by Aldrigo Raffaele #include "Common.h" #include "Exceptions.h" class MemWrp { private: uint numref; public: void* content; MemWrp(void* content) { this->content = conten...
As part of my Java learning, I tried solving Part I of problem description here. The only issue that I see now is that I could not close the button of Frame. Please review and provide your comments on coding style/OOPS aspects. Ocean.java /* Ocean.java */ /** * The Ocean class defines an object that models an ocean ...
I'm using this JS to sticky website footers at the bottom and I would like to know if is there anything to be optimised? (function($, window, document){ //Screen_height = Header_height + Main_Content_height + Footer_height + alltoplvlContainersMarginTop_Bottom + alltoplvlContainersPaddingTop_Bottom $.fn.sticky_...
I've tried to write my Property Container design-pattern implementation. Could anybody, please, tell me, if this code is really what I intended to write (follows the Property Container design-pattern rules)? Is there anything that can be improved? <?php class PropertyContainer { private $PropertyContainer = array(...
import java.math.BigInteger; import java.util.Random; public class Primetest { private static int size=15; private static Random r=new Random(); private static BigInteger two=new BigInteger("2"); private static BigInteger three=new BigInteger("3"); public static void main(String[] args) { ...
I am using knockout in my project. I have some models like EmployeeModel, ServiceModel etc which user can update. On UI I give the user a Cancel control button by which he can revert the changes. On cancel I have to revert the model change back to its original state. For this I found these two good approaches by @rniem...
I'm hoping this is the correct place for this, I'm struggling a little for wording as i'm not sure what you would call this. Basically, i have a system in place where my datagrid marks cells that have changed with a new background colour, to do this i have a method in the object that contains these properties that rece...
I tried to make a weighted search function in JavaScript. I've been improving my JS lately but still not sure about some best practices, wondering if there's any improvements I could make, or if I've ended up doing it completely wrong. The intention is to keep it quite flexible so it can take an array of filter functio...