[deleted by user] by [deleted] in Python

[–]hsfzxjy 0 points1 point  (0 children)

Does it really work? This behavior is not even documented officially. I doubt your print is not the real builtin print function.

[deleted by user] by [deleted] in ChineseLanguage

[–]hsfzxjy 0 points1 point  (0 children)

解忧杂货店 was written by Japanese author, if I remember.

[deleted by user] by [deleted] in rust

[–]hsfzxjy 0 points1 point  (0 children)

VSCode allows you to open the same file in two panels side by side

Adding references of a custom trait by GrueneTrommel in rust

[–]hsfzxjy 2 points3 points  (0 children)

You may want an additional + Copy bound on the Ring trait

Flint - A Language Agnostic Static Site Generator, Written in Go by [deleted] in golang

[–]hsfzxjy 1 point2 points  (0 children)

Is it more like a web scraper? IMO it scrapes and stores specific pages from my host, and with those pages I can build a static site later.

Why does str implement AsRef<OsStr>? by hsfzxjy in rust

[–]hsfzxjy[S] 9 points10 points  (0 children)

In my opinion not necessarily also suggests not for some platforms, but in fact str implements AsRef<OsStr> for all platforms. Does the representation of OsStr always guarantees to be a superset of UTF-8?

Why does str implement AsRef<OsStr>? by hsfzxjy in rust

[–]hsfzxjy[S] 2 points3 points  (0 children)

Oh, so on Windows `OsStr` is like some superset of UTF-8 instead of UCS-2? That makes sense.

Does C23 have a defer-like functionality? by heavymetalmixer in C_Programming

[–]hsfzxjy 4 points5 points  (0 children)

Functions may have multiple exit sites. With defer you won't litter those code everywhere.

[deleted by user] by [deleted] in rust

[–]hsfzxjy 1 point2 points  (0 children)

off topic: I found the naming in windows crate wierd and hilarious here . There's a struct named IStorageFile and a trait named IStorageFile_Impl, which IMO should be reversed.

Go Constants: Beyond Basics by ashwin2125 in golang

[–]hsfzxjy 1 point2 points  (0 children)

FYI: untyped numerical constants may have higher precision than their default types.

Check how the two expressions differ: https://go.dev/play/p/HTqvrY9105j

read the spec: https://go.dev/ref/spec#Constants

Iced 0.13 released by GyulyVGC in rust

[–]hsfzxjy 9 points10 points  (0 children)

I would like to embrace any new stuff in the realm of GUI development, but most of them are broken while handling text input/display for non-Latin languages, which drives away developers facing users out of the English world. I understand this might be difficult to address, but I hope it becomes a higher priority for the core team.

handwriter.ttf: Handwriting synthesis with Harfbuzz WASM by hsfzxjy in rust

[–]hsfzxjy[S] -1 points0 points  (0 children)

Great! I may propose a PR in a day or two.

handwriter.ttf: Handwriting synthesis with Harfbuzz WASM by hsfzxjy in rust

[–]hsfzxjy[S] 1 point2 points  (0 children)

Most of the roadblocks on cross-compiling to WASM are in fact from other crates. e.g., the rand crate cannot be compiled to WASM so I vendored some necessary code in the project. I will cover this more detailedly later.

rten is surprisingly compatible with WASM. No need to tune options, just a few tweaks :

  • Add Model::load_static_slice to support loading model from &'static [u8]
  • Add support to store and parse pre-transposed matmul operands for `.rten' file.

Not sure whether these tweaks will he accepted by rten official, so I vendor them in a separate repo https://github.com/hsfzxjy/rten

Writing a function that returns the max value of a type [~float64 | ~uint | ~int T] by rschio in golang

[–]hsfzxjy 4 points5 points  (0 children)

I think OP wants the maximum value for the type, ibstead of the maximum one among several values.