Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 130/297 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • How to call a generic method through reflection

    - by milan
    Hi, is it possible to call with reflection a method with "explict type argument" <S> definition e.g. oObject.Cast<S>() ? where is: IList <P> oObject = new List <P>(); I tried with oObject.getType().InvokeMember( "Cast", BindingFlags.InvokeMethod, null, oObject, null) but it does not work, does anyone know why?

    Read the article

  • Perl and hosts file mapping question?

    - by user275633
    All, I have a hosts file that looks like this: 10.10.10.1 myserver1 myserver1alias 10.10.10.2 myserver2 myserver2alias I'm looking for a way using perl to pass in an argument of myserver1 and have it return myserver1alias, likewise if I pass in myserver2 it should return myserver2alias. Any suggestions?

    Read the article

  • How to effectively measure difference in a run-time.

    - by Knowing me knowing you
    Guys, in one of the excersises in TC++PL B.S. asks to: "Write a function that either returns a value or that throws that value based on an argument. Measure the difference in run-time between the two ways." Great pity he never explaines how to measure such things. I'm not sure if I'm suppose to write simple "time start, time end" counter or maybe there are more effective and practical ways to do it? Thanks in advance.

    Read the article

  • How to call Java method from C++

    - by fhucho
    Hi, I am using JNI to call my C++ function from Java. One of the C++ function's arguments is jobject thiz (as far as I know, all JNI native functions have this argument). The function takes quite long to complete and I want to report progress back to the jobject thiz Java object, so that I can show the progress to the user. How can I call jobject's methods from C++?

    Read the article

  • is there a proper way to handle multiple errors/exceptions?

    - by toPeerOrNotToPeer
    in OO programming, is there some conceptual pattern, ideas, about handling multiple errors? for example, i have a method that performs some checks and should return an error message for each error found ['name is too short', 'name contains invalid unicode sequences', 'name is too long'] now, should i use an array of exceptions (not thrown exceptions)? or something like this is better: class MyExceptionList extends Exception{ public Void addException(Exception e){} public Array getExceptions(){} } any theory behind this argument will be appreciated! (this isn't a request about a specific programming language, but a pure theoretical one) thank you in advance

    Read the article

  • How to reference a particular JSON in a function call.

    - by Jane Wilkie
    Hi guys! I have two javascript routines.. the first one declares some JSON and it contains a function that takes two arguments, the first argument being the json object that needs traversing and the second argument is the tab that the rendering is done in. The second routine merely passes the name of the JSON that needs traversing and tab to render in. The code is below.... <script language="JavaScript1.2" type="text/javascript"> var arr = [ {"id":"10", "class":"child-of-9", "useless":"donotneed"}, {"id":"11", "class":"child-of-10", "useless":"donotneed"}]; var arrtwo = [ {"id":"12", "class":"child-of-12", "useless":"donotneed"}, {"id":"13", "class":"child-of-13", "useless":"donotneed"}]; function render_help(json,tab){ var html=''; for(var i=0;i<json.length;i++){ var obj = json[i]; for(var key in obj){ var attrName = key; var attrValue = obj[key]; if (attrName == "id"){ html = html +'<B>'+attrValue+'</B>'+'<BR><BR>'; }else if (attrName == "class"){ html = html + attrValue + '<BR><BR>'; } } } document.getElementById(tab).innerHTML=(html); } </script> <script language="JavaScript1.2" type="text/javascript"> render_help(arr,"helptab"); </script> Various testing and strategically placed alert boxes indicate that the tab parameter is being passed and interpreted correctly. I know this because when I change .... document.getElementById(tab).innerHTML=(html); to document.getElementById(tab).innerHTML=("Howdy"); and it renders "Howdy" just fine. Putting an alert box (alert(json)) in to check the value of json yields.... [object.Object],[object.Object] The JSON object remains elusive. For the purposes of this scripting I need the JSON "arr" to be iterated over. I feel like the answer is fairly obvious so far no luck. Admittedly I am new with Javascript and I am apparently missing something. Does anyone have a clue as to what I'm overlooking here? Happy New Year to you all! Janie

    Read the article

  • how to identify process in kernel read func without using current->pid

    - by yoavstr
    my lecture wants us to build module where we need to identify each read process and where the same read process called twice on the same writer massage we should insert him to an queue who's we wake up when all readers have read I achieved this goal by by using list of pid's and boolean read/not_read inside each node but he decided to be nasty and require us to it with some argument from FILE struct can you please help me ?....

    Read the article

  • I have a following gcc compilation warning

    - by thetna
    symbol.h:179: note: expected ‘uintptr_t *’ but argument is of type ‘PRECEDENCE’ The corresponding code is : 176 void symbol_SetCount(SYMBOL, unsigned long); 177 unsigned long symbol_GetCount(SYMBOL); 178 179 size_t symbol_Ordering(uintptr_t*, SYMBOL); 180 181 void symbol_CheckIndexInRange(int); 182 void symbol_CheckNoVariable(SYMBOL); SYMBOL is defined as: typedef size_t SYMBOL Any effort will be highly appreciated.

    Read the article

  • Bash, no-arguments warning, and case decisions

    - by Werner
    Hi, I am learning bash. I would like to do a simple script that, when not arguments given, shows some message. And when I give numers as argument,s depending on the value, it does one thing or another. I would also like to know suggestions for the best online manuals for beginners in bash Thanks

    Read the article

  • Hook perm for more than one content type

    - by Andrew
    Drupal 6.x I have this module that manages four different content types. For that matter, how do I define permission for each content within the same module? Is that even possible? I can't figure out how to define permission for each content type cuz hook_perm has to be named with module name and it doesn't have any argument(like hook_access $node) to return permission base on content type. Any help would be highly appreciated.

    Read the article

  • 'Invalid conversion from some_type** to const some_type**'

    - by petersohn
    I've got a function that requires const some_type** as an argument (some_type is a struct, and the function needs a pointer to an array of this type). I declared a local variable of type some_type*, and initialized it. Then I call the function as f(&some_array), and the compiler (gcc) says: error: invalid conversion from ‘some_type**’ to ‘const some_type**’ What's the problem here? Why can't I convert a variable to const?

    Read the article

  • C++: Trouble with tr1::bind (C2065)

    - by Rosarch
    I'm getting a compiler error with bind: using namespace std; bool odp(int arg1, int arg2); // ... find_if(vec.begin(), vec.end(), tr1::bind(odp, iValue, _1)); // C2065 My goal is to curry odp(), so its first argument is iValue, and apply that function in find_if. The error: C2065: '_1' : undeclared identifier. What am I doing wrong?

    Read the article

  • Writing a file shredder in python or ruby?

    - by pmilb21
    In the effort to learn python and/or ruby, I was wondering how a file shredder would be implemented? I would like it to take in a file as an argument and then employ an algorithm to make that file unrecoverable. Would possibly add the support for multiple files or even whole directories later.

    Read the article

  • Sending Data as Instances using Python Sockets

    - by Alice
    I'm working on the networking part of a 2 player game (similar to tetris), and I'm trying to pass the game grid from client to server and vice versa. However, when I tried using send(grid) I get a TypeError: send() argument 1 must be string or read-only buffer, not instance. Is there anyway to circumvent this, or do I have to convert my grid instance into a string and then interpret it from the other side? Thanks in advance!

    Read the article

  • Iterating through struct fieldnames in MATLAB.

    - by Noio
    My question is easily summarized as: "Why does the following not work?" teststruct = struct('a',3,'b',5,'c',9) fields = fieldnames(teststruct) for i=1:numel(fns) fns(i) teststruct.(fns(i)) end output: ans = 'a' ??? Argument to dynamic structure reference must evaluate to a valid field name. Especially since teststruct.('a') does work. And fns(i) prints out ans = 'a'. I can't get my head around it.

    Read the article

  • How can I have a newline in a string in sh?

    - by juannavarroperez
    This STR="Hello\nWorld" echo $STR produces as output Hello\nWorld instead of Hello World What should I do to have a newline in a string? I'm aware of echo -e, but I'm no sending the string to echo, the string will be used as an argument by another command that doesn't know how to interpret \n as a newline.

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >