Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sedro
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
sedro
1y ago
That's another gotcha-- interning of strings and boxed primitives. Are there linters for this sort of thing? I don't write Java much any more.
2.
▲
by
sedro
1y ago
Autoboxing's evil twin, auto-unboxing should knock the score down a few points. Integer a = null; int b = 42; if (a == b) {} // throws NullPointerException
3.
▲
by
sedro
2y ago
It's useful and very common to use. For example, you could concatenate together command-line argument flags that may or may not be present.
4.
▲
by
sedro
2y ago
A separate VLAN, if your router is capable
5.
▲
by
sedro
2y ago
The PDF metadata says it's PyPDF2
6.
▲
by
sedro
2y ago
It does! Code is here https://github.com/java-native-access/jna/blob/40f0a1249b5ad...
7.
▲
by
sedro
2y ago
That's how java.io.File#deleteOnExit works under the hood. The DLL is still loaded at that point and can't be deleted.
8.
▲
by
sedro
2y ago
According to JNA it's not safe to unload the DLL: https://github.com/java-native-access/jna/blob/40f0a1249b5ad... Do NOT force the class loader to unload the native library, since that introduces i
9.
▲
by
sedro
2y ago
You would also need to learn about Maven profiles and activation. And for other build tools, you'll be delighted to know they have partial support.
10.
▲
by
sedro
2y ago
This wouldn't work on Windows, because you can't delete a DLL while it's in use
11.
▲
by
sedro
2y ago
Native libraries are typically packaged inside a jar so that everything works over the existing build and dependency management systems. For example, each these jars named "native-$os-$arch.jar" contain a .dll/.so/.dylib
12.
▲
by
sedro
2y ago
> I can't think of another statically typed language that screws this up so badly. It just keeps getting worse with stuff like Optional and @NotNull. Java might be the only language where a simple assignment `x = y` can throw a Null
13.
▲
by
sedro
3y ago
Or more succinctly val num = words.count(_.nonEmpty)
14.
▲
by
sedro
3y ago
This cheatsheet would have you publish dist/*.{js,d.ts}. Presumably you would use "files":["dist"] in package.json to exclude sources from being published. The OP recommends to additionally package src/*.ts alo
15.
▲
by
sedro
3y ago
California Code Regulations, title 10, Section 2632.5 - Rating Factors It carves out an exception for "using a technological device to collect information about the location of the insured vehicle as part of an emergency road service,
16.
▲
by
sedro
3y ago
It's the same in parts of the US. In California, insurers are only allowed to collect the mileage.
17.
▲
by
sedro
3y ago
Maybe a foldable e-bike would be a good compromise?
18.
▲
by
sedro
4y ago
You can use G1 on Java 8 with -XX:+UseG1GC
19.
▲
by
sedro
4y ago
You can use ?. or assign to a nullable type. Or you can get a NPE at runtime. Which is to say, it's not null-safe.
20.
▲
by
sedro
4y ago
Kotlin interops nicely with Java but it's not null-safe (all references from Java are assumed non-null).
21.
▲
by
sedro
4y ago
This seems to work: document.querySelectorAll('video').forEach(v => v.playbackRate = 1.5)
22.
▲
by
sedro
4y ago
And the purpose of "T extends string" is to carry the value of a string literal. For example, there's the string value "foo", but there's also a type "foo" which extends string and has only the one
23.
▲
by
sedro
4y ago
There's a mechanism: if people want their bulbs to match, they might pick the same brand/model as a replacement
24.
▲
by
sedro
5y ago
now you have N+2 problems?
25.
▲
by
sedro
5y ago
Are you conflating CORS with some specific product?
26.
▲
by
sedro
5y ago
> Pinned versions don't mean anything when sub-dependencies can have transient versioning resolution occur. That's the purpose of lockfiles-- to pin the entire dependency tree.
27.
▲
by
sedro
6y ago
When I search for an identifier it comes up with usages, tests, docs, etc. I have to dig several pages to find the declaration/definition.
28.
▲
by
sedro
9y ago
To clarify, the arrested individual sells a swatting "service" [1]. One of the CoD players hired him to swat the other over a twitter argument. The other CoD player taunted the swatter and gave him a random address [2]. The police
29.
▲
by
sedro
9y ago
Look closely. Or, equivalently > n=12345678910111210 > n+1 === n+2 true
30.
▲
by
sedro
9y ago
Kotlin has its own standard library
More ›