Better HN
topnewbestaskshowjobs
Log inSign up

panic

29,749 karma · joined Sep 16, 2009 (17y ago) · 3,593 submissions

Submissions

comment 11y ago · link · parent

It's also difficult to solve problems like priority inversion, where a high-priority task H is blocked on a low-priority task L. Ideally you'd increase L's priority so H can make progress. But a semaphore doesn't track which thread is in the critical section, so you don't know which thread's priority to boost.

comment 11y ago · link · parent

The goal of Hamburg’s project is to replace roads with a “gruenes netz” or a green network of interconnected open areas covering 40% of the city. According to the official website, parks, playgrounds, sports fields, allotments and cemeteries will be connected to form a network, which will allow people to navigate through the city without the use of cars.

Why not just let people walk on the roads? Places like cemeteries and parks can be quite creepy to walk through, especially at night. Roads next to buildings with people in them are a more comfortable place to walk.

comment 11y ago · link · parent

I would probably let small objects pile up on its surface though, which would make it hard to turn.

That does seem like the biggest problem with this idea. The entire surface doesn't have to be writeable, though. You could cover part of (most of?) the desk with a second surface, fixed around the front and back, that would remain stationary as the paper moves.

comment 11y ago · link · parent

Exactly. Otherwise the same note played over and over at an even tempo would be "sticky" (which is nonsense).

comment 11y ago · link · parent

git itself is decentralized

The source code itself is stored in a decentralized way, sure, but the git repository doesn't include pull request comments, wiki pages and issues. Of course, you can fetch these using the (rate-limited) GitHub API, but it's not quite the same (and other social networks typically let you extract your data in the same way).

comment 11y ago · link · parent

Efficient 2D using OpenGL is very difficult. It will never approach the speed of a well designed 2D API.

All web content on OS X and iOS is rendered using OpenGL. That's not to say it was easy to make efficient, but it definitely outperforms the default CoreGraphics implementation on most content.

comment 11y ago · link · parent

In fact, Steve eventually decided that giving recognition to the designers was a bad idea. Nowadays, Apple has abolished programmer names in the "About Box", and closely guards the names of their designers, allowing only a select few employees to interact with the press at all.

I wonder why he decided giving recognition in this way was a bad idea. It's a shame the thousands of people coming up with ideas, building hardware and implementing software at Apple aren't credited anywhere.

3278.

Time travel in Braid(qntm.org ↗)

127 points · by panic · 11y ago · 35 comments

comment 11y ago · link · parent

I agree with the other commenters that some of these animations make more sense than others, but it's cool to see people experimenting in this space. The photo loading animation in particular is really nice!

3280.

Doubly Linked Lists in C(locklessinc.com ↗)

4 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

Separating "lexing" and "parsing" can still be good for performance, since "lexing" needs no auxiliary storage (not even a stack) and cannot backtrack. The author points this out in the performance documentation: https://github.com/Engelberg/instaparse/blob/master/docs/Per...

comment 11y ago · link · parent

The algorithm used is Generalized LL parsing (http://dotat.at/tmp/gll.pdf), which promises linear-time parsing of LL grammars and cubic-time parsing of arbitrary grammars. For some reason this isn't mentioned until the very end.

comment 11y ago · link · parent

Previously: https://news.ycombinator.com/item?id=3844302

comment 11y ago · link · parent

The author of Cap'n Proto recently wrote an article about representing range types via C++ templates to protect against overflow: https://capnproto.org/news/2015-03-02-security-advisory-and-...

comment 11y ago · link · parent

That's the inverse of the function the author wants, which ought to have type '[Word8] -> Maybe a' (where 'Nothing' is returned when the bytes exceed the range of the type in question).

comment 11y ago · link · parent

Are pointer events actually a good way to write high-quality web apps? Maybe Apple and Google have reasons for opposing the standard.

comment 11y ago · link · parent

Exactly. If simplicity were the most important thing, we'd all be writing code in Forth or some sort of macro assembler.

comment 11y ago · link · parent

Swift's String class (https://developer.apple.com/library/ios/documentation/Swift/...) uses extended grapheme clusters as characters. If you need the raw Unicode scalars or UTF-16/UTF-8 code units, there are separate "views" into the string that let you iterate over these.

Using extended grapheme clusters as characters means truncation, concatenation, length measurement and transformations like reversal all work in the expected way, even in the presence of combining characters. More standard libraries should consider adopting this model!

comment 11y ago · link · parent

Some thoughts on Flow Hive from a beekeeper: http://www.honeybeesuite.com/should-you-go-with-the-flow/

comment 11y ago · link · parent

Sure, but since any object could have a reference to a GC object, you still have to eat the latency of scanning the entire heap (not just the GC'd objects) every so often. That seems like a pretty big performance cliff.

comment 11y ago · link · parent

I like this language because it doesn't try to do anything too fancy. It's "just" a streamlined C++.

I do wonder how they're planning on avoiding overhead with the garbage collector, though. Once you have a single garbage collected object on your heap, it seems like you'd have to start scanning the whole thing to make sure the garbage collected object is still alive.

comment 11y ago · link · parent

There was a contest to produce programs generating large numbers in a version of C with integral types that hold arbitrarily-large integers: http://djm.cc/bignum-rules-posted.txt

You can see the results here: http://djm.cc/bignum-results.txt -- there's some interesting stuff in there!

3293.

Filenames and Pathnames in Shell: How to Do It Correctly(dwheeler.com ↗)

2 points · by panic · 11y ago · discuss

3294.

An Interactive Look at Apple’s Technology History(kenedict.com ↗)

1 points · by panic · 11y ago · discuss

comment 11y ago · link · parent

If you haven't seen it already, you should watch Matt Haughey's "Lessons from 11 years of community" (link below), in which he describes some of the moderation tools and techniques MetaFilter has developed over the years.

"Lessons from 11 years of community": https://vimeo.com/21043675

3296.

Maze Generation in Thirteen Bytes (2012)(trixter.oldskool.org ↗)

102 points · by panic · 11y ago · 21 comments

comment 11y ago · link · parent

In order to draw the PNG, the browser has to decode it, including the transparent pixels. I'm also pretty sure (though I haven't tested this) that the overhead of painting four smaller images is negligible in comparison to the cost of blending the entire center area.

Many sites are very bad about this, e.g. this sprite sheet from linkedin: https://static.licdn.com/scds/common/u/img/sprite/sprite_glo... which, when decoded, takes up ~9MB of almost entirely empty memory. Check out the "Optimizing Web Content in UIWebViews and Websites on iOS" talk on https://developer.apple.com/videos/wwdc/2012/ for more info about not wasting memory on mobile web sites.

comment 11y ago · link · parent

The triangular grid is dual to the hexagonal grid -- if you take a hexagonal grid, put a vertex in the center of each hexagonal tile, then form tile edges by connecting each vertex to its six neighboring vertices, you get a triangular grid. Doing the same operation to the triangular grid gives you the hex-grid back again.

comment 11y ago · link · parent

Good idea! To go further, you could cut the PNG into four strips (top, bottom, left, right) so the browser doesn't have to store the enormous rectangle of transparent pixels making up the insides of the PNG.

3300.

Divide and Conquer Debugging(aras-p.info ↗)

1 points · by panic · 11y ago · discuss

1
109110111
120