HN user

abbeyj

1,115 karma
Posts44
Comments137
View on HN
www.scientificamerican.com 1y ago

Probability Probably Doesn't Exist

abbeyj
2pts0
www.nist.gov 1y ago

Major leap for nuclear clock paves way for ultraprecise timekeeping

abbeyj
12pts10
support.mozilla.org 2y ago

Firefox Fullpage Translation

abbeyj
2pts0
www.youtube.com 4y ago

I remastered my 30 year-old DOS game [video]

abbeyj
5pts0
www.depesz.com 4y ago

Waiting for PostgreSQL 15 – Add UNIQUE null treatment option

abbeyj
4pts1
www.possiblerust.com 5y ago

Non-Generic Inner Functions

abbeyj
2pts0
www.businesswire.com 5y ago

SiFive to Introduce New RISC-V Processor Architecture and RISC-V PC

abbeyj
22pts9
www.rug.nl 5y ago

A stepping stone for measuring quantum gravity

abbeyj
1pts0
www.righto.com 5y ago

Reverse-engineering the 8086's Arithmetic/Logic Unit from die photos

abbeyj
102pts38
www.os2museum.com 6y ago

Those Win9x Crashes on Fast Machines

abbeyj
274pts102
nl.movim.eu 6y ago

Parentheses and Indentation

abbeyj
1pts0
www.youtube.com 6y ago

C64 Turbo Assembler 34-Year-Old Bug Found and Fixed [video]

abbeyj
4pts0
www.vice.com 6y ago

Early Meme Site Ytmnd Has Been Resurrected with the Help of Fans

abbeyj
2pts0
phys.org 6y ago

Permanent magnets could be a solution for delivering fusion energy

abbeyj
3pts1
robert.ocallahan.org 6y ago

Debugging Gdb Using Rr: Ptrace Emulation

abbeyj
2pts0
news.sophos.com 6y ago

Ransomware borrows vulnerable driver to remove security software

abbeyj
2pts0
mjg59.dreamwidth.org 6y ago

Avoiding gaps in IOMMU protection at boot

abbeyj
1pts0
www.forbes.com 6y ago

Why the 'X17' Particle and a New, Fifth Force Probably Don't Exist

abbeyj
1pts0
www.phoronix.com 6y ago

Glimpse 0.1 Released as the Rebranded Fork of the Gimp

abbeyj
5pts1
devblogs.microsoft.com 6y ago

C++20 Concepts Are Here in Visual Studio 2019 Version 16.3

abbeyj
12pts0
www.diyphotography.net 6y ago

Panono makes decision to hold its camera customers hostage behind a paywall

abbeyj
1pts0
areena.yle.fi 6y ago

Cassette Lamers – Raiders of the Lost Bytes [video]

abbeyj
2pts0
engblg.livingcomputers.org 7y ago

A Journey into the Ether: Debugging Star Microcode

abbeyj
2pts0
www.alchemistowl.org 7y ago

PoC||GTFO 19 [pdf]

abbeyj
1pts0
www.tabsoverspaces.com 7y ago

How many keywords I can fit into a single C# expression?

abbeyj
110pts91
richwhitehouse.com 7y ago

DOOMBA

abbeyj
687pts36
arxiv.org 7y ago

Memristor – The fictional circuit element [pdf]

abbeyj
2pts0
nullprogram.com 7y ago

Prospecting for Hash Functions

abbeyj
116pts14
codeblog.jonskeet.uk 8y ago

Backward compatibility and overloading

abbeyj
4pts0
chriswheeler.blogspot.com 8y ago

My Favourite Smells (2005)

abbeyj
1pts0

I'm not clear on why there is `ip++` in the RECORD_INST handler. We've already moved to the next instruction by running `ip++` at the end of the handler in the normal dispatch table. In the RECORD_INST handler we do the work to record the instruction but don't do the actual work of that instruction. We can't, because we only have the one handler that has to work for all instructions. Shouldn't we jump to DISPATCHER_TABLE_NORMAL without incrementing ip again?

They might have been inspired by a similar feature in previous chips, like the external video support in the TMS9918: https://en.wikipedia.org/wiki/TMS9918#External_video.

If they had extra pins that they had no use for, I'm sure this would have seemed like a very easy and cheap addition. You take 4 unused pins and add 4 pulldown resistors. Then when you go to draw the background, instead of using index 0, you take the value for the index from those pins.

Maybe they planned to use this in arcade hardware, where you'd have a bigger budget than a home console and could afford two PPUs. Then you'd get more colors, and you could scroll the background layer independently from the foreground layer. I believe they later added support for independent layers on the SNES hardware so this type of thing was probably already in demand from game designers.

The one that immediately springs to mind is C#. Of all the mainstream languages it is probably the one most similar to Java. It can be compiled into platform-independent bytecode (like Java) or into native code using Native AOT. Relevant to the subject of this article, it has had support for structs (user-defined value types) since C# 1.0 in 2002.

The Python one-liner is there because most modern shells refuse to create a non-UTF-8 filename for you.

Both `echo -ne 'weird\xffname\0' > list0` and `printf 'weird\xffname\0' > list0` seem to work fine for me on Linux. Is this macOS-specific?

I'm a bit confused about the colors used in the CPU graphs. In the first graphs it looks like green means that the application is running and red means that the GC is running. But once we get to Figure 4 then red means the GC is running (on the GC threads) or nothing is running (on the Main thread)? If red always means that GC work is being done on that thread then this is inconsistent with the text that says "By distributing reclamation work across both cores..." since we would have three threads running at once. Once you move to the concurrent GC figures you definitely have three things running at once. Unless you're assuming SMT with each core running two threads?

In Figure 3 you somehow have 101% wall time. :)

That would probably be difficult at optical wavelengths. At radio wavelengths you might have a better shot, but we can build radio interferometric telescopes on Earth and since the atmosphere is relatively transparent at radio frequencies, you probably aren't going to get any advantage by trying to build one in Earth orbit.

Though not the same thing, you may be interested in https://en.wikipedia.org/wiki/Laser_Interferometer_Space_Ant...

It depends on what you want. If you want to install an old copy of Visual Studio from 20 years ago then you should be able to write a program and compile it and have that work on XP. But that comes with limitations. You're not going to be able to use even C++11 and will be stuck with C++03, or maybe even C++98. If that's acceptable to you then it can work. But if you want to compile something that somebody else wrote or want to use some library that somebody else wrote, it probably won't work in that environment.

Or you could install and old copy of Cygwin or MinGW.

Do you want to run a modern Visual Studio and target XP? Maybe you can make that work if you install an old platform SDK and set WINVER and _WIN32_VERSION and work around all the warnings and compatibility problems that you'll run into. It is fighting an uphill battle and it will continue to get worse with each new version of VS that you want use.

For rust there is Rust9x https://seri.tools/blog/announcing-rust9x/. But I think this is the effort of handful of people. It is behind the upstream rust and it could go away at any time. If you want to write a toy program in Rust then it is fine, but if you want something that's going to be supported long-term you're rolling the dice.

Python 3.4.4 is the last version of Python that will run on Windows XP. That's 10 years old and many things on PyPI now require newer versions of Python so you'd be stuck with old, unsupported versions of those modules, possibly containing security issues.

We all know that strlen will return 5, but some compilers don't: https://godbolt.org/z/M7x5qraE6

I feel like it is unfair to blame the compiler when you've explicitly asked for `/O1`. If you change this to `/O2` or `/Ox` then MSVC will optimize this into a constant 5, proving that it does "know" that strlen will return 5 in this case.

If you want to tell the compiler not to worry about the possible buffer overrun then you can try `int foo(char const s[static 4])`. Or use `&` instead of `&&` to ensure that there is no short-circuiting, e.g. `if ((s[0] == 'h') & (s[1] == 'e') & (s[2] == 'l') & (s[3] == 'l'))` Either way, this then compiles down to a single 32-bit comparison.

Interestingly, it is comparing against a different 32-bit value than `bar` does. I think this is because you accidentally got the order backwards in `bar`.

The code in `bar` is probably not a good idea on targets that don't like unaligned loads.

You need `"$@"`, not just `$@` at the end of the command. Otherwise it will split any arguments that have spaces in them. E.g. try

    long_fn() {
      echo "$1"
      sleep "$2"
    }

    to 1s long_fn "This has spaces in it" 5

I tried to reproduce this binary to see what the 278 KB was being taken up by. The first obstacle that I ran into was that the build.bat file doesn't work if you have git configured to use core.autocrlf=false. Changing that to core.autocrlf=true and recloning was sufficient to get me building.

I'm using x86_64-15.1.0-release-win32-seh-msvcrt-rt_v12-rev0.7z from https://github.com/niXman/mingw-builds-binaries/releases/tag... as the toolchain. This produces a 102 KB .exe file. Right off the bat we are doing much better than the claimed 278 KB. Maybe the author is using a different toolchain or different settings? Exact steps to reproduce would be welcome.

We can improve this by passing some switches to GCC.

    gcc -Os => 100 KB
    gcc -Oz => 99 KB
    gcc -flto => 101 KB
    gcc -s => 51 KB
    gcc -s -Oz -flto => 47 KB
If all you are interested in is a small .exe size, there is plenty of room for improvement here.

It seems like it should be possible to factor out most of the iterator boilerplate into a helper class. Then each place where you want to iterate you can construct an instance of that helper class and supply a lambda that specifies how to descend into children. If you're doing the same iteration in several places then you can use a named function instead of a lambda, which means less typing for each `for` loop. Here's a rough sketch: https://godbolt.org/z/x94WY77rv

This is probably technically out of scope for this article. Long-running processes that respond to SIGHUP will usually be running detached (with no controlling TTY). Thus it is a bit of stretch to call them "terminal programs".

The student dutifully changed the line, and both tools reported their satisfaction with the replacement

clang-tidy's `modernize-use-emplace` check warns for both the original version that uses `push_back` (as quoted in the article) and for the modified version that uses `emplace_back`:

    warning: unnecessary temporary object created while calling emplace_back [modernize-use-emplace]
       13 |     widgets.emplace_back(Widget(foo, bar, baz));
          |                          ^~~~~~~             ~
https://godbolt.org/z/sE7jWacTf

It appears that this check was improved to add this warning at some point between clang v14 and now. At least things have improved since the article was written.

Could you use something like `template <StringLiteral str> constexpr inline Key<str> key;`? Then you could write `key<"myKey">` instead of `Key<"myKey">{}`, saving you from needing the `{}` each time.

This isn't really about using Explorer for file management. It is about using Explorer as the shell. That's the default setup for everybody. Changing the default steel is difficult and some programs may not be compatible with whatever alternative shell you switch to.

Most people don't want to learn a whole new shell. They just want the Explorer shell to have the features that it has had since Windows 7. Features that Microsoft inexplicably chose to remove in Windows 11 and that they are only now belatedly adding back.

Since you're stuck using active FTP, maybe using nf_conntrack_ftp would help? I believe it is supposed to snoop the FTP connection, extract the port number from the PORT command, and then open only that port (from only that one IP) on the firewall. Of course since this is all on your LAN, just opening up all connections from the IP address is not really that dangerous and so anything more advanced might not be worth the effort.

The FTP connection seems to be using active mode (PORT command). Does using passive mode (PASV command) help at all? This is usually the easiest fix for problems with FTP and firewalls, without having to reconfigure or poke holes in the firewall. I actually thought that most ftp clients had switched to passive mode by default to avoid this type of issue.