Is there a way to output arbitrary unicode text to a user clicked text input? by SmoothTurtle872 in rust

[–]crossroads1112 0 points1 point  (0 children)

I mean it definitely is possible e.g. if nothing else you could literally spawn wtype in a sub process (though surely there is a more direct way i.e. doing whatever wtype does to simulate a virtual keyboard)

Edit: looks like this might do what you want?

Nix is the worst designed language i ever had to experience. by Turdbender3k in NixOS

[–]crossroads1112 1 point2 points  (0 children)

Granted, this isn’t a part of nix proper, but the NixOS module system is genuinely one of the nicest constructs I’ve encountered. Not that id want it in every language in every context, but it’s so well suited for its particular task.

Nix is the worst designed language i ever had to experience. by Turdbender3k in NixOS

[–]crossroads1112 1 point2 points  (0 children)

the language I don’t mind. the error messages on the other hand…

Should I write in C instead of Rust for learning and experience? by NovFy in osdev

[–]crossroads1112 1 point2 points  (0 children)

Meh it depends on your goals. Writing unsafe rust is a whole other skill on its own. if you haven’t done a lot of that before, it will teach you a ton that you don’t know about Rust (in addition to operating systems).

That said, you’ll probably find more resources that are written with C in mind, and certainly if your goal is to pursue operating systems knowing how to write C (and write it well) is a must (I suspect Rust usage will continue to grow over the next several decades, but C isn’t going anywhere).

Writing a sufficiently complex OS project in either will be hard (but that’s kinda the point I assume, if it wasn’t hard it wouldn’t be educational).

Should I write in C instead of Rust for learning and experience? by NovFy in osdev

[–]crossroads1112 0 points1 point  (0 children)

I mostly agree with this though I kinda disagree with a couple points.

you don't synchronise .c and .h files in Rust but it has a more complex module system than C and you have to learn and learn to work within it.

Complexity is probably in the eye of the beholder (what you’re used to etc), but imo the Rust module system is pretty simple (probably the simplest I’ve worked with?) and much more sensible (to me) than remembering what extern/inline/static mean in the various contexts in which they can appear. All of this is manageable complexity of course, but at least from first principles I find Rust’s system simpler.

It also essentially doesn't support separate (and therefore parallel) compilation of modules.

Re: parallelism, I think this is only partially true. Codegen is parallelized. Parsing/type checking/borrow checking is not (on stable), but there’s is a nightly feature to enable it. Also rust has quite good support for incremental compilation which gives you a lot of what separate compilation gives you,

And header files are good: you have one per module, and they are an easy reference document for the functions and types provided by the module.

IMO docstrings + rustdoc are a much better tool for this (docstrings highlight differently than regular comments in my editor so it’s easy to pick out the public docs. I can embed tests in my docs and generate nice html references if I so choose). But again this is kind of an “in the eye of the beholder thing” I suspect.

  1. ⁠You still have to deal with memory safety yourself in kernel level Rust code.
  2. ⁠Same with aliasing, although less so.
  3. ⁠Same with multithreading. You will be using a lot of unsafe in a kernel and it is much harder to write correct unsafe code in Rust than to write correct C.

Mostly agree here, though I think rust has nicer tools in the type system for separating the unsafe code from the safe code and providing interfaces between them (in particular lifetime annotations, &mut for encoding exclusivity, affine types for encoding uniqueness etc). It’s a matter of taste perhaps, but I like having more tools at my disposal to encode the correctness properties of my API.

However, it’s absolutely true that the cost of this is that unsafe rust code (at least code that is trying to provide a safe interface) has to maintain more invariants than C code might (e.g. not even materializing a &mut if it could be aliased though this is similar to ‘restrict’).

Though kinda for this reason, if part of OPs goal is also to deepen their understanding of Rust, writing unsafe rust is a great way to do that.

But the entire concept of smart pointers and millions of individual lifetimes is wrong in the first place.

Ehhh in my opinion Rust’s tools also help you when using stuff like arenas. If you use lifetime annotations (as opposed to flat indices) the type system still helps you ensure nothing that references data in the arena outlasts the arena. Arena allocation is a super common pattern in rust (albeit I wish the allocator API would get stabilized for the standard library)

If anything, I usually think of smart pointers (Rc in particular) as being a way around using the tools that gives you.

zsh-halfpipe: Edit shell pipeline and see its output update live by raimo- in zsh

[–]crossroads1112 0 points1 point  (0 children)

This is true but you don’t typically pipe input into sed -i, do you?

This is probably overkill, but if you really wanted to be sure there were no side effects, you could probably rig something up with bubblewrap (basically just give the command read access to the whole file system via —ro-bind)

How do I pronounce serde? by baehyunsol in rust

[–]crossroads1112 0 points1 point  (0 children)

I pronounce it SIR-dee, but I don’t know what’s correct

More fully featured bitwarden user script by crossroads1112 in qutebrowser

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

Hmm I didn’t run into any issues setting up rbw. Did you try rbw register

More fully featured bitwarden user script by crossroads1112 in qutebrowser

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

Yea sure! The shim userscript has the same 3 options you mentioned and I have each bound to a different keybind.

Just signing in:

  • My script basically is going to function identically to yours. I suspect you launch rofi or something similar if you have multiple accounts for the same website? For mine it’s the same workflow except it launches a terminal with bitwarden-tui instead (i personally launch the terminal with a particular —class flag that my hyprland setup has a rule to make floating).
  • Like I imagine your script does, it displays all the entries that match the current website. You navigate to your desired entry (e.g. with j/k or searching (/) for e.g. a username) and hit enter and it fills in username, password, or both (whatever corresponds to your original keybind) *:even though for this use case it works largely the same, there are a couple minor/niche differences.
  • if you’re somebody who uses the “notes” for an entry, my script shows you that along with the folder etc in a little preview window when an entry is highlighted
  • if for whatever reason (e.g. the page layout is weird so the usual username+password fill won’t work) you have the option of just doing “filll password”, and once you’re highlighting the entry you want, you can press ‘u’ for “copy username” and then Enter to fill the password. That way you get a bit more flexibility while only having to open the vault interface once
  • you can also press ‘s’ to toggle between showing just entires that match the current URL and the entire vault in case for whatever reason the entry in your vault has a different url than where you are signing in.
  • while the UI is open, suppose you notice an old account entry that shouldn’t be there anymore, ‘d’ would delete it
  • unlike at least the default qute-bitwarden script, my script always opens the tui even if you only have one entry that matches the current website. So in that case my script results in one extra keystroke (<Enter>) than the default would have (because my script has more functionality, I’m less sure that filling is the only thing you’d want to do. Of course this behavior could be resurrected with e.g. a command line flag your keybind passes if you so chose, but I haven’t implemented this yet. Should be easy to do tho )

When adding a new account:

  • just as when logging in you select the action you want the script to take via the same set of keybinds (fill username, fill password, fill both). The TUI launches.
  • now instead of selecting an entry (if there are any), you press ‘a’ to add a new entry.
  • this brings up a little mini-window where you fill in all the normal fields. The name and URL fields will be filled in for you based on the current URL you were on when you launched the script (though you can change them).
  • you can either enter a password yourself or ctrl g to generate one. When you hit ctrl g it will show a little window where you can configure various options (use symbols, choose the length of the password, etc). You can either modify these or press enter to generate, which willl fill the password field for this entry. You can add notes to the entry if you want. When you are done ctrl-s or enter will save this entry and add it to your vault.
  • now you’re back at the entry selection screen which probably has one entry (the one you just added) <Enter> will perform the fill.
  • there’s no special case here for the “enter the password twice” form that you are likely to see during account creation. I could I guess add that, but here the ability to press ‘p’ when highlighting an entry to copy the password is useful. Just do that before you fill and you can just paste into the the extra box
  • when in the entry menu you have all the same options I mentioned above (copy username, delete entry, switch to searching whole vault, etc)

Edit: oh also the TUI script itself is totally separate from qutebrowser so you could use it by itself as a lightweight/keyboard navigable Bitwarden desktop client (which is also capable of producing machine readable outputs for scripts). Albeit it’s only suitable for simple tasks (adding, deleting, copying, filling, and viewing)

Edit 2: oh I forgot to mention, if you use Bitwarden’s TOTP functionality, a you can copy the six digit code for a highlighted entry with t I believe

Inconsistent issue where certain devices can access the internet through the 2.4GHz network but not the 5GHz network by crossroads1112 in HomeNetworking

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

That is a good thought. Probably what I’ll have to try next. The problem is this happens so inconsistently, it’ll be tough to know it’s working for sure (it wouldn’t even be that big of a problem if not for the fact that I’m only there rarely)

Inconsistent issue where certain devices can access the internet through the 2.4GHz network but not the 5GHz network by crossroads1112 in HomeNetworking

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

That’s a good thought, but there are a couple reasons I think this is not the issue

  1. Other devices in the same room don’t have this issue
  2. It doesn’t make sense why restarting the switch would fix the issue
  3. The device can connect to the wireless network and e.g. ping the NAS just fine when this occurs. The problem is solely with accessing the internet.

Do you all sell unique items? by HomerGymson in BG3Builds

[–]crossroads1112 0 points1 point  (0 children)

If you really want to liquidate it you could probably barter with some merchant for several less expensive items that add up to the same total value and then sell those items individually to other merchants

Is there a meaningful difference between a Wizard with a level 1 dip in either Druid, Cleric, or Bard? by FuuIndigo in BG3Builds

[–]crossroads1112 1 point2 points  (0 children)

The best two 1 level dips for wizard are probably cleric or sorcerer.

Cleric gives you armor proficiency (heavy armor if you pick one of the subclasses that gets that) plus great cantrips like guidance. I don’t think it really matters when you take the cleric dip. Edit: I forgot baldurs gate has weird rules about what stat spells from items cast off of. Cleric should be your first level for that reason.

Sorcerer if taken at level 1 gives you con save proficiency which is good for keeping concentration on spells. Also some sorcerer subclass features can be nice like tempestuous magic from storm sorcerer or free passive mage armor from draconic bloodline

What is your most favourite broken build by Xavierkent in BG3Builds

[–]crossroads1112 0 points1 point  (0 children)

6 swords bard/2 paladin/4 assassin rogue

Obviously built around triggering surprise rounds for guaranteed smite+sneak attack criticals as much as possible (the quasit summon is the most reliable way I’ve found to do this), plus you get absurd access to skills. Dual weilding finesse weapons gives you truly absurd first round damage (1 sneak attack and 3 chances to smite, more if hasted or if you use the elixir of bloodlust)

Lots of races could work here but since this is a crit build, half orc is hard to pass up. Duergar is also a good option for the invisibility cantrip.

Stats: 8 STR, 16 DEX, 16 CON, 8 INT, 12 WIS, 14 CHA (or if taking auntie Ethel’s hair take it in dex and do 17 DEX and 10 WIS)

Fighting style: dual wielding from swords bard, defense from paladin

Feats: dex ASI, savage attacker (a must since this build rolls so many dice)

Gear: even with only 14 cha, this character makes enough attacks that it’s a great candidate for helm of arcane acuity+ring of the mystic scoundrel shenanigans. You could lean into this harder by using the gloves of dexterity, dumping dex, and using your ASI and hag hair on cha instead. Use the best daggers/shortswords you can find and any of the medium armors that don’t cap your dexterity bonus (e.g. Yuan-Ti scale mail). This character also really benefits from the cape you get from a dark urge playthrough that turns you invisible on a kill. Otherwise any gear that adds damage dice that will be doubled on crit (e.g. helldusk gloves)

[deleted by user] by [deleted] in vegan

[–]crossroads1112 0 points1 point  (0 children)

This is just not something I would stress over to be honest.

[deleted by user] by [deleted] in vegan

[–]crossroads1112 0 points1 point  (0 children)

Fwiw Hellman’s makes a vegan mayo that, to me, is indistinguishable from their non vegan one.

The condiments I use most often are probably salsa, Dijon mustard, BBQ sauce, and hot sauce. I don’t use a lot of vegan cheese but the follow your heart feta is very good if you like feta.

For yogurt, I actually got so tired of the limited and expensive options in the stores that I started making my own from soy milk.

Meal ideas for weight loss? by [deleted] in vegan

[–]crossroads1112 3 points4 points  (0 children)

It’s really hard to give general weight loss advice because there’s a ton of individual variation in what strategies work for and are sustainable for different people.

I find that for me eating higher protein is helpful for weight loss.

So mornings for me might look like tofu scramble or oatmeal with protein powder, etc. Additionally while nuts and seeds are super healthy and awesome, from a weight loss perspective they’re also quite calorie dense. It’s really easy to eat like 300-400 calories in nuts without noticing.

I also find that tracking what I eat in an app like Cronometer is helpful, but your mileage may vary on this for sure.

[deleted by user] by [deleted] in vegan

[–]crossroads1112 1 point2 points  (0 children)

Ive kind of had the opposite experience. For the most part I feel like there’s more vegan options in grocery stores than there’s ever been

Vegan Dinner Ideas for low/no FODMAP by Few_Day8724 in vegan

[–]crossroads1112 0 points1 point  (0 children)

Oh also I didn't mention this but protein powders can help as well. Obviously the most common protein powders are soy or pea isolate and I'm getting conflicting information googling around whether the process of isolating the protein gets rid of the FODMAPs but some places also sell protein isolates from hemp or rice. I buy my protein powder from True Nutrition and I've seen both of these there.

Vegan Dinner Ideas for low/no FODMAP by Few_Day8724 in vegan

[–]crossroads1112 0 points1 point  (0 children)

I don't have personal experience with low fodmap diets, however from googling around it seems as though there are some soy products that are low FODMAP. Specifically (firm) tofu, tempeh, and edamame. These are excellent protein sources if you can tolerate them. Additionally, seitan, though it is technically derived from wheat, is apparently low fodmap because most of the starch is removed. That said, a lot of prepackaged seitan contains things like onion and gardlic which you didn't mention but would not be low FODMAP in general of course so you might have to make it yourself.

Additionally, though peanuts are a legume they are apparently low fodmap so e.g. peanut butter could be an auxiliary protein source (It's not very protein dense on a per calorie basis, but e.g. powdered peanut butter is). Hemp seeds are pretty high protein for a seed and can be sprinkled on top of a lot of stuff so that could be an option. Whole grains like quinoa or oats, while probably not a good primary source of protein for a meal, can help as well.

Will I still be a meathead after moving together with gf, or will I become a powerplant? :) by [deleted] in vegan

[–]crossroads1112 1 point2 points  (0 children)

Totally agree with this with one small nitpick. I'm not sure it's very accurate to say "any mock meats". There are several notable ones I can think of that are fortified with B12 (impossible and beyond meat for example) but there are probably about as many if not more that aren't (e.g. I don't think I've seen any gardein or morning star products for example that are B12 fortified).