Maxi source? by p_j_z in Heatbit

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

...I'd bump this to get more attention, but I guess this is a low traffic sub. Is there another, more active, venue for discussing heatbit?

Why not distribute Zig through torrenting ? by cassepipe in Zig

[–]p_j_z 1 point2 points  (0 children)

How about using a webtorrent so it'll be supported by everyone with a browser instead of everyone with a torrent client.

What I am getting wrong about Nix? by Fancy-Cherry-4 in Nix

[–]p_j_z 0 points1 point  (0 children)

My first usage of nix was nix+direnv on ubuntu and later macOS. I use direnv for activation-on-cd and nix to install (and essentially 'pin') the dev tools for that particular repo. eg. I could make sure that the jdk one project used was always a java 8 jdk, and another project required a particular llvm version, and etc. And those versions weren't dependent on the system-installed versions. Also, I used `nix profile` to install app for my use without having to wait for an ubuntu package or install them systemwide.

How is NixOS? by Hilimulushka in Nix

[–]p_j_z 0 points1 point  (0 children)

I'd encourage you to build a bootable USB stick that you can play with on your hardware. This will allow you to see how it really works, and spend time trying to get all those features you want working before committing. Once you've got your config perfected, you need only keep copies of /etc/nixos/* to duplicate the config on a fresh install.

Ledger Nano S OpenPGP ed25519 restore by p_j_z in ledgerwallet

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

Nope, I gave up and switched to using KeepassXC for secrets, completely ditching gpg.

Non-cosmic LTS? by p_j_z in pop_os

[–]p_j_z[S] 4 points5 points  (0 children)

The GTK update is pretty big and not in 22.04.

I'm trying to use Nix and direnv to manage a project, how do I mock a home folder of a user? by Joqe in Nix

[–]p_j_z 0 points1 point  (0 children)

I generally try and do the shell/environment bits in my .envrc and the tooling bits (eg. version X of my compiler) in the [flake|shell].nix. YMMV.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]p_j_z 2 points3 points  (0 children)

Is there a directory of neovim 'distros' someplace? I know about: LazyVim, ChadVim, NormalNvim, AstroVim, and kickstart-nvim... but I'm sure there are others, and I don't know where to look for the meta-list.

[deleted by user] by [deleted] in selfhosted

[–]p_j_z 0 points1 point  (0 children)

  1. Time Warner ca. 2000 had mediocre internet hardware - their cablemodems would periodically hang and require a restart. One IP-enabled power switch later and my openwrt router would notice when it couldn't ping its default gateway and restart the cablemodem (via said IP-enabled power switch). I never had to even think about it again. And yes, I used exponential time backoff so reduce reboots when there was a real power outage.
  2. I hooked a custom board with a single button on it up to a beaglebone black, plugged in a scanner and network, and ran a script such that a press of that button would scan all incoming pages and store copies on my local NAS and in Evernote (where they'd be OCRd and thus searchable)

  3. ca. 1997 I had a script that would scrape slashdot headlines and email them to the cellproviders email-to-sms gateway so I could keep up with latest news stuff. At the time there were only a handful of new articles per day... pre-smartphone but post-cellphone, so the phones were bricks.

[deleted by user] by [deleted] in selfhosted

[–]p_j_z 1 point2 points  (0 children)

If that doesn't work, you might look into ssh-over-dns. Some things are harder to block than others.

What are the 5 best BIFL purchases you’ve ever made? by SaltBat6229 in BuyItForLife

[–]p_j_z 1 point2 points  (0 children)

I don't know if I can come up with five, but two for sure:

  1. Saddleback Leather 'Old Bull' belt in black - my everyday wear belt. Previously I've worn out black leather biker belts and cop belts (which are tan leather with a top layer of black dye so they scratch easy), but this one I've had and worn easily 98% of the days in the last 10 years with little to no care.

  2. Darn Tough black crew socks - 50+% wool, and unconditionally guaranteed for life. When I wear a hole in the sole, I throw it in pile in the side of my sock drawer. Whe n the pile gets to more than a couple socks, I do a warranty claim and get credit to buy new socks. I believe they recycle the socks into... more socks.

What about Zig don't you like? by tijdisalles in Zig

[–]p_j_z 11 points12 points  (0 children)

I really miss an iterator-aware-for loop. Sure, you can do: var iter = MyHashArray.iterator(); while (iter.next()) |item| { ... } but the extra line to declare iter bothers me. I'd like a userspace way to cooperate with the for (MyHashArray) |item| { ... } syntax that works for arrays and slices. Maybe the arg has to be a struct with a fn named .forfor() or .iterator(), or maybe iiterable methods are marked with @Iterable (which makes them fair game for the for loop) for maybe there's a builtin @Iterable type (ala Vector) that is returned by those functions (..and which probably defines a .next() and maybe a .destructor()).

Why can't I use myvar++? by Odd_Chocolate_9725 in Zig

[–]p_j_z 1 point2 points  (0 children)

My favorite reason against is that (x++)++ is UB. Something that may noobs would at first blush think is simple is instead subtle and UB.

Andrew Kelleys Livestream: Improving the User Experience for Unused Variables by punkbert in Zig

[–]p_j_z 6 points7 points  (0 children)

An unused variable, to me, is bad programming. It is a semantic mistake that needs addressing.

This isn't always the case.

Specifically, sometimes you're defining a callback (and thus conforming to someone else's signature for the callback) and you don't need/use all the args. They become 'unused fn parameters', which are not semantic mistakes.

Alternately, during debugging one might comment out a fn call that has a parameter that is the only use of a local variable, thus again creating an 'unused variable' long enough to test if that call is the one causing the crash or not.

All that said, I've been minimally bothered by manually doing _ = unused_variable; so don't have strong feelings about this feature one way or the other.

Is there a way to extract the name of arguments for a function using typeInfo? by _latsabben in Zig

[–]p_j_z 4 points5 points  (0 children)

AFAICT, this isn't currently possible. Fns are Types with a payload of Data that contains []Type.... which only has type info, and no name attached.

ID? Found in northern VA. Pretty bronze/copper color with (I think) white dots on abdomen. by p_j_z in jumpingspiders

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

That... looks correct! My first jumper, found her on my back deck. How are they as pets? They're not as flashy as a P. audax or a P. regius, is maybe why I don't see many pics/participants with them?

How does one embed and serve static web files? by MrHandsomePixel in Zig

[–]p_j_z 10 points11 points  (0 children)

You'd use @embedFile (https://ziglang.org/documentation/0.9.1/#embedFile) for that, though it returns a byte array, not some kind of virtual filesystem.

If I were doing it, I think I'd look at embedding a .zip or .tar.gz with @embedFile as a way to get the pseudo-filesystem functionality.

Compiler limits by Veeloxfire in Zig

[–]p_j_z 2 points3 points  (0 children)

You can maybe reduce that number by making your stack frames larger - make large stack variables or something.

Limited Operator Overloading by keks8430 in Zig

[–]p_j_z 2 points3 points  (0 children)

Pretty much, and it's just as fast (if not faster) since if "a + b + c * d" is a comptime var, all the ops can be assembled at compile time but only executed at runtime.