Hacker News new | past | comments | ask | show | jobs | submit | cl3misch's comments login

As mentioned in this discussion: https://news.ycombinator.com/item?id=43769486

Care to elaborate? Where is the complexity hidden?

1. operators use special lookup for dunder methods--on class, not on instance:

    >>> a+1 # lookup on class 
    1+1
    2 
    >>> a.__add__(1) # instance method 
    0
2. There is __radd__ that is called if __add__ doesn't support given types (for different types).

the full story is in the language reference, but the short answer is: __radd__ (unless it's more complicated than I realize)

Yes, the next level of complexity is that `a + b` will sometimes fall back to `b.__radd__(a)` if `a.__add__(b)` returns `NotImplemented`. But also:

- There are situations where `__radd__` takes priority over `__add__`. The rules for determining that priority are complex (and IIRC subtly different from the rules that determine whether `a < b` prioritises `a.__lt__(b)` or `b.__gt__(a)`).

- The lookup of `__add__` etc uses a special form of attribute lookup that's neither equivalent to `a.__add__` nor `type(a).__add__`. This special lookup only searches `type(a)` whereas the first would find an `__add__` function on `a`, and the second on `type(type(a))`.

I've also heard of further complications caused by implementation details leaking into the language semantics - for example, see Armin Ronacher's blog post: https://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-t...


Neither in (German) high school nor in the many math courses of a physics B.Sc. have I ever used the secant function. I am surprised the article does not explain it in the beginning. I assume for other people it must be a common function?

Trig is full of functions that fall into disuse and are forgotten.

For example "versine"

versin theta = 1-cos theta.

There is also "haversine" which is (1-cos theta)/2. Which is used in navigation apparently https://en.wikipedia.org/wiki/Versine


See R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159

iirc, haversine is useful for transforming 2-d "as the crow flies" coords to their 3-d equivalents. at longer distances a body's curvature is really noticeable and often overlooked

Interesting. versine has a lovely and intuitive geometric definition. If you construct a right triangle from the origin to some point on the circle, most people who have done trig will know that the x-coordinate of that point is r cos theta, where theta is the angle and r is the radius. Geometrically the distance from the origin to where the triangle rests on the x axis is r cos theta. But what about the rest of that radius? ie the line segment on the x-axis from there to where the circle intersects the x-axis?

That is r versin theta (ie r - r cos theta). Pretty cool no? I mean I've literally never had to find the length of that line, but that's how you would if you wanted to..


It's a US thing. Europeans just write 1/cos(x) instead of treating it as a special thing with its own name. The Americans have sec, csc, and a bunch of others I never bothered to learn. It doesn't seem to add all that much to me? (Of course, it's a bit hypocritical since I gladly use tan(x).)

I imagine it was more useful when using tables to lookup/approximate the values before calculators with trig support were a thing.

speak for your own european country, in my neck of the woods (EE) we were taught and we worked with both secant and cosecant.

They were taught to us in Spain, I suppose they don't make an appearance often, but they are perfectly familiar.

the only other one is cot, actually.

Personally I thought they were nice to have because coming up with the integral of 1/cos on the fly is pretty brutal in a long integral


I used sec, cosec and others during my math degree in the UK too.

there are these old-fashioned looking drawings...

(quick search, didn't find the old ones, but similar to these)

https://mathematicaldaily.weebly.com/secant-cosecant-cotange...

https://www.pinterest.com/pin/enter-image-description-here--...

... which were not used in my education but whenever i saw them i wished they had been, they lay out a geometric interpretation of all of them. by "old" i mean "look like Leonardo drew them"


In the UK we certainly use sec(x)

I'm sure you used inverse of a cosine multiple times. Didactic math today is just not bothering to give it a name. Probably because people think that sin, cos and tan is enough. Even ctg which is just inverse of tan is often skipped.

I know what you mean, but as a sibling pointed out for everyone else's benefit, parent is using the word inverse where they mean reciprocal.

The inverse of cosine is arccosine (sometimes written acos or cos^{-1}). Secant is the reciprocal of cos ie sec x = 1/cos(x)).

Likewise cotan is the reciprocal of tan (1/tan). The inverse of tan is atan/arctan/tan^{-1}.

This is confusing for a lot of people because if you write x^{-1} that means 1/x. If you write f^{-1} and f is a function, then _generally_ it means the inverse of f. In the case of trig functions this is doubly confusing because people write sin^2 theta meaning (sin theta)^2 but sin^-1 theta means arcsin theta.

That's why in my maths studies they started by teaching you to do the inverse with a -1 so when you see it you don't get confused but changed to preferring arcsin etc as this is unambiguous and if you learn to write this way you won't confuse others.


It does not help that both reciprocal and inverse come from French, and that their common meanings are reversed in English. I'm not sure whether the meaning of both words has remained constant over time in these two languages, as they both roughly mean "the opposite" and if you want to avoid ambiguity, you simply add context. For example, if you say "inverse function" or "multiplicative inverse" it's not ambiguous.

Inverse function: https://en.wikipedia.org/wiki/Inverse_function / https://fr.wikipedia.org/wiki/Bijection_r%C3%A9ciproque

Reciprocal: https://en.wikipedia.org/wiki/Multiplicative_inverse / https://fr.wikipedia.org/wiki/Inverse

Wikipedia seems to have chosen "multiplicative inverse" over "reciprocal" for title, even though they are clearly indicated as synonymous.


That’s a really good point. I will try to remember to do that in future.

The secant is the reciprocal of a cosine – the hypotenuse over the adjacent

That’s right, it’s a distribution. And that fact has me, a non-mathematician, personally caused some huge headaches, because I thought I could treat it just like a function… Yeah, turns out really weird things happen if you try to do so without knowing what you’re doing. For example, taking its square does not make sense.

It is a function. What do you mean?

Oops, replied to the wrong comment. This is the one I meant to reply to, which is talking about the impulse train, which is not a function: https://news.ycombinator.com/item?id=43741539

The weird thing about 1/cos is it’s discontinuous wherever cos is 0 but, yes, it’s a function.

Yeah, that was replied to the wrong comment.

>Neither in (German) high school nor in the many math courses of a physics B.Sc. have I ever used the secant function

I think we used it in geometry in US high school, but only to complete an assignment or two to show we could use trig functions correctly. I had to relearn how all of them worked to help my kid with homework, it's mostly look at the angles and sides you have available and pick which trig function is necessary to figure out which one you're solving for. I'm sure there are real life uses for trig functions, and I hate to be one of those "when are we ever going to use this" types, but I've never used any of them outside of math classes.


Law of sines is useful when constructing things with a known angle outside of CAD.

Apparently it's only available in MS Office:

> The basic styles of Kermit (Regular, Bold, Italic, and Bold Italic) are available today in Office, with the remaining 38 styles arriving in early May.

...from the last paragraph of the linked article.


Are you not reasoning on lossy abstractions?

I'm still not on board with the (seemingly prevalent) notion that LLM's can't reason. What's reasoning, anyway? I'm not actively advocating for any side, but the arguments against reasoning always felt very tautological to me.


The burden of proof is on the argument that they _are_ reasoning, and I have seen very little evidence that they do.

It's also immediately clear to me when I look at the architecture of transformers that reasoning is not in the cards. I could be convinced otherwise if, again, someone showed me an indication of reasoning behavior. Since there is no such evidence and the systems theory approach tells me it does not reasonably reason, I have a pretty darn good reason not to believe it's reasoning.


> It's also immediately clear to me when I look at the architecture of transformers that reasoning is not in the cards.

I'm not saying that's incorrect, but thb that's exactly the tautology I was talking about!


That's not a tautology. That's the summary of the argument itself. If you want to know more, then a good reason why it can't be reasoning is that there is no evaluation of the truth value of any statement at any point, only the likelihood of the statement being found in the training set. This evaluation has no relationship with truth.

If no statement is ever evaluated, it's not logical reasoning, because logical reasoning requires the evaluation of truth values of statements.


> there is no evaluation of the truth value of any statement at any point

You could argue that the attention part of the network is some form of truth validation of the next predicted token? But indeed, the current chat interfaces don't change their previous text output retroactively.

Still, I am not really convinced. If we assume a human can reason, what does "evaluation of the truth value" mean? Thinking about something? This is still performed with our implicit mental model of the world, coming from shadows on a cave's wall, right?


According to other comments stating how responsive Discord is to reports, it might be better to not delete these webhooks but instead report the connected users/servers.


Wow, very addictive loop! I instantly played a couple of rounds.

Fyi, the perk to self-destruct the last block didn't seem to work.


You are right, thanks, should be fixed now. It was a `remainingBricks < perks.skip_last` instead of `<=`. I never pick that perk so I didn't realize.


I noticed that too. Was very disappointed the last brick wasn't destructing. Otherwise fun!


I think it's an off by one error. When I got to level 2 of the perk, it ended when there was 1 block left.


Yeah, a < sign when it should be a <=


If this idea sounds interesting, you might want to look at xarray for a more established project: https://github.com/pydata/xarray

It's focused on indexing and lacks the batching idea, though. Combining named axes and vmap is a great move!

But tbh I'm turned off by the repo not being a Python package more than I'd like to admit. Reading

> Download it and put it in your working directory.

when skimming a project makes me think it's immature. Which definitely is not the case here!


The computers don't get slower, and light Linux distros should still work fine.

But what matters is the software you're using, and that will be modern software (mostly). Modern browsers visiting JS-heavy websites, or a heavier office suite than 15 years ago.

And if this is the context, then computers must get slower over time, right?


I stumbled over that 19% in the article. Maybe in practice you wouldn't want to convert a GIF to lossless webp, but original video to lossy webp? And then the lossy webp would be slighly smaller than the GIF with far superior quality?


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: