instruction
stringlengths
71
71.9k
I am currently writing an app that converts musical keys. In a nutshell the conversion part of the script, is one giant if / then statement (if the user selected A then display B, etc etc.). While this works perfectly fine, I definitely feel like this is fairly crude, and extremely lengthy, with all of the keys that ne...
I have the following, quite ugly statement - is there a better way to write something of this nature? if (!item["Created By"].ToString().Contains("System Account") && !item.Url.Contains("_catalogs") && !item.Url.Contains("Style Library") && !item.Url.Contains("Cache Profiles") && !item.ContentType.ToSt...
I am trying not to pick up any bad habits while improving the way I write programs. Any suggestions on the following lines of code? package guessGame; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; // Main Class public class G...
I am writing a byte array value into a file, consisting of up to three of these arrays, using Java with big Endian byte order format. Now I need to read that file from a C++ program. short employeeId = 32767; long lastModifiedDate = "1379811105109L"; byte[] attributeValue = os.toByteArray(); I am writing employeeId, l...
I am writing a simple event handling class in C++, to avoid having delegate registration and calls cluttering the rest of the code. I have a design that seems to do the job, but it has a couple of drawbacks. So far it looks like this: template<typename T> struct IDelegate { virtual void operator ()(const T & args) cons...
Ok, code reviewers, I want you to pick my code apart and give me some feedback on how I could make it better or more simple. public final class StringValueOf { private StringValueOf () {} // note that int max value is 10 digits final static int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999, ...
I am currently working on an app and have some issues with the date handling. Found a simple solution, and want your opinion. First thing, that I want to achieve: I have 2 date format inputs, one is like 2013-09-30 14:20:00 and the other is 30/09/2013 1420 Time stamp is given with no day light saving time. So, I have...
I have written the following Executor: /** * <p>This executor guarantees that there is never more than one element waiting to be executed. If an element is * submitted for execution and another element is still in queue, the newly submitted element replaces the previously * queued element in the queue</p> * * <p>A...
The processing is the same, but the response type differs based on whether it's an AJAX request or not. One way I can think of is to store all the response calls inside closure functions, and return once at the end (twice in the function overall because of the first return). That would only make it look a teensy bit be...
I'm using Pygame to create a small game with few rectangle shapes. However, I want to learn more about classes, and I'm trying to use them. I'm very new to classes and inheritance, but I want to learn the best habits possible. I'm using Python 3.3.2. import pygame class Screen(object): ''' Creates main window an...
I just wrote this tiny library called isRTL.coffee to determine the direction of the text. Is there any better way of doing this? rtlChars = '\u0600-\u06FF' # Arabic - Range rtlChars += '\u0750-\u077F' # Arabic Supplement - Range rtlChars += '\uFB50-\uFDFF' # Arabic Presentation Forms-A - Range rtlChars += '\uFE70-\...
HTML <!Doctype html> <html> <head> <title>Welcome To DPS Raipur</title> <link rel="icon" type="image/png" href="logo.gif" /> <link rel="stylesheet" type="text/css" href="index.css"> </head> <body> <div class="wrapper" id="wrapper"> <div class="title" id="title"><i...
I wrote DSSudokuSolver - a sudoku solving algorithm a while back. Is there any possibility that this algorithm can be improved? Original Algorithm: CleanElements = function(comp_ary, Qsudoku){ for(i=0; i<9; i++){ for(j=0; j<9; j++){ /*if(Qsudoku[i][j] != ""){ comp_ary[i][j]=[]; ...
After recently getting a bulk of work done on my WebAPI service layer, I thought I'd post some of my working on here for you guys to tear apart, generally, most of it 'feels' mostly okay, but I know there are areas for improvement. Hopefully no screaming issues with it: Someone is going to quote me Ayende, note that my...
This is a simple script that I use for wrapping a selected word in a textarea field. I'm looking to: make sure my logic is valid/see what others have done in a relative context. request improvements to the OO approach I'm going for. Formatter = {}; Formatter.getSelection = function(event) { var text = document.g...
I'm learning DB design. How would you change the following schema which tries to replicate Stack Overflow's functionality: create_table "questions", :force => true do |t| t.text "question", :null => false t.text "description", :null => false t.integer "up_votes", :null => f...
I've asked Code Climate to generate metrics for the ftpd Ruby gem. It correctly identified the God class; I know what to do about that. But one of the smaller classes has me stumped. This is telnet.rb: # -*- ruby encoding: us-ascii -*- module Ftpd # Handle the limited processing of Telnet sequences required by t...
I'm doing a infix to postfix conversion. The code works, but here are some points I want to improve 1) In the line of while ((!operators.empty())&&(order(operators.top()) >= order(token[0]))) If the condition order changes ( check the stack empty later), there'll be a segmentation fault (because I'm calling operators...
This code review request is tightly coupled with this SO question, this is the solution I implemented to solve the problem being asked about there. All my ViewModels get constructor-injected with a Model that itself gets constructor-injected with a DbContext-derived class, and that works well in all cases, except when ...
I'm trying to do something like this: var loudDogs = dogs.Where(async d => await d.IsYappyAsync); The "IsYappyAsync" property would return a Task<bool>. Obviously this isn't supported, so instead I've built an extension method called WhereAsync. public static async Task<IEnumerable<T>> WhereAsync<T>(this IEnumerable<T...
Since Entity Set does not support asqueryable, I have to do this. How can I reduce the amount of redundant code between the two methods? public static IQueryable<T> WhereCreateWithin<T>(this IQueryable<T> query, DateManager.TimeRange timeRange, DateTime? beginDayParam = null) where T : IHasCreateDate { if (beginDa...
Within a function, I want to grab a set of parameters from a named array. What is the most efficient way of testing if the parameter exists in the array, and if it does, use it as a variable? I came up with a few alternatives. target = $('#page_links') if ( functionobject.target ) { target = functionobject.target }...
I want a second copy of an std::vector in which all elements are inverted, e.g. 0x01 in the first vector should be 0xFE in the second. Is this a good solution? std::vector<uint8_t> first_list = {0x01, 0x10, 0x32, 0x1A }; std::vector<uint8_t> second_list = first_list; for(std::vector<uint8_t>::iterator it = second_list...
I have three types alert dialogue. Each alert dialogue behave differently but I don't like to write three types of alert dialogue in same class because it extends the class size drastically. Here are the three alert dialogue given below: public boolean onJsAlert(WebView view, String url, String message, final a...
I am using Codeigniter and it's ActiveRecord. I had this idea for a base class that provided a generic getter/setter for doing simple queries on a database. I have a lot of database objects that could benefit from not having to duplicate the basic query patterns. Instead of writing functions whose sole purpose were to ...
I've got the following query builder. Some of the cases have the same piece of code (those that have a parameter). I know it's not good to duplicate code that much if at all. How would you suggest I improve this loop? for ($i = 0; $i < $len; ++$i) { switch ($conditions[$i]['condition']) { case 'version': ...
How can I refactor this? public static IQueryable<T_COMPANY> WhereTotalTransactionOrShowCaseAtLeast(this IQueryable<T_COMPANY> query, int minimum, DateTime? date = null) { if (date == null) { query = query.Where(company => (company.Products.Count + company.References.Count) >= minimum || ...
Be as harsh as you can! I'm trying to improve my coding style and would like to know if there is anything I could improve. EDIT: To make this fair, The person who provides the most helpful tips (both in quantity and quality) will get marked as the answer The code below is the JavaScript file for a CMS application I'm c...
I have a grid which allows a user to enter a new Grid item. If the grid item exists or the tb is empty it displays the error. Here's the code I came up with. Can anybody think of a cleaner or more efficient way of doing so? Thinking about it now, I guess I could have done it all in one function, and placed InsertTrack...
Here's some code that I ran through jsperf to assess its performance. The first test (named EvalLengthBefore++ in the images below) is the way I would consider normally looping through the elements of an array: var arr = []; for (var x = 0; x < 1000; x++) { arr.push(Math.random()); } var len = arr.length; for (var y...
I have a large C# Dictionary of string keys and boolean values. Background on the reason for it is this: my program builds up a bunch of the same objects from two different sources, and then compares all the properties to see if there are any disparates. But I want to ignore the differences where I know one source hasn...
Is this query acceptable in terms of performance (I get the correct data) or can it be optimized? SELECT bankInstitution.name, person.firstName, person.surname, offer.offerId, bank.personId, bank.bankOtherName, bank.sortCode, bank.number, loan.loanId offer.campaignId, FROM bank ...
I have a server-client environment, where the client connects and synchronizes data with the server every 5 second. For synchronizing I use a background thread on the client which works fine, but on one specific hardware the method GetNetworkAvailable throws out of memory exceptions occasionaly. The errors occur whitou...
I have made this program to find out the first and following sets of the productions: E->TA A->+TA A->0 T->FB B->*FB B->0 F->(E) F-># Here epsilon(NULL) is taken as 0: #include<stdio.h> #include<ctype.h> char a[8][8]; struct firTab { int n; char firT[5]; }; struct folTab { int n; char folT[5];...
This question is the first draft, my new revised code is here: Anagrams for a given input 2.0 Here is my code that I wrote, which basically lists the anagrams for a given input. I did this by reading each line in my dictionary file and comparing it to the anagram. Only if it matched did I add it to the list, instead ...
This is a simple console menu that just holds a main menu and a few menu "buttons" (numbers and titles which the user has to enter for the button to do its action). It does not need submenus or more complicated input handling. I went with an object-oriented approach and defined three classes: Menu, Button, and Controll...
Please feel free to be as harsh as possible. Implementation file: #include "Stack.h" #include <iostream> using namespace std; // Initializes an empty Stack. Stack::Stack() { this->head = new node(); this->num_elements = 0; // set default values for head this->head->next = 0; this->head->value = 0;...
I would like to do these actions step by step: first DB update copy file unlink file second DB update It is working, but I don't know if my code is correct/valid: $update1 = $DB->query("UPDATE..."); if ($update1) { if (copy("...")) { if (unlink("...")) { $update2 = $DB->query("UPDATE ...
So I have this Pygame 3.3.2 code of 2 classes. I tried to make it as simpler as possible, but ofcourse to show the problems I have with thedesign. import pygame import sys class MainWindow(object): ''' Handles main surface ''' def __init__(self, width, height): self.WIDTH = width self.HEIGHT = hei...
I was trying to solve a challenge. The execution time should not exceed 5s, but for some value my code took longer. I want to know if I can optimize my code for performance. public class Solution { int n;long k;int count=0; public static void main(String[] args) { new Solution().readInput(); } public ...
I have the following method that's in a common library. I want to know how to write it better, but mostly, I want to know how to think about this better so I don't end up with code like this. public virtual void PrintConsoleAndLog(string verboseMessage = null, Exception e = null, ...
I have a implementation of following code block, public class FileFormatConversion { public static enum File_TYPES { PDF, PNG, OTHERS, ALL } public static void processOtherFileType(String arg1) { System.out.println("Other file output -- " + arg1 + " file"); } public static void processPNGPDFALL(String arg1, S...
Here is my code. Is there anyway to make it more efficient? /* IN: string to have characters reversed OUT: string containing characters in reversed order */ char* reverStr(const char *str) { char* revStr = (char*)malloc(strlen(str)); int i; for(i = strlen(str)-1; i >= 0; i--) revStr[...
I wonder if there is a more "functional" way of implementing something like this: @months.zipWithIndex.foreach { case (month, index) => if (index%3 == 0) { <tr> } <td>@month</td> if (index%3 == 0) { </tr> } } Can these two if-statements be removed by using something other than forea...
This is very simple: the user inputs his/her name, the program then truncates it on a consonant at a specified position, if possible if not it will truncate it on a vowel. It then adds an extension from a list of extensions to make the complete nickname and displays it. /** * @author :KyleMHB * Project ...
A few years ago I started building a tiny (~300 SLOC) JavaScript framework for scalable and maintainable Single-Page-Applications written in CoffeeScript. GitHub www.scaleapp.org It's inspired by the talk "Scalable JavaScript Application Architecture" by Nicholas Zakas. The project was starred on GitHub by some peopl...
Just got done implementing a shortest path algo of a unit cost DAG BFS in Hadoop and wanting to get anyone's opinion on how I could have done it better. The main issue I see is that I lose the parallel nature of hadoop by forcing the mappers to wait for the output of the previous mapper before beginning. The thing work...
This question follows on from :Previous Question Here is what my reworked code looks like. I neatened it up as much as I could. Changed some of the semantics of it. I also tried to add some faster exit points and checks to prevent errors. Any further critiques? /** * @author :KyleMHB * Project Number ...
I'm new to using fragments in Android. I'm working on an app using a sliding panel layout and I just came up with an idea for changing my fragments. I decided to create the following method: private void changeFrag(Object newFrag){ // Insert the fragment by replacing any existing fragment FragmentMa...
Considering the following Makefile: %.o: %.cpp $(C) $(CF) -c $< -o $@ Audio/%.o: Audio/%.cpp $(C) $(CF) -c $< -o $@ Game/%.o: Game/%.cpp $(C) $(CF) -c $< -o $@ Generation/%.o: Generation/%.cpp $(C) $(CF) -c $< -o $@ Input/%.o: Input/%.cpp $(C) $(CF) -c $< -o $@ Particle/%.o: Particle/%.cpp ...
#include <iostream> #include <vector> void getUserNum(int &); int rFib(int n); void dispSeq(std::vector<int> &vRef); int main() { int userNum; getUserNum(userNum); rFib(userNum); return 0; } void getUserNum(int &refVal) { std::cout << "Enter a positive integer:\n"; std::cin >> refVal; } in...
I'm working my way through The Java Programming Language, Fourth Edition - The Java Series. This is Exercise 7.3: Write a program that calculates Pascal's triangle to a depth of 12, storing each row of the triangle in an array of the appropriate length and putting each of the row arrays into an array of 12 int arrays...
Reason for script: dir="auto" is an attribute value from the HTML 5 spec with current poor support in IE and Opera browsers. The project I am working on only cares about IE, Firefox and Safari browsers and handles text in both left to right LTR and right to left RTL languages. For cases where the directionality of th...
public class ArrayList<E> implements List<E> { private static final int defaultMaxSize = 10; private int maxSize; private int size; private int currentPosition; private E[] array; /** * Create a new ArrayList object. * * @param maxSize */ @SuppressWarnings("unchecked") ...
I wrote a small library to learn Haskell while studying Automata theory. I have some concerns on my algorithm to evaluate state reachability. That is, I think it might be improved if I can avoid checking paths already excluded in other branches of the search for a valid path. This one recursively checks each path separ...
public class KeyValuePair implements Comparable { private Comparable key; private Object value; public KeyValuePair(Comparable key, Object value) { this.key = key; this.value = value; } @Override public int compareTo(Object item) throws ClassCastException { if (!(item instanceof K...
So here is my Queue interface: public interface Queue<E> { /** * Add an item to the rear of the queue. * * @param item * Item to be added. */ public void enqueue(E item); /** * Remove and return the item at the front of the queue. * * @return The item that...
I'd like this to be reviewed: public class MaxHeap<E extends Comparable<E>> { private E[] heap; private int capacity; // maximum size of heap private int numberOfNodes; // number of nodes in current heap /** * Create a new MaxHeap object. * * @param heap * @param capacity * @pa...
I use this interface for my BST node class: public interface BinNode<E> { public E getValue(); public void setValue(E value); public BinNode<E> getLeftChild(); public BinNode<E> getRightChild(); public boolean isLeaf(); } My BSTNode is implemented as follows: public class BinarySearchTreeNode<Ke...
I am writing code for breadth-first search of a tree with C++'s STL. Please help as I am new to the STL. #include<iostream> #include<malloc.h> //on llvm we don't need this #include<list> using namespace std; typedef struct Node{ int val; struct Node* left; struct Node* right; }node; void push(node** root,i...
This implements binary search on an array of cstrings. One thing I'm wondering about is it faster or slower to pass a variable as const i.e. len. Also strcmp() gets called a lot and since I can't find any specific details on how it works, is it worthwhile to make my own function? For example does it immediately return ...
Here, this vector was used at many APIs in the code with sync block on it. And all the places they want to search another collection based on each itr.next(). synchronised(vector) { Iterator itr = vector.iterator(); while (itr.hasNext) { //Perform some search on another collection using the value fr...
This Review Request evolves into this Review Request now with a custom UI and other changes. I wrote a program to simulate the drinking card game Kings. This is my third Java Project. I didn't quite understand how to create the classes Card and Deck. I was struggling to create them so I went ahead and used someones c...
I have written this program to compute the leading set of the following productions E->E+T E->T T->T*F T->F F->(E) F-># Here identifier is taken as '#' #include<stdio.h> #include<conio.h> #include<ctype.h> struct leadT { int n; char lead[5]; }; struct leadT leading[7]; char ip[7][7]; int col,cnt=0; char Sym[5]...
I'm using Bootstrap 3 as the front-end framework for this. It is quite simple but I feel I'm doing it wrong. I'm sure this code can be optimized not to duplicate the $('a[href=""]') functions but I just can't wrap my head around it. For now, this code is only for mobile. I'll have to figure out how to control the menu ...
I am doing old versions of the Canadian Computing Competition, on a website where I can run my solution against some test cases they have. I am failing one of their test cases, and cannot figure out why. I have no access to the test case. I have posted below the full problem description as well as my attempted solution...
I am trying to find the uncommon elements from two sets in Java. Here is my way: private void findUnCommon{ Set<Integer> a = new HashSet<>(Arrays.asList(1, 2, 3, 4)); Set<Integer> b = new HashSet<>(Arrays.asList(3, 4, 5, 6)); // get all elements from set a and set b System.out.println("Before.."); ...
I wrote a FastReader utility class that is supposed to read input fast. It's mostly aimed at parsing input files in competitive programming. How could I made this better? I am mainly looking for good code suggestions rather than the specific details of the logic. Though, any comments/recommendations are appreciated. p...
I implemented an algorithm to solve a constraint satisfaction problem. It is a non-trivial one, so I do not intend to take your time with its details. I am mainly looking for good code suggestions rather than the specific details on the logic. How could I made the code better? Any comments/recommendations are appreciat...
I implemented the FixedSizePriorityQueue class. The intended purpose is that, you can add as many elements as you want, but it will store only the greatest maxSize elements. I would like any suggestions on how to improve this data structure implementation. Any comments on how to make the surrounding code better is high...
I have a FaultType enum with more than 100 members: public enum FaultType { FaultType1, FaultType2, FaultType3, FaultType4, FaultType5, } And I have a FaultTypeConstants class corresponding to FaultType: public class FaultTypeConstants { public const int FaultType1 = 600; public const int F...
I needed a utility function/method that would get the next available filename to save as. An example would be, if I need to save a file as MyTestFile.html but it already exists. This method would then check to see what the next availble filename would be, and it would return MyTestFile2.html. If MyTestFile2.html exist...
I wanted to try out F# so I decided to I converted a library file from c# to f#. I have done that successfully(thanks a you people in stackoverflow). At first I ported the code from c# to f#. Than I tried to covert the code into FP after a lot of pain I have managed to get this far. Here is the Source Code for the whol...
I've been thinking about how to create a robust function that parses the command line arguments for valid filenames. I came up with a while-switch construct because that allows me to reduce redundancy (no break-statement at the end of case 2). As I am pretty new to programming, I can't really tell the quality of this c...
I'm working on my students attendance system project. I have a list of students along with their ID (jntuno) and I need to create a database in MySQL for storing the daily attendance of each student for each subject. Table: students Fields: slno int(5) auto increment, jntuno char(15), name char(50), primary key(slno,jn...
I have a method to provide an NSManagedObjectContext using UIManagedDocument. I need to ensure that the context did initialize before I return, so I added an infinite while loop at the end of the method. But I think that was very stupid and is not acceptable. - (NSManagedObjectContext *)context { NSURL *url = [[[N...
I have a website written in PHP but the whole script is old so today I started upgrading from Mysql to Mysqli. So here's my register page. I still have to add account confirmation and send mail part but that part can wait for now. /* PUBLIC */ $IP = $_SERVER['REMOTE_ADDR']; /* PRIVATE */ if(isset($_POST['submit'])) {...
Here is the implementation with the interface below: public class DoublyLinkedList<E> implements ListInterface<E>, ListIteratorInterface<E> { private DoublyLinkedListNode<E> head; private DoublyLinkedListNode<E> tail; private DoublyLinkedListNode<E> currentNode; private int size; /** * Create ...
The following is working but I just want to know if I can make it better in any way. The header file can be viewed here. #include <stdbool.h> #include <stdlib.h> #include "Polynomial.h" static int64_t power(int64_t x, uint64_t y); /** * Initializes *P as described below. * * Pre: P points to an uninitialized Po...
Can someone review this? The header file can be viewed here. #include <stdio.h> #include <stdbool.h> #include <math.h> // searches default library classpaths #include "Rational.h" // searchs my directory // let's the compiler know that this is a function static bool Rational_isPositive(Rational rational); static double...
/** * credential * * Easy password hashing and verification in Node. * Protects against brute force, rainbow tables, and * timing attacks. * * Cryptographically secure per-password salts prevent * rainbow table attacks. * * Variable work unit key stretching prevents brute force. * * Constant time verificati...
This request is a new version of this request: Kings Drinking Game This version has a custom JForm GUI and almost all new methods. GUI: I wrote a program to simulate the drinking card game Kings, now with a JFrom GUI. The GUI is also now not hard-coded into the business code and any UI can be easily used with little ...
I wrote the following interface and class to bijectively map a string to a long. I would like feedback on how to make the code more readable and maintainable. Interface: /** * Bijectively maps a string consisting of chars from a predefined 'charSet' to a long value * Bijective mapping ensures that the conversions ar...
I am currently working on a Python project. It is some sort of a hub, where you can do some cool but basic stuff, such as: setting timers, launching websites, doing basic math, ping and view source codes of URLs, and more. I want to make this code just a little more compact. I especially want my math menu more compact...
I am trying to find unique hashtags from a tweet that a user inputs. I have the code to find the number of times a word is used in the input, but I just need to know the number of different hashtags used. For example, in the input #one #two blue red #one #green four there would be 3 unique hashtags as #one, #two, and...
Please pick my code apart and give me some feedback on how I could make it better or more simple. final class Edge { private final Node node1, node2; private final int distance; public Edge (Node node1, Node node2, int distance) { this.node1 = node1; this.node2 = node2; this.distanc...
I was wondering if anyone could give a critique of my code. We are supposed to be using inheritance and OOP principles. All the functions but the PlayerSet class were given, so really I just need someone to critique that class. The full code is here. class PlayerSet: '''A group of players to play the Pass The P...
I posted a couple questions about a week ago, but have almost gotten it working. This program is supposed to simulate the following: Ask the user how many balls to drop Drop one ball at a time Allow it to bounce ten times moving either once to the right or once to the left each bounce Then print out the even numbers ...
I wonder whether or not I should improve my current practice on creating/calling dialogs with AngularJS. Think of a simple information, displayed on demand as a modal window. To create such a thing, I would write a directive, include it to my page and use ng-hide to hide it. If I want to call it, I would simply change ...
I have some C# unit tests which each basically perform the same steps but supply different arguments to the unit under test. I wanted to encapsulate the logic inside some "helper methods" but found that the method names, while descriptive, were cumbersome. For example, the code inside a test method would look like this...
I am trying to make a very fast hash table based set of pointers. It is supposed to be as fast as possible, not conforming to standard C++ at times. This is always marked in the code. Collisions are resolved by linear probing. The maximum size is known at construction time and memory grows by multiples of 2. All memory...
I have written a simple copy file code, called 'Amature SVN', kindly review my code. using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace AmatureSVN { public partial class Form1 : Form { public Form...
I am trying to make an universal implementation of IDisposable (as a base class): public abstract class DisposableObject : IDisposable { private bool hasUnmanagedResources; private bool baseDisposeManagedResourcesCalled; private bool baseDisposeUnmanagedResourcesCalled; protected bool IsDisposed { get;...
I have a lot of classes which are principal equal, but they consist small differences so that I can´t abstract then very well. The classes represent different kinds of DataTables. Every Class has two important methods which every "table-class" has. Here a abstracted example: internal class FooTable { internal stati...
I am doing a bio-statistics calculation and the following code works. However, can someone help to improve the messy nested loop? for(int i=0; i<NN; i++) { for (int j=0; j<NN; j++) { if (i != j){ thirdlayer = 0; for (int k=0; k<NN; k++) { fourthlayer = 0; ...
I have the following code that I know can be written in a better way. Basically I query tables and display the results for each student for the homework that has been marked. <?php include 'inc/db_con.php'; mysql_select_db("homework", $con); $resultcourse = mysql_query("SELECT course_code FROM courses WHERE course_ac...
I have this class containing two constructors with different signatures but they do the same thing: public Person(Dictionary dictionary, string someString) : base(dictionary, someString) { base.GetProperty("FirstName"); base.GetProperty("LastName"); } public Person(Dictionary dictionary, string[] someStrin...
I'm not familiar with threads but I am not against them either. A bit of background the original program would have taken about 2 years to run. I had modified it and knocked down that time to around 40 days. Can I make it even faster by using threads or updating my code? The reason it is 40 days is because it has to ...
In this scenario I've got a textbox to which I have added autocomplete functionality. The kicker is that I want to dynamically change the source option of the AJAX call based on the value of a dropdown list. To do this I encapsulated the differences between the AJAX calls in an object of type Resolver. The name prope...
I have a pretty interesting problem that I'm trying to solve, and I am kind of stuck. I want to count the triplets of distinct combinations a, b, c, that are smaller than LIMIThave the following properties: a >= b, a >= c, and let's note m = a + b (a, b are integer) a and m are the smallest 2 numbers in a Pythagorean ...