Readit News logoReadit News
nurpax commented on Leveraging Zig's Allocators   openmymind.net/Leveraging... · Posted by u/PaulHoule
gizmo · 2 years ago
I'm not 100% sure how Zig allocators work but it looks like the arena memory is getting re-used without zeroing the memory? With slight memory corruption freed memory from a previous request can end up leaking. That's not great.

Even if you don't have process isolation between workers (which is generally what you want) then you can still put memory arenas far apart in virtual memory, make use of inaccessible guard pages, and take other precautions to prevent catastrophic memory corruption.

nurpax · 2 years ago
The same can happen with C malloc/free too.
nurpax commented on Google engineers want to make ad-blocking (near) impossible   stackdiary.com/web-enviro... · Posted by u/pabs3
reedf1 · 2 years ago
It will be hard to beat any AR level ad filtering. Ultimately AI will make ad avoidance easier rather than harder.
nurpax · 2 years ago
AR?
nurpax commented on How often do people copy and paste from Stack Overflow?   stackoverflow.blog/2021/0... · Posted by u/prakhargurunani
henrikeh · 5 years ago
Is it just me or is this also a symptom of Python's documentation being really strange to navigate and generally having a massive impedance mismatch with Google?

When I search on Google for "python reverse list", not a single link is to the official Python documentation. Not even if I search for "python reverse" does the documentation page show up. Searching for "python reverse documentation" leads to the second link to the Build-in Functions page (https://docs.python.org/3/library/functions.html), which is what I "need".

Excuse the comparison, but "matlab reverse list" has the top three to the official documentation (all of them relevant, but slightly different semantics). Why can't Python be better than that?

nurpax · 5 years ago
It’s not just you. Python seems to suffer from Python-specific ”tutorial sites” being SEO’d above Python’s official docs. I don’t know what it is about the Python documentation that lowers its rank on Google search results. In general, not a big fan of Python docs.
nurpax commented on A common mistake when NumPy’s RNG with PyTorch   tanelp.github.io/posts/a-... · Posted by u/sunils34
_coveredInBees · 5 years ago
Yeah, I'd run into this 2 years ago and ended up also reporting an issue on the Centernet repo [1]

The solution I have in that issue adapts from the very helpful discussions in the original Pytorch issue [2]

`worker_init_fn=lambda id: np.random.seed(torch.initial_seed() // 2*32 + id)`

I will admit that this is *very* easy to mess up as evidenced by the fact that examples in the official tutorials for Pytorch and other well known code-bases suffer from it. In the Pytorch training framework I've helped develop at work, we've implemented a custom `worker_init_fn` as outlined in [1] that is the default for all "trainer" instances who are responsible for instantiating DataLoaders in 99% of our training runs.

Also, as an aside, Holy Clickbaity title Batman! Maybe I should have blogged about this 2 years ago. Heck, every 6 months or so, I think that, and then I realize that I'd rather spend time with my kids and on my hobbies when I'm not working on interesting ML stuff and/or coding. An added side benefit is not having to worry about making idiotic clickbaity titles like this to farm karma, or provide high-quality unpaid labor for Medium in order for my efforts to be actually seen by people. But it could also just be that I'm lazy :-)

[1] https://github.com/xingyizhou/CenterNet/issues/233

[2] https://github.com/pytorch/pytorch/issues/5059

nurpax · 5 years ago
This field contains the worker-specific seed:

    torch.utils.data.get_worker_info().seed
So I guess something like the below (untested!) could work too:

   worker_init_fn=lambda id: np.random.seed(torch.utils.data.get_worker_info().seed)

nurpax commented on Python 3's F-Strings: An Improved String Formatting Syntax   realpython.com/python-f-s... · Posted by u/mmastrac
noncoml · 5 years ago
I can't say I like the f" syntax much. I think JS's backtick is better.

Other than that, I agree, much better than % and less verbose than .format.

It's just the f" or f' that doesn't sit right with me

nurpax · 5 years ago
Yup, especially as you often need to access dict's with foo["field"] and you get a syntax error if the f-strings is also f"". JavaScript backtick syntax doesn't lead to this extra syntactic friction.

Deleted Comment

nurpax commented on Colorize Your CLI   danyspin97.org/blog/color... · Posted by u/danyspin97
GhostVII · 5 years ago
I feel like we need a complete rewrite of terminal emulators/bash/whatever. It should be super easy to make a CLI with nice colors, good loading icons, etc. without having to deal with all kinds of color codes and cursor movement. When I press "enter" while a script is showing some progress bar, or resize the terminal window, it should handle it nicely like every other application.

I use the command line whenever possible over a GUI application, but sometimes I wish it wasn't still stuck in the 80s. Keep the speed an simplicity (I don't want images or anything), but make it easy to make robust applications with a clean text based UI. I shouldn't still have ghosting in my Vim setup, it's 2020.

nurpax · 5 years ago
Inline images would be great too (bitmap or svg). There’d be a lot less need for something like jupyter if you could show images in the shell.
nurpax commented on Hundreds arrested as crime chat network cracked (BBC)   bbc.co.uk/news/uk-5326331... · Posted by u/trtobe
nurpax · 5 years ago
This was an interesting Twitter thread about Encrochat: https://twitter.com/josephfcox/status/1278638671416168450?s=...
nurpax commented on Linear – A fast issue tracker   linear.app/... · Posted by u/tommoor
enra · 5 years ago
Founder here. Here to answer any questions you might have.

We built Linear as we’re frustrated the practices and the available tools when it came to managing software projects.

On the product, we especially tackled the performance problem. Everything is synced to the client and we sync just delta packages between the cloud and client as changes happen. This way all actions a happen instantly and navigating around the app is really fast. And the app works offline too.

We also streamlined the UI and UX, overall we are rethinking what comes after agile for software development. I think many teams looking for something simple to run their teams.

Our announcement post: https://medium.com/linear-app/practices-for-building-linear-...

nurpax · 5 years ago
Looking forward to trying out Linear. I'd really love to use a tool with good performance and offline support! Your website looks slick and lovely too.

Alas, the e-mail sign up seems to take a while to send the registration link e-mail. When I got the e-mail after maybe 5-10 minutes of waiting, the sign up link had already expired. :( It says "Verification code expired. Please request a new one." I did, but the same thing happened.

u/nurpax

KarmaCake day418August 18, 2013View Original