Search Results

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

Page 127/297 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • ASP.NET masterpage public variables error

    - by eugeneK
    I have public variable 'MessagePlaceholder' on MasterPage and a Class that accesses this property like that setting it's value to string from getMessage(); ((HttpContext.Current.Handler as System.Web.UI.Page).Master as MasterPage).MessagePlaceholder = getMessage(); which gives me an error like this one Error 3 'System.Web.UI.MasterPage' does not contain a definition for 'MessagePlaceholder' and no extension method 'MessagePlaceholder' accepting a first argument of type 'System.Web.UI.MasterPage' could be found (are you missing a using directive or an assembly reference?) What should i do ?

    Read the article

  • django deployment apache

    - by Uszy Wieloryba
    I would like to create a python script, which will: Create a django project in the current directory. Fix settings.py, urls.py. Do syncdb Install new apache instance listening on specific port (command line argument), with WSGI configured to serve my project. I can't figure out how to do point 3. EDIT: Peter Rowell: I need the solution for both Linux and Windows I have root access This is a dedicated host Apache only

    Read the article

  • Java method get the inheriting type

    - by DrDro
    I have several classes that extend C and I would need a method that accepts any argument of type C. But in this method I would like to know if I'm dealing with A or B. * public A extends C public B extends C public void goForIt(C c)() If I cast how can I retrieve the type in a clean way (I just read using getClass or instanceof is often not the best way). PS: Fell free to edit an explicit title. *Sorry but I can't type closing braces

    Read the article

  • Delphi Unit local variables - how to make each instance unique?

    - by Justin
    Ok, this, I'm sure is something simple that is easy to do. The problem : I've inherited scary spaghetti code and am slowly trying to better it when new features need adding - generally when a refactor makes adding the new feature neater. I've got a bunch of code I'm packing into a single unit which, in different places in the application, controls the same physical thing in the outside world. The control appears in several places in the application and operates slightly differently in each instance. What I've done is to create a unit with all of the features I need which I can simply drop, as a frame, into each form that requires it. Each form then uses the unit's interface methods to customise the behaviour for each instance. The problem within the problem : In the unit in question (the frame) I have a variable declared in the IMPLEMENTATION section - local to the unit. I also have a procedure, declared in the TYPE section which takes an argument and assigns that argument to the local variable in question - each form passes a unique variable to each instance of the frame/unit. What I want it to do is for each instance of the frame to keep its own version of that variable, different from the others, and use that to define how it operates. What seems to be happening, however, is that all instances are using the same value, even if I explicitly pass each instance a different variable. ie: Unit FlexibleUnit; interface uses //the uses stuff type TFlexibleUnit=class(TFrame) //declarations including procedure makeThisInstanceX(passMeTheVar:integer); private // public // end; implementation uses //the uses var myLocalVar; procedure makeThisInstanceX(passMeTheVar:integer); begin myLocalVar:=passMeTheVar; end; //other procedures using myLocalVar //etc to the end; Now somewhere in another Form I've dropped this Frame onto the Design pane, sometimes two of these frames on one Form, and have it declared in the proper places, etc. Each is unique in that : ThisFlexibleUnit : TFlexibleUnit; ThatFlexibleUnit : TFlexibleUnit; and when I do a: ThisFlexibleUnit.makeThisInstanceX(var1); //want to behave in way "var1" ThatFlexibleUnit.makeThisInstanceX(var2); //want to behave in way "var2" it seems that they both share the same variable "myLocalVar". Am I doing this wrong, in principle? If this is the correct method then it's a matter of debugging what I have (which is too huge to post) but if this is not correct in principle then is there a way to do what I am suggesting? Thanks in advance, Stack Overflow - you guys (and gals!) are legendary.

    Read the article

  • window.open causing error in IE only.

    - by John Isaacks
    I am calling this from ie8: function verify_ssl() { window.open ("https://seal.godaddy.com/verifySeal?sealID=129275340046e2e09512711f05bc73f617fac022950185486622550", "ssl-window","status=0,toolbar=0,menubar=0,resizable=0,width=540,height=435"); } It says invalid argument, It works fine in FF and Chrome. Any idea what the issue is in IE?

    Read the article

  • How to access xmlParserCtxt structure from within xmlSAXHandler callbacks?

    - by Lux In Tenebris
    I'm parsing (X)HTML pages content with libxml using the following call: htmlDocPtr doc = htmlSAXParseDoc(content, NULL, &html_handler, NULL); But for debugging purposes I need to analyze some of the current node properties in the start/end element callbacks. I know that the fourth argument of htmlSAXParseDoc can be used to pass any user defined data to the callbacks, but I don't have a pointer to xmlParserCtxt.

    Read the article

  • Testing custom constraints in Grails App

    - by WaZ
    Hi there, I have the following as my unit test: void testCreateDealer() { mockForConstraintsTests(Dealer) def _dealer= new Dealer( dealerName:"ABC", Email:"[email protected]", HeadOffice:"", isBranch:false) assertFalse _dealer.validate() } But when I run the test I get the following error: No signature of method: static com.myCompany.Dealer.findByDealerNameIlike() is applicable for argument types: (java.lang.String) values: [ABC] I use some custom constraints in my domain class. How Can I test this? static constraints = { dealerName(blank:false, validator: { val, obj -> def similarDealer = Dealer.findByDealerNameIlike(val) return !similarDealer || (obj.id == similarDealer.id) } )

    Read the article

  • How to launch a browser in view source mode?

    - by JorgeLarre
    I want to open a file in a web browser (anyone will do) and I want to see it in the view source mode instead of in the standard browser window. This can be done in two steps, by opening the file and then go to the view source window (different shortcuts in each browser), but I want to directly go to the view source window. I have not found any such command line argument for Firefox nor Chrome. Is this possible just with the base browser functionality?

    Read the article

  • C++ function pointer as parameter

    - by Roland Soós
    Hello, I try to call a function which passed as function pointer with no argument, but I can't make it work. void *disconnectFunc; void D::setDisconnectFunc(void (*func)){ disconnectFunc = func; } void D::disconnected(){ *disconnectFunc; connected = false; }

    Read the article

  • Should I avoid using Java Label Statements?

    - by Kamikaze Mercenary
    Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however. What are people's opinions on label statements?

    Read the article

  • NTPD: use an unrestricted port for communication

    - by Cetra
    When querying ntp servers with the command ntpdate, I can use the -u argument to make the source port an unrestricted port (port 1024 and above). With ntpd, which is meant to run in the background, I can't seem to find a way to turn this option on. So the source port is always 123. It's playing around horribly with my firewall configuration. Is there a configuration option in ntp.conf to make it use a random source port?

    Read the article

  • How can I manipulate a VB6 Collection in .NET?

    - by jhominal
    Hello all, I am currently in the process of designing an interface for .NET software that would be consumed by COM objects - specifically, VB6. While I have found a number of pages by Microsoft detailing how to make an COM-interoperable interface, I am currently tripping over the use of Collections in design time: I would like to be able to use a standard VB6 "Collection object" in the .NET program - for example, specify an argument as being a VB6 collection - and thus minimize the time necessary for clients to consume the interface. Thank you in advance.

    Read the article

  • ruby language syntax(how platform_info variable is used

    - by amit singh tomar
    class EncodeDemoTest < Test #inheritance in ruby def setup(platform_info, logdir) @telnet_ip = platform_info["telnet_ip"] @telnet_login = platform_info["telnet_login"] @telnet_password = nil @filesys_path = platform_info["filesys_path"] @host_files_path = platform_info["host_files_path"] @host_machine_ip = platform_info["host_machine_ip"] @linuxserver_ip = platform_info["linuxserver_ip"] @target_prompt = platform_info["target_prompt"] @demo_execuable_path = platform_info["demo_execuable_path"] @mts4ea_machine_ip = platform_info["mts4ea_machine_ip"] @mts4ea_files_path = platform_info["mts4ea_files_path"] @ffmpeg_machine_ip = platform_info["ffmpeg_machine_ip"] @ffmpeg_service_machine_ip = platform_info["ffmpeg_service_machine_ip"] @ffmpeg_files_path = platform_info["ffmpeg_files_path"] @ffmpeg_login = platform_info["ffmpeg_login"] @ffmpeg_password = platform_info["ffmpeg_password"] @ffmpeg_prompt = platform_info["ffmpeg_prompt"] @platform_info = platform_info could anyone tell me how argument passed in setup method .means what does that syntax means platform["telnet_ip"]

    Read the article

  • Thread sleep and thread join.

    - by Dhruv Gairola
    hi guys, if i put a thread to sleep in a loop, netbeans gives me a caution saying Invoking Thread.sleep in loop can cause performance problems. However, if i were to replace the sleep with join, no such caution is given. Both versions compile and work fine tho. My code is below (check the last few lines for "Thread.sleep() vs t.join()"). public class Test{ //Display a message, preceded by the name of the current thread static void threadMessage(String message) { String threadName = Thread.currentThread().getName(); System.out.format("%s: %s%n", threadName, message); } private static class MessageLoop implements Runnable { public void run() { String importantInfo[] = { "Mares eat oats", "Does eat oats", "Little lambs eat ivy", "A kid will eat ivy too" }; try { for (int i = 0; i < importantInfo.length; i++) { //Pause for 4 seconds Thread.sleep(4000); //Print a message threadMessage(importantInfo[i]); } } catch (InterruptedException e) { threadMessage("I wasn't done!"); } } } public static void main(String args[]) throws InterruptedException { //Delay, in milliseconds before we interrupt MessageLoop //thread (default one hour). long patience = 1000 * 60 * 60; //If command line argument present, gives patience in seconds. if (args.length > 0) { try { patience = Long.parseLong(args[0]) * 1000; } catch (NumberFormatException e) { System.err.println("Argument must be an integer."); System.exit(1); } } threadMessage("Starting MessageLoop thread"); long startTime = System.currentTimeMillis(); Thread t = new Thread(new MessageLoop()); t.start(); threadMessage("Waiting for MessageLoop thread to finish"); //loop until MessageLoop thread exits while (t.isAlive()) { threadMessage("Still waiting..."); //Wait maximum of 1 second for MessageLoop thread to //finish. /*******LOOK HERE**********************/ Thread.sleep(1000);//issues caution unlike t.join(1000) /**************************************/ if (((System.currentTimeMillis() - startTime) > patience) && t.isAlive()) { threadMessage("Tired of waiting!"); t.interrupt(); //Shouldn't be long now -- wait indefinitely t.join(); } } threadMessage("Finally!"); } } As i understand it, join waits for the other thread to complete, but in this case, arent both sleep and join doing the same thing? Then why does netbeans throw the caution?

    Read the article

  • want to run c program from php using exec() function

    - by Abhimanyu
    hi i m trying to run one c executable file using php exec(). when c contains a simple program like print hello i m using exec('./print.out') its working fine.but when i need to pass a argument to my c program i m uing exec('./arugment.out -n 1234') it not working .can any body tell me how to pass arugment using exec to c program.

    Read the article

  • Haskell: Gluing a char and a list together?

    - by Vincent
    So I have this code here: toWords :: String - [a] toWords "" = [] toWords (nr1 : rest) | nr1 == ' ' = toWords rest | otherwise = nr1 : toWords rest The "toWords" function should simply remove all spaces and return a list with all the words. But I keep getting this error: test.hs:5:18: Couldn't match expected type a' against inferred typeChar' `a' is a rigid type variable bound by the type signature for `toWords' at test.hs:1:22 In the first argument of `(:)', namely `nr1' In the expression: nr1 : toWords rest In the definition of `toWords': toWords (nr1 : rest) | nr1 == ' ' = toWords rest | otherwise = nr1 : toWords rest Failed, modules loaded: none.

    Read the article

  • Why are static classes considered “classes” and “reference types”?

    - by Timwi
    I’ve been pondering about the C# and CIL type system today and I’ve started to wonder why static classes are considered classes. There are many ways in which they are not really classes: A “normal” class can contain non-static members, a static class can’t. In this respect, a class is more similar to a struct than it is to a static class, and yet structs have a separate name. You can have a reference to an instance of a “normal” class, but not a static class (despite it being considered a “reference type”). In this respect, a class is more similar to an interface than it is to a static class, and yet interfaces have a separate name. The name of a static class can never be used in any place where a type name would normally fit: you can’t declare a variable of this type, you can’t use it as a base type, and you can’t use it as a generic type parameter. In this respect, static classes are somewhat more like namespaces. A “normal” class can implement interfaces. Once again, that makes classes more similar to structs than to static classes. A “normal” class can inherit from another class. It is also bizarre that static classes are considered to derive from System.Object. Although this allows them to “inherit” the static methods Equals and ReferenceEquals, the purpose of that inheritance is questionable as you would call those methods on object anyway. C# even allows you to specify that useless inheritance explicitly on static classes, but not on interfaces or structs, where the implicit derivation from object and System.ValueType, respectively, actually has a purpose. Regarding the subset-of-features argument: Static classes have a subset of the features of classes, but they also have a subset of the features of structs. All of the things that make a class distinct from the other kinds of type, do not seem to apply to static classes. Regarding the typeof argument: Making a static class into a new and different kind of type does not preclude it from being used in typeof. Given the sheer oddity of static classes, and the scarcity of similarities between them and “normal” classes, shouldn’t they have been made into a separate kind of type instead of a special kind of class?

    Read the article

  • Java method: retrieve the inheriting type

    - by DrDro
    I have several classes that extend C and I would need a method that accepts any argument of type C. But in this method I would like to know if I'm dealing with A or B. * public A extends C public B extends C public void goForIt(C c)() If I cast how can I retrieve the type in a clean way (I just read using getClass or instanceof is often not the best way). *Sorry but I can't type closing braces

    Read the article

  • JSplitPane SetDividerLocation Problem

    - by Goutham
    I have a JSplitPane which when shown should split the pane by 50%. Now on giving an argument of 0.5 (as suggested) to setDividerLocation, Java seems to treat it as a normal number instead of a percentage. As in, the divider, instead of going to the middle of the pane, is almost at the start of the left pane (the pane is vertically split). Any work arounds?

    Read the article

  • WinForm-style Invoke() in unmanaged C++

    - by Matt Green
    I've been playing with a DataBus-type design for a hobby project, and I ran into an issue. Back-end components need to notify the UI that something has happened. My implementation of the bus delivers the messages synchronously with respect to the sender. In other words, when you call Send(), the method blocks until all the handlers have called. (This allows callers to use stack memory management for event objects.) However, consider the case where an event handler updates the GUI in response to an event. If the handler is called, and the message sender lives on another thread, then the handler cannot update the GUI due to Win32's GUI elements having thread affinity. More dynamic platforms such as .NET allow you to handle this by calling a special Invoke() method to move the method call (and the arguments) to the UI thread. I'm guessing they use the .NET parking window or the like for these sorts of things. A morbid curiosity was born: can we do this in C++, even if we limit the scope of the problem? Can we make it nicer than existing solutions? I know Qt does something similar with the moveToThread() function. By nicer, I'll mention that I'm specifically trying to avoid code of the following form: if(! this->IsUIThread()) { Invoke(MainWindowPresenter::OnTracksAdded, e); return; } being at the top of every UI method. This dance was common in WinForms when dealing with this issue. I think this sort of concern should be isolated from the domain-specific code and a wrapper object made to deal with it. My implementation consists of: DeferredFunction - functor that stores the target method in a FastDelegate, and deep copies the single event argument. This is the object that is sent across thread boundaries. UIEventHandler - responsible for dispatching a single event from the bus. When the Execute() method is called, it checks the thread ID. If it does not match the UI thread ID (set at construction time), a DeferredFunction is allocated on the heap with the instance, method, and event argument. A pointer to it is sent to the UI thread via PostThreadMessage(). Finally, a hook function for the thread's message pump is used to call the DeferredFunction and de-allocate it. Alternatively, I can use a message loop filter, since my UI framework (WTL) supports them. Ultimately, is this a good idea? The whole message hooking thing makes me leery. The intent is certainly noble, but are there are any pitfalls I should know about? Or is there an easier way to do this?

    Read the article

  • Problem with pointers and getstring function

    - by volting
    I am trying to write a function to get a string from the uart1. Its for an embedded system so I don't want to use malloc. The pointer that is passed to the getstring function seems to point to garbage after the gets_e_uart1() is called. I don't use pointers too often so I'm sure it is something really stupid and trivial that Im doing wrong. Regards, V int main() { char *ptr = 0; while(1) { gets_e_uart1(ptr, 100); puts_uart1(ptr); } return 0; }*end main*/ //------------------------------------------------------------------------- //gets a string and echos it //returns 0 if there is no error char getstring_e_uart1(char *stringPtr_, const int SIZE_) { char buffer_[SIZE_]; stringPtr_ = buffer_; int start_ = 0, end_ = SIZE_ - 1; char errorflag = 0; /*keep geting chars until newline char recieved*/ while((buffer_[start_++] = getchar_uart1())!= 0x0D) { putchar_uart1(buffer_[start_]);//echo it /*check for end of buffer wraparound if neccesary*/ if(start_ == end_) { start_ = 0; errorflag = 1; } } putchar_uart1('\n'); putchar_uart1('\r'); /*check for end of buffer wraparound if neccesary*/ if(start_ == end_) { buffer_[0] = '\0'; errorflag = 1; } else { buffer_[start_++] = '\0'; } return errorflag; } Update: I decided to go with approach of passing a pointer an array to the function. This works nicely, thanks to everyone for the informative answers. Updated Code: //------------------------------------------------------------------------- //argument 1 should be a pointer to an array, //and the second argument should be the size of the array //gets a string and echos it //returns 0 if there is no error char getstring_e_uart1(char *stringPtr_, const int SIZE_) { char *startPtr_ = stringPtr_; char *endPtr_ = startPtr_ + (SIZE_ - 1); char errorflag = 0; /*keep geting chars until newline char recieved*/ while((*stringPtr_ = getchar_uart1())!= 0x0D) { putchar_uart1(*stringPtr_);//echo it stringPtr_++; /*check for end of buffer wraparound if neccesary*/ if(stringPtr_ == endPtr_) { stringPtr_ = startPtr_; errorflag = 1; } } putchar_uart1('\n'); putchar_uart1('\r'); /*check for end of buffer wraparound if neccesary*/ if(stringPtr_ == endPtr_) { stringPtr_ = startPtr_; *stringPtr_ = '\0'; errorflag = 1; } else { *stringPtr_ = '\0'; } return errorflag; }

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >