HNHacker News
TopNewBestAskShowJobs

ygra

6,002 karma · joined September 19, 2012

Software developer at yWorks GmbH, working with graph drawing, compilers and UX. My posts are my opinion and don't represent my employer in any way.

Contact, if needed: hn (at) hypftier (german tld)

submissionscomments
ygra··on How an oil refinery works
Trucks need a lot more infrastructure in a lot more places than ships, though. I guess that's not often factored in.
ygra··on New mechanical panoramic film camera from Jeff Bridges
This concerns Widerrufsrecht, i.e. the right to cancel an order or contract shortly after signing it. For certain services you also waive this when you get to use it immediately (cellphone service, for example), and for custom-made items it also does not apply, as in this case.

This is independent of warranty (which is something the manufacturer may or may not offer), or Gewährleistung (which concerns the vendor and is typically the easiest way of dealing with damaged or defective goods).

ygra··on All 12 moonwalkers had "lunar hay fever" from dust smelling like gunpowder (2018)
We first need to get rid of the current one in a few billion years. That won't end well for Earth, though.
ygra··on Simplest Hash Functions
That only helps with multiplications by statically known word sizes (4x, 8x, etc.) and not arbitrary x·y. It can help with many smaller constant multipliers if the complete is clever, but it has to be known at compile time.
ygra··on "The new Copilot app for Windows 11 is really just Microsoft Edge"
So, like edit.com and QBasic. What is old is new again.
ygra··on Windows Notepad App Remote Code Execution Vulnerability
> Did you know Windows comes with a bare bones C# 5 toolchain, with csc.exe, and even vbc.exe and jsc.exe?

Even with MSBuild 4. From the days when .NET Framework was an OS component and also the build tools (until Roslyn) were part of the Framework.

ygra··on Snow Simulation Toy
Oh, that's something I also did in QBasic ages ago. I since lost the source code, but it basically worked by querying the screen from bottom to top, finding snow pixels (white) and moving them down, unless there was an obstacle. The initial snow on the ground (and the snowman) were using a different color that was almost white so it wouldn't detect as snow. It worked fairly well in 320×200 at the time.

I've tried the same approach in Turbo Pascal with BGI in the hopes of having a faster language and higher resolution available. It turned out to be quite a bit slower, likely because drawing and querying pixels was a bit more involved when using an adapter layer like BGI.

A few weeks ago I tried rewriting all that in TypeScript for fun and also trying to integrate it as an easter-egg with our graph drawing library (which renders with SVG) and first had to figure out how to efficiently support arbitrary obstacles that are initially SVG as well as a potentially changing viewport of the whole scene. I got sidetracked and didn't finish it, but proper collision handling was so easy back then (just look at the pixel color), but now with vector graphics and reading pixels being a very slow operation in many cases, it was surprisingly complicated.

ygra··on All my Deutschlandtickets gone: Fraud at an industrial scale [video]
At least from Rostock to somewhat closer destinations you have both options. There's a bi-hourly IC to Hamburg or Berlin and another bi-hourly RE towards the same destinations. They're not terribly different in terms of travel time, but one is a regional train and one is an inter-city train.

Sure, long distances (I had to travel from Rostock to Tübingen last weekend) are typically not taken with regional trains (although you technically can; I did that as a poor student a few times, it just takes 16 hours instead of 10), but over medium distances (around 2–3 hours) you often have both options.

ygra··on Lego announces Smart Brick, the 'most significant evolution' in 50 years, no AI
Rebrickable is awesome. One of my children loves building with instructions and will do relatively little free building with Lego, and Rebrickable makes it very easy to find alternative models (often with questionable stability, though) that can be built from the same set. It also features a search of alternative models you can build with all the sets (and bricks) you have.
ygra··on JavaScript's For-Of Loops Are Fast
The way the array is constructed at least leads to holey arrays in V8. Perhaps similar in other implementations. The performance characteristics between different array types may vary significantly as well. Still, the traditional for loop, counting upwards seems to be fastest for me across Chrome and Firefox on Linux. For-of is slowest by a wide margin.
ygra··on The compiler is your best friend
In fact, part of the implementation (or at least ideas) were borrowed from TypeScript. Nullability in C# changes depending on the checks around the code (similar to how the type of expressions in ThpeScript can change depending on prior code).
ygra··on Comptime – C# meta-programming with compile-time code generation and evaluation
The use cases are different. While MSBuild tasks run during build (and partially when loading a project), typically the IDE is oblivious what happens there. The source generator runs directly inside the compiler infrastructure and thus you didn't get error highlights for code that would otherwise be only generated during build but not as you type. This makes it much more friendly than pure build-time generation of code.
ygra··on Comptime – C# meta-programming with compile-time code generation and evaluation
Roslyn, the C#/VB compiler, uses them extensively, but in other code they're indeed quite rare.
ygra··on Volvo Centum is Dalton Maag's new typeface for Volvo
I'm sure this font is neither intended for writing code or serial numbers.

Proper fonts do exist, but no font is usable in all circumstances.

ygra··on Comptime – C# meta-programming with compile-time code generation and evaluation
You don't have to write the method twice. Source generators can only add new code, they cannot take away a method you declared, so it will still be there at runtime when called with non-constant arguments.
ygra··on Ireland’s Diarmuid Early wins world Microsoft Excel title
The formulae are indeed stored in the same format, regardless of language. For rendering and parsing in the UI they use translated function names and the field separator (commma in English, but semicolon in many other languages because decimal numbers use a comma there).

It does irk me a bit (though not as much as the translated VBA back in the day). But that's probably because I know English, I often look for solutions to my problems in English, not in my native language, and then would have to mentally translate that back. But that's perhaps a burden for programmers more than for typical users.

A few thoughts:

• it's been that way for decades, at this point. So changing it would annoy a lot of users

• the problem with comma and semicolon would remain unless you want entering numbers normally and within a formula to be different. I'm not sure that's good in a product built around numbers (and often numbers that should be written and formatted like any other number in that country).

• making it configurable might work, but that then requires more testing, although sometimes it's not clear how much testing Microsoft is still doing, so that might not be much of a point. But adding options also has UX limits and not just in the length of the settings screen.

ygra··on Mapping Amazing: Bee Maps
The map on the heatmap is definitely OSM without attribution. I can see a bunch of features I added. That doesn't make me respect them a lot. It's not that hard to use OSM correctly, at least in this context ...
ygra··on YouTube increases FreeBASIC performance (2019)
Explanation for that is here: https://devblogs.microsoft.com/oldnewthing/20210126-00/?p=10...
ygra··on 3D solar tower increases capacity factor 50%, triples solar surface area
You need a scaffold, which costs. The roof must be able to hold the additional mass (can be problematic in older buildings), you have to remove tiles and attach supports to the rafters and properly close the roof again. Sure, it's quick once work starts, but there's still some investment in material and tools you don't need on the ground.
ygra··on Safe zero-copy operations in C#
> C# doesn't do escape analysis and automatically put things on the stack

There has been work ongoing in this direction since .NET 9 at least, but the effect is very limited currently. The following code however, has no allocations at runtime, despite having an object creation in the code:

https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACR2DC2A3ut...

ygra··on What's New in C# 14: Null-Conditional Assignments
> When you have an expression P which names a mutable place, and you execute P := X

This isn't the case, though, is it? A normal member access (or indexer) expression may point to a mutable location (field, property). However, with conditional access expressions you get either a member access _or nothing_. And that nothing is not a mutable place.

When you use any of the conditional operators, you split the following code into two paths, and dropping the assignment (since there's nothing to assign to) seems pretty consistent to me, since you'd also drop an invocation, or a property evaluation in similar expressions.

If you require P to point to something that actually exists because you want the assignment to succeed, then write code to ensure that P exists because the assignment has no way of knowing what the intention was on the left side.

ygra··on What's New in C# 14: Null-Conditional Assignments
I think in the context of C# this is not exactly unexpected since there are various operators that apply conditional execution (and evaluation) to parts of an expression. All of them start with ?, though (? :, ??, ?., ?[], ??=), so except for casts to nullable types, every question mark in an expression signals that control flow is about to happen and it's been that way in C# for quite a while.
ygra··on What's New in C# 14: Null-Conditional Assignments
I stumbled over this a few times, mostly when cleaning up older code. This basically just means that using the ?. member access no longer dictates what is possible on the right side.

Property reads were fine before (returning null if a part of the chain was null), method invocations were fine (either returning null or just being a no-op if a part of the chain was null). But assignments were not, despite syntactically every ?. being basically an if statement, preventing the right side from executing if the left side is null (yes, that includes side-effects from nested expressions, like arguments to invocations).

So this is not exactly a new feature, it just removes a gotcha from an old one and ensures we can use ?. in more places where it previously may have been useful, but could not be used legally due to syntax reasons.

ygra··on Will Smith's concert crowds are real, but AI is blurring the lines
Seems like they ignored the non-square pixel aspect ratio as well for the upscaling, which may have changed face shapes as well.
ygra··on PHP compile time generics: yay or nay?
> The goal for Valhalla is value types, reified generics if they ever happen is still open.

But if they want the List<int> use case to be fast they basically have to keep this information at runtime and will have to make changes to how objects are laid out in memory. I'm not sure there's a good way around that if you want List<int> to be backed by an int[] and `get` returning an int instead of an Object. This may or may not be available to developers and remain internal to the JVM in the beginning, but I think it's necessary to enable the desired performance gains.

They also state on the website: »Supplementary changes to Java’s generics will carry these performance gains into generic APIs.«

ygra··on New records on Wendelstein 7-X
Help on either project actually flows both ways. If I remember correctly, Wendelstein 7-X provided experience and know-how regarding microwave heating and welding large plasma vessels. In the end they're scientists and engineers and don't seem to see the other project so much as competition than a way to learn more than just with one of them.
ygra··on Nice things with SVG
I've used this to succinctly define a Sierpinski carpet on Wikimedia Commons a while ago: https://commons.wikimedia.org/wiki/File:Sierpinski_carpet_6....

That file was able to lock up or crash most SVG renderers back then.

ygra··on Better typography with text-wrap pretty
Browsers typically say below the styles also which fonts are actually used (there can be multiple, e.g. when substitution is required to render certain characters).
ygra··on Magical Instant Bullets
It seems from the other articles as well that they are reviewing the UT99 arsenal, which didn't yet have the lightning gun.
ygra··on I use Cursor daily - here's how I avoid the garbage parts
That's a great analogy. For me it is a very similar feeling that I get ripped out of "problem solving mode" into "code review mode" which is often a lot more taxing for me.

It also doesn't help reviewing such code that sometimes surprisingly complex problems are solved correctly, while there's surprisingly easy parts that can be subtly (or very) wrong.

← PreviousPage 2 of 34Next →