dynamic

Dynamic Return Type in Java method

你。 提交于 2020-01-22 07:21:29
问题 I've seen a question similar to this multiple times here, but there is one big difference. In the other questions, the return type is to be determined by the parameter. What I want/need to do is determine the return type by the parsed value of a byte[] . From what I've gathered, the following could work: public Comparable getParam(String param, byte[] data) { if(param.equals("some boolean variable") return data[0] != 0; else(param.equals("some float variable") { //create a new float, f, from

Dynamic Datasource in SQL Server Stored Procudure

跟風遠走 提交于 2020-01-22 02:22:05
问题 I have a SQL Server that houses Several Databases. I have a Main Database that holds several tables with entities and ID numbers. Then, each one of those entities has a correlating database (not a table, but database) with all of its information. For example, if the an entity in the MAIN database has an ID number of 1, there would be an SubDatabase1 Database on the same SQL Server. Essentially, what I am trying to do is create a stored procedure in the MAIN Database, that collects data from

Dynamically Growing an Array in C++

こ雲淡風輕ζ 提交于 2020-01-22 02:20:10
问题 I have an array of pointers of CName objects. I have the following constructor which initializes my array to size one. Then when I add an object I grow the array by 1 and add the new object. It compiles fine, however when I try to print them I just get segmentation fault error. Can you look and see if I'm doing anything wrong? //constructor Names_Book::Names_Book() { grow_factor = 1; size = 0; cNames = (CName**)malloc(grow_factor * sizeof(CName*)); cNames[0] = NULL; } void Names_Book:

Dynamically execute query using the output of another query

别等时光非礼了梦想. 提交于 2020-01-21 16:57:08
问题 I have a function called generate_table, that takes 2 input parameters ( rundate::date and branch::varchar ) Now I am trying to work on a second function, using PLPGSQL, that will get a list of all branches and the newest date for each branch and pass this as a parameter to the generate_table function. The query that I have is this: select max(rundate) as rundate, branch from t_index_of_imported_files group by branch and it results on this: rundate;branch 2014-03-13;branch1 2014-03-12;branch2

Dynamically execute query using the output of another query

回眸只為那壹抹淺笑 提交于 2020-01-21 16:56:50
问题 I have a function called generate_table, that takes 2 input parameters ( rundate::date and branch::varchar ) Now I am trying to work on a second function, using PLPGSQL, that will get a list of all branches and the newest date for each branch and pass this as a parameter to the generate_table function. The query that I have is this: select max(rundate) as rundate, branch from t_index_of_imported_files group by branch and it results on this: rundate;branch 2014-03-13;branch1 2014-03-12;branch2

Passing a variable through DTEXEC with xp_cmdshell (SQL Server 2008)

孤人 提交于 2020-01-21 16:56:12
问题 I have created an SSIS package that imports an Excel file into my database. I have created a variable that I would like to use as the Excel filepath for the excel connection manager. The name of the variable in my SSIS package is "ExcelSource" and it is supposed to represent the full path. I would like to eventually set this dynamically because the filename contains a date. What is the T-SQL code to run this? Here is what I have so far: DECLARE @ssisstr VARCHAR(8000) , @packagename VARCHAR

Expression Lambda to order fields with null value

♀尐吖头ヾ 提交于 2020-01-21 14:34:45
问题 I use a dynamic method to order a list of object. For Each Sort In MesDonnees.MesOptions If Sort.Sens < 2 Then Dim sortPropertyName As String = Sort.ColName If (TypeClass.GetProperties().Any(Function(prop) prop.Name = sortPropertyName AndAlso prop.CanRead)) Then 'Information sur la propriété recherchée Dim pinfo As PropertyInfo = TypeClass.GetProperty(sortPropertyName) Dim Expr As Expression = Expression.Property(paramExpr, pinfo) Dim Tostr As Expression = Expression.Call(Expr, "ToString",

Dynamic allocation of memory

我的梦境 提交于 2020-01-21 11:47:29
问题 Lets consider following two codes First: for (int i=0;i<10000000;i++) { char* tab = new char[500]; delete[] tab; } Second: for (int i=0;i<10000000;i++) { char tab[500]; } The peak memory usage is almost the same, but the second code runs about 20 times faster than the first one. Question Is it because in first code array is stored on heap, and in the second one array is stored on stack? 回答1: Is it because in first code array is stored on heap, and in the second one array is stored on stack?

Dynamic allocation of memory

北城以北 提交于 2020-01-21 11:47:26
问题 Lets consider following two codes First: for (int i=0;i<10000000;i++) { char* tab = new char[500]; delete[] tab; } Second: for (int i=0;i<10000000;i++) { char tab[500]; } The peak memory usage is almost the same, but the second code runs about 20 times faster than the first one. Question Is it because in first code array is stored on heap, and in the second one array is stored on stack? 回答1: Is it because in first code array is stored on heap, and in the second one array is stored on stack?

How to pass form values as FormData in reactjs on submit function

依然范特西╮ 提交于 2020-01-21 07:27:58
问题 I have a dynamic form generated using json data and I need to pass the form input values on submit. I'm planning to send the values as formdata. I have created submit function but i dont know how to append the values in formdata and need to pass through post method using Axios. Im new to react can anyone tell me how to do this. Below is my code. var DATA = { "indexList": [{ "Label": "Name", "Type": "text", "Regex": "", "Default_Val": "", "Values": { "Key": "", "Value": "" }, "Validtion Msg":