Hacker Newsnew | past | comments | ask | show | jobs | submit | st0le's commentslogin

Another fun trick I've discovered.

`XOR[0...n] = 0 ^ 1 .... ^ n = [n, 1, n + 1, 0][n % 4]`


Tables yuck :P, maybe

XOR[0...x] = (x&1^(x&2)>>1)+x*(~x&1)


~Is there a simple proof for this type of identity?~

Actually I found something through Gemini based on the table mod 4 idea in previous post. Thanks.


Right, or in summary, no you don't need to all that extra work up front.


This is an amazing idea! Love it.


Did you happen to enable "recommendations" in Youtube Mobile App? That would implicitly enable it. I don't have Trending/Shorts because its disabled.



also https://jwt.ms (fully client side, hosted by Microsoft)


https://jwt.is is also fully client-side


Also https://token.dev which supports JWT and PASETO tokens


Off Topic: what is the adoption of PASETO like? I haven't seen any major move towards the standard and most everyone still using JWT


I wonder this as well. I've never come across a real-world implementation of PASTEO.


IIRC They were acquired by Amazon. They have a paid offering for shared team environments.


Oh cool, thanks!


The python code sample starts off with C/C++ style comments.


Thanks! I will look into it.


Also, the Java sample starts with the C comment. It still works, because it's the same syntax, of course, but it has the wrong content.

Edit: my bad, I totally just clicked on the wrong one!


They python comment is fixed, thanks for testing it!



Thanks, replying from it right now, it looks neat and I liked the article summary! Two things though: it seems there’s no “new submission” tab? And you can’t do anything to replies except replying, so no votes, flags, etc?


Edit: the app crashed submitting that reply, and it seems I can’t edit it using the app either.


No idea how to call the api.


Good point. I tried to use axios and it didn't work


Hey there! I've changed the page to generate a curl request that will properly call the function. By default it is looking for a POST request (even if data is empty).


Ultimate plumber can do this.

https://github.com/akavel/up


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

Search: