HNHacker News
TopNewBestAskShowJobs

juki

285 karma · joined January 14, 2017

submissionscomments
juki··on C# 11 Preview Updates – Raw string literals, UTF-8 and more
No, they're still UTF-16.
juki··on Comparing the C FFI overhead on various languages
.NET core is .NET nowadays. The old Windows only .NET framework isn't being developed anymore (other than fixes).
juki··on The business case for fewer developers in meetings
At least in Finland you get the holiday pay (0.5 * salary) on top of the normal salary. It can also be converted to additional days off.
juki··on Jeffrey Snower was originally demoted over PowerShell
If you use `Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete` it will show the options and the types of the arguments, but yeah, I don't think there is a completion function available that orders them based on history or shows the docstrings.

In principle there isn't anything that would stop one from making that. PowerShell has history info available, and help messages/docstrings can be given for parameters (`Get-Help command -full` will show them if available).

juki··on Jeffrey Snower was originally demoted over PowerShell
> It doesn't appear to have completions matching those shells

What kind of completions do you mean? PowerShell has completion for commands, parameter names and arguments. You can define arbitrary script blocks to do custom completion (or for simple cases just use `ValidateSet`). They can be defined either in the script/function itself, or separately with `Register-ArgumentCompleter` (that also works for non-PowerShell programs).

juki··on Jeffrey Snower was originally demoted over PowerShell
> syntax and case sensitivity have always been a barrier for me

Can you clarify that a little? PowerShell isn't case sensitive, and the syntax is just a mixture of traditional shell syntax (pipes, operators like -eq/-ne/-lt/-gt, etc.) and conventional C#-like syntax (if/elseif/else, switch, ?:, ??, try/catch/finally/throw, etc.).

juki··on Unix command line conventions over time
The Verb-Noun convention isn't that bad once you learn the approved verbs well enough to know which one the command you're looking for would be using. After you have the right verb, tab-completion works fine. Also, `Get-Command` (built-in alias `gcm`) is very helpful. E.g.

  PS> gcm *build*

  CommandType     Name                                               Version    Source
  -----------     ----                                               -------    ------
  Alias           Build-Checkpoint                                   5.8.6      InvokeBuild
  Alias           Build-Parallel                                     5.8.6      InvokeBuild
  Alias           Invoke-Build                                       5.8.6      InvokeBuild
  Application     mcbuilder.exe                                      10.0.2200… C:\Windows\system32\mcbuilder.exe
Or find everything from a module:

  PS> gcm -m InvokeBuild

  CommandType     Name                                               Version    Source
  -----------     ----                                               -------    ------
  Alias           Build-Checkpoint                                   5.8.6      InvokeBuild
  Alias           Build-Parallel                                     5.8.6      InvokeBuild
  Alias           Invoke-Build                                       5.8.6      InvokeBuild
And at least if you use `MenuComplete` for tab (`Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete` in your profile), you can also just write `*<noun>` and hit tab. It will offer completions regardless of the verb.
juki··on When I tell the Windows Terminal team something is simple, I am "misguided"
True, the slow startup is annoying (especially if you load modules in your profile), but overall I still think it's better than the alternatives. I usually just keep a terminal window always open.
juki··on When I tell the Windows Terminal team something is simple, I am "misguided"
Windows Terminal is a separate project from PowerShell. It's just a terminal that you can use with different shells (including PowerShell).

I have no idea what their blog posts are saying, but at least I've always found it pretty nice.

juki··on A first for Canada: New type of nuclear plant opening by 2028
I think yodelshady is saying exactly that they don't need gas plants to cover nuclear while they do for wind.
juki··on The bottom is dropping out of Netflix
They have different prices for different countries.
juki··on California grid set record of 97% renewable power on April 3
At least in Finland pretty much every electric company offers "pörssisähkö" contracts using either hourly or daily prices. Afaik they all provide an app to see the prices, or you can get them directly from Nord Pool.

Since German prices are on that map, I assume there are at least some companies doing that in Germany too.

juki··on California grid set record of 97% renewable power on April 3
Nord Pool covers a large part of Europe: https://www.nordpoolgroup.com/en/maps/#/nordic

Your actual contract would be with some local electric company that uses Nord Pool (or some other provider).

juki··on The tank is dead: Long live the javelin, the switchblade, the ... ?
Finland also just recently signed a deal for 64 F35s after several years of research and comparing alternatives. I'm fairly confident that if there was some significant problem, they would have picked something else.
juki··on The chicken you are eating has increased 364% in size over the last 50 years
They are/have been also used to promote growth. That's banned in the EU at least, but I think American producers still do it.

https://en.wikipedia.org/wiki/Antibiotic_use_in_livestock#Gr...

juki··on Ask HN: Have you created programs for only your personal use?
> It was too much hassle to add new entries (I'm lazy), so now I have a utility that inserts journal entries in the correct place from the command line

Wouldn't it be easier to just use org-mode's capture functionality (https://orgmode.org/manual/Capture.html)? I.e.

  (setq org-capture-templates
        '(("j" "Journal" (file+olp+datetree "~/journal.org") "* %?")) ;Add more templates as needed

  (global-set-key (kbd "C-c c") #'org-capture)
Then `C-c c j` will prompt for a new entry, `C-c C-c` to save it. The `file+olp+datetree` will automatically put them in a year/month/day hierarchy.
juki··on Dunbar’s number and how speaking is 2.8x better than picking fleas
> Even now, a company in many militaries seems like the smallest unit that's somehow "self-contained" or capable of independent operation and logistics in a way neither a platoon or a battalion does.

Do you have company and battalion mixed up here? Why wouldn't a battalion, which consists of companies, be capable of independent operation if the individual companies are?

juki··on Show HN: Google Maps Shadow Calculator
> Could this be used to generate large scale 3d building models automatically?

A lot of places have lidar data available that can be used for that.

juki··on I used Apple AirTags, Tiles and a GPS tracker to watch my husband’s every move
Legal matters always depend on the jurisdiction. Here in Finland, for example, everyone has the right to privacy and "secrecy of confidential message". The law has a couple exceptions, but things like age or who pays for devices are not among them. A parent may only read a specific message addressed to their child if there is justifiable reason to believe that reading that specific message is necessary for the child's safety.

Of course it's pretty rare for children to actually press charges against their parent for that, but it has happened. Using computer software "designed or modified to" violate the law is also specifically mentioned to make it an aggravated offense, with maximum penalty of 3 years in prison.

juki··on MirageOS 3.0 (2017)
Looks like it's trying to use pkg-config to find the necessary flags for the library: https://github.com/sionescu/iolib/blob/master/src/syscalls/f...

The proper solution would be to install it somewhere and configure pkg-config to find it, but you could just try putting the headers in /usr/local/include and see if it finds them.

I think your system package manager has installed your SBCL/asdf in some weird way. It would be best to just uninstall it all and build SBCL from sources yourself (it has asdf bundled with it). The binary releases for FreeBSD on sbcl.org seem to be ancient versions.

juki··on MirageOS 3.0 (2017)
It's a bit weird that it would load asdf despite --no-userinit. Maybe there's something in your system init. In that case adding --no-sysinit in the command line might help.
juki··on Alternative privacy-respecting front ends for popular services
The last three commands are the whole installation (`git clone` and `cd` would be required anyway). Adding a completely unnecessary dependency to a second build tool just to invoke tasks in the build tool they already use would be pretty silly though. They could just define a nimble task to do all three at once.
juki··on An interview that disappeared – FIFA World Cup Qatar 2022
You're forgetting that those non-Qataris are almost all migrant workers, so the population is extremely skewed towards relatively healthy 20-50 year old men. Also, people aren't just worried about directly work related deaths, but about bad living conditions in general.

https://en.wikipedia.org/wiki/Demographics_of_Qatar

juki··on Nim 1.6.2
> but why not add something new like memory management to learn about?

You can learn that with Nim too. It supports manual memory management like C. The new ARC/ORC GC also works more like modern C++ than a traditional GC.

> its wasm support would integrate with your JS knowledge

Nim can also compile to JS. Or you could compile it first to C and then compile that to wasm, although that's not supported out of the box.

juki··on Old McCarthy Had a Form
> A function per slot written inside the module that owns the symbols?

Yes, usually you define accessors/readers for the slots that you want to be available to others. An accessor is basically a function that can be used like a variable, but allows arbitrary code to run when getting/setting it (this is important to allow macros to be written without having to constantly worry about whether something is a function call or a variable). The `defclass` macro has an option to automatically generate accessors, readers or writers for the simple case (just directly reading/writing the slot), but you can also define more complex ones by hand.

You could of course also export the symbol to allow direct access to the slot, but accessors are the typical choice.

juki··on Old McCarthy Had a Form
In CL, slots are named by a symbol, and anyone can access it if they have access to the symbol. Symbols however are, by default, internal to a package (~namespace). Internal symbols won't be included when someone imports the package to another one. They can still be used from outside the package, but it requires explicitly using the double-colon `package::symbol`-syntax.
juki··on Bash patterns I use weekly
Powershell is also a good option nowadays (although a lot of people on HN seem to dismiss it for various, imo rather superficial, reasons).

  PS> (irm https://api.github.com/repos/lmorg/murex/issues) | % { echo "$($_.number): $($_.title)" }
  380: Fail if variable is missing
  379: Backslashes and code comments
  378: Improve testing facility documentation
  377: v2.4 release
  361: Deprecate `swivel-table` and `swivel-datatype`
  360: `sort` converts everything to a string
  340: `append` and `prepend` should `ReadArrayWithType`
Or just

  PS> (irm https://api.github.com/repos/lmorg/murex/issues) | format-table number, title

  number title
  ------ -----
     380 Fail if variable is missing
     379 Backslashes and code comments
     378 Improve testing facility documentation
     377 v2.4 release
     361 Deprecate `swivel-table` and `swivel-datatype`
     360 `sort` converts everything to a string
     340 `append` and `prepend` should `ReadArrayWithType`
Or even `(irm https://api.github.com/repos/lmorg/murex/issues) | select number, title | out-gridview`, which would open a GUI list (with sorting and filtering), but I think that only works on Windows.
juki··on Finland Divided: The Finnish Civil War 1918
There was a Hungarian volunteer battalion that came to Finland for the Winter War in early 1940, but as far as I know, the war ended while they were still in training, so they didn't participate in any battles.
juki··on Trie in JavaScript: The data structure behind autocomplete
No, it mutates the input trie. If you call `insert(trie, "foo")` with an empty trie, it will be modified to look like

  {'f': {'o': {'o': {END: True}}}}
I don't think this implementation is efficient enough to ever be worth using in a real program, though.
juki··on Female African elephants are evolving without tusks due to ivory poaching
> -- 8.7% of females born to two-tusked females were two-tusked

... were tuskless, you mean?

← PreviousPage 2 of 6Next →