Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 47/606 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Determine connection state

    - by rayman
    Hi, Iam trying to determine if my current connection state is WIFI or Cell network(3g/2g.. etc) iam using SDK 1.5. tried couple of technics not realy working. any working suggestions? thanks, ray.

    Read the article

  • Get highlighted state for NSButtonCell

    - by dvg
    I have a NSTableView that contains a NSButtonCell in one of the columns. To draw a custom background in neighbor cells (based on NSTextFieldCell) I use isHighlighted method: - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { if ([self isHighlighted]) { //here I draw the cell background But for NSButtonCell isHighlighted shows only the button pressed state. How to determine when the NSButtonCell is selected, i.e. when it's highlighted in the row?

    Read the article

  • Set global position for a QLabel

    - by alfredozn
    Hi I'm trying to display a QLabel (without parent) at a fixed position using PyQt. The QLabel functions as a graphic that appears only for a moment, it's appears in the middle of the screen by default but I can't find how to move its position. Any suggestion??

    Read the article

  • Reset UIKeyboard State

    - by kamziro
    I have a UITextView which the keyboard enters values into. However, if you clear the text value (i.e uitextview.text = @""), the keyboard's state does not reset to the lowercase alphabet keyboard. That is, if I was in the middle of typing "hello.." and the textview gets cleared, the keyboard still shows the symbols, rather than back to the alphabetical letters. Is there a way to get around this?

    Read the article

  • OOP/MVC advice on where to place a global helper function

    - by franko75
    Hi, I have a couple of controllers on my site which are handling form data. The forms use AJAX and I have quite a few methods across different controllers which are having to do some specific processing to return errors in a JSON encoded format - see code below. Obviously this isn't DRY and I need to move this code into a single helper function which I can use globally, but I'm wondering where this should actually go! Should I create a static helper class which contains this function (e.g Validation::build_ajax_errors()), or as this code is producing a format which is application specific and tied into the jQuery validation plugin I'm using, should it be a static method stored in, for example, my main Website controller which the form handling controllers extend from? //if ajax request, output errors if (request::is_ajax()) { //need to build errors into array form for javascript validation - move this into a helper method accessible globally $errors = $post->errors('form_data/form_error_messages'); $i = 0; $new_errors = array(); foreach ($errors as $key => $value) { $new_errors[$i][0] = '#' . $key; $new_errors[$i][1] = $value; $new_errors[$i][2] = "error"; $i++; } echo '{"jsonValidateReturn":' . json_encode($new_errors) . '}'; return; }

    Read the article

  • Accessing global variables within functions in PHP

    - by st3
    There are multiple times in one page where I need to connect and subsequently query a MySQL database, yet my code won't let me. I think it might be something to do with how my files are nested but it makes no sense. I am opening the SQL connection in the header file. The top of the offending page looks like the following: <?php $page_title = 'Dashboard'; include('templates/header.inc'); // includes a 'require_once('mysqli_connect.php') and a small query to the database; require_once('includes/functions.php'); require_once('includes/dashboard_sql.php'); // Contains functions which connect to database (which are failing.) ?> I get the PHP error Notice: Undefined variable: dbc in /Library/WebServer/Documents/pediatory_site/includes/dashboard_sql.php Where $dbc is the database connection defined in mysqli_connect.php. If anyone could help me out that would be great.

    Read the article

  • how could I pass closure problems in order to increment a global var

    - by hyptos
    I have a simple goal, I would like to increment a variable but I'm facing the closure problem. I've read why this s happening here How do JavaScript closures work? But I can't find the solution to my problem :/ let's assume this part of code I took from the link. function say667() { // Local variable that ends up within closure var num = 666; var sayAlert = function() { alert(num); //incrementation } num++; return sayAlert; } I would like to increment num within the function and to keep the changes to num. How could I do that ? Here is the JsFiddle where I have my problem, I can't figure out how to increment my totalSize and keep it. http://jsfiddle.net/knLbv/2/ I don't want a local variable that ends up with closure.

    Read the article

  • Global NSMutableArray doesn't seem to be holding values

    - by diatrevolo
    I have a Cocos2D iPhone application that requires a set of CGRects overlaid on an image to detect touches within them. "Data" below is a class that holds values parsed from an XML file. "delegateEntries" is a NSMutableArray that contains several "data" objects, pulled from another NSMutableArray called "entries" that lives in the application delegate. For some strange reason, I can get at these values without problems in the init function, but further down the class in question, I try to get at these values, and the application crashes without an error message (as an example, I put in the "ccTouchBegan" method which accessess this data through the "populateFieldsForTouchedItem" method. Can anyone see why these values would not be accessible from other methods? No objects get released until dealloc. Thanks in advance! @synthesize clicked, delegate, data, image, blurImage, normalImage, arrayOfRects, delegateEntries; - (id)initWithTexture:(CCTexture2D *)aTexture { if( (self=[super initWithTexture:aTexture] )) { arrayOfRects = [[NSMutableArray alloc] init]; delegateEntries = [[NSMutableArray alloc] init]; delegate = (InteractivePIAppDelegate *)[[UIApplication sharedApplication] delegate]; delegateEntries = [delegate entries]; data = [delegateEntries objectAtIndex:0]; NSLog(@"Assigning %@", [[delegateEntries objectAtIndex:0] backgroundImage]); NSLog(@"%@ is the string", [[data sections] objectAtIndex:0]); //CGRect rect; NSLog(@"Count of array is %i", [delegateEntries count]); //collect as many items as there are XML entries for(int i=0; i<[delegateEntries count]; i++) { if([[delegateEntries objectAtIndex:i] xPos]) { NSLog(@"Found %i items", i+1); [arrayOfRects addObject:[NSValue valueWithCGRect:CGRectMake([[[delegateEntries objectAtIndex:i] xPos] floatValue], [[[delegateEntries objectAtIndex:i] yPos] floatValue], [[[delegateEntries objectAtIndex:i] xBounds] floatValue], [[[delegateEntries objectAtIndex:i] yBounds] floatValue])]]; } else { NSLog(@"Nothing"); } } //remove the following once the NSMutableArray from above works (legacy) blurImage = [[NSString alloc] initWithString:[data backgroundBlur]]; NSLog(@"5"); normalImage = [[NSString alloc] initWithString:[data backgroundImage]]; clicked = NO; } return self; } And then: - (void)populateFieldsForTouchedItem:(TouchedRect)touchInfo { Data *touchDatum = [[Data alloc] init]; touchDatum = [[self delegateEntries] objectAtIndex:touchInfo.recordNumber]; NSLog(@"Assigning %@", [[[self delegateEntries] objectAtIndex:touchInfo.recordNumber] backgroundImage]); rect = [[arrayOfRects objectAtIndex:touchInfo.recordNumber] CGRectValue]; image = [[NSString alloc] initWithString:[[touchDatum sections] objectAtIndex:0]]; [touchDatum release]; } - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event { TouchedRect touchInfo = [self containsTouchLocation:touch]; NSLog(@"Information pertains to %i", touchInfo.recordNumber); if ( !touchInfo.touched && !clicked ) { //needed since the touch location changes when zoomed NSLog(@"NOPE"); return NO; } [self populateFieldsForTouchedItem:touchInfo]; NSLog(@"YEP"); return YES; }

    Read the article

  • Error with global variable in php not extending to included php file

    - by phileaton
    I have an html file that calls has a php section in the header like so: $page = basename($_SERVER['PHP_SELF']); Now further down in the html file I have a included footer like so: <?php include("footer.php"); ?> In this script I am referencing the $page variable, but it doesn't find it. I tried echoing the variable and nothing happened. When I place the basename() code in the footer.php file though, it handled it fine. I'd like to be efficient with the coding, so how can I get the footer.php file to get that $page variable? Is there a better way to do this than including the $page variable twice?

    Read the article

  • View state is not getting in the Page PreInit event

    - by Jibu P C_Adoor
    Hii,, I need a help. I have a master page and i am changing the masterpage file property to some other master page dynamically in the page PreInit event and that changing url is taken from a viewstate. but the view state is not getting in the pre init event. If you finding any solution regarding this pls help me....

    Read the article

  • Determine Mouse Button Switch State

    - by VoiDeD
    Hello, I'm trying to determine the host operating system's settings regarding mouse button switch state to properly handle a context menu event. I want to determine whether or not the operating system my application is running on has switched the left and right mouse buttons, and handle the mouse click event accordingly. What would be the best way to determine that in C#? Thanks!

    Read the article

  • Global JavaScript Variable Scope: Why doesn't this work?

    - by CoryDorning
    So I'm playing around with JavaScript and came across what I think to be an oddity. Is anyone able to explain the following? (i've included the alerted values as comments) Why is the first alert(msg) inside foo() returning undefined and not outside? var msg = 'outside'; function foo() { alert(msg); // undefined var msg = 'inside'; alert(msg); // inside } foo(); alert(msg); // outside Considering these both work fine: var msg = 'outside'; function foo() { alert(msg); // outside } alert(msg); // outside and: var msg = 'outside'; function foo() { var msg = 'inside'; alert(msg); // inside } alert(msg); // outside

    Read the article

  • Using a model to represent the overall state of a view

    - by James P.
    Is there a standard practise for representing the state of a user interface that is not linked to a single Component? For example, a Swing interface could have a series of tabs with a constraint that a single tab should only be displayed once per a given entity type (this could be represented as a HashSet). Or a message could give the result of the last operation carried out. Or a JPanel could be linked to a single entity instance for editing purposes.

    Read the article

  • unique random id

    - by Piyush
    I am generating unique id for my small application but I am facing some variable scope problem. my code- function create_id() { global $myusername; $part1 = substr($myusername, 0, -4); $part2 = rand (99,99999); $part3 = date("s"); return $part1.$part2.$part3; } $id; $count=0; while($count == 1) { $id; $id=create_id(); $sqlcheck = "Select * FROM ruser WHERE userId='$id';"; $count =mysql_query($sqlcheck,$link)or die(mysql_error()); } echo $id; I dont know which variable I have to declare as global

    Read the article

  • Trying to provide a global logging function

    - by Gekitsuu
    I typically write my scripts with a structure like s #!/usr/bin/python import stuff def do_things(): print "FOO" def main(): do_things() if __name__ == "__main__": main() The problem I have is I'd like to have a logging function that is defined globally and I"m not really sure how to do this. I tried a decorator function but if I define it in main I can't call it from other functions in the script. It seems like something that should be easy to do but not something I have experience with.

    Read the article

  • how to save current state of application

    - by medma
    hi, I am making an iphone application in which after login we will go through some steps and then finally we make a call from within the app. As we know on making call our app quits so plz suggest me how to resume that state on relaunching the app? 1-login 2-some steps 3-list of numbers 4-call Any help will be appreciated. Thanx..

    Read the article

  • C++ wrapper for C library

    - by Maximilien
    Hi, Recently I found a C library that I want to use in my C++ project. This code is configured with global variables and writes it's output to memory pointed by static pointers. When I execute my project I would like 2 instances of the C program to run: one with configuration A and one with configuration B. I can't afford to run my program twice, so I think there are 2 options: Make a C++ wrapper: The problem here is that the wrapper-class should contain all global/static variables the C library has. Since the functions in the C library use those variables I will have to create very big argument-lists for those functions. Copy-paste the C library: Here I'll have to adapt the name of every function and every variable inside the C library. Which one is the fastest solution? Are there other possibilities to run 2 instances of the same C source? Thanks, Max

    Read the article

  • Why is this global variable not being changed???

    - by user398314
    Why does this turn up null instead of being set to the data returned from the ajax call? It must be something simple i am overlooking. var message; $(document).ready(function(){ fbFetchMessage(); alert(message); }); function fbFetchMessage(){ var url = "http://graph.facebook.com/companyname/feed?callback=?"; $.getJSON(url,function(json){ message = json.data[0].message; }); }

    Read the article

  • Define global textbox (or other control) width in WPF

    - by John B
    I'd like to be able to maintain the width of controls globally throughout my WPF application. Previously in winforms world I'd override onload in a base form and iterate through all controls and containers and determine the type of controls and set the dimensions accordingly. I guess I could do the same in WPF but is there any better way to do this?

    Read the article

  • Set global maxRequestLength value in web.config- for all pages

    - by Albert
    I currently have my web.config location section set up like this <location path="page1.aspx"> <system.web> <httpRuntime maxRequestLength="65536" executionTimeout="3600"/> </system.web> </location> <location path="page2.aspx"> <system.web> <httpRuntime maxRequestLength="65536" executionTimeout="3600"/> </system.web> </location> etc with one entry for each page. How can I set the maxRequestLength for all pages, instead of one at a time?

    Read the article

  • Store global values for use in a wordpress theme

    - by CeejeeB
    How/Where can I store some values such as a phone number or email address so I can use these values on any page in a my custom theme? Example: I want to store a contact phone number that should be displayed in the header file of my theme but i dont want to hardcode it into the html. I would like to store it in a simerlar way custom values are stored but accessable from any theme page.

    Read the article

  • Keep Jquery dialog State after poseback

    - by shaahin
    Hi i have a dialog that made by jquery in this dialog i have asp button that save information in database but when i pust the button the page will be poseback and dialog will be close but i want to keep dialog state how can i do that cheers shaahin please give me an example

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >