Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ptx
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
64 ms
·
931.
▲
by
ptx
5y ago
Ah, they "inadvertently ended up deleting the source code". Easy mistake to make. Nothing to worry about then.
932.
▲
by
ptx
5y ago
So where the article says loading // true setLoading(false) loading // false they mean that it will become false in the next invocation of the render function, I hope?
933.
▲
by
ptx
5y ago
Refreshing on every click is super fast if you're not loading megabytes of JS. Maybe everyone on HN despises SPAs because we've all seen how fast, light and reliable HN itself is compared to e.g. Twitter where clicking anything us
934.
▲
by
ptx
5y ago
I'm only vaguely familiar with React, but the class-based components and their methods make perfect sense to me after seeing the diagram and example in the article, whereas I have no idea how the "more straightforward" and &q
935.
▲
by
ptx
5y ago
Is the concern that it will encourage library maintainers to do essentially something analogous to an empty catch block to make the error go away without having to think too hard? try: use_thirdparty_library() except SecurityIssue
936.
▲
by
ptx
5y ago
If you want Java without the verbosity, try Kotlin: https://kotlinlang.org/
937.
▲
by
ptx
5y ago
Yup, the backend IR is shared between JVM, JS (beta) and Native. The new frontend IR, I realize on second thought, will come later[1] with the K2 compiler frontend. The old Kotlin/JS compiler is definitely closer than the new one to wh
938.
▲
by
ptx
5y ago
> What Jetbrains calls Kotlin -> JavaScript, is "transpilation" What about the new beta Kotlin/JS compiler that does Kotlin -> frontend IR -> backend IR -> JavaScript?
939.
▲
by
ptx
5y ago
The videogame parts were tedious (I can't see the point of describing in detail the appearance and behavior of virtual worlds, since they can be programmed to behave in arbitrary ways that are most likely meaningless) - but the second
940.
▲
by
ptx
5y ago
Well, yes, but the point was to get a process per request just like PHP, so you'll have to start those processes one way or another. Anyway, it appears uwsgi can be configured to do this, using fork-server[1] and maybe max-requests[2],
941.
▲
by
ptx
5y ago
To do this in Python, couldn't you just fork the Python process after initializing the web framework etc. and handle the request in the forked process? Optionally keep a pool of pre-forked worker processes so that the request doesn
942.
▲
by
ptx
5y ago
The loop can be written using This One Weird Trick that Walruses Hate: for foo in iter(partial(data.get, "foo"), None): handle_foo(foo) So I would only use the walrus operator for the first example (the if statement),
943.
▲
by
ptx
5y ago
I'm sure you're already aware of this example since it's the canonical one, but to me personally the point is very clear: I use regular expressions all the time and always have to write that little bit of boilerplate, which t
944.
▲
by
ptx
5y ago
What about setting a simple boolean flag, e.g. setting "cancelled = True" in the UI thread to cancel an operation in a background thread? In Java you would have to worry about safe publication to make the change visible to the o
945.
▲
by
ptx
5y ago
https://kotlinlang.org/docs/null-safety.html
946.
▲
by
ptx
5y ago
> V8 is an excellent JS runtime Doesn't Electron use two instances of it though, one for Node.js and one for the browser UI, with some sort of message-passing inbetween? That would tend to slow things down.
947.
▲
by
ptx
5y ago
In the past it has sent command line arguments and the path of the current working directory, among other things, according to comments on that issue. Even if Microsoft doesn't intend to deliberately collect sensitive data, they don&#x
948.
▲
by
ptx
5y ago
The way it's managed in JS, digging the function out of the prototype to apply it, can be done in Python as well. But unlike JS you won't normally have to, thanks to the method not being defined only on one specific type of iterab
949.
▲
by
ptx
5y ago
> things like value types and generics without type erasure aren't solved in Kotlin Perhaps not solved, but at least partially addressed with value classes[1] and reified type parameters[2]. [1] https://kotlinlang.org
950.
▲
by
ptx
5y ago
Here is one real reason to prefer it over .NET Core: https://github.com/dotnet/sdk/issues/6145
951.
▲
by
ptx
5y ago
If I understand that page correctly, you can use Java 17 to compile and run your program, as long as you also have Java 16 or older installed to run Gradle itself.
952.
▲
by
ptx
5y ago
It's an unambiguous signal that Mozilla is no longer making software to benefit the user but rather to benefit "trusted partners". That's what's to dislike.
953.
▲
by
ptx
5y ago
Something similar is on the way for Python with subinterpreters: https://pythondev.readthedocs.io/subinterpreters.html
954.
▲
by
ptx
5y ago
What are my choices for accessing a service that uses Microsoft's "identity platform" / "modern authentication" / (whatever they're calling it now) from a cross-platform desktop client application? Fr
955.
▲
by
ptx
5y ago
Or alternatively, closer to the original, doing both null checks the same way the original does the first one: val numVowels = getDTO()?.string?.let(::countVowels) ?: 0
956.
▲
by
ptx
5y ago
Rider, their closed-source .NET IDE, is supposedly written in Kotlin though (except for the parts that are written in C#): https://blog.jetbrains.com/dotnet/2016/01/13/project-rider-a...
957.
▲
Call for Discussion: New Project: Leyden
(mail.openjdk.java.net)
2 points
by
ptx
5y ago
|
0 comments
958.
▲
by
ptx
5y ago
The post-jQuery native browser APIs that were added to support those use-cases are querySelector for querying the DOM and fetch for AJAX (assuming you don't need the X part).
959.
▲
by
ptx
5y ago
> I've lost count of the number of times I've heard someone say, "don't use biometrics because you can't change your fingerprints". That's an absurd statement... because you can. [...] Thing is though,
960.
▲
by
ptx
5y ago
I think the point is that the .NET API for writing a minimal web service is now more minimal, thanks to being designed around lambdas instead of heavy use of OOP. The web server API is just an example of this style of .NET API.
More ›