Search Results

Search found 1772 results on 71 pages for 'retain cycles'.

Page 4/71 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • UIButton that cycles through images when clicked

    - by dot
    I have three images that I want to cycle through when clicking on a UIButton. How would I go about doing this? This is what I have so far, but it's not really working. //the images NSString* imageNames[] = {"MyFirstImage", "AnotherImage", whatever else}; int currentImageIndex = 0; and - (IBAction)change{ UIImage* imageToShow = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource: imageNames[currentImageIndex] ofType:@"png"]; if( currentImageIndex++ == sizeof(imageNames)/sizeof(NSString)) //check to see if you hit the last image { currentImageIndex = 0; //start over } } Ideas? Any help will be greatly appreciated! Thanks!

    Read the article

  • java GC periodically enters into several full GC cycles

    - by Peter
    Environment: sun JDK 1.6.0_16 vm settings: -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -Xms1024 -Xmx1024M -XX:MaxNewSize=448m -XX:NewSize=448m -XX:SurvivorRatio=4(6 also checked) -XX:MaxPermSize=128M OS: windows server 2003 processor: 4 cores of INTEL XEON 5130, 2000 Hz my application description: high intensity of concurrent(java 5 concurrency used) operations completed each time by commit to oracle. it's about 20-30 threads run non stop, doing tasks. application runs in JBOSS web container. My GC starts work normally, I see a lot of small GCs and all that time CPU shows good load, like all 4 cores loaded to 40-50%, CPU graph is stable. Then , after 1 min of good work, CPU starts drop to 0% on 2 cores from 4, it's graph becomes unstable, goes up and down("teeth"). I see, that my threads work slower(I have monitoring), I see that GC starts produce a lot of FULL GC during that time and next 4-5 minutes this situation remains as is, then for short period of time, like 1 minute, it gets back to normal situation, but shortly after that all bad thing repeats. Question: Why I have so frequent full GC??? How to prevent that? I played with SurvivorRatio - does not help. I noticed, that application behaves normally until first FULL GC occurs, while I have enough memory. Then it runs badly. my GC LOG: starts good then long period of FULL GCs(many of them) 1027.861: [GC 942200K-623526K(991232K), 0.0887588 secs] 1029.333: [GC 803279K(991232K), 0.0927470 secs] 1030.551: [GC 967485K-625549K(991232K), 0.0823024 secs] 1030.634: [GC 625957K(991232K), 0.0763656 secs] 1033.126: [GC 969613K-632963K(991232K), 0.0850611 secs] 1033.281: [GC 649899K(991232K), 0.0378358 secs] 1035.910: [GC 813948K(991232K), 0.3540375 secs] 1037.994: [GC 967729K-637198K(991232K), 0.0826042 secs] 1038.435: [GC 710309K(991232K), 0.1370703 secs] 1039.665: [GC 980494K-972462K(991232K), 0.6398589 secs] 1040.306: [Full GC 972462K-619643K(991232K), 3.7780597 secs] 1044.093: [GC 620103K(991232K), 0.0695221 secs] 1047.870: [Full GC 991231K-626514K(991232K), 3.8732457 secs] 1053.739: [GC 942140K(991232K), 0.5410483 secs] 1056.343: [Full GC 991232K-634157K(991232K), 3.9071443 secs] 1061.257: [GC 786274K(991232K), 0.3106603 secs] 1065.229: [Full GC 991232K-641617K(991232K), 3.9565638 secs] 1071.192: [GC 945999K(991232K), 0.5401515 secs] 1073.793: [Full GC 991231K-648045K(991232K), 3.9627814 secs] 1079.754: [GC 936641K(991232K), 0.5321197 secs]

    Read the article

  • numeric cycles in shell

    - by oraz
    hello, what is the name and sintacsys of construcion ((..)) in example below? for ((i=1;i<10;i++)) do echo $i; done it has strange variable i where are other constructons for numeric cycling in shell?

    Read the article

  • How to make cycle over cycles in Java?

    - by Roman
    I would like to make a cycle over the following elements: [1,2,11,12,21,22,111,112,121,122,....,222222] or for example [1,2,3,11,12,13,21,22,23,31,32,33,111,112,113,... 333333333] How can I make it in Java? In my particular case I use 4 digits (1,2,3,4) and the length of the last number can be from 1 to 10. I managed to do it in Python and PHP. In the first case I used list over lists. I started from [[1],[2],] then for every element of the list I added 1 and 2, so I got [[1,1],[1,2],[2,1],[2,2]] and so on: nchips = sum(chips) traj = [[]] last = [[]] while len(last[0]) < nchips: newlast = [] for tr in last: for d in [1,2,3,4]: newlast.append(tr + [d]) last = newlast traj += last When I did it in PHP I used number with base 3. But it was a tricky and non elegant solution. for ($i=-1; $i<=$n; $i+=1) { if ($i>-1) { $n5 = base_convert($i,10,5); $n5_str = strval($n5); $tr = array(); $found = 0; for ($j=0; $j<strlen($n5_str); $j+=1) { $k = $n5_str[$j]; if ($k==0) { $found = 1; break; } array_push($tr,$k); } if ($found==1) continue; } else { $tr = array(); } } Can it be done easily in Java?

    Read the article

  • .htaccess - redirect non www to www and retain subdomains from redirecting

    - by RhymeGuy
    So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'. Now, I want to redirect non www to www with .htaccess and this is what currently what i have: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301] </IfModule> This works. When somebody enter domain.com it will be redirected to www.domain.com. However when somebody enter sub1.domain.com, he will be redirected to www.domain.com/sub1 - which I don't want, it needs to be in sub1.domain.com. What shall I add in .htaccess file to accomplish this?

    Read the article

  • Windows Color Calibrator Does Not Retain Color Settings

    - by Zian Choy
    When I try to calibrate the monitor using Windows 7's color calibrator, the monitor rejects changes to the color settings. For example, one of my monitors has a blueish tinge. If I click my mouse to tone down the blue and then let go of my mouse the monitor will go back to being blueish. At the moment, I am getting around the problem by using the color controls in the monitor's on screen displays. How can I get the color calibrator to work? Update: I tried checking the color settings in the ATI Radeon Catalyst Control Center and noticed that I can't do anything. The "Reactivate ATI color controls" button keeps flashing and any changes I try to make are discarded instantly.

    Read the article

  • How to retain background colors when pasting between documents in Excel

    - by Iain Fraser
    I have a script that programatically generates excel spreadsheets - cleaning up ugly reports that are given to us from another organisation. For interests sake; I'm using PHPExcel to generate the "clean" reports. We get these reports every week for an event that happens every couple of months. The reports contain a list of attendees along with a group id that allows us to know that some attendees belong together. To help the event organisers out, I've taken the event ID and generated a unqiue color code (based on the hash of the event ID - truncated to 6 characters). This unique colour code is set as the background color of a cell in each row. This helps organisers quickly visually identify group members. Trouble is, when the organisers copy the rows from the weeks report into the master report (which contains all attendees, not just the ones that signed up this week) - all the colour-codes snap to the master template's color pallette. Thank you very much for your time All the best Iain

    Read the article

  • retain last used path to location for saving files in Windows 7

    - by Mark Miller
    I am using Microsoft Office 2010 and Windows 7 on a Dell PC. I am opening a bunch of MSWord files one at a time, copying data tables therein, pasting the data into Excel and saving the Excel files as comma delimited text files. I am creating a separate Excel file for each MSWord file. The path to the folder containing the saved comma-delimited files is quite long, something like this: c:\users\me\aa\bb\cc\dd\ee\ Every time I open Excel and save a new comma-delimited file I have to re-navigate the entire path (c:\users\me\aa\bb\cc\dd\ee). In the past Windows seemed to remember the last used path, saving a lot of tedious key-strokes. In fact, I think Windows did this for me as recently as last week, albeit on a different computer. Can I apply a setting in Windows somewhere asking it to offer the last used path as a default when saving files so I do not have to re-navigate the entire directory structure to save each new comma-delimited file? If I can, how so? Where is the option for specifying that setting? Thank you for any help.

    Read the article

  • SWF -> Compatible YouTube format and retain ActionScript

    - by random
    I have an swf (just a sequence of slides with audio, timing controlled by actionscript) that I want to convert to a compatible YouTube format (flv, mp4, etc.). I've tried using the Moyea SWF4Tube software but when it was converted all of the timing was gone. I'm fine with uploading as a swf, but the problem was (when I tried) that the codecs weren't appropriate. Any help regarding this is much appreciated, thanks.

    Read the article

  • Corsair SSD appears completely blank and does not retain written data

    - by ebanders
    I have a 180GB Corsair SSD (model# CSSD-F180GB2-BRKT) as the primary drive in a Windows laptop. Recently the machine became unbootable after installing Windows updates. Windows installed updates before the machine shut down and the next time the machine boot up it complained about not being able to find a bootable device. After finding fixmbr unsuccessful at making the machine unbootable, I investigated a little within knoppix. Fdisk revealed an empty partition table. A scan by Testdisk came up empty. And finally 'head -c 1024 | hd' reveals all zeros. Creating a primary partition spanning the whole disk completes successfully, but after a reboot the disk appears empty again. dmesg reveals no read or write errors. smartctl indicates that the drive is healthy- although the SMART attribute values do not appear to be read properly. "Data Page | WARNING: PREVIOUS ATTRIBUTE HAS TWO" and "Threshold Page | INCONSISTENT IDENTITIES IN THE DATA" messages appear within the table of values. I don't have much experience with SSDs. Is this drive dead or something? Can anyone recommend any diagnostic tools that may be suited for diagnosing SSDs?

    Read the article

  • Get string value of class propery names in Objective-C

    - by Flash84x
    I have the following class definition. Contact.h #import <CoreData/CoreData.h> @interface Contact : NSManagedObject { } @property (nonatomic, retain) NSString * City; @property (nonatomic, retain) NSDate * LastUpdated; @property (nonatomic, retain) NSString * Country; @property (nonatomic, retain) NSString * Email; @property (nonatomic, retain) NSNumber * Id; @property (nonatomic, retain) NSString * ContactNotes; @property (nonatomic, retain) NSString * State; @property (nonatomic, retain) NSString * StreetAddress2; @property (nonatomic, retain) NSDate * DateCreated; @property (nonatomic, retain) NSString * FirstName; @property (nonatomic, retain) NSString * Phone1; @property (nonatomic, retain) NSString * PostalCode; @property (nonatomic, retain) NSString * Website; @property (nonatomic, retain) NSString * StreetAddress1; @property (nonatomic, retain) NSString * LastName; @end Is it possible to obtain an array of NSString objects with all of the properties by name? Array would look like this... [@"City", @"LastUpdated", @"Country", .... ]

    Read the article

  • Effect of 'myObj = [[[[MyClass alloc] init] autorelease] retain];'?

    - by filipe
    I've just downloaded the Facebook iOS SDK and I noticed that in the sample code that comes with the SDK whenever it creates an instance of the Facebook class it does it like this: _facebook = [[[[Facebook alloc] init] autorelease] retain]; where _facebook is a member variable of the calling object (i.e. not a local variable). Can anyone explain exactly what's the point of autoreleasing and then retaining it?

    Read the article

  • What are the semantics of [myThing.myProperty release]?

    - by dugla
    I clearly have not fully grocked properties. I have an instance of a class, myThing. myThing has a property that has be synthesized: // .h @property(nonatomic,retain)MyCoolType *coolType; // .m @synthesize coolType; In my program I call: // The retain count on MyCoolType is 1. [myThing.coolType release]; The reference count on MyCoolType is now zero and dealloc should fire. So, shouldn't myThing.coolType now be nil? In my code that is not the case. How do a correctly release and force the property to return nil? Thanks, Doug

    Read the article

  • Retain IEnumerable<T> value during postback

    - by ScG
    I have an IEnumerable< T which is declared on the page like this: IEnumerable< Person person; When the page postsback, the person list is null. How can I retain the values of person list without declaring it as static? Sr. devs in my company say that you should not declare the list as static.

    Read the article

  • MS Word paste into tinymce - retain tabulators

    - by jdog
    Hi, I have a 5 year old web application which runs tinymce 2.0.5.1 In this version it is possible - in IE 6,7,8 only to paste from MS Word and retain the tab characters. What we have done is to add a callback: paste_insert_word_content_callback : "findtabs" function findtabs(type, content) { if (type == "before"){ content = content.replace(/( This functionality is important to the client as they have 100s of MS Word documents of quote templates which use tabulators for formatting. Because of another problem suspected to be caused by TinyMCE, we'd like to upgrade to the current TinyMCE version 3.2.7 However in this version the resulting paste code does not contain anything that seems to 100% link to a tabulator. If pasted into an empty textarea, I get something like , if pasted into a I simply a space character. Can anyone recommend how to detect tabulators when pasting from MS Word?

    Read the article

  • Trying to understand NavigationController retain count for ViewControllers on its stack

    - by sharkan
    I have an UITableViewController as the rootViewController for my navigatorController. When I press a table cell I do the following: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MessageHistory *msg = (MessageHistory *)[[self fetchedResultsController]objectAtIndexPath:indexPath]; ConversationViewController *chatController = [[ConversationViewController alloc]initWithNibName:@"ConversationView" bundle:nil andUser:msg.user]; [self.navigationController pushViewController:chatController animated:YES]; [chatController release]; But when I'm returning from the chatController (using the back button on the navbar) I get “EXC_BAD_ACCESS” commenting //[chatController release]; solves the problem. How? I thought when pushing to the navigationController adds a retain count and when pop from it release it? Also I believe if I'm not including the release after pushing to the navcontroller I'm generating a leak. Any idea what's happening here?

    Read the article

  • Retain Delimiters when Splitting String

    - by JoeC
    Edit: OK, I can't read, thanks to Col. Shrapnel for the help. If anyone comes here looking for the same thing to be answered... print_r(preg_split('/([\!|\?|\.|\!\?])/', $string, null, PREG_SPLIT_DELIM_CAPTURE)); Is there any way to split a string on a set of delimiters, and retain the position and character(s) of the delimiter after the split? For example, using delimiters of ! ? . !? turning this: $string = 'Hello. A question? How strange! Maybe even surreal!? Who knows.'; into this array('Hello', '.', 'A question', '?', 'How strange', '!', 'Maybe even surreal', '!?', 'Who knows', '.'); Currently I'm trying to use print_r(preg_split('/([\!|\?|\.|\!\?])/', $string)); to capture the delimiters as a subpattern, but I'm not having much luck.

    Read the article

  • Retain ViewData when editing variable length list

    - by Pieter
    I'm editing variable length lists and use ViewData to pass around information for filling a DropDownList. I use the method described here for editing these lists: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/ The data for this dropdownlist comes from the database. As the ViewData is not available across requests, I currently do a new query to the database each and every time. This also happens when the ModelState is not valid and the form is redisplayed. Of course, this is less then ideal even for a light-weight query as this one. How can I retain the information from that query across requests as long as the user is editing the page with that variable length list?

    Read the article

  • Linq To SQL: Retain list order when using .Contains

    - by rockinthesixstring
    I'm using Lucene.net to build a MyListOfIds As List(Of Integer) which I then pass on to my Linq service. I then search the database as follows Return _EventRepository.Read().Where(Function(e) MyListOfIds.Contains(e.ID)).ToList Now I know that Lucene is already ordering MyListOfIds based on the weight it gave each term. What sucks is that Linq is losing that order in it's SQL search. My Question: How can I retain that sort order when building my Lambda expression? I tried using LINQPad to see how the query is being built, but because I had to declare a variable LINQPad didn't show me the resultant SQL :-( Here's what I tried in LINQPad Dim i As New List(Of Integer) i.Add(1) i.Add(100) i.Add(15) i.Add(3) i.Add(123) Dim r = (From e In Events Where i.Contains(e.ID) Select e) note: my example is in VB.NET, but I don't mind if responses are in C#

    Read the article

  • An NSMutableArray that doesn't retain?

    - by synic
    A few UIViewControllers in my app that need to register with a "provider" class in their viewDidLoad methods. I've just been adding them to an NSMutableArray contained in the provider class. However, I don't want this NSMutableArray to keep them from being dealloc'ed, and I also want to have them remove themselves from the NSMutableArray in their dealloc methods. I tried just issuing a [self release] after adding them to the array, and this works, but in order to avoid a crash when they get dealloc'ed, I have to issue a [self retain] right before I remove them. It seems like I'm doing something horribly wrong by retaining an object in it's own dealloc method. Is there a better way to store these values?

    Read the article

  • How to retain XML string as a string field during XML deserialization

    - by detale
    I got an XML input string and want to deserialize it to an object which partially retain the raw XML. <SetProfile> <sessionId>A81D83BC-09A0-4E32-B440-0000033D7AAD</sessionId> <profileDataXml> <ArrayOfProfileItem> <ProfileItem> <Name>Pulse</Name> <Value>80</Value> </ProfileItem> <ProfileItem> <Name>BloodPresure</Name> <Value>120</Value> </ProfileItem> </ArrayOfProfileItem> </profileDataXml> </SetProfile> The class definition: public class SetProfile { public Guid sessionId; public string profileDataXml; } I hope the deserialization syntax looks like string inputXML = "..."; // the above XML XmlSerializer xs = new XmlSerializer(typeof(SetProfile)); using (TextReader reader = new StringReader(inputXML)) { SetProfile obj = (SetProfile)xs.Deserialize(reader); // use obj .... } but XMLSerializer will throw an exception and won't output < profileDataXml 's descendants to "profileDataXml" field in raw XML string. Is there any way to implement the deserialization like that?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >