Questions tagged [synthetic]
98 questions
154
votes
13 answers
Synthetic Class in Java
What is a synthetic class in Java? Why should it be used? How can I use it?

andHapp
- 3,149
- 2
- 21
- 20
25
votes
1 answer
What are synthetic fields in Java?
Can someone explain in an easy to understand way the importance of synthetic fields in Java. I recall reading it in context of non static inner classes where each such inner class instance maintains a reference to the enclosing class. Why are such…

Geek
- 26,489
- 43
- 149
- 227
21
votes
2 answers
What's the intended use of @JvmSynthetic in Kotlin?
I have come across the @JvmSynthetic annotation in kotlin-stdlib, and I'm wondering what it is for, but, unfortunately, it is undocumented. (UPD: it was at that moment)
As far as I understand, applying it to a program element will add the synthetic…

hotkey
- 140,743
- 39
- 371
- 326
13
votes
2 answers
Why 'T.super.toString()' and 'super::toString' use a synthetic accessor method?
Consider the following set of expressions:
class T {{
/*1*/ super.toString(); // direct
/*2*/ T.super.toString(); // synthetic
Supplier> s;
/*3*/ s = super::toString; // synthetic
/*4*/ s = T.super::toString; //…

charlie
- 1,478
- 10
- 20
10
votes
2 answers
Why would the Java compiler create a serialVersionUID synthetic field?
As part of debugging an application, I noticed that Field.getDeclaredFields() returns some synthetic fields, including a serialVersionUID field in a class extending an interface, although none extend Serializable.
Why does the compiler add such…

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453
9
votes
1 answer
What is a angular synthetic property?
Recently, while developing a animated component, I came across the term synthetic property.
...
In…

zgue
- 3,793
- 9
- 34
- 39
8
votes
2 answers
Access view binding in Fragment from Activity
I am upgrading an application to remove all synthetics and use the new ViewBinding feature. So far everything works as long as you are inside of the class/layout you are accessing, but I have synthetic references to layout elements in my Main…

gma
- 198
- 1
- 4
- 11
6
votes
0 answers
Ray tracer that handles gradient refractive index?
I would like to find a ray tracing / synthetic imaging program that utilizes gradient refractive indices. I've looked online at a number of ray tracers, but I've yet to find one that specifically handles gradient indices, alongside regular…

AaronJPung
- 1,105
- 1
- 19
- 35
5
votes
1 answer
Find synthetic members in class fields in Scala
I am using the following method in scala to get hold of all the fields in a class:
val fields = contract.getClass.getDeclaredFields.toList.map(value => {
value.setAccessible(true)
value.getName
})
contract has been defined as a class in my…

Core_Dumped
- 4,577
- 11
- 47
- 71
3
votes
1 answer
Define a constructor parameter for a synthetic class in a Scala Compiler Plugin?
I'm trying to generate a class in a Scala compiler Plugin. I have a trait Test, and need a class TestWrapper, approximately like this:
class TestWrapper(wrapped: Test) extends Test { ... }
I define the constructor parameter like this:
val pName =…

Sebastien Diot
- 7,183
- 6
- 43
- 85
3
votes
2 answers
How to prepare data in the input format table and metadata for the Synthetic Data Vault (SDV) library
I want to use the synthetic data generation method of the Synthetic Data Vault (SDV) library (reference https://sdv.dev/SDV/index.html), but I can't. I think my problem is how to prepare data in the input format required for the method ".fit()".
The…

Davide Mariani
- 31
- 2
3
votes
2 answers
Trying to interpolate 2D data using scipy- just getting arrays of NaNs
I'm trying to write a very simple piece of code that will interpolate from a set of existing data to create a synthetic distribution of values.
The code I have so far looks like this:
import pandas as pd
import numpy as np
import scipy
from…

Tessa
- 79
- 1
- 11
3
votes
2 answers
Why we lose the View caching feature on ViewHolder?
Kotlin Android Extensions allow us to access views in the layout XML just as if they were properties, with the name of the id you used in the layout definition. It builds a local view cache for this purpose.
But with the RecycleView adapter we loose…

bitvale
- 1,959
- 1
- 20
- 27
3
votes
0 answers
Mahout's synthetic control data example
Mahout's wiki includes an example of using clustering on synthetic control data (here).
The example includes a data sample with 100 rows of data for each of 6 patterns in the data. What I expect when I run the example code is that some of the…

mister blinky
- 554
- 1
- 5
- 13
3
votes
3 answers
synthesized submodule: from A import B (ok) vs. import A.B (error)?
I have a module modA, which contains a synthesized submodule modB (created with PyModule_New); now importing the module:
from modA import modB it is OK
import modA.modB fails.
What am I missing?
modA.cpp (using boost::python, but it would be very…

eudoxos
- 18,545
- 10
- 61
- 110