• 1 Post
  • 25 Comments
Joined 2 years ago
cake
Cake day: June 10th, 2023

help-circle
  • Yeah, theres a lot of old old laptops which make no sense to run. But there’s a growing crop of more recent used devices that are only being sold off because they don’t support Windows 11, and the power efficiency story changes there. The OOP mentions “8.1 lappies”; my main laptop has a 15W 8th gen which is only in the last year starting to feel less appropriate for desktop use. (And honestly, a RAM and storage bump will probably get me another couple years.)

    For environmental concerns, youve got to tax new devices with manufacturing costs as well.

    100% agree about VMs though.



  • I don’t fit into any of those categories.

    Its obtuse, old, and doesn’t have a lot of functionality of modern code editors

    Obtuse? Yeah. The keyboard focus means natural discoverability is low. But I immediately preferred modal editing once I learned it.

    Old? Eh, most people use Neovim nowadays and write plugins in lua. Even in OG Vim, Vim9script broke compatibility for a better dev experience.

    Functionality? Out of the box, it is just a text editor. But only VSCode might have a more active plugin ecosystem. ALE has been a thing for ages if it’s LSP support you’re looking for.

    It’s not better, it’s not worse, I’m not in any way superior for using it, but I love it for a reason.




  • Relevant except below, bolded is the key point.

    -v prints non-printing characters in a visible representation. Making strange characters visible is a genuinely new function, for which no existing program is suitable. (sed -n l, the closest standard possibility, aborts when given very long input lines, which are more likely to occur in files containing non-printing characters.) So isn’t it appropriate to add the -v option to cat to make strange characters visible when a file is printed?

    The answer is “No.” Such a modification confuses what cat’s job is  concatenating files  with what it happens to do in a common special case  showing a file on the terminal. A UNIX program should do one thing well, and leave unrelated tasks to other programs. cat’s job is to collect the data in files. Programs that collect data shouldn’t change the data; cat therefore shouldn’t transform its input.





  • It’s interesting, the results here are way different than the Code Golf & Coding Challenges Stack Exchange. I would never expect Haskell to be that low. But after looking at code.golf, I realize it’s because I/O on CG&CC is more relaxed. Most Haskell submissions are functions which return the solution.

    Sidenote: I like the CG&CC method, it’s semi-competitive, semi-cooperative.

    • all languages welcome
    • almost all users post “Try it Online”/“Attempt This Online” links
    • most users post explanations under their submissions
    • often people will post solutions beginning with “port of user1234’s excellent Foolang answer” when there’s a clever shortcut someone finds
    • or people will post their own solution with “here’s a solution which doesn’t use user1234’s algorithm
    • or people will add comments to answers with minor improvements

    IMO It’s geared towards what is the best part about code golf: teaching people about algorithm design and language design.


  • Gamma@programming.devtoLinux@lemmy.mlMet a nice lady at the grocery store
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    2 years ago

    My experience is still a good success rate there. Back in ~2015 my family got an USB WiFi card which needed an out-of-tree module, which the manufacturer had on Github, complete with DKMS instructions. It was upstreamed after about a year, though!

    The only completely unsupported device I’ve had is my laptop’s fingerprint sensor.



  • This has never stuck with me, and I hadn’t thought about why until now. I have two reasons why I will always write ${x}_$y.z instead of ${x}_${y}.z:

    • Syntax highlighting and shellcheck have always caught the cases I need to add braces to prevent $x_ being expanded as ${x_}.
    • I write a lot of Zsh. In Zsh, braces are optional in way more cases. "$#array[3]" actually prints the length of the third item in array, rather than (Bash:) the number of positional parameters, then the string 'array[3]'.





  • I’m pretty sure both are possible in xkb. But you’ll have to learn how to get a custom xkb_keymap into your DE of choice. I only learned enough to do one mapping:

    xkb_keymap {
    	xkb_keycodes  { include "evdev+aliases(qwerty)" };
    	xkb_types     { include "complete" };
    	xkb_compat    { include "complete" };
    	xkb_symbols   {
    		include "pc+us+inet(evdev)"
    		key  {
    			type= "TWO_LEVEL",
    			symbols[Group1] = [  Multi_key,                Caps_Lock ],
    			actions[Group1] = [ NoAction(), LockMods(modifiers=Lock) ]
    		};
    		key  {[ Escape ]};
    	};
    	xkb_geometry  { include "pc(pc105)" };
    };
    

    This remaps Capslock to Escape, Escape to Compose, and Shift+Escape to Capslock. Not what you want, but hopefully this will give you a starting point to playing/breaking xkb.

    Another benefit of doing this with xkb: it’s now a separate codebase from X.org, and is used in every Wayland compositor I know of.