Machine Learning and Ketosis - <AUTHOR> https://github.com/arielf/weight-loss <comment><USER2> What's interesting about this post isn't the actual diet advice, but the guidance to track and see what works for you. Different people react to fasting differently - some continue to burn calories and drop weight, some just go into starvation mode, have their BMR crash through the floor, and end up exhausted all the time because their body is fighting like crazy to conserve energy.

Likewise - some people, when they start to eat carbs, see their BMR ramp up, are full of energy, and end up running 5-10 miles a day to burn that energy off, and are pumped the rest of the day.

Also, focussing on weight to the exclusion of everything else is really horrible. It's pretty easy to lose 40-50 pounds and end up being much less healthier than you were before if you aren't careful. Having some sense of your V02 max, your strength, endurance, flexibility, etc.. are sometimes as important, if not more important, than what your weight is to +/\- 20 pounds.

Everybody is somewhat different in how they'll react to various diet and exercise regimes. Understanding that, and taking a bit of time to watch how your body responds, is the important insight here.

<comment><USER3> > It's pretty easy to lose 40-50 pounds and end up being much less healthier > than you were before

Maybe if you amputate your legs or catch AIDS or syphilis in the process. Otherwise, I can't see how losing 50 pounds will leave you less healthier than before.

<comment><USER2> What I was trying to say, perhaps poorly, that is if you were heavy because you were working out a lot, and eating a lot, and then decided to lose weight by reducing the eating/working out, you can end up being skinny/fat/weak.

At the very least, doing regular body-weight resistance training (pushups, situps, pullups, air-squats), helps to reduce the amount of muscle you are losing while you are losing weight.

<comment><USER3> >doing regular body-weight resistance training (pushups, situps, pullups, air- squats), helps to reduce the amount of muscle you are losing while you are losing weight

Can you explain why archaeologists, astronomers and professors have the highest life expectancy and athletes and body builders have that among the lowest?

<comment><USER4> >Can you explain why archaeologists, astronomers and professors have the highest life expectancy and athletes and body builders have that among the lowest?

That's a pretty serious statement hidden as a question. Can you point to your source(s) claiming this to be true? I am sure a huge % of HN population would be interested in this.

For those interested, I found parent's claim very intriguing so I spent a few minutes Googling and the best I came close to answering yes/no was this -

 _The life-prolonging benefits of a scrupulous life have come to light from a comparison of 20 previous studies which together rated 8900 people for conscientiousness using a standard psychological survey, and also recorded the age they died.

Howard Friedman and Margaret Kern at the University of California at Riverside found that people who were less conscientious were 50 per cent more likely to die at any given age, on average, than those of the same age who scored highly (Health Psychology, DOI: 10.1037/0278-6126.96.36.1995). This exceeds the effects of socioeconomic status and intelligence, which are also known to increase longevity._

[https://www.newscientist.com/article/mg20026794-800-conscien...](https://www.newscientist.com/article/mg20026794-800-conscientiousness- is-the-secret-to-a-long-life/)

 _Do elite athletes live longer?_ TLDR; - In most cases, not really [http://www.athletesheart.org/2013/11/do-elite-athletes- live-...](http://www.athletesheart.org/2013/11/do-elite-athletes-live-longer/)

[https://www.quora.com/Which-professions-have-the-longest- lif...](https://www.quora.com/Which-professions-have-the-longest-life- expectancy-Which-ones-have-the-shortest)

</comment></comment></comment></comment></comment><comment><USER5> I'd really like to see this kind of analysis applied to a larger sample.

If someone were to put together a little app to make this sort of data collection trivial and upload it to a central (preferably cheap) repository, would people be interested in contributing their data in exchange for analysis?

Also, since this is HN, is anyone interested in building something like this? I've got an hour or two a week of spare time to chip in.

Unrelated question, mostly for OP: do you know of any publicly available databases of GI/GL info? It's really important for people with type 1 diabetes (a subject rather dear to my heart), and could also be useful for OpenAPS stuff ([https://github.com/openaps](https://github.com/openaps)).

<comment><USER6> We are working with a few groups to make this sort of this possible. Feel free to reach out if you are interested.

<comment><USER7> I'm interested!

</comment></comment></comment><comment><USER8> I don't have a weight problem, I learned about ketosis researching natural ways for improving focus and concentration, and somehow came across "bulletproof coffee". (I'm only using BP for lack of a better name and I don't endorse the stuff they sell online).

To my utter surprise, something as stupidly simple as coffee blended with butter with coconut oil (or MCT) first thing in the morning did unbelievable things for mental productivity. After much googling I learned that this is not a fluke, and that there is real science behind it - beta-oxidation, etc, all that good stuff.

What's most incredible to me is that (1) I didn't know about it, I always thought glucose is the only fuel (and I consider myself fairly knowledgeable as far as basic physiology is concerned) and (2) that sugar, especially the industrially produced kind, is about as close to being the root of all evil as it gets and there is nothing wrong with fat at all.

<comment><USER9> "Bulletproof Coffee"(TM) is snake oil stuff. It's based on the assumption that all other coffee on the market has mycotoxins, yet literally none of the brands in first world countries have them anyway. This was confirmed by tests.

<comment><USER10> He started off by selling high-fat coffee creamer and sugar-free hot chocolate, which are reasonable. It's only later he's gone on to try to convince everyone coffee and wine are full of secret mold toxins.

</comment></comment></comment><comment><USER11> It's astonishing (and really awesome) that they were able to extract such a strong signal from daily weight swings! This makes me a lot more optimistic about the possibilities of quantified-self-type stuff.

Three things I'm really curious about:

\- How significant are the estimates of lifestyle factors? Do you have p-values? If you bootstrap resample, how much do the rankings change at the extremes?

\- How much cognitive overhead did it impose to collect the data for this? Did you put a lot of effort into designing the tags beforehand or making sure you weighed yourself at a consistent time?

\- It looks like the predicted delta from going from a "nosleep" day to a "sleep" days is about 1.4 pounds (sleep coef minus nosleep coef). That seems fishy, or at least like it will stop working fairly soon because you can't actually lose 1.4 pounds/day sustainably. Is it possible there's something weird going on with the data or those variables don't have the obvious meanings?

<comment><USER12> > \- How significant are the estimates of lifestyle factors? Do you have > p-values? If you bootstrap resample, how much do the rankings change at the > extremes?

His VW script does do bootstrapping ('\--bootstrap 16') but he doesn't report it anywhere I see. [https://github.com/JohnLangford/vowpal_wabbit/wiki/using- vw-...](https://github.com/JohnLangford/vowpal_wabbit/wiki/using-vw-varinfo) seems to not report any sort of p-value or confidence interval which might be derived from the bootstrapping. (The 'relevance' is 'the relative distance of each variable from the best constant prediction', not sure what that means.)

So if you want to know, it looks like you'll have to run it yourself and visualize the output. I would guess that the uncertainties are huge and none of them reach even p<0.05 - it simply should not be possible to get mean loss of like 0.2 and reliable estimates of hundreds of variables like 'melon' out of less than 4 months of data when the random measurement error of the scale itself is on the order of half a pound (I have an Omron body fat scale, and even taking 2-3 measurements daily, there's a lot of error) unless his VW regression is grossly overfitting.

<comment><USER11> I mean, the uncertainties in the middle are less interesting than the uncertainties at the extremes. I'm sure you can't say anything useful about melon, but it would be interesting to know if (e.g.) "sleep" was consistently that big. He did regularize somewhat (`--l2 1.85201e-08`) but unclear whether that's enough regularization.

Basically I'd love to see some actual diagnostics I guess :)

PS I believe the "relevance" is just the coefficient divided by the biggest coefficient (the `RelScore` column in the printout in the README file).

<comment><USER12> Well, he also disables the holdout set (`--holdout_off ariel.train`), so between that and not reporting the uncertainties and his absolutely tiny dataset with high measurement error and the low prior probability that any of these effects could be that big... Nah. It's just overfitting noise.

I tried to run the makefile, but apparently the version of Vowpal Rabbit that ships on my Ubuntu (7.3) is so outdated that it doesn't support the bootstrap option.

<comment> ariel-faigon Thanks so much for all the excellent comments. There was definitely an over- fit with 4-passes.

No more. I've updated the Makefile to run only one pass, changed the options so it runs with older-version vw, Fixed misspellings of 'gioza', removed 'mayo' which found itself on the wrong side because it appeared only twice and always alongside the bun and regenerated the chart.

All the main conclusions remain intact.

In the end, I urge everyone to use their own data, that was the main purpose of sharing this code. My data-set is small, awfully noisy and insufficient. There are no p-values and no rigorous statistics, so please don't read too much into the minute details. It is the discovery journey into the _top factors_ that is the important part, in my view. The ML was just one aid in this discovery process. The proof for me was my actual, and sustainable, weight loss that came after (very slowly) realizing the top factors that eventually worked for me. Thanks again.

<comment><USER12> I don't think it matters whether you run 4 passes or 1 pass, it's still going to overfit. You can run an online linear regression in a single pass too, but that doesn't magick away the uncertainties. The results are still going to be garbage, and any effects you get are due to your health-consciousness and not any specific dietary choices you make (how could it be, when the data is so weak and noisy that each item can easily flip signs?).

<comment> ariel-faigon Thanks so much. Your comments are really helpful.

I realized early on that the data is hopelessly noisy, due to the small daily changes and the scales resolution so rather than trying to build a perfect model to gauge the variable importance of each and every kind of food, I focused on the few days when weight change was more significant hoping I could detect some signal in those, and extrapolate and further explore from that. That's why I sorted the data-set by abs(delta) and that's what consistently pointed me towards sleep/fasting as the #1 factor. I do agree that the full list/model is garbage in the sense that probably 80% or so of it is woefully inaccurate/flipped, noisy, overfitted etc. The main point was to lead me in the right direction by looking at the big picture and what stood out.

And what stood out were 2 things 1) sleep (fasting duration), and 2) fat vs carbs. I think everything else should be ignored. I think we're in total agreement on this point.

Does this sound more sensible to you?

<comment><USER13> Is it possible weight loss made you sleepy?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> This is all good if your goal is weight loss. However weight loss doesn't necessarily means higher fitness. Glycogen is fundamental if you do sports, and exercise is a major ingredient in getting fit. If I read correctly, exercise was not a big part of your experiment, how would you suggest modifying the experiment to accommodate one's exercising needs?

On a side note, I reached a similar conclusion on the role of "carbs at night", sleeping, and fats, and I read this interesting article [https://aeon.co/essays/hunger-is-psychological-and- dieting-o...](https://aeon.co/essays/hunger-is-psychological-and-dieting-only- makes-it-worse) on the importance, for effective weight loss, of feeling satisfied (I believe there is also a reference to the relationship between eating fats and feeling satisfied).

<comment><USER15> Another anecdote. I tried keto on and off for 2 years while trying to achieve my former triathlete performance. I felt good at the beginning; lost some weight and felt more energy, but it quickly declined and I was never able to perform well.

Last year I was introduced to books like Finding Ultra, Whole and Proteinaholic, and went on a high carb diet.

Today my diet is based on beans, lentils, potatoes and fruits and I'm performing 15-20% better than my previous peak from 15 years ago (I'm 37 now). As a bonus, with the amount of fibber I consume, I never had digestive issues again.

<comment><USER16> Any good ways to prepare lentils?

<comment><USER17> Too many to count. I like allrecipes or some website like that.

Dal Bhat is one of my favorites after living in Colorado.

</comment></comment></comment></comment><comment><USER18> Just for what it's worth, there are several Soylent-like meal replacement products that are explicitly formulated for ketogenesis. This could be an aid for a person who wants to try a keto diet without having to research a lot of new recipes.

Biolent has a keto variant: [http://biolent.ca/](http://biolent.ca/)

Keto Chow: [https://www.thebairs.net/product- category/ketochow/](https://www.thebairs.net/product-category/ketochow/)

Keto Fuel: [http://superbodyfuel.com/shop/keto- fuel/](http://superbodyfuel.com/shop/keto-fuel/)

KetoSoy: [https://www.ketosoy.com/](https://www.ketosoy.com/)

PrimalKind is "paleo": [http://primalkind.com/](http://primalkind.com/)

Edit: added Keto Chow, which I forgot on first pass!

<comment><USER19> Also remember, his diet is a function of not taking carbs at all (or very little) for a short time.

For someone who eats lots of carbs already, a plum/orange isn't going to cause an increase in weight. It is primarily just calories. It is of course easier to eat more calories in carbs than in protein, but overall, carbs aren't "bad".

Moreover, such Atkins diets tend to work only temporarily, until atkins-diet homeostasis is achieved, unless calorie restriction is practiced as well [1,2].

[1] Many studies show that long-term weight rebounds if you forgo carbs and overall weight loss depends only on calories. One article: [http://ajcn.nutrition.org/content/90/1/23.long](http://ajcn.nutrition.org/content/90/1/23.long)

[2] [http://jama.jamanetwork.com/article.aspx?articleid=200094](http://jama.jamanetwork.com/article.aspx?articleid=200094)

<comment><USER20> Atkins is not a keto diet. Atkins starts keto, then reintroduces carbs.

Weight loss is simple: calorie deficit. However, switching from carbs to fats and taking advantage of some of the metabolic processes your body has to offer makes the process easier for many people. Calorie deficit with less hunger and decent energy. It helps a lot.

<comment><USER21> >Weight loss is simple: calorie deficit

Not that simple. People touting this are usually genetically endowed with great metabolism. I've tried this many times and reach a plateau pretty quickly and have to keep decreasing calories until it's not practical anymore.

On the other hand, watching the glycemic index/load does the magic for me.

<comment><USER22> What do you mean by "great metabolism"?

Metabolic rate does not vary that much: [http://www.ncbi.nlm.nih.gov/pubmed/15534426](http://www.ncbi.nlm.nih.gov/pubmed/15534426)

And to be clear, you can't not lose weight with a calorie deficit.

<comment><USER23> > And to be clear, you can't not lose weight with a calorie deficit

That's true, but in a useless way.

You can't die of cancer if you get rid of all the cancer cells in your body -- that doesn't help us treat cancer.

The problem isn't whether caloric deficit works. The problem is why some people are unable to maintain caloric deficit.

This appears to be complex, and includes stuff like gut flora, medication, strong cognitive biases, among others.

</comment></comment></comment></comment></comment></comment><comment><USER24> I lost 15 kg (33 lb) over a period of 7 months.

* Stopped drinking juice, coke etc. completely * Ate sweets strictly only once a week (like one cake every sunday) * Ate carbs mainly at lunch when doing sport afterwards. In the evening I ate carbs too, but much less.

There's one thing that all these fasting-guides and tips fail to mention:

The fastest way to loose weight is to heighten your resting-energy- consumption, and the fastest way to do this is to gain muscle mass by training.

<comment><USER25> Indeed. A muscular person at 185lb will burn more energy sitting still than their more rotund counterparts.

Another thing to keep in mind -- muscle weighs more than fat. When participating in a workout regimen, some may be discouraged by their lack of weight loss and mistake it for stalling. This should be overcome.

Frankly I think the greatest innovation in this would be a bathroom scale that shows both body-fat percentage and weight.

<comment><USER26> Such scales exists, but they do it by measuring electric resistance between your feet. So not very accurate. However, if you do it under the same conditions every day (same amount of water in your body etc) you can at least show the trend.

</comment></comment></comment><comment><USER27> Totally anecdotal, but I want to second the recommendation of a longer fasting period.

I switched to a strict-but-not-religious "no food between 7 pm and 11 am" system (with exceptions for weekends and social occasions).

Within a few months I was down 15 pounds (~182 to around ~167) and had shed 4 inches off my waist (~34 to ~30). I'm about 5'10" and 41 years old.

It's definitely helped with physical activity (mostly parkour/free running) and I look better. It's also _more_ convenient than what I was doing before, since I don't have to cook breakfast.

The only negative side effect (possibly unrelated) has been that I need a much cooler sleeping environment to be comfortable.

The only thing I would add is that I'm starting to (upside-down) plateau at around 165 and (what my scale says is) 20% body fat. I would love to lose another 5-10 pounds but it'll probably be a slow process.

<comment><USER2> If you can afford it (usually around $150 here in Singapore), it might be worthwhile going into a sports clinic to get a RMR reading. It's possible that your body has significantly dropped your metabolism after the weight loss, and is fighting to restore its previous weight - making further fat loss (particularly while retaining most of your lean body mass) really difficult.

Ironically, in that scenario, it might be worth occasional days of _increased_ caloric input, to attempt to trigger your body into believing that it isn't starving, and really can continue to run a high BMR.

At the very least, having the data in hand is pretty cool - and it only takes about 40 minutes, inclusive of the time they need to set up the gear (just an face mask) and get you into a calm/resting state.

<comment><USER22> I'm sorry, this sounds like you're talking about "starvation mode". Do you have a decent source for this because everything I've seen around it is pseudoscience. You're suggesting that they, while feeling fine, have an enormous problem with one of the most fundamental processes which keeps us alive.

Your BMR drops as you lose weight, it might simply be that this hasn't been taken into account.

Or they're not tracking their calories.

<comment><USER2> Fair point. There is research which shows your BMR may drop after sustained reduction in caloric intake, far below what your body weight would indicate. Probably one of the more well known recent ones was: [http://onlinelibrary.wiley.com/doi/10.1002/oby.21538/abstrac...](http://onlinelibrary.wiley.com/doi/10.1002/oby.21538/abstract) \- which shows the effect can go on for several years.

Here's a really good article discussing caloric-reduction, impact on Leptin (key hormone involved in regulating the body metabolism): [http://www.bodyrecomposition.com/muscle-gain/calorie- partiti...](http://www.bodyrecomposition.com/muscle-gain/calorie-partitioning- part-1.html)

Though, careful reading suggests that the author believes that a day of refeeding (ala 4-hour body), is unlikely sufficient to trigger Leptin such that the body's BMR kicks back into high gear.

</comment></comment></comment></comment><comment><USER28> I've been doing ketosis for about 6 months, after having done twice in the past. From my heaviest to today over the last 2 years, I'm down 50 pounds.

The data in this post was cool. I found Dr. Peter Addia's analysis to be one of my favorite resources. He's a medical doctor who was an overweight endurance athlete, then began doing ketosis. I appreciated an honest scientific analysis of the benefits and drawbacks of ketosis.

His blog:

[http://eatingacademy.com/](http://eatingacademy.com/)

As an aside, I think that our attitude toward insulin from a public health perspective is going to change a lot in the next few years.

<comment><USER16> What do you mean about insulin?

<comment><USER29> I am very interested as well and hope there is a response. Since he was working with an MD, my guess is as follows: insulin is the devil.

Whereas if you look at the old FDA food pyramid and the new food plate, carbs/sugars/fruits take up a significant percentage of the recommended daily diet. Take fruit for example, prevailing norm would be fruit is healthy (especially in its natural state where it is accompanied by fiber), fruit aside most people would believe carbs (especially in whole grain form) are perfectly fine in moderation. My big guess is that an M.D. recognizes any amount of carb (fruit or whole grain being no different that high fructose corn syrup) triggers the bodies production of insulin. More and more, I think M.D.'s will have negative perspective on any/all insulin production if it can be avoided. I have more thoughts on the impacts of insulin on the body, but I hope OP will chime in with a response to see if my instincts are on point.

<comment><USER28> Basically this. I think it's more about insulin spiking, though, because insulin stops healthy people on a nutritional ketogenic diet from going into diabetic ketoacidosis.

</comment></comment></comment></comment><comment><USER30> This is delightfully nerdy and overly analytical, but I can't believe someone would go to the extent of creating this yet never think to look for counterarguments against their dieting regimen. Doing this would have given him the answer much sooner.

Trying to figure out how the consumption of certain foods correlates with weight gain/loss is a waste of time because it's simply the caloric content, not the macronutritional content (eg protein vs carbs vs fats). There are dozens of studies showing that only calories matter for weight loss, including vs low-carb, low-fat, and more[1].

The author is acting like each food has arbitrary properties that make them food or bad for weight loss. It's a good reason to play with ML, but it's easier to just count calories. I hate seeing people go down the "good food/bad food" path of thinking because they end up overanalyzing the shit out of everything they eat and for no good reason.

The glycemic index doesn't realistically matter either for a ton of reasons. It hasn't been taken seriously as a useful marker when chosing foods for quite some time now. It's not a reliable indicator of anything. I posted a summary a few years back that debunks all the insulin/GI spike voodoo[2].

Low carb diets work, but they only work because they're a trick to get you to reduce calories. Look at what you're eating and remove all the carb foods. Notice how much your calorie intake dropped. It's a simple way of losing weight without counting calories, but that's it. The weight loss on keto, atkins, etc have nothing to do with carbs, and everything to do with calorie restriction.

It's worth noting that low carb diets have great health benefits, however [3].

[1]: [http://examine.com/nutrition/what-should-i-eat-for-weight- lo...](http://examine.com/nutrition/what-should-i-eat-for-weight-loss/)

[2]: [https://reddit.com/r/Fitness/comments/j853z/insulin_an_undes...](https://reddit.com/r/Fitness/comments/j853z/insulin_an_undeserved_bad_reputation_plus_notes/)

[3]: [http://examine.com/nutrition/are-there-health-benefits- of-a-...](http://examine.com/nutrition/are-there-health-benefits-of-a-low- carb-diet/)

<comment><USER31> Food does have properties (not arbitrary) that make them good or bad for weight loss. I agree, calories count. But if you eat food that makes you hungry, it is harder to cut calories. The reason low-carb high fat diets work is that you feel full on fewer calories.

<comment><USER32> All calories are not equal. Ask a diabetic to chow down on carbs. The body clearly doesn't treat all the macronutrients as interchangeable units of energy. To say, "a calorie is a calorie" helps none and allows people to behave as thought-terminating parrots.

</comment></comment></comment><comment><USER33> I really like your reading because I went to a time period when everything I read was so misleading even words from doctors. That's the time when I tried very hard to improve my health (I gained about 30 lbs since the time I came to this country 15 years ago). To do that, I ate less fat, avoid carbs, getting a lot of exercises (1-3hrs a day, at least 5 days a week), eating oatmeal, even taking statins. And all one failed after another. I went through a lot of things mentioned here. And finally I decided to forget about everything doctors and researchers said. I look at my parents diet and how I was raised and started slowly from there. My health then got improved much better. I'm glad that you wrote something here for everybody to read. But there's one point I would like to add to the recipe: improve mental state by listening to the body (meditation, yoga, brisk walking are good methods), eat only when the body feels hungry and stop eating when it feels full, eat the food that it feels good after eating (you will develop your own list). I lost about 10lbs and I don't gain/lose any weight for the last 3 years.

</comment><comment><USER34> As a long-term ketogenic eater (10 years), here are my top simple tips. Unfortunately they were not gleaned using machine learning.

1\. Watch your protein. Most people when first going keto will eat too much protein and not enough fat. Protein has an insulinogenic effect when eaten in quantity. Keep protein below 8 oz per meal. Don't be afraid to eat more fat.

2\. Avoid cheese. Yes, it's technically low carb, but it repeatedly throws me and my girlfriend off (also a low carber).

3\. Avoid nuts. Yes, like cheese, nuts are delicious. But they're a slippery slope. Life will be easier if you avoid them.

<comment><USER35> Apoligies, what is LCer?

<comment><USER34> Low carber

</comment></comment></comment><comment><USER36> > The 'stayhome' lifestlye, which fell mostly on weekends, is a red-herring, I > simply slept longer when I didn't have to commute to work.

Is it?

First, whatever method you use should already take into account that _sleep_ happens together with _stayathome_. Even basic regressions take into account that.

Second, staying at home means your eating binges are constrained by what's around you. If it is healthy stuff it might mean weight loss, if it is bread and chips the opposite

<comment> ariel-faigon Thanks for the comment. You're absolutely right. I stand corrected and updated the README accordingly.

</comment></comment><comment><USER37> The author is wrong that sleeping more just gives less time for eating. Truth is that sleeping more reduces insulin resistance, increases testosterone production in males and puts leptin under control. All three reduce carb craving, push us towards meat and fat and increase natural fat burning.

<comment><USER38> Thank you. Getting plenty of sleep also lowers levels of "stress hormones" like cortisol, which tend to promote fat storage.

Which is sort of what those hormones are for. It's easy to see how ancient humans or proto-humans who had this tendency to store extra calories during times of stress, would've had survival/evolutionary advantages.

Therefore don't mimic times of high stress by shorting yourself on sleep!

</comment></comment><comment><USER39> Warning: unpopular opinion here. Long term low carb dieting and ketosis is not without risk. Yes, you will see weight loss, but what about other health markers? Check out some of the information here: [http://nutritionfacts.org/topics/low-carb- diets/](http://nutritionfacts.org/topics/low-carb-diets/) What has worked for me was a plant based diet without added oil and processed foods: [https://medium.com/@borkdude/tl-dr-of-my-long-term-weight- lo...](https://medium.com/@borkdude/tl-dr-of-my-long-term-weight-loss-and- maintenance-success-49cb43f62a1a) Been doing that for five years now. Never hungry, still happy with it.

<comment><USER40> For once I want someone who isn't morally opposed to eating animals tell me that low carb diets are bad.

Vegans and animal lovers don't like low-carb-high-fat diets because it requires eating a lot of animals, so I find it hard to trust them.

<comment><USER39> OK, then watch this lecture by Denise Minger. She is known within paleo circles and is pretty unbiased when it comes to eating animal foods:

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

</comment></comment></comment><comment><USER41> Carbohydrates do not make you fat. I am eating a high carb vegan diet and have lost 63 pounds since last October.

My weight loss: [http://imgur.com/a/cGb4X](http://imgur.com/a/cGb4X)

I do not restrict the amount of food I eat. I snack and have big meals.

Carbs do not make you fat. Eating high caloric density foods makes you fat.

More resources: [http://nutritionfacts.org/](http://nutritionfacts.org/)

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

[http://www.forksoverknives.com/category/success- stories/](http://www.forksoverknives.com/category/success-stories/)

<comment><USER32> Carbohydrates make me fat. Maybe not you, but definitely me. There is no way around that and I've made peace with it.

<comment><USER41> Have you tried going on the starch solution strictly for two weeks? How do you eat your carbs - is there any oil along with those carbs? Any meats or dairy?

</comment></comment></comment><comment><USER42> I guess if we're sharing fitness plots, here's 1300 measurements and 7 DXA scans:

[http://i.imgur.com/J4Ls2bQ.png](http://i.imgur.com/J4Ls2bQ.png)

<comment><USER43> Woah!

I thought I might be over-doing it with 2 DXA scans :)

I should dig mine up, I got down to 10% body fat a few weeks before completing my first Ironman. I'm normally around 17-19% from memory.

</comment></comment><comment><USER44> I might have missed it, but doesn't look like ketone levels was one of the factors being measured. You can actually buy ketone pee strips at any drugstore for cheap. Would have been an interesting thing to track, since conventional wisdom says that ketosis is binary, you're in it or your not, and the actual ketone level doesn't affect the weight loss. I'm sure this has been put to the test in some experiments already, but maybe applying learning could teach us more and validate/invalidate this hypothesis

<comment><USER45> On a related note; NuSI (Gary Taubes's Nutrition Science Initiative for better nutritional testing) has not published their first results for the carbohydrate/insulin link to obesity, but Dr. Kevin Hall discusses the upcoming results in this video and some people may be surprised (including Gary).

_No Metabolic Advantage for Ketosis Found_

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

<comment><USER44> I wish I had data to back this up, but there is no chance I was in caloric deficit on the keto diet. I lost lots of weight at the time. Not claiming my body violated energy conservation, but clearly this is more complex than "you don't get weight loss for free so you have to exercise more". So many folks doing the keto diet are sucking down ungodly amounts of bacon, heavy cream, etc and losing weight

<comment><USER2> They are replacing even _more_ ungodly amounts of calories in the form of carbohydrates with that bacon/cream. Honestly, you can only eat so much bacon before you get sick of it, and your body just screams "Yuck. Stop eating. I'm full".

That's not true of things like rice, noodles, bread, etc.. where for many people eat some, and your body is like, "Awesome. Bring it on" in a never ending cycle.

Put another way - Satiation happens a lot faster, and lasts longer, when you are eating protein/fats, than it does when you are eating refined carbohydrates.

I think that what made it clear to me, is that there are _no_ metabolic chamber studies (where people's activity and diet are perfectly controlled) that have ever demonstrated significant variation from the calories in/calories out model. Carbs, Protein, Fats - doesn't seem to make a difference, your weight is simply a reflection of your metabolic output and caloric-intake.

Stephan Guyenet also has an interesting perspective here:

[http://wholehealthsource.blogspot.sg/2011/08/carbohydrate- hy...](http://wholehealthsource.blogspot.sg/2011/08/carbohydrate-hypothesis- of-obesity.html)

<comment><USER44> I don't doubt for many that reduction in carbs amounts to reduction in calories. For others though, eating a lot, and not worrying about consequences, is a coping mechanism for how shitty the diet is. I'm super biased from my own past experience, but I was having 3000+ calorie days with minimal exercise and losing weight on keto. Open to the idea that I'm somehow wrong though :-)

<comment><USER2> They've tried all sorts of diets in metabolic chambers - and it's really quite amazing how closely the observed results track the predicted results. Determine a person's BMR, and then feed them a variety of diets higher, or lower, than that BMR, and watch their body mass (exc. water) increase, or decrease as expected.

Possibly the case that when you were eating carbs, you were putting away 3500 calories a day, and that dropped to 3000 calories a day when it was just meat? I know that just a casual stroll through the mall on a refeed day for me, I have zero difficulty putting away 6000+ calories - refined carbs are shockingly calorically dense.

Also - for some time on a Keto Diet, you are going to be dropping a ton of water - so the scale will be dropping like a rock, regardless of what your actual body weight is doing. Getting a DexaScan, or whatever lean/fat body mass assessment you prefer to see what's really going on.

<comment><USER46> The water loss is one thing I like about a low carb diet--you get positive feedback right away. It isn't real weight loss, but that doesn't matter. The point is to get started and feel like you have made progress in the right direction. Then the real, much slower, weight loss can begin.

<comment><USER2> Completely agree with you. And, even though I realize exactly what's happening, I also like it. You can even make the up/down swings work for you. The 4-hour body slow-carb approach has you "refeed/binge" once a week, where you usually put on 8-10 pounds in a single day. But because you _know_ it's going to happen, it's not particularly worrisome, and then you get the bonus the next week of dropping 2-3 pounds on the scale every day.

But, I think it's also a good idea, _in addition_ to enjoying that little bit of gamification on your scale numbers, to also have a good sense of what's actually happening in the body mechanics.

That way, you get the best of both worlds.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER47> I collect some of my own data in 1/0 form in regard to whether I was productive the day before as well as a few other things (I have a google form for myself that I fill out each morning). I only have a month of data but here is what it spat out:

      FeatureName       HashVal   MinVal   MaxVal    Weight   RelScore
      ^dreams         24546     0.00     1.00   +0.0705     47.11%
      ^shower           215555     0.00     1.00   -0.0239    -15.96%
      ^exercise         190069     0.00     1.00   -0.0350    -23.41%
      ^vitamins         252959     0.00     1.00   -0.0442    -29.56%
      ^write                129676     0.00     1.00   -0.0687    -45.90%
      ^publish            12600     0.00     1.00   -0.1496   -100.00%

Which is to say that when I write and publish I also have the willpower and combined other factors to lose weight.

Interestingly I was tracking dreams because I made various changes all at once:

      -phillips hue bulbs
      -new mattress
      -new exercise routine (up from nothing)
      -started taking vitamins
      -stricter on my diet

And was wondering what the cause might be.

When I say "dreams" I mean - "did I wake up remembering vivid dreams?". I wonder now if it's related to caloric surplus.

I also have minutised step data, nightly minutised sleep data and hourly mood self-reported data that I might try to throw in to the system and see what it says.

<comment> ariel-faigon This is pretty hilarious. Thanks for sharing. It may be showing how much noise there is in a random data-set with too few data-points to draw statistically significant conclusions. It might also mean that you're on the right track and now that you have the tool, you can keep going until you find real enlightenment.

I really like your comment because you're one of the very few that actually tried the idea. Thats the #1 reason I put this on github, to help others conduct their own experiments on whatever they care about. If you ignore all my weight-loss journey story and data and just use some of these ideas to improve your own life, it was all worth it for me.

</comment></comment><comment><USER48> This is awesome. I'd love to see something similar from someone who (intentionally) gained muscle mass. Is it really about high-protein + high- carbs + workout + sleep, or is there a more optimum diet for this.

</comment><comment><USER49> Of course you're going to gain weight when you eat carbs. Glycogen contains mostly water and carbs, so if you store glycogen you gain weight, up to 20 lbs from completely depleted.

So let's say you eat low carb and train very hard for a week. Your muscles will be depleted, your liver will be depleted. You see that you lost 10 lbs! Great! But is it? Maybe you lost one pound of fat and 9 pounds of water. Then you eat NOTHING BUT carbs for three days and you gain 20 lbs. Oh no! But actually it's your muscles expanding their capacity to store glycogen (since you trained hard and depleted yourself they will regain even more glycogen than before). You may have not gained ANY FAT AT ALL!

I have had great success dieting with medium fat medium carb diets. I try to keep between 180lbs and 220lbs (I'm 6'4"). I'm saying that this kind of tracking is oversimplifying the issue of fat loss - you need to see that you're losing fat tissue which involves at least caliper measurements.

<comment><USER2> I was wondering when someone was going to mention this. I can add about 11-12 pounds of body-weight by scale reading in a single day simply by eating food rich in carbs the day prior. Cutting the Carbs out of my diet see's that weight disappear (thought it takes 4-5 days). Adding Potassium, Sodium, Magnesium supplements to meals reduces the water loss somewhat.

Agreed - that the real question isn't weight, per se, but Lean Body Mass. DexaScan is also a good approach to nailing down that number.

<comment><USER49> Yeah, I had a DEXA scan T 191lbs and I was 16% BF. It's not practical to do this every day, though.

But what I've found is that calipers actually do a good job at showing body fat changes. They're horrible for absolute values (if they say 12%, they might be off by 4%), even at multiple measurement sites. But if calipers measure more or less, you can still be fairly sure that you have gained or lost fat mass.

Measuring like that I found that nothing beats lots of caffeine and plain low calorie diet.

</comment></comment></comment><comment><USER50> Interestingly "gioza" and "gyoza" as factors come out with opposite signs. I guess that provides a heuristic confidence interval for the weights.

<comment><USER51> Maybe there's a correlation between weight gain and spelling ability? /s

</comment></comment><comment><USER52> If anybody is reading this and curious about Ketosis, I'd recommend Taubes book ([https://www.amazon.com/Why-We-Get-Fat- About/dp/0307474259](https://www.amazon.com/Why-We-Get-Fat- About/dp/0307474259)). It's a great review of scientific studies done over the years.

I read that 4 years ago, spent another 4 months reading the listed studies, convinced myself it was a good plan, and lost 40 pounds with no exercises. I still do LCHF after all these years, and likely will never go back to a traditional diet, it feels great.

<comment><USER53> I was told about Keto diets about three years back by a friend of mine. There's a lot of misinformation about food and health in the US and elsewhere, and for the longest time I thought low-carb diets were stupid.

But after trying it and reading a lot of the research, I was pretty amazing. I went from close to 70kg down to 58kg over the course of the next year (although I've come up to around 62 ~ 63kg stable).

I like how this person mentions in the Github readme that it's not for everyone and "listen to your body." Some people have bodies that do well with high carb intakes. Every body type is different. With all that being said though, a huge issue with being overweight is education. The food industry wants you to buy fast food, pizzas and things that are cheap to create with easy base ingredients (sugar, starch, corn, wheat, etc.)

Sadly, the only way for me to realize this was to experiment on myself, as did this person (although with totally insane amounts of metrics). Kudos!

<comment><USER43> Whenever I relate my ketosis experience to people who ask, the biggest emphasis is on how "personal" diet is. You really can't just copy someone else's eating habits and expect the same result.

Listening to your body is very underrated skill. You can learn it (helps to have been an athlete at some point in your life) but you also have to do something about it :)

</comment></comment></comment><comment><USER54> This matches my experience of weight loss using high fat diet. I started it after hearing Sarah Hallberg's Tedx talk. [https://www.youtube.com/watch?v=da1vvigy5tQ&feature=youtu.be](https://www.youtube.com/watch?v=da1vvigy5tQ&feature=youtu.be) For a vegetarian, starting and continuing the high fat low carb diet is difficult. Are there any resources for more vegetarian recipes for high fat low carb food?

The article was very impressive. I liked the graphs and presentation.

<comment><USER28> Many of these meals are vegetarian - it may be good inspiration:

[http://eatingacademy.com/personal/actually-eat-part-iii- circ...](http://eatingacademy.com/personal/actually-eat-part-iii- circa-q1-2014)

[http://eatingacademy.com/nutrition/what-i-actually- eat](http://eatingacademy.com/nutrition/what-i-actually-eat)

[http://eatingacademy.com/personal/what-i-actually-eat- part-i...](http://eatingacademy.com/personal/what-i-actually-eat-part-ii- ifik-2)

<comment><USER54> thanks for the pointers. will check them out.

</comment></comment></comment><comment><USER55> Sorry for the crosspost/copy-and-paste:

For me personally this worked quite well for reducing bodyfat:

Intermitted fasting[1] and lifting weights 3 times a week[2] and being on a cutting regime[3] (cutting on the rest days with low carb and loading on the workout days wiht more carbs).

In the beginning IF was quite difficult but after a while the body get used to it and also I tend to have less cravings during the day. On the loading days/workout days I often have a hard time to get enoug calories because I feel full. I am using MyFitnessPal to track what I eat but it's more about the macros and not so much about the exact calories (but it's also good to get a feeling how much calories different kinds of food has)

[1] [http://www.leangains.com/2011/03/intermittent-fasting-for- we...](http://www.leangains.com/2011/03/intermittent-fasting-for-weight- loss.html) [2] [http://stronglifts.com/](http://stronglifts.com/) [3] [http://www.lgmacros.com/standard-leangains-macro- calculator/](http://www.lgmacros.com/standard-leangains-macro-calculator/) reply

</comment><comment><USER56> It is funny but I had pretty much the exact weight loss as the OP had doing intermittent fasting. Sadly I wasn't as rigorous on the recording of weight loss but I went from 195 to 175 over roughly the same time period as the OP.

One thing I found is writing down a plan seems to really help you stick with it.

I finally wrote down my workout routine after decade of on and off training. I always logged my workouts but I never wrote the overall plan down. If you are interested in my routine it is here (it has very little to do with diet as I was going to write a follow up some day): [https://gist.github.com/agentgt/f93b78dbe13870a6d0a1](https://gist.github.com/agentgt/f93b78dbe13870a6d0a1)

I have never publicly posted the routine so if you feel the need to trash it I suppose you can do so in the comment area of the gist but routines are pretty personal anyway (to the OPs point).

</comment><comment><USER57> A word of advice to those attempting a Ketogenic diet: get your blood work done on a regular basis.

If possible, get heart scans done once a year.

It's easy to slip into a sloppy version of the Ketogenic diet, at which point you're consuming lots of unhealthy fats and carbs, you triglycerides and cholesterol could shoot up and put you in shit street.

This is a strict diet.

<comment><USER2> What is an unhealthy fat? Also, by definition, if you are eating more than very minimal carbs, you aren't on a ketogenic diet.

Honestly, and with no sarcasm intended, I think your advice would be similarly correct for anyone considering eating bread, or white noodles/rice - get your blood work done on a regular basis, and heart scans done once a year, your triglycerides and cholesterol could shoot up and put you in shit street.

I'm willing to wager that significantly more people have cholesterol problems with rice/bread, than they do with eating meat and fat.

<comment><USER57> > What is an unhealthy fat?

Fat consumed with high levels of sugar.

Not everyone has the capacity to be strict with their diet, habits, or health in general. These people might still attempt the Keto diet.

The Ketogenic diet gets approached by lots of people with mental health issues (bipolar for one), and people who have issues being strict with their diet.

Advising them to get their blood work done, and heart checked is normal, and sensible. Getting your blood and heart checked regularly is a healthy habit, and provides vital feedback to understand exactly how your diet is impacting your health.

</comment></comment></comment><comment><USER58> Among words correlated to weight-gain, the least correlated of these is cheeseburgers! Be still my heart (not literally)!

<comment> ariel-faigon Good eye. May be random noise since most daily deltas in the data-set are so small. See comments about over-fitting and noise elsewhere in the thread. Also may be a veggie-style (without the bun) burger. It was over 2 years ago, so I don't remember. I plan to write a separate machine-learning focused doc on this exploratory experiment when I get more time.

</comment></comment><comment><USER59> The challenge for me is always knowing what to eat to help me accelerate my weight loss. I need structure. If I don't have structure, it's easy for me to eat things I shouldn't. I started a weight loss program 5 weeks ago called "Ideal Protein," which uses the Ketosis method. They supply breakfast, lunch, and a snack. I only need to make dinner (plus 2 cups of veggies for lunch). I love how easy it is.

I'm wrapping up week 5 tomorrow and I'm down 25lbs (~14% of my body weight)! They promise 2-5lbs of fat loss a week. I generally drop around a pound a day, but I'll get stuck a few days here and there. This method really works for me.

The best part is how fast you lose it. When I did South Beach years ago, it took me months to hit my goal. I have 14lbs left now and I should be able to hit my goal by Labor Day.

Give it a try.

</comment><comment><USER60> I appreciate that the author shared his data because it's interesting to compare notes. I embarked on a strict ketogenic diet in 2012 from a significantly higher initial weight and observed a very different pattern of weight loss: [https://i.imgur.com/mOt6P.png](https://i.imgur.com/mOt6P.png)

I hit a loss plateau around 180 lbs that I couldn't break through until I began eating on an 8-16 fasting schedule like Ariel mentions in his "Further progress" section.

I gave up on the diet during 2015 and have since regained a significant amount of weight, but I suppose that's just an opportunity to apply some of the tracking techniques in this article to my next foray.

</comment><comment><USER61> I don't get it, and I've really tried. I'm referring to the keto diet (though this person's approach is obviously extreme overkill). I absolutely love meat, but when I go that low on carbs, I feel like crap. And sure, some people say if I just wait 4 weeks to 6 months my body will adjust, but... why bother?

Get a calorie tracker like my fitness pal, set a goal weight loss, stick to it, and 1 lb per week will be a breeze. You don't need a fad diet. For me, meticulously paying attention to what I was putting into my body and putting a number next to it made it a no brainer. It was almost gamified at that point.

<comment><USER62> Congrats on finding on a solution that works for your body. For me, I find eating keto gives me more even energy, allows me to sleep better, keeps me from feeling hungry, and I also lose weight.

Humans are pretty diverse; perhaps certain eating patterns work better for different body chemistries.

</comment></comment><comment><USER63> Semi-related. For those who want to track their weight daily, efficiently, try Fitbit Aria (or one of the cheaper no-brand WiFi scales). Hook it up to Fitbit app, connect that to TrendWeight ([https://trendweight.com/](https://trendweight.com/)), then throw away the Fitbit app.

Whatever your goals are, however serious you are, I find it a great way to keep track. I just stand on this thing once a morning, and forget about it. And now I have a near-daily record, smoothed out with a weekly moving average.

<comment><USER64> Cosign. I have one of the Withings scales and weigh in multiple times a day. I don't fret over fluctuations -- and I might fluctuate 5lbs in a day -- it's the long term trend line that matters and I can see it on the Withings site. Adding more data just helps.

<comment><USER43> Have you considered tracking skinfold measurements too? I know my weight can fluctuate a lot just from inflammation response after a hard training run. Weight seems to have too many factors that vary at different rates for different reasons.

</comment></comment></comment><comment><USER65> It's a great experiment

However I think the biggest issue with this is that it's considering only a 1 day window. Weight can vary a lot between every day (bladder and bowel contents, muscular glycogen, etc)

<comment><USER66> Yup. Current weight is a sum of several variables: body fat, muscle, water, and digestive track contents. Nearly all day to day variation (up to three pounds in my case) is water. The long term trend is mostly body fat, but I need at least a week and sometimes up to three to see the underlying fat changes. Sometimes my weight will remain almost level for two weeks, and I'll then I'll drop 5 pounds in a few days, and wind up right back where the underlying calorie consumption said I would.

By using a one day window, the author has mostly detected things that affect water weight. Carb intake is a huge driver of water weight because of muscle glycogen replacement, which includes a huge amount of water.

This isn't to knock ketosis: If you enjoy eating that way and it encourages you not to overeat, then it's probably a great strategy for you. Might be worth checking your lipids after a few months though: I've heard of the rare person who tries the Atkins diet and shoots up to 400+ cholesterol.

</comment></comment><comment><USER67> Very interesting littlw study. The results seem to make sense, and I'm impressed that his model can learn what causes his weight swings given the low resolution delta-weight data he collects.

The author uses vowpal-wabbit to train his regression model. Anybody know what learning algorithm it uses (eg random forest?) Here's the link: [https://github.com/JohnLangford/vowpal_wabbit/wiki](https://github.com/JohnLangford/vowpal_wabbit/wiki)

<comment> ariel-faigon Thanks mbrundle. I'm the person behind that git repository and honestly am in a bit of a shock that this is making hacker-news.

As I say in the README.md: please ignore the noise, the scales I used had 0.2 pound resolution, and my data-set was too small (and as one snarky commenter noticed, some words were misspelled). What is important is the big picture. There are actually numerous contradictions and irregularities in the data. In particular, any food item that appears only once or twice in the data-set, and is randomly coinciding with other features that make it biased the wrong way contributes to the error of the model.

So as I say in the README, I would ignore anything that's not near the top or bottom, and even those should be taken with a healthy dose of (noise/modeling) skepticism.

Anyway, the code is free for everyone to use so people are encouraged to run the experiment on themselves using more accurate methods and contributing more data. It only requires R+ggplot2 and vowpal wabbit. Cheers.

</comment></comment><comment><USER68> The impact of sleep/no sleep. Wow.

</comment><comment><USER69> I'm pretty sure this is just an example of a "placebo diet"[1] at work.

[1] [http://www.placebodiet.org/](http://www.placebodiet.org/)

</comment><comment><USER70> Remarkable work. I am really pleased about the contribution of "sleep" in the whole weight loss experience. I have reached some similar anecdotal conclusions; I bet this is similarly not surprising for many persons.

I am not entirely sure sleep contributes only as "a fasting period". Sleep also means we are relaxed. All the other times of the day (when we are awake) we are relatively stressed, meaning more stress hormones (ie cortisol) which are known to be contributing to weight gain.

</comment><comment><USER71> One thing I've never been able to get a clear answer on, is when you "lose" fat, how long does it take for the number of fat cells to go down? As I understand it, at first fat cells just deflate (not the right word) are will easily plump up again and that's one reason why it's hard to keep weight off. What's involved in actually ridding the body of the extra cells (outside of mechanical means)?

</comment><comment><USER72> If you're looking to extend this further, I'll be privileged to work on this with you. Another great opportunity to be part of something! yay!

</comment><comment><USER32> When I ditch the carbs and eliminate grain from my diet, there's no denying that I look better and feel better. I've cycled on and off several times now and there's no way to get around it: The carbs and grain have to go and they have to go forever.

If you can eat them, no problem. However, there's many of us that can't and we're going to talk about how to operate with that as baseline.

</comment><comment><USER73> I'd love to see something like this applied to the goal of gaining muscle. I've been a twig my whole life. In college, I gained 20 lbs of "noob gains" and then tapered off severely. I've maintained that weight, but can't gain more with any reasonable effort.

Dear ddv,

You've got a potential million+ dollar business in the works. In fact, I'd quit my job to be a programmer on your team.

<comment><USER74> The conventional advice in this situation I believe is: unless you're eating enough that you're also putting on some fat, you're not eating enough... Also consider the Gallon Of Milk A Day method.

</comment></comment><comment><USER75> I just started my keto diet about 2 weeks ago and I feel great. Did have one rough night of "keto flu" but then I started supplementing with minerals and more water. I'm super low carb right now. Funny thing is to get (about 4 weeks ago) I would get a double big mac or a double quarter pounder but no drink and no fries and that was it till breakfast. That was fun.

<comment><USER76> Do you supplement with sodium, potassium and magnesium? It might be placebo but I seem to do better when adding sodium (I drink a gram or two via a broth.) Potassium is easy to get from "lite" salt (hard to eat enough otherwise). The amounts required (several grams of sodium, several of K), according to random sites I've looked up, seem rather high for a non-keto dieter. Dunno if they are accurate.

<comment><USER75> I bought a magnesium supplement that includes potassium and sodium, albeit the sodium is the easiest to get anyway, just salt things. Apparently avocados are the potassium go to as well. I've looked at the recommended numbers, and quite frankly I'm not tracking enough to know if I'm hitting htem. The more I remind myself of the recommended and the easier it is for me to calculate on the fly, it's just a matter of looking at my bookmarked page, habit to build I guess until I memorize it. For now I just go by how I'm feeling. If I think I'm going to be frustrated I'll get a little more stringent and careful.

</comment></comment></comment><comment><USER77> He advocates a book "The Truth About Statins".

Is it helpful info on evidence based science or mostly zealotry and soapboxing?

<comment> ariel-faigon "He" is me :)

Sorry, I've never read that book so rest assured, I'm not promoting it. Please note that the link is not to the book, it is a just a google search for the term "the truth about statins". Perhaps some sponsored ad for the book was added by google? If so, my sincere apologies for the unintended consequences.

Here's my personal experience with statins, I may be wrong here, but I'm following my compass and am open to be proven otherwise:

Doctor: "Your 'bad cholesterol' is borderline, I want you to take these statins". Side observation: when the 'Lipitor' patent expired and it became a cheap generic drug, the suggestion turned into 'Crestor' which I learned has a bit longer effective half-life, and way higher price. Me, researching the subject while adopting a different diet: "Hmm statins would have taken me _maybe_ 3% lower and here I am 20% lower after a year of a simple, self- studied, diet change. Maybe there are better ways to lower the so called 'bad cholesterol'? Further study: there's always a new statin the moment patent expires: check out: Compactin -> Simvastatin -> Fluvastatin -> Cerivastatin -> Atorvastatin -> Rosuvastatin on wikipedia (these are chemical names, not brand names, the last two are the brands: "Lipitor" and "Crestor")

So I don't know. I'm 100% sure all my doctors are well meaning and caring and I have nothing against them, but my confidence in these health suggestions, and in all the research that is funded by big-pharma, and in the new great statin of the era while america keeps getting obese and less healthy, is, how can I put it? a bit shaken.

No zealotry at all. Just prove me wrong, and I'll change my view.

</comment></comment><comment><USER9> Maybe your weight loss rate accelerated because you started watching what you eat more carefully, knowing that you want to provide the most sanitary input to your program. Anyway this is impressive for a n=1 study. Glad it worked for you.

Also, OP, what materials would you recommend for a machine learning newbie?

</comment><comment><USER78> One should be careful extrapolating this type of data to other individuals. For example, sleep on its own may not actually be the primary factor in weight-loss --- the weight gain during periods of lack of sleep may occur simply because you have a habit of snacking while staying up late.

That said, awesome work.

<comment><USER79> Very true. The nice thing about some of this is that it's harmless if wrong. Extra sleep won't hurt me, but it'll make me feel better about sleeping rather than feeling that it's wasted time I could have been spending trying to get healthier or smarter.

</comment></comment><comment><USER80> I think this shows how various factors correlates with the amount of water/food still in the digestive system.

I'm not surprised that for example sleeping longer would make you having less water in your body.

Most foods that gave "weight loss" were high energy foods that have lower mass per calorie.

</comment><comment><USER81> I've tried keto a couple times in the past, but struggled with serious acid reflux / heartburn from having to digest so much fat all the time. Any one else struggle with this and find a way to incorporate keto without negative digestive consequences?

<comment><USER82> Tums and hydration will get you 90% of the way there. 10 months on keto so far :)

</comment></comment><comment><USER83> The observation that "no breakfast" is #1 way to lose weight by extending fasting period that includes sleep is pretty astonishing. Everything I have read says no breakfast is one of the contributors to weight gain.

<comment><USER70> Maybe I missed it, did he say what time of the day he does the weight measurements? Unless you do multiple measurements per day and take the average (as my fancy device does automatically), a single weight measurement should be done in the afteroon, ie after rehydrating and stopped the fasting of the night and early morning.

</comment></comment><comment><USER84> I've had weight graphs like that and the trouble always is that if you plot further instead of it being a flat line at a constant weight it bounces back up again. It's maintaining that's the hard part.

</comment><comment><USER85> I understand the principles and found the low-carb diets sound scientifically but I can't understand how eating a lot of fruits and potatoes would be bad for you from an evolutionary perspective.

</comment><comment><USER86> This is freaking genius. Kudos. I wish I could upvote this 1000x.

</comment><comment><USER87> I don't understand what exactly he did with the data and how the calculations indicate weight loss/gain.

Can someone explain, please?

</comment><comment><USER88> Lol bacon is associated with weight loss by 32%

</comment><comment><USER89> so i cannot give up rice. how much can i consume of rice/carbs per day and not mess up this balance?

</comment><comment><USER90> What about sex?

<comment><USER91> Well, you do burn a few calories, say, anywhere from 100 - 200 calories an hour depending on how active you are during the session, and like all exercise that gets your heart pumping there is some health benefit.

More interesting is what sex and orgasms do for your emotional well-being which is dependant upon your brain chemistry, if the sex is a positive experience (e.g. not forced) there is release of endorphins which affects cortisol levels. Simplified I believe this is how all exercise reduce stress. Cortisol levels will fluctuate throughout the day but chronically high levels are common for individuals too stressed out, that would be a real "starvation mode". The ways in which cortisol affects metabolic, but not limited to, processes in our bodies are intricate and many, it is very important to understand cortisol in regards to weight loss, overall health and emotional well-being.

</comment></comment><comment><USER92> In males, over time testosterone decreases which causes muscle mass to decrease. Building up the large muscles through resistant exercise or any exercise (eg, gluteus maximus -- thigh) increases the muscle mass. Increased muscle mass increases the basic metabolic rate (BMR) which is the number of calories consumed even while at rest, even while sleeping.

</comment><comment><USER93> Yeah. I has been downvoted into oblivion by saying almost the same things without any machine learning, just by observing eating habits and traditions of "village folks" in Nepal, India, Tibet and Sri Lanka where I have spent last few years.

The message was that traditional (evolved according to local food sources and seasons) unprocessed foods of Asian tribes is the most natural and healthy. Economic and habitat selection pressures implicitly works the same way as machine learning, for hundreds of years.

Visit any rural area and try simple folk's foods. They will be way healthier that any processed crap. The similar patterns could be notices really quickly.

</comment><comment><USER94> A couple a years ago I did keto for 8 months. During that time I lost 31 kg. While this diet was amazing for losing weight it really affected my concentration negatively, to the point where I was forced to drop the diet because it was simply interfering with my performance at work. It's a real shame though, as I've never been able to find a diet as easy and effective since.

</comment><comment><USER95> Ketosis is the greatest thing to ever happen to me. It has been life-changing for myself and many of my closest friends. I lost over 200lbs doing keto and it was one of the easiest, most ennjoyable things I have ever done in my life.

Keto is absolutely amazing and life-changing. I encourage everyone to try it.</comment>


Ask HN: Do you regularly apply for jobs even if you are well/happily employed? - <AUTHOR> I wonder if it's just me or others also regularly apply for new jobs just to see what's out there?<p>Three reasons why:<p>- Know if I still employable<p>- Keep myself sharp with my interview-fu<p>- Eventually land in a new and better job.... <comment><USER2> No. Although, the last bullet point you have listed may give you an idea of how satisfied you are with your current job. I used to regularly apply for jobs, but I finally found a position that I don't feel that urge. I'm getting competitive pay, I am well appreciated, and I enjoy the work. It also affords me a hobby where I can have fun outside of my work day (and invest in side goals). Personally, that is all I'm looking for at the moment. So you searching for jobs may indicate that you (perhaps unknowingly) are dissatisfied with your work on some level. YMMV.</comment>


Fitbit paid just $23M to get its hands on Pebble - <AUTHOR> https://www.axios.com/fitbit-paid-just-23-million-to-get-its-hands-on-pebble-2278920086.html <comment><USER2> They overpaid. What tech is Pebble pushing that Fitbit didn't implement already?

If they were willing waste 23M they should have just given coupons to all the Pebble owners to upgrade to Fitbit.</comment>


Thanks PG, applying to Y Combinator cost me a shot at my local startupfund - <AUTHOR>

After being turned down by a local startup fund in Canton, OH (which is being ran by a statewide accelerator program) I enjoyed the spirited 45 minute conversation I was having with the investment analyst  who was in charge of turning down my application, and listening to his reasoning on why I was not even eligible to EVEN PITCH my concept to the local commission who decides who receives funding .
Let me set the table for the story, I applied to the fund  September 30, and was contacted by the analyst (who shall remain nameless),  after having a brief talk about my idea, he told me to send in an executive statement. During this conversation I also told him I was applying to Ycombinator (which turned out to be a mistake lol).  I had never made an executive statement b4, and after just finishing up my ycombinator application, I couldnt help but feel an executive statement for an early stage tech start up is a  huge waste of time. But I still spent much more time then I could afford (law school full time/ as well as developing a company), because the $25,000 the fund was offering would be a welcome addition to our start ups financial situation (besides being funded solely by a poor graduate student). 3 weeks after sending the executive statement in as well as a follow up email trying to verify he had received my message, I had yet to receive any sort of reply. So I contacted the accelerators offices, and eventually was able to get in touch with the financial analyst over the phone. After not initially remembering who I was, and having to check to make sure he had recieved my emails (he did), and after briefly visiting my beta for the first time, he told me that my website was not at a point where it was elible to recieve funding. My idea failed for several reasons, which I would like to discuss more fully below.
1. I applied to Ycombinator- part of the start up funds conditioning on recieving investment is that the company must stay in Canton, OH for the next 10 years. My application to Ycombinator 3 month program showed that I wasn't dedicated to staying in the area, and was a major part of his reasoning on passing on  my application to pitching to the start up commission.  I found this entertaining on several levels, and apparently my points listed below couldn't convince him.
        1. There aren't a lot of people who would question my dedication to my hometown. I have lived here my entire life, including while finishing my under grad degree at Mount Union University,  and while pursuing my Law degree at The University of Akron, not to mention locating my start up here.
        2.  The odds of getting accepted to Ycombinator are between 1-3%, horrible odds no matter how you look at it, I'd consider anyone applying who places their start ups future on getting accepted a pipe dream. So I didn't, after my application I continued building my company and working on my product, business as usual. So I find it funny that a potential investor would take my APPLICATION to a program he knows to be a long shot,  as a definitive signs that I would leave the area.  If accepted to Ycombinator it would be a tough decision for me to make on whether or not I should relocate to the Valley full time, but this is a road I haven't crossed yet, and I'd appreciate if someone who understand the ycombinator process (he knew about the program, the analyst is originally from The Valley) would be able to understand this, and at the very least not throw my application to his program out the window just because I applied to another potential fund.
2. Uniqueness- according to him my idea wasnt unique enough. After outlining several ways in which my product was unique from the competition, and outlining areas where I believed our start up had a significant advantage. His reply was, whats to prevent one of you major competitors  in the social media field from adopting your idea, and at this point I knew he had no idea what he was talking about. If my idea is unique enough to where major competitors in the field would try to adopt it, then I suppose its at the very least unique, and potentially a market that my competitors would be interested in acquiring us or by competing with us.
3. lack of market validation- according to him my company wasnt suitable for the start up fund because it lacked validation, after all when he visited my beta for the first time I only had 4 members  who have joined the site. I explained to him that currently my start up is in stealth mode, and the "members" accounts are there simply for testing. He couldnt understand the concept on why a start up would want to remain in stealth mode(or at least how his fund couldnt invest in a company still in stealth mode), and without market validation they couldnt tell if the idea whether the market would accept it.  He couldnt distinguish between a startup that had launched, and one that was simply an idea, prefering to place my site in the latter merely because of a lack of market validation.   At this point I began to get slightly agitated. If you work for a start up fund, and are unable to invest in ideas that have yet to been released, or had significant market validation, good luck. Good investors/entrepreneurs  are able to make a living because they don't need market validation everytime they evaluate concept,  if they did they would have much more difficult time making money, because by the time the market has been validated its either to late or much more difficult to enter it, the competition being more formidable.
There's a reason the valley has had a stranglehold on the tech innovation that has been changing the world. Its because outside of the valley, this is the shit the future entrepreneurs deal with on an every day basis. <comment><USER2> You were turned down by one program? You sound really bitter and I can see why they turned you down - you're not ready to be an entrepreneur. As a person running a start up, you're going to get turned down A LOT. So what if YC or TS or any incubator/fund is accepting 1%? You try. You try again. You keep trying. As a woman founder, I face much tougher numbers. I don't stop because the numbers are stacked against me! I keep trying. I figure out ways to monetize without funding. I get feedback on how to be better. When someone tells me an aspect of my product is crap I consider it and improve. I don't write out rants about how someone else was to blame. And yes - YOU NEED MARKET VALIDATION. If you can't prove that people will use your product, why would someone invest in you. This isn't 1998.

<comment><AUTHOR> Sorry If I may have came off as an ass with the post. The point I was trying to make is that I truly didnt get any feedback on my product, besides the point of lack of market validation. IN my executive statement I sent a link to my beta, which he didnt visit until I was on the phone with him. Market validation is important, but I feel that id you have a functional beta as well as a concept or plan the least you can so is go through it b4 saying lack of market validation is the end all be all.

<comment><USER2> I rarely see a VC or incubator read the entire statement or much less click through to a beta. They care about numbers. You could have the next Google or FB but if you can't show that people will (or are) using it then what's the point? For me, I had to do an alpha test w/75 users and I have hundreds in my private beta and have tons of articles and market research to show traction and I still get questions about "enough traction". Just think about it from the VC perspective: "How much am I going to get back on my return" That's ALL they care about. That's all they should care about. Plus, its not up to them to give you feedback. You need to get people on your product and ask them for feedback, iterate based on their feedback and then start shopping it around to people in your space and get their feedback. After that, you go to investors.

</comment></comment></comment><comment><USER3> You didn't apply to a startup incubator. You applied to a local vanity project.

Local/city governments all over the world are trying the "incubator" fairy dust in an attempt to seem hip and with the times. The "analyst" you spoke to is really a gatekeeper trying to filter out any project with a bit of risk (or any possibility of outsized success). What they're looking for is zero risk, guaranteed small-time success which officials can point to and say "see, we're entrepreneurial and digital!!".

On the other hand, if being rejected by third tier "analysts" gets you this down perhaps business isn't for you.

</comment><comment><USER4>
      His request: he told me to send in an executive statement
      Your response: an executive statement for an early stage tech start up is a huge
      waste of time

      Fund's requirement: the company must stay in Canton, OH for the next 10 years
      Your response: apply for funding outside Canton, OH

      His response: according to him my idea wasnt unique enough
      You need to refine your pitch

      His response: lack of market validation
      four people isn't validation. Even in stealth, you need to get a number of people
      using your product. You need a revenue model, you need people using the service
      to tell you what needs to be improved. Your idea may not be easily marketable and
      clients are going to give feedback on what works better for them.

      His question: why a start up would want to remain in stealth mode
      Your response: I began to get slightly agitated

Regardless of your opinion of what he knows, he's the one with the money that you're trying to get. Telling the guy with the money that he doesn't know what he's doing isn't going to get him to write that check.

Refine your pitch, adjust your attitude, get some market validation and paying customers and approach other funds or bootstrap until someone notices you.

<comment><USER5> Is the norm to build and test until you have a live system where users have been using it over many iterations of feedbacks and alterations before approaching investors? At earlier stages than that is generally a bad idea to approach them? Thanks.

</comment></comment><comment><USER6> What part of this is PG's fault?

<comment><AUTHOR> None of this is PG's fault. I only made that the title of the post, because the financial analyst I talked to said the local fund I applied to said one of the reasons I wasnt eligible is that I applied to YCOMBINATOR. I meant this as a post to show whats wrong with the start up scene in most of the country. I feel that PG and ycombinator are part of the solution not the problem

<comment><USER7> Please revise the title to something like "having applied to YC was one of the reasons another fund turned me down".

It'd be fair to say it wasn't the only reason.

</comment></comment></comment><comment><USER8> Unless you get _accepted_ by YC or any funds, there's no reason to mention them in the first place.

It's like trying to hit on a girl and saying, "I also met this other chic I liked ..."

</comment><comment><USER8> I don't really feel bad for you. Try again.</comment>


Worst. Apple. Keynote. Ever - <AUTHOR> https://www.youtube.com/watch?v=PsBVyUDs-84 <comment><USER2> Favorite quote:

"But what Jeff (Goldblum) doesn't know and what Michael does know is that a Macworld crowd is not a tough crowd at all. They're basically teenage girls at a One Direction concert."

</comment><comment><USER3> hahahha i'm gonna spread this around</comment>


Every C99.php shell is backdoored - <AUTHOR> http://thehackerblog.com/every-c99-php-shell-is-backdoored-aka-free-shells/ <comment><USER3> The whole thing _is_ a backdoor. Backdoor in a backdoor? Surprise! Of course it's backdoors all the way down ;)

But of course, script kiddies aren't particularly good at securing the servers they pwned, are they? [1]

A couple of months ago, I wrote QADE [2] for fun, a "quick and dirty" PHP- based text editor and webshell for editing files and running commands remotely. I deliberately failed to implement any authentication-related feature, because I didn't want to give an illusion of security. A secure webshell is an oxymoron.

[1] [https://blog.avast.com/2014/06/09/are-hackers-passwords- stro...](https://blog.avast.com/2014/06/09/are-hackers-passwords-stronger- than-regular-passwords/)

[2] [https://github.com/kijin/qade](https://github.com/kijin/qade)

<comment><USER4> What about putting it behind https and use basic http auth? If it's only for you you can always have a self signed certificate.

<comment><USER3> That's exactly what I do with my own installation of QADE on my dev box. The README on GitHub recommends others to do the same, since it's pretty much the only way to make QADE secure.

</comment></comment></comment><comment><USER5> Why would anyone who's not completely insane install anything like C99 in the first place?

Not only is the idea completely nuts, but all Google produces for C99shell is how it's used in backdoor tools.

Surprises: Zero.

<comment><USER6> Apparently it's mostly used by script kiddies who compromise someone else's server and install it.

<comment><USER7> Well, I hope someone tells them their backdoor has been compromised.

</comment></comment></comment><comment><USER8> In all my years of writing PHP code I have yet to find a legitimate use case for extract() - PHP should have gotten rid of it generations ago.

<comment><USER9> You can use it to pass a bunch of variables between functions, without having to constantly get them from an array.

        function qux() {
          return compact('foo', 'bar', 'baz');
        }

And in the other function:

        extract(qux());

You can have one "preparer" function that works on the data and sets up the variables, then several others that work on it, and all call the same preparer. Or the reverse.

Obviously you can do the same thing by just passing arrays but sometimes a simple variable is easier and less cumbersome.

<comment><USER10> ... and to think that my contempt for PHP couldn't be increased.

Wow. This is the anti-Scheme. It's like they took everything good in language design and decided to do the exact opposite. "Let's make a function that has the side effect of introducing variables into scope. That's a great idea."

Oh, Bog....

<comment><USER9> > This is the anti-Scheme.

Since when is Scheme the arbiter of what is good or bad?

PHP lets you do this, or not do this, your choice. Like C, PHP doesn't tell you what to do, it's up to you.

That's why people actually use it.

<comment><USER11> Exactly, what's wrong with a double clawed hammer?

Use it or not, if you don't like it you can smash stuff with the triblade screw driver. Or the 7 point socket wrench.

PHP provides a wealth of very useful tools that you can choose to use or not. I don't know why people think my 7 point socket wrench is dumb, it works quite well to round the edges of 6 sided bolts and saves a lot of money on buying those special bolts that can't be removed once tightened.

<comment><USER9> If this is the quality of the argument then I have nothing to concern myself with.

Your post might be [slightly] humorous, but as an argument against PHP language constructs it fails miserably.

<comment><USER12> It really doesn't. Especially when you see people pulling out the double claw hammers at your company.

Features that have limited real benefits with lots of risk get abused all the time. They are the retarded tools of the world creating technical debt for everybody else and they should be retired.

Extract is one of the stupidist language feature conceived precisely because it puts something so ripe for abuse into the hands of idiots. It even has a simple name that practically encourages its abuse.

<comment><USER11> Yup, then you see people building sine wave roads for the square wheels they build last week.

Or making critical parts of infrastructure work by a cron job that calls wget.

For some reason PHP needs extract, because a dictionary just won't do.

      foo["var_x"]

      // for some reason needs to be:

      $var_x

<comment><USER13> I think you mean catenaries, not sine waves.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> I have only every seen the c99.php shell used by script kiddies which utilizes some well known php vulnerability and uploads this as the control point.

It would be cool if somebody wrote an automated script which would seek out these c99 and try to identify those which are used on hacked sites. It could then use this to get access and remove this script and fix the original exploit.

Using exploits to help people is of course a can or worms but I like the idea of good hackers helping everyone.

<comment><USER15> Please don't do this. Max Butler did that to DNS in 1998 with patching bind (plus a backdoor). He went to prison 18 months. Then coming back out, he ended up doing carding and back to prison.

[http://www.securityfocus.com/news/203](http://www.securityfocus.com/news/203) [http://en.wikipedia.org/wiki/Max_Butler#FBI_investigation.2C...](http://en.wikipedia.org/wiki/Max_Butler#FBI_investigation.2C_guilty_plea.2C_and_sentencing)

<comment><USER7> Fixing a broken BIND and then installing a backdoor is a much different kettle of fish than just writing a worm that fixes the bug and then walks away.

That said, I would agree completely that it's very legally dangerous. If it's not yours, don't mess with it!

As an academic matter, I think such a worm _could_ end up being socially useful, _if_ there are enough compromised machines _and_ the people running them are sufficiently incompetent _and_ those machines are being used against other people _and_ you can be sure that your fix doesn't break something else _and_ the machines just won't get re-compromised again next week. That's too many conditional clauses for me, but maybe someone else feels like taking one for the team.

Legally: again, don't do it. It's not yours.

</comment></comment></comment><comment><USER16> I'm actually disgusted to see how many people use extract in bad ways! As some others here have mentioned, I've never found a legitamate reason to use extract - and the php documentation clearly mentioned not to use it on input data.

Example: [https://github.com/search?l=PHP&p=1&q=extract%28%24_GET%29%3...](https://github.com/search?l=PHP&p=1&q=extract%28%24_GET%29%3B&ref=advsearch&type=Code)

Yuck...

</comment><comment><USER17> Cached version:

[http://webcache.googleusercontent.com/search?q=cache:http://...](http://webcache.googleusercontent.com/search?q=cache:http://thehackerblog.com/every-c99-php- shell-is-backdoored-aka-free-shells/)

</comment><comment><USER18> Got confused for a minute. Why the hell call your shell after a C language standard? Also, the term "shell" is terribly overloaded nowadays.

</comment><comment><USER19> > due to a vulnerability in the extract() command

No.

This is due to insane usage of the extract() function. Not a vulnerability with the function itself.

You can pass user-supplied input directly to plenty of other functions which have equally idiotic outcomes, it doesn't mean that they have vulnerabilities, it means the author is a liability.

<comment><USER20> Right, didn't mean that in the original post - obviously this is how the function is designed to work. Fixed up the wording to clarify.

</comment></comment><comment><USER21> After reading these comments I am intrigued. Whenever I have used PHP I pretty much always run extract three times:

        extract($_GET, EXTR_PREFIX_ALL|EXTR_REFS, 'gVar');
        extract($_POST, EXTR_PREFIX_ALL|EXTR_REFS, 'pVar');
        extract($_COOKIE, EXTR_PREFIX_ALL|EXTR_REFS, 'cVar');

It makes working with get/post/cookies much easier. All variables are extracted with a prefix... so:

[http://www.yyy.com/script.php?hello=world](http://www.yyy.com/script.php?hello=world) Results with: $gVar_hello being the variables holding 'world'.

Is this poor form?

I previously used: `import_request_variables` - but thats been sidelined.

<comment><USER22> Why is using $gVar_hello easier than $_GET['hello']? Also $_GET and friends have the benefit of being super global.

<comment><USER21> It is easier to use in strings, `$blah = "hi $gVar_hello"` rather than $blah = "hi {$_GET['hello']}";`.

Not that it is a massive deal... I guess I just got in the habit when I was younger. Like I said, I always used import_request_variables (with various prefixes).

\----

But back to my question - is it bad to use like I have?

<comment><USER23> First: this could result in:

      echo $blah; // hi <script>alert('foo');</script>

But maybe it's just because you posted an example...

Second: it will double the memory used.

Third: you can't use the variables global anymore

<comment><USER21> Like you said, I wouldn't use it without first cleaning the input. I guess I use it more out of habit and preferring a straight variable to an array... just feels neater.

Good point on the memory, but I wouldn't think thats a big issue. I haven't tested right now, but I dont remember ever having issues using the $_GET variable after exporting? Not sure if thats what you meant.

<comment><USER24> If I am not mistaken, PHP is copy-on-write, so if extract just copy value then memory usage wouldn't be doubling.

</comment></comment></comment></comment></comment></comment><comment><USER25> A tool that's pretty much only useful for hacking is backdoored? Heaven forbid!

How is this even news?

</comment><comment><USER26> I think the trouble is now, if this was just released, is that you can easily google for c99.php and find vulnerable servers with this file hosted on it, from pre-existing backdoors/phishing hosts, or what have you, and this allows anyone and everyone to use it, not just the original person who placed the backdoor. Which, I suppose, kind of enhances the problem exponentially.

As far as I'm concerned though, Google and Firefox's malware checker engines should blacklist any domain that has the c99.php file located on it and block their webbrowsers from connecting to it in the first place.

Of course - correct me if I'm wrong here.

<comment><USER27> actually, google is pretty far ahead of this. trying searching allinurl:c99.php, most of the returns are actually about the script.

</comment></comment><comment><USER28> this is pretty bad:

[https://www.google.com/search?client=ubuntu&channel=fs&q=all...](https://www.google.com/search?client=ubuntu&channel=fs&q=allinurl%3Ac99.php&ie=utf-8&oe=utf-8)

</comment><comment><USER29> The only reason you have C99 on your server is because you've already been hacked. Its' one of the oldest shells used for backdooring a hacked site - <USER2> rarely see it anymore because there are much better shells now.

</comment><comment><USER30> So... what's the best way to tell if C99 is "installed" on your server(s)?

        grep -Ri c99 /path/to/htdocs

would be my guess

<comment><USER31> There are thousands of variations of C99 used by various 'hackers'. Many of which are obfuscated (base64, gzip, other more obscure encodings). Generally, searching for a combination of 'base64_decode', 'gzdecode', and 'eval' will find a great deal of them. Others may require more manual inspection. Just searching for 'eval' alone tends to find a lot.

There are a few tools floating about that try to use a more signature-based approach to searching, and clamav has some signatures for the shells, but they can be hit-and-miss, as the obfuscation often changes.

</comment></comment><comment><USER32> Is the C99.php shell any popular? This is such a classic exploit of `extract()` that it seems like very amateurish job. If they even use this function at all I imagine the rest of the script is not that secure either.

</comment><comment><USER33> I just deployed a lot of these for fun on Heroku. Really interesting stuff. [http://php-c99.herokuapp.com/](http://php-c99.herokuapp.com/)

</comment><comment><USER34> I thought everyone knew this already ~10 years ago...

</comment><comment><USER35> Is this a joke?

</comment><comment><USER36> Founder of [https://commando.io](https://commando.io). It is utterly frightening that anybody would consider using c99. If you're interested in a parallel SSH web-based interface, check us out. Commando.io does not provide an interactive shell, but instead operates through pre-defined scripts we called recipes (written in shell, bash, perl, python, ruby, go, or node.js). Recipes are fully versioned, and we keep a full audit trail of all executions run on your infrastructure.

<comment><USER37> Are you recommending us to use your software on servers that we compromise?

<comment><USER36> Absolutely not, recommending Commando.io for anybody looking for a web-based SSH interface for servers they rightfully manage.

<comment><USER38> ;)</comment></comment></comment></comment>