US cybercrime laws being used to target security researchers - <AUTHOR> http://www.theguardian.com/technology/2014/may/29/us-cybercrime-laws-security-researchers <comment><USER2> Note that this concerns the subset of security research that involves actively talking to computer systems owned by other people, presumably in production, on the public Internet.

Most security research does not in fact work this way. Consider, for instance, virtually any memory corruption vulnerability; while it was once straightforward (in the 90s) to work out an exploit "blind", today, researchers virtually always have their targets "up on blocks", connected to specialized debugging tools.

I am a little surprised that we are only now hearing about high-profile researchers getting dinged for actively scanning for actual vulnerabilities in other people's deployed systems. It has pretty much always been unlawful to do that.†

(These are descriptive comments, not normative ones. My take on unauthorized testing of systems in production is complicated, but does not mirror that of the CFAA).

It's for this reason that you should be especially appreciative of firms, like Google and Facebook, that post public bug bounties and research pages --- those firms are essentially granting permission for anonymous researchers to test their systems. They don't have to do that. Without those notices, they have the force of law available to prevent people from conducting those tests.

(Background, for what it's worth: full time vulnerability researcher, started in '94.)

† _Caveat: it does depend on the vulnerability you 're testing for. There are a number of flaws you could test for that would be very difficult to make a case out of. But testing deployed systems without authorization is always risky._

<comment><USER3> _"...testing deployed systems without authorization is always risky..."_

While what you describe may be the sad reality, it makes zero sense. If a legit researcher, 'specially one that's being transparent about it, researches any domestic system, then that's got to be better than the Iranians, Russians or Chinese doing it (which they do anyway).

But hey, what do we know anyway. There's probably some benefit that makes it preferable for a foreign party to uncover our vulnerabilities without our knowledge.

<comment><USER4> How would you feel if I broke into your place of business, made a list of all of the things you were doing that were out of compliance with federal and state laws and regulations, then left you my card and offered to let you hire me to do legal compliance work for you?

<comment><USER5> "Broke in" rather presupposes the point.

If we're analogizing, an exterminator seeing rat droppings in your restaurant and offering to solve your problem rather than letting the department of health deal with it, is a slightly more realistic example.

<comment><USER6> Taking that a step further: it is like an exterminator going around different of restaurants, then crawling under customer's tables while they are eating, saying, "Don't mind me, just looking from rat droppings."

A more legit exterminator would agree to come past while the customers were not there.

</comment></comment></comment></comment></comment><comment><USER7> I think this article is misleading to British English readers.

> _HD Moore, creator of the ethical hacking tool Metasploit and chief research > officer of security consultancy Rapid7, told the Guardian he had been warned > by US law enforcement last year over a scanning project called Critical.IO, > which he started in 2012._

British might confuse "warning" for what's known in Britain as a "police caution", which is a extra-judicial criminal prosecution, judged summarily by police, and is also referred to as a "formal warning". Such warnings become part of their criminal record in the UK and effect things like employment, as they are in effect a criminal conviction (as I understand it, although the UK describes them as "not a criminal conviction but an admission of guilt [after being accused by the police]", which I view as an irrelevant distinction). There is no such system under federal law in the United States. A UK reader might rationally assume "police cautions" are just called "police warnings" or "US law enforcement warnings" in the US. Police cautions are not something most people in the US know about, and would probably be outraged to know of their existence. (In effect, the police say you admitted to a crime, so they go around telling everyone who asks that you're a criminal. Such as potential employers and landlords.)

At least, to me, that's the implication of the statement.

<comment><USER8>
      > ...judged summarily by police...

Wikipedia claims [1] that the offender can't be summarily judged by the police because they must agree to be cautioned:

      > In order to safeguard the offender's interests, the
      > following conditions must be met before a caution can be
      > administered:
      >   * there must be evidence of guilt sufficient to give
      >     a realistic prospect of conviction;
      >   * the offender must admit the offence;
      >   * the offender must understand the significance of a
      >     caution and give informed consent to being
      >     cautioned.

Did you mean something else when you wrote "summarily judged?" Or does Wikipedia have this wrong?

[1] [http://en.wikipedia.org/wiki/Police_caution#Circumstances_fo...](http://en.wikipedia.org/wiki/Police_caution#Circumstances_for_use)

<comment><USER7> Only if you think a guilty plea (in a court of law) doesn't result in a summary judgement because the offender agreed to it.

</comment></comment></comment><comment><USER9> A fundamental difference between online "property" and physical property is that you can never fully protect physical property. Build a stronger wall and someone can use a bigger bulldozer to break it. But build a secure website and you might find that it doesn't get hacked no matter the resources of the hacker. If it does, you have plans to limit the effects.

I wonder if people are so busy rushing to do things online they don't want to pay the cost of strong security, so they let themselves be vulnerable and need laws to protect them. As a few people have said, foreign government hackers aren't bound by such laws and even they can't get in to many sites.

If we stop seeing hackers as guilty people to blame, and think of them as an unavoidable natural presence on the internet, just like data corruption or power failures, then we won't need laws, instead we'll need safety standards and licenses for IT workers just as we do for, say gas plumbers.

Every day, spammers "hack" my web forum by solving the captcha. I don't want to find them and send them to prison. I want to build better defenses to prevent them doing it.

</comment><comment><USER10> I disagree with people who are drawing direct analogies between someone breaking into your property to test its security and cyber security pen- testing. To me, it's more like giving your money to a bank for safe keeping with the understanding they will protect it, and then wanting to test they are actually fulfilling their promise (e.g. by going to the bank and checking they have solid thick walls, and that entry to the vault is guarded properly). Even that's not a direct analogy, as you'll likely be compensated if the bank loses your money, but you'll rarely be compensated when your personal information is disclosed. I also think there are some interesting questions raised by cloud computing. What if I were to deploy a purposefully insecure honeypot VM or application to the cloud, and an attacker managed to use that to mount an attack on other applications?

<comment><USER7> There seems to be a fundamental disagreement about the correct analogy.

Is it akin to going to a bank during normal business hours and using lawful powers of observation, i.e., implicitly authorized? Or is akin to breaking into the bank after its closed, or otherwise violating some implicit lack of authorization, e.g., going somewhere off-limits, such as trying to secretly enter the vault?

Because I think you'll recognize the inherit danger of allowing people to willy-nilly try and break into banks to "test they are actually fulfilling their promise".

</comment></comment><comment><USER11> Call your congress critter, form a PAC, and elected one of your own. If you are in a gerrymandered district, join the party that controls that district, and primary the congress critter out.

<comment><USER7> Take your rational thinking elsewhere. This is the Internet.

</comment></comment><comment><USER12> Monied interests want you to play in their safe playground without rocking the boat, the legal and technical enforcement is closing in. Slowly, but the ratchet only turns one direction. I worry that the only reason it hasn't closed in entirely is that smart people exploring is more beneficial to business than not. For now.

Over the last few weeks I've been wondering when the scale flips and general purpose computing will die outright. Things that were once considered forgone conclusions about tech are turning out to be accidents of the fact adoption starts with individuals. How long can tech empowering people continue to outrun the oldschool powers using tech to empower themselves?

<comment><USER2> This is both a comment on vulnerability research and a credible System Of A Down song lyric.

<comment><USER12> Yeah, it felt kinda trite writing it. I just haven't found a way to articulate the idea without asking myself "Oh, so you're still a teenager getting stoned every day thinking you have thoughts about things, hows that working out for you?" Edit: Maybe I should just lean into it and write a phrack article. I'm sorry, that's a low blow, I enjoyed phrack even when the writing style wasn't my speed.

<comment><USER2> I'll just note that the biggest "moneyed interests" in the technology industry have more or less waived most of their ammunition to stop research under the CFAA by posting public bug bounties. Not only have they made it much harder to sue researchers, but they also pay strangers to do it.

<comment><USER13> It makes me wonder who actually likes the CFAA the way it is. Does anybody? I don't see how it's helping anybody. Most of the actually malicious computer intrusions come from outside of U.S. jurisdiction. It's like trying to reduce child labor in China by increasing the breadth of the offense and severity of the penalties in Texas. The next thing you know nothing has changed in China but a father in Texas is facing felony charges for having his son stock shelves at the family business.

Who would actually oppose fixing that? Is it purely a lack of understanding the issue on the part of legislators?

<comment><USER2> The CFAA exists because during the 1980s, there was a concern that no existing statute would deter purely malicious attacks on systems, or any other attack that didn't fit the narrow definition of wire fraud.

I actually do not have a problem with the CFAA's statutory prohibitions on unauthorized access. They seem eminently sensible to me. Don't mess with systems that don't belong to you.

I do think the CFAA has a grave and dangerous flaw: I think its sentencing makes absolutely no sense. I generally do not believe that computer crimes should have sentences that scale with the iterator in a "for()" loop. In the cases where sentences could reasonable scale along with the magnitude of the attack, the meaningful scaling factor should (and I think typically does, in a sane reading of the law) come from some other crime charged along with CFAA.

<comment><USER13> I agree that significantly reducing the penalties under the CFAA would mitigate almost all of the damage it causes, but I don't see how that makes the language any better. It just limits the damage.

"Don't mess with systems that don't belong to you" worked much better in 1980 when typical computers cost a million dollars and were only expected to be used by the employees of the bank or government that owned them, because in that context you know you're authorized when you file a W2 and are issued a security badge.

Once you put systems on the internet for access by the general public it changes everything. "Mess with systems that don't belong to you" is practically the definition of The Cloud. The defining question is no longer who is authorized, because everybody is authorized, so the question becomes what everybody is authorized to do.

The problem is that nobody has any idea what that means in practice. All we can do is make some wild guesses -- maybe SQL injection against random servers of unsuspecting third parties is unauthorized access whereas typing "google.com" into a web browser without prior written permission from Google, Inc. is not. But what about changing your useragent string to Googlebot? What if that will bypass a paywall? What if that will bypass a paywall, but you're a web spider like the real Googlebot? What if you demonstrate a buffer overrun against the web host you use in order to prove their breach of a contract to keep the server patched? Can you charge a journalist for reading a company's internal documents when the company made its intranet server accessible to the internet without any authentication?

The answers to these questions depend primarily on which judge is deciding the case. Which is ridiculous, and the hallmark of a bad piece of legislation.

<comment><USER14> Well, the Weev case showed that accessing unsecured data that doesn't belong to you is punishable under the law.

He was released on appeal over a jurisdictional issue, not a statue or misapplication of the law.

<comment><USER13> > He was released on appeal over a jurisdictional issue, not a statue or > misapplication of the law.

This is actually why we _don 't_ know anything from that case. District court rulings aren't binding on other courts and the appellate court apparently threw out the case without ruling on the CFAA, so there was no precedent created either way.

But if the appellate court had ruled the same way as the district court and created _that_ precedent, I don't think you could reasonably describe that as an improvement in the CFAA situation.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> this is dumb on many layers - threatening white hat who could be held accountable but could be hired to do further audit; failing to come to grips that if you are insecure enough to threaten someone, you know - internet will find out that you rather than fixing holes in your system rather use expensive lawyers to intimidate people who on the whole trying to a good thing for you.

The whole thing about unauthorized access - not sure about. If you get burglarized and live worse part of town - because you did not lock your front door - is this you fault or criminal's? Ultimately buck stops with you, you would look very stupid arguing that a stranger walked off the street and pinched your laptop, better yet, if you leave your laptop on your front lawn.

<comment><USER7> It in no way diminishes the effect of a crime if a person does not lock their front door. It is not the victim's fault if they did not install bulletproof glass and employ a security guard. If you think differently you have a twisted outlook on life, a sort of might-makes-right view of righteousness.

Such rationale is the rationale of a lowlife. "The front door was unlocked so its their fault I stole from them." "If they didn't want me to steal their lawnchair, they shouldn't have left it unchained on their porch." Nothing is inexcusable with that line of thinking. "If she didn't want to get raped, she shouldn't have been all alone in the middle of the night in a dark alleyway." "If he didn't want to get brutally assaulted, he shouldn't have left such a stupid comment on HN."

<comment><USER16> Agreed. You don't get a pass for breaking into someone's house just because you say you weren't there to cause any harm. Yes, it's good to be pragmatic and understand that there's always something the owner of the house could have done to help prevent the break in -- close the door, lock them, get locks that are harder to pick, install security cameras, etc. etc. -- but the person breaking into your house is still wrong for doing so, even if they claim they just wanted to tell you about the weaknesses of your house's security. I don't see any reason the same reasoning shouldn't apply to digital property.

<comment><USER17> I think what makes it tricky is that the systems are automated and intent and authorization aren't so clear.

We never call up the owner of a web server and ask them for permission to browse their site. We just connect to port 80 or 443 and go to town. This is universally accepted as authorized use.

Now, say you're running a vulnerable sshd such that if you send just the right bytes, it'll log you in as root without the password. I imagine most will say that this is unauthorized use.

But what's the difference really? In both cases, you're asking the server to do something, and then it does it. In the real world, we have various things to look for. Private dwellings are off limits without an invitation. Elsewhere, a lock means you don't go in, even if it would be trivial to defeat. Or just a sign that says you should stay out. It's not so clear with computers.

People have been convicted of a crime for taking a public URL and chopping off the last component and getting a directory listing from the server. To one side, the fact that you had to edit the URL and the fact that the directory listing wasn't what the rest of the site was like was enough to establish that as "unauthorized". To the other side, the guy just asked the server, "Can I have what's located here?" And the server replied, "Yep, sure, here you go."

A few weeks ago, there was a story here about a blackjack player who cheated a casino out of a bunch of money. He asked for a dealer who spoke Mandarin. His confederate then asked the dealer in Mandarin to turn certain cards upside down for luck. Normally this would be fine, but the cards at this particular casino weren't quite symmetric on the back, so they could tell them apart. The request would be suspicious, but they used a language the bosses couldn't understand, so they didn't realize what was going on.

In the end, the casino sued the guy for hefty damages. And yet all he did was ask and then receive what he asked.

In many ways, servers are like that dealer. You talk to it in a weird language that the owner can't understand (or he can, but he doesn't listen in on everything) and sometimes you can ask it for something the owner would refuse, but the server/dealer says yes.

So while it's clear that walking off with somebody's laptop just because they left the front door open is wrong, it's much less clear to me where you draw the line with networked computers, and it doesn't look like others have a particularly clear idea either. Given that fundamental lack of clarity, I don't think it's completely unreasonable to characterize these guys as locating spots where access _is_ authorized (and thus legal) but shouldn't be, rather than locating spots where unauthorized access can be gained.

<comment><USER7> The difference between lawfully entering a 7-11 and trespass is just as you describe the situation with a server. Authorization can be implied, and "unauthorization" can be trivial.

The real problem is that a lock on a door is more obvious than a URL scheme. The government is saying that entering a 7-11 that is unlocked, but walking in backwards, is criminal trespass because that's not what the 7-11 intended for the customer to do. That's nonsense. Implicit authorization in physical property is just so much more straightforward, and the government is trying to maliciously take advantage of the lack of common sense on what is unauthorized, helped along by a Congress that willfully authorizes such action.

And I like your server dealer analogy. The question is whether or not a computer is an agent of its owner and whether its decisions, right or wrong, can be relied upon in business dealings as the actions of its owner.

So what is the digital equivalent of a lock on a door? Must the law explicitly say a lock on a door signifies lack of authorization to enter? Is walking into a 7-11 store backwards implicitly unauthorized?</comment></comment></comment></comment></comment>


A Tale of Two Ships [pdf] - <AUTHOR> http://thorconpower.com/docs/two_ships.pdf <comment><USER2> In ~2009 I worked with the engineering manager for this class of ship. Can confirm it was chaotic. Not in the sense that we didn't know what we were doing, but in the sense that every other week some crazy issue would come up.

At one point I had to inventory every... single... weld... on the ship because we questioned their quality.

At another time (2007), a diesel engine en route to the ship fell off a truck and crushed a car, barely missing a woman who was sleeping in the back. Nothing to do with the ship's quality, but imagine getting that news while already putting out so many fires.

On the bright side, I got to be onboard one of these ships during a multi-day sea trial, which was a lot of fun.

With all that said... It is completely unhelpful to compare the cost of a military ship to a commercial ship. The commercial ships are very simple and cookie-cutter[1], unlike military ships that are almost always new designs and involve complex, integrated systems such as communication, defense, hospitals, refueling, etc, etc.

[1] I wrote about this just last week: [https://www.gkogan.co/blog/simple- systems/](https://www.gkogan.co/blog/simple-systems/)

<comment><USER3> _The commercial ships are very simple and cookie-cutter[1], unlike military ships that are almost always new designs and involve complex, integrated systems such as communication, defense, hospitals, refueling, etc, etc._

So, subsequent hull numbers for San Antonio class ended up being cheaper than 100% over budget? Likewise, is it customary for STX or Chantiers de l'Atlantique or Fincanterei to have to double-check the status of _every single weld_ in ship they've delivered, or are the owners of cruise lines tolerant of massive cost overruns && late delivery?

<comment><USER2> Generally, the first ship of any class suffers the most issues. Similar to the first version of any major OS/software release. I don't remember the per-ship costs off-hand but I'd be surprised if they were higher than the first.

Unfortunately the Navy doesn't have much choice in who builds their ships. They _must_ be built in the US, and there are very few capable shipbuilders still left in this country. It's a terrible business to be in, so there's no incentive for companies to jump into the market because the margins are razor- thin. In fact, Northrop Grumman got _out_ of the market a few years ago ([http://investor.northropgrumman.com/news-releases/news- relea...](http://investor.northropgrumman.com/news-releases/news-release- details/northrop-grumman-board-approves-spin-huntington-ingalls)).

(As an aside, cruise ships are still cookie-cutter compared to military ships.)

To borrow a quote from Churchill, "[the current ship procurement process] is the worst form of [procurement], except for all those others that have been tried."

<comment><USER3> Cruise ships are cookie-cutter designs relative to military ships due to...more ships per class (model)? Lack of armament?

They are still made of steel, are welded/riveted together in modules, and must be watertight. Is the knowledge of how to properly weld a hull-section for a commercial ship utterly nontransferable to military work?

<comment><USER2> One of them is a war machine made by the world's richest country to defeat the war machines of other very rich countries.

The other is a floating hotel.

<comment><USER4> Does a machine's purpose change how the welding for that machine is done?

<comment><USER5> Yes.

I learned a couple of afternoon's worth of welding (TIG and MIG, with a dash of spot) and looked at some books regarding it. I realized that I was staring into a piece of craft that would take years to actually master the nuances of, if I were even capable of it.

Very much, _yes_. Yes because of the probably different steels in a cruise ship versus a battleship, yes because of lifetime expectancies, yes because of stresses expected, yes because of inspection schedules. I probably don't have even a good enough sense of what is required to come up with half of where the differences would lie.

</comment></comment></comment></comment></comment></comment></comment><comment><USER6> As someone who has worked in both commercial ship and U.S. defense ship design and construction for over 20 years, this is one of the most absurd and uninformed write-ups I've ever seen.

VLCC's (an example of a commercial ship or "black hulls") are designed to minimize cost. They use the cheapest steel, burn the cheapest fuel - it's basically a metal bucket with a motor. LPD's (a military vessel (more specifically an amphib) or "grey hull") is constructed of higher end materials to protect itself and it's crew in peace time and it war.

Just to give you an example of where some of that cost comes from - LPD's have flight decks with night vision compatible visual landing aids so pilots can land at night concurrent with LCACs bing loaded into the well deck. The flight deck can handle the intense structural heat loading of V-22 aircraft. They have massive hangars to store and maintain aircraft, with precision gantry cranes to do delicate aircraft parts replacement aboard the ship. There is an ASSIST RAST track that does not deteriorate over time and jeopardize heavy weather aircraft landings. There is a state of the art help control station... ALL OF THIS is shock qualified to survive blasts.

The list goes on and on - combat systems, command and control, freshwater generation and sewage systems for a massive crew (compared to a ~20 person merchant ship), a propulsion and steering system with much higher installed power and power density than anything anyone would put on a commercial ship due to stringent speed and maneuvering requirements.

All of this is very difficult to integrate into a design and equally difficult to build.

If you think you're going to design and build a grey hull at the same displacement cost (steel weight) as a grey hull, you are grossly mistaken. You're comparing a custom Ferrari to a bare bones van and saying "hey, this can weighs more and costs way less. Gee, I need to write a paper to let everyone know that Ferraris are way over priced."

Ding dong.

<comment><USER7> I don't think anyone expects price parity -- but I'd expect at least basic features to work? I don't think anyone would complain if flight deck failed, or new combat systems failed to perform to spec. Instead, report mentions what looks like basic features -- "deficiencies [..] major enough [to] compromise watertight integrity"? "Could not move under own power"?

When one is paying for a Ferarri that's a lot of money.. but at least when the vehicle arrives, it can move under its own power and does not break down 2 month after.

<comment><USER6> > I don't think anyone expects price parity -- but I'd expect at least basic > features to work?

I only worked on the LPD platform for a brief period of time, but as anyone in industry knows, the LPD-17 Class does indeed "work" \- far above and beyond the basic propulsion and maneuvering.

>I don't think anyone would complain if flight deck failed, or new combat systems failed to perform to spec.

Tell that to the family of the sailor who was crushed by a rotating gun turret while checking his phone because an audible alarm failed to sound.

Tell that to the crew of the adjacent ship during a training excersize when the gun barrel flips 180 degrees due to an erroneous sign-flip in the software.

Tell that to the tax payers who have to pay for new flight deck non-skid and deck repair after the V-22 exhaust burns the old non-skid off and warps the deck steel (hopefully the FOD from the nonskid didn't get ingested into the aircraft intakes and cause a crash killing the crew)

It's these kinds of uninformed statements that are dangerous to the very people trying to defend their country because average citizens don't take the time (and honestly don't have the time) to look into the true reason for defense costs. Instead they get their information from non-peer-reviewed papers by authors who make horrendous summations on topics they know nothing about.

Yes, spending needs to be monitored and checked thrice, but the truth is much more complex than can be summed up two pages (not that this write-up even scratched the surface of the truth).

This write-up is more than ignorant, it's dangerous because is spreads easy to digest and believe falsehoods that seep into the minds of the public. It may as well have been written by Trump himself (I'm a patriot and respect the POTUS office, but I still think the person in office is horrifying, even if he does want to increase the naval fleet size, which is needed to protect the country).

<comment><USER8> And who should we tell when the hull fails its most basic function (to keep water outside the ship)?

Attempting to repeatedly change the subject by talking about night-vision compatible this-or-that and various gun turret failures only makes your argument look weak. Don't assume that we're stupid just because we aren't actively serving in the military.

> This write-up is more than ignorant, it's dangerous because is spreads easy > to digest and believe falsehoods that seep into the minds of the public.

Ok, I'm open to persuasion. Can you identify one or two falsehoods in the pdf that is the subject of this thread?

Thus far, I see a lot of accounts attempting to change the subject, a lot of complaining that the author is unfair, and insinuations that we civvies are too stupid to understand such complex military issues. But no actual "The author said X, and here's a link to show he's wrong."

That makes me think the author probably isn't wrong.

<comment><USER9> "I am quite confident the price would come in under 50 million dollars, quite possibly well-under."

The outfitting on a LPD and any other Navy vessel is the majority of the cost. There is over 50m USD worth of radar processing equipment in a single space on an LPD. Chocks, non-skid, RAST, extensive welding well beyond a VLCC, and more. The alignment work alone on the combat systems equipment, i.e. directors, CIWS, nulka, SRBOC, slq-32, spq-9b, HGHS, DTS, etc., is over 500k USD. That's just ALIGNING the foundations and equipment. It's not the actual equipment or foundations. The NOMEX panels in every space is incredibly expensive. That's something you would never find on a VLCC. Even if you used non-mil-spec cables you'd have miles and miles and miles more cable on a LPD than a VLCC.

The article is correct. You could build a ship to carry 700 marines, helicopters, and support vehicles for much cheaper. You would never be able to have it move with the speed of a LPD, have the combat systems equipment outfitted, and you'd never have it with any level of defense.

I have been on this exact ship many, many times. I previously commented that it just left BAE NSR within the last 6 months. It just finished sea trials at NAVSTA NFK. The LPD-class has been riddled with problems, but it's a totally unfair to compare it to a basic "off-the-shelf" VLCC.

I'm surprised to see so many naval architects and engineers in this thread. You have to remember that none of us wake up every day to do a poor job. These ships are a miracle of modern engineering.

</comment></comment></comment></comment></comment><comment><USER10> Just think, this was a "successful" project. If you think _this_ sounds like a boondoggle, look at the F-35, the Littoral Combat Ship, the Zumwalt class, or the Gerald E. Ford.

The disaster described in this essay is the proverbial good old days. DoD procurement has gotten _worse_ since then.

</comment><comment><USER11> >If the job of building a 22 knot, 25,000 ton ship capable of carrying 700 marines a couple of helicopters and a couple of air cushion vehicles were put out for competitive bid to the the world shipyards, I am quite confident the price would come in under 50 million dollars, quite possibly well-under. And the ships would perform per spec. >In some situations, the difference between what it should cost and what it did cost can be a factor of 30.

... And that's the end of the article. I'm not saying the author is wrong or makes any dubious claims, but I really wish he would have explored his alternative more thoroughly. It's quite an easy assertion to make, that US military acquisitions are rife with inefficiencies, but solving that problem is much harder.

<comment><USER12> > It's quite an easy assertion to make, that US military acquisitions are rife > with inefficiencies, but solving that problem is much harder.

My favorite example of this was the US Army's decision to use the ACU design pattern. The only thing it blends in with is Gramma's floral couch.

In terms of ships and other equipment, having a commercial manufacturer step into the military space would be like asking Ford or GMC to make Bradley Fighting Vehicles; they don't have the know-how for combat ready manufacturing. The systems in any combat vehicle are an order of magnitude more complex than commercial offerings in terms of design, verification, and manufacturing.

Part of this is the military requirement for 3rd party integrations. The BFV is manufactured by BAE Systems, but the turret optics/electronics package is Raytheon.

An engineering firm I'm familiar with recently got the contract for part of the M1 Abrams tier 4 (?not sure?) upgrades and has to meet integration requirements of existing hardware/electronics and new hardware/electronics other bid winners are contributing.

I would argue that, aside from the run-of-the-mill pocket lining (see ACU design selection), the acquisition process for military equipment is _necessarily_ inefficient.

<comment><USER3> _In terms of ships and other equipment, having a commercial manufacturer step into the military space would be like asking Ford or GMC to make Bradley Fighting Vehicles; they don 't have the know-how for combat ready manufacturing. The systems in any combat vehicle are an order of magnitude more complex than commercial offerings in terms of design, verification, and manufacturing._

Strangely enough, seventy years ago commercial manufacturers ...GM, Ford, Chrysler, Food Machinery Corp(!), General Mills(!!), Western Electric etc. had the know-how for combat-ready manufacturing...what changed?

<comment><USER12> > what changed?

Complexity and integration requirements. Tanks 70 years ago were not as complex as our current heavy armor by several orders of magnitude.

=== EDIT ===

To clarify: the complexity arises from electronics and electro-mechanical assemblies, the chemistry/metallurgy/materials science from armor/chassis, engine complexity (M1 has a jet turbine), and so on. We have a depth of advancement that is as complex at the knowledge end as it is at the application end.

<comment><USER3> 70 years ago, cars weren't as complicated as tanks were. Do you think that automotive tech has stood still relative to military technology?

<comment><USER13> All of the apologist replies are based on the problem of overoptimizing. Yes, if you pay 100x as much, you can always get something 10% better. Is it worth it? Well, it is 10% better. Depends.

For our military since the 70s, we have not fought a major power, and the main incentives are to keep the contractor money flowing and the body bag count down. So, the system is working to deliver what it is optimized to deliver.

Were we to get into a war with Russia or China though, it's pretty clear we'd get our asses handed to us because we can only make N weapons for Y dollars while they make 10N weapons for the same price, and theirs are only 10% less effective than ours. As it is, ISIS and the Taliban can keep us spinning our wheels for a decade with nothing to show for it. Imagine a foe with an actual military budget…

<comment><USER12> To be fair, the Russians also occupied Afghanistan with very similar results. I think this is a tenant of colliding ideologies of the occupied people, ideologies of the occupiers, and asymmetrical warfare (see a fantastic book titled "Small Wars").

<comment><USER14> > To be fair, the Russians also occupied Afghanistan with very similar results

Exactly, but was that lesson learned? No.

<comment><USER13> Also, they occupied Afghanistan for less time and with arguably more control.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> "You don't actually think they spend $20,000 on a hammer, $30,000 on a toilet seat, do you?"

<comment><USER16> Worth reading: "The Myth of the $600 Hammer"

[https://www.govexec.com/federal-news/1998/12/the-myth-of- the...](https://www.govexec.com/federal-news/1998/12/the-myth-of- the-600-hammer/5271/)

<comment><USER10> This article subverts its own thesis. The $435 hammer was an "accounting artifact," but the government is routinely fleeced and the DoD in particular is unable to accomplish basic accounting tasks.

My favorite paragraph:

> Conversely, said defense analyst Loren B. Thompson of the Lexington > Institute, a conservative Arlington, Va., think tank, the $2 billion-per- > plane figure cited by opponents of the B-2 stealth bomber includes the > program's high research and development expenses--which must be spread over > only 21 planes--plus spare parts, maintenance and future inflation. Said > Thompson: "What would it cost me to build one more bomber? . . . $700 > million."

Gee, what a steal! Only $700 million for a "stealth" "bomber" that is neither stealthy nor able to carry a significant payload.

<comment><USER17> Your last sentence is filled with so many factual errors...

The B2 is considered the most stealthy of any of the fifth generation aircraft currently flying. And it carries a 40K payload. Yes, that's smaller than the B-52 and B-1, but it's fine for it's role.

</comment></comment></comment></comment><comment><USER18> I've always wondered why the government doesn't try a payment-on-delivery model. That would put the risk on the supplier and fix the incentive problems. A counter-argument would be that it creates significant barriers to entry, but it seems like these contracts go to the big powerhouses anyway.

<comment><USER19> > _I 've always wondered why the government doesn't try a payment-on-delivery > model._

Because we're not talking about generic widgets here. It's the difference between buying a bespoke Saville Row suit and a 3-for-1 Suit Warehouse suit.

There are all sorts of off-the-shelf (OTS) designs for general use vessels like tugboats:

* [https://ral.ca/designs/tugboats/](https://ral.ca/designs/tugboats/)

And there are some 'generic' designs for combat vessels:

* [https://products.damen.com/en/clusters/combatants](https://products.damen.com/en/clusters/combatants)

But if you purchase a generic design, then you don't have an advantage of your (potential) opponent because they may also have purchased a generic design.

The US military specifically does not want a generic design (at least in some areas) because they want (perceived) advantage with more (supposedly) advanced design. And someone has to pay for the R&D on that advanced design.

Given that the only market for these boats is the USN, why should the builder pay for the R&D? It's their (only?) customer that's asking for this, and they can't use what they learn for any other designs (because of ITAR export restrictions).

When Ford is doing research for a new F-150 they can spread the R&D over millions of units getting economies of scale, but (e.g.) Bath Iron Works can't exactly amortize the fixed costs of the _Zumwalt_ -class destroyer if their only customer, the USN, says they'll buy 32 but then only builds 3. Why should BIW be the ones to pay?

It's the reason why the F-22 and F-35 have different costs: the Raptor is a US-only plane that no one else can touch, the Lightning II is cheaper because it's available for export and gets economies of scale.

<comment><USER10> In reality BIW gets to double dip — they charge for R&D and also postpone the "D" part until after the ship is built, at which point the Navy will pay again to fix problems that should never have made it out of the yard.

Why do anything right the first time if you can get paid twice, thrice, or six times to fix your fuckups later?

P.S. if I buy a bespoke suit, I pay a fixed cost and it's guaranteed correct — problems are paid for by the maker, not me.

<comment><USER19> > _P.S. if I buy a bespoke suit, I pay a fixed cost and it's guaranteed > correct — problems are paid for by the maker, not me._

Using materials that have been used for decades.

If you want to create a new nano-fibre fabric in a lab that's never been used before, and will not be purchased by anyone else, why should Henry Pool or Huntsman & Sons be the ones to pay for all the lab equipment?

If the USN wants cheap and cheerful there are OTS options:

* [https://products.damen.com/en/clusters/combatants](https://products.damen.com/en/clusters/combatants)

It's kind of what the USN is doing for the FFG(X):

* [https://news.usni.org/2018/02/16/navy-picks-five-contenders-...](https://news.usni.org/2018/02/16/navy-picks-five-contenders-next-generation-frigate-ffgxprogram)

<comment><USER10> Last I checked, ships are still built from steel, just as they have been for a century.

Also the ffg/x "competitive" "bidding" process is a joke. They are paying five vendors to make PowerPoint presentations, then whoever made the prettiest slide deck gets billions of dollars.

The folks who run this are sensitive to criticism but also either unwilling or unable to enact any substantial change.

<comment><USER19> So tell me: which COTS design are the _Zumwalt_ s based off? Or the LCS designs? Or the _Ford_ carriers? Where was the _Ford_ s' EMALS catapults tried before?

</comment></comment></comment></comment></comment></comment><comment><USER20> It really surprises me that companies can get away with scamming the government so badly, and nobody gets shot (or at least put in jail) for that.

<comment><USER21> I dunno, when was the last time the US had an anti-corruption effort where anyone paid any kind of price? I'm old enough to remember Abscam[1], the outcome of which seemed to be "hey, American politicians can be bought for super cheap!" Also: whether or not he killed himself, l'affaire Epstein indicates that our politicians are swine who can be bought off in more simple and sleazey ways.

[1] [https://en.wikipedia.org/wiki/Abscam](https://en.wikipedia.org/wiki/Abscam)

<comment><USER22> I was around 3 y/o when Abscam went down. Now, however, I have a pretty good idea why Penn and Teller called their Bell Labs prank "lab scam". Thanks for that.

[https://www.bell-labs.com/usr/dmr/www/labscam.html](https://www.bell- labs.com/usr/dmr/www/labscam.html)

[https://www.youtube.com/watch?v=fxMKuv0A6z4](https://www.youtube.com/watch?v=fxMKuv0A6z4)

</comment></comment></comment><comment><USER23> Great write-up. I am sure Thorconpower knows all too well, sadly, a tale of 'two nuclear reactors' and extensive paperwork for quality control... in an alternative universe their exciting design for MSTR would already be mass produced.

</comment><comment><USER24> A few years ago I got an inside tour of the brand new LCS Jackson (littoral combat ship) while undergoing acceptance trials at Mayport Naval Base near Jacksonville, Florida. The Jackson was first of its new class.

Why do they check every weld on a new Navy ship? So they can test it by trying to blow it up:

[https://www.defensenews.com/pentagon/2016/06/16/lcs- survives...](https://www.defensenews.com/pentagon/2016/06/16/lcs-survives- first-shock-test-preps-for-more/)

Not part of the acceptance test for a VLCC.

<comment><USER25> from the link:

>A 10,000-pound explosive charge was set off about a hundred yards from the Jackson – the Navy wouldn't say exactly how close, saying the actual distance is classified

and they provided the photo clearly allowing for the precise calculation :) - the explosion is about 12 widths of the helicopter deck from the ship and that means at least 200-250m which sounds more realistic as setting off a 5ton explosion 100m from a small aluminum ship - who is going to pay for all that damage :) If the test is officially declared for anything close to 100m then that may be another case of "Pentagon Wars" ...

</comment></comment><comment><USER14> The us has allies with which it shares technology and weapons. Why should it not have diversity in sourcing?

</comment><comment><USER9> The USS San Antonio just left BAE Systems NSR within the last 6 months. In fact, this week it has just returned from sea trials to NAVSTA Norfolk. There were plenty of issues during the availability, including that damn stern gate.

:-)

</comment><comment><USER26> IMO this might be the most significant point in the doc. "Ship's XO Sean Kearns refuses Captain's mast, is court-martialed."

While underway, commander/captain is judge, jury and executioner for disciplinary issues. They call it "Captain's mast" and the powers that come with it are wide and can be extreme, including demotions and docking pay.

The XO refused to receive the ship commander's punishment while on mission. Tantamount to a mutiny.

<comment><USER27> And yet he is, per the PDF, acquitted.

<comment> jagged-chisel I'm curious what orders were given and refused. We can assume that they were related to forcing approval of ship's readiness or some such, but I'd really like to be sure.</comment></comment></comment>


Data structures and algorithms problems in C++ using STL - <AUTHOR> http://www.techiedelight.com/data-structures-and-algorithms-interview-questions-stl/ <comment><USER3> A really cool algorithmic problem I've been obsessed with lately is stable sorting in O(n log n) time and O(1) extra space. It's possible (Trabb Pardo 1977, Katajainen and Pasanen, Huang and Langston, etc.) but all known algorithms are very complicated. As far as I understand now, there seems to be a "wall" at sqrt(n) extra space. If we have that much, it's not too hard to write a stable mergesort or quicksort with the right time complexity. But if we are restricted to O(1) or O(log n) space, the algorithms become much more involved, using a sqrt(n) buffer inside the array to encode information about the rest. There are working implementations on GitHub (GrailSort and WikiSort), both are over 500 lines.

Here's a couple innocent-looking special cases that are still surprisingly hard:

1) Given an array [a1, a2, ..., an, b1, b2, ..., bn], rearrange it into [a1, b1, a2, b2, ..., an, bn] using O(n) time and O(1) extra space.

2) Given an array of zeroes and ones, sort it stably using O(n) time and O(1) extra space.

I'd be very interested to hear about any advances in this area.

<comment><USER4> On the first glance the first problem seems quite impossible. For example, if n is power of two, then for each prime number < n there will be a cycle starting with that number. If n is not a power of two, I haven't yet seen any good explanation of cycles. Any hints? We can't use a or b in any way?

<comment><USER4> Even for power of two it's not correct, forget my statement about cycles.

<comment><USER4> Yet I have only one idea - that we can permute the elements somehow (in a O(1) reversible way like a Gray code) so that the cycles would form something computable in O(n) time and O(1) space

</comment></comment></comment></comment><comment><USER5> I've spent the last hour browsing www.techiedelight.com and I would like to say this is a great resource for coding problems. I like that the methodology for solving them is discussed for each posting.

I would be interested in hearing recommendations for other such sites that specifically discuss the methodology for approaching these problems.

Geeksforgeeks.com is another such resource for learning the approaches as well but I would be curious to hear any other suggestions as well.

<comment><USER6> I suppose you meant geeksforgeeks.org

<comment><USER5> Indeed, yes, sorry.

</comment></comment></comment><comment><USER7> The k'th largest element in an array can also be found by the nth_element() algorithm already included in the STL. It has linear complexity as opposed to the O(n log k) and O(k log n) variants proposed here.

<comment><USER8> It is only linear in std::distance(first, last), so it very well might be (and likely is) nlogk .

Edit: see comment below for why it actually is O(n) and not O(n logk) as I had thought.

<comment><USER9> But std::distance(first, last) is how _n_ is defined.

std::nth_element is typically implemented using a fancy version of quickselect called introselect. You can imagine quickselect as a version of quicksort where the recursive call is only executed on the side which contains the element. Introselect adds some fanciness to ensure worst-case linear running time if quickselect takes too long (bad pivot selection).

<comment><USER5> Its O(n logk) then? It maintain a heap I'm guessing?

<comment><USER9> No, as per my previous comment, it t does not use a heap. It's like quicksort, but only doing one of the recursive calls:

\- choose a pivot _p_ randomly from the elements

\- partition into elements _< = p_ and _> p_. This takes time O(n).

\- if the number of elements _< = p_ is at most _k_ (the rank of the element we want), do a recursive call on these elements. Otherwise recurse on the other elements (those _> p_).

Because a random pivot splits the elements well enough most of the time, this has an expected running time of O(n): 1 + ½ + ¼ + ⅛ + … < 2 in the best case, and similar constants if the partitioning is a little worse. But in the worst case, when the pivot is the smallest/largest element in each iteration, it's O(n²). That's where the fanciness of introselect comes in: if quickselect doesn't converge, it switches to an algorithm with worst-case O(n) time, which is slower in most cases but saves the day when quickselect has trouble.

<comment><USER10> See "median of medians algorithm": [https://en.wikipedia.org/wiki/Median_of_medians](https://en.wikipedia.org/wiki/Median_of_medians)

It's hairier than a partial quicksort, but (if you erase the proof and weigh the chalk dust) guaranteed linear time.

<comment><USER11> and median of medians can be used to implement quicksort with O(NlogN) worst case. It is usually not worth it as other hybrid quicksorts like introsort are faster in practice.

On an unrelated note, I was once asked to prove the upper bound for median of median on an interview...

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> Thought this was going to be "problems in STL data structures" not "solving problems using with STL". A better title might be "Solving algorithm problems in C++" as STL isn't really important to the solutions.

<comment><USER13> "as STL isn't really important to the solutions."

Sure it is. It's as much as showcase of practical applications of the STL as it is of algorithms. Any algorithms book has implementations, the great thing about this site is that it shows you how to use the STL in real world applications.

</comment></comment><comment><USER14> Does anyone know of a website that teaches you data structures and algorithms, preferably in C, in an interactive way? I've always found that's the best way for me to learn.

<comment><USER15> [https://visualgo.net](https://visualgo.net)

</comment></comment><comment><USER16> It claimed that recursive binary search has a space complexity of O(1) - <USER2> has O(log n) as the stack frames are your used memory

<comment><USER9> But it can be implemented iteratively instead of recursively, so that there is only one stack frame. O(1) space for binary search is entirely possible. The link demonstrates both versions, the iterative one uses O(1) auxiliary space and the recursive implementation uses O(log n), _unless the compiler uses tail call optimization_ :)

<comment><USER17> Since C++11 elision of copies of named local lvalues being returned is mandatory. In practice this was elided by older smart compilers and new compilers elide a whole more when returning.

<comment><USER9> That seems entirely unrelated to tail call optimisation though? For once, "return foo(bar, baz)" isn't returning a named value, it's returning an rvalue. Secondly, return value optimisation doesn't optimise away the stack frame. Thirdly, the standard isn't as strict as you make it sound: compilers may elide the copy if they can, _but if they cannot they have to move, never copy_.

</comment></comment></comment></comment><comment><USER18> Funny how I focused on "problems" and "using STL" when I read the headline the first time. I remember C++ fondly but only because my mind has now forgotten all the "fun" of debugging STL.

</comment><comment><USER19> Thanks for sharing this. I was looking into [http://www.geeksforgeeks.org/top-10-algorithms-in- interview-...](http://www.geeksforgeeks.org/top-10-algorithms-in-interview- questions/) but it's not very idiomatic.

Then, make sure you use std::make_unique or std::make_shared rather than operator new if you are going for a C++ job.

</comment><comment><USER20> Very useful work! I would love to see it implemented in many other languages. Any takers? :-)

</comment><comment><USER21> Just looked at the kth largest algorithm and author claims max heap method is k log n ! His method is actually n log n. The min heap is n log k and the right way to do it.

<comment><AUTHOR> it is clearly O(klogn). We are popping k times from a heap of size n.

</comment></comment><comment><USER22> I'm very used with this kind of stuff with C++.

Which modern language should I try if the first thing I miss in a language is the STL and the C-like syntax?

<comment><USER23> Call me crazy but stick with c++.

It has a ton of warts and complexity but it also has the features you need. If you program in C++ you can have simple solutions 95% of the time and when the intrinsic complexity is higher the language has the tools to save the day. Many other languages will solve the simple parts slightly cleaner but the complexity explodes on the difficult bits.

However if you are looking for fun I really like Rust, it has a nice c++ feel without having to worry so much. Personally I still think it is a bit too new for "enterprise coding" but it is maturing nicely and learning it will really teach you a lot.

</comment></comment><comment><USER24> Is there something similar that's language agnostic or in Python?

<comment><USER25> Well there is one of the best books on the subject.

"Introduction to Algorithms"

[https://www.amazon.com/Introduction-Algorithms-Thomas-H- Corm...](https://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen- ebook/dp/B007CNRCAO/ref=mt_kindle?_encoding=UTF8&me=)

<comment><USER26> "The Algorithm Design Manual", by Steven Skiena, is very readable and it's generously free to download. I was going to post the link, but I couldn't unmangle it from Google. It's easy to find.

<comment><USER27> This looks like it: [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.471....](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.471.4772)

I don't see any links to it from any of Skiena's or the publisher's webpages, so it's not clear how legitimate it is.

Incidentally, I wouldn't really suggest Skiena as an _alternative_ to Cormen et al; they're extremely different in style and content, and in situations where you need one of them the other probably won't help you. I recommend getting both. (For more verbosity on this, see my review of the first edition of Skiena's book at [https://www.mccaughan.org.uk/g/books/alg- design.html](https://www.mccaughan.org.uk/g/books/alg-design.html) .)

<comment><USER26> CLR is information-dense and authoritative. I have a copy from my college algorithms course and I refer to it occasionally. Skiena is a lighter read, so, I figure, you're more likely to actually read it. Whatever algorithms text you read, you will want to continue to augment your knowledge if you're going to confidently adapt and engineer algorithms.

I agree with you. Get both.

</comment></comment></comment></comment></comment><comment><USER28> Is there an offline/e-book version?

</comment><comment><USER29> Website is unusable on mobile. Text falls off right side, horizontal scrolling disabled. How is this still a thing?

<comment><USER30> Looks fine on my phone. Do you have desktop request on by accident?

<comment><USER29> No I do not. Code is fine. Comments in code are cut off mid word. PixelXL. Chrome.

</comment></comment></comment><comment><USER31> It doesn't state what standard it is using. Is it with:

      C++98 or
      C++03 or
      C++11 or
      C++14 or
      C++11 or
      C++17 or
      C++20 ?

<comment><USER9> Appears to be C++11, which is contained twice in your list. C++20 doesn't exist yet. C++17 isn't finished either.

It doesn't appear to use new language features, only some library things like std::unordered_map, from what I gathered in a quick look. Most things will probably work just fine with C++03.

<comment><USER32> It compiles with -std=c++11, graph one fails with 03 on WSL at least

<comment><USER33> I see "nullptr" in a few examples, which is C++11.

<comment><USER9> Yeah but it should work in C++03 if you just '#define nullptr NULL'. Not saying it's good practice but C++11 usage is very light.</comment></comment></comment></comment></comment>


Congresswoman Proposes Top 1% Act to Drug Test Wealthy People Who Get Tax Breaks - <AUTHOR> http://bipartisanreport.com/2016/06/16/congresswoman-proposes-top-1-act-to-drug-test-wealthy-people-who-get-tax-breaks-quotes/ <comment><USER2> Should drug test members of Congress first.

</comment><comment><USER3> In the US, corporate and wealth welfare combined are on the order of several trillion USD including subsidies, tax breaks and other incentives. Welfare proper is on the order of 700 billion. Or: all the rich people take around a dozen times more than all the poor people.

</comment><comment><USER4> you know, if the congress critters put more effort into pushing the fair-tax, this would stop. maybe.</comment>


Decisionero is now "complete." Feedback and alpha guinea pigs wanted. - <AUTHOR>

A while ago I posted to y combinator in an attempt to rally the locals towards the cause of convincing my business partner to stay and work on our project. http://news.ycombinator.com/item?id=233570
As it turns out he elected to pursue his doctorate. C'est la vie. The nature of our working relationship was that of the tortoise and the hare. Him being the super star coder, me being a jack of all trades but with slow, steady progress. After his departure, I carried forth in my clumsy fashion and "finished" our site. I'd love feedback from people, and to see if anyone finds it useful. No, I'm not spamming the internets with requests for testers seeing if I can ensnare users. I'm targeting the y-c crowd due to the nature of the users here.
Decisionero: what it is. A tool to get your ideas on the page to help you and a few people make decisions. We found it useful when sorting through various design decisions, for instance. http://decisionero.com
sample decision page: http://decisionero.com/43t_friends/San_Francisco_or_Indiana%3F
Feedback can be posted here or sent to sgibson12 at gmail.
Cheers! <comment><USER2> Good Job. I'm glad you were able to release.

I think it's kinda neat. I like the way you've approached collaborative decision making. I know you're just testing it with simple questions at the moment, but I'd really be interested to see how it would work with more complex issues. (Which target market should we pursue this quarter? Which candidate would make the best hire? Etc Etc)

One thing that strikes me is that it would probably work best as a part of another system, such as a PM system or bug tracker, or even in a e-vite style invite system.

I'm not sure how much value it would have just on it's own above cute curiosity... What's your long term goals with this?

Quick EDIT: I just saw the feedback from the SF or Indiana thread... obviously, some aspect of commenting seems to be something people are clamouring for... but I like your idea of bringing "factors" into play... something to play with I guess.

<comment><AUTHOR> Thanks for the feedback. Yes, it definitely needs more relevant demo questions.

It could work as part of another system. We (or at this point, I) am not planning on building that other system so in the near future it's a stand alone application.

I hope to achieve value above cute curiosity, but I appreciate hearing that perception. The utility is when it becomes a habit to utilize this method for decision making rather than just deciding. How to train, convince and alter people's behavior to do so is the next challenge. I know my business partner and I began to value using it, not just because we built it.

The long term goal would be to move it away from the donationware model and provide varying levels of service for utilizing the tool. For instance, you get 5 decisions for free and if you want more then pay $X/month.

Yep, comments are on the long term goal list.</comment></comment>


Riot OS – Real-Time, MMU optional and threads - <AUTHOR> https://www.riot-os.org <comment><USER2> I wonder why the comparison table does not include FreeRTOS or Zephyr.

From a high level view, I don't really what's really different for RIOT OS

<comment><AUTHOR> I would read the extensive list of features and look at the code first before hurling content-free FUD. It even supports Arduino too.

[https://github.com/RIOT-OS/RIOT/tree/master/cpu](https://github.com/RIOT- OS/RIOT/tree/master/cpu)

<comment><USER3> Not comparing to Zephyr, which ticks all the same boxes, is absolutely a problem.

And I would argue that Arduino support nowadays is a negative, not a positive. Arduino support means that you are going to do a bunch of things to support 8 and 16 bit systems that look absolutely silly on 32 bit systems. And, it's not even clear that Arduino systems are actually cheaper or lower power than ARM Cortex-M4 systems anymore--which negates the advantage of Arduinos.

<comment><USER4> I completely switched to the Adafruit Feather M4 series for my hobby electronics about 5 years ago. Each board might be a little more expensive than a base Arduino, but they are way more powerful and have a lot of great features.

<comment><USER5> If you want to go "budget", STM32 hardware (like the common "blue pill" STM32F103C8 board) is priced comparably to a knockoff Arduino, if not cheaper.

<comment><USER6> You can now get much more powerfull STM32F411CEU6 boards for the same price.

<comment><USER5> Which boards are you thinking of? "Blue pill" STM32F103C8 boards are $2 to $3, if you're willing to run the risk of getting a cloned microcontroller. (The clones are actually quite usable for most purposes.)

<comment><USER6> The clones even tend to have more memory.

But I was thinking of those boards: [https://aliexpress.com/item/4000103610226.html](https://aliexpress.com/item/4000103610226.html)

(also supported by RIOT btw [https://github.com/RIOT- OS/RIOT/pull/12778](https://github.com/RIOT-OS/RIOT/pull/12778))

<comment><USER5> Oh, those! I have one of the F401 models -- I didn't know there was a F411 variant, though, nor that they've gotten so cheap. There might be a purchase in my future. :)

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> Yet another to the list[0].

[0]: [https://www.osrtos.com/](https://www.osrtos.com/)

</comment><comment><USER8> Related from 2019: [https://news.ycombinator.com/item?id=19016945](https://news.ycombinator.com/item?id=19016945)

(Edit: link is for the curious. Reposts are fine after a year or so: [https://news.ycombinator.com/newsfaq.html.](https://news.ycombinator.com/newsfaq.html.))

<comment><AUTHOR> Dern it, http<->s. I swore I algolia'd first but must not have. Sorry!

Btw, would it be a bother to suggest a tweak to the submit action's link uniqueness check to prevent dupe items differing only in URI scheme?

        // Crunchy pseudo-LISP below

        (defun flip_scheme (url)
          (sed "s/^https/@ttp/;s/^http/@ttps/;s/^@/h/" url)
        )

        // after sanitization/normalization at the point of checking for dupe items
        // instead of
        // (has_url url)
        (if (has_url url)
           (return (redirect 301 "Moved permanently" (item_for_url url))
        )
        (let flipped (flip_scheme url))
        (if (has_url flipped)
           (return (redirect 301 "Moved permanently" (item_for_url flipped)))
        )

<comment><USER9> The last posting was more than a year ago, it's fine to re-post! Dang was merely providing the old thread as a reference.

</comment></comment></comment><comment><AUTHOR> Collab between Samsung + Microsoft + UofW + U of Maryland that is also trying CheckedC.

[https://github.com/Microsoft/checkedc- clang](https://github.com/Microsoft/checkedc-clang)

[https://github.com/Microsoft/checkedc](https://github.com/Microsoft/checkedc)

</comment><comment><USER10> Cool project, but no ipv4 support. Can't take an iot os seriously with no ipv4, sorry

<comment><USER11> Ipv6 should be the way to go nowadays, no ? For sensors network, people are using ipv6: as you don't have enough ipv4 adresses for computers and phones, you don't use ipv4 for sensors networks and IOT, that's a nonsense.

<comment><USER12> I would imagine almost all IoT devices in the home are using IPv4 at the moment, you can't rely on IPv6 working properly with many ISPs. They don't have to use public addresses, so scarcity isn't a problem.

</comment></comment></comment><comment><USER13> I wonder how this compares to RTEMS

</comment><comment><USER14> Tock OS[1][2] is way more promising since it's written in Rust instead. In 2020 there is no reason to invest time in anything new in C, apart from maintaining legacy software.

[1] [https://www.tockos.org/](https://www.tockos.org/)

[2] [https://github.com/tock/tock](https://github.com/tock/tock)

<comment><USER7> I'd rather seL4, which isn't written in rust but on a time-proven language (C) and yet has thorough proofs of doing what it's supposed to do, unlike this OS you suggest.

<comment><USER15> Indeed, 40 years of proven memory corruption bugs.

[https://www.cvedetails.com/vulnerability- list/opmemc-1/memor...](https://www.cvedetails.com/vulnerability- list/opmemc-1/memory-corruption.html)

[https://msrc-blog.microsoft.com/2019/07/16/a-proactive- appro...](https://msrc-blog.microsoft.com/2019/07/16/a-proactive-approach-to- more-secure-code/)

Which are reaching the tipping point of enough is enough.

Which is why Android 11 will now require memory tagging hardware for C and C++ code, when running on ARM.

[https://security.googleblog.com/2019/08/adopting-arm- memory-...](https://security.googleblog.com/2019/08/adopting-arm-memory- tagging-extension.html)

[https://source.android.com/devices/tech/debug/tagged- pointer...](https://source.android.com/devices/tech/debug/tagged-pointers)

And no, it doesn't need to be Rust, in fact NVidia has decided to dump C and C++ for security critical firmware, betting on Ada,

[https://blogs.nvidia.com/blog/2019/02/05/adacore-secure- auto...](https://blogs.nvidia.com/blog/2019/02/05/adacore-secure-autonomous- driving/)

While F-Secure is using bare metal Go for their Foundry, [https://www.f-secure.com/en/consulting/foundry](https://www.f-secure.com/en/consulting/foundry)

Speaking of seL4, Genode OS is now using Ada alongside seL4,

[https://genode.org/documentation/release- notes/16.08](https://genode.org/documentation/release-notes/16.08)

[https://genode.org/documentation/release- notes/19.11](https://genode.org/documentation/release-notes/19.11)

<comment><USER16> seL4 isn't really written in C, AFAIK it's written in Haskell then translated in C. Because C is one of the few language to have a formally verified compiler CompCert.

Now does seL4 support properly modern CPUs: multiple cores, with different power settings? This I don't know.

And what about Spectre?

<comment><USER15> With the caveat that CompCert is mostly C99 and requires MISRA like C.

What about Spectre? It is an hardware exploit, thus there is only so much one can don in software to prevent it.

However that shouldn't be an argument for not improving the security of the IT stack, people still die when wearing security belts and helmets, but they surely do surving in higher rates than when they weren't a requirement.

Exploits due to logical programming errors, false premises, hardware bugs, will always be around, however reducing the attack surface is already a big improvement.

<comment><USER16> >What about Spectre? It is an hardware exploit, thus there is only so much one can don in software to prevent it.

And there _has been_ mitigations done in software in the Linux kernel (and the web browsers but that's userspace), so my question:

has seL4 being updated with mitigations for Spectre?

Plus for a microkernel, this can be a big performance issue..

<comment><USER15> Mitigations never solve 100% the problems, as proven by 40 years of C related security mitigations, including hardware memory tagging.

As for seL4, I only have superficial knowledge of the project.</comment></comment></comment></comment></comment></comment></comment>


Ask HN: Will the C programming language really die? - <AUTHOR>

There is too much talking about Rust programming language and it's great that research on this topic is vibrant.
My question.
Will the C programming language really die? Meaning, stop being used as a System programming Language or in the Embedded Systems field.
It is still worth to invest some time digging these topics with the C programming language?
Newbie here, don't be rude. <comment><USER2> Read this - [http://blog.biicode.com/cpp-will-never- die/](http://blog.biicode.com/cpp-will-never-die/). And I think C will never die! But it's very interesting to known Linus Torvalds's opinion about Rust and the future of system programming languages.

</comment><comment><USER3> Well, it's an interesting question!

I started learning C almost 30 years ago and while I have learned a lot of other languages: C++, Java, Scheme, Dylan, NewtonScript, Visual BASIC, some Haskell, a little Forth, various assembly languages... recently I received training in LabView.

I keep winding up using C again. I spent today writing C code that runs on an embedded board. Simple code, really, running on an embedded processor with very little RAM. There's still a need for this. I have most of modern C++ available on this platform. It is technically C++, but I'm not using any classes or templates, so it looks for the most part very much like C99.

As someone who is well-acquainted with C's weaknesses as well as strengths, I would honestly like it if I could migrate all my work to something else. I really like functional languages and I really like strict type safety. I am looking forward to using Haskell on embedded systems and think it will have a niche there. I'm looking forward to expressing embedded state machines in FRP (functional-reactive). However, these things are still relatively limited and experimental. As for Rust and Go, etc., it's still a chicken-and-egg thing, I think. And I'm not sure they are really suited for _small_ chips -- what's the minimal runtime? Can you get rid of all garbage collection at runtime? And remember that practical issues of tooling are _huge_. They tend to swamp theoretical elegance and even sometimes efficiency by a large margin.

So, I guess the answer is "I don't know." C still has a niche. At some point it may truly be unnecessary. As to whether it is worth studying or investing your time understanding, I would say the answer is almost certainly yes. The C runtime model is still the dominant one; C is still the language used to build most of the tools that other languages are built on. If you need to understand what is going on at the low level, just above assembly language, and programmers still do, they still need to understand C.

</comment><comment><USER4> There's still nothing that can actually replace C. I think that's because of a combination of:

1) Being reasonably high level

2) Having asm() be usable at all. You can't drop into asm with Go, as far as I'm aware. You can with Rust and C++, but the next point...

3) The ABI as commonly implemented is dead simple. I know how to call C from asm, and vice versa, without screwing everything up, having bizarre initialization and destruction to worry about, etc. C++ can't claim that. I don't think Rust can either.

C will live on until there's an actually usable replacement. Right now, there isn't.

<comment><USER5> > I don't think Rust can either.

Rust has no defined ABI at this time, just like C++, but by adding the 'extern' keyword, and a '#[no_mangle]' attribute, you get the C ABI, and so then it's easy. We also support a few other ABIs as well, then it's 'extern "fastcall"' or whatever.

(This still doesn't mean "Rust will kill C" or something silly like that.)

</comment></comment><comment><USER6> There's a Japanese proverb: If you believe everything you read on hacker news, don't read hacker news.

Let's say rust fares better than go, c#, D, java, limbo, modula (-2, -3), oberon, pascal, etc. Programmers around the world race to convert all legacy C code to rust. C, C++ and Objective C are banned under international treaty and everyone suspected of leaking memory is rounded up and sent to coder bootcamps for re-education. Learning C is the second best (behind assembly) programming language to understand how your computer actually works.

</comment><comment><USER7> It does feel that there has been a recent boom in new compiled languages (languages that compile to native code, I mean, instead of whatever virtual machine people currently think is hot). One or more of these might well wind up displacing C in the future. C is an elegant language but it suffers from not being able to learn from the lessons of the last 40 years.

Fortran is still in use after ~60 years, but it isn't really being used for new applications, which seesm to be what you're asking. It seems safe to assume that someday C will follow suit.

</comment><comment><USER8> C is still absolutely standard and huge in both the fields you mentioned. Despite all the new system languages or whatever doesn't change the fact that C dominates and will continue to dominate embedded development among other fields.

Anyone who claims C is dead likely is working in the Silicon Valley startup bubble. Sure, C isn't going to get your far at mostly web based companies but every computing device you own most likely has C and assembly running the hardware bits and the underlying system.

</comment><comment><USER9> Not in a hundred years, everything we use today is built on top of thousands of C code lines.</comment>


How Much Information Was Consumed by Americans in 2008 - <AUTHOR> http://spectrum.ieee.org/riskfactor/computing/it/how-much-information-was-consumed-by-americans-in-2008?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+IeeeSpectrum+(IEEE+Spectrum)

<comment><AUTHOR> > "In the past, information consumption was overwhelmingly passive, with > telephone being the only interactive medium. Thanks to computers, a full > third of words and more than half of bytes are now received interactively."

hmm...how much of "interactive written communication" on computers are chat conversations? talking and chatting online are somewhat different, but i can't help but feel that chatting online is only the tip of the writing iceberg.

when i think about written communication i think about reason, eloquence and creative expression. how much online chatting, facebok walls and tweetings really explore that, versus putting casual conversation into text?</comment>


Spinning wheels (dealing with burnout) - <AUTHOR> http://ihumanable.com/blog/2009/11/spinning-wheels/

<comment><USER2> _So I'm creating a list of things to accomplish in the hopes of defeating my professional burnout: Re-institute a workout and diet regimen_

Yes, do this one. It works for me, at least. See also <http://news.ycombinator.com/item?id=948481> for some possible biology behind this.

A rule of thumb I have learned to follow is that when I am in a crummy state, that is _not_ the time to try to solve the problems I perceive. Better to try to make a transition to a better state, by whatever means, and then explicitly remember the problems and try to solve them when I'm in an energetically more capable place. The solutions that result this way are much better.

<comment><USER3> Funny. I'm in the process of doing the same thing and it does make a huge difference.

</comment></comment><comment><USER4> I find myself in a mentoring position to interns at my day job. They are very talented and have no big responsibilities like a family or kids. If I was their age, I wish someone told me how frustrating it is to have not tried my hand at being an entrepreneur.

Do I tell these interns the frustration I feel and that they should think long and hard about whether they want to join to big corporate world? The big multi-nationals offer good compensation and is relatively secure. However, I wonder if they will eventually start feeling frustration down the years and start thinking the same thoughts as I am now?

Anyways I've chosen my path. I have a family that depends on my stable income, I realize how important is for a parent to BE a parent, and accepted that I no longer have the energy to work three jobs. (day job, family, plan B) I'm trying to bring up the kids to live the life I wish I had...

But it doesn't mean I've given up on 'plan B'. I'm sure as the kids get older, I would find myself with more time. Just need to stave off the burnout by not trying to do too much.

<comment><USER5> I read DHH awhile ago and he mentioned only working 2 hrs a day (and not even everyday on your side project). I think most people even if they're octomom if they plan and schedule well enough could probably find 2 hrs a day (early in the morning or late at night) to squeeze in some work.

There's no requirement that it has to be an extra 6 or 8 hr marathon everyday for 6 months or year, etc.

<comment><USER4> I agree. The problem I'm having is juggling the three elements of day job, family service, and plan B. Day job eats up over 12 hours of my day (include prep + commute). Then the family service thing goes on for at least 4 hours, usually more with the clean up miscellaneous house things. The majority of the days, I find my important duties finally ends around 11pm, on most weekdays. Exceptions are like yesterday where late night day job phone conferences has me up past midnight. Weekends, you can replace the time with the day job with family service. I think this is where as the kids grow older and more independent, I can reap back some time for plan B.

I just can't help but wonder how different my life would have been if I pursued doing my own thing more aggressively 10 years ago. Ten years ago was four years before the wife and I wanted to have kids, the wife was working making good income, a time where I could have gone balls out. m'eh, enough dwelling on the pasts what-ifs.

Day job and family duties calls! I'm off to the (rat) races!

</comment></comment></comment><comment><USER6> I faced this precise dilemma. I finally just quit. It was less stressful to do what I wanted, and worry about the bills than it was to have the bills paid by not doing what I wanted.

<comment><USER7> What did you want to do? How did you know? Did you just follow a gut feeling?

I ask because I am struggling to find what I want to do. There are many possibilities that seem interesting. It seems easier to find out what I don't like. Using process of elimination would take quite some time.

<comment><USER6> Well, I knew what I wanted my hobby project to be, and I also have a rough long term goal.

So, upon reflection, I realized that I was spending 95% of my time doing shit I hated doing, or at best was ambivalent about, and I decided that was no way to live my life.

I didn't have some grand scheme, I just said to myself: look Pete, you wake up and you think about how you want to spend your time, and it's basically the same every day, but then you ignore the impulse so you can "pay the bills." Just stop ignoring the impulse.

That's what I did.

So if you're feeling like "Fuck it, I want to [lay on a beach/travel the world/go on a spirit quest/write a novel/program a game/whatever]," then just do it. It might even be worth screwing your credit rating and losing your worldly possessions over--that's not a big deal, in the scheme of things. It doesn't have to be forever, it just has to be enough to break you out of your rut.

I wanted to do two things: 1) Write more 2) Create my "grand opus" video game

That's what I'm doing now, and I love it. I make perhaps 5 times less than I used to and I put up with it being cold in the house because I stopped programming full time and started freelance writing. Big deal -- I wake up refreshed and excited, and the writing I'm doing, I'm doing in such a way that it will support me passively in years to come. I have a realistic opportunity to never have to work again, and it's because I broke out the the rut of "I want to stop this job, but I need to pay the bills."

I could be wrong statistically speaking, but for me personally, the right answer is: Fuck the bills.

</comment></comment></comment><comment><USER5> That last comment on his blog about the guy whose wife is about to leave him is sad. One of the main reasons it's important to have a supporting partner in life.

</comment><comment><USER8> My suggestion is to find a kindred spirit(s) who wants to co-found a business based on your ideas. Pitch the hell out of it, everywhere you hang out.

I left a longish comment on your post Matt with my story.</comment>


Lightgallery: Electron and Node.js-based image viewer for Mac, Windows and Linux - <AUTHOR> http://sachinchoolur.github.io/lightgallery-desktop/ <comment><USER2> This is good and all but anyone else see a problem with electron apps for everything? all these apps built with electron really clogging my ram.

<comment><USER3> Javascript is the new Flash Player

<comment><USER4> JavaScript is becoming what Java set out to do, but in a way that works for users.

<comment><USER3> And not in a way for engineers that want to host applications, or people who care about single threaded web-frame apps chewing up their laptops battery and RAM.

</comment></comment></comment></comment><comment><USER5> A bit of feedback. Since is a user facing app, the front page needs to be tidied up a bit.

"Modern image viewer" = decent. It is a sales pitch so at least you included something regular users would want to read about.

Electron and NodeJS = bad. Only developers care about that. IMO keep that in the "About" page or just on Github.

"View on Github" is a bit redundant, you already have a tab for that.

Make the Download button bigger and more prominent. I believe the standard color for download buttons is green.

Core features: again, the first feature ("Electron") should go. The other 5 are valid for users. BTW, IMO pull a summary of those features as part of the slogan aka sales pitch used above.

Settings: make that a separate page. It's super scary for regular users.

Also: list the file formats supported somewhere on the home page, preferably in a section which is easily visible. If the file format list isn't yet as big as you want, you could list some of the formats you plan to support soon (but mark the "work in progress" ones clearly.

Cool project!

<comment><AUTHOR> Thank you for the valuable feedbacks. I agree with almost all of the above points. I will update the home page ASAP

</comment></comment><comment><USER6> Perhaps I missed it, but I didn't see anything indicating what image formats it supports.

I assume it supports JPEG and PNG, but does it support all the various versions of TIFF (there are a _lot_ of these)? Does it support raw images (Canon/Nikon/PhaseOne/etc)? Does it support PSD? How about GIFs and video formats?

Unless I'm wrong, and I missed it, this might have been useful information to include in the "Core Features" section.

<comment><AUTHOR> Lightgallery supports jpg, png, gif and webp image formats. Information about image formats is available on github readme section

<comment><USER7> wait, what? so you have to go to the github page to find out what sort of images the tool your downloading can display?

<comment><AUTHOR> Sorry for the inconvenience. I will add it on the home page too.. :)

</comment></comment></comment></comment><comment><USER8> It's a shame that HN is almost completely incapable of having productive discussions regarding Electron-based apps (especially Atom). Yes they're bigger downloads than "necessary", and yes they use more ram than a native app probably would for the same task. We get it.

</comment><comment><USER9> Feedbacks on OSX: \- "Pinch with 2 fingers" on trackpad should zoom, not move to other pictures \- I would like to be able to move very quickly from picture to picture with the right/left arrow (as fast as the Picasa photo viewer on Windows), but I cannot switch to the next photo until the animation is over, therefore I cannot see more than 1 or 2 photo per second (too slow when I want to browse hundreds of photos to find the one I'm looking for).

<comment><AUTHOR> Thanks for your feedback. If you want to find any particular images you can easily find it from thumbnails strip of from pagers. If you want to move between images quickly you can decrease the speed of animation from menu > view > speed > numbers.

</comment></comment><comment><USER10> >modern

With the fad of bundling up web browsers and web code into an app this phrase is starting to have negative connotations for me.

<comment><USER11> You can't have it both ways right now, as there's no desktop application framework that offers modern UI features.

</comment></comment><comment><USER12> a few suggestions:

\- crop the image or fix just the height in the thumbnail section so they don't get distorted. Electron means it's with CSS, right? the background image can crop via CSS.

\- don't make the user wait for the animation until he can interact again. I want to tap the arrow keys twice fast to quickly skip ahead.

\- hide bars delay and animation speed should be set much faster by default.

\- hide bars should include the thubmnails button

\- fullscreen deserves a button.

\- menu bar should dissappier in fullscreen (I'm on windows)

\- auto-add all images of that folder if just one image is opened (this is default in windows and I see mac people stumble to show a few pictures in big all the time)

\- hide the thumbnail list by default so the auto-add does not add clutter

\- the black bar on top is mostly empty in the middle and just occludes the picture, maybe just a small rectangle for the controls was better.

\- I think a more discrete border with the thumbnails would look better (50% grey, 1px, 2px rounded edge. white or turquoise for current image)

\- most of the settings should be hidden in an advanced section

\- on windows it does not seem to register the file associations

\- on windows I'd like to be able to choose the installation path

\- nitpicking: the logo/icon does not work well in 16x16px

<comment><AUTHOR> Thanks. I will try to include some of the features in the next version.

</comment></comment><comment><USER13> I installed it, but the functionality to open a picture from the menu (file -> open and then select the picture through a dialog box) doesn't work (and it doesn't show anything on the command line). It works fine when I drag the file to the app window though. For what is worth I use Debian 8 with Node.js 2.14.2

<comment><AUTHOR> Thank you for the feedback. I will check it and get back to you.

</comment></comment><comment><USER14> Its really awesome app.I am using ubuntu and no image viewer was available for ubuntu with this much features.

<comment><AUTHOR> Thanks. I am glad that you like lightgallery.

</comment></comment><comment><USER7> supports 31 image transitions and 4 file formats

</comment><comment><USER15> Sorry to be that guy, but the fact that it is built in Electron is not a "core feature". It does not benefit the end user in any way

<comment><USER16> It scales

<comment><USER17> Scale what? Humans can still only look at a couple of images at a time... (or was that a joke?)

<comment><USER5> It was a joke :)

</comment></comment></comment></comment><comment><USER11> That's a serious step up from Lightbox etc. and certainly better than at least the Windows picture viewer. Nice work.

<comment><AUTHOR> Thanks for the nice feedback,i really appreciate it :)

</comment></comment><comment><USER18> A bloated 35 Mb installer app just to view images ? Why thank you, but my 4 mb xnviewer which starts instantly is better.

<comment><USER11> There are users who like their applications to have a nice UI.</comment></comment>