HNHacker News
TopNewBestAskShowJobs

andreyv

248 karma · joined June 11, 2016

submissionscomments
andreyv··on Jolla Phone Pre-Order
Follow this forum: https://forum.sailfishos.org/c/announcements/17.
andreyv··on Parallel ./configure
Autoconf can use cache files [1], which can greatly speed up repeated configures. With cache, a test is run at most once.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/a...

andreyv··on History of Null Pointer Dereferences on macOS
Here is a non-zero null pointer: https://gcc.godbolt.org/z/Po5r5Pa36
andreyv··on Getting silly with C, part (void*)2
It creates a compound literal [1] of type array of int, and initializes the specified array positions using designated initializers [2] with the results of calls to puts().

Using designated initializers without the = symbol is an obsolete extension.

[1] https://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html [2] https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

andreyv··on Glibc Buffer Overflow in Iconv
Even the original version 1507 is still supported on the LTSC channel. Support for UTF-8 manifest was added only in version 1903.
andreyv··on Kate editor on all platforms
Old does not mean bad. Even a decade later Wayland struggles to provide basic features that were built in the X protocol.
andreyv··on Ubuntu 24.04 LTS will enable frame pointers by default
The number of registers available to the program is fixed in the instruction set. The program cannot address more registers without recompiling it to an extended instruction set.
andreyv··on GTK: Introducing Graphics Offload
First person shooters. Vertical synchronization causes a noticeable output delay.

For example, with a 60 Hz display and vsync, game actions might be shown up to 16 ms later than without vsync, which is ages in FPS.

andreyv··on The world nearly adopted a calendar with 13 months of 28 days
The Soviet Union briefly tried 5 and 6 day weeks in the 1930s: https://en.wikipedia.org/wiki/Soviet_calendar
andreyv··on Fcron Is the Best Cron
You can use systemd-cron [1] to run traditional cron jobs with systemd. No need for a separate daemon anymore.

[1] https://github.com/systemd-cron/systemd-cron

andreyv··on Exploring Linux command-line space time
Instead of "/usr/bin/time" you can also write "command time".
andreyv··on Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
1% is still a lot for power saving. If the system is idle, it should be at 0%. If it is anything above, then it shows poor design.
andreyv··on Visual Sum of Cubes
See: https://en.wikipedia.org/wiki/Lagrange_polynomial
andreyv··on Bugs in Hello World
Right — ferror() does not set errno, and so perror() is not appropriate here. fprintf(stderr, ...) would be better.
andreyv··on Bugs in Hello World
In C, and many other languages, the file stream error state is saved after each operation, so you can skip error checking on every output line and only do

  if (fflush(stdout) != 0 || ferror(stdout) != 0)
  {
    perror("stdout");
    return EXIT_FAILURE;
  }
at the end of the program. The same should be done for stderr as well.

In GNU programs you can use atexit(close_stdout) to do this automatically.

andreyv··on Dell deletes Latitude CPU Throttling issue after link is posted here
Perhaps this: https://docs.microsoft.com/en-us/windows-hardware/design/dev...

> On occasion, the system stays in the active mode (with the screen off) for a longer interval of time. These longer active intervals occur for a variety of reasons, for example, processing incoming email or downloading critical Windows updates.

andreyv··on Why “process substitution” is a late feature in Unix shells
> So there is no way to abort a bash script if something like <(sort nonexistent) fails.

The process ID of the last executed background command in Bash is available as $!.

  cat <(sort nonexistent)
  wait $! || echo fail
gives

  sort: cannot read: nonexistent: No such file or directory
  fail
andreyv··on Dell removed Fn+Left/Right for Home/End from all its products
Dell also removed trackpoint and all touchpad buttons, and made up/down arrow keys half height on the new Latitude laptops.

These are not the changes one would expect to see in a professional-grade laptop. On the other hand, the Lenovo line looks good in this regard.

andreyv··on Surprisingly Slow
Autoconf can use a cache file to speed up tests: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/h...
andreyv··on The X.Org Server Is Abandonware?
In fast-paced games it is essential to disable vertical synchronization as well, trading possible tearing for less input lag.

Does Wayland support this?

andreyv··on Who's afraid of a big bad optimizing compiler?
C now has a memset_s() function to do this.
andreyv··on Red Hat Expecting X.org to “Go into Hard Maintenance Mode Fairly Quickly”
Windows unredirects full-screen games, bypassing the compositing delay. This is also what sensible compositing X11 window managers do on Linux.
andreyv··on Red Hat Expecting X.org to “Go into Hard Maintenance Mode Fairly Quickly”
Forced composition and vsync is a mistake for gaming.

The added output latency is unacceptable, especially for first-person shooters. A little tearing is nothing compared to the vsync lag.

If Wayland wants to replace X.org, then it should support also this use case. But full composition being mandatory isn't very encouraging in regard to this.

andreyv··on Ways to break your systems code using volatile (2010)
Indeed, "volatile sig_atomic_t" is the recommended official C way to change a flag from a signal handler.
andreyv··on Why don't we have Wayland on Raspberry Pi yet? (2018)
There is no tearing with proper drivers and window managers. This was a problem in the past, but now is largely overstated.
andreyv··on Linux Kernel Developers Discuss Dropping x32 Support
One counterargument is that for each ABI you need a different set of libraries loaded in memory.

So, if some programs in the system use the 64-bit ABI and some use x32, then memory usage may substantially increase. And, of course, this also affects CPU caches.

andreyv··on Ask HN: First month job anxiety. Am I actually an impostor?
What the actual hell.
andreyv··on Flatpak – a security nightmare
Flatpak, Snap, container images are the new iteration of static linking.

Just like with static binaries, they make deployment easier for the developer, but introduce problems with size, duplication and library updates.

Flatpak added runtimes [1] to alleviate the problem. Does this solution look familiar? Yes, it is the same dynamic library concept. We are coming full circle.

[1] http://docs.flatpak.org/en/latest/available-runtimes.html

andreyv··on Introducing the Windows Pseudo Console (ConPty)
You can spawn a thread manually and use the POSIX sigwait() function.
andreyv··on Firefox switching to clang-cl for Windows builds
Google tries to make you log in if it knows you have an account. You can erase Google cookies to avoid that.
Page 1 of 2Next →