Search Results

Search found 13794 results on 552 pages for 'variable scope'.

Page 37/552 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Checking for a variable in the executable

    - by rboorgapally
    Is there a way to know whether a variable is defined, by looking at the executable. Lets say I declare int i; in the main function. By compiling and linking I get an executable my_program.exe. Now, by looking inside my_program.exe, can I say if it has an int eger variable i ?

    Read the article

  • WPF UserControl Embedded Animation

    - by Matt B
    Hi all, I have a UserControl called Beetle.xaml which has animation makeing the legs move. So far so good. I added this to my Background.xaml page by decaring the xmlns and xaml as: xmlns:my="clr-namespace:Intellident.Liber8.GUI.Theme.Jungle" and <my:Beetle VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="180,0,0,175"> <UserControl.RenderTransform> <MatrixTransform x:Name="trnBeetle" /> </UserControl.RenderTransform> </my:Beetle> However I get errors telling me that I can't declare my:Name as I'm in the wrong scope. I can't declare my:Name as this doesn't exist. How do I do this, I want to create a path animation on the beetle to make him walk around... Ta, Matt. EDIT: THought I'd point out that both Beetle.xaml and Background.xaml live in Intellident.Liber8.GUI.Theme.Jungle namescope.

    Read the article

  • What are the main advantages of adding your custom functions to a javascript libraries namepsace?

    - by yaya3
    It is fairly well known in JavaScript that declaring variables within the global scope is a bad thing. So code I tend to work on contains namespaced JavaScript. There seems to be two different approaches taken to this - Adding your application specific functions to the libraries' namespace e.g. $.myCarouselfunction Creating your own namespace e.g. MyApplication.myCarouselFunction I wanted to know whether or not there is a 'better' solution or if they tend to meet somewhere close in terms of pros and cons. The reason for me personally deciding not to go with the library is for Seperation / Isolation / Lack of conflict with library code and potential plugins that are likely to share that namespace. But I am sure there is more to this. Thanks

    Read the article

  • one variable for all the sql output

    - by kdev
    hi everyone myRs=myStmt.executeQuery("select i_col,col_name from tab_col") i=0 while (myRs.next()): list= myRs.getString("I_COL")+','+myRs.getString("COL_NAME") i have a jython code to run a sql statement i want to store all the row of the sql into a single variable. I used to list to store the value but its always storing only the single line , so is there is way to append all the rows and keep adding to single variable. Thanks so much for your help.

    Read the article

  • Open a save file dialog for a js variable

    - by Constructor
    In my web app I need to give the user the option to save a js variable as a file (when the user clicks download, the app offers him to save a file, preffereably as .js file). Similarly as google docs offers you to save a file. Is it possible for javascript to pass it's variable this way?

    Read the article

  • powershell function output to variable

    - by tommy
    I have a function in powershell 2.0 named getip which gets the IP address(es) of a remote system. function getip { $strComputer = "computername" $colItems = GWMI -cl "Win32_NetworkAdapterConfiguration" -name "root\CimV2" -comp $strComputer -filter "IpEnabled = TRUE" ForEach ($objItem in $colItems) {Write-Host $objItem.IpAddress} } The problem I'm having is with getting the output of this function to a variable. The folowing doesn't work... $ipaddress = (getip) $ipaddress = getip set-variable -name ipaddress -value (getip) any help with this problem would be greatly appreciated.

    Read the article

  • return the variable used for using inside the using C#

    - by di3go
    Hello, I am returning the variable I am creating in a using statement inside the using statement (sounds funny): public DataTable foo () { using (DataTable properties = new DataTable()) { // do something return properties; } } Will this Dispose the properties variable?? After doing this am still getting this Warning: Warning 34 CA2000 : Microsoft.Reliability : In method 'test.test', call System.IDisposable.Dispose on object 'properties' before all references to it are out of scope. Any Ideas? Thanks

    Read the article

  • shared global variables in C

    - by Claudiu
    How can I create global variables that are shared in C? If I put it in a header file, then the linker complains that the variables are already defined. Is the only way to declare the variable in one of my C files and to manually put in externs at the top of all the other C files that want to use it? That sounds not ideal.

    Read the article

  • Find out what variable is throwing a NullPointerException programatically

    - by Hectoret
    I know I can find out if a variable is null in Java using these techniques: if (var==null) - too much work try { ... } catch (NullPointerException e) { ...} - it tells me what line is throwing the exception using the debugger - by hand, too slow Consider this line of code: if (this.superSL.items.get(name).getSource().compareTo(VIsualShoppingList.Source_EXTRA)==0) { I would like to know if there's a generic way to find out programatically what variable (not just the line) is throwing the NullPointerException in a certain area of code. In the example, knowing that

    Read the article

  • Why does subshell not inherit exported variable (PS1)?

    - by amn
    After some debugging I finally narrowed down the problem as to why my X session xterm prompt does not appear according to my PS1 setting. If I run sh -c env, it doesn't even show PS1 in the list. Why? export PS1='test' sh -c env # No PS1 in the list, default prompt appearance (shell name + version) Substituting sh with bash yields same result, alas the behavior appears to be the same for both shells/modes. As far as I understood from man bash, the environment resulting from command run by shell with -c should include the exported variables. And it does - exporting FOOBAR results in FOOBAR listed in env run by subshell. It appears that the story is different if the variable is PS1 however. What is going on? I want my prompt propagated throughout the process tree and system. For matters sake, it is set in /etc/profile.d/user.sh (a file I created myself) with the following: PS1='\u@\H \w \$ ' export PS1 I am running Arch Linux (updated yesterday.)

    Read the article

  • assigning a specific record in a ResultSet to a variable

    - by kilhra
    Hi I want to retrieve a set of records from a database, do a rs.next() and then assign the result of this to a variable to pass to a method that will use this record, in the same way that I would without assigning it to a variable and passing it to a method is there any way to do this? I'm using JAVA (1.5)

    Read the article

  • Using a array variable in a foreach loop

    - by Jess McKenzie
    I am having an issue trying to work out how to use a function variable in a foreach loop so that I can do the following but its not working. $var = array(7) { [0]=> array(3) { ["listingId"]=> int(532712629) } [1]=> array(3) { ["listingId"]=> int(532712202) } Works but not right: foreach($var as $varr) { var_dump($varr['id']); { Goal - Having the array variable as the foreach value foreach($var['id'] as $item) { if($item === $foo) { } }

    Read the article

  • Environment variable for volume names in Windows?

    - by Shinrai
    I'm trying to write a batch file that will look at the volume label of the current drive and report if it's not equivalent to a certain string. Is there a default variable in the shell for this? Can I define one? Am I SOL and I'll actually have to do some (shudder) programming? EDIT: If this is possible in PowerShell that would work fine. (For the curious, we ship our machines with software cloning as a rapid bootable backup solution since most of our customers are daytraders and aren't interested in RAID due to urgency of getting-the-hell-back-to-work-right-away if there's a software corruption problem, and we want to make it immediately obvious if they're booting to the backup drive unintentionally, like say the primary failed entirely. The hope was just to write a simple batch file that would autostart on boot and throw a warning in the event of a problem.)

    Read the article

  • If a variable has getter and setter, should it be public?

    - by Oni
    I am an about to graduate Computer Science student so probably this is a stupid question. If I have a class with a variable that is private and the class have getter and setter for that variable. Why don't make that variable public? The only case I think you have to use getters and setters is if you need to do some operation besides the set or the get. Example: void my_class::set_variable(int x){ /* Some operation like updating a log */ this->variable = x; } Thanks in advance!

    Read the article

  • PATH variable recently changed

    - by Dan
    $ loopy Command 'loopy' is available in '/usr/games/loopy' The command could not be located because '/usr/games' is not included in the PATH environment variable. loopy: command not found Every answer I've found just says to add it to my .profile... but this should be be in the PATH for all users, and was up until recently (I have no idea what would have caused it to change). How can I solve this on my system for all users? What could have caused this to change? Thanks.

    Read the article

  • Read file contents into variable in batch file

    - by Faisal
    I want to read the contents of an external file in a variable inside a batch file. The contents of file contains multiple lines. I found a couple of ways but it either reads the first line or last line or its too complex. I want all content in one variable. Any easier way?

    Read the article

  • puppet propagate variable from node to erb tamplate?

    - by picca
    Is it possible to declare variable in node and than propage it way down to the erb template? Example: node basenode { $myvar = "bar" # default include myclass } node mynode extends basenode { $myvar = "foo" } class myclass { file { "/root/myfile": content => template("myclass/mytemplate.erb") ensure => present, } } Source of mytemplate.erb: myvar has value: <%= myvar %> I know that my example might be complicated. But I'm trying to propagate file on (almost) all my nodes and I want its content to be altered depending on the node which requests the file. The $myvar = "bar" statement should be default when node does not override its value. Is there a solution to my problem? I'm using puppet 0.24.5

    Read the article

  • Perl replace slash in variable

    - by cc96ai
    How can I replace the slash inside the variable? $string = 'a\cc\ee'; $re = 'a\\cc'; $rep = "Work"; #doesnt work in variable $string =~ s/$re/$rep/og; print $string."\n"; #work with String $string =~ s/a\\cc/$rep/og; print $string."\n"; output: a\cc\ee Work\ee

    Read the article

  • ServeletException, Property <variable name> not found

    - by k9yosh
    What i'm trying to do is add a new variable to this previously created Managed Bean Hello.java and use it in my xhtml file binding to a text field. But it seems that it is not being found when i run it on the server. So it throws a "ServeletException" and says that the "property 'lname'(my variable) is not found". How do i solve this and why is this happening? This is my managed bean, package stack.tute.malinda.model; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class Hello { private String fname; private String message; private String lname; //trying to add this new variable and use it in my xhtml file in a text field. public String getLname() { return lname; } public void setLname(String lname) { this.lname = lname; } public String getName() { return fname; } public String createMessage() { message="Hello " + fname + ""+ lname +"!"; return null; } public void setName(String fname) { this.fname=fname; } public String getMessage() { return message; } } This is my xhtml code, <h:body> <fieldset style="padding: 1em; float:left; margin-right:0.5em; padding-top:0.2em; text-align:left; border:1px solid green; font-weight:bold;"> <legend>Personal Details</legend> <h:form> <h:outputLabel for="name" value="First Name :" required="true"/> <h:inputText id="name" value="#{hello.name}"/> <br/> //Trying to access that variable here. <h:outputLabel for="name1" value="Last Name :" required="true"/> <h:inputText id="name1" value="#{hello.lname}"/> <h:message for="name"/> <br/> <h:commandButton value="Say hello" action="#{hello.createMessage}"> <f:ajax execute="@form" render="@form"/> </h:commandButton> <br/> <h:outputText value="#{hello.message}"/> </h:form> </fieldset>

    Read the article

  • Variable reference in a Groovy GString

    - by Maurits Rijk
    From the book "Groovy and Grails recipes" I'm using the following code snippet: String HelloLanguage = "def hello(language) {return \"Hello $language\"}" However, I get a compiler error "You attempted to reference a variable in the binding or an instance variable from a static context." because language can't be bound. What is wrong?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >