Unanswered Questions
31
votes
0answers
454 views
Capture the notion of invertible functions
I find sometimes it is useful to capture the notion of invertible functions.
The idea is that if two functions f :: a -> b and ...
14
votes
0answers
134 views
FizzBuzz in Forth
There are quite a large number of existing implementatons of FizzBuzz but I awoke this morning in a cold sweat with the terrible revelation that Code Review had no FizzBuzz implementation in Forth! ...
14
votes
0answers
267 views
Factor script to change case of all filenames in a directory
In the absence of a full-fledged tutorial, I am teaching myself to program in the Factor language by writing a bunch of functions that I will eventually use in command-line scripts.
One common ...
11
votes
0answers
52 views
Tiny Lua library to get char pointer from string
Background
I'm using Lua with luaglut to do some OpenGL stuff. The luaglut API is almost identical to the gl/glut C APIs. Sometimes, gl functions want a pointer to some data, for example:
...
11
votes
0answers
169 views
Shift and merge numbers as in 2048 game code
I started to learn Rust last night. Given its parallelization capabilities, I thought a good starting point would be porting my C++ AI for 2048 to Rust.
This is the function implementing the shift ...
11
votes
0answers
208 views
Lua OOP and classically-styled prototypal inheritance
I want to do some object-oriented programming in Lua, and I decided on something like this:
...
11
votes
0answers
627 views
boost::any replacement with std::unique_ptr support
I needed a boost.any look-a-like, that could handle a std::unique_ptr. I came up with this. Please provide some C++11 criticism.
...
10
votes
0answers
263 views
Portable CMake script
I'm trying to write a portable CMake script for a simple Qt application. The target platforms are Win and Mac OSX. But as you can see, it's quite a monster already.
Are there any CMake profs? Can you ...
10
votes
0answers
1k views
JSON Serializer
Carrying on from:
Yet another C++ Json Parser
Yet another C++ Json Parser (Recursive)
All the code is available from git hub: ThorsSerializer but only reviewing a small section here.
The idea is ...
9
votes
0answers
100 views
Template integer range
This is a follow-up of an old question by @LokiAstari, modified for the current community challenge. The idea is to provide a compile-time integer range. I applied all the modifications that I ...
8
votes
1answer
1k views
Intranet PHP application
I'm more of an IT guy (no CS course) with a strong and passionate relationship with Unix and I love KISS.
I'm writing an application to help my coworkers with their daily tasks. Every now and then I ...
7
votes
0answers
68 views
+50
Is this IRC bot utility library Racket-y enough?
To help myself learn Racket, I ported a simple JavaScript ircbot module I wrote for Node.js to Racket. The Racket version is built atop the Racket irc package, so ...
7
votes
0answers
72 views
Implementing a generic and covariant Set in Scala
I'm struggling with manually implementing a simple purely functional Set that's also generic and covariant on its type parameter:
...
7
votes
0answers
169 views
Most elegant variadic functor
Question
Suppose we have two sorts of classes
an input class Input
defines a type result_type
defines ...
6
votes
1answer
146 views
How do I interrupt a ServerSocket#accept() and shut down a multi-threaded socket server?
I have got here a work-in-progress piece of code here that does multi threaded communication via sockets. I am using a poison pill to shut it down. It is a local port number. Is there a better way to ...