All Questions

6,247 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
40
votes
0answers
803 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 ...
37
votes
0answers
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 ...
29
votes
0answers
863 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 ...
25
votes
0answers
504 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 ...
20
votes
0answers
2k 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 ...
18
votes
0answers
253 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, ...
16
votes
0answers
164 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. ...
15
votes
0answers
371 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 ...
15
votes
0answers
7k 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: ...
15
votes
0answers
152 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 ...
14
votes
0answers
231 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 ...
14
votes
0answers
323 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. ...
14
votes
0answers
394 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 ...
14
votes
0answers
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 ...
13
votes
0answers
160 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 (...
13
votes
0answers
165 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. ...
13
votes
0answers
489 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 ...
13
votes
0answers
168 views

Tracking the bounding box of a map

Context I have a bunch of data points that look roughly like this: ...
13
votes
0answers
481 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 ...
12
votes
0answers
170 views

“String Interpolation in {language}”, “VBA”

"This is {0} cool!", "freaking" I've always wanted an easy and intuitive way to inject variables into a string. So after about 10 variations, I finally came up with this function. How it works The ...
12
votes
0answers
78 views

Ruby chess engine gem

This is my first Ruby gem that claims to provide all the rules of the chess game. My goal was to keep this library as simple as possible via OOP principles, and I'd be glad to hear any feedback from ...
12
votes
0answers
2k views

Inverse transform sampling

Inverse transform sampling is a method to generate random values that follow an arbitrary distribution. For some reason this method was never implemented in any popular scientific libraries. And as I ...
12
votes
0answers
150 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 ...
12
votes
0answers
496 views

Binary Search Tree Monad Implementation

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 ...
11
votes
0answers
47 views

Continuous Fourier integrals by Ooura's method

I have a PR implementing Ooura and Mori's method for continuous Fourier integrals. I used it here to compute an oscillatory integral that Mathematica got completely wrong, and then I thought "well ...
11
votes
0answers
99 views

Download files in parallel

This module has a ensure_downloaded function which takes a slice of Urls. It downloads all of the urls to a local downloads ...
11
votes
0answers
124 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: ...
11
votes
0answers
358 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 ...
10
votes
0answers
213 views

Windows keylogger in C++

Windows keylogger in C++ Known issues: Not implementing rule of five Having to use hack to use member variables, out_, in static method Pressing caps-lock won't ...
10
votes
0answers
341 views

Asynchronous serial port communications class in C++

Please review my serial port class written in C++. It is completely asynchronous, ie event driven. My idea for later is to inherit from this a sync_serial, where timeouts can be specified and it ...
10
votes
0answers
250 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 <...
10
votes
0answers
666 views

Realtime concurrent Haskell MIDI buffer

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 ...
10
votes
0answers
210 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 ...
10
votes
0answers
171 views

Multi-function memoizator and multi-type container

I'm trying to write a multiple functions memoizator, which I've talked about here. The main problem is creating a container containing different and heterogenous functions. I found a working solution,...
10
votes
0answers
162 views

Multithreaded Groovy Mandelbrot

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 ...
10
votes
0answers
454 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: ...
10
votes
1answer
1k views

Parallelizing some model fitting code using multiprocessing

I'm trying to refactor some code for fitting parametric models that are defined symbolically using Theano. My goal is for all models to expose a common interface so that, as far as possible, they can ...
9
votes
0answers
1k 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. ...
9
votes
0answers
151 views

Parser for a custom scene definition format for a raytracer

For a raytracer I’ve been writing with a classmate, we use a custom scene definition format that allows specifying shapes, composite shapes, materials, lights, cameras and transform and render ...
9
votes
0answers
124 views

Creating an istream peeker

I want an istream that you can safely peek arbitrarily many characters from. This works as far as I can tell, but I am unsure if this is really "the right way" to ...
9
votes
0answers
870 views

Bilinear interpolation using Neon intrinsics

I'm trying to do a Bilinear interpolation on the ARM Neon. However, I find that my vectorized code is slower than the regular one, on a BeagleBone Black. Any idea why this could happen? I'm using ...
9
votes
0answers
369 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 ...
9
votes
0answers
220 views

Take two on type to instance map

I realised that what I was doing wasn't particularly smart, so I switched to a different approach. This costs more dynamic allocations but has a much simpler implementation: ...
8
votes
0answers
85 views

Not so Excellent Knight's Tour

Note: This is part of a set of demo applications I'm writing for colleagues to show we're not limited to VBA when dealing with Excel. Considering our IT challenges (no admin on-site & no local-...
8
votes
0answers
157 views

Safe dynamic SQL for generic search

Prompted by discussion about SQL injection, I wanted to put a proof of concept forward to get feedback about whether this is in fact safe and protected against SQL injection or other malicious use. ...
8
votes
0answers
168 views

Population dynamic simulation on biological information maintenance 2

This question is the follow-up to this previous question. Background Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, ...
8
votes
0answers
46 views

Parallel merge sort with thread- and bufferpooling

I did wrote this parallel merge sort with no external dependencies. I tried to make use of modern C++ as much as possible. Can you please tell me how it is? ...
8
votes
0answers
124 views

Binary Search Tree Implementation in C++17

I am a hobbyist computer programmer trying to learn modern C++ (in this case C++17). I thought it might be an interesting challenge to write a Binary Search Tree similar to ...
8
votes
0answers
136 views

Building Slack message

I have the function which builds and return Slack message with text and attachments. How can I refactor this function to make it ...
8
votes
0answers
409 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 (...

15 30 50 per page