Better HN
topnewbestaskshowjobs
Log inSign up

panic

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

Submissions

comment 9y ago · link · parent

We don't have a democracy so there's a risk that if large enough groups of people get too worked up, they might create a massive problem like a revolution or something. Nobody would benefit from that - see the mess it made in Syria, Egypt, Lybia, and Tunisia.

What about the Cultural Revolution which put the ruling party itself in power? It's a bit hypocritical for the government to categorically condemn revolution when they wouldn't even exist without it.

comment 9y ago · link · parent

What CPUs in common use still have trap representations? Are there other reasons why reading from an indeterminate value can't give an arbitrary but well-defined result?

comment 9y ago · link · parent

Sure, UTF-8 isn't always the shortest, but for many common strings (like JSON-encoded objects with ASCII keys) it is much shorter than UTF-32. The point is that using a list representation means you can't do any better than UTF-32, even if you wanted to.

comment 9y ago · link · parent

Here's a scenario: imagine China agrees to un-ban Facebook as long as they can provide their own "terrorist photos" and "terrorist text" as input to this software, giving them the power to censor Facebook worldwide. The fact that this capability even exists is a bit concerning!

comment 9y ago · link · parent

Memory use: Unicode scalar values go up to 0x10ffff, which on most machines means a 32-bit value for each character. A UTF-8 representation can be less than 30% the size. And that's not even counting the fact that many languages (Haskell included) represent lists as a linked data structure, with the overhead of a pointer per list entry.

Correctness: you often don't want to operate on individual Unicode scalar values. Extended grapheme clusters can combine multiple scalar values to form a single human-readable character, and that's usually the unit you care about. Representing a string directly as a list of extended grapheme clusters would use even more memory.

Fundamentally, a string has more structure than a list representation gives you (encoded bytes vs. scalar values vs. grapheme clusters). I think it's better to expose this structure than it is to pretend a string is just a list of characters.

comment 9y ago · link · parent

The "spookiness" is more subtle than that. You could argue that the cubes have decided on their color as soon as you close the box. Why doesn't this argument work for real quantum systems?

In reality, you're not measuring colors of boxes, but spins of particles. You generate two particles with opposite spins along a known axis. If you measure the spins along that same axis, you always get the same result: one is spinning "clockwise", the other "counterclockwise".

On the other hand, if you measure one of the spins along a different axis, you'll randomly get "clockwise" or "counterclockwise" according to the angle between the original spin axis and the measurement axis. Measuring at a right angle to the original axis gives you random results, which is also what you'd expect. But what about the angles in between? Classical statistics says the correlation should vary linearly with the angle, but the actual results have a cosine factor (https://en.wikipedia.org/wiki/File:Bell.svg). This cosine factor can't be explained by any kind of classical statistical randomness. That's the "spooky" part.

1897.

Hard Questions(newsroom.fb.com ↗)

103 points · by panic · 9y ago · 35 comments

comment 9y ago · link · parent

One of the papers got some discussion here: https://news.ycombinator.com/item?id=14494935

comment 9y ago · link · parent

I'm not sure if it's as clear-cut as you say. It seems like complex sounds could be harder to differentiate and could take more energy to recognize. What specifically will kill you if you transmit less information?

1900.

Obscure Steam Games and Digging for Hidden Gems(nition.co ↗)

3 points · by panic · 9y ago · discuss

1901.

The secret origin story of the iPhone(theverge.com ↗)

3 points · by panic · 9y ago · discuss

1902.

Welcome to America: Here’s Your Electronic Shackle(villagevoice.com ↗)

1 points · by panic · 9y ago · discuss

comment 9y ago · link · parent

Here's a concrete example: say I want to write a class which wraps an object, logging all the methods called on it. So if I say (in C++-ish syntax):

    Dog *dog = new Dog()
    LoggingWrapper *wrapper = new LoggingWrapper(dog)
    wrapper->runAround()
The program should output a log entry like "Dog->runAround() called", then the dog should run around.

In Smalltalk, you can implement `LoggingWrapper doesNotUnderstand:` to output the log entry; something like:

    doesNotUnderstand: aMessage
        Logger log: target class, ' ', aMessage selector, ' called'.
        ^ aMessage sentTo: target.
It's not impossible to implement a class like LoggingWrapper using vtables -- in order to make a vtable, you have to know all a class's methods at compile time, but LoggingWrapper can respond to any method its target responds to.

comment 9y ago · link · parent

In C++, if you try to call obj->method() where `method` is not defined on the object, it won't throw an exception: it simply won't compile. In Java, the "class cast exception" is a somewhat different concept. Even if both classes support the same method, you can't cast between them if they don't have a superclass-subclass relationship.

The core difference is "late binding" -- in languages like Smalltalk, the mapping from names to methods is evaluated at runtime, not at compile time like Java or C++. Looking things up at runtime makes the system less efficient, but makes it easier to change pieces of the system independently.

comment 9y ago · link · parent

In this analogy, your home has millions of rooms that you're renting out. The people arriving in your home are paying just the same as the people who have lived there all their lives. Are these new arrivals adding any less value?

comment 9y ago · link · parent

C++ doesn't do everything OOP: it doesn't support the late bound message-send style OOP of Smalltalk at all. In particular, you can't implement #doesNotUnderstand: (http://wiki.c2.com/?DoesNotUnderstand) or replace one object with another unless they have a superclass-subclass relationship.

1907.

Computing Fractional Fourier Transforms(algassert.com ↗)

51 points · by panic · 9y ago · 4 comments

comment 9y ago · link · parent

Maybe we should increase the number of agents investigating this stuff, then? Fraud affects many more people than terrorism, but nobody gives the "there's just not enough agents" excuse for that.

Also, only investigating fraud when there's lots of money involved means we're only helping rich people, who need the least help. Losing less money doesn't mean less impact on someone's life if that's all they have.

comment 9y ago · link · parent

How about "got it"?

comment 9y ago · link · parent

Ruby and Objective-C both have a strong Smalltalk lineage. You typically use the C part of Objective-C to perform basic operations like arithmetic and function calling -- if you know C already, it may be a more comfortable starting point, but it doesn't show off the power you get when every value is an object (and you can do things like add new numeric types while the system is running: http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-...).

comment 9y ago · link · parent

In principle we do not know the long-term impact in advance, but we can often make a probabilistic estimate.

I'm not sure this is true. We can't make a probabilistic estimate without a model. And to design an accurate model, you need to describe precisely what it means to ask, "is this activity worth pursuing?" Is there a way to do this without involving all of human society in your model?

1912.

The Regrettable Decline of Space Utopias(currentaffairs.org ↗)

3 points · by panic · 9y ago · discuss

1913.

WebAssembly Demystified(floooh.github.io ↗)

3 points · by panic · 9y ago · discuss

1914.

Summary of Global Warming Solutions by Overall Rank(drawdown.org ↗)

1 points · by panic · 9y ago · discuss

comment 9y ago · link · parent

You may have to specify a flag like "-C target-cpu=native" -- not all CPUs support popcnt, so LLVM can't generate it without knowing details about the target. I can't get the compiler on godbolt.org to generate it either way, though.
1
636465
120