Preferences

juki
Joined 285 karma

  1. 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])
  2. 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
  3. 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.

  4. It seems to just be the landing page that's down. The course pages themselves still work.
  5. 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.

    Their web development course is also very good: https://fullstackopen.com/en/

  6. Images can also be turned off under "Text & Images" in the settings.
  7. 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.

  8. 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.
  9. 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).
  10. > If a significant advance in charging connectors is made, they can simply amend the law.

    Also, I'm not sure what the Indian law says, but at least the EU version actually requires review of current technologies every 5 years.

  11. Also, for those who speak Finnish, the materials that Lönnrot and others gathered are nowadays freely available online at the Suomen Kansan Vanhat Runot database: https://skvr.fi/
  12. > And I still don’t know what the Sampo is!

    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.

  13. Less work than trying to add named stacks to bash. If it's so central to your workflow that you're willing to put up with the rest of bash just for it, adding a couple lines to your profile can't be that big of a deal.
  14. Just get the 7th path from `Get-Location` and `Set-Location` there, e.g.

      function Set-StackLocation ($Position) {
        (gl -Stack).Path | select -Index $Position | cd
      }
  15. Assuming you have curl installed, it'll say

      curl: try 'curl --help' for more information
    
    I assume you're thinking of the old Windows PowerShell that used to have curl/wget aliased to it's own commands, but that's not the case with the new cross-platform PowerShell.
  16. Also make sure you're on latest version of PSReadLine (I had some problems with it not updating properly and had to do a manual `Install-Module PSReadLine -Force`) and try

      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.
  17. `dirs -v` would be `Get-Location -Stack`. Also in newish versions PowerShell `Set-Location` (aliased to `cd`) supports -/+ to move backwards/forwards in it's own history, so usually you don't even need to bother with `pushd`/`popd` unless you need a named stack.
  18. > blessed upgrade path for C++ applications.

    There is C++/WinRT + WinUI 3, but looking at the screenshot that will pretty much require re-designing the whole UI so it's not going to be a simple upgrade.

  19. > I guess it is because Edge is using the one that comes with Chrome

    Is it? As far as I can tell, Chrome just has a plain PDF viewer with none of the annotation/highlighting/commenting/read-aloud features that Edge has.

  20. The latest Windows 11 update just switched the task manager to the new UI style with support for dark theme.
  21. It might make sense if Francisca had just said "from Córdoba" and Jayalalithaa "from Erode, Tamil Nadu". Since everyone was talking about countries rather than states, one would reasonably expect Peter to do the same, and thus assume he is from Georgia rather than the USA.
  22. Notice that if you look at the all-time stats, the decline in the summer happens every year, so it probably doesn't have anything to do with covid.
  23. > Sony's WH-1000XM4 is a good wireless option on the go, but because it uses bluetooth it murders the quality of incoming audio if you use the mic.

    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.

  24. > You have to step through the breakpoints, right?

    This seems to be a common misunderstanding, but debuggers generally also support logpoints (print statements that you can add/remove on the fly without having to close, compile and restart the application).

  25. Too fresh. While it looks nice, it's not yet usable for anything but very simple mobile apps. I'm not actually quite sure whether it will ever be suitable for complex desktop applications; at least for now everything is clearly designed only for mobile.
  26. Same in Finland. All police officers go to the Police University College, which counts as a University of Applied Sciences, just like engineering schools.
  27. The ImportExcel (https://github.com/dfinke/ImportExcel) PowerShell module is quite useful.
  28. I haven't really tried using Edge for general use, but I do use it whenever I want text-to-speech. That's a lot better in Edge than other options I've tried.

This user hasn’t submitted anything.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal