Btw, I've completely forged this crossposted message, because Mastoposter didn't even have "
New status: " log entry for this post neither for the post nor for the boost activities...Why is
apt index so huge? And does apt update calculate deltas before downloading data?apt-daily.timer can cause almost 1GiB disk usage and idk how much internet data usage.Happy New Year!
I don't think I will write much this time. I didn't follow that much about what is going in the world. I just hope that things get better.
And I don't generally share my personal life online, but things are pretty fine for me.
My social circle didn't change considerably, but I didn't engage in anything big this time. I still was mostly communicating online with @hatkidchan. We sometimes played together (mostly Minecraft) either organised by @kiriharunya or on @EpicKitty's Epiccraft. And as usual, when I was being active in my free time, I was mostly learning or trying something programming-related (one of the things I've spend some time with were combinatorial parsers, but I was also doing other things: recently I've implemented task grouping for
Thanks to everyone again!
I don't think I will write much this time. I didn't follow that much about what is going in the world. I just hope that things get better.
And I don't generally share my personal life online, but things are pretty fine for me.
My social circle didn't change considerably, but I didn't engage in anything big this time. I still was mostly communicating online with @hatkidchan. We sometimes played together (mostly Minecraft) either organised by @kiriharunya or on @EpicKitty's Epiccraft. And as usual, when I was being active in my free time, I was mostly learning or trying something programming-related (one of the things I've spend some time with were combinatorial parsers, but I was also doing other things: recently I've implemented task grouping for
tint2 panel), but was also sometimes drawing in Krita and trying to create some music.Thanks to everyone again!
❤4
❤2
Sometimes I write collections of C macros of different levels of cursedness. Today I implemented slice types as anonymous structs:
#c
#define MIN(a, b) ((a) <= (b) ? (a) : (b))
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
#define SLICE_T(T) struct {T *ptr; ssize_t len;}
#define SLICE_LIT(arr) {.ptr = (arr), .len = sizeof(arr) / sizeof(*(arr))}
#define SLICE_LIT_STR(str) {.ptr = (str), .len = sizeof(str) / sizeof(*(str)) - 1}
#define SLICE_CSTR(str) {.ptr = (str), .len = strlen(str)}
#define SINGLETON_SLICE(p) {.ptr = (p), .len = 1}
#define SLICE_ARG(T, name) ssize_t name##__len, T* name##__ptr
#define SMALL_SLICE_ARG(T, name) int name##__len, T* name##__ptr
#define SLICE_TO_ARG(slc) (slc).len, (slc).ptr
#define SMALL_SLICE_TO_ARG(slc) (int)MIN(INT_MAX, (slc).len), (slc).ptr
#define SLICE_FROM_ARG(arg) {.ptr = arg##__ptr, .len = arg##__len}
#define SLICE_ARG_TO_VAR(arg) SLICE_T(typeof(*arg##__ptr)) arg = SLICE_FROM_ARG(arg)
#define CHRSLC_FMTS "%.*s"
#define CHRSLC_FMTA SMALL_SLICE_TO_ARG
// If .len is zero, one cannot dereference .ptr !
#define _SUBSLICE_POSITIVE(slc, start, endlen) (typeof(slc)) {.ptr = ((slc).ptr ? (slc).ptr + (start) : NULL), .len = (start >= 0) ? MAX(0, MIN((endlen), (slc).len) - (start)) : 0}
#define SUBSLICE(slc, start, endlen) _SUBSLICE_POSITIVE(slc, (start) + ((start) >= 0 ? 0 : (slc).len), (endlen) + ((endlen > 0) ? 0 : (slc).len))
#define _SLICE_PTR_AT_POSITIVE(slc, i) (typeof((slc).ptr)) ((i) < 0 (i) >= (slc).len !(slc).ptr ? NULL : (slc).ptr + (i))
#define SLICE_PTR_AT(slc, i) _SLICE_PTR_AT_POSITIVE(slc, i >= 0 ? i : i + (slc).len)
#define _SLICE_SAFE_DEREF(ptr, domsg) (*((ptr) ? (ptr) : ((domsg), fflush(stderr), abort(), (typeof(ptr))NULL)))
#define SLICE_AT(slc, i) _SLICE_SAFE_DEREF(SLICE_PTR_AT(slc, i), fprintf(stderr, "Failed to access%s slice (%s) of length %zd at index (%s = %zd) at %s (%s:%d)\n", (slc).ptr ? "" : " a NULL", #slc, (slc).len, #i, (ssize_t)(i), func, FILE, LINE))
#define SLICE_FOR_INDICES(slc, i) for (ssize_t i = 0; i < (slc).len; ++i)
#define SLICE_CALLOC(T, size) {.ptr = (T*)calloc((size), sizeof(T)), .len = (size)}
// Should only be called for non-subsliced slices
#define SLICE_FREE(slc) do { if ((slc).ptr) free((slc).ptr); (slc).ptr = NULL; (slc).len = 0; } while(0)
// If SLICE_CALLOC was saved into a const SLICE_T
#define SLICE_FREE_DANGLE(slc) do { if ((slc).ptr) free((slc).ptr); } while(0)
#c
🐳1
Vftdan Channel
Sometimes I write collections of C macros of different levels of cursedness. Today I implemented slice types as anonymous structs: #define MIN(a, b) ((a) <= (b) ? (a) : (b)) #define MAX(a, b) ((a) >= (b) ? (a) : (b)) #define SLICE_T(T) struct {T *ptr; ssize_t…
Given that the types are anonymous, they have to be unpacked to be passed between functions:
void
print_slice_chars(SLICE_ARG(const char, s))
{
SLICE_ARG_TO_VAR(s);
while (s.len) {
printf("Character: %c\n", SLICE_AT(s, 0));
s = SUBSLICE(s, 1, 0);
}
}
I am trying to generate a ligature font. Can ttf file only define the look of ligatures that it has as the results of the GSUB table without influencing the look of the constituent codepoints in contexts that don't match the substitution rules? As I understand, the codepoints still need to be associated with some glyph IDs. Do I still need to define their metrics (hmtx), if the single-codepoint glyphs don't contain any strikes? Will rendering software understand that the font doesn't define the look of these characters, but only uses them in the GSUB table?
#OpenType #ttf #otf
Link to post
#OpenType #ttf #otf
Link to post
Vftdan Channel
World, if shebangs were allowed at the beginning of XML documents Link to post
Only saved by bash process substitution
👏1😨1
Vftdan Channel
World, if shebangs were allowed at the beginning of XML documents Link to post
I think, it should be possible to register
<?xml magic in binfmt_misc with a script that looks for <!--! at the beginning of the second line and exec s the rest of the line with the filename and arguments.Can I configure my Android 10 Oxygen OS system, so that play/pause headset button unpauses the current foreground (video) player instead of AIMP (music player I use)?
Time for me to do #linguistics / #unicode crimes: "ѳ゙" — fita dakuten, to mark /ð/ phoneme
Link to post
Link to post
Dragging a file from a filemanager and dropping it into a webpage:
- webpage handles the drop => attach the file to a form or whatever
- webpage doesn't handle the drop => open the file in the current tab, unloading the webpage
Link to post
- webpage handles the drop => attach the file to a form or whatever
- webpage doesn't handle the drop => open the file in the current tab, unloading the webpage
Link to post
I was thinking recently about a transparent way for yggdrasil to add tls (for protocols that require https)
Vftdan Channel
I was thinking recently about a transparent way for yggdrasil to add tls (for protocols that require https)
Is it possible to create a self-signed certificate for two ip ranges?
Vftdan Channel
Is it possible to create a self-signed certificate for two ip ranges?
I think, ideally, yggdrasil client should create one root certificate and use it to sign peers' self-signed certificates, is it possible to implement it in TLS? Also, do servers need to send the whole trust chain till a root certificate, or is it possible to receive the near-root part from another place (that will run locally in yggdrasil case)?
Vftdan Channel
I think, ideally, yggdrasil client should create one root certificate and use it to sign peers' self-signed certificates, is it possible to implement it in TLS? Also, do servers need to send the whole trust chain till a root certificate, or is it possible…
And peers should send a new packet type (signed, idk whether it needs to be encrypted) that contains the public part of their certificate for their
02xx:.../128 and 03xx:.../64 ranges, that they use to sign all their other certificates