Search Results

Search found 3096 results on 124 pages for 'scope creep'.

Page 11/124 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • C++ header files and variable scope

    - by MrDatabase
    I want to organize my c++ variables and functions in the following way: function prototypes in a header file "stuff.h", function implementation in "stuff.cpp", then say #include "stuff.h" in main.cpp (so I can call functions implemented in stuff.cpp). So far so good. Now I want to declare some variables in stuff.cpp that have global scope (so I can modify the variables in functions implemented in stuff.cpp and main.cpp). This doesn't seem to work. How can I do this?

    Read the article

  • session scope in velocity

    - by Raam
    how can i use session scope in VELOCITY(in view part am using sample.vm like that)... my requirement is when i login into a page,i want to store the user's name& some details in session and if i press logout i want to clear all the information in that session. thanks for ur help

    Read the article

  • Accessing Ember component scope from block form?

    - by user3009816
    I want to let a user pass a custom text field, App.CustomTextField, in a Ember component using block form. However, that App.CustomTextField needs access to the component to manipulate its properties. How can I pass the component to the textfield using block form? I would like to pass the component as a property to App.CustomTextField, but how do I access the component's scope? {{#blog-post}} {{view App.CustomTextField component=?}} {{/blog-post}}

    Read the article

  • How to fix error with "class" when creating a dhcp split-scope on Windows 2008?

    - by Jonas Stensved
    I'm trying to split a dhcp scope between a existing domain controller TTP01 and the new DC TTP02 to provide failover. I'm using the the wizard in DHCP [my scope] Advanced Split-scope. In the final step I get an error saying: Migration of Scope Options on Added DHCP Server: Failed Error: 0x00004E4C - The class name being used is unknown or incorrect. I can't find anything that seems to be wrong with my Scope Options settings, they are: Option Name Vendor Value Class 003 Router Standard 192.168.137.1 None 006 DNS Server Standard 192.168.137.2 None 015 DNS Domain Name Standard ttp.local None 060 PXEClient Standard PXEClient None I can't find any information about this error except this msdn article when searching. How do make it work?

    Read the article

  • JSF2 - what scope for f:ajax elements?

    - by Konrad Garus
    I have this form: <h:form> <h:outputText value="Tag:" /> <h:inputText value="#{entryRecorder.tag}"> <f:ajax render="category" /> </h:inputText> <h:outputText value="Category:" /> <h:inputText value="#{entryRecorder.category}" id="category" /> </h:form> What I'm trying to achieve: When you type in the "tag" field, the entryRecorder.tag field is updated with what was typed. By some logic upon this action the bean also updates its category field. This change should be reflected in the form. Questions: What scope shall I use for EntryRecorder? Request may not be satisfactory for multiple AJAX requests, while session will not work with multiple browser windows per one session. How can I register my updateCategory() action in EntryRecorder so that it is triggered when the bean is updated?

    Read the article

  • NSURL Out of Scope

    - by ct2k7
    Hi, I've an issue with this piece of code: NSURL *url = [[NSURL alloc] initWithString:@"http://authenticate.radonsystems.net/products.xml"]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; //Initialize the delegate. XMLParser *parser = [[XMLParser alloc] initXMLParser]; //Set delegate [xmlParser setDelegate:parser]; //Start parsing the XML file. BOOL success = [xmlParser parse]; if(success) NSLog(@"No Errors"); else NSLog(@"Error Error Error!!!"); } // this is the breakpoint! I've listed where the breakpoint is - (I've placed one on every line of code in the area) Now at this point, success = NO, and looking back through the code, I reach the first line. XCode tells me that the url variable is out of scope with code 0x15db010. What does this mean?

    Read the article

  • C++ STL library in XCode - memset not defined in this scope

    - by Sharath
    I am trying to create a STL based C++ library in XCode with a bunch of C++ files that I have. Basically my end output should be a shared library (dylib) that can be consumed by a Objective-C application. When trying to compile, I get the following error.. 'memset' was not declared in scope. Since my codebase uses a lot of external 3rd party codebases, I thought i'll include or to resolve this, but I tried both and even that didn't work. Does it have something to do with the SDK? Am currently running 10.5 with GCC 4.2 Need help with setting up the Target properly. Any help is appreciated. Thanks.

    Read the article

  • Java Backgroundworker: Scope of Widget to be updated unclear

    - by erlord
    Hi all, I am trying to understand the mechanism of org.jdesktop.swingx.BackgroundWorker. Their javadoc presents following example: final JLabel label; class MeaningOfLifeFinder implements BackgroundListener { public void doInBackground(BackgroundEvent evt) { String meaningOfLife = findTheMeaningOfLife(); evt.getWorker().publish(meaningOfLife); } public void process(BackgroundEvent evt) { label.setText("" + evt.getData()); } public void done(BackgroundEvent evt) {} public void started(BackgroundEvent evt) {} } (new MeaningOfLifeFinder()).execute(); Apart from the fact that I doubt the result will ever get published, I wonder how label is passed to the process method, where it is being updated. I thought it's scope is limited to the outside of the BackgroudListener implementation. Quite confused I am ... any answers for me? Thanks in advance

    Read the article

  • NSMutable String "Out of scope"

    - by Garry
    I have two NSMutableString objects defined in my viewController's (a subclass of UITableViewController) .h file: NSMutableString *firstName; NSMutableString *lastName; They are properties: @property (nonatomic, retain) NSMutableString *firstName; @property (nonatomic, retain) NSMutableString *lastName; I synthesis them in the .m file. In my viewDidLoad method - I set them to be blank strings: firstName = [NSMutableString stringWithString:@""]; lastName = [NSMutableString stringWithString:@""]; firstName and lastName can be altered by the user. In my cellForRowAtIndexPath method, I'm trying to display the contents of these strings: cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ %@", firstName, lastName]; but this is causing the app to crash as soon as the view controller is displayed. Using the debugger, it seems that both firstName and lastName are "out of scope" or that they don't exist. I'm new to Xcode but the debugger seems to halt at objc_msgSend. What am I doing wrong?

    Read the article

  • php variable scope

    - by Illes Peter
    I have two files: index.php /lib/user.php Index contains the form: <div class="<? echo $msgclass; ?>"> <? echo $msg; ?> </div> <form id="signin" action="/lib/user.php" method="post"> ... </form> User.php makes all the processing. It sets $msg to 'some error message' and $msgalert to 'error' in case of any error. At the end of processing it uses header() to redirect to index.php But after redirection $msg and $msgalert get out of scope and index only gets empty vars. How can i fix this?

    Read the article

  • Why do I not see stricter scoping more often?

    - by Ben
    I've found myself limiting scope fairly often. I find it makes code much clearer, and allows me to reuse variables much more easily. This is especially handy in C where variables must be declared at the start of a new scope. Here is an example of what I mean. { int h = 0; foreach (var item in photos) { buffer = t.NewRow(); h = item.IndexOf("\\x\\"); buffer["name"] = item.Substring(h, item.Length - h); t.Rows.Add(buffer); } } With this example, I've limited the scope of h, without initializing it in every iteration. But I don't see many other developers doing this very often. Why is that? Is there a downside to doing this?

    Read the article

  • "_FILE_AND_LINE_ is not defined in this scope" (compiling RakNet NAT examples in OS X)

    - by Michael F
    Hello! I'm working on a RakNet-based project (using 3.8 on OS X 10.6), and I'm trying to work through the various examples that demonstrate the parts of RakNet I want to use. For the "NatCompleteClient" example, I've imported the source into a command-line project in XCode, along with the UPNP dependency. At compile time I've had a few errors in the UPNP section, though, and I can't find any guidance on this. In UPNPPortForwarder.mm, there are 7 lines that use _FILE_AND_LINE_, and the compiler is not happy; for example on line 232: foundInterfaces.Deallocate(r1,_FILE_AND_LINE_); causes: UPNPPortForwarder.mm:232: error: '_FILE_AND_LINE_' was not declared in this scope Can anyone tell me what this is all about? That variable doesn't seem to get talked about very often... or Google doesn't like to find it.

    Read the article

  • Ant var and property scope

    - by bobtheowl2
    I have a main build script that calls various targets. One of these targets needs to store a value and another target needs to display it. Obviously this is not working so I think it may be related to scope. I've tried var, property, and declaring the property outside of target1. Since var seems to be mutable, it looks like I need to use it instead, but each time my output is empty. Main script <antcall target="target1"/> <antcall target="display"/> In target1: <var name="myVar" value="${anotherVar}"/> In display: <echo>${myVar}</echo>

    Read the article

  • javascript and extJs - scope question

    - by ben
    Hi guys, I got a little scope related problem with some js code, maybe somebody can explain to me what I'm making wrong: I'm using extJs and got this snippet: Ext.onReady(function(){ // Form for filter selection var formFilter = new Ext.FormPanel({ // ... items: [ cbGroup = new Ext.form.ComboBox({ fieldLabel: 'Group', store: dsGroups, displayField: 'name', valueField: 'number', emptyText : '- Please choose a group -', listeners:{ 'select': function() { alert(cbGroup.selectedIndex +' '+this.selectedIndex); } } }) ] }); }); The problem: When I access the combobox over 'this' within the listener function, I get the correct result for the selectIndex property. When I access the combobox over it's var name, I allways get the result '-1'. Thank a lot for your help!

    Read the article

  • JSF2 - use view scope managed bean to pass value between navigation

    - by Fekete Kamosh
    Hi all, I am solving how to pass values from one page to another without making use of session scope managed bean. For most managed beans I would like to have only Request scope. I created a very, very simple calculator example which passes Result object resulting from actions on request bean (CalculatorRequestBean) from 5th phase as initializing value for new instance of request bean initialized in next phase lifecycle. In fact - in production environment we need to pass much more complicated data object which is not as primitive as Result defined below. What is your opinion on this solution which considers both possibilities - we stay on the same view or we navigate to the new one. But in both cases I can get to previous value stored passed using view scoped managed bean. Calculator page: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>Calculator</title> </h:head> <h:body> <h:form> <h:panelGrid columns="2"> <h:outputText value="Value to use:"/> <h:inputText value="#{calculatorBeanRequest.valueToAdd}"/> <h:outputText value="Navigate to new view:"/> <h:selectBooleanCheckbox value="#{calculatorBeanRequest.navigateToNewView}"/> <h:commandButton value="Add" action="#{calculatorBeanRequest.add}"/> <h:commandButton value="Subtract" action="#{calculatorBeanRequest.subtract}"/> <h:outputText value="Result:"/> <h:outputText value="#{calculatorBeanRequest.result.value}"/> <h:outputText value="DUMMY" rendered="#{resultBeanView.dummy}"/> </h:panelGrid> </h:form> </h:body> Object to be passed through lifecycle: package cz.test.calculator; import java.io.Serializable; /** * Data object passed among pages. * Lets imagine it holds something much more complicated than primitive int */ public class Result implements Serializable { private int value; public void setValue(int value) { this.value = value; } public int getValue() { return value; } } Request scoped managed bean used on view "calculator.xhtml" package cz.test.calculator; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class CalculatorBeanRequest { @ManagedProperty(value="#{resultBeanView}") ResultBeanView resultBeanView; private Result result; private int valueToAdd; /** * Should perform navigation to */ private boolean navigateToNewView; /** Creates a new instance of CalculatorBeanRequest */ public CalculatorBeanRequest() { } @PostConstruct public void init() { // Remember already saved result from view scoped bean result = resultBeanView.getResult(); } // Dependency injections public void setResultBeanView(ResultBeanView resultBeanView) { this.resultBeanView = resultBeanView; } public ResultBeanView getResultBeanView() { return resultBeanView; } // Getters, setter public void setValueToAdd(int valueToAdd) { this.valueToAdd = valueToAdd; } public int getValueToAdd() { return valueToAdd; } public boolean isNavigateToNewView() { return navigateToNewView; } public void setNavigateToNewView(boolean navigateToNewView) { this.navigateToNewView = navigateToNewView; } public Result getResult() { return result; } // Actions public String add() { result.setValue(result.getValue() + valueToAdd); return isNavigateToNewView() ? "calculator" : null; } public String subtract() { result.setValue(result.getValue() - valueToAdd); return isNavigateToNewView() ? "calculator" : null; } } and finally view scoped managed bean to pass Result variable to new page: package cz.test.calculator; import java.io.Serializable; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; @ManagedBean @ViewScoped public class ResultBeanView implements Serializable { private Result result = new Result(); /** Creates a new instance of ResultBeanView */ public ResultBeanView() { } @PostConstruct public void init() { // Try to find request bean ManagedBeanRequest and reset result value CalculatorBeanRequest calculatorBeanRequest = (CalculatorBeanRequest)FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("calculatorBeanRequest"); if(calculatorBeanRequest != null) { setResult(calculatorBeanRequest.getResult()); } } /** No need to have public modifier as not used on view * but only in managed bean within the same package */ void setResult(Result result) { this.result = result; } /** No need to have public modifier as not used on view * but only in managed bean within the same package */ Result getResult() { return result; } /** * To be called on page to instantiate ResultBeanView in Render view phase */ public boolean isDummy() { return false; } }

    Read the article

  • Scope of variables inside of javascript

    - by wcpro
    I have the following code sample that im trying to wrap my head around $(document).ready(function () { test("load json", function () { length = 0; // length = 0 $.getJSON("plugins/form.json", function (data) { length = data.fields.length; // length = 4 }); ok(length == 4, "length = " + length.toString()); // length = 0? wtf? }); }); the 'length' variable does not persist when the $.getJSON runs. I cant figure out if its because its asynchronous or because the variable is out of scope.

    Read the article

  • LuaInterface: add a table to the script scope

    - by user93422
    Question: how can I insert a table from C# into 'LuaInterface' script scope using a C# object (preferably anonymous type)? /// I want to do this, but it does not work /// (complains that 'test' is userdata and not table /// when I pass it to pairs() in the script) //lua["test"] = new { A = 1, B = 2 }; /// another option /// but building this string is a PITA (actual string is nested and long). lua.DoString("test = { A = 1, B = 2 }"); // So I have to do this lua.NewTable("test"); ((LuaTable) lua["test"])["A"] = 1; ((LuaTable) lua["test"])["B"] = 2; lua.DoString("for k,v in pairs(test) do print(k..': '..v) end");

    Read the article

  • Losing scope for DataContex using LINQToSQL intermediately

    - by greektreat
    I am having a weird Situation with my DataConext. All My code is in C# I have a DLL project for my data access layer and business Layer which and Winforms project for my UI layer. My Data access Layer's Namespace is xxx.Data this is where have my xxx.dbml I also have xxx.Data.BusinessObjects name space of course for my business object in that project In my UI Layer I have these namespaces xxxApp(for Forms), xxxApp.Controls (For Controls) I have lost scope of the DataContext, it was accessible now when I do a Rebuild Solution I sometimes get compile errors saying for example: Error 34 'xxx.Data.xxxDataContext' does not contain a definition for 'SubmitChanges' and no extension method 'SubmitChanges' accepting a first argument of type 'xxx.Data.xxxDataContext' could be found (are you missing a using directive or an assembly reference?) Also intelisense doesn't recognize the methods and table classes from my xxxDataContext anymore I can access all object fine when I am in the DLL project but now in the Winforms project this is very strange. If anyone can help me out I would be extremely grateful!

    Read the article

  • I get "stack level too deep" error when using a named scope

    - by Brian Roisentul
    I'm using ruby on rails 2.3.8 and when I write the syntax shown below I get the "stack level too deep" error message. The model is called Announcement and the line of the error looks like this: Tag.find(category_id).announcements.published Where published is named_scope :published, :conditions => "announcements.state = 'published'" I use this named scope in many other places and it works fine. What am I doing wrong? (the relationship between Tag and Announcement model is ok because if I remove the ".published" method from that line it works just fine).

    Read the article

  • Please explain syntax rules and scope for "typedef"

    - by unknown google user
    What are the rules? OTOH the simple case seems to imply the new type is the last thing on a line. Like here Uchar is the new type. typedef unsigned char Uchar; But a function pointer is completely different. Here the new type is pFunc: typedef int (*pFunc) (int); I can't think of any other examples offhand but I have come across some very confusing usages. So are there rules or are people just suppose to know from experience that this is how it is done because they have seen it done this way before? ALSO: What is the scope of a typedef. Thanks to everyone.

    Read the article

  • Scope of Constants in Ruby Modules

    - by user204078
    I'm having a little problem with constant scope in mixin modules. Let's say I have something like this module Auth USER_KEY = "user" unless defined? USER_KEY def authorize user_id = session[USER_KEY] def end The USER_KEY constant should default to "user" unless it's already defined. Now I might mix this into a couple of places, but in one of those places the USER_KEY needs to be different, so we might have something like this class ApplicationController < ActionController::Base USER_KEY = "my_user" include Auth def test_auth authorize end end I would expect that USER_KEY would be "my_user" when used in authorize, since it's already defined, but it's still "user", taken from the modules definition of USER_KEY. Anyone have any idea how to get authorize to use the classes version of USER_KEY?

    Read the article

  • Problem with "not declared in this scope" error

    - by lego69
    I've got: error a1 was not declared in this scope Can somebody please explain why this code causes that? quiz.h #ifndef QUIZ_H_ #define QUIZ_H_ #include "quiz.cpp" class A { private: int player; public: A(int initPlayer); ~A(); void foo(); }; #endif /* QUIZ_H_ */ quiz.cpp #include "quiz.h" #include <iostream> using std::cout; using std::endl; A::A(int initPlayer = 0){ player = initPlayer; } A::~A(){ } void A::foo(){ cout << player; } main function #include "quiz.h" int main() { quiz(7); return 0; } quiz function #include "quiz.h" void quiz(int i) { A a1(i); a1.foo(); }

    Read the article

  • NSString variable out of scope in sub-class (iPhone/Obj-C)

    - by Rich
    I am following along with an example in a book with the code exactly as it is in the example code as well as from the book, and I'm getting an error at runtime. I'll try to describe the life cycle of this variable as good as I can. I have a controller class with a nested array that is populated with string literals (NSArray of NSArrays, the nested NSArrays initialized with arrayWithObjects: where the objects are all string literals - @"some string"). I access these strings with a helper method added via a category on NSArray (to pull strings out of a nested array). My controller gets a reference to this string and assigns it to a NSString property on a child controller using dot notation. The code looks like this (nestedObjectAtIndexPath is my helper method): NSString *rowKey = [rowKeys nestedObjectAtIndexPath:indexPath]; controller.keypath = rowKey; keypath is a synthesized nonatomic, retain property defined in a based class. When I hit a breakpoint in the controller at the above code, the NSString's value is as expected. When I hit the next breakpoint inside the child controller, the object id of the keypath property is the same as before, but instead of showing me the value of the NSString, XCode says that the variable is "out of scope" which is also the error I see in the console. This also happens in another sub-class of the same parent. I tried googling, and I saw slightly similar cases where people were suggesting this had to do with retain counts. I was under the impression that by using dot notation on a synthesized property, my class would be using an "auto generated accessor" that would be increasing my retain count for me so that I wouldn't have this problem. Could there be any implications because I'm accessing it in a sub-class and the prop is defined in the parent? I don't see anything in the book's errata about this, but the book is relatively new (Apress - More iPhone 3 Dev). I also have double checked that my code matches the example 100 times.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >