instruction
stringlengths
71
71.9k
I have written a basic PHP upload script a few years ago and recently I discovered some phishing html pages in the website's root. This website is located in /www/sitename, while I upload the files to /gstorage/sitename, which can't be accessed from the web. I have found a lot of html files in /www/sitename and it see...
I'm creating my own game and for some statistics I need to get the names of specific objects. The problem was that I had them declared like "SmallFireBall" but I wanted them to appear like"Small Fire Ball" because that's something the user is able to see, so I decided to create my own extension method to help me out: p...
I'm writing a simple tool as a helper on Route Cipher for fun. In summary, the tool breaks input string into a two-dimensional array of characters with the dimensions specified by the user, and after that it's represented as a table on HTML. The tool also has a function to shift table data on a row to left or right, an...
I'm looking to improve a loop within a script that performs scheduled server restarts. Currently, I'm using a DO While loop with an exit condition within an IF statement once a counter reaches a limit. I'm looking to change this into a more simpler loop using a Labeled While loop containing a For loop that breaks when ...
I've exceeded the time limit on Sherlock and Squares on hackerrank.com. Problem Given the number of test cases and a range (inclusive), find the number of numbers within that range that are perfect squares. Sample Input 2 (number of test cases) 3 9 (first test case) 17 24 (second test case) Sample Output 2 (in ran...
I've just started to teach myself Rust. I've written the following code to read a text file and store the contents in a String. Is this the typical way of doing this? Can anyone suggest any improvements to this? use std::fs::File; use std::io::Read; use std::io; fn main() { let file_name = "test.txt"; let mu...
Below I've written a simple version of what I'm attempting to accomplish. I'm new to asynchronous functions, so it's difficult to wrap my head around this. My goal is to wait for the loop to finish all the callbacks before console.log() runs, but I want all the callbacks inside the loop to be asynchronous, so they don'...
I came across the below problem in a coding challenge: Let's define 2 functions, \$F(i)\$ and \$Val(i,j)\$, for an array \$A\$ of size \$N\$ as follows: $$ \begin{align} F(i) =& \sum_{j=i+1}^{N} Val(i,j) \\ \\ Val(i, j) =& \begin{cases} 1,\qquad & \textrm{if } A[i] < A[j] \\ 0,\qquad & \te...
This is one simple crawler that downloads images from websites, the website's URL to be crawled to must match the regex, as well as any image-to-download's URL. (Also, I know, I made my own thread pool, because I did want to keep my crawler lightweight...) Code: import BeautifulSoup import requests import re import jso...
Inspired by Reddit r/dailyprogrammer A vampire number v is a number v=xy with an even number n of digits formed by multiplying a pair of n/2-digit numbers (where the digits are taken from the original number in any order) x and y together. Pairs of trailing zeros are not allowed. If v is a vampire number, then x and y...
How can I improve my code, make it more efficient, and are there any tips you have? Project Euler 3: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? public class LargestPrimeFactor { public static void main(String[] args) { long num = 6008514...
Introduction This problem is essentially equivalent to this HackerRank problem. The task is to remove all duplicate characters that are adjacent to each other in a given String, until no adjacent characters are the same. If a String only contains adjacent duplicate characters then return an empty String. Examples: baa...
Problem In the famous eight queens puzzle, one must place eight queens on a chessboard without letting any queen threaten any other queen. There are 92 (or 12, depending on how you count) solutions to the original puzzle, but it can also be generalized to smaller or larger boards. Solution My strategy is pretty similar...
Very new to Raspberry Pi and bash, but working on a headless server that will run a streaming app from USB audio card. The plan is to take a USB card with settings file, and when inserted, the usb will automount, check for settings file, load the streamer using config file and wait for the audio input stream to start A...
In some code that I am writing, I am manipulating some heterogeneous containers of user-defined types. I desperately need to be able to move-assign these types without generating exceptions. However, this can cripple the usability of my code because on many older compilers, important standard library types do not have ...
I made a triple-type container, that is, a single type that can store a value, under one of the three types used. It's somewhat similar to Boost::Variant. The header file (multitype.hpp): #ifndef MULTITYPE_HPP #define MULTITYPE_HPP #include <iostream> #include <cstdlib> #include <typeinfo> typedef void* vp_t; // Void...
I am new to PHP development. So Kindly, review my code and guide me make it better/optimize. Currently, it works well with inputs that I have tried. <?php // Program to find the word in a sentence with maximum specific character count // Example: "O Romeo, Romeo, wherefore art thou Romeo?” // Solution: wherefore // Ex...
For fun I decided to write a 'real' Haskell program. The intention of the program is that it listens on a socket on a given port for input. The client can send some raw text on it and the server generates a paste for it. As an example: Client dino :: ~ % echo "Schoolbus" | nc call-cc.be 9999 http://call-cc.be/files/3DF...
I am learning JavaScript and I have written a code snippet. Can someone suggest some improvements? Array.prototype.pushIfDoesntExist = function (item){ if(this.indexOf(item) === -1) { this.push(item); return true; } return false; } var Testing = { clickedList: [], applyListeners: func...
I made a Blum Blum Shub pseudorandom number generator implementation in JavaScript. Blum Blum Shub (B.B.S.) is a pseudorandom number generator proposed in 1986 by Lenore Blum, Manuel Blum and Michael Shub that is derived from Michael O. Rabin's oblivious transfer mapping. Blum Blum Shub takes the form \$x_{n+1}=x_...
I currently use this method to count unread messages for a user (self here): def unread_messages_count number = 0 conversations = Conversation.where {|conversation| conversation.user1 == self || conversation.user2 == self } conversations.each do |conversation| number += conversation.messages.select{|message|...
I am making my first object-oriented program in python and I am having trouble with the __str__ part of Board() class. I want it to be a visual representation of the tic-tac-toe board. I have achieved this but the code looks ridiculous and I know there must be a better way! Here is my project so far: class Space(object...
The filenames.txt contains all the names of the files that you want to change in a given directory. It is generated by: import os walk = os.walk("./app/") for dirpath, dirs, files in walk: for filename in files: fpath = os.path.join(dirpath, filename) with open("filenames.txt", "a") as f: ...
I implemented Karger's algorithm with the function find_min_cut and it works, but I don't feel satisfied with the code I wrote. from numpy import inf from random import choice from copy import deepcopy # We use the karger method for finding the minimum cut in a graph. # Each row of "original_Graph" needs to match a v...
I know B-Trees are meant to be used for external memory, but I implement it to understand the algorithms involved in insertion and deletion. Also, I didn't use a vector because I was asked not to use it (I will probably reimplement this using vectors later). namespace mds { template<typename T, typename Func = std:...
I am developing an application that works with files and folder on a network share (similar to the windows explorer). The application is used by multiple users and provides some commands for modifying the file system. Problem The parallel access to the file system may result in conflicts. Example: User A renames a fo...
I am working on a project for Udacity, where I should use CSV files to display data on fake corporate dashboard. Structure of the data I am working on is like this: I am using AngularJS for this project, I created service for getting the data, formatting it to JSON and summarizing data into months. It works good, but I...
That's already known problem: to return an array of linked lists that contain values of elements at each level. Eg for tree with depth n there should be n linked lists. I wrote the solution: public ArrayList<LinkedList<Integer>> levelLists() { class NodeLevel { public BinaryTreeNode node; public int le...
I have to reverse a string in JavaScript and cannot use the built in reverse() function. It does not seem efficient to have to create two arrays but is there a better way? function reverseString(str) { newarr = str.split(""); result = []; x = newarr.length; for (i = x; i > -1; i--) { result.push(newarr[i]);...
I am trying to learn how to write clean HTML5 code and I came across a sidebar. I need to get something like this: My code: <aside> <section> <header> <h1>Naujienos</h1> </header> <ol> <li> <article> <header> <h3>2015-09-20</h3> ...
The only way I could think of doing this is creating a text file and modifying it each time the program is executed and outputting the average but this has many flaws so I was wondering if it was possible to do this any other way. int num1, num2, counter = 0; num2 = rand(); do { cin >> num1; counter++; } while(num1 != ...
I wrote a solution for SPOJ "It's a murder!". I'm exceeding the time limit even after n log(n) solution and fast I/O. Given a list of numbers, I need to calculate the sum of the sum of the previously encountered numbers that are smaller than the current number. For example, given 1 5 3 6 4, the answer is (0) + (1) + (...
I've made a simple web plot with D3 JS version 4. I've drawn a discontinuous function: $$f(x)=\frac{1}{x(x-2)}$$ which has 2 vertical asymptotes and 1 horizontal asymptote. I add a legend with LateX: I'm not a master using JavaScript and D3, so I'd be thankful for any suggestion about a more efficient use with arrays....
Here is the JS Fiddle: https://jsfiddle.net/4jo9hvpk/ The code is fully functional. Could someone point out any mistakes in style? Any redundancies? I want to work on making my code look better and being more efficient. $(document).ready(function(){ var button = $(".buttons"); var allButtons = [$("#red"), $("...
This XOR function is costing my program too much time (specifically the conversions.) How can this code be made faster? string xor_str(string astr, string bstr){ unsigned long a = strtoul(astr.c_str(), NULL, 16); // Convert strings to longs unsigned long b = strtoul(bstr.c_str(), NULL, 16); stringstream ...
In the C# Player's Guide book, one of the challenges was to make the game Game of Life in the console. Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.IO; namespace GameOfLife { class Program { ...
I create login form with session with four files: connection.php login.php plan.php logout.php Please check my code and tell about any smokestack. Database educate (create table users) CREATE TABLE users( id INT AUTO_INCREMENT, username VARCHAR(50) NOT NULL, password VARCHAR(100) NOT NULL, PRIMARY KEY(id) ); Connect...
I am new in Golang, and decided to create a function that could cater to my needs of reading an integer from stdin. I need the function to be as efficient and fast as possible. package main import( "fmt" "bufio" "os" "strconv" ) type NoIntRead int func (err *NoIntRead) Error() string{ return fmt.S...
I have used multiple map/flatmap combinations. Could anybody help me with the review? var Rx = require('rx'); var RxNode = require('rx-node'); var request = require('request'); var _ = require('lodash'); var cheerio = require('cheerio'); exports.getResult = function(req, res) { var result = ''; fetchContent(...
The code is supposed to group start and end time logs and provide log counts and unique ID counts. The grouping will be variable 1 hour, 6 hours, 12 hours, 24 hours, etc. What is the better way to rewrite the simpler version for this code? Input: No of day reamins 'x' in inputs. import pandas as pd fn = r'Dart.csv' ...
I'm working on a report of quality control. I've got a table, with all the points of control inside, and each time, when I get a new test result, Excel should fill this table. My code already works, but slowly (I have 15000 lines in this table, and it takes me 4 minutes to fill it), so I wish I can accelerate a little ...
I want to check if a file exists in a given directory or in the parent one, so I wrote this code: if (File.Exists(fileName) || File.Exists(Directory.GetParent(Path.GetDirectoryName(fileName)).FullName + Path.DirectorySeperatorChar + Path.GetFileName(fileName))) However, this seems quite odd to me...
I have started to implement cross site scripting prevention (xss) within my code. However as I am using symfony for this particular project I have read up that nothing needs to be done for xss in symfony as it is already protected from it, is this case? If this is not the case I want to make sure that the code I have ...
This a solution to the CodeEval's challenge "Lucky Tickets". After a failed attempt with brute-force calculations (no surprise here), I have tried to implement an algorithm that I found on StackOverflow. The code runs without errors and my results match the output given in the example. However, when I submit the code f...
I have decided to make a game of text-based Tetris in C. At first I had no idea how to start so I settled for threads. Each thread moves its own piece down the grid and all the main thread does is redraw it every 16ms. However, now I see that multi-threading a game like Tetris isn't necessary at all. Now I can't figure...
I have a (large) number of nodes and (triangular) cells, e.g., cells_nodes = [ [0, 3, 1], [0, 2, 3] ] This example represents the small mesh (Please call me Picasso from here on out.) Now, I would like to create the edges for these meshes (in red above), specifically edge–node and edge–cell relations. For...
I need to run several identical threads. All threads must wait to do their job, until all threads are running (alive). I use wait/notify to synchronize: when a thread is created it waits until it gets a notify to continue. It works, but not sure it's the best way. Is it efficient? I read from Java 5, is it better to...
I have implemented an event bus library for Java - JBus. Anybody please care to review my code? It is an open source project and link is provided above. Usage Define events: public class UserEvent { /* Additional fields if required */ } Create subscriber: public class Listener { @Subscribe ...
I'm developing a game in Unity 5.3.5, I have a player statistics system with 10 different stats, as in probably every game the user is able to see the points put in each stats and also the benefit each stats is giving him. I have 2 panels with 2 text the first one is responsible for the points in each stats and the sec...
This game has a few basic functions: ask users trivia questions based on user input, add or substract points. save game data when user inputs save. allow old user to log in and play the same old game. I only have two main questions: In this game,I tried not to write too many things in the main.js and let most thing...
Here is the code I have written for a HackerRank challenge which takes multiple arrays, and attempts to determine if there exists an element in an array such that the sum of the elements on its left is equal to the sum of the elements on its right. If there are no elements to the left/right, then the sum is considered ...
This program calculates common factor for given numbers. The original use case is to find a possible resolution for pixel games that scale well with new screen resolutions (that's why I don't have any check and optimizations for big numbers and use simple brute force). (define (fun1 l d) (if (apply = (map (lambda (...
2 days ago as I was working on my game I decided I wanted to include some sort of a video showing sneak peaks of the themes and tutorials and such. I then decided to check how to record my scene or nodes. After looking around i concluded there was no easy way to do it so I decided to make my own utility which I want to...
I'm ultimately trying to compare the MD5 hashes for files in two disparate directory trees to see if files are missing from one directory or the other. More broadly, I'm pushing photos from my DSLR camera to Google Drive, and need to know which files need to be synced up. Pictures from my phone are automatically being ...
I have a MVVM application that fetches data from active directory and displays it in a DataGrid. The exact data displayed is determined by which query a user runs, and there are multiple available queries. Each query requires slightly different logic, but they all have the same general idea. These methods are all in my...
Please help me make this code more object oriented. I also want to use a few more classes and separate the input processing code to another class. Question: A hotel chain operating in Goa wishes to offer room reservation services. They have three hotels in Goa: GreenValley, RedRiver and BlueHills. Each hotel has separ...
In my project, I have 3 payment mode. Via Manually Entered , Card Swipe, and cash. I have 2 fragments named RecordCardManuallyFragment and SwipeCadFragment and they both are almost identical according to functionality except in RecordCardManually you have to type info manually and in swipe card fragment you informaion ...
Input: Set of elements (String) Output: Printing the elements of the power set of the given set public class PrintPowerSet { public static List<String> permuteSet(String inputSet){ List<String> powerSet = new ArrayList<String>(); int n = inputSet.length(); //size for binary for(int i=0;i<Math.pow(2,n);...
I'm writing a 3D space graphics program and I just changed the build system to using gradle. This is my first gradle project. It works but I'm sure there is room for improvement. apply plugin: 'java' apply plugin: 'application' apply plugin: 'eclipse' apply plugin: 'idea' mainClassName = 'spaceworld.UFOSpaceWorld' r...
I'm a beginner to Java and Android programming, and I wrote this app in order to get some practice. It works, but it's most likely not as good or efficient as it could be, since I'm new. I'm hoping to get some feedback or maybe some revisions to help me learn. MainActivity.java: // this app can't: // accept blank val...
I thought this question made a good excuse for some basic OOP code, so I whipped up a little bit of code to demonstrate it in VBA; the idea is to have tutorial-grade code, to show how interfaces and default instances can be used to implement immutable types and factory methods to simulate constructors in VBA. Here's th...
Inspired by Reddit r/dailyprogrammer Help! My keyboard is broken, only a few keys work any more. If I tell you what keys work, can you tell me what words I can write? The program works fine, not really any additions I wish to make to it. Was just wanting some general feedback on the layout, structure and efficiency...
I was curious on what, if anything, I could be doing better. I have been spending the last few days working with Java and learning some basics and wanted to try this challenge and making it two classes. I found the scanner is sometimes strange and doesn't take input the first time. import java.util.Scanner; import java...
(See the next iteration.) I have this easy to use facility that maps input elements to output elements concurrently by the means of a thread pool: concurrent.h: #ifndef FORP_H #define FORP_H #include <functional> #include <initializer_list> #include <iostream> #include <thread> #include <vector> namespace net { ...
Please help me improving this code(golang), thanks! Why I need built a API for xkcd Can't get the data provided by xkcd directly in front-end(CORS). So we can package the data to 10 comics per request. Instead of 1 request match one comic. main.go package main import ( "encoding/json" "fmt" "log"...
today I coded a simple API class in C# with just a WebClient instance in each void and just simple voids to do simple things, can anyone give me any support in how I can improove it? Thanks. using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.T...
I have a ColorFormat class that contains a string format for a color and its format name. In the software, I will define multiple instances of this class and regroup all of them in the class ColorFormats: [XmlRoot("ColorFormats")] public class ColorFormats : Collection<ColorFormat> // <-- Notice ColorFormat { priv...
I’ve got my first real PHP web application up and running. It is working as expected, but being my first time, I’m sure there is plenty of room for improvement. Right now, there is one particular aspect that I’d like some Code Review love on: my session handling class. I haven’t used any frameworks this time around, b...
Consider, please, my code of the finalizer template: #include <functional> template<typename F, typename... Args> class finally { public: finally(F action, const Args&... args) : _action(std::bind(action, args...)) {} ~finally() { if(enabled) _action(); } bool enabled = true; private: ...
Im making a Python program. It is basically a questionnaire and I was just wondering if there is a shorter way of doing this as at the moment I'm writing out all of the questions in separate functions. I was wondering if there is an alternative way of doing this in almost a single function where the function just repea...
The following code I am using to lookup the description based on a "Partition Type" in either a string, an integer or hex value. By calling parttype(parttype) in the below code. Is there a more pythonic way for this? __PARTTYPE_TO_DESCRIPTION__ = { "00": "Empty", "01": "DOS 12-bit FAT", "02": "XENIX root", ...
Trying to get https://github.com/github/fetch working with an API that almost always returns a json payload, even when the response is an error: { "message": "User not logged in", "code": 401 } So I came up with this, adopting their status check example function checkStatus(response) { if (response.status >= 20...
sentence = input("What is your sentence?") sentence=sentence.capitalize() counta = sentence.count("a") counte = sentence.count("e") counti = sentence.count("i") counto= sentence.count ("o") countu= sentence.count ("u") countA2 = sentence.count("A") countE2 = sentence.count("E") countI2 = sentence.count("I") countO2 = s...
I have a static list of descriptions in a resource and I am filtering down the list based on the index positions of the text in the array Here is my multi converter: using OCLMEditor.Data.StudentInfo.Enums; using System; using System.Collections.Generic; using System.Globalization; using System.Windows.Data; namespace...
I am new to perl and want some help in tuning this script if possible cause it takes time if I increased my array. also if I use warnings I get a lot of warnings which I'm unable to handle. I'm using perl (v5.24.0) built for darwin-thread-multi-2level. Here is an example of what I want to achieve: The number 886 is lik...
I am interested in implementing advanced data structures. One of them that tickled my fancy is the SkipList. I wanted to know if there is anything to improve in my code. The SkipList node: /** * SKNode.java */ import java.io.Serializable; class SKNode<T extends Comparable<? super T>> implements Serializable{ pr...
My application is really easy. It's going to add 500 records at a time to AWS Kinesis and if there's an error occur I'll just add that back to the queue and it's going to be retry. It's going well but I feel like there's a bug somewhere that I don't see. 'use strict'; const _ = require('lodash'); const moment = requi...
I wanted to write a c++ program to solve a 3x3 rubik's cube, but failed at it. So I picked up a 2x2 rubik's cube and wrote a program using Blindfold cubing algorithm. Can anyone help me write a more efficient program ? This is the program I wrote #include<iostream> #include<string> using namespace std; class Solver { ...
I am making a little single-player game and to help with scoring I have created a Player class. Can you review my implementation? I know that for a multiplayer game this isn't good. For multiplayer I would need to call functions and have all players in one instance. File player.h namespace SDLGamecore { namespace playe...
I'm implementing a "live analytics" feature and I need to always keep track of the last N items that were added to a collection so I figured I'd make a circular buffer since I couldn't find one. I tried to figure out to use Interlocked but couldn't find out how to use Increment or CompareExchange in an obviously corre...
I recently wrote the livejson module as a way to make working with JSON in Python easier. The idea of the module is that you initialize a livejson.File, and then you can interact with your JSON file with the same interface as a Python dict, except your changes are reflected in the file in realtime. I'd like to know how...
I've written some code to scan large files and search for long strings that you can write without repeating a letter. I'm self-taught in python and I'm wondering what I've missed. import sys letters ={} #letters is a dictionary currentResult="" ideas=[] with open(sys.argv[1]) as f: while True: c = f.read(1) ...
I have two matrices a and b that have, on each line, some values (null or not) and then a bunch of zeros at the end. I want to construct a matrix c that for each line has the corresponding line of a from the first element till to the last not-null element, concatenated with the corresponding line of b from the first el...
I'm looking for a general review of this AVL tree implementation: #pragma once #include <cmath> #include <algorithm> namespace mds { template< typename T, typename Func = std::less<T> > class avl_tree { struct Node { T key; int h; Node *le...
I am working on a user login using Flask and the following extensions: Flask-Login, Flask-WTF, WTForms and Flask-SocketIO Client-Side Rendering of Forms and pre-filling with data is done with Flask-WTF / WTForms just like this: <form class="form-horizontal" role="form" id="username-password-form" method="post" action="...
Currently all this does is retrieve data from specific columns, the final result will be that I will check the data to make sure that it passes the test cases, but I want to look at this foreach right now and see if I can't make it a little simpler. A lot of what I have coded I have come back and turned into Linq sta...
The application I'm working on needs to occasionally take pictures, and then send them to either an ftp server or a network drive (user configurable). To try to abstract away the differences between a ftp server and a network drive I made this class. The idea is, the code that takes a picture with the camera and saves ...
To generate a password, I generate a key using RNGCryptoServiceProvider. The key is 9 alphanumeric characters long into which I insert a single non-alphanumeric character for a full length of 10 characters. Having a mix of Uppercase, lowercase, numbers and symbols and being 10 characters long, as a plain text password ...
This is code that gets a list of polygon vertices, non-ordered, and finds the order in which they should be arranged in order to create the polygon with the largest area. There are two key elements in the approach: Testing the area of the polygon is done by Monte Carlo calculation. Random points are dropped on the pla...
I have switch statement that is switching on an enum to build a ContextMenu depending on what the selected enum value is. While the various enum values require different operations in their cases of the switch, some of them require some of the same operations. All of the MenuItems are declared as readonly and initializ...
This is a toy version of the code I really want to write: #include <stdio.h> #include <stdlib.h> typedef struct node_s { char val; struct node_s *next; } node; int n; char obtain_next_char(){ if (n<100) { return 'a'; } else { return 0; } } int main() { char c; node *start, *curr; ...
The program can be used to hide an image within another image and later extract the hidden image. This is done by concealing the secret image within the lowest bits of the apparent image. Example of a cat hidden within a tree. I split it into 2 programs to make commandline args parsing easier, Crypt and Decrypt. Info.h...
earlier I coded a quick console worker that runs a timer every 1 second and updates the consoles timer with how long the app has been open, how can I improve this? using Faze.Other.App; using log4net; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using S...
I got this as part of some interview assignment. After some head scratching I think I have done quite well as the result can be seen here: After transformation(10x10 tile): More crisp picture with smaller tile size: So, the requirement were: Not to use any external library. Only front end code. Should be a producti...
I am quite new to using python for machine learning. I come from a background of programming in Fortran, so as you may imagine, python is quite a leap. I work in chemistry and have become involved in chemiformatics (applying data science techniques to chemistry). As such, the application of pythons extensive machine le...
I created this as a template for our email marketing team to use when creating emails. For fluid/responsive behavior, I am using max-width and conditionals for clients that do not support it (e.g., Microsoft Outlook). If anyone could give some suggestions for improvement, that would be appreciated! <!doctype html> <htm...
A few hours ago I posted a similar question but this is a follow-up, I have revised the code and added and removed certain lines of code and hopefully improved it a bit, I just brought it here for a final cleaning, can anyone notice anything than can be improved even more? Some of the code has been totally changed such...
Decided to get a little JDK 8 practice in today, so I built two methods to print out the golden ratio, one uses the Stream API the other does not. Wanted to request general feedback on how well I implemented these methods (mainly the stream generator,) considering the given task and if there is anything I could have do...
Basically, what I mean by splice is to take an array of Enumerables, take the 1st element from the first one, then the 1st element from the second one, and so forth, until we come back to the 1st enumerable, and we then take the next element from it and each of the others. Sort of like this: [A A] [B B] [C C] [D D] [E ...
Inspired by Swift's @autoclosure feature, I tried writing a brief C++-14 header that permits "optionally" lazy parameters (by "lazy" I mean @autoclosure-like; I chose the word "lazy" in emulation of lazy evaluation in languages such as Haskell). From this post on interesting Swift features: The @autoclosure attribute ...