skysight-inc/HackerNews huggingface dataset:
Thank you for sharing that, that makes complete sense.

My parents also don't speak English. They speak Romanian, so when they see English they read it as if it is Romanian. Like if they see "house" they might pronounce it as "hoe-oo-seh" (just say every letter, and pronounce with as if it is from a Romanian alphabet). I guess I never thought what it might be like if it was a completely unpronounceable alphabet like Greek for example. At that point a string of digits would work better.
if (state->g2 == SPIN_LOCK_NO_LOCKER) {
state->g2 = state->g1;
if (state->g1 == locker_id) {
if (state->g2 == locker_id) {
return;
}
}
}

You need to insert memory barriers between the writes and the reads. Without, on systems with multiple cores, other cores may not see the state changes in program order, which will make it possible for multiple threads to conclude they won the race.

http://en.wikipedia.org/wiki/Memory_barrier
http://en.wikipedia.org/wiki/Weak_consistency
That's fair. I've been reading The Economist for quite awhile, and to your point, it's never short on clever catchphrases and headlines. I do, however, think the use of catchphrases within a text (as opposed to the headline) has been growing over the years. Especially in recent years. Not just in The Economist, but in general. To wit: the headline "Crowning the Dragon" feels very typically Economist; the catchphrase "The Pacific Century" feels more like a conscious attempt to coin a meme.
They do.

https://developer.chrome.com/native-client/overview
More importantly, the explicit barriers are needed on ARM chips where writes are permitted to be reordered with reads.
Hello dear Keith,

I can see a few problems with this code, please consider the following constructive criticism.

for (;;) {
if (state->g2 == locker_id) {
return;
}
while (state->g2 != SPIN_LOCK_NO_LOCKER) {
if (spin_wait_callback != NULL) {
spin_wait_callback();
}

You don't need this 'continue', the loop will do that just fine without it.

continue;
}

The following four lines are problematic:

state->g1 = locker_id;

if (state->g2 == SPIN_LOCK_NO_LOCKER) {

Imagine the consequences of a task switch right here.

state->g2 = state->g1;

This if does nothing.

if (state->g1 == locker_id) {

And you're going to do the following if without all the extra
conditionals above when you do not return from here the
next time you iterate through the loop. So all that extra
testing of state->g1 above does nothing.

if (state->g2 == locker_id) {
return;
}
}
}
}

I think I can see what you're trying to do here but once you
fix the basic problems with the code and you test it under
very high load locking and unlocking a resource you'll find
that fairly soon two threads will be accessing the resource
at the same time.

Try a very tight loop that locks a counter, does a load, increment, store
on it and then unlocks the counter again. Keep separate tallies
per thread and use a third thread to keep track of the expected
sum and the actual sum.

That should show you reasonably quickly why atomicity in the
basic operation of acquiring a lock is a base requirement.

Locking issues almost never show up when you are running lightly loaded on a single core. But the lack of ensuring all cores see the same information, that race conditions can't occur and that instructions are executed in the right order will show up with a terrible certainty under load on multiple cores.
I wonder if the author of Betty has taken a look at one of the existing Inform (http://inform7.com) interpreter variants used for Interactive Fiction games (what we used to call "text adventures"). They have progressed a lot since the old text adventures of yore, and are now capable of parsing pretty complex English sentences (instead of just "take sword", you can write "examine sword, then take it and give it to the wizard", and the interpreter will even ask you about ambiguities, such as "which sword? the magic sword or the long sword?").

Then again, I'm unsure if the precision needed from command line interfaces can ever be improved with natural language. Natural language is imprecise, ambiguous, redundant, and confusing even to our human interlocutors. Why would we want to interface with computers in English, instead of using a synthetic and concise made-up language? I'm talking specifically about the command line, which is for power users anyway.

(A perfectly valid answer is "because it was fun to write Betty, and that's its own reward", of course).
libcontainer - http://blog.docker.io/2014/03/docker-0-9-introducing-executi...
It's obviously both "profit" and "prophet." Neither one is wrong.
> What is a `machine level exchange instruction`?

http://en.wikipedia.org/wiki/Compare-and-swap
That check does nothing, you're about to loop and then do the 'if' without all the checks, see my other comment.
Docker stopped using LXC and now uses libcontainer:

http://www.infoq.com/news/2014/03/docker_0_9
Both the compiler and CPU will reorder operations. Proper locking requires a memory barrier which will prevent both CPU and compiler from doing that. For more information I recommend reading up on double checked locking. DDJ had a good pair of articles the first where they presented the faulty algorithm, the second where they talked about why it was broken.

C/c++ doesn't have many guarantees about operation ordering.
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLo...
the order you supply here can not happen (at least if i understand what you are saying)

if step #9 happens then #10 will be skipped by the
"if (state->g2 == SPIN_LOCK_NO_LOCKER) {"

what am i missing?
Also PowerPC and any other weakly consistent architecture, natch.
"DSLs" are one of ruby's strengths, no?
It seems kinda suspicious that 50 requests and 5 MB takes as long as 1000000 requests and 100 MB. It makes me think that something is wrong with your benchmark.
CurveCP sounds good, but what's Noise? And could CurveCP be improved by using QUIC instead of UDP?
I love Angular for exactly that reason. My HTML template should be a HTML file. I cannot stand codebases that mix code and markup together.
The tensile strength of the packaging (about 0.8 mm worth of it) is such that you need brute force to even pierce it.

Maybe a chopping block as a base and a stanley knife should be part and parcel of any tourist's apparel about to buy an SD card.
Try http://ractivejs.org (disclaimer: I'm on the core team). It's a standalone system but works seamlessly with Backbone if necessary.
You made a HN thread for your own reflection on another one of your posts that nobody responded to. Wow.
There seems to be an implicit assumption in this code that writes which one thread makes will be seen by other threads in the same order. This is not the case on modern architectures. You need both compiler and machine-level memory barriers to ensure this. C's "volatile" keyword does not provide either.

The Linux kernel guys wrote an in-depth explanation of why volatile doesn't work for this use-case here: https://www.kernel.org/doc/Documentation/volatile-considered...
If he were to write an alternative, it would be given undue preference over others. He probably knows this.
Even more amazing to me than the discovery is the fact that Dr. Rechenberg, who apparently also was big into the formation evolutionary computation ( http://en.wikipedia.org/wiki/Ingo_Rechenberg ), managed to already make a robotic model of the spider. At age 80.
One narrow use case would be textbook shopping. I don't understand the underlying reasons, but the prices of textbooks between e.g. Canada and the UK can be substantial, and more than enough to justify shipping overseas.
No, I wasn't aware of that, but that is interesting.

Betty just grew out of my cheat sheet of commands. I was tired of repeatedly looking up things in my cheat sheet or Google, and decided to make this.

The current project has a limited number of commands, but I am hoping that by making it public, others will issue pull requests with things they'd want to use.

Its current state is command line only, which is for power users. But thinking ahead, on the roadmap I wrote that by the time it reaches v1.0, I'd like it to be extensible. This means it can be used from text-to-speech apps or whatever. Some futuristic use cases: I'm sitting on my bed, with my computer on my desk, and say "Betty: next song" and it just works. Or I'm running on my treadmill, talking aloud: I'd say "Betty: open the New York Times in Chrome" then "Betty: read me this article" and it just works. That'd be cool. I don't know specifically how to do everything I'd want to do, but those are the sorts of far future things that would be cool. In its current implementation, it's mainly for not having to keep looking up commands or options.
Here's a copy of the functions in question so that it's easier to see what people are talking about:

void
spin_lock(struct spin_lock_state *state, int locker_id,
void (*spin_wait_callback)()) {
for (;;) {
if (state->g2 == locker_id) {
return;
}
while (state->g2 != SPIN_LOCK_NO_LOCKER) {
if (spin_wait_callback != NULL) {
spin_wait_callback();
}
continue;
}
state->g1 = locker_id;
if (state->g2 == SPIN_LOCK_NO_LOCKER) {
state->g2 = state->g1;
if (state->g1 == locker_id) {
if (state->g2 == locker_id) {
return;
}
}
}
}
}

void
spin_unlock(struct spin_lock_state *state, int locker_id)
{
state->g2 = SPIN_LOCK_NO_LOCKER;
}
Yeah, I pretty much immediately close any web page that has an auto play video on it. If I get a link from a friend and a video plays before it, I just close it. No interest in that stuff, especially when I'm browsing at work.
Oh this is neat. Would be super cool if you could view how others did the same exercise.
so, the attempt here (line 32 which you believe is problematic) I think can be pre-empted.

if thread 1 is pre-empted by thread 2 and thread 2 is able to get to the same point (line 33) then G1 will be equal to 2. both threads will assign G2 = 2 and thread 2 will win the race -- thread 1 will loop and begin to spin again.

have i missed something?
SOX after Ten Years: A Multidisciplinary Review
My favorite debugging tool
They All Look Just the Same
I'd figure simply quantizing timestamps with larger step sizes would work better. And sure, you can filter those out, but you can also make it take too long to be useful. You could also perform the attack on yourself and adjust accordingly, although this is not robust since it depends on deatils of each attack.
The Sunday Night Hustle: Your bed is not a desk space
I was with you until the last bit.

There are some folks having a lot of success taking apps running on old versions of centos and running them on later versions, as an example.

To elaborate - Some distros / companies are planning it to be part of their upgrade strategy - i.e, containerize the application, move to <your distro of choice cough rhel 7/atomic cough> while having the userland of the previous release intact.
That would be cool indeed and I hope my comment didn't sound too negative. And you should definitely take a look at Inform (and similar), it's amazing what they can do. I think some interpreters are open source (edit: it seems it's not, I remembered incorrectly).
Yes, task switches unfortunately do not happen at the level of 'C' code but between machine instructions!

Run your compiler -S and save the output, then try to reason through the consequences of a context switch in between every instruction with multiple threads contending for the lock. And have a look at the manual for your CPU to learn about out-of-order execution and cache coherency between multiple cores / cpus.

Some interesting reading on the subject:

https://www.kernel.org/doc/Documentation/memory-barriers.txt

If you want to do this entirely in userspace and you must avoid atomic instructions for some reason consider abstracting out your locking to a separate process and use IPC, first come first serve.
AngularJs with no user JavaScript
I believe Boden uses LXC to mean 'Linux Containers' the theory, not lxc the tool/implementation.

In speaking to him he's very well aware about libcontainer.
Using virtualization technology to actually to abstract away hardware hardware and OS differences? How is that an edge case. Isn't that the raison d'être of virtualization. That fact that host and guest OS kernels happen to match is the edge case then (a nice one too, that can lead to good optimizations).

Now deployment, isolation, repeatable test and dev environments is a bit of a different beast. So LXC works great there.

The point was to avoid the conclusion that KVM is useless now in all cases, throw it away tomorrow and start using LXC.
Google is also working at hiding URLs/sources for Google search results (image search for example)... so it is not only a Chrome experiment
Hi,

lispylol: you can view other's 'public' cycles.

Question to creator: how do I make my cycles public? Have been scrutinising the interface, perhaps not closely enough ;)
How does it defer from a wire transfer?
For real solutions to this problem, see:

http://www.di.ens.fr/~pouzet/cours/systeme/bib/dijkstra.pdf

http://phoenix.goucher.edu/~kelliher/cs42/sep30.html
I have successfully run KVM inside of a container, so there's no reason not to combine them if that makes sense. Or to run a container inside of KVM.

The beauty (to me!) of Docker is that it still applies whether you're talking about any linux-based infrastructure. There are just trade-offs to be made in certain cases (like performance/density for very strict isolation)
I personally think the phusion images are garbage and kind of miss the point.

That being said, running init inside of a container is definitely a supported use case.
Often songs - like poetry - often aren't insightful exactly, but provide a good way of communicating the emotions connected with an experience or concept.

Take Smells like Teen Spirit" (which appears on 6 of the lists linked to above): The lyrics are not particularly insightful (almost deliberately), but it captures the goalessness of disaffected youth like no other song.

Nothing Compares 2U* really is unrequited love.

Then there's U2's One (3 lists) which has lyrics that mean different things to different people, and music that can support multiple interpretations[1].

(Of course, some songs on those lists are just entertaining because they are perfect pop ("Billy Jean", "Like a Virgin") or funny ("Baby got Back")

[1] http://www.pophistorydig.com/?tag=u2-one-song-history
Absolutely agree, but (at least in my mind) Docker with a full OS really is just LXC. Running a single process inside the container is something that genuinely differentiates Docker from other approaches.

It's a powerful idea which to date has been tied to LXC containers, though I think that's a false association: it's just as interesting with KVM or Xen containers.
Of course users whose home screen has been replaced by a Google Now like experience are using web search less. This information is hardly generalizable to users of regular smartphones.
See my comment elsewhere - the intention is to discuss LXC the theory, not the userland 'lxc-start' etc tools. But I agree, it can be confusing.
Good criticism. I saw an opportunity to make a point I've been wanting to make and jumped on it
After successfully implementing a project with React.js + Backbone models and routers, I'm now sure Angular is both unnecessarily complex and limited.

One of the nicest things about React.js is not having to deal with such a layered architecture, you work at the right level of abstraction ("components"), and those components are composable. Some people freak out with JSX but it pays off to finally have a proper GUI pipeline for web apps instead of manipulating the DOM directly, or being limited to directives embedded in HTML.
This is pretty silly.

They give back to the community and even offer free plans that are pretty damn useful.

With amount of growth they have experienced, you should be thankful that they are able to find time for anything at all at this point.
It seems like this is just storing a thread id in some shared variables a few times and double checking that your id "made it" and you win the race. My understanding of why this doesn't work is without atomics or memory barriers, what you read might not reflect what another core has in its cache, and when you write, it might not be immediately visible to others. So while in your thread's view of the world you might have successfully written those 2 words and won the race, it might not matter to the other guy. Though this depends on the consistency model of the CPU. The table here comes to mind: http://en.m.wikipedia.org/wiki/Memory_ordering - my memory is that x86 is generous in how much it lets you get away with this, you might have more trouble running on say, power.
The Angular guys aren't missing the point. I think it's the other way around.

People see the word "Factory" and for some reason assume that it's somehow a Java enterprise bloatware feature. Nevermind that "Factories" Angular are

a) Nothing at all like Factories in Java

b) Something you don't need to use, and most Angular apps likely don't

c) Really useful when you do need them

If AngularJS is too heavyweight for what you're trying to achieve, it's not he right tool for your task. It's like complaining that a forklift isn't a very good hammer.

Angular is used to build thick heavyweight client applications. The sort of thing you might use to build a complete desktop-style application in the browser running in offline mode.

Mind you it's still surprisingly good at smaller applications as well. But if your solution can be solved with a few lines of jQuery, then you don't need Angular.
Apple refined the feature set, and Google ripped them off. Samsung ripped them off more blatantly.

It's not my opinion that Apple invented all those features, though that's the public opinion. It's my opinion that Apple spent a lot of effort and patent filings to refine them, and that's more relevant to the court. And patents are valid for about 20 years, not "forever."

It is not just about touchscreens. Look at the Nokia N97 and the Blackberry Storm to see the competitors' immediate reactions to the iPhone. And look at Windows Phone for a different approach to designing for touch.
That is how C programming was taught in my engineering college and so was Java and even HTML.

There would be a short note table tag or a 10 mark question on what is the difference between Interfaces and Inheritance in Java.
Hi, thanks for checking out the site. When you complete a cycle, you will be presented with the choice to make it public or private. Public will earn you some experience.
KickSat Sprite deployment may not happen
My whole point is that the contemporary understanding that the USSR's economic system was flawed was not apparent to Westerners half a century ago. This is exactly the "I have seen the future" sentiment that I previously referred to. Many Westerners, including Americans, were genuinely afraid that the USSR would come to economically dominate, that they had developed a superior system. The fact that so few people realize that these days is a testament to the enduring success of the Western system.

In the 30s (yes, during the Great Depression), 40s, and 50s, the Soviets achieved rapid economic growth, largely because they were starting from such an economically backward situation (ring any bells when it comes to China?). But when growth on the basis of "catching up" started to plateau, they could make no further progress.
The Game of Hangman, Decision Theory and Delivering Software
To do the same thing using pure shell scripting, you have to write a large number of helper functions to avoid boilerplate. Things like asserting — in an idempotent way — the existence of files (with the right content, the right ownership and mode flags, etc.), services, packages and so on.

Tools like Ansible and Puppet already provide that set of functionality. If you write it yourself, you pretty much end up with something like Ansible, except it's specific only to your use case. Better to focus on commonality.

I'm a Puppet guy myself (although I appreciate the simplicity Ansible can bring to the table), and make extensive use not just of the primitives, but of the ability to bundle primitives as reusable modules. For example, rather than explicitly putting files in /etc/logrotate.d, I define a "logrotate class" and do:

logrotate::rotation {
postgresql:
pattern => "/var/log/postgresql/*.log",
keep_count => 10,
require => Package['postgresql'];
}

However, this is not merely a macro that is expanded in-place. Rather, it's an object which can be referenced (for example, I can have something else which requires that the object Logrotate::Rotation[postgresql] runs first) as well as "inventoried" (I can ask the system about all the log rotations that have been declared, and use that to drive a UI, for example).

The expressiveness and flexibility of tools like Ansible (which must have something similar) and Puppet is best seen in a multi-node server environment, however.
That is an excellent idea. I want to do something where once you complete an exercise, only then can you see how others answered the same one. Kind of like Project Euler if you've ever used that.
SpacePen: A powerful front-end framework from GitHub
Sweet, I'll use your website next time. :-)

Thanks, and as Borat says, "big success"!
If you like the data journalism handbook you might like this list I put together:
http://thedata.directory/resources/
It's bad enough that google makes it impossible to cut-and-paste links from search results (try sending the URL of a pdf you've found using google to a colleague, especially nice if it is longer than the maximum bit displayed as text).

Getting rid of the URL makes users effectively out of touch with 'where' they are on the web and within a website.

A browser is a navigation device, a browser without a sense of location is the digital equivalent of being lost.
> I don't think any of those reasons explain why the Intrade markets were unpopular.

It's hard to say if any of these are the fatal problem with Intrade, but it's not like we'll know until some prediction market does 'take off', and we should at least address the known problems even if they don't look like huge problems.

> I don't think there were any restrictions on customers until after the CFTC charges were filed.

They didn't make it easy on US customers well before CFTC, as I found out first hand. You had to really want to sign up. It was much harder to get my money into Intrade than, say, Bitcoin (and people claim the difficulty of fiat->Bitcoin is a major barrier to Bitcoin adoption, so...)

> I have a hard time believing that counterparty risk was meaningful.

Even if we assume customers were idiots who didn't believe in counterparty risk before, they certainly do now.

> In fact Intrade realized that the only markets people were interested in were sports markets and have focused exclusively on that area since the relaunch.

Or... those are very safe areas legally for Intrade, and that's why they ban other markets?
You seem pretty confident that you are conscious, but I've seen no conclusive evidence. How can a person possibly know if a collection of brain cells produces "consciousness"? What brain cells do is definitely not the same sort of thing as the inner life of my experience.
If you can solve something in jQuery, why are you using Angular? Wrong tool for the job.

If you have an application that otherwise uses Angular, and you have a snippet of jQuery code that you want to use, wrapping it in a directive takes about 30 seconds. Alternatively, if you don't want to write a directive, you can just run the jQuery code directly as if Angular didn't even exist.