Western fast food companies are aggressively expanding in Brazil - <AUTHOR> https://www.nytimes.com/interactive/2017/09/16/health/brazil-obesity-nestle.html <comment><USER2> > At one meeting, a representative from the food industry accused Anvisa of > trying to subvert parental authority, saying mothers had the right to decide > what to feed their children, recalled Vanessa Schottz, a nutrition advocate.

The same argument is used in the US to thwart limitations on sugary beverage purchases and other junk food with SNAP -- these compose 10-20% of purchases, 50% of which goes to Wal-Mart, alongside 2-5x greater premature mortality from cardiac arrest and diabetic related complications.

[http://ajph.aphapublications.org/doi/abs/10.2105/AJPH.2016.3...](http://ajph.aphapublications.org/doi/abs/10.2105/AJPH.2016.303608)

Incentivizing the poor to hock Nestle timed according to Brazilian food assistance checks is clever. Reminds me of Herbalife, and Betting on Zero -- Hispanic populations, eager to succeed in entrepreneurship, here too are victims of pyramid schemes preying on ill health.

<comment><USER3> >>The same argument is used in the US to thwart limitations on sugary beverage purchases and other junk food with SNAP

Those living under the poverty line don't like being hit with condescending statements coming from those who are supposedly trying to help them, either. Conservatives/Republicans at least call the poor lazy. Liberals/Democrats who want to restrict sugar/luxury items from EBT/SNAP often make ridiculous statements about "knowing better for them," which you can imagine plays real well in their population.

I've collected EBT with a family and been under the poverty line. I know very well how people think and feel about those above them. Sometimes the single father or mother of two kids who struggles with daycare and a tough job 10 hours a day with 2 hours of commute time would like to buy their kids some ice cream and "bad" food to escape from the terrible life they have, rather than eat some broccoli or toasted kale. Let's have some sympathy.

<comment><USER4> > Those living under the poverty line don't like being hit with condescending > statements coming from those who are supposedly trying to help them, either.

So what? leave corporations feed them with junk food and ruin their health?

When I was a kid, we drank Coke at every meal and I'm literally paying for it as an adult - and it certainly didn't make me an happier kid. I wish our government had done something to avoid the damage (whether through taxation or information).

> Sometimes the single father or mother of two kids who struggles with daycare > and a tough job 10 hours a day with 2 hours of commute time would like to > buy their kids some ice cream and "bad" food to escape from the terrible > life they have, rather than eat some broccoli or toasted kale.

There is a middle ground between ice cream and broccoli. And believe it or not, eating healthy food would make their life _much_ better, regardless their commute time.

<comment><USER5> > So what? leave corporations feed them with junk food and ruin their health?

One possible option is to offer people information and resources to guide them towards what we might prefer. A lot of farmer's markets and groceries in my area offer a 50% discount on produce for customers paying via EBT or SNAP, for example.

</comment></comment></comment></comment><comment><USER6> As an American who lived in Brazil for 8 years, honestly I'm not sure this is any worse than traditional food.

A typical Brazilian lunch is a piece of meat with beans, sides of rice, french fries, and fried flour (farofa) -- that's right, 3 carbs of empty calories (2 fried) and no real vegetables -- all washed down with mostly-added-sugar "fruit juice concentrate" (cashew apple is really common). Bar snacks are 100% deep-fried, or "pizza" with copious amounts of sugary ketchup (don't ask). Desserts are the sweetest things your tongue has ever touched -- brigadeiros, pudim, essentially all just super-sweet condensed milk.

It's not like the traditional Brazilian diet is full of fresh veggies or nutritional variety at all. I mean, I thought us Americans loved our french fries... but the Brazilians have got us beat!

<comment><USER7> As a Brazilian-American who spent many years in both countries from the 1980s until today, you're misrepresenting things a bit.

First of all, the juice concentrates are a newish thing, 20 years ago it was still common to make fruit juice from scratch at home every day. Also, farofa is fried (more like sauteed, it doesn't need that much oil) _yucca_ flour, which is a world away from refined white flour. Growing up, lunch was a large salad along with rice, beans, a cooked vegetable and some kind of meat or fish.

I fully admit that Brazil really took to fast food and it's just as terrible as it is anywhere, but your analysis of "traditional" Brazilian food is quite myopic and probably influenced by your own white-collar professional tendencies towards convenience foods.

<comment><USER8> Fruit juice is pretty bad on the calories regardless of added sugar or not. I mean, the sugar doesn't help, and has other bad effects (teeth, most notably).

But the issue with fruit juice is just how much fruit you need to make it. One glass of apple juice is 3-4 apples. An apple is 60-80 calories. That makes that glass about 300 calories, which is ridiculous.

It's a bit less bad with orange juice, although like lemon juice it has other problems (they're very acidic, at least as bad as coke).

So one glass of juice should be somewhere between 20-25% of your total meal calorie intake. As in, if you drink (one glass) of juice, 2 loaves of bread is now your limit. With water, you can do 3.

But the sugar. Well, the sugar takes the 250-300 calorie glass to 300-350. Not good, but ... not going to make the difference. That's like taking a bit more jam on the sandwich.

<comment><USER9> Where have you seen a glass of apple juice with 300 kcal? In my (European) experience it's barely a hundred or so. Is this some American version that consists of vaguely apple-flavored sugar or something? I'm actually slightly envious because I'm a tad underweight (and with a very low body fat percentage) and find gaining weight difficult.

<comment><USER10> Fresh squeezed orange juice is 110 calories per 8 oz serving. But most people in America would drink a glass more like twice that size.

<comment><USER9> I guess it's mostly just a difference in volume then. Google tells me 8 oz translates to about 230 ml, that's pretty much the average glass of juice around here.

<comment><USER11> People would complain if a resteraunt give them such a small glass. 12 oz / 350 ml is much more common drinking glass size here.

People going to McDonalds for soda get 32 ounce / 950 ml

Some crazy sizes here...

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> Japan seems to have fought this off. Japan has explicitly rejected "fat acceptance" as public policy. Under the 2008 "Metabo Law", everyone between 40 and 75 is weighed and measured annually and sent to counseling if overweight. Employers are involved and apply pressure to employees.

<comment><USER8> > Employers are involved and apply pressure to employees.

That sounds like hell.

<comment><USER13> It is hell, for someone not used to it or someone over the fat line. Google "Japan fat shaming" for some idea of how abusive they are toward fat people culturally. They're not the only ones though, South Korea and China also have weaker variations of aggressive cultural fat shaming.

<comment><USER14> I'm curious: How is "fat shaming" applied to sumo wrestlers? They are probably big (no pun intended) stars in Japan.

<comment><USER13> As you would imagine with most nations and cultural extremes that benefit entertainment or celebrity, it's an exception. Being obese for the purpose of Sumo, is regarded as entirely different versus being obese because of poor discipline / lifestyle reasons.

</comment></comment></comment></comment></comment><comment><USER15> I saw McDonalds being built in dirt-street towns in Guatemala, I saw lines three blocks long at KFC in South America, and I've seen many Porsches and Ferrarris in the parking lots of American fast food joints in third world countries.

I am utterly shocked they have not moved into Africa yet.

I've just driven tens of thousands of miles through 17 countries without a single Mcdonalds. Between Morocco and South Africa, there were none [1]. I am shocked they are not in at least Nigeria, Cameroon, Ivory Coast, Ghana, etc.

I wonder if that's the longest distance in the world that can be driven without one. Or at least the most consecutive countries.

(checkout the map) [1] [https://en.wikipedia.org/wiki/List_of_countries_with_McDonal...](https://en.wikipedia.org/wiki/List_of_countries_with_McDonald's_restaurants)

<comment><USER16> There was a KFC in Accra back in 2011 or so when I was there, so they are definitely in Ghana, at least.

<comment><USER17> KFC seems to be the easiest American fast-food to take global, given the lack of cultural or religious prohibitions against consuming chicken. I've seen it all over Asia at least.

</comment></comment></comment><comment><USER18> I think it's also important to point out that it's not just "western fast food" conglomerates doing all the damage. Frito Lay (Pepsi Co.) had its job cut out for them by local junk food producers so they simply bought them out and stuck their logo on the bag. Bimbo which is a Mexican giant in the processed food industry has been doing exactly the same all across the Andean region.

Another very important thing to keep in mind which this article fails to mention is the influence of all the free trade agreements which were signed by countries like Colombia and Perú in recent years. Now it's become more affordable than ever to export "goods" from the U.S into these emerging markets without paying any import duties. That is why you now find supermarkets in emerging nations that bare a strikingly resemblance to their american counterparts. A quick glance through the frozen food section will reveal items that weren't even part of the local diet just a few years ago such as pot pies and tater tots.

</comment><comment><USER19> I find the title of this link quite funny: Brazil is a western country, even more "west" than Switzerland, where Nestle is from, and with very similar culture to that of Western Europe and the US.

Not only that, but Nestle has been in Brazil for almost a century now.

</comment><comment><USER20> Not to mention we brazilians have been bombarded with fast-food joints in the past few years. My little hometown with no more than 90k habitants got its first Subway. And last year the first Taco Bell in the country came to São Paulo. This is the only one I would miss actually, as I've had enough from the traditional fast-food places.

</comment><comment><USER21> they claim that a universal income (bolsa familia) is responsible for poor people buying tons of sugary foods. in reality that universal income allows poor people to not starve. why do they buy crap food? because that's what middle class is also eating. why? because of recently unregulated and rampant advertising.

</comment><comment><USER22> How do you hook people on better tasting food? You let them try it.

<comment><USER23> Indeed, just like drug pushers.

</comment></comment><comment><USER24> This makes me sad for Brazil.

I have heard, though cannot confirm myself, that Japan had one of the healthiest societies in the world until fast food expanded there a couple decades ago, causing many problems common in the States, like obesity and diabetes and blood pressure issues, to significantly increase in frequency there.

<comment><USER13> It's worth noting that Latin America has plenty of nations that have struggled with obesity due to poor local diets even longer than the US has, including Mexico, Chile, Belize, Brazil and El Salvador. The US obesity problem began in the late 1980s.

</comment></comment><comment><USER21> title is completely off. its not fast food (Mcdonalds, wendy, etc) but junk food (nestle, kellogs, kraft, etc)

<comment><USER25> The article focuses on junk food, but it's both.

Until recently in medium-sized Brazilian cities, the only fast food chains an American would recognize are McDonald's and Subway. This changed since the last two years. In a short span of time I saw new franchises of KFC, Pizza Hut, Domino's and Burger King.

<comment><USER21> those companies are there for at least 10 years! at least! pizza hut over 15. kfc over 10. bk over 7.

...but well, those companies increasing presence explain why the corrupt coup government rushing to sell the country just passed laws removing low-wage workers protection.

</comment></comment></comment><comment><USER26> So, Brazil is not a Western country? I guess the entire Europe is The East now. Also, why wouldn't they? It's a big market. Everyone loves fast food even though you'll never see anyone admit it.

<comment><USER27> I'm sure you know this, but "Western country" doesn't strictly refer to a geographical location. [https://en.wikipedia.org/wiki/Western_world](https://en.wikipedia.org/wiki/Western_world)

</comment></comment><comment><USER28> In Israel fast food costs more than normal food. Vegetables are relatively cheep to the US ($3 for avocado??) And in general "fast" food is not a value people appreciate over "healthy". One of the ways to fight obesity is by taxation and lowering the costs of healthy food. When salad will cost less than a burger (and there's no economic reason it shouldn't) people will choose it.

<comment><USER29> Not sure where you're seeing the $3 avocados. Even in SV, it's like $1 per unless things have changed in the last several weeks.

<comment><USER28> NYC, and untill recently every whole foods store

<comment><USER29> [https://www.hassavocadoboard.com/retail/volume-and-price- dat...](https://www.hassavocadoboard.com/retail/volume-and-price-data)

This aligns with my recent shopping experience.

<comment><USER28> I think you're missing the point of vegetables being expensive in the US. If you think these prices are normal than allow me to disagree.

[https://www.nytimes.com/2017/08/28/business/amazon-whole- foo...](https://www.nytimes.com/2017/08/28/business/amazon-whole-foods- cheaper-prices.html)

[https://imgur.com/a/6yozr](https://imgur.com/a/6yozr)

<comment><USER11> Avacados happen to be one of the more expensive vegetables.. and the price is highly seasonal. You should see them for $0.8 to $1.2 "in season" and $1.5 to $2.5 "out of season". Perhaps an additional tax if you live in a big city.

if you want to talk about vegetable affordability, lets start with lettuce, carrots, and broccoli.

</comment></comment></comment></comment></comment></comment><comment><USER30> Change the title to reflect the focus on fast food (use The NY Times headline).

</comment><comment><USER31> I don't doubt that this is all true, but he diet pre-Nestle was hardly superb, Brigadeiro, flan, lots of meat, croquettes, tons of bread... you could do plenty of harm with those traditional foods. What the were not however, was heavily and aggressively marketed, ultra-cheap, and essentially never spoil.

<comment><USER32> The traditional meal of beans, rice, meat and veggies, is much better than a lot of countries.

Even the "junk" foods you mention are still considerably better than empty corporate garbage like cheetos and soda pop.

<comment><USER31> I think you'd be surprised on the snack front, but soda is addictive poison, that's true enough. The issue with the traditional diet is that it only worked when food was somewhat scarce. Even without the influx of 1st World crap accelerating the obesity/diabetes issue, those problems would remain.

I'm not denying the role of Coke, Nestle, McDonalds, etc in amplifying an existing problem into a full blown catastrophe however.</comment></comment></comment>


Utah governor says he will approve strictest DUI limit in U.S. - <AUTHOR> https://lasvegassun.com/news/2017/mar/23/utah-governor-says-he-will-approve-strictest-dui-l/ <comment><USER2> _Republican Gov. Gary Herbert said he plans to approve the measure lowering the blood alcohol limit for most drivers to .05 percent from .08 percent and that it will save lives.

Opponents had urged him to veto the bill, saying it would punish responsible drinkers and burnish Utah's reputation as a Mormon-majority state that's unfriendly for those who drink alcohol._

This merely puts Utah practice in line with practice on the Old Continent. You do ask about the punishment for those who are caught. What you'd like to see is several years in prison for the first offense, something that you don't shrug off on one buttcheek, because drunk drivers are killers.</comment>


Tiny USB business card - <AUTHOR> http://hackaday.com/2010/10/29/tiny-usb-business-card/ <comment><USER4> If you're interested in some of the security implications of this there were a few related talks from DEFCON18:

* [https://www.defcon.org/html/links/dc-archives/dc-18-archive....](https://www.defcon.org/html/links/dc-archives/dc-18-archive.html#Crenshaw)

* [https://www.defcon.org/html/links/dc-archives/dc-18-archive....](https://www.defcon.org/html/links/dc-archives/dc-18-archive.html#Elkins)

* [https://www.defcon.org/html/links/dc-archives/dc-18-archive....](https://www.defcon.org/html/links/dc-archives/dc-18-archive.html#Honeywell)

The upshot is that anything with a USB connector can be any device it wants to be--you have to trust any hardware you plug into your machine.

<comment><USER5> That something like this is a security threat is without question - <USER2> addition to the defcon presentations, a variety designed to attack has been featured on the popular usb interface site users projects list for some time. Odds are the technique has already owned at least a few folks.

I'm sure the creator of the card is a fine guy, and the short time it'd be inserted along with him standing right there and your active attention means it's practically pretty safe.

The party line in security is that once an attacker has physical access to the computer compromise is so trivial mitigating any specific attack is a waste of time. That's certainly true right now: firewire, PCI-E and hard drive removal are much more dangerous. But it's more of a philosophy than a logical truth - security is really just the practice of raising the bar enough to counter the level of threat. The fact that critical computers aren't connected to the internet or any network at all doesn't stop OS vendors from spending countless hours fixing exploits.

Someday a bus design like this will seem hopelessly niave and be long gone just like telnet and analog cell phones. Virtually all attacks right now involve holes with well defined solutions - think 802.1x, DNSSEC, http and smart cards. But adoption is usually glacial and universal adoption would only lead to new holes being exploited.

The potential for USB attacks goes far beyond a simple HID controller. Any serious attacker would disguise or hide a device in a way that would make it easy to include a few more chips and a much more sophisticated design. Include a benign real device that matches whatever function the user expects - <USER3> drive, mouse, etc. Wait some time before attaching the keyboard service suspicion - at the same time connect a serial class as well allowing a reliable command channel after just "typing" a two or three line script. Send over a better native command program, maybe wait until the user idles, mount storage or replace existing flash blocks with privesc exploits, rootkits, etc. A modern, well administered system may be difficult to exploit directly as a user. Crash or reboot the OS, possibly including a crash dump or hybrid sleep first for later access to kernel data. Once the usb bus resets, provide a variety of usb storage types for the BIOS to find - one will usually preempt the main hdd with a linux image that would show an OS appropriate boot animation perhaps with a filesystem check to explain any delay. At this point it could grab the BIOS image and repack it with a ROM root kit and reflash it or replace ethernet, video or dvd firmware to provide pre-boot or even pre- BIOS control. Attack the boot loader, kernel files or anything else needed to remove code signing requirements or install new certificates, integrity checks, install a good rootkit, etc. Disable the usb storage, pass control to the real boot loader and once full control is confirmed wipe the bad bits of NAND and microcontroller flash, blow an efuse to disable any naughty hardware and you're done.

While that is all highly speculative and sounds complex, it's 100% possible and would be a small amount of work compared to what goes into modern root kits and bot code.

Such an attack is probably not something a common user would ever face though high value targets are often subjected to at least as much effort. All bets are off if someone designed an easy to use version, produced a significant run of them and packaged them nicely. Rootkits have gone from rare and amateur to polished and plug and play and widely used rather quickly.

This spring I was shown a keyboard that included a hardware keylogger with flash, usb serial interface, a tiny microphone and a cmos clock. The chips were on a board identical in size and location of the one normally installed. It was flipped upside down, screw heads stripped clean and glued in, with a number of large industrial staples attaching it to the plastic below. When disassembled the components were found to be covered with thick epoxy. At some point during the initial investigation a trace to a small battery was broken and a SIM was destroyed. The bootstrap passed some code through the smart card and a majority of the controller and secondary flash were encrypted.

As interesting as the design was, even many dead simple gadgets require more technical expertise to create. I was told that the design was very similar to a popular commercially available keylogger minus the smart card and mic. You can find them for $100 or less many spots on the web.

The most striking fact is that the victim purchased the keyboard themselves from a well known US web store as an OEM keyboard. It was delivered to his door by UPS, it was the style ordered, shrink wrapped, and included another item that was legit. Suspicion arose because the keyboard quality was low and appeared counterfeit. When connected, it displayed a device name that included some unicode and some garbage at the end that included some simple shell code.

The user didn't know why he'd been targeted and lacked any typical high risk factors or usual motivations for attack. The source was never identified, no similar kit was found in the retailer's stock. The item had sat in the users wish list at the retailer for several months before being ordered. The victim reported a sophisticated attack occurring nine months prior, no evidence was found of an existing intrusion. Law enforcement suspected it had been included accidentally before leaving china and likely is produced on the same line as benign versions.

</comment></comment><comment><USER6> This made me realize that USB keys are not only dangerous because of Windows auto-run.

They could also emulate USB HUB with keyboard/mouse to send input required to run exploit off the drive and click through all UAC warnings.

<comment><USER7> Happily, that can't spread via malware - and would be visible to the user, though a long delay could possibly avoid that (is there any way for a device connected via usb to figure out when the computer is idle?). But yes, when you plug something in to your computer, you are explicitly saying that you trust that it is what it claims to be, before even thinking about what nasty things it may be holding in its memory. Or whether it may be wired to short out the usb port, or the computer it's attached to.

<comment><USER8> Well, waiting 30 minutes after the last keypress could help.

</comment></comment></comment><comment><USER9> I would take a pass on adding his information -

       Stuxnet was first detected in June by a security firm
       based in Belarus, but may have been circulating since
       2009.

       Unlike most viruses, the worm targets systems that are
       traditionally not connected to the internet for security
       reasons.

       Instead it infects Windows machines via USB keys -
       commonly used to move files around - infected with
       malware.

<comment><USER10> Except in this case the "business card" emulates a USB HID keyboard. No autorun, no file storage. Although the HID device could send some malicious keystrokes I suppose.

<comment><USER9> You don't know what it does until you plug it in.

<comment><USER11> You don't necessarily know what it did even _after_ you plugged it in.

What You Saw Is (not necessary) What You Got.

<comment><USER12> This is actually an incredibly important point. The Trojan Horse worked for a reason. Many seemingly beneficial pieces of code also do some very malicious things: one of the best ways to hide is in plain sight.

</comment></comment></comment></comment></comment><comment><USER13> First off, I think this is super cool. It's a novel and interesting take on a very boring but necessary concept, and he's taken the time to get the design looking nice as well -- he could easily have just soldered an attiny to a USB connector, and that wouldn't have had the same charm.

Secondly, it seems the security implications are very slightly more severe than one might think. The card only activates when you press caps lock three times. This means it must be able to receive key presses, as well as to send them. From my understanding of his description, keyboard HID devices which support the boot protocol profile also receive notification of key presses ([http://frank.circleofcurrent.com/cache/usbbusinesscard_detai...](http://frank.circleofcurrent.com/cache/usbbusinesscard_details.htm) and search 'boot protocol'). So in theory this could record everything you typed, as well as do destructive things to your computer. And of course storage is not an issue as it's likely that the host is connected to the Internet.

It seems borderline paranoid to think like this w.r.t. someone's business card, though.

<comment><USER14> According to a comment on the parent article, all USB keyboards receive the standard 3 lock keys so they can toggle state (think LED lights): Caps Lock, Num Lock, Scroll Lock

If true, this is why the author chose to use Caps Lock over a different key. I can't claim whether that is true or not but it puts a damper on the USB keyboard security concerns.

<comment><USER15> You are correct.

There are a few other small triggers that the keyboard can also potentially receive, but those 3 are the most common.

HID in general can be set up to receive more data, but there aren't any "normal" devices with built-in drivers that utilize a lot of bi-directional data transfer. (I've been looking to create a "driverless" "serial port" using HID communication, tx is easy (keyboard type), but rx is hard (bitbanging using the 3 LEDs? eh....)

<comment><USER4> > I've been looking to create a "driverless" "serial port" using HID > communication

When you say "driverless" do you want it to act as an actual serial port or just provide bi-directional data transfer for a userland program?

I think there's a standard V-USB example that provides driver-less bi- directional data transfer via reports.

I adapted the example to work with the Arduino and a Python script. Some details are in the entry dated 22 October 2009 here: <http://code.rancidbacon.com/ProjectLogArduinoUSB> The code is online as the UsbStream example available in the download from here: <http://code.google.com/p/vusb-for-arduino/downloads/list>

</comment></comment></comment></comment><comment><USER16> The actual page:

<http://www.frank-zhao.com/card/>

</comment><comment><USER17> Anybody know how much these things cost once you order them in bulk?

Apparently you can get those business-card CDs for under a buck each if you order over a thousand. More sane quantities will probably run you $3/each.

</comment><comment><USER18> In case anyone is interested, here's essentially the same idea from months ago:

<http://news.ycombinator.com/item?id=1435640>

There was significant discussion from an even earlier submission: <http://news.ycombinator.com/item?id=1377651>

It was also submitted again, but with no discussion: <http://news.ycombinator.com/item?id=1383888>

</comment><comment><USER19> This is a slightly older card with a lot more interesting stuff on it than a text file:

<http://t4f.org/en/projects/business-card></comment>


Fastmail is down (again) - <AUTHOR> https://www.fastmailstatus.com/services/general <comment><AUTHOR> Considering this is the second time in one month, I think I will be transferring to some other provider.

</comment><comment><USER2> Works for me</comment>


How to explain zero-knowledge protocols to your children (1998) [pdf] - <AUTHOR> http://pages.cs.wisc.edu/~mkowalcz/628.pdf

<comment><USER3> I love this. It could be one of the stories the [Young Lady's Illustrated Primer might tell Princess Nell]([http://enwp.org/The_Diamond_Age](http://enwp.org/The_Diamond_Age)) when she ventures forth from Castle Turing.

<comment><USER4> The finest book I've ever read. Perhaps by the time my 2-year-old is ~13, a nano-scale machinebook will exist that can teach the both of us about zero- knowledge protocols. I understand, at the surface level, how it works, but am far too dense to see how such a system could exist in, say, computer authentication.

<comment><USER5> Hm, is it that good??? I've read only 2 NS novels and really loved them (Cryptonomicon & SnowCrash).

<comment><USER6> The Diamond Age is my favorite, by far, of the work of his that I've read (including the two you mentioned). It's very very good. I like the way he imagines a world where everyone can print whatever they need from The Feed (nanomachines + materials), and yet it's so different from the techno-utopias we have seen before where such is possible.

Most importantly, I really liked the characters (just like I did in Snow Crash). It's interesting in that there doesn't seem to be an antagonist, really -- it's more about the journey of the young lady. It's a neat fairy tale.

<comment><USER7> I never really noticed the "no antagonist" until you just mentioned it - <USER2> find that's a sign of maturity in a literary work - a story can be riveting by just seeing different people/organizations in contention with their own aims - not the simplistic good vs. evil trope.

</comment></comment></comment></comment></comment><comment><USER8> Can someone give some background on zero knowledge protocols and how this pdf relates to the protocol?

<comment><USER9> A good definition from the PDF:

 _He wanted, in fact, to show that it is possible to convince without revealing, and so without unveiling his secret._

Or from wikipedia [1]:

 _In cryptography, a zero-knowledge proof or zero-knowledge protocol is a method by which one party (the prover) can prove to another party (the verifier) that a given statement is true, without conveying any information apart from the fact that the statement is indeed true._

[1] [http://en.wikipedia.org/wiki/Zero- knowledge_proof](http://en.wikipedia.org/wiki/Zero-knowledge_proof)

<comment><USER10> I think the privacy component is also important (somehow hidden in "without unveiling his secret", but not so clear imo). When Alice proves her knowledge to Bob, no external party would "believe in the proof", as A & B might have colluded.</comment></comment></comment>


Saving 500 Apple II Programs from Oblivion - <AUTHOR> http://blog.archive.org/2016/03/04/saving-500-apple-ii-programs-from-oblivion/ <comment><USER2> PoC||GTFO 0x10 had a great article on the copy protection mechanisms these programs use. [https://www.alchemistowl.org/pocorgtfo/](https://www.alchemistowl.org/pocorgtfo/)

</comment><comment><USER3> >remove the copy protection that prevents them from being digitized

In other words, cutting that little square of plastic off of the top right corner of the 5.25" disks? I distinctly remember learning that skill myself.

<comment><USER4> That's WRITE protect. Copy protection is something quite different, and will not be thwarted by punching out a little notch. Back in the days when people reasonably expected to be paid for software, nearly as much ingenuity went into the copy protection as went into the software, and everything from obfuscated or self-modifying code to invalidly formatted disks to exotic disk speeds to writing bits of the software in tracks flagged as "bad" was done.

<comment><USER5> Yep. In those days you could re-enable write protect with little stickers over the notch. It's hard to imagine people putting little paper-world stickers on their SD cards before shoving them in their shiny devices these days!

<comment><USER6> I still have sheets of those stickers. They are perfect for putting on laptop webcams.</comment></comment></comment></comment>


Google buying Songza - <AUTHOR> http://songza.com/google

<comment><USER2> I do not exactly know I feel about this..</comment>


Show HN: Mobile-First FB, IG and Google Ads Manager - <AUTHOR> https://otis.ai/?ref=hackernews <comment><AUTHOR> I put up a functionality GIF here: [https://www.producthunt.com/upcoming/otis- ai](https://www.producthunt.com/upcoming/otis-ai)</comment>


Category Theory for Programmers [pdf] - <AUTHOR> https://unglueit-files.s3.amazonaws.com/ebf/e90890f0a6ea420c9825657d6f3a851d.pdf <comment><USER2> He also has a three videos series about it on youtube.

[https://www.youtube.com/user/DrBartosz/playlists](https://www.youtube.com/user/DrBartosz/playlists)</comment>


ReKognition's Free Face Detection API better than Facebook/Face.com - <AUTHOR> https://sphotos-a.xx.fbcdn.net/hphotos-snc7/581047_345870535501848_1191830577_n.jpg

<comment><USER2> Pretty cool! I have tried other apis, but most of them only detect 3 faces. Face.com is the best one which could detect 4 faces.</comment>


Voice Recognition Software Beats Humans at Typing - <AUTHOR> http://www.npr.org/sections/alltechconsidered/2016/08/24/491156218/voice-recognition-software-finally-beats-humans-at-typing-study-finds?href= <comment><USER2> "Beats humans at typing" is a super misleading title. I'm a hobbyist stenographer and I'm always interested in advances in voice recognition. But this is just a little test without much merit, in my opinion.

A couple points:

\- "Typing" isn't what I'd call whatever people do while tapping away at a touchscreen keyboard. There are different actions, including swiping and tapping, but without hardware, "typing" is misleading.

\- Human typing speed is variable. Many people type below 50 words per minute, but others break the 100 words per minute barrier (or more in the case of prodigies like Sean Wrona).

\- To ever use this for captioning or court reporting, we'd have to overcome stenography, which is exceeding 200 words per minute. We're on a totally different level now.

If anyone wants to learn about stenography or try it out on their own keyboard for fun, check out our open source efforts at [http://opensteno.org](http://opensteno.org)

</comment><comment><USER3> I've always found it funny how strange dictating to a device is relative to typing.

I can speak to real person with ease, but talking to a device makes my ideas jumbled.

I guess dictation is a skill like anything else.

<comment><USER4> A big part of this is that typing and dictation are very different from conversation. Conversation is free flow, very flexible to errors (since people can infer each other's true meaning) and interactive. However, in both typing and dictating, your end product is often meant to be read and so must be error free.

For dictating this means planning ahead to make sure that the sentence is well-formed. Have you watched yourself type? There's a lot of backtracking, erases and restarts. The feedback from dictating is also slower, which then affects your input rate. If you do manage to ignore this and speak free flow, even with perfect recognition (which is impossible even for humans), you will have to go back and edit grammatical and cohesion errors.

The advantages of typing are faster feedback (this is unavoidable as the computational needs will always be less), working memory augmentation and better nonlinearity for edits.

When you take into account all that, the time to correct grammatical and spelling errors, to edit for comprehensibility, I doubt that speaking will come out ahead because input bandwidth is only the bottleneck for trivial pieces.

<comment><USER5> As someone who hates typing on mobile, but also dislikes speaking on mobile even when it correctly and easily transcribes my voice, you're definitely on point with the "why".

With that said, i think voice can still be superior, but perhaps i'm biased. I think what we need is an improved UX. Voice can handle the free flow part, but imagine being able to easily modify the context of the conversation via a few simple buttons. Maybe an undo button based on some context aware value _(ie, not just words)_ , and etc. The goal being to augment our ability to correct mistakes, or change the flow of the conversation.

I'm a prime example of why voice "typing" is difficult, i tend to misspeak very frequently. When using my voice, i often need to pause - which then usually causes the voice program to stop transcribing /eyeroll. Regardless, i still want to see it succeed, and think it can overall.

</comment></comment></comment><comment><USER6> The main problem with voice regognition for me is privacy. I mostly use my phone to write when I'm in public and wouldn't want everyone around me to hear what I'm doing.

<comment><USER7> I know a lot of people who used to get upset about kids ignoring conversations for their "texting machines" and those same people now will dictate a text message in the middle of a conversation and give me the look like IM the one ruining their text conversation.

</comment></comment><comment><USER8> "on a mobile device". Talk about tying your hands. I'm sure on a real keyboard with a competent typist, there's still no contest - the typist will win.

<comment><USER9> Doubly so if it's a stenotype (typist?).

<comment><USER10> I love how tech types rage against the future every time voice recognition is discussed.

How many people know steno? No one you know, but hey that's how we chew the fat on the Internet. How many of the 7 billion people can type?

People already effectively use dictation. John Siracusa used Dragon to write his 20,000 word Mac OS reviews:

[http://arstechnica.com/apple/2013/10/os-x-10-9/23/](http://arstechnica.com/apple/2013/10/os-x-10-9/23/)

David Pogue has been using dictation for years:

[https://youtu.be/x0GXX-SJuQM](https://youtu.be/x0GXX-SJuQM)

Software developers have even cobbled together voice programming solutions:

[http://ergoemacs.org/emacs/using_voice_to_code.html](http://ergoemacs.org/emacs/using_voice_to_code.html)

[https://www.extrahop.com/community/blog/2014/programming- by-...](https://www.extrahop.com/community/blog/2014/programming-by-voice- staying-productive-without-harming-yourself/)

[http://web.stanford.edu/~ouster/cgi- bin/wrist.php](http://web.stanford.edu/~ouster/cgi-bin/wrist.php) \- Creator of Tcl/Tk has had RSI for a couple decades.

Also, let me throw out my standard response: "No one said..." that you have to use a keyboard or voice dictation, you have the option of using both solutions.

<comment><USER2> I'm really splitting hairs here, you have valid points but…I use a steno machine to write code all day. I know, I'm probably the only one. But steno was forever locked up in proprietary industry until only very, very recently when Plover came to be. There are more and more people learning it every day. I'm hopeful that it will be comparable to the number of people using Dragon and the like. Sure, it won't replace the QWERTY keyboard, but at least people won't say "a what?" when I tell them I write on a steno machine.

<comment><USER10> The chorded keyboard idea is definitely interesting but voice recognition is what most people will use.

People don't always want to simply type fast. Imagine other use case cases, like designers, for example. They might be using a Wacom tablet and need to reach for the keyboard to "create a new layer", "change font to San Francisco", "50x100 rectangle", etc. Wouldn't voice recognition be much easier?

Here's an interesting study on chorded keyboards:

[http://www.billbuxton.com/input06.ChordKeyboards.pdf](http://www.billbuxton.com/input06.ChordKeyboards.pdf)

<comment><USER2> Thanks for that. Yes, speech control seems really natural for certain tasks, like a painting program especially where you use few and distinct words. The VR painting programs come to mind.

That case study interests me, but it really glazes over stenotype and palantype. I'll email Bill and see if I can get a discussion going. Cheers

</comment></comment></comment></comment></comment></comment><comment><USER11> The problem at least on iOS is that at least the last time I tried it it doesn't recognize when I'm switching languages for some words. This is extremely annoying when asking for a song with an english song title.

Another issue is that it doesn't recognize my dialect. I don't want to talk differently just so a computer understands me.

And last (this is also an issue with autocorrect!) it doesn't like at all when I'm using nonce words. I feel like the cause is that they seem to be not as common in English as in German, and compound words are usually written as two or more words instead of one.

</comment><comment><USER12> Ok, but this comparison seems a bit unfair since there are tools to "type" words faster like Swipe-to-Type. I mean, it has been literally years since I typed continuously character by character in the old-fashion way (there are always words that are not part of the dictionary and you have to type them character by character).

I have even found that it's faster for me to switch the language of the keyboard and keep using Swipe-to-Type than typing in the classic way.

<comment><USER13> I feel like autocorrect has made me less accurate because it often picks the wrong word and I have to go back and fix it. I can't get used to swipe-to- type.

<comment><USER12> Do you know mechanography? I know some people that can't get used to it too and I think it's because they haven't learned by heart the distribution of the keys (something that someone capable of typing with both hands on a desktop keyboard knows)

</comment></comment></comment><comment><USER14> Hopefully they can use this for closed captioning.

A few years ago, for some work-related thing, I was looking at closed captioning for various TV channels. One channel had the most bizarre gibberish in there. What the heck... was there an error in decoding? But the words seemed like english words. Upon closer inspection, I realized that if you pronounce the gibberish sequence of words, the sounds made sense. Turns out it was a bad job of automated speech recognition.

<comment><USER15> Youtube does this. It's useful even when it's not 100%.

[https://support.google.com/youtube/answer/6373554?hl=en- GB](https://support.google.com/youtube/answer/6373554?hl=en-GB)

It also produces amusing gibberish if the accents are strong enough.

</comment></comment><comment><USER16> Interesting. I wonder how that stacks up against retention. I mean, part of the weird inter-connetivity of the brain relates to vocabulary and speech but tying that together with motor skills (printing, cursive, or in some ways typing) are, I think, pretty established. I think dictation is useful, sure. However, if people end up writing the way they talk, I hope the software auto- crops "uhhhs" and some other errata.

</comment><comment><USER17> I use voice recognition for taking notes whilst on the move. Although good for short sentences, a lot of improvement is needed before i could, for example, dictate a document. Punctuation is an example of a weak area.

There are also certain words and phrases that it gets wrong much of the time. I have learnt to not use these when making voice notes. There's definitely a learning curve to use voice effectively.

</comment><comment><USER18> Don't think that will work for me; when I try voice recognition it gets so many words wrong that you can't even guess what the original input was. I don't have a speech impediment but voice recognition neural nets sure think I do. Also I type faster than most people speak when they are not trying hard to speak as fast as possible. I bet that's the case for many people here.

<comment><USER19> At least when your typing, you get a word wrong and immediately fix it. With Voice Recognition, you have to parse back through the whole message and pick out the corrections one at a time, many corrections if it has a 20.4% error rate.

Humans don't do well with that, they look at something and their brain fills it in correctly for them, it's easy to miss typos in your own work. When I used to do helpdesk and someone had password problems I'd have them retype their usernames, because they would not notice it was wrong, but it was often the problem.

<comment><USER20> Actually, you are a better typer, generally, if you do not correct mistakes as you make them. Reasons being: a) the computer can often just fix it for you and b) you shouldn't be looking at where you are typing if you really want speed.

<comment><USER19> Most of my typing is technical commands and jargon.

</comment></comment></comment></comment><comment><USER21> Other unsolved problems in natural language processing: [https://en.wikipedia.org/wiki/Natural_language_processing#Ma...](https://en.wikipedia.org/wiki/Natural_language_processing#Major_tasks)

One that bugs me is proofreading. It seems like the tools in Microsoft word could do a lot more to catch and fix mistakes and with higher accuracy.

</comment><comment><USER22> Big disclaimer for me was that dictation was faster than typing _on iPhones_. Doesn't look like they even used swype!

<comment><USER10> They claim that it's three times faster than typing with your thumbs and autocompletion. How much faster is swype than typing? Do the math.

</comment></comment><comment><USER23> A friend of mine will repeatedly text back and forth using voice recognition and then gets frustrated when responses come slower or dont answer the question than they would like.

I'm just like stop texting and call the person then!

<comment><USER24> True, but you miss the searchability of text if you call someone. Plus, calling interrupts people, and usually my text chatter isn't important enough for a phone call.

</comment></comment><comment><USER15> Something I've wondered about is if it would help if I could talk and type at the same time and it could use that to correct errors by cross referencing the two data sources.

</comment><comment><USER25> This is a mobile keyboard no? The story is misleading imo. It will be interesting to see how this holds up against a regular keyboard on a laptop.

</comment><comment><USER26> I get tired while dictating, I don't get tired while typing.

I also have speakers with music playing</comment>


Small Refactorings in Ruby - <AUTHOR> http://caiustheory.com/some-small-refactorings-in-ruby <comment><USER2> I enjoyed reading that, thanks.

One thing: replacing

        def my_method
          @foo == :bar ? :foo_matches : nil
        end

with

        def my_method
          :foo_matches if @foo == :bar
        end

doesn't look like an improvement to me. The first style is direct and readable, and lowers the barrier of entry to understand it. The second one requires to be familiar with the subtleties of Ruby, which adds difficulty when you're working with multiple languages daily or getting started with Ruby. I'm not saying you should avoid pushing Ruby to its best capabilities so that it's readable by any programmer, but in this case, winning 4 characters doesn't seem worth the compromise.

<comment><USER3> I think the example for that is bad, when you look at what it's trying to explain.

       def foo_matches?
         @foo == :bar
       end

It returns true if it does, and false if it doesn't, as opposed to true or nil. Which is miles better than any of those alternatives.

It also failed to consider that the naming of the method and the usage of Ruby naming conventions is just as important as what goes on in the body.

<comment><USER2> Agreed, this is an example where returning true or false would be more useful. I presumed the point was assuming a situation where a method returning either a value or nil would be desirable.

</comment></comment></comment><comment><USER4> I am just not a fan of that pattern of testing the return value of an assignment statement:

      if (( info = details[:info] ))
        ...do something

instead of

      info == details[:info]
      if info
        ... do something

It always looks like somebody typed = instead of ==. Or at the very least, I have to stop and think about what's going on. Yes, I get it, it lets you do something in one line of code, but I think it sacrifices readability and can make the intent ambiguous.

<comment><USER5> Usually there is a convention to put parens around if-assignment clause, so it is detectable.

<comment><USER4> That's interesting, I've never seen that convention in use before. Or at least never picked up on it.

<comment><AUTHOR> Someone on twitter asked me about that convention too - the best explanation I could find was that it's from C, where the compiler will warn you if you have a plain `if (foo = "bar")` in case you typo'd it. But putting double parens around it makes the compiler stop warning you, as you've intended the code to be that way by using a double parens. - [http://stackoverflow.com/questions/3323257/double- parenthese...](http://stackoverflow.com/questions/3323257/double-parentheses- in-sample-code/3323400#3323400) was the explanation I linked on twitter about it.

</comment></comment></comment></comment><comment><USER6> I like using the multiple-equality-comparison technique mentioned as the top example by the OP:

           foo == "bar" || foo == "baz" || foo == :sed || foo == 5
           ["bar", "baz", :sed, 5].include?(foo)

But that just _has_ to be several times slower than the boolean check with the array usage, enough that you wouldn't want this refactoring in a mega-loop, right?

<comment><USER7> > that just has to be several times slower

This is why Matz gave us benchmark:

        steve at thoth in ~/tmp
        $ cat benchmark.rb
        require 'benchmark'

        n = 500000
        Benchmark.bm do |x|
          x.report("==") do
            n.times do
              foo = "lol"
              foo == "bar" || foo == "baz" || foo == :sed || foo == 5
            end
          end

          x.report("include?") do
            n.times do
              foo = "lol"
              ["bar", "baz", :sed, 5].include?(foo)
            end
          end
        end

        steve at thoth in ~/tmp
        $ ruby benchmark.rb
               user     system      total        real
        ==  0.370000   0.000000   0.370000 (  0.367943)
        include?  0.550000   0.000000   0.550000 (  0.551897)

<comment><USER8> Now do it enough to trigger a couple of GC passes, and the #include? version looks even worse.

</comment></comment></comment><comment><USER8> Example #1 is actually a bad thing to do. This creates a new array every time you want to do the comparison. I've fixed multiple open-source libraries who abused this exact method, refactored them into the chained "and" statements, and seen a hefty performance increase as a result (MongoMapper and Haml come to mind)

Example #3 suffers from unbalanced returns and is less clear in its intent than the original (albeit difficult to read) example. Instead, I'd propose:

        def my_method
          @blah == foo && :foo_matches || :no_match
        end

This eliminates the visual problem of adjacent semicolons, while still being clear and concise.

I'd argue that Example #4 is bad because it hides the expectation that nil should be returned in the negative case.

</comment><comment><USER9> > name = details[:info] && details[:info][:name]

If you have ActiveSupport, then:

> name = details[:info].try {|hash| hash[:name]}

<comment><AUTHOR> Object#try should work in plain 1.9 too, although I'm not sure I'd have reached for it in this case. This was more about showing the DRYing up a (visual) pattern across two lines into a different construct though, so perhaps I would've used try if it was just one line somewhere in my code.

That said, I didn't know try could take a block instead of a symbol, so thanks for sharing :-)</comment></comment>


A robot that once said it would destroy humans became the first robot citizen - <AUTHOR> http://www.businessinsider.com/sophia-robot-citizenship-in-saudi-arabia-the-first-of-its-kind-2017-10 <comment><USER2> Oh lord - here come the cylons :-O</comment>


Applying the Lean Startup to Mobile: Tips from Instagram & Foursquare - <AUTHOR> http://www.andrewcross.ca/2012/03/16/quick-tips-from-sxsw-for-applying-the-lean-startup-to-mobile/

<comment><USER2> The all or nothing distribution for iOS and Android is something that has bugged me for a long time. It bugged me enough that I developed an "in-app" distribution platform for Android. In a nutshell I wrote an SDK that turns your entire apk into a plugin. A "shell" apk is installed on the phone that can run and update the plugin apk(s). This allows you to change almost anything about the app (not including permissions) and target a single phone, class of phones or all phones for the updates. I licensed the software to a company that needed to tightly manage phones but they have since pivoted away from their previous model.

I am trying to figure out if there is enough of a demand to create a service based on this technology. It seems like web companies have embraced lean startup, A/B testing, etc but I don't see a ton of mobile companies going this direction. This article gives me hope that these ideas are catching on in the mobile world.

If anyone is interested in "in-app" distribution to enable lean style iteration and A/B testing on Android please let me know.

</comment><comment><USER3> And if there's some special 'platform native' special sauce you want to add to the rapidly iterating HTML UI :

[http://wiki.phonegap.com/w/page/36752779/PhoneGap%20Plugins#...](http://wiki.phonegap.com/w/page/36752779/PhoneGap%20Plugins#HowtoInstallPluginsforAllPlatforms)</comment>


Obscure kernel settings to increase performance of Linux TCP servers - <AUTHOR> http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.kernel.obscure.html

<comment><USER2> In general you don't want to screw around with kernel settings. You're just as likely to break something as you are to improve anything. You need to know what you are doing when you venture into this territory, and if you don't, there's not enough info in this post to really guide you.

<comment><USER3> Ideally, thats why you tune on a system that you can "break", in an environment that is replicating the bottleneck/issue you are trying to improve/fix.

Tuning can be fun. Almost as fun as fixing obscure problems with modem AT strings. ;)

</comment></comment><comment><USER4> The one I have been bitten by is the TCP retransmission timeout (RTO). This is the time TCP will wait for an ack before resending some data. This number has to be somewhat conservative because if the RTO is less than the normal round trip latency TCP will be constantly resending packets.

Normally the RTO is set to 200ms. This is conservative in case you have long distance TCP connections. However when your systems are in a same data center environment where round trip times are sub-millisecond the default is two orders of magnitude too high and should be tuned down.

<comment><USER5> Looks like incast. Here's an in-depth article [http://www.snookles.com/slf- blog/2012/01/05/tcp-incast-what-...](http://www.snookles.com/slf- blog/2012/01/05/tcp-incast-what-is-it/) Check out these patches extracted from the original paper site for 2.6/3.0rc kernel lines [https://github.com/vrv/linux-microsecondrto](https://github.com/vrv/linux- microsecondrto)

</comment></comment><comment><USER6> I believe this list is up to date as of July 2002.

<comment><USER7> Worse than that even.

> The default is 0, since this feature is not implemented yet (kernel version > 2.2.12).

2.2.12 was last modified in August of 1999. 2.2.14 was released by January 2000, so it's not like 2.2.12 was around forever.

Don't go screwing around with your kernel settings based on this document.

</comment></comment><comment><USER8> These all seem prime candidates for some kind of learning algorithm (at the very least a naive one). Like TCP's window size scaling, just for settings that are too complex to bother with tuning.

<comment><USER9> At the same time, the default settings have been tweaked by domain experts over decades to be reasonably good for the general case. Not everyone might be interested in shoving a a complex, un-tested, un-debugged learning algorithm into their kernel. Still, interesting proposal . . .

<comment><USER10> You wouldn't necessarily have to run it in-kernel, as these are all configurable from /proc. With a sufficiently complete test environment, you could use machine learning to tune a lot of the params up safely, then just run the resulting config in production.

</comment></comment></comment><comment><USER5> As said elsewhere.... don't adjust the "richness" controls on your kernel unless there's an actual scalability problem costing you $$. Your special "tweaks" will end up using more memory or slowing performance most of the time. sysctls should be sensible by default on RH (cent/sci/cern/aws) and Ubuntu based kernels.

The two most common encountered problems are incast TCP collapse and slow clients.

[https://everythingisdata.wordpress.com/2009/09/25/fine- grain...](https://everythingisdata.wordpress.com/2009/09/25/fine-grained-tcp- retransmissions/)

[http://www.pdl.cmu.edu/Incast/](http://www.pdl.cmu.edu/Incast/)

[http://conferences.sigcomm.org/sigcomm/2009/workshops/wren/p...](http://conferences.sigcomm.org/sigcomm/2009/workshops/wren/papers/p73.pdf)

(For TCP testing: iperf... remember to account for protocol overhead, bits/bytes)

Handling slow clients is app-specific, so there's no general advice other than don't get clever. Clever -> !debuggable -> !maintainable -> !scalable.

</comment><comment><USER11> I don't know where the poster's "performance" came from in the title, the TLDP doc just calls these "obscure settings".

Actually it seems someone just copypasted the whole set of sysctls from the kernel ip-sysctl.txt, as the list includes the most common settings such as net/ipv4/ip_forward, net/ipv4/tcp_keepalive_time and net/ipv4/ip_local_port_range.

</comment><comment><USER12> This is worth noting apart from the crowd:

/proc/sys/net/ipv4/tcp_abort_on_overflow

because figuring out when you need it is awful.</comment>


Assembly programmer writes in C for first time - <AUTHOR> https://gist.github.com/seisvelas/a09fb1650a6bffbd7dc8393edf9462f5 <comment><USER2> This is GAS syntax x86. I am _very_ interested to learn what sort of context you do assembly language programming mainly.

Heh. If this were 10 years ago, we'd be using _register int_ s.

As I'm sure you're aware you can get gcc to emit assembly, quite a few of the answers here seem interesting: [https://stackoverflow.com/questions/137038/how-do-you-get- as...](https://stackoverflow.com/questions/137038/how-do-you-get-assembler- output-from-c-c-source-in-gcc)

You don't need to parallel-install dozens of versions of different compilers to play with them, too: [https://gcc.godbolt.org/](https://gcc.godbolt.org/)

<comment><AUTHOR> I'm a hobbyist, but I'm applying to get into an awesome program called hola<code/> here in CDMX.

<comment><USER2> Oh, that sounds interesting. Definitely hope it works out for you!

I must admit my great curiosity about what path led you to assembly language and _then_ C. In many circumstances it's the other way around.

</comment></comment></comment><comment> crooked-v Next would probably be a while loop using the same setup, then a for loop with the counter reversed (incrementing rather than decrementing), and seeing how the assembly differs in each case. If you were using C++ then next after that would be using an iterator on a vector and mostly taking away direct control of the counter in the process.

</comment><comment><USER3> The latest comment on the gist is gold! It's like watching a conversation in code.

<comment><USER4> TL;DR:

      L_.str:                                 ## @.str

</comment></comment><comment><USER5>
        int ebx = 0;

but

        movl $1, %ebx

.... FAIL.. :D

<comment><AUTHOR> That's actually a copy/paste error, the original assembly goes like this:

        movl $10, %edi # number of fibnum we hunt
        movl $0, %ebx # 1st fibnum
        movl $1, %eax # 2nd fibnum

Updated the gist, thanks!</comment></comment>


Understanding ETF "Flash Crashes" - <AUTHOR> http://www.factset.com/insight/2015/08/understanding-etf-flash-crashes#.VeRJ69NVhBc <comment><USER2> This whole thing was triggered at opening. Why does the market even close these days? There is "after hours" trading going on for some people. Why shouldn't the computers be running 24/7? Is there some batch stuff that goes on after close? I've seen cases where transactions were unwound, but aren't we nearing real-time across the board?

<comment><USER3> Wouldn't you like to sleep, at some point?

<comment><USER4> Banks can (and already do) have multiple shifts.

I used to work for a forex broker (forex is 24h a day) and we had offices in different timezones (Toronto, New York, London, Singapore) so we would always have trader coverage without requiring night shifts.

<comment><USER5> And you had full 3rd level knowledge of all issues in all regions? Or key people in key regions who got woke up a lot? They should run these things for an hour a day 4 days a week. It's just a game, we don't need this.

<comment><USER4> You don't have to participate. But I don't see how it's your business if people want to trade equities 24h a day any more than if people want to open a 24h McDonald's.

<comment><USER6> Adding more trading hours to the day doesn't serve a productive purpose.

<comment><USER7> "I don't see a reason for this, so you shouldn't be allowed to do it."

Not very good reasoning. It's not exactly on point, but I'm reminded of a quotation from G. K. Chesterton:

> In the matter of reforming things, as distinct from deforming them, there is > one plain and simple principle; a principle which will probably be called a > paradox. There exists in such a case a certain institution or law; let us > say, for the sake of simplicity, a fence or gate erected across a road. The > more modern type of reformer goes gaily up to it and says, "I don't see the > use of this; let us clear it away." To which the more intelligent type of > reformer will do well to answer: "If you don't see the use of it, I > certainly won't let you clear it away. Go away and think. Then, when you can > come back and tell me that you do see the use of it, I may allow you to > destroy it."

<comment><USER6> I'm not saying you shouldn't be allowed to, I'm saying that even if it was permitted, it wouldn't be productive.

I mean, this is Hacker News. We discuss all day about what should or shouldn't be done. If you want action, go out and do it. Otherwise, we're just armchairing all of this.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> "When irrational actors are at work (and let's be clear, anyone selling RSP for half off isn't being rational), the smartest thing to do, if you're the actual human being watching RSP trade, is to simply step out for a cup of coffee". If you honestly believe that selling for 50% off is irrational, then you should not step out for coffee but put in bids and buy that ETF. That's the rational thing to do, conditional on your beliefs about valuation.

<comment><USER9> No, that's irrational.

Stock opens at X, you buy at 0.5X, you sell at 0.9X, it goes back to X. Then the exchange breaks the 0.5x trade. Now you still have to deliver the order you sold at 0.9x, but you're buying it at X, so you've earned a neat loss.

The rational thing to do is to get a cup of coffee. Unless you enjoy losing tons of money, in which case your idea is great as well.

<comment><USER10> _Then the exchange breaks the 0.5x trade_

Yeah, this can't be overemphasized. When some widow or orphan (or more likely GS) is on the other side of the trade, then clearly it should be broken. Wouldn't want them to lose any money. /sarcasm

As you say, the rational action is not to play.

Other people have opined on this and said that, if the "clearly erroneous" rules are properly defined, then a trade should _never_ _never_ _never_ be broken. It should simply not be allowed to go thru. That makes more sense to me.

Edit: And for those who think this is merely hypothetical, or just whinging, you should read this: [http://www.ft.com/cms/s/0/37fff9c6-0b36-11e3-bffc-00144feabd...](http://www.ft.com/cms/s/0/37fff9c6-0b36-11e3-bffc-00144feabdc0.html) GS trades were broken. Hopefully the FT paywall won't block that link, it worked for me when I searched for the story. So who knows.

<comment><USER11> > _" the rational action is not to play"_

The rational action is not to attempt a _short-term_ play. Having one side of your two-sided trade broken is a very bad outcome.

But if you're making a long-term play, that consideration is irrelevant. There's no "other side" of the trade for you to match up with. If you get an asset at 0.5X and then _don 't sell it_ and then the exchange breaks the trade, you get your money back and you're no worse off than when you started. But if you happen to grab an asset at 0.5X and the exchange doesn't break the trade, then you gained an asset for half of what it's worth. Now you've got a great asset in your portfolio, only you have twice as much as you should have been able to afford. That's a _great_ move!

</comment></comment></comment></comment><comment><USER12> For a related article concerning this sort of market microstructure and the behavior of its participants, see this post by Matt Levine: [http://www.bloombergview.com/articles/2014-12-01/apple- had-a...](http://www.bloombergview.com/articles/2014-12-01/apple-had-a-rough- morning)

I especially liked this quote: _" The equity market is set up to dampen small movements (market makers tend to buy when others are selling), to exacerbate mid-size movements (as market makers capitulate and stops get triggered), and to dampen large movements (as circuit breakers cut off trading and let algorithms catch their breath)."_

From my layman's point of view, it seems like this sort of "system behavior" is a peculiar emergent property that derives from the rules of the system and the individual actions of the actors working under those rules.

<comment><USER13> Definitely. That's the world of market microstructure. You could certainly change the rules but there might be other unintended consequences. For example, removing circuit breakers could make people less confident in the market since a fat finger order or error could mean Game Over instead of a manageable but significant loss.

</comment></comment><comment><USER14> Equity markets have become so complex and convoluted. It seems like a silly game of people trying to fool each other through layers of abstraction:

How can we take the fundamentally abstract idea of a company, its products, its business model, and its future potential, abstract that one level to a claim for some "portion of the company" (one share of equity, or a stock), abstract that into an index that tracks a portfolio of companies based on some abstracted notion of how to weigh different companies to model some desired strategy that tracks a market, sector, or industry. Then we're going to build software in order to abstract the task of trading whatever residual is leftover from this process amongst ourselves using formulas and algorithms that we think will outperform or trick other formulas and algorithms.

It's fascinatingly complex, which is why I suspect so many people on HN are trying to figure out how things like an ETF flash crash could happen. But for the average retail investor, it's damn-near impossible to comprehend.

<comment><USER15> The average retail investor doesn't need to comprehend it.

<comment><USER14> Agreed. But if retail investors are allowed to plow money into the stock market, then regulators need to understand it. Which I'm not sure is the case/is entirely possible with the complexity of modern finance.

The average consumer doesn't need to know anything about the drugs she takes. She just needs to know that the drugs are FDA approved and that she can trust the FDA.

I guess it comes down to how much you trust the SEC, FINRA, NYSE, etc. to stabilize and support markets. I have no idea if they're doing a good job or not. Any thoughts?

<comment><USER16> There are opinions on both sides. Some are quite insistent that the SEC etc are not doing enough: eg. Themis, Nanex, most of the ZeroHedge crowd. I think the "SEC is doing fine" crowd is less noisy, but probably the majority.

Of course, opinions can be influenced by whether the management of the markets is to your financial benefit, and perhaps that's why there seem to be a more people saying nothing: they're heads down, quietly making a fortune ...

It's worth noting (again) that the LULD circuit breakers were introduced after the 2010 flash crash, as an attempt by the regulators to "stabilize and support" markets. In some previous events, I think they've worked better than they did on Monday.

</comment></comment></comment></comment><comment><USER17> So, the take-home for me seems to be that there are weird regulations on these types of ETFs that block liquidity (like the "current single stock circuit breaker rule") and when you take that and combine that with preset orders (mainly stop loss orders) you have all you need to create a textbook chaotic system.

<comment><USER18> The single stock circuit breakers were put into effect after the 2010 "flash crash" and they're designed to "let cooler heads prevail" when stocks or ETFs go wonky. The problem is that in a real panicky freefall, it just makes the window where the stock is trading very very small (it halts for 5 minutes, opens, hits the next breaker, halts for another 5 minutes, etc.)

It happens both up AND down. This last monday was really the first time they'd been tested en mass.

<comment><USER4> Who cares if stocks flash crash? If you're buying stock for short term profit you deserve to be screwed by volatility and I have no sympathy for you.

<comment><USER19> >If you're buying stock for short term profit you deserve to be screwed by volatility and I have no sympathy for you

These people increase market liquidity, they too serve a purpose. If only long term investors were in the market, the exchanges would end up looking like ebay.

<comment><USER20> Why would that be a bad thing? (honest question)

<comment><USER13> Because most people have things they'd rather do than playing trader when their expertise is in something else. Being able to trade in and out of assets at a fair price at any time is valuable. Would you rather have your net worth tied up in a liquid index ETF or illiquid startup equity?

<comment><USER6> If I need the cash more than a few years out, whichever provides the highest return, like all long term investments.

</comment></comment></comment></comment></comment></comment></comment><comment><USER21> The linked article interpretation is really good as a long format, but as a very short format in EE-ish math-ish terms HN readers will likely understand, market prices are not fractal and are occasionally very noisy on small scale.

They aren't fractal in that they are strongly scale sensitive, and at a small scale over a short enough time period on an unusual day you're basically looking at noise.

As per innumerable statistical analysis given enough noise samples all possible values (of price) are eventually, however temporarily, touched.

"Lastly, if we're concerned about protecting individual investors, we need better education and controls around the most dangerous tool in the ETF investor's toolbox: the market order."

Seriously, those things should just be banned from retail investment and retail investment education.

<comment><USER22> > Seriously, those things should just be banned from retail investment and > retail investment education.

What? That's absurd, you want to ban "buy/sell now" at the market price? There is no justification for wanting to ban the most basic and most ordinary transaction type.

<comment><USER23> That's not what a market order does. It buy/sells at an unknowable future price.

<comment><USER22> I trade, I know exactly what a market order is.

It buys at the current market price, which during the filling of the oder may slip as liquidity slips; that's the entire point, fill this order now no matter what. To not have such an order means having your entries and exits fail or partially fill which means you'll just have to reinvent the market order yourself to continue pushing through your order. To ban a market order is to tell me I'm not allowed to enter/exit a position in a single order, that's non-sense. If you don't want slippage, don't use a market order but that comes with the side effect of failed/partially filled orders.

<comment><USER24> >To ban a market order is to tell me I'm not allowed to enter/exit a position in a single order, that's non-sense.

You could carry on trading as you currently are. If a stock is trading $100/$100.1 and you want to buy it ('now' as you say), then just set your limit to $1000.

Of course, you will have no one to blame but yourself if, during the ~50 milliseconds it takes for the order to reach the exchange, the market makers have switched off and you end up crossing a massive spread and buying the only available offer at $600 or something. An incredibly unlikely scenario, but it can happen.

So I imagine you'll set your limit to something sensible, like $101. It'll still get filled 'now' 99.9999% of the time. But you won't be taking the risk of doing something epically stupid. There, that wasn't so hard now was it?

<comment><USER22> > So I imagine you'll set your limit to something sensible, like $101. It'll > still get filled 'now' 99.9999% of the time. But you won't be taking the > risk of doing something epically stupid.

Your scenario doesn't handle the case a market order does, i.e. close my position now. In a fast moving market, using limit orders for stops or exits is just going to result in partial fills or failed orders. If I want out, I want out, I don't only want out if I lose between X and Y, I want out period; that's what market orders are for, for that convenience, you accept slippage as a reality.

> There, that wasn't so hard now was it?

No, it's easy to do things that don't work, I can pump my order into /dev/null, that's easy too, and it's just as useful as a limit order for stops.

<comment><USER24> >Your scenario doesn't handle the case a market order does, i.e. close my position now.

I covered that. If you really, truly, want to sell at _any_ price(and I can't imagine why, that is terrible trading), then you set your limit to zero.

That's all a market order is - a special case of a marketable limit order (immediate or cancel/fill and kill/etc) with the limit set to zero (in the case of a sell) or infinity (in the case of buy).

Banning vanilla market orders just forces people to acknowledge that fact, which is a good thing.

<comment><USER22> > I covered that. If you really, truly, want to sell at any price(and I can't > imagine why, that is terrible trading), then you set your limit to zero.

Perhaps to avoid a margin call; your imagination is limited, you seem to forget you also have to buy/sell to exit a position when holding on is not an option. Terrible trading is holding on until you get margin called; when your risk management says get out, you get out. A stop loss isn't a stop loss if it can fail to fill or only get partially filled, a market order is exactly what one desires in a stop loss.

> That's all a market order is - a special case of a marketable limit order > (immediate or cancel/fill and kill/etc) with the limit set to zero (in the > case of a sell) or infinity (in the case of buy).

Yes, and thus no need to ban it.

> Banning vanilla market orders just forces people to acknowledge that fact, > which is a good thing.

You can't force people to acknowledge details they don't care to know about. Ban this, ban that; it's all non-sense from people who think they can force the ignorant to learn, you can't. Banning market orders achieves nothing.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER25> > Sleeping-stops kill...If you had a stop to sell if RSP crossed under $70, > say, right after the open, your order became a market order, and you could > have been executed anywhere in the line of terrible trades.

Is there another mechanism that serves the same purpose as a market order, but that isn't quite so vulnerable to these flash panics? Maybe something like "sell if it stays below $X for more than an hour"? Though I guess that wouldn't save you if the crash really was because of bad news.

<comment><USER26> I used to work on the algo-trading desk of a big brokerage firm (so writing trading algorithms that execute other people's orders for them), and I have to say almost always if someone sends a market order, it would be safer for them if they sent the same thing as an aggressive IOC ("Immediate or Cancel") limit order. The IOC flag gives similar semantics to a market order (in that no portion of your order is going to stay on the book if it's unfilled), but you are guaranteed to execute no worse than the limit you have set. This is clearly way better in situations where the market has big dislocations.

<comment><USER27> The problem with the IOC order is that you have execution risk. I.e. quite possibly your order isn't filled. Then if your favorite stock were to go down and _stay down_ , you would still be holding it.

In short there is no perfect "stop loss" order. There is either price risk or execution risk - pick your poison.

That said, unlimited price risk and zero execution risk is probably NOT the optimal point to be at.

<comment><USER28> I'm not sure about that. If the market is moving in an orderly fashion, and you're trading in a very liquid asset, market orders remove a psychological impediment to trading. For someone who trades 3-5 times a year, doing a limit order requires additional consideration (making sure you're doing the right limit, setting a limit price, etc.) If you just want to buy or sell some stock for reasons totally unrelated to trading, It's rational to accept a tiny risk that the market is going to have a shit fit between when you hit submit and when your order is filled 2 seconds later when the news is quiet.

Certainly, I would never put in a market order when the market is operating under circuit-breakers and things are unstable. When things are stable, it can be a reasonable choice for someone transacting in stock who just wants it done so they can get on with other things they have to do.

<comment><USER29> If you are trading 3-5 times a year, I'd argue that requiring people to put in the limits on their limit orders would be a good thing.

It makes people think about how the market _actually_ works instead of how they hope it works.

<comment><USER28> But what benefit does that actually have? People aren't going to remember this interaction or learn anything, they're just to be annoyed at having to come up with that number. They might even put off the transaction.

I would be in favor of restricting the use of market orders by non- professionals during any time a market special rule is in place (circuit breakers, Rule 48, etc.) However, I think allowing them during normal market operation makes transacting easier for investors, which is also a good thing.

<comment><USER29> If someone is so annoyed to have to come up with a price that makes their order invalid, I'd argue they _should_ put off the transaction.

</comment></comment></comment></comment></comment></comment></comment><comment><USER30> What i don´t understand is - there are arbitrage players, who calculate "real value" of the single stocks in each ETF. Aren´t they liquid enough? Because if they were, the price would not drop that much, would it?

<comment><USER31> A lot of stocks were hitting circuit breakers IIRC, so some of the underlying single stocks simply weren't trading for part of the time.

<comment><USER30> ahh, so arbitrage players simply paused trading, as their automated calculations where incomplete?

<comment><USER31> Yeah. A human can probably spot the difference between a flash crash and a true crash, at least after making a few phone calls - but by that point the opportunity has probably gone.

<comment><USER32> I know it's anecdotal, but I have heard from some of my human prop trader friends about guys who made a killing buying on Monday morning.

</comment></comment></comment></comment></comment><comment><USER33> Are we sure causing those halts was unintentional?

<comment><USER29> Are you suggesting a market actor was manipulating the market so that no one could trade? Can you come up with a scenario where someone could make money doing that?

<comment><USER34> One scenario would be to gum up the market during a volatile time - eg to retain "value" while investors are panicking.

But I would lean towards the halts being an unintentional (as in: not well thought through) consequences of all the layers of regulation and counter- regulation.

</comment></comment></comment><comment><USER35> Pfft. [https://www.tipranks.com/etf/rsp](https://www.tipranks.com/etf/rsp)</comment>