All Questions

5,849 questions
629 views

Swiftly turning wheels – The May 2017 Community Challenge

This is my attempt at the May 2017 Community Challenge in Swift, with a chain consisting of rigid links. I took this as an opportunity to learn SpriteKit, Apple's framework for 2D games. At least ...
1k views

JSON formatter in your least favorite language

Just joking guys, Brainfuck is an awesome, challenging language. I've tested the following code with bf-x86 compiler and rather big JSON file. I believe code is fully functional on a valid (!) JSON ...
813 views

Making a generic NSMapTable replacement written in Swift thread-safe

This is a follow-up to this question. While discussing some details about the code I posted there, I came upon a problem with thread-safety. After searching and trying different things, I reached a ...
455 views

Definitional Returns. Solved. Mostly

I have made the bold claim that a longstanding problem in Rebol is "now solved"...that of "definitional returns". But of course, such claims need some peer review, and there's always some new trick ...
1k views

4-stage pipelined RV32I CPU in Verilog

This is a simple 4-stage pipeline that partially implements the RV32I ISA. All instructions are supported, except jalr, those relating to memory (...
232 views

Mucheck - a mutation analysis tool for Haskell programs

We have been working on a mutation analysis tool for Haskell tests called MuCheck. It accepts any Haskell source file, and a function name to mutate, applies a defined set of mutation operators on it, ...
1k views

CMake Project Template for a General Cross Platform C++14 Project

UPDATE: I am no longer updating this post with the contents of my actual project since they have changed significantly (Unit testing is now done with doctest, code coverage is included, etc.). This ...
145 views

Timeoutable computations module

Defines a simple module for timeoutable computations, with the ability to return arbitrary intermediary results on timeout or the final value otherwise. It also allows default return values. The ...
128 views

Rubik's cube mode for emacs

Following is a dumb implementation of Rubik's cube for Emacs. I am not well versed in writing (e)lisp, so I ask for a review and corrections. ...
316 views

BF welcomes Fibonnaci

Slightly inspired by a previous question/april fools joke I decided to take on Fibonnaci sequence in the lovely language Brainfuck. In order to do this I have also worked on Brainduck, which is a ...
207 views

Water flowing swiftly over farmland – The August 2016 Community Challenge

This is my attempt to solve the August 2016 Community Challenge in Swift. I tried to implement the algorithm described by @200_success: Each Cell keeps track ...
312 views

Modularizing a Game Scene in Sprite Kit

I am trying to modularize the main SKScene of my strategy game. I am not sure that my approach is correct so I would love to get a review of the following code. ...
6k views

Django Rest Framework - add/remove to a list

I have a model Collection which has a many to many relation to a model Item. I want to be able to add or remove items to this collection using Django Rest Framework. Option1 - make an action: ...
381 views

Shepard Tone stream generation in Clojure

This is my work to generate an infinite Shepard Tone. It is written in Clojure and works by generating repeating streams of incrementing frequencies, converting those to values on a sine wave and then ...
1k views

PowerShell module for formatting objects using Razor

I managed to get something up and running, but I've no idea whether there are better ways to do this. I've spent all morning trying to figure out the best way to use parameters (allowing objects from ...
115 views

Multiplying big numbers using Karatsuba's method

The Karatsuba algorithm, first published in 1962, aims to speed up the multiplication of big numbers by reducing the number of 'single-digit-multiplications' involved. Because of its complexity (...
158 views

Tracking the bounding box of a map

Context I have a bunch of data points that look roughly like this: ...
1k views

Object-Oriented Chess Game in Ruby

I wrote a chess game in Ruby using object-oriented principles. One of the challenges was deciding which particular methods/actions belonged to a particular class, as there were some that felt as if ...
412 views

Autotools detect C++ language standard support

I have been updating my build tools to optionally use autotools (autoconfig/automake/libtool etc.). As part of this change I have written a couple of M4 macros. This not being something I have done ...
453 views

I've written a Binary Search Tree Monad in Scala. I would like to hear your thoughts on how to improve it (e.g. making insertion/deletion/search faster and more scalable). Also, is there a better way ...
120 views

Replace color in image measured by Euclidean distance

This script replaces the red hair in image to black color (replace one color to another) Three major parts in this script Not just replace color red to black, I hope the output image looks natural, ...
194 views

Efficiently selecting spatially distributed weighted points

Background: Motivation behind writing the following code is originated in the area of computer vision. More specifically – image rectification. In order to obtain rectified images, one has to find a ...
77 views

261 views

Testing a list of proxies for validity concurrently

I have a class that tests a list of proxies for validity concurrently, which I have created in 2 different ways, one utilizing Parallel.ForEach and the other using a TPL Dataflow ActionBlock. I am ...
122 views

Signed integer-to-ascii x86_64 assembler macro

I have implemented an algorithm which converts a signed integer to its ASCII equivalent string with the corresponding sign as a first byte. I have tested it on several numbers and it worked correctly. ...
1k views

Lock-free atomic shared pointer in C++14

I'm trying to write a lock-free implementation for atomic shared pointer. Basically, there are two class templates shared_ptr and ...
656 views

Plotting polynomials roots

NOTE: See follow up to this question here I created a simple python script to plot quadratic, cubic and quartic polynomials with integer coefficients between -4 and 4. It uses numpy to find the roots ...
341 views

Repository pattern in Rust

I'm looking to add a thin layer of abstraction for database interaction in my application. I'm not really looking for a full blown ORM or advanced query builder. I am familiar with Diesel, but its ...
109 views

Delete engine for deeply nested linked structure

The background is the question at https://stackoverflow.com/questions/36634394/nested-shared-ptr-destruction-causes-stack-overflow. To summarize, for a data structure that looks like: ...
338 views

Document formatting markup engine in Postscript

I've been rewriting this same sort of thing off and on over the years, but finally here's the "perfected" monstrosity. Some kruft in the middle with attempting to predict the number of spaces that ...
661 views

Fluid Simulation with SDL

I have always wanted to write a fluid simulation, and with the help of a paper and some StackOverflow users I've got something that works. My goal is to have a program that someone can run right away ...
141 views

Encoding the problem domain of products and prices into the typesystem in F#

I'm trying to design a model for purchasing amounts of products in F#, following the ideas for designing for correctness (source). The idea is to use the type system to capture the different legal ...
276 views

Is this implementation of persistence OK?

I'm using this code in an app that has hundreds of daily users. The code works, and passes all of the test cases I have. Occasionally some users report a problem that I don't get right to the bottom ...
144 views

BattleShip - Ships & Players

I'm making a full-blown OOP Battleship game in VBA (previous post: Battleship Grid), and I want this code to be as good as it gets - and better, if I can. I've refactored a few things, introduced a <...
535 views

Problem Background MIDI is a serial representation of control signals to a sound generator. Typically, a noteOn message initiates the attack phase of a sound at a given pitch. The note will ...
47 views

Python RPI button board

My project consists of a Raspberry Pi 2B V1.1 connected to a number of push-buttons via GPIO pins. The goal is to create a panel of buttons, allowing the user to make a selection of one or more items ...
466 views

Live-streaming tweets and plot its sentimental value in colors on a world map

I want to have someone reviewing and helping me get some good ideas in how to improve my current project. All information about the project is in the following github link. I would also appreciate ...
185 views

Code to fill PE import address table

I wrote a program to test AV engines against encryption. When it runs, it will compute some key, decrypt an executable it has in its data section and copy it to the locations where the executable ...
854 views

Interview coding challenge for iOS Part 2 - the application in Objective-C and Swift

I recently interviewed with a company that needed a C/C++ programmer to work on the iOS side of the products. The job description indicated they needed someone with 4 years of Objective-C and iOS ...
192 views

Vergesort — A runs-adaptive layer to enhance sorting algorithms

More than a full-fledged sorting algorithm, vergesort is a Runs-adaptive algorithm that falls back most of the time to another sorting algorithm to sort a sequence of elements, but is able to identify ...
967 views

Function to conect to Firebase Rest API via Access VBA

This is the application for small school, which will store students' info in Firebase and also retrieve data from Firebase. I am using JSON Parser to parse the data and save the same in Access tables. ...
825 views

Selection sorting a type list (compile-time)

This question has the tuple_selection_sort<> template that sorts the variadic template of a tuple using a comparator (any template taking two types that has a ...
155 views

Seeing as it's October, I thought I'd do the community challenge. Due to my inexperience coding in Groovy, I decided to give Groovy a go. I'm not sure how well I followed Groovy conventions, and the ...
422 views

Serialization: Step 1 Json Parser

As nobody has provided input, I have updated the question. (The next one is coming soon) Coding to this interface: ...
364 views

Idiomatic way to implement tail -f in clojure

Disclaimer: This is just an educational task to learn how to program in clojure and switch brain to immutable state-way of developing (the provided snipped has some unused variables which I didn't ...
331 views

Simple, intuitive and (hopefully) safe EventDispatcher

For my own game engine I need an event system. I tried to avoid the single-huge-enum-approach for minimizing compile times. The BasicEventListener is the (...
133 views

Root finding and integration

I am trying to implement the modified Next Reaction Method with time varying propensities as mentioned in sections IV and V of this paper. At one step in the process this expression must be evaluated: ...
169 views

.NET DLL Injector in C++

I built a DLL Injector with User-Interface. The program lists all processes, the user chooses one of them and a DLL, and inject it. It's my first project in C++, and I know it's not exactly C++ ...