Search Results

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

Page 19/552 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Bind Variable and SQL error during statement preparation

    - by Abhishek Dwivedi
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}  I was getting the following exception at run-time. JBO-27122: SQL error during statement preparation. Statement: SELECT AxEO.A_ID, AxEO.B_ID, AxEO.C_ID, ByEO.A_ID, ByEO.B_ID, ByEO.C_ID, Cz.A_ID, Cz.B_ID, Cz.C_ID FROM ABC_x AxEO, ABC_y ByEO, ABC_z CzEO WHERE AxEO.A_ID = ByEO.A_ID AND  CzEO.A_ID = :Bind_PId I copied and pasted the query on SQL worksheet, replaced :Bind_PId with a valid id, and executed the query. The query worked alright, implying the query was alright. I tried to connect to different DBs but the issue persisted, meaning it was not a DB issue either. Finally, the root cause was found to be in the concerned VO; one of the bind variables (say Bind_TId) was marked "Required". De-selecting the Required check-box resolved the issue. In retrospect, the issue looks to be rather straight-forward. However, the error message is not very helpful, if not misleading. Besides, it's counter-intuitive to think that a bind variable which is not being used in a query can cause error while statement preparation. The other bind variable - Bind_TId - was being used in other view criteria, not the view criteria involved in the given query. Still, it was required.

    Read the article

  • how to set environment variable in eric IDE

    - by ng0323
    I have no problem running a python script from the terminal, but in eric IDE, I am getting this error: ImportError libcudart.so.6.0: cannot open shared object file: No such file or directory Perhaps it's an enviroment variable that needs to be set. In eric, when I run script, I filled in the environment option as follows. I tried set PATH = usr/local/cuda-6.0/bin or PATH = /usr/local/cuda-6.0/bin or just /usr/local/cuda-6.0/bin and they all didn't work.

    Read the article

  • Parent variable inheritance methods Unity3D/C#

    - by Timothy Williams
    I'm creating a system where there is a base "Hero" class and each hero inherits from that with their own stats and abilities. What I'm wondering is, how could I call a variable from one of the child scripts in the parent script (something like maxMP = MP) or call a function in a parent class that is specified in each child class (in the parent update is alarms() in the child classes alarms() is specified to do something.) Is this possible at all? Or not? Thanks.

    Read the article

  • CONFIG_ATH_USER_REGD variable In Ununtu

    - by BigGenius
    There is a CONFIG_ATH_USER_REGD variable in OpenWrt that allows the user to override the default settings of the wireless NIC. Unfortunately grepping the Arch kernel config doesn't seem to have that, and since OpenWrt has its fair share of hacking and patches, I don't know if that's something they added or that's provided e.g. in compat-wireless. Does this setting exists for Ubuntu or BackTrack-Linux?

    Read the article

  • Variable number of GUI Buttons

    - by Wakaka
    I have a generic HTML5 Canvas GUI Button class and a Scene class. The Scene class has a method called createButton(), which will create a new Button with onclick parameter and store it in a list of buttons. I call createButton() for all UI buttons when initializing the Scene. Because buttons can appear and disappear very often during rendering, Scene would first deactivate all buttons (temporarily remove their onclick, onmouseover etc property) before each render frame. During rendering, the renderer would then activate the required buttons for that frame. The problem is that part of the UI requires a variable number of buttons, and their onclick, onmouseover etc properties change frequently. An example is a buffs system. The UI will list all buffs as square sprites for the current unit selected, and mousing over each square will bring up a tooltip with some information on the buff. But the number of buffs is variable thus I won't know how many buttons to create at the start. What's the best way to solve this problem? P.S. My game is in Javascript, and I know I can use HTML buttons, but would like to make my game purely Canvas-based. Create buttons on-the-fly during rendering. Thus I will only have buttons when I require them. After the render frame these buttons would be useless and removed. Create a fixed set of buttons that I'm going to assume the number of buffs per unit won't exceed. During each render frame activate the buttons accordingly and set their onmouseover property. Assign a button to each Buff instance. This sounds wrong as the buff button is a part of the GUI which can only have one unit selected. Assigning a button to every single Buff in the game seems to be overkill. Also, I would need to change the button's position every render frame since its order in the unit's list of buffs matter. Any other solutions? I'm actually quite for idea (1) but am worried about the memory/time issues of creating a new Button() object every render frame. But this is in Javascript where object creation is oh-so-common ({} mainly) due to automatic garbage collection. What is your take on this? Thanks!

    Read the article

  • Netlogo: error when putting variable in table, only constants allowe??

    - by Chantal
    Hello, Currently I am working on a Netlogo program where I need to use nodes and links for vehicle routing problem. (links are called streets in the program) Here I have some practical problems of how to input variable linkspeed in a table with another node. Constants like 200 etc are fine. Online I found some examples where variables are used, but I do not know why I keep getting the following error: Expected a constant. (or why netlogo expects a constant) Here is the relevant piece of code: extensions [table] streets-own [linkspeed linktoll] nodes-own [netw] ;; In another piece of code linkspeed is assigned successfully to the links to cheapcalc ;; start conditions set costs very high 300000 ;; state 3 unsearched state 2 searching state 1 searched (for later purposes) ask nodes [ set i 0 set j count nodes set netw table:make while [i < j][ table:put netw (i) [3000000 3] set i (i + 1)]] set i 0 let k 0 ask node 35 ;; here i use node 35 as an example. ;; node 35 is connected to node 34, 36, 20 and 50 [table:put netw (35) [0 1] ;; node need to search costs to travel to itself ;; putting constants is ok. while [i < j] [ask my-links [ask both-ends [if (who != 35) [set color blue ;; set temp ([linkspeed] of street 35 who) ;; here my real goal is to put this in stat of i. but i is easier than linkspeed. table:put netw (who) [ i 2 ] ] ] ] set i (i + 1)] ] ;; next node for later, no it is just repetition of the same. end I hope somebody knows what is going on... Kind regards, Chantal

    Read the article

  • Variable length argument list - How to understand we retrieved the last argument?

    - by hkBattousai
    I have a Polynomial class which holds coefficients of a given polynomial. One of its overloaded constructors is supposed to receive these coefficients via variable argument list. template <class T> Polynomial<T>::Polynomial(T FirstCoefficient, ...) { va_list ArgumentPointer; va_start(ArgumentPointer, FirstCoefficient); T NextCoefficient = FirstCoefficient; std::vector<T> Coefficients; while (true) { Coefficients.push_back(NextCoefficient); NextCoefficient = va_arg(ArgumentPointer, T); if (/* did we retrieve all the arguments */) // How do I implement this? { break; } } m_Coefficients = Coefficients; } I know that we usually pass an extra parameter which tells the recipient method the total number of parameters, or we pass a sentimental ending parameter. But in order to keep thing short and clean, I don't prefer passing an extra parameter. Is there any way of doing this without modifying the method signature in the example?

    Read the article

  • Improved technique to store a filename in a variable?

    - by SDGuero
    Greetings, I need to store the filename of a log into a variable so my script can perform some checks on the daily log files. These logs always have a different name because they have a timestamp in the name. Currently I'm using a hodge podged method that pipes an ls command to sed, sort, cut, and tail in order to get the name out. CRON_LOG=$(ls -1 $LOGS_DIR/fetch_cron_{true,false}_$CRON_DATE*.log 2> /dev/null | sed 's/^[^0-9][^0-9]*\([0-9][0-9]*\).*/\1 &/' | sort -n | cut -d ' ' -f2- | tail -1 ) UPDATE: $CRON_DATE is supplied as an argument to the script. It is the date (to the day) that the log was created on. Sometimes multiple logs will exist for the same day so I want this to get the most recent one. A typical filename is fetch_cron_false_031810090452.log I'm pretty sure I kluged this together from some stuff I found google a few months ago. it works now but I'm not really happy with the technique. I have some ideas about how to do this better but I have had great success on this site before and thought it might be best to refer to the stackoverflow gods first. All answers are greatly appreciated. Thanks, Ryan

    Read the article

  • python - tkinter - update label from variable

    - by Tom
    I wrote a python script that does some stuff to generate and then keep changing some text stored as a string variable. This works, and I can print the string each time it gets changed. Problems have arisen while trying to display that output in a GUI (just as a basic label) using tkinter. I can get the label to display the string for the first time... but it never updates. This is really the first time I have tried to use tkinter, so it's likely I'm making a foolish error. What I've got looks logical to me, but I'm evidently going wrong somewhere! from tkinter import * outputText = 'Ready' counter = int(0) root = Tk() root.maxsize(400, 400) var = StringVar() l = Label(root, textvariable=var, anchor=NW, justify=LEFT, wraplength=398) l.pack() var.set(outputText) while True: counter = counter + 1 #do some stuff that generates string as variable 'result' outputText = result #do some more stuff that generates new string as variable 'result' outputText = result #do some more stuff that generates new string as variable 'result' outputText = result if counter == 5: break root.mainloop() I also tried: from tkinter import * outputText = 'Ready' counter = int(0) root = Tk() root.maxsize(400, 400) var = StringVar() l = Label(root, textvariable=var, anchor=NW, justify=LEFT, wraplength=398) l.pack() var.set(outputText) while True: counter = counter + 1 #do some stuff that generates string as variable 'result' outputText = result var.set(outputText) #do some more stuff that generates new string as variable 'result' outputText = result var.set(outputText) #do some more stuff that generates new string as variable 'result' outputText = result var.set(outputText) if counter == 5: break root.mainloop() In both cases, the label will show 'Ready' but won't update to change that to the strings as they're generated later. After a fair bit of googling and looking through answers on this site, I thought the solution might be to use update_idletasks - I tried putting that in after each time the variable was changed, but it didn't help. It also seems possible I am meant to be using trace and callback somehow to make all this work...but I can't get my head around how that works (I tried, but didn't manage to make anything that even looked like it would do something, let alone actually worked). I'm still very new to both python and especially tkinter, so, any help much appreciated but please spell it out for me if you can :)

    Read the article

  • Objective C, Linking Error with extern variable..

    - by LCYSoft
    I have a very simple java code like this. I don't have any idea how to do this in Objective C. Especially, the static part which calls the getLocalAddress() method and assign it into the static string variable. I know how to set a static variable and a static method in Objective but I dont know how to implement that static { } part in java. Thanks in advance... public class Address { public static String localIpAddress; static { localIpAddress = getLocalIpAddress(); } public Address() { } static String getLocalIpAddress() { //do something to get local ip address } } I added this in my .h file #import <Foundation/Foundation.h> extern NSString *localIpAddress; @class WifiAddrss; @interface Address : NSObject { } @end And my .m file looks like #import "Address.h" #import "WifiAddress.h" @implementation Address +(void)initialize{ if(self == [Address class]){ localIpAddress = [self getLocalIpAddress]; } } +(NSString *)getLocalIpAddress{ return address here } -(id)init{ self = [super init]; if (self == nil){ NSLog(@"init error"); } return self; } @end And Now I am getting a linking error and it complains about "extern NSString *localIpAddress" part. If I change the extern to static, it works fine. But what I wanted to do is that I want make the scope of "localIpAddress" variable as grobal. Since if I put "static" in front of a variable in Objective-C then the variable is only visible in the class. But this time, I want to make that as a grobal variable. So my question is how to make "localIpAddress" variable as a grobal variable which is initialized once when the first time Address class is created.. Thanks in advance...

    Read the article

  • c# - How do you get a variable's name as it was physically typed in its declaration?

    - by Petras
    The class below contains the field city. I need to dynamically determine the field's name as it is typed in the class declaration i.e. I need to get the string "city" from an instance of the object city. I have tried to do this by examining its Type in DoSomething() but can't find it when examining the contents of the Type in the debugger. Is it possible? public class Person { public string city = "New York"; public Person() { } public void DoSomething() { Type t = city.GetType(); string field_name = t.SomeUnkownFunction(); //would return the string "city" if it existed! } } Some people in their answers below have asked me why I want to do this. Here's why. In my real world situation, there is a custom attribute above city. [MyCustomAttribute("param1", "param2", etc)] public string city = "New York"; I need this attribute in other code. To get the attribute, I use reflection. And in the reflection code I need to type the string "city" MyCustomAttribute attr; Type t = typeof(Person); foreach (FieldInfo field in t.GetFields()) { if (field.Name == "city") { //do stuff when we find the field that has the attribute we need } } Now this isn't type safe. If I changed the variable "city" to "workCity" in my field declaration in Person this line would fail unless I knew to update the string if (field.Name == "workCity") //I have to make this change in another file for this to still work, yuk! { } So I am trying to find some way to pass the string to this code without physically typing it. Yes, I could declare it as a string constant in Person (or something like that) but that would still be typing it twice. Phew! That was tough to explain!! Thanks Thanks to all who answered this * a lot*. It sent me on a new path to better understand lambda expressions. And it created a new question.

    Read the article

  • Javascript Square bracket notation for global variables

    - by Yousuf Haider
    I ran into an interesting issue the other day and was wondering if someone could shed light on why this is happening. Here is what I am doing (for the purposes of this example I have dumbed down the example somewhat): I am creating a globally scoped variable using the square bracket notation and assigning it a value. Later I declare a var with the same name as the one I just created above. Note I am not assigning a value. Since this is a redeclaration of the same variable the old value should not be overriden as described here: http://www.w3schools.com/js/js_variables.asp //create global variable with square bracket notation window['y'] = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old The problem is that the old value actually does get overriden and in the above eg. the alert shows 'new' instead of 'old'. Why ? I guess another way to state my question is how is the above code different in terms of semantics from the code below: //create global variable var y = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old

    Read the article

  • What is the scope of TRANSACTION in Sql server

    - by Shantanu Gupta
    I was creating a stored procedure and i got stuck in the writing methodology of me and my collegue. I am using SQL Server 2005 I was writing Stored procedure like this BEGIN TRAN BEGIN TRY INSERT INTO Tags.tblTopic (Topic, TopicCode, Description) VALUES(@Topic, @TopicCode, @Description) INSERT INTO Tags.tblSubjectTopic (SubjectId, TopicId) VALUES(@SubjectId, @@IDENTITY) COMMIT TRAN END TRY BEGIN CATCH DECLARE @Error VARCHAR(1000) SET @Error= 'ERROR NO : '+ERROR_NUMBER() + ', LINE NO : '+ ERROR_LINE() + ', ERROR MESSAGE : '+ERROR_MESSAGE() PRINT @Error ROLLBACK TRAN END CATCH And my collegue was writing it like the below one BEGIN TRY BEGIN TRAN INSERT INTO Tags.tblTopic (Topic, TopicCode, Description) VALUES(@Topic, @TopicCode, @Description) INSERT INTO Tags.tblSubjectTopic (SubjectId, TopicId) VALUES(@SubjectId, @@IDENTITY) COMMIT TRAN END TRY BEGIN CATCH DECLARE @Error VARCHAR(1000) SET @Error= 'ERROR NO : '+ERROR_NUMBER() + ', LINE NO : '+ ERROR_LINE() + ', ERROR MESSAGE : '+ERROR_MESSAGE() PRINT @Error ROLLBACK TRAN END CATCH Here the only difference that you will find is the position of writing Begin TRAN. According to me the methodology of my collegue should not work when an exception occurs i.e. Rollback should not get executed because TRAN does'nt have scope. But when i tried to run both the code, both was working in the same way. I am confused to know how does TRANSACTION works. Is it scope free or what ?

    Read the article

  • Life Scope of Temporary Variable

    - by Yan Cheng CHEOK
    #include <cstdio> #include <string> void fun(const char* c) { printf("--> %s\n", c); } std::string get() { std::string str = "Hello World"; return str; } int main() { const char *cc = get().c_str(); // cc is not valid at this point. As it is pointing to // temporary string internal buffer, and the temporary string // has already been destroyed at this point. fun(cc); // But I am surprise this call will yield valid result. // It seems that the returned temporary string is valid within // scope (...) // What my understanding is, scope means {...} // Is this valid behavior guarantee by C++ standard? Or it depends // on your compiler vendor implementations? fun(get().c_str()); getchar(); } The output is : --> --> Hello World Hello, may I know the correct behavior is guarantee by C++ standard, or it depends on your compiler vendor implementations? I have tested this under VC2008 and VC6. Works fine for both.

    Read the article

  • [iphone] method created in a seperate class returns "out of scope"

    - by Dror Sabbag
    Hey, I have created a Class (subclass of NSObject) which will hold all my SQLs/dbConnections etc.. in a seperate viewcontroller, i have instantiated the SQL's class and performed some actions, all went trough OK. but. one of my methods in the SQL's class is a method defined as follows: -(NSString *)queryTable:(NSUInteger *)fieldnum //query from db, and assign the field value into "fieldName" dbEntity = fieldName; [fieldName release]; } sqlite3_finalize(statement); } return dbEntity; } dbEntity is defined as NSString, and i have set it as a nonatoimc-retain property @property (nonatomic,retain) NSString *dbEntity; when ever i call this method out from my viewController and debug step by step, i see that the method is running, it is quering from the db as expected, but when it passes the value into dbEntity the values in dbEntity are suddenly "out of scope" that is... if i browse this specific action: dbEntity = fieldName; i can see values inside fieldName, but see "out of scope" in dbEntity. Why is that?!? what is wrong with dbEntity definitions? Any help will be appriciated.

    Read the article

  • How to scope access to a service to set of users, using OpenLDAP, and only OUs

    - by JDS
    Okay, here goes. Solving this will solve several problems for me (as I can reapply this knowledge to several extant, similar problems), but luckily I have a very specific, concise problem to describe. Enough preamble. Our hosting partner is setting up VPN access for us and is connecting it to our LDAP server. They are using Cisco VPN, the docs on setting this up are here: http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a00808c3c45.shtml#maintask1 Specifically, note the screenshot in (5), under "ASDM" Now, I do NOT want to provide access to all of our users. I only want to provide access to our IT group. But I do not see a configuration option for LDAP groups on that web reference for the Cisco VPN. We are using: OpenLDAP 2.4 Static groups (i.e. "Group has the following members...") Single user OU, "ou=users,dc=mycompany,dc=com" Is it possible to provide an alias of some kind in OpenLDAP that creates another OU, "itusers", say, and lets me alias the members of that OU somehow? Something like: "cn=Jeff Silverman,ou=itusers,dc=mycompany,dc=com" is an alias for "cn=Jeff Silverman,ou=users,dc=mycompany,dc=com" And is NOT a separate, unique user account. Alternatively, should I just create a separate OU and manage it separately? It is a pain, but only 12-15 users will have to be managed that way, with two separate user accounts. But I hate this option - messy, unmanageable, unscalable. You know what I mean. I am open to any options. I've searched and read all over but I can't quite find an directly analagous example. I can't possibly be the only one who's had this problem! Thanks!

    Read the article

  • Google Earth - zoom like with a scope, rotate the camera

    - by Suma
    I know it is possible to change a viewing altitude in Google Earth, but is it possible to zoom in/out as well, like with a telescope? I would like to preview what could be viewed from a particular lookout point, but without zoom in it seems very hard. Another feature which would be handy for the purpose: is it possible to turn the viewing direction around the camera, and not around the target?

    Read the article

  • Scope of Mainframe Technologies Today?

    - by Vaibhav Bajpai
    I have been recently allocated to training in Mainframe Technologies at my company (where I am currently working as a Trainee). I am slated to learn DB2, JCL, CICS, and Cobol during the programme. I am from a C++ background, and curious how the community here feels of these technologies. I am also curious to know, how mainframe computers fit into today's computing scenario where distributed computing has taken over almost completely.

    Read the article

  • environment variable issue in shell

    - by George2
    I am using Red Hat Linux Enterprise 5. I know the theory that -- using export to set environment variable, the environment variable will apply to current and child environment, but without using export to set environment variable, the environment variable will only apply to the current environment. My confusion is, what is the exact definition of "child environment" and "current environment"? For example, $ var1=123 $ echo "Hello [$var1]" the value of var1 (which is 123) is printed in shell, but I think echo is a command invoked by current shell, and it (the echo command) should be a child environment of current shell and the value of var1 should not (because not using export var1=123) impact echo. Any comments? Thanks in advance!

    Read the article

  • exported variable not persisted after script execution

    - by Daniele
    I'm facing a wierd issue. I've a vm with solaris 11, and trying to write some bash scripts. if, on the shell, I type : export TEST=aaa and subsequently run: set I correctly see a new environment variable named TEST whose value is aaa. If, however I do basically the same thing in a script. when the script terminates, I do not see the variable set. To make a concrete example, if in a file test.sh I have: #!/usr/bin/bash echo 1: $TEST #variable not defined yet, expect to print only 1: echo 2: $USER TEST=sss echo 3: $TEST export TEST echo 4: $TEST it prints: 1: 2: daniele 3: sss 4: sss and after its execution, TEST is not set in the shell. Am I missing something? I tried both to do export TEST=sss and the separate variable set/export with no difference.

    Read the article

  • the scope of a pointer ???

    - by numerical25
    Ok, so I did find some questions that were almost similar but they actually confused me even more about pointers. http://stackoverflow.com/questions/2715198/c-pointer-objects-vs-non-pointer-objects-closed In the link above, they say that if you declare a pointer it is actually saved on the heap and not on the stack, regardless of where it was declared at. Is this true ?? Or am I misunderstanding ??? I thought that regardless of a pointer or non pointer, if its a global variable, it lives as long as the application. If its a local variable or declared within a loop or function, its life is only as long as the code within it.

    Read the article

  • Pass FORTRAN variable to Python [migrated]

    - by Matthew Bilskie
    I have a FORTRAN program that is called from a Python script (as an ArcGIS tool). I need to pass an array, Raster_Z(i,j), from FORTRAN to python. I have read about the Python subprocess module; however, I have not had much luck in understanding how to do this with FORTRAN. All examples I have found involve simple unix command line calls and not actual programs. Has anyone had any experience in passing a variable from FORTRAN to Python via a memory PIPE? Thank you for your time.

    Read the article

  • global scope of variable

    - by shantanuo
    The following shell scrip will check the disk space and change the variable "diskfull" to 1 if the usage is more than 10% The last echo always shows 0 I tried the global diskfull=1 in the if clause but it did not work. How do I change the variable to 1 if the disk consumed is more than 10% #!/bin/sh diskfull=0 ALERT=10 df -HP | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do #echo $output usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) partition=$(echo $output | awk '{ print $2 }' ) if [ $usep -ge $ALERT ]; then diskfull=1 exit fi done echo $diskfull

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >