Better HN
topnewbestaskshowjobs
Log inSign up

Hello71

1,909 karma · joined Sep 24, 2012 (14y ago) · 1,011 submissions

Submissions

comment 6y ago · link · parent

except it's impossible to simultaneously pay those rates on a marginal basis. according to https://www2.gov.bc.ca/gov/content/taxes/income-taxes/person..., the 20.5% rate only applies to income over $220,000 (which, even by US standards is in the top 3%), while according to https://www.canada.ca/en/revenue-agency/services/child-famil..., the CCB clawback only applies between $31,712 and $68,707. therefore, while you can simultaneously pay all these taxes, I don't think it's accurate to call it a marginal rate.

comment 6y ago · link · parent

> I didn't cash it, as it seemed like LJ needed the money.

I don't think this is particularly useful. For professional accounting purposes, uncashed outgoing checks are liabilities, meaning that in general, the company cannot spend that money to do other things. If you want them to keep the money, you need to tell them that. Otherwise, the money effectively gets split between the bank and the government.

comment 6y ago · link · parent

  extract() {
    bsdtar -xf "$1"
  }
you can decompress things which are not files, such as stdin or device files. in addition, your code does not cover *.tar.xz (more common than tar.bz2 nowadays), or lzma, or lz4, or tar.zst, or many many other formats. further, it's not even consistent: bunzip2, gunzip, and unxz remove the input file, but tar, unrar, 7z, and zstd do not.

comment 6y ago · link · parent

it is, and it's unnecessary for decompression since GNU tar 1.21 according to a comment lower in the thread.

comment 6y ago · link · parent

according to https://git.savannah.gnu.org/cgit/findutils.git/commit/find/..., this functionality has been present since findutils was moved under source control in 1996.

comment 6y ago · link · parent

dxvk only supports dx10/dx11, but vkd3d does dx12, d9vk does dx9, and wine itself does all versions. performance isn't great, but the compatibility definitely is.

comment 6y ago · link · parent

Unfortunately, similar to a number of other Enterprise Open Source projects, despite being on GitHub, potential contributors still cannot open any tracked bugs, and need to print and scan a CLA before submitting any code.

comment 6y ago · link · parent

> - Log files. Append-only mode, enforced. Can't seek back and overwrite. On a crash, the file recovers to some recent good write, with a correct end of file position. It does not tail off into junk.

Linux already semi-supports this with chattr +a, which is filesystem-specific, plus filesystem-specific mount options (e.g. data=journal). unfortunately, implementing the latter is non-trivial to do on a per-file basis.

> - Temp files. Not persistent over restarts. Not backed up. Can be memory-mapped as read/write. On a crash, disappears.

O_TMPFILE exists on Linux, and I don't know of any reason why it couldn't be added to POSIX.

> - Managed files. These are for databases. Async I/O available. May have additional locking functions. Separate completion returns for "accepted data" (caller can reuse write buffer) and "committed data" (safely stored), so the database knows when the data has been safely stored. Can be memory-mapped as read/write. Intended for use by programs which are very aware of the file system semantics. On a crash, "committed data" should be intact but data not yet committed may be lost.

io_uring exists now.

these features are Linux-specific, but my point is that these features do exist now already, there is no need to wish for them.

comment 6y ago · link · parent

> It's not a trivial undertaking to compile OpenJDK from sources.

uh? assuming you already have a working C toolchain and JDK installed, you just hg^Wgit clone; bash configure; make.

edit: you may have more trouble compiling it on windows, but compiling anything on windows is a pain unless it uses the entire proprietary non-portable microsoft-specific project management tools.

comment 6y ago · link · parent

sure, but my point is that despite all the rhetoric, when it comes to actually spending money, kids seem to get the short end of the stick.

comment 6y ago · link · parent

> The other threads need to continue running while the thread waiting on open(2) is paused, but ptrace pauses the whole process.

This definitely doesn't sound right. Running strace, you need to specify -f in order to trace threads, otherwise only the main thread is traced. gdb does stop all threads on interrupts, but only by default for convenience, and I don't think it's atomic.

Because of this, LD_PRELOAD is not the easiest way to delay system calls, strace -e inject:delay is.

  $ cat > a.c << EOF
  #include <stdio.h>
  #include <sys/types.h>
  #include <fcntl.h>
  #include <pthread.h>
  #include <unistd.h>
  
  void *start_thread(void *arg) {
      while (1) {
          puts("thread");
          sleep(1);
      }
  }
  
  int main() {
      pthread_t thr;
      pthread_create(&thr, NULL, start_thread, NULL);
      while (1) {
          puts("main");
          close(open("/dev/null", O_RDONLY));
          sleep(1);
      }
  }
  EOF
  $ gcc a.c
  $ strace -o /dev/null -P /dev/null -e inject=openat:delay_enter=3s ./a.out
  main
  thread
  thread
  thread
  thread
  thread
  main
  thread
  thread
  thread
  thread
  thread
  [ and so on. ]

comment 6y ago · link · parent

if children's needs were taken into account when designing transit systems, then school buses wouldn't be taking kids to school at 7 a.m.

comment 6y ago · link · parent

so you'd rather spend time hunting down which config file you've mangled to be incompatible every month? this is not a good solution.

comment 6y ago · link · parent

you're thinking of minimax.

comment 6y ago · link · parent

this is a very old idea. ndiswrapper did this for network drivers back in 2003, and freebsd implements shim layers for linux graphics drivers, linux applications, some solaris kernel modules (dtrace, firewall, others?). the main problem is that nowadays, modern simple hardware has mostly standardized on a fairly small set of APIs (e.g. SATA/SCSI/NVMe for the majority of disks, UVC for the majority of cameras), and modern complex hardware requires complex shims. see: the amount of work put into Linux graphics kernel APIs.

comment 6y ago · link · parent

that's an incredible margin, and sounds suspiciously like they didn't enable optimizations on gcc, or set icc to optimize for a specific processor and gcc to generic, or something like that.

comment 6y ago · link · parent

this is the purpose of the gcc -mtune flag, which does have an actual purpose beyond being used in the utterly redundant -march=native -mtune=native.

comment 6y ago · link · parent

any usb gadget should require root, otherwise there are serious security issues. my concern with drivedroid is that it is closed source, which is highly worrisome for a root app.

comment 6y ago · link · parent

most rooted Android devices can do something like this with the USB Mountr app (available on F-Droid). unfortunately, most kernels only provide mass storage device support, not optical drive, but it's usually good enough.

comment 6y ago · link · parent

only works if you are already using windows and therefore can use diskpart/"mark as active", or you are booting from an extended uefi firmware with the appropriate drivers (e.g. dell).

comment 6y ago · link · parent

from the home page:

> A "Ventoy Compatible" concept is introduced by ventoy, which can help to support any ISO file.

from the "Ventoy Compatible" page:

> From the document you can see that ventoy will create a virtual disk from the iso file and boot it. But the virtual disk is only on BIOS(Legacy or UEFI) level. In most case it works only in bootloader period. Most of the morden OS's kernels will use their driver to access hardware after boot, so the virtual disk will not be visible to them. In normal case, the OS will search all the hardware storage media(CDROM/USB/HD ...) to find the source medium. But with ventoy they will not find such medium because there is no such physical media and they don't know that they were booted from a virual disk. In order to support that ventoy must do some hook before boot. But the hook is really a hard work because there are so many different OS distros and so many special cases.

comment 6y ago · link · parent

https://github.com/schnaader/precomp-cpp

comment 6y ago · link · parent

fixed... ish... with two sizes and two formats: https://dev.gentoo.org/~mgorny/articles/portability-of-tar-f...

comment 6y ago · link · parent

does it include system files?

comment 6y ago · link · parent

IE Tab was an extension, never a native feature. It was one of the many innovations allowed by the open extensions API, allowing anybody to make major features without formal approval.

comment 6y ago · link · parent

and why is that?

comment 6y ago · link · parent

there are other "C++ programmer trying to write C" anti-patterns, such as typedefed structs and one "class" per file, leading to terrible performance without LTO. stuff like https://source.netsurf-browser.org/libdom.git/tree/src/core/... has more signs of excessive C++ love: "vtable", "protected", etc. I don't know that these things are inherently bad, but they certainly don't exist in C.

comment 6y ago · link · parent

on a fully virtualized system, echo o > /proc/sysrq-trigger is going to be as close to a forced shutdown as you can get. that won't test hardware/firmware issues, but neither will a VM stop anyways.

comment 6y ago · link · parent

or like Japan or Korea.

comment 6y ago · link · parent

Clearance/citizenship required?
1
8910
34