instruction stringlengths 71 71.9k |
|---|
The first function, sqlPull(), connects to a local MySQL database and pulls the last 20 rows from the database every 5 seconds. The data coming in is a list of tuples, where MAC, RSSI and TimeStamp are the 3 elements in each tuple. The data is entering the database at a variable rate, where sometimes I'll have tons o... |
I originally asked this question on StackOverflow. Reproduced here by recommendation.
I've got a number of Python scripts that I'm considering converting to Go. I'm seeking confirmation that I'm using Go in essentially the way it was meant to be used. Full code is available here: https://gist.github.com/anonymous/75215... |
I put the readable version into the gist file -> link
Please ignore the print and comment in the following code.
I often have to write this sort of logic: init the conditions, and deep into loop condition, get the variables in each iteration and break when the condition meets.
As you can see, I get the first line in a ... |
I had an half an hour interview with Microsoft for an intern position. I was asked to generate a list of alternatively positioned odd and even number out of an array of unsorted integers. I guess it was below the interviewer expectations since I did not get the offer. Can any one give me some hints on improving my c... |
I have a bit of code that I use to update my blog. Basically, I send an email to a particular address, and every x minutes the daemon fetches the emails, creates the files, executes middleman and then synchronizes it all to S3.
The thing is that I'm using lots of different apps to do it all, be it system commands, Pyth... |
I write the following version of an if-statement very often. And every time, I hate the way that I make it, but I don't know how to improve it.
For example, I have two ArrayList's. If one of them is not empty, then I convert it to a StringBuilder and send it per mail. The problem is, first I check if one of them is not... |
I am developing a bean class which has multi face properties (name has first name, last name and middle name). The object is going to be used to create an xml file. Please compare my two methods to incorporate the same in my application.
Method 1:
public class SampleVO {
String firstName;
String middleName;
String last... |
I have this basic JavaScript that, using a constructor, validates the form where the login fields can't be empty. All this WITHOUT using any JS libraries.
function Validator(txtbox) {
this.txtbox = txtbox;
}
var validator = new Validator([ "username", "password"]);
Validator.prototype.validate = function(form) {
... |
I was searching for a way to put a Tuple<List> into a Tuple<IEnumerable>, and I found that Tuple has no covariance.
Is C# 4.0 Tuple covariant
Co/Contravariance? Tuple> not satisfied with List
I decide to make my own implementation of an interface which subclass a tuple with a support for Covariance:
/// <summary>
///... |
I would like some comments on my code and implementation for this simple piece of jQuery.
Basically it is 2 div boxes #side1 and #side2, in a container div called #frontimage, where #side2 can be swung out by dragging from right to left along #frontimage.
My jQuery code below continuously updates the CSS transform ro... |
This is a template for one of our data injection tokens.
When I first looked at the template, it was worse than it is now. I would like some input on this because I think that it can be cleaned up even better.
Side note: this is code that we've received from a vendor to use in conjunction with their application for i... |
I've just completed the WordWrap Kata in the Ruby Kata gem and I'd love some feedback. Thanks!
Here's the Kata:
$kata take word_wrap.rb
WordWrap Kata
Create a "WordWrap" class that is initialized with an integer parameter
- detail: The parameter is the wrap column
- example: WordWrap.new 4
- detail... |
I am creating a Frogger game in Flash AS3 and just wanted to see if anyone can help me improve it without breaking the game.
The reason I ask for it because I don't have any errors, but I do get over 50 of these:
Warning: 3596: Duplicate variable definition.
package {
import flash.display.*;
import flash.eve... |
I had to write my own iterator implementation for my structure which has ArrayList<Vector> field. An iterator is supposed to iterate over mentioned List. Any suggestions on improving it, or anything else?
public class ExamplesIterator implements Iterator<Vector> {
private List<Vector> examples; //ArrayList<Vector... |
I made a simple app that fetches the favourite programming language of a Github user, by simply inserting their username. The full code is uploaded on Github, please feel free to fork it from https://github.com/elmargasimov/lovelanguage.
The stack:
Yo Backbone generator from Yeoman
Require.js
Underscore
Sass
Backgro... |
The code below is used to download a JSON data from the web and use the data to fill a spinner. I would like to know if there is better way. Is it wise to move everything from onGetPriceType to the AsyncTask?
Interface
public interface GetBuildTypeInterface {
public void onGetBuildType(HashMap<String,String> result... |
This is a trade script for an online virtual currency exchange I have been developing. We have a team of 3, and we all work in our own trees. Since we're all young and not very experienced, we would like some feedback and advice prior to hiring penetration testing.
if (isUserLoggedIn())
{
//get balances
}
function G... |
This code section is from the main method of my Annual Fuel Use class. The program projects my annual fuel usage based on at least three fill ups of my car.
Here, I am calculating the max and min for distance (which is miles traveled), MPG, and price per gallon. I'd like a general review.
//initialization of array of ... |
My homework is to make a program that calculates the total value of products sold. It works, but I use the if statement because it was asking for the quantity on the output before ending the loop. And for the same reason, I couldn't make the program ask the user again to enter a number from 1 to 5.
import java.util.Sc... |
Below is my implementation for an interview question of printing a binary tree level by level. I've also included some methods for creating a binary tree from a vector in my solution. Please review my solution.
#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <type_traits>
... |
I've written a program all by myself, but I just want to make sure I did it right and if anybody has any suggestions on improving it in any way.
Define and implement the Die class depicted by the following UML diagram to create an ADT for one die (singular of dice) with faces showing values between 1 and the numberOfF... |
I've attempted to write a program to find the largest palindrome in a sentence. Spaces are included and characters are case-sensitive. Can you suggest better ways of doing this?
//public static void main(String args[])--
String source = "my malayalam is beautiful";
//Find the the largest palindrom in this sentence
S... |
Please review my FindMovie and AddMovie methods.
public static boolean FindMovie(String movietofind, String[] ArrayMovie) {
movie Movieobject = new movie();
for (String ArrayMovie1 : ArrayMovie) {
if (ArrayMovie1.equals(movietofind)) {
return true;
}
}
return false;
}
publi... |
Here's my code:
let rem x y =
let rec aux acc i n =
if i=n then acc else
if acc+1=y then aux 0 (i+1) n else
aux (acc+1) (i+1) n in
aux 0 0 x;;
I'm just learning OCaml and I wonder:
Is this tail recursive?
Is there a more efficient algorithm, i.e., operating in better than linear time?
|
I've created a module that implements a basic "Document at a time" algorithm for inverted index querying (more background here). There are many algorithm improvements possible, but I'm now interested in feedback on the structure of the Erlang code, specifically:
Unneeded verbosity / code
Erlang 'style' mistakes
Thing... |
I am relatively new to Java, but have been reading up on how to improve the quality of my code.
I am writing a system where I take in a series of points from a file with x and y co-ordinates and by checking slopes relative to each other, am calculating and drawing a line if there is four or more co-linear points on the... |
I have a tree of objects.
Object id:0 Object type:0
Object id:1 Object type:0
Object id:3 Object type:0
Object id:2 Object type:0
Object id:4 Object type:0
Object id:5 Object type:0
For each object I have a method that returns its "index" in the tree down to the root item.
Indices:
0 - 0
1 - 0 0
2 - 0... |
This method finds the smallest positive number that is evenly divisible by all numbers from 1 to 20.
I am wondering if there is a better way to test if all iterations of a for loop completed successfully. When I put the found boolean outside the for loop, it was terminating my while loop prematurely since the break in ... |
I've written this simple JavaScript application for a homework assignment and I've received feedback saying it could be written better.
Can I get some feedback on how to write this differently? It works for me and returns the results I need, but I would like some more specific feedback. It was meant to be simple and n... |
I'm creating a chess engine and I'm currently in the stage of adding validation. I'm starting off with the major validationrule: checking if a piece can move to the given target destination.
I have setup a system that allows me to very fluently define how a piece can move and validation is done on these rules.
An exam... |
I am having an issue with the following query returning results a bit too slow and I suspect I am missing something basic. My initial guess is the 'CASE' statement is taking too long to process its result on the underlying data. But it could be something in the derived tables as well.
The question is, how can I spe... |
I'm working on implementing the stochastic gradient descent algorithm for recommender systems (see Funk) using sparse matrices with Scipy.
This is how a first basic implementation looks like:
N = self.model.shape[0] #no of users
M = self.model.shape[1] #no of items
self.p = np.random.rand(N, K)
self.q = np.random.rand(... |
I am trying to design an exception hierarchy for logging errors.
These logs will be used only by developers and not by users.
This is a base class that I came up with.
#ifndef TSTRING_TYPEDEF
#define TSTRING_TYPEDEF
typedef std::basic_string <TCHAR> tstring ;
#endif
struct BaseException // Derive from some stand... |
Basically, find x and y given the product = xy and sum = x + y. I would like review on optimization, clean code, and complexity. It looks like O(1), but the while loop makes me wonder if it's something different.
/**
* x will always be less than or equal to y.
*/
final class Variables {
private final int x;
... |
I just wrote the code to evaluate a postfix expression and would like it if someone reviews it for me, it works perfectly fine but I'm having trouble adding the character "=" at the end.
public static int evalPostfix(String exp) {
int res = 0;
myStack list = new myStack();
int n1; //result of 1st pop... |
I have created a state diagram to show the different transitions and states. I could not find many examples of the state pattern in C, so I have taken an example from a Java state pattern and tried to convert it to C.
Is there a way to create the state pattern in C? I'd like some tips or tricks in doing this better us... |
I am slowly learning to master JavaScript and particularly the art of self-executing/invoking functions. I have developed a simple JavaScript plugin and I think I have followed the correct standards.
It is pretty basic in what it does, it is to store information on a oData BATCH request, which provides functions to add... |
The method foo gets a sorted list with different numbers as a parameter and returns the count of all the occurrences such that: i == list[i] (where i is the index 0 <= i <= len(list)).
def foo_helper(lst, start, end):
if start > end:
# end of recursion
return 0
if lst[end] < end or lst[start... |
What I'm basically wondering is if there's anything that is possible to improve in this C++ code:
#include <cstddef>
#include <string>
bool is_palindromic(std::string s)
{
std::size_t i = 0;
std::size_t j = s.length() - 1;
while (i < j) {
if (s[i++] != s[j--]) {
return false;
}
... |
I created this module, and I'm wondering if I did a good job. How would an experienced JavaScript developer improve this simple slider module further? Like, let's say that you want to use this module on 3 sliders on the same page.
Here is a jsFiddle.
Module
var sliderTest = (function(){
/*::::::::::::::::::::::::::... |
My question is to find the longest DNA sub-sequence that appears at least twice. The input is only one DNA string, NOT TWO strings as other LCS programs.
I have done my 4th program and it seems to be working and efficient (computes 10k strings in 4 seconds). But I don't know if this is 100 % correct. This is a really i... |
I have written some example code to test object inheritance, but I'm not sure if it's really the best way for an object to inherit another's functions (like Java's extends).
function Class() {
console.log("Created class"); // The base class
}
Class.prototype.test = function() {
console.log("Testing class"); //... |
I have an image upload form with which I call multiple functions before uploading the file such as checking the size and dimensions, and that it is in a valid image. The code works, but calling the functions and dealing with the results seems quite cumbersome and complex.
Is there a tidier way of structuring the code?
... |
I have this jQuery function I wrote up to set the size of an input based off of its data. In this case I have already figured out the widths for each character based off of a 12px font size for Helvetica.
It's not super flexible or anything, but I would like to know if there is any good way to take what I have and mayb... |
I'm fairly new to Python and am going to be parsing hundreds of thousands of names eventually. What I wanted to do was take individual CSV files, and create new CSV files with only the info I wanted. Then to take the whole lot and combine it into one big file.
This code does that, but I feel I have typed way too much... |
public static StringBuffer infixToPostfix(StringBuffer infix) throws InvalidCharacterException
{
StringBuffer postfix = new StringBuffer("");
Stack<String> myStack = new Stack<String>();
myStack.push("(");
infix.append(')');
for(int i = 0; i < infix.length(); i++)
... |
Here is a simple webpage that I wrote to test HTML code in real time as typed, what are some ways that I can Improve my code? part of the code is reused from a previous project, I believe that it may now be causing problems. I am still learning about CCS and in places i used both the HTML width tag and the CCS property... |
I've recently been learning about design patterns. Now I decided that I know enough to be able to refactor my inventory code. The question solely exist so I could show my fellow programmers the kind of destructive and lame mindset you'd get out of OOP, SOLID etc. Adder.Add<CoolAdd>(new CoolAddArgs(1, 2, 3, etc) instead... |
I've written a small function for solving simple quadratic equations:
class EquationSolver
def solve(x, *args)
args.reverse.map.with_index { |coefficient, index| coefficient * x ** index }.reduce { |result, element| result + element }
end
end
To calculate f(3) for f(x)=3x3−2x2−x+5, one would write:
puts Equat... |
I'm learning Python, and found a fun little video on YouTube called "Learn Python through public data hacking". In essence it uses the CTA unofficial API to do some parsing of XML data. In taking things further than inline code, I'm chunking behaviors into modules and classes to further understand how Python works.
T... |
Is there a way to make this smarter?
Here is the complete code jsbin link
the code needs to filter the table,
and show in the parameters list, only the filters that remain in the table,
and with the number aside the parameter.
<div class="filterColumn">
<h2>size</h2>
<span class="filter" data-filterby="size" data-c... |
The class takes an input of a game-id from the ESPN soccer website. The code then has to grab the commentary, process that and also grab the player names/ids and create a small dictionary of those.
I understand the premise of OOP when shown in basic examples but I cannot get my head around using it in actual programs/a... |
I am just trying to convert each list of values to String by index one by one. My Code is running fine. But I am thinking that I can write better code than this. I Need your good coding possibilities here to convert from list to String.
I am using the code below to convert:
CarComment[] list = form.getCarDataJaxb().get... |
I've a requirement to find sum of an attribute of each JSON row and then add another attribute to show percentage of corresponding attribute.
The JSON is as follows -
[
{"value":150, ...},
{"value":125, ...},
{"value":100, ...},
{"value":60, ...},
{"value":30, ...}
]
Now, I've written following cod... |
Can someone help me make this code more professional? I'm trying my best to find something similar, but I wasn't successful.
I want to avoid the repeat of the code for every single value and also I can't find a solution to avoid select. I only get it run when I repeat the code and count rng, rng1, rng2 etc.
Sub a()
... |
I'm fetching some values from the memory. I would like to create some custom events that I can listen to for each value. Since there are no existing events regarding memory changes, I've decided to go with a polling solution. I'm restarting the timer below manually just to make certain the work is finished.
Would this ... |
Here's some code of mine that I don't like (this was my very first attempt at DI/IoC!). It's a small C# application that runs scheduled on one of our servers and is responsible for fetching the latest version of a VB6 codebase, compiling it and packaging an installer for it.
There's an Execute method in there that smel... |
This is a stored procedure that takes 5-30+ minutes to run depending on the parameter they select.
It also has a nasty side effect of clogging down our SQL Server.
SET NOCOUNT ON;
DECLARE @clients TABLE (customer varchar(200))
IF (NULLIF(@startdate, '') IS NULL)
set @startdate = getdate()-7
IF (NU... |
“There are only two hard things in Computer Science: cache
invalidation and naming things.” -- Phil Karlton
That being said, I created this SimpleCache class which I intend to use to cache database queries and results over a relatively short period of time.
I'm just asking if there are any immediate faults or erro... |
Background
Today at work, I had to bring a component that used to load CSV data into MySQL, and perform calculations as result of SQL queries. I was tasked with replicating that in a programming language.
The general example is like:
There's a 2D array (a table) with columns "Name", "Age", "Grade" and "Total". Produce ... |
I think I have fixed the issues which caused this program to not be functional.
Now I believe the design of my code is somewhat bad and may be causing problems with the number of processes that are created (I would think 10 processes would be created when 20 are?). I am unsure what may be causing this, but I probably ... |
I have a select case that checks against a string variable. It's starting to get large and I am wondering if there is a better way of doing this?
Here is a sample of the Select Case statement:
Select Case Param.ToLower
Case "dashboard_home_vm"
Return _Locator.DashboardHome_VM
Case "job_list_vm"
... |
I'm trying to implement search over two models. In this example Book and Article. Here are the attributes from both of these :
Article(id: integer, magazine: string, title: string, body: text, created_at: datetime, updated_at: datetime)
Book(id: integer, publisher: string, author: string, title: string, foreword: text,... |
I have a fairly ugly controller method I would like to refactor / extract. I can only test this in a integration type test which kind of signals a code smell.
The method processes the form and needs to do one of 5 things, depending on which button was pressed
if submitted and valid (button 1) => update some values on ... |
From https://www.codeeval.com/browse/115/:
You have a string of words and digits divided by comma. Write a program which separates words with digits. You shouldn't change the order elements.
I tried to do it using Haskell (learning Haskell).
Can you give me some good practices/shortcuts/advice on how to make this co... |
Contains 3 options. Given an input array
Unsorted and consecutive range, and array is 1 element short. eg: range is 6-9, and array = [7, 8, 9] output should be 6.
All conditions same as previous except 2 numbers are missing.
Input is sorted, numbers are consecutive, array has one missing element.
Code:
final class... |
I have created a module to draw text tables. The relevant parts are below and here's the full code for txtable).
class Row(Txtable):
[...]
def format(self, col_widths):
"""Return the row as formatted string.
"""
columns = []
for x, column in enumerate(self.columns):
... |
I am working on a SimCity clone, and I am noticing a drop in frame rate as I add more objects to my map, now this is expected, but, when I fill the whole screen, the game maintains about 300 FPS.
Will it hold this as I add a lot more objects, or will it continue to drop?
import pygame
from pygame.locals import *
from r... |
How can I improve the speed of this LINQ query?
using (var txn = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted }))
{
var myAlertsList = (from alerts in _db.Alerts.AsNoTracking()
where alerts.AlertID >=... |
I have the following algorithm which retrieves information in a List of KeyValuePair (prices) and write them in a DataRow. I was wondering if I could achieve the same result without j.
if (prices != null)
{
for (int i = 8, j=0; j < prices.Count; i+=2, j++)
{
res[i] = prices[j].Value;
res[... |
I would like feedback on things I can improve. If you want to see the full example in action, here is the link.
$(document).ready(function() {
var all = $("#slider-view");
var winWidth = window.innerWidth;
var winHeight = window.innerHeight;
$(all).css('height', window.innerHeight);
$(all).cs... |
I thinking of a way to start a new transaction inside a single EJB bean. Typical use case would be to process every item from a list in a separate transaction.
One way to do it would be to use UserTransaction:
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class ManagerBean implements Manager ... |
I'm not very good with templates, so any general tips would be appreciated.
Basically this class parses a CSV file with a very specific format.
My original idea for this was that I wanted this to be useful in MFC desktop applications and non-MFC applications such as Windows services. Basically, I wanted this class to... |
I am using this code to run my sql scripts in inno setup. However ADO gives an error if the script contains GO syntax within it. I added my own code to overcome this problem.
My code below splits the script at each GO statement and run each section separately. I think this could be done in better ways.
[code]
const
a... |
I am looking for tips on improving my short program. I am using system("PAUSE") because this was for an assignment.
Code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
void Display(string* , int* , double*, int);
void Percentage(int*, double*, int);
void Intro(string*, int*, int&);
v... |
I have a method that generates a 10 digit random number where each digit occurs only once.
eg:
0123456789
3645720918
Is there any way this method could be optimized/improved?
private static String randomize(){
Random r = new Random();
List<Integer> digits= new ArrayList<Integer>();
String ... |
I created this out of curiosity and it has some code duplication issues and the fact that sticking .yield() on the end of a call to a unit converter is pretty strange.
How would you improve it?
/**
* A very special velocity converter
* Designed mainly for a very natural syntax
* It allows full chainable conversion c... |
I have finished my first Android App, but I am getting lots of skipped frame messages from Choreographer. So, I started reading and got the impression that I should put as less calculations/works as possible in main thread, rather should use AsyncTask.
To understand the thumb rule, can anybody please validate my code w... |
MongoDB does not provide means to lock a document (like SELECT FOR UPDATE in RDBMS).
There is a recommended approach to Isolate Sequence of Operations, which is sometimes called optimistic locking, but there are scenarios when this approach seems to be overly complicated or even inefficient (that is why pessimistic loc... |
I create series of objects out of Student Class and store them in a vector. I write each object in to a .ser file once it created. Then I read them back. My code is working perfectly. What I want to know is, I do this in a correct optimized way or are there any easy and optimized ways to get this done?? And also how to... |
I create class level static ArrayList by the following line.
static ArrayList<Student> studentList = null;
Then I create and fill ArrayList with some objects inside a function.
studentList = new ArrayList<Student>();
Write(student);
later I want to clear all of my ArrayList elements
studentList = new ArrayList<Stude... |
Is there a simpler and optimized way to calculate listAdminCorePriveleges and privileges ?
public string[] GetPrivilegesForUserByPersonEntityId(int personEntityId)
{
var listPrivileges = new List<string>();
var listAdminCorePriveleges = (_accountRepository.AsQueryable()
.Where(acc => acc.P... |
I currently have this bit of code, but I need to repeat it for red green and blue. Is there a way I can do it without copying and pasting the code 3 times?
yellow.setOnClickListener(new View.OnClickListener() {
public void onClick (View v) {
switch (buttonCount) {
case 1:
em... |
I recently gutted and redid my game code to be object oriented (before it was just functions and a mass of global variables.
Before I go an make more functionality happen, I would like to take one last step backwards to make sure I have the best foundation I can before proceeding.
Note: the point of this game is to bet... |
I want to implement something like C# Linq in C++
Currently only select and where is implemented, but others should be fairly easy if I can make a good structure.
The main concerns I have is I am not sure when to pass reference and when to pass value. Also how it works with different types (array type, lvalue, rvalue, ... |
I'm reading Professional Node.js: Building Javascript Based Scalable Software by Pedro Teixeira and created a web page responding with www.google.de. Could you take a look at my code and let me know if the implementation is not good?
var request = require('request');
var url = 'http://www.google.de'; // input your url ... |
I have attemped to define a function which scan an int value in a specified range and returns that value. The lower bound is the lower of the two parameters, the upper bound is the larger of the two parameters.After invalid input, the function displays a message and repeats input (and message, if necessary ) until a va... |
I am doing my best to keep this code clean and fast, but as I add more to the game, it seems to get harder to maintain a frame-rate higher than 200! I believe that the culprit is a somewhat large for loop inside of the main loop. It performs all of the actions for the tiles inside of the world, and as more tiles are ad... |
The class supplies a simple thread pool that uses the thread class from C++11.
When I schedule the job, I pass two std::function<void()> objects that the pool will execute: the first function is the real job, the second is executed to send some sort of notification that the job has been done.
I'm not sure if I should m... |
I have this CSS selector:
.img + *{
}
Which, from my understanding, will make the browser look for all the elements and then select only those which follow an element with the class img. Is there a better way of writing this selection to improve performance?
Relevant HTML structure:
<div class="media">
<div class=... |
I've implemented a working version of Array#uniq in Ruby to answer the question here: http://www.rubeque.com/problems/like-a-snowflake, but I'd like to see if there's ways to clean up my code or some better practices I should follow? This is my version:
class Array
def uniq(&block)
objs = []
yield_vals = []
... |
Looking for reviewers to suggest optimization and improvements, and to evaluate coding practices.
final class Variables {
private final int x;
private final int y;
Variables(int x2, int y2) {
this.x = x2;
this.y = y2;
}
public int getX() {
return x;
}
public int ge... |
I want a git repository, accessible over ssh, to be read-only when used with certain keys. With other keys access to the full system is okay.
Here is my solution.
git-readonlyshell:
if echo "$2" | egrep -q ^git-upload-pack; then
sh -c "$2"
else
echo Error: read only access 1>&2
fi
.ssh/authorized_keys:
command="./... |
This is a school project that I am turning in late. The prof suggested that i somehow prove myself by improving upon the basic code. This is really tough to do for someone who is just starting to learn to code.
Is there something I can do to:
add onto the code (have it do or ask something different)?
make it even mo... |
Probably the hardest part of learning lisp has been to think in the "lisp way" which is elegant and impressive, but not always easy. I know that recursion is used to solve a lot of problems, and I am working through a book that instead uses apply to solve a lot of problems, which I understand is not as lispy, and also ... |
I have written some code to search a for a pattern in a list of tuples.
It works, but I am sure that it can be improved. Any feedback or ideas would be greatly appreciated.
The list of tuples I am searching in looks like this:
x = [('A', True), ('B', True), ('C', False), ('D', False),
('X', False), ('E', True... |
I have a series of text boxes in a table to gather input as below:
The user will input a target and actual value for each measurement point they require. I would then like to validate the actual values against the target values based upon the tolerance inputted in the tolerance textbox. The tolerance will be the same ... |
Allow for stuff like:
API/ExampleObjects
API/ExampleObjects/SOME_INTEGER_ID/Children
...
with children knowing their owners (aka parents).
Full repo here
Please be brutally honest if something can be improved!
I couldn't add the rest tag as I don't have 150 rep yet.
<?php
class RestApi {
private
$id... |
I'm about to release this application as a hobby and I'm wondering how would I improve the speed of the calculations and overall responsiveness of the class?
I have covered a module briefly in data structures and algorithms so I'm thinking a big factor would be reducing the amount of loops I'm using.Can some suggest/pi... |
I'm writing an AI for an italian Card game scopa http://en.wikipedia.org/wiki/Scopa And as part of it i need to generate all moves available to the user.
A move consists of finding cards in the centerboard that sum to a card in the players hand.
For example if I have a 5 in my hand and the center contains a [5,4,3,2,1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.