parameters

Invoking procedure defaults without binding values to parameters in Jdbc

陌路散爱 提交于 2019-12-11 07:55:55
问题 I am trying to call a PL/SQL procedure which has defaults defined for some of its parameters. I am doing this using CallableStatement in JDBC . This procedure has a large number of parameters with defaults defined. I do not want to explicitly set the defaults in the Java code. Doing this would make maintaining the code harder. If the PL/SQL code changes , would have to make the same changes in the Java code too. Is it possible to accomplish this in JDBC ? For instance just bind values to the

Putting biographical data in order from 4 parameters using python 3.3

陌路散爱 提交于 2019-12-11 07:48:33
问题 I need to create a function called student data, that takes 4 parameters, a name (a string), age (an integer), student number (a string) and whether they are enrolled in CSCA08 (a boolean), and returns a string containing that information in the following format: [student number,name,age,enrolled] . I have written the following code but it doesn't work def student_data(name,age,number,enrolled): name = str() age = int() number = int() enrolled = bol() return '['+ 'number'+','+'name'+','+'age'

Passing Parameters from An Activity to BroadcastReceiver

不打扰是莪最后的温柔 提交于 2019-12-11 07:43:49
问题 Hey I have been trying to pass an array of string from my activity to broadcast receiver but it always give me null at broadcast receive i have tried it in 2-3 ways. // Code in Receiver String stringText= intent.getExtras().getString("string_text"); //Code in Activity Intent i = new Intent("android.intent.action.PHONE_STATE"); i.putExtra("string_text", "abc"); sendBroadcast(i); but at receiver end stringText always come null. I have tried it in another way but no luck String text= (String

Bash parameter substitution

好久不见. 提交于 2019-12-11 07:39:10
问题 I am trying to learn bash parameter substitution and have a very basic question: Why does this work: #!/bin/sh v1="-E" v2="s/./x/g" sed "$v1" "$v2" <<<"abc" # result = "xxx" but this doesn't work: #!/bin/sh v1="-E" v2="s/./x/g" sed "$v1 $v2" <<<"abc" # result = "sed: illegal option..." I am using Mac OS X bash. 回答1: Because on the second example, (the wrong one) you are using the quotes wrong. The quotes are being used in order to specify that what whatever comes out of that variable has to

Output parameter for TABLE OF VARCHAR2 Oracle odp.net

こ雲淡風輕ζ 提交于 2019-12-11 07:25:09
问题 I have this type: TYPE tipo_TableVarchar2 IS TABLE OF VARCHAR2(1000) INDEX BY BINARY_INTEGER; and procedure get_array (p_arr out TableVarchar2 ) is ... OracleParameter param = new OracleParameter(); param.OracleDbType = OracleDbType.Varchar2; param.CollectionType = OracleCollectionType.PLSQLAssociativeArray; param.ParameterDirection = ParameterDirection.Output; cm.Parameters.Add(param); How to use OracleParameter 's output to get the value? 回答1: Look into the Oracle 11g odp.net drivers, which

pthread with unique struct as parameter C

懵懂的女人 提交于 2019-12-11 07:24:44
问题 I have this piece of code that is giving me trouble. I know all the threads are reading the same struct. But I have no idea how to fix this. #include <pthread.h> #include <stdio.h> #include <stdlib.h> typedef struct { int a,b; } s_param; void * threadfunc(void *parm) { s_param *param2 = parm; printf("ID:%d and v:%d\n",param2->a,param2->b); pthread_exit(NULL); } int main(int argc, char **argv) { pthread_t thread[3]; int rc=0,i; void * status; for(i=0; i<3 ; ++i){ s_param param; param.b=10;

How to pass results of Get-Childitem into a Scriptblock properly?

廉价感情. 提交于 2019-12-11 06:59:11
问题 In this example, I'm trying to pass the results of Get-ChildItem into a scriptblock, with limited success and unexpected results. C:\temp contains 3 files: A.txt B.txt C.txt What I want is to pass $files into the scriptblock here, and maintain the entire list of three files that Get-ChildItem has returned. In other words, I would like for $files to return A.txt, B.txt, and C.txt, both inside and outside the scriptblock. I am able to do this, but I'm not able to do it reliably, and cannot

Using the same object on different classes while keeping content of one object

强颜欢笑 提交于 2019-12-11 06:44:07
问题 I am having 3 classes. First class is a Authorize class which have get/set property for User and Pass. Second, Add class is creating new instance of Authorize class and assigning a value from it's textboxes to the properties by using initializing new object: Authorize authorize = new Authorize(); Third class, Display, is trying to get the value of property User and Pass from class Authorize. The problem is that I can not use here a new object of Authorize, because it will empty the content of

Warning: strlen() expects parameter 1 to be string, array given in file… in line

强颜欢笑 提交于 2019-12-11 06:34:57
问题 I have this error: Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/general.php on line 159 Line 159 is: if ((strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y')) { Could you help me solving this problem? 回答1: strlen() only works for strings. From the strlen() documentation: strlen() returns NULL when executed on arrays, and an E_WARNING level error is emitted. If

Matrix dimensions error in MATLAB

落爺英雄遲暮 提交于 2019-12-11 06:27:35
问题 It's late - I can't find where my error is in my error function. I'm attempting a parameter estimation. function value = lv(t,y,p) %Lotka-Volterra Model %p(1)=a, p(2) = b, p(3) = c, p(4) = r. value = [-p(1)*y(1)-p(2)*y(1)*y(2);-p(4)*y(2)+p(3)*y(1)*y(2)]; end function error = lverr(p) %LVERR: Function defining error function for %example with Lotka-Volterra equations. H = [30.0 47.2 70.2 77.4 36.3 20.6 18.1 21.4 22 25.4 27.1]; L = [4 6.1 9.8 35.2 59.4 41.7 19 13 8.3 9.1 7.4]; [t,y] = ode45(@lv