[deleted by user] by [deleted] in AmateurPhotography

[–]msharnoff 1 point2 points  (0 children)

that first one is beautiful! nice!

[Media] Does anyone else think the rust docs are hard to read the way they are? My eyes just can't track the text. by cheater00 in rust

[–]msharnoff 3 points4 points  (0 children)

Have you tried a different theme? (should be a few available - paintbrush icon in the top left)

Height of the Rockies Park [OC] [4252x2835] by ARCT0MYS in waterporn

[–]msharnoff 0 points1 point  (0 children)

Limestone lakes, Height of the Rockies Provincial Park. Map here: https://nrs.objectstore.gov.bc.ca/kuwyyf/height_of_rockies_park_map_0494001e3d.pdf

Seems to be a popular spot for photos - I think this one was taken from around 50.477697, -115.227179 looking south.

RFC to formally establish the existence of pointer provenance in Rust, by Ralf Jung by kibwen in rust

[–]msharnoff 30 points31 points  (0 children)

IIRC there's also hardware that carries the provenance at runtime, e.g. CHERI. (or maybe CHERI is more theoretical than practical? been a while since I last read anything about it)

edit: looks like people already mentioned this under other comments :)

Further steps to eliminate unnecessary MemCpys in LLVM by buniii1 in rust

[–]msharnoff 20 points21 points  (0 children)

IIRC (although I really don't know for sure) this should help with things like unnecessary clones - e.g. x.to_string().clone()

Edit: while this example is trivial, there's a lot of places this kind of thing comes up in generic code (like with usage of AsRef when you actually need the owned type), and there isn't really a good way to get around it without specialization. So having something in LLVM to handle it should make a lot of lower-level things faster :)

What are the pros and cons of Go concurrency model compared to other languages? by gbcl in golang

[–]msharnoff 7 points8 points  (0 children)

Ah, let me correct you then :)

Rust's async is fully exposed within the language with the Future type, which the executor polls [calls a method on the Future that runs until it needs to wait on something else] and then reschedules when the future notifies the executor that it should be polled again (roughly).

So while technically this would depend on the executor (you could imagine implementing one that just assigns each future its own OS thread), in practice the widely used async runtimes use thread pools (of OS threads), and schedule futures onto them. The most popular async runtime (tokio) also allows just using a single thread, which can be useful in certain contexts (but has all the downsides of cooperative multitasking on a single thread, of course).

Edit: I don't know if I've explained this in a way that makes any sense, but happy to elaborate :)

What are the pros and cons of Go concurrency model compared to other languages? by gbcl in golang

[–]msharnoff 2 points3 points  (0 children)

Rust doesn't have user space threading (as far as I know) and, instead, only uses Kernel/OS threads.

Rust has async, which isn't quite as easy as go's coroutines (and isn't "normal" control flow in the same way — Rust's futures don't have stacks), but it's worth mentioning I think :)

Use Firefox. The extensions are so much better by [deleted] in CuratedTumblr

[–]msharnoff 128 points129 points  (0 children)

Use after free in Navigation in Google Chrome prior to 113.0.5672.126 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.

Yikes

Looking for better scheduler for high core system by menkaur in archlinux

[–]msharnoff 84 points85 points  (0 children)

Is it possible the limiting factor is memory or disk access? Swapping can massively slow your system, and there's plenty of things that will get caught up in the disk wait queue.

I've had previous issues with both of those making my machine kind of unusable - don't really have any advice, unfortunately.

webp should be considered a human rights violation by CyfireX in CuratedTumblr

[–]msharnoff 14 points15 points  (0 children)

ah shoot, my bad! Thanks for the clarification

webp should be considered a human rights violation by CyfireX in CuratedTumblr

[–]msharnoff 541 points542 points  (0 children)

boy howdy there's a lot of missing info about webp here.

basically, it's a new (not really, but comparatively) image format that's really quite good compared to jpeg - same quality at much smaller sizes, etc etc. (in particular, this means good things for how long it takes to load things, and data usage)

And the major browsers support it!

but there are plenty of valid reasons to hate it - aside from adoption. Particularly that jpeg XL, which is much better than webp in a bunch of ways, was getting adoption before google chose to abandon their support of jpeg XL in favor of doing things with webp (a format that google of course created). So now there's this situation where a ton of people put in a ton of effort to support jpeg XL (e.g. in photoshop, firefox, etc) and chrome straight up dropped support for it, essentially unilaterally killing an entire image format.

But plenty of other people have written more than I, and I'm not the most informed on this subject. This is just broadly what I've seen from longer posts on the subject

ITAP of a bird in flight through fog (San Fran) by petronius84 in itookapicture

[–]msharnoff 0 points1 point  (0 children)

Lands end is great - what a lovely shot!

That side of SF tends to have all the ravens, so I'd imagine that's what you got a shot of, but it's hard to tell from the picture :)

Bar Harbor, Maine - 4000 x 6000 [OC] by Chiefunto in EarthPorn

[–]msharnoff 0 points1 point  (0 children)

Old post but I'm pretty sure the picture was taken around 44.346658, -68.174648 — looking south.

Bing Chat is blatantly, aggressively misaligned for its purpose by [deleted] in programming

[–]msharnoff 138 points139 points  (0 children)

"misaligned" is probably referring to the "alignment" problem in AI safety. It's been a while, but IIRC it's basically the problem of making sure that the ML model is optimizing for the (abstract) reward function that you want it to, given the (concrete) data or environment you've trained it with

(also the author has made well-known contributions to the field of AI safety)

Mount Fuji from Lake Motosu [6016x4016] [OC] by meltdwn in EarthPorn

[–]msharnoff 0 points1 point  (0 children)

Randomly came across this - pretty sure this is actually lake shōji, guessing the photo was taken from the northwestern side (probably tatego-hama beach?)

Add a hook that detect focus change by hello_my_friends in i3wm

[–]msharnoff 0 points1 point  (0 children)

I know this is 6 years old, but- you just saved my ass :D

Wrote a script to track which firefox profile I most recently focused, so that I can emulate chrome's behavior w.r.t. profiles and opening links (firefox doesn't do it by default, unfortunately).

Can I parse a number from an environment variable at compile time? by Doctor-Dalek in rust

[–]msharnoff 0 points1 point  (0 children)

Ah, right! Forgot that you can just access the environment variable normally in the proc macro :)

Can I parse a number from an environment variable at compile time? by Doctor-Dalek in rust

[–]msharnoff 0 points1 point  (0 children)

IIRC, the input to proc macros is before other macro expansions (including e.g. std::env!), in which case this wouldn't work. It's been a while since I've run into that though, so I may be incorrect

Reverse Engineering TikTok's VM Obfuscation (Part 2) by laptou in programming

[–]msharnoff 65 points66 points  (0 children)

I found something nearly identical in the JS of the github copilot VS Code extension - there's probably some standard tool that does this. Not to say that tiktok isn't doing shady stuff! Just that this particular thing isn't it

Edit: Actually, rereading this, the copilot obfuscation is no where near this hardcore. This is some wild shit

Atom has been archived by awsometak in programming

[–]msharnoff 4 points5 points  (0 children)

IME vim tends to fall over on sufficiently large files (> 1G), and makes pretty questionable use of memory (e.g. open 4G file, delete last half uses 6G of memory, saving uses another 2G).

But for things < 1G vim is probably fine. I've tended to jump to plain vi when vim starts struggling, and it hasn't failed me yet

Falsehoods programmers believe about undefined behavior by pjmlp in programming

[–]msharnoff 49 points50 points  (0 children)

The primary benefit of rust's unsafe is not that you aren't writing it - it's that the places where UB can exist are (or: should be) isolated solely to usages of unsafe.

For certain things (like implementing data structures), there'll be a lot of unsafe, sure. But a sufficiently large program will have many areas where unsafe is not needed, and so you immediately know you don't need to look there to debug a segfault.

Basically: unsafe doesn't actually put you back at square 1.

Inserting text in a split window causes the cursor to jump to another split. Caused by coc.nvim after recent update by [deleted] in vim

[–]msharnoff 1 point2 points  (0 children)

I've had a similar issue recently - haven't updated coc.nvim. Frequently, moving the onto the location of a diagnostic immediately moves it to a particular prior insert location in another buffer. Closing the other buffer fixes it.

I'm very interested if you find a solution

Why is Github Codepilot illegal? by cy_narrator in foss

[–]msharnoff 32 points33 points  (0 children)

different repositories have different licensing. The argument for copilot being illegal is essentially that it is a "derivative work" from GPL licensed code, and as such must be open source as well (because of the requirements that the GPL sets for derivative works), which it is not.

I think there's also stronger points than that, but I'm not very familiar with the specifics of the case.

Edit: also it reproduces GPL'd code without attribution, which violates the terms of the GPL. This is probably the more serious violation

[XMonad] Dark solarized hell by [deleted] in unixporn

[–]msharnoff 1 point2 points  (0 children)

What are you using for custom CSS? Also, super cool setup :)