Search Results

Search found 28682 results on 1148 pages for 'drop down menu'.

Page 109/1148 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • Count down timer

    - by Ohmnastrum
    I have a timer set up and it gets called when ever the player is in their turn phase. I also have a multiplier that decrements slowly while the player is committing actions. for some odd reason my mult variable is returning garbage values I initialized it to 1 in the onLoad statement but it still seems to have trouble. -(void) Timerbar:(NSTimer *)barTimer { if(!waitForPlayer) { [barTimer invalidate]; } if(mult > 0.0) { mult -= 0.01; if(mult < 0) { mult = 0; } } power = (mult * 10) / pwrBarMaxWidth; pwrBarWidth = (int)power % limit; NSLog(@"%d", mult); } Do I have a syntax error somewhere?

    Read the article

  • Fixed strptime exception with thread lock, but slows down the program

    - by eWizardII
    I have the following code, which when is running inside of a thread (the full code is here - https://github.com/eWizardII/homobabel/blob/master/lovebird.py) for null in range(0,1): while True: try: with open('C:/Twitter/tweets/user_0_' + str(self.id) + '.json', mode='w') as f: f.write('[') threadLock.acquire() for i, seed in enumerate(Cursor(api.user_timeline,screen_name=self.ip).items(200)): if i>0: f.write(", ") f.write("%s" % (json.dumps(dict(sc=seed.author.statuses_count)))) j = j + 1 threadLock.release() f.write("]") except tweepy.TweepError, e: with open('C:/Twitter/tweets/user_0_' + str(self.id) + '.json', mode='a') as f: f.write("]") print "ERROR on " + str(self.ip) + " Reason: ", e with open('C:/Twitter/errors_0.txt', mode='a') as a_file: new_ii = "ERROR on " + str(self.ip) + " Reason: " + str(e) + "\n" a_file.write(new_ii) break Now without the thread lock I generate the following error: Exception in thread Thread-117: Traceback (most recent call last): File "C:\Python27\lib\threading.py", line 530, in __bootstrap_inner self.run() File "C:/Twitter/homobabel/lovebird.py", line 62, in run for i, seed in enumerate(Cursor(api.user_timeline,screen_name=self.ip).items(200)): File "build\bdist.win-amd64\egg\tweepy\cursor.py", line 110, in next self.current_page = self.page_iterator.next() File "build\bdist.win-amd64\egg\tweepy\cursor.py", line 85, in next items = self.method(page=self.current_page, *self.args, **self.kargs) File "build\bdist.win-amd64\egg\tweepy\binder.py", line 196, in _call return method.execute() File "build\bdist.win-amd64\egg\tweepy\binder.py", line 182, in execute result = self.api.parser.parse(self, resp.read()) File "build\bdist.win-amd64\egg\tweepy\parsers.py", line 75, in parse result = model.parse_list(method.api, json) File "build\bdist.win-amd64\egg\tweepy\models.py", line 38, in parse_list results.append(cls.parse(api, obj)) File "build\bdist.win-amd64\egg\tweepy\models.py", line 49, in parse user = User.parse(api, v) File "build\bdist.win-amd64\egg\tweepy\models.py", line 86, in parse setattr(user, k, parse_datetime(v)) File "build\bdist.win-amd64\egg\tweepy\utils.py", line 17, in parse_datetime date = datetime(*(time.strptime(string, '%a %b %d %H:%M:%S +0000 %Y')[0:6])) File "C:\Python27\lib\_strptime.py", line 454, in _strptime_time return _strptime(data_string, format)[0] File "C:\Python27\lib\_strptime.py", line 300, in _strptime _TimeRE_cache = TimeRE() File "C:\Python27\lib\_strptime.py", line 188, in __init__ self.locale_time = LocaleTime() File "C:\Python27\lib\_strptime.py", line 77, in __init__ raise ValueError("locale changed during initialization") ValueError: locale changed during initialization The problem is with thread lock on, each thread runs itself serially basically, and it takes way to long for each loop to run for there to be any advantage to having a thread anymore. So if there isn't a way to get rid of the thread lock, is there a way to have it run the for loop inside of the try statement faster?

    Read the article

  • using 'or' operator not working for menu

    - by John Wilkes
    In my code here, I have a CSS class called "active" which I use if the $_GET['page'] == tutorials, php, mysql, etc... The problem is, even if the 'page' variable is not equal to any of these values, the Tutorials button in this case is still active for some reason. Any ideas why this would be happening? Am I using the 'or' (||) operand incorrectly? <?php if($_GET['page'] == 'tutorials' || 'php' || 'mysql' || 'html' || 'css' || 'js') { ?> <li class="active"> <?php } else { ?> <li> <?php } ?> <a href="index.php?page=tutorials">Tutorials</a> <ul> <li><a href="index.php?page=php">PHP</a></li> <li><a href="index.php?page=mysql">MySQL</a></li> <li><a href="index.php?page=html">HTML</a></li> <li><a href="index.php?page=css">CSS</a></li> <li><a href="index.php?page=js">JS</a></li> </ul> </li>

    Read the article

  • Mixing menuItem.setIntent with onOptionsItemSelected doesn't work

    - by superjos
    While extending a sample Android activity that fires some other activities from its menu, I came to have some menu items handled within onOptionsItemSelected, and some menu items (that just fired intents) handled by calling setIntent within onCreateOptionsMenu. Basically something like: @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_ID_1, Menu.NONE, R.string.menu_text_1); menu.add(0, MENU_ID_2, Menu.NONE, R.string.menu_text_2); menu.add(0, MENU_ID_3, Menu.NONE, R.string.menu_text_3). setIntent(new Intent(this, MyActivity_3.class)); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { super.onOptionsItemSelected(item); switch (item.getItemId()) { case (MENU_ID_1): // Process menu command 1 ... return true; case (MENU_ID_2): // Process menu command 2 ... // E.g. also fire Intent for MyActivity_2 return true; default: return false; } } Apparently, in this situation the Intent set on MENU_ID_3 is never fired, or anyway the related activity is never started. Android javadoc at some point goes like <<[if you set an intent on a menu item] and nothing else handles the item, then the default behavior will be to [start the activity with the intent]. What does it actually mean "and nothing else handles the item"? Is it enough to return false from onOptionsItemSelected? I also tried not to call super.onOptionsItemSelected(item) at the beginning and only invoke it in the default switch case, but I had same results. Does anyone have any suggestion? Does Android allow to mix the two type of handling? Thanks for your time everyone.

    Read the article

  • trying to prune down a list of files

    - by romunov
    I have a list of files and I'm trying to extract all layer1_*.grd files. Is there a way of doing this in one grep expression? lof <- c("layer1_1.grd", "layer1_1.gri", "layer1_2.grd", "layer1_2.gri", "layer1_3.grd", "layer1_3.gri", "layer1_4.grd", "layer1_4.gri", "layer1_5.grd", "layer1_5.gri", "layer2_1.grd", "layer2_1.gri", "layer2_2.grd", "layer2_2.gri", "layer2_3.grd", "layer2_3.gri", "layer2_4.grd", "layer2_4.gri", "layer2_5.grd", "layer2_5.gri", "layer3_1.grd", "layer3_1.gri", "layer3_2.grd", "layer3_2.gri", "layer3_3.grd", "layer3_3.gri", "layer3_4.grd", "layer3_4.gri", "layer3_5.grd", "layer3_5.gri", "layer4_1.grd", "layer4_1.gri", "layer4_2.grd", "layer4_2.gri", "layer4_3.grd", "layer4_3.gri", "layer4_4.grd", "layer4_4.gri", "layer4_5.grd", "layer4_5.gri" I tried doing this in two steps: list.of.files <- list.files(pattern = c("1_")) list.of.files <- list.of.files[grep(".grd", list.of.files)] Can someone enlighten me how to do this with grep in one step? I naively tried passing list() and c() to the grep but, as you can imagine, it doesn't work. list.of.files <- list.files() list.of.files <- list.of.files[grep(list("1_", ".grd"), list.of.files)]

    Read the article

  • Python programming. Accessing Windows rigth click menu options

    - by Zack
    I'm hoping to automate a few tasks at work. One of them being combining and converting power point files to PDFs. I'm a bit of a newbie (I just finished Magus Heitland's Beginning Python), so I'm not entirely sure what I'm specifically asking. On windows, one can select multiple files, right click, and select combine as adobe PDF. I've figured out the 'grouping' of the files I want to convert (I traverse the dir and nest the files inside of a list based on their names), but I'm unsure how to pursue the next step (the rightclick/combine command). Googling has led me to things like win32api, pywinauto, and ctypes. But as I read over what they do my newbieness prevents me from knowing which is the tool I need. Could any one suggest a few good resources or tips?

    Read the article

  • How to record when user follows external links without slowing user down

    - by taw
    I want to track when user clicks external links for analytics purposes. The simplest solution is to replace all external links with links to special record-and-redirect controller, but that would slow the user unnecessarily. The second idea would be to override click event and within in $.post a message to record controller, then let the main event handler happen, which will usually be either click (open link in same tab) or middle click (open in new tab) - good either way, and the user won't have to wait for wait for my server to record it, it's fire-and-forget. (I don't care if users without Javascript don't get tracked) Is that a reasonable way to go? Or what else would be the best way to track all external link clicks?

    Read the article

  • SQL 2008 HierarchyID - Select X descendants down

    - by NTulip
    How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee? Here is the current structure: CREATE TABLE [dbo].[Employees]( [NodeId] [hierarchyid] NOT NULL, [EmployeeId] [int] IDENTITY(1,1) NOT NULL, [FirstName] [varchar](120) NULL, [MiddleInitial] [varchar](1) NULL, [LastName] [varchar](120) NULL, [DepartmentId] [int] NULL, [Title] [varchar](120) NULL, [PhoneNumber] [varchar](20) NULL, [IM] [varchar](120) NULL, [Photo] [varbinary](max) NULL, [Bio] [varchar](400) NULL, [Active] [bit] NULL, [ManagerId] [int] NULL )

    Read the article

  • Drupal Navigation Conundrum

    - by Vecta
    I'm attempting to set up navigation withing a Drupal site and am having a bit of trouble. I'm trying to have a series of pages that each have a set number of sub-pages. These pages will need to link to one another. All pages will contain similar content. For instance: Page 1 will have sub-pages a, b, c, d, e, and f all with content related to the topic of page 1 Page 2 will have sub-pages a, b, c, d, e, and f with content related to the topic of page 2 I'd like these links to appear in a horizontal nav bar on each page. Is it possible to accomplish this using the book module? I've also read some information about the taxonomy menu module that sounds promising, but I'm not really sure how that would work. What route should I look into? Thanks for any input!

    Read the article

  • How to check for exception further down a pipeline

    - by laertejuniordba
    Hi all I am using New-Object System.Management.Automation.PipelineStoppedException To stop the pipeline OK..works.. But how Can I test in the next cmdlet if was stopped ? Foo1 | foo2 | foo3 Stop in foo1, but goes to foo2. I want to test if was stopped in foo1 to stop too in each function function foo1 { process { try { #do } catch { New-Object System.Management.Automation.PipelineStoppedException } } } and still going to the next cmdlet, as stopped by error I want to stop in each next cmdlets..:) Thanks !!!

    Read the article

  • How to slow down Uploadify plugin script voor jQuery

    - by Peter
    Now if that isn't a weird question, I don't know what is. But here is the problem: I have a function in my "onSelect" option that has to collect some data (through AJAX) and I have a function in my "onComplete" option that processes the just uploaded files based on the data "onSelect" collected. However, with very small files, the "onSelect" hasn't finished yet before the upload is complete and the "onComplete" fails because it lacks the necessary data. Bigger files work just fine. So, I'm looking for a way to stall the upload of the file. To let it start only after the function in onSelect completed fetching the necessary data. Any ideas? Here is an example of the function that the onSelect triggers: var foo = new Array(); function checkDB( event, queueID , fileObj ) { $.post( ajax_folder + 'fetchData' , { ref: "someValue" } , function( data ){ foo[ queueID ] = data.result; } , 'json' ); return true; }

    Read the article

  • submenu items in WPF Menu

    - by Vishal
    how to make SUBMENU ites visible vertical as a left navigation in CODEGURU.COM In windows we use layoutstyle property to make all main and child items to be viewed vertical and DOCK the menustrip to left. How to acheive this in WPF

    Read the article

  • How do I *really* justify a horizontal menu in HTML+CSS?

    - by flight
    You find plenty of tutorials on menu bars in HTML, but for this specific (though IMHO generic) case, I haven't found any decent solution: # THE MENU ITEMS SHOULD BE JUSTIFIED JUST AS PLAIN TEXT WOULD BE # # ^ ^ # # There's an varying number of text-only menu items and the page layout is fluid. # # The first menu item should be left-aligned, the last menu item should be right- # # aligned. The remaining items should be spread optimal on the menu bar. # # # # The number is varying,so there's no chance to pre-calculate the optimal widths. # # # # Note that a TABLE won't work here as well: # # - If you center all TDs, the first and the last item aren't aligned correctly. # # - If you left-align and right-align the first resp. the last items, the spacing # # will be sub-optimal. # Isn't it strange that there is no obvious way to implement this in a clean way by using HTML+CSS?

    Read the article

  • Sprite background image lags on mouse hover

    - by user351342
    I have basic DOM menu that has sprite background images for the first level of "LI"s. It works just fine, but I guess there is some problem and instead of switching the image right away on hover it goes blank and after about a second the hover image "appears" (shifts). That happens only on first hovering. After that it's smooth like it's supposed to be. Refresh the page and there it is again... Frustrating... Here is a link to check it out: http://goo.gl/6FAM The problem exist on Firefox v3.6.3. Chrome 5.0.375 and IE 8.0.7600 don't have this issue. Any ideas?

    Read the article

  • Exposing a "dumbed-down", read-only instance of a Model in GAE

    - by Blixt
    Does anyone know a clever way, in Google App Engine, to return a wrapped Model instance that only exposes a few of the original properties, and does not allow saving the instance back to the datastore? I'm not looking for ways of actually enforcing these rules, obviously it'll still be possible to change the instance by digging through its __dict__ etc. I just want a way to avoid accidental exposure/changing of data. My initial thought was to do this (I want to do this for a public version of a User model): class ReadOnlyUser(db.Model): display_name = db.StringProperty() @classmethod def kind(cls): return 'User' def put(self): raise SomeError() Unfortunately, GAE maps the kind to a class early on, so if I do ReadOnlyUser.get_by_id(1) I will actually get a User instance back, not a ReadOnlyUser instance.

    Read the article

  • 398 row datalist slowing down modal open????

    - by Jreeter
    Hey guys I got a weird issue.. I have a datalist that's only loaded on pageload it contains 2 columns a name and date and has 398 rows.. In IE 7 and above(and prob previous version) when I open a modal via a button click it takes almost 5 seconds to open. HOWEVER, if I do not bind this datalist it's MUCH faster.. Also this is only happening in IE, Chrome, Firefox and opera both open the modal instantly with the datalist binded... Josh

    Read the article

  • Webkit ondrop event while dragging

    - by monmonja
    I'm trying to drag one img and so it fires ondragenter for IE and dragover event for standard browsers, on IE and FF after the user drags it could fire ondrop event however on Webkit based (chrome and safari), i need to cancel or preventDefault() on the dragover event, doing that so will disable the dragging. Any idea on solving this? Thanks

    Read the article

  • Tableview not drilling down

    - by JoshD
    I have a Tableview which is loaded with a dummy list of exercises. I need to drill to a different page. My didSelectRow is being called, but not implementing the method. The app is a tab bar navigation app that loads a UITableView. #import <UIKit/UIKit.h> @interface Schedule : UIViewController <UITableViewDelegate, UITableViewDataSource> { NSArray *mySchedule; } @end #import "Schedule.h" #import "AnotherViewController.h" @implementation Schedule - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return mySchedule.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //create a cell UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; //fill it with contents cell.textLabel.text = [mySchedule objectAtIndex:indexPath.row]; //return it return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherViewController" bundle:nil]; [self.navigationController pushViewController:anotherViewController animated:YES]; [anotherViewController release]; } /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { NSString *myFile = [[NSBundle mainBundle] pathForResource:@"exercise" ofType:@"plist"]; mySchedule = [[NSArray alloc] initWithContentsOfFile:myFile]; [super viewDidLoad]; }

    Read the article

  • Large static arrays are slowing down class load, need a better/faster lookup method

    - by Visualize
    I have a class with a couple static arrays: an int[] with 17,720 elements a string[] with 17,720 elements I noticed when I first access this class it takes almost 2 seconds to initialize, which causes a pause in the GUI that's accessing it. Specifically, it's a lookup for Unicode character names. The first array is an index into the second array. static readonly int[] NAME_INDEX = { 0x0000, 0x0001, 0x0005, 0x002C, 0x003B, ... static readonly string[] NAMES = { "Exclamation Mark", "Digit Three", "Semicolon", "Question Mark", ... The following code is how the arrays are used (given a character code). [Note: This code isn't a performance problem] int nameIndex = Array.BinarySearch<int>(NAME_INDEX, code); if (nameIndex > 0) { return NAMES[nameIndex]; } I guess I'm looking at other options on how to structure the data so that 1) The class is quickly loaded, and 2) I can quickly get the "name" for a given character code. Should I not be storing all these thousands of elements in static arrays?

    Read the article

  • Remove class when move to next menu item

    - by danit
    I have a simple nav made up of the following HTML; <div class="inner"> <div class="button"><img class="portal" src="images/portalbutton.png" /></div> <a href="#"><div class="prod_description">&nbsp;</div></a> </div> There are a number of items (All set to float left along side each other) to make up a nav bar. When I hover over .button and/or .prod_description I want the .inner <div> to have the class .hover added to it. This is so I can set a background image around the whole thing (Kind of like highlighting the nav item). I only then want to remove .hover when another .button or .prod_description is hovered over, in which case this nav item takes the .hover class.

    Read the article

  • I want to know when a file is down downloading

    - by paulj3000
    Hi, I have a file which I want users to download only once. After it's done downloading, the file is no longer available. Outside of setting up a streaming system, is there any way I can set some sort of callback up to say the file is done downloading on the client's computer? Thanks

    Read the article

  • Force download menu for remote files

    - by o-logn
    Hey, I would like users to upload links on my site. When another user clicks on the link (e.g. PDF file), then I would like the download popup to show instead of actually displaying the PDF in browser. I know I can use Response.AddHeader/Response.WriteFile to achieve this, but the WriteFile method required a virtual path. However, the links uploaded by the user will be pointing to external servers. Can I still force the download popup to show and, if so, what would be the most efficient way of doing it? Thanks for any advice

    Read the article

  • javascript accordian menu problem in worpress

    - by Praveen kalal
    hi all i am working on wordpress project there is i used accordion for right sidebar but all the link are over lapping each other in IE8 its working fine mozzila so plz help my code is var parentAccordion=new TINY.accordion.slider("parentAccordion"); parentAccordion.init("acc","h4",1,-1); var nestedAccordion=new TINY.accordion.slider("nestedAccordion"); nestedAccordion.init("nested","h4",1,-1,"acc-selected"); $args = array('parent'=>0,'hide_empty'=>0); $cats = get_categories($args); echo '<ul id="acc" class="acc">'; foreach($cats as $key => $val) { $args1=array( 'showposts' => 10, 'category__in' => array($val->term_id), 'caller_get_posts'=>1 ); $post=get_posts($args1); echo '<li><h4>'.$val->name.'</h4>'; echo '<div class="" style="opacity: 0; height: auto;">'; echo '<ul id="nested" class="acc">'; if(isset($post) && !empty($post)) { foreach($post as $key1 => $val1) { echo '<li class="cat-item"><a title='.$val1->post_title.' href='.$val1->guid.'>'.$val1->post_title.'</a>'; } } $subcats = get_categories(array('parent'=>$val->term_id,'hide_empty'=>0)); if(isset($subcats) && !empty($subcats)) { foreach($subcats as $k => $v) { echo '<li><h4 class="">'.$v->name.'</h4>'; $args2=array( 'showposts' => 10, 'category__in' => array($v->term_id), 'caller_get_posts'=>1 ); $post1=get_posts($args2); if(isset($post1) && !empty($post1)) { echo '<div class="" style="opacity: 1; height: auto;">'; echo '<ul class="children" style="padding-left:15px;">'; foreach($post1 as $key2 => $val2) { echo '<li><a title='.$val2->post_title.' href='.$val2->guid.'>'.$val2->post_title.'</a></li>'; } echo '</ul></div>'; } } } echo "</ul>"; echo "</li>"; } echo '</ul>'; ?> </div> so plz help me

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >