-2
votes
0answers
5 views

Read from Serial Port in C++ is unstable

I have a serial device (RS232) from which I am requesting (binary) data. This interface answers with a sequence of 5 bytes, or 17 bytes when it has some new data. I figured out, that I have to turn ...
1
vote
0answers
7 views

Thread-safe lock free FIFO queue

A few years ago there was a need to add a FIFO queue between 2 threads into my project. At that time I've got some interesting idea how to do that without any atomics and locks. (There was a ...
3
votes
0answers
13 views

Blurring an Image

Lately, I've been part of a team working on a utility library for iOS called Thundercats (on Github). We're about to start working on some changes and upgrades in preparation for a 2.0 release, so we ...
3
votes
0answers
15 views

Impyla parse user args into SQL query

My Python is super-rusty and I feel like there must be a better way to do the following. I would really appreciate any feedback/pointers so that I can improve my code and skills (or lack thereof!). ...
-2
votes
0answers
17 views

Hapi Lab e2e test workflow

This is my first attempt to set up a test suite with Hapi and Lab. What do you think of this workflow? Is there a better way (error-checking aside)? controller/user.js ...
-2
votes
0answers
13 views

Cant understand the difference between char and strings [on hold]

Trying to solve a problem, I cant understand why my struct of arrays are getting overwritten although it should not. Well, I have tried different methods and saw that my sorting algorithm works fine ...
4
votes
1answer
21 views

Optimising a user's-choice sorting algorithm

With the help of some nice folks at Stack Overflow, I wrote an algorithm that will give a user three buttons: option a neither ...
0
votes
0answers
28 views

Optimising nested for loops Java [on hold]

I am having a code that does scheduling of a days events based on the exact fit basis. I am kind of having three nested for loops and I'd love to hear thoughts on ...
4
votes
3answers
38 views

C++ vector that uses expression templates technique to increase performance of mathematical expressions

I've been reading Item 6 from Scott Meyers' Effective Modern C++ and noticed he mentioned a technique called "expression templates". I've decided to give it a try and implemented a vector that ...
0
votes
0answers
18 views

Pattern for prototypal class creation

Last night I made a object oriented pattern that I find very useful. With this pattern, one can quickly assign a new class, add to an existing class, and chain methods together. Its pretty short, I ...
2
votes
0answers
23 views

Heap selection sort in Java

I designed and implemented this adaptive heap sort in Java. It works as follows: Copy the range to be sorted into auxiliary array \$A\$ Create an empty run heap \$H\$ Scan \$A\$ from beginning to ...
2
votes
0answers
20 views

Using Enum to apply Consumer

I have a utility called ZipFileCombiner that combines zip archives into a single archive. Part of the implementation is using an ...
0
votes
0answers
11 views

Checking size of StorageFile stream before writing to it [on hold]

I want to write to a StorageFile in Windows Phone 8.1 (using C# libs). I have to open a stream before I can begin writing, and I get the size of the file from the stream. I want to see that if the ...
0
votes
0answers
17 views

Dilemma cash flow modeling [on hold]

I'm studying a modeling form to be the most generic and reusable I can with the cash flow design, but there's many variables in the model. Am I on the right way? My model It is too fragmented? Is ...
5
votes
2answers
204 views

C# conversion of hexadecimal string to string

Given a C# string which is a set of hexadecimal numbers such as: string HexString = "202048656c6c6f20576f726c64313233212020"; Where those hexadecimal numbers ...
1
vote
0answers
29 views

Get list of unique parents from childrens list

Parent has list of Children. I only have access to the list of children. I need to get list of unique parents from the List of ...
-1
votes
0answers
12 views

Flask Restless Filtering Query [on hold]

I am trying to use filter for query, using requests on Flask Restless. I tried to write the code like this, ...
5
votes
1answer
33 views

Permutations of a list in Haskell

I have this piece of code which given a list returns another list which combines every element with every other element (without repetitions) using a given function as a combiner. I came up with three ...
-1
votes
1answer
43 views

Math quiz for teachers & students - follow-up

I have been programming a maths quiz that can be used for teachers an I have have been trying to make the code as short as possible so it is easier to understand. If you have seen my previous post you ...
-3
votes
0answers
35 views

Send JSON data on HTML Form with ajax type POST [on hold]

Hi am traying this code it will help me. In this code the html form field converting into json object and send it via ajax on server using type POST. ...
3
votes
2answers
63 views

Math quiz for teachers & students

I have been programming a maths quiz that can be used for teachers and I have have been trying to make the code as short as possible so it is easier to understand. If there is any way I could make it ...
1
vote
0answers
22 views

Using combinations of OR and AND filters with RxJava

I'm trying to work out a way to create a combination of OR and AND filters in RxJava. Here's what I've done so far: ...
-1
votes
0answers
24 views

Getting, Processing and returning a update collection [on hold]

Self explanatory code here, This is just an example of what I am doing, had to change names and remove irrelevant code to make it as short as possible, ...
0
votes
1answer
30 views

Delayed Include rules for EntityTypeConfiguration using LINQ expressions

The aim of this class is to set rules for including navigational properties on Configuration level and then apply where needed in the code. I've decided to store expressions in the list for different ...
2
votes
2answers
298 views

Return sum of three values, excluding values within a specified range

Is there a way to make my code simpler? Given three int values, (a, b, ...
-1
votes
0answers
17 views

ormlite and mongodb c# driver performance comparison [on hold]

I am currently using servicestack Data is stored in MongoDB For performing CRUD operations from servicestack I am using Mongo DB C# Driver Is ORMLITE more efficient than Mongo DB C# Driver? I ...
1
vote
1answer
22 views

Find disjoint integer intervals

Given a list of numeric intervals in the form of (a,b), where a and b are integers, it finds ...
2
votes
2answers
32 views

Find a Id that contains all mentioned values

I have a scenario to find the CategoryId which all have the mentioned Mode values. The schema of the table ...
2
votes
0answers
18 views

WPF MVVM Dialog with Prism, MahApps.Metro

I am building a Metro-themed WPF application with MVVM approach using Prism and MahApps.Metro. I have to show a custom dialog from view model. Currently, I am using ...
-2
votes
0answers
16 views

Determine whether numbers are pythagorean triple? [on hold]

I am trying to make Python code that determines whether or not a set of three numbers are Pythagorean triples. It returns false regardless. Please help. ...
7
votes
1answer
68 views

Simple Self-Learning AI

This is a programming challenge I set for myself a while back to create an AI that starts with no knowledge of anything whatsoever, and learns as you talk to it. (It can learn stuff like your name, ...
5
votes
1answer
16 views

Implementation of Set data type in Haskell

I'm an advanced beginner Haskell programmer. I implemented a set data type in Haskell and I wanted to find out if I made correct choices when writing it. Would there be a way to improve some of the ...
10
votes
5answers
599 views

Method to count all comments in single external C# file

I recently had an interview question: Write a method that counts all comments in a single external file. It was a timed question and I wanted to know if this is the best way to accomplish the ...
0
votes
1answer
24 views

Class and Static practice, IDS and a max instance count [on hold]

I was practicing working with classes and the static property included with them and came up with a simple ID counter and max number list. I also added a quick debug error ...
19
votes
3answers
2k views

Excuse me, how many of you are new here? Mind if I JOIN you?

I had perceived an uptick in new reviewers around here, and I wanted to see if the data backed that observation up. It's been a while since I've written any SQL, so this was a nice little exercise in ...
-1
votes
2answers
29 views

Program that filters JSON data based on user selection

I have made a basic program using AngularJS that displays data from a JSON file, and filters it according to the user's selection (specifically FIFA 15 chemistry cards). I did plenty of CSS work to ...
0
votes
0answers
13 views

How to create a random number in an oval [on hold]

I need to help to find a way to generate a random number in the circle under the variable random_number. I'm new to this, so can you please make this understandable to a rookie? ...
8
votes
4answers
277 views

“Heat spot” image generation performance

I wrote a function that generates an image like this. The function is as follows: ...
2
votes
1answer
25 views

Insertion sort via recursion

I'm learning about algorithms and have been recently experimenting with insertion sort via recursion in Python. My code works fine, but I was wondering if there are any possible improvements that ...
3
votes
1answer
32 views

Unit-testing an RSS feed parser

I'm working on a class to parse RSS feeds using SyndicationFeed. (related to Downloading data using HttpClient). I'm trying to write this so it can be unit-tested, ...
3
votes
1answer
38 views

Swap items of a linked list in pairs - revision 2

The first revision is available here and the code is available on GitHub. I modified the method reversePairs and added mSize to ...
6
votes
4answers
281 views

Resumable HTTP download class

Any suggestions, corrections and advice would be very nice and much appreciated. ...
2
votes
1answer
17 views

Sidekiq worker in Ruby

I have worker code that looks like this: ...
1
vote
0answers
8 views

Bootstrap Modals

I am learning how to implement Bootstrap modals in AngularJS. I can do it when the modal code (the actual popup window code) is on the main page, but I want to be able to display external files so ...
8
votes
2answers
76 views

World Generation for City Builder

I decided that I wanted to add some spice to my bland looking city maps, so I created a couple of algorithms to add water to the map. I also added a "marshlands" setting that would just randomly ...
3
votes
1answer
21 views

Mapping file data to environment variables

This is a follow-on to my previous question: Enforcing set environment variables While learning more about JavaScript, node, and the bluemix environment, I have been using the loading of process ...
1
vote
1answer
32 views

Dynamically create Javascript Object

Given a strings like 'param1.param2.param3' and a value that should be set on the last parameter, is there a better way than the following to dynamically create an Object and reuse the function to ...
4
votes
0answers
19 views

White box input stream for creating test scenarios

I need to test a specialized input stream class that takes input from a TCP/IP network connection. I particularly need to ensure that the blocking and availability behavior is correct. To help me ...
1
vote
1answer
43 views

Snake class for simple Snake clone

NOTE: I'm only including the snake class (only one file) here because the rest of the code doesn't need reviewing. If you need to see the complete code for whatever reason, it is available on GitHub ...
6
votes
3answers
114 views

Manipulating a .csv file to look for two common values to create a key, then summing up values

My code reads a .csv file, looks for a couple values to create its key, and then wraps up the data based on a few business rules I have. I'm trying to learn "the right way", so I'd really appreciate ...

15 30 50 per page