Questions tagged [dynamic]

16760 questions
1

votes
1

answer
1.1k

Views

What does Znwm and ZdlPv mean in assembly?

I'm new to assembly and I'm trying to figure out how C++ handles dynamic dispatch in assembly. When looking through assembly code, I saw that there were 2 unusual calls: call _Znwm call _ZdlPv These did not have a subroutine that I could trace them to. From examining the code, Znwm seemed to return...
user2999870
1

votes
2

answer
1k

Views

Flutter - Create dynamic number of texteditingcontrollers

I am recreating an app I have previously made in Swift, and on one of my pages we call an API and based on the results, we present the user a dynamic number of textfields to search by different search parameters. Is there any good way to do this in Dart/Flutter? Since dart doesn't support generatin...
Matt Lampe
1

votes
1

answer
43

Views

Allow user to select implementation of code to use

I am starting a new project were we need to do some calculations based on some formulas, those formulas are valid for a limited interval for example year: 2017 to Year:2018 each couple of years they can change. However we need to allow the user to select the 'set' of formulas to use for example the...
forcewill
1

votes
1

answer
45

Views

MPI malloc vs MPI_Alloc_mem when to use?

When writing MPI programs, I've been using malloc to allocate dynamic memory, for example: int main(int argc, char* argv[]) { MPI_Init(&argc, &argv); int arr_size = 10; int* arr = malloc( sizeof(int) * arr_size ); // do some MPI stuff MPI_Finalize(); } However, I came across this MPI function: MPI_A...
Aeternus
1

votes
1

answer
54

Views

dynamic keyword affects return type

I'm not entirley sure why the following code compiles namespace ConsoleApp13 { public class Person { } class Program { static void Main(string[] args) { dynamic expand = new ExpandoObject(); List people = GetPerson(expand); } public static Person GetPerson(int item) { return new Person(); } } } Why...
Steven Yates
1

votes
2

answer
87

Views

How to fix “realloc(): invalid pointer”

I am trying to write a function to convert a text file into a CSV file. The input file has 3 lines with space-delimited entries. I have to find a way to read a line into a string and transform the three lines from the input file to three columns in a CSV file. The files look like this : Jake Ali Ma...
P. Gillich
1

votes
4

answer
671

Views

Dynamic Insert — ORA-00923: FROM keyword not found where expected

I'm trying to implement a simple procedure that calculates the proportion of distinct values of a given field and stores the result in an auxiliary table. CREATE TABLE TEST_DATA_QTY_AND ( TABLE_ID VARCHAR2(30), FLD_ID VARCHAR2(30), MEASURE NUMBER(1, 2), DATA_T DATE DEFAULT SYSDATE, NOTES VARCHAR2(25...
M.C.
1

votes
2

answer
58

Views

PIVOT with dynamic columns and JOINS 5+ tables

This is an extension of a question posted by me earlier which can be found here : Previous Question Now i have 2 more tables that are also connected to ProfileFan tracking the Activities of the Fan(ProfileFan). Table Fan ----------------------- | FanId | Name | Info | ----------------------- | 17111...
daskalot
1

votes
2

answer
45

Views

Append function for C with dynamic memory allocation

Following this question, I'm trying to modify the code provided in this blog post to create an append function using dynamic memory allocation. This is what I have so far: #include #include typedef struct intlist_ { int size; int* list; } intlist; void append(intlist* arr, int value){ realloc((*ar...
Foad
1

votes
4

answer
1.6k

Views

Substitute for LD_PRELOAD or LD_LIBRARY_PATH

I'm doing some C programming on a machine for which I don't have root access. I've compiled some shared libraries that I'm linking to, but because I cannot install the libraries in the typical location (/usr/local/lib) I have to explicitly specify the location of the libraries each time I compile an...
Daniel Standage
0

votes
0

answer
2

Views

Knapsack (dynamic programming) segmentation fault error

Here's my code to implement a knapsack problem with dynamic programming algorithm. If the input number (item number size) gets bigger than 300, there is segmentation fault : 11 error. What is the problem? unsigned long long dynamic_programming (unsigned long long W, int item_num, int v[], int w[]) {...
Yoom
1

votes
2

answer
3.4k

Views

How to link dll in visual studio?

To link static library I have to create .lib from .h and .c files. Then I add it to my project, put in Additional Dependencies and compile. To use dll I need .dll and .lib. This .lib is the same as above or different? How to say to Visual studio to use .dll and .lin, not only .lib? I put .dll to pro...
Stark
1

votes
1

answer
3.7k

Views

How to fix 'No property or field exists in type' error?

I got this error when trying to sort any columns that are not in the Order table, if I use OrderBy('Customer.CompanyName' + ' ' + sortDir) the error will gone but all the columns will become unable to sort. The OrderBy method used below come from here. What is the cause of the problem ? public Acti...
Phantom
1

votes
1

answer
1.4k

Views

Java Calculate Max Steps of Stairs and skip stair

I recently got an interview for an intern position and one of the questions was similar to this: Input: n for number of actions, k for a stair that you could not step on Question: Jack has n amount of actions where he wants to reach the maximum number of steps but cannot step on the kth stair. For...
mding5692
0

votes
1

answer
16

Views

Executing script for add primary keys to all tables returns error

I want to add Primary Key IDD to every 'Temp...' table in the schema. I'm trying to do it the following way: DECLARE @addId VARCHAR(MAX) = ''; SELECT @addId = @addId + 'ALTER TABLE ['+ TABLE_NAME +'] ADD IDD int IDENTITY(1,1);ALTER TABLE ['+TABLE_NAME +'] ADD PRIMARY KEY (IDD);' FROM INFORMATION_SCH...
Passer7by
1

votes
1

answer
1k

Views

Lazy Loading Routes in React With Typescript AsyncComponent

I'm trying to lazy load routes in React by implementing the AsyncCompoment class as documented here Code Splitting in Create React App. Below is the es6 asyncComponent function from the tutorial: import React, { Component } from 'react'; export default function asyncComponent(importComponent) { clas...
Mike Lunn
1

votes
1

answer
62

Views

How to refresh app when opened from deeplink?

I am struggling with a react native app. I would implement react native firebase dynamic link, but now I am a little lost. I use this method on HomeScreen which working perfectly every times when somebody opens the app. async componentWillMount() { try { let url = await firebase.links().getInitial...
Robert Kovacs
1

votes
1

answer
101

Views

Fast way to get Expression method call target

Given the following code line of code, Expression expression = () => target.ToString(); is there a fast way to obtain the target object? Below code works public object GetExpressionTarget(Expression expression) { MethodCallExpression methodCall = (MethodCallExpression) expression.Body; LambdaExpress...
Thomas Flinkow
1

votes
2

answer
55

Views

Spread data table based on two columns, SQL server

I have a table I would like to re-shape, that currently looks like this: ID Year Channel Payments 1 2012 HV 100 1 2014 HV 56 2 2012 NL 17000 2 2012 HV 495 3 2013 HV 565 etc... with many rows. I nee...
rw2
1

votes
3

answer
61

Views

Find no of possible formations of explosive mines in a 2D matrix where some cells contain info about even/odd mines are adjacent to them

I am trying to make game involving 2D grid where given some hints a player can avoid cells containing explosive mines. I have come upon a particular scenario where given certain hints, i want to know how many formations of mines are possible. Let there be a 2D matrix. Each cell may be empty or may c...
iro otaku
1

votes
2

answer
32

Views

Check dynamically whether instance implements interface [duplicate]

This question already has an answer here: Test if object implements interface 7 answers I am trying to create a function which takes two parameters - a class instance and a interface - then returns true if the provided class instance implements the provided interface. My problem is that I cannot fi...
Cyber_Agent
1

votes
2

answer
22.4k

Views

How to dynamically create an Actionscript 2 MovieClip based class with

I have a helper method has been created which allows a MovieClip-based class in code and have the constructor called. Unfortunately the solution is not complete because the MovieClip callback onLoad() is never called. (Link to the Flashdevelop thread which created the method .) How can the followi...
tronster
0

votes
1

answer
18

Views

Can a double pointer be written in two ways in c++?

Do the following pieces of code do the exact same thing? is *(*(array+ x) + y) = 1; the same as array[x][y] = 1;
Unknownzdx
1

votes
1

answer
32

Views

Android Layouts within layouts and making a slideable/scrollable strip within my android app

Im a beginner in android development and a bit stuck, I would like to have a strip in part of my main layout which gets dinamicaly filled and where the user can scroll it sideways to get the info while staying within the main layout. Im currently using a horizontal linearLayout and adding texViews t...
Jack
1

votes
1

answer
79

Views

How to know which shared library my program is actually using at run time?

How do I figure out the path of a shared library that my program is using at run time? I have glibc 2.12 as the primary glibc running on my CentOS 6.10 system, and have also installed glibc 2.14 in /opt/glibc-2.14. When I inspect my executable file with $ objdump -p ./myProgram it gives this info D...
Accountant م
0

votes
0

answer
4

Views

Printing Dynamic Sql with Parameter Values

I want to print the SQL Query which is used in the below stored procedure with parameter values.Currently it is printing the SQL Query without parameter values substitution while executing the stored procedure.It is printing the the parameters as it is(for example AND TP.F_LANGUAGE = @LANGUAGE) CRE...
Ram
1

votes
1

answer
249

Views

Writing flatten data.frame in .csv from a Shiny app

I have a problem with managing a dynamic data.frame created in my Shiny app. Problem is, since it is handled through the server.R, I can't find a way to access it, flatten it into a vector then write it after my other variables (which are all text/numeric inputs). Working app can be accessed here :...
Samuel Tremblay
1

votes
0

answer
106

Views

Removing Single View from a layout programmatically

I'm trying to remove a single view from layout but it is not being removed. But, when i call removeAll, it does remove them all. Here is the code: for (int subspe = 0; subspe < totalSubSpe; subspe++) { View childSubSpe = BasicInfoUpdateDocProfile.ll_custom_for_supspecialist.getChildAt(subspe); Text...
Shoaib
1

votes
0

answer
32

Views

Android Activity - Design on Server / Render on Client

We have a Windows Mobile application which is being migrated to Android. It has a large-ish number of forms (around 150). Given the complexity of the rewrite ahead of us, I am looking for as many shortcuts as I can find :) One of the options we are considering is as follows: Move all the .NET code...
Timothy Muir
1

votes
0

answer
46

Views

Display JSON list from dynamically created list

Alright, so I have not worked with JSON before. So far I am able to display the last information entered, but I need to display each input that is entered. How can I loop through my current function to do this? Would I need to do a for loop? If so, could I get some tips on how that would look? Any h...
ICode4Fun
1

votes
0

answer
166

Views

Line graph automatically connects with other collection in DynamicDataDisplay WPF MVVM

In my project, i have to display multiple line graphs dynamically. If i bind more than one dynamic collection to my D3 line graph, every collection end point gets automatically connects with next collection first point. Please help me to differentiate line graphs.
Bala
1

votes
2

answer
83

Views

Bind parameters to partial SQL statement

I am dealing with an old PHP application and have been tasked with making sure all areas used prepared statements. Currently it uses sprintf to build most of the query before executing. Below is some example code of the current implementation: $queryString = 'SELECT count(user.uid) as count FROM use...
Markus Tenghamn
1

votes
0

answer
97

Views

how to display data with dynamic columns -SQL

I have a dynamic pivot query that has dynamic columns column1, column 2... column My query works fine. I can dump it into temp table ... But I wanted a view. I can't because of the changing number of columns. What do I do? It took long time to put this query together as I am not sql expert. I would...
Simi
1

votes
1

answer
42

Views

javascript event targeting a list item but not it's elements

I have this dom and JS: var searchInput = document.getElementById('searchInp'); var suggestions = document.getElementById('suggest'); suggestions.addEventListener('click', function(evt) { var pressed = evt.target.textContent; searchInput.value = pressed; }, false); examplesomething test senten...
Tadas Blinda
1

votes
1

answer
634

Views

Remove dynamically added view component

I have a component that allow user to press on 'Add' button to dynamically add View component. I have managed to do the adding but how i can improve the code to remove dynamically added view component? import React, { Component } from 'react'; import { View, Text, Platform, StyleSheet, Touchable...
Fire Hand
1

votes
0

answer
143

Views

Customising ASP.NET Dynamic Data with ADO.Net Entity Data Model for Ready Only and Audit

I previously followed the below tutorial on Dynamic Data scaffolding with Entity framework: https://www.youtube.com/watch?v=hWatePj2RmE (Part 1 and Part 2) (ASP.net Scaffolding, Dynamic Data with Entity framework) I used this tutorial to implement a table editing solution, that does the following: D...
DIG
1

votes
1

answer
55

Views

Downloading app with firebase dynamic link and deleting and re-downloading returns a value in the link

1 : I click on a dynamic link which I have created with data in it(firsntname, lastname etc..) and go to the appstore. 2 : I build the app on Xcode to simulate a download with the dynamic link 3 : The app is being downloaded and in the openURL a dynamic link with value is returned 4 : Now I delete t...
IOSporgrammerIOS
1

votes
0

answer
22

Views

different output of static dynamic scope

I'm learning difference between static scope and dynamic scope language. Here is a snippet pseudo code. write(x) will print out the value of x. { int x = 2; void fie(reference int y) { y = x + y; x = x + 1; } { x = 3; { int y = 5; int x =6; fie(x); write(x); } } write(x); } What's the output for st...
Davidw
1

votes
1

answer
123

Views

Highcharts - Redundant Y Axis Point Markers (Any insight welcome!)

Having an issue with a dynamic multiple Y axes. Occasionally the spline lines register two data points and botch the spline up. This code is within programable logic controller that employs a 'widget adapter' in which the HTML is handled separately. I am admittedly a hack at this and have managed t...
Justin Lindstrom
1

votes
0

answer
62

Views

Static and dynamic bindning

I have tried to find information on the internet but I have not got a clear picture of it. My question is what affect static and dynamic binding have on encapsulation, inheritance, subtype polymorphism in object orientated programming?
thpthp

View additional questions