Questions tagged [dynamic]

Dynamic is a widely used term that, in general, describes a decision made by the program at run-time rather than at compile time.

Programs that perform some common tasks based on program inputs in contrast with programs that predetermine the task beforehand. Dynamic is often used to mean:

  • The dynamic keyword
  • using JavaScript to manipulate web pages in the browser.
  • have features that allow the of a variable to be bound at run-time.
  • Program generated content, especially content in contrast with web pages created by a person and stored on disk, ready to serve.
27209 questions
100
votes
5 answers

How to debug dynamically loaded JavaScript (with jQuery) in the browser's debugger itself?

A dynamically-added script is not showing up in the browser's debugger's scripts section. Explanation: I need to use and have used if( someCondition == true ){ $.getScript("myScirpt.js", function() { alert('Load Complete'); …
TwiToiT
  • 1,200
  • 2
  • 9
  • 13
100
votes
3 answers

Why does this (null || !TryParse) conditional result in "use of unassigned local variable"?

The following code results in use of unassigned local variable "numberOfGroups": int numberOfGroups; if(options.NumberOfGroups == null || !int.TryParse(options.NumberOfGroups, out numberOfGroups)) { numberOfGroups = 10; } However, this code…
Brandon Martinez
  • 1,330
  • 1
  • 9
  • 13
99
votes
2 answers

Setting android:animateLayoutChanges programmatically

I am creating linearLayouts programmatically and would like them to fade in and out when the visibility is set to visible/gone. I can set android:animateLayoutChanges="true" in the xml-file, but since I am creating the views programmatically, I…
deimos1988
  • 5,896
  • 7
  • 41
  • 57
97
votes
8 answers

Avoid Pylint warning E1101: 'Instance of .. has no .. member' for class with dynamic attributes

Imagine a function which dynamically adds attributes to an object using setattr. The reason for doing so is that I want to map some external structure (e.g. a given parameter tree) to an object: my_object = SomeClass() apply_structure(my_object,…
frans
  • 8,868
  • 11
  • 58
  • 132
95
votes
29 answers

Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7

I have a Swift project that uses a ObjC dynamic framework, the framework had to be linked with and embedded into my project. The project runs OK in devices, when submitted to App Store, the error occurred during validation: Found an unexpected…
pzs7602
  • 1,233
  • 1
  • 10
  • 9
94
votes
4 answers

How can I dynamically create a selector at runtime with Objective-C?

I know how to create a SEL at compile time using @selector(MyMethodName:) but what I want to do is create a selector dynamically from an NSString. Is this even possible? What I can do: SEL selector = @selector(doWork:); [myobj…
craigb
  • 16,827
  • 7
  • 51
  • 62
92
votes
8 answers

C# ‘dynamic’ cannot access properties from anonymous types declared in another assembly

Code below is working well as long as I have class ClassSameAssembly in same assembly as class Program. But when I move class ClassSameAssembly to a separate assembly, a RuntimeBinderException (see below) is thrown. Is it possible to resolve it? …
mehanik
  • 1,067
  • 2
  • 9
  • 11
87
votes
7 answers

How to dynamically change base class of instances at runtime?

This article has a snippet showing usage of __bases__ to dynamically change the inheritance hierarchy of some Python code, by adding a class to an existing classes collection of classes from which it inherits. Ok, that's hard to read, code is…
Adam Parkin
  • 17,891
  • 17
  • 66
  • 87
87
votes
26 answers

Javascript: how to dynamically create nested objects using object names given by an array

I hope someone can help me with this Javascript. I have an Object called "Settings" and I would like to write a function that adds new settings to that object. The new setting's name and value are provided as strings. The string giving the setting's…
David
  • 1,005
  • 1
  • 10
  • 12
87
votes
15 answers

Determine size of dynamically allocated memory in C

Is there a way in C to find out the size of dynamically allocated memory? For example, after char* p = malloc (100); Is there a way to find out the size of memory associated with p?
s_itbhu
  • 1,177
  • 3
  • 10
  • 12
86
votes
11 answers

Width and Height Equal to its superView using autolayout programmatically?

I've been looking for a lot of snippets in the net and I still can't find the answer to my problem. My question is I have a scrollView(SV) and I want to add a button inside scrollView(SV) programmatically with same width and height of its superview…
Bordz
  • 2,810
  • 4
  • 23
  • 27
86
votes
6 answers

Adding rows to tbody of a table using jQuery

I am trying to add rows to the tbody of a table. But I am having issues with achieving that. Firstly, the function where everything takes place is called on change of a dropdown from a html page. I created a tr string containing all the td inside…
Anupam
  • 1,821
  • 3
  • 23
  • 41
84
votes
8 answers

How to add dynamically attribute in VueJs

I'm using vuejs and I wanna know how to have control on inputs (add disabled attribute when necessary). Is there any way to add dynamically attribute in vuejs ? Below my Textfield component :