instruction
stringlengths
71
71.9k
Sometimes when I write a Python 3.x script with too many nested loops and some big values it just takes too long to give the answer. How can I optimize my code so that it runs faster, or where should I optimize? def isprime(n): '''check if integer n is a prime''' # make sure n is a positive integer n = abs(...
I've written a date parser that parses different types of dates using Parsec. Credit for the original problem goes to here. The following formats are as such: yyyy-mm-dd mm/dd/yy mm#yy#dd dd*mm*yyyy (month word) dd, yy (month word) dd, yyyy (month word) can be: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Note if i...
I am trying to learn C#. Please tell me if the following code respects coding standards and naming conventions because I want to write beautiful code. The purpose of this program was to help me understand different concepts that I've learned in the last few days but I was having difficulties thoroughly understanding th...
I have an array like Original = {1, 2, 3, 6, 7, 8, 9, 10, 12}. After removing some elements like Delete = {6, 7} from it, I want to get n sequential numbers which are not in the array, like IDs = {4, 5, 6, 7, 11, 13, 14, ..., n}. After getting the numbers I want the original array to be changed to the updated array. pu...
I have finished writing my nice and little text editor in Python with Tkinter. I tried to achieve the best user experience that I could. I want this code to be 2/3 compatible, I tested it in both versions but if you could test it out again in the 2 versions too it would very knd of you. I did not use a class on purpo...
Recently I wrote some code to take two arrays of data and create a title. Each array could have 0-n elements. However, the multiple if statements seem messy to me. Is there a nicer way to do this? Perhaps one that harnesses the power of jQuery better? var campaign_names = data["campaign_names"]; var list_names = data["...
I'm learning Clojure and have written a small function to calculate change. I don't like few things about the code and would primarily like to replace recursive call with something more idiomatic. Could you please comment on the code and suggest a better (more Clojure-like) way of implementing it? (def in-bank #{1 2 5 ...
This is part of a bigger project I'm doing to get better at JavaScript. It's basically the beginnings of a combat log parser for World of Warcraft. It looks a bit messy right now and I could really use some feedback at this point since I'm not really sure if I'm moving in the right direction here. The code doesn't fee...
I did some guesswork tweaking and let the heap reach a maximum of ~450 megabytes (was originally using invokeAll). The program just finished in 6.3 minutes. I've been advised to use ctrl + break to obtain a thread dump, but I am not experienced enough to use these results effectively yet. Finally, running the profiler ...
Is there a way to write this simpler? if(criteria.SortBy =="name") { if (criteria.SortDirection == "ascending") { physicians.Sort((x, y) => string.Compare(x.Name, y.Name)); } else { physicians.Sort((x, y) => string.Compare(y.Name,x.Name )); } } if (criteria.SortBy == "birth") {...
I want to be sure that this isn't vulnerable to SQL injection. If yes, then how can it be improved? $pid = $_REQUEST['product_id']; $query1 = "SELECT * FROM products WHERE id = '" . $pid . "'"; $result = mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1); $thisrow=mysql_fetch_row($result); if ($t...
The following is a excerpt from a class that is supposed to represent a reflection of an object in a 3D world, like in a mirror. After I started I discovered that mirroring is a property of an object, it is either mirrored, or it isn't. Multiple mirrors don't come up with unique objects but just keep flipping from one ...
I have wanted a way to do code profiling in VBA for quite some time. It becomes very complicated to figure out what methods are actually being executed for how long and how often in complex Access applications. A key reason this is complicated is that many form events or function calculations happen very often and not ...
I started making a text-based RPG game and before I spend a lot of time on it, I wanted to know if there is a better way to make it. Currently I'm using switches to flow through the game, I also know some people use a lot of if statements, but is there a more efficient way? Main public class Main { public static G...
I'm a beginning C programmer. As an exercise, I have attempted to implement a stack of strings in C. This is my first real exercise working with pointers. I looked at some other similar posts on here, and read through the comments. It seems that most individuals have chosen to do this by using linked lists, whereas I'v...
In A Tour of Go, you are given the following problem: In this exercise you'll use Go's concurrency features to parallelize a web crawler. Modify the Crawl function to fetch URLs in parallel without fetching the same URL twice. This is the code you're given package main import ( "fmt" ) type Fetcher interfa...
I have been working on a port of JavaCC for Android. It is mainly an interface. I needed only to modify the original source to redirect output to a TextView. The point of this project is to rekindle my coding skills after years of dormancy, to actually finish a coding project, and to make a useful port of JavaCC that I...
I have a package directory pkg with several classes that I would like to build into a convenient dict property. The structure of pkg/ looks like: pkg/base.py: class _MyBase(object): pass pkg/foo.py: from .base import _MyBase class Foo(_MyBase): pass And in pkg/__init__.py, it is a bit clunky, but once pkg i...
I want to control a motor which rotates a device over a gear. Input values for the device are from 0 to 360 degrees. The motor should always rotate the device the shorter way around. For example, if the position is 30° and target position will be 340°, it should rotate over 0° counter clockwise. The motor controller in...
GetBootstrap-2.0 update from GetBootstrap-1.0.0.2 I just update my console application customizer and add some new features like disable minimize, maximize and close button, new color and simple popup box. Help me review my codes... Here is my sample preview of GetBootstrap-2.0: The preview contains Write(), WriteLine...
I'm writing this as (eventually) part of a larger program. This will serve as the bulk data insertion from .csv files we parse. I'm primarily looking for parts that are breaking Go's formatting, styling, etc. rules redundant and/or dangerous Right now the code works and all 4 million rows of the .csv file were proper...
I have used reflection for divide the complex property. For example, if I bind A.B[0], CustomerName means CustomerName is returned. Can anyone help to reduce the code? var itemproperties = view.GetItemProperties(); if (itemproperties != null) { if (propName.Contains(".")) { string actua...
I'm working with C# and .NET Framework 4.0 and Windows Forms. On my project I have three custom objects that inherits from MyControl class (MyControl class inherits from UserControl). I have this code: private void ShowControlForBatchStatus(BatchStatus batchStatus) { MyControl control = null; panelContainer.Co...
Input : <h2>{translate} Dear Atteck {/translate} <br/></h2>{translate}Please complete registration</h5> {/translate} Output : <h2> Дeaр Аттeҗк<b/></h2>Плeaсe җомплeтe</һ5> Main code: private static readonly Dictionary<string, IOrderedEnumerable<KeyValuePair<string, string>>> TransliterationMaps = new Dictionary<strin...
I made a cool roll-over in CSS which displays an animated GIF when the parent is hovered. Codepen The problem is that I will have about 40 .day like that, all playing the animated GIF behind the circle at any time. I'm not sure that any browser/computer/connection can handle that much. I tried to figure out a solution:...
I find this piece of Java code really ugly and cumbersome. How can I refactor it to be more clean and easier to read? ByteArrayOutputStream out = null; try { out = new ByteArrayOutputStream(); workbook.write(out); return out.toByteArray(); } catch (Exception e) { e.printStackTrace(); } finally { tr...
I am trying to connect to a server. If the connection goes through, then print an apt message. If the connection does not go through, try for a total of n times. And quit after the nth attempt with an apt message. I set up a mock server like this - class Server: def __init__(self): self.connection_st...
$("#colors_added").html(parseFloat($("#colors_added").html()) + 1); This JS line makes my IDE go Duplicated jQuery selector with the following explanation: Checks that jQuery selectors are used in an efficient way. It suggests to split descendant selectors which are prefaced with ID selector and warns about duplicate...
I've written a function that wraps the classList API, allowing you to pass an array of classes to add/remove, or the variable arguments already supported by classList. The methods are the following: var flatten = function(array) { return Array.prototype.concat.apply([], array); }; var classMethod = function(method...
This simulated annealing program tries to look for the status that minimizes the energy value calculated by the energy function. The status class, energy function and next function may be resource-intensive on future usage, so I would like to know if this is a suitable way to code it. #pragma once #include <cmath> #in...
This is probably the noobiest SQL question ever, and I'm almost positive there's a JOIN or something in PostgreSQL for this, but I can't find it so I'm using a naive method. Here's a bit about my schema: phrases: CREATE TABLE phrases ( phrase_id bigserial NOT NULL, language character varying(4) NOT NULL, text tex...
I'm trying to sort an array with JavaScript. The objects should be sorted based on several properties (about 4 in my real scenario), which are all strings that may also be null or undefined. A null or undefined value should be treated similar, and should be "earlier" in the sorted array than items with values. I used u...
I'm learning Haskell on my own and I'm following the material of a course. I would like to know if this is idiomatic Haskell. asList :: [String] -> String asList ss = "[" ++ (concat $ intersperse "," ss) ++ "]"
In our application, we have many function calls that we want to cache the results of. However, the result of these functions depends on database calls, so we want this cache to refresh every so often so that new data is pulled from the database on a regular basis. (Note: we know that these values are changing once a da...
Disclaimer: I just asked this on the regular SE, but was suggested to post it in here since it's kind of a code review. I've recently been playing around with component frameworks, and I'm trying to create a basic trigger component. The component should be able to take one (or more) pair of values that can be compared ...
I created the following function below to merge the real values with the predicted values (when real are absent) in a new column in data.frame. The function actually works, but I would like to optimize it, because with the dataset that I work with, the function takes about two hours to run. The function seems to be slo...
I am building a php based mobile website that must be in both Spanish and English. This is my first bilingual site so I've been having to re-think a lot of coding practices I currently use to accommodate multiple languages. I'm using a custom MVC pattern and currently I'm trying to use the same controller and model fo...
I'm writing a simple utility class for sending an email. I'm not sure what's the proper way to present this to a consumer. Should I force them to use an array in send()? Or should I provide an overload so they can pass a single argument? public class SimpleSender { public static void send(String smtpServer, String...
This is from my own question on Stack Overflow. I want to get average numbers from a range such that they fit an intended average. I expect something bell-curve-like, but asymmetrical unless the average is the mean of the range. The function should allow for any degree of deviation. In my Overflow question, I wante...
I have a class that I use to display on a web page fieldset. However, all of the properties of this class are optionally filled in by the user, which means all of them could be null/default. In this case I would like not to render the fieldset at all, instead of displaying an empty one. I wrote a simple isEmpty() metho...
I made a database for my Android app using SQLite and it works fine. However, as I understood, SQLite calls shouldn't be made on UI thread. Is the below okay or not? /** * @param howMany Amount of Stations returned, passing null returns all. * Sorted after last time searched. * @return ...
I have a script that contains functions from login in to posting status to friend request send and receive. Pretty much a social network script. Anyways i think my security is not up to date so if anyone can check my code out or review it live on the web: iphone.hostei.com. email is demo@demo.com and password is demo12...
Here is my first Canvas/JS banner. I just got a flash one and hand-coded it from the beginning to the end. I have several major concerns/questions: I have seen several banners made in Adobe Flash, despite there being several external libraries are used (which is not cool in my case). There is also only ONE canvas, so ...
To get used to Haskell, I wrote a little program using the Diagrams package which generates 100 random dots (larger dots are more likely to be in the center). Sample output: My questions: Is the program well structured with respect to the IO monad and the random values (see types for randomDot and randomDots)? Should...
I've reworked (for C++11) a section of PyCXX which contained an almost identical iterator and const_iterator. I would like to know whether there is any way I can further tidy the code. (Please bear in mind that the original was written maybe 20 years ago). Here is the original: template<TEMPLATE_TYPENAME T> class SeqBa...
I'm reading CLRS, and to practice, I rolled my version of radix sort and counting sort. I was looking at some reference implementations, particularly the LSD one from Rosetta Code, and mine performs significantly better (~10 times), especially on 64 bit inputs and if the maximum input range is known. I think one place ...
I was able to complete the problem doing it in this manner, but I would assume there has to be an easier way. Sample input: abc, cba Output: Both strings of characters are equivalent. Or abc, acc Output: Different import java.util.Scanner; public class StringTest { public static void main(String[] args) ...
I have written this Active Directory password changer script. Comments and testing is appreciated for things I may have overlooked, since this is my first AD Script. There are two parts: PHP and PowerShell. This is being run on an IIS Server with PHP 5.4.x with Fast CGI and PowerShell 2.x. The IIS_IUSRS is a manager of...
I've implemented the phoenix-singleton as a class template with boost inspired by Modern C++ Design. The code compiles fine with MSVC 2013 - and it seems to work, but I'm new to multi-threaded programming and Boost. Are there any pitfalls in the code? Improvements? TSingleton.h #ifndef TSINGLETON_H #define TSINGLETON_H...
I'm new to Python and as a first exercise, I've written a function (module?) to calculate Kaprekar's constant using Python 3. I'd like some feedback on whether this is Pythonic enough, and if I can improve it. import collections def kaprekar(value): print("Starting value: %d" % value) # Check ou...
I am modeling an infectious disease with a fixed incubation period. I chose a queue to keep track of when people become symptomatic. I imagined using some operations like so: queue' = enqueue numberOfPeopleWhoJustGotInfected queue (numberOfPeopleWhoJustBecameSymptomatic,queue'') = dequeue queue Since enqueue and deque...
I have expanded a lot on my last project and had a lot of fun doing it. It was great to build out all the code. I am new to JS so these types of projects are really helping me learn. Please be honest about where I can improve the clean the code. I learnt about the helper functions after I posted here last time and love...
I'm just learning Haskell on my own, and did an exercise to implement insertBST. Is this idiomatic Haskell? insertBST :: (a -> a -> Ordering) -> a -> BST a -> BST a insertBST _ v Leaf = Node Leaf v Leaf insertBST cmp v (Node left nv right) = case (cmp v nv) of EQ -> Node (insertBST cmp v left) nv right ...
I'm learning Haskell on my own, and I'm wondering if this is idiomatic Haskell. In particular: is it a common pattern to "wrap" the result in a list in order to make a function total? (that's what I ended up doing to ensure the function was total and no compiler warnings about not matching a pattern). safeHead :: [a] -...
As a newbie programmer, I decided to try my hand at making a program whose function actually might be useful to someone, somewhere. This utility takes a text file, reads it out to the user, displays its length (in bytes), asks the user if they would like to alphabetize, randomize, or do nothing to the contents of the f...
Problem Statement: Design a BALANCE class with account number, balance and date of last updation. Consider a TRANSACTION class with account number, date of transaction, amount and transaction type. Check whether the amount is available or not in case of a withdrawal. Transaction object will make necessary upda...
The following code compiles correctly: public ContextStatus Commit(string userName) { var status = new ContextStatus(); var task = Task.Run(async () => { status = await CommitAsync(userName, new CancellationToken()); }); task.Wait(); return status; } public async Task<...
How could I make this code dry? $("#btnSubmitToCheckOut").click(function(event) { var isSelected = []; $(".age_agree :checkbox").each(function() { if ($(this).is(":checked")) { isSelected.push("true"); } else { isSelected.push("false"); ...
It's really a nitty-gritty issue for me, and I have been here many times before. How could this be improved? I have a basic viewmodel for a view: public class LoginViewModel : BaseViewModel { public User _User { get; set; } } My base class looks like this: public class BaseViewModel { public List<string> State...
I will be creating a web service as part of a group project for university, which will be developed using Java within the Eclipse IDE. Having no prior experience using web services, I managed to find some tutorials that were useful, but struggled to find enough database code examples which suited my needs (though, per...
I have developed the following script to zip and then remove all files with "*.log" extension in the file name that were modified yesterday. It's definitely not 100% at the moment. For example, it misses files from yesterday that have a modified time of 00:00. #!/bin/bash yest=$(date --date="yesterday" +"%m_%d_%Y") f...
My problem is quite straightforward. I want to build a factory, but the kind of object returned depends on a value read from a bean that is somehow a cache. So of course, I can't call the bean's method from the static method in the factory: public interface FinderService { public String find(String name); } publ...
Here is my code for generating edge list based on Price model algorithm. I think there have two points to reduce execution time: use proper data type use faster random sampling Originally, I used list instead of NumPy array and then changed from extending array till c x n to setting initial fixed array (and change th...
I would like to improve the performance of the piece of code below (in Fortran). It gives good results but the profiling tells me that it is where it spends most of its running time. Basically, it increments over a time window (j loop) and performs a spate of 2x2 matrix multiplications. I was wondering where I can refa...
I'm working on an old application written in JavaScript. It's absolutely littered with console.* messages some of which are useful for development purposes. At the very least I'd like to switch these off when a production flag is set. I would also like to stub off any unsupported console methods (trace on IE for exampl...
I have written a code for following problem: Write a program to grade a short multiple-choice quiz. The correct answers for the quiz are: C 5. B A 6. C B 7. C D 8. A Assume that the pass marks are 5 out of 8. The program stores the correct answers in an array. The submitted answers are specified as program argu...
I'm trying to think of a better way to write these routes in my routes.rb file: Rails.application.routes.draw do root 'home#index' s = /section1|section2|section3|section4/ y = /\d{4}/ m = /\d{1,2}/ resources :articles, except: [:index, :show] # The slug will replace the default params[:id] of the follow...
I'm in very early stages of learning some Java coding. I'm asking for this review because, although the code below works, I'd like to know if it's an ugly way of achieving it. What I want the code to do is take input from Scanner and reprint it, except if the input is empty, ie, just hit the return key, in which case t...
Hacker News recently released an official API. Unfortunately, it cannot be used to get the newest posts submitted. I wrote a script to provide a faux streaming-api like method (like praw reddit's submission_stream) so that I can simply put it in a loop and do something like make a gtk-notification when title contains t...
I want to be able to write logging data out to a network device with the same ease as using std::cout, so I implemented an ostream wrapper. The wrapper uses the C file IO functions to simulate writing to the device. I am looking for feedback on whether or not I have implemented the ostream API correctly. device_ostream...
I have the following arrays: Array (db_values) ( [0] => Array ( [system_name] => object_car_brand [value] => Alfa Romeo [id] => 136 ) [1] => Array ( [system_name] => object_car_model [value] => Spider [id] => 137 ) ) Array (db_attributes) ( [0] => Array...
Given a huge graph, I want to traverse it, in the fastest way possible, and extract a subgraph with the following properties: the starting node is specified the maximum number of elements and max depth can be specified if there are more links than the number specified, I want to save the information about the original...
I wrote a very small little DSL for spec testing: (ns funky-spec.core) (def described-entity (ref nil)) (defn it [fun & v] (assert (apply fun (cons (deref described-entity) v)))) (def it-is it) (def it-is-the it) (defmacro describe [value nest] `(dosync (ref-set described-entity ~value) ~nest)) (def...
public function setErrorReporting() { if($this->debugMode == 0) { error_reporting(0); } elseif($this->debugMode == 1) { error_reporting("E_ALL"); } elseif($this->debugMode == 2) { error_reporting("E_ALL"); // Also log errors } I want to change the error reporting bas...
I am looking for this code to look neater, and if possible, less bulky. I am new to def and to dictionaries, so I think throwing a few of those in here could shorten the code. Here is the code for the RPG: # RPG_TEST #Dennis Gordick #10/21/2014 """ Task list: fix bug where you can sell potions you don't have allow play...
This is a followup to Improved stack implementation using a linked list Simple stack implementation using linked list Please review my hopefully improved stack implementation As suggested by some answers to my previous code, some of the functions can be overloaded to provide versions of return by value, return by re...
I wrote a random world generator for the classic Snakes and Ladders board game. Snakes and Ladders is a dice game played over a grid, usually 10x10. You win by reaching the last square first. The board has ladders and snakes that connect specific squares. Land at the base of a ladder and you climb to the ladder's head...
At work I decided it would be better to reverse engineer a SDK for one of our pieces of hardware. Because it is work related I can't share the exact code.. but I can give enough of a gist of the code with the following question in mind. Is there a design pattern that better reflects what I want to do? I'm going to desc...
The following is an implementation of a random world generator for the classic Snakes and Ladders game. This is a follow up to this question, where I reviewed my own original implementation. I am asking for a review of my review. The world rules are: The head of a snake can not be on the last square (you'll never win)...
This program will scrape Wikipedia to create a list of all English Wikipedia articles. How can I improve this program as it currently performs very badly performance-wise? On my Internet connection it takes about 1-2 secs per processed link. import wget # I use wget for downloading the files import os ...
I need to make a simple class that tracks how many clients are listening to a specific item, will be referred to as building hence forth. I will have a timer running that will check which buildings are active and send updates to them. While this is occurring, the client will be able connect and disconnect. This mean...
I implemented an implicit treap and tested it a little. It works fine but I'd like to know if there are ways to improve/simplify things and/or if some parts are incorrect. Later, I'll augment code to allow for more operations (interval reversal, shifts, etc..). Treap node. struct Node { int v, p, c; /* value, priorit...
Currently I try to create some unit tests for a project, which provides access to some webservice methods. It's interface is rather simple. I have a class "WebService" which offers methods like "CreatePDF". Here's a little example: The Model: The model contains a number of properties, which each represent a URL paramet...
I implemented as follows and it works (I got the solution here), but I really wonder if I can do that without having to define an array. For 20 it's a hassle but can be done, but what if you have an hundred to do? Is there a more "aesthetic" way to do that? public void afficheuneimagecombo() { for (int i = 0; i <...
This seems like an easy thing to mess up, so I'd be grateful if you could think of any edge-cases that I've missed. public class StreamIterable<T> implements Iterable<T> { private final Stream<T> stream; public StreamIterable(Stream<T> stream) { this.stream = stream; } @Override public Iterator<T> iter...
I have a simple game where you try to go as high up with rockets as possible. I currently store 2 statistics about your playthrough: Current altitude Highest altitude These statistics are stored in a Dictionary<string,float> where the string key is the name of the statistic. I have two tasks related to stats, settin...
I have one HashMap<String, ArrayList<String>> and I want to concatenate a key with every item in its ArrayList. Consider the following demo program: HashMap<String, ArrayList<String>> map1 = new HashMap<String, ArrayList<String>>(); ArrayList<String> map11 = new ArrayList<String>(); map11.add("a"); ...
I am learning MVC and Android. I have create a sample program which is supposed to implement the MVC philosophy. I plan to build my codes on top of this. I wish to know whether I have got the concept more or less, or if there are any fundamental issues in my understanding of the MVC. Summary: This application will get ...
I've two versions of promise code. The page is a simple one - an unordered list with a few items. I am trying to make the items show up (fadeIn) one-after-another sequentially. This exercise is done to sort of explain people what promises are... Version 1: $('li').hide(); var fadeInFunc = function (obj) { var defe...
My code works perfectly fine and I would just like to clean it up a little. From the research I've done, I cannot find anyone that used a multidimensional list to a game of TTT. I'm just looking for a way to make this code prettier than it is right now. grid = [['-','-','-'], ['-','-','-'], ['-','-','-']]...
When Page_Load is executed I assign the ImageUrl which is a IHTTPHandler: imgView.ImageUrl = "ImageHandler.ashx" + "?rezeptId=" + rezeptId.ToString() +"&imageId=0"; Which looks like this: public class ImageHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { int rezeptId = Int32.Pa...
I wonder if the code below is a good (quality and correctness) implementation of a single linked list in C++, in regard of data structure (not the exposed interface). class List { class Node { friend class List; int value; Node *next; }; Node *head, *last; public: int size; List() { hea...
My code converts a number from one number system to another (from binary to 36 and back). Do you think my formatting is successful or not? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <locale.h> #include <math.h> //#include <vld.h> #define _CRT_SECURE_NO_WARNIN #define MAXMEMORY 10 const int EX...
The following is my Ruby attempt at a (very) basic CSV file parser class, inspired by an exercise from the book Seven Languages in Seven Weeks. I'm a Ruby novice and will be grateful for any suggestions for improvement. #!/usr/local/bin/ruby -w # CSV file parser. # # USAGE: # CsvFile.new('data.csv').each { |row| puts ...
I'm in the process of creating a forex trading algorithm and wanted to try my shot at calculating EMA (Exponential Moving Averages). My results appear to be correct (compared to the calculations I did by hand) so I believe the following method works, but just wanted to get an extra set of eyes to makes sure i'm not mis...
I am developing a reporting application in Flask where I pull data in a route function from a postgresql database and jsonify the data. On the client side I have some javascript that does a $.getJSON on the route to request the data. Here is what the code looks like. Flask route def get_db(): if not hasattr(g, 'po...
This game that I semi coded is a little bulky and kind of boring. I want to know if there is anything simple I can do to shrink it and add a little spice to the code. # Word Jumble # # The computer picks a random word and then "jumbles" it # The player has to guess the original word import random # create a sequence ...
I recently had to install VNC on mass across a lot of computers on a domain and needed some info about their PC, for example: Host name Username MAC Address IPv4 Address Domain name Once all of this info is gathered, it is compiled into a text file and uploaded to a FTP server. To save files from being conflicted wit...
Since I had been in the need of finding directories from a startpath with different search depth levels, I created this little helper class. This class is using objects of the System.IO namespace. public class IOHelper { public const int AllDirectories = -1; public const int TopDirectoryOnly = 0; private co...
I have been working on this: Design a class for a bank database. The database should support the following operations: ❍ deposit a certain amount into an account ❍ withdraw a certain amount from an account ❍ get the balance (i.e., the current amount) in an account ❍ transfer an amount from one account to another Th...