instruction
stringlengths
71
71.9k
I have coded a database manager in C# that connects to a MySQL database and does a few things, etc.. I just wanted someone to give me a few tips on how I can improve this, and maybe make it a bit faster. DatabaseManager.cs using MySql.Data.MySqlClient; namespace Kiwi.Application.Base.Core.Database { sealed clas...
Problem I want to create a simple class for storing money - I will be storing dollars/cents as just ints for this model. Idea is to implement various operations on Money class - to be able to add/subtract/multiply/divide money by constant (division is integer for our model - so we don't support money less then a penny ...
I'm currently learning MySQL about prepared statements and I was wondering if this code I've written is the most efficient way. The process: There's a query that checks a table called 'websites' for a field called websites_pagecount. The same query then increments the field by 1. (I haven't done this is the database u...
This is not much of a question as more of an practice/experience project and feedback request. First off, this was a project I worked on when I started getting into Java last summer and had an assignment that required us to write a simple ATM application. As I'm looking at the code a year later, and gained a bit more e...
I am updating my gaming website's CSS and I was wondering if I am on the right track. HTML: <!DOCTYPE html> <html lang="en-US"> <head> <title>Summon The Assault - Index Page</title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="skins/nos1/style.css" /> </head> ...
Would this recursive solution's speed be comparable to a non-recursive solution? // returns location of the target public static int search(int[] arr, int start, int end, int target){ int midpoint = (start+end)/2; if(target > arr[midpoint]) return search(arr, midpoint+1, end, target); else if(target < arr[mi...
I just learned about classes today and wanted to find a way to implement them that interested me. I whipped up this little battle simulator and would like any feedback and critiques as well as any ideas or similar projects I could pursue. import random import time import decimal rnd = 0 class Unit: def __init__(...
I'm working through a Sudoku solver problem that I found at UPenn (no it's not my homework ;)). I'm a beginner at Scala, and I'm trying to write good functional code (not that this particular method really demonstrates that...). A problem that keeps occurring for me involves trying to use Lists but not using vars, as p...
What this function does it's to return an array of remaining dates that are e.g. Mondays. Is this really the best way to do that? function range(start, count) { return Array.apply(0, Array(count)) .map(function (element, index) { return index + start; ...
On machines where I don't have C# 6 I use this named string interpolation method. I tried to make it as pretty a possible as far as good coding practices are concerned but I just can't get rid of the repeating code for braces validation and index incrementation. Somehow I don't like it. public static string FormatFrom(...
Is this a right way to use/implement an external library into a project? If it's not how do you do it? class Mail { protected $mail; public function __construct(PHPMailer $mail) { $this->mail = $mail; $this->mail->isHTML(Config::read('mail.isHtml')); $this->mail->setFrom(Config::read('m...
I'm implementing an interface with the async method Execute. In this I need to call some synchronous code. (removing an item from a dictionary). What would be the best way to go about this? Alternative 1. internal class ClearClaimByClaimIdCache : IListenTo<ClaimStatusChangedEvent> { private readonly ICache<Guid...
I have a common issue that I face in my applications (because I don't know any better) and I want to improve. This is my usual structure: Project.UI (MVC Project) Project.BLL (Class Lib) Project.DAL (Class Lib) LinksConfigurationController public class LinksConfigurationController : BaseController { public async ...
What I have to do is to sort the array list and then rank them in descending order. I have to write a method to sort and display the names according to their final scores decreasingly. The output should be in the form: Rank_number1 Name1 new_final_grade1 new_final_score1 e.g. 1 Winnie A 94.4351629426243 (Rank_number...
I've created a Forum website tool for admins to add, edit, and delete users from their desktop, saving to a file, and uploading the file to the database, the program is not completed I'm posting it here for review thus far (People I'm creating it for would prefer me not having access to database, I understand I would ...
On my job I had the task to process multiple excel sheets, so I tried to make a generic component to make the conversion between the cell values and a java object type. The first thing that came to mind was a generic interface that will handle the processing of a particular column: public interface ExcelColumnProcessor...
Conway's Game of Life is a common problem. I had to write a version of it to get my current C# job, so I thought it would be a nice way to get into Python (especially as the example in the book are a little too simple for my liking) I've slightly abused the unit tests to print out the grids, normally I would not use a ...
I tried this program in both Orwell DevC++ and Visual Studio 2013 (program works correctly). My astonishment is the performance of the same program in both IDEs. While the former took only 395 milliseconds, the latter took a whooping 34984 milliseconds. What's wrong with VS2013? Is it due to the compiler it uses? Or is...
I wrote this jQuery code as I could for a dropdown menu. But I'm sure there is a way to make this code shorter. $(document).ready(function() { $('#show-menu-1').on('click touch', openSubMenu); $('#close-menu-1').on('click touch', closeSubMenu); $(document).on('click touch', function(event) { if (!$...
The issue that i'm trying to fix with this code is simple I have a huge dataset and I have to bind it (as readonly) to a DataGridView In that dataset I have some column that are key to list and I have to display a custom property from that list with the DataGridViewComboBoxColumn there is a big issue of unsharing row w...
Due to an excercise, I've made a function that converts given string to spinal case just-like-this-one (all lower case). I did it with two regular expressions. Can it be done with one, or generally better? function spinalCase(str) { //if string is not delimited if(str.search(/[_\s]/) === -1){ // insert dash ...
Context: The following code is used to look up a setting values based on multiple layers of configuration within the application. For any given setting (ie: default printer), the application can be configured at the following levels in order of precedence. Operation Material Workstation & Program Combination Workstati...
I'm new to C++, so I'm trying to learn the language by implementing all the type systems and languages in Pierce's Types and Programming Languages. My first attempt starts at the very beginning and implementes this very simple language "Arithmetic Expressions" on page 41 in the book (for those that want to look at it, ...
The sole purpose of this post is to see how a production quality developer would approach this very simple problem. I am a fresh graduate and do not have a professional development experience. What are the cases and approaches that I should start considering when developing in a production environment? Please feel free...
I'm trying to set up a contact form using phpmailer. Are there any security holes in my code? I want to be sure as I feel there might be some kinda exploit I may not be aware of. <?php if (isset($_POST['submit'])) { if ($_POST['name'] != "") { $_POST['name'] = filter_var($_POST['name'], FILTER_SANITIZE_ST...
I'm using WinForms and have a picturebox in my form. This program looks in "C:\image\" directory to find a specified image document, in my case a tif file. There is always only one picture in "C:\image\" directory. After it locates the file, the program displays the image document in the picturebox. When I was running ...
Is there anything wrong with this implementation of an object pool that will be called from an ASP.NET application? The object I want to pool has extremely expensive initialization, so currently I am storing one instance of it in a static variable and using C# lock() to avoid race conditions. I want to change to an ...
A have a model with a dynamic field like so: def resolveClient() { if (prevCall && prevCall.client) { return prevCall.client } else { return client } } Pretty simple. However, using a dynamic field makes me unable to do queries at the database level. I can't query using HQL or Criteria. Thi...
I made a fast and simple WPM (WriteProcessMemory) for Android. Any suggestion is welcome. bool bChangedProtect; cout << search_results[cur_result].size() << " found.\n" << endl; for (int xy = 0; xy < search_results[cur_result].size(); xy++) { bChangedProtect = false; if (ReadProcessMemory(phandle,(void*)search...
For a given object that may be an instance of a class, a built-in container or type, I would like to copy that object, but replace all instances of a given class with something else. I can do this with two calls to deepcopy as shown below, but there may be a more straightforward approach. Create some complex nested ob...
In learning golang, I wrote a small CLI utility that will take paths as arguments and list out their md5 hash as hex strings. Included are two flags that alter functionality, --check | -c which takes an additional file, hashes both, and returns whether or not they match (and exits with the proper return code), and --te...
Referring to my previous post, should I consider using current pointers for this code snippet for reversing a linked list using recursion? public static List ReverseRecursion(List head){ List newHead; List current = head; if(current == null){ return null; } if(curre...
This code correctly gathers diagnosis records for a patient to show distinct records based on the AMA ICD9 code, diagnosis description, and date of posting. The output is distinct on (ICD code, cdesc, tposted). The most recent date of usage, tposted, is assigned to each unique combination of (ICD9 code, cdesc). Additio...
For fun and to learn a bit, I decided to implement a bidirectional map in Ruby, relying on Ruby core libraries where possible. Its behavior is intended to be that of a Ruby Hash, but one in which 'values' are also hashed as keys for quick reverse lookup. I've implemented nearly all the methods from Hash, except those I...
I originally wrote this as an answer to a question on Stack Overflow, but it turned out so nicely that I decided to post it here to see if I can make it even better. (defn char-seq "Returns a lazy sequence of characters from rdr. rdr must implement java.io.Reader." [rdr] (let [c (.read rdr)] (if-not (neg? ...
This is a calculator I'm working on. The ultimate goal is to calculate multiple payrolls before selecting to end the program, please review current version in that context. PSA: I'm a beginner. def main(): hours, rate = inputData() normal_hours, overtime_hours, overtime = computePay (hours,rate) regular,...
I have a folder called core with two files inside: index.js and module.js. I'm kidding a little with dependency injection and ES6, and I would like to receive feedback with improvements for my code. index.js module.exports = [ { mod: require('./module'), inj: ['bluebird'] } ]; Inside module: module.expor...
I have two code snippets and the following questions: Which uses the best practice and why? Which one is good for performance? Code 1 jQuery( function( $ ) { // Responsive video var $area = $( "#sidebar" ); $area.fitVids(); // Image gallery var $slider = $( ".owl-carousel" ); $slider.owlCaro...
I'm working on a program that will be significantly multi-threaded. I need to respond to events between objects and threads so I've come up with the following code. #ifndef EVENT_H #define EVENT_H #include <vector> #include <mutex> #include <algorithm> #include <memory> /** * Create the definition of a dispatcher f...
I wrote this class. I would be very interested in your feedback how much thread safe this class is. I know users of this class must still use some kind of synchronization when using this class, but I am ok with it, they will do such synchronization. To save your time and energy, I am more interested in thread safety re...
I am using the following to validate my user which works but i wish to incoperate roles so I used the reg iis to add the standard tables aspnet_UsersInRoles. What I basically want is the ability to have variables canView canDelete canEdit and that I can just access them when my dal is called. protected void btnLogin_Cl...
I'm on a quest for making a good debug_print() method for printing out debug information in some of my private projects. When testing I aliased my debug_print() imported from a module to debug() print, and some of the intrinsic of my code stopped working. This led to a question on Stack Overflow, which with a little nu...
How many different ways can 200 be made using any number of coins? The possible denominations are 1, 2, 5, 10, 20, 50, 100, 200. -module(coins). -export([coins/2]). coins(_, 0) -> 1; coins([], _) -> 0; coins(_, Goal) when Goal < 0 -> 0; coins([H|T], Goal) -> coins([H|T], Goal-H) + coins(T, Goal). The call is: 1> c...
I have the following scenario: I create a lucene document from a potentially very large text. Apart from indexing the text, I perform some analysis on the document for which I need the document's term frequency vector. The results of this analysis also need to be stored in the lucene document/index. Here is my current ...
To display comments recursively I'm using this: function fetch_article_comments($article_id, $parent_id) { $app = new Connection(); if ($parent_id <= 0) { $parent_id = NULL; } $sql = "SELECT * FROM recursive WHERE article_id = :article_id AND comment_parent <=> :parent_id ORDER BY comment_timestamp...
This is a part of a project I am working on. I need advice and criticism regarding the data base design and general approach to querying the data. I am not at all experienced with relational data bases (as you should notice), and even though I have tried to invest some time in reading up I am currently forced to just m...
This is my first piece of code to post here. I wrote this script as a post-receive hook for a Git repository but I’m not so concerned with the Git parts (I’d like to have the part marked with TODO working but it’s not a priority). It’s my first time to use either named pipes or the trap command to clean up temporary fi...
The code allows you to subscribe to events and publish events via an EventBus class. Events are identified by a source and subject. Events can have a single parameter or they can be 'indexed' and have two parameters (the first being an integer index - I will be using this a lot so wanted a specialization). I don't part...
For those who don't know, Twine is just a simple interactive fiction making tool. It lets you easily create a series of passages that are hyperlinked to each other, making a choose your own adventure style structure. It exports as HTML format, but if you wanted to just use Twine to write nodes to use elsewhere it's lac...
I am working on a simple Rails app. For the Expense resource I use a DataTable. So, in my CoffeeScript for this resource I basically do several things: initialize the datatabe; since I use a custom search field (not the one, provided by DataTables), I add a search function in the table api; initialize the Select2 plug...
I'm completely new to Javascript and NodeJs and functional programming in general. The code below scrapes a torrent-website containing movies, gets info about the movie from the OMDb API and lets a user choose a movie to watch by streaming the torrent. Any feedback appreciated. var scraperhelper = require('./scraperhel...
I would like some help condensing this code down to size. I am trying to utilize Qt's container classes as efficiently as possible. I do not believe this code reflects my objective. #include <QCoreApplication> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QVector<int> ve...
I'm brand new to C# and I've started to make a cipher decryption program. The code works and runs fine, apart from the odd exception. I'm just looking for ways to improve my code and make more efficient. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Ap...
I am building a map editor to easily create 2d levels. To visualize how my level looks like I am using a canvas. On this canvas I can select which block is filled with a certain type ( like solid ). I did add click and drag but because I am live drawing on the canvas it goes very slow and if you draw at a decent speed ...
I'm using some third-party libraries in my project. Once in a while the code in these libraries freaks out and produces infinite loops and other nasty things. My goal is to write a wrapper that allows me to abort execution of this third-party code after some timeout. Here's my current implementation: public static clas...
This is my 1st F# program so I'm open to any and all criticism on my syntax and the way I approached the problem. Challenge Project Euler 16: Power Digit Sum 2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000? open System open System.Numerics let digitP...
I need to vertically concatenate two disjoint ranges in VBA to be passed to an Excel function (in this case the LINEST function). I hate working with arrays in VBA but I managed to get it working using the following code: Option Base 1 Function VERTCAT(R1 As Range, R2 As Range) As Variant Dim ncols As Integer ...
I'm a HPC guy so I'm all about "make it work, then make it fast." I have a little bash script which gets a Physical Source Lines Of Code (PSLOC) and Logical SLOC (currently just of Java code, but it would work for C and C++ too). It works by finding all *.java files in a directory and then goes through each file found ...
I'm working on a page that shows groups of users. The following JavaScript function is used to show more details about a user (such as email and login) when you click on their name. But there's a twist: clicking on one of those pieces of information will highlight it to make it easier to copy. This is accomplished by a...
I'm just a beginner in Python. I wrote a simple code that detects the user's password strength, but I feel that it isn't very efficient. How can I improve it? print('''# This is Password Strength Detector.\n -----------------------------------------------------------------''') password = input('Enter your password her...
Inspired by this website, I wrote the following function to automatically generate a div and load a page for each page listed in an array of page names. The idea is that if I want to conveniently display webpages or other pre-packaged content, I just need to make an array of the file names/URLs and then the function cr...
This will be tough to explain. I am implementing a tool to support RFC6020. But when it comes to the Choice Statement, things get weird. For the sake of better understanding, I have to remember you a couple of things: I have a XML and a YANG file according to the RFC. A Choice (and it's cases) are not included on the ...
So this is my first project. I made a Calculator using Tkinter. For the next version, I will try adding oops concepts Custom parser for input Here's the code #!/usr/bin/env python3.4 from tkinter import * import parser root = Tk() root.title('Calculator') i = 0 def factorial(): """Calculates the factorial of...
I'm using numpy to write the "back substitution" method for solving linear system where "A" is a nonsingular upper triangular matrix. import numpy as np def upperTriSol(A, b): n = np.size(b) x = np.zeros_like(b) x[-1] = 1. / A[-1, -1] * b[-1] for i in xrange(n-2, -1, -1): x[i] = 1. / A[i, i] *...
A week ago I posted my TicTacToe game follow-up question. The suggestions were referring mainly to the lack of polymorphism. Here's the new code, hopefully there's not a lot (or at all) to improve by now (except separating board functionality from Game class, but it seems to be too much of work anyway). As always, sugg...
I'm fairly new to JavaScript, and wanted some critique on some code I've written based upon what I've learned recently. I have a strong background in OO programming (C/C++, C#, Java), but recently I've had to delve into JavaScript for my job. I'm working with a lot of legacy code, and want to improve it as I go. I've w...
I have a problem were the time in minutes of N songs are given and I have to write the maximum number of time in K CDs. Input description The first input line consists of two positive integers N e K (\$N \le 100\$, \$K \le 3\$), which represent respectively the number of songs and the number of cds. The second input l...
I'm outputting the results of a query to file.txt in JSON. The file is updated every time I click on 'submit'(form) and depending on the variables it updates the query. Right now the table only has about 20 records and will probably increase by 2/3 new records everyday. Is there a better way to updating the file test.t...
I decided to write a simple runnable example to try and express my concern: index.html <section ng-app="App" ng-clock> <div ng-controller="ShopController as shop"> <prize-directive ng-repeat="prize in prizes"></prize-directive> </div> </section> Inside my shopController I have set a static pr...
I am studying computer science and decided to implement a linked list from scratch for extra practice. To do so, I created a Node class which simply holds an integer, and wrapped the Nodes in a LinkedList class which adds, removes, and returns Nodes. I am wondering how I did, what I can add, and what I can do better. p...
I'm trying to use Python to solve the Project Euler problem regarding the Collatz sequence. With some research online, I have come up with the code below. However, it still takes a long time to find the maximum length of the Collatz sequence of the numbers from one to a million after the following improvements. Using ...
Following is a working program to add new articles. The only thing I want is to check if there is any way to write it in a better way, or if the architecture is good as it is. Maybe I did not have to user a new class ListOfProducts I could easily create a list in the Articles class and add items directly in the BuyItem...
Using await task.ConfigureAwait(false) is a standard best practice for indicating to the compiler that the continuation does not need to be run on the current context. We also have the Task.Yield() method which hands control back to the calling context and always posts a continuation (no fast-path optimizations); howev...
I'm starting to learn Clojure and as an exercise I've implemented the following functions (written in Java) in Clojure: private int[] SwapValues(int val1, int val2, int[] array) { int[] result = new int[array.length]; for (int i = 0; i < array.length; i++) { if (array[i] == val1) { result[i]...
Here's a little command-line utility written in Rust that connects to a Denon AV receiver and sends a command, then receives the response. It's a simple TCP client that takes its command from the first argument. extern crate encoding; use std::env; use std::io::prelude::*; use std::net::TcpStream; use encoding::{Encod...
I was feeling bored with nothing to do (well, sort of) and decided to write a program that runs a program in Java. What it pretty much does: Creates a new file with the name classname + ".java" Write the code into that file if it is not already compiled, run javac filename.java on the command line run java filename on...
The purpose of this question is to get some advice for improving the following code in order to make it less repetitive. .parent-div a { border-bottom: 10px solid; .blue & { border-color: $blue; } .red & { border-color: $red; } .green & { border-color: $green; } .pink & { border-color: $...
I was solving a question where I had to find all possible unique palindromes of size greater than 1 for a string. I was able to come up with the solution shown below. If I am not mistaken it is an \$O(n^2)\$ solution. I'd like feedback on improving the code and if my understanding of its time complexity is correct. def...
I've got an Angular controller where I have two functions that are repeated inside two functions: (function () { 'use strict'; angular .module( 'app.purchases.products' ) .controller( 'ReadProductController', ReadProductController ); ReadProductController.$inject = [ '$scope', 'ReadProduc...
I am developing a Java program on Windows. I want to access Wi-Fi interface details such as SSID, IP, subnet, enabled or not, connected or not and so on. I am currently trying with using netsh and ipconfig commands. For example, here is how I get the connected SSID. Is this a good way? Is there any better, easier metho...
I have to generate a random number from a range with exceptions held in a bool array, is there a way to do it without a loop depending on probability? There is also a potential infinite loop here if all values are false. Any suggestions? bool[] paths = InnateChannels(channelID, channelOrientation); bool done =...
Updated question: Compress numbers in a string array (#3, #1, #2, #4) to range (#1:#4) This function takes a string array, {"foo", "#123", "#124", "bar", "#125", "#126"} makes a new array with the numbers converted to a range: {"foo", "#123:126", "bar"} and returns: "foo,#123:126,bar" Note it doesn't and shouldn't ...
I'm a newbie in javascript. Could you please say what is wrong in my code? How can i improve it? Maybe something is wrong with variables or methods naming. Maybe something is wrong with common structure. My program generates magic square by order. I decided that it is good to create one main function and one class. // ...
(See the next iteration.) I have this small collection of exact string matching algorithms: Knuth-Morris-Pratt algorithm, Finite automaton matcher, Rabin-Karp algorithm, Z algorithm. The main research question was comparing performance of all the algorithms in two different settings: Input which degrades performanc...
I have this C++ 14 code in a project of mine. Enhedron/Util/Enum.h: #ifndef ENHEDRON_UTIL_ENUM_H_ #define ENHEDRON_UTIL_ENUM_H_ #include <stdexcept> #include <type_traits> namespace Enhedron { namespace Util { namespace Impl { namespace Enum { using std::runtime_error; using std::underlying_type_t; /** ...
This function takes a string array, {"foo", "#123", "#124", "bar", "#125", "#126"} makes a new array with the numbers converted to a range: {"foo", "#123:126", "bar"} and returns: "foo,#123:126,bar" Note it doesn't and shouldn't change {"#1", "#2"} to {"#1:#2"} using System; using System.Linq; using System.Collecti...
I understand that and why using eval is generally considered bad practice in most cases (see e.g. here). Related questions on config files and argparse don't use types. (1, 2) I needed to parse a number of command line arguments and decided to store the arguments, defaults and help strings in a .json file. I read the ....
I want to eliminate code duplication in my Fizz-Buzz like program. Any ideas? #include <stdio.h> int myseries(int n) { int i, cpt = 0; if (n < 0) { for (i = 0; i >= n; i--) { // if the number is multiple of both three and five if (i % 15 == 0) { printf("lancelot\n"); } // if the ...
I'm learning PHP now, and I'm trying to find out whether or not the following code structure has any faults: $loggedIn = false; if (isset($_GET["userpass"])){ if (strcmp($_GET["userpass"], $correctPassword) == 0) { $loggedIn = true; } } To me, it seems pretty bullet-proof. If the password isn't set, th...
I made a program that converts a decimal number given from the user, and converts it to a binary number. For example, if I entered 2, it would return 10. It then, counts the amount of ones and zeros in the binary conversion. Please tell me any way my code can be either, more efficient, or if there is an error with my c...
I'm a beginner in Python. I wrote this code which encrypts and decrypts text using Caesar chipher. I wrote it in many days and optimized it many times. But how it can be improved more? I've used lists because they are flexible and they serve my algorithm. print('''# This is version 1.0 Caesar Encryption-Decryption Too...
Back in late 2012, I wrote the following C# .NET MSSQL Wrapper, which offered the following operations: ExecuteScalar (for selecting single field from a row) ExecuteReader (for selecting one or more row) ExecuteNonQuery (for usual CRUD ops - uses transaction) Handle deadlock with retries This wrapper was used in a De...
I'm trying to filter a list composed of multiple dictionaries for useless entries and non-ideal fields. An entry is useless if Mem['visibility'] == "redacted" and then should be removed from the list. An entry is non-ideal when any of the fields are empty, and these should be filled with a 0 instead or if Mem['~whateve...
The goal here is to implement a basic binary tree with values only on leaves, with depth, mirror, and in_order (traversal) operations. I have not used Rust before. Some particular questions I have: In a few places, I'm defining methods by passing self by reference and then matching on its derefenced form. I then have ...
I decided to dive into the world of JS/JQuery by trying to build a simple web app to display all of my various meet results in an easy-to-view manner. For this stage of the review, all it does is generate a table of all the meets and log some stuff to the console when you click on it. The app gets its data as JSON in ...
These are 3 functions I created in C language to read in a text file, remove the carriage returns from it in order to display on the screen, and display the file on screen wrapped with the words of the text not breaking (this is the most important task of the program: wrapping words without breaking them). I created a ...
I am aware that this code is vulnerable for SQL injections, but I don't know how to avoid it. <?php session_start(); $message=""; if(count($_POST)>0) { require ''.$_SERVER['SERVER_NAME'].'/admin/settings.php'; mysqli_connect($host, $user, $pass); mysqli_select_db($db); $...
I wrote this to query the Trello API to find the cards that haven't been updated in 7 days and send an email notification to the card's members as a digest. I'm a Node.JS & client-side JS dev, and this is my first Python script. I'd really appreciate any suggestions around best practices, how it could be more modular/r...
This is a follow-up to Basic binary tree manipulation in Rust, where Shepmaster suggested that I implement the Iterator trait for the binary tree. This ended up being less trivial than I thought. My original data structure design was that the iterator would simply contain a vector of binary tree nodes representing the ...
I am taking a lynda dot com course online to start off. The course asks you to write a simple program: Ask the user to input 2 values Ask the user to input an operation Use the operation on the 2 values and print the result This was very different from the solution given by the course. Could anyone take a quick loo...