News for hackers. Stuff that matters.

ThatOtherPerson

Re:Mics that record in 3D ambisonics are the next big thing on Wednesday September 19, 2018 @02:28PM (#18026490)
Yeah, you have to simulate the attenuation from different directions - HRTFs (head related transfer functions)[1] are used to do this. They're already supported by some games, and you have to use them for VR audio, since the user is in control of the camera position and angle.

[1] https://en.wikipedia.org/wiki/Head-related_transfer_function

Re:Announcing Rust 1.23 on Thursday January 04, 2018 @07:20PM (#16075402)
That's already possible - Apex[0] provides a shim for running golang and Rust, and I'm running headless chrome on Lambda to take screenshots right now (see [1] for an example).

[0]: http://apex.run/#runtime

[1]: https://github.com/sambaiz/puppeteer-lambda-starter-kit

Re:Breakdown of a Simple Ray Tracer on Friday February 03, 2017 @06:50PM (#13564442)
What happens if you need to alter the color of a texture that's been loaded? For example, if you want to do diffuse shading on a sphere with a texture mapped to it. Do you first need to convert the texture pixel back to linear space, apply the shading, and then correct for gamma?
Re:Breakdown of a Simple Ray Tracer on Friday February 03, 2017 @05:40PM (#13563974)
I thought about that, but some of the results I found on Google suggest that output from WebGL shaders is supposed to be in a linear color space [0] [1]. Then again, some of the comments here [2] suggest that you do have to do gamma correction manually.

Incidentally, I didn't know to do gamma correction until I came across [3], which explained why the output from my raytracers always looked a little off ;)

[0] http://stackoverflow.com/questions/10843321/should-webgl-sha...

[1] https://www.khronos.org/webgl/public-mailing-list/archives/1...

[2] https://www.shadertoy.com/view/Xdl3WM

[3] http://blog.johnnovak.net/2016/09/21/what-every-coder-should...

Re:Breakdown of a Simple Ray Tracer on Friday February 03, 2017 @05:23PM (#13563868)
This is pretty cool. I've written a couple of toy ray tracers, but always in a language that runs on a CPU, so it's interesting to see how you would do it on a GPU. And I noticed that this is from the Ken Perlin, which is cool - I'm mostly just used to seeing his name as the "Perlin" in Perlin noise.

There's one thing I'm curious about - does anyone know why he's taking the square root of the color to produce the final pixel color?

Re:Ask HN: How to get better at technical interviewing? on Wednesday October 05, 2016 @08:46PM (#12649239)
How you do in technical interviews often has little to do with how good of a programmer you are. Modern technical interviews (in Silicon Valley, at least) tend to focus on a certain category of computer science and mathematical questions, rather than skills that would actually benefit an employer.

On the bright side, something of an industry has been built up around preparing people for tech company interviews (similar to the SAT prep industry). Check out Gayle McDowell's Cracking the Coding Interview[0], CodeKata[1], or Interview Cake[2].

[0] https://www.amazon.com/Cracking-Coding-Interview-Programming...

[1] http://codekata.com/

[2] https://www.interviewcake.com/

Re:Learn the Command Line on Monday August 24, 2015 @03:38PM (#10112474)
Could you use emscripten and just run bash in the browser?
Re:Is My Code Good? on Thursday April 23, 2015 @12:17PM (#9427727)
Read the bar at the bottom:

    Lovingly (and satirically) created by your friends at test double. Designed by Derek Briggs.
It's not meant to be serious, although I'm not sure what the point is.

Edit: It seems to be (perhaps unintentionally) clickbait for programmers. We can't seem to resist visiting a website that claims to rate our code quality.

Re:The Hardest Logic Puzzle Ever on Sunday April 19, 2015 @09:59AM (#9403141)
You can only ask yes/no questions.
It looks like a video projected on a transparent screen, similar to the variant of Pepper's Ghost used in several concerts recently.
Re:The Book of Shaders on Tuesday March 17, 2015 @07:26AM (#9217250)
The sharp sign (♯) [1] is actually a different symbol than the number sign (#) [2].

[1] https://en.wikipedia.org/wiki/Sharp_%28music%29

[2] https://en.wikipedia.org/wiki/Number_sign

Re:Why reading a book 100 times is a great idea on Tuesday February 10, 2015 @11:58AM (#9028352)
It's been my opinion for a while that the "meaning" in a work of art or in the sentences we use to communicate is found where it differs from the established pattern. For example, this very sentence follows the same general outline of thousands of other sentences. The actual meaning is found where it breaks with the pattern.

Another simple example would be image macros. They often follow a very strict pattern; the new information the user wishes to convey is where the pattern is broken.

In the same way, stories often follow a number of tropes. These tropes help to establish some basic information about the story, but what really makes it interesting is when the story breaks from the pattern and does something new.

Re:Say hello to x64 Assembly, part 1 on Saturday August 30, 2014 @02:15PM (#8247117)
Not everybody targets all their code for the web.
Re:We have C++14 on Monday August 18, 2014 @05:25PM (#8194782)
It's an improvement in the sense that it's more general; you can loop through any container that implements that protocol, which most (if not all) of the STL containers do. For example,

    template <class T>
    void foo(T arr)
    {
        for (auto it = arr.begin(); it != arr.end(); ++it)
        {
            std::cout << *it << std::endl;
        }
    }
You could pass a `std::map<int>` to `foo`, or a `std::list<string>`, or a `std::vector<char>`. You could even create your own classes and give them to `foo`, as long as they implement the `begin`/`end` protocol.

It's certainly more verbose than necessary, but it can be convenient.

Re:Zelda De-make on Tuesday April 01, 2014 @03:48PM (#7511171)
He says he stored the map data as a single PNG. So, each pixel specifies what tile type that area of the map is.
Re:Neovim on Saturday February 22, 2014 @03:51AM (#7281467)
Check out pandoc [1], it will let you write documents in Markdown + LaTeX for equations and then convert it to LaTeX, a PDF, or several other document formats.

Also, even though Markdown tends to be fairly easy to write, there are many edge cases where you can't really be sure what the result is unless you try it.

[1]: http://johnmacfarlane.net/pandoc/

Re:Tim Berners-Lee: We need to re-decentralise the web on Thursday February 06, 2014 @01:18PM (#7191942)
I've gotten to the point where I just tune those out. I wouldn't have even known there was an advertisement on that page if you hadn't pointed it out.
Re:Strangest Programming Language Feature? on Friday January 31, 2014 @09:34PM (#7160620)
Can you explain your array[i] / i[array] reference? I can't find it on Google.
Re:Why am I here? on Thursday December 19, 2013 @09:20PM (#6939504)
"Why am I here?"

"Because my daughter loves it here."

Seems to fit in with what he was saying to me.

Re:Github seems to be experiencing security issues on Tuesday November 19, 2013 @03:44AM (#6759943)
Check your previous history. You probably don't have many failed attempts before the past 24 hours. It seems to be some sort of botnet attack.
Re:Github seems to be experiencing security issues on Tuesday November 19, 2013 @03:42AM (#6759938)
I just checked my account's security history, and there's been a failed login attempt every 7 hours for the past two days, all from different IP addresses.

It reminds me of the "Hail Mary Cloud" posted previously on HN - http://bsdly.blogspot.com/2013/10/the-hail-mary-cloud-and-le...