skysight-inc/HackerNews huggingface dataset:
Top three answers for those who don't want to sign up with Quora:

Dynamic Programming appears to account for a plurality (some estimate up to a third) of contest problems. Of course, DP is also not a single algorithm that you can just learn once and retain, so maybe this doesn't answer your question.

I suppose it also depends on whether you consider data structures in the same category as algorithms. There are certainly some data structures that you should be familiar with if you want to do well in programming competitions. The most important ones are range trees (variously known as interval trees or segment trees) and binary indexed trees (BITs), also known as Fenwick trees. Additionally, many DP algorithms make use of a prefix sum array.

The most essential of the single algorithms I can think of are the following, in no particular order. However, you may be disappointed by how rarely some of these actually appear in contests. Most non-DP problems appear to be of the "ad hoc with data structures" variety, and you simply have to practice in order to get good at them.

(To be clear, again, I list below only algorithms that take a single input set, compute some function of it, and carry no state between inputs. This distinguishes them from data structures, which by definition hold state, and categories of algorithms and algorithmic techniques like DP, which don't have some specific function they compute.)
· Sieve of Eratosthenes, or another prime number sieve
· Depth-first search
· Breadth-first search
· Dijkstra's algorithm
· Floyd--Warshall algorithm
· Either Kruskal's or Prim's algorithm
· Some implementation of topological sorting, such as by using DFS
· Convex hull (I recommend the Monotone Chains algorithm)
· Coordinate compression
· Edmonds--Karp, or another implementation of the Ford--Fulkerson method; or a preflow-push algorithm; or, if you are preparing an ACM codebook, Dinic's algorithm. (Note: Max flow is not allowed to appear on the IOI, but may nevertheless appear on national team-selection contests)
Ask HN: Sharing something very funny from office to end friday?
Hello Everyone

Weekend is coming, I thought the best way to end friday would be to share something funny from regular office talks. We were using a tool (lets say x) for the growth management and suddenly all entries got disappeared for a minute. My collegue said at that time, He nearly had a heart attack and he think the company should insure me so even if app deletes anything. His Insurance money (because he will have a real heart attack) will help the company. I find this very funny. Hope to read some of the funny stories from fellow hackers too.
Ah, that's an excellent differentiating factor I hadn't thought of, thanks.
Great idea! I will buy you app just for your effort...
The Hunter, the Hoaxer, and the Battle Over Bigfoot
And so you're just focusing on breathing? Like you're directing your active thoughts towards thinking those words, and thinking about breathing. Is that correct?
Interesting. I have always thought about the down vote as: I don't like your comment and I want to punish you for it.

You know, there is karma involved. If down votes are supposed to be used the way you describe, people that are intelligent and polite and educated on their answers, but share a different view than the majority here, should not be part of the community. Is that the intent?
Congratulations!

Adding that perspective camera in one week, while running the kickstarter was impressive.

Hopefully you'll get some sleep next week.
I gotta wonder what all those little plastic button-beads are in each photo? Some other spill?
And THIS is how you write a job posting. Explaining the setup and perhaps some of the culture lets potential candidates know right away if that's an environment matching their style. (And it doubles as an interesting article too.)

Disclaimer: satisfied ZenPayroll user here.
I've personally used Erlang in Real Time Bidding scenarios, where soft-real time constraints exist and is on the order of milliseconds.

It's a fine tool for this, too.
Weekend is coming, I thought the best way to end friday would be to share something funny from regular office talks. We were using a tool (lets say x) for the growth management and suddenly all entries got disappeared for a minute. My collegue said at that time, He nearly had a heart attack and he think the company should insure me so even if app deletes anything. His Insurance money (because he will have a real heart attack) will help the company. I find this very funny. Hope to read some of the funny stories from fellow hackers too.
So?

1) There are trade offs, sometimes you trade development time for execution time.

2) Erlang is "fast"/scales, ask whatsapp

3) A lot of people worry about execution but have enough spare CPU cycles to compute the universe.

4) Benchmarks mean nothing, you must figure out what is meaningful to you. You won't compare a ferrari and a minivan? Well, you could, but yet, find that a minivan is more practical for your daily needs.
Second answer:

If you want specific algorithms, my top 10 would be:
· Dijkstra's - depending on the type of contest, you might see basic pathfinding problems, or you might see problems with non-obvious reductions to pathfinding problems. Whenever you have a cost minimization problem with a (reasonably small) finite number of states, an initial state a target state, you can look at it as a pathfinding problem.
· Bellman-Ford is useful for pathfinding when edges may have negative costs. For example if you're navigating a maze with potions which boost health and hazards which lower it, Bellman-Ford would be a great approach.
· Floyd-Warshall is useful for computing all paths. It is sometimes used in problems where you don't need all paths, because it's so easy to implement. It is slower than other pathfinding algorithms though, so whether Floyd-Warshall is an option depends on the graph size.
· Edmonds-Karp for max flow/min cut problems. One common application is bipartite matching problems. For example, given N people, M food items, and a list of each person's food allergies, how many people can you feed?
· The Hungarian algorithm for assignment problems. Similar to the above, but in these problems the edges have weights, and we're maximizing the total weight rather than just the number of matchings.
The sweep line "algorithm" (more of a general approach really) is useful for various geometric problems, like the nearest pair problem. Also useful for a variety of intersection-related problems, like finding intersecting line segments, or conflicting calendar events.
· Graham scan or another convex hull algorithm, for problems such as building a minimal fence to enclose animals.
· An algorithm for finding strongly connected components, such as Tarjan's.
· Prim's algorithm for minimum spanning trees.
· Knuth-Morris-Pratt algorithm for string searching.

Other concepts worth studying, which aren't in the above list because they aren't specific algorithms:
· Memoization/dynamic programming is quite useful. Some problems have obvious DP solutions, while others have very non-obvious ones which take practice to recognize.
· Binary search is useful in many optimization problems, so make sure you're very comfortable implementing it.
· Combinatorial game theory comes up now and then. I recommend Thomas Ferguson's introduction.
· Tries are useful in a variety of text-related problems.
Sleep sounds pretty good :)
"In that case, Erlang might work as a prototyping language."

If you can write reasonably idiomatic Erlang from the get-go (design things in terms of gen_servers and such, instead of single-process monoliths), Erlang is a great prototyping language, because anywhere you send a message and receive something back is a point where you can drop in some other implementation of that particular bit without affecting the system as a whole.

You'll find in practice that the only time you'll be tempted to do that is if something is computationally expensive. Erlang is pretty darned good at reading from and writing to sockets in general.
Anyone knows if these talks were filmed?
Very nicely done. One suggestion I'd make is to have friendlier URLs.
"Any"? Including family? Doesn't your wife or girlfriend constitute a very special category? If not, then then are indeed messed up.
They don't have to break Tors crypto to figure out where hidden services are. They just need to identify which IPs are consistantly connected to the Tor network, and then prod them and see if the hidden service goes offline.

That is one of the reasons why you're absolutely not supposed to run a relay from the same IP that you run a hidden service from. Because your IP is published if you do that.

If I were to run such a service, I would want to make sure that the IP that the hidden service is running from has as little connection to me as possible.

[edit] If it were my full time job to locate Tor hidden services, I'm pretty sure I could make a decent go of it. Certainly for a lot of them. Given the resources the NSA and GCHQ have, I have to believe that they can do a much better job of it.
This is a useful piece of information but I think the OP is asking how it is technically achieved. i.e. how was the database created in the first place.
Mousr is a robotic mouse that reactively plays with cats
After a quick look, Perl 6 still looks like $#%&@ to me. I don't see why anyone would bother.

When Python 3 came around, I thought it was a good idea and that everyone would want to migrate as soon as possible. What we got instead is 3 more parallel installs of language versions. Beside Py-2.7 (which will apparently never go away), you will need Py-3.3, 3.4 AND 3.5 because every project wants a different one. Why would anyone want the same drama with Perl?
Facebook Now Lets You Join the Fight Against Ebola
I wish people would make their websites workable without Javascript.

Is it too much to ask?

Do I really need to open my browser up to Javascript vulnerabilities just to use some website?

Do they really need Javascript to allow a user to select a genre or type in a search field?
Sure its different, and comparing it via the normal means (litres or rpms) won't work because its so different - those means assume a substantially identical engine or they don't work at all.
It's an interesting idea. I think physically shipping a server to a datacenter is precarious. Remember, it is known that your server is hosting a darknet website. You can't really hide this fact. Timing correlations make it possible to figure out which server is doing what. The reason that Tor users are generally safe from this is because they're not constantly connected, and an adversary generally can't cause a client to issue a web request on demand. But a webservice is constantly connected, and any adversary can cause it to issue responses since it's a webservice. Whether it's a timing correlation from a global passive adversary, or it's simply noticing that "silk road is extremely popular and this webserver in this datacenter seems to be hosting a huge amount of Tor traffic," you have to assume that it's known that the location of your server is compromised.

And if you assume that, then it suddenly becomes very, very bad if you've personally shipped a computer to the datacenter, colocation-style. First, clever hardware won't protect you if it's a running box. But beyond that, you can be traced simply by the components that you've assembled. You have to order those components from somewhere. You have to assume the worst: that authorities will take your box using a power adapter that lets them physically remove the computer from the datacenter without turning it off (such things exist), dump an image of your server while it's running (so that encryption keys won't help you), and then dismantle your server and trace the origin of the components. Congratulations: you're caught.

I think the model of "rent a bunch of servers using opsec" is also precarious, but less precarious than relying on hardware protections to save you.
Perl is a fundamentally different approach to language design.

It's almost anti-academic in the approach and more linguistic. It's superficially like any other curly braced language but there was lots of thought put into how statements are constructed and making things easy to humans to write rather than for computers to process. So it features all kinds of implicit actions and context sensitive approaches to the language and how it works. It's also an amalgamation of several preceding tools and ideas, and in that sense is almost an "English" of the programming world.

Perl is almost more of a human language than a programming language, and like any other human language, once you learn it and some dialects it makes all kinds of natural sense. Even if you're away from it for a long time it comes back like a second language does and you're up and running really quick. It feels less like programming and more like you're having a conversation with your computer friend.

Even small things that you get used to in Perl turn into huge pains in other languages, things like having regexes be a literal type (rather than trying to shoehorn the syntax into a string like in almost every other language) makes wanting to use them and using them second nature and really natural. Having a state machine you can type up in a few characters and be a first class citizen of the language is incredibly powerful.

Perl 6 is supposed to take these ideas and expand on them, lots of clever new language constructs and first-class grammars are exciting new promising notions. It'll be like going from the language a child speaks to the language an educated adult uses.

I'm concerned Perl 6 has missed it's window, but there's enough interesting stuff going on in the Perl 5 community and there's some really smart people working on it that I'm hopeful it'll be more than another language curiosity.
> 1) Optimizing for the most common use case

My compiler is most commonly used together with an editor. Still I'm glad it didn't come with an editor built-in :)

> 2) You can create file descriptors not backed by any actual network connection or file on the harddrive

Indeed. It doesn't mean it is the preferred way to do it, from a code-quality or even performance point of view.
Gaming camps for girls will change the face of video games
Tesla Model S scores 5 stars in Euro NCAP crash test
Cool App,

How much will you app? Is it iphone only?
I'm probably naive, but any computer a crack-head customer can find, can not be rocket science for the FBI to find. Right?
It would be hubris to think I would be any good at crime. Basically sounds like a higher stakes version of the movie Bottle Rocket.
You can disagree with current drug laws and desire a change, you can say that the actions the FBI has taken made the situation worse and be correct with that, but you can not blame the FBI for doing so, because they are just doing what they are expected to do given the current laws.
I think it's pixel perfect this way.
You're both right.

Absolutely, Erlang can serve well as a general-purpose language.

But there's no denying that it was designed to solve very costly, very difficult problems, and that remains its strength.
This is so exciting, I wish you all the best. And kudos for live streaming your development progress!
Pangu8 1.2.1 jailbreak released with latest cydia update
Yes, you can, if your goal is massive bloat. If you want to have reasonable performance and scalability, a blocking API (that is to say, at least one OS thread per connection) and loads of IPC syscall overhead is about the worst thing you could do.
Yeah, the default Perl is more of a slang dialect. Lots of implicit assumptions made about you, the language and your job. Once you turn on strict and use some common sense your code reads more like an school essay, but strangely is just about as easy to work in.

Just like real languages have different modes to communicate in, Perl has it's own modes.

I've worked on a couple large-ish Perl codebases too and with some decent code standard found them really easy to work on and extend.
Congratulations! Excellent work and very impressive that you came up with all of that by yourself.

I'd like to ask you a little about how you implemented the engine. What technology is behind it? How many voxels per sec. it is able to render? Things like that...
I focus on where I can feel the breath going, through the entire breath. Once you start paying attention you can notice it flowing through your sinuses or whatever's up there, filling your lungs.
It's definitely a lot faster. I still wouldn't call it fast.

Of course, most apps are I/O bound, objects in the heap are larger than they appear, blah blah blah.
Nope. You need to purchase new (late 2013 or newer) hardware to get it.
A yapc europe talk mentions even more features:

http://act.yapc.eu/ye2014/talk/5704
My regrets as a 46 year old, and advice to others at a crossroad
Yes. It helps prevent your mind wandering. After a while you don't need to focus on the words and without sounding too 'weird' your mind will focus itself. It's a difficult and strange thing to explain. The steps I outlined are how I started and I definitely noticed benefits. I was much less stressed afterwards and that typically lasted for a few hours after just 10 mins meditation.

Edit:

If I remember correctly I watched a few videos on meditation on Zenhabits.net. I liked the approach which was very basic. A lot of the guided meditaiton sites I've tried make it too complicated. If you have a look on zenhabits.net you might find something to help you get started.
The front page suffers from tiny-screen syndrome.

1371px is just slightly more than half my available screen space.

Changed .container, #index-cont, #movies_show .movie-cont to 85% width and no max-width and immediately felt better. Being adaptive/responsive goes both ways.
Since they did not deprecate much (any?) previous APIs yet, you still have that possibility.

They just added a new API that answers the most common use cases in a simple, straightforward, and internally consistent way.
Can you name anything in Python 3.3 or 3.4 that doesn't work flawlessly in 3.5?
This is fantastic. Discovered a movie in about 40 seconds :) I watch a lot of movies so it occasionally gets a bit rough having to dig around for new stuff and movies I've missed. Went straight for the SciFi and found a Korean film "Snowpiercer" I had never heard of, then saw the list of related movies down below. Great stuff, if they add an "Anime" films category I'd be in heaven.
Mayan Civilization Math
I wonder how hard it is to cause a very spiky, targeted temporary network outage (DDoS, etc) and use it to correlate with which Dark web sites relies on which physical network. With enough random events, it's probably possible to pin down the location, unless you have more than a host or move around a bit.
Is it that much?:) Everybody is on Rails. :( Hello from a Django remote dev in EU.
The constant silent failure to either send or receive texts. I can send my father textsecure messages but any he sends to me disappear in the ether somewhere
It's an open question whether Tor has been compromised to the point that it's now trivial for authorities to locate where darknet websites are hosted. I'm simply making the observation that if your opsec is good enough, you shouldn't need Tor's hidden webservice capability to protect you. You could simply run your website as a standard .com website, except for the fact that authorities can take the .com domain from you.

Or, put another way, if you're relying on Tor's hidden webservice capability as your sole defense, then you're in a bad position.
The same argument is better directed at drug prohibition writ large, and seems intellectually incoherent when focused selectively on individual enforcement actions.

Too, there's something galling about the idea of militating for forbearance for the drug market that serves primarily the wealthiest actors. Before we turn a blind eye to what are in fact gigantic organized criminal conspiracies operated by the kinds of people who will happily slap $70,000 on the barrel for a vanity electric car, maybe we could take a hard look at sentencing laws and early release programs.

Finally: it's an easy sleight of hand trick to suggest that the "darknet" traffic solely in substances, as if allowing them to operate unimpeded would have only the effect of getting some of the drug trade off the street.
If this is true, I'm incredibly excited. Perl is like a girl I used to love, broke up with, but never got over. I'm eager to start hacking on Perl 6 code, but don't want to put the time in dealing with preproduction versions of the language.

Very exciting.
Cool ad hominem, bro.
Second that question. In fact, I'd be happy for a not-so-cheap one (up to $100). Do ECC smartcards compatible with GPG2.1 exist?
As a statement, it is meaningless.
roughly one billion voxels per second on a single GTX 780 (seems crazy, but that is the count, you can see in some screenshots its usually generating around 10s to hundreds of billions of voxels within the first minutes of running) - [EDIT] also I should note that in many cases it super samples voxels up to 4 times or more, or 64 base voxels per result voxel (4x4x4). These voxels are stored in 2D projections of the chunks as rendertargets/bitmaps in iso mode, and their surface area is meshed on the CPU in perspective mode.

Stats are for isometric mode. Have not measured it in the new perspective mode that I am demoing now. Right now with perspective, I am using polygons but could implement raytracing. Not sure what the limit on polys will be but right now it easily does over 60 FPS and performance can be greatly improved with volumetric mipmapping of the chunks (i.e. less detail as chunks are further away).
> 2) Erlang is "fast"/scales, ask whatsapp

But whatsapp is not a latency-critical application.
I know this is ever so slightly off topic, but is Groovy in popular use these days? I seem to see it mentioned quite a lot recently.

If so, what for? General scripting tasks?
GOP Pierces Democratic Monopoly on Technology, Targeting, and Voter Mobilization
Down voting is not for disagreeing, read the guidelines for HN. If you disagree, provide a comment as to why.

Down voting is for completely irrelevant comments, inappropriate comments, etc...

[EDIT] To be clear, I did not downvote you and I disagree with the down votes on your comment here, even though it's off-topic it's important to acculturate people that are accustomed to "downvoting for disagreeing". Which is why I'm commenting.
Why are those who follow immoral laws not accountable?
Is there a particular book/biography on Shannon you'd recommend? I've not found anything that looked particularly definitive.
Thanks, it's iPad-only actually. iPhone will come in an update. We had to drop the iPhone version for 1.0 as we didn't have enough time.

It will be free to download, with In App Purchases. The main purchase will be a PRO upgrade, which will include all the instruments and voice filters.
Python, now with 4 ways to do it!

Now on a more serious note, the perl community has always had a goal of backwards compatibility. When was the last time you heard someone having to update their perl5 interpreter to get something to work? Perl6 will be similar I assume, it can even in a limited way run perl5 code.

I've stuck with perl through the years just because of this. So you use perl to avoid those same issues you speak of.
I focus on the sensation of the air moving through my nostrils. That is all.

If my attention wanders from this sensation, when I notice the wandering, I just bring my attention back to the sensation of air moving through my nostrils. I try not to berate myself about the lack of attention. I try not to see it as some kind of failure, and just bring my attention back.

I've noticed myself getting better at this with time, and it's really helped me get through boring or frustrating little things like waiting in line. It gives me something to do and helps me calm myself.

I think I am calmer overall because of this technique, and find myself using it whenever I get frustrated or upset at anything and it really helps.