HNHacker News
TopNewBestAskShowJobs

dfbrown

288 karma · joined August 9, 2012

submissionscomments
dfbrown··on How to design an API function that creates something
With tuples in C++11 you can have multiple return values and ignore ones you don't want: http://ideone.com/3eHOld
dfbrown··on C++14 and SDL2: Managing Resources
This is no worse than anything else in the standard library. Writing generic template code is always ugly but once written you don't have to deal with the ugliness to use the resulting functions. It's not worth the complexity in most cases but if it's something general you're going to use a lot (and lots of C libraries have this idiom of Resource_Init Resource_Destroy function pairs) then it can be worthwhile.

Eigen is a quintessential example. It's some of the most complex and inscrutable template code out there but it makes writing numerical code in C++ almost as nice as matlab while also being extremely fast.

dfbrown··on Google Cloud Platform price drops
If my math is right, that makes it $6.77 per month for a full time f1-micro instance. That's comparable to DigitalOcean's prices.

( 0.013 dollars/hour * 24 hours/day * 31 days/month ) * 0.70 discount = 6.77

dfbrown··on 2048 Numberwang
I've found this seems to make the game significantly easier. If you get a block stuck in a bad spot it will eventually get merged fixing the problem.
dfbrown··on Arq 4 is out – Mac backup to S3/Glacier
I can't think of any reason you would back up to AWS if you already have an offsite backup solution, unless you don't think your offsite backup location is reliable enough.
dfbrown··on All RGB colors in one image
with PNG it's 59kb: https://upload.wikimedia.org/wikipedia/commons/c/c4/All_24-b...
dfbrown··on Most Winning A/B Test Results are Illusory [pdf]
It's not, you can use whatever power you want.
dfbrown··on What Happens When You Drop A Magnet Inside A Copper Tube [video]
I don't think the spinning should have any effect on the speed. Only the vertical movement would create eddy currents. It could be he does it to keep the magnet stable as it falls (like spin on a football).
dfbrown··on Confessions of an ex-TSA agent
It's not really spam if your job is to represent the people contacting you with their concerns.
dfbrown··on Why I no longer contribute to Stack Overflow
This seems more like an argument that SO's "meritocracy" isn't perfect, not that it's poorly implemented. Having two accounts is an edge case.
dfbrown··on Hey Latex users, I have an idea for you
I do think a project website is a great complement to an academic paper for collecting all relevant information into one place (author info, supplementary material, citation information). I know most Computer Graphics authors have web pages for their papers that include the paper, accompanying video, reference information and very occasionally a demo. I don't think it is a good replacement for academic papers however.

Academic papers are intended to be static, finalized content so I don't see the need for anything more than hyperlinks, and even hyperlinks are problematic because the content they link to disappears so often. Because of this PDF makes a great export format because it is nearly as old as HTML, standardized and you know your paper will always look the same. And for generating academic paper PDFs there is nothing that produces better looking papers than LaTeX.

As for standardization, TeX is older (1978), more standard (a single definitive reference implementation), and more stable (no feature changes since 1989). LaTeX is not quite as stable (last release was in 1994 with a new version planned for some time in the future) but I would argue it is still more stable than HTML.

dfbrown··on Breakout in 30 lines of JavaScript
There are many such algorithms, and it is an active area of research especially in the area of soft body physics (cloth, human tissue, etc) where precise collision handling is very important.

Most rigid body simulations use discrete collision detection with fixed time steps, so it only checks for collisions at specific points in time. This is fast, but can cause issues where fast moving objects passing through thin objects (such as a bullet through a pane of glass). The alternative is called Continuous Collision Detection in which you calculate exactly when two objects will collide (or have collided) and can then simulate up to that point (or roll back to that point) and deal with the collision. One naive technique to do this is after integrating your simulation forwards, you use the volume each object swept out in that time step as its collision geometry instead of just the shape of the object at its new position. This solution has issues; it doesn't tell you when two objects collided and it can give false positives, but it works ok for rigid body simulations.

Some recent papers on the subject with more exact (and complicated) techniques:

http://www.cs.columbia.edu/cg/ACM/

http://www.cs.ubc.ca/~rbridson/docs/brochu-siggraph2012-ccd....

dfbrown··on Amazon AppStream
> You can imagine that it would be a terrible experience if it literally sent your keypress to the server, registered it in a game & then sent back the screens display pixels.

I believe that's exactly how Onlive works.

dfbrown··on Cool C Programming
gcc does this as well (though it also supports #pragma once). I believe the current convention is to prefer #ifndef include guards as it is more portable and most compilers can detect and avoid re-including files with them.
dfbrown··on Discoveries Ten Years Later in Zelda Speedrun
Not to diminish Cosmo's skills or his excellent explanations, but the tricks used in these speed runs were discovered and improved upon over many years by many different members of the speed running community who all deserve some credit. [1] has a list of techniques and usually notes who originally discovered them. There are some speed runners who are very good at discovering these kinds of techniques but they are not always the ones who are the fastest at running the game.

1: http://zeldaspeedruns.com/oot/

dfbrown··on Healthcare.gov Lines of Code Comparison
That 323 million lines of code for Debian 5.0 also counts all the packages included with debian. The debian codebase by itself is only 68 million lines of code: http://www.ohloh.net/p/debian
dfbrown··on Aerospace Company Develops Drone That Can Fly Continuously For 5 Years
Is there much weather at 65000 ft?
dfbrown··on Write less
I think v4 has a very different message from v1-3. 1-3 seem to be saying value your readers time by writing as succinctly as possible whereas v4 says a shorter message is more powerful. This may sometimes be the case, but often it is not. Many of the most powerful speeches use repetition and deliberate at length on their message in order to emphasise it. Shortening them would probably have made the message less powerful.
dfbrown··on SteamOS
I think they mean in comparison to Windows. They have previously reported getting better performance using OpenGL on Linux than DirectX on Windows[1]

1: http://blogs.valvesoftware.com/linux/faster-zombies/

dfbrown··on Five years ago, Stack Overflow launched
They may not drive the traffic of Stackoverflow, but from what I've seen most of them are great sources of information for their particular topics. There are several other Stackexchanges I personally have found quite useful (ubuntu, tex, cooking, gaming, and homebrew mainly). I also enjoy just reading popular questions and answers from various sites as they can be quite interesting. Some examples:

http://travel.stackexchange.com/questions/19941/one-foot-in-...

http://english.stackexchange.com/questions/1216/what-is-the-...

http://physics.stackexchange.com/questions/75459/why-do-chim...

http://skeptics.stackexchange.com/questions/17578/did-9-11-l...

dfbrown··on Square open-sources its Vim repo, Maximum Awesome
One minor nitpick is they use snipmate, but Ultisnips[1] is much better and actively maintained

1: https://github.com/SirVer/ultisnips

dfbrown··on Square open-sources its Vim repo, Maximum Awesome
I used to use comma, but then I discovered comma's default mapping is actually quite useful[1] so I switched back to the default '\'

1: http://vimdoc.sourceforge.net/htmldoc/motion.html#,

dfbrown··on Five Hundred and Seven Mechanical Movements
This reminded me of a recent paper on automatically designing animated mechanical characters. Some of these movements could be used to incorporate different kinds of animations into these characters.

http://www.youtube.com/watch?v=DfznnKUwywQ

dfbrown··on Cello: Higher level programming in C
You could do

    #define foreach(x, xs) \
        for (var _xs = xs, *x = iter_start(_xs); x = iter_next(_xs); x != iter_end(_xs))
Because var is just void* and anything you can iterate over will also be a void*.
dfbrown··on A useful program, 0 bytes long
:!program executes an external program, but you can also open a shell with :sh
dfbrown··on Google Buys Wavii For North Of $30 Million
"Try-hard" is the most confusing derogatory term I've ever come across.
dfbrown··on Linode hacked, CCs and passwords leaked
I stopped using linode in mid February and I have not received an email. They also still appear to have my credit card attached to my account (and I had to change my password when I logged in).
dfbrown··on Haskell Beats C Using Generalized Stream Fusion [pdf]
I'm not sure why they wrote this in the first place. Eigen's MatrixBase already has a squaredNorm function: http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html...

edit: I see, they address this in the article: In this specific case the Eigen library has the squared L2-norm in its API, but in more complicated examples there might be no such built-in provision

dfbrown··on Idiomatic Python [video]
It would be nice if you resized your editor window to be as small as possible and cropped the video to that size. As it is the area of the video I actually care about is very small with lots of empty space around it.
dfbrown··on YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Completion Engine for Vim
One thing I miss form clang_complete is its snippet support for functions [0]. With clang_complete you could set it up so when you autocompleted a function, it would generate a temporary snippet in your favourite snippet engine (ultisnips, snipmate, etc) so you could jump between the parameters of the function.

[0] https://github.com/Rip-Rip/clang_complete/blob/master/doc/cl...

← PreviousPage 2 of 3Next →