That’s “Nemo”.
The one that’s used by Ubuntu by default is called “GNOME Files” or “Nautilus”, in case you want to do some research on it.
That’s “Nemo”.
The one that’s used by Ubuntu by default is called “GNOME Files” or “Nautilus”, in case you want to do some research on it.
Well, most people don’t have spare computers at home, so they do actually need to decide. It also means that they can’t easily try out different operating systems, so even when they’re unhappy with their current OS, they’ll rarely inform themselves about alternatives.
Yep, some code examples from the official documentation. This:
printPersons(
roster,
(Person p) -> p.getGender() == Person.Sex.MALE
&& p.getAge() >= 18
&& p.getAge() <= 25
);
…is syntactic sugar for this:
interface CheckPerson {
boolean test(Person p);
}
printPersons(
roster,
new CheckPerson() {
public boolean test(Person p) {
return p.getGender() == Person.Sex.MALE
&& p.getAge() >= 18
&& p.getAge() <= 25;
}
}
);
…which is syntactic sugar for this:
interface CheckPerson {
boolean test(Person p);
}
class CheckPersonEligibleForSelectiveService implements CheckPerson {
public boolean test(Person p) {
return p.gender == Person.Sex.MALE &&
p.getAge() >= 18 &&
p.getAge() <= 25;
}
}
printPersons(roster, new CheckPersonEligibleForSelectiveService());
The printPersons
function looks like this:
public static void printPersons(List<Person> roster, CheckPerson tester) {
for (Person p : roster) {
if (tester.test(p)) {
p.printPerson();
}
}
}
Basically, if you accept a parameter that implements an interface with only one method (CheckPerson
), then your caller can provide you an object like that by using the lambda syntax from the first example.
They had to retrofit lambdas into the language, and they sure chose the one hammer that the language has.
Source: https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
Yeah, I’m just saying that the benefit of using such a regex isn’t massive (unless you’re building a service which can’t send a mail).
a@b
is a syntactically correct e-mail address. Most combinations of letters, an @-symbol and more letters will be syntactically correct, which is what most typos will look like. The regex will only catch fringe cases, such as a user accidentally hitting the spacebar.
And then, personally, I don’t feel like it’s worth pulling in one of those massive regexes (+ possibly a regex library) for most use-cases.
Yeah, I love to rag on languages with weak typing, because of the potential for a bug, but seeing it play out in reality, directly with user input, that’s certainly something else.
Well, and remember: If in doubt, send them an e-mail. You probably want to do that anyways to ensure they have access to that mailbox.
You can try to use a regex as a basic sanity check, so they’ve not accidentally typed a completely different info into there, but the e-mail standard allows so many wild mail addresses, that your basic sanity check might as well be whether they’ve typed an into there.
I always hated the implementation for .toString()
of Duration
. It gives you a string like that: PT8H6M12.345S
(not a hash)
Apparently, it’s an ISO 8601 thing, but what the hell am I supposed to do with that?
It’s not useful for outputting to end users (which is fair enough), but I don’t even want to write that into a log message.
I got so used to this just being garbage that I would automatically call .toMillis()
and write “ms” after it.
Well, and not to gush about Rust too much, but I recently learned that its debug string representation is actually really good. As in, it’s better than my Java workaround, because it’ll even do things like printing 1000ms as 1s.
And that’s just like, oh right, libraries can actually provide a better implementation than what I’ll slap down offhandedly.
It makes it look like they’re just adding random noise to avoid colliding with existing syntax. Maybe they can try a UUID next time…
Yeah, I came to Rust from Scala and Kotlin, where equality is default-implemented (for case class
and data class
respectively, which is basically all we ever used), so this meme surprised me a bit.
I do actually like that you can decide a type cannot be compared, because sometimes it really just doesn’t make sense. How would you compare two HTTP clients, for example? But yeah, it certainly is a choice one can disagree with.
I find these videos give a very visual explanation and help to put you into the right mindset: http://intorust.com/
(You can skip the first two videos.)
Sort of when it clicked for me, was when I realized that your code needs to be a tree of function calls.
I mean, that’s what all code is anyways, with a main-function at the top calling other functions which call other functions. But OOP adds a layer to that, i.e. objects, and encourages to do all function calls between objects. You don’t want to do that in Rust. You kind of have to write simpler code for it to fall into place.
To make it a bit more concrete:
You will have functions which hold ownership over some data, typically because they instantiated a struct. These sit at the root of a sub-tree, where you pass access to this data down into further functions by borrowing it to them.
You don’t typically want to pass ownership all over the place, nor do you typically want to borrow (or pass references) to functions which are not part of this sub-tree.
Of course, there’s situations where this isn’t easily possible, e.g. when having two independent threads talking to each other, and then you do need Rc
or Arc
, but yeah, the vast majority of programming problems can be solved with trees of function calls.
The first iteration of the Rust compiler was written in OCaml…
It’s like back in the 80s, when games had amazing hand-drawn covers and then the graphics was just text or simple shapes, but now with gameplay.
Probably around 14 or something. For whatever reason, people will often name DD as a large bra size around here. It also doesn’t exist in our bra size system. Some girl pointed out that non-sense at school.
Hmm, I don’t know anything about Whoogle, but from other privacy-conscious search engines, I would expect it to work when you use that URL in your bookmark.
Three things I can imagine:
Well I,m, glad because, I, do, put a, lot of, them,.
One time, I had to hand in English homework, 1½ pages, and later got it back from the teacher with the feedback that I had only written two sentences. The first sentence spanned the whole first page, which wasn’t intentional.
You don’t want to use exceptions in normal control flow, because they’re extremely slow. Every time you throw
an exception, it has to collect a stacktrace, which is hundreds, if not thousands, of calculations, compared to a handful of calculations for returning a boolean or an enum variant.
Interesting. I almost guessed that variant, too, but figured it would be a bit too wild for a country to auto-adopt most laws that another country implements. 🙃
I’m more surprised that it even got offered there. There’s some legal hurdles to clear for selling in a new country, and I guess, one of their distribution platforms decided it was worth it.
I guess, the Vatican might not have a ton of laws, though…
I’ve found that many (past me included) don’t really make the connection that, because cows only give milk when impregnated, dairy consumption necessitates that the number of cows multiply.
I guess, if you don’t know the numbers (or don’t think about it too much, since the numbers aren’t that surprising), then you might think that one pregnancy is enough for years of milk production, or that the born cows would be bred for selling meat anyways.
They’re certainly somewhat more exotic choices.
Bazzite is currently seeing a hype wave, because it’s strongly inspired by what the Steam Deck does. But that also means, it’s somewhat built like an OS for a console (or in fact like Android), in that it’s a transactional/atomic distribution.
This means, you can’t easily make changes to the OS itself, only to the applications you install and of course your personal files.
It certainly makes it more difficult to break, but it’s still a relatively new thing in the Linux world and particularly you might still run into some limitations when trying to use it as a full-fledged desktop (depending on what you’re looking to do with your PC).
Garuda Linux is based on Arch Linux, which is what we refer to as “bleeding edge” (as opposed to “cutting edge”), because you get the newest version of all the software on your PC just a few days after it got released by the respective developers. Sometimes, those newest versions will have bugs.
You’ll find folks who’ll tell you they’ve been running Arch since they were two years old and never had a problem, but ultimately, why risk it?
And yeah, Trisquel is also getting basically a hard no from me. It’s a distribution for purists. For people who want nothing to do with the corporate world, who’d rather not be able to do something than rely on proprietary software.
If you’re coming from Windows, the chances of you even really knowing what that means are basically non-existent, so I doubt it’s what you want…