instruction
stringlengths
71
71.9k
I have not used Springs stored procedure class before to return data and I was hoping someone would be able to check this for me.. If it will A. Return data, B. Can be improved. C. If I wanted to return multiple rows how would this need to be changed? public class AccountAddress extends StoredProcedure implements DAOC...
I am trying to build something that will allow us to configure "custom" validation for each customer. So if a customer wants to see a value contain a specific char, be specific length, or equal something else they just add a pre-created option. I wrote something that seems to be very primitive, but works. I would li...
I have two functions that are used to prompt and recieve input from the user. One is for int and the other is for boolean. They work somewhat similar to each other, one uses try/catch and the other doesn't. Can they be improved upon or is one better than the other? I'm having trouble with the user interface, I'm not su...
I'm very new to Python and would like some feedback on my script. I'm fairly clueless to best practices, code correctness etc. so if there's anything at all that looks wrong, isn't 'pythonic' or could be done in a simpler way, I'd love if you could point me in the right direction. #!/usr/bin/env python """Follows Ins...
I finished answering Exercise 3.3.1 of How to Design Programs where: Exercise 3.3.1. The United States uses the English system of (length) measurements. The rest of the world uses the metric system. So, people who travel abroad and companies that trade with foreign partners often need to convert English measur...
This is my first code. I would really appreciate a critique for it, if anyone can spare the time. def wedcost(hours): print " " try: hours = int(hours) except ValueError: print "Invalid input" new_hours = raw_input("Please use only numeric characters. ") hours = int(new_ho...
I am trying to use decorator pattern to decode and encode packet layers in my application. I've supposed my packet has three layers: Header, Level2, Level3. So far I've come up with the following code. For the sake of simplicity, I've supposed that the data of each layer is the first 10 bytes of the input packet. I've ...
I'm trying to solve the SPOJ primes problem: Peter wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all prime numbers between two given numbers! Input The input begins with the number t of test cases in a single line (t <= 10). In each of the next t lines there are tw...
The code below prints sum from 1 to 10: \$1\$ \$1+2 =\$ \$1+2+3 =\$ \$1+2+3+4 =\$ \$......\$ \$1 + ... 10 = 55\$ public class Solution{ public static void print_sums(){ int sum = 0 ; for(int i = 1 ; i <= 10 ; i++){ for(int j = 1 ; j <= i; j++ ){ sum = sum ...
Following is a function that takes a long matrix of states and corresponding values (every row is a state), and collects optimal solutions given those values from an interpolating function (getV()) of a grid that contains the optimal solutions (V). I'm looking for suggestions to clean up the code, but most importantly...
I have to convert positive numbers, that are less than 1000, to words. A quick search didn't find anything that looked good to my eye, so I came up with the following. While I was at it I expanded the conversion. I am looking for comments, suggestions, or errors I am missing. Public Class NumberToWords Public S...
This is an answer to this problem. Basically, given an array, swap the given number of elements in the array. The solution that came to my mind: since we always swap at least two elements, pick two random indices and swap array[first_random] with array[second_random]. Then, if there's more to swap, find index that was...
I've tried to create an implementation of a tree for comments. I want use it in Django to store comments. Please tell me how to implement it much simpler, without recursion, to find child nodes. class commentTree(object): def __init__(self, id, data, parentId = 0, childrens = None): "Represents one leaf Tree" s...
I'm building a small web app primarily for mobile use. I have some widgets that need to handle tap gestures in the expected way, and I don't feel this one feature is reason enough to include JQuery mobile. I've written the following function for making an element respond to "tap" events: function bind_tap(el, cb) { ...
I'm trying to simplify our unit tests with hand written DSL's. So far I have DSL's that walk developers through processing a service after setting up all preconditions and the construction of an monster object that has a huge constructor and setters that conflict. The monster is one of the many preconditions of proce...
I am trying to improve my coding skills. As a result, I solved the T9 Spelling question from the Google Code Jam dashboard. I will appreciate it if anyone could critique the code, and provide illustrations (if possible) of how I could make my code clean and simple. For me, simple is really beautiful. Google judges the ...
Following is the main file in the project (executing tasks). It uses the mpi4py module, and multiple processes execute the same code. Please review the code and post your suggestions on making it more efficient and pythonic. from mpi4py import MPI from Peers import Peers from SegmentHandler import SegmentHandler from C...
I am writing a C++AMP library, and as one of my utility methods I am implementing a parallel reduction algorithm based on the cascade method documented on this blog post with slight improvements by utilizing asynchronous CPU execution. Does anyone have any performance/correctness/language improvements to offer? templat...
To understand the basic workings of PHP I wrote a test page where one can create, load and edit entries (name-info-pairs) in a list. It would be cool if you could give me some advice on that to improve. <?php class User { public $name; public $info; Public function __construct($name, $info){ $this->name = $na...
For now, I have two views using Twig: messages.html.twig item.html.twig The first one is the view which displays all of the users' posts in my forum. When a user post a new message, it's done via Ajax so the server returns a view with the posts information. That view is item.html.twig So I have something like: messag...
I have a prime-finding class here that needs improvement. Sample result: Number of primes? 10 2 3 5 7 11 13 17 19 23 29 Total calculation time: 6 milliseconds Calculation time per number: 0.6 milliseconds As more prime numbers are calculated, the calculation time per number increases. 100 primes: Number of prim...
The code below is used to check if there are tags or categories in the database. If they exist, they are not added to the database, otherwise they are added. Is this code efficient and easy to read? private void CreateTagCategoryBlog(string Tags, string category) { int lastInsertedId = postRepo.GetAll().Las...
I have class House and module Lockable. Locking and unlocking House should reflect the real world, so you can't lock twice. Do you think this is a good approach to using a module and raising an exception? module Lockable attr_reader :locked def lock! raise StandardError, "Already locked" if @locked == true ...
I have this obsession with esoteric programming languages. So I decided to spiff up my previous Brainfuck interpreter. # Simple BrainF*** interpreter # Class that stores lang variables class Lang(object): step = 0 cell = [0] * 30000 test_cell = [0] * 30000 pos = 0 test_pos = 0 loop = False ...
This code was inspired by this question: Number to Words import Foundation extension Int { func plainEnglish (negativeSign: String = "negative") -> String { func singleNumberName (number: Int) -> String { switch (number) { case 1: return "one" case 2: return "two" ...
Following along with some previous questions: The @dbasnett original here: Number to Words @nhgrif's here: Int extension for translating integer to plain English I wanted to answer the original question with a different algorithm, but was not able to get the VB.net code to work. I see @nhgrif had the same idea as me,...
I am trying to compare the RemoveAt() function performance in an array and linked list. For array: public T RemoveAt(int index) { if (index >= this.count || index < 0) { throw new ArgumentOutOfRangeException( "Invalid index: " + index); } T item = this.arr[index]; Array.Copy(th...
I have a function: Private Function getbyte(s As String, ByVal place As Integer) As String If place < Len(s) Then place = place + 1 getbyte = Mid(s, place, 1) Else getbyte = "" End If End Function For extracting a character at a particular place in a string, how can I shorten this or any alternate for the same purpos...
I'm quite new to Python and have been experimenting. So far I have made a simple hangman type game which creates a random word and the user then guesses it. I'd like to know if I've committed any bad practices so I can learn early on what to and not-to do. #Word Game Python from random import randint #Define an alphabe...
I've created a PDO wrapper. I understand PDO could be used on it's own, and I'm reinventing the wheel as there are solutions like Laravel's Eloquent that would do a better job. I'd like advice on best practices used here, which would be much appreciated. The idea is to have a central Database class and separate classes...
I am making a Python program that does math and physics calculations for you. This is my first programming project and is a work in progress. The SymPy library was used for some portion of it. import math import turtle import webbrowser from sympy import * Planck_constant = 6.626176 * (10 ** -34) Reduced_Planck_consta...
Is this a better way to validate a text box for mobile number only? Validation: allow only numbers will not allow to paste string including characters allow copy from the box length is set to 10 without country code allow back space Suggest some methods to help me improve my function. Public Sub mob_validation(ByVal ...
Since XSLT 1.0 doesn't have a lot of convenience functions, I have had to cobble them myself. The below capitalizes "words" in a string as defined by a string of delimiters. Is there any way to improve it? <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1....
Problem Description A profiler is a tool which provides information about run-time performance of an application. Lets say. you are given output file format of a profiler called Jensor. Jensor captures response times of methods executed by capturing method entry and exit events. The entry and exit events are w...
This method takes a text file of my work schedule and parses it. It works, but is kind of kludgey, and I'm looking for feedback and suggestions. My first attempt at a file parser, and my first look at Python (I have dabbled in Java/Android and JavaScript). I'm hoping that between the pseudocode and the comments it w...
I've written up some generic code for a card-game and would like to hear any and all suggestions for how to improve this code further, in any way shape or form. The code is on github or pasted directly below: Card class: class AbstractCard: """Abstract class for handling comparisons between cards based on rank""" ...
I am dealing with the following problem: Write a method for the Queue class in the queue.java program (Listing 4.4) that displays the contents of the queue. Note that this does not mean simply displaying the contents of the underlying array. You should show the queue contents from the first item inserted to the last...
The following three source files is to define and test a class StackLayer. While it was written in a need for scalable layer-based architecture design, it was also a practice for std::shared_ptr (I'm new to C++11). I'm not sure if I'm understanding the concept and best practices for std::weak_ptr and std::shared_ptr. Y...
I am building my first application based on the OOP model. The application basically responsible for sending XML Soap requests. Model contains couple classes - Server.cs which contain servers IPs, Query.cs for XML soap texts, Message.cs which will contain list of queries put to specific message to be send, and Sender....
This seems like a popular topic lately, so I took a crack at it. Related questions are Number to Words and Converting a number to the text representation. I used this article as a guideline. The article mostly explains by example, but some key points were: Use a hyphen to separate numbers like twenty-two. Using and is...
I have this method that is working perfectly fine, but it's very slow, and sometimes I have to wait 15 minutes to get a good result, which is ok. I'm wondering if I can make it faster. Basically I'm running best fleet simulations, and I pre-calculate the possible ship combinations for specific voyages, but then I have...
So I needed very basic state management and notification for a small game-like thing I'm building. I decided to implement something like a finite state machine (but not quite, it doesn't transition upon events, but instead is told to transition). This is mostly used for changing visual behavior and animation or whatnot...
I have a problem where you have a bunch of probabilities associated with a number. In this case: any number between 0 - 0.3 should return 0, any number between 0.3 - 0.7 should return 1, any number between 0.7 - 1.0 should return 2 Is there a better way I can achieve this? import random class ProbChecker(object): ...
I don't understand the concept of autoloaders, other than the bare minimum, which is that to load a class file when the class is being called. Or as the PHP manual cites it, to avoid having to require multiple time. I get that, but what I don't understand is the complexity behind almost all the autoloaders which I sou...
I have this working function circuitFind that I really don't find nice because I feel there is a better and simpler way to accomplish what it does. circuitFind :: Circuit -> Tile -> Maybe Position circuitFind c t = unpack . find (\ p -> fst p /= Nothing) . enumerate . map findTile $ c where findTile = findIndex (=...
I thought of this algorithm today. It seems fast, but how can I know? #include <string.h> #include <stdlib.h> #include <stdio.h> #include <assert.h> /* * Reverse a string * the caller has to free dynamic memory allocated */ char *mon_string_rev(char *string) { char *out = malloc ( strlen(string) + 1 ); ass...
I'm interested in seeing different ways the proc can be expressed inside a method that takes args. This method is meant to be a sort of FizzBuzz that will dynamically replace "Fizz" or "Buzz" as well as the traditional divisors 3 & 5. def fizz_buzz_custom(string_1="Fizz", string_2="Buzz", num_1=3, num_2=5) proc do |l...
I'm writing a method to throttle duplicate requests taking place within multiple HttpModule instances within a web application. Currently, I have the following setup: // Container for semaphores private static readonly ConcurrentDictionary<string, SemaphoreSlim> SemaphoreSlims = new ConcurrentDictionary<string, Semaph...
As a sequel from my previous question, I decided to solve the next problem statement from the GCJ dash board. Any thorough critique, this time, with much attention to skill and technicalities would be much appreciated. I have few questions: According to the problem statement, the number of test cases was to be read f...
I don't use Ruby on a regular basis, but I felt inspired to write an extensible, object-oriented version of FizzBuzz to sharpen my skills. I welcome all feedback. The main class: class FizzBuzzer def initialize(*tests) @tests = tests end def run(values) result = [] values.each do |value| str = ...
How could I take this code and optimize it so that I could possibly run Conway's Game of Life on a large grid at 15 frames per second? public partial class MainWindow : Window { Cell[,] activeCells; //List<Cell> nextGenCells; static Timer time; bool onOff = true; int columnNum = 10; int rowNum = 10; int codeColumn; ...
Consider the following code segment written by a coworker of mine: public ActionResult Index() { DataRetrieveModel dataRetrieveModel = new DataRetrieveModel(); using (spc_web_trunkEntities db = new spc_web_trunkEntities()) { DataRetrieveDAL dataRetrieveDAL = new DataRetrieveDAL...
This is a follow up on this question and has now a follow up question here. I have implemented some changes to the class below and also added the method AddChildRange() to the ArchiveTreeEntry class. I have kept the method as static, as this method is the only purpose of this class, and none of the passed items will be...
I'm working on a class, what will be able to send e-mails for our customers. I need to help with review of my classes design. I'm trying to do it to be easy extendable in future. I'm thinking about using dependency injection to inject InputReaderInterface. But is it worth doing it? InputReaderInterface - has method: ...
This is a follow up on this question which is a follow up on this question This follow up is created, because the class in question contained something, which didn't do what it should do. Based on the suggestion for the RemoveRootArchiveDefinitions() method of the first follow up I have renamed the name of the return v...
I'm trying to select two groups of countries with different situations. SELECT cou.id, cou.title FROM continents con RIGHT OUTER JOIN countries cou ON con.id = cou.continents_id WHERE con.deliver = 1 AND con.active = 1 UNION ALL SELECT cou2.id, cou2.title ...
I wrote a simple shared pointer, which I think works pretty well. I would like to see your review of it. This is the header file: #pragma once #include <algorithm> template <class T> class SharedPointer { private: T* ptr; int* counter; void swapp(SharedPointer& first, SharedPointer& second); public: ...
I have built a simple wild card pattern matcher algorithm. I am concerned where it can be improved. Main concern is algorithm. Any other improvements are welcome too. What it should does: Match * -> one or more of any character Match ? -> any single character similar to the file search wild card pattern (ex: Windo...
Nowadays many sites introduce CAPTCHAs (Completely Automated Public Turing test to tell Computers and Humans Apart) for securing their sites. I wish to introduce the technique in windows forms, as expression evaluation CAPTCHA. Approach: Two randomly generated integers are loaded into two different labels Place a r...
I have designed a Python TreeNodeBase class, so all tree nodes I implement can inherit from this. However, due to the laziness inherent in a lot of trees, I would like some fields to be properties (using the @property decorator) instead. But doing so, the base class will raise AttributeError whenever it tries to set a ...
I have a large Sql Server view with this schema: [archive_ID] (int, not null) [archive_date] (datetime, not null) [archdata_path_ID] (varchar(50), not null) [archdata_value] (int not null) I need to group the records by the Date, and I need to extract just the first record for each group. This is the current query: W...
I have this task to find whether 5 integers are ordered from the smallest to the largest or not. Depending on the results, the program output should be "yes" or "no". No loops or arrays supposed to be used (according to the task). This is my solution, but it's 4 lines longer. Can anyone help me make this better? int m...
This is kind of a follow-on from here: Canvas animation I've been trying to copy the following GIF animation using a canvas. I have re-factored the code following Stuart's pointers and wanted to know if I was doing what I should be. jsbin /*Start Canvas*/ var Canvas = function(canvas) { this.canvas = canvas; ...
The code it self is pretty self explanatory, however i do not think it is very efficient at all. Is there a better way to do this? Its basically so i can track spam sites and save the sites into my honeypot db. <?php $site = $_GET['url']; $con=mysqli_connect("localhost","_","","_"); // Check connection if (mysqli_conne...
I'm normally a C# developer, but I've started to learn F# and I want to make sure I'm writing code in a functional way that suits the language. I've quickly pieced this together with my knowledge from reading Functional Programming for the Real World and various material from the Web. Please look and provide feedback o...
Could you help me to speed up/optimize this code: // Get API Keys var keys = xRoot.Elements("key").Select(key => new { ID = int.Parse(key.Attribute("id").Value), VerificationCode = key.Attribute("verificationCode").Value }); // Get status of account using API Key var tasks = keys.Select(key => EveOnlineClient.GetAccou...
Is there a simple way to combine the functions of this Powershell script? It would be nice to have it file to one output file instead of several output files. GET-DATE WRITE-EVENTLOG -logname Application -Source BLERG -EventID 1000 -entrytype Information -message "START CBM_PARSE.ps1" -category 1 #################...
I have just began porting an old project to ASP.NET MVC . In the end, I'll have a lot of controller methods like the one below, called by AJAX requests done by JQGrid objects in the pages: AJAX request: /UserRole/RolesByUserGridData?userId=2&_search=false&nd=1407171194811&rows=10&page=1&sidx=RoleName&sord=asc Contro...
I'm using this pattern since a few months and I was wondering if I can make it any better. The one thing I am not satisfied about is the dispose method. In every repository I have to add a dispose method that calls the base dispose method. Is there a way to get rid of the dispose method in every repository and just let...
I'm trying to write a general function to several specific stored procedures, but I'm afraid that it will cause errors that I don't see now. The function is to get the name of the stored procedure as a string, and get a list of objects that contain the parameters of the stored procedure. Does it look good to you? publi...
I'm playing around with trying to do things in a better way, and in a class I have for sending emails, I have the concept of a recipient. This gets passed into my other classes essentially as a struct that is a little more descriptive than an associative array. I'd like to know if the Recipient is going to be valid to ...
This is a follow-up review of Simple wildcard pattern matcher in Java I have built a simple wild card pattern matcher algorithm. I am concerned where it can be improved further. Main concern is algorithm. Any other improvements are welcome too. What it should does: Match * -> one or more of any character Match ? -...
This is a follow-up of an old question by @LokiAstari, modified for the current community challenge. The idea is to provide a compile-time integer range. I applied all the modifications that I proposed to Loki at the time and tried to write a class as close as possible to the standard library class std::integer_sequenc...
I'm working on some Scala problems given here, specifically: sealed abstract class Tree[+T] case class Node[+T](value: T, left: Tree[T], right: Tree[T]) extends Tree[T] { override def toString = "T(" + value.toString + " " + left.toString + " " + right.toString + ")" } case object End extends Tree[Nothing] { overri...
I'm working on a small isometric drawing system in JavaScript. After much help from the Gamedev section, reading old questions, I've got something working. However, it's still a little hacky. I need to fix the culling to be more straightforward and it still isn't quite getting edge tiles down correctly. I want to impro...
This method in my code uses a producer-consumer design to read many files and process them for use in an NLP algorithm. The completion service collects files as they are processed, which means that docId != index. Given that I need to retrieve probabilities elsewhere where docID == index, I've implemented a priority qu...
I have a function for generating RGB colors in VB6.0, and it is working properly. Please suggest improvements for this, if any. Public Function RandomRGBColor() As Long RandomRGBColor = RGB( _ Int(Rnd() * 256), _ Int(Rnd() * 256), _ Int(Rnd() * 256)) End Function
I have a controller that has a purpose of returning json depending on the route_id being passed from the route (Using laravel). There's a point in my code where I resorted to using a double nested foreach loop in order to iterate the values I want to be stored into an array. Everything works fine, but I feel like the c...
I wrote an EF browser to dynamically navigate through entities. Beside basic properties of system types, each entity can have several singular or plural navigation properties. In order to support all of these using a single batch of code, I come up with the following solution considering the following requirement: Eac...
For various reasons, I wrote this. For one, I don't like to wrap every single function in a separate class, which is too verbose. It's a state machine based on GoTW 57 function pointer wrapping and CRTP to make things readable, at least in client code parts. template <class Derived> struct StateMachine { typedef De...
I am trying implement the distance measurement between two distributions. The detail is described in here and input image . Let short summarize the idea of the paper: The input image is divided into inside region and outside region by using Heaviside function H Calculate the distribution inside region and outside reg...
I need to use the same code in different jQuery attributes. Is it possible to put this if in a external function and call it inside a change event? I would like avoid duplicating code. $("#Max").change(function () { var max = $("#Max").val(); var min = $("#Min").val(); if (max != min) { $("#Result").attr("disabl...
This problem is from the Stanford Open Course CS106B Programming Abstractions Assignment #3 Problem number 6 here. "You are charged with buying the plumbing pipes for a construction project. Your foreman gives you a list of the varying lengths of pipe needed. Home Depot sells stock pipe in one fixed length. You ca...
I always have a problem figuring out what good JavaScript coding practices and conventions are and if I'm following them, especially concerning OOP. So I implemented The Game of Life and wanted to ask if you have any criticism or suggestions. My main concern is the gameLogic.js file, but for completeness I'll post all ...
function GenerateRandomString($Length) { $Length /= 2; $cstrong = false; while ($cstrong != TRUE){ $bytes = openssl_random_pseudo_bytes($Length, $cstrong); } $hex = bin2hex($bytes); return $hex; } Is this a good function for generating a cryptographically secure random string? Is there a chance, that it'll g...
I have a situation in a class tries to create a group of same type of components and if some component fails then it needs to decide whether it should continue or throw the exception. Now the behavior whether to continue or re-throw depends in the context in which that class is used. So a obvious solution was to pass t...
For the past two hours I was searching for a built-in function for converting an integer to an equivalent Roman numeral, but it failed to achieve the target. Hence I wrote my own routine for performing this conversion. I think it needs some more clarifications. Public Class Form1 Dim ind() As Integer = {1, 2, 3, 4...
Is there a better way to write the following code fragment? I can't have more than 10 conditional statement in my method as it gives cyclomatic complexity. private List<AutoDto> getFilteredAutoList() { List<AutoDto> autoList = getAutoListForCoverage(); List<AutoDto> filteredAutoList = new ArrayList<AutoDto>()...
I've got a form that needs validating before the data in the form is added to a service queue: self.ee.on('validateForm', function(formData){ // Validation var isValid = false; var validTitle = false; var validDescription = false; var validObjectives = false;...
I have a class that serves purely as a data container for passing values from a parsing class to a class responsible for saving the data. I have been wondering whether it would be more appropriate as a struct. The class definition is below. internal class DataContainer { public string FirstName { get; set; } p...
I want to ask this question because I have been thinking about it for a while and I haven't discovered a solution that I am very happy with. When coding games, I've frequently run into the situation where it seems advantageous to step out of the OOP mindset and into a sort of functional programming mindset for a brief ...
I wrote a C# program to remove non-ASCII characters in a text file, and then output the result to a .NonAsciiChars file. The input file is in XML format. In fact, the data may all be on two lines, which is why I am not doing the replacement line by line. Instead, I'm using StreamReader.ReadToEnd(). The problem is, the ...
I have this code, which goes through a string and split it using a char delimiter. I am concerned where it can be improved. Main concerns are speed and memory usage with speed as the priority. Any other improvements are welcome too. Is there a better way (Without regex based split and without 3rd party libraries). Wh...
I'm nowhere near a PHP expert, but I have dabbled a bit. I can make things work just fine, but I am terrible at figuring out what is wrong. I was informed by our server admin that we have a mail script that is being abused, and I am unsure of how to remedy the issue. I am looking for help to see how someone is using th...
I'm looking to see if there is anything in this I could have done better or see if could have structured the code better. Here is the project on GitHub. import socket import string import sys import os path = "plugins/" plugins = [] # Load plugins sys.path.insert(0, path) for f in os.listdir(path): fname, ext = o...
I'm making a demo program for a job interview and I'd like to know if there is anything I can make work faster in my current solution. It's a C# console application that accepts input in form of a single string with the words delimited by , symbol. The task is to find the most commonly encountered combination of three ...
I have got the following C code and I feel it is crazy stupid and there must be a better way to do this, but just can't think of one and have yet to learn algorithms. /*generates 1000 random numbers, lists frequency*/ #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int count, generated_nu...
Currently, my team and I have 2 types of databases that are updated periodically, SQL Server and Access. Also, we run specialized reports based on those databases. Basically, we have 4 tasks that need to be completed: Update SQL Server Publish SQL Server Reports Update Access Databases Publish Access Db reports Acces...
I've been working on a simple login script. The registration part is still to be coded, but I'm done the login part. Are there any security holes in my code? I'm using SHA-512 right now but I think I'll change it to mcrypt later. Class User { private $db; public function __construct($db) { $t...
Recently, I became tired of how slowly os.walk seems to run (really, it should be called os.crawl), and made something recursive which moves much faster. I was using it to take directories I wanted and add them to an array, but this time I need to add all files to an array that aren't in an 'exclude array.' Does anyon...