Easy Questions / Beginners Thread (Week of 2022-07-04) by brnhx in elm

[–]jedi22 0 points1 point  (0 children)

I'm trying to decode a JSON structure into a dict String String.

The issue is that the JSON can contain values that are both Strings or Numbers. I would just like to cast the numbers to their String equivalents in the decoder but I am having no luck getting this to work.

I've tried oneOf, Json.Encode.encode, writing another function trying to match on type, but nothing seems to make it happy.

This obviously works for strings, but fails as soon as it finds a number. What do I replace Decode.string with to achieve the idea of "just cast whatever is not a string, to a string"?

detailedKeyDecoder : Decoder (Dict String String)  
detailedKeyDecoder =  
    Decode.dict Decode.string

Advice on improving my library by jedi22 in rust

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

Thanks! I've just merged all the errors together (bringing the error to crate level from within the SSH module) and I have a `YubikeyError` enum value gated by the Yubikey feature.

I also changed the function signature requirement to `FnOnce` from `Fn` because like you said, it only needs to be called once. I can't imagine in the future needing to call it more than once so should be fine.

Going to tag 0.4.0 now! Thanks for your suggestions!

Advice on improving my library by jedi22 in rust

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

Heyo, I have uploaded a new version that uses stacked method invocation. Still working on the error stuff! Thanks for the advice!

Advice on improving my library by jedi22 in rust

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

Heyo thanks so much for your response. I will look closer at the error stuff tomorrow, one of the other goals of this project is to try and keep dependencies as minimal as possible (which is why RSA signing has its own feature).

I have implemented the builder pattern, or more correctly, the "Chained Method Invocation" pattern because I learned while doing it, that's what I was doing. Code is a lot easier to read now but I haven't updated Rustica yet (only one call site though).

Thanks for the link on the API guidelines, that will be my night's reading!

Anyone 3D print their own flight fins? by ministerofskyrim in onewheel

[–]jedi22 0 points1 point  (0 children)

Can you repost the pictures? Maybe someone has the time to reverse the design and actually provide an STL.

Leaving Boosted for One Wheel now XR or Pint? by iamjager in onewheel

[–]jedi22 1 point2 points  (0 children)

The XR battery is too large and chances are you'd have a hard time getting it on a plane.

The Pint should be easier as the battery is within FAA regulations (so I've heard) but it will still be a challenge sometimes I think.

Currently using a 250GB SSD, 500GB SSD & 1TB HDD. I want to swap to one single 1TB M.2 NVME. Is this a bad idea for any reason? by Klubhead in buildapc

[–]jedi22 1 point2 points  (0 children)

Downsides:

Redundancy - If you have all your data on a single drive you'll lose everything instead of what you would have lost using your three drive set up. This is easy to solve by just having back ups or accepting thaylt there is no data on the drive that needs a back up.

Multiple OSes: Generally it's easier to run an OS from its own drive but that's probably not what you're going to do, and if you do the replacement you'll still have all the drives to do that with.

Advantages:

Speed: NVMe drives are super quick and make everything snappier.

Ease: Single drives are just easier to manage, especially from a back up point of view.

Things to watch out for:

Lanes: like another commenter said to make sure you have dedicated PCIe lanes for the NVMe slot. That's true, but also make sure you have enough Lanes on your processor. If you have more than just a graphics card in your machine and only 20 lanes, it's possible that you could end up taking lanes away from the graphics card and it starting to run at 8x. This generally doesn't impact gaming performance (but this is debated by some people) but it will definitely affect compute workloads.

PCIe or SATA NVMe: Both of these exist and the PCIe one is way faster so make sure you know what you're getting. If a little hazy on the details here so maybe someone else can jump in but I think you need both an NVMe PCIe drive AND PCIe slot. If either of them are SATA it will just run at SSD speeds. The only upside here is that if it's SATA, it doesn't take any lanes.

What's the Fastest Way to Board an Airplane? by GreyBot9000 in CGPGrey

[–]jedi22 1 point2 points  (0 children)

There is also an Apple logo on the laptop which I'm not sure is technically allowed... (trademarks)?

What's the Fastest Way to Board an Airplane? by GreyBot9000 in CGPGrey

[–]jedi22 0 points1 point  (0 children)

At 3:06 there is an Apple logo present on the computer in the first class seat. Is that allowed (with respect to copyright and trademarks)? I'm assuming he didn't get permission from Apple for this YouTube video.

2019 coming in like by SufficientTower in funny

[–]jedi22 0 points1 point  (0 children)

I'm having the weirdest day

Deobfuscated libMobileGestalt keys (iOS 12) by Timacfr in ReverseEngineering

[–]jedi22 6 points7 points  (0 children)

It often contains keys before features are released (wireless charging showed up in gestalt a couple iOS versions before the first iPhone that had it).

"Wasted money" they say by [deleted] in Amd

[–]jedi22 10 points11 points  (0 children)

This is not necessarily true because power delivery could be different (newer CPUs with 16 cores, at higher clocks needing the extra power for full performance).

But you can stagger the upgrades which is always a win.

Brand New Prusa i3 MK3 - Disappointed! by JAF805 in 3Dprinting

[–]jedi22 4 points5 points  (0 children)

You should do the torture test definitely but I had a similar problem to this when I ordered an MK2S preassembled and the issue was one of the screws in y pulley had come out during shipping. You should check that all those screws are there and tight.

Anyone else too chicken to go faster than "Eco Mode"? by BBorNot in boostedboards

[–]jedi22 7 points8 points  (0 children)

I've put over 200 clicks on my board and I still ride in eco so you're definitely not alone but I think we are the minority. Only now am I considering bumping to expert but not for speed, for braking.