HNHacker News
TopNewBestAskShowJobs

jmgao

1,289 karma · joined February 6, 2012

[ my public key: https://keybase.io/jmgao; my proof: https://keybase.io/jmgao/sigs/n5UFQGDv-Rd7VAJM_qdjyATNxOs-n8Z3rIZBV8RFGQU ]
submissionscomments
jmgao··on Amazon props Vega to replace Android-based Fire OS on future smart devices
No, the backup plan was to switch the implementation of the Java core libraries from Apache Harmony to the already-GPLed OpenJDK.
jmgao··on Large Language Models for Compiler Optimization
puts isn't applicable here because you actually need to format the %d, but any compiler worth using (i.e. not MSVC: https://gcc.godbolt.org/z/zx74vY1za) will optimize a printf of a constant string ending in a newline into a puts.
jmgao··on Thermochromic Breadboard
Whoops, forgot to mention the name. The company making the sensors is InfiRay. Doogee doesn't even have a product listing for the V20 Pro on their website currently, although you can find one on archive.org that says they're using the Tiny1-C sensor from InfiRay: https://web.archive.org/web/20230601144956/https://doogee.cc...

I searched AliExpress for Android phones with thermal cameras, narrowed it down to three brands (Doogee, Blackview, ulefone), eliminated Blackview because all of their product listings proudly mention that the thermal cameras are by FLIR, and then opened a bunch of tabs to compare specs and search YouTube for review videos that seemed like they weren't paid for. The video I linked above in my comment is from a prominent electronics YouTuber who explicitly states that he bought it on his own and I found another video comparing the FLIR One Pro and S98 Pro that looked promising (https://www.youtube.com/watch?v=QQ7NJPvPsk0), which is why I'm deciding between the two options from Doogee now.

jmgao··on Thermochromic Breadboard
I've been researching this recently because every time I need to use my FLIR One, it's annoying because I need to find it, charge it, plug it in, and use FLIR's awful software. In the last few years, a Chinese company started selling sensors that seem to be far superior to anything you can get for reasonable prices from FLIR (256x192, and 25Hz since they're not subject to American export controls). I've been looking into buying a Android phone with one of their sensors built in as a replacement, because it seems to have a lot of advantages:

- not needing to futz with a dongle, way better displays than the standalone camera options

- never needing to charge it if you leave it on a wireless charging pad

- lots of internal storage that can automatically sync captured videos/pictures to the cloud

There's tons of options that look great in the $300-$500 range, which is a problem because it makes choosing difficult. This review has me leaning towards getting either a Doogee S98 Pro ($270), or a V20 Pro ($330, newer and has better specifications across the board except for not having wireless charging, so I'd need to get a wireless charging adapter for it): https://www.youtube.com/watch?v=4002_MqVNfY

jmgao··on Rivian embraces Tesla's charging standard for EVs
There isn't a global standard anyway, CCS1 (North America) and CCS2 (Europe) are physically incompatible.
jmgao··on Trip report: Summer ISO C++ standards meeting in Varna, Bulgaria
> But I still argue that this design is simple, checks all checkboxes as long as open questions are decided, and can be independently deployed.

You're handwaving a ton of complexity. You don't even need token pasting for this to become a confusing mess, just consider what happens if GUARD takes the name as an argument, or if an expression is constructed by putting two macros with different editions next to each other. You're also missing the biggest issue, which is 'what happens with headers that don't care about editions, and only begrudgingly even include an extern "C" for C++ users?'.

> (A systematic approach would be to collect a set of all editions used in syntactic tokens, and if not all editions in that set result in the same result, to issue an error.)

This does not work in general. Suppose you wanted to remove most vexing parse in a new edition: changing the result of `Foo bar(std::array<int, PAGE_SIZE>())` is the goal!

jmgao··on Trip report: Summer ISO C++ standards meeting in Varna, Bulgaria
> Even in that case it would be reasonable to opt in that syntax for some blocks of code, without breaking any existing code which hasn't opted in, and this "edition" mechanism was very successful to evolve syntaxes and often semantics in recent languages (JS, Rust, ...).

You can't really do this in a language where the way you use libraries is by textual inclusion of headers which can include arbitrary code (no one uses modules).

jmgao··on WSL 1.3.10 Brings Experimental Memory Reclaim, Updated DXCore and Linux Kernel
It could be worse, it could be Java 2 Standard Edition 5.0 1.5.0 release 22!
jmgao··on Why did the flywheel hybrid system never catch on for road cars? (2021)
Mazda has regenerative braking that goes to a supercap, but AFAIK it's only sporadically available in the U.S. because the American fuel economy testing standards don't benefit much from it.
jmgao··on Optimizing compilers reload vector constants needlessly
Intel wrote a header that maps NEON intrinsics onto SSE to help people port to x86 Android: https://github.com/intel/ARM_NEON_2_x86_SSE
jmgao··on The Army tried to develop a missile guided by pigeons
The British had a proposal for a time-detonated nuclear land mine which would be kept warm by sealing chickens inside with a food and water supply: https://en.wikipedia.org/wiki/Blue_Peacock
jmgao··on SL(1): Cure your bad habit of mistyping
> Control-backslash sends SIGQUIT on the other hand. This signal cannot be trapped.

Yes, it can.

jmgao··on Google says US employees can relocate to states with abortion rights
Kavanaugh's concurring opinion said this:

> Second, as I see it, some of the other abortion-related legal questions raised by today’s decision are not especially difficult as a constitutional matter. For example, may a State bar a resident of that State from traveling to another State to obtain an abortion? In my view, the answer is no based on the constitutional right to interstate travel. May a State retroactively impose liability or punishment for an abortion that occurred before today’s decision takes effect? In my view, the answer is no based on the Due Process Clause or the Ex Post Facto Clause.

jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
The trick is that USB-C has a pair of pins that identify what type of cable is connected. Different value resistors on the pins identify different types of cables, so the USB-C charger will know that the cable plugged into it is a legacy A to C cable, and not actually connect its VBUS.
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
I'd be careful with these: USB-A male to USB-C female adapters are illegal in the specification because they let you connect two power sources together, which can lead to explosions.
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
Sure: https://photos.app.goo.gl/CerrZNcQiQE254pTA
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
Annoyingly, the USB-C midplate is specified at 0.7mm. In my experience, 0.6mm boards are too thin to make a reliable connection. Going thicker has worked perfectly with all of the cables I've tried. I suppose there might be some risk of damaging your cables, but it doesn't seem too likely to me (the spec is 0.7 +/- 0.05), and I haven't had any problems.
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
Yeah, you need a 0.8mm thick PCB, but everyone can do that now (JLCPCB and oshpark both do it for the same price as a regular 1.6mm board). Here's a footprint: https://github.com/jmgao/PCB-USB-C
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
0.8mm, https://github.com/jmgao/PCB-USB-C
jmgao··on Why do USB-C hubs still have USB 2.0 ports? (2021)
And the best part is that you don't even need a connector, you can just build it right into your PCB! USB-A also lets you do a PCB-only connector, but if you're doing anything that requires a cable instead of just plugging directly into a port, it's a lot more annoying to require a USB-A extension cable than any USB-C cable.
jmgao··on The x86 architecture is the weirdo, part 2
Belated, but no, I was referring to UAL vs old syntax.
jmgao··on Esports stars have shorter careers than NFL players
It's a lot more basic than that. Everyone can steal game knowledge by just copying what other people do, but the ability of progamers to click quickly and accurately and efficiently divide their attention and context switch between multiple things is way harder to copy. If you've never seen the first person view of a Starcraft 1 progamer, you should watch this: https://www.youtube.com/watch?v=JfAU2lw6BrQ#t=6m8s
jmgao··on The x86 architecture is the weirdo, part 2
ARM spends it on pc being wrong: when you mov from it, it's off by 8 in ARM mode, and off by 4 in Thumb mode, and if you're using it for pc-relative loads (and stores, if you're crazy), it uses a word aligned value.

edit: oh, and softfloat vs softfp vs hardfp vs vfp

edit: oh, and how they have two incompatible assembly language dialects that are mostly the same, but in non-trivial code, incompatible

jmgao··on Elo scoring two years of Magic: The Gathering games
> With MTG, you have a huge effect from the quality of the deck. Unless you have each player play with each deck, there's no way to de-convolute the quality of the deck vs the quality of the player. And if you did have that data, Elo couldn't leverage it -- you'd need a more sophisticated model to account for that statistical effect.

How well a player chooses their deck is one of the factors that determines how good a player is. You can say the same thing about the other games: I'd probably have a better rating in chess if I didn't only play somewhat unsound gambits, and I'd definitely have a better rating in Starcraft if I didn't only do 2port wraith in TvZ.

jmgao··on Intel Suspends Operations in Russia
IIRC, in the past, they had a pretty substantial office in Russia working on Android.
jmgao··on A one in a million bug in Switch kernel
Knowing the Tegra chip in question, I'd bet it's probably not ARM's fault. Tegra X1, unlike pretty much every other SoC, did big.LITTLE via cluster migration with a custom cache coherence system, instead of just having a bunch of heterogenous cores. It turns out that their custom cache coherence was unfixably broken and would randomly corrupt memory when doing migration between the big and little cores, so everyone was forced to just entirely disable one set of cores. At least NVIDIA managed to fix this one in software?
jmgao··on Kaitai Struct: A new way to develop parsers for binary structures
That's probably just an artifact of how the author initially went through the open sourcing process. It is code that is written and maintained by a Googler as his day job, that's used in skia (i.e. chromium, android, etc.) today for GIF decoding: https://source.chromium.org/chromium/chromium/src/+/main:thi...
jmgao··on Kaitai Struct: A new way to develop parsers for binary structures
This appears to just allow you to parse binary formats to the represented fields. (Not that that's not extremely useful, doing this in managed languages is generally a giant pain in the ass!)

wuffs is much more powerful: it's essentially a safe C dialect that compiles to C, that lets you write an entire codec and know that there aren't any overflows.

jmgao··on Thousands of Mazdas in the Seattle area are stuck on a single FM radio station
He's wrong, it is getting parsed in C. glibc happens to allow ' ' as a modifier to %n: https://gcc.godbolt.org/z/zaTnjzEY3
jmgao··on Thousands of Mazdas in the Seattle area are stuck on a single FM radio station
That section of the transcript is incorrect, despite being from someone who worked on it. It's obviously a printf bug because it only happens with %n with valid modifiers: https://www.reddit.com/r/gimlet/comments/bdxht4/hey_its_ben_...
← PreviousPage 2 of 9Next →