Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)WD
Posts
8
Comments
16
Joined
2 yr. ago
  • Is your keyboard layout set correctly?

    I would suppose so, cause I used nmcli d WiFi connect SSID password PASSWORD, and the PASSWORD is displayed correctly.

    Does the SSID or password have a , or weird character?

    My password is alphanumeric, so that shouldn't be the issue. My SSID is alphanumeric + (), but I don't think that's the issue either cause I cannot connect to my password protected hotspot that is only alphanumeric.

  • Linux @lemmy.world
    0WN3D @lemmy.cafe

    nmcli unable to connect to password protected home WiFi

    Hey, I am trying to connect to my home WiFi using nmcli but can't seem to connect. The error is

     undefined
        
    Error: Connection activation failed: (7) Secrets were required, but not provided.
    
      

    The journal logs are at the bottom.

    Some context:

    • I am using arch linux ARM on a raspberry pi 4
    • I am able to connect to non-password protected networks (I created one by using a hotspot on my phone). Once I set a password for the hotspot, I am unable to connect to the same network
    • I've tried the solutions in https://wiki.archlinux.org/title/NetworkManager#Secrets_were_required.2C_but_not_provided, but no success
    • Previously, I was using netctl/netctl-auto and it worked for my use case for a while. But one day, it cannot connect so I can't ssh into my pi for a few days. I got frustrated and uninstalled it and installed nmcli which I am more familiar with. But now I can't seem to connect to a password protected network, so looking back, maybe it wasn't netctl that was the root cause of the i
    Asklemmy @lemmy.ml
    0WN3D @lemmy.cafe

    Best way to get recommended videos

    I know there was quite a bit of controversy surrounding YouTube's recommendation algorithms, but I can't seem to find a better alternative. What are the ways y'all find videos that are of interest?

    I know we could use RSS and subscribe to our desired channels and get a better experience than YT's own subscription system, but what about channel/video discovery, those that you've never seen before? Is there a better way to find a video that might be interesting to you without kneeling before the almighty algorithm? Half of the recommended page on YT seems irrelevant to me, but I can't seem to find a better alternative.

  • so don’t ever send anything you don’t absolutely have to.

    Hmm I was thinking that after I've establish a base and was going to optimize, I think that setting the multiplayer nodes to be manually updated should be ok rather than having them done periodically, since a card game game state progress at fixed events rather than being real time.

    but I generally personally prefer modifier parent nodes because the tree is very efficient and it seems to allow for more flexibility.

    One downside with nodes that I noticed is that if we store the cards in the deck as nodes under a deck node, it becomes rather annoying to manipulate them, eg shuffle them, as compared to list. Would that be enough a drawback to reconsider using a list instead?

  • Godot @programming.dev
    0WN3D @lemmy.cafe

    Quick advise on multiplayer deck builder

    Hey, I am planning on building a co-op multi-player deck builder as a side project, nothing fancy or grand of sorts.

    I'm kinda new to this Godot thing, but I kinda get the gist of it. Was always interested in it.

    I have prior experience with Game Maker and Unity, so picking up the basics was rather simple, given that I also do programming as a job. So don't simply dismiss this as too ambitious a project to start with when learning Godot.

    I just want to ask it out there, are there any advise on how I should structure the code or any advise in general? Just want to be prepared for issues in the future and plan for it.

    Basically, my initial idea of the game is think of multiplayer Slay the Spire. But I want a more elaborate upgrade system to the cards, closer to Wild Frost.

    For now, my head space for the design is to have:

    • Card details, ie names + descriptions + image are resources since they are data that are "loaded in".
    • Actual cards that exists throughout the run would be a
  • Oh, ticks are rare in my region, that's why I have no prior experience with them.

    I was thinking in the context of us slapping the mosquito would be equivalent to slamming a thumbtack into your skin which could increase the damage dealt and penetration depth.

  • Asklemmy @lemmy.ml
    0WN3D @lemmy.cafe

    Mosquito splinters

    Just a random shower thought.

    Mosquito's proboscis is sharp enough to penetrate your skin. So when you smack it while it is in the process of drawing your blood, isn't there a chance of its proboscis being forcefully jammed into your skin, leading to some sort of "splinter"? Or does it somehow loses its stiffness the moment it feels the impact?

    I've never encountered nor heard of such occurrence in my lifetime of killing those buggers, but wondering if such a thing is even possible. If such could happen, I could only imagine the risk associated with having a piece of foreign organic matter being embed in the body

    Arch Linux @lemmy.ml
    0WN3D @lemmy.cafe

    How to know why a package is being updated/installed

    Hey, sometimes when I do pacman -Syu, I see some weird package being installed and I am curious which explicitly installed package is installing/updating it.

    How do I so with pacman?

    I know we can easily find out why an installed package is being installed, but what about before the package is being installed?

  • Yea, it seems to be using 200% CPU. But I have vo=gpu though, so I'd thought the GPU would've taken some of the load.

    If I am strapped for CPU resources, how do I make it so that MPV buffer or something instead of dropping the audio when this happens? Cause it is strange the even though the visuals are acceptable, it is the audio that fails before the video

  • Linux @lemmy.ml
    0WN3D @lemmy.cafe

    MPV dropping frames and audio

    I've tried searching around and stuff but I couldn't find a working solution

    Background: I am running Arch Linux on a Raspberry Pi, mainly as a media player.

    When I run MPV, it seems to drop frames (1-2 per second). Visually, nothing looks wrong so I am fine with that.

    The issue is that after playing for some duration, the audio will just disappear. I would then need to pause the video for a while or seek backwards for the audio to come back (sometimes it just comes back on its own when I leave it playing too). I suspect it may be due to the dropped frames or maybe it's due to insufficient system resource.

    Could someone help suggest some config changes which may help with the issue? I am totally fine with the visual dropped frames, I just want to fix the audio issue.

    This is my config.

     undefined
        
    input-ipc-server=/tmp/mpvsocket
    ao=pipewire
    volume=120
    demuxer-readahead-secs=3                                
    cache=yes
    
      
  • are you running it from a tty on login

    Yea, directly on tty.

    I imagine these are two separate issues.

    I'd think they are related since mpv is working fine on Xwayland but not when I launch alacritty instead

    Can you dump your installed packages with pacman -Qe and post it here? I’ll compare it to mine.

     undefined
        
    alacritty 0.12.2-1
    ani-cli 4.6-1
    archlinuxarm-keyring 20140119-2
    base 3-1
    base-devel 1-1
    bat 0.23.0-3
    cage 0.1.5-1
    dhcpcd 10.0.2-1
    dialog 1:1.3_20230209-1
    linux-rpi 6.1.54-1
    lobster 4.0.0-1
    man-db 2.11.2-1
    neovim 0.9.1-1
    net-tools 2.10-2
    netctl 1.28-2
    noto-fonts 1:23.9.1-1
    opendoas 6.8.2-1
    openssh 9.4p1-4
    pacman-contrib 1.9.1-1
    raspberrypi-bootloader 20230921-1
    raspberrypi-firmware 20230921-1
    ripgrep 13.0.0-3
    socat 1.7.4.4-1
    tmux 3.3_a-7
    vi 1:070224-6
    which 2.21-6
    wireless-regdb 2023.09.01-1
    wireless_tools 30.pre9-3
    wpa_supplicant 2:2.10-8
    xorg-xwayland 23.2.1-1
    `
      
  • I tried with cage + Xwayland and that works perfectly, so I highly doubt that is the issue. Maybe it is something to do with cage + alacritty that is causing it, but I'm not too well versed in the Wayland stuff to know if spawning a terminal application may somehow not support audio.

  • Arch Linux @lemmy.ml
    0WN3D @lemmy.cafe

    Missing audio with MPV + Wayland

    So I know my setup is really niche, but here goes nothing

    • I am using Arch Pi on Pi 4
    • Installed cage as a lightweight Wayland compositor
    • Installed mpv + wireplumber + pipewire

    I am not quite sure how to use cage to launch a simple "Wayland session (if it even makes sense)", so that I can send MPV to that display. So I tried cage -s alacritty :1, and it does launch alacritty with it detecting that it is on wayland.

    But when I do DISPLAY=:1 mpv ...., the video runs, but there's no audio. Also there's no errors shown on mpv either.

    The other thing of note is that I tried cage -s Xwayland :1 and the audio+video works perfectly.

    So in all:

    1. How do I launch cage to spawn a simple Wayland session? Is this even possible?
    2. How do I solve the audio issue on Wayland?

    EDIT: Thanks all for the help. After some investigation, I found out the pipewire somehow is not ran on startup of alacritty, but it did for Xwayland. I noticed that the first play of the vid

  • I think there's a spectrum here, and I'll clarify the stances.

    The spectrum ranges from "Data shouldn't cause the function to do (something wildly) different" to "It should be allowed, even to the point of variable returns"

    I think you stand on the former while I stand on the latter. Correct me if I'm wrong though, but that's the vibe I'm getting from the tone in your example.

    Data shouldn’t drive the program in this way.

    Suppose we have a function that calculates a price of an object. I feel it is agreeable for us to have compute_price(with_discount: bool), over compute_price_with_discount() + compute_price_without_discount()

    You’ve basically spelled:

    I feel your point your making in the example is a bit exaggerated. Again, coming back to my above example, I don't think we would construe it as compute_price('with_discount').

    Maybe this is bandwagoning, but one of the reason for my stance is that there are quite a few examples of variable returns.

    eg:

    • getattr may return a different type base on the key given
    • quite a few functions in numpy returns different things based on flags. SVD will return S if compute_uv=False and S,U,V otherwise
  • yea, this is pretty close to what I'm looking for.

    The only missing piece is the ability to define the overload methods on the bool

    something like

     undefined
        
    @overload
    def foo(return_more: True) -> (Data, Data)
    
    @overload
    def foo(return_more: False) -> Data
    
      

    But I don't think such constructs are possible? I know it is possible in Typescript to define the types using constants, but I don't suppose Python allows for this?

    EDIT: At first, when I tried the above, the typechecker said Literal[True] was not expected and I thought it was not possible. But after experimenting some, I figured out that it is actually possible. Added my solution to the OP

    Thanks for the tip!

  • but from a practical perspective, let's say you retrieve an object and can either return a subset of its fields as your API. Doesn't it make sense to re-use the same function, but change what fields are returned?

    I'm specifically talking about the narrow use-case where your API returns either A or B of the fields, and won't extend it in the future

    The alternative is to either duplicate the function, or extract it out which seems a bit overkill if it is only 2 different type of functions.

  • Python @programming.dev
    0WN3D @lemmy.cafe

    Typehints for functions that have variable signatures

    I know what I am asking is rather niche, but it has been bugging me for quite a while. Suppose I have the following function:

      python
        
    def foo(return_more: bool):
       ....
        if return_more:
            return data, more_data
       return data
    
      

    You can imagine it is a function that may return more data if given a flag.

    How should I typehint this function? When I use the function in both ways

     undefined
        
    data = foo(False)
    
    data, more_data = foo(True)
    
      

    either the first or the 2nd statement would say that the function cannot be assigned due to wrong size of return tuple.

    Is having variable signature an anti-pattern? Is Python's typehinting mechanism not powerful enough and thus I am forced to ignore this error?

    Edit: Thanks for all the suggestions. I was enlightened by this suggestion about the existence of overload and this solution fit my requirements perfectly

     undefined
        
    from typing import overload, Literal
    
    @overload
    def foo(return_more: Literal[False