Sugar-sweetened drinks with protein rich meal affect metabolism - <AUTHOR> https://blogs.biomedcentral.com/bmcseriesblog/2017/07/21/sugar-sweetened-drinks-and-your-metabolism/ <comment><USER2> Often people are wary of new results about health, so it's worth pointing out that this paper is rigorous and the conclusion is very likely to be correct, as explained by this comment on Reddit's /r/science [1].

[1] [https://www.reddit.com/r/science/comments/6oufus/comment/dkk...](https://www.reddit.com/r/science/comments/6oufus/comment/dkkfh95)

<comment><USER3> However:

* the "multiply p value by ten" rule would exclude the main results (but not some well known findings)

* paper does not have much discussion of context or past results

* paper does not have any scatter plots or show individual data at all for the primary results; there are scatter plots under additional files for oxidation vs. lean body mass and vs. fat mass and 24 hour energy expenditure vs fat mass

* there is no discussion of the possibility that the small additional calories could have had the same effect even if not sugar

* there is no discussion of the possibility that gut microbial response to the non-sugar drink might cause the differences they see

* a conflicting study used a different artificial sweetener

* the study did not test if the same SSB vs NNSB given at non-meal times would have a similar or different effect

* also all the limitations mentioned in the study

* this is a basic research study, not something directly applicable to real life; if you aren't doing extensive research in the area then drawing any conclusions from this one paper is unlikely to be helpful

Of course, considering the study in connection with the rest of the literature is likely to address some of these considerations and it may be a valuable contribution. Saying "very likely to be correct" does not sound accurate to me.

Since fructose is suspect, comparing trehalose vs. sucrose would be interesting.

<comment><USER4>
      the possibility that gut microbial response ... might cause the differences

This will eventually be proven to be a significant factor, IMHO.

</comment></comment></comment><comment><USER5> > _The next time you tuck into a protein rich dinner, it may be a good idea to > hold off on the sugary drinks._

For 300,000 of human existence except the past few decades, humans drank no sugar-sweetened drinks.

It is _always_ a good idea to hold off on sugary drinks.

<comment><USER6> Fruit juice? Does fructose vs sucrose make a difference?

<comment><USER7> I predict in the coming years we'll start referring to fructose as "bad sugar" and glucose/dextrose as "good sugar".

Sucrose, being a 50/50 compound of the two, thus inherits "bad sugar" from the fructose produced during digestion.

HFCS actually ranges from 29-55% fructose vs. glucose/dextrose (the highest being available in CocaCola freestyle soda machines), and can be better or worse than sucrose, but is generally equivalently bad.

Since dextrose is basically incompatible with acidic beverages and solidified candies, we're not likely to see fructose going away, either as a direct ingredient or as a metabolite.

If natural concentrated sweetener is considered, attempts to replace sucrose and fructose with dextrose-only sources like plain old corn syrup (POCS), rice syrup, and honey, might achieve some fascinating health benefits. Is it possible that we're fat only because we're eating the wrong kind of sugars?

<comment><USER8> > Is it possible that we're fat only because we're eating the wrong kind of > sugars?

Nope, we are fat because there are many cheap sources of calories, particularly deep fried foods.

<comment><USER9> The objections to this oversimplified reasoning usually point to the fact that, among other things, there's a documented rise in obesity among animals as well, across a variety of situations (feral rats, lab primates, domestic pets). Lab primates aren't eating out more or getting less PE in schools, which suggests the possibility of an environmental factor[1].

> particularly deep fried foods.

This is a very early-1990s understanding of nutrition. The low-fat recommendations pushed by the USDA and followed to a large degree by American consumers didn't do anything to halt the obesity rise, because excess dietary fat isn't nearly as bad for you as excess processed carbs/sugar.

[1] [https://www.livescience.com/10277-obesity-rise- animals.html](https://www.livescience.com/10277-obesity-rise-animals.html)

</comment></comment></comment></comment></comment><comment><USER10> Note that (at least the summary indicates) this experiment refutes "calories in calories out" theory - food composition affects thermogenesis. (I am not talking about the tautological and useless thermodynamic sense in which it definitely is true; I am talking about the "measure your intake and exercise" crowd)

<comment><USER11> Exercise is a bad way to increase calories out, because it's just too efficient. The conversion is something like 1 mile run = 1 tbsp peanut butter.

<comment><USER12> Assuming you meant inefficient. It is exceedingly difficult for people to make lifestyle change. Some shockingly small percentage of people lose 40 lbs and keep it off.

I have an anecdotal idea that, basically, folks who are fit enough to exercise off 1000-1500 calories every week and do so are the ones that never have to lose the weight in many cases. Finally, although inefficient in the thermodynamic sense, I think part of why this is true is because most people gain weight over a course of years. That extra soda or beer every day. When you have a simple balancing lever like an extra mile or two of vigorous walking or something else it can all balance. When you are sedentary in the same situation, you slowly get diabetes.

Also peanut butter is dense, but a good way to illustrate the problem to someone a good way is to also ask someone if they are willing to walk for 30 minutes for one soda.

<comment><USER13> Moving the mass of a human body over a mile on one tablespoon of fuel is highly efficient!

Edit: tablespoon, not tea-

<comment><USER14> Trains do about 30 times better on a tablespoon of diesel, and that's only including the weight of the freight and not the train itself.

<comment><USER15> i feel like a train isn't going to get anywhere on a tablespoon. That's enough for a few engine strokes perhaps, but that's hardly 30 times better than a mile by a human, no?

<comment><USER16> I'm not sure on the numbers but I know a human couldn't get freight moving even with a whole jar of peanut butter.

<comment><USER15> > I know a human couldn't get freight moving even with a whole jar of peanut > butter.

This is probably one of the best serious sentences I've ever read.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER17> Lately I've been having this feeling that the pseudo science of nutrition (not talking about the researchers but the food and lifestyle artists on social media) makes it very hard to find out what a good diet is and what isnt.

Meat ? Bad unless it isnt. Dairy and Eggs ? Even worse except when it isnt. Vegan/vegetarian nutrition ? The worst except, you guessed it, when it isnt.

If you dont believe me just google any food and try to find out a general consensus about it. A lot of these sites talk about facts without sources, use terms like "toxins" without going into detail about what exactly they are etc.pp.

Thoughts ?

<comment><USER18> I know what you mean, and my answer probably wont be very satisfying to you: Use common sense, eat what your grandma tells you (if you have a good grandma), ignore all the crap on the internet which is 90% confusing rubbish (with the exception of some scientific studies which can be insightful but not necessarily anything to base a diet on).

Try to cook your own food at least half the time and have a balanced intake (just the basics: meat + veg + fruit), if you stick to natural unprocessed foods it's pretty hard to go wrong, avoid sugary treats and highly processed food as much as possible, that's basically all you need to know (sounds pretty obvious because it's common sense).

The fad diets and contradicting advice do not arise out of a failure of your grandmas advice, they arise out of supermarket foods, high sugar, high carbs, ready meals etc. Same with the obesity epidemic, it does not come from lack of will power to not eat like most people think, it comes from the laziness and temptation that we all get from supermarkets.

I try to cook at least half the time and keep an eye on my tendency to be lured by what is becoming way over half of supermarket isles these days (sugar and carb packed processed shit), go to the meat and veg isles out of habit don't even walk down the others unless you want to treat yourself (sugar is a treat not an everyday thing).

<comment><USER19> My grandpa ate meat and dairy every day and died after his forth stroke at 70. He had his first stroke at 50, but never even considered changing his diet. My grandma is obese on a similar diet and probably won't make it much longer.

My mom ate the a same since an early age and had very high cholesterol and the doctors warned her that she is on a similar course as my grandpa if she didn't change her diet.

I've since convinced her of going on a plant based diet and I am planning her meals. Her cholesterol has been decimated, she lost a ton of weight and feels way better now.

Am I a qualified nutrionist? No. Am I feeding her the diet my grandma ate. Fuck no. Where did I get my information? Plenty of peer-reviewed studies. There is no denying that dietary cholesterol is a killer and cutting out meat and dairy is probably the healthiest option for the majority of the population.

<comment><USER20> > Plenty of peer-reviewed studies. There is no denying that dietary > cholesterol is a killer and cutting out meat and dairy is probably the > healthiest option for the majority of the population.

Yeah, except that the pendulum is swinging the other way now. [http://www.health.harvard.edu/blog/panel-suggests-stop- warni...](http://www.health.harvard.edu/blog/panel-suggests-stop-warning- about-cholesterol-in-food-201502127713)

"There's a growing consensus among nutrition scientists that cholesterol in food has little effect on the amount of cholesterol in the bloodstream. And that's the cholesterol that matters."

which is exactly the phenomenon GGP commenter zython was describing.

edit: "dietary cholesterol != blood cholesterol" was even in the popular culture ca. 1995, see "Homer the Great" [https://www.youtube.com/watch?v=4OZkCXbbEJw](https://www.youtube.com/watch?v=4OZkCXbbEJw)

<comment><USER21> It doesn't has as high an effect as saturated fat, no, but it still has a negative effect, and fact of the matter is that we need to consume zero dietary cholesterol, so every time we do, that is a negative action towards the goal of health.

Another thing to note is that often the case is that food that is high in cholesterol is also high in saturated fat, both things that affect ldl cholesterol levels in a negative way.

</comment></comment></comment></comment></comment><comment><USER22> I wonder how it affects muscle building.

I have low carb diet and try to avoid "fast" carbs completely except when taking proteins/BCAA right after workout--I was under impression that taking protein without carbs might result in burning proteins for fuel instead of using them to restore/build muscle.

</comment><comment><USER23> There go protein bars... Does anyone know if artificial sweeteners hack the body to switch to "fat storage" mode as well? Like metabolism after Coke Zero with no sugar still causing excessive fat storage? Our bodies seem to use some silly heuristics all the time, like the one hacked by drinking plain water but with scent of a fruit in front of a nose, forcing brain thinking we drink juice...

<comment><USER2> The control group in this study was drinking an artificially sweetened drink in place of the sugary one. Otherwise, this answer [1] refers to recent studies having shown insulin rising from artificial sweeteners, but says the research on links to actual weight gain is still ongoing (I have no idea if that answer is current).

[1] [http://www.health.harvard.edu/diabetes/ask-the-doctor-do- art...](http://www.health.harvard.edu/diabetes/ask-the-doctor-do-artificial- sweeteners-cause-insulin-resistance)

<comment><USER24> Do you have a subscription to that? I was only able to read the first paragraph but it mentioned resistance to insulin which I thought is different than temporarily causing your insulin levels to rise from consuming a sugary drink or eating a high carb food like rice. I'm really interested to know if drinking something with sugar alcohol,aspartame, or sucralose causes insulin level spikes like sugar does.

<comment><USER25> In the event GP doesn't respond, I probably have the same unsatisfactory answer that the Q&A from the link does: we don't yet know.

I too, have the same interest regarding insulin spikes from artificial sweeteners and spent considerable time researching. Caveat, this was about five years ago so there could be new findings.

While the research is inconclusive, I personally try to cut down on artificial sweeteners. I suspect they can cause an insulin response. This is based on my understanding of the literature and my n=1 experiments.

</comment></comment></comment></comment><comment><USER26> So it seems that for most of our past, this would actually have been beneficial.

The article says: "We found that drinking a sugar-sweetened drink with a meal significantly decreases fat use and diet-induced thermogenesis (heat production)."

So if food is relatively scarce then this is a good thing.

Feels a bit weird to optimize diets for couch potatoes. The article doesn't say how exercise was done, so I assume it was none.

</comment><comment><USER27> I wonder if this means ending a meal with a dessert it's considered a "no no".

<comment><USER28> I would suspect it strongly depends on the dessert size. In North America desserts are huge and that's a problem. A small two-bite dessert won't hurt and would give the same satisfaction as a big one. Also a small (and I mean really small) shot of fortified sweet wine (e.g. port or madeira) is a traditional way to finish a meal in some parts of Europe, which I suspect is healthier than a typical North American dessert.

</comment></comment><comment><USER29> Does someone know of any serious "weight loss" books that are _rigorously evidence based_, without layman explanations, bad/outdated research, and bovine manure like confusing correlation with causation or relying on small, unrandomized population studies to confirm the author's preconceived notions for how things should be? I mean real, hard ass summary of today's best, most rigorous studies + some recommendations.

<comment><USER30> Eat less calories then you burn == weight loss

<comment><USER29> I'm more interested in sustained weight loss over the rest of person's life. Best I can tell, that is predicated on reducing insulin resistance while not restricting calories too much. People don't stick with reduced calorie diets, and human body can (and does) reduce its metabolic rate to compensate for reduced calorie intake, thus defeating it.

</comment></comment></comment><comment><USER31> This study seems like common sense to me. You're going to store more fat when you add the calories and sugar from the soda.

Can someone explain what I'm missing?

</comment><comment><USER6> This is very interesting - like most influenced by GI theory, I had assumed that rate of absorption/avoiding an insulin spike meant that if you wanted something sweet, it would be OK or at least least-bad, if it were mixed with slow-digesting items such as protein. Guess not :-(

<comment><USER32> GI isn't the whole story. Some proteins trigger insuline response way more than blood sugar.

This site has a lot of interesting material on the subject. [https://intensivedietarymanagement.com/insulin- index/](https://intensivedietarymanagement.com/insulin-index/)

Couldn't find the particular text I was loooing for but apparently there was this study where they mixed pasta with milk or water and added glucose to achieve equal mixes of glucose, lactose and such. The mix with the milk had something like three times higher insulin response.

</comment></comment><comment><USER33> "Having a sugar-sweetened drink with a high-protein meal may negatively affect energy balance, alter food preferences and cause the body to store more fat."

Damn that's a lot of negatives. I'm glad I haven't regularly drank soda in 5 years.

</comment><comment><USER34> Keeping people confined for long periods affect metabolism?

</comment><comment><USER35> So O-Juices and Eggs are a sin, to the holy church of body now? Well sorry, if i sin on like a old heathen, while you drive up your blood pressure in your schisms, popes and anti-popes.

Seriously, fruit was a base part of our food source - since we walked out of the djungle. And we have cravings for it, wherever we go- to get some honey, some overripe mango. If somebody wants to declare that unhealthy, he is free to experiment on himself.

And yes, those monkeys did binge mango eating. Binge Banana, we did alot of binge, and alot of starving, when the source of food was gone and the hunt was on again. To try to fight these instincts, with self-moderation is kind of funny.

<comment><USER19> There is a difference between whole fruits and juices. Juices basically don't have any fiber in them anymore and the sugar is much more concentrated. Nobody will take eating fruit or even drinking smoothies away from you. (well maybe the Keto folks will)

<comment><USER35> I just wish there was- i dont know, some time-wise distance between research and application. Time for the propaganda to die and the science to survive by having repeatable results. This all is - too fast moving, to hasty, to many zealots ready to jump on any band wagon promising a longer live.

Its just a guts feeling, but we had several times over by now, whole category's declared bad and then re-instated. I will keep to what i can know for certain, and that is the diet our hunter-gatherer ancestors ate. I shall keep away from processed, enriched foods as much as possible. And thats it.

Everything not close or similar to the nutrition approach- no matter how demonized or declared healthy will have to ripe for ten years, before i evaluate it. Im sorry for the serious scientists, but in a field so ravaged by Replacement-Religious fanatics and Cooperate Propaganda, time is the only thing that will tell.</comment></comment></comment>


IBM, sonic delay lines, and the history of the 80×24 display - <AUTHOR> http://www.righto.com/2019/11/ibm-sonic-delay-lines-and-history-of.html?m=1 <comment><USER4> A few years ago I had the pleasure of working with Lee Felsenstein on an electronics design.

One night over burrito bowls we got to talking about the Osborne 1 and the odd size display. Specifically why _52_ x 24 instead of 40x24.

As the story goes, there were huge concerns the computer would come in under budget. At the time chip companies would bundle their CPU's and RAM - <USER2> leading with one but charging more than market for the other. Architectures should have meant these chips were not cross compatible. Adam Osborne set a hard ceiling on the price, Intel compatibility, and 40x24 native resolution for the display (so as to be compatible with with other "Business" applications). Facing these constraints Lee couldn't make it work unless he got creative. Through some arcane use of the dark arts (read: layout and capacitor placement) he was able to get the timing working between the low cost Z80 processor and the low cost 4116 RAM.

When he presented the news it went something along the lines of: "Adam, I've got some good news for you and some bad news. The good news is I made the cheaper ram work with the Z80 and we're going to come in under budget. The bad news is I can't get you 40x24, but I can do you one better: 52x24!"

As I understand it, this has something to do with the timing weirdness when integrating into the Z80s built in refresh logic which Motorola devs had to write in software. My understanding is they rolled with it but Adam went on to flush the savings windfall this hack got them down the drain by announcing the Osborne 2 at a lower price with more features before the Osborne 1 shipped.

<comment><USER5> It wasn't uncommon at the time for small computer systems to make the memory reads performed by video output pull double duty as a memory refresh. The Apple II relied upon this, for example, and ended up with an oddly fragmented video memory layout as a result.

</comment></comment><comment><USER6> No matter how outdated and irrelevant those computers are today, their look is so nostalgic to me like no other thing. Other things that disappeared from our lives, such as rotary phones, vinyl records (not completely lost though), the beautiful stereo systems of the 1980s, etc can never compare to the feeling of seeing and touching a computer for the first time. The magic of technology is lost at least for my generation, I don't know about the others.

<comment><USER7> It depends. Technology became magic beyond our wildest dreams too, in many respects, when we take a second back to look at first principles, how far we've come. Part of that magic was age and personal disposition too, in addition to the revolutionary object. That combination doesn't happen quite often.

But imagine a true sci-fi-esque VR experience a decade or two from now in company of your children or grand-children on a Christmas evening, that might make you feel in magic-land all over again.

<comment><USER8> Progress doesn't work like that. Once you've picked the obvious low-hanging fruit it stops being a research problem and starts being an engineering one. Which means tradeoffs and no free lunch and no more magic.

We're never gonna have an airliner that is 10 times faster than the ones we have now. Same principles with computing too.

<comment><USER9> I don't know, using a VR headset for the first time is the most magical tech experience I've ever had and that was barely three years ago. Modern VR came about because all the disparate pieces of tech involved slowly improved over decades, until one day they all worked well enough to create something humanity could only dream of just a few years ago. There are a lot of fields in similar situations. We have room for some magic yet.

</comment></comment></comment></comment><comment><USER10> "The punch card remained a keystone of data processing until the 1970s, and its impact still remains."

I worked for an aerospace contractor in the mid-80s, and the corporate computing center was an IBM mainframe shop (originally 360s/370s, later a mix of 370s and 3033s, later the 308x multiprocessors series).

Even when I left that world in 1986, punch cards were still used in several contexts, such as the starter decks for all production jobs. But the greatest reliance on punch cards was that _every employee 's time card was a punch card_. Recurring data was pre-punched, employees would write billing hours and projects on printed fields, then that data was punched in by the keypunch department at the end of the week. The timecards then were written to tape and fed into accounting, payroll, and shop order control.

Yet despite this primitive appearance, every employee got their paycheck by the following Thursday, every week.

</comment><comment><USER11> For background, the "sonic delay line" appears to refer to this:

[https://en.wikipedia.org/wiki/Delay_line_memory#Magnetostric...](https://en.wikipedia.org/wiki/Delay_line_memory#Magnetostrictive_delay_lines)

<comment><USER12> > A later version of the delay line used metal wires as the storage medium. > Transducers were built by applying the magnetostrictive effect; small pieces > of a magnetostrictive material, typically nickel, were attached to either > side of the end of the wire, inside an electromagnet. When bits from the > computer entered the magnets the nickel would contract or expand (based on > the polarity) and twist the end of the wire. The resulting torsional wave > would then move down the wire just as the sound wave did down the mercury > column. In most cases the entire wire was made of the same material.

wow. this is literally a sound wave. i thought it was some kind of euphemism.

as i was until now only familiar with the electric variety.

<comment><USER13> > _literally a sound wave_

Well, not literally. A sound wave is a compression wave (vs. shear or torsion).

</comment></comment></comment><comment><USER14> This is very much an IBM-centric narrative - it doesn't mean that it's wrong but at the time there really was an IBM world and an everyone else world - <USER3> carefully tended to its walled garden, to the point of getting people fired who might consider looking outside of it - the result is people who knew nothing about IBM, and people who knew nothing but.

Which essentially means that there are going to be different stories about 80x24/5 from that time - probably all of them correct in context.

(oh and the console monitors on our Burroughs 6700 mainframe had delay lines while the user block terminals - TD830s - had dram and micro-controllers - there's another non-IBM/non-DEC world view of essentially the same technology)

<comment><USER15> Well yes to this - in the 80s you were either System V or whatever crap IBM was selling back then! :)

Ps I always assumed 80x24 was a teletype (eg. tty) standard or at the least a two-by 80x12 punch card layout. I also wonder if the serial cable throughput to the terminal played a role..

<comment><USER16> I think RSX, RT-11 and VMS would like a word.

<comment><USER15> Sorry I was being intentionally controversial. I had both Unix and vms accounts as a student and I guess the vms never really resonated with me...

<comment><USER16> Don't worry. I never liked it either. When I found Unix, I was sold. I think it was the pipe (in the shell) that did it.

<comment><USER15> For the longest time I had my systems cat Syslog to an lpr... anytime someone did something, I'd hear a bzzzzzt. Usually about 5 times a day. Maybe a dozen. Then one morning I came into work and there was a whole box of paper on the floor and the printer is still bzzt, bzzt, bzzt... it was a hacker who had decided to follow some instructions he found on the web and hack my system. Every time he'd do something he'd erase his steps... but he never checked to see that all his movements were being printed!

</comment></comment></comment></comment></comment></comment><comment><USER17> > AT&T introduced the Teletype Model 40 in 1973, a CRT terminal with an 80×24 > display.

The Model 40 was a nice machine. I remember it because the printer unit reused the type pawls from the Model 28 in a rubber belt that ran the full width of the paper (80 columns, of course). So it was a chain printer without the chain, which meant it was somewhat quiet when printing.

</comment><comment><USER18> I can still hear the sound that an ASR-33 would make as it was typing out a listing. I was fortunate to attend a high school in 1975 or so that had a DEC PDP-8 with an attached ASR-33 with paper tape reader and punch. I remember that it took something like 45 minutes to load the BASIC interpreter from paper tape. Good times.

<comment><AUTHOR> I love the cadenced hum of the ASR-33 when it idles. Wish I could have one in my office.

</comment></comment><comment><USER19> Non-mobile link: [http://www.righto.com/2019/11/ibm-sonic-delay-lines-and- hist...](http://www.righto.com/2019/11/ibm-sonic-delay-lines-and-history- of.html)

</comment><comment><USER20> The 'recent blog post' that Mr Shirriff mentions was discussed on HN at [https://news.ycombinator.com/item?id=21340548](https://news.ycombinator.com/item?id=21340548)

</comment><comment><USER21> There is a mistake somewhere: the 3270 is said to have been introduced in 1977, but to dominate the market by 1974. Could it have been introduced in 1971 instead?

<comment><USER22> You are right; I've fixed the typo.

</comment></comment><comment><USER23> "The new 32- and 43-line sizes didn't really catch on"

But it made it to the PC and its MDA video, IIRC. I used to use that mode all the time.

<comment><USER24> I don't recall 32- or 43-line MDA text modes (and online sources on MDA I can find don't list such modes), but EGA and later adapters supported 43-line text modes, which I do remember using.

<comment><USER23> IRI. :) definitely then I used the EGA mode. I had a Hercules compatible adapter that supported EGA mono modes.

</comment></comment></comment><comment><USER25> From the article, about why 80x25 became standard:-

>The biggest problem with this theory is the VT100's display was 80×24, not 80×25

Having spent quite a few years banging away on VT100's and clones, wasn't the display actually 80x25, but with the 25th line being used to show status? So the electronics was actually set up for 25 lines.

<comment><USER22> No. The VT100 was 80×24 (or 132×14 or 132×24) and had no status line. You can verify this on Wikipedia or in the manual. The status line was added in the VT320.

[http://www.bitsavers.org/pdf/dec/terminal/vt100/EK- VT100-UG-...](http://www.bitsavers.org/pdf/dec/terminal/vt100/EK- VT100-UG-001_VT100_User_Guide_Aug78.pdf)

</comment></comment><comment><USER26> Interesting article with some nice pictures and links.

I have a very simplistic question. The article asks, "Given the historical popularity of 80x24 terminals, why do so many modern systems use 80x25 windows?" My question is: _Do_ any modern systems use 80x25 windows, other than the console of the IBM-compatible PC?

<comment><USER22> I believe 80x25 is the default for iTerm, qemu, as well as cmd/command on Windows, minicom, kermit, and CentOS console. Anyone know of other current users of 80x25?

<comment><USER27> MATE Terminal defaults to 80x25 as well.</comment></comment></comment>


Ask HN: Desktop cross-platform toolkits in 2019? - <AUTHOR> I used C++ and Qt4.5 – Qt4.8 to build a desktop app from 2007 – 2012.
If you are starting development today, what's the "state of the union" regarding cross-platform apps? <comment><USER2> Qt is well maintained and got a lot of new modern parts, like a well integrated web view widget with the full blown WebKit engine, QML/a JavaScript engine, of course support for mobile platforms and for instance a novel more pythonic Python binding.

<comment><USER3> Where can we read about the "novel more pythonic Python binding"?

</comment></comment><comment><USER4> Unfortunately it seems to be things like [https://electronjs.org/](https://electronjs.org/)</comment>


Lichess rating distributions display peaks at round numbers - <AUTHOR> https://lichess.org/stat/rating/distribution/bullet <comment><AUTHOR> Hypothesised to be interpretable as empirical evidence that some users stop playing when they reach their target rating to avoid losing points: [https://www.reddit.com/r/chess/comments/ckm6w2/does_anyone_e...](https://www.reddit.com/r/chess/comments/ckm6w2/does_anyone_else_fear_playing_chess_online/evp4i25/)</comment>


Partying like it's 1999 – Initial public offerings are back in Silicon Valley - <AUTHOR> https://www.economist.com/business/2020/08/22/initial-public-offerings-are-back-in-silicon-valley <comment><USER2> This is uncharacteristically poor journalism from the _Economist_. The graph shows excepting 2009 and 2016 there has been effectively no significant downturn, whereas the title suggests an order of magnitude change in the last two years.

<comment><USER3> I wouldn't say uncharacteristic. The economist has always been short on details and overflowing with unecessary snark.

<comment><USER4> Agreed, the Economist's habit of laying out a few kindergarten-level facts and then extrapolating to what the world should do is pretty irritating. Enough that after one subscription I swore off reading them generally.

<comment><USER5> Can you provide some examples? I think this would only apply to the Leaders sections, but the point of it is to serve as introductions for later articles. The rest I've found to be thorough, especially the Briefing section and Technology Quarterly. It's definitely full of "shoulds" from a classical liberal perspective.

</comment></comment></comment></comment><comment><USER6> [https://archive.is/GSxK4](https://archive.is/GSxK4)

</comment><comment><USER7> The stock market is living in a dream land where it doesn't matter that the real economy is doing badly, they can count on nearly unstoppable supply of money flowing from the Fed. In this situation it is obvious that all stock prices will skyrocket, but the most probable outcome is a crash in 1929's style.

</comment><comment><USER8> And Tesla just surpassed Walmart in market cap even though their total quarterly deliveries have been relatively flat around 80-90k per quarter for almost 2 years.

<comment><USER9> It's an obvious short opportunity but how can you know how long the market will remain irrational?

<comment><USER10> Is it? Which company has more growth ahead of it? Wal-Mart is slowly digesting in the Amazon Saarlac pit like all retail.

Stocks are valued by growth unless they pay a lot of dividends, and dividends are rare today.

<comment><USER9> I need what Walmart sells. I don't need anything Tesla sells.

<comment><USER11> Problem is, anyone can have what Walmart sells.

Nobody really has what Tesla sells.

<comment><USER12> > Problem is, anyone can have what Walmart sells.

5,000 massive scale physical retail buildings (at a time when other physical retail is being mauled), a brand with buyer loyalty that took half a century to create, operating on a 3% profit margin in a hyper low margin business, and excellent real-estate locations across most of the US.

Be sure to wave to Kmart, Penneys, FW Woolworth, JG McCrory's and Sears on the way to having what Walmart has.

No, you can't have what Walmart has.

Nobody can afford to replicate what Walmart has built up over time. And if you try to compete with them via ecommerce instead of physical retail (thinking that will somehow be cheaper), you'll need to spend tens of billions of dollars on distribution to do it (and good luck competing with Amazon).

If you had to choose who to compete with, Walmart & Amazon or Tesla, that's a comically easy choice. That's why companies like Nikola or Rivian exist (and 37 Chinese Tesla clones), and absolutely nobody is eager to build a thousand new giant physical retail stores to go after Walmart (besides, you can't get the money to do it, there are no funding sources for that financially suicidal move).

<comment><USER13> I understand your point for the most part, but the argument isn't that you have to build exactly what Walmart has (hundreds of buildings with mass distribution). Any Joe can setup a grocery/goods store tomorrow. Will they crush Walmart any time soon? Nope. Good luck trying to build what Tesla has. Call me a fanboy, but there is some amazing technology in those cars, and while strapping a battery on a frame with a electric motor looks easy, doing it at scale and as efficiently as they do is definitely not. Many of those 37 or whatever Chinese knock-offs have failed already. I would never buy a knock- off electric car, but I would definitely shop at Joe's convenience store to pick up some bananas, I do it daily actually.

<comment><USER14> Isn't VW now producing 2 fully electric cars at scale based on their new electric platform? I think the ID3 is shipping to customers in Europe already or in the near future.

<comment><USER11> Yes, but while those are somewhat cheaper than the Model 3, they don't match it on range, power and efficiency.

Also they are somewhat delayed because someone figured that it would be a good idea to create a lot of new software(a whole new OS?) specifically for this car.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> The interesting game people will get to play is if Biden wins and Democrats control at least the House, do you hold onto your shares and hope the Democrats bring back the SALT deduction.

<comment><USER16> They won't bring it back. They don't want the SALT deduction either. They just didn't want to piss off their voters.

To be fair, getting rid of SALT was a good move. It makes the tax code more fair. There is no reason for the federal government to subsidize someone who lives in California or New York.

</comment></comment><comment><USER16> Might as well get your piece of the pie while the government is still pumping billions into the market with QE.

<comment><USER17> Partying like it's 1929.

<comment><USER18> However unlike that period, we won't have to deal with a contracting money supply.

<comment><USER19> The Weimar Republic didn't have a contracting money supply in that period

<comment><USER20> What do you think caused the deflation then?

<comment><USER21> The Weimar Republic didn't experience deflation during that period.

<comment><USER20> "[Brüning] enacted a draconian policy of deflation and drastically cutting state expenditure.[5] Among other measures, he completely halted all public grants to the obligatory unemployment insurance introduced in 1927, resulting in workers making higher contributions and fewer benefits for the unemployed. Benefits for the sick, invalid and pensioners were also reduced sharply.[52] Additional difficulties were caused by the different deflationary policies pursued by Brüning and the Reichsbank, Germany's central bank.[...]Brüning triggered a deflationary internal devaluation by forcing the economy to reduce prices, rents, salaries and wages by 20%."

This made unemployment skyrocket and arguably caused the rise of Hitler.

[https://en.wikipedia.org/wiki/Weimar_Republic#Br%C3%BCning's...](https://en.wikipedia.org/wiki/Weimar_Republic#Br%C3%BCning's_policy_of_deflation_\(1930%E2%80%931932\))

EDIT: I'm not sure why all the downvotes, maybe because it looks like I Godwin-ed the thread? I was just paraphrasing the rest of the wikipedia section:

"In 1933, the American economist Irving Fisher developed the theory of debt deflation. He explained that a deflation causes a decline of profits, asset prices and a still greater decline in the net worth of businesses. Even healthy companies, therefore, may appear over-indebted and facing bankruptcy.[57] The consensus today is that Brüning's policies exacerbated the German economic crisis and the population's growing frustration with democracy, contributing enormously to the increase in support for Hitler's National Socialist German Workers' Party"

<comment><USER22> > EDIT: I'm not sure why all the downvotes, maybe because it looks like I > Godwin-ed the thread? I was just paraphrasing the rest of the wikipedia > section:

Well in a thread about the re-emerging dominance of idiocy in silicon valley, consider it more supporting evidence.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER23> And it looks like California is planning on keeping an ever larger portion of that oh so sweet founder IPO dough!...

<comment><USER24> Good time to shelter in place in a tax haven now that your working remotely.

New Hampshire can be quiet lovely.

<comment><USER25> California is quite aggressive at taxing income from stock people were granted while living in California.

<comment><USER26> Your comment is technically correct, but misleading.

In fact California specifically does _not_ tax ex-residents for income arising from the disposition of stock acquired with ISOs, which is usually the way pre-IPO employees acquire shares. This is true even if the ISOs were granted for work performed in California.

<comment><USER23> You should look into the recent proposed bills that target exactly this. The provision that made headlines was a wealth tax on $30MM personal wealth, however it also includes enormous income tax hikes on anything above $1MM and explicitly targets capital gains.

<comment><USER16> > however it also includes enormous income tax hikes on anything above $1MM

It's a 1% tax hike on income over $1M, 3% on over $2M, and 3.5% on income above $5M.

I wouldn't call that enormous.

<comment><USER23> At rates like this, the gov't (federal and state) are collectively taking more than half my income and still can't seem to function properly.

3% _is_ enormous on top of existing sky high CA numbers...

<comment><USER27> still far below historical highs if you are being taxed at that marginal rate.</comment></comment></comment></comment></comment></comment></comment></comment>


Web Developers...HOW? - <AUTHOR>

I believe I have an industry changing idea but need the help of an exceptional web-developer....where do I go (other than local universities) to find this person? Any leads or interest is appreciated! Email me at firstname.lastname@example.com! Let's make it happen! <comment><USER2> You will probably want to get independent feedback from others (with nda if necessary) on whether your idea is truly industry changing before you go investing time and resources into building it.

</comment><comment><USER3> It's hard to imagine that there are exceptional developers out there with domain experience that don't have a backlog of ideas that they would prioritize. I think if it's industry changing then you should put your own money into it. Saving 25% sweat equity on 1 billion is a lot of money!

</comment><comment><USER4> I hope you have cash, otherwise get in line. Ten million people with industry changing ideas that need a 'partner.'</comment>


Visualizing and exploring sorting algorithms in two dimensions - <AUTHOR> https://dotink.co/posts/visualizing-sorting-algorithms/ <comment><USER2> > Most languages' baseline sort operations implement quicksort under the hood, > including the standard C library's gsort() and JavaScript's > Array.prototype.sort()

There isn't any "JavaScript's Array.prototype.sort()". Different implementations use different algorithms.

I know V8 used to use Quicksort with insertion sort for (sub)arrays smaller than 10 elements (the implementaion has changed since I last looked, but I don't know what).

But SpiderMonkey has and still does use a bottom up mergesort with insertion sort for subarrays of length 3.

<comment><USER2> A cursory look at the V8 source seems to show that it delegates sorting to std::sort which in libstdc++ (gcc) is Introsort (a hybrid Quicksort + Heapsort).

<comment><USER3> A more detailed look will show that it uses Timsort:

[https://cs.chromium.org/chromium/src/v8/third_party/v8/built...](https://cs.chromium.org/chromium/src/v8/third_party/v8/builtins/array- sort.tq)

<comment><USER2> Well I don't know how someone not used to the code was suppose to find it at that odd location.

Thanks for showing me where its actually implemented.

<comment><USER3> Yeah, for someone not used to the code it's tough. The "insider knowledge" is that builtins defined in .tq files (files compiled by the Torque compiler[0]) are added to entries in the Builtins enum, which itself is defined as a giant macro[1] that pulls in a Torque generated macro[2]. In the bootstraper (which sets up the standard library), the Builtins::kArrayPrototypeSort builtin is installed as "sort" onto Array.prototype[3], which means you should grep for "ArrayPrototypeSort", which is defined in the linked .tq file.

[0] [https://v8.dev/docs/torque](https://v8.dev/docs/torque) [1] [https://cs.chromium.org/chromium/src/v8/src/builtins/builtin...](https://cs.chromium.org/chromium/src/v8/src/builtins/builtins- definitions.h) [2] [https://cs.chromium.org/chromium/src/out/Debug/gen/v8/torque...](https://cs.chromium.org/chromium/src/out/Debug/gen/v8/torque- generated/builtin-definitions-tq.h) [3] [https://cs.chromium.org/chromium/src/v8/src/init/bootstrappe...](https://cs.chromium.org/chromium/src/v8/src/init/bootstrapper.cc?l=1687&rcl=6d7e1dd21b6495d3b55afae266edb65b41c40b20)

</comment></comment></comment></comment></comment><comment><USER4> > _Quicksort is a mouthful to explain in detail_

Don't know about that, this is not efficent but "explains" quicksort in general:

        fun <T : Comparable<T>> quickSort(list: List<T>): List<T> =
                with(list) {
                    if (size < 2) this
                    else {
                        val pivot = first()
                        val (smaller, greater) = drop(1).partition { it <= pivot }
                        quickSort(smaller) + pivot + quickSort(greater)
                    }
                }

</comment><comment><USER5> Selection sort and insertion sort are not O(n) algorithms...

<comment><USER2> If swaps are the only thing you are counting, selection sort is O(n).

I can't come up with a reasonable way to consider insertion sort O(n) though.

<comment><USER5> > If swaps are the only thing you are counting, selection sort is O(n).

And if you ignore the bottom half of the centaur, it's just a dude playing a flute. :)

"In computer science, the time complexity is the computational complexity that describes the amount of time it takes to run an algorithm." [1] We shouldn't be confusing people that actually want to learn about this stuff.

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

<comment><USER2> > And if you ignore the bottom half of the centaur, it's just a dude playing a > flute. :)

That is an excellent phrase.

> We shouldn't be confusing people that actually want to learn about this > stuff.

I definitely agree that Selection sort should definitely not be described as O(n) to beginners. I was just pointing out a subtly. In the strange case where memory writes are much more expensive than reads or comparisons, it is correct to say the Selection sort takes O(n) time.

<comment><USER5> I'm not sure what conditions you have in mind, but in the selection sort, the comparisons are O(n^2), and the assignments are O(n).

If comparisons are a fixed, non-zero cost, and assignments are a fixed, non- zero cost, then the comparisons in your selection sort will always overwhelm the assignments, and I can tell you at exactly which input size.

[https://gist.github.com/mrami4/56d6e234f34787b8c5daf543a299a...](https://gist.github.com/mrami4/56d6e234f34787b8c5daf543a299a7d5)

</comment></comment></comment></comment></comment><comment><USER6> Is it just me, shoe-horning this in there, or does this picture [1] of the Quicksort remind anyone else of a Scutoid? [2]

[1] [https://dotink.co/img/quick-color.png](https://dotink.co/img/quick- color.png)

[2] [https://en.wikipedia.org/wiki/Scutoid](https://en.wikipedia.org/wiki/Scutoid)</comment>


Dungeons and Dragons: The revival of a 'geeky' pastime - <AUTHOR> http://www.bbc.co.uk/news/uk-england-42874044 <comment><USER2> If people want to see what D&D can be when done by good players, don't look further than Critical Role. It's a bunch of voice actors playing D&D, who finished their multi-year campaign at the end of last year and started a new one at the beginning of this year. So they are dedicated to The game. The playlist is here [https://www.youtube.com/playlist?list=PL7atuZxmT955Cw- fFS-_3...](https://www.youtube.com/playlist?list=PL7atuZxmT955Cw- fFS-_3IQvaCpQgDzWA)

<comment><USER3> I can't get into Critical Roles style of play.

Where every hit is described in exquisite detail and one combat encounter feels like watching 9 innings of baseball.

Seriously, if it takes longer to "buy a torch" in a game than in real life, you're doing it wrong.

<comment><USER4> I don't mind that style of roleplay much as I've always gamed with improv/actor types, but the guest appearances are what ruin it for me... (unpopular opinion warning) I find Wil Wheaton, Felicia Day and most of the other folks in their orbit to be unbearable. I physically cringe when they start talking.

<comment><USER3> I'm from the Mirror universe.

Felicia Day could play solitaire and I'd probably watch.

Wil Wheaton can never atone for Wesley Crusher, so there's some common ground.

<comment><USER5> >Wil Wheaton can never atone for Wesley Crusher, so there's some common ground.

I know this is more or less a Trekkie meme, but to be fair, Wil Wheaton didn't create Wesley Crusher or write his lines, he just had to make due with being Gene Roddenberry's Gary Stu.

<comment><USER6> Will Wheaton to someone calling for prayers for shooting victims:

"The murdered victims were in a church. If prayers did anything, they'd still be alive, you worthless sack of shit."

He's more despicable than the character he played.

<comment><USER5> >He's more despicable than the character he played.

Despicable? He broadcast an emotional outburst and apologized for it later. That doesn't make him despicable, only human.

And besides, I think he's right.

And you left out the context[0] - that "someone" Wil was replying to was Paul Ryan. Calling for prayers for the victims of gun violence when you oppose attempts to address that violence in any practical manner is an insult to both the living and the dead. To me, _that_ is despicable.

[0][https://twitter.com/wilw/status/927284357609353218?lang=en](https://twitter.com/wilw/status/927284357609353218?lang=en)

<comment><USER6> [https://www.merriam-webster.com/dictionary/bigotry](https://www.merriam- webster.com/dictionary/bigotry)

You and Wheaton.

<comment><USER5> I mean, _you 're_ the one who decided to bring up a tweet he made a year ago and call the man despicable in a thread about how disliked a fictional character he played on tv was, but ok... I guess _we 're_ the bigots...

<comment><USER6> Yes

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> I could be wrong, but I follow few podcasts about "the hobby" and seems like people my age got into it on early 90s and stopped playing on by the end of the decade.

Now we're in our 40s and technology makes it easier to get back into it. For example, there's a healthy gaming community in Google+ and hang outs are great for playing without moving from home, because finding a group to play in the same room is one of the factors that made me drop off.

Then there's all the DIY part of it, with lots of people releasing new games and modules. I guess that creativity was already there back when I started, but now is easier for people to share it.

One of the best communities in Google+ is "The Gauntlet". Look for it.

<comment><USER8> Or got into it in the 80's — and now our kids are into it.

</comment></comment><comment><USER9> Table top role-playing was never dead. It's just hip right now for some reason like anything "geek", since "geeks" now have money brands and the media try to cater to their tastes, the same media who painted them as "idiots with a useless hobby" for 30 years.

<comment><USER10> idiots? that would have been gentle. Most media painted geeks as antisocial and having serious mental issues.

<comment><USER11> Antisocial? The media tried to link D&D to satanic murders for years.

<comment><USER10> Yeah, before moving to video games as the new culprit.

</comment></comment></comment></comment><comment><USER12> I used to play it a bit about 25-30 years ago. One of my best friends owns a comic shop, and we (a steady group of about 10 of us) used to go down there every Friday night and play various board and strategy games, D&D included every so often.

Then it all stopped when we started getting busy with work, getting married, transferring interstate etc.

But last year, one of our group passed away suddenly from cancer, and we were all at his funeral. We agreed then that we should start up the regular gaming nights again, even though we are all in our 40s and 50s now. Just last week we set up a Facebook group to start organising the games and to start planning characters for the next D&D night. It is good to play like carefree kids again.

<comment><USER13> It definitely gets a bit harder as people get busy family lifes et cetera. Our weekly games turned into perhaps monthly sessions at best, but we kept at it. One person moving to another country was also a hiccup, but it turns out it's quite doable to dial in with a good video connection if the will to continue is there.

</comment></comment><comment><USER14> In the 80s, I wrote at least four different versions of a character generator, all using the various PCs available at the time. For me it was like FizzBuzz.

Some of them got quite involved, with full-page printouts with all kinds of stuff on there. I even rented a booth at one of the early cons and attempted to sell them. (Along with another program that made custom crossword puzzles)

D&D was a happy part of my late childhood. Many good memories.

</comment><comment><USER15> I don't know. I don't like the new DD (4 and 5 versions) which seem to emulate online mmorpg game mechanics with no emphasis on storytelling. I'd like to play an good old DD session (hacking, slashing, adventuring and mystery solving) but nowadays when I and the gang play we go diceless with almost no rules.

<comment><USER16> I think most groups just ignore 90% of the rules and focus on interactive story with chance elements. I've met very few people who play tabletop RPGs for the mechanics. It's actually a lot like scrum or lean manufacturing in the sense that blindly following the rules is the worst way to actually use the system. Though, I think nearly every D&D book says you're doing it wrong if you're not having fun.

<comment><USER8> Agreed. The rules are there just to settle disputes or to corral players that want to test the limits of the DM's generosity.

<comment><USER17> As a DM, I kept the players in check by telling them that if they wanted to do such-and-such rule/thing, that the NPC's and monsters would also be able to do it. They backed down when they realized the rule would unbalance things.

</comment></comment></comment></comment><comment><USER18> I'm going to go out on a limb here and attribute the spread of tabletop RPGs to easy access to beginner friendly materials such as D&D Beyond & Roll20. When I started playing one of my classmates fingered me for a nerd and asked if I'd like to play, they needed a Wizard to round out the party. I had heard of D&D but didn't know of anyone who played or had the books, a few weeks and a bunch of new friends (and Fireballs) later I was hooked. 10 years later I'm still playing and DMing, have dumped an ungodly amount of cash into books/minis and love a good Sorcerer. If that guy in chem hadn't of asked, it probably wouldn't have happened.

Simply having access to all the materials and content destroys one barrier to entry, the character builders streamlining and simplifying the arduous character creation process with all the Handbook & DMG content available for free. I love that with Beyond DMs can purchase various sourcebooks and share their books out to members of their campaign, unlocking different classes and content. It's reminiscent of everyone bringing their random modules/bootleg PDFs and getting doe-eyed over some new variant. With Roll20 there are so many groups from all skill ranges looking for players/DMs and while not as bonding as sharing a table loaded with snacks, It's enough to get a foot in the door.

If you're curious about RPGs start with something simple and easy to learn the rules of such as Modempunk or Paranoia. Get some friends together, chuck on the Hackers Soundtrack and unleash your inner Joey [1] :)

(Page 27)

[1] [https://1d4chan.org/images/e/e8/JnJ_Modempunk_rightways.pdf](https://1d4chan.org/images/e/e8/JnJ_Modempunk_rightways.pdf)

<comment><USER19> My group is playing Savage Worlds, and I've found it very easy to learn. The other guys are RPG veterans, but this is my first PnP campaign. The reason I feel SW is good for beginners is the high focus on storytelling and creativity, rather than endless stats and dice rolls. They're obviously still a part of the game, but the GM can really work with you if you are able to tie your actions to a good bit of storytelling. It makes it feel more like a shared story than a game, to me.

<comment><USER18> >It makes it feel more like a shared story than a game, to me.

And that's the entire crux of why D&D is special, it's not just grinding along squashing mobs and ripping through dungeons it's creating that shared experience in novel non scriptable ways. I feel like Paranoia takes this to a extreme where I can DM sessions where only a handful of die are even cast and the rest is all interactive storytelling!

A DMs style must fit the player, this is one thing that will make or break a players RPG experience.

<comment><USER20> G&S did a one off of a paranoia game Felicia day is scary good [https://www.youtube.com/watch?v=oWEDpT1gByI](https://www.youtube.com/watch?v=oWEDpT1gByI)

</comment></comment></comment></comment><comment><USER21> Always happy to bring more people into the fold.

My friend group pooled our money in middle school to get a single copy of the 3.5 players handbook, and boy did we make use of it. I loved that you could play nearly anywhere, we usually played in the library (the librarian was nice and let us chat quietly) because we were broke though. We made some amazing stories, and still joke over all the dumb stuff we did that had ridiculous consequences (ie, "remember that time you forgot that burning hands had an area effect and got the whole team killed b/c you angered the Ranger's pet and then it started attacking everyone?")

I actually still play with two of those friends every week, more than a decade later. It kinda stinks to have to use Skype, but it's better than not playing at all. So yeah, Dnd is a wonderful, friendship strengthening hobby that I recommend to anyone with some patience and creativity.

</comment><comment><USER22> Another recent, fun take on the history of D&D [https://reason.com/archives/2018/04/07/the-radical- freedom-o...](https://reason.com/archives/2018/04/07/the-radical-freedom-of- dungeon)</comment>


The N.Y. Times' Support of U.S.-Backed Coups in Latin America - jules-jules https://www.truthdig.com/articles/your-complete-guide-to-the-n-y-times-support-of-u-s-backed-coups-in-latin-america/ <comment><AUTHOR> There's a lot of click bait going on in here. A coup in Venezuela wouldn't disrupt a democratic order because there is no democratic order in Venezuela.

The article assumes that Maduro is a legitimate President. That is simply not true, there is solid evidence of plenty of fraud on the last election, the rule of the law is long gone in there, the justice courts are puppets of the regime, the legislative is silenced by force.

What is at stake here is just whether the military keep supporting the caudillo Maduro or not. Democracy is out of this game already.

<comment><USER2> American citizens rely on the government and the press to determine if the election in a foreign country were legitimate. They do not speak the language in the country and do not have cultural ties to this country.

Do you think that the average American can accurately asses who is the proper president of Venezuela using only the word of the government and the press?

We know the current administration is packed with ideologues; many of whom are veterans of the Latin American "Dirty Wars" of the 1980s. I don't think we can trust the government on this one.

The "click bait" article, which is actually well cited, makes the case that the press is almost always in favor of regime-change in Latin America.

So I will ask again, do you think that US Americans are knowledgeable enough about Latin America to know what is best for Latin America?

<comment><AUTHOR> > do you think that US Americans are knowledgeable enough about Latin America > to know what is best for Latin America?

I don't know, I am Latin American (from Brazil), not US American.

<comment><USER2> I'm in the US and it is difficult to find media here that is critical of US intervention in Latin America. It's not a question that people need to engage with at all if they don't want to. It's a small story.

The current administration has nefarious intentions for Venezuela. They want to turn it into a more compliant, Banana Republic. [https://en.wikipedia.org/wiki/Banana_republic](https://en.wikipedia.org/wiki/Banana_republic)

</comment></comment></comment></comment><comment><USER3> Summary : America has done a lot of terrible things in South America.(agreed)

They tried to depose a lot of legitimate leaders. (agreed)

A couple of times the nytimes argued it was the right thing to do when it probably wasn't. (I'll take their word for it.)

But none of the article argues that Maduro is a legitimate leader. And I don't know if I buy the argument that because we tried to depose a lot of legitimate leaders in the past with illegitimate ones we should now support an illegitimate leader instead of the legitimate one.

<comment><USER2> The question that matters is: Should the US intervene.

Let's run down a list of the recent US interventions.

Russian Election of 1996: The US helped rig Russia's election in 1996. Electing Yeltsin for a second term is what brought in Putin and basically killed Russian democracy. [https://www.globalresearch.ca/us-meddling- in-1996-russian-el...](https://www.globalresearch.ca/us-meddling- in-1996-russian-elections-in-support-of-boris-yeltsin/5568288)

Iraq: 600,000 dead so far.

Libya: It was supposed to turn into a thriving democracy but instead it's now a thriving slave market. [https://www.cnn.com/2017/11/14/africa/libya-migrant- auctions...](https://www.cnn.com/2017/11/14/africa/libya-migrant- auctions/index.html)

Yemen: Largest humanitarian crisis in the world.

The list goes on and on. Things don't get better when the US intervenes. Let Venezuela decide it's own fate.

</comment></comment><comment> jules-jules Posted here mainly in light of the NYTimes article "Want to Stop Fake News? Pay for the Real Thing" that was recently posted here on HN. [1]

Also, let's not forget the NYTimes cheered the invasion of Iraq in 2003, and journalists who merely questioned the Iraq War lost their job at the NYTimes, the Dixie Chicks got blacklisted, etc.

[1] [https://news.ycombinator.com/item?id=19050102](https://news.ycombinator.com/item?id=19050102)

<comment><USER4> Too much truth in this thread so it was flagged. The HN readership and staff do not want their own bubbles popped.

<comment> jules-jules It's ridiculous, that post got 253 points and some 429 mostly uncritical comments. The HN crowd should know better than to uncritically trust the MSM, be it the NYTimes, CNN, or others.

</comment></comment></comment><comment><USER5> Why do papers collaborate with the government in this way? I don't see what they would have to gain, it's not like they're getting paid.

<comment><USER3> I don't think the nytimes is trying to back the governments opinion. One the author is cherry picking times when the nytimes supported the government. But I'm sure someone else could find plenty of times when they didn't.

Secondly when they made the wrong call, I bet at least part of the reason was 2002 was a less connected time, and there was more trust in government. So if a bunch of government offficials tell the journalist Chavez is a terrible regime. And you happen to know a handful of anti Chavez individuals in Venezuela the journalist could easily make the wrong call.

</comment></comment><comment><USER6> Media bias. Fake news.

From Chile: Allende was declared unconstitutional by the congress. The CIA came into play because the KGB and the Cubans were working here. There was inflation of more than 400%, the communists expropriated and introduced weapons, the country was in ruins and near a civil war.

On Venezuela: The Cubans have there: armed force, agents and intelligence. Besides that it is a Narco State. The economy = people are literally dying of hunger.

</comment><comment><USER6> Media bias. Desde Chile: Allende fue declarado inconstitucional por el congreso. La CIA entró en juego porque aquí estaba trabajando la KGB y los Cubanos. Había inflación sobre el 400%, los comunistas expropiaron e introdujeron armas, el país estaba en ruinas y al borde de una guerra civil.

Sobre Venezuela: Los Cubanos tienen ahí fuerza armada, agentes e inteligencia. Además de que es un Narco Estado. La economía = las personas literalmente se están muriendo de hambre.

</comment><comment><USER2> Establishment media organizations in the Anglo world are so reluctant to criticize of the Government line on anything related to foreign policy. It seems like it would be so easy and risk-free in the current era especially.

They're either ignorant of the history of US interference in Latin America, or they're ideologues acting in bad faith. I imaging there is also a strong pressure to go-along to get-along that weeds out anyone who would properly push back.

I recommend The Gray Zone Project for a counters-establishment perspective. Like all journalism, you need to know how to read it, but it really does cover foreign policy in a way that NYT cannot. [https://grayzoneproject.com/](https://grayzoneproject.com/) If you prefer something more tabloid-y I recommend The Canary. They even have US and UK editions. [https://www.thecanary.co/us/](https://www.thecanary.co/us/)

<comment><USER7> > Establishment media organizations in the Anglo world are so reluctant to > criticize of the Government line on anything related to foreign policy.

How did you miss the fact that virtually every US newspaper has criticized the current president's foreign policy on _deep breath_ Syria, Russia, Iraq, Afghanistan, Russia, Iran, North Korea, Russia, Canada, South Korea, Russia, most of our allies, etc?

Even before our current president plumbed unheard of depths in foreign policy idiocies, I've long seen criticism of foreign policy. The drone assassination program was a big one. The virtues of the surges in Iraq and Afghanistan was certainly a spirited debate.

<comment><USER2> I'm not really talking about the current administration. I'm talking about the US government's overall policy of overseas intervention that goes back decades. The press often criticize the government for not intervening, or for exiting an intervention. You're not going to see anyone on the pages of the NYT say that the US shouldn't be intervening in other countries, period.

> How did you miss the fact that virtually every US newspaper has criticized > the current president's foreign policy on deep breath Syria, Russia, Iraq, > Afghanistan, Russia, Iran, North Korea, Russia, Canada, South Korea, Russia, > most of our allies, etc?

> Syria

The press criticized the administration for deciding to leave. Even though the Syrian civil war is basically over and the regime won. Obama was criticized for not "doing enough" even though the Syrian Civil War was the largest CIA operation in decades and the opposition was overwhelmingly made up of sectarian death-squads. Don't take my word for it, read what the NYT's Thomas Friedman said in 2017. He argues we should allow ISIS to continue existing so that it might take down the Assad regime. [https://www.nytimes.com/2017/04/12/opinion/why-is-trump- figh...](https://www.nytimes.com/2017/04/12/opinion/why-is-trump-fighting- isis-in-syria.html)

> Russia

The liberal press has been criticized the decision not to ramp up a new cold- war with Russia. They attack anyone who opposes more sanctions.

> Iraq

The press uncritically promoted the invasion of Iraq and only turned against it when it started going bad.

> Afghanistan

If the any administration decided to pull out they would be criticized.

How about the West's role in Yemen? You didn't hear anything about that in the Anglo press until recently even though the UN was calling it the worst humanitarian disaster in the world.

I'm not saying the establishment press is always wrong. They serve an important purpose, but on foreign policy in particular their coverage ranges from good(leaving the Iran deal is bad) to awful(uncritical support for Syrian opposition), and sometimes it's just propaganda.

<comment><USER8> If you go look for _any example_ of _any op-ed_ in _any publication_ taking _any side_ in a foreign policy controversy, you will find it. It is not reasonable to then take that example and extrapolate it to "the press" or even "the liberal press".

<comment><USER9> This is why Chomsky et al also look at access to administration leaks and special interviews, the patterns of career TV "analysts" that get brought on to "analyze" a current event, and the way language, structure, and frequency of print news stories paint a picture. I doubt anyone is presenting "# of op- eds" as some sort of quantitative signifier and is unaware of the shades of gray between op-eds and news stories.</comment></comment></comment></comment></comment>


Thai government to MITM all internet communications - <AUTHOR> http://www.bangkokpost.com/opinion/opinion/993937/internet-laws-a-time-bomb <comment><USER2> We need general, automatic MITM detection in HTTP.

It's quite possible. An MITM attack has a basic quality that makes it detectable - each end is seeing different crypto bits for the same plaintext. All they have to do is compare notes.

There are out-of-band ways to do this, such as certificate pinning and certificate repositories. But these haven't achieved much traction.

Doing it in-band is difficult, but possible. An early system, for one of the Secure Telephone Units (STU), displayed a 2-digit number to the user at each end, based on the crypto bits. The users were supposed to compare these numbers by voice, and if they matched, they were probably not having a MITM attack. An MITM attacker would need to fake the voices of the participants to break that.

This is the insight that makes MITM detection possible. You can force the MITM to have to tell a lie to convince the endpoints. More than that, if you work at it, you can force the MITM to have to tell an _arbitrarily complex_ lie. You can even force the MITM to have to tell a lie about the future traffic on the connection. That means they have to take over the entire conversation and fake the other end.

As an example, suppose a server sending a page sends, at the beginning of the page, a hash value which is based on the contents of the page about to be sent, and also based on the first 64 bytes of the crypto bits of the connection. The browser checks this. The MITM attacker now has a problem. If they don't know about this, the MITM attack immediately sounds an alarm at the browser. If the attacker does know about this, they can compute their own hash. But they haven't seen the content the hash covers, because the page hasn't been transmitted yet.

So the attacker either has to buffer up the entire page before they can send any of it, or fake the page based on some source like a cache. Buffering up the entire page adds delay. The server can add to that delay by deliberately stalling for some seconds before sending the last few bytes of the page. If the MITM attack adds 10 seconds before every page begins to load, it's obvious what's happening. The browser could even check this; if the first byte of the page doesn't appear within N seconds, don't display it.

Faking the page is a lot of work, especially if it's customized. A cache won't be enough. Users will notice if they get a generic page instead of their personal social network page.

This would be a good feature to add to HTTP2, because it has one persistent connection which, once validated, is good for many pages.

Nobody seems to be doing enough with in-band MITM detection. There's [1], but that requires "previously established user authentication credentials." Facebook has a scheme which relies on MITM attackers not knowing how to MITM Flash content.[2] That's a form of security through obscurity, but it does detect most attacks at the proxy and hostile WiFi level.

[1] [http://www.cc.gatech.edu/~traynor/papers/dacosta- esorics12.p...](http://www.cc.gatech.edu/~traynor/papers/dacosta- esorics12.pdf) [2] [http://www.scmagazine.com/researchers-detect-ssl-mitm- attack...](http://www.scmagazine.com/researchers-detect-ssl-mitm-attacks- method-implemented-by-facebook/article/346994/)

</comment><comment><USER3> In order to successfully pull off the MITM attack against TLS connections they will need a rogue CA or cooperation from browsers. Fortunately Thailand is completely dependent on foreign software and services, and I see no reason why Google, Mozilla, Facebook, etc would cooperate.

The government will still be left with two options: Severely cripple themselves by blocking entire services or remain unable to decrypt traffic. Unlike China, Thailand is in no position to create their own search engines, social media and messaging systems.

<comment><USER4> > In order to successfully pull off the MITM attack against TLS connections > they will need a rogue CA or cooperation from browsers.

Well, "fortunately", Blue Coat Systems, leading manufacturer of intercept devices for authoritarian regimes, now has an intermediate cert courtesy of Symantec CA, so they're fully capable of issuing and installing MITM certs for use on their clients' devices.

<comment><USER5> Would it be hyperbolic to say vendors like Blue Coat have blood on their hands?

Yeah it's just a tool and yeah your workplace or school might need one to "keep the children safe", and yeah they're not responsible for what their customers do with their products. But when they knowingly sell[1] to repressive governments where bad things happen to dissenters, what does that make them? And please spare us the "terrorist" and "criminal" barf, we've heard it in the West.

Any Blue Coat care to comment?

1\. [https://www.eff.org/deeplinks/2011/10/blue-coat- acknowledges...](https://www.eff.org/deeplinks/2011/10/blue-coat-acknowledges- syrian-government-use-its-products)

</comment></comment></comment><comment><USER6> It was inevitable this would spread beyond Kazakhstan. I previously wrote about this: [https://www.devever.net/~hl/policymitm](https://www.devever.net/~hl/policymitm)

</comment><comment><USER7> I just cancelled my ticket to Chiang Mai, I will find somewhere else to digital nomad.

<comment><USER8> I was wondering what all the digital nomads there think of this.

<comment><USER9> I live in Thailand; I'm extremely skeptical that it's going to happen. The most likely explanation is that a few powerful generals feel like this must happen and proudly announce their plans, and technical teams responsible for actually doing it feel too intimidated to explain to the generals why it's impossible, so they just agree to it hoping that the dictatorship will be out of power before the implementation could happen.

As someone from /r/Thailand put it, "I'm hoping incompetence and indifference would save the day once again, as it has many times in the past." They can't withdraw it now without losing face, but they can let it just wither and become forgotten over a few years.

<comment><AUTHOR> I also live in Thailand and I hope you are correct. But the fact that they can now easily buy the equipment and consulting to do this sort of thing means they might very well try it. And like I said in another comment, they don't care if it breaks the internet because they and the people they are serving don't use it like everyone else. To them the internet is little more than a major annoyance because it allows dissidents to communicate and engage in speech they don't like.

<comment><USER10> I also live in Thailand and think we should all get a beer.

firstname dot lastname at gmail

</comment></comment></comment></comment></comment><comment><USER11> SSL added and removed here

We begin therefore where they are determined not to end, with the question whether any form of democratic self-government, anywhere, is consistent with the kind of massive, pervasive, surveillance into which the Unites States government has led not only us but the world.

This should not actually be a complicated inquiry.

[https://archive.org/details/EbenMoglen- WhyFreedomOfThoughtRe...](https://archive.org/details/EbenMoglen- WhyFreedomOfThoughtRequiresFreeMediaAndWhyFreeMedia)

Surveillance is not an end toward totalitarianism, it is totalitarianism itself.

[https://www.washingtonpost.com/world/national- security/nsa-i...](https://www.washingtonpost.com/world/national-security/nsa- infiltrates-links-to-yahoo-google-data-centers-worldwide-snowden-documents- say/2013/10/30/e51d661e-4166-11e3-8b74-d89d714ca4dd_story.html)

</comment><comment><USER12> Those who read Thai can find more information here:

[https://thainetizen.org/2016/05/single-gateway-back-ssl- cens...](https://thainetizen.org/2016/05/single-gateway-back-ssl-censorship/)

</comment><comment><USER13> I somehow feel this is good for any of those countries in between the western capital based democracies and the extreme of North Korea: it will backfire sooner or later, but without any of this silly measures trigging public awareness, people would keep believing in their leaders and brainwashed culture.

Maybe it is what it takes to move forward from a dictatorship to a (fake) democracy these days.

<comment><USER14> Are you aware of the last 15-ish years of democracy in Thailand.

<comment><USER10> Thailand had a coup two years ago and has been living under military dictatorship ever since.

<comment><USER14> The 2014 coup was just the latest in a series of anti-Shinawat actions (including the 2006 coup and the events of 2010).

<comment><USER10> Do you spend much time in BKK? If so we should get a beer. @travlbum on Twitter

</comment></comment></comment></comment></comment><comment><USER15> What about China? Does the great firewall also MITM the requests?

<comment><USER16> China blocks a lot of https traffic out right.

the https everywhere movement was a pain-in-the-ass when I was in China, because many websites would redirect me from http to blocked https.

<comment><USER17> How was your access to VPNs, or did you have a chance to try them out? I used to work for a VPN company and China was a constant challenge.

<comment><USER16> I lived there before the big VPN crack-down. It is much harder to get working VPN now then just a few years ago, according to my friends.

I switched from Gmail while I was there (and back) and just watched youku instead of youtube, so I mostly didn't bother paying for a VPN.

</comment></comment></comment></comment><comment><USER18> So unrelated to this, what are the best couple resources out there for understanding the PKI system? I understand it in vague terms and I can use it. I just don't know enough of the details of it to be comfortable with it.

It may be that I would be even less comfortable with it if I knew the details.

</comment><comment><USER19> Kazakhstan is doing this already.</comment>


Fans--Don't Miss Out - <AUTHOR> http://blog.fancite.com/post/19933583986/fans-dont-miss-out

<comment><USER2> I am definetly finding things that otherwise i would miss. i am just facinated by how much "Fan art" is out there. fans are spending time and showing off their creativity through Fan art which is such a pleasure to see.

I am part of the Fancite team. I would love to hear any feedback you guys have on the design/product etc.</comment>


Dear Tech Early Adopters: Manufacturers Don't Care About You - <AUTHOR> http://techcrunch.com/2010/12/21/dear-tech-early-adopters-manufacturers-dont-care-about-you/

<comment><USER2> _tl;dr: normal people don't care about specs, the operating system, etc. manufactures ship shit cos they can and ultimately just need to sell it. as early adopters we are influencers but thats it, manufactures don't care. early adopters pontificating about tech are just chirping to the echo chamber. something about tight pants._

What a load of old bollocks. In his attempt to prove a point he totally over- simplifies the situation.

Sure my mother doesn't care whether her phone has a 900Mhz Targa CPU or a 1Ghz Snapdragon CPU. But of course she does care which OS it is. _"Why don't the apps I bought on the Apple App Store work on this Android phone I just upgraded to?"_.

And of course it is not ok for some manufacture to offload some stinky pile of shit tablets to Walgreens, one that have fundamental hardware and software flaws which is why they can't be sold via regular channels, and call them "$99 Android Tablets". Because poor customer who buys said tablet now goes away thinking all Android tablets are crap, perhaps all tablets in general are crap, and goes and tells their friends to boot.

Who else is going to call out the manufacture than the early adopter crowd? Other manufactures can't (it's not the done thing). It makes the space crap for everyone.

And as for saying manufactures don't care about early adopters, most first-gen products are aimed squarely at the early adopter crowd because often on day 0 there isn't the network effect, product development, etc to really bring out a proper fully baked product and so they rely on the early adopter crowd to start the ground swell.

Android G1, current line of Google TVs, First DVD/HD-DVD/Bluray players are all examples of products manufactures built for early-adoptors. Even Apple, usually very good at being totally consumer-focused, has openly been courting he early adopter crowd with the AppleTV while it R&D's in public what the sweet spot is in that space.

Yes, us early adoptors != general public buyers, but this article completely discounts and discredits a still significant and important part of the technology market and ecosystem.

<comment><USER3> To be fair, I think what he is specifically saying is that a lot of the blogosphere/tech buzz/flame wars etc. is not influencing anything because by the time the early adopters get their hands on the gear, the next product is already in the production pipeline, so there's no _real_ net effect in being able to influence product development. (The "influencing" effect is more of a marketing effect).

But I agree with you that I have not encountered a computer user, no matter how naive, who didn't take specs into consideration when they buy their next computer. They know they need "more" if nothing else.

</comment></comment><comment><USER4> The article is incoherent.

In any case, if the early adopters of Apple products are getting a bad deal as the author seems to be saying, where are these unhappy customers? Shouldn't such unhappyness show up in customer satisfaction surveys, where Apple leads by a wide margin?

On the other hand, the author's central point that early adopters often don't make out so well generally is probably true. Experienced tech customers understand the risks, others may not.

</comment><comment><USER5> I would imagine the microsoft ad linked in the article will resonate with a lot of people. Very well done.</comment>


Building a Poker Bot: Part 2 - <AUTHOR> http://www.codingthewheel.com/archives/how-i-built-a-working-online-poker-bot-2

<comment><USER2> "Ironically, your profit would shrink to zero if the site stopped collecting rake! The thing that more than any other makes games tough to beat - the rake - makes it possible for your bot to turn a healthy profit. And that, as a long-time online poker player, makes me smile."

That's not true at all. In fact, the logic is terrible. If your bot is breaking even at a raked table, and you remove the rake, it would become a winning player. Far more so, in fact, than it makes just taking 35% of the rake back.

<comment><USER3> I definitely agree with you, but I was trying to think about how what he said could be true. Is it possible rakeless games would alter the strategies of the opposing players enough to render the bot ineffective?

But I guess even then the bot could be modified accordingly. Interested to hear the author's response...

<comment><USER2> It would alter strategy a little. You should play more hands. There are a number of hands that are very close to 0 in EV that become positive EV with no rake. Not that many though, especially in low limits.

I'm sure the bot would be modified accordingly. My guess is it would add a couple percent more hands in. I'd further suspect that the increase in postflop play would then lower the bot's expectation (bot's are incredibly well suited for pre-flop play, not so much after) so though it would still do better than at a raked table it wouldn't be the 3x you'd expect.

It would do better though. The skill differential would be nowhere near large enough to overcome adding a hundred or more dollars per hour to the table. It'd still probably be at least 2x I'd guess.

The bot would also make more in the long run because the people it makes its money from would go broke slower.

</comment></comment></comment><comment><USER4> I thought that the topic was covered comprehensively last week ( <http://news.ycombinator.com/item?id=185830> ) but, there's plenty to discuss about privacy invasion and bot counter-measures.</comment>


Functional JavaScript, Part 4: Function Currying - <AUTHOR> http://tech.pro/tutorial/2011/functional-javascript-part-4-function-currying

<comment><USER2> Interesting, especially aside about partial application ("holes") which I've not seen done in JS before.

I've been using my own JS currying implementation in a few projects[1], which pretty much matches the implementation in the article: count the function's parameter number and build up argument lists in closures until we have enough to call the function, then pass them all in.

However, when I was implementing the same thing in PHP[2] I discovered a nice alteration we can make: instead of passing _all_ arguments to the curried function, we should only pass the minimum number. If we have any left over, we should pass them to the _return value_. This lets us chain even more things together[3]. For example:

        // "c" is our currying function
        var id     = c(function(x)       { return x;         });
        var triple = c(function(x, y, z) { return x + y + z; });

        // These work with both currying functions
        id(triple)('Hell', 'o Wor', 'ld');
        id(triple)('Hell')('o Wor', 'ld');
        id(triple)('Hell', 'o Wor')('ld');
        id(triple)('Hell')('o Wor')('ld');

        // These only work with the altered version
        id(triple, 'Hell', 'o Wor', 'ld');
        id(triple, 'Hell')('o Wor', 'ld');
        id(triple, 'Hell', 'o Wor')('ld');
        id(triple, 'Hell')('o Wor')('ld');

[1] [http://chriswarbo.net/index.php?page=news&type=view&id=curry...](http://chriswarbo.net/index.php?page=news&type=view&id=currying- in-javascript)

[2] [http://chriswarbo.net/index.php?page=news&type=view&id=admin...](http://chriswarbo.net/index.php?page=news&type=view&id=admin- s-blog%2Fpartial-application)

[3] [http://chriswarbo.net/index.php?page=news&type=view&id=admin...](http://chriswarbo.net/index.php?page=news&type=view&id=admin- s-blog%2Fbetter-currying-in)

<comment><AUTHOR> This is very interesting. I'm not so sure this wouldn't trip me up some times though. What if the first argument you are expecting, is supposed to be a function? I would think that would be a pretty common scenario...

Unless I'm not quite getting what you mean?

EDIT: I see that this would only happen if you passed in more arguments than expected, thus it wouldn't be a problem.

Very cool! I might update mine to work this way.

<comment><USER2> Indeed, the behaviour should be identical when too few or exactly enough arguments are given.

The way I see it, if we're not given enough arguments we introduce wrappers around our function to accept the rest. With this alteration, when we're given too many arguments we eliminate wrappers from around our result by passing them the rest.

This hints that they might be 'dual' notions, in a Mathematical sense. Maybe I should dub it "cocurrying"? ;)

<comment><USER2> > This hints that they might be 'dual' notions, in a Mathematical sense. Maybe > I should dub it "cocurrying"?

After a little more thought I've realised that this is exactly uncurrying of return values.

When we uncurry, we take a bunch of arguments at once and supply them one-at- a-time to our function, for example "uncurry(foo)(a, b, c, d)" becomes "foo(a)(b)(c)(d)".

Note that this is identical to the calling convention of a curried function, hence the name uncurrying. In this way, it makes sense to uncurry the return value of curry:

        // Pass 3 values to a curried function which just-so-happens to return
        // other functions
        curry(function(w, x) {
          return function(y) {
            return function(z) {
              return w + x + y + z;
            };
          };
        })(1, 2, 3, 4);

        // Take the first 2 arguments to be w and x
        (function(w, x) {
          return function(y) {
            return function(z) {
              return w + x + y + z;
            };
          };
        })(1, 2)(3, 4);

        // Apply the first function
        (function(y) {
          return function(z) {
            return 1 + 2 + y + z;
          };
        })(3, 4);

        // The above version will ignore 4 and wait for another z.
        // This is why we need to uncurry it.
        uncurry(function(y) {
          return function(z) {
            return 1 + 2 + y + z;
          };
        })(3, 4);

        // Now we can execute it properly
        (function(y) {
          return function(z) {
            return 1 + 2 + y + z;
          };
        })(3)(4);

        (function(z) {
          return 1 + 2 + 3 + z;
        })(4);

        10;

Now, given our implementations of curry, we don't actually have to uncurry a function explicitly: we can call "foo(a, b, c, d)" even if "foo" is curried. Hence we can just pass all the arguments straight into the return value _assuming that_ it is uncurried.

This will work for regular Javascript functions and those which we've curried. The only thing it won't work for is functions which have been hard-coded in a curried form; these will need to be sent through an uncurry function first (which we can do via composition).

</comment></comment></comment></comment><comment><USER3> Seems to me that using the functional style it's really important to document the types (done in the article with the //\+ lines).

Otherwise it will be hard to make the types line up.

Also there are functions in javascript which do different things depending on what the type of the argument is (or do different things depending on how many arguments are passed in; those kinds of functions always have irked me), so it would be hard to document exactly what the "type" of those functions are.

<comment><AUTHOR> @platz, yes, this is correct. When currying and/or composing functions, it becomes more difficult to determine the input/output types of the function since the function signature won't be right there. I'm borrowing the `//+` syntax from Brian Lansdorf, since I saw him use it and quite like it. He mentioned he has "a lot to say on the topic" of commenting / type sigs, but I haven't heard him speak specifically on that.

Also, for functions that do different things depending on how many arguments are passed in, you would _never_ want to curry these. The curry function relies on the function passed in expecting a specific number of arguments.

<comment><USER3> Part of me thinks that if you're going to pursue this style to it's extreme, you might as well just be better off using something like purescript

[http://purescript.readthedocs.org/en/latest/intro.html#hello...](http://purescript.readthedocs.org/en/latest/intro.html#hello- purescript)

<comment><AUTHOR> I haven't had a chance to try purescript yet, but I have looked at it. Really though, I love JavaScript, and don't have much desire to use another language that that transpiles into it...

<comment><USER3> Fair enough, there's always headaches with transpilers; I for one have been suspicious of all the coffeescript+derivatives.

</comment></comment></comment></comment></comment><comment><USER4> "In most web applications the "bottle-neck" is going to be DOM interaction. It is very unlikely that you will notice a performance hit at all."

uhhh, 2 wrongs don't make it right?

"It is very unlikely that you will notice a performance hit at all."

Until you do..

\--

I could never justify using this stuff at work. It's inefficient, unfamiliar to most JS developers and even if it did pass a peer review, nobody else would actually want to maintain it.

<comment><USER2> > I could never justify using this stuff at work. It's ... unfamiliar to most > JS developers and even if it did pass a peer review, nobody else would > actually want to maintain it.

The same could be said for any API.

Currying is actually very unobtrusive; the only time a curried function behaves differently to its uncurried counterpart is when it's given a 'wrong' number of arguments. The benefit is never having to perform manual eta- expansion (ie. any time we write a redundant wrapper like "function(x) { return bar(a, b, c, x); }").

As for efficiency, I default to having the machines doing things to save developer's time and only do things the other way around when it's untenable (or for fun).

</comment></comment><comment><USER5> Another motivation for currying in JS is to memoize the curried function which I describe in my post [http://taylodl.wordpress.com/2013/11/05/functional- javascrip...](http://taylodl.wordpress.com/2013/11/05/functional-javascript- currying/)

I never provided a currying function, thinking there were so many implementations easily available - but I've never seen one as good as what's presented here!

</comment><comment><USER6> Awesome job! I was trying to understand curry by learning Haskell but you summed it up perfectly.

What is the difference between curry and partial? Is a partial just a curry that hasn't filled in all the arguments yet?

<comment><USER2> I assume you mean "partial application"?

"Currying" turns a multi-argument function into a chain of one-at-a-time wrappers. If we curry a 5-argument function "foo(a, b, c, d, e)", we get a nesting of 5 functions, each accepting one argument "foo(a)(b)(c)(d)(e)". The implementation in the article, as well as my own, go slightly further and _also_ allow curried functions to accept multiple arguments at once, eg. "foo(a, b, c, d, e)"; this is just for convenience though, a "real" curried function must accept arguments one at a time. Note that in Haskell syntax, there is no difference between the two: "foo a b c d e".

Alternatively, "partial application" takes some argument values now, returning a function which accepts the rest later. If we partially-apply a 5-argument function with, say, its first 2 arguments, we get back a 3-argument function, eg. "papply(foo, a, b)(c, d, e)".

Note that we must use partial application explicitly whenever we want to supply a few more arguments; curried functions keep track of this themselves.

As an aside, you mention Haskell. Note that Haskell functions are already curried; in Haskell, "curry" and "uncurry" convert between functions which accept separate arguments and functions which accept one big tuple of arguments.

</comment></comment><comment><USER7> being a javascript/typescript developer with little knowledge about functional programming, this article renewed my interest in the matter. I would be interested to see some performance tests though, to get a feeling just how much 'a little performance cost' costs

<comment><USER8> Me too. I thought long and hard about how I could use functional programming (aside from the usual callbacks) and came to the conclusion that functional programming is more composable - that's its strength - how you can combine stages in a pipeline. It's all centered around data flow instead of execution flow.

One example would be jQuery or Underscore - how you can chain operations with the "." operator, or another common example is how we use the pipe " | " operator in the shell to compose processes. I use the latter quite a lot and am proficient at making pipelines.

By contrast, procedural programming relies a lot on global variables and that makes a mess of reusing pieces of code from an app into another.

<comment><USER2> I wouldn't say that procedural code relies on global variables, but I would say that we find ourselves worrying about execution order a lot more when using procedures rather than pure functions.

If we care about execution order, we tend to avoid higher-order patterns which may defer execution (eg. compose) or give a nondeterministic order (eg. map). If we avoid higher-order patterns, we end up hard-coding an awful lot of control-flow, which makes our code less re-usable.

Simplistic attempts to avoid this, introduce a small amount of higher-order behaviour, like passing around 'callbacks', but this can be cumbersome and add a lot of boilerplate. Of course, the solution to avoiding this is to use even more powerful higher-order functions (like monadic bind) to handle the callbacks for us, but since we're trying to avoid as much higher-order behaviour as possible, this tends not to be done.

</comment></comment></comment><comment><USER9> Seems like a cool use of the technology.</comment>


Google Flushes Heat From Data Center With Toilet Water - <AUTHOR> http://www.wired.com/wiredenterprise/2012/03/google-sewer-water/?intcid=story_ribbon

<comment><USER2> I wonder if it would be feasible to put a data center next to a power plant, and use the cooling water to raise the temperature of the water flowing in to the power plant, theoretically it should then take less energy to raise the temperature high enough to generate steam to power the turbines...

<comment><USER3> I had thought the same thing about using a power plant's steam output to preheat the inbound water. Turns out, that bringing water up to just below boiling is a very small amount of energy, compared to the energy it takes to boil off that same amount of water. As a demonstration, fill a pot with water and put it in the stove. Notice that it will start boiling within about 5 minutes, but it takes maybe a half hour to an hour to boil off the whole pot of water.

<comment><USER2> Good point. How disappointing!</comment></comment></comment>