285 karma · joined Jan 14, 2017 (9y ago) · 159 submissions
comment 1y ago · link · parent
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])2.
Estlink cable disruption: Finnish Border Guard detains tanker linked to Russia(yle.fi ↗)
8 points · by juki · 1y ago · 2 comments
comment 1y ago · link · parent
comment 2y ago · link · parent
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.
comment 2y ago · link · parent
Their web development course is also very good: https://fullstackopen.com/en/
comment 3y ago · link · parent
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.
comment 3y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
No one does. Sampo is basically just a magical MacGuffin that brings wealth to whoever has it. In Kalevala it is usually understood as a mill that creates infinite grain, salt and money, but different folk stories have different interpretations.
comment 4y ago · link · parent
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView
You can also toggle between the default inline and listview with F2. Also if you install Install-Module CompletionPredictor
and add this to your profile: Import-Module -Name CompletionPredictor
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView
you also get the normal intellisense autocompletions in the listview. And remember that if you have all the help files installed locally you can use F1 to view help for the current parameter/command.comment 4y ago · link · parent
comment 4y ago · link · parent
In my experience they work well if you only connect it to a single device, but if you use the two device mode then the mic is useless.
comment 4y ago · link · parent