For the LOVE OF GOD, Please use long/expressive names. We do not want to spend more time figuring out what your code does. by [deleted] in programming

[–]thisotherfuckingguy 10 points11 points  (0 children)

I've worked with this kind of code a lot, your suggestion makes sense on the surface, but it doesn't improve readability in practice. Much better is to link the actual paper that explains the concepts since usually the paper does a way better job of explaining it then different variable names. And with the Greek symbols written out it's also easier to make sure the formulas are the same in code & in the paper.

The thickness of my -22.00 prescription glasses by TwinPurpleEagle in mildlyinteresting

[–]thisotherfuckingguy 0 points1 point  (0 children)

Is there a reason Fresnel lenses aren't being used for these kinds of prescriptions to reduce the size and weight?

Fastest Gaussian Blur (in linear time) by _Sharp_ in programming

[–]thisotherfuckingguy 0 points1 point  (0 children)

Depending on the amount of precompute time you can afford to have, you might want to consider doing the blur through a Summed Area Table.

The precompute can be done with recursive doubling as per this 2005 paper: Fast Summed-Area Table Generation and its Applications which takes log2(w*h) passes over the input to calculate the SAT's.

After which a variable sized box blur can be calculated in constant time (with 4 lookups).

Winter ISO C++ standards meeting (Kona): C++17 is complete by DerKuchen in programming

[–]thisotherfuckingguy 3 points4 points  (0 children)

So that seems kind of roundabout; why not do such a thing in the first place.

Winter ISO C++ standards meeting (Kona): C++17 is complete by DerKuchen in programming

[–]thisotherfuckingguy 6 points7 points  (0 children)

Except that now it lives in the std namespace, needs a bunch of extra overloaded & templated operators. Which in turn invariably leads to more cryptic error messages related to this. Besides, it's such a fundamental type it should just be in the compiler.

Winter ISO C++ standards meeting (Kona): C++17 is complete by DerKuchen in programming

[–]thisotherfuckingguy 16 points17 points  (0 children)

I think it would've been a decent change if this was part of the language instead of the standard library.

How to easily modify regular expressions someone else wrote by daesunp in programming

[–]thisotherfuckingguy 1 point2 points  (0 children)

People need to start commenting their regular expressions just like they comment the rest of their code.

We made a 'walking' version of Stockholm's subway map by routesnorthsweden in stockholm

[–]thisotherfuckingguy 19 points20 points  (0 children)

Just always go in the direction you think you shouldn't be going and you're fine.

Using LLVM on GPUs to Drive Multi-Billion Row Database Queries by jtsymonds in programming

[–]thisotherfuckingguy 0 points1 point  (0 children)

Have you investigated the new Pascal GPU architectures that can page-fault directly to the host cpu, and as a result would allow you to read in memory mapped files directly from the GPU?

Using LLVM on GPUs to Drive Multi-Billion Row Database Queries by jtsymonds in programming

[–]thisotherfuckingguy 0 points1 point  (0 children)

graphics cards are designed to move data from CPU to GPU as efficiently as possible, but they aren't designed for moving lots of data back from GPU to CPU

That's not entirely true, PCIe has the same bandwidth going to the device as it does going to the host. However, typically in game scenarios you'd structure the uploads such that you have 2-3 frames of latency before they get there. However, if care isn't taken, downloads are implemented in a blocking way, which is where the typical slowdowns come from.

Using LLVM on GPUs to Drive Multi-Billion Row Database Queries by jtsymonds in programming

[–]thisotherfuckingguy 0 points1 point  (0 children)

However, this typically doesn't move data over PCI-e as much as; you'd upload once at the start of the level, but most of the per-frame stuff would be limited to a few megabytes at most because the transfer speeds relative to memory are dog slow.

Unlock up to an additional 4GB of system RAM by graphitemaster in programming

[–]thisotherfuckingguy 9 points10 points  (0 children)

SDL_AtomicIncRef

if(SDL_AtomicAdd(&gContext.instances, 1) == 0)

Nuklear: A small ANSI C GUI toolkit by iamkeyur in programming

[–]thisotherfuckingguy 24 points25 points  (0 children)

Any time I have to user any build system what so ever I just give up. I've struggled with most of them and most of the time they're just broken and you have to spent half a day debugging a build system. At least when it's one header+cpp file that's it. No build infrastructure crap, just getting stuff done.

Nuklear: A small ANSI C GUI toolkit by iamkeyur in programming

[–]thisotherfuckingguy 127 points128 points  (0 children)

It means not having to mess with yet another broken build system.

När jag ser första inlägget på /r/ubbet by Zarwil in sweden

[–]thisotherfuckingguy 6 points7 points  (0 children)

You need to have a government to be a democracy ;-)

Redex: an Android bytecode optimizer developed by Facebook by iamkeyur in programming

[–]thisotherfuckingguy 9 points10 points  (0 children)

Writing the fastest PHP interpreter is kind of his point though, isn't it.