• 3 Posts
  • 59 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle


  • bad hygiene (for olodumarè’s sake, bathe daily, and if possible brush your teeth at least twice a day).

    I know this is popular in this thread, but how to achieve that? I shower 0-3 a day, with 0 being in days waiting for the washing machine for I have showered too much, and have no clothes remaining.

    It seems no matter what I do, someone thinks I accidentally opened a shower on myself by how sweaty wet my underwear is, then proceeds to tell me I smell awful and banishes me from society back to my computer, which is what I would be doing anyway, also that person is the only one that complains and they (singular) can’t handle heat at all.

    I just checked and the temperature goes up to 42*, I don’t know how hot that is, since I never look at weather, if it’s hot I bear with it, if it’s cold I get sick for 3 days bear with it.

    Also I only wear winter-y jackets for some reason (A joke that went too far that’s been lasting for 3 years?), people underestimate how good they are at shading, and they come with a built-in hat, and protect your body better than any T-shirt ever could.

    Wait did I just answer my own question?


  • It’s hard to answer your request because, you see, your statement is like saying: “Everything is just atoms, so everything is basically the same”, it is “reductionist” of higher values, which even atheists have, but the statement itself cannot be denied, nor replaced with an alternative.

    Edit: I read your other replies, and you seem to not need this one, to ignore it.







  • Doods@infosec.pubtoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    edit-2
    4 months ago

    I just got some idea yesterday regarding impl blocks, ready to be my respondent?

    I had a big impl block with 4 levels of indentation, so I cut the block, and replaced

    impl InputList {
        //snip
    }
    

    with mod impl_inputlist; and moved the impl block to a new file, and did not indent anything inside that block.

    The advantage this has over just not indenting the impl block in place, is that people will have difficulty distinguishing between what’s in the block and what’s outside, and that’s why the impl was moved to its own exclusive file, impl_inputlist.rs

    Maybe I am overstressing indentation. Ss there something wrong with my setup that prevents me from accepting 4-space indentation?

    I use:

    Editor: Neovide

    Font: “FiraCode Nerd Font Mono:h16” (16px fonts are addicintg)

    Monitor: 1366x768, 18.5 inch, 10+ years old, frankenstein-ly repaired Samsung monitor.

    Distance: I sit at about 40-60 Cm from my monitor.

    That leaves me with a 32x99 view of code excluding line numbers and such.


  • Inaccurate report,

    I just ran Neovim in terminal and was used to Neovide, so I thought it was choppy.

    Intel HD 630.

    There is, however, a 2D game - which I am not going to disclose the name of - that’s pretty broken. (It uses Adobe Flash as an engine)

    Also the steam client doesn’t maximize properly with tiling but I am sure that’s reported.

    I have been daily driving Cosmic for a week now; it caused me Arch-syndrome, everyday I run sudo apt update hoping to get some polish to the desktop.

    Edit: there’s more…

    Neovide’s transparency is completely broken, and shows a blank, though not a pitch black, color and screenshotting it results in seeing the text with a checkered background. (In the resulting screenshot only) (Running on Proton 8.0-5)

    clipboard=unnamed plus, the setting supposed to unify Neovim’s clipboard and system’s, doesn’t work. clipboard: error : Error: target STRING not available

    I also was unable to transfer a file to my phone using Cosmic Files, but Nemo worked, though I read that’s fixed in some Blog.

    Edit II: I just discovered popdev:master it seems to be a general unstable branch instead of just Cosmic things, but I took the risk and added it, I just have to remember to remove it once 24.04’s released


  • Doods@infosec.pubtoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    4 months ago

    Formatters are off-topic for this, styles come first, formatters are developed later.

    My other reply:

    How about this one? it more closely mirrors the switch example:

    match suffix {
    'G' | 'g' => mem -= 30,
    'M' | 'm' => mem -= 20,
    'K' | 'k' => mem -= 10,
    _ => {},
    }
    

    How about this other one? it goes as far as cloning the switch example’s indentation:

    match suffix {
    'G' | 'g' => {
    	mem -= 30;
           }
    'M' | 'm' => {
    	mem -= 20;
           }
    'K' | 'k' => {
    	mem -= 10;
           }
    _ => {},
    }
    

  • Doods@infosec.pubtoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    edit-2
    4 months ago

    How about this one? it more closely mirrors the switch example:

    match suffix {
    'G' | 'g' => mem -= 30,
    'M' | 'm' => mem -= 20,
    'K' | 'k' => mem -= 10,
    _ => {},
    }
    

    How about this other one? it goes as far as cloning the switch example’s indentation:

    match suffix {
    'G' | 'g' => {
    	mem -= 30;
            }
    'M' | 'm' => {
    	mem -= 20;
            }
    'K' | 'k' => {
    	mem -= 10;
            }
    _ => {},
    }
    

  • Doods@infosec.pubtoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    4 months ago

    A single match statement inside a function inside an impl is already 4 levels of indentation.

    How about this?

    The preferred way to ease multiple indentation levels in a switch statement is to align the switch and its subordinate case labels in the same column instead of double-indenting the case labels. E.g.:

    switch (suffix) {
    case 'G':
    case 'g':
            mem <<= 30;
            break;
    case 'M':
    case 'm':
            mem <<= 20;
            break;
    case 'K':
    case 'k':
            mem <<= 10;
            /* fall through */
    default:
            break;
    }
    

    I had some luck applying this to match statements. My example:

    
    let x = 5;
    
    match x {
    5 => foo(),
    3 => bar(),
    1 => match baz(x) {
    	Ok(_) => foo2(),
    	Err(e) => match maybe(e) {
    		Ok(_) => bar2(),
    		_ => panic!(),
    		}
    	}
    _ => panic!(),
    }
    
    

    Is this acceptable, at least compared to the original switch statement idea?


  • Well, what I meant was just rustfmt’s default with:

    • 80 character line
    • 8-space hard tabs

    In addition to naming local variables short names, and soft-limiting functions to 48 lines long & their local variables to 5-10 (you know, normal reasonable things)

    The part about switch statements doesn’t apply as Rust replaced them with match.*

    The part about function brackets on new lines doesn’t apply because Rust does have nested functions.

    The bad part about bracket-less if statements doesn’t apply as Rust doesn’t support such anti-features.

    The part about editor cruft is probably solved in this day & age.

    The rest are either forced by the borrow checker, made obsolete by the great type system, or are just C exclusive issues that are unique to C.

    I left out some parts of the standard that I do not understand.

    I just skimmed through the Rust style guide, and realized the only real difference between the 2 standards is indentation, and line length. Embarrassing.

    *: I experimented with not-indenting the arms of the root match expression, it’s surprisingly very good for simple match expressions, and feels very much like a switch, though I am not confident in recommending to people.

    Edit: How did I forget?! Indentation is limited to 3, increasing code readability.



  • I am on Pop!_OS, I ran sudo apt install cosmic*.

    Don’t worry, you’re not missing out on much, running video games, or any OpenGL thing including 2D games and GPU-accelerated terminal emulators is a bad experience, and alt+f4 isn’t implemented, and f11 to fullscreen is janky, and theming for buttons and such is clearly alpha.

    The promise of an Arabic-supporting, Rust based, GPU-accelerated terminal is too attractive, however, as I was teared between multilingual terminal, Wezterm, Alacritty and Kitty for a while.

    The first is horrible at everything but supporting languages, the second is really janky, the third doesn’t support tabs, the fourth has bad theming and customization.


  • wasting 10% of that space for each indentation? What are you smoking?

    As I said before, this standard is older than C itself, and the kernel’s been using it for decades, I shouldn’t have to explain it. Long tabs and short lines boost readability, and restricting indentation to 3 solves the problem. Read my reply to [email protected] for more context.

    Also rustfmt didn’t move the string in

    println!("a very long string slice with a static lifetime"); to a new line even when it exceeded a 100 columns, I should seek a solution.

    Note: The actual string I used was way longer than that.