Looking for an alternative way of findFragmentById with binding? - kotlin

Is there any way to get a reference to a Fragment without using findFragmentById or findFragmentByTag ??

There is very little information in your question. I assume you use the FragmentManager? There is a getFragments method, you could find your fragment using that. https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentManager#getFragments()
You could also catch the fragment when it attaches, I believe there is an onAttach callback.
If these solutions are not what you are looking for, please provide more information

Related

Decoding oneof proto fields with tf.io.decode_proto

I'm using tf.io.decode_proto to parse some custom protobufs in a way that can be used inside #tf.functions. This seems to work fine when accessing message fields, but it raises an unknown field error when trying to access something declared as a oneof (not the fields inside it).
Is there any way to get something similar to proto.WhichOneof(oneof_field) using tf.io.decode_proto? If possible I'd rather avoid getting all possible fields inside the oneof and iterating them to see which one (if any) has non-empty data.
I don't know of any workarounds, but a good way to resolve this is to fix the op itself; the error probably comes from here. It's worth filing an issue to see if anyone might be able to help.

How is Groovy hot-swap agent "gragent.jar" is supposed to work in Intellij Idea?

It seems doesn't add anything to the regular java hot-swapping. I'd like to get the groovy class hot-swapped in a case of method adding/removing/signature changing. Is it possible with this agent?
Dany's answer is correct, but doesn't answer the question fully. No, this agent doesn't help you to hot-swap when fields or methods are changed. You might want to consider using DCEVM for that.
Removes all timestamp-related Groovy fields on class loading
Also clears Groovy's call site cache
As stated in
https://github.com/JetBrains/intellij-community/blob/master/plugins/groovy/hotswap/agentSrc/org/groovy/debug/hotswap/ResetAgent.java

extend orm.yml-entity with another orm.yml-entity

I got multiply .orm.yml-entites which actually need to be extended by another one. As it is described here:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#mapped-superclasses
But I do not found a solution there for orm.yml-files, this is only for annotations.
How can i achieve this?

How does GPermission work?

GPermission seems to have little to no documentation. How do you actually use it? (I'm currently using it for a GTK LockButton).
I agree, the documentation is pretty lacking. GPermission is an abstract base class which isn't particularly useful by itself. You need something which actually implements GPermission, like polkit.
There are some examples in gnome-control-center, like the datetime panel.
You need to subclass GPermission. When you need to change the values, you call g_permission_impl_update. Very non-intuitive, but yeah that's how it's done.
Google found me this straight away: https://developer.gnome.org/gio/2.26/GPermission.html
Is that not sufficient?

Jade - way to add dynamic includes

I'd like to do something like the following within a jade template.
include page-content/#{view.template}
As this won't work I have ended up with.
-if(view.path==="/")
include ../page_content/home
-else if(view.path==="/login/")
include ../page_content/login
-else if(view.path==="/join/")
include ../page_content/join
-else if(view.path==="/user/")
include ../page_content/user
ad nauseum
I asked TJ whether it was possible, he replied
unfortunately no, they're compile-time includes, which is somewhat necessary for a few technical reasons that I wont get into but we may eventually need to add a dynamic alternative
I'm wondering if anyone has come up with any alternatives, for example using view helpers.
I'm stuck with a big config file to generate the views - and the if-else statements in the template , I know are going to come back and haunt me. :)
If this is possible using another engine, like ejs or mustache, I'd love to know.
Any ideas much appreciated.
Feels like way too much logic in the view to me. Seems like the best way to do this would be through a dynamicHelper or possibly a mixin