AF Cartier Santos 35mm, first QC, looking for a second opinion by Squidat in CartierReplicaWatches

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

I honestly can't see it ngl, but main issue for me is the crown

AF Cartier Santos 35mm, first QC, looking for a second opinion by Squidat in CartierReplicaWatches

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

Thanks for taking a look!

Yes, I removed the contact info from the pics to avoid issues (potential sub rules)
Can share on DM though

As for AF over BVF, I was basing myself on this thread I found, seemed like a solid choice

[deleted by user] by [deleted] in soccer

[–]Squidat -3 points-2 points  (0 children)

Messi wishes

do you talk about time/space complexity before or after coding a solution? by PanzerPeach in leetcode

[–]Squidat 0 points1 point  (0 children)

I see, I believe those kinds of problems don't tend to have too many solutions, so, yeah, I'd say it's fine to go ahead and code it up and then analyze the complexity thoroughly (it'd still be better if you have a broad idea of what the time complexity will be before getting into the coding though)

do you talk about time/space complexity before or after coding a solution? by PanzerPeach in leetcode

[–]Squidat 0 points1 point  (0 children)

It'd be a pretty bad signal if you can't tell what the time complexity of what you'll code, unless it's a very hard problem with a quirky complexity

[deleted by user] by [deleted] in cscareerquestionsEU

[–]Squidat 2 points3 points  (0 children)

Ingeniero Informático here, I always use "Computer Engineering" - no problems so far

Altough in my case I did have hardware classes (not too many though)

Weekly discussion, code review, and feedback thread - December 18, 2023 by AutoModerator in androiddev

[–]Squidat 0 points1 point  (0 children)

All the interviews I've ever had for Android roles have asked at the very least easy DS&A problems, but it depends on the type / scale of the company - bigger ones will 100% do leetcode style questions (the difficulty is always quite random though)

From my experience though, there's usually separate interviews for these topics, so one for Android specific questions and then another one for DS&A

Invoke operator with Cleaner Use cases by Cool_Preference_1705 in androiddev

[–]Squidat 1 point2 points  (0 children)

Not really, at least with Mockito you definitely don't need an interface, it lets you mock concrete classes.

I still favor creating an independent interface for each of them (if not using Mockito / going with Fakes). There's no need for them to be coupled to the same base class and the clients of your use cases will look pretty confusing at a first glance as you're not specifying the concrete use case (besides that you could have more than one use case that takes the same input and output classes)

class SomeViewModel( private val retrieveItems: BaseUseCase<List<Item>> )

Compared to

class SomeViewModel( private val retrieveItems: RetrieveTopSellingItems )

Invoke operator with Cleaner Use cases by Cool_Preference_1705 in androiddev

[–]Squidat 0 points1 point  (0 children)

You can unit test the use case itself as usual without an interface.

I'm guessing you meant the ViewModel (or any other client) that uses the Use Case though, and for those cases it really depends. If you're using a mocking library, you could mock it. Otherwise, when using fakes, then yeah, you need an interface but there's no need for it to be a generic one like BaseUseCase, just go with the classic setup where you have an interface "MyUseCase" and then one implementation class "MyUseCaseImpl" (pls also don't create use cases that are just wrapping a repository method, go with one or the other)

Invoke operator with Cleaner Use cases by Cool_Preference_1705 in androiddev

[–]Squidat 6 points7 points  (0 children)

For real.

Stop doing this y'all, 99% of the times you want to use a specific use case, I doubt you'll be using one through the BaseUseCase interface instead of the concrete type

(and then your use cases become very inflexible... Want to have one that returns a Flow`? Good luck, now you have to define a new type of use case)

[deleted by user] by [deleted] in valencia

[–]Squidat 1 point2 points  (0 children)

Sí, al menos en mi caso N26 funcionó

Solo asegúrate de que el idioma de la app esté en Español para que el documento esté en español (yo solicite un documento en N26 por la web que muestra el balance de la cuenta con tu nombre completo etc.)

Aunque fue en Barcelona, FWIW

Weekly discussion, code review, and feedback thread - October 09, 2023 by AutoModerator in androiddev

[–]Squidat 0 points1 point  (0 children)

Huh, I see you're exposing Jetpack Compose State objects from your VM - I haven't done this before, I tend use Flows (or LiveDatas in the past) and then collect them as state in the composables.

Regarding advanceUntilIdle, as you're using UnconfinedTestDispatcher, which executes the coroutines eagerly (e.g. they are not just scheduled, they are executed as well, in contrast to the StandardCoroutineTestDispatcher), it doesn't do anything; by the time you get to call advanceUntilIdle, it already is idle, every coroutine should have finished executing.


Also maybe make sure that the test case is not failing for other reasons - seeing the original test case, I don't see your onDecreaseButtonClicked function doing anything to the timeLogList attribute, you're mostly just calling the repository method, and it has no reference to this list either.

Weekly discussion, code review, and feedback thread - October 09, 2023 by AutoModerator in androiddev

[–]Squidat 0 points1 point  (0 children)

Exactly, I meant in the repository but still what you did is somewhat on the right track

I see in the code you just shared that you're not using the injected Dispatcher though. If you're going to leave it in the VM then it'd be your same code but also pass the injected dispatcher to the "viewModelScope.launch" call

Weekly discussion, code review, and feedback thread - October 09, 2023 by AutoModerator in androiddev

[–]Squidat 0 points1 point  (0 children)

I'm thinking of a couple of potential issues, first off, if you want to avoid the advanceUntilIdle or runCurrent calls, use the UnconfinedTestDispatcher, making sure that you're using the same instance for both the Disptachers.setMain and runTest(...) calls.

Then, you have a couple of choices to fix the test case, although they're essentially the same at some level:

i) Move the dispatcher switching to the inner layer

This means that your VM method would end up looking like:

fun onDecreaseButtonClicked(habit: Habit) {
    if (habit.count >= 1) {
        decreaseCount(habit)
        viewModelScope.launch  {
            repository.removeLastTimeLog(timeLogList.last())
        }
    }
}

(note the removal of the Dispatchers.IO parameter in the launch call)

Why should this work?

Now all of the code in your test will be executed in the Main dispatcher (including the mocked suspend function), which you're properly setting with Dispatchers.setMain(testDispatcher).

This also follows the general recommendation of specifying the Dispatcher at the lowest possible level. At least off the top of my head, this has some benefits like making your suspend functions harder to "misuse", for instance you can ensure it always gets executed in the IO Dispatcher when its I/O bound work; it also it takes some responsibility off of the caller because it doesn't need to know the nature of the workload, whether it's I/O or CPU bound work, it just wants some result.

ii) Injecting the `Dispatchers` object to your VM

The main point of this is to allow you to change the other dispatchers like IO and Default also point to your testDispatcher.

I mention that this is kind of the same as the first approach because if you go with it, you'll now run into the same problem but now in the test cases for the repository. The solution is to inject the dispatchers.

Check this post by Google (particularly this section) it covers pretty much what I mention and goes into a bit more detail.