instruction
stringlengths
71
71.9k
def guessr(): '''Application that generates 5 numbers which a user enters a number as a guess to match any of the number generated by the application, if you is able to guess one of the numbers correct, user has won, else user lost''' from random import randint print 'Welcome to the Number Guesser App...
I know Swift isn't exactly meant to be used to write your classic stdin to stdout scripts, and that Python, Ruby, Perl, bash, awk, and friends are much better in this area, but I'd still like to see how well it can be done. The problem I chose is: Read from standard input, and write to standard output a space-separated...
This is my second algorithm and I will try to make it as simple for you to understand how it works. It is pretty expensive and I'd like to make it more efficient. . It works by splitting a square into 4 sides and then by determining if an edge is within a side (which is a triangle). Then collision can respond by using...
I'm still somewhat new to C, so pardon me for any silly mistakes I've made. I'm trying to convert video frames into Minecraft map colors using JNI and FFmpeg's av (and swscale) libraries. The code works below but it's sluggish and I'm going to assume it's prone to the branch prediction problem. The Minecraft map data i...
I am currently teaching myself C++ in my spare time. I created the below "game" to simulate combat between an army of humans and an army of skeletons. Is there a simpler or better way of creating this game? I would love for someone to "improve" my code so I can get a better idea of how to use C++. I think a major impro...
This script, once added to the Windows Scheduler, automatically creates a backup of your Google Chrome bookmarks. import shutil import os import datetime def setup(): print ('Enter your Chrome bookmark directory.') print ('Standard one is: C:\\Users\\<USER>\\AppData\\Local\\Google\\Chrome\\User Data\\Default'...
I'm new to unit testing and I'm curious if anyone can see any problems with my approach below. Basically I want to test the Add function. To do this I am creating a new Account object, passing that to the Add function, retrieving that account and finally comparing the retrieved objects values to hard coded values. I'...
I was working through Cracking The Coding interview, and I couldn't wrap my brain around their solution to one of the problems, so I ended up coming up with my own that, IMHO, is a lot cleaner and easier to read. Would love your feedback. Here is the actual problem: "A binary search tree was created by traversing throu...
I made this as a personal challenge. It seems to work fine as I can't find any bugs and am happy with how it runs, but I am interested in what I should do to make the code more professional. I think the draw() function can be replaced with two for loops but I could never get it working. The code for the input by each o...
Today is my first time working with GUI, so I'm really interested in the best ways of handling various events to get the best habits from the jump. Most of the GUI-related code for this project was generated by Netbeans's layout manager, although I tried to rip out as many of the meta tags that I could, did imports whe...
I am currently creating a Multiplayer Game using node.js and web sockets. The client side is receiving the positional information and applying it to all the players on the client side. Each client stores a list of all game elements. The main issue I am experiencing at the moment is a large amount of Garbage Collection...
I have an ASP.NET web-client and many WCF services. I used it this way: public class UserController { private Service1Client _service1Client = new Service1Client(); private Service2Client _service2Client = new Service2Client(); public JsonResult HasDebts() { var user = _service1Client.GetUser...
Problem Count the number of matching nodes in the subtree rooted at some node n. Solution from collections import namedtuple Node = namedtuple('Node', 'key, left, right') def build_tree(inorder, preorder): """Builds a Binary Tree from given inorder and preorder traversal. Steps: 1. Take the first element ...
How do I write this function more efficient? My class names always contain modell and essentially, only the numbers are changing. Is it right that I get a better performance if I update the numbers instead of adding and removing classes ? So basically: modell[1], modell[2], ... jQuery(document).ready(function(){ ...
I've implemented simple +-*/ calculator in WPF. I know that here are few implementations of the same thing, but each is different, with different advantages or disadvantages against this one. Can you suggest me, what could be improved in my code? // calculator operations public enum CalcOperator { None, Plus, ...
I have this before_action method : def convert_duration_reminder allowed_duration_units = %(hour day) if allowed_duration_units.include? params[:store][:store_setting_attributes][:reminder_unit] store_settings_params = params[:store][:store_setting_attributes] @duration_reminder = store_settings_p...
This code snippet is about asking Windows for the highest possible execution priority. Basically, we have to ask for real-time priority class for the entire process, after which each thread has to ask for real-time thread priorities. However, since Windows Vista, whatever is the program that needs the real-time priorit...
I've tried designing a Turing Machine model, it works quite well, however I think it could be confusing to maintain on in the future, and I'm not sure what of best practices. Can I get some feedback on my code? Turing Machine Namespace using System; using System.Collections.Generic; namespace TuringMachineNS { pub...
I wrote a small generic implementation of a simple generic double buffer pattern, and I was wondering if it's actually thread safe or can be improved in any way. Note: The specific part that I'm worrying about thread safety is the Swap() function. /// <summary> /// Simple generic double buffer implementation class ...
I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility. I have just created a new protocol for my programs: <mutableDeepCopying>. I’ve implemented this protocol into NSArray and NSDictionary using categories. The MutableDeepCopying.h file is pasted b...
I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility. Recently, I asked the question which asked if there was a way to create a method in a new class which automatically ran itself every frame. I was answered that it would be a good idea to use CAD...
Suppose you are given two functions, foo and bar, and neither of them are inlined. Now, if foo calls for bar and bar calls for called_from, bar receives the address of the caller, that is, the address of foo. I know that there is no real need for such computation as it is always possible to simply pass an enumeration t...
Is this an acceptable approach to update WPF MainWindow from an async task, using events thrown from a public static class? In MainWindow.cs, I subscribe to UI.TaskCompleted event In UI.cs, I subscribe to AsyncTaskActions.TaskCompleted event Using this pattern, AsyncTaskActions.TaskCompleted is raised when an async ...
A similar question must have been asked a thousand times, but for the life of me I can't figure this out. I am new to Java and I want to create a programme that asks a user for his or her height and weight, and calculate the corresponding BMI. I want to throw exceptions for the wrong input (has to be a double, non-nega...
I'm using EF7 with In-Memory database and xUnit for repository testing. I'd like to know if it's a good practice initializing the database in this manner for reuse it in every test method, specifically through the Initialize() method: private Context _context; private BrandsRepository _repository; private void Initiali...
I am using the below code to execute a MySQL query in PHP. $cus_id = '1'; $query = new QUERY(); $clause = "SELECT * FROM customers WHERE cus_id=:cus_id AND status='ACTIVE'"; $params = array('cus_id'=>$cus_id); $result = $query->run($clause, $params)->fetchAll(); Is it secure enough, or do I need to bind the static var...
Let's say I have \$5\$ apples, thus \$n = 5\$. I have three bags (\$k = 3\$), each having the capacities of \$4\$, \$4\$ and \$2\$: $$c = { \{4, 4, 2 \}}$$ I'd like to calculate the number of ways the \$5\$ apples can be distributed into those bags; each bag can be empty. The results for this example would be following...
This class seems to be able to represent the data stored in any possible database table: public class DbTable { private Set<Map<String, Object>> tblData = new HashSet<Map<String, Object>>(); public DbTable(Connection dbConn, String tblName) throws Exception { PreparedStatement prpStmt = dbConn.prepare...
The foldRight and foldLeft methods for Scala Streams cannot terminate early, so here is my attempt to provide that functionality through the "enrich my library" pattern: implicit class StreamWithLazyFold[A](s: Stream[A]) { def foldLeft1[B](z: B)(f: (B, A) => (B, Boolean)): B = s match { case _ if s.isEmpty...
I have the following code which does 2 things: Return a scanned fingerprint as base64 Store this print as bitmap While the code works most of the time, sometimes an invalid bitmap is saved (I can't open the file). I think there are some improvements (padding?) that can counter this strange behavior. The 'firstPixel' ...
I'm currently reading a book and watching some tutorials about PHP with MySQL (PDO), but it is not clear where to put certain things - where to put some code, should I put the connection to the database within try-catch and so on. So, I'll explain how I started my project and if you could tell me if this is wrong or i...
I wrote a wrapper class in PHP to use Telegram bot API. What do you think about it? I used this class in some projects and it doesn't have any problem but I want to know if it is optimized? <?php /** * A wrapper class for telegram bot api * you can find source code in https://github.com/smoqadam/php-telegram-bot * ...
I am consuming data from an API that reads from a SharePoint list. The API is basically this: IList<Dictionary<string,string>> GetListData(string listName); So the data is a list of dictionaries - each dictionary containing value-pairs (column name, column value) for a "row" in the list. I need to group over the resul...
I have written the code for a genetic algorithm and have the crossover function, mutation function, parent selector function and a function to transfer genes. Now I want to put it all together and would like to know if the following code is good programming practice or not. Species Parents[popSize]; Species Children[po...
I'm trying to figure out if I'm doing superclasses right. Also, I welcome critique on Java structure/syntax etc. Animal.java: public class Animal{ private static int counter = 0; // how many animals we have created (to demonstrate a static variable) private Boolean isWild = true; // is the animal wild? pri...
I am working on a project with an Arduino microcontroller and a Raspberry Pi. The code will have to do the following: If the variance calculated of the ultrasonic sensor detections exceeds 1000, a event will be sent over the serial bus starting with the prefix /E/ If a request is received on the serial bus asking for...
I've got a Python function that takes two arguments, lat and lon. These arguments can be either scalar values (52.3) or any sort of iterable (e.g. a list or a NumPy array). At the beginning of my function I need to check what I've been given, and convert both arguments to arrays (if needed) and check that both argument...
Write a program to determine the mean, median, and standard deviation of a list of numbers Count the duplicate numbers in the code, listing any that occur more than once with the number of times it occurs. My implementation: import math def mean(input): return sum(input) / float(len(input)) def median(input): ...
This program's main function is to: Watch a directory. If there are new files, insert those as entries into the database. Delete the files from the directory. My below code runs well, but I want to optimize it and I think it needs better error handling. import os import time import mysql.connector import MySQLdb imp...
Please critique: public void printTree(Node head) { if (head == null) return; Queue<Node> q1 = new PriorityQueue<Node>(); Queue<Node> q2 = new PriorityQueue<Node>(); q1.add(head); do { while (q1.size() > 0) { Node element = q1.poll(); System.out.print(elemen...
My aim is to write a method which prints contents of a singly linked list in reverse order with time complexity \$O(n)\$ and space complexity \$O(\sqrt{n})\$. The best I could come up with is to store the pointers to nodes in an array and print it in reverse order. void display_reverse(List *l) { int list_size = si...
I am self-taught and trying to improve my programming skills. My project is a point-of-sale application, with lots of buttons. I am curious how improve this section of code, as I seem to be going against the DRY principle. I have a Customer object named cust, and each customer has an ID that is set to one of 8 differe...
I'm making an app in Excel-VBA, but when I have more than 50,000 records, my code runs very slow and the formatting takes about 33 seconds. Application.Interactive = False Application.EnableEvents = False Application.ScreenUpdating = False '--------------- Tao Bien ------------------------------------------ Dim Dulieu(...
I have written a method to determine whether a Vector2 lies inside a polygon or outside of it. The polygon is defined by an array of clockwise vertices, p[]. It returns true if the point is inside, false otherwise. public bool polyCheck(Vector2 v, Vector2[] p) { int j = p.Length-1; bool c = false; for(int i...
The user can provide a JSON object to configure the plugin when they initialise it. I want those options to be available whenever a plugin action is performed. I have read the plugin documentation but I'd like to get confirmation that I am going about this the right way. Plugin is initialised with: $(selector).hide_and...
I sometimes need an object that caches some data but only for the specified amount of time. So I created a class that should handle this. The main goal was to make it generic unlike the MemoryCache and be a single object cache and not a general all-pupose cache. ObjectCache public class ObjectCache<T> { private rea...
Ram was busy calculating the factorials of some numbers. He saw a pattern in the number of zeros in the end of the factorial. Let \$n\$ be the number and \$Z(n)\$ be the number of zeros in the end of the factorial of n then for \$x < y\$ \$Z (x) \leq Z(y)\$ i.e. the function never decreases. He is solving a pro...
I have the following code in Scala as a solution to the problem: Find the maximum number possible from the given Seq of Integers while keeping the individual numbers intact e.g. Seq(2,5,9,4) should result in 9542 Seq(4, 98, 10, 110, 91) should result in 9891411010 Note that in case of numbers with more than one dig...
import random student_teacher = input("are you a student or teacher") if student_teacher == "student": group = input("what class are you in") if group == "1": name = input("What is your name") #Asks the user to enter their name print("Hello",name) #Prints a wlcome message to the user sco...
This code shows a title with an image and subtitle: What improvements can I make in this code and is there a better of doing this? package Components.CustomLabel; import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.GridPane; /** * * @a...
Using file stream object, write a program to read an external text file ("myCourse.txt") which contains all the course name and numbers you are taking this semester, and to generate an analysis (total number of courses) into an external file ("myCourseSummay.txt"). This is a past question my teacher has been hinting...
This is my solution of string calulator kata in scala(i'm new of tdd). I'd like a general review of this. String Calculator Create a simple String calculator with a method int Add(string numbers) The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example “” ...
I have this small Java program for computing particurly large Fibonacci numbers (10000th Fibonacci number is computed in about 220 milliseconds). The key idea here is to use lists of digits, which is exactly what is done in java.math.BigInteger, yet I wanted to implement a simple digit list addition on my own. import j...
I am a relatively new programmer and am currently working on something with the egit GitHub client library which requires me to iterate over a bunch of values and if a condition is met, add a bunch of stuff to a HashMap then add it to a List. Example: List<Map<String, Object>> files = new ArrayList<>(); for (TreeEntry...
The query below is quite slow (taking about half a second). Any obvious things I could improve? The PRICES table has about 21 million rows and 30 columns while CONTRACTS has 130 k rows and 10 columns. SELECT CONTRACTS.EXT_ID, PRICES.REFERENCE_DATE, PRICES.PRICE_DATE, CONTRACTS.PERIOD, PRICES.TIME_TO_MATURITY, PRI...
I have completed a FreeCodeCamp exercise to create a tomato timer and chosen to do so with vanilla Javascript. Although it works, I don't like in how many places I am checking against two state variables onBreak and isPaused in many areas of the application. (function() { "use strict"; // Initialisation ...
I've read that it is good to separate model from DB mapper (entity manager) (but at the end, it is perhaps personal - just a matter of opinion). Anyway, if I understood correctly, I should not have data models with DB connections, I should not have any methods with SQL (CRUD) in a class, right? I will give you how my c...
See the next iteration. I have that method for computing Fibonacci numbers \$F_n\$ (\$n = 0, 1, 2, \dots)\$, that relies on computing $$ A = \begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}^n. $$ The solution is then read from \$A_{1,2}\$. Now I can easily compute, for instance, \$F_{100000}\$. However, in this code snipp...
I'm working on a class project for my intro to Java class. My background is in accounting/finance so I decided to make this simple calculator that helps the user decide what they can afford and how much they can save on interest expense over the loan term. I'm just looking for general feedback on code structure and tip...
below I have coded a simple configuration manager that loads config elements from a file straight into a dictionary, and also has a function for getting an element by its key in the dictionary. I just wondered if there is anything I can do to improve this.. using log4net; using System; using System.Collections.Generic;...
I am working on optimizing a Wator program. I have a specific question about code, if you are familiar with it. There is a function which takes most of the time. I need your help to improve this particular part of the code. // find all neighbouring cells of the given position that contain an animal of the given type p...
I have ported the code from my previous question "Generate a random numbers class" to C++14 and made a few modifications. How can I improve it further? #include <iostream> #include <random> template<typename T> class Random { template <typename U> static auto dist() -> typename std::enable_if_t<std::is_integra...
I've come up with a solution for Euler Problem 530, but my code runs too slowly to actually get the answer (solving for 10^15). What can I do to optimize it to run faster? static void Main(string[] args) { string num = Console.ReadLine(); double bigtotal = 0; double n = double.Parse(num); ...
Link to the previous question, before refactoring. I've decided to make this module of a dialog, sort of like talking to NPCs in games, like this for example. I've creating the visuals of the window using the code from this post, works pretty well. Here's an example: I've created a Manager class to manage those pop-u...
This is a commonly used format for our save button for a lot of our pages. I parameterized (to prevent SQL injection) a lot of this. For this page, there's a ton of textboxes and other stuff, so excuse the length. Can I do this differently? This accounts for the add of a new record or after an edit of an existing one. ...
In an attempt to learn Haskell, I've built this - it accepts a number n, a source directory, and a sink directory (ending with /) copies n lines from each file in the source directory to the sink directory. It is not recursive. Thoughts? module Main where import System.Directory import Control.Monad import System.IO ...
This code is built on Json.NET and gets called hundreds of times per second. My data starts in an ArraySegment<byte>. I wrap that in a MemoryStream and pass it in to the code. It's generally small data: hundreds of bytes, not thousands. It just doesn't seem right that I have to construct multiple streams and readers fo...
I have a class called _NodeProcess. It consists of a mainloop (main function) which is run in a separate process and methods (start and stop) that control the mainloop. Here's the code: class _NodeProcess: def __init__(self, master): self.master = master self.process = multiprocessing.Process(targe...
I recently had a potential employer send me a programming test to read through a file and write to another file all the words that were anagrams (two or more words containing the same letter). The following code worked on my machine, but the recruiter told me I didn't pass the test without giving me any feedback. Sin...
Back in the day in addition to DOM and SAX parsers for XML another parser type was relatively popular -- pull parsers. Recently I was looking for a JSON parser and figured that most JSON C parsers are more akin to DOM parsers with their own toy object models. I personally see no need adopting such models in my projects...
I am taking a Ruby class and our assignment was to write a class that takes two users inputs (1. the time, 2. the amount of minutes to move forward). Then based on the two inputs forward the time by that amount. I am new to Ruby so any feedback on how to improve my code would be great. class Timeshift @time @time...
I'm in the process of building a soon to be opensource CMS. 100% MVC. The basic idea is that a plugin should be able to add pages (read: methods) to a given controller, without needing to instantiate a new Route object, which the Router would then have to iterate over to test for a match. class_alias won't work. You ca...
A month ago I posted an earlier version of the game here, and got a great response, which was mainly about the structure of my code. I freed some time today and reworked the code from scratch. Things I improved: Class separation No more god object Applied single responsibility principle for classes and methods I woul...
I tried to implement a DBScan in C# using kd-trees. I followed the implementation from here. public class DbscanAlgorithm { private readonly Func<PointD, PointD, double> _metricFunc; public DbscanAlgorithm(Func<PointD, PointD, double> metricFunc) { _metricFunc = metricFunc; } public void ...
I have recently made some major changes to my configuration file and wondered if I could get it reviewed, and be told what I can improve on it. My designer pattern and personal preference has changed a lot since I originally wrote this class, and I have basically re-wrote it. I just wanted to know if anything is poor c...
My session controller has a method for creating new user session. According to Rubocop's output there is 'Assignment Branch Condition' metric is too high [15.17/15]. def create agent = Agent.find_by(login: params[:session][:login]) if agent && agent.authenticate(params[:session][:password]) log_...
I am generating routes and responding to it dynamically by looking at the enum defined in the model. Is this safe and is there more proper method? # Place enum post_type: [:restaurant, :bar, :chill] # routes scope '/places' do get '/:category', to: 'places#index', constraints: { category: Regexp.new( Place.post_...
I have written a small library for saving data on local storage. I am still a learner and I am not sure whether my code is OK for a production level application. function AppStorage (aName) { "use strict"; var prefix = aName; var saveItem = function (key, value) { if (!key || !value) { ...
I've recently started to look into React. I feel like I'm understanding it, but I want to make sure I'm doing the best practices before I make too many bad habits. I'm using the react-rails gem, and my data structure is as follows: GolfCourse: has_many :holes Hole: belongs_to :golf_course has_many :yardages Yardage: ...
I am trying to implement multiple producer multiple consumer problem using a custom blocking queue. The requirement is that: If the queue is not full, all the producers should be able to produce products independently. If the queue is full, the producers have to wait. If the queue is not empty, the consumer can consum...
I would like to serve a growing audio file (raw PCM audio for now) with the possibility of seeking. I tried to manage it with Apache, but in the end wasn't able to achieve what I wanted. Now I managed to come up with a solution within Django that seems to work quite nicely. Basically I created a view that delivers a pa...
I am playing around with parallelization in Java and am trying to see how to squeeze out more performance on my multi-core box. My machine has 6 physical cores, 12 with hyperthreading. However, with this code, I only see performance improvements up to about 3-4 threads, after which the improvements top off and then de...
I have an entity with opening and closing times and I have to list timetable in HTML label. Times can be empty. Ugly attribute names getHorarioMIni or getHorarioTFin cannot be changed due external DB relations and the auto-populating methods. How to optimize this function: public String getTimetable() { final St...
As a very novice developer, I'm reading more about OOP and structuring JavaScript in a sensible way and have been using the following format for a little while now. It's difficult to know the best way to do things because most examples I see online are for much larger websites than I currently build. More like applicat...
Could I make this method for deep copy generic to the Collection type? That method is so simple and I can't imagine ever needing to change it, so maybe I should just use the "cut / paste" code re-usage design pattern to handle the Collection typing problem? public class Start { public static void main(String[] arg...
I made a translator for the English language. As of now it only translates from Spanish, Russian, and Arabic (will be adding more languages). The program pulls the input from a yaml file with a list of words and phrases inside of it. It searches the users input and if it finds a match it returns with the English transl...
Original question: Basic Config Class One problem I know about is Initialize() not being threadsafe, which I am sorting as we speak, so please disregard that. using log4net; using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace Apple.Application.Base.Config { internal class ...
I am working on a product application where user could sell/buy. This application is based on collection view. Collection view has collection cell where it displays product image thumbnail. The following code gets products images from the server and it waits to download all images and then display them in the cells. Th...
I am developing a social platform and currently just completed the registration and login PHP pages. The application is an android application that authenticates against a MySQL DB. I am seeking critiques on how "safe" and correct my PHP pages are that I am authenticating against, IE: Am I storing and authenticating pa...
I was tasked with building three individual methods; one to create a Binary Search Tree (BST), one to carry out a Breadth First Search (BFS), and one to carry out a Depth First Search (DFS). Create Binary Tree class Node attr_accessor :value, :left, :right def initialize(value) @value = value end end def bu...
I have to work with a function that takes an instance of a class as an input, and depending on that instance, I have to return a specific string. It works, but it has a lot of repetitive code. How can I make it more efficient? private getDescription(ScreenViewer o) { String output = ""; if(Utils.isTot...
This class updates the console's title so it can tell the person using it the programs uptime, which can be pretty useful. The class holds a timer and each time the timer executes it will call the function to update the title (interval is in config file). How can I improve on this? using Apple.Application.Base.Config; ...
I did this exercise yesterday mostly as practice, but it has some utility as well in day to day. I was basically attempting to take a string that looked like the following: src=bing_adid=8312488564_kw=swiftcapital com_kwid=35030235383_mt=e_qs=swiftcapital.com_device=c' And create a series of columns based on the param...
I am creating a poll that website visitors can then vote. I use a hosted CMS (Business Catalyst) so I have to do a lot of this with javascript. I have the poll working but when I click submit it is taking around 15 to 20 seconds for the poll to submit. I really need to improve this performance but unsure how to do so. ...
My application imports a CSV file and parses each row, turning it into an object in my code. The speed for a 500,000 row x 68 column takes 2+ minutes to read. I've narrowed down the bottleneck to the part where the strings are being converted into their respective types using the converter I created. I need some pointe...
I wrote a program to retrieve the key/messages from 10 different ciphers which were all encrypted with the same key with an xor one-time-pad method via crib dragging. To do this, I wrote a python script which turns a string to test to hex code. Then it xors the 10 cipher strings (200 hex characters each), two at a time...
I've decided to take some of the many suggestions for improvement on my previous question, Easier user input in C++, and actually get it to work as expected. This time around, a few things are different, namely: The function will now accept string input with spaces, like "Ethan Bierlein", and not just spit back the fi...
I rewrote this simple, list-based Sokoban implementation a few times, trying to make it better. Right now, I'm stuck without ideas, but I still feel there is room for improvement, specially in runLoop and data types. Is there anything, such as monad transformers, FRP, lenses, or anything else that I should study to be ...
After the feedback I have got from this question, I tried to to re-implement the classic Producer Consumer problem using multithreading. The requirements are: If the queue is not full, all the producers should be able to produce products independently. If the queue is full, the producers have to wait. If the queue is ...
I just wondered if someone could review this socket class for me. using Apple.Application.Base.Sockets; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace Apple.Application.Base.Connection { class...