HN user

protopete

112 karma
Posts2
Comments46
View on HN

Hey I noticed that the division code example is using the "ul" tag instead of the "div" tag. Thanks!

Edit: nevermind, but the comment still says "This ul tag"

Likely a bug. I carried the skull item and got this error when trying to dance:

  Uncaught Error: Frame tag not found: dance-carry
    getTaggedFrameIndex Aseprite.ts:140
    update Player.ts:859
    update GameScene.ts:424
    update Scenes.ts:130
    update Scenes.ts:128
    update Game.ts:107
    gameLoop Game.ts:86
  Aseprite.ts:140:18
    getTaggedFrameIndex Aseprite.ts:140
    update Player.ts:859
    update GameScene.ts:424
    update Scenes.ts:130
    forEach self-hosted:216
    update Scenes.ts:128
    update Game.ts:107
    gameLoop Game.ts:86
    gameLoop self-hosted:1171

Me too, this feels like another case of better off not knowing. Being a childhood fan of Ren and Stimpy cartoons, and having read the article realizing that Katie Rice worked for Spumco, now I get why I like the art style for Katie's webcomics Skadi and Camp Weedonwantcha. I really hope the content of the article isn't the reason for the current hiatus of the camp comic. I was really struck by her quote at the end about wishing she hadn't gone through it even if would have made her a less skilled artist.

I got this Arduino bot for $70. Has its own battery for sufficient power. The motor gearing is a bit fast, so it's better to use PWM to slow down the motors, except the default pinout disables PWM on the drive gpios when the servo is enabled. The build quality is ok, except there are no spacers for the bolts between the PCBs and acrylic base, so I worry about damaging the PCB during assembly.

https://www.amazon.com/Elegoo-Four-wheel-Ultrasonic-Intellig...

I was able to compile it on Ubuntu after moving the X11 includes to the bottom of the list:

  #include <stdio.h>
  #include <strings.h>
  #include <string.h>
  #include <stdlib.h>
  #include <stdint.h>
  #include <inttypes.h>
  #include <stdarg.h>
  #include <math.h>
  #include <X11/Xlib.h>
  #include <X11/Xlibint.h>
  #include <X11/Xproto.h>
  #include <X11/Xatom.h>
  #include <X11/extensions/Xrandr.h>
  #include <X11/extensions/Xrender.h>

Passing a null pointer to free() is perfectly safe, and in this case simplifies the cleanup code.

Although the concern of a memory leak is valid. I would have expected the resources to be free'd regardless of the result.

I think it unlikely that pre-existing footage can be used, because HD video is almost always compressed, thus masking the minute vibrations in the pixels. The algorithm described in the article work best for uncompressed video directly from the image sensor, and they can run it in real-time without needing to store the video.

Twitter's GIF hack 12 years ago

Unfortunately the MP4 looks worse than the GIF, due to chroma compression in the YUV 420 colorspace. While each pixels luminance value is kept, the color information for a 4-pixel square is stored as a single CrCb pair, which is really obvious when you look at how the orange hat has artifacts against the blue background. Increasing the bitrate won't solve this either, since it's a limitation of the colorspace.

Pointers don't have to be the exception. I'm working on a programming language runtime where objects are stored as a 32-bit value, with 3/4 of the range representing an integer, and 1/4 of the range (30 bits) representing a pointer. Given the constraint that pointer objects are aligned to 8 bytes, the 30-bits multiplied by 8 results in an 8GB addressable memory space. Pages within that space can be allocated using mmap with MAP_FIXED flag. Smaller memory usage results in more things in cache, resulting in higher performance.

To count the number of page faults during execution, use:

  perf stat <executable>
Page faults occur after anonymous pages are mmap'ed for the heap, either mapping a common zero page, then faulted again for a memory write. Prefaulting the page with MAP_POPULATE flag to mmap can help reduce the number of page faults.

Shared libraries are also mmap'ed and faulted in, and doing it this way saves memory for things that aren't used. But if paying the penalty for faulting the pages when used outweighs the memory savings, it might be better to use MAP_POPULATE here too. It might worth trying to add an LD_LIBRARY_XXX option to tell the loader to use MAP_POPULATE. Statically linking the executable will also reduce the number of faults (sections are combined, etc.)