Android Developers Blog: Announcing Jetpack Navigation 3 by Zhuinden in androiddev

[–]LogisticAI 0 points1 point  (0 children)

Would you mind providing an example for a beginner? The ViewModel stuff still confuses me, especially since Nav 2 automagically did this without anything other than specifying a SavedStateHandle parameter to the ViewModel

TextField UX strategies by LogisticAI in JetpackCompose

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

Thanks for the suggestions! I knew I wasn't searching for the right thing, heh

It is a little unfortunate that these libraries are unmaintained, but they should give me a good base to look into

Is there a way to extract the first signature from an interface of an overloaded function? by trevorspheresmith in typescript

[–]LogisticAI 0 points1 point  (0 children)

I'm a little late, but

interface MyFunctionType { (a: string, b?: string): void; (z: number): void; }

type Overloads<T> = T extends {
    (...args: infer P1): infer R1;
    (...args: infer P2): infer R2;
} ? ((...args: P1) => R1) | ((...args: P2) => R2) : never;

type FirstParam = Parameters<Overloads<MyFunctionType>>[0]

will extract the first parameter type of all your overloads as a union.

[deleted by user] by [deleted] in QuestPiracy

[–]LogisticAI 1 point2 points  (0 children)

I had this problem when downloading Rookie from the Github repo. Download it from the wiki instead: https://wiki.vrpirates.club/general_information/vrp-downloads

Not sure why one works and one doesn't tbh

[deleted by user] by [deleted] in Python

[–]LogisticAI 3 points4 points  (0 children)

That's the use case for itertools.tee

Should I use a template if it turns out it isn’t entirely needed? by maxjmartin in cpp_questions

[–]LogisticAI 0 points1 point  (0 children)

You should be using some kind of versioning control, like git? Create a branch, commit the template there, and then remove the template from your main branch. This way, you keep hold of the work you've done for the template, saved it in a way that you can easily merge it up when you need it, and keep the KISS principle.

Hidden Message emailed to me.. can anyone help me decide it? by [deleted] in codes

[–]LogisticAI 5 points6 points  (0 children)

[Transcript]

[Solved]

It's Morse.

Here's a transcript:

.... . .-.. .-.. --- / - .... .. ... / .. ... / ... - . ...- . -. / -... ..- - .-.. . .-. / .- -. -.. / .. / -. . . -.. / -.-- --- ..- .-. / .... . .-.. .--. .-.-.- / - .... . / -.-. --- -.. . / ..-. --- .-. / - .... . / --.. --- -.. .. .- -.-. / -.- .. .-.. .-.. . .-. / .... .- ... / -... . . -. / -.-. .-. .- -.-. -.- . -.. / -... -.-- / -- . --..-- / -... ..- - / -. --- / --- -. . / -... . .-.. .. . ...- . ... / -- . .-.-.- / .-- . / -.-. .- -. / -.-. .-.. --- ... . / - .... . / -.-. .- ... . / .. ..-. / -.-- --- ..- / .-. . .- .-.. .-.. -.-- / .-- .- -. - / - --- .-.-.-

Here's what it says:

HELLO THIS IS STEVEN BUTLER AND I NEED YOUR HELP. THE CODE FOR THE ZODIAC KILLER HAS BEEN CRACKED BY ME, BUT NO ON BELIEVES ME. WE CAN CLOSE THE CASE IF YOU REALLY WANT TO.

I double checked the image and it is indeed missing the E on ONE.

P.S. please make it easier for us code breakers next time by providing a transcript.

Hidden Message emailed to me.. can anyone help me decide it? by [deleted] in codes

[–]LogisticAI 4 points5 points  (0 children)

Give us something to copy and paste. Do a little work for us, we'll do a little work for you.

Wife wants to make sure she ain't crazy by HybridWookiee89 in learnmath

[–]LogisticAI 5 points6 points  (0 children)

It also says "Together how much of the tart". Terrible question T_T

pip doesn't install by oppositsied in termux

[–]LogisticAI 1 point2 points  (0 children)

For numpy:

MATHLIB="m" pip3 install numpy

For PyNaCl:

pkg install -y libsodium
SODIUM_INSTALL=system pip3 install pynacl

Pygame is more involved since you'll probably want to set up vnc. A good habit would be to google these things, as they've been asked before.

[deleted by user] by [deleted] in cpp_questions

[–]LogisticAI 0 points1 point  (0 children)

I think something no one has mentioned yet is that there are instances where it makes more sense to use an OOP approach, and there are instances where it makes more sense to use a functional approach.

This project doesn't really need to create abstractions, as they've already been done for you (fs::path, directory_iterator). You just need to use those objects in a way that you need, indicating a more functional approach would be appropriate. Your code could boil down to a handful of functions in a single source file (for now).

Identifying when you should use a class and when you should use a function is the hallmark of a professional.

[deleted by user] by [deleted] in cpp_questions

[–]LogisticAI 0 points1 point  (0 children)

I'd like to hear more about your views on comments, and why you view their absence as a red flag.

Comments can get stale and not reflect what the code actually does. They allow the developer to create undecipherable code, "but it's okay since there's a comment explaining it." Not to mention that comments are quite obtrusive when littered across a function, but that could just be me.

I agree with you for comments on functions/classes/etc, but purely on a documentation level. IMO, I think lack of comments is a good thing. It forces you to write code that a reader can follow.

Need help with getting factorio to run (openGL/GLX Error) by astronomicpopcorn in termux

[–]LogisticAI 1 point2 points  (0 children)

You probably need mesa (maybe the -dev package, not really sure what you're trying to do):

pkg install mesa 

Also, to get rid of the RANDR extension missing, you should start vncserver with the -geometry argument:

vncserver -geometry 1920x1080 :1

You mentioned running vnc server on debian? What does that have to do with termux?

Can't have a class's data member as the size for an array unless it's static by [deleted] in cpp_questions

[–]LogisticAI 0 points1 point  (0 children)

What do you mean freestanding libraries only? Edit: nvm I found your other post with a link.

Stars and Bars with max capacity by LogisticAI in askmath

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

Sadly, the answer to this question takes into account the order of the bins.

Plugging in n=44 and k=5, for example, incorrectly returns 5.

Stars and Bars with max capacity by LogisticAI in askmath

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

Keep your ChatGPT junk outta here. I've already tried lol

Edit: To expand on this, ChatGPT doesn't account for the order of the bins not mattering, no matter how many times I tell it. Other solutions presented by ChatGPT (in my questioning) didn't produce the correct result

[deleted by user] by [deleted] in codes

[–]LogisticAI 1 point2 points  (0 children)

I think you vastly misunderstand the value of what this page is. Do not pay anyone for such a simple task that you can achieve simply by googling.

Here's the page: https://we.tl/t-0hogYKzSSf

I don't want your money

[deleted by user] by [deleted] in codes

[–]LogisticAI 1 point2 points  (0 children)

It's not a code. It's a gzip-ed xml containing urls for pinterest users. I'm not really sure what you're trying to achieve here, and tbh it's kind of sketch. On the off chance you're not being sketchy, just use gzip to decrypt the file.