Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
juliusgeo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
juliusgeo
3y ago
Ah, yeah I see what you mean. If I'm understanding you correctly, the fact that we are calling the Python interpreter internal functions during that calculation makes it branch because it is not pre-calculated?
92.
▲
by
juliusgeo
3y ago
Ok, I converted them all to jpgs and now they seem to be loading in Chrome fine!
93.
▲
by
juliusgeo
3y ago
I was considering doing it all in a ternary statement, but I feel that the current form is also branchless because it is simply a multiply and add. The extra bounds-checking condition can probably be omitted, but I haven't tested that.
94.
▲
by
juliusgeo
3y ago
Weirdly enough, when I go to this url on Safari it loads fine: https://raw.githubusercontent.com/juliusgeo/branchless_bisec... When I go to it on Chrome, I get an error.
95.
▲
by
juliusgeo
3y ago
I am very confused why am I am unable to solve the problem, but I added all of the images to a folder in the repo so you can take a look at them there. Still unable to resolve the error on Chrome on my machine. EDIT: issue is fixed now I th
96.
▲
by
juliusgeo
3y ago
That is concerning. I just tried loading it on an incognito tab and the images loaded after a short delay.
97.
▲
by
juliusgeo
3y ago
Now I’m hungry too! Darn.
98.
▲
by
juliusgeo
3y ago
I just checked on my phone and images are rendering fine for me—it might be because they’re high res or otherwise delayed in loading.
99.
▲
by
juliusgeo
3y ago
There are some provisos to the “Branchless” tag that are covered in the article I drew inspiration from. One of which is that a “CMOVE” is not technically a branch :)
100.
▲
Beating Bisect with Branchless Binary Search
(github.com)
62 points
by
juliusgeo
3y ago
|
36 comments
101.
▲
by
juliusgeo
3y ago
I was inspired by this article[0] to see if I could beat the Python standard library implementation of "bisect_left" using C-extensions. [0] https://probablydance.com/2023/04/27/beautiful-branchless-
102.
▲
by
juliusgeo
3y ago
One small thing that I have done that I have found leads to at the very least more productive use of my spare digital time—and that is just setting up the Apple night-time DND feature. It doesn’t give you a very prominent notification, so I
103.
▲
by
juliusgeo
3y ago
This is definitely possible to do in reverse. Unfortunately, the thing that makes the Python-MongoDB translation so easy is that Python provides utilities to parse and lex the Python source code. If you were to translate from MongoDB back t
104.
▲
Transpile Python to MongoDB Aggregations
(github.com)
1 points
by
juliusgeo
3y ago
|
3 comments
105.
▲
“Fortune” Typing Speed Test in 80 Lines of Python
(gist.github.com)
1 points
by
juliusgeo
4y ago
|
1 comments
106.
▲
by
juliusgeo
4y ago
This is a relatively fully-featured typing test in only 80 lines of Python code. It uses escape sequences to style the text, and does not have any external dependencies.
107.
▲
by
juliusgeo
4y ago
This is true—some of the people I met in Philly had serious drug addictions but their rent was only 300 a month for a whole house. I genuinely don’t think there is any equivalent in SF. That is probably also why I almost never saw tents or
108.
▲
by
juliusgeo
4y ago
I have only lived for extensive periods of time in two cities: SF (2 years about) and Philadelphia (4 years). The biggest difference between them is that even in some of the worst areas of Philadelphia in terms of drug crime, there were far
109.
▲
by
juliusgeo
4y ago
I find sometimes the only way to get good results for obscure movies like that is to search in the original language. For example, searching for “tian zhu ding” surfaces pretty good results for me. Also those real life events are listed on
110.
▲
by
juliusgeo
4y ago
To be honest I don’t use the type annotations given by the IDE that much, and I also only encounter them in my work code base (pymongo), so I can’t comment on that part. I was mainly commenting just on its ability to handle large code bases
111.
▲
by
juliusgeo
4y ago
I use PyCharm for my job as well as for personal projects, and it handles large codebases with type annotations very well. I would compare it to Visual Studio (not Code) in the sense that it’s a batteries included deal, which means larger i
112.
▲
by
juliusgeo
4y ago
This is referred to as “straight piping” in the car community, and you are correct it’s basically replacing the entire exhaust system with a straight pipe from the engine to the back. Even very weak Honda’s can be absurdly loud with this.
113.
▲
by
juliusgeo
4y ago
Beautiful! I love obfuscated code, but I normally do it in high level languages. Always wanted to pick up golfing in asm.
114.
▲
Ioccc 1988 'Underscore Pi' Python Recreation
(gist.github.com)
1 points
by
juliusgeo
4y ago
|
0 comments
115.
▲
Calculating Pi in Python for Pi Day
(gist.github.com)
3 points
by
juliusgeo
4y ago
|
0 comments
116.
▲
by
juliusgeo
4y ago
Mathematica is both closed source, and very idiosyncratic. It is primarily useful as a way to check things, but I have never seen anyone in actual research use Mathematica.
117.
▲
by
juliusgeo
4y ago
Also one additional comment is that you are setting precision in number of bits, not in decimal digits. It obviously runs much faster when it is only computing log2(20000000) not 20000000 digits of precision.
118.
▲
by
juliusgeo
4y ago
It definitely does calculate it otherwise it would diverge significantly at lower digits from the Gauss Legendre and Chudnovsky algorithm that I compared it to. It just defers calculation to MPFR, the C library Julia binds to for BigFloat c
119.
▲
by
juliusgeo
4y ago
Thanks for looking into this! That is interesting, I wonder if it varies a great deal based on the implementation of the BigFloat rather than the language that it is implemented in.
120.
▲
by
juliusgeo
4y ago
Interesting! What does Gauss Legendre look like in Gambit-Scheme? I also wonder if perhaps there is a way to get the Julia implementation up to par…
More ›