Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
0 votes
0 answers
2k views

I am trying to create Dynamic classes in Java 17 spring boot application using Javasssist library and this works only when we add VM option as --add-opens java.base/java.lang=ALL-UNNAMED in the spring ...
Sushmita Mitkar's user avatar
1 vote
0 answers
47 views

I need to find all FK keys. I have a code: public static List<string> GetAllRelations<T>(DbContext db, T entity) where T : class { var model = db.Model; var userEntity =...
Tomáš Sýkora's user avatar
0 votes
1 answer
1k views

I'm building an automatic proxy generator around any arbitrary API given it's swagger document. The intended output would be a python module that could be used as a client for said API. The API itself ...
RobertLD's user avatar
0 votes
1 answer
44 views

I'm creating a stepper component with a v-for loop, which currently works without an issues: <li v-for="(step, index) in stepper" :key="step.id" class="goals-...
Gazillacode's user avatar
4 votes
2 answers
463 views

I was reading through the PerfMark code and saw a comment about avoid an accidental class load through using reflection in a commit: if (Boolean.getBoolean("io.perfmark.PerfMark.debug")) { - ...
Jane's user avatar
  • 93
0 votes
0 answers
41 views

I want to bind a dynamically created namedtuple to a class When an instance of the class is initialized, a new namedtuple-type is created, and registered in globals() (this allows pickling). When ...
Hyperplane's user avatar
  • 1,721
0 votes
2 answers
1k views

I am using OData on a dynamic model. The MyObject data is stored in two different ways on the database - in a main MyObject table and in a secondary table of key/value pairs. The allowed field names ...
ChristyPiffat's user avatar
0 votes
0 answers
207 views

I have a factory class with a method that generates classes dynamically. This class is within a factory.py file. class Factory: def __init__(self, ast): self.ast = ast self.classes ...
ibi0tux's user avatar
  • 2,649
0 votes
0 answers
314 views

Python's library neomodel provides the ability to define a relationship with a class that hasn't been defined yet, by using its name as string, which works fine as follows: from neomodel import ...
Rami Ma's user avatar
  • 1,025
0 votes
2 answers
96 views

i am trying to create an instance of a class using arguments, and the problem is my meta class needs some positional args to decide about the bases of class creation. here is an example to clear it ...
Hossein Dehghanpoor's user avatar
1 vote
1 answer
374 views

PEP 3115 has the following example of using the __prepare__ method of a metaclass (print statements are mine): # The custom dictionary class member_table(dict): def __init__(self): self....
joseville's user avatar
  • 1,023
1 vote
0 answers
386 views

I need to generate a data class at run time based on my REST API response with the given class name , and need to access it .Here is the sample json response and expected sample data class . 1) Sample ...
Pavan Kumar's user avatar
2 votes
1 answer
127 views

I am having trouble targeting a specific div on click, currently when I click "currentTarget.id" the function returns all of the div objects within my JSON file instead of the one that was ...
Captain Steve's user avatar
0 votes
1 answer
1k views

I am trying to dynamically create a class using ByteBuddy with my custom constructor. I have read the Intercepting default constructor with Byte Buddy and I have written the following code base on ...
ardalan foroughi pour's user avatar
1 vote
2 answers
1k views

In the code below, I am dynamically creating an object of the class inside the _py attribute by using the generate_object method. The code works perfectly if I am not using a concurrent approach. ...
ihavenoidea's user avatar
1 vote
0 answers
203 views

I have a code in python which looks something like this: def Make_My_Class(): My_Class = type("My_Class", (object, ), { "__init__": Callinit, "My_Funct": Call_My_Funct, }) ...
nonsqu's user avatar
  • 27
1 vote
1 answer
390 views

I am generating classes from Groovy source and store them in GroovyClassLoader. These classes have @Configuration annotation. They are in package a.b.c.d.e. I want them to configure my spring context. ...
igobivo's user avatar
  • 455
2 votes
0 answers
365 views

I need to take input at runtime and create a new class with it, and load it into the JVM to run. Although this can quickly become an abstract question with minimal concrete answers, and therefore ...
Nate Schreiner's user avatar
0 votes
1 answer
62 views

I'm attempting to convert a working static String class to a dynamic String class using pointers, but when I implement the pointer it throws a segmentation fault error. Code below: mystring1.h: //...
odhranthewizard's user avatar
-1 votes
1 answer
571 views

I know maybe this not a good way to create class but I just wondered why if else working but conditional operator not and need implicit conversion static void Main(string[] args) { ...
sonertbnc's user avatar
  • 1,790
1 vote
2 answers
127 views

I am well aware of fact that classes can be declared dynamically in python using type and have used it here and there. But I am still unclear what are the differences between these two functions. def ...
Nafees Anwar's user avatar
  • 6,678
2 votes
1 answer
285 views

I have a luigi pipeline. We have a lot and lots of external files that change with a regular basis, and we want to be able to build the pipeline from metadata. I create classes dynamically, and have ...
hirolau's user avatar
  • 14k
0 votes
1 answer
53 views

When I changed something in a file containing a dynamic class who's name is called from database. its working fine for the local server, but it is not updating on the live server until I change the ...
Waqas Shaikh's user avatar
1 vote
2 answers
15k views

I have written a method which creates a Dictionary. I need to convert this dictionary to a class. Example of Dictionary Dictionary<string, dynamic> myDictionary = new Dictionary<string, ...
Ehsan Aliverdi's user avatar
2 votes
0 answers
256 views

I'm creating a PHP library to extract schema.org structured data out of web pages. Schema.org features a multiple inheritance hierarchy that I can only achieve through PHP interfaces: interface ...
BenMorel's user avatar
  • 37k
0 votes
2 answers
138 views

I am trying to create a class (working as factory class) in my Zend Expressive APP as follows: declare(strict_types=1); namespace App\Install\Factory; use App\Install\Model as Models; use App\...
Md Monjur Ul Hasan's user avatar
2 votes
1 answer
3k views

When using __new__ to customize the creation of a metaclass, we can pass attributes to the type().__new__ method which will be set on the object before it is returned, e.g. class Foo(type): ...
aaa90210's user avatar
  • 12.3k
0 votes
2 answers
1k views

I'm designing a project about cataloging something. In this project user must be able to create his own table as he wish. Therefore I do not have any static class and instance of it. I'm creating a ...
Emre SERBEST's user avatar
0 votes
1 answer
1k views

I am trying to create in instance of ProjectScreen dynamic class when add_project_screen is called. I want to create various instances of ProjectScreen, each with a different name, which is obtained ...
Amardeep Gill's user avatar
-1 votes
1 answer
130 views

I have a class-loading problem in my app. We are using custom classloader and all is closed correctly but dynamic classes (com.sun.proxy.* and org.springframework.core.$Proxy) are generated pretty ...
kosta5's user avatar
  • 1,148
0 votes
1 answer
284 views

I extended a class dynamically using ASM. I used defineClass method without ProtectionDomain argument.When I try to use that class in other class, I am getting java.lang.NoClassDefFound Error. How can ...
chirag nathwani's user avatar
2 votes
2 answers
2k views

I need a way to run a java method for ex. createModule("Login") and as an output to have: New folder named mod_login Inside on mod_login java classes files created from a template If the template is ...
Jbwz's user avatar
  • 305
3 votes
1 answer
183 views

I want to do something like this def make_class(name : str)->type: class Ret: __name__ = name def __init__(self): self.__x = 0 return Ret A = make_class('A') a = ...
bentheiii's user avatar
  • 451
4 votes
1 answer
6k views

I have a stored procedure which accepts the table name, then it reads the table structure and returns me the table structure in the form of a class definition in a string. E.g.: string myString = "...
Ankur Arora's user avatar
0 votes
0 answers
326 views

I want to create a dynamic class or method. The server sends the complete class as the response. I want to use the response to create a dynamic class.
Nandha Kumar's user avatar
0 votes
1 answer
80 views

I have a need to have custom code attributes that output something like "DataType(DataType.Text)" I'm currently attempting to use CodeAttributeDeclarations. But, something like this adds extra ...
websculpt's user avatar
6 votes
1 answer
3k views

I have a class such as: public class Sample{ private String a; private String b; public Sample(String a, String b) { this.a = a; this.b = b; } public String getA() {return a;} public ...
Rotem ben's user avatar
  • 176
0 votes
1 answer
506 views

I have a builder method which wraps a class with injected props and I would like to set class name the same as the wrapped class. how do I achieve this? (just ignore the flow typing if you want) ...
jeff's user avatar
  • 1,197
4 votes
1 answer
1k views

Looking at the documentation of the super type in Python 3.5, it notes that super(…) is the same as super(__class__, «first argument to function»). To my surprise, I wrote a method that returned ...
Sam Hartman's user avatar
  • 6,539
0 votes
3 answers
2k views

I am reading a bunch of XML files into a list (IEnumerable really) of XElements. Then I want to convert the XElement list (these XElements contain a bunch of child-elements) into a list of classes, so ...
Sach's user avatar
  • 10.5k
0 votes
1 answer
51 views

I am starting out with kivy and I have already hit a roadblock that I cannot solve. All I want is to create a dynamic Ellipse class in kv file and then project that on the canvas of a widget. What I ...
Nebelhom's user avatar
  • 3,951
14 votes
2 answers
10k views

I'm trying to add a dynamic class to a jade template. Like so: - var obj = {a: 1, b: 2, c: 3}; - var len = Object.keys(obj).length; .abc-#{len} But the compiler is taking exception to this: > ...
NotoriousWebmaster's user avatar
0 votes
2 answers
265 views

Let's say I have a list of dictionaries like: list_of_dicts = [ {'id': 'something', type: 'type_a', blah...}, {'id': 'anotherthing', type: 'type_b', blah...}, {'id': 'yetanotherthing', ...
user1087973's user avatar
  • 1,158
0 votes
1 answer
794 views

While trying to execute the following code on show() we get an exception that the links attribute cannot find the model either if it is specified by class or if it is specified by entityName. Ext....
George Pligoropoulos's user avatar
0 votes
0 answers
78 views

I am starting to use asm for generating classes at runtime. I started with a very simple class, which has just one String field and a getter for the same. ClassWriter cw = new ClassWriter(0); String ...
Sachin C Nambiar's user avatar
4 votes
3 answers
6k views

My class is like this: class X {} class Y extends X {}; class Z extends X {}; I have an enum for each subclass (id + class): enum Type { Y_TYPE(1, Y.class), Z_TYPE(2, Z.class); int id; ...
w00d's user avatar
  • 5,626
2 votes
1 answer
2k views

I have a java class that consist of an inner interface, and plan to implement the implementation class during runtime with asm bytecode injection. package my.example; public class X{ public ...
Syenun's user avatar
  • 55
0 votes
2 answers
159 views

I have this: public class Blah { public int id { get; set; } public string blahh { get; set; } } public class Doh { public int id { get; set; } ...
Tomo's user avatar
  • 432
2 votes
3 answers
2k views

There is a Message superclass and there are various Message subclasses like WeddingMessage, GreetingMessage, FarewellMessage, Birthday Message. The Message superclass has a constructor: public ...
sergiisuikoden's user avatar
0 votes
2 answers
2k views

I'm trying to write a code that loads classes dynamically at run time public class URLDynClassLoader { public URLDynClassLoader(){ try{ loadclasses( new File("C:/Users/...
Khaled Eltahan's user avatar