Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 76/604 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Passing input to Ant's <exec> task

    - by mikek
    I have an Ant script running a standard -task after taking in an inputed password: <input message="Password:" addproperty="password"> <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> </input> <exec executable="/bin/sh" input="${password}" failonerror="true"> <arg line='-c "myScript.sh"' /> </exec> The script myScript.sh prompts the user for a password, and, it was my understanding that from the Ant documentation that input is supposed relay input into whatever the <exec> task is executing, but instead I get (for entering the password foobar) [exec] Failed to open /usr/local/foobar which is followed by a stack trace from my script complaining about an incorrect password...so obviously I've understood the documentation wrong. Does anybody know how to handle prompted input from external scripts in Ant?

    Read the article

  • Null reference for first memory address between 0 - 65535

    - by Terry
    I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question. How come the following code, accessing memory address 0(and up to 65535) in C# would throw NullReferenceException byte* pointer = (byte*)0; byte test = *pointer; Thanks a lot in advance!

    Read the article

  • Django admin, filter objects by ManyToMany reference

    - by Nick Z
    Hello! There's photologue application, simple photo gallery for django, implementing Photo and Gallery objects. Gallery object has ManyToMany field, which references Photo objects. I need to be able to get list of all Photos for a given Gallery. Is it possible to add Gallery filter to Photo's admin page? If it's possible, how to do it best?

    Read the article

  • GIT core.editor setup on windows along w application PATH reference

    - by delinquentme
    Hey all so i wehnt ahead and opened up my .gitconfig file and manually input the [core] editor = 'C:/Program Files/Notepad++/notepad++.exe' which would allow me to execute command: (im trying to setup my .gitignore list) "C:/Program Files/Notepad++/notepad++.exe" .gitignore im JUSt not interested in typing this out every time that i need to make a file SO ive heard something about editing PATH to allow me to replace the above with something like: npp .gitignore any help would be aprpeciated!

    Read the article

  • Passing Object From Controller to JavaScript JQuery

    - by TMan
    This is driving me crazy. All I'm trying to do is to pass in a Id to a ActionMethod which is working and have an Object be returned to the javascript. Then in javascript, I want to be able to say something like..Objec.Property, ie/ Student.Name, or Student.GPA. Any help is appreciated. I tried json but couldn't get that to work either. ActionResult: [AcceptVerbs(HttpVerbs.Get)] public Epic GetEpicPropertyDetails(int id) { var Epictemplist = epicRepository.Select().Where(x => x.Id.Equals(id)); return Epictemplist.SingleOrDefault(); } javascript: <script type="text/javascript"> $(document).ready(function () { $(".ListBoxClass").click(function (event) { var selectedid = $(this).find("option:selected").val(); event.preventDefault(); $.get("/Estimate/GetEpicPropertyDetails", { id: selectedid }, function (result) { $(".TimeClass").val(result); }); }); }); </script> result.Name is obviously wrong I just dont know how to call this the right way.

    Read the article

  • Circular Reference for Parent Link on Work Item cannot be resolved by Retry

    - by Atters
    I receive the following error; OH-TFS-Connector-0051: Operation failed getCollectionMetaData. Server Error : TF201063: Adding a Parent link to work item 1737 would result in a circular relationship. To create this link, evaluate the existing links, and remove one of the other links in the cycle. I have completely flattened out the Work Items in the source project. When retrying the migration the timestamp is modified on the pending errors however the issues are not resolved. These Work Items now have no parents or children in the source project. So I'm wondering if the retry list is no longer valid but there doesn't appear to be a away to have it update? I can run the whole migration again, however it takes 5-7 hours to just do the work items so it would be great if there is a quick fix.

    Read the article

  • How can I add a function reference to an object literal

    - by rob
    I need to add binders to DOM elements after rendering is done. Therefore I want to pass a list with (ID, callback) tuples to the rendering function so it can bind it after the rendering is done. So i would like to create a list of such objects and pass it to the rendering function: {id:'#someDOMelement', callback: someObject.someFunction} and bind it after the rendering like this: $(binders[i].id).bind('click', binders[i].callback);

    Read the article

  • Passing values into regex match function

    - by Tim
    In python (it's a Django filter), I'm doing this: lReturn = re.sub(r'\[usecase:([ \w]+)]', r'EXTEND WITH <a href="/usecase/%s/\1/">\1</a>' % pCurrentProjectName, lReturn) I'd like to use a function instead of a string (so I can check that the usercase is a valid name), so it would change to this: def _match_function(matchobj): lMatch = matchobj.group(1) return "EXTEND WITH <a href='/usecase/%s/%s/'>%s</a>" % (pCurrentProjectName, lMatch, lMatch) lReturn = re.sub(r'\[usecase:([ \w]+)]', _match_function, lReturn) How do I get pCurrentProjectName into the _match_function() function?

    Read the article

  • Passing values for multi-value parameter in SSRS query string

    - by Andy Xufuris
    I have two reports built using SSRS 2005. The first report is set to navigate to the second when a specific field is clicked. There is a multi-value parameter on the second report. I need to pass multiple values for this parameter in the URL query string when calling this report. Is there a way to pass multiple values for a parameter in the query string of a report? Or can you pass a parameter that will cause the Select All value to be selected?

    Read the article

  • What is root reference ?

    - by DotNetGuy
    class GCTest { static Object r1; static void Main() { r1 = new Object(); Object r2 = new Object(); Object r3 = new Object(); System.GC.Collect(); // what can be reclaimed here ? r1 = null; r3.ToString(); System.GC.Collect(); // what can be reclaimed here ? } } // code from - DonBox's Essential .Net

    Read the article

  • passing paramter as to webservcie function in wcf

    - by prince23
    hi, this my datagrid event here i am calling the webservice. private void dgProject_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e) { WSDataServiceClient wsService = new WSDataServiceClient(); wsService.GetProjectCompleted += new EventHandler<GetProjectCompletedEventArgs>(wsService_GetProjectCompleted); wsService.GetProjectAsync(strUniqueName); // here can i send datagrid as an parameter to the function? Datagrid gd= new Datagrid(); } void wsService_GetProjectCompleted(object sender, GetProjectCompletedEventArgs e) { // } is there any way that i can send datagrid as a paramter to this function is it possiable to do? beacuse i will be using the same websevice function her but need to bind result with different datagrid based on the condition if i can send a datagrid as paramter to this function i can reduce the code so any help on this issue would be great thank you.

    Read the article

  • Object reference case study

    - by Skogen
    When person 1 become partner with person 3, person 2 should no longer have person 1 as partner. How should I solve this? public class Person { private String name; private Person partner; public Person(String name){ this.name = name; } public void setPartner(Person partner){ this.partner = partner; partner.partner = this; } public static void main(String[] args) { Person one = new Person("1"); Person two = new Person("2"); Person three = new Person("3"); Person four = new Person("4"); one.setPartner(two); three.setPartner(four); one.setPartner(three); //Person two is still partner with person 1 }

    Read the article

  • Message passing chrome extension

    - by Mayur Kataria
    I wants to create an extension where content script will send message to background page and then on browser action means clicking on extension icon will access that background page and get some data.I am using chrome Version 23.0.1271.64 m on windows8. I am getting following error. Port error: Could not establish connection. Receiving end does not exist. I tried to solve the same. but people are using sendRequest which is not supported by chrome20+. i also found solution mentioned for chrome 20+. But not working. Please help. Below is the file contents. manifest.json { "name": "Test Extension", "version": "1.0", "manifest_version": 2, "description": "A test extension.", "background": "background.html", "content_scripts": [ { "matches": ["<all_urls>"], "js": ["jquery.js","content.js"] } ], "permissions": ["tabs", "http://*/", "https://*/"], "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" } } background.html <html> <head> <script src="background.js"></script> </head> <body> <h1>Wy</h1> </body> </html> background.js chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { // Chrome 20+ alert(request); console.log('received in listener'); sendResponse({farewell: "goodbye"}); }); content.js $(function(){ console.log('start-sending message'); chrome.extension.sendMessage({greeting: "hello"},function(response){alert(response);}); console.log('end-sending message'); }); popup.html <!doctype html> <html> <head> <title>Getting Started Extension's Popup</title> </style> <!-- JavaScript and HTML must be in separate files for security. --> <script src="jquery.js"></script> <script src="popup.js"></script> </head> <body> </body> </html> popup.js $(function(){ var str_html = "<tr><td width='60%'>S</td><td width='40%'>15</td></tr><tr><td width='60%'>M</td><td width='40%'>25</td></tr>"; $('#sizes_container').html(str_html); var bkg = chrome.extension.getBackgroundPage(); console.log(bkg); });

    Read the article

  • Passing System classes as constructor parameters

    - by mcl
    This is probably crazy. I want to take the idea of Dependency Injection to extremes. I have isolated all System.IO-related behavior into a single class so that I can mock that class in my other classes and thereby relieve my larger suite of unit tests of the burden of worrying about the actual file system. But the File IO class I end up with can only be tested with integration tests, which-- of course-- introduces complexity I don't really want to deal with when all I really want to do is make sure my FileIO class calls the correct System.IO stuff. I don't need to integration test System.IO. My FileIO class is doing more than simply wrapping System.IO functions, every now and then it does contain some logic (maybe this is the problem?). So what I'd like is to be able to test my File IO class to ensure that it makes the correct system calls by mocking the System.IO classes themselves. Ideally this would be as easy as having a constructor like so: public FileIO( System.IO.Directory directory, System.IO.File file, System.IO.FileStream fileStream ) { this.Directory = directory; this.File = file; this.FileStream = fileStream; } And then calling in methods like: public GetFilesInFolder(string folderPath) { return this.Directory.GetFiles(folderPath) } But this doesn't fly since the System.IO classes in question are static classes. As far as I can tell they can neither be instantiated in this way or subclassed for the purposes of mocking.

    Read the article

  • Restoring and passing data to an already running instance of a .NET application

    - by mtranda
    The goal is to have an application that runs in the system tray and can either accept user input from its actual GUI (which isn't the actual issue) OR accept command line parameters (that would actually be done via a context menu in windows explorer). Now, while I'm aware that the command line parameters are not exactly possible once the application has started, I need a way to pass data to the already running application instance via some form of handler. I'm thinking maybe define and raise some sort of event? Thanks in advance.

    Read the article

  • .htaccess & mod_rewrite for passing GET parameters

    - by Joel Alejandro
    Currently I use this to pass GET parameters on an "elegant" way: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)/$ index.php?module=$1 [L] RewriteRule ^([^/]*)/([^/]*)/$ index.php?module=$1&object=$2 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?module=$1&object=$2&submodule=$3 [L] This works great for 3 parameters max., (and I'm sure it's seriously ugly). Any way to do the same thing, for n-paremeters?

    Read the article

  • Passing mix of T and T[] to a Java varargs method

    - by rfalke
    Suppose you have a Java method void foobar(int id, String ... args) and want to pass both String arrays and Strings into the method. Like this String arr1[]={"adas", "adasda"}; String arr2[]={"adas", "adasda"}; foobar(0, "adsa", "asdas"); foobar(1, arr1); foobar(2, arr1, arr2); foobar(3, arr1, "asdas", arr2); In Python there is "*" for this. Is there some way better than such rather ugly helper method: static String[] concat(Object... args) { List<String> result = new ArrayList<String>(); for (Object arg : args) { if (arg instanceof String) { String s = (String) arg; result.add(s); } else if (arg.getClass().isArray() && arg.getClass().getComponentType().equals(String.class)) { String arr[] = (String[]) arg; for (String s : arr) { result.add(s); } } else { throw new RuntimeException(); } } return result.toArray(new String[result.size()]); } which allows foobar(4, concat(arr1, "asdas", arr2));

    Read the article

  • Get name mangling when I try to use exceptions [CodeBlocks, C++]

    - by Beetroot
    I am trying to use exceptions for the first time but even though it is quite a simple example I just cannot get it to compile, I have looked at several examples and tried coding it in many, many different ways but I am still not even sure exactly where the problem is because I get namemangling when I introduce the catch/try/throw anyway here is my code hopefully it is something really stupid :) #include "Surface.h" #include "SDL_Image.h" using namespace std; SDL_Surface* surface::Load(string fileName){ SDL_Surface* loadedSurface = IMG_Load(fileName.c_str()); if(loadedSurface == 0) throw 0; //Convert surface to same format as display loadedSurface = SDL_DisplayFormatAlpha(loadedSurface); return loadedSurface; } #include "GameState.h" #include "Surface.h" #include<iostream> using namespace std; GameState::GameState(string fileName){ try{ stateWallpaper_ = surface::Load(fileName); } catch(int& e){ cerr << "Could not load " << fileName << endl; } } Thanks in advance for any help! EDIT: Sorry I forgot to post the error message: It is In function `ZN14GameStateIntroC1Ev':| -undefined reference to `__gxx_personality_sj0'| -undefined reference to `_Unwind_SjLj_Register'| -undefined reference to `_Unwind_SjLj_Unregister'| In function `ZN14GameStateIntroC1Ev':| undefined reference to `_Unwind_SjLj_Resume'| In function `ZN14GameStateIntroC2Ev':| -undefined reference to `__gxx_personality_sj0'| -undefined reference to `_Unwind_SjLj_Register'| -undefined reference to `_Unwind_SjLj_Unregister'| obj\Release\GameStateIntro.o||In function `ZN14GameStateIntroC2Ev':| C:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\ext\new_allocator.h|69|undefined reference to `_Unwind_SjLj_Resume'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `redirect_output':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|219|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|220|undefined reference to `SDL_strlcat'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|243|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|244|undefined reference to `SDL_strlcat'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `console_main':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|296|undefined reference to `SDL_strlcpy'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|301|undefined reference to `SDL_GetError'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|312|undefined reference to `SDL_SetModuleHandle'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `WinMain@16':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|354|undefined reference to `SDL_getenv'| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|386|undefined reference to `SDL_strlcpy'| C:\MinGW\lib\libSDLmain.a(SDL_win32_main.o)||In function `cleanup':| \Users\slouken\release\SDL\SDL-1.2.15\.\src\main\win32\SDL_win32_main.c|158|undefined reference to `SDL_Quit'| **

    Read the article

  • Passing functor and function pointers interchangeably using a templated method in C++

    - by metroxylon
    I currently have a templated class, with a templated method. Works great with functors, but having trouble compiling for functions. Foo.h template <typename T> class Foo { public: // Constructor, destructor, etc... template <typename Func> void bar(T x, Func f); }; template <typename T> template <typename Func> Foo::bar(T x, Func f) { /* some code here */ } Main.cpp #include "Foo.h" template <typename T> class Functor { public: Functor() {} void operator()(T x) { /* ... */ } private: /* some attributes here */ }; void Function(T x) { /* ... */ } int main() { Foo<int> foo; foo.bar(2, Functor); // No problem foo.bar(2, Function); // <unresolved overloaded function type> return 0; }

    Read the article

  • passing data to and from server using xml

    - by sapna
    i need to design a web site in which data is passed to and from the server using xml.i got it how to transform data from database to xml and then to html.but i am not able to find how to pass data from client to server using xml.webpages are designed using asp.is it possible to do pass data from client to server using xml.what are the things that are to be studied.help needed immediately.

    Read the article

  • passing the parent form on the onclick event to javascript function

    - by user1051505
    Hi I am trying to pass variables on the onclick event to a javascript function. I am trying the following way, I can't get the input value in the javascript function.(I am expecting an alert of 1.) Is it the right way of doing this? Please help. <head> <script> function submit_value(form) { alert(form.ip.value); } </script> </head> <table> <tr> <form> <td> <input id="ip" type="text" value="1"> </td> <td> <a href="javascript:;" onClick="submit_value(this)">Button</a> </td> </form> </tr> </table>

    Read the article

  • Passing around objects to network packet handlers ?

    - by xeross
    Hey, I've been writing a networking server for a while now in C++ and have come to the stage to start looking for a way to properly and easily handle all packets. I am so far that I can figure out what kind of packet it is, but now I need to figure out how to get the needed data to the handler functions. I had the following in mind: Have a map of function pointers with the opcode as key and the function pointer as value Have all these functions have 2 arguments, packet and ObjectAccessor ObjectAccessor class contains various functions to fetch various items such as users and alike Perhaps pass the user's guid too so we can fetch it from the objectaccessor I'd like to know the various implementations others have come up with, so please comment on this idea and reply with your own implementations. Thanks, Xeross

    Read the article

  • Passing arguments and conditions to model in codeigniter

    - by stormdrain
    I'm adding some models to a project, and was wondering if there is a "best practice" kind of approach to creating models: Does it make sense to create a function for each specific query? I was starting to do this, then had the idea of creating a generic function that I could pass parameters to. e.g: Instead of function getClients(){ return $this->db->query('SELECT client_id,last FROM Names ORDER BY id DESC'); } function getClientNames($clid){ return $this->db->query('SELECT * FROM Names WHERE client_id = '.$clid); } function getClientName($nameID){ return $this->db->query('SELECT * FROM Names WHERE id ='.$nameID); } } Something like function getNameData($args,$cond){ if($cond==''){ $q=$this->db->query('SELECT '.$args.' FROM Names'); return $q; }else{ $q=$this->db->query('SELECT '.$args.' FROM Names WHERE '.$cond); return $q; } } where I can pass the fields and conditions (if applicable) to the model. Is there a reason the latter example would be a bad idea? Thanks!

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >