Hacker News new | ask | show | jobs
by onedognight 1681 days ago
I use it regularly. Sometimes it’s broken, and maybe nobody notices but me? :)

Their natural language queries for things that I know they know about are amazing. Here are some that I have used recently. You really need to see these results to appreciate them.

I wanted to know how tall my daughter might be.

   8 year old female 55 lbs
http://www.wolframalpha.com/input/?i=8%20year%20old%20female...

I wanted to know the nutrition content of an egg sandwich.

   1 egg, two slices whole wheat bread, one slice of cheddar, two pieces of bacon
http://www.wolframalpha.com/input/?i=1%20egg%2C%20two%20slic...

I was curious about the relative usage of two names over time.

   Michael, Henry
http://www.wolframalpha.com/input/?i=Michael%2C%20Henry
7 comments

Also a frequent WA user. I use it for things I could calculate, but are much faster to just ask in plain text.

How much that cloud instance really costs

  $0.03/hr * 1 month
Bandwidth calculations for hosting providers

  10 TB per month in Mbps
you might want to try units(1).

https://www.gnu.org/software/units/units.html

the input language is less flexible than wolframalpha/google, but i quickly got used to it. it's nice to have something local and reliable. you can also define custom units.

i prefer using it in terse mode:

    $ units -t 0.03$/hr*1month
    21.914532 US$
    $ units -t 10TB/month Mbps
    30.421214
qalc[1] is also quite nice if you're looking for a command line calculator; it handles units well, but has some other fancy features, and has a very lax parser which i find to be a huge plus.

    $ qalc '0.03$/hr*1month'
    error: "r" is not a valid variable/function/unit.
    (0.03 × (USD / hour)) × (1 × month) = $21.915

    $ qalc '0.03$/h*1month -> CAD'
    (0.03 × (USD / hour)) × (1 × month) ≈ CAD 27.28388011

    $ qalc '10TB/month -> Mbit/s'
    10 × (terabyte / month) ≈ 30.42056430 megabits/s

    $ qalc 'integrate(x+x^2)'
    integrate(x + (x^2)) = x^3 / 3 + x^2 / 2 + C
[1] https://qalculate.github.io/manual/qalc.html
Units advises there are 118.20896 smoots per furlong..
Wouldn’t that be properly expressed as 118 Smoots plus 5 Ears?
people still measuring in smoots smh
For calculator problems like that, I use J:

   */ 0.03 24 30
21.6

   1e6 %~ (10e12 * 8) % */ 30 24 3600
30.8642

Usually requires some massaging, but still takes seconds.

While APL dialects are very nice for this sort of thing, they generally don't understand units of measure or know about physical constants; you have to put those into them yourself. Here are some of my recent units(1) queries:

    141 pounds force 30 mm  # in joules
    1160/4
    log(3)/3/(log(2)/2)  # how much more efficient is one-hot ternary than one-hot binary?
    5V 7 μs / 7.3 A
    .0117% half avogadro mol / 1.251e9 years / (potassium+chlorine)g  # how radioactive is lite salt?
    3.27$/gallon  # in $/liter
    sqrt(2 2000 electronvolt/electronmass)
    18.8 foot pounds force # in joules
    163$/(7.9 g/cc * 1500 mm 3000 mm 3.2 mm)  # cold rolled steel price is higher than steel sold by weight
    m3/4 / 15 cfh
    2 pi sqrt(200 um / gravity)
Julia is also excellent for working with units (Units.jl, IIRC).
Unitful.jl
Yeah, it's great for these types of things. It also has a bunch of values built in, so you can do things like:

  (day length of jupiter) * 80
Same here, the way it seamlessly wrangles even the most ridiculous combinations of units is insanely useful. Just yesterday I used it to calculate power consumption for a house by timing one of those spinning wheel meter things. Something like "(10 rot / 46 s) / (375 rot / kW*h)" and it gave me straight answer in watts.

I definitely could've worked that out by hand, but it would've taken a minute or a few, mostly on unit conversions. With WA, I can just think in variable relationships and not worry about units at all.

Don't get me wrong, it often returns complete garbage, see all the memes of Siri passing non-math questions to it. It's annoying to figure out or explain to someone because the syntax is very loose and you just kind of need to get a feel for it, but once you do, it's really powerful.

I use Google for those pretty often.
I do the same for basic calculations. I was surprised things like 9:00 EST in CET don‘t work in google search, but do in WA.
You are absolutely right. I misremembered. Using GMT does indeed work only on WA:

9:00 GMT-7 in CET

https://www.google.com/search?channel=fs&client=ubuntu&q=9%3...

https://www.wolframalpha.com/input/?i=9%3A00+GMT-7+in+CET

Google handles GMT and UTC but doesn't handle offsets from there and, frankly, it's understandable and I wouldn't bother either. What it does handle though is countries and their DST settings:

> 9:00 UTC in Thailand

Ohh does WA respect time zones in searches?

A regular complaint I have with google is (simplified example) converting EDT to MST. Google will “helpfully” correct me and convert EDT to MDT instead, which is explicitly not what I asked for. It’s stupid (I can usually figure it out on my own) but that would be a huge win for me.

You also might want to try google search. They display calculations for these particular queries and quite a few more.
Google is also often wrong. For example, my computer is set to US English, as is my profile. Yet somehow it still gets confused on decimals and commas (they are switched in my current country’s locale).
Also, if you use the Firefox search bar only the first 20 chars are sent to google, so longer calculations are truncated before they're calculated and wrong answers come back with no warning. Not a Google problem per se but a risk of using Google to calculate still.
or frink [1], which started off as a tool like the others mentiond here, but is now a full fledged units-based programming language. See some examples of them here [2]

1: https://frinklang.org/ 2: https://frinklang.org/#SampleCalculations

Its been on HN before.

The sandwich example was brilliant! I never expected that to be possible (the example of packing smaller circles in a larger one in another comment is also brilliant but less useful for me today I think.)
Just asked a friend about this:

> 1 egg, two slices whole wheat bread, one slice of cheddar, two.. leaves of lettuce ..

and he said it's wrong and useless (!) - giving me examples and numbers as:

protein assimilability from bread is 40% etc.

Is there a way to get correct answers from Wolfram regarding this ?

(assimilability of doesn't work)

Edit: Excuse me, what's wrong with you downvoters - it's a legit question. Or is there something wrong with assimilability? Are you happy being off with your answers by 60% - or jealous that a human can have better answers?

Wolfram isn't reporting how much protein you'll get from eating something; it's reporting how much there is in the bread. Protein assimilation depends on a huge range of factors, and varies significantly between individuals (based on everything from gut microbiome to health factors to how much you chew your food to your saliva production to... Well, it's a long list). There's no way a website could report the amount of protein you will get from bread. Reporting how much is in the bread makes much more sense. It's a shame your friend didn't explain that.

This is something that actually annoys me immensely when people say "you eat too much!" to fat people. Two people can have the exact same diet and the exact same exercise regime, and if one assimilates particular foods more effectively they'll be getting more calories, and put on weight. Food intake is far more complex than many people believe.

>This is something that actually annoys me immensely when people say "you eat too much!" to fat people. Two people can have the exact same diet and the exact same exercise regime, and if one assimilates particular foods more effectively they'll be getting more calories, and put on weight. Food intake is far more complex than many people believe.

I don't see why that statement is inaccurate. It's not "you eat more than me" but "you eat too much." As in you eat too much versus how much your body is able to burn of the calories it assimilates.

The problem is that it is usually presented as a "simple" solution. "Just eat less. Reduce your food intake until you're at a calorie deficit". For some people, that can mean eating three small, but satisfying meals a day. For others, it can mean eating extremely strict rations for only two meals a day, leaving the person constantly hungry and cranky. Then it becomes a will power issue, which as we all know is a function of brain energy reserves (right, we all know that, right?!). Throw in a mentally challenging job versus just phoning it in and it's really not actionable advice.
I agree that a dramatic change is very difficult and the level of difficulty varies from person to person. However, obesity is probably one of the worst long term health predictors. If it leads to diabetes, almost all outcomes get much worse. The change is worth the difficulty.

For me, I quantified what I was eating and simply reduced it a bit by careful tracking. I also did quite a bit of relatively low heart rate exercise and did do some shift of the calories away from carbs. I also identified some intake that was purely habit and not sustaining, like late evening snacks, and eliminated or modified those. Lost 35 pounds in a few months. It may take a while, but the math works over time. It is relatively simple, but it is not easy. I kind of turned it into a game and that helped a bit. At any rate, I wish anyone who decides to try the best of luck.

It's a willpower issue for 3 days, the time it takes for your stomach and appetite to readjust to a lower volume of food intake. Anyone who's fasted knows how easy skipping meals is--it's certainly not the agonizing test of willpower you and many nonfasters seem to think it is.

And by the way, if diet and exercise are not the path to weight loss, then what is?

You also don't need to eat that much less if you're at a stable weight. 10% less a day means you lose a pound every 1-2 weeks. In my experience people seem to not like it when you tell them, after they ask, that you lost weight simply by eating a bit less every day consistently for a year.
Diet and exercise are indeed not the path to weight loss. This is well known: most fad diets work this way in some fashion or another, and it’s well known that most fad diets fail.

Since it touches my field, physics, why people have this misapprehension, (“a calorie is a calorie” is an attempt at a thermodynamic statement) I feel somewhat qualified to talk about part of this even though I am not an endocrinologist or a nutritionist, they would have better answers for you in many other respects.

Thermodynamics is necessary but not sufficient to understand the problem. There are many physical problems with ending the explanation there.

The first is that it ignores equilibrium. So, the claim is that I can diet and exercise down to the weight that I want and then return to the lifestyle that I had before but maintain this new weight. That is, when you say diet and exercise you are talking about temporary interventions and no temporary intervention is going to permanently disrupt the equilibrium. Put another way, most people calculate a basal metabolic rate or total daily energy expenditure at their present weight, and leave it at that. If you're a physicist, you start to want to calculate it at two different rates, you want to see the slope between the two, so you get units of kJ/s/kg, but a kg of fat also maps to a certain number of kJ so this is actually a time constant of something like a year—some crude differential equations then suggest that the time constant is something like the half-life of your weight, so if you start living like someone who is 50 lb lighter than you, after a decent chunk of a year you will be 25 lb lighter, then 37.5 lb lighter after another... Basically just that we regress to a weight set by lifestyle. So the focus on an intervention is wrong. Instead one needs to focus on a whole lifestyle shift. You need to focus on setting a new equilibrium, not on burning calories.

But this is a really crude model and that gets into the second point, which is that you are assuming that the system is linear, like an electronic circuit made only out of inductors and capacitors and resistors. The problem is, it is not, it is in fact a complex system of feedback loops braided together. Picture’s worth a thousand words here,

http://biochemical-pathways.com/#/map/1

You know, that thing.

Once you have feedback loops, there is no guarantee that changing the input voltage to an electronic circuit by 10% will reduce some voltage observed inside the system by 10%. It might, it might not. Changing a complex system requires a fundamentally different approach. Often to change one output, the entire system needs to be reconfigured.

As a direct consequence of this, it turns out that most people who go on diet plans hit “the wall.” At the wall, the feedback loops in your body are downregulating your basal metabolism and your perception of available energy. They are jacking up hormones that make you hungry, and also inducing you to wear more sweaters and other such things. They impel you to have “cheat days.” Part of the cause of this may be that your body does not know how to burn just fat. If your body runs out of energy it starts burning everything, both fat and muscle, to make that energy. As a result if you don't target your exercise and diet to build muscle, losing weight quickly actually can maybe drop your lean muscle mass, and your body is reacting to this global damage by telling you that you're sick, because you are. At least, that's one explanation I have seen, I am not a doctor and do not have any qualifications in this way. For all I know, maybe the body is using your fat to try to sequester some sort of toxin or pollutant from the environment, and suddenly dropping the weight releases all of this crap into your blood and that's the reason that your body suddenly wants to put on weight again. Don't ask me these questions

These sorts of feedback loops are why I would recommend listening to endocrinologists, the endocrine system is a signaling system in the body, so these people are very keenly aware of all of these feedback loops and how they reinforce each other. In his recent Metabolical, Dr. Lustig, a research endocrinologist, suggests that focusing on weight for health outcomes is actually totally backwards anyway, that there are more thin sick people than fat sick people in terms of absolute number, and that sickness should come first and wait is probably just a symptom that some people don't express. He gives some better advice about the benefits of healthy eating—studies where they kept calorie consumption and weight the same, and demonstrated huge improvements in health markers, simply by switching out sugary kid food for starchy kid food. Stuff like that.

The insight from complex systems is that telling people to focus on diet and exercise is deeply blaming and that blame might drive shame spirals that are causing the problem in the first place, which is again where I have to step back and hand the problem over to psychologists this time. Viewed this way the problem is that you have an unhealthy relationship with food, and it is unlikely that telling you to diet and exercise is going to magically make it a healthy relationship with food. Mindfulness exercises while eating could for example be a better option. Telling people to eat when they are hungry, but they have to put it on a plate and sit in a dining room and put away their phone and enjoy the food with gusto and stop when they are full: this might help with these binges.

I mean, I could say the same thing about quitting cigarettes. I absolutely realize it’s hard to do, and that’s why so many people still smoke. But my advice would be the same...
The problem here is that you think you're giving people advice when really you're just telling them what to do. The difference is that advice comes with kindness, compassion, an understanding of how the advice is affected by someone's situation and context, and deep knowledge of the subject you're advising about.

Equating changes to diet for weight reduction to quitting cigarettes shows you probably don't have that.

... and that is also extremely bad advice. There is very wide variability in how nicotine addiction affects different people. Some people can quit after a pack-a-day habit and have no problems. Some people have trouble with getting off a pack-a-week habit.

Someone who is having extreme difficulty quitting smoking could benefit from working with a doctor to discuss quit-smoking aids or even seeing a therapist to work through their addiction.

No shit, the person needs to "just stop". Way to point out the obvious. Most people don't have a "just stop" button.

IDK, maybe you're just bad at giving advice. Maybe you should just stop.

EDIT: this is seriously an article on The Onion in the making. "Nation wakes up to random forum poster telling them to 'just eat less'. Obesity epidemic ends overnight." The proof is in the pudding here. Telling people "just eat less" is shitty advice.

Cravings go away, saying to just eat less can be telling somebody they have to be hungry for the rest of their lives.
Except it is as I see it. The goal is to eat less and to achieve that you need figure out what you can eat less of that will make you still feel fed. Sure it doesn't apply to everyone but nothing does.

For example, for me, 600 calories worth of chips will keep me feeling fed for an hour or two. 600 calories worth of pure brisket can keep me feeing fed for 8 hours. You can guess which I tend to eat more of when I'm trying to lose weight.

edit: Also if you're at a stable weight then we're talking 10% less food per day and not 50% less.

For that to be true the base metabolic rate would need to be vastly different between individuals. While it is true that there is significant variation (according to Wikipedia more than 100%), most of that variation (60%) seems to be explained by differences in lean body mass, which is the other side of loosing weight, exercise. From those results I would argue the is little evidence that some people would have to cut dien to almost nothing while others could almost continue eating like before
> it's really not actionable advice.

It really is though. It is hard and requires discipline but it’s actionable.

So you're saying that "fat people eat too much" is a statistically inaccurate statement?
I'm saying that someone can eat what is defined as "a healthy diet" and still gain weight.
Not if "too much" is relative to their physiology. How much is too much varies for each person.
>protein assimilability from bread is 40%

This is wrong; the digestibility of gluten is 80-90%. Your friend was probably thinking of the PDCAAS, which is more like 45 for gluten. But this is nutritional quality vs an egg white equivalent as defined by the bioavailability and concentration of essential amino acids (egg = 100 by definition; the score is based on the lowest fraction of any EAA, so gelatin — no tryptophan — has PDCAAS 0), not the fraction absorbed or utilized. For an idea of what utilization looks like see e.g.:

https://mdpi-res.com/d_attachment/nutrients/nutrients-10-001...

> The net protein utilization is profoundly affected by the limiting amino acid content—the essential amino acid found in the smallest quantity in the foodstuff. It is therefore a good idea to mix foodstuffs that have different weaknesses in their essential amino acid distributions.

> The limiting amino acid for wheat is lysine.

From what I gather, you still can process all of the protein from wheat if you get lysine from somewhere else:

> A vegetarian or low animal protein diet can be adequate for protein, including lysine, if it includes both cereal grains and legumes.

This also means that any statements about protein utilization from compound meals are more-or-less bogus if done without calculating the different amino acids.

It might help to explain what your friend says is “wrong and useless” so others could provide feedback.

It also might help to avoid insinuating things about strangers online in order to promote discussion and not stifle it.

Downvotes start to happen before my excuse. I've payed with karma and got an answer. Thanks for your human feedback.
its not karma, its hn community conformity points
You can improve the protein assimilability of bread by combining it with a high-lysine protein (and I'm not sure but I think eggs and cheddar might fit the bill) but you may not care if you're looking for low-glycemic-index low-fat calories rather than amino acids specifically.

I don't know what's wrong with the downvoters.

It seems that Wolfram Alpha also has some difficulty figuring out whether I'm talking about raw oats or cooked oats, even when I use the word raw in my query. As a result, it can be off by a factor of 3. I agree that it's not useful if you have to carefully check the output every time.
I would expect it to work properly with the word oatmeal.
Yeah; I use it for the occasional repeating specialized query, but have never broadened my usage to anything more-general.
> You really need to see these results to appreciate them.

Seems more like the quality of the queries rather than the results. Many of the complaints I see about google and friends is related to them dumbing down search for the global common denominator.

I really struggled with the "natural" language queries for this: https://www.wolframalpha.com/input/?i=+new+south+wales+covid...

Any advice on rephrasing it to work would be welcomed. Downside to allegedly natural language query systems - there's no concise explanation of syntax it recognises.