parameters

What's the Matlab equivalent of NULL, when it's calling COM/ActiveX methods?

Hi, I maintain a program which can be automated via COM. Generally customers use VBS to do their scripting, but we have a couple of customers who use Matlab's ActiveX support and are having trouble calling COM object methods with a NULL parameter. They've asked how they do this in Matlab - and I've been scouring Mathworks' COM/ActiveX...

Python: Do (explicit) string parameters hurt performance?

Suppose some function that always gets some parameter s that it does not use. def someFunc(s): # do something _not_ using s, for example a=1 now consider this call someFunc("the unused string") which gives a string as a parameter that is not built during runtime but compiled straight into the binary (hope thats right). The que...

Can I create view with parameter in MySQL?

I have a view like this: CREATE VIEW MyView AS SELECT Column FROM Table WHERE Value = 2; I'd like to make it more generic, it means to change 2 into a variable. I tried this: CREATE VIEW MyView AS SELECT Column FROM Table WHERE Value = @MyVariable; But mysql doesn't allow this. I found an ugly workaround: CREATE FUNCTION Ge...

Oracle: How can I parameterize a list?

I have a query with a where clause that looks like: WHERE field IN ( 1, 2, 3 ) Is possible to parametrize this so it looks something like: WHERE field in ( :list )? How do you create the :list parameter, assuming it's a list of ints, that could be anywhere from 1 to 10 ints? ASP.net, webforms if that makes a difference. ...

What is the actual data type of the @cleartext (2nd) param of SQL Server's EncryptByKey(..) function?

Pointedly what I'm asking below is: What is the actual data type of the @cleartext parameter of this SQL function? >> ENCRYPTBYKEY (..) - http://msdn.microsoft.com/en-us/library/ms174361.aspx (If you read below this line you can follow the history and reasoning. I think it's trickier than it first appears.) The SQL Server documentati...

How do I insert a date into mysql as a parameter?

I have the following code: function dbInsert() { global $dbcon, $dbtable; global $inputData; $sqlQuery = 'INSERT INTO ' . $dbtable . ' (id_author, date, title, description) VALUES (?, ?, ?, ?)'; $stmt = $dbcon->prepare($sqlQuery); echo $sqlQuery; $stmt->bind_param('isss', $inputData['idAuthor'], $inputData['date...

How to pass parameters to javascript function within a struts tag?

something like this: <s:iterator value="list" status="status"> <s:textfield value="%{list_item}" onchange="js_func(this, **status.index**)"/> <s:/iterator> I wanna pass the index of status to js_func but fail to do that. any suggestion? ...

Parameterizing complex search methods

Is there a best practice on how to handle DAL methods with complex search logic? I'm talking about the business requirements like "List customers who's companies are active or in sleep status, have more than 1000$ of orders in the last quarter, customer must not be deleted, company must have office in London or New York and Paris..." T...

How to prevent crashes when parameter is null

i am inserting the value of dynamic controls into the db like so; Dim ae1 As DropDownList = FindControl("AreasExpertise1") If (ae1 IsNot Nothing) Then x.Parameters.AddWithValue("@areasexpertise1", ae1.SelectedValue) End If then in my query i have parameters like so; INSERT INTO [foo] ([etc], [etc], [etc], ...

Uploadify plugin doesn't pass more than 1 param

There is issue, when Uploadify plugin desn't POST more than 1 parameter. Tried 3 variants below. Any suggestions or experince? First - standard way explanation: portletId and jsessionid params passed in 'script' : oScript.text = "var $j = jQuery.noConflict();"; oScript.text+= "$j(document).ready(function(){"; ... oScript.text+= "$j('#u...

Why does this mod_rewrite expression not append the existing query string correctly?

I'm a real newbie regarding mod_rewrite so please don't laugh. I am using this tool for testing: http://civilolydnad.se/projects/rewriterule/ Basically I want to rewrite http://hostname/spanish/whatever/ into http://hostname/whatever/?lang=es Here's the best I could come up with: RewriteRule ^spanish/(.*)$ $1?lang=es [QSA,L,NC] ...

Is it possible to embed a Citrix XenApp in a webpage and pass it parameters dynamically?

So, I know nothing about the Citrix applications, so maybe I can be pointed in the right direction or even be given examples. I need to be able to run an desktop application (which is installed on servers), but have it embedded in a web application (ASP.NET). We need it to feel like it is pretty integrated, so We were going to pass a...

How to take an array of parameters as GET / POST in ASP.NET MVC?

How best to get an array(item=>value) pair as a GET / POST parameter? In PHP, i can do this: URL: http://localhost/test/testparam.php?a[one]=100&amp;a[two]=200 this gets the parameter as: Array ( [a] => Array ( [one] => 100 [two] => 200 ) ) Is there any way to accomplish the same in ASP.NE...

Using Verilog Parameter keyword

I am using the parameter keyword to define a state ie RESET = 5'b00000. If I want to use $display to printout the state name instead of the binary representation, or display the state name in my simulation wave viewer, how can I do this? It doesn't work to try to print it out as a string (as you would expect), so I'm wondering if this ...

Javascript syntax (2 minute question)

Hi, I'm trying to work with openstreetmap through openlayers, and I have encountered a biit of Javascript syntax that I don't understand (I'm no expert with Javascript - just beginning to learn how it handles objects at the moment...) Here it is anyway... map = new OpenLayers.Map ("map", { controls:[ new OpenLayers.Control.Navigati...

Proper usage of "this." keyword in C#?

Hi all, I'm working through the book Head First C# (and it's going well so far), but I'm having a lot of trouble wrapping my head around the syntax involved with using the "this." keyword. Conceptually, I get that I'm supposed to use it to avoid having a parameter mask a field of the same name, but I'm having trouble actually tracking ...

NHibernate Named Query

Hi, I'm trying to learn about SQL named queries using NHibernate and I have the following code. The issue is that I get the following error : "Message: No value given for one or more required parameters." when I try to test the code from MBUnit. <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2...

C++ types and functions

I'm having some trouble compiling my code - it has to do with the types I'm passing in. Here is what the compiler says: R3Mesh.cpp: In copy constructor 'R3Mesh::R3Mesh(const R3Mesh&)': R3Mesh.cpp:79: error: no matching function for call to 'R3Mesh::CreateHalfEdge(R3MeshVertex*&, R3MeshFace*&, R3MeshHalfEdge*&, R3MeshHalfEdge*&)' R3Mesh....

Conversion from imperative to functional programming [Python to Standard ML]

I have a function specification that states it that should evaluate a polynomial function of one variable. The coefficient of the function is given as a list. It also accepts the value of the variable as a real. For example: eval(2, [4, 3, 2, 1]) = 26 (1*x^3 + 2*x^2 + 3*x^1 + 4*x^0, where x = 2) Here's the function in python, but I'...

should I include the @ when using SqlCommand.Parameters.AddWithValue?

I have always included the at sign in the parameter name when using AddWithValue, but I just noticed some code written by someone else that doesn't use it. Is one way more correct than the other? cmd.Parameters.AddWithValue("ixCustomer", ixCustomer); or cmd.Parameters.AddWithValue("@ixCustomer", ixCustomer); ...