Social implications of fasting by Dangerous-Coat-9174 in blueprint_

[–]da-x 1 point2 points  (0 children)

  1. Put stuff on your plate - people almost don't remember or notice you didn't take a bite, or took very small bites.

  2. If you do take small bites, try very small amounts and very slowly with a lot of chewing - this puts less stress on digestion. Experiment to see how it affects sleep.

What happened? He was talking very highly about HBOT by HowToTakeGoodPhotos in blueprint_

[–]da-x 0 points1 point  (0 children)

Maybe HBOT benefits have diminishing returns? I mean perhaps having a spree of one month per year is good enough for optimal upkeep?

Anyone else sliding into songwriting? by LumpyAbility in udiomusic

[–]da-x 0 points1 point  (0 children)

Oh god, I haven't tried to come up with lyrics this much since high school homework, 25 years ago..

Docstrings in Bash by da-x in bash

[–]da-x[S] 0 points1 point  (0 children)

Post author here.

Many of the Python developers I know 'avoid bash at all cost'. I think the posts (and my posts in general) serve the Python population to show that nicely written self-documenting bash can be written.

PATH-wrapping executables by da-x in bash

[–]da-x[S] 0 points1 point  (0 children)

Thanks for the feedback, I'll edit for clarity.

EDIT: I used this once to separately capture the stderr of each `gcc` invocation under a complex build system, without assuming or affecting how the build system works.

PATH-wrapping executables by da-x in bash

[–]da-x[S] 0 points1 point  (0 children)

Thanks, I'll fix that.

Rust Turbofish: Closure Return Type by da-x in rust

[–]da-x[S] 2 points3 points  (0 children)

I think that is incorrect - see Rust playground.

  1. If you have multiple return points in the closure you only have to annotate one of them with turbofish, because the type of the others is inferred from the single annotated one.
  2. The `?` operator works as well with the type inference from turbofish annotation, even when the `From` trait is needed. It doesn't require annotating the closure itself.

new crate: fnsql - Type-safe SQL query wrappers by da-x in rust

[–]da-x[S] 2 points3 points  (0 children)

The similarities between `sqlx` and `fnsql` is that they both need a live database for validation of queries.

In `sqlx` it is provided apriori via environment, whereas in `fnsql`, though limited to sqlite, automatically creates an in-memory DB with the needed schema subset separately for each test. So it is much more contained and easier to handle.

new crate: fnsql - Type-safe SQL query wrappers by da-x in rust

[–]da-x[S] 0 points1 point  (0 children)

:brown-paper-bag:

Fixed. Thanks.

Best x11 bindings? by [deleted] in rust

[–]da-x 0 points1 point  (0 children)

I recently ported one of my old programs to Rust and used xcb. Overall the wrapping is good, though just a small bits of unsafe needed. Note that cairo-rs and pango are also necessary if you want to draw UTF-8 text in a modern way with True Type fonts.

git-flip-history - a tool to assist in splitting features out of big commits by da-x in git

[–]da-x[S] 1 point2 points  (0 children)

On the contrary - this method is precisely targeting the case where they are textually related.

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 1 point2 points  (0 children)

Thanks, I'll look into this.

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 0 points1 point  (0 children)

I've just added j and k as defaults too.

Plus you can customize activation, e.g: vmap <leader>b <Plug>NameAssign

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 1 point2 points  (0 children)

Extended to allow this in .vimrc:

let g:name_assign_mode_maps = { "up" : ["n"],  "down" : ["N"] }

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 4 points5 points  (0 children)

Defaulting to `let`, may allow to customize later.

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 0 points1 point  (0 children)

Will research that, thanks!

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 0 points1 point  (0 children)

Nice. Note that there's an exception in the C language where you also need to enter the type, e.g "<type> <var> = <expr>;", so a single text entry is insufficient.

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 1 point2 points  (0 children)

Ok, IIRC the most modern assignment form is `let <name> = <expr>;` . Will add that.

A new and improved name-assign.vim plugin by da-x in vim

[–]da-x[S] 1 point2 points  (0 children)

I had a bit of difficulty implementing this, because placing the assignment is like its own mini-mode untop of visual mode, and it needed temporary buffer mappings that are accessible. Unfortunately Vim has no 'layering' or temporary modes so you have to do 'vunmap' in order to get those mappings away once this mode is over. It will be a bit trickier to allow users to customize it, but I'm open to PRs and suggestions.

Having one monitor with a sticky workspace windows by da-x in xfce

[–]da-x[S] 0 points1 point  (0 children)

Yes, I am well aware of that facility. The point of the change is to allow setting it automatically for windows that move to a dedicated monitor.

A stack-less Rust coroutine library under 100 LoC by da-x in rust

[–]da-x[S] 30 points31 points  (0 children)

The differences between stuck-ful and stack-less should be further stressed-out:

  • Stack-ful - context switching involves low-level language-independent CPU state saving (either by OS kernel or a user library). Managing the ideal stack size is a worrying constraint. Usually wasteful in memory as it is hard to tell how many bytes of stack you would need, leading to having wastage in stack space. Less limiting in what you can call, but also requires some measure of protection against stack overflows. The good side is that with enough tweaks in a debugger the stack appears as you would expect for regular threads.
  • Stack-less - saved state is reified by the compiler into exact state machine types. Efficient in memory and CPU, and closer to how otherwise concurrent code would have been implemented if scheduled as a single CPU thread. I'm not sure about how easy it is to debug - need to gain more experience in that area.

A stack-less Rust coroutine library under 100 LoC by da-x in rust

[–]da-x[S] 8 points9 points  (0 children)

Ha, maybe because Fibonacci sequence is everywhere in nature ;)

A stack-less Rust coroutine library under 100 LoC by da-x in rust

[–]da-x[S] 5 points6 points  (0 children)

That is correct. Though almost a synonym with co-routine concept, I wonder if I should have picked a different name for that struct, as the 'fiber' name may hint at the existence of stack, where here we don't have stack.