instruction
stringlengths
71
71.9k
The following problem is from codechef.com: Recently Chef become very much interested in perfect squares. We all know Chef and his weird interests. Anyways Chef will be soon writing his masters thesis on perfect squares revealing what-not-known properties of perfect squares. While doing his research, he happened...
I made a simple administrator page lock in PHP and I was wondering how secure it was. I want to use this script to secure administrator pages for my portfolio site but I want it to be fairly secure. <?php /* * Array of authenticated users */ $users = [ // Username => Password 'admin' => 'password' ]; /* * Exp...
Can you review my code? class Router { /** * Store the current URI [0] => Controller/ [1] => Method/ [2]=> parameter * @var array */ private $URI = array(); /** * Store an instance of configuration object * @var object */ private $config = NULL; /** * Store an...
I have a query that populates an array from the database. In some cases, this query returns a great amount of data, (let's say for purpose of an example, 100.000 records). Each row of the database has at least 6 or 7 columns. $results = [ ['id' => 1, 'name' => 'name', 'status' => true, 'date' => '10-01-2012'], ['id...
I am wanting to build web-based testing tools for test website environments utilizing the Selenium Web Driver. I am building a GUI which will contain the following: Drop-down for selecting the website, toggle button for selecting the testing environment and a button for launching the specified browser you wish to test ...
I wrote this Fortran module and I need its subroutines to run as fast as possible. My hope is to get some advice to optimize this code, and after having the serial version running as fast as it can run I will use MPI to make it parallel. Module smearingmodule IMPLICIT NONE contains subroutine smearing(i, nMCd, nPeriodT...
I have code that reads from files of surnames, female and male names and randomly generates a name in the following format: lastname, male/female name. The files are in the following format: JAMES 3.318 4,840,833 1 I have the following working code: def picks(filename): with open(filename) as f: li...
I need to expand the functionality of this project to encompass more commands (you may notice in GetSelectedFilePaths() I have a case that is not currently used, this is to support additional commands I plan to add in my next sprint). So, before going further with this project I thought I'd post it up here for review....
I wrote a simple Python app that is given an IP address and port and the app then finds the PID listening on that IP:PORT. I would like to hear constructive criticism regarding the bellow code. import argparse import sys import socket import subprocess import os def is_legal_ip(address): ip = address.split(":") ...
I have a search form that doesn't require much in terms of input parameters, but the Date Of Birth is import for this particular search. I have been working on creating a way that the form can be intuitive and keep people from attempting to search for a minor. Is there anything that I can make simpler or more efficient...
I have an Array of 5 objects, some key values need to be changed based on the browser width. ie: 5 cols, 4 cols, 3 cols or 2. vs.streams is an Array which is tied to a AngularJS model. When the selected value is true, that data will be called via an API And displays in their appropriate columns. function checkBrowserWi...
This method returns true if any arrays element is equal to another element value, returns False otherwise. public static boolean distinctValues(int[] tmp){ for (int i = tmp.length - 1; i > 0; i--) { for (int j = 1; j < i; j++) { System.out.println(j + ". " + tmp[i] + " and " + tmp[j] + ...
I started to code in C++ and tried to implement a simple BST data structure. Since at the moment I am learning about the Rule of Three, I tried to implement it in my code. Yet, I realize that my code might be far from efficient. I also doubt whether I've made a right destructor or not. What are the best practices to us...
This is my first calculator in Java. I just started learning a week ago so any feedback (positive and negative) is welcome. Tell me what's good and what I can improve on. import java.util.Scanner; public class Calculator { public static void main(String[] args) { // Creates scanner object Scanner...
It's pretty typical for Linux command-line utilities that deal with files to accept either a file as input, or stdin. It's also pretty common for them to be able to output to a file or to stdout. These should be supported: python myprogram.py input output cat input | python myprogram.py > output python myprogram.py in...
I am currently working on a binary serialization library written in C++11 for a personal project. I'd really like to have a review about my design, my implementation and everything else. The library is inspired from QDataStream. Here is the GitLab repository containing the project. Sery/Misc.hh #ifndef SERY_MISC_HH_ #d...
I have some code that checks to see what event data is being passed back from two different media players. The first player sends back play button clicked, but the second player sends back the data I want but it's I have to parse it and read it to see if it matches play and startPosition === 0. Wondering if there is a ...
I decided to roll out my own encryption algorithm, which I am calling "SBC" or Simple Byte Cipher. Essentially, I just take the bytes of the string data, do a Caesar cipher like shift to it, increment through an array of password bytes for each byte in the data (this enables the same letters such as "T" to not always h...
This is my attempt at implementing debounce in Scala without any 3rd party library. How can I improve the code/make it more idiomatic (and any bugs I might have missed)? import scala.compat.Platform.{currentTime => now} import scala.concurrent.duration._ import scala.util.control.NonFatal /** * Return a fun...
I've written my own local "source control". Rather than using a commit-based system, when you're ready to release a version, you can run a command which will create a .zip copy of your source code, and it's saved to a versions folder. How does it work? Each "project" written with this has a specific file structure tha...
What are your thoughts and comments relating to areas I could improve on? import csv import re import requests from bs4 import BeautifulSoup class Resto: def __init__(self,url,filename="default"): self.page = 1 url = url + "&page={0}" self.url = url self.filename = filename d...
I have made an interactive transition controller in Swift in two different ways. This interactive transition controller is the parent class and I have few child classes which adapt the parent for each situation where I need an interactive transition. The first way, the parent doesn't use a delegate and forces the child...
I was recently at a hackathon and saw quite a few people using Parse, so I decided to check it out and read some guides online. Can someone take a look at my code? I followed Parse documentation so it should be fairly readable. I'm trying to get the balance for the user when they log in and display it. Parse.User.logIn...
I have code that uses the brute force technique to find the message to a Caesar cipher. The program decrypts the message using different keys and then checks whether the resulting words are contained in a file called 'wordlist.txt'. if they are, it returns only that result. from collections import namedtuple Keycode = ...
I have model action in RequestAdmin like this: def offer_plan(modeladmin, request, queryset): class MembershipForm(forms.Form): plan = forms.ModelChoiceField(queryset=Plan.objects.all(), required=True,empty_label=None) _selected_action = forms.CharField(widget=forms.MultipleHiddenInput) expi...
I have written the following function to empty and then populate multiple elements using jQuery: function drawHumanCard() { var random = generateRandom(); var humanEl = $('#human'); humanEl.find('#human-name').empty().text(cards[random]['name']); humanEl.find('#human-job').empty().text(cards[random]['...
I run a build system. Datawise the simplified description would be that I have Configurations and each config has 0..n Builds. Now builds produce artifacts and some of these are stored on server. What I am doing is writing kind of a rule, that sums all the bytes produced per configuration builds and checks if these ar...
I have to perform on some collection and return ranking based on some logic I wish to optimize this working code since I think it can be bettered (maybe using tasks?). I need to search on Counterparts item. I load this data from DB and I've got more aliases per counterpart. I need to return the result based on those cr...
I have an array of some arbitrary int values; I want to find the array containing the sum of the past elements in the current index. Example: int[] myArray = new int[5]{ 5, 7, 8, 2, 6 }; I would attempt to: myArray[0] = 5 myArray[1] = myArray[0] + myArray[currentIndex] = 5 + 7 myArray[2] = 5 + 12 + 8 and so forth ti...
I want to have a cross-cutting delete flag in my repository. I have the following repository pattern at the moment: public interface IRepo<TModel> where TModel : EntityBase<int> { TModel Add(TModel item); void Add(IEnumerable<TModel> entities); TModel Remove(TModel item); TModel Find...
I'm working through the Free Code Camp syllabus and I'm on to Intermediate JavaScript Algorithms. This Pairwise problem was the last challenge in that section. The section came just after "Object Oriented JavaScript." So I figured they were looking for an OO solution, but the instructions included a link to MDN's array...
I am writing a program that updates bonds in an external system that I have database access to. The program is run in an 8-minute interval. Bonds are stored in a table called Debentur. Bonds need to be calculated if they are new or it's calculation method is changed. The calculation method is stored in the column Calle...
Please help me decide whether this should be good or bad idea to declare a Singleton variable in Global.asax file. (It is not actually singleton pattern, I just want to make sure that only one instance is created for this class.) public class Global : System.Web.HttpApplication { private HTML5Video dailyHtml5Video;...
I have several Google Maps on one page and each has its own set of Lat/Lng co-ordinates. As a result I have added in the JavaScript options for each one individually as follows: function initialize() { var myLatlng1 = new google.maps.LatLng(49.18589, -2.19917); var myLatlng2 = new google.maps.LatLng(101.1986, -50...
I'd like to get some feedback on this very basic JavaScript to update which tab is showing as "active" on my simple web page. This is all in a file titled adjustactive.js and included in my footer template for all pages like so: <script src="assets/js/adjustactive.js"></script> Here's the full content of that .js file...
I've been having fun with this program and trying to use different methods and such to achieve the fastest possible word cracking program I can come up with. I'm pretty happy with my current program which is able to crack any three letter word on my computer (Dell Latitude E6400 Dual Core) well under a tenth of a secon...
The following programs are bubble sorting, selection sorting and insertion sorting. As most of the programs online or in books are with Arrays and not ArrayList, I am unsure if they are correct. BubbleSort: public class BubbleSort { List<Integer> unsortedList; private BubbleSort() { unsortedL...
So I'm working on a project that sometimes requires me to switch my server configuration. This is due to some circumstances with database drivers and names that are "too expensive to fix" ... That made me think though: "Why do I always copy these files around manually?" I decided I won't and wrote this small script to ...
See the previous and initial iteration. I got rid of Run objects and just maintain two integer arrays in the RunHeap: one for starting indices, and another for ending indices. Also, thanks to a great suggestion by @maaartinus, the algorithm is now stable. The last, but not least: I do not longer sift up a newly pushed...
I am writing an application with the repositories concept in php with laravel framework. In my controller I have this method: /** * Update the specified resource in storage. * PUT /locais/{id} * * @param int $id * @return Response */ public function update($id) { $data = Input::all(); $data['str_cat...
Rubberduck's latest (and greatest?) feature is a regex search/replace: This is the defining interface: public interface IRegexSearchReplace { List<RegexSearchResult> Find(string pattern, RegexSearchReplaceScope scope = RegexSearchReplaceScope.CurrentFile); void Replace(string searchPattern, string replaceValue...
I am running this code as a macro in Excel, which copies two columns from sheet 1 and pastes them into sheet two. It then compares the first column to a column in sheet two before deleting any duplicates. The two columns I am copying are product code and price. I need to compare the product code to the existing ones. P...
How can I make this "War" card game code more visibly pleasing? import random import sys class Card: def __init__(self, rank, suit, value): self.rank = rank self.suit = suit self.value = value self.name = str(self.rank) + " of " + self.suit class War: def wincards(self, winner,...
I wrote this script to add some config to a Juniper device. It works well but the whole user input validation section (yes or no section) seems a little messy. Is there a better way I could have done it? from jnpr.junos import Device from jnpr.junos.utils.config import Config import getpass #Grab credentials username...
Recently, I reviewed this question about an LZW decoder. In order to properly review that question, I needed to write my own encoder and decoder to be able to test their program. Someone thought it would be interesting to submit these programs for review, so here they are: encode.c /* * LZW encoder * * - Uses fixe...
surface is a pygame.surface object from the Pygame graphics library. It actually runs way faster than I thought it would for a first try. Still, have I made any obvious mistakes here? Is there any way to make it go even faster? cdef mapped_chromatic_aberration(surface, numpy.ndarray[int,ndim=2] intensitymap): cdef ...
Have one div: Here's what scrolling of this div should look like: The only way I see is to duplicate div to left and right sides of original one, and then scroll the whole bunch. Here is a corner-cutting implementation sketch: Fiddle $(document).ready(function() { $original = $("#original"); // Duplicate div to...
I wrote this echo server in Haskell as a way to introduced myself to programming with sockets in Haskell and generally practice Haskell. The echo server has a simple purpose: accept connections from a port (provided as a command line argument) and echo data read from the port back one line at a time. import Control.App...
A class Array which contains two data members: a pointer on array of complex numbers and the length of the array. Implement a function for reading the array. The class should have a constructor, destructor and copy constructor. In the main program, enter the array of complex numbers. main.cpp #include <iostream> #inc...
The program downloads stock information from Yahoo! Finance and displays it in the spreadsheet. On my Mac the program takes 10 minutes to get data for approximately 4000 stocks and on the PC it takes 45 minutes. I wrote another version which copies and pastes the data instead of iterating through each price value, bu...
I've created some custom code that will capture how long a user spent viewing a picture. The timer will stop when the user clicks or escapes from the fancybox view. Is there an alternate way for me to implement this functionality without using the counterStop setInterval() variable? The specific reason why I added an...
I'm trying to print a binary tree in vertical strips. For instance, a tree like this: 8 / \ 6 10 / \ / \ 4 7 9 12 / \ 3 5 Is printed out as: 3 4 6 5 8 7 9 10 12 Here's how I'm doing it: Map<Integer,Set<Integer>> printStripsVertically(TreeNode root, Map<Integer,Set<Integer>> ...
I'm trying to improve my skills with the Task-based Asynchronous Pattern (TAP), by writing simple task-based wrappers around some WMI methods: void Main() { var driveLetter = "E:"; var query = string.Format("select * from Win32_Volume WHERE DriveLetter = '{0}'", driveLetter); var searcher = new ManagementOb...
I'm trying to unit test an AngularJS service that is dependent on another service, using QUnit as my testing framework. The first test I'm writing is one to verify that my service calls another service under specific circumstances. Below is a runnable example. I'm mainly looking to get feedback on the contents of the s...
This is for Java 6 and uses Guava. It's a little ugly and I'm worried I missed some obvious way to do it a lot better. If there is more than one element satisfying either condition I am saying it's false because the condition I am checking should be unique among the list. If and only if the one element satisfying cond...
This is a partial update of this question. An implementation of these interfaces is in this question. To summarize, the class is a generic container similar to MaxHeap, but only needs to support the following operations. create from an existing collection or finite IEnumerable (constructor / factory) with arbitrary co...
Problem You are planning a big programming conference and have received many proposals which have passed the initial screen process but you're having trouble fitting them into the time constraints of the day -- there are so many possibilities! So you write a program to do it for you. • The conference has multi...
Given a list of pairs of integers that represent closed numeric intervals, I need to output a list of intervals where the adjacent intervals are merged together. The code assumes that the intervals do not overlap and that a <= b in all pairs (a, b). Intervals (a,b) and (c,d) are adjacent if b + 1 == c. merge [] ...
fn basename<'a>(path: &'a str, sep: char) -> Cow<'a, str> { let pieces = path.split(sep); match pieces.last() { Some(p) => p.into(), None => path.into(), } } Usage: println!("'{}'", basename("foo", '/')); // outputs 'foo' println!("'{}'", basename("bob/", '/')); // outputs '' println!(...
This is the Matrix Rotation problem from hackerrank.com. You are given a 2D matrix, \$a\$, of dimension \$M×N\$ and a positive integer \$R\$. You have to rotate the matrix R times and print the resultant matrix. Rotation should be in anti-clockwise direction. Rotation of a \$4×5\$ matrix is represented by the foll...
I am using this code to add a class on mouse hover to a link button and remove it on mouse leave. jQuery(".banner-wrap__color-1 > .banner-wrap__inner > .banner-wrap__desc > .banner-btn > .btn-link").hover(function () { jQuery(".banner-wrap__color-1 > .banner-wrap__inner").toggleClass("active"); jQuery(".banner-...
Can this code be improved from an OOP paradigm perspective? package JavaCollections; import java.util.Iterator; /** * Dlist using sentinel node * * @author mohet01 * * @param <T> */ public class DblyLinkList<T> implements Iterable<T>{ /* * Representation - starts * * */ /** ...
I am a moderator of /r/sweepstakes on Reddit, which lets users post their referral links to contests/sweepstakes. One main rule is that a user is not allowed to post their link to a contest, if another user has already done so. It's not so simple checking for reposts since all referral links have a different URL (i.e. ...
I have started reading clean code and want to improve my coding practices. Here is my attempt at solving an online puzzle. Please review the code and let me know how could I have written it better in terms of logic, coding practices or any other advice you might have. Problem Statement Sherlock is given an array of N ...
I've developed quickly two kinds of socket use: the first with blocking mode and the second with non-blocking mode. The sockets are Unix domain sockets. My problem is that the kernel consume a huge amount of CPU (approx: 85 %). My goal is to minimize the kernel CPU usage and to increase the throughput. I use taskset co...
I am adding some constraints for my auto layout. My method calling the methods creating the constraints: // all if displayUnitConversion && displayCode { if currency.isDefaultCurrency { buildConstraintsForDefaultCurrency(view1: computedRateLabel, sizeView1: 37, view2: codeLabel, sizeView2: 27) } else { ...
While writing a C++ GUI application more or less from scratch I needed some form of an event-listener system, preferably using lambdas. An event should be able to have multiple listeners and the user should not have to worry about the lifetime of the objects. I came up with this bit using shared and weak pointers to de...
The process: I read the lookup and create a list aa. I traverse through the glob.glob("C:\\project resource\\dump\\*.html") and find matching. If a match is found, I create a file if not available, but if available, I just append it to the file. import glob,re from bs4 import BeautifulSoup import unidecode lis=[] aa...
I am looking for a function, that will find in array of n integers highest or equal locally values including corners. My code is probably wrong, and I somehow think solution is in some library like NumPy or SciPy, but I do not know how to find it: def look_for_maximas(vals): ''' actually look for hills, 1, 0, 1...
I wrote a custom class which (atm) displays the +, -, =, x, and ÷ operators inside a circle. Apart from the issue of some symbols not appearing in the exact center (everything except + looks a bit off) it works great. It uses an enum to select the symbol to make using the ÷ symbol easier. public enum Operators { Plus =...
This is another part of the update to this question. The interfaces are in this question. To summarize, the class is a generic container similar to MaxHeap, but only needs to support the following operations. create from an existing collection or finite IEnumerable (constructor / factory) with arbitrary comparison rul...
I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at least two input signals are strong enough, the axon is activated. I consider the neuron to be learned as soon as it "gues...
Follow-up to this question as recommended. Can this code be improved from an OOP paradigm perspective? package JavaCollections; import java.util.Iterator; import java.util.NoSuchElementException; /** * Dlist using sentinel node * * @author mohet01 * * @param <T> */ public class DblyLinkList<T> implements Iter...
This works, and the UI is snappy in the simulator, but since this is my first time really using GCD, I'd just like this code to be reviewed before I start using it everywhere. Note that this is inside a PFQueryTableViewController. My function: func tableRefresh() { // get quality of service (high level) ...
Problem Statement In this problem you will use regular expressions to help you detect the various Tags used in an HTML document. Here are a few examples of tags: The "p" tag for paragraphs: <p>This is a paragraph</p> It is also okay to have one or more spaces before or after the tag name: < p >This is also a p...
This struct is used a lot throughout my programme. This struct is responsible for only things regarding colour, not anything else. I'm largely concerned of the bitwise operations, and the fact that I store four byte values in a uint but access them with bitwise flags. This is a concept I use throughout the programme. (...
Write a Java application that prompts the user for pairs of inputs of a product number (1,2,3,4,5) and quantity of units sold (any integer)? Use a switch statement and a sentinel-controlled loop (i.e., a loop that stops execution when an out-of-range value, such as -1, is input). All 15 items below are for a sin...
I am writing a test web application in Golang. Create post handler: type NewPostReq struct { Title string `validate:"required"` Description string `validate:"required"` Body string `validate:"required"` Tags []struct { Tag string `validate:"required"` } `validate:"min=2,d...
I am using this code on my own personal website (my personal administration site) so it doesn't need any security and so on. I am not into learning everything about that yet, and although I do know a lot about it already, it is not the case for this code. My order/sort links are looking like this: {{ URL::route('events...
I have millions of files in the Google cloud storage's bucket. I want to search within files with a .index extension and retrieve the contents. This is currently what I am doing, but the time required for overall process is large. Is there any better and faster way to do this? class storage(): ... self.indexFil...
I do a lot of unit testing(tdd) and would like some comments about my style. Here is a simple example from a composite. Is there anything I could improve? public class ChangedClaimsServiceComposite : IChangedClaimsService { private readonly IChangedClaimsService[] changedClaimsServices; public ChangedClaimsSer...
I wasn't satisfied with Simon's alert on the orange alert. I wanted to know if even 1 review item was available, so I made some modifications to the userscript so that it runs on the Review page, and only alerts you when there are reviews that show a positive number. This is Simon's version, and here is my version: /...
I've created a custom slide show container to use with Jekyll. This is the platform used by Github pages. It works by converting plain text Markdown to HTML. I wanted to be able to embed the slide shows in the Markdown as inline HTML, so the following is a usage example: some_file.markdown: ... text ... <div class="s...
I'm creating a meta-utility tool for a project that I'm on that has a lot of repetitive tasks that can eat up a lot of time. My goal with this tool is to eventually be able to automate, or at least facilitate, the vast-majority of grunt-work. I eventually hope to add Django functionality to create reports from e-mail...
I have a CSV file, call it csv_file. It has the following content: Username, Password name1, pass1 name2, pass2 ... I also have a dictionary, call it mydict. It has the following content: mydict = { "name2" : "pass2", "name3" : "pass3" ... } I want to update my CSV file to now include name3, pass3, since...
Is there a way to speed up this code so it is \$O(n^2)\$ instead of \$O(n^3)\$? I'd appreciate if someone showed me how to do so. public void minimalSpanning(int sVertex) { source = sVertex; boolean[] mstv = new boolean[maxSize]; for (int j = 0; j < gSize; j++) { mstv[j] = false; edges...
The dictionary class loads entries from a file and then can perform operations on them. The dictionary class then stores the entries back into the file. I would like to know the best way to check if the arguments to my dictionary member functions are valid terms/definitions. I have thought of two possible solutions, b...
Factorio is a game about building factories and about automation. Items can be crafted (just like Minecraft) yourself, or crafted automatically by assembling machines. To help me expand my factories I created a little script in Python 3 that shows me what other items that I can produce once I create factory of an item....
Recently I've written some code which implements snap-to-edge functionality for some windows. There is some code duplication as you can see. I think this code can be simpler or possibly improved. // If 'rtParent' and 'rtChild' are closed each other as 'ENABLE_STICK_VALUE', return true; auto IsNearEachOther = []( cons...
It's easy to write a function that adds two ints in F#: let add x y = x + y Actually, it's the same as: let add (x:int) (y:int): int = x + y If you need to make it generic so that it can take arguments of other type than int, you should use inline keyword: > let inline add x y = x + y;; val inline add : x: ^a -> y...
I wrote a quick script and wanted some critique, as I don't get to practice my coding often, or even in one language I might make some idiomatic errors. The program works and runs \$145,555\$ entries (\$873,330\$ lines in the original data) in approximately five seconds. It may run up to a few million entries later. So...
Do you think this works well? I.e, do I need to close the database connection at the end? The goal is to be able to upsert and delete many records in one shoot. Here is is an example HTTP POST request with JSON body to use it: {"db" : "Memorise", "upsert" : [["Diagram", {"_id" : "abcd", "key1" : "value1"}]], "delete" :...
A new scheme user trying to use syntax-rules to define something like the Haskell where keyword. Sometimes this is useful since when we do programming, we first design in the high level, where all the names left undefined. In later steps, we define those names and complete the program. where keyword preserves the order...
I have written a script for basic uploading of a single image to a web server using PHP. This is an example that is intended for educational purposes in a basic PHP course. It does not take extensive consideration to security as it is not the focus. Key points to focus on the review: If the code comply with the PSR-1 ...
I have written some code to suspend someone's enrollment to a course. A course may have multiple presentations. module Enrolments class Suspend attr_reader :enrolment, :responses, :comment, :user_id attr_writer :event_service, :suspend_enrolment_presentation_service def initialize @responses = [] ...
Recently I started to learn Haskell. I did this by making exercises on the Internet. The problem of making these exercises is that I never know if I solved it the correct way. I currently wrote a function which I think looks really ugly, but I don't know how to improve it. I hope that someone could give me some tips to...
I struggled my way through the first quiz and here are the results. Since I have some experience in jQuery I really wanted to use only vanilla JavaScript. I know the code is pretty choppy and there is most likely a lot of room for improvement. How can I make this code more succinct? What are some better practices th...
Motivation: I'm relatively new to C++. I'm writing a function meant to be used with range-based for loops. The goal is to be able to iterate over multiple containers at once, each in turn (essentially Python's itertools.chain), with as littler overhead as possible (e.g. no copying containers). Usage: vector<int> a = {...
I wrote this in Java (I know that the brackets don't exactly follow the standard way of doing it in Java - so it looks a bit like C#). But I was wondering how this algorithm is percieved. I have seen some iterative ways of solving the problem - but I thought recursion improves readability here. Every node in a Binary T...
I have recently started using Laravel as my chosen framework. It is my first time using a framework. As I have made progress through my project, my controller methods have started to increase in size. My concern is, I feel like I am doing it wrong. It seems way off of the OO approach. An example of one of my controll...