instruction
stringlengths
71
71.9k
I'm developing an ASP.Net web application, using MVC 5. This application authenticates via LDAP and will assign an Identity Role of "Admin" to a designated user. The Admin user will be able to go to an administration page to add users with a role of "Admin", if the admin checkbox is not checked, then the role is "Emplo...
Similar problem: Sum Of Prime I've done the given problem in roughly \$\mathcal{O}(n\sqrt{n})\$. How can I improve this algorithm? #include <stdio.h> int isPrime(long long int n) { long long int i; for(i=2;i*i<=n;i++) { if(n%i==0) return 0; } return 1; } int main(void) { int...
Title says the biggest part. The class is designed to be used to search for very big prime numbers, hence the element type is templated. The performance, neither in space nor time, is considered. Users are free to provide any type that supports required semantics. It also supports traverse performance of std::vector du...
I am developing a game, its map is based on a 2D city. The city is being generated as string, # are streets, O are buildings. Here is an example: ####### #OOOOO# #OOOOO# ####### #OOOOO# #OOOOO# ####### Now I am replacing the Os with other buildings, by replacing the character with an other. The other buildings are def...
I needed a simple and efficient way to use events in my JavaScript code, so I came up with a small event library. Currently, I'm doing it like this: // eva.js - The lightweight es6 event library. var eva = (() => { // Prepare local globals var eva = {}; var receivers = []; var gid = 0; /** * Verify the typ...
I'm a teacher and I built a one-page web app to display random question sets for quizzes and tests. The script I wrote selects one question from a set (array) of questions. The script works fine, but I wonder if it follows best practices or if it could be made more efficient. I want to share my app with other teachers...
I am developing a text-based RPG with a randomly generated world space. I have built a light engine to produce a world for me and fill it with 'world objects' like trees, mountains, villages, and the like. The world can be generated either through a fully automatic method, or a "manual" method, that allows for more spe...
This is part of a larger project that is to run on POSIX systems. My concerns with it are the lack of comments, best practices with the filesystem, and naming things. Of course all feedback is great. fileio.h: #ifndef FILEIO_H #define FILEIO_H char **readlines(const char *path); void freelines(char **lines); #endif ...
I am practicing to code in the right way and make it testable. Please review this code and tell me anything bad practices of it. Entity: namespace MockBlog\Entities; use Doctrine\ORM\Mapping as ORM; //use Doctrine\Common\Collections\ArrayCollection; /** * @ORM\Entity * @ORM\Table(name="mockblog_page") */ class Page {...
I have a simple app which is checking occurrences of values. If there is already occurrences which I am looking for, it display that. If not, it adds. create table Strings ( StringID INT IDENTITY(1,1) NOT NULL PRIMARY KEY , StringValue VARCHAR(100) NOT NULL ) create table Links ( LinkID INT IDENTITY(1,1) N...
I wrote a script to copy a file, but this file already exists in the target directory. So, first I need to rename the original file. The script works, but a colleague did not want to use it because it is too complex. I would like to know how can I improve the code of this script. In some sense it seems to be overkill ...
I'm a beginner working on a text adventure. It's quite bare-bones at this point but I would appreciate feedback before I continue and the flaws in my code become further ingrained. I plan to add an item pickup and inventory system which can store items to heal and deal damage to enemies, some problem-solving and expand...
I was asked to make a String encryption utility without using encryption API I basically had to come up with my own ecryption methodology! the program was to be able to encrypt a string and decrypt a string and to of course make it nearly impossible for anyone to figure out what the encrypted string says! I would real...
I've written a procedure which allows serialized writing of a stream. I don't in any way consider this done, but this is the beginning of it. I know there are other implementations out there like this, but they tend to be either too primitive or too heavy. This is an attempt to simplify serializing the output stream. T...
I am trying to solve a programming problem on a coding platform. When I submit the code on the coding platform, it throws a "Time Limit Exceeded" error. Can someone check my solution and help optimize it? A food delivery company X gets a lot of orders every day. It charges some commission from the restaurants on these...
I wrote a method that calculates the average and standard deviation of sell currency exchange-course (ASK). But I think that it isn't the easiest way to define such behavior. In my opinion there is too much creating of BigDecimal values. I have also doubts about using an ArrayList to get values in order to count stan...
I made a little copy tool, but my progress bar seems to be too slow. I would also be very interested in any tips and improvements or code smells. MainForm (code behind): public partial class MainForm : Form { private FileCopy _fileCopy; private delegate void UpdateProgressEventHandler(object o, CopyProgressChan...
I am trying to write a program to find a zip file's password. I know the password consists of only lower-case letters and it's length does not exceed 6 characters. I wanted to check the passwords of length 1 first, then length 2 and so on. So I used breadth first search, but then I realized that BFS consumes so much m...
The problem I was trying to solve sounded pretty basic, but turned out to be a bit hairy. I need to select some lines of arbitrary length from an input stream (file or standard input) and print them to output. In other words, a function that just echos the line would do the job. The input stream is encoded in UTF-8. Fo...
The question is to find a number with absolute minimum difference from a number of the form be. I came up with the below code which takes 4 seconds to solve each test case on an average however it has to be solved within 2 seconds. Sample Input: 11 25 Sample Output: 20 Explanation: 11 is the nearest to 32. Th...
So I have started creating a UITableView with multiple prototype cells. I currently have the below code setup, which works fine func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell: UITableViewCell? if indexPath.row == tableView.numberOfRowsInSecti...
I've tried out implementing a combination generator using boost coroutines. It accepts an array of possible values and generates one array at a time for each combination. As a limitation, it only generates combinations of the same length as the array of possible values and does not check for duplicates inside the sourc...
I'm trying to learn some Haskell by working my way through the CodeAbbey problems. I really struggled to find a nice functional (but still efficient) way to solve problem #21: Array Counters. The problem is, given a list of M numbers between 1 and N (an input parameter), to count the number of occurrences of each numbe...
I am working on some sampling to collect data for my research on SOLID Principles. One of my sample consists proceeding code snippet: public abstract class Notify { public abstract void NotifyClient(); } public class OnPremisesClient : Notify { public override void NotifyClient() { Console.WriteLin...
I need to handle configuration errors and ask the user for the right credentials if something is wrong. I cannot decide between three implementations. Which style is better in Python and why? A: while not backend.check_config(): click.echo('Invalid Configuration parameters!') for param_name, question in backend...
I implemented a generic Dijkstra algorithm. It's lazy since the vertices with their final distances are request on demand. I used the Fibonacci Heap from this question with a few changes (added a copy and move constructor and the copy and swap idiom among other things). I'm looking for a general review. Dijkstra's algo...
The code will move the mouse from a start point (xs, ys) to finish point (xe, ye) like a human would. I'd like some help possibly shortening the code (by optimizing it) and making it more readable. Also, if you spot any mistakes I could have made while converting the Pascal code to C# code, please let me know! Original...
I have just begun to learn the C language and wanted to start off small with a temperature conversion calculator. The program works, and I'm looking for feedback on do's and don'ts as I am sure there are at least a few errors in technique that can be improved. (I just realized Fahrenheit is spelled incorrectly). /*Calc...
Basically, I want the code to break when strLink doesn't contain any domains in the googleDomains link. The code seems to be very awkward. I wonder if there is a way to make this more elegant. Dim googleDomains = {"google.com", "blogger.com", "youtube.com"} Dim pass = False For Each domaingoogle In googleDomains If...
I'm creating a personal website where, among other things, there is a blog, or a "microblog" (I'm still not sure how to define the two), where I will be writing articles and having users, who will create accounts, write comments on the posts. In addition, the blog posts will be tagged to allow for easier searching of s...
I've started to learn Python today. I'm trying to write decoupled middleware or chain of responsibility pattern. In my app I have some two classes: abstract class or interface named Processable class ProcessorChain, which must locate implementations of the Processable, create objects of these implementations and call ...
I'm a beginner. This is my implementation of binary search algorithm in Python. Please review my code and give your valuable inputs for further improvements on overall coding style, rare cases etc. def binary_search(arr,value): left = 0 right = len(arr) - 1 while(left <= right): mid = (left + right)...
I'm new to rails and this is the situation I'm in: I have a User model that has many tournaments, a Tournament has many users and questions and a Question belongs to a tournament. I'm trying to write a query for all questions that are in tournaments the user is a part of, for example if we have the user A in tournament...
Is pattern matching within a unit test a code smell? Do I really need to throw an exception just for my test to fail if the function under test receives invalid arguments (i.e. not Succeeded case value)? Here's my test: [<Test>] let ``get available positions for black soldier`` () = // Setup let piece = Blac...
A number is a prime when it is divisible by 1 and the number itself. To check if a given number is a prime we can divide the number by primes which are less than the square root of that number. If there is at least one prime which properly divide the number then the number is composite otherwise it is a prime number. I...
I am working on a project to automate utilities of our application on Linux. The utilities are basically chunks of programs with specific options for specific tasks. They are run like UNIX commands. We need to validate command outputs and at times the files generated by them. The automation needs to cover all options f...
I have made this class for database connections to my applications. It eases out the task of making connections to the database with knowing the credentials in advance and provides a way to execute the queries. Class dbConnection { public $CONN; private $dbservername, $dbusername, $dbpassword, $dbname; pu...
I have recently started looking into networking with Python. I saw some tutorials about the socket library so I decided to give a "live chat room" idea a go. It works (on Windows, os.system("cls") may be problematic) but was just wanting to see how people could improve upon it server.py from socketserver import Threadi...
This sorts two lists (a, b) according to aand returns two sorted lists separately: a = ['apple','carrot','banana'] b = [5,15,10] s = sorted(zip(a,b)) a,b = map(list, zip(*s)) print a print b ['apple', 'banana', 'carrot'] [5, 10, 15] Are there any better ways to do this?
I decided to write a console program that can generate a random alphanumerical password in the C language. It's quite useful for when I'm making a new account and need to make up a quick password on the spot. I've noticed a lot of the password generators people have shown on this are written in Java and maybe Python or...
I'm looking for ways to make this calculator more efficient and/or make the code a little easier to read. #include <iostream> #include <cstdlib> using namespace std; // variables to be used in the program double result, valueA, valueB, valA, valB; int choice; char cont; //functions to perform the calculations doub...
I have implemented simple BubbleSort algorithm. How can I optimize my code? Any suggestion would be helpful. public class BubleSort { private int arr[]; public static int COUNT; public BubleSort(int array[]){ this.arr = array; } public int[] getArray(){ return this.arr; } public void setArray(int[] a...
This class will take just the table name and data array and will do the rest, update or insert. I know it's not perfect, but I could use some feedback. <?php class DataBaseAction{ private $tableName ; public $tableId ; private $fieldNames = array() ; private $fieldType = array() ; private...
I'm attempting to improve my OOP design skills through solving sample problems. Below is an implementation of a flight booking system where the passenger can only request a seat class, but no number. Also, flight statistics must be printed. In your review, please focus on design: How can I design the classes better (or...
I need to parallelise a for loop that does quite a lot of processing over thousands of items. I came up with this basic loop that seems to work quite effectively on a small test. template<class T, class C> void parallel_for_each(std::vector<T>* ts, C callable, uint poolsize = (std::thread::hardware_concurrency()+1)*2) ...
The following program is a lexical analyser for a simple and small grammar. Please read my code and answer me these questions: Is my code easy to understand? Is my code well organized? Are there bugs in my code? Is the lack of comments a problem? Can you make my code more performatic without modifying all the structur...
I have two arrays and I want to combine them both in a manner similar to this: arr1 = "1a, 1b, 1c" arr2 = "2a, 2b, 2c" arr1.zip(arr2).flatten(1) # => [1a, 2a, 1b, 2b, 3b, 3c] That is, put each arr2 element right after the arr1 element sharing an index. Since arr1 elements come before their arr2 counterparts, arr1 can ...
I'm roughly trying to follow the guidelines in "Effective Java", "Item 15: Minimize mutability", hence the class is not "final" on purpose. Information is gathered from a number of temperature meters. Some may fail to report, so the size of the map is not known. The serializing bothers me. Is there a simpler way to...
I have been trying to develop online food order application. I have taken the concept of zomato.com where a user or say owner registers his/her restaurant. After adding the restaurant, an executive from the company will fix a meeting with him/her, take pictures and menu of his/her restaurant by himself/herself or ask h...
Some time ago I was experimenting with an Extendable format provider but I wasn't satisfied with the implementation. It didn't feal very SOLID so I've rewritten it to this: The base class is the Formatter: public abstract class Formatter : IFormatProvider, ICustomFormatter { protected Formatter(CultureInfo culture ...
Uncle Bob in his Clean Code says: So all the same rules apply. Functions that take variable arguments can be monads, dyads, or even triads. But it would be a mistake to give them more arguments than that. void monad(Integer... args); void dyad(String name, Integer... args); void triad(String name, int count, Inte...
Based upon feedback received in this post I've amended my game and would very much appreciate further feedback on it's current state(work in progress) and any suggestions on what I could implement in the future. An @classmethod was introduced in Enemy() and these are completely new to me so a confirmation that all is c...
I wrote list, which I think is more elaborate than usual. I would like to ask you for some tips, criticisms, and general feedback about my code. #ifndef _LIST_HPP #define _LIST_HPP #include<memory> #include<iostream> #include<cassert> template<typename T> class List{ private: struct Node{ std:...
Could you review my code for finding max, min, and mode? #include <iostream> #include <vector> #include <algorithm> int main() { std::vector <int> v = { 2, 5, 3, 4, 3, 2, 3, 3, 3 , 6, 6, 6, 6, 6, 6, 6, 6, 1}; sort(v.begin(), v.end()); int number = v[0]; int max = v[0]; int min = v[0]; int m...
I've written a simple C# class to use as a dll for simple math calculations: addition, subtraction, division, and multiplication. How can I improve this code, specifically for addition and multiplication? I've tested it with a C# GUI and a VB.NET GUI. I've tried it with VS 2005, 2008, 2010, 2012, and the Community Edit...
I use SQL Server 2014 and I have three tables: Student (ID, Name, Age) Product (ID, Name) StudentProduct (StudentID, ProductID, Date) TABLE Student(ID, Name, Age) >> ID Name Age 1 Adam 20 2 Bob 17 3 Ben 18 4 Joseph 18 5 Jon 18 TABLE Product (ID, Name) >> ID Name 1 SQLServer 2 V...
I love politics, and I love programming, so I figured why not try and combine the two for something to do? I'm making a work-in-progress (but runnable at this stage) Politico api that I call "pylitico.": from bs4 import BeautifulSoup import requests import time import ast import re story_link = re.compile('a href="(...
I have decided to give python a try and have to start out at the very basics, so I chose this well-represented kata. The code aims to convert Arabic numbers between 1 and 3999 to Roman numerals and back. Here, Roman numerals are 'well-formed', that is, no 'XM' or similar, even though I know they were occasionally used....
The following script is meant to be a user script, but it should work on the console. It takes the id of the question and adds the corresponding /posts/id/timeline link to the post-menu element, just besides others. It's meant to not have problem with other scripts. The same as above for the answers, just that in this ...
I'm trying to recreate a printer in Java. I'm fairly new to programming so I'm using huge if/else blocks inside a single function to dictate the logic of the program. I'm noticing this is creating a mass of code inside the same function. I was wondering if there was a more eloquent/efficient way of doing this Printer c...
Can the below code be done in one line? Do you think it should or is it ok like this? function() { var str = {{Click URL}}; var str1 = str.split('/').pop(); return str1.charAt(0).toUpperCase() + str1.slice(1); }
I've started learning java. I've written a small program I've done in C before. It's simple input analysis. If there is number, program checks if number is prime. Then write number: (value of input variable) (prime) for example date in format DD/MM/YYYY, if does program will print date: DD/MM/YYYY Day (Day represents...
I'm using the flexbox for the first time for a responsive grid system. It seems to be working as far as I tested but want to make sure it works on others too and see ways to improve this. Please see style.css for the grid system with flexbox on github. *{ box-sizing: border-box; -moz-box-sizing: border-box; } htm...
I built an Order Statistics tree on top of a Treap in order to solve this HackerRank problem. It works (passed all test cases). Any comments whatsoever would be greatly appreciated. class EmptyTreeError(Exception): def __init__(self): self.error = "Empty tree" class node(object): def __init__(self,val,...
Question from the book: (Geometry: closest pair of points) Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or more points, highlight the pair of closest points. Whenever a new point is created, a new pair of closest points is highli...
I've created a program that will create work notes for me, however, I've been under the impression since I started writing in Ruby that while loops are bad. How can I write this differently in order to gain the same effect or an even better effect? def prompt(input) print "[#{Time.now.strftime('%T')}] #{input}: " S...
This is basically the beginnings of a battleship game. There is only 1 ship which takes up 3 of six locations on a 1 x 6 grid. The locations are created by finding a random location on the grid and then taking the next two points as the other 2 locations. I basically just make sure the the guess is between 1 and 6, mak...
I'm currently working on a small project that uses Java to handle a socket-based MMO browser game. I'm still at the beginning of the project and I'm currently writing a class that logs errors and debug messages to the console and writes these to the appropriate file, based on the error. I'm wondering if this code is cl...
I kind of started making an API for my site in a Django class based view because it seemed logical and now it has gotten quite large and unruly and I am starting to wonder if I am doing this correctly. class URLAPI(View): def get(self, request): if request.GET.get('param') == "foo": ... ...
I've been making games using the Pygame module recently. I've noticed that Pygame has no builtin GUI elements. To save time for me (and hopefully other people), I have created some very simple GUI elements: buttons and labels. The button module was the first to be created, and is probably the most thoroughly tested. Th...
I wrote a React app to adjust the serving size of a recipe. For example, if the recipe serves 4 people and requires 4 eggs, scaling it down to serve only 1 person should only require 1 egg. I try to also keep the units singular/plural accordingly while converting units when they become too big or too small. These featu...
I am a new Pythoner. I have solved a OJ project with Python. Can you tell me how can I solve it more Pythonically? Problem Description: There are n coin denominations, each with an unlimited supply of coins. Use them to make a given total amount m. Requirements: Every denomination must be used The number of coins of...
I have written JavaScript code for fetching data from a MySQL database. I have used connection pooling and Promise API. var mySql = require("mysql"); var Promise = require("promise"); var pool = mySql.createPool({ host : "localhost", user : "root", password : "rahul", database : "testDb", //schema connectio...
I'm executing a cursor. I have cut off the code how the procedure is called and executed. This part is efficient. At last I have a small cursor. I'm calling the procedure, which returns this cursor many times on the page and I need to create a multidimensional array from it. This array should look like the following: $...
I'm writing a TCP server using tasks and I wanted to know if there's something I can improve and how I am doing. ConnectionHandler.cs: public class ConnectionHandler { private List<TClient> CLIENT_LIST; private TcpListener LISTENER; private const int PORT = 8080; private const int ACCEPT_DELAY = 75; ...
Here is an array based stack. I tried to implement this basic stack from memory. I want to make sure it is correct. import java.util.*; public class Stack{ private int[] stack; private int size; public Stack(){ stack = new int[5]; int size = 0; } public Stack(int capacity){ ...
I have 9 sheets with 1668 rows and 34 cols. The code collects all data from every sheet into one Summary sheet in the following format: service 1 supplier 1 price etc.. service 1 supplier 2 price etc.. Unfortunately excel freezes around the 7k row and I receive 'out of memory' error. Any suggestions how to solve imp...
I wrote this simple function to rename columns in a data frame to standardized names in R. This function is useful when we have a very large data set with large number of columns especially for machine learning applications. colRename<-function(x){ for(i in 1:ncol(x)){ colnames(x)[i] <- paste("column",i,sep="")...
I have a large dataset (78k instances x 490k features) that is loaded as a scipy.sparse.csr_matrix format. From this dataset I want to filter certain features (i.e. columns) for which all values fall below a certain threshold. Loading the dataset as a dense matrix is not an option, nor did I find sparse matrix operatio...
There's been a lot of questions lately about database provider and repository design especially without entity framework or alike. I thought I try myself to create a reusable framework for this kind of stuff. So let's begin ;-) TL;DR - There's an example at the bottom Core The main part of the framework is the DbProvi...
I've written the following script import shutil,os,glob # setting up destination folders PYDEST = "/home/ubuntu/python-scripts/python-test" TEXTDEST = "/home/ubuntu/python-scripts/texte-test" def move8files(pwd): PWD = pwd + "*" for files in glob.glob(PWD): if files.endswith(".txt"): pri...
I'm going to start small here because I actually have several questions but I'll go one at a time. In the app I am making to better learn Java/Android/SQL/OOP, I have a page where a user can define Places (e.g. "New York City", "Seattle", etc). You could add made-up stuff if you wanted, too, doesn't matter. The user ca...
I am currently working on a new version of my application, and I just finished rebuilding the log part. It works well but I am skeptical about the choices I made. I am a student and I work alone in some side projects, and I am afraid of developing bad habits. I use java.util.logging, because it is simple enough for wha...
First of all, I'd want to represent, in my application, two different users (admin and client) which can access to two different classes, through two different graphic interfaces... My idea is to represent faithfully what is in the e/r and I'd want to generalize shared information (like nick, pw, email) using an interf...
I wrote a program (hard-code) in MIPS that gets an array of 10 integers and calculates the sum and the square sum of them. The array is {23,-2,45,67,89,12,-100,0,120,6} .data array: .word 23,-2,45,67,89,12,-100,0,120,6 # array = {23,-2,45,67,89,12,-100,0,120,6} length: .word 10 # the length of the array is 10 sum: .wo...
I'm trying to alternate if a button is checked. I've come up with this, which works but its feels unnecessary to write 70 lines of code for such a simple task. How would I go about to shorten this up, is there any way I can call the base toolStripButton and tell it to uncheck other buttons when clicked on and check it ...
I wrote some code to execute remote commands over ssh, using expect, from c++. The code works but is a bit of a mess of c / c++ since there doesn't seem to be an idiomatic way to achieve much of what I wanted in pure c++. I appreciate that there are nominally some security concerns with the way I'm using passwords, but...
I'm developing a document merger that utilizes an FTP site containing hundreds of documents. FTP Connection Function private static function establishFTP() { $ftp_conn = ftp_connect(getenv('FTP_HOST')); ftp_login($ftp_conn,getenv('FTP_USER'),getenv('FTP_PASS')); ftp_pasv($ftp_conn,true); return $ftp_co...
I have a view that displays details of a work order request submitted by a user. As far as security and database querying is concerned, which one of the following options would be better if I'm going to update a table named "Requests" with some changes to the properties? Is the extra query to the dbcontext in option 2 ...
I have this script working pretty well but I know that there must be many things that I could do better to make it more efficient. from selenium import webdriver import re from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_...
This a problem from Hackerrank.com and Project Euler #8. The problem statement is as below. Is there a specific algorithm to solve such problems? Can my code be made more efficient? Find the greatest product of K consecutive digits in the N digit number. Input Format: First line contains T that denotes the number o...
I wrote this little class to wrap around a work-in-progress, poorly documented API and I'd like to know what else can be improved. I feel like there's a lot of repetition in the functions and I'd love to know if I could turn all those functions (which do the same thing, just setting a different command in the request o...
This is a hyperid implementation of a linked list and ArrayList: The total capacity is divided into \$\sqrt{n} \text{ "arrays count"} \sqrt{n} \text{ "array size"}\$. This will lead to, as I assume, \$O(\sqrt{n})\$ for operations like indexing, insertion and deletion, along with \$O(1)\$ for adding We start with on...
The problem (from Cracking the Coding book): Given an NxM matrix in which each row and each column is sorted in ascending order, write a method to find an element. I thought of a modified version of binary search, and I haven't found this solution anywhere on the internet (some solution about quad partitioning is ver...
As part of my learning Java I'm doing various tasks I set myself - one such task is a postfix calculator. It seems to work with all tests I've given it, and I would really appreciate some review of the code I've created to complete this, both logic and style wise: package com.VortixDev.PostfixInterpreter; import java....
So far, I've been using codes based on solutions other people wrote, and I'm trying to learn by modifying those codes. My problem now is that my code ended up too messy (a lot of script tags, jquery mixed with javascript, etc). I would like to know what should I do to clean this mess. Since I'm a beginner, I'm not look...
I have a method in C# which communicates with REST API.It has a several small task like splitting of a string ,checking a commandText is valid or not,POST and GET JSON payload to/from REST API. public string PostToAPI([FromBody]string value) { string input = value; //splitting of str...
When the application connects to the database it keeps the connection open until the user closes the file using File->Close. Is this bad practice? Should I be opening and closing the connection every time I need to use it? using System.Data; using System.Data.SQLite; using System.IO; using System.Windows.Forms; namesp...
I have Matlab code that is very inefficient and I need to run it several times. The code is basically a big parfor loop which I guess there is almost impossible to get around. The code starts by loading several parameters and 4-D matrices, and then needs to make a few interpolations. All need to be done 5000 times (t...
This is a POC for a clock using moment.js, eventually I plan to recreate this in Raect.js. Any opimisations or a better way to do it? <!DOCTYPE html> <html> <head> <title>Html clock</title> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script> ...