I'm developing a tool that will perform several types of analysis, and each analysis can have different levels of thoroughness. This app will have a fair amount of options to be given before it starts. I started implementing this using a configuration file, since the number of types of analysis specified were little. As the number of opt...
Passing Value Type parameters to functions in c# is by value unless you use the ref or out keyword on the parameter. But does this also apply to Reference Types?
Specifically I have a function that takes an IList<Foo>. Will the list passed to my function be a copy of the list with copy of its contained objects? Or will modifications to...
Like this:
select * from foo where @nameofdbcolumnprovidedbyparam = 1 ?
Whenever I attempt this with sqldatasource or in ado I get errors such as:
Syntax error converting the nvarchar value 'foo' to a column of data type int.
...
I am using an ODBC connection to retrieve a data set in C#. I can see that the full command string is added to the connection when it is created.
OdbcDataAdapter dataAdapter = new OdbcDataAdapter(GetCommandString(), odbcConnection);
I am using the following line to add the parameter to the command string.
dataAdapter.SelectCommand.Pa...
An example of a method that uses the params keyword is String.Format("", foo, bar, baz)
But how would I make a method that accepts an array of enums like so:
class MyClass
{
public enum Foo { Bar, Baz }
public static void MyMethod(params enum[] Foo) {}
public static void TestMethod()
{
MyMethod();
MyMe...
Hi Everyone!
I have a little problem in ASP.NET MVC 2 FrameWork 4... Let me explain :
I have one class that contains other classes like ...
IndexViewData -> MemberViewData -> UserViewData
public class IndexViewData : Manager
{
public MemberViewData member { get; set; }
....
public class MemberViewData : Manager
{
publi...
Hello!
I am calling a .js file within a HTML file. On the URL to the .js file I want to include a parameter that will be accessable to the code INSIDE the .js file.
For example:
I want to be able to pass the ID value to a function within the jquery_widget.js file, with the help of jQuery. How is this done?
Thankful for all help!
...
Hey everyone, today I'm trying to get a link to an XML file passed from the Object Embed code into my Flash movie. (Not using SWFobject). I have 1 swf file that should be able to connect to 3 different XML files.
Attempt 1
Below is the HTML code (I'm trying to get theXML path):
<div class="left">
<h2>300 x 353 Green Accent Color</h2...
I find myself doing the following a lot, and i don't know if there is any side effects or not but consider the following in a WinForms C# app.
(please excuse any errors as i am typing the code in, not copy pasting anything)
int a = 1;
int b = 2;
int c = 3;
this.Invoke((MethodInvoker)delegate()
{
int lol = a + b + c;
});
Is there ...
Hi, I have some example data:
public struct Task
{
public int INT;
public string STRING;
public DateTime? NULLABLEDATETIME;
}
And function, which uses it:
public KeyValuePair<Expression<Func<Task, object>>, object> Marry(Expression<Func<Task, object>> key, object value)
{
return new KeyValuePair<Expression<Func<Task, ...
I have the following code:
As you can see, i need to pass a parameter to Field2, but i also need that parameter to be ablo to handle the ""all values" option, for example, if i assign "foo" to the parameter, the query will return every record where Field2 = "foo"... but i also want to be able to pass a wildcard, or something to tell tha...
With JSF 2 you should be able to do this:
<h:commandButton action="#{myBean.myAction(myParameter)}"/>
which would then call the action method, passing in the parameter (assume it's an Integer):
@ManagedBean
@SessionScoped
public class MyBean {
...
public String myAction(Integer myParameter) {
// do something
r...
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...
I'm having an issue with a callback. I'm not even getting an error in Firebug. If I alert before and after the getjson call both alerts show but the getjson call doesn't fire.
public ActionResult TestPage()
{
return View();
}
public ActionResult LoadMapLonLats(int mapId)
{
//some code
return Json...
The client side should look like (taking the login example) login(user, password) SOAP header is added by interceptor.
The service side look like login(Login login, headerstuff). Login is just a class with all the elements from the client call. ALso have an interceptor to show how you could add things to the header before it arrives at ...
Hi, 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...
I was told to use bind parameters so that I could insert text into my db that had quotes in it. But, I am pretty confused when it comes to how to do this, the commands seem confusing to me.
So, if I had a php string, that contained html, how would I insert this into my DB using bind parameters?
I wanted to INSERT it, how would I do th...
Hello all,
I soon started a small C++ project and elaborated some naming convention rules for variables, according to scope.
I made class members _prefixed_with_underscore and methods parameters suffixed_with_underscore_. I soon got neurotic about inventing naming conventions for everything, like global variables (ok, those might be im...
Hi everyone,
is it possible to call an oracle storage procedure with a record type as IN parameter.
In Oracle I have a record definition:
TYPE R_InData_tab IS RECORD ( ... );
TYPE InData_tab IS TABLE OF R_InData_tab INDEX BY BINARY_INTEGER;
Now I want to set this record type as parameter:
PROCEDURE myProcedure (inRecord IN myPackage....
Hello.
I'm sure this is a very obvious question, but I'm having little luck finding an answer to it.
Essentially, after compiling utility jars w/ ANT, I'm having the problem that all the parameters are showing up in Eclipse's tool-tip as arg0, arg1 etc.
For example:
public void myMethod(String name, String address)
After being comp...