There are shorter options in Nim too, depending on your stylistic preferences
let sorted = entries.sorted(proc (a, b: Entry): int = cmp(a.timestamp, b.timestamp))
let sorted = entries.sorted((a, b) => cmp(a.timestamp, b.timestamp))
let sorted = entries.sortedByIt(it.timestamp)
I suppose you could change the whole proc to something like
proc groupIntoThreads(entries: seq[Entry], threshold: int): seq[seq[Entry]] =
let sorted = entries.sortedByIt(it.timestamp)
for i, entry in sorted:
if i == 0 or entry.timestamp - sorted[i - 1].timestamp > threshold:
result.add(@[sorted[i]])
else:
result[^1].add(sorted[i])
You're misreading that. The survey ranks USA as #3 overall, but #22 on quality of life. The overall ranking is mainly thanks to the agility (#1), power (#1), entrepreneurship (#2) and cultural influence (#3). The other categories aren't that good: https://www.usnews.com/news/best-countries/united-states
I think a lot of people here are being confused by all the talk about "implicit interfaces" in the article. It's not actually talking about interfaces in C# at all, just about the old-fashioned way of passing callbacks.
If you consider that a problem, you would also have the same problem in any other language with first class functions. Someone might define a `readSomething(string -> int) -> ...` function. Does that mean everyone who now defines a `string -> int` function must make it suitable for `readSomething`? Obviously not. It's up to the caller to pass correct arguments to the functions they are calling.
The courses page is also down. It's the pages of individual courses that are still up; it looks like they're hosted in separate subdomains. We'd need a list of links to all the course pages. Doesn't really help if they're up if we don't know which ones are available.
The Java course (https://java-programming.mooc.fi/) was being updated every year until a couple years ago when they switched to Python. I did it in 2020 and it was certainly a good introduction to programming. I don't know about the new Python edition.
You could just build the example in C#, grab all the required dlls from it and then load them in PowerShell with `Add-Type -Path '.\QuestPDF.dll'`.
Unfortunately it looks like this uses extension methods for everything, and those are a pain to use in PowerShell. You'll probably want to write the PDF creation bits as a C# cmdlet instead.
What did you find fishy about them? They seem roughly the same, aside from the countries involved with the projects having a bit more local information.
The Dutch and German are a lot longer than the quite short English version. But ... that's just a matter of organisation: in the English the editors chose to make separate "Nord stream {1,2}" articles, in other languages they folded it in one article. On the German one in particular it's just two huge sections.
In short, it's fishy in the same way that bread tastes like fish: not at all.
I have absolutely no idea whether it applied to that case, too, but I've found that Wikipedia's language mapping sometimes breaks down when there's no easy 1:1 mapping between articles in differing languages.
They don't. What aidenn0 said applies to all CL implementations, although with a small correction that it's not "any already compiled forms", but rather any variables/objects that already hold the value of `#'foo` that will keep pointing to the old definition. Compiled code calling `(funcall #'foo ...)` will get the new definition normally (unless `foo` is inlined).