I'm trying to compile a Code::Blocks project with SDL2, but the file won't build, with the errors:
||=== Build: Debug in SDLtest (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lSDLmain|
ld.exe||cannot find -lSDL|
||error: ld returned 1 exit status|
||=== Build failed: 3 error(s), 0 warni...
Challenge
Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. Your challenge is to evaluate the score using the FEN string. This is an example of a FEN string:
5k2/ppp5/4P3/3R3p/6P1/1K2Nr2/PP3P2/8
Using this string, you can calcula...
When implementing an algorithm for correcting aliased measurement data, I hit the need to implement following function. The function takes input bitstring on the left, and should produce the integer and list on the right:
1 => 1, [0]
10 => 1, [0]
11 =>
explanation: hits the down, runs across the hello world part. prints the first char, goes down to the bottom line (this still could be golfed by reversing the sub part), substitutes p[anychar] with p. When it finally gets to printing !, it does not go down and hits the halt command
In linear algebra, the permanent of a square matrix is a function of the matrix similar to the determinant. The permanent, as well as the determinant, is a polynomial in the entries of the matrix. Both permanent and determinant are special cases of a more general function of a matrix called the immanant.
== Definition ==
The permanent of an n-by-n matrix A = (ai,j) is defined as
perm
(
A
)
=
∑
σ
∈
S
n
...
In linear algebra, the computation of the permanent of a matrix is a problem that is known to be more difficult than the computation of the determinant of a matrix despite the apparent similarity of the definitions.
The permanent is defined similarly to the determinant, as a sum of products of sets of matrix entries that lie in distinct rows and columns. However, where the determinant weights each of these products with a ±1 sign based on the parity of the set, the permanent weights them all with a +1 sign.
While the determinant can be computed in polynomial time by Gaussian elimination, th...
and there is little if any code out there to do it for you
so a perfect codegolf.se question!
what do you think?
another nice challenge would be to play connect 4 perfectly I think
@Lembik unless a golfing language has an inbuilt function I think Mathematica would win the golfing portion - Permanent[m] returns a fraction, Permanent[N[m]] returns a float, and Permanent[N[m,d]] returns to d digits of precision.
The Mathematica docs even tell you how to do that! Module[{n = Length[m]}, Sum[Product[m[[i, \[Sigma][[i]]]], {i, n}], {\[Sigma], Permutations[Range[n]]}]]
GPU VPSs aren't really a thing, since GPU passthrough is horribly unstable for most VM stacks. And even then, most require one dedicated GPU per VM. This doesn't scale at all in a "cloud" way.
@Lembik 100 per week yeah. But these are used for huge GPGPU tasks. You don't actually need OpenCL or CUDA for smaller tasks. OpenGL GPGPU (via GLSL) is more than sufficient.
@Lembik Here's an example of a slicker GPGPU library (runs in C++ and JS), not using OpenCL or CUDA, but still doing general computation: minxomat.github.io/NanoCL . It measures performance. The top number is JS, the bottom one is GPU-accelerated JS.
Codegolf the permanent
The challenge is to write codegolf for the permanent of a matrix. Your code can take input however it wishes but please include in your answer a full worked example including clear instructions for how to supply input to your code. To make the challenge a little more inte...
The challenge is to write codegolf for the permanent of a matrix. Your code can take input however it wishes and give output in any sensible format but please include in your answer a full worked example including clear instructions for how to supply input to your code. To make the challenge a l...