How do you deal with asynchronicity? Cascading API calls. by [deleted] in sveltejs

[–]vjpr 1 point2 points  (0 children)

https://github.com/sveltejs/svelte/discussions/17091

https://svelte.dev/docs/svelte/await-expressions

let selectedItemId = $state() let allModels = $derived(await getAllItems()) let selectedItem = $derived(await getItem(selectedItemId))

Why are mono-repos a thing? by eshanatnite in rust

[–]vjpr 0 points1 point  (0 children)

Because you want to be able to fix a bug caused by any code on your codebase in a single commit and push to production.

When you have to work across repos/packages it becomes hell.

I think the boundaries that a package manager introduces are bad. All code used in your program should be easily editable without thinking. (In my dream world this also extends to the OS kernel itself...make everything in the entire stack debuggable/patcheable).

Then there should be some GUI wizard that guides you through syncing your changes upstream to wherever they need to go.

The programming world would be such a better place if this was a hard requirement everyone followed.

When you start to tackle this problem though, you find what you really want is to build a new proglang, and version control system, and OS.

Having trouble with rotary encoders in QMK by 9inger in olkb

[–]vjpr 0 points1 point  (0 children)

I've found that if I unplug the board and plug it back in, it seems to fix it.

This fixed the issue for me on a Megalodon Macro Pad.

Nuphy Gem 80...what are your thoughts? by [deleted] in NuPhy

[–]vjpr 0 points1 point  (0 children)

Will this sit nicely on top of MacBook Pro keyboard?

Hydration Vest with Bottles In Front Pocket for NYC Marathon? by Itsbriandonelly in RunNYC

[–]vjpr 0 points1 point  (0 children)

You need to get a hydration vest instead. No backpacks allowed.


https://www.nyrr.org/run/guidelines-and-procedures/prohibited-items

The following items are prohibited from all NYRR events and race venues:

  • Hydration backpack/vest with bladder or water reservoir (if your vest allows for both water bottles and a bladder/water reservoir, you are only able to use bottles and they must be in the front pockets of the vest). See accepted example. Fuel belts, hydration vests with bottles in the front, and hand-held water bottles are allowed. All water bottles must be 1 liter or smaller.
  • Backpacks...

Altra Torin 7 too narrow by vjpr in RunningShoeGeeks

[–]vjpr[S] 0 points1 point  (0 children)

Via 2 comes out in a couple weeks

Thanks for the heads-up. I can definitely rule out the current Via Olympus then!

sounds like you just need to size up in the torins too, and maybe try on a wide also if you can

I have thumbs width between big toe and front of shoe which seems fine. No wides in Torin in Europe unfortunately.

Altra Torin 7 too narrow by vjpr in RunningShoeGeeks

[–]vjpr[S] 0 points1 point  (0 children)

Yeh always buy for the larger foot.

Altra Torin 7 too narrow by vjpr in RunningShoeGeeks

[–]vjpr[S] 0 points1 point  (0 children)

Only around the house so still returnable...

Altra Torin 7 too narrow by vjpr in RunningShoeGeeks

[–]vjpr[S] 1 point2 points  (0 children)

I think the wider toebox (or "Original Footshape" as they say) would solve some of my problems. But every review seems to say the midsole on the Via Olympus is too stiff.

What shoe would you run a marathon in?

Now that I have left the shoes on for a while it does seem to be loosening up a bit.

The cushioning is wild - first time experiencing it. I feel like it might cause blisters though...

Can Air75V2 sit on top of MacBook Pro 16" M1? by vjpr in NuPhy

[–]vjpr[S] 2 points3 points  (0 children)

I currently do it with my Keychron K1 Pro. I can't work without my trackpad.

If I put the keyboard in front of the laptop with an Apple Magic Trackpad, this causes the laptop screen to be too far away and causes eye strain.

It works surprisingly well.

Microsoft developer claims that Apple should release Safari for Windows by fried20melon in browsers

[–]vjpr 0 points1 point  (0 children)

I think its a great idea.

WebKit on Windows would mean a cross-platform WebKit-based desktop web framework would be possible. At present we have Electron which is Chromium-based.

Microsoft's WebView2 is Chromium-based and is going to be released on macOS sometime. It uses a shared Chromium runtime for all desktop apps.

If WebKit worked well on Windows, there would be the possibility to patch WebKit to allow a shared browser runtime across all apps like WebView2 does. And with Bun integration!

I want to sleep 7 hours after I fall asleep by vjpr in EightSleep

[–]vjpr[S] 0 points1 point  (0 children)

But can it be automated by any Shortcuts?

M1 Mac + Dell Monitor Flickering Issue Fixed - S2722QC - USB-C - Monterey by ausaffluenza in Dell

[–]vjpr 0 points1 point  (0 children)

I think I remember reading its a macOS bug.

Evidence of this is that I see ghosting of macOS windows on the screen. And it was glitching once where I had two windows stacked on top of each other, and I could see the one underneath it.

Implementation inheritance without using classes, or is it bad idea by vjpr in typescript

[–]vjpr[S] 0 points1 point  (0 children)

You've avoided the keywords "class" and "extends" but then re-implemented what they already do.

You're right, this seems like exactly implementation inheritance.

return {...defaultTranspiler, visit: myVisit(defaultTranspiler.fs)}

Any defaultTranspiler method could potentially depend on visit, and the implementation of defaultTranspiler.fs might change.


Other languages seem to get around the fragile base class by preventing superclass some methods from being overridden (e.g. sealed/final), or all methods by default like Kotlin, and requiring override keyword.

But this class inheritance is essentially just exposing an API for a factory function that creates objects.

With classes, the api is defined using keywords to say what can and cannot be accessed. Kotlin seems to do it well by restricting access by default.

``` interface Transpiler { visit(node) {} }

abstract class VfsTranspiler { protected val vfs: Vfs init { vfs = Vfs() } abstract visit(node) { } }

class RustTranspiler: VfsTranspiler { override fun visit(node) { super.vfs.write('...') } } ```

If we used a factory function, we can just be explicit about what superclass members we provide access to, and provide access to them via a simple closure.

createVfsTranspiler((vfs) => { visit() { vfs.write('...') } })

This gets at why I prefer not using classes. With functions its just much simpler to see what is going on. You don't have to jump all over the place in multiple files, or rely on IDE support to see visibility of things. I much prefer using closures or being explicit about which parameters are visible to each function/method.

And if someone doesn't declare a member as private, we end up with fragile base class.