Thoughts about the cutting-edge of server programming - <AUTHOR>

I am currently working on a project to develop a secure mobile app using micro-services written in Go, Node.js, and Lua targeted at both Android and iOS. I am writing the back-end which will be cloud-based. I thought it would be a good idea for me to share some of my experiences.
Micro-services are the coming absolute standard in server architecture. Dividing a program up into smaller pieces has always be one of the principles of computer science, but to take it one step further and to have different parts of the program in different machines use to be only in the realm of super-computing. Cheap cloud-computing allows everyone to easily create their own clusters, and micro-services are the best architecture.
Of course our queries are RESTful, but we chose to use a simplified form. The requests are URL-queries, and it seems that the lowest common denominator for how long they can be is 2k characters (to be accessible to all browsers). The responses, though, are always in JSON.
Go is an incredible language whose standard library has enough components to satisfy 90% of one's needs. One can think of it as an improved C, so it lacks inheritance, function overloading, and generics. I hope someone creates a fork called Go++. I did some tests, the Go HTTP component was 80% as fast as Nginx, but they were only simple page loads, since Nginx's scripting language is not that complete.
Node.js is the most powerful way to do server-side scripting. Tens of thousands of packages means that one hardly has to write any code. And the speed is pretty decent, but do not even try to do anything CPU intensive. Node.js is JavaScript which is compiled with the V8 Engine and single-threaded.
I also realized the differences between concurrency and parallelism. When there is only 1 CPU, it is not possible to have parallelism. Parallelism includes concurrency, but concurrency is not parallel. <comment><USER2> > Node.js is the most powerful way to do server-side scripting

not really.

By the way, have a look at [http://blog.plataformatec.com.br/2015/06/elixir- in-times-of-...](http://blog.plataformatec.com.br/2015/06/elixir-in-times-of- microservices/) . Elixir/Erlang excels at concurrency and allows you to build large-scale distributed backends easily, with many additional benefits (fault tolerance, ...).By the way, "Microservices" and "Actors" for parallelism and concurrency aren't really discussed in the erlang/elixir world, since this is the natural way to code. The "cutting edge" to do massive backends is actually decades old, battle-proven and guaranteed to work, this is what erlang actually was designed for.

Many many Big systems today are using the Erlang VM for their critical backends, like Call of Duty or Whatsapp.

<comment> vezzy-fnord Please do not give undue preference to Elixir over Erlang.

Other than that, I agree.

<comment><USER2> I used both, Elixir/Erlang and Erlang/Elixir. And Both variants exactly one time. The only small preference is that I used the Elixir/Erlang variant as the first one, but hey, one could argue that coming from Go/Node, elixir may be easier to get started. :)

<comment> vezzy-fnord What are "Elixir/Erlang" and "Erlang/Elixir" supposed to mean? I understand adding the slash for OTP, as those are shared traits. Perhaps their use of BEAM, though that's secondary.

<comment><USER2> Common language shortcut for "OR", at least for my understanding it seems-

</comment></comment></comment></comment></comment><comment><USER3> "Micro-services are the coming absolute standard in server architecture."

I worry when I read comments like this.

Micro-services are an architectural style that should be used appropriately, not religiously, no matter what your favorite blog is telling you.

<comment><USER4> Spot on. And there is a fairly large overhead. A lot of the places speaking about the wonders of micro-services deal with <100 micro-services (about the number you would get if you converted a small-medium sized app). Lets see what happens when you get 10k micro-services.

</comment></comment><comment><USER5> > Tens of thousands of packages means that one hardly has to write any code.

this is exactly what's wrong with the Node community.

</comment><comment><USER6> I think that the Go++ you search exists already: Rust. (no offense, but Rust has everything you need plus what Go has already)

<comment><USER2> Agreed, Rust is superior to Go in _almost_ any way. Especially when stuff becomes more than a 30-lines-snippet, Rust shines.

<comment><USER7> I haven't yet found a supported Rust answer to goroutines, though -- am I missing something?

<comment><USER6> std::uv ? lightweight threads similar to go-routines, greenlets of gevent (Python), or Node.js.

EDIT: Mea culpa, it used to have. (ref. [http://stackoverflow.com/questions/29428318/why-did-rust- rem...](http://stackoverflow.com/questions/29428318/why-did-rust-remove-the- green-threading-model-whats-the-disadvantage))

Well, you can always build your own interfaces to achieve a similar result. But why do you need go-routines ?

By the way, at least, Rust tries to handle concurrency the most he can (by analyzing if data race can occur, at compile-time for example).

What do you need more ?

<comment><USER7> The goroutine model allows a _lot_ of tasks to be handled in parallel without the application developer having to worry about it. So, for example, a web framework can have one goroutine per request and scale very well. That is what I would love to see in Rust, although I know it isn't likely right now since a lot of the ecosystem is still maturing.

<comment><USER6> Oh, I see what you're saying. Yes, me too. And I may end by giving a try to implement such lib.

Anyway, like you've said, the ecosystem is still maturing. But the more people are interested in Rust, and the more libs we will have.

<comment><USER8> The advantage that Go has with regard to green threads is that the language and its standard library are built around them. There's no easy way to introduce them into a language via a library with the same level of simplicity.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> I'm curious if you writing a "mobile app" that works in the browser, why you labelled it Android/Ios? I do love the optimism abound that you think your app will need to scale so largely. It is better to build in scale from the beginning, rather than as an afterthought.

</comment><comment><USER10> Hi, you mentioned Lua in the first paragraph but didn't go into any detail about how you are using it. Can you expound on that?</comment>


Jill Stein to file for recount in three states - <AUTHOR> http://thehill.com/blogs/blog-briefing-room/news/307404-jill-stein-to-file-for-recount-in-three-states <comment><USER2> I think if there's reason to believe that votes were miscounted or there was fraud, there should be a recount.

But I can't help but notice that the media seemed to hammer Trump about the possibility of not accepting the results of the election. I strongly suspect if he were the one demanding a recount it would be treated very differently. It's disappointing that our society so obviously switches its standards based on someone's in-group or out-group status.

<comment><USER3> Recount is different from rejection of results. It was unclear whether he was anticipating a legal fight or simply planning on ignoring the counts. My guess is that he wanted to lose so that he could focus on making noise and have no responsibility.

<comment><USER2> Why would anyone put so much time and money into an activity they hope to lose?

I think the whole issue was created to make him look bad. "Hey, if you lose, will you accept the results?" After Gore/Bush, I don't know if anybody would immediately say "Yes" without thinking about the possibility of questionable things happening. Would you accept the results of an election with fraud? Until the election happens, you can't have 100% confidence that you won't think there was some fraud.

A lot of us here have questions about voting machines, people voting who shouldn't, etc. These are natural concerns that should be Hillary's concerns (as they are now) and not just Trump's.

The question was not "Assuming there is iron clad proof of no voter fraud, will you accept the results if you lose?" The answer would almost certainly have been "Yes" in that case. I think all of us on this site are smart enough to assign non-zero probability to the chance that this question was asked WITHOUT the "no voter fraud" disclaimer specifically to elicit the reaction that it got.

<comment><USER3> > money

He loaned $45 million and gave less than $10 million, but mostly as in-kind gifts not cash. He said back in 2000 he could run for president and _make money_ from the campaign. I think he succeeded, depending on the interest rate of that loan. He spent a bunch of campaign funds by buying from his own businesses.

> time and money

Maybe he just wanted to be on TV.

<comment><USER4> > He spent a bunch of campaign funds by buying from his own businesses.

Is that illegal?

<comment><USER3> No, just lame.

</comment></comment></comment></comment></comment></comment><comment><USER5> To bring this more in line with HackerNews usual content, what do you guys think the chances are that the voting machines will actually show a significant discrepancy from the paper receipts? Will this recount actually involve an audit of the voting machine software at all?

I have my doubts the outcome will be significantly changed, but I'd love it if the process involved an auditing of the voting machines, just from a curiosity standpoint...

<comment><USER6> I would suggest it be checked, but not expect to find anything depending on the model. It'd look for zeroed out blocks, blocks containing data from other blocks or blocks containing random data where there should be none because this is how I'd erase traces of malware myself. Also look for directories with suspicious deleted entries (because I almost forgot I'd need to rewrite those too to erase any fingerprints).

</comment></comment><comment><USER7> Basically, this is pretty much academic at this point. Hilary would have to gain enough votes to flip all 3 states. Trump will win the recount.

However, this will absolutely enrage his base as they see it as an attempt by the elite to steal the election. Trump seems to be moderating on some of his previous stances, but will likely reverse and be even more extreme after he wins a recount. Also, look for pressure on the Senate to completely suspend the filibuster and push through a very right wing Justice.

Based on how President Obama and Hilary Clinton are handling this so far, I expect them to intervene to squash any recount and try to make the transition as smooth as possible.

<comment><USER8> I noticed the same, Obama and Hillary both started to act very sportsmanlike right after the results. As is appropriate. It's the media and other factors that seem to hold on to a distant dream they once had.

<comment><USER9> What's unsportsmanlike about a recount, especially by a third party candidate that received so few votes? It's not like she's not accepting the results of the election, just challenging the accuracy of the reported results.

<comment><USER8> I didn't mean Stein, more like meant about all the rioting and the news coverage that tries to paint this grudgy picture.

<comment><USER9> Yes, then I misunderstood your comment, and in that case I agree.

</comment></comment></comment></comment></comment><comment><AUTHOR> Looks like it is going to happen. The fundraising is getting close to its goal and it is over 1.9m, (it was 1.7 just 30 mins ago).

[https://jillstein.nationbuilder.com/recount](https://jillstein.nationbuilder.com/recount)

<comment><USER10> it will lead nowhere... but civil war would be interesting!

<comment><USER6> A rigged election, a civil war interrupted by a Russian nuclear attack. On the bright side, we'll have time travel soon.

</comment></comment></comment><comment><USER11> "Jill Stein is the friend who ruins your wedding but really shows up for you during the divorce."

[https://twitter.com/morgan_murphy/status/801589703078187008](https://twitter.com/morgan_murphy/status/801589703078187008)

</comment><comment><USER7> Looked into this a little more, and I doubt that Jill Stein could even get a recount in Pennsylvania. According to [http://billypenn.com/2016/11/23/a-pennsylvania-recount- for-h...](http://billypenn.com/2016/11/23/a-pennsylvania-recount-for-hillary- clinton-a-nightmare-scenario-explained/)

" A candidate can't actually file for a vote recount under Pennsylvania law. Instead, they would have to challenge a county board regarding its vote computations, and a state appeals judge would have to rule that a statewide recount is necessary. That means the Clinton campaign would either have to request a recount by petition in every voting district or present a prima facie case showing voter fraud. (Prima facie is a lower threshold than beyond a reasonable doubt. A judge would just have to rule that fraud probably occurred in order to call for a recount.) "

While a state judge just possibly might rule for Clinton for a recount, I seriously doubt a judge would do that Jill Stein as she has no realistic chance of winning the state.

</comment><comment><USER12> If there's any modern case to be made for the electoral college, it's in these states. If they aren't all effectively faithless voters, then the founding purpose of the college is not true and should be done away with. Instead, it sounds like the faithless voters, should there be any, and if they defect, would vote for some other Republican. So it's not like Hillary would win just because Donald doesn't get enough votes.

If the election is questionable, the state legislatures can pick its Electors, and they should. That's what authenticates the process. Of course there needs to be more facts than just speculation there's been tampering or fraud; but the way these systems are designed, they may not have sufficient auditing to determine it, itself a big problem.

</comment><comment><USER13> They'd be wasting their money in Michigan. The director of the Michigan Bureau of Elections said nothing is connected to the Internet. That's because Michigan is entirely a paper and optical scan state.

[http://www.freep.com/story/news/politics/2016/11/23/michigan...](http://www.freep.com/story/news/politics/2016/11/23/michigan- elections-director-casts-doubt-hacking-claim/94327842/)

</comment><comment><USER14> What is this data referenced in the article?

FTA: With your help, are raising money to demand recounts in Wisconsin, Michigan, and Pennsylvania-- three states where _the data suggests significant discrepancies in vote totals, " the page reads._

<comment><USER15> > The scientists, among them J. Alex Halderman, the director of the University > of Michigan Center for Computer Security and Society, told the Clinton > campaign they believe there is a questionable trend of Clinton performing > worse in counties that relied on electronic voting machines compared to > paper ballots and optical scanners

Source: Computer scientists urge Clinton campaign to challenge election results

[http://www.cnn.com/2016/11/22/politics/hillary-clinton- chall...](http://www.cnn.com/2016/11/22/politics/hillary-clinton-challenge- results/)</comment></comment>


California Governor Approves $300M Gift to Telcos, Vetoes Streetlight Giveaway - <AUTHOR> https://www.tellusventure.com/blog/brown-approves-300-million-gift-to-telcos-but-vetoes-streetlight-giveaway/ <comment><AUTHOR> From the article:

"AB 1665 takes effect immediately. It lowers California minimum broadband service standard to 6 Mbps download/1 Mbps upload speeds and adds $300 million to the California Advanced Services Fund for broadband infrastructure, to be spent under rules will give it to AT&T and Frontier in exchange for token upgrades. That they would, in most cases, be making anyway."</comment>


Low Carb vs. Low Fat Diets - <AUTHOR> https://www.washingtonpost.com/lifestyle/wellness/low-carb-vs-low-fat-new-research-says-it-doesnt-really-matter/2017/07/13/270d2270-61c1-11e7-a4f7-af34fc1d9d39_story.html?utm_term=.d17a72b5933f <comment><USER2> My wife and I have been doing Keto since May 1st. I'm down 17lbs now (started at 221, right around 204-205 now, goal is 195). She started at 135 (she's 5'8" so not much for her to lose) and is down around 129 now.

Weight loss is great, but the energy gains from the diet are incredible. I never crash anymore. I have steady energy all day, and way less lethargy in general. Also, in general my stomach is not tempermental anymore. I used to get stomach aches after dinner, no more.

It does make eating out trickier, but oh well.

Now, I don't necessarily think it's _just_ keto that is responsible. I think it's these 3 things (in this order):

1) Way less beer drinking (and when I do, it's Miller Lite or something comparably light on carbs)

2) In general just paying attention to what we eat

3) The science of Keto itself

On the second point especially, it's kinda insane to pay attention to the carb counts in some meals. Especially fast foods/Mexican/Italian foods, you're looking at _hundreds_ of grams of carbs in a single meal...sorta nutty.

I recommend everyone try it if not just for the experiment/self control test. I'm not sure what I'm going to do when I hit my goal in terms of lightening up on things or not, but I'm happy so far.

<comment><USER3> Your energy gains are more from being more healthy and not weighing as much. Not so much the particular diet you're on.

Now that you are down 17lbs, go grab 17lbs worth of weights and strap them to your body somehow and walk around the house for a bit like that. It's pretty incredible how much 17lbs will feel like. Now think of how much harder your body had to work to carry that extra 17lbs everywhere. (This is assuming that the 17lbs lost was not comprised of muscle =p)

<comment><USER4> I've lost this much weight via traditional means before, and I will say that keto is very different. Your sleep improves, and overall focus is better.

The weight loss certainly helps. But for me, keto does something different.

<comment><USER5> This illustrates my problem with "the keto phenomena" (also including Atkins and its ilk).

My problem is because my parents have been on the Atkins diet for about 5 years now. They objectively have lost weight, they claim to feel much better, more energetic, etc. I don't have a way to argue that this could just be because they are healthier, fitter, and slimmer now. That the reason could just as easily be because they consume less calories and a no-longer-absurd amount of carbs. To them, it's all because of Atkins.

The _reason_ I have a problem with it is that I'm not convinced that long- term, severe carb restriction (and the consequential increase in fat in the diet) is healthy. Their cholesterol is rising, they are consuming alarming amounts of high-fat foods such as bacon and butter, and I don't think they ever actually learned how to "diet" because they still eat _a lot_ , but because it's low carb, they don't gain weight. They still drink and eat a lot of "sweet food," because they never tackled those cravings, just instead of sugar now they get aspertain or whatever it's called. Lots of coke zero, atkins bars, etc.

I can't find any evidence that long term atkins dieting is unhealthy, so I can't convincingly link the increase in cholesterol (or convince them that high cholesterol levels are unhealthy) or increase in kidney stones to their diet. To them if I ever am able to point out a negative change before and after their diet, it's simply due to old age (kidney stones for example).

<comment><USER6> The increased kidney stone problem is a real risk. You can help minimize it by taking citrate ion supplementation, which is available in prescription slow- release, or cheap OTC regular tablets. My doctor recommended it when I started keto years ago, and so far so good. I would do it anyway, as I've had a kidney stone again, and holy hell I do not want to experience that twice if at all possible!

Regarding cholesterol levels: make sure they get a full vertical profile, not just a calculated one. If their overall levels are higher, but it's from HDL, and the amount of LDL or VLDL is low, there is no associated increase in cardiac risk. FWIW.

</comment></comment></comment></comment></comment><comment><USER7> _In the end, "low-carb" meant about 30 percent carbs and 45 percent fat, while "low-fat" was about 29 percent fat and 48 percent carbs. Despite not being required to cut calories, participants were eating an average of 500 calories less, and what they were eating was high quality. The low-fat group was encouraged to choose whole grains, a variety of beans and lentils, seasonal organic fruit, organic low-fat milk and lean meats. The low-carb group was pointed toward high-quality oils and fats, organic avocados, hard cheeses, nut butters, grass-fed meat and pasture-raised eggs. "Everyone was supposed to have vegetables all day long as much as they could, have a salad every day, and no added sugar and as little refined flour as you could get," Gardner said._

They designed two diets that were very similar to each other, and unsurprisingly got similar results.

<comment><USER8> > Despite not being required to cut calories, participants were eating an > average of 500 calories less, and what they were eating was high quality.

This could also be simply attributed to being watched. That to me is a huge confounding factor that needs to be carefully isolated in all diet studies.

The huge success of personal fitness trackers suggests people tend to have healthier lifestyles when they measure their actions, even if it's for their own personal record (let alone for sharing on social media or being studied).

<comment><USER9> This is why cross study design is better. In both cases the vigilance is applied nullifying it as a factor.

The trouble is that diets take very long to apply so a cross design study would take many years.

</comment></comment></comment><comment><USER10> Firmly in the low carb camp.

There is another aspect to it though: With a low-fat mentality you can eat anything you like since everything is "low-fat" these days. Low carb on the other hand requires conscious strategic thinking & planning - the average processed product isn't geared towards it. I wonder whether some of the health benefit comes from that: The second I'm tracking & analysing things I automatically eat healthier and better as a result regardless of what exactly I'm tracking.

<comment><USER11> I agree. And its hard, really hard to follow a low carb diet. Practically all diet products are rich in carbs. Many products for the breakfast are rich in carbs. Practically all products in small stores (such as newsstand) are rich in carbs.

<comment><USER12> > And its hard, really hard to follow a low carb diet.

Really? I do very low-carb precisely because it's so very easy. I have heaps of vegetables and lean-meat and that fills me up and gives me all the energy I need. I almost can't see where I'd fit carbs in now. (I do eat more carbs when I'm doing something particularly arduous though).

> Many products for the breakfast are rich in carbs.

Well you can eat whatever you want for breakfast. You don't need 'breakfast food' in particular. I often have steamed fish for breakfast.

> Practically all products in small stores (such as newsstand)

Well yes, things are going to wrong if you are planning a diet around shopping at a newsstand. I'd say obviously you shouldn't do that no matter what your diet, but I suppose people have different lives to fit diets around - I work from home so it's probably easier for me.

<comment><USER5> >lean-meats

Well, it's not easy to do it "cheap," in most people's mind of what "cheap" food is - the little muffins at star bucks, or mcdonalds, the free cereal at work (when there are no high-protein, low-carb options).

So it's not "easy" because you're no longer even capable of eating what 80% of the people you know are. If you had even half of one of the muffins at work, you'd be thrown out of ketosis and you'd need half the week getting your diet back on track.

That being said, if you already have a strong habit of cooking and eating the majority of your meals instead of eating out or eating the free food at work, a low carb diet is a remarkably "easy" way to lose weight, because it doesn't come with that shitty feeling of grumpy hunger that (I at least) one gets from low-calorie dieting.

<comment><USER9> It is also easy to prepare ahead of time, as fatty foods do not spoil as easily when done due to lack of water. Easier than dried fat free foods though.

</comment></comment></comment></comment></comment><comment><USER13> "In the end, "low-carb" meant about 30 percent carbs and 45 percent fat, while "low-fat" was about 29 percent fat and 48 percent carbs."

Does anyone who advocates a low carb diet consider 30% of calories from carbohydrates "low carb?"

In a 1600 calorie diet (likely calorie restricted), that would be 120g of carbs.

<comment><USER14> Low carb generally would be <50 grams/day.

Though most enthousiasts on keto aim for <20 grams/day.

So you're right, 120g is still very high. And can basically be accomplished with just not stuffing yourself with bread, pizza or fries.

<comment><USER3> Yeah, I read the 30% amount and the study now makes sense as to why the participants had the same results. I wish they had the low carb group do < 20g carbs/day. I think they would have seen a difference.

I've done the keto target at less than 5g, 10g, 15g, 20g (depending what stage you're at) carbs a day. Even increasing that number to 100g carbs a day kind of ruins that diet.

The under 10g carbs a day has worked very well for me. Just remember, stay hydrated! =p

<comment><USER9> The problem with grams is that everyone has different needs. So It only works as a guide. It is easier to calibrate a keto diet with a real ketone sensor. (Available at any pharmacy, used by diabetics.) Specifically increase carbs until ketosis stops then drop say 20% for margin. There's your value. Check every now and then.

</comment></comment></comment></comment><comment><USER15> > Despite not being required to cut calories, participants were eating an > average of 500 calories less, and what they were eating was high quality.

That's what happened to me. I tried to lower carbs to 40% of calories, not to lose weight but rather to see what affect it would have on blood sugar levels. My A1c had crept up to 8.1, and that was while on two different diabetes medicines.

I made no attempt to limit calories...just to make sure that 40% or less came from carbs. In fact, to reach that I started _increasing_ the size of some meals. For example, if I got a sandwich which would normally be 50% carbs, I would order that sandwich with double meat and/or with full mayonnaise instead of light mayo or no mayo, because meat and mayo are calories without carbs, and so lower the carb ratio.

I found that this made the food more satisfying, and I ended up eating less kind of automatically. Over the next 18 months I lost 140 pounds that way. A1c is down to 5.0 now, and that is after three months with no diabetes medicine.

Long term, I'm eating about 30-35% carbs, and about 45% fat.

</comment><comment><USER16> This is an interesting discussion about a topic we know doesn't work. Every piece of reliable data shows that diets don't work. 95% of people who diet gain that weight back and more within 1-5 years. Nutrition philosophies based on deprivation are doomed to fail. A better question might be is what healthy lifestyle components lead to a healthier experience?

<comment><USER17> Most "dieters" follow it on a whim. For those that really get into keto and _educates themselves_ on nutrition, read forums, etc I would bet money are _far_ more successful than 5% in keeping it off. It's far easier to be disciplined following a low carb diet because you simply can't cheat with sweets, cheating = you're not on keto any more, makes it psychologically easier (for me anyways).

And, once you adopt it as a lifestyle, you really watch what you eat even after the intensive diet - I eat whatever I want, I just don't find myself wanting sugary foods because I know what they do to you, and I have zero problem staying at my desired weight.

<comment><USER18> You've literally described anyone who chooses to truly adhere to _any_ diet over the long term.

The point is, those people are, in practice, a tiny fraction of dieters.

<comment><USER19> Yes, but a diet is not a magic incantation that you can get the effects of by merely repeating the word or discussing it endlessly with friends.

Diets work (or not) based on fairly straightforward causal chains. People who want to continue to do exactly or very nearly the same of whatever they were doing and see a drastic change are bound to be disappointed not only in the mission of reducing weight but also in life.

</comment></comment></comment></comment><comment><USER20> > Gardner asked the 609 participants to aim for 20 percent carbs or fat

20% carbs is not a "low-carb" diet.

I've been doing keto since January and have lost over 50 pounds. I never get more than 20g of net carbs per day, which is less than 5% of my overall caloric intake.

</comment><comment><USER11> Using a low carb diet, i lowered from 90kg (198lbs) to 68kg (149lbs) in 6 months. And im still in 67-69kgs.

ps: i do zero exercise, just because i can't.

</comment><comment><USER21> I think the real interesting diet at the moment is Whole Food Plant-Based (WFPB). It is a low-fat, high-carb, fully plant based diet, that does not prescribe going "raw only".

Many have great results on this diet without counting any macros.

<comment><USER22> Does this basically mean no processed foods?

<comment><USER21> Kinda. And then the plant-based section of it. It is in line with what mankind supposedly _really_ mostly ate for 100000s years.

The docu "What the Health" also discusses this diet and some other stuff.

</comment></comment></comment><comment><USER23> The diet that truly works is high protein. Carbs and Fats cannot convert to muscle like proteins can and as a result they can not raise your resting metabolic rate like proteins can. Furthermore proteins have a filling effect that satiates hunger and they are not easily stored as fat. If you focus on filling your daily allotment of proteins first, you will often find you are too full to fill the remaining Fats/Carbs requirement. This advice from a personal trainer helped me lose 60 lbs over a year.

<comment><USER9> Come on, getting those 60g of protein or so is trivial on any diet. (Including complete protein, unless you're vegan and have major legume intolerance.)

High protein diets do work indeed, but most of them end up ketogenic by accident as well. Mostly because sugary or starchy foods have little protein.

</comment></comment><comment><AUTHOR> Seems there was little difference between low fat and low carbs. However, both groups were urged to eat a healthy diet: "Everyone was supposed to have vegetables all day long as much as they could, have a salad every day, and no added sugar and as little refined flour as you could get,"

Also, at the end it talks about the idea of satiation. Eat as much as you want to feel full, as long as it is healthy. That has been my philosophy, and it has worked very well.

<comment><USER24> I've 'recently' (May 2017) started simply counting the calories i consume and not avoiding one thing or another, keeping it below my TDEE. Some days are very high in Fat, others carbs, sometimes protein.

I've lost 32lbs/14.5kg since then (and another 30 to go).

I guess i will see in the long term if it is healthy, but i do feel great now.

<comment><USER25> After a few (many?) failed attempts at keto and other diets (I would always stall out after around 15lbs of weight loss), simply counting calories is by far the only thing that has worked for me well. Currently, I target 1,400 kcal a day (8-16 intermittent fasting with 2 meals of 700 calories each) with a calculated TDEE of around 2,500 kcal. I've lost around 60lbs/27.2kg since January 2017 (240lbs/108.9kg to a bit less than 180lbs/81.6kg). I eat whatever I feel like (usually meat, veggies, and a starch in each meal) and just limit calories.

I don't use anything like MyFitnessPal to track calories counted. Keeping things to "eat only 700 calories per meal" is simple enough where you can do a quick Google search before eating to make sure you're on track.

Something interesting is that my error with calorie counting (and possibly metabolism) is about 10-15%, given that the hacker diet calculations (trendweight.com hooked up to my withings scale) calculates my TDEE (based on my actual weight changes) at 2,200 kcal instead of the calculated 2,500 kcal.

Also, I just bought a medium t-shirt last weekend for the first time since I was in high school! :)

<comment><USER26> IMO it helps to treat calorie-counting as something that is fundamentally inaccurate, but still "good enough" as long as the errors are consistent.

Meanwhile, the moving-average of your weight is closer to some kind of ground truth, and can be used to recalibrate the calorie budget.

</comment></comment></comment></comment><comment><USER27> I'd like to see the actual distributions of foods (and micro/macros) in these studies along with the human stats (ages, activity levels). I suspect that the factors are for more multi-modal than the buckets of "low carb" and "high fat". Open source data here would allow for alternative views on the data, and likely better learning overall.

</comment><comment> GuB-42 Low carb, low fat, low anything are essentially just low calorie diets, which result in weight loss through basic thermodynamic principles.

The more I follow trends in diets, the more it seems to boil down to : don't eat too much or too little and have a varied diet.

The first point is obvious, the second one is more subtle. There is actually no need for a varied diet. It is just that it is the easiest way for us to make sure we get all the nutrients we need while limiting toxicity. By toxicity, I mean that everything we eat is a bit poisonous, but fortunately, our body is well equipped to deal with it. But eat too much of one poison and it won't keep up. So it is possible to have an unbalanced diet and still be healthy (ex: vegans) but it may take some bookkeeping.

Note that research seem to point that the more we eat something, the less we get pleasure from it, as if we are wired to prefer a varied diet.

Remember, we are omnivores, and the whole point of being omnivores is that anything goes.

<comment><USER23> Treating all calories the same ignores the fact that the body does different things with Carbs, Fats, and Proteins. Proteins help build muscle which raises a person's resting metabolic rate. A diet that is deficient in proteins will result in muscle loss and will lower metabolic rate. The scale only tells half the story. 200 lbs of lean muscle burns much more calories than 200 lbs of fat. What you eat directly contributes to this composition and therefore impacts your ability to burn calories.

</comment></comment><comment><USER28> I still haven't found a simple, straightforward, proven explanation of how to do a "ketonic" diet. Any help?

<comment><USER29> Eat no sugars, no grains, and lots of fat. Also as far as veggies go, avoid potatoes and corn. Avoiding alcohol is best, but if you must drink, go for no- carb options like hard liquor. That's about the shortest version of it I can come up with :)

</comment></comment><comment><USER30> an aside, for those on either diet: lacto-fermented foods like Kombucha, sauerkraut etc. seem to do me a lot of good.

Perhaps it is just the B-vitamins in the Kombucha but I find that being on keto and having Kombucha once a day is a good combination.</comment>


The Unbearable Lightness of Java - <AUTHOR> https://jodd.org/ <comment><USER2> Interesting business model: collect useful utilities, document them, and also offer consulting services.

I spent some time looking over a couple Jodd libraries and frameworks, and I felt some nostalgia for my past use of Java. I also always used Java 'lightly', avoiding J2EE unless the work really paid well. Now professionally my work is in Python (I have been close to 100% deep learning for about four years), and I use Haskell and Common Lisp for my personal projects - but I still think fondly of Java.

</comment><comment><USER3> When you parse JSON, what is the reason to choose special classes for structure (and sometimes data units) instead of using Java-native equivalents?

<comment><USER4> Do you mean deserialising to, say, a java.util.Map instead of a Book?

<comment><USER3> Yes. When I'm done with JSON-specific operations, I'd like to use traditional libraries to do non-JSON-specific things, and I would like to avoid having explicit conversion to Maps and Lists.

<comment><USER4> Most Java JSON libraries can, but then you usually end up having to deserialise to a Map<String, Object> and then have to do casts when using the values, so people tend to use deserialising to POJOs to remove the manual casting - even if all it does is shift the runtime type checking from the code consuming the map to the code deserialising it.

Also, using POJOs can lead to more readable type signatures - it's easier to determine what the method getBooks of the Author POJO that returns List<Book> is about than a Map<String, Object> that has a List<Map<String, Object>> mapped to the key "books".

Bit of an impedance mismatch between a serialisation format from a dynamically typed language and a statically typed language.</comment></comment></comment></comment>


TokuMX 1.0.3: Seamless Migrations from MongoDB - <AUTHOR> http://www.tokutek.com/2013/07/tokumx-1-0-3-seamless-migrations-from-mongodb/

<comment><USER2> Neat! Good Luck! What versions can this replicate from?

<comment><USER3> MongoDB 2.2 and 2.4</comment></comment>


Latin Lives (2015) - <AUTHOR> http://www.thenation.com/article/latin-lives/ <comment><USER2> This has many previous submissions; the one that got the most discussion was

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

Re-reading it now makes me tempted to go do Paideia!

I can also recommend highly recommend SALVI, which is a U.S.-based spoken Latin organization.

[http://latin.org/wordpress/](http://latin.org/wordpress/)</comment>


Truecaller puts a face to inbound unknown phone numbers - <AUTHOR> http://www.bbc.com/news/business-36015547 <comment><USER2> It's a European company so they must be aware of the dreaded 'Data Protection' rules here. Users opting in to the service should be okay, but scanning and uploading their entire address books (the pre-selected default) with everyone else's contact info looks questionable. It's been done though, I know the Android Twitter app does this (it asks permission after installing and it's easy to opt-out) so there's probably a way of doing this without getting sued.

If you visit their site and try to search your number to opt-out, you get a modal asking you to sign in with a Google or Microsoft account - no other options are provided. In miniscule font, an even smaller tooltip says _" Sharing is caring, and in the Truecaller community we care about accurate results. By sharing your contacts with Truecaller, you will receive more accurate results and help improve the experience for millions of users around the world."_

It's a tried and tested business model but I'm just not interested in doing data entry for someone else's silo for a marginal benefit to myself. Maybe I'm old-school but I'm fine with figuring out who is calling from an unknown number by simply answering and speaking with the caller.

<comment><USER3> > It's a European company so they must be aware of the dreaded 'Data > Protection' rules here.

One man's poison is another man's tea. As a US citizen without any EU data protections, I envy the EU data protection rules. I don't care if that ruin's your startup's model.

<comment><USER4> Everyone has their phone number and home address publicially visible. You can't opt out. Is it the same in the US?

<comment><USER5> >Everyone has their phone number and home address publicially visible

Fist time I hear it. Where?

<comment><USER6> Take a look at hitta.se or eniro.se

Basically, an online phonebook, with reverse lookup, addresses, birthdays, neighborhood data, ...

</comment></comment></comment></comment></comment><comment><USER7> I think the URL everyone is looking for is [http://www.truecaller.com/unlist](http://www.truecaller.com/unlist). Impossible to check if it works though without creating an account and handing over all your details.

They really should provide a "Is my number listed?" search (and maybe a "Who do I blame if it is?"). Also, they should probably add some verification you own the number I guess, since I was able to delist my wife's without question.

<comment><USER8> About a couple of months back it was possible to search for your own number on their site without an account, but now it's fully blocked and require you to install their app (and thus give all your info by default if you're on Android).

EDIT: It seems that they added Google and Outlook account login now, but they also require all your contacts.

</comment></comment><comment><USER9> I was curious if my number was in their system, so I went to their web site. To do a simple lookup you have to log in with a Google or Microsoft account, and you have to give it permission to view your Google+ circles as well as _full access to your contact database_. No, sorry, I am not giving you private contact info for everybody I know.

<comment><USER10> Well if you weren't in their database before you sure are after you allow full access

<comment><USER9> As are potentially all of my friends, family members, and colleagues.

I found this particularly absurd paragraph in their privacy policy[1]:

> Where the Truecaller Apps are obtained from other sources than Apple App > Store or Google Play, You may share the names, numbers and email addresses > contained in Your device's address book ("Contact Information") with > Truecaller for the purpose described below under Enhanced Search. If you > provide us with personal information about someone else, you confirm that > they are aware that You have provided their data and that they consent to > our processing of their data according to our Privacy Policy.

So by using the app you not only provide your entire contact database, but you're saying all your contacts are aware of it and they've agreed to the policy. I guess before you install it you have to call up everyone you know and ask if it's okay. It applies to new contacts too - getting a girl's phone number might be a bit awkward now that you have to ask if she accepts the privacy policy for a smartphone app you use.

Of course, it only applies if you don't get the app from the App Store/Google Play - because both of those ban this behavior. However if the app comes pre- installed with your phone, this policy could easily be baked into the terms you agree to during setup.

[1]: [http://www.truecaller.com/privacy- policy](http://www.truecaller.com/privacy-policy)

Edit: I actually didn't find anything in their privacy policy specifically referring to the web-based search on truecaller.com. Since their policy only mentions not harvesting your contact info if you use the App Store or Google Play, I have to assume the worst - especially since I can't think of any other reason why the web search would need full contact access.

</comment></comment></comment><comment><USER11> This could have been such a killer app for Google Voice, you make hit *22 or something after a call to indicate its a spammer/sales/robocall and totally improve the experience for everyone else who doesn't have to listen even to the ring.

</comment><comment><USER12> Doesn't solve the _real_ caller identification problem I have: is this going to be a marketing call / PPI fraud / robodialler / attempt to social engineer me by telling me my PC has a virus.

<comment><USER13> All I want is to know which business is calling. Isn't all that information public?

Google top results are littered with supposed answers to this question but are all just SEO tricks without any good info.

I've tried Truecaller several times and it didn't really do what I want (on iPhone).

<comment><USER14> Google has tons of verified public phone numbers for its map products. Android should be able to do reverse lookups of unknown callers.

This might not work for unlisted telemarketers. To catch those numbers, perhaps Google could anonymously collect Android users' phone blocklists. That does not have quite the same privacy concerns as sharing your entire contacts list with Google. This is the phone number version of Gmail's spam filter.

</comment></comment></comment><comment><USER15> "If you receive a call from a number and we can't detect it, then you, as a user, can actually add that information."

I hope that doesn't mean it has unrestricted access to my contact list.

<comment><USER16> The app actually came into existence through harvesting data via the contacts permission. Pretty sure this is still how it works, or maybe they changed their strategy once they got big enough.

</comment></comment><comment><USER5> That's pretty much why I change my phone number once a year. I don't want people to put it online in google, facebook, truecaller services. I never receive spam texts or calls.

<comment><USER17> Yeah, but isn't it super annoying to people who want to contact you (family, friends, etc.)? I haven't changed my cell number in over a decade, and rarely (if ever) get spam calls (never texts). Seems like a high price to pay for something that probably won't happen much, anyway.

<comment><USER5> >Yeah, but isn't it super annoying to people who want to contact you (family, friends, etc.)?

I have different approach to instant communication. Yes, some people complain, as I live overseas, mostly my parents. Others used to it. I don't want to be contacted by anyone who has my phone number any time THEY WANT TO CONTACT ME, so I see no need for them to have my phone all the times. I keep my number updated for some people, I didn't talk with friends from high school for last 2 years, but I send them text from my new number when I change it, some people deserve it, some don't. 3/4 of the day my phone is in offline mode, because I use it only to listen to music and as alarm clock. I never need to topup for more than £10 per 3months. Give it a try :)

</comment></comment></comment><comment><USER18> My number is on some Indian pharmacy's list and seems to have been sold to a bunch of others. I get at least two calls a day. Formerly on my Android, Mr. Number successfully blocked the great majority of these calls. Since switching to an iPhone I installed both Mr. Number and Truecaller, but apparently iOS doesn't permit these apps intercept the call and simply hang up. Really sucks. For just this reason I'll probably go back to Android for my next phone.

<comment><USER19> Yeah, I'm another big vote for Mr Number.

For some reason I would get multiple calls a week (sometimes multiple per day) from "Walgreens" telling me my prescription is ready - not sure if it's a scam for personal/medical/insurance info or if someone somewhere mistakenly entered my number. Leaning towards scam - called Walgreens and asked they delist me, they said they didn't know anything about it. And at first it was a listed number, then after I blocked that it started being unlisted, then I finally just blocked all unlisted callers. It only started after I opened a Bank of America card, and they're rather notorious for selling their customer info, so I have my suspicions there.

For some reason Android 4.4 doesn't have the capability to block unlisted numbers, so Mr Number is fantastic for adding this back in.

</comment></comment><comment><USER20> Just like with IP proxies - it's easy to originate call from Google talk, or other free calling service to remain totally unidentified.

Best way to filter calls during the meeting - don't pickup the phone and let caller to leave voicemail. At a first hint of a spammer - just block the number.

Done.

</comment><comment><USER21> Useful app, but the latest android version of truecaller(7.x) REQUIRES access to your contacts. I uninstalled it and found the previous version(6.6) which only nags you for contacts access.

Bad move truecaller and very rude.

<comment><USER22> Not "Bad move". Try "Basics of the operation". How do you think they are able to collect all these phone numbers ?

</comment></comment><comment><USER23> I was using this to log calls in violation of the do not call list for some time. I meant to sue in small claims, but never got around to it.

Still, it's immensely valuable.

<comment><USER24> Does it somehow resolve spoofed caller id data?

</comment></comment><comment><USER25> Truecaller appears to be built into my Cyanogenmod OS. I certainly appreciate it since ~90% of my phone calls that are not immediate family seem to be spam.

</comment><comment><USER26> my solution to this problem is easy.

just don't pick up the phone.

what is compelling you to pick up an unknown call? do you think you're going to win the lottery or something?

<comment><USER27> The challenge is when you're expecting a call but don't know the number it'll originate from (doctor's office, school, sports team parents/member/organizer, plumber, ...).

<comment><USER28> What's so bad about prefacing the meeting with "Sorry guys I'm expecting a call at some point today so if my phone goes off I'll need to leave to answer it"? Some people must surely be expecting calls from someone of an unknown number every day individually, but I would be surprised if it was a large number of people.</comment></comment></comment>


Apple announces the new iPad - <AUTHOR> http://www.apple.com/ipad/ <comment><USER2> Despite the short term confusion of the name change (Not "iPad 3" just "iPad") it does make sense. Afterall you have iPod Touch, Macbook, Mac Mini, etc. Better than eventually having iPad 7, etc.

Wouldn't be surprised to see the iPhone 5 just be called the iPhone.

</comment><comment><USER3> Apple: We support plenty of Languages like American English, British English, Australian English, ..

Seriously only Apple can get away (even get applause) making such kind of statements.

<comment><USER4> In the context of speech recognition at least, those are indeed very different languages.</comment></comment>


Are You a Target for Nation-State Propaganda? - <AUTHOR> https://www.recordedfuture.com/nation-state-cyber-activity/ <comment><USER2> If you live in a nation-state, you are definitely a target of that nation- state's propoganda. Possibly others as well but certainly the one you reside in.

</comment><comment><USER3> If you watch TV or read the big news, yes, of course.

</comment><comment><USER4> All who visit the New York Times are.</comment>


Wall Street, the Home of the Vanishing I.P.O. - <AUTHOR> http://www.nytimes.com/2010/11/18/business/18place.html

<comment><AUTHOR> Long story short, the number of IPO's on US equity markets has shrunk dramatically. It fell not by 30% or even 50%, but by over 95% from 1996 to 2008. In 1996 there were 756 IPOs and at the low in 2008 there were only 36. It's picking up a bit again, with 100 IPO's in the US this year.

I think one of the more interesting bits from the article is "This year alone, Chinese companies introduced 391 global I.P.O.'s, worth $89.5 billion, the data firm Dealogic reported. The 99 I.P.O.'s by American companies listing in the United States were worth $15.69 billion."</comment>


First Evidence of Sleep in Flight - <AUTHOR> http://maxplanck.nautil.us/article/326/first-evidence-of-sleep-in-flight <comment><USER2> While this may be the "first evidence" in the sense of measurements of brain activity, swifts apparently sleeping at 10,000 feet were directly observed 100 years ago: [https://www.rspb.org.uk/globalassets/downloads/documents/con...](https://www.rspb.org.uk/globalassets/downloads/documents/conservation --sustainability/help-swifts/amazing-swift-facts.pdf)

</comment><comment><USER3> Technically we've known for decades that humans can sleep while flying airplanes :+/

</comment><comment><USER4> _When the birds circled on rising air currents the hemisphere connected to the eye facing the direction of the turn was typically awake while the other was asleep, suggesting that the birds were watching where they were going. "The frigatebirds may be keeping an eye out for other birds to prevent collisions much like ducks keep an eye out for predators," says Rattenborg._

Earlier it said these brief periods of sleep would start as the sun went down; does it mean that they would only catch some sleep at dusk/twilight, or this would continue throughout the night? And if it's at night, do the birds have good enough night vision to see anything flying nearby or swimming on the surface below (such as their prey, squid and flying fish)?

</comment><comment><USER5> Imagine what we could achieve if humans needed only 42 minutes of sleep per day…

<comment><USER6> I think it would give a constant time advantage. If humanity operates on O(f(t)) in that case we would operate on O(C f(t)). That is, as opposed, improvements that change the model itself (i.e. f) such as increased productivity, automation, cultural shifts etc...

<comment><USER5> I thought about this argument some more. Instead of spending ten times longer awake, you could say the same for living ten times longer. It's also just a linear increase your reasoning would apply.

But I feel that if all geniuses of history had lived 800 years they could have achieve more and we would be further along.

It changes the model because along the way we make meta discoveries about learning and methodology and science itself, and even just discoveries that we build upon. That feeds back into our progress.

</comment></comment></comment><comment><USER7> In business class, maybe.

</comment><comment><USER8> Could anyone ever been able to subscribe to their print edition on shop.nautil.us? I like the look and feel of their magazines and would like to support them. But, the subscription webpage has been broken forever. I twitted their support staff a month ago and hasn't heard anything yet. What a shame.

<comment><USER9> I subscribed in early 2018 and have only received two issues since. Sometime in the summer I received an email that they were having issues raising the funds necessary to publish the upcoming print edition.

<comment><USER8> Apparently a tough chicken and egg problem for them: not having enough money to print so they stop accepting new subscriptions and hence will not getting any more funding. I really want to pay for their print magazines.

</comment></comment></comment><comment><USER10> There are several other articles about this dating from 2016 [0][1]. Still, the articles back in 2016 also come as a big surprise for me, since I remember having a kids encyclopaedia back in 1994 [2] that had a small snippet mentioning a certain migratory bird that travelled an insane distance and used warm currents that generated lift to basically take a nap mid-flight. So unless this is ruled out and not considered "flying", I really don't understand how many "first times" there have been.

[0] [https://www.sciencealert.com/scientists-have-just-seen- birds...](https://www.sciencealert.com/scientists-have-just-seen-birds-sleep- while-flying-for-the-first-time-ever)

[1] [https://gizmodo.com/we-finally-know-how-birds-sleep- during-f...](https://gizmodo.com/we-finally-know-how-birds-sleep-during- flight-without-d-1784760623)

[2] Sorry, I can't provide a source at the moment, will try to find it later.

Edit: to be fair, this article is citing the ones in 2016. I found other articles from as early as 2014 [3] but maybe this is just about how for the first time the theory is actually based upon measured, empirical data. Like an article that was recently in HN about semi-automatic weapons being more deadly than non-automatic ones.

[3] [http://sabersabor.es/una-vida-de-record-los-10-hechos- porten...](http://sabersabor.es/una-vida-de-record-los-10-hechos-portentosos- del-vencejo/)

<comment><USER11> > This article was originally published by Max Planck Neuroscience on Aug. 3, > 2016. The relevant study can be retrieved here.</comment></comment>


Israel develops cancer vaccine - <AUTHOR> http://unitedwithisrael.org/israel-develops-cancer-vaccine/

<comment><USER2> I came here to point out that the title must surely be misleading since cancer is not one but many different diseases and therefore any vaccine would only be targeting certain cancer types, however the article states that 'VaxHit' could be applied to 90 percent of all known cancers, which is huge! I sincerely hope there is some substance to this.

</comment><comment><USER3> There are no links to any reputable journals or anything here. How can we tell if this is legit?</comment>


The Whole System Failed - <AUTHOR> http://www.nytimes.com/2013/07/16/opinion/the-whole-system-failed.html

<comment><AUTHOR> This is a sad and heartbreaking article, about one of the most shameful trials of this country.

Regardless if judge's decision was due to racial bias or not, it doesn't change the facts: a teenage boy is dead, while his killer is out there, walking around freely, with a concealed gun, _legally_ allowed to kill people under the claim of self-defense whenever he feels threatened.

This is _really_ a f'ed system.

</comment><comment><USER2> This has nothing to do with programming, business, etc, etc. Check reddit if you want to post opinionated pieces like this.</comment>


25 Arduino video tutorials for beginners - <AUTHOR> https://arduino-tutorials.net <comment><AUTHOR> Last year I decided to share my Arduino knowledge with brief video tutorials on YouTube. These tutorials include downloadable course material, part list and circuit schematics.

All these videos were in Dutch. A couple of months ago I figured that it would be useful to re-record them all in English (yeah, that is quite some work )

Now that I've done 25 tutorials I thought it was time to share [https://arduino-tutorials.net](https://arduino-tutorials.net) with the world</comment>


Here's What Google, Salesforce & Sequoia Are Investing In - <AUTHOR> http://mashable.com/2011/03/08/hubspot-funding/

<comment><AUTHOR> And, coverage on VentureBeat: [http://venturebeat.com/2011/03/08/hubspot- funding-series-d-3...](http://venturebeat.com/2011/03/08/hubspot-funding- series-d-32-million/)

Also on RWW: [http://www.readwriteweb.com/hack/2011/03/salesforce-for- mark...](http://www.readwriteweb.com/hack/2011/03/salesforce-for-marketing- start.php)

And, Bostoninnovation: [http://bostinnovation.com/2011/03/08/hubspot-locks- up-32-mil...](http://bostinnovation.com/2011/03/08/hubspot-locks- up-32-million-from-sequioa-google-ventures-salesforce-com-exclusive-video- interview-with-ceo-brian-halligan/)

Even, SEOmoz: <http://www.seomoz.org/blog/inbound-marketing-is-taking-off>

Lastly, TechCrunch: [http://techcrunch.com/2011/03/08/hubspot- takes-32-million-in...](http://techcrunch.com/2011/03/08/hubspot- takes-32-million-investment-from-sequoia-google-ventures-and-salesforce/)

</comment><comment><USER2> Lead gen is one of the biggest challenges for B2B marketers. Salesforce + Google are trying to rally more of small-mid sized B2B organizations to their platforms. I think that the greatest upside will go to the partner that makes the most effort to integrate Hubspot with the other apps on their platform.

Don't just let it float around like another app in your marketplace, guys. Help Hubspot customers connect the dots between inbound leads and the other pieces of customer / market intelligence that are lying around on their accounts... on your platforms.

</comment><comment><USER3> I saw hubspot yrs ago. They're definitely going to be homerun company (imo).

But I also think there is plenty of room for improvement in that space.</comment>


Bet on People, not on ideas - <AUTHOR> http://davo.li/bet-on-people-not-on-ideas/

<comment><USER2> Right, like if we had no television and some guy named Dave invented it, we'd be like, "Screw you, Dave... you're not the right person to invent this."</comment>


Catching use-after-move C++ bugs with Clang's consumed annotations - <AUTHOR> https://awesomekling.github.io/Catching-use-after-move-bugs-with-Clang-consumed-annotations/ <comment><USER3> Perhaps the future of software isn't "rewrite everything in Rust", but instead we end up annotating existing C/C++ with borrow checking information. This would be similar to how there is a push in JavaScript to add TypeScript annotations everywhere. It gives you the flexibility of the existing language and ecosystem while still allowing you to use new techniques in programming languages.

<comment><USER4> My problem with C++ isn't the lack of borrow checker - this is the feature I like the least in Rust (I know it's their core design goal but frankly the inconvenience and limitations it imposes don't seem worth it for my use case, and then theres the compile times).

C++ lack of modules and package management on the other hand is a huge PITA and I'm not optimistic either of those bolted on so late in to the language lifecycle will provide a useful solution.

It's a pity D took it too far in the other direction with GC and runtime - <USER2> really could use a C with classes and modules.

<comment><USER5> I think conan has real potential when it comes to package management

Some example of what can be done with it [https://gitlab.com/xadix/xonan](https://gitlab.com/xadix/xonan)

It is kind of like gentoo portage or nix pkg and can be used to manage your tool chain also

<comment><USER6> I don't get conan. Portage can already create a linux root in your homedir (see the prefix project) and has a huge package repo. What am I missing?

<comment><USER7> Portage doesn't work across Windows, QNX, IBM i, IBM z, Android, iOS, macOS, mbed, RTOS, ClearPath, Aix, HP-UX, INTEGRITY, FreeBSD, NetBSD, OpenBSD, PS4, Switch, XBox, Tizen,...

</comment></comment></comment></comment></comment><comment><USER8> With C++ even if your project follows this, there is no way to _enforce_ this across your project's dependencies & wider eco-system.

With Rust, its entire ecosystem (however nascent) is subjected to the same strict rules. This is _big_ plus when Rust eco-system matures functionality wise.

<comment><AUTHOR> My project doesn't have this issue ;) [https://github.com/SerenityOS/serenity](https://github.com/SerenityOS/serenity)

<comment><USER9> Wait, we enforce borrow checking rules on SOS?

<comment><AUTHOR> At the moment it only shows up as an on-screen warning in my Qt Creator thanks to its clang integration. The default Serenity toolchain is using GCC-8.3.0 which doesn't support this trick at all, so we don't get any compile-time enforcement. :( I keep thinking about switching over to a clang toolchain to be able to do more stuff like this.

</comment></comment></comment></comment><comment><USER10> Why isn't a moved-from object _always_ considered "consumed"?

<comment><USER11> Because its still a legal and valid object according to the standard.

A moved from vector might get reused to store new things for example.

<comment><USER12> Are you sure? I thought a moved from object was left in an indeterminate state and further use was undefined behavior. Move constructors and move assignment operators that zero out the rhs members try to prevent duplicate references from an object likely to be destructed soon, which might lead to dangling pointers and then use after free in lhs. Can someone cite the spec and prove me wrong, please?

<comment><USER11> A move constructor is supposed to leave the donor object in a valid state. All STL objects with one will do so.

If you write a poor move constructor that doesn't do this you will get exactly what you asked for. However the compiler has no way to know you half assed it and must support a legal valid case.

See this stack overflow: [https://stackoverflow.com/questions/9168823/reusing- a-moved-...](https://stackoverflow.com/questions/9168823/reusing-a-moved- container)

To quote office space, "Your moved from object only needs to be destructible. But some people choose to allow more and we encourage that."

<comment><USER13> "if (x = y)" is also a legal valid use case (it sets x to y, and then tests whether it's nonzero), but that doesn't stop compilers from complaining if you write it, on the grounds that it's most likely a mistake. They should do the same with use-after-move. There could then be some workaround or annotation to disable the warning if you really did want a use-after-move, as there is for the warning I mentioned (adding extra parentheses).

</comment></comment></comment></comment></comment><comment><USER14> > Once you std::move an object and pass it to someone who takes an rvalue- > reference, your local object may very well end up in an invalid state.

As far as I remember, move constructors/assignments must leave the moved-from object in a valid state - just that the standard doesn't say anything about what that state is for standard classes.

Also, I have seen code where some kind of "result" can be moved from an object and then re-generated from scratch with different inputs. In that case it was perfectly valid to use it after move. But that's nitpicking, anyways.

<comment><USER15> I believe the standard says that move does "valid but unspecified" for standard library objects, but does not generally guarantee that moved from objects must be valid.

<comment><USER16> The destructor gets called on them. They need to be valid enough for that.

<comment><USER15> Hm, technically don't think this would be required. Take for instance:

      auto no_destroy = new MoveNoDestroy();

      MoveNoDestroy* moved_into;

      *moved_into = std::move(*no_destroy);

Wouldn't call the destructor of the moved from MoveNoDestroy.

<comment><USER17> Yes, if you leak resources, their destructors won't be called. That really has nothing at all to do with move semantics though. I think the important point is that move semantics don't alter the lifetime management of the moved-from object.

</comment></comment></comment></comment></comment><comment><USER18> Looks like a lightweight borrow checker, although I wonder how well it fares in places where lifetimes are difficult to track. Or is there a way to annotate methods with this information as well?

<comment><USER19> To me, it looked more like Rust's move semantics: in Rust, when an object is moved it's "consumed" and cannot be used anymore. The borrow checker is for when the object is not "consumed", only temporarily borrowed by some other code.

<comment><USER18> I'm using the term "borrow checker" to encompass Rust's whole memory model, but yes: this only seems to provide information about when something's been "moved" (or "dropped") rather than "borrowed" in the temporary sense.

</comment></comment></comment><comment><USER20> Very nice!

</comment><comment><USER7> Cool idea.

</comment><comment><USER21> I've been writing C++ for 21 years now (started when I was 14). To be honest, I have never seen a solid case where move semantics provided added value (in terms of code readability and maintainability) over just passing object references as function parameters.

That big ugly object that would get copied on function return -- just create it before the function call and pass it in as a reference! No copy required.

<comment><USER22> C++ has a few major flaws with respect to move and copy semantics. The biggest one is that copy semantics are default and silent: it requires less work to copy something than it does to use it by reference, and there is no visual indication if the value is being copied or accessed via reference. This means that it is way too easy to accidentally copy large objects (such as std::vector) without realizing you're copying them.

Most newer languages have realized that implicit copy semantics is usually a bad thing, and duplicating objects requires explicitly saying that you're duplicating them (such as calling a .clone() method). Of course, some types are value types, where copy is cheap and better than reference, but such mechanisms are opt-in. C++ automatically generates these mechanisms, and gives you nasty error messages when you opt-out of default copy.

Move semantics are almost always better, but in C++, with its historical baggage of opt-out-of-implicit-copy-semantics, it means that constructing move-only types requires a lot of excessive calls to std::move. Compilers do a good job of telling you when you put one too many calls to std::move in, but the code is definitely verbose compared to C++, to the point that it tends to strongly weigh against actually using C++'s ability to annotate move-only methods. Furthermore, without something like the mechanism in the blogpost here, compilers don't give any indication of API misuse, so you can't leverage move-only types to construct safe-by-construction APIs.

This is something I've been tripping over a lot recently, as I have a type system where calling most methods makes the original object unusable.

<comment><USER21> I appreciate your reply. But frankly, why would someone "accidentally" copy something by value?

I don't mean to sound arrogant but if someone is writing C++ at a level where he/she does accidental copies then that's a _very_ clear sign to me to stay the hell away from move semantics and other advanced features.

I personally find things being copied by default a nice feature. It's more consistent than "PODs by value, objects by reference" such as in Java.

<comment><USER23> There is no such thing as a bad programmer, only bad tooling. C++ is bad tooling.

<comment><USER24> A craftsman doesn't blame his tools.

<comment><USER23> A great craft recognizes how important good tools are.</comment></comment></comment></comment></comment></comment>


Top 18 Headless CMS Platforms Available – 2018 Review - <AUTHOR> https://www.linkedin.com/pulse/top-17-headless-cms-platforms-available-2018-review-varghese/ <comment><USER2> Hey, you should take a look at Gentics Mesh [https://getmesh.io/](https://getmesh.io/). It seems to be a lesser known headless cms but still very powerful and fully open source.</comment>


Apple Says Jony Ive to Leave, Form Independent Design Company - <AUTHOR> https://www.bloomberg.com/news/articles/2019-06-27/jony-ive-to-leave-apple-aapl-form-independent-design-company <comment><USER2> Bloomberg says Apple will be among his primary clients, so he's not gone entirely.

Still, this is a major change. His public-facing role has been quite diminished over the years, so this might not be the biggest shock, but it's still a major change.

Some will say that it's time for him to go. I don't think I agree with that, but I am interested in what a post-Ive Apple looks like.</comment>


Waymo car involved in Chandler crash - <AUTHOR> https://www.abc15.com/news/region-southeast-valley/chandler/waymo-car-involved-in-chandler-arizona-crash <comment><USER2> "According to police, a Honda sedan traveling eastbound on Chandler Boulevard had to swerve to avoid striking a vehicle traveling northbound on Los Feliz Drive. As the Honda swerved, it continued eastbound into the westbound lanes of Chandler Boulevard and hit the Waymo van."

Waymo car appears to not be at fault.

<comment><USER3> Would be interesting to know what the Waymo car did in this circumstance. I imagine it would've hit the brakes when the sedan came into its lane, but not sure whether it would've swerved or not in an attempt to avoid the accident.

<comment><USER4> Please don't call car crashes accidents - [https://daringfireball.net/linked/2018/03/19/crashes-not- acc...](https://daringfireball.net/linked/2018/03/19/crashes-not-accidents)

<comment><USER3> Good point. Will call them crashes in future.

</comment></comment></comment></comment><comment><USER5> Waymo posted a video from the van. Pretty much answers all questions about what happened.

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

</comment><comment><USER6> "Waymo car hit by a vehicle in Chandler".

But hey, you gotta spin that title as much as you can waiting for the third paragraph to reveal the self-driving car was not at fault.

<comment><USER7> If the car was really smart, it could've avoided the oncoming vehicle (or at least ensured the driver is not hurt).

<comment><USER5> From the video from the Wyamo vehicle it's pretty hard to argue that it could have done anything in this case.</comment></comment></comment>


Show HN: Doka.js – A vanilla JavaScript image editor - <AUTHOR> https://pqina.nl/doka/ <comment><AUTHOR> Hi! Developer here, I've build Doka over the past months as an extension to FilePond.js. When I was half way I decided it would be better as a standalone editor. It's super fast, can crop, resize, rotate, and flip images (also SVGs).</comment>


Bitcoin and Ordinary People: This Is Gonna Be Hard Work - <AUTHOR> https://www.reddit.com/r/Bitcoin/comments/71c73j/bitcoin_and_ordinary_people_this_is_gonna_be_hard/ <comment><USER2> It'll be harder when you keep projecting the shortcomings into the minds of your listeners. This is a problem with evangelists.

I'm not as old as this person's Dad nor a professional economist, but I get crypto just fine. I was arguing for Phil Zimmerman's right to distribute the source code to PGP back in the day, so understanding blockchain concepts wasn't especially difficult for me. But I'm not so convinced about the desirability of having an ever-expanding wallet file or the long-term viability of a currency that isn't formally backed with anything; scarcity alone does not confer economic value. Fiat currencies issued by governments are ultimately proxy ownership certificates for resources under said government's control. Speculative money can flow in to inflate the value of Bitcoin, but the problem is that it can just flow right out again too. If people decide they like some other means of exchange better in the future, doesn't the market for Bitcoin have only as much value as the total of futures contracts that specify payment in that currency at the spot price?

 _I was able to explain to him that it 's like I took $20 out of my wallet, passed it to him, and he put it in his wallet EXCEPT that Bitcoin instantly "teleports" the money from my wallet to his. But also everyone can see that happen. But also no one can see that it was me and him who did the transaction._

Then why do mixers exist?</comment>