Decoding oneof proto fields with tf.io.decode_proto - tensorflow2.0

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.

Related

How to fix the auto code formatting in Pharo?

When I save a method and get back to it later, all of my variable names become temp and all of my parameters becomes arg and the code indentation get changed.
Any thoughts on how I can fix this?
The behaviour that you are experiencing is not code formatting at all. You immage is experiencing an issue where it can't access original source code. Thus it uses a backup solution and decomples method bytecode. During the compilation process the variable names are erased, so they can't be re-created during the decompilation, and generic substitudes are used instead.
Now, why you are missing sources is another question. First of all it's important to check if you get some exceptions. Often these happen when you open or save your image, but also thaty may occur when you save methods.
Depending on the Pharo version you may be missing .changes or .sources files. This often happens when you more an image without moving other supporting files.

VBA Access Error displayed but nothing in the code

It's my first time using VBA and Access even if I'm coming from Angular and Swift, I'm completely lost.
I'm modifying an existing project and I have created a text label and used the expression generator, then the application crashed. I obviously think that there is a problem in the "expression" that I generated.
The problem is now that I cannot access to the Form where I was working and I get this message :
I have tried to go to the code but I haven't found my problematic expression. Do access store somewhere else the code generated, especially for the expressions generated? How can I find again my problematic expression?
In the code I found, I didn't find any object declaration, for example, as a TextBox...I tried to compile all code, since this is a syntax error, it should be easier to find and solve but it didn't work at all, the compile and run didn't show me any syntax error, I tried to change some settings to handling error but no success...
So if someone could tell me how to solve this problem. Thanks in advance.

Realm database performance

I'm trying to use this database with react-native. First of all, i've found out that it can't retrieve plain objects - i have to retrieve all of the properties in the desired object tree recursively. And it takes about a second per object (~50 numeric props). Slow-ish!
Now, i've somehow imported ~9000 objects in it (each up to 1000 chars including titles). Looks like there is no easy ay to import it, at least it is not described in docs. Anyway, that's acceptable. But now i've found out that my database size (default.realm) is 3.49GB (!). The JSON file, which i was importing is only 6.5mb. I've opened default.realm with Realm Browser and it shows only those ~9000 objects, nothing else. Why so heavy?
Either, i don't understand something very fundamental about this database or it is complete garbage. I really hope i'm wrong. What am I doing wrong?
Please make sure you are not running in chrome debug mode. This is probably why things seem so slow. As far as the file size issue goes, it would be helpful if you posted your code to help figure out why that is happening.

Clarification needed for Jade Syntax

I'm working with Huge's new Styleguide templates and am starting to wrap my head around Jade syntax. That said, I can't seem to find any documentation related to how the author created image paths. The syntax used is:
img.huge-sidebar__logo.clearfix(src='styleguide/assets/images/#{public.styleguide._data.logoImage}')
The part I'm not getting is the section of the path that appears to be an include:
#{public.styleguide._data.logoImage}
Can anyone shed some light on what this is called and what it's doing?
What you are seeing is an interesting application of Jade's interpolation functionality, which can be used on plaintext strings, such as is the case with src='...'.
It looks different (with the dots) because it's using a multidimensional JavaScript Object rather than simply a variable.

WinDev - Using a variable in a Looper Content Query

I am hoping someone will be able to point me in the right direction. I have a Looper control within WinDev and am filling the Content using a Query.
How do I utilise a global variable within the query? It seems that it must be passed in as a parameter to the query, however there is no opportunity to set the parameter unless executing the query from code. It all seems a little contradictory and I am sure I'm missing something obvious.
UPDATE
Having read about MySource but also read that MySource cannot be utilised in an Initialization block; I have moved the query to independent. Thereby allowing me to set the parameter with
Query name.Parameter = Value
However, although the Query is specified in the Content table of the Looper control, it does not seem to return anything.
Have tried calling HExecuteQuery() and LooperDisplay(), neither of which seem to do anything.
The query is a simple select and works when tested in the query editor.
Any help would be greatly appreciated,
It turns out that I had to go into the Description of each field and re-click the Link entry. Nothing changed as I clicked them but the data now appears.
Not a great solution but it resolved the issue :-(
Changing from embedded to independent is the best thing you could do and it's the best practice as well. Once the source has changed though you do have to rebind all the data to the attributes since it loses it's references.
You better execute the query at the window's Global Declarations section if you don't want to eat up resources and I/Os for nothing by using the Window's End of Initialization section like I've seen people doing .
This way you don't need to call LooperDisplay() and your independent Query will only be called once by your HExecuteQuery().