HNHacker News
TopNewBestAskShowJobs

juliusgeo

338 karma · joined October 1, 2018

github.com/juliusgeo
submissionscomments
juliusgeo··on Photomator for Mac
It's really confusing because the names are so similar, but I believe Pixelmator is still a one-time purchase, it's just Photomator that is a subscription. Completely agree on these subscriptions prices being way too high for very infrequent usage.
juliusgeo··on TikTok is now banned in Montana
I would like to make the modest proposal that a more effective way of reducing usage would be to make it punishable by summary execution.
juliusgeo··on Bitwise Binary Search: Elegant and Fast
I made an implementation of that same articles algorithm in Python using C-extensions, and it beat the stdlib implementation across many sizes of arrays. https://github.com/juliusgeo/branchless_bisect
juliusgeo··on Photomator for Mac
I would highly agree with this. I always wanted something slightly better than Preview, but not Photoshop (and all that encumbrance). Pixelmator is pretty amazing for quick edits and adjustments.
juliusgeo··on Constrict Your RAM with Python
Various ways to make memory bombs in Python.
juliusgeo··on Cyberpunk 2077’s Path Tracing Update
It is empty in a lot of ways, but filled with detail that many other games don't have in others. I particularly dislike how ridiculous the driving physics are, but the character customization and vast variety of different upgrades and mods is pretty cool.
juliusgeo··on Cyberpunk 2077’s Path Tracing Update
I think it might have been that? It was in one of the first missions. I agree though on your other points--my experience playing the game up until that point was quite good, hence why I spent hours trying to get past the issue.
juliusgeo··on Cyberpunk 2077’s Path Tracing Update
I had a similar experience playing it a few months ago—I bought it on steam so it had all the patches, but I got stuck on this one mission where it would refuse to spawn the entrance to the next part of the quest. I spent a few hours googling trying to figure out what was going on, and then I gave up. It’s such a beautiful game, and has a lot of potential, but it is definitely not as stable as any other major AAA game I’ve played in the last 10 years. I would also get random crashes if I enabled raytracing (despite having an RTX card).
juliusgeo··on Intel OEM Private Key Leak: A Blow to UEFI Secure Boot Security
Riot anti cheat is quite invasive but Valorant is a competitive ranked first person shooter, allowing cheaters violates the integrity of any ranking system of players, and that ranking system is one of the primary appeals of the game.
juliusgeo··on When “free forever” means “free for the next 4 months”
Most of my recommendations for services to use come from my friends who have either used that service on a free plan, or a paid plan. It matters very little in terms of the network effects of their service whether or not you're on a "free plan". See GitHub's free subscriptions of CoPilot for open source contributors.
juliusgeo··on CPython Timsort Implementation Notes
This file explains the nitty-gritty behind how CPython's sorting algorithms are implemented, and compares it to previous implementations.

The last time Timsort was posted on HN was here [0] and here [1], and neither article seemed to have similar detail.

[0] https://news.ycombinator.com/item?id=27823180

[1] https://news.ycombinator.com/item?id=21196555 (the article for this link is now a 404)

juliusgeo··on Ryujinx: Experimental Nintendo Switch Emulator written in C#
Yeah! it's one of those videos that I was first shown in high-school, and then fairly recently dug up and rewatched. Such a classic.
juliusgeo··on Ryujinx: Experimental Nintendo Switch Emulator written in C#
I’m sure you are already aware of this video, but for those who are not: https://m.youtube.com/watch?v=kpk2tdsPh0A this video is an amazing exploration of the various ways speed runners will use glitches to their advantage.
juliusgeo··on Beating Bisect with Branchless Binary Search
That makes a lot of sense to me--I added another graph to the README which shows the performance at every size between 0 and 2*15, rather than just powers of two :). It is in images as "4.jpeg".
juliusgeo··on Beating Bisect with Branchless Binary Search
The python objects are all created on demand by the benchmarking code in the repository—changing the “sizes” object will change the number of samples/etc.
juliusgeo··on Beating Bisect with Branchless Binary Search
Yeah it’s difficult because all the times are by default in seconds from ‘timeit’. I think the sortedcontainers impl is just really, really bad, and that’s why that graph looks so flat in comparison. The datasets and search values are generated on each loop in the benchmark, so hopefully no priming issues.
juliusgeo··on Beating Bisect with Branchless Binary Search
Ah, that is fair. I misinterpreted your point. The reason I say the x axis is distributed by powers of two is because it is only evaluated at powers of two:

  sizes = [2**i for i in range(1, 29)]
The limits that matplotlib fills in are largely superficial, the benchmarks and the x axis are only being evaluated at powers of two.

Your points about the other two graphs though is very good. I think my graphs could use some clarity. The main reason why I didn't use a log scale and compute on much much larger inputs is mainly because it would just take too long for my laptop to compute.

juliusgeo··on Beating Bisect with Branchless Binary Search
Thanks for the feedback! I experimented with using the matplotlib `plt.xscale("log")` function, but because the x axis already distributed by powers of 2, it to some extent is already a log axis (unless I'm making a very wrong assumption). I was curious about the behavior of the lines, and how they seem to ramp up in weird ways. I tried to mitigate by increasing the number of samples in the benchmark, but I haven't been able to get graphs that look as nice as the original article. I think to some extent though, that is because the `sortedcontainers` implementation is so bad. If the `y` axis was scaled better, you would be able to see a more linear increase in execution time.

Also, if you want to, the repo provides a build script for the C-extension so you can mess around with the benchmarks. I would love for you to find some bugs in my implementation :).

juliusgeo··on Beating Bisect with Branchless Binary Search
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?
juliusgeo··on Beating Bisect with Branchless Binary Search
Ok, I converted them all to jpgs and now they seem to be loading in Chrome fine!
juliusgeo··on Beating Bisect with Branchless Binary Search
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.

  for (step >>= 1; step != 0; step >>=1) {
          if ((next = begin + step) < size) {
              begin += PyObject_RichCompareBool(PyList_GetItem(list_obj, next),     value, Py_LT) * step;
          }
      }
juliusgeo··on Beating Bisect with Branchless Binary Search
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.
juliusgeo··on Beating Bisect with Branchless Binary Search
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 think

juliusgeo··on Beating Bisect with Branchless Binary Search
That is concerning. I just tried loading it on an incognito tab and the images loaded after a short delay.
juliusgeo··on Beating Bisect with Branchless Binary Search
Now I’m hungry too! Darn.
juliusgeo··on Beating Bisect with Branchless Binary Search
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.
juliusgeo··on Beating Bisect with Branchless Binary Search
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 :)
juliusgeo··on Beating Bisect with Branchless Binary Search
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-bi...

juliusgeo··on Digital addiction: Focusing on the cure, not the disease
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 often find myself checking my phone far less because I don’t even see the notifications, and don’t even realize I’m in DND mode. You can also set up pass-through for trusted contacts or urgent calls, but I find it is a very easy measure to implement and I’ve seen it’s value in my own life.

You can also do similar things for work related notifications (ie. I had github and slack apps automatically muted after 5pm). I find that the approach of letting the notifications pile up and then checking at my leisure let’s me slowly start to forget about my phone except when it serves an actual purpose.

juliusgeo··on Transpile Python to MongoDB Aggregations
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 to Python, you would have to construct the AST yourself. You can use `ast.unparse` to convert a Python AST into Python source code. The main issue that I find with aggregations is that they are prefix rather than infix notation. Converting them to infix perhaps could make them easier to understand as well?
← PreviousPage 3 of 5Next →