instruction
stringlengths
71
71.9k
I have the next bilinear resizing algorithm, and even though I use fixed point is still quite slow for my requirements. In the past I tried to cache some values in tables but the improvement was of a few not noticeable milliseconds. Is any other way I can improve the speed? As this is intended for ARM processors, I kno...
As explained in my blog article… I was looking up the docs for Javascript's String replace() function the other day (because, no, I could not remember the vagaries of its syntax!). And whilst being relieved I had remembered it correctly for my immediate requirements, I also noticed it can take a callback inste...
I am porting a linear optimization model for power plants from GAMS to Pyomo. Models in both frameworks are a collection of sets (both elementary or tuple sets), parameters (fixed values, defined over sets), variables (unknowns, defined over sets, value to be determined by optimization) and equations (defining relation...
I've written a little function that iterates over two iterables. The first one returns an object which is used to convert an object of the second iterable. I've got a working implementation, but would like to get some feedback. A simple use case would look like this: list(serialize([String(), String()], [1, 2])) # s...
I'm trying to learn how to use threads to generate lots of random numbers. In particular, I'd like know: Is the following code thread safe? (I think the histogram class is the only one that requires special attention) Are there implication for the 'randomness' of my numbers when they are generated from different threa...
I have an unusual data structure that I need to search - the structure is the result of parsing a JSON file returned from an HTTP request. The top-level object is an Array, but from top to bottom I have Array->Hash->Array->Hash. I'm writing code to check the value of a given key in the innermost hash, across the entire...
As a part of a job test, I wrote following implementation of the Actor execution model: import java.util.LinkedList; import java.util.Queue; import java.util.concurrent.Executor; public abstract class Actor implements Runnable { private final Executor executor; /** current token */ private Message message=null; ...
I've got the imperative styled solution working perfectly. What I'm wondering is how to make a recursive branch and bound. This is my code below. Evaluate function returns the optimistic estimate, the largest possible value for the set of items which fit into the knapsack (linear relaxation). For some inputs this outpu...
I have written the following algorithm (for Android/NDK) to apply levels to a bitmap. The problem is that it is really very slow. On a fast device such as the SGSIII, it can take up to 4 seconds for an 8MP image. And on devices with ARMv6 takes ages (over 10 seconds). I know that can be speed up with NEON instructions...
I am currently migrating a large backbone application over to Marionette and am curious as to the opinions on what is a better design for mediating activity between modules. I have an Application that have several Modules where an action in one module might cause activity to happen in other modules. Since these all are...
I tried to write a naive Bayes classifier to classify OkCupid profiles, and I was wondering if you could give me feedback on my code. The classifier performs no better than chance and the coding style is probably not great either. I had a training set of 20 good profiles and 20 bad profiles, and a test set of 16 good...
The code below is designed to deal with this situation: There is a Battle environment with Characters; these Characters obviously have certain characteristics and abilities, and they need to be able to use Items from an inventory. I would like as much feedback as possible on the various aspects of the code: The appr...
I have inside a Backbone model validate function several if statements: if(!attrs.firstAttr) errorMsg+="first attr mandatory"; if(!attrs.secondAttr) errorMsg+="second attr mandatory"; as you can see there is a lot of repetition (I have actually 10 fields to check with this. I was thinking of introducing an interface ...
I'd like to know how this program can be improved. Any comments or critiques are most welcome. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <errno.h> #define MAX 10000 #define FOUND 1 #define NOT_FOUND 0 #define DEAD 0 #define LINUX void starMaker(char string[] , char starCont...
I am trying to build a simple C#/.Net console application that runs three iterations (see code below). The process runs as intended, but because of how many iterations there are, it can run upwards of 15 to 20 minutes. I intend to run through a list of nodes that would require individual simulations. Therefore requirin...
So, this is a thing. I've got a simple little 2D game where a character can run left and right and jump. My problem here is that I've got two velocities, xVel and yVel, that I need to increment as the character runs in a certain direction, and stop altogether as the player stops moving altogether. Right now, I'm only f...
This is a method which creates an array of all possible consecutive substrings from a string: def get_seperated_tokens(query) result = [] length = query.split.count tokens = query.downcase.strip.split(' ') length.times do |i| length.times do |j| result << tokens[i..j].join(' ') if j >= i end end...
Following on from a question about handling-com-exceptions-busy-codes I would like to know if the following model is the accepted best practice of handling Excel COM busy messages when accessing the Excel COM object model: private void AskExcelToDoSomething() { bool retry = true; do { try { ...
I'm making my own script editor (in this case for Arma: Cold War Assault) because I want to learn and this is challenging enough. Let me just get this out of the way: please don't tell me that I should do easier things. I want to do this anyway. So, basically I have the simple GUI for now with a working new/open/save ...
Given a production module like this: function ($) { var showForm = function () { $.get(url, function (html) { $('body').append(html); }); }; return { showForm: showForm }; }); I have written the following unit test: it("calling showForm appends html to ex...
What? I have a reference counted dynamic byte array written in C. I'm currently using this implementation in a FIFO fashion. Particularly reading data from files into the arrays, then parsing the data in the array byte by byte. I'm looking for feedback on anything! Even the decision to use a dynamic byte array versus ...
What? I have an algorithm that parses comma separated lists of unsigned 32-bit ints from strings. Here is an example of what a list could look like: 1302,51,2312,2,52 The algorithm uses a custom data structure called parse_input which is a data structure that is a FIFO of numbers. This structure is passed to another ...
I am learning about heaps, and I have found two ways of building them from a given array: I am trying to build up a MAX Heap. 1. Top-down approach Here I check for every element to see if it is at the correct position or not. By using a function called restoreUp, in which every key is compared to its parent key, and if...
I was doing timing with variations of function largest_prime_factor. I was able to write a better one largest_prime_factor2. There were some repetitions in the new function so I wrote another function largest_prime_factor3. I thought the 3rd one has to be faster than the 2nd because I broke it up into more functions b...
I created this quite important piece of code, but I am not pretty sure is it good enough. Goal: I have a big task for a database and have decided to use Django-Celery. I want to go through all objects of a particular model and create monthly statistics for each of them based on other foreign objects of it. The task wi...
This script creates a hierarchy of directories. Is this a good approach or can it be made better? I am mainly concerned with maintainability here, not efficiency. Suppose I wanted to add more directories to this hierarchy. Would this structure of the script make it easier to do? Hierarchy ./project_euler ./001_05...
Ok, I have written the following but I am sure it can be done better, my two main worries here are the awful use of the if else statements in the check variables and the usage of setinterval to set the i variable. my problem with the i variable is that the check's run after the i has been set forcing the i to always ha...
I'm just getting started on GUI programming using swing in Java, and I would love some critiques on my code. I understand there is a danger in using global variables. If someone can hint me on how to get rid of my globals (which will be later registered for event handling), I'd really appreciate it. import java.awt.Bo...
I wrote this code to read text of a file and use it to initialize objects and place them in a multi-tree data structure. The multi-tree has the base node as an object called theTree, which has an ArrayList that contains a bunch of objects called Party. Each Party has an ArrayList that contains a Creature. Each creature...
I have been watching Alexander Stepanov programming C++ with components and he, as usual, has some strong opinions. I did like one of his assertions that we use regular, semi-regular and fully ordered types. So I decided to pull together a skeleton class (pair in this case) and wonder if there are any valid reasons for...
My biggest problem is attempting to remove a client when the "disconnect" button is hit. It doesn't work properly, and I'm not sure if my approach is best: sending out a list of all the current users to the clients. Any major logic/coding flaws and any suggestions for improvement would also be welcome. Server class: ...
I need to read n chars from a binary file into a string. Currently, what I do is: static string Read(istream &stream, uint32_t count) { auto bytes = unique_ptr<char[]>(new char[count]); stream.read(bytes.get(), count); return string(bytes.get(), count); } I found the way I deal with the array of chars qu...
I started learning C# a few months ago (so keep in mind that this is all fairly new to me) and I am working on my first real project (WPF / MVVM). I've received conflicting advice on how to handle my backing data. Currently I have everything held in a singleton class (DataManager); some say that's okay, but others say ...
What are your guys thoughts on the following jQuery plugin? $.fn.with = function( fn ) { // Verify function if( jQuery.isFunction( fn ) ) { var temp = fn.call(this); // Check fn for valid response if( temp instanceof jQuery ) { return temp; } } return this; }...
Retrieving an instance of (Default) SharedPreferences and then calling the six methods that may be called to put/get a value gets pretty old pretty quickly, so I wrote this: import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Context; import android.content.SharedPreferen...
This is a class I wrote for parallelising certain parts of my main codebase. How could this code be improved in terms of making it shorter, more secure, and more efficient? using System; using System.Collections.Generic; using System.Threading; using System.ComponentModel; namespace System.SMP { public static clas...
I've made a Bash script to monitor some server log files for certain data and my method probably isn't the most efficient. One section specifically bugs me is that I have to write a newline to the monitored log so that the same line wont be read over continually. Feedback would be greatly appreciated! #!/bin/bash serv...
I'm building this website with PDO and Pattern MVC. I'm currently working on the login page and would like to know if this structure is correct for MVC pattern. I'd also like your opinions and advice on this. For my login view I have: <form action="test.php" name="loginform" method="post"> <input type="text" name...
This app is a simple taxi emulator. The only feedback I've got on it was "bad internal architecture", that's why I would be grateful to receive more adequate and humiliating review. Simply-speaking, it should be a static lib, all the functionality must execute in the same thread (but! thread-safe). There should be a ta...
I've been asked to attach a C++ code sample to my application for an entry-level C++ programmer position in a videogame company. I've created a simple, yet complete console application to solve Sudoku problems. How can I improve the code that I have? Please do comment on the algorithm, the code practices, presentation...
I have mongoose model: var mongoose = require('mongoose'), Schema = mongoose.Schema, Imager = require('imager'), env = process.env.NODE_ENV || 'development', config = require('../../config/config')[env], imagerConfig = require(config.root + '/config/imager.js'); var LinkSchema = new Schema({ ti...
I want a task scheduler with some specific capabilities for my application. I've searched for a good library that provides me with the following, but found nothing. Queuing awaitable tasks. Ability to stop started jobs. Ability to repeat some jobs. Ability to cancel repeat enabled jobs. Specifying a priority foreach ...
Please review this: class KoolDailyReminderAfterWeek(webapp2.RequestHandler): def get(self): logging.info('sending reminders') timeline = datetime.now () - timedelta (days = 7) edge = datetime.now () - timedelta (days = 8) ads = Ad.all().filter("published =", True).filter("added <", ...
I have written a sample immutable binary search tree using Scala. However, I am not sure whether or not I was doing it the proper way since I am not an expert at functional programming. Is there a better or more efficient way of, say, traversing the tree or adding an item to it using a purely functional approach? The a...
How could this VHDL counter and its test bench be improved? I am interested in anything you see that could be done better, but especially in the test bench: Is wait for 10 ns better or worse than any other time delay? The test is very minimal. Should it do more? counter32.vhdl: library ieee; use ieee.std_logic_1164...
The point of my code is to: Read in the observed data from the a catalog of stars (whitespace separated table). Do some unit conversions on the observed data (math stuff). Apply an interstellar correction factor to the observed data (more math). Compare the scaled observed data to the DUSTY model data using the BC tab...
I am new to Python and can't quite make my if-cases any shorter. Any ideas on how to do that? import csv fileheader = csv.reader(open("test.csv"), delimiter=",") # Defines the header of the file opened header = fileheader.next() # Loop into the file for fields in fileheader: # For each header of the file, it does t...
I'm on the road to prepare for the 70-480 Microsoft exam and I'm learning the basics of jQuery. Now I wrote the following JavaScript function to create a table dynamically: function MakeTableJavascript() { var rows = document.getElementById("rows").value; var cols = document.getElementById("cols").value; va...
So I'm relatively new to programming in general, and I've finally strapped in and started learning Python. This is my first significant project using it and I'm trying to build good habits with layout of my code, readability, comments, when to make functions, when not to etc. The problem I was solving was that I have a...
This is my solution for HackerRank's first "Algorithm Challenge, Insertion Sort Part 1". The challenge is to sort the array from least to greatest, the input being an array in sorted order, except for the last entity, i.e. {2, 3, 4, 5, 6, 7, 8, 9, 1} It works fine, but it's definitely not an optimal solution. Could any...
Would like some assistance in improving my jQuery validation code. I have some repeated code, but I am not sure how to write it in a way so that I don't have to keep repeating the same code over and over again for different variable names etc... (such as the if statement part) My goal is to make it so that I can easily...
This code works nicely for my purposes, but I would like to improve it exponentially. What are some steps I can take? I'm interested in optimization, refactoring, and clean-code. def do_GET(self): qs = {} path = self.path print path if path.endswith('robots.txt'): self.send_response(500) ...
I'm sure this has probably been asked before (although I couldn't find a question akin to this one). I have a canvas "app" that is refreshing persistently, but performance is awful on mobile devices. I just wondered if there was a nice alternative to requestAnimFrame() or the like. Here is my "app": http://www.barriere...
I've developed this spreadsheet in order to scrape a website's number of indexed pages through Google and Google Spreadsheets. I'm not a developer, so how can I improve this code in order to have less code, to use less resources, or to go faster? I've explained everything here. //---------------------------------------...
Method implemented in parent class (extends SherlockFragmentActivity) (source) ViewPager viewPager; // initialized in onCreate method public void toggleActionBar() { try { FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, Frame...
I'm currently working through a series of bugs in an application. Our application is written in C#/ASP.NET (on the server) and HTML/CSS/JavaScript (on the client). We are using ELMAH to log any uncaught exceptions in the system so that we may identify it later and fix it, which is what I'm currently doing. The way ELMA...
Here is some code I've created to generate and use a list of prime numbers. This is some of the first Common Lisp code I've written, and I'd be grateful for any comments regarding style and its use or misuse of common idioms. I'm not really interested in improving the algorithm, but in making my implementation readab...
I'm writing a C++ wrapper library for sockets which will hopefully be cross-platform. It's basically two headers: mizaru.hpp, which contains the wrapper classes themselves. trans_layer.hpp, which provides platform agnostic function prototypes. So far they only support Linux and TCP sockets. I think that I'm using a l...
I've created a simple jQuery plugin to allow developers to quickly create image hover effects with very simple markup. I also created an option to automatically create the mouseover or mouseout versions of the image via TimThumb. Here is a link. for more information and a demo. (function($){ $.fn.hovr = function(option...
I have these if-else statements that I am not able to refactor. I have used them for doing validations on server-side using asp.net. Would anyone please suggest ways to reduce these statements? Here, validation fields and validation types are enum lists. else if (CheckNextItem(ddlBr1Type.SelectedValue.ToString(), ddl...
I have four methods like these (here are only two of them): def checkLeft(clickedIndex: Int): Option[Int] = { val leftIndex = clickedIndex - 1 if (leftIndex >= 0 && clickedIndex % field.width != 0 && isEmptyCell(leftIndex)) Some(leftIndex) else None } def checkRight(clickedIndex: Int): O...
I went through lots of tutorial, and almost all of them were quite long, so I came up with my own code: $page = $_GET['page']; $pg_count = $page-1; if ($page == 1) { $start = 0; } else { $start = $pg_count*15; } $limit = $page*15; $query = 'SELECT * FROM table LIMIT '.$start.', '.$limit.'';...
I have a question that may be easily answered, but the answer evades me. In regards to numeric operations, how come when I code this: double celsius = 30; double fahrenheit = (celsius + 32.0) / (5/9); I get an answer: fahrenheit = infinity; But, when I code this: double fahrenheit = (celsius + 32.0) / (5.0/9); // w...
I am looking for feedback on a solution to the following problem posed from a book that I'm working through (Java: How To Program, 9th Edition): Write an application that reads a five-letter word from the user and produces every possible three-letter string that can be derived from the letters of that word. For examp...
The 'Do' method is for prepared statements and returns (by fetchall()). I am also using two looping statements. Is there any better way to fetch two tables in one statement or query? If not, what can I do to improve this code? // 'id' is index in 'userinfo' table and 'id' in 'election' table is a child index(foreign...
The file is quite long, 1000 LOC so I want to separate it into smaller files. https://github.com/anvoz/world-js/blob/v1.0/js/world.core.js Here is a brief version of the code: (function(window, undefined) { var WorldJS = window.WorldJS = function() { // WorldJS Constructor this.nextSeedId = 1; ...
I've solved Project Euler #28 using recursion. If this 5 × 5 spiral pattern is extended to 1001 × 1001, what would be the sum of the red diagonals? $$\begin{matrix} \color{red}{21} & 22 & 23 & 24 & \color{red}{25} \\ 20 & \color{red}{7} & 8 & \color{red}{9} & 10 \\ 19 & 6 & \color{red}{1} & 2 & 11 \\ 18 & \colo...
I've got relation in my database as following : Customer has many Orders Order has many Parts Order has many Upc So my requirement is to copy all orders from one customer and attach or copy those orders (with their dependencies including parts and upcs) to another customer. With originals customers orders to be left i...
I wrote a small script to manipulate fields of a file based on the input of a user. Is there something I could've done better, or perhaps a better refactor? I do know however that I need a way to validate for empty fields. view_column() { for i in "$file_name"; do cat "$i" | awk -v col="$1" '{ print $col }' don...
I am so sick of WYSIWYG editors being exclusively for the latest browser or being huge with every option under the sun. I tried to make my own, using code I found online as well as a little of my own handy work. This is what I came up with: http://jsfiddle.net/spadez/RRBHw/1/ /* * WYSIWYG EDITOR BASED ON JQUERY RTE *...
I've taught myself some basic HTML/CSS over the past few weeks and just finished up my first horizontally scrolling single page site last night. I went for a clean minimal design and achieved the look I was going for, but am absolutely sure I did some things the hard way. Would really appreciate any advice on how I cou...
I have a byte array and a List of a custom object ByteRule and I'm needing to loop around and perform an operation on both but only as long as one of both is available, the original method is as follows: private final List<ByteRule> rules; @Override public boolean match(final InetAddress addr) { final byte[] bytes...
Can the metafunction below be implemented more elegantly, with less code? What I have now is not very elegant or smartly written. #include <type_traits> namespace detail { template <typename T, typename A, typename ...B> struct max_type { typedef typename max_type< typename std::conditional<(sizeof(A) > sizeof(...
To summarize from a previous question, the user selected a starting date, an ending date, and a region. From these choices, an array of weeks and regions are created, and users enter values ("points") that correspond to a particular week and region. This is what it looks like right now (some parts are hard-coded for te...
This code handles a response from an RSS feed. It organizes and appends to content. If there's a video embeded then separate it from the rest of the content. I would like a review mainly on performance/efficiency but I'm open to any other suggestions as well. That star selector is really nagging me but I don't know of ...
I'm developing a class to compare prices. For example, give me products which price are above 50 or under 50. Here's my API: var indicator = new PriceIndicator(PriceComparison.Above, 50); var actual = indicator.Apply(listOfProductPrices); I managed to design my code for the operator Above and Under comparison: publi...
I am given the following CSV file which I extracted from an excel spreadsheet. Just to give some background information which could be of assistance, it discusses AGI Numbers (think of it as protein identifiers), unmodified peptide sequences for those protein identifiers, and then modified peptide sequences with modifi...
Other code review noted problems with commenting and non-C++ code. This post aims to follow up on those issues. Please check: Comments are appropriate Code is not C My test file contains: one two three four five six seven eight nine //This app is an exercise/study: Etude fr1_x // prints x number of words from file,...
I have this action and it works but looks rather clunky to me. Is there any way I could improve that? transMit :: Serialize a => Socket -> POSIXTime -> KEY -> a -> TPSQ -> TMap a -> IO () transMit s time key newmsgs q m = do loopAction <- atomically $ do mT <- readTVar m ...
This is my Clojure code for finding prime numbers. Note: this is an advanced version which starts eliminating from i*i with step i, instead of filtering all list against mod i == 0 (Sieve of Eratosthenes). It has better asymptotic runtime: O(n log log n) instead of O(n log n) in typical examples of finding primes in Cl...
I wrote a little PHP wrapper class for GeoIP which looks like: <?php class GeoIP { private $ip; private $geo_ip_details; function __construct($ip) { $this->ip = $ip; $this->fetch(); } private function fetch() { if(filter_var($this->ip, FILTER_VALIDATE_IP)) { ...
I have a float in the String strFloat. I wanted to convert it to a rounded integer also stored in a String. This looks awful to me, so please offer some suggestions for improvement. String strInteger = new Integer(Float.valueOf(strFloat).intValue()).toString()
I have written a shell script to process my huge data files (each one having around 7,000,000 lines ~ a weeks data in a single file). Here is a sample of my data file (i.e., input file) structure: 808 836 204 325 148 983 908 836 203 326 148 986 8 835 204 325 149 984 108 835 204 325 148 984 208 836 204 326 149 984 308 ...
I am writing simple code to accept/read a input of lines from a text file, split it into my class variables, sort them and finally display the input in the ordered form. But I have been struggling for the past couple of days to split the read line in appropriate manner. static void Main(string[] args) { List<MyClas...
I have a method to replace URL parameters in an URL. It receives url as mandatory parameter and prefix and/or hash as optional parameters. Examples: url_replace( '/news?b=2', { b: nil } ) # => '/news' url_replace( '/news?b=2', { b: 3 } ) # => '/news?b=3' url_replace( '/news?a=b...
I did a little function which is listening to hashchanges. What do you think about? var onhashchange = function(code) { var checkHash = function(oldHash, code) { var hash = window.location.hash; var hashObject = hash.replace('#/','').split('/'); if (hash !== oldHash) code(hashOb...
Here's the situation: I've got several distinct objects, each with their own responsability and (therefore) each their own dependencies. As this is code that will be implemented in 2 existing applications, I've created my own namespaces, interfaces, abstract classes and so on... the works, basically. IMO, the objects' ...
I'm currently working on a project that I had to create basically a running queue of items. My thought was to do this by a list, but surprisingly there weren't any methods to remove the first sequence or last sequence of items in a list that I found. I wrote the following class with extension methods for List<T>: using...
Can anyone think of a way to DRY up this code or is there a way to make it more efficient or quicker. Its what authenticates a user with my API and i want to make it as fast as possible. def authenticate! authenticate_or_request_with_http_basic do |access_key, secret_key| @current_app = App.find_by_access_key(acc...
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Can someone give me suggestions on how to improve this solution? Also, please tell me whether or not my programming style is goo...
What do you think about this variant class? Some hype: no RTTI needed, no heap allocation, supports copying. #pragma once #ifndef VARIANT_HPP # define VARIANT_HPP #include <cassert> #include <ostream> #include <type_traits> #include <typeinfo> #include <utility> namespace detail { template <typename A, typename ...
How can this be improved,to make it easier to maintain? There is so much boilerplate being thrown around, so is it possible to use annotations? I've seen one example from Stack Overflow, but it ended up using reflection in order to call the method. I was already planning on somehow annotating these "variables" in order...
The following is code I'm running to FIRST, SECOND, THIRD and so on until SEVENTH with a master query and a query of query. As it's clear that I'm using the master query for each of FIRSTCONN, SECONDCONN etc., I want to have only one master query and the rest subqueries. Is this an efficient way to do so? How can I ma...
This is the first code of this type that I've attempted, so I'm wondering if anybody would be willing to critique it. It's "sort of" (I think) a factory class. I want to keep it as simple as possible (and still work, and be at least as elegant as Phyllis Diller - it doesn't have to be Elizabeth Taylor). The situation i...
I am trying to write a function, where given a sorted array, and a number, it returns the FIRST index of that number. Is this correct? Code is in Ruby, but even if you don't know Ruby, you can pretty much understand the syntax. def first(array, n) if(array.size == 0) return -1 end l ...
I am tracking trains and trying to identify individual trains seen multiple times at different points through the IDs of the wagons on them when spotted. // create a lookup of all tracked trains for each wagon IEnumerable<Train> trains = GetTrains(); var wagonTrains = new Dictionary<int, List<Train>>(); foreach (Train...
G'day Just before I submit this to CFLib, it'd be great to get feedback: <cfscript> /** * @hint CFML implementation of Array.reduce(), similar to Javascript's one ref https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce * @array Array to reduce * @callback Callback function to u...
I echo a rank of a student whose regd is equal to $regd. In fact, this is working code. However, I was advised by a friend that the MySQL statements Distinct and Group By should not be used together. But as a newbie, I could not figure out how I could implement it without using Distinct because it does not return rows ...
After posting this question I made some updates and changes to my code. My new demo for the game is located here. Right now it is only one player. Is there anything I could improve on in the code? Array.prototype.randomize = function () { //fisher yates from https://codereview.stackexchange.com/a/12200/3163 var...
I have this code that works fine, but I would like to create some unit test for this class. Most of the code is in private or void type methods. Please help me refactor my class to make it more testable. namespace Insperity.HCRBlackBox.HCRServices.Biz { public class OrganizationChartBiz : IOrganizationChartBiz ...