instruction
stringlengths
71
71.9k
How can I improve this code? public virtual HttpResponseMessage Get(int pageNo, int pageSize) { pageNo = pageNo > 0 ? pageNo - 1 : 0; pageSize = pageSize > 0 ? pageSize : 0; int total = repository.Table.Count(); int pageCount = total > 0 ? (int)Math.Ceiling(total / (double)pageSize) : 0; var entit...
I would like to have a review of this basic CRUD application so I can improve and learn from your experience. The code can be found here. Design pattern/coding principles improvement that could be used Exception handling Readability Coding best practices ProductManager.java public class ProductManager { privat...
This is my first template implementation. I'm trying to learn C++ and Algorithms. Any constructive criticism on code quality, readability is welcome. Everyone has their own style, but there are certain rules which all good programmers should follow. Kindly remark as to if I have followed those and what rules are missin...
I've got a complex object tree that I need to instantiate. The object tree is a bunch of specialized classes that don't have a common root object (other than Object) and has generic objects (that I need to configure), and custom objects (all the "My" classes in the example code). I've created the factory below to encap...
Here is some of the code in my library. If there any inefficient things in my code, let me know. UPDATE: The following code is deprecated. All of your fixes have been incorporated. The project now lives at InitializeSahib/Inverse InverseAPI.cpp: // InverseAPI (Cobalt) // Developed by Sahibdeep Nann (@SahibdeepNann) // ...
I'm looking for a code review on a class that I've written. It was my first attempt at lockless programming and I'd love any feedback I can get. #pragma once #include <atomic> #include <thread> #include <memory> namespace Pro { namespace Util { /*! Thread Safe Lock Free Pipe */ template...
This question contains some C# code I've written as well as a XML format I have designed. My C# code runs a series of "jobs" by loading the XML file and then calling different SQL stored procedures and E-Mailing the results to different addresses. My question specifically relates to the C# code to parse the XML documen...
This code hides a message in an image by altering the blue values in the top left part. This is just for fun as I think it would be easy for a cryptographer to find and decrypt this. Original With message We will meet at London bridge at dawn As you can (cannot) see, as long as the message is short enough, the naked ...
I am a new guy to Java. I want to find the longest sequential same character array in a input character arrays. For example, this character array: bddfDDDffkl The longest is DDD. Next example: rttttDDddjkl The longest is tttt. I use the following code to deal with this problem but I want to improve my code. Could you...
I'm getting myself acquainted with Rust and decided to implement the classical overlapping intervals problem. Here is a statement of the problem: Given a collection of intervals, write a function that merges all overlapping intervals and prints them out. For example, given [1, 3], [2, 6], [8, 10], and [7, 11], the ...
I'm learning python and I have written a bank program incorporating all the skills I've gathered so far. Using the program, one can create user profiles (name, password, account balance) which will be stored in three different text files. One can then do the normal bank transactions: deposit, withdraw, check balance or...
I have written VERY simple code that converts a string to a character array and then displays the ASCII value of each character. Let me know if this is the most effective/safe way of doing what I described above. #include <iostream> using namespace std; int main(int argc, char *argv[]){ //Declare Variables. ...
Inspired by MATLAB's tic/toc I've written a short helper function for calculating execution time. from time import time def tic(): """Simple helper function for timing executions. Returns a closure that holds current time when calling tic(). Usage: toc = tic() //some code print(toc()) """...
My project manager is saying that there are many bad things in my code, but they are not helping me to correct it. Can you please specify the bad things they mean? I have 7 projects in my solution that work together to save a role to the database. Here are the details: Project - 1 - Object Model(Class Library Project) ...
Now I have this C implementation of the famous algorithm: dijkstra.h: #ifndef DIJKSTRA_H #define DIJKSTRA_H #include "directed_graph_node.h" #include "weight_function.h" #include "list.h" #ifdef __cplusplus extern "C" { #endif list_t* dijkstra(directed_graph_node_t* p_source, directed_graph_node_t*...
As part of an online course exercise, I was supposed to implement Merge Sort in C. Pointers were still not discussed prior to this exercise, so I have to work with arrays. Memory efficiency is not something I'm supposed to be focused on. #include <cs50.h> #include <stdio.h> #define DEBUG void getArray(int[], int); vo...
I have a graph represented as an adjacency list. I need to find a triangle in this graph. A triangle is a triple of vertices u, v and w, such that (u, v), (v, w) and (u, w) are edges of the graph. The graph does not necessarily needs to be undirected. I found the following pseudocode for solving the problem: function c...
Recently came upon this question asked in interview with major tech company. Implement Java's next and hasNext function in your favorite programming language. Here is the solution I came up with. I am not sure whether next() is implemented correctly. Here is the iterator documentation. #include <iostream> #include ...
I wrote this for a CodeWars challenge while trying to learn ECMAScript and would really like to have some advice on how it could be improved. What I don't like about this code myself, but am unsure on how to improve: I didn't yet found a way to have a class in ECMAScript that mixes public and private methods in a way,...
Exercise 1: skips :: [a] -> [[a]] The nth list in the output should contain every nth element from the input list. For example, skips "hello!" == ["hello!", "el!", "l!", "l", "o", "!"]. The question UPenn Homework 3: skips function and it's associated answers inspired me to write a solution in Javascript. I used ...
It has been bugging me for a while that while I understand how the basics of Brainfuck works, I can't get a firm grasp on the advanced features of the language. So I started to re-evaluate what I know about the language from the ground up. Brainfuck's memory consists of a tape of cells. Every cell can be modified by po...
Given a text, this program will output a Brainfuck program, that when executed will print the text back. Writing Brainfuck in this style to print a sentence is pretty straightforward. Iterate over the sentence and do the following per character: Calculate the difference between the current character and the previous ...
I use the module os specifically for Windows since I am familiar with Batch. Batch alone didn't allow me to execute more complicated mathematical functions, I began to use Python. import os import math os.system('cls') os.system('') os.system('color a') os.system('title Quadratic Equation Solver') #This is used for pr...
I'm writing a little script that encrypts a file using the user's SSH identity. I read the RSA private key from ~/.ssh/id_rsa (default) Use the private key to encrypt a random 32 byte symmetric key (PKCS#1 OAEP) Encrypt a stream of data with AES-256 in counter mode (no extra padding) Write all of this to the output st...
When writing this code I found myself getting more and more complex. When I got to the solution I trimmed the excess parts I'd thought I needed from before, but didn't actually need. The example of wc.c had some definitions for IN and OUT. Why didn't I need those for writing this example? If there are any bugs or impro...
Now I have this implementation of A*. Basically it is the same as the Dijkstra's algorithm in my previous post, yet I bothered to make it more cohesive by making functions for handling all the state data structures. astar.c: #include "astar.h" #include "directed_graph_node.h" #include "weight_function.h" #include "unor...
I have written the following code, and so far in all my tests it seems as if I have written a working Mutex for my 4 Threads, but I would like to get someone else's opinion on the validity of my solution. typedef struct Mutex{ int turn; int * waiting; int num_processes; } Mutex; void enterLock(Mutex * loc...
I am developing a form on bootstrap, and I'd like to know if what am doing is best practice and a clean code or not. Here's a form I'm working on, please help me make it "clean code". <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/cs...
I made a tower-defense game in Python with Pygame called "Bunny and Badgers". You're a bunny and must kill the badgers before they come into the castles. You can use W, A, S, D and the arrow keys to move around and press a mouse button to shoot. You can also use a joystick to control it. The game dures 1 minute and 30 ...
Textbook style program that generates the values of two, six-sided dice; which are used to perform simple calculations. Recently, I saw an example using similar criteria that was able to utilize 360,000,000 rolls. However, I have not been able to initialize an array or vector containing more than 100 million elements. ...
I am not sure how to properly make this readable. I have been trying to find examples online but I cannot find any that are specific to this simple program. import java.util.Scanner; public class KifahUnit3 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); String ...
Introduction I wrote three functions that aims to log errors and exceptions as well as show a user a generic error page. Would appreciate some feedback on it with regards to the PSR standards and if I have left out anything of value. Memory issue: I am aware that the memory issue has not been addressed in this code, i...
Many Brainfuck implementations I've come across generally are obtuse, verbose or over-the-top. But I've always seen Brainfuck as "easy to implement", especially for beginners. My original need for this was to be able to have an actual Brainfuck "machine" that executed instructions to aid with code generation. However, ...
I'm having troubles with a coding problem. Yes, I need to write a C++ program which sorts dates. I've tried several methods. Using 2D arrays and now parallel arrays. The problem I have with my parallel array to keeping tract of those which haven't been sorted yet. That is the YYYY has been sorted. I need to keep track ...
Following up on CommandBars, Buttons and Commands: Take 2, I've refactored quite a lot of the Rubberduck code base (like, a whole third of the entire code base has been affected), and successfully untangled the RubberduckMenu and gave each command its own place to be. So, "Shared" commands that can be executed from the...
Interactive Wandbox example Inspired by this Stack Oveflow question, I've implemented a function that, when called with a desired arity, a callable object, and a variadic amount of arguments, calls the passed callable object forwarding the passed arguments in groups of the desired arity. Example: auto printAll([](auto....
I converted a C# analyzer for removing empty argument lists from attributes to be a C# and VB.NET analyzer: public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(AnalyzeCSharpSymbol, CSharpSyntaxKind.Attribute); context.RegisterSyntaxNodeAction(AnalyzeVisualBasicSymbol, Vis...
I'm trying to dynamically create a table of input fields (two per field) that I will then send off to a Python script. Here's the expected behaviour: User chooses "manual entry," specifies rows, columns, of table, clicks button. Table is printed with two input fields per cell (e.g.: A(i,j), B(i,j)), user fills in all ...
I have an Android app with three different Activity classes. Each of the Activities uses and changes config and user-customization data stored in a wrapped SharedPreferences. The code could stand some refactoring, so I'm thinking that rather than have each Activity instantiate the SharedPreferences by calling Preferenc...
I wrote this .cmake script when I needed to make smallest possible executables. It makes CMake prefer static libraries, and adds custom command to strip and UPX the end result. I used it only with MinGW on Windows with MSYS2. My questions: Can this be made more short and readable? Are my checks portable enough? Any wa...
It works, but I'm sure there's a lot of improvement I could make here. I didn't try to get it to work for words over 10 characters in length, and I also didn't want to use built in properties like .length to do the work for me (I don't know why, I just wanted to figure out how to do it on my own). #include <stdio.h> /...
I was trying to write an iterative search function for my Ternary Search Tree class based on a pseudo-code, and now it seems to work, but I think it can definitely be improved. def search(self, key: str): return TST._search(self.root, key) @staticmethod def _search(node: TSTNode, key: str): """Note that node.k...
Just decided to make a quickie Fibonacci Sequence via jQuery and I was wondering if anybody can think of a faster way to interpret it? I can type pretty much any number in and it returns in a fraction of a second. Can anybody think of a quicker method to calculate a specific Fibonacci number? http://jsfiddle.net/st9sgr...
This code is in a really early state in the lifecycle. I'm still in the process of implementing some core features, but nevertheless the code up to here works and accomplishes its task. I have no idea as to how well, though. This code is intended to give a dead-simple way of creating growable and shrinkable form conten...
I'm building a library for myself to use to store user passwords. The library itself shouldn't do the retrieval of data, but it should provide container classes for the data. I would like to know what I've done wrong in it, what could be improved and what's concidered a bad practise with passwords on the way I've done ...
This is a warm-up programming exercise for learning string methods in Python from HackerRank: You are given a string S. Your task is to find if string S contains: alphanumeric characters, alphabetical characters, digits, lowercase and uppercase characters. Input Format Single line containing, string S. Constraints ...
I have a class with 3 properties, and I would like to know how I can write my code better. I want to use Single.TryParse so that if any token is unknown string, I could still get 0. But using this method, I need to use a temp variable, and as my properties list increases, I will have more temp variable, and this is not...
Im looking to improve my search algorithm in my battleship game. Code is not perfect but would appreciate any suggestions or recommendations. Running the simulation using a 100x100 grid (10,000 possible locations) Im averaging ~30% accuracy. Games played 500 Average = 0.31108 Im using a forward and backwards diagon...
I have created a brute-force algorithm class in C# and I was wondering if I could speed up the process of creating a new string. There are two methods inside the class: one returns the brute-force string and one returns the number of strings created. public class BruteForce { int IntPasswordsGenerated = 0; publ...
How should I rewrite an if-return-else condition in the middle of this function? def import_excel_to_database(xls_file_path) q_param = { report_type:report_type, item:product, exchange:exchange, product_exchange:row[0], date: row[2]} # timestamp_utc: row[2].strftime('%Q').to_i # if exsisted then return or continue...
Is it possible to remove the inner loop by assigning data.Data.Tables[0].Rows[i].ItemArray directly? object[,] arr = new object[52784, 21]; for (int i = 0; i < data.Data.Tables[0].Rows.Count; i++) { for (int j = 0; j < data.Data.Tables[0].Columns.Count; j++) { arr[i, j] = data.Data.Tables[0].Rows[i][j]...
This is actually an old 'problem' that I never really knew how to improve, but I'm wondering now if there is a better approach for this problem. I'm creating MineSweeper with Java and struggling with an OOP aspect of the game. Basically I have a class Square.java, SquareBoms(extends Square) and Field.java. My approach ...
I don't truly understand how OOP works and It's stopping me from creating good programs! Below I have a program that will check to see if there are 3 tiles from a gridview in a row. Here's a screenshot of the game. Basically you're not supposed to get 3 of the same colours in a row! But at the moment I've been adding...
I have a simple ASP.NET Web API project. Now I want to make all basic methods as asynchronous. I tried to do something, and it's working but I'm not sure that it was implemented properly. Please check whether I properly implemented async/await in my project. I had implemented methods like below in my repository: ...
Suppose I have a class of complex numbers called Complex and I wish to implement a class of generic matrices with transpose operation. doubles and ints don't require special care, but you have to calculate the conjugate of complex numbers to transpose. Therefore, I implemented a "specialized transpose()". template <cla...
Input A list of words separated by any number of spaces. Output A horizontal ASCII art histogram, where the n-th line is composed by as many asterisks (*) as the n-th word is long. Example usage The > signals user input, you should not input it when testing the program. > This is an example histogram of word length ***...
I have a uniform grid in this application. After resizing the window (when width < 300) it removes the right column from the grid, and deletes items. After reverting to the previous size (width > 300), it adds back the deleted column and its elements. But in my code I have two global variables public ObservableCollecti...
Here is a piece of code that draws superellipses: #include "std_lib_facilities.h" #include <iostream> #include "Simple_window.h" #define PI 3.14159265359 template <typename T> int sgn(T val); vector<Point> generateSuperEllipse(double CoeffA, double CoeffB, double expN, double expM, int centX, int centY, double prec...
This is a follow up post for this question. There aren't a lot of changes. The changes (all of them major) are: I've decided to ditch my previous approach using Math.ulp() and adopt Tim Leek's suggestion: comparing ratios. In my updated code, I calculate both ratios and ensure that their difference from 1 is within th...
[DataContract(Name = "jobDateTimeFilterRequest", Namespace = Constants.ManagementNamespace)] public class JobDateTimeFilterRequest : TimeFrame { [DataMember(Name = "jobType")] public BackgroundJobType JobType { get; set; } } [DataContract(Name = "timeFrame", Namespace = Constants.ManagementNamespace)] public c...
We were asked to make a triangular number pattern in C++ with minimum loops: ____1_____ ___2__3____ __4__5__6__ 7__8__9__10 Code: #include <iostream> using namespace std; int main() { int n=0, r=0, i=0; cout << "No. of rows: "; cin >> r; for( n=1; n<=r; n++) { for( i=1; i<=r-n; i++) { ...
Here is a naive implementation of a kernel density regression algorithm in Julia. The code works, but there is quite a bit of room for improvement though. First, there is not an optimal bandwidth selection implemented and second; it's really slow. Nevertheless, it took me a while to implement and I am really looking f...
I have a method in Python that is extremely slow: def patternRecognition(self): patRecStartTime = time.time() plotPatAr = [] patFound = 0 for eachPattern in self.patternAr: sim1 = 100.00 - abs(self.percentChange(eachPattern[0], self.patForRec[0])) if sim1 > 50: sim2 = 100.0...
I created a class which is some kind of thread pool. The difference is that it holds foreign threads. This means that the threads are created somewhere else and are then held by calling holdThread. Then another thread can call executeOne or executeAll to execute a specific function. At the end the threads can be releas...
Edit - here is my modified code: http://jsfiddle.net/#&togetherjs=GzytydCsRh Can someone take a look and give me some feedback? It seems a bit long still but that is the first time I used functions. I am reading a bunch of CSV files and using glob to concatenate them all together into separate dataframes. I eventuall...
This is a Python implementation of a stream cipher encryption algorithm. This implementation originates from the one displayed on the TI-Basic wikidot cryptography page. I am well aware that this code breaks the holy 80 character limit, so any suggestion on how to make the code more succinct would be appreciated. My ma...
An improved version Sieve32FastV2 is available. The classical solutions for the Sieve of Eratosthenes fall into 2 camps: one uses a bool[], which is fast but very memory bloated; the other uses a BitArray, which is more sluggish but uses far less memory. Refusing to accept that those are the only 2 possibilities, I’ve...
I wanted to use an async-cache to store URLs of images that I have to display in a list. The image URL is fetched (REST call) using a unique UUID associated with each item of the list. I store this URL locally and then use it to show images in the future. I came up with the following async-cache to make my life easier....
So recently I made a large project of mine open source: Khronos. I will be dissecting parts of it so that I can have it reviewed more easily here and so that the project as a whole will be improved. The first part I want to have reviewed is the CMake file involved with kicking off the building process of the project....
I'm writing a function that receives an array and returns an object with the count of unique values, pretty much like other questions here or in StackExchange. Except that in my case, this array may contain a nested array, like: var array = [1, 2, 'a', 'b', [3, 'c', 1], 'd', 2, 'b']; Here is my code: function findUniq...
This is a follow up of this post. Changes: I tried harder to make my code readable yet concise. All Point instances are immutable and unique. New, useful features have been added (like reflection, rotation, translation, etc.) This class depends upon this class. Line will follow soon. For the time being assume that Ou...
Here is a partial example of a text tokenizer. I'm looking for ways to improve one particular line in this code: implicit class textFile(val fileName: String) { def toDict() = { io.Source.fromFile(fileName).getLines.flatMap(_.split("\\\\r?\\\\n")).toList } } def filterComments(m: List[String]) : ...
As part of processing card payments, before even attempting to process, I need to check and validate the card number to make sure it's valid. For this, I've encapsulated this validation in a record called TCardNumber. It does the trick for what it needs to do, tested with a Visa card and an Amex card. Since this is a s...
This is a recursive algorithm implementation of Eulerian tour search. I guess there is no way to make it more efficient (except rewriting with loops instead of recursion). Any advice on style? def sub(visited, _cur, graph): if not graph: return visited + [_cur] for i, edge in enumerate(graph): c...
I have written a class containing methods to factor a polynomial equation using the p over q method. The method returns a string that is the factored equation. Here is the class (can also be found here): public class RPF { private RPF(){} public static String solve(int... a){ if(a.length <= 2){ ...
I'm working on a generic repository using EF 6 code first and trying to following the Unit of Work pattern. Unity is being used to inject my repositories, and I'm trying to get everything supporting Async. Here is my EF configuration + context: public class CustomDbConfiguration : DbConfiguration { public CustomDb...
Well, I've used some of the feedback from my last posting to improve how I wrote this program. Mainly using the void parameter in main, initializing my int array to zero without using a for-loop, and better naming of variables. If there are some issues that are going on with my code, or there's some things I can do bet...
For my second major project in C, I decided to write an implementation of the Vigenère cipher in C. My program uses command line options (optarg) and can read from both a file or from a string specified with the -s option. It does both encryption as well as decryption of text and also has error handling and I've list...
I'm relatively new to programming, and I've been wondering about a problem such as this. How can I think about decomposing the code into its constituent functions? I went the simplest route I could, just putting the formula in its own function. I believe this makes the code more readable, but there's also a part of me ...
I would like to write a function in C that turns all negative values into zeros then shifts the positive numbers to the beginning of the array, maintaining the order of the positive integers in the array. void shift_positives(int values[], int num_values) { int i; int last_zero = 0; int j; for (j = 0; j...
I am looking to improve my code structure. In this code it is opening all the links with ?pid= in the url. However, the structure of the code can be improved. for a in self.soup.find_all(href=True): href = a['href'] if not href or len(href) <= 1: continue if href[0] == '/': href ...
I use this document as a basis for my mini-library: Motivation The std::rand friends are discouraged in C++14, so we want: A direct replacement to the std::rand friends. Despite of the security issues, std::rand is considered both handy and useful as a global uniform random number generator. To expose the most wide...
Write a function that takes in two sorted lists and outputs a sorted list that is their union Could anyone help me to improve this code and make it more user-friendly? We are not supposed to use any built-in Python functions, but rather develop our own efficient algorithms. def answer(list1, list2): len1 = len...
I'm not sure whether my code looks good or not: var app = angular.module('Todolist', ['ngResource', 'xeditable']); app.run(function(editableOptions) { editableOptions.theme = 'bs3'; }); app.controller('TasksCtrl', [ '$scope', 'Task', function($scope, Task) { $scope.user = gon.current_user $scope.updateT...
This is a code I wrote to find all URL within a PDF file and replace the one that matches the ID that I passed as a parameter. It works as intended, but as I am a beginner on Java, I am sure there are some best practices that I am not following. I am using the PDFBox library. Here's the code: Main.java public class Mai...
I wrote some code to put stamps on all pages of a PDF file with the name and company passed as parameters. It works as intended, but as I am a beginner in Java, I am sure there are some best practices that I am not following. I'm using the iText library. Main.java: public class Main { public static void main(String[] ...
I created a C# console program to loop through a specific folder in Outlook to look for a specific email subject. When I run it on my computer (multi-core CPU), it didn't use up 100% of the CPU resources. But when I test it on the server (single-core CPU), it uses up 100% of the server's CPU resources. What can I do to...
I've written some method for sorting asc and desc numbers in array. All I want to know is this good logic, and is there a space for improving this code? -(NSArray *)sortHanded:(NSArray *)inputArray ascending:(BOOL)ascending { NSMutableArray *inputMutableArray = [inputArray mutableCopy]; NSMutableArray *sortedAr...
I have implemented Latent Dirichlet Allocation in Julia. Since the code is rather long, I copied the essential part here but the complete code can be found on GitHub. #= LDA.jl Adham Beyki, odinay@gmail.com =# ########################################## ###### Latent Dirichlet Allocation ###### #######################...
This is a contest problem. The entire description is here. In resume: The question gives a point simulating a light explosion that always has a negative x coordinate, a set of pairs line segments on the y axis are given simulating walls and a set of points with positive x coordinate representing possible positions for ...
My code was made as an practice for CodeChef. Here's the brief from that page: Relational Operators are operators which check the relationship between two values. Given two numerical values A and B you need to help chef in finding the relationship between them that is: First one is greater than second or First o...
The code works fine, but the speed stays at a consistent eight frames per second. Today I fixed some pieces and got four more frames per second. I figured out that the typecasting (int) and Math.floor() consume around 50 fps. Is there anything I can do to improve the performance of this code? public void render(){ ...
Here's a function that sorts an array of objects with a dateProp by the date. First it uses moment to convert the Date object to a unix timestamp. var _ = require('lodash') var moment = require('moment') util.orderByDate = function (arr, dateProp) { if (!dateProp) return arr return _.chain(arr) .map(function (it...
I built one of these long ago, and it got lost when I reformatted my SSD (sad day) so here is the new version. It is very multithreaded, spawning numCores - 1 threads to calculate n chunks. When one thread finishes, another is spawned until all chunks have been assigned. It's quite quick and accurate, though the imageS...
As plain r5rs is lacking in useful string processing utilities, such as string-split and string-join (I'm using MIT/GNU Scheme), I decided to implement my own. My procedure, string-join, works just fine, but I would like my code to be critiqued by seasoned Schemers, and also find out if there are other, more efficient...
A little while ago in The 2nd Monitor, me and @Phrancis were talking about Python and debugging, and the topic of function decorators came up with this message: Ethan Bierlein: You could even build a debug decorator. Give me a sec. So, I built a small, simple debugging decorator, which would just print out the argume...
I wrote FizzBuzz. My aim is to use C# Code Standards correctly, and write flexible code. How can I improve my solution according to code standards? How can it be better in general? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsAp...
I have 5 or 6 ID's and I need to compress .hover jQuery into smaller amounts. I tried this answer, but due to how he needed only 1 "group" inside the .hover function, it makes mine not work because I need a way to have 2 "groups" inside the function. $(document).ready(function(){ $("#menuicon").click(function(){ ...
So I wrote this for my Mandelbrot Generator, to collect and use input from the user, and I made it dynamic enough to be useful anywhere. I'm really interested in all critiques of it, as I'm going to be using it a lot now. The idea is to allow the user to easily show messages on the console, that require input. Once val...
With C++ templates, I've implemented a template list type with cons, reverse, merge, sort, filter, map, fold; and higher order template functions with currying. The C++ compiler can also work as an interpreter of a (convoluted) purely functional programming language, which is the C++ template metalanguage. This main fu...