skysight-inc/HackerNews huggingface dataset:
My own favourite random() in the wild bug is one that I've come across many many times:

/* Generate a random number 0...5 inclusive */
int r = random() % 6;

The problem is that this results in a bias towards certain values, because the random() return space is probably not a whole multiple of the number you are modding. It's easier if you think what would happen if RAND_MAX were "10". Then the results 0,1,2,3,4 each have two opportunities of being selected for r, but "5" only has one. So 5 is half as likely as any other number. Terrible!

Using float/double random()'s don't always help either, because floating point multiplication has non-uniform errors. Instead, what you really need is:

int random_n(int top) {
if (top <= 0) {
return -1;
}

while(1) {
int r = random(top);
if (r < (RAND_MAX - (RAND_MAX % top))) {
return r;
}
}

return -1;
}

Although it's better to replace random() itself with something that uses real entropy.
Note that I actually said it's not true that there's been no progress.

My point, rather, was that progress has been unevenly distributed so there's a disturbingly large range in practice: it's certainly true that actual experts are not using netstat to detect malware but it's also true that most system administration is not performed by security experts. The same places which waited until this spring to upgrade from Windows XP or where security updates are blocked behind long review processes also tend to be the places where someone learned how to use netstat 20 years ago and doesn't want to learn a new skill.
> cut and past.

I cannot tell if that's a pun or typo..
Thanks for the kind words my friend.

Yes we'd love to get there. Our CEO left the investment management industry precisely for that reason. Said his boss, who managed $6 billion, still typed with 2 fingers. No offense, but probably time to start embracing technology.
Honestly, I think the pirate bay getting busted would be a good thing, as it would probably lead to the creation of more distributed, robust filesharing platforms.

The actual bulk data distribution is already quite P2P; the only remaining centralized part is the part that distributes the magnet hashes.
Long time Mint user for the cash flow/budgeting bits. It works on all of my devices and is always up to date with my accounts for assets, debts, etc... I'm considering a change for my investments which are with a money manager; Betterment, FutureAdvisor and Wealthfront all offer similar portfolio management at a much lower cost.
I thought file sharing was recognized as a religion in Sweden.
SoundCloud’s Valuation Could Top $1.2B with New Fundraising
In digital content, "the fold" has its own meaning (which is, certainly, inspired by the literal fold in newspaper.)

This is one of many digital design that are inspired by terms from print, like "page" (which also is inappropriate for digital if you take the print meaning literally.)

And, anyway, laptop users do fold their computers in half, but that's a completely different thing.
There's one TEDMED talk about chronic disease [1] in particular that has really stuck with me over the years. At about 2:40 the speaker pulls up a graph compiled from WHO Global Burden of Disease data [2] that shows the occurrence of serious acute (usually communicable) and chronic diseases across countries with high (United States), middle (India), and low (Kenya) incomes.

As you would suspect, the United States has significantly fewer acute diseases than India, which in turn has significantly less acute disease than Kenya. BUT for chronic conditions, the numbers (relative to population size) are pretty much the same across the board. The distribution of chronic disease is slightly different depending on wealth (diabetes vs obesity vs malnutrition vs heart/lung disease like cancer vs liver disease from alcohol, etc) but they are almost entirely preventable often with "just" some life style changes (I'm oversimplifying, but the vast majority of the conditions are considered very preventable). With the United States spending nearly a fifth of its GDP on medical care we STILL have just as big a problem with chronic disease as Kenya, a country where the average income is under $10/day.

Preventive medicine is almost definitely its own health risk but when you look at what we're trying to combat and just how intractable the problem is here in the US, let alone globally, it starts to look like a very acceptable risk.

[1] http://www.tedmed.com/talks/show?id=7333

[2] http://www.who.int/topics/global_burden_of_disease/en/
Could anyone care to explain how this works?
I remember seeing you post something about this back in the day (maybe on WF?)

good times :-P
Some of this data is readily available in the user-agent string. The other does require some JS execution and sending the results back though. Check this out: https://valve.github.io/fingerprintjs/
Wow, thank you! It took less than 90 minutes for all 1,000 of Segment's gift cards to be claimed.

You can still buy a gift card here: https://watsi.org/gift-cards. They're a holiday gift that's perfect for everyone and 100% of every gift card funds life-changing healthcare.
It's a shame the report is so partisan. The democrat and republican sides disagree on basic facts, such as whether torture worked in extracting information, and whether that information helped to save lives. Both sides accuse the other of cherry-picking to bolster their cause. Since the primary records are unavailable to us, there's no way to get a more trustworthy opinion on the program. The CIA's behavior is probably pretty horrible, but it's unwise to be very confident in that assessment.

Another interesting fact is that torture may work, or it may not, yet many people don't want torture to work. But think about it for a second: If torture worked, it would be an opportunity to save lives. Torturing one known criminal to extract information that could save dozens (or hundreds) of innocents is unsavory to say the least, but it's better than the alternative. (To reverse the situation, one wouldn't kill dozens of innocents to prevent the torture of a known criminal.) Simply ignoring the issue and saying, "Torture is always wrong," can lead to more death and suffering than thoughtfully considering the issue.

I'm not talking about some hypothetical ticking time bomb scenario. This can actually apply to real life. Consider collateral damage. In war, it is acceptable to accidentally kill innocent people. It is also acceptable to intentionally kill combatants. But torturing combatants to extract information that would reduce collateral damage is unacceptable. It's such a strange instance of moral blindness.

Note that this doesn't mean I would want torture to be legal even if it worked. It seems like there's a good case to be made for keeping torture illegal, since doing so would force a would-be torturer to be sure about the circumstances; so sure that they'd willingly to go to prison to save innocent people.

Edit: So far, both replies are attacking positions I do not endorse. I'm saying make torture illegal even if it works. I'm saying ticking time bomb scenarios are poor justifications for torture. But I'm also saying that torture may save lives in some circumstances. If we're willing to accept the horror of collateral damage, we should also be willing to reduce it using methods as horrific as torture.
Yeah sorry, I meant most of Europe: http://www.laits.utexas.edu/lawdem/unit02/supporting/map_civ...
I don't think it's possible to just "think up" true AI.

I think the easiest method to achieve it, would be to first upload an actual human brain to a computer environment - by slicing a brain into molecule-thin slices, then observing the neural responses of that simulated brain.
You missed the low ambition axis:

(4) Good but insecure (at least in a financial dimension) who seek the safety and anonymity of large corps and

(5) Favor 9-5, low stress, and a steady paycheck
That's not always true. Most ROMS update by first downloading, then flashing the entire rom with the new version. And most OTA updates kill your root if you have it because they reset the entire system partition back to factory state, not just the updated part.
Forex Miner Code Review – How to make $1600 per day trading forex
> A Monte Carlo simulation that always gets the same results isn't going to be too hot.

A Monte Carlo simulation absolutely needs to be able to produce the same numbers every time if you want to have a hope of debugging it. In a release version, yes, sure. But even there, people will still have concerns about replicating other people's results, so being careful with random seeds is important.
Just to be clear, I did not mean 'nitpicky' as an insult, in the same way I don't (always) consider the Dutch tendency to speak our minds even when not asked a bad thing. One of the reasons I like living in different cultures is that they show me different ways to do thing, and I've come to greatly appreciate many of the more 'typical' German things.
Looking for a SDET/Test Engineer at Fiserv working on mobile development. Located in Auckland New Zealand, but our HR team will work with you to sort any visa requirements.

Also looking for any mobile or c# devs.

You can reach me at jamesfarrier@gmail.com

Thanks,
James
Republican Rebuttal to CIA Torture Report [pdf]
My Best Hiring Stunt to Date (2011)
Yes it is, kopimism is a recognized religion. But it is a minority religion treated quite badly.
http://en.wikipedia.org/wiki/Missionary_Church_of_Kopimism
How would you distinguish between e.g. an HTTPS request to a CloudFlare IP for a legitimate blog comment and one for a throwaway blog being used for C&C?
@rayiner

>Oh my god they were quite chilly

And abducted, held without trial, tortured, waterboard, anal raped, threatened, beaten againast a wall, and other things besides. A lot of them while also being totally inoccent (and in any way, without trial).

What exactly have you suffered besides a comfy middle class existance that gives you the moral superiority to laugh at that?

Would you also laugh at jews in Dr. Mengele's cold exposure experiments being "a little chilly"?
is it possible to clone a websites template?
The 8 biggest lies the CIA told about torture
>You're probably too morally outraged by all this to appreciate the humor in the phrasing of that sentence.

How about the humor in sentences about raping?
Posting from a throwaway account since I work on a competing browser.

I think Google needs to check its steps quite carefully when doing things like these. For quite some time they have leveraged their search monopoly (think about their EU search market share) to bring search/browser-type integration features to chrome first. I would say this is abusing a monopoly in one market segment (search in the EU) to attempt to create a monopoly in another segment (browsers in the EU) by continually making sure that Chrome is the browser that works better than other browsers when using Google search services.

Yes, this is innovative, but there is also a concept known as antitrust laws. Another way of bringing this to the market would have been to invite competing browsers to use this and build a credible time plan for a simultaneous launch for all the browsers that wanted to support this.
Holy shit this is infuriating.
Is it normal? I have seen it a bit.

Have I been asked to code for free, at a substantially reduced rate, for equity, and with really strange arrangements? Absolutely. At times I have been asked to do this on a more than weekly basis. Do I ever accept the terms? Absolutely not, never.

Have I started companies and asked people to do this? I have started businesses, I always pay a rate that is fair because I believe the relationships I have with people who sit in my office are important. I would rather my idea fail then see an employee 5 years down the line whispers under his breath "There is that #$%@@#$% who promised me the world and than didn't pay up."

There are substantial ethical, and, maybe more important to some, legal risks to have people work on your start up without being paid. Who owns their work output? If they are not paid, are they covered in the case of physical or emotional harm or accident? What tax liabilities are you under because of their generosity? What tax liabilities are they under for taking deferred payment or an investment in return for real goods or services? The list goes on and on.

Putting on my employee or consultant hat the answer is simple. How do I value my time? If I receive $100/hr from client A as agreed upon in writing, why would client B, an underfunded start up, deserve my time at a lesser rate? Many times I have said to a company who tries this tactic of saying "Can we pay you X amount in Y months?", "No, I take $X per hour, and if you cannot meet these terms, I understand. Please let me know before signing." They sign, they pay, and everyone ends up quite happy.

As I suggest to engineers who I meet, know what your value is and charge for that value. It is engineers who allow start ups to get away with these sorts of practices.
Ah, but that video is four years old.

Here's the shirt-folder: http://youtu.be/Mr7U9pQtwq8

Sure, it sucks at folding shirts quickly, but it's most of the way there. Reducing the amount of human assistance needed is going to be a gradual process for the more complicated tasks, but you can bet it's being worked on.

The core of the technology is already operational, it's just not quite consumer-ready yet.
Congratulations, nice app. Just the UX's from the 90's ;)
The Republican rebuttal: http://www.intelligence.senate.gov/study2014/sscistudy3.pdf

and some commentary about it: http://www.msnbc.com/msnbc/republicans-dismiss-senate-tortur...
Archive.org does caching. A page is pulled from long term slow storage, and cached.
A modern command-line tool for extracting data from tab-separated files
Uber Is Now Bedding Down with Regulators to Screw Over Competitors
Proxies to mirrors.
Thank you!! Yeah I've never used OSM render, it is just the only place I had been able to find discussion about the inaccuracies of the projection. It also exists in all online slippy maps I've used from the latest OpenLayers to the latest Google Maps. Thanks again!
It's a lot like what's called an Overton Window:

http://en.wikipedia.org/wiki/Overton_window
http://jakearchibald.com/2014/offline-cookbook/#putting-it-t... - here I cover the techniques I used to create a very simple timeline-based app, sort-of Twitter-like. AppCache can only do one of those patterns, the one that handles static assets, and of course you open yourself up to appcache's quirks such as master entries.

AppCache can just about handle static assets. Just about. That's not enough for most apps. Look at the patterns in the article and their use-cases.
> Does anyone choose C++ anymore unless it is required by environment/legacy/performance constraints?

At work no. Typical enterprise world using JVM and .NET languages.

For side projects, surely yes!

It is the only language supported across all mobile OS SDKs with full access to the hardware.

If you have control over the codebase, the ability to use C++11/14 is quite comfortable, even in terms of memory management.

Now for the typical enterprise projects, with offshore developers at work I wouldn't use it. I already cry when I look at code written in less powerful languages.
The best free option I've found is to run Ghost, Buster, and Github-pages.

http://talalanwar.com/host-a-ghost-blog-for-free/

You said it's for your company so I would run your own Ghost instance on the companies subdomain and be done with it. Medium can be great for exposure but ultimately your posts will be more valuable on your own domain.
I don't believe I claimed Plagiarism is a legal term, nor is piracy in my view. I said there is a semantic difference and they both are effectively Copyright infringement - which is a legal term.

Depending on your world view and what you do; you can plagiarize and infringe, you can pirate and not break a law. This synopses should help muddle things up nicely
https://www.techdirt.com/articles/20130925/09523724654/diffe...

I do not feel that 'Documentary Realism' gives the film makers a right to lift the text from the original slides verbatim without attribution. Fair use though, I can agree with you.
Twitter should take note of Tumblr usage here.
I'm pretty sure you can actually download the magnet links as an archive, which shouldn't be too big either.
Rails addresses this by interpreting a special _method parameter:

http://api.rubyonrails.org/classes/ActionView/Helpers/FormTa...

That is, a POST containing _method=delete will be interpreted as a DELETE.

It seems faintly silly; if you're exposing an API to the browser, why use methods that you can't use directly and then have to go to the effort of emulating them, when you could just use supported methods directly? Is the use of the proper methods really that important?

But it does work.
do you have an email address I can reach your friend by?
The statin stuff is just bad science. Statins don't have the effect on cholesterol that they are purported to have. They are the product of a time when we still thought that the fat you eat makes you fat. We're beyond that point, but statins are absolutely huge in terms of money.
What an awesome person. I met his sister this year at NHLF - she was pretty rad as well. I'm excited for him to get out of prison and become a leader.
Can implement any communication protocol as long as it's SOAP.
> Imagine, if you will, that your son is taken against his will by say, Iran, because your son has ties to someone who threw a grenade that killed an Iranian. Your son is tortured in much the same way the report states.

It's much worse than that, we'll just flat out kill you with a drone strike, even if you're an American citizen[1][2].

[1]http://www.huffingtonpost.com/2013/04/23/obama-anwar-al-awla...

[2]UPDATE - found the better article: http://www.theatlantic.com/politics/archive/2012/10/how-team...
The parent is right to be skeptical considering the number of lawyers involved in this mess. Torture is obviously illegal so it has more implications than just "enhanced interrogation".
Looks a lot like Red Hat's Project Atomic (http://www.projectatomic.io/)

"An Atomic Host is a lean operating system designed to run Docker containers, built from upstream CentOS, Fedora, or Red Hat Enterprise Linux RPMs. It provides all the benefits of the upstream distribution, plus the ability to perform atomic upgrades and rollbacks"
Hah, that brings back some memories! 2005?! Yes, it must have been around a decade ago now.

It was written in thousands of lines of bash because back then, I had used some random distro that didn't have Python installed out of the box so I became convinced that only bash would be compatible enough. No clue if that perception was actually right - Python would probably have worked well enough. The GUI was in C/GTK. Some of the binary compatibility tools were an unholy mix of bash, C and assembler :)
Computer vision at scale with Hadoop and Storm
What is your source? Both because I have always heard about the "rewards program" and am interested in reading more, and because wherever you got the information that thousands of people were ever sent to Guantanamo Bay is simply wrong [1]. I see a trend of people rehashing things about Guantanamo Bay that they've heard somewhere else and just putting it out there. It doesn't help the progressive agenda of understanding GTMO and closing it, because the information is just plain wrong.

[1] http://www.humanrightsfirst.org/sites/default/files/gtmo-by-...
I wonder how mass usage of AdNauseam could affect this:

http://dhowe.github.io/AdNauseam/

http://www.informationweek.com/software/productivity-collabo...
On my machine RAND_MAX is 2^31-1. So getting the probability wrong in the way you describe means a relative error of one in two billion. That's really quite small for non-critical applications.
Could the magnet links be served as a torrent?
That's believable, but they don't cite a source…
CyanogenMod OTA updates preserve root... because the OTA image contains root access and SuperSU.

So what OTA updates do you mean? If you mean stock Android updates removing root access...then that is exactly the expected behavior. Root is considered a security hazard and not supported by ASOP. As it should be.

I find it hilarious when people who use ROMs complain about how hard it is to modify the OS then complain about lack of security updates in the same thread. Bootloader locks and read-only filesystems are there for a very good reason.
No, the fact that the salary is paid by a US employer has nothing to do with it. The tests for the Forgein Earned Income Exclusion are where your "tax home" is which is determined by your place of physical employment and the number of days per year you spend outside of the US. So long as your tax home is in a foreign country and you spend at least 330 days outside the US you don't pay federal income taxes on your first

This site explains the basics. It most definitely does apply to US contractors.

http://www.hrblock.com/tax-answers/services/jsp/article.jsp?...
Stripe iOS Integration with Swift and Apple Pay
I do like it! Best of luck with the project! :)
I'm wondering whether it's a good idea to pay too much attention to a project early on in its design; whether it can lead to a worse interface/less iteration loops vs. a bunch of smart people working and iterating on an idea in private.
>The saving grace is that we have a country that was able to admit that it did this.

It's mostly able to admit it because nothing will change, that is: such exposes are inconsequential.

If those kind of reports could change things, they wouldn't happen at all.

This would end with a few questions, some pats in the back, and business as usual.
Dion Almaer tweeted a video comparison using a 3g-throttled connection: https://twitter.com/dalmaer/status/538906815010836480
Spare us the snark please.
1. The crimes of others do not excuse your own.

2. There is abundant proof that the US engaged in a deliberate, not occasional, policy of torture, whitewashed as "enhanced interrogation techniques".

3. There is so far no proof that other western nations have recently had a policy of deliberate torture, except for the sad cases where the US creatively outsourced some of its torture needs to Poland and perhaps a few other eastern european countries.
Docker Dev to Prod in Just a Few Easy Steps
Turns out the "definition language" (WSDL) and the presumption that it would be simpler to deal with than just showing people the messages that needed to be placed on the wire... was the broken assumption.

We wanted automagic seriaization and de-serialization and we wanted every language-based construct (linked lists, arrays of structures that contain arrays) to be supported. Different tool vendors built that differently, hence the interop problems.

In REST/JSON, we don't have an IDL. We don't have a JSON Schema (yet! thank god) We generate human-readable documentation containing examples, for the definition. And developers build to those examples. There's nothing - no runtime or static tool - that gets in the way of developers serializing their data into JSON, the way they need to.
The first thing I did as a developer was to write a SOAP wrapper gem for Propertyware's API. It was here that I learned the concept of Pain.
(If I understand your question correctly,) sure, but it would instantly be outdated, because you can't include the torrent you just created.
>Just look at what people were saying a out water boarding - "it's not really torture".

Let's put it this way: unless you're not horrified to have such a procedure happen to you, your wife, child, etc, it IS torture.
Possible a magnet to the magnet bundle?