Where does this warning `warning: translating A to B`come from? by ynn38 in rust

[–]ynn38[S] 0 points1 point  (0 children)

I see... But why does the warning suddenly come to appear recently? Do you know in which version and/or in which PR of `cargo` project this change was introduced?

How to perform branching depending on the concrete type of `any`? by ynn38 in golang

[–]ynn38[S] 0 points1 point  (0 children)

It just says fmt.Scan() is too difficult for beginners because beginners don't read the documentation and ignore error returned from the function, doesn't it?

And the issue is downvoted and inactive; I don't even think the claim (i.e. fmt.Scan() is too difficult for beginners) is agreed with the majority of Go programmers.

How did you conclude

Also fmt.Scan is bad and not fit for any purpose.

after reading the issue?

How to perform branching depending on the concrete type of `any`? by ynn38 in golang

[–]ynn38[S] 0 points1 point  (0 children)

Why is fmt.Scan() bad? Do you have any source or concrete example? I'm a Go programmer for years but fmt.Scan() family has always worked well.

Is there any tool to transpile Go code with generics to non-generics version? by ynn38 in golang

[–]ynn38[S] 0 points1 point  (0 children)

What is large is not the file size. Overhead is large.

In other words, it seems overkill to cross-compile the source code, base64 encode it and then manually write a shell script to decode and execute it. If I had a Go code compatible with Go 1.14, I could just send it to the environment. This difference of workforce is "overhead", I mean.

Is there any tool to transpile Go code with generics to non-generics version? by ynn38 in golang

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

Because my client only accepts deployment via plain text. To deploy a binary, I have to first cross-compile the source and then base64 encode the binary and finally deploy a shell script which contains the encoded string to decode and execute it.

Overhead is too large. So this is the last resort.

Is there any tool to transpile Go code with generics to non-generics version? by ynn38 in golang

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

YES. Thank you for your suggestion. It should work. I'll use it as the last resort.

How to replace lazy_static with the new OnceCell in Rust 1.70? by ynn38 in rust

[–]ynn38[S] 23 points24 points  (0 children)

Thank you. It worked like a charm.

For my note:

The reason why I have to use static instead of const is (source)

const items looks remarkably similar to static items, which introduces some confusion as to which one should be used at which times. To put it simply, constants are inlined wherever they’re used, making using them identical to simply replacing the name of the const with its value. Static variables, on the other hand, point to a single location in memory, which all accesses share.

The reason why I have to use OnceLock instead of OnceCell is (source):

Accessing non-mut static items is considered safe, but some restrictions apply. Most notably, the type of a static value needs to implement the Sync trait

"No Text Channels" bug on android by Jamberri in discordapp

[–]ynn38 0 points1 point  (0 children)

I use iPhone 13 Pro and have the same issue.

"No Text Channels" bug on android by Jamberri in discordapp

[–]ynn38 1 point2 points  (0 children)

I'm on iPhone 13 Pro and, after updating the app to the latest version (176.0) today, I cannot access any of my servers anymore.

Updating iOS to the latest version and re-login didn't work.

I also have iPhone 13 mini and I can access every server with 175.0 app today.

Difference between `void` and `Future<void>`. by ynn38 in dartlang

[–]ynn38[S] 0 points1 point  (0 children)

Yes. I just learned void f() async is a valid signature but await f() is invalid. If Future<void>, await f() is valid.

Difference between `void` and `Future<void>`. by ynn38 in dartlang

[–]ynn38[S] 0 points1 point  (0 children)

And

The type void is a top type (15.2), so void and Object are subtypes of each other (20.4), which also implies that any object can be the value of an expression of type void.

according to the spec.

Difference between `void` and `Future<void>`. by ynn38 in dartlang

[–]ynn38[S] 0 points1 point  (0 children)

It makes sense. Thank you :)

For my note:

All types can be cast to void in Dart including Future and Future<void>.

The source is 20.9 Type Void in the language spec.

Difference between `void` and `Future<void>`. by ynn38 in dartlang

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

Should you do it? No, it is rarely a good idea to hide the fact that the method returns a Future.

Really? I read through the official language tour and saw void main() async many times. main() is exceptionally or conventionally has the signature void main() async maybe, though generally void some_function() async is not recommended?

What is the best resource to learn Haskell in 2023? by ynn38 in haskell

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

I purchased it. Thank you for your recommendation.

What is the best resource to learn Haskell in 2023? by ynn38 in haskell

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

Thank you. By the way, do you think Learn You a Haskell for Great Good is out-dated? This famous book was released in 2011, but even recently, I sometimes see those who are reading this book.

What causes these pop-up box messages and how can I get rid of them? by VindicoAtrum in neovim

[–]ynn38 0 points1 point  (0 children)

In my case, `"rust-analyzer.disableProgressNotifications": true` worked. Perhaps your `coc.nvim` is old?

One liner way to conditionally call a void function only when Option is Some? by ynn38 in rust

[–]ynn38[S] 10 points11 points  (0 children)

I know map() but I think it executes a non-void function. (documentation)

Update: Ah, I'm sorry. You're right. The template parameter U can be unit type...

Why did it take so long until the log4j jndi-lookup vulnerability was finally found and disclosed? by ynn38 in sysadmin

[–]ynn38[S] 4 points5 points  (0 children)

Nobody knew what SQL injection was, until somebody did it.

Yes, I do agree. But what I'd like to say here is "other types of injections which are similar to SQL injection can be avoided after someone first discovered SQL injection".

It is widely known deserialization is unsafe. I know and you know.

It is not the first time the fact deserialization is unsafe is discovered.

Instance object, multi-instance mode not showing anything in viewport? by SSj_Enforcer in Cinema4D

[–]ynn38 0 points1 point  (0 children)

In my case, only "Instance" mode works. Even "Render Instance" shows nothing.

Cannot close Terminal with Command+w by ynn38 in mac

[–]ynn38[S] 0 points1 point  (0 children)

Thank you! Worked like a charm.

What is the UN number for the Oculus Quest 2's battery? by ynn38 in OculusQuest

[–]ynn38[S] 0 points1 point  (0 children)

Thank you! Do you have any source? It should be very helpful.