Ephera

joined 5 years ago
[–] Ephera@lemmy.ml 2 points 4 hours ago

Isn't that still just an alias for Invoke-WebRequest though?

At least, I heard again of that being the case not too long ago. Might have also been outdated information, though...

[–] Ephera@lemmy.ml 17 points 4 hours ago (1 children)

On Monday, one of our students at $DAYJOB asked me what projects I do in my freetime. After I infodumped on her for half an hour, she asked in disbelief "And you do these in your freetime, without being paid?".

Like, mate, did you not listen how feckin' excited I got just then? Of course, I do these in my freetime.

To be fair, though, the last project I told her about is very dry. It's a library to help automate CI builds. And the thing I'm thrilled to build is a compile-safe API for accessing the packages in your workspaces. Like, yeah, it does take a special kind of nerd to get excited about that...

[–] Ephera@lemmy.ml 4 points 5 hours ago

Pretty sure, people drawing for commissions would typically use a drawing tablet... ^^'

[–] Ephera@lemmy.ml 2 points 7 hours ago* (last edited 7 hours ago) (2 children)

Invoke-WebRequest has entered the chat

🫠

[–] Ephera@lemmy.ml 9 points 7 hours ago

I mean, Rust does have a pretty inclusive community...

[–] Ephera@lemmy.ml 11 points 18 hours ago* (last edited 17 hours ago) (1 children)

Ah, da kann ich eine Zimmerpflanze empfehlen. Insbesondere das Modell "Basilikum" könnte dir gefallen.

Jeden morgen schaut sie dich an, als hättest du sie noch nie gegossen, obwohl du täglich giest.
Und wenn du auch noch regelmäßig düngst, dann spriest das Teil so schnell, dass du regelmäßig deinen Sadismus ausleben kannst, indem du selbst mit einer Schere Stücke herausscheidest und diese dann auch verspeisen kannst.

Und selbst wenn du mal nicht oft genug schnippelst, schafft es die Diva trotzdem noch zu leiden, indem dann die höheren Blätter den Unteren das Licht wegnehmen, sodass die austrocknen und natürlich auch die einzelnen Triebe von unten herauf verholzen.

Und wenn du dann doch wieder die Schere ansetzt, um das vertrocknete Material zu entfernen, dann sieht das Teil aus als wäre eine Bombe eingeschlagen. Und natürlich morgens dann wieder als ob du sie noch nie gegossen hättest.
Bzw. gleichzeitig dann auch als ob du zu viel gegossen hättest, weil eine ausgetrockete/zurechtgestutzte Pflanze natürlich weniger Wasser braucht, wie kann man da nicht draufkommen, wo sie dir doch so eindeutige Mixed Signals sendet, und man fragt sich nur, wie hat diese Pflanze in der freien Wildbahn überlebt, obwohl sie so gewillt ist wirklich bei jeder Gelegenheit möglichst elendig zu verkommen AAAAAHHH

[–] Ephera@lemmy.ml 20 points 1 day ago (3 children)

Da müsstest du dir Unmengen an Salatblätter in's Gebälk ballern, damit das aufgeht.

Sonst werden bei einer nicht-veganen Ernährung nämlich mehr Pflanzen verspeist, weil die Tiere sich ja auch von Pflanzen ernähren und einige Kalorien selbst zum Leben brauchen, die nicht in Milch/Ei/Fleisch etc. landen.

Nur eben aus Salatblättern können wir Menschen im Gegensatz zu Wiederkäuern keine Kalorien ziehen, weshalb du dir davon sehr viele reinballern kannst.

Wobei so Wiederkäuer auch hervorragend Methan rülpsen können, wodurch der Klimawandel angekurbelt wird, wodurch langfristig noch mehr Pflanzen absterben. Also gesamtheitlich betrachtet, ist die nicht-vegane Ernährung trotzdem noch die bessere Strategie.

[–] Ephera@lemmy.ml 36 points 1 day ago (1 children)

Yeah, you don't need the urinal to be under the sink. You can just run a pipe to the urinal...

[–] Ephera@lemmy.ml 2 points 1 day ago

In many cases, you don't need an equivalent to finally, because the cleanup is automatically handled via the Drop trait, which runs cleanup code when the object is freed from memory (similar to "destructors" in some other languages).
Because of Rust's whole ownership thingamabob, it's generally entirely deterministic when this code will run (at the closing brace for the scope in which the object is defined, unless you pass that object outside of that scope).

In other cases, you don't need a finally, because nothing forces you to bubble up errors instantly. You can make a call which fails, store the error in a variable, run your cleanup steps and then return the error at the end of you function.

Sometimes, however, you do want to bubble up errors right away (via ? or early return), typically so you can group them together and handle them all the same.
In that case, you can run the cleanup code in the calling function. If you don't to want to make it the responsibility of the caller, then pull out a small function within your function, so that you become the caller of that small function and can do the cleanup steps at the end of your function, while you do the bubbling within the smaller function.
There's also ways to make that less invasive via closures (which also serve as a boundary to which you can bubble errors), but those are somewhat complex in Rust, due to the whole ownership thingamabob.

I will say, I do sometimes feel like Rust could use a better way to handle doing something before the error bubbles up. But generally speaking, I don't feel like a finally is missing.

[–] Ephera@lemmy.ml 2 points 1 day ago

You can use the anyhow crate for something quite similar to exceptions: https://crates.io/crates/anyhow

In terms of how it actually fits into Rust, you want to use anyhow for application code. If you're writing a library, then anyhow is a no-go, because users cannot match on different error classes with it. (Much like you would want custom exception classes, so that users can catch them in different catch branches and handle them differently.)

Every so often, you will also need matchable error classes within your application code, then you would have to replace anyhow with a custom error type there, too, of course.

I will also say, IMHO it is fine to use anyhow even while you're learning Rust. It is so easy that you kind of skip learning error handling, which you will need to learn at some point, but you can still do that when you actually need it.

[–] Ephera@lemmy.ml 8 points 1 day ago* (last edited 1 day ago)

I'm guessing, those people are worried that it will be removed. It's already somewhat on the line since Wayland started replacing X11, because individual desktop environments can now decide to implement it or not.

[–] Ephera@lemmy.ml 5 points 1 day ago

Man kann auch gleich einen Putsch vorschlagen. Dann laufen alle Gesetze seit 1949 aus.

 

Musste mal wieder an diesen Klassiker denken...

 

Very simple + sane extension that I found.

Puts an RSS icon into your URL bar when the webpage you're on has an RSS feed. The button is hidden, if it does not.
When you click the button, it copies the feed URL into your clipboard, so you can add it into your RSS reader. If there's multiple RSS feeds on a webpage, it shows a little dropdown and then when you click one of the entries, it copies the feed URL.

When I say "RSS", I do also mean Atom and possibly others.

193
submitted 2 months ago* (last edited 2 months ago) by Ephera@lemmy.ml to c/programmerhumor@lemmy.ml
 

Increasingly so, the more experienced I get...

144
Underappreciated top (friendo.monster)
 

Always thought top was one of those programs frozen in time since the 70s, but apparently, it has a feature set comparable to htop and the like. The default configuration just doesn't show much of it...

-15
submitted 3 months ago* (last edited 3 months ago) by Ephera@lemmy.ml to c/dadjokes@lemmy.world
 

Spoilertrans-parent

 

Found this article interesting. Some (technological) highlights for me:

She initially wrote simple Python scripts to help with chain-of-custody problems. Those scripts worked on her machine, but she had trouble delivering the software to the people who actually need it.

Yeah, Python, Java etc. are quite portable in theory, but we also always ship the runtime along with it at $DAYJOB, because we don't want to deal with different runtime versions and users failing to install them properly. And since the runtime is compiled for specific platforms, we effectively have non-portable artifacts anyways.

Deuson's first attempt at distributing her software was to bundle it using Kubernetes. That sort of worked, but it turned out to be hard to get it installed in police departments. Opening ports in the firewall is also often prohibitively hard. "Getting software into these environments is really difficult."

Eventually, she decided that the only way to make this work would be to write a single, standalone executable that does everything locally. It would need to be able to run on ancient desktop computers, in a variety of environments, without external dependencies. That's why she ultimately chose Rust to write FolSum.

I feel like our industry poured tons of effort into making things deployable via Kubernetes, but there's still an absurd amount of niches, where this just does not make sense. Always interesting to hear about yet another such niche...

One thing that users really liked about the Rust version of the application was that it starts quickly, she said. Lots of commercial software is big and bulky, and takes a while to start up, leaving users staring at splash screens. FolSum starts up almost as soon as the user releases the mouse button.

Yep, I never quite buy it when this is deemed unimportant in commercial software development. The chance of your software running all the time is really low. And if it's not running all the time, I need to start it before I can use it. If I need to wait a minute for that, that takes me out of my workflow and I'll kind of hate your software for it.

It turns out that non-technical users like the approach that she has called "GUI as docs", where the application puts the explanation of what it does right next to the individual buttons that do those things. Several users have told her that they wished other software was written like this, to her bafflement. For-profit software is often a forest of features, which makes it hard to find the specific thing one needs, especially if the tool is only rarely used, she said.

I've been looking to take that kind of approach for our GUI at $DAYJOB, too. Our software is not either something that users use all the time. They might not look at it for months at a time. It's ridiculous to assume that they will remember all the concepts, just as ridiculous as it is to expect them to look at a completely separate manual every time. So, just dotting help texts around the place seems like a good idea.

 

Result presentation (first 25 mins) and discussion of an accessibility study that Thunderbird ran. They explain various accessibility technologies (like screen readers, eye tracking etc.) and problems they encountered in their design when users relied on these technologies.

Nothing really groundbreaking in here, but still good for challenging one's assumptions.

view more: next ›