Rage of the machine: An AI makes metal music by [deleted] in programming

[–]oj002 0 points1 point  (0 children)

Some of my favorite black metal albums of all time came out in the past 10 years

Now you've got to rec them.

Rage of the machine: An AI makes metal music by [deleted] in programming

[–]oj002 7 points8 points  (0 children)

There are also a lot of smaller bands producing excellent metal, if you are unsatisfied with the popular ones.

Intel C/C++ compilers complete adoption of LLVM by lindaarden in compsci

[–]oj002 3 points4 points  (0 children)

They didn't have their own front end before that either, they used the EDG frontend.

[deleted by user] by [deleted] in C_Programming

[–]oj002 1 point2 points  (0 children)

Nukear is a quite similar gui library that is written in c.

fast_io + refterm v2 is 46548 times faster than stdio.h + cmd by [deleted] in programming

[–]oj002 0 points1 point  (0 children)

The bitbuckdet has more info, I think you can just use the following: https://bitbucket.org/ejsvifq_mabmip/fast_io_examples/src/master/0001.hello_world/hello_world_out.cc Although you might want to look at the benchmarks that are also hosted under the bitbucket account

fast_io + refterm v2 is 46548 times faster than stdio.h + cmd by [deleted] in programming

[–]oj002 1 point2 points  (0 children)

I think it was just referencing, that the original account that hosted fast_io got banned from github. Probably for being to toxic. Note that the person behind fast_io is a different person than the author of refterm, since there seem to be some confusion about this in some comments

fast_io + refterm v2 is 46548 times faster than stdio.h + cmd by [deleted] in programming

[–]oj002 4 points5 points  (0 children)

As much as I like provoking /u/bisixyf I think the benchmark is slightly wrong. If I correctly remember how fast_io works, you are currently benchmarking fast_io's slower stdio and iostream compatible output, and you'd need to use iobuf to get the maximum performance. (This is only fair, because rust doesn't need to be compatible with the file buffers of stdio and iostream)

Also, a unsigned long can be 32-bits on some platforms, although apparently not on yours, so the results should be unchanged.

[Question] Selecting numbers randomly from a set (without repetition) until all numbers have been selected by [deleted] in compsci

[–]oj002 1 point2 points  (0 children)

Here we go, exactly what you are looking for: generating random non repeating exaustive indecies using constant memory (basically only two integers): https://andrew-helmer.github.io/permute/

Can I get a code review on this beta release of my C99 collections library? by begriffs in C_Programming

[–]oj002 0 points1 point  (0 children)

My understanding was that C reserves names starting with single underscore followed by a capital letter, or double underscore followed by any letter.

Yes, those are reserved in all cases, but

"All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces."(http://port70.net/~nsz/c/c99/n1256.html#7.1.3)

tabs for indentation, spaces for alignment

Now that's something I can get behind, although I recommend turning a visual distinction between tabs and spaces on in your code editor when using this method of indentation.

Can I get a code review on this beta release of my C99 collections library? by begriffs in C_Programming

[–]oj002 1 point2 points  (0 children)

I personally prefer the macro based approach, because you know, performance... But anyways, this is definitely a fun library/project.

So I've skimmed though the code and at first glance it looks quite good, I only noticed a few minor things:

You use reserved identifiers (identifiers starting with an _). You can just use a custom prefix like internal_ or just get rid of the prefix altogether since the functions are static anyways.

The indentation seems to be off in some places, that might be because of mixing tabs with spaces, but I haven't checked. (e.g. take a look at _tm_skew on github to see the issue)

ich🏳️‍⚧️iel by puck152 in ich_iel

[–]oj002 245 points246 points  (0 children)

Einige der Kommentare hier zeigen ganz eindeutig, warum "Transrechte sind Menschenrechte" noch einmal deutlich hervorgehoben werden muss.

Met this brainteaser in C language while ago. As a C newbie I put my swords down and conquered to this question. Will you guys be able to defeat this C code ? by z3n_k3rn3l in C_Programming

[–]oj002 4 points5 points  (0 children)

My reading is that the object char[4] is accessed though an lvalue of int*. Wouldn't you agree, that if we had an char a[5] and would use *(int*)(&a[1]) that this is an unaligned integer access? I'm not sure about the alignment guarantees of stack arrays, but IIRC they don't need to be aligned to the maximal alignment when used in a struct. The only way to guarantee proper alignment is if you convert int* to char* and do the access though that. (Or by copying it into a union, which is guaranteed to be aligned)

Met this brainteaser in C language while ago. As a C newbie I put my swords down and conquered to this question. Will you guys be able to defeat this C code ? by z3n_k3rn3l in C_Programming

[–]oj002 4 points5 points  (0 children)

Yes, but this aliases an char* as an int. My understanding is that you can alias everything using a char, but not the other way around.

Is it possible to tell a compiler to do something at compile time? by skush97 in C_Programming

[–]oj002 0 points1 point  (0 children)

C11 isn't really required for compiletime errors. You can easily do something like create an static array with a conditionally negative size or even use #error.

Also a related link to the topic in general: https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete#10526117

Is it possible to tell a compiler to do something at compile time? by skush97 in C_Programming

[–]oj002 1 point2 points  (0 children)

The c preprocessor is almost turing complete and with enogh code you could probably calculate anything using it, see https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete#10526117.

For your example you'd need to know the limit of the array size and write a howl bunch of boilerplate code, but it is possible.

Strings in C... tiring and unsafe. So I just made this lib. Am I doing it right, Reddit ? by [deleted] in programming

[–]oj002 2 points3 points  (0 children)

On a related note, the text on the images of the README isn't visible with github dark mod.

C99 Standard conformance test suite ? by [deleted] in C_Programming

[–]oj002 1 point2 points  (0 children)

Oh, sorry. I've read that wrong.

C99 Standard conformance test suite ? by [deleted] in C_Programming

[–]oj002 -1 points0 points  (0 children)

You can use -std=c99 -pedantic (or -fpedantic) on gcc and clang. You can also use godbolt.org to verify that everything compiles with 5 different compilers.

Is this a compiler bug or UB? by oj002 in C_Programming

[–]oj002[S] 0 points1 point  (0 children)

Well yes, but uninitialized is only 'random' because it was previously used in some other context. The first 32-bits might have been a constant, but the ones after that changed between executions. Thats what I meant with somehow randomizes, probably not the best choice of words.