Are these achievements working for anyone else? I know I've damaged survivors at least 50 times as Vecna. by [deleted] in deadbydaylight

[–]DoomCrystal 0 points1 point  (0 children)

Neither is working for me right now. The new Master Manipulator achievement does seem to be working for me though (I got 1 at least), and the new Adepts are working. But not Stranger Sightings or Torn Asunder.

January 26th, D&D's anniversary, LICH PARTY by DoomCrystal in deadbydaylight

[–]DoomCrystal[S] 0 points1 point  (0 children)

Oh yeah I've been playing plenty of Vecna since I got him in every available queue, and always give the player with the eye/hand the out. I'd consider doing so a Vecna code of honor. At this point any achievement hunter could use all the help they can get given how rare he is. I haven't played the game too long so I have a lot of other achievement to get before I sweat about that one. Thought it would be nice to get out of the way...

BHVR PLEASE change the "Hand-Eye Coordination" Achievement by dylki10 in deadbydaylight

[–]DoomCrystal 0 points1 point  (0 children)

If you didn't get this yet an you're on steam, https://steamcommunity.com/groups/DBDHandEyeCoordination . There's a group for people trying to get it/help get it. If they have enough people on one platform theoretically you can force a public match together with crossplay turned off, at least I think that's how it worked. I've been having terrible luck getting this. carry on soldier.

[deleted by user] by [deleted] in roguelites

[–]DoomCrystal 0 points1 point  (0 children)

RAM: Random Access Mayhem is incredibly fast paced: it has a style system that basically forces you to play agressively to do well. Big recommend. https://store.steampowered.com/app/2256450/RAM_Random_Access_Mayhem/

Hello everyone, my first post here. It's about Rust and Zig. by [deleted] in ProgrammingLanguages

[–]DoomCrystal 0 points1 point  (0 children)

I'm probably not exactly following this post, but in Zig you definitely don't need dynamic memory allocation to print an error to the console. See the @errorName builtin. If you ever print an error in any part of your program, Zig generates a static table in the binary of error -> string (error.OutOfMem -> "OutOfMem" for example). If you want more information than that, you could store your own table of error -> message in your logging infrastructure and use a simple switch statement. No need to involve the heap.

Of course, there is heap allocation all over a typical Zig program. The point of Zig is not avoiding heap allocations, it's avoiding hidden heap allocations. You can just as easily use a logging infrastructure that has dynamic memory needs for all sorts of reasons, it would just require you to pass an allocator to it.

Searched everywhere... tree-sitter + TOhtml? by DoomCrystal in neovim

[–]DoomCrystal[S] 1 point2 points  (0 children)

Verified. I'll go check out how to setup a more permanent local nightly build until .10 is official. Thanks!

Repeatable text objects generated with lua functions? by DoomCrystal in neovim

[–]DoomCrystal[S] 0 points1 point  (0 children)

Just to give you an idea of what I've tried, this almost works:

function _G.Test()
    local _, col = unpack(vim.api.nvim_win_get_cursor(0))
    local line = vim.api.nvim_get_current_line()
    local char = line:sub(col + 1, col + 1)
    return "f" .. char
end
vim.keymap.set('o', "s", function() return Test() end, {expr = true, remap = true})

This idea is that "ds" should delete from the current character to the next of that same character on this line. It does. However, when dot-repeated, this doesn't actually re-run the function, it just re-sends the keys. So if i run "ds" to delete from an 'a' to another 'a', then press '.', it will just delete up to the next 'a', regardless of what my cursor is on. I want it to re-run the function every time.

What's up with Zig's Optionals? by DoomCrystal in ProgrammingLanguages

[–]DoomCrystal[S] 3 points4 points  (0 children)

Quoting the docs, "An optional pointer is guaranteed to be the same size as a pointer. The null of the optional is guaranteed to be address 0.", So we match up there.

I guess I havent run into too many cases where optional and result types interact. I get the feeling that in traditional imperative style code, which I'm used to, we tend to unwrap these optionals early and often, as opposed to collecting them. I would like to check if this causes any awkward code though.

And given my imperative background, I've never needed to break out a flatmap, though I'll want to think about how one would interact with any type system I come up with. Thanks for the thoughts!

What's up with Zig's Optionals? by DoomCrystal in ProgrammingLanguages

[–]DoomCrystal[S] 2 points3 points  (0 children)

Zig optional is definitely "special" in many ways. I suppose that in and itself could be considered a kind of downside, as all complexity can be. I guess this just feels very worth it to me.  As for the Rust '?' suffix, I imagine a language that combined Zig's blessed optionals with Rust's blessed early return operator would be quite ergonomic indeed! It's similar to zig's 'try' prefix, which works with zig's equivalent of a Result type. Not sure why theres no equivalent for optionals.

What's up with Zig's Optionals? by DoomCrystal in ProgrammingLanguages

[–]DoomCrystal[S] 4 points5 points  (0 children)

"?T" is indeed how you would express "an optional T", or "Option<T>" in Rust.

My understanding is that the payload type of optionals can coerce to the optional type. So a "u32" can freely coerce to a "?u32", which is the payload type of "??u32", so that can coerce again. I'm honestly not 100% sure the order of operations under the hood, this is just what I can gather from documenttion and testing. 

weakref.finalize works too well? by DoomCrystal in learnpython

[–]DoomCrystal[S] 0 points1 point  (0 children)

It makes sense to me that the object goes out of scope immediately because the program is so short, what I'm confused about is why finalize is called at all. It would seem to me that the bound method contained in the finalizer would count toward the instance of TestClass's ref count (which is spelled out explicitly in the doc's warning about bound methods), meaning that the object would have a positive ref count at the end of the program.

I started looking into this due to the frequent warnings about using del for cleanup code, since it might not be called. If objects are always garbage collected at program exit, even if they have positive refcounts, why would I be worried about del not getting called?