instruction
stringlengths
71
39k
I am trying to write a module that automatically subdivides div-elements, given some initial parameters. I've prepared the following jsfiddle. What I am doing at the moment is: Setting the width and height of the parent element. Setting the child elements to float left and assigning percentual width and height to the...
I have the following class: public class IssueWithComments : Issue { public IReadOnlyList<IssueComment> FullComments { get; set; } public IssueWithComments() : this(new List<IssueComment>()) { } public IssueWithComments(IEnumerable<IssueComment> comments) { FullComments = comme...
This is the problem: (Game: display a tic-tac-toe board) Display a frame that contains nine labels. A label may display an image icon for X or and image icon for O. What to display is randomly decided. Use the Math.random() method to generate an integer 0 or 1, which corresponds to displaying an X or O image icon. Thes...
I have rewritten my C Mandelbrot set image generator, including many suggestions given in my previous question (see: Mandelbrot image generator), as well as some recomendations by a friend. The total list of additions is as follows: Parallelisation (omp.h) typedef-ing of structures Implementing a better file-type (P6 ...
In my previous NQueens Code Review question, I received feedback saying that I should write a program that would find all solutions. This revised program should be more general than before. import java.util.*; public class RedoNQueens { public static void main(String[] args) { Scanner input = new Scanner(S...
I was trying to implement the sieve of Eratosthenes entirely by myself, using only what I have learned so far. Now I'm wondering what I can do to improve my code's readability. Optimizing the algorithm is not my goal for now. #include <iostream> #include <cmath> using namespace std; class num { private: static un...
I'm trying to figure out what the best way to do this is. I have a part on my website where people can search for a particular card based on multiple different factors. Like the name of the card, color, cost, etc. When the user types in the criteria, I send the information via ajax GET. So the url looks something like ...
I'm very happy with the performance, but I always try to optimize my code as much as possible. Since I plan on using the code in production, I feel more save posting it here first. I probably missed something obvious that could break everything. Let's start with the KVF class. Its job is loading / saving values to the ...
After several attempts to follow my intuition that this code can be refactored to something more DRY, I keep hitting road blocks. Hoping someone can see a refactor that might get me going in a nicer direction. I'm trying not to break anything out of this one code file, although, I suppose helper types could be placed i...
I am currently writing code for a UART communication in my firmware. I am getting an interrupt every byte received (meaning I don't get a chunk of data, 1 byte at a time but, in the sample below I store them into a chunk of data for simulating my data parsing only). I have a dynamic message length format, as shown in t...
I am trying to refactor a switch statement. I know that you can replace a switch with a Dictionary, or a strategy pattern but it kind of feels like overkill for what I have. Switch var filters = new List<ColumnFilter>(); switch (gridColumnDataType) { case "System.String": ...
CreateInputParameter is an overloaded function with 6 type overloads, is it possible to simplify the following code or is this as good as it gets? I wish to call it like this : CreateInputParameter( string , object ) like following code : private void AddInputParameter(string description, object value) { ...
Within a complicated Ruby project, I need to monitor the connection to a PostgreSQL database, as answered here. I use a thread for this purpose. Every few milliseconds, I invoke "consume_input" which will raise an exception of the database connection no longer exists. If might have been closed for a number of reasons, ...
I would like to have advice on this use of base class and derived class. This all works but is it a good way to achieve a SOLID class? public class ProductRepository : GenericDataExport { private const string DB_TABLE = "[dbo].[ReplenEdit]"; private int rowsUpdated; pr...
My nested (ordered) dictionary looks like this: OrderedDict([ ('1', OrderedDict([('1994_fte_count', '4'), ('1995_fte_count', '2'), ('1996_fte_count', '5'), ('1997_fte_count', '7')])), ('2', OrderedDict([('1994_fte_count', '5'), ('1995_fte_count', '22'), ('1996_fte_count', '6'), ('1997_fte_count', '3')])), (...
I'd like to write classes which are Pythonic, readable and easy-usable. A main issue for me is to keep data consistency. Here is an example (version 1): from collections import namedtuple import math Point = namedtuple('Point', ['x', 'y']) class PointsAlongCircle(object): '''Set of regularly spaced points along ...
Entity Framework (version 6) generates classes based on your tables that look like this (where each property represents a field in the table): using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; [Table("dbo.MyTable")] public partial class MyTable { [Key] [DatabaseGe...
I'm preparing a new tool for our deployment system. One part of it is to generate a set of XML-files for modules. The tool is really big, so I'll post only one function here for your consideration. Prerequisites We have a template for new XML files, which looks like this: <plugin assemblyUrl="%DATAURLPREFIX%/%MOD_DLL%...
I am preparing for interviews where my code would be judged based on optimizations, OOP concepts, code readability as well as my knowledge of JAVA and design patterns. What comments will you give in code review for the below code? This is my code for Kth Largest element in an Array. The logic is to create a K size max...
A couple of questions: Is the algorithm wasting CPU time or memory unnecessarily? If there is something in the code that is not idiomatic Python, how to improve on that? def permute_first( c ): retval = [] retval.append( c.upper() ) retval.append( c.lower() ) return retval def permute( str ): le...
Any thoughts on improving this method of finding the next 8 Mondays not including today? var app = angular.module("angularApp", []); app.controller("appController", function($scope, $filter) { $scope.mondays = []; var MILLISECONDS_IN_A_DAY = 1000 * 60 * 60 * 24, now = new Date(), nowTime = now.getTime(),...
Okay I have the following use case: Module A broadcasts an event. Module B listens to that event. Maybe also Module C listens to that event. Now Module B has to perform an asynchronous operation before Module A may proceed with its code. I solved this by creating an custom module $deferredEvents which allows to queue u...
The company I am with has a lot of old code migrated over from ALPHA Basic, written back in the 1980s. As development languages have evolved (should I say, "died off"?) the code has been migrated to newer languages. The company also hires a lot of new graduates from a local college. Sometimes, the code is written in a ...
Okay, I am wanting to expand my armoury within PHP, so I've been researching OO PHP. With my researched knowledge I went on to create a quick script that reads a CSV file and outputs the results. CSV Class: class CSV { private $file; public function __construct($filename, $mode) { $this->file = fopen...
A few weeks ago, I wrote a Python implementation of 2048. Since then, I've been working on a simple AI to play the game for me. The code uses expectimax search to evaluate each move, and chooses the move that maximizes the search as the next move to execute. Similar to what others have suggested, the evaluation functi...
I am using Python with libtcodpy to build a turn-based strategy game. In this game each unit has a maximum range which varies from 4-10. This range determines how many "steps" the unit can take and therefore the distance it can move on the game map. I wish to output all the squares which the unit can move to, based upo...
The below macro finds and pastes images into column A. While the macro works, it starts to slow down when running 500+ images. I am not too familiar with the VBA language, does anyone have any suggestions to make this code quicker and/or more elegant? My existing Macro is as follows: Sub Picture() 'This Sub Looks f...
What a difference 1 bit makes! This very fast, simple sieve of Eratosthenes quickly finds 32 bit primes. It uses a memory efficient BitArray for odd numbers – but the BitArray is at the maximum allowable length of an array. While it borrows heavily from its 31 bit counterpart, Sieve31, this sieve has some interestin...
I want a Python example that illustrates how object.__getattribute__ resolves instance attribute lookups. I'm looking for feedback about the following code. Is it a "close-enough" approximation of the object.__getattribute__ workflow using Python? I'm aware that under the hood C is accessing the type/object slots and ...
I've written code in Free Pascal based on a contest problem (The contest insists that I have to write with Pascal). It works like charm, but I think it still need some improvements, from memory usage to runtime. Input Format First line is n (Number of people in the Yellow Pages) and q (Number of people to search)...
The code below represents a lock-free ordered single-linked list, and is a modification of the algorithm proposed in this doc. How can I improve speed of searching (lookingup) in the list maintaining lock-free capability? Any suggestions, code modifications, examples, maybe other lock-free data structures? typedef uint...
This code works, but I feel like it's really hacky and could be done a lot better. Can anyone give some advice on how this could be neater? $scope.arrays = function() { $scope.committees = []; $scope.employees = []; $http({method: 'GET', url: 'data.php'}).success(function(data) { an...
I just created a naming convention analyzer + code fix based on the Roslyn platform. The implemented naming conventions are the following: If you're interested in seeing all the test scenarios that have been covered, you can take a look here. Some notes about the implementation: Analyzers and code fixes cannot share ...
Is there a way to improve this code? (specially how I built the recursion and the breaking out of the loops and conditionals) # Returns sum of present value of a sequence of cash flows # rate = interest rate (month) # initial amount = balance at the beginning # *amounts = sequence of cash flows (1 or more) def prese...
I have a Ruby script meant for some basic database tasks, such as add a user and deactivate a user. The end user can load up the script and follow the basic path of "Do I want to add a user?", or "Do I want to deactivate a user?". They have the option to retreat back to the main menu if needed. The script works just f...
I'm tinkering with the idea of crafting a search engine in my spare time. More of a learning experience than anything at this point, but still a project. A key aspect of this system is checking whether a domain is live or not. That's what this code is trying to do (and is succeeding). It's written in Java, and using...
I wrote my first python code to conduct PSO. I am wondering about the best practices for Python. While my code works, I want to make sure it's orthodox as well. For example, here is my class I use followed by a function that initializes the list of Particles that I use for the algorithm: ########### data representation...
After reading a bunch of Ruby tutorials, I decide to write fake ATM bank software. I've tried to use OOP design and just want to know if I'm on the right road. require "yaml" require 'colorize' class Person attr_accessor :info def initialize(info={}) @info = info end def change_info(info={})...
So I'm one of those weirdos over here talking about making a game engine for text-based (think Zork) games. There was pretty recently another question by someone else working on the same thing, if you're interested. Anyway, this is a prototype of the code for that engine, but instead of reading for a file (and being wr...
Question is here: Input The first line contains an integer \$N\$, which is the quantity of numbers written down by Vasya (\$1 \le N \le 1000\$). The second line contains these numbers separated by spaces. All the numbers are positive integers not greater than 10. Output Output the numbers Petya would write down separa...
I've built a function that mimics _.throttle (returns a new, throttled version of the passed function, that, when invoked repeatedly, will only actually call the original function at most once per every wait milliseconds). I would like to know what you think about my code, especially if the code is clean and essential ...
I came across this coding problem. Back in primary school, maybe you were sometimes asked to solve a fill-in-the-blank sum - or "mystery sum" - in which certain digits are removed and you had to figure out what they originally were. Now, it's time for serious business: sums with no digits, where every digit is r...
I have a CheckChanged method that I would like to improve as it takes a lot of space in my program and really hurts readability. The method prompts the user for input "Comments" and that is stored. However the below code is being used up to 70 times so any way to optimize would be great. private void checkBox45_Check...
This is a project Euler Problem #50. Here is my solution with the problem. /* * The prime 41, can be written as the sum of six consecutive primes: 41 = 2 * + 3 + 5 + 7 + 11 + 13 This is the longest sum of consecutive primes that * adds to a prime below one-hundred. The longest sum of consecutive primes * below one-...
This is my first jQuery plugin (used the jQuery ui widget factory). All code improvements are welcome. GitHub The plugin creates a gallery with one big picture and a given amount of clickable thumbnails. When the last thumbnail of set has been clicked it fades into the next thumbnail set. ;(function ($, window, documen...
I have created a python script that takes a 2D NumPy array of elevation values and given a seed value and an elevation it will grow a flood from that seed point. It does this by checking all adjacent cells to see if they are above or below the flood level. From there it checks all of those locations until all cells tha...
I've just created a function to check if your IP is within an array of IPs. The IP array can contain ranges like 192.168/170.50.0/255. I have a working example, but it seems a bit clunky to me. Is there anything wrong with my method, or anything I could improve? Link to Ideone example. <?php function checkIpWhitelist...
I have script which plays audio, shows/hides elements: var audio = new Audio("audio/test.mp3"); audio.addEventListener("ended", function(){ element.fadeIn(0); setTimeout(function() { element2.fadeIn(0); setTimeout(function() { elemen...
I wrote a PHP class in Zephir to increase performance, but it is still very slow and memory consuming. To compare, I wrote several variants of the same code, but unpack() is always nearly as slow at storing the data in a csv file. Is there any way to optimize this code? About 30% of the whole program time is spent in u...
For primality testing of 64 bit ulong, I have optimized a very fast trial-by-division test using possible factors of the form 6k+/-1. For input numbers less than uint.MaxValue serial testing is performed. For really larger numbers, parallel processing is performed. Again as optimized as it is, it is still trial-by-di...
In my efforts to learn the Swift language, I am trying to mix in a pet project along with my learning of the basic language syntax. In essence, i'm trying to write an iOS keypad application to work with my house alarm, which I have utilizing a device from Alarm Decoder. The device basically opens up a socket which I ha...
I have a small function in Objective-C which uses the C Socket API to check if the device has an active internet connection: #include <netdb.h> - (BOOL)isNetworkAvailable { char *hostname; struct hostent *hostinfo; hostname = "youtube.com"; hostinfo = gethostbyname(hostname); if (hostinfo == NULL)...
I have a QTreeview that is filled with data from data_for_tree dictionary. Suppose that dictionary represents the most common purchases a person makes. I call it "source list". Data, shown in that list differs from data that is shown in the "receiver list". Suppose a person inserted it via special form. The goal is - b...
I'm fairly new to C and wanted a general review of this code. It's a solution to this problem. You and your \$K-1\$ friends want to buy \$N\$ flowers. Flower number \$i\$ has cost \$c_i\$. Unfortunately the seller does not want just one customer to buy a lot of flowers, so he tries to change the price of flowers f...
This is a puzzle I found online that I have been trying to optimize and make the best version. I've tested it and it works great but I'm curious how it can be improved in any way. Instructions: "You forgot to give Professor Boolean's favorite rabbit specimen a name? You know how picky the professor is! Only particul...
I just completed my first multi class program, Blackjack, and it works! It allows the user to play Blackjack against a single dealer, with no other players at the table. I was wondering, seeing as it is my first multi class program, if you could help me optimize it and/or give me any advice. I want to implement insura...
I have this method that returns an array of all the hours for the past 24 hours, ex: if the current time is 3:24pm it looks like @[3pm,4pm...12am,1am...2pm,3pm]; Everything is working as it should, I was wondering if there was a more efficient (or pretty) way to do it than how I have it: NSCalendar *calendar = [NSCalen...
Here is my clone pointer template: #include <functional> #include <utility> #include <iostream> template<typename T> struct clone_ptr { clone_ptr() : ptr(nullptr), cloner(nullptr) {} clone_ptr(clone_ptr&& other) noexcept : clone_ptr() { swap( other ); } clone_ptr(const clone_ptr& ot...
I have created a MySQL database which will be used in a medical app, but I am pretty sure the design and the used queries can be improved, since I am new in database design. My biggest doubt is the s_apply column in combination table. The user should choose 1 main symptom (s_id). Main symptoms may have 0, 1 or 2 sympto...
I'm implementing a lock-free ordered doubly-linked list based on heavily modified paper entitled Split-Ordered Lists: Lock-Free Extensible Hash Tables by ORI SHALEV. My main concern is correctness of algorithm, secondly performance. Is the algorithm used in the code really lock-free? How can I improve the code? typedef...
A classic problem to split a string into its "root and suffix": (Stemming) The word "walk" is the base form for word "walking" (suffix is "ing"); The file path /var/www is the base path of /var/www/myApp; The string doi:10.1038/ncomms is the URN-prefix for doi:10.1038/ncomms7368 and doi:10.1038/ncomms7666; The word "h...
At the moment I am learning algorithms and here I am trying to implement a simple binary search tree. I would like to know your suggestions on whether I am on the right track or not, and how this can be improved. BinaryTree.cs class BinaryTree { private Node root; private int count; public BinaryTree() ...
Project Euler problem 1 says: Find the sum of all the multiples of 3 or 5 below 1000. I have written a program that will return the sum of the multiples of any list of positive integers. So for example if I wanted to know the sum of every integer that was a multiple of 3 and 5 that is less than 10 I would add 3,5,6, ...
I have implemented a simple read/write lock without using a critical section. I have tested my code by running 50 threads reading and writing the same data. .h file #pragma once #include "stdafx.h" class CReadWriteLock { public: CReadWriteLock(void); virtual ~CReadWriteLock(void); void LockReader(); voi...
(Project Euler #62) The digits of the cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly five permutations o...
I have a windows form application which uses a form for two different purposes. We use the form for both our handheld system and our in-house system. I would just like someone to review the code for saving and see if I have done it the best way or if not, what the best solution is. Windows Form Save Method private void...
I have a function, getUnusedName that returns a random name, but first checks if it's already used by any object within a second array. Observing how many times the function is called across multiple runs shows a pretty wide variation as I would expect when using random. Is there a more efficient way of achieving this?...
I wrote a simple calculator with general operations. Give me please some advice, suggestions, and criticism about my code: code design, readability, mistakes. Calculator.java import javax.swing.*; public class Calculator { public static void main(String[] args) { CalculatorView calculator = new CalculatorView(...
I am working on a code to see if a video already exists. The problem is that I have to check multiple sections. The code is working but it should not be this big, I think, and it takes a long time to load. Is there an easier way to do this? $xmlurl7b = 'http://mysite.me/library/sections/2/all?title=' . $movie->title() ...
I have the following problem in my algorithms textbook: Write a computer program that generates and counts how many words of 5 letters of the English alphabet can be formed, with the condition that no 2 consecutive letters can be consonants or vowels. From the statement, I understand that the output should have this ...
Last night I thought a word search would be fairly interesting to try. I'm not sure how proper ones run, but my one kind of works through the brute force method, where it'll place a letter in one spot (the first letter of a random word), and branch out in all directions while narrowing down the list of matching words u...
I like to explicit return function even for void functions to reduce the use of if-elses, like this code snippet: private void processContactBetweenPlayers(Contact contact) { final Body bodyA = contact.getFixtureA().getBody(); final Body bodyB = contact.getFixtureB().getBody(); if (!isPlayer(bodyA) || !isPl...
I have this Excel/VBA code and here is what it does: I have 3 sheets, where first sheet has two columns that will be used (A,C). 2nd Sheet is just the raw data file that will be imported from external source. 3rd sheet is the final output. Column A in the first sheet is "Raw Column Headings" where the column headers f...
3 elements forms arithmetic sequence, when difference between any two consecutives of them is the same. In our task we are given array A. Any pair of integers in this array is called slice (eg. (B,C)), when 0 <= B < C< N, where N is an array length (0<=N<=60). A slice (B,C) is called arithmetic, when the sequence: A[B]...
A triangle needs a good foundation. Every row in the triangle is derived from the sum of the two values below it. However, there can be no repeated values, if a value shows up more than once the triangle crumbles. Find the base which minimises the value in the top of the triangle satisfying the condition of no duplica...
I have a client GL file (Excel) that needs to be regularly imported to SQL Server (as tab-delimited txt). Sample (simplified): PayCode PayDesc Dept1 Dept2 Dept3 ======================================== REG Regular 00001 00001 00002 VAC Vacation 00011 00012 00013 HOL Holiday 00021 0...
I'm quite a newbie in Python and I want to speed up this method since it takes very long time especially when the size of the input file in Mbs. Also, I couldn't figure out how to use Cython in the for loop. I'm using this function with other functions to compare files byte by byte. Any recommendations? # this function...
The idea here is we have Roles, Permissions, and a table called PermissionRoles that connect the two. So a Permissions can be in many Roles, and many Permissions can have the same Role. So what the following code does is: Get all the permissions required for a user to authenticate, by ActionName Loop through each of t...
Given A and B, count the numbers N such that A ≤ N ≤ B and N is a palindrome. Input: First line contains T, the number of testcases. Each testcase consists of two integers A and B in one line. Output: For each testcase, print the required answer in one line. Constraints: 1 ≤ T ≤ 10 0 ≤ A ≤ B ≤ 10^5 private st...
I spent a long time searching for ways to create a quiz app and to create a way to sort through non-random questions. The only way I was able to create was to use a series of 3 dictionaries that are key:value pairs. With 1 being the questions, 1 answers and 1 the explanations for the answers. The app works by a user ch...
For project Euler, I need quite often to test things like is x*y*z < 1e18. Since BigInteger is usually too slow, long overflows, and double may return incorrect result due to rounding, I wanted to use long with appropriate checks. As Guava's LongMath.checkedMultiply throws, it can't be used as exception handling is too...
The following code removes all pictures that are placed into Column A. When running the code however I have noticed it runs fairly slow. This will be attached to a command button that will be located in A1, it is important that the deleting of pictures doesnt target this command button. Any suggestions? ' Clears Al...
This reads a huge database (SQLite) and extract any IP address similar to ip_base: for num_db=1:10 i=1; % connection to different db db_name='C:\Users\galotibi\Documents\MATLAB\user'; obj_name='jdbc:SQLite:C:\Users\galotibi\Documents\MATLAB\user'; databases=strcat(db_name,num2str(num_db),'.db'); objects=strcat(o...
I've coded a function which uses a map and creates a random way between two points. Startpoint is always 0/0 and the goal is somewhere else everytime on the map. Now I'd like to know if I could change anything to make that function more efficient or use another function. But I need to create random ways and not the fa...
(This problem is related to Simple string-split by root and sufix algorithm) There are many ways to find a "common root" of a list of similar strings, that begins with the same substring... The question is what the best way (faster and elegant)? Do you know a book or library with these algorithms? Example: in the set ...
I posted yesterday about my first attempt at a Blackjack game. After I received much helpful advice I tried my best to fix up my code. I was wondering what you would think about round two! Edit: I also wanted to implement the ability to split a hand if you have two of the same card. My User class already has a split me...
I have a function that is able to return the factors of a number that are prime. For example: The prime factors of 13195 are 5, 7, 13 and 29. The function works great, and I was even able to improve it by dividing by just prime numbers instead of all numbers. The problem is it still isn't efficient enough because at 10...
Is there a faster, more efficient way to read a text file than this implementation? Taking into account phones capabilities: dictionary = new ArrayList<String>(); long start = System.currentTimeMillis(); int count = 0; try{ InputStream inputStream = context.getAssets().open("words.txt"); ...
I've been playing with a simple toyrobot exercise to brush up some of my forgotten language skills and was wondering if there was a nicer way to implement my main command parsing loop. I think the use of the two maps and the nested ternary operator is readable but would be interested in seeing other approaches. #inclu...
I am trying to construct a binary message packet. It needs to escape binary value 0 by appending extra 0 in front of it: //Before escape data[] = { 1, 2, 3, 4, 5, 0, 6, 7, 8, 9 } //After escape - value 0 is appended after 0 data[] = { 1, 2, 3, 4, 5, 0, 0, 6, 7, 8, 9 } My source code: uint8_t escape_data[32]; uint8_t ...
I am working on making my code run smoother, since I will be using it a lot in a game in development, but I am stumped. Is there any way I could make this run faster? Improvements to the terrain generation and image drawing are both welcome. internal class Terrain { public Terrain(Content content) { Ran...
Below is my query to identify what hazard type does the buildings belong: def floodhazard_tbl(request): if request.method == "GET": reference_high = FloodHazard.objects.filter(hazard='High') reference_medium = FloodHazard.objects.filter(hazard='Medium') reference_low = FloodHazard.objects.fi...
How can I improve this code? public String checkAddressFromMelissaServer(boolean isEditMode, boolean addressChecked, Address address) { boolean isAddress = false; boolean isError = true; String SystemResult = ""; boolean systemErrorFlag = false; StringBuffer requestAddress = new ...
I'm doing some simple validations using jQuery to check if all textboxes are filled. $(document).ready(function () { $("#<%= btnInsertCountry.ClientID %>").click(function () { var codeValue = $("#<%= txtCountryCode.ClientID %>").val(); var nameValue = $("#<%= txtCountryName.ClientID %>").val(); if (codeVal...
Please review my registration code and suggest what changes I should make to improve security. I'm new to PHP and this is my first project. Also I have no Idea how to make a "forget password page" as I've used password_hash to store passwords in database. <!doctype html> <html> <head> <meta charset="utf-8"> <title>VALI...
I have an application which uses ASP.net Identity as for its user authentication. I do not wish for users to reset their own password (for reasons which are not relevant here), so I have developed the following back end system to allow system administrators to reset the users password. I have the following implementati...
I think that everyone is familiar with the concept of a context (such as HttpContext in ASP.NET) where you can put some shared resources and take them back later in another module (I think the most used scenario is current/logged in user information). Well it's obvious that usually these contexts are generic (and in a ...
I want to refactor this code that is currently in a partial Form Class and deals with edits made on certain cells in a datagridview (in this case called dgvReplenish). I would like to refactor so that I can create unit tests to be able to test the logic that effects changing the back color of cells, and updating other ...
Problem Statement: Given a string of words return all words which have their reverse present in the string as ( (word1 , reverseword1 ) , (word2 ,reverseword2) ) Example Case: Input: Sachin tendulkar is the best tseb eht nihcaS Output: { ( best , tseb ) , ( the , eht) , (Sachin , nihcaS) } My approach is ...
Based on this: asymmetric encryption in C# I added some more functionality to make it even easier to use (I combined the keySize and the keys into one base64 string). My requirements are: I want a public and private string key A simple method to call to encrypt or decrypt another string. This works, and the followi...