parameters

C# method generic params parameter bug?

折月煮酒 提交于 2019-12-18 04:21:26
问题 I appears to me as though there is a bug/inconsistency in the C# compiler. This works fine (first method gets called): public void SomeMethod(string message, object data); public void SomeMethod(string message, params object[] data); // .... SomeMethod("woohoo", item); Yet this causes "The call is ambiguous between the following methods" error: public void SomeMethod<T>(string message, T data); public void SomeMethod<T>(string message, params T[] data); // .... SomeMethod("woohoo", (T)item);

iReport: Passing parameters from a main report query to a dataset query for a table or list

懵懂的女人 提交于 2019-12-18 03:04:38
问题 I understand how to pass parameters from a main report to a subreport, since there's a specific field for this in the subreport object. However, I'd like to do the same thing with a table or list object as a consumer (rather than a subreport). Is it possible? For example, say I have a parameter of 'customerID' that I can populate with a main report query, but I can't seem to pass this parameter to the table's dataset's SQL query. I've tried, and continue to try, various combinations of

Facebook stops custom parameters (image,title,description) through FB.ui?

断了今生、忘了曾经 提交于 2019-12-18 02:58:09
问题 Today I check my site and this code not working: <script> ... FB.ui({ display: 'dialog', method: 'share_open_graph', action_type: 'og.likes', hashtag: '#Testing', action_properties: JSON.stringify({ object: { 'og:image': img, 'og:image:secure_url': img, 'og:image:type': 'image/jpeg', 'og:image:width': w, 'og:image:height': h, 'og:image:alt': img, 'og:url': link, 'og:title': title, 'og:description': desc, 'fb:admins': fbadmin } }) }, function(response) { if (typeof response != 'undefined') { /

Passing parameters to a JSON web service in Objective C

断了今生、忘了曾经 提交于 2019-12-18 02:57:26
问题 I'm trying to call a webservice method and pass a parameter to it. Here is my webservice methods: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public void GetHelloWorld() { Context.Response.Write("HelloWorld"); Context.Response.End(); } [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public void GetHelloWorldWithParam(string param) { Context.Response.Write("HelloWorld" + param); Context.Response.End(); } Here is my objective c code: NSString *urlString = @

How to pass an array of struct using pointer in c/c++?

无人久伴 提交于 2019-12-18 02:48:15
问题 in C code I'm stuck to pass an array of struct to a function, here's the code that resembles my problem: typedef struct { int x; int y; char *str1; char *str2; }Struct1; void processFromStruct1(Struct1 *content[]); int main() { Struct1 mydata[]= { {1,1,"black","cat"}, {4,5,"red","bird"}, {6,7,"brown","fox"}, }; processFromStruct1(mydata);//how?!?? can't find correct syntax return 0; } void processFromStruct1(Struct1 *content[]) { printf("%s", content[1]->str1);// if I want to print 'red', is

What is the scope of a defaulted parameter in Python?

久未见 提交于 2019-12-17 23:23:37
问题 When you define a function in Python with an array parameter, what is the scope of that parameter? This example is taken from the Python tutorial: def f(a, L=[]): L.append(a) return L print f(1) print f(2) print f(3) Prints: [1] [1, 2] [1, 2, 3] I'm not quite sure if I understand what's happening here. Does this mean that the scope of the array is outside of the function? Why does the array remember its values from call to call? Coming from other languages, I would expect this behavior only

Creating a procedure in mySql with parameters

六月ゝ 毕业季﹏ 提交于 2019-12-17 22:44:46
问题 I am trying to make a stored procedure using mySQL. This procedure will validate a username and a password. I'm currently running mySQL 5.0.32 so it should be possible to create procedures. Heres the code I've used. All I get is an SQL syntax error. GO CREATE PROCEDURE checkUser (IN @brugernavn varchar(64)),IN @password varchar(64)) BEGIN SELECT COUNT(*) FROM bruger WHERE bruger.brugernavn=@brugernavn AND bruger.pass=@Password; END; Thank you in advance 回答1: I figured it out now. Here's the

Binding Parameters to Oracle Dynamic SQL

Deadly 提交于 2019-12-17 22:43:23
问题 I have a stored procedure that accepts multiple parameters (i.e. pName, pHeight, pTeam) I have the query built up like this: SQLQuery VARCHAR2(6000); TestCursor T_CURSOR; SQLQuery := 'SELECT ID, Name, Height, Team FROM MyTable WHERE ID IS NOT NULL '; -- Build the query based on the parameters passed. IF pName IS NOT NULL SQLQuery := SQLQuery || 'AND Name LIKE :pName '; END IF; IF pHeight IS > 0 SQLQuery := SQLQuery || 'AND Height = :pHeight '; END IF; IF pTeam IS NOT NULL SQLQuery := SQLQuery

How to get stored procedure parameters details?

倾然丶 夕夏残阳落幕 提交于 2019-12-17 22:33:52
问题 Where can I find information about stored procedure parameters? In my situation I need to know only the input parameters of given store procedure. In the sys.objects there is only common details about the procedure. In sys.sql_modules I can extract the whole SQL text of a procedure. As (in SQL Server Management studio) I am able to extract information about the parameters in tabular view using ALT+F1 when selecting the procedure name. I hope there is some place from which I can extract input

PHP check whether property exists in object or class

前提是你 提交于 2019-12-17 22:32:38
问题 I understand PHP does not have a pure object variable, but I want to check whether a property is in the given object or class. $ob = (object) array('a' => 1, 'b' => 12); or $ob = new stdClass; $ob->a = 1; $ob->b = 2; In JS, I can write this to check if variable a exists in an object: if ('a' in ob) In PHP, can anything like this be done? Thank you very much for your advice. 回答1: property_exists( mixed $class , string $property ) if (property_exists($ob, 'a')) isset( mixed $var [, mixed $... ]