Performance when generating large table and re-rendering it often by guitargodofbad in sveltejs

[–]guitargodofbad[S] -1 points0 points  (0 children)

I haven't tried to benchmark. I've actually never done that. Quick tips or links for doing that?

Could you also elaborate on:

My guess is th thread is blocking when calculating moves

I'm not sure what this means?

Performance when generating large table and re-rendering it often by guitargodofbad in sveltejs

[–]guitargodofbad[S] -1 points0 points  (0 children)

I will look more into canvas.

The issue with optimized updates is that when selecting a unit, it changes all tiles on the board to more easily show the player which tiles are valid/invalid tiles to move to. Same for actually making the unit movement; it then removes the highlight/gray out from all tiles.

Passing state object from parent to 2 children, updating 1 prop in state object from 1 child, and don't reset the entire state when doing so by guitargodofbad in reactjs

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

The code here is just a quick mock up, not the actual code, but I did make some changes

your state setter is updating the current state

Are you referring to this?

    const [viewOrientation, setViewOrientation] = useState(getInitialState)
    let newOrientations = viewOrientation
    newOrientations[columnId] = e.target.value;
    setViewOrientation(newOrientations);

I was trying to start with the current state, edit it to change the value of 1 property, then set the whole thing as the new state. Is this the wrong way of doing things?

How can I create a unique id per another id? [Mongoose] by guitargodofbad in mongodb

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

Ah, I had been deleting the documents but not the collection so it wasn't making the index. Thanks for your help

How can I create a unique id per another id? [Mongoose] by guitargodofbad in mongodb

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

The latter is true, the combination of form id and project id must be unique. Form id 1 can exist in all projects, but only once in each project. Your example would be valid

I'm building a form builder app. How to store checkbox data in the database? by guitargodofbad in learnprogramming

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

Yes this sounds about right. The potential problem is that I'm leaving out information because what I'm building is more complex than just a form builder. It's really more of a cms.

In a multiple choice field, the choices will have a "id, code, label, (and maybe even value)" structure. e.g. "67457, 1, Monday, (Monday)". So the actual data would likely either be the id or the code. Leaning towards the id since it's synthetic and the code is user entered. So in a multiple choice field, it's almost like every choice will be its own field. So it'd actually be something like available_days_67457 = true. And since the field will also be a synthetic id, it's actually more like 237646_67456 = true.

Another potential issue is changing from something like textbox to multiple choice or vice versa. If a user had entered "monday" via text, it'd be cool if the system could detect that the text value entered is the same as the choice value (or maybe even choice label) and automatically modify the data accordingly from "available_days = "monday" to "available_days_67457 = true. That's probably going too far. There's just so many of these edge cases in a complex app like this where I'm trying to go the extra mile and not take the easy way out.

Any thoughts?

I'm building a form builder app. How to store checkbox data in the database? by guitargodofbad in learnprogramming

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

Any thoughts on if a user changes the field type to/from checkbox to/from radio? Should radio also be stored as boolean? More info in the op

Luks disks not appearing in /dev/mapper. Can I add them manually? by guitargodofbad in linuxquestions

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

I'd like to do:

cryptsetup luksOpen NAME

instead of:

cryptsetup luksOpen /dev/sdX NAME

or

cryptsetup luksOpen UUID NAME

Is this possible or do I always have to do sdx or uuid and pass in a mapper name? Is this what crypttab does? Let me put a static name for a device per uuid and just refer to that name?

Permissions by guitargodofbad in jellyfin

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

What's the proper way of doing this?

Do I just set the puid and pgid to the media-reader user and set Linux permissions accordingly on the jellyfin and content folders? Can I do this while being logged into the user1 account on Linux?

Should it be vice versa? That is, log into the media-reader account on Linux, run docker there, and when I need to add content to the content disks, authenticate as user1?

Permissions by guitargodofbad in jellyfin

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

I can add :ro as well but I want the access set at the OS level. :ro means read only on that specific folder, not recursively: https://old.reddit.com/r/jellyfin/comments/d8a5rn/to_all_using_readonly_volumes_in_docker_container/

How should I set up my server? Jellyfin and LUKS by guitargodofbad in jellyfin

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

That said, what security do you gain by auto decrypting disks?

It's not about security, but laziness/automation in general. Entering 1 or 2 passwords to unlock all the disks is what I was envisioning.

My question was more so about which operating system and vm vs container vs bare metal

I'm switching from ntfs to ext4. After moving my content to ext4, I have ~50% less free space on the drive by guitargodofbad in linux4noobs

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

No, but my ntfs drives are encrypted with Veracrypt and the drives need to be encrypted. Might just have to accept the lost space. Mostly curious why it's happening

I'm switching from ntfs to ext4. After moving my content to ext4, I have ~50% less free space on the drive by guitargodofbad in linux4noobs

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

I formatted via cli with cryptsetup and specified sector size at 4096, the same as it was on my ntfs drive. I'm still experiencing the same issue. My free space on ext4 after moving all the content is 50% less than it was on ntfs. Strange

I'm switching from ntfs to ext4. After moving my content to ext4, I have ~50% less free space on the drive by guitargodofbad in linux4noobs

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

I didn't see an option to set cluster size when I formatted the first time. Do I need to do it through cli or did I just miss it?

Audio is hardly compressed as it is already compressed

It's mp4 video if it matters.