Search Results

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

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

  • Working with CPU cycles in Gameboy Advance

    - by Preston Sexton
    I am working on an GBA emulator and stuck at implementing CPU cycles. I just know the basic knowledge about it, each instruction of ARM and THUMB mode as each different set of cycles for each instructions. Currently I am simply saying every ARM instructions cost 4 cycles and THUMB instructions cost 2 cycles. But how do you implement it like the CPU documentation says? Does instruction cycles vary depending on which section of the memory it's currently accessing to? http://nocash.emubase.de/gbatek.htm#cpuinstructioncycletimes According to the above specification, it says different memory areas have different waitstates but I don't know what it exactly mean. Furthermore, what are Non-sequential cycle, Sequential cycle, Internal Cycle, Coprocessor Cycle for? I saw in some GBA source code that they are using PC to figure out how many cycles each instruction takes to complete, but how are they doing it?

    Read the article

  • Approximate Number of CPU Cycles for Various Operations

    - by colordot
    I am trying to find a reference for approximately how many CPU cycles various operations require. I don't need exact numbers (as this is going to vary between CPUs) but I'd like something relatively credible that gives ballpark figures that I could cite in discussion with friends. As an example, we all know that floating point division takes more CPU cycles than say doing a bitshift. I'd guess that the difference is that the division is around 100 cycles, where as a shift is 1 but I'm looking for something to cite to back that up. Can anyone recommend such a resource?

    Read the article

  • mips number of clock cycles and how improving code

    - by Hooman
    I'm really new in MIPS and I have these questions which I found so many dissimil answers for them ... if someone can help, it would be great. Thanks How many clock cycles does this code take? #Macro Instructions li $t0, 32 # 1 or 2 cycles ? # lui $at, Upper 16-bits of value # ori Rd, $at, Lower 16-bits of value # ----------------------------------- # ori Rt, $0, value # # Which set of instructions will be executed? div $t2, $t2, $t0 # 41 cycles? # bne Rt, $0, # break $0 # ok: div Rs, Rt # mflo Rd #Integer Instruction lw $t2, 0($t13) # 1 cycles? sw $t2, 0($t3) # 1 cycles? How those 4 lines of codes can be significantly improved? by avoiding to use Macros or ... ?

    Read the article

  • Retain Count Question: Some Guidance, Please

    - by yar
    [I'm sure this is not odd at all, but I need just a bit of help] I have two retain properties @property (nonatomic, retain) NSArray *listContent; @property (nonatomic, retain) NSArray *filteredListContent; and in the viewDidLoad method I set the second equal to the first (so now the retainCount is two, I think): self.filteredListContent = self.listContent; and then on every search I do this self.filteredListContent = [listContent filteredArrayUsingPredicate:predicate]; I thought I should do a release right above this assignment -- since the property should cause an extra retain, right? -- but that causes the program to explode the second time I run the search method. The retain counts (without the extra release) are 2 the first time I come into the search method, and 1 each subsequent time (which is what I expected, unfortunately). Some guidance would help, thanks! Is it correct to not release?

    Read the article

  • objective-c 2.0 properties and 'retain'

    - by Adam
    Stupid question, but why do we need to use 'retain' when declaring a property? Doesn't it get retained anyway when it's assigned something? Looking at this example, it seems that an object is automatically retained when alloc'ed, so what's the point? #import "Fraction.h" #import <stdio.h> int main( int argc, const char *argv[] ) { Fraction *frac1 = [[Fraction alloc] init]; Fraction *frac2 = [[Fraction alloc] init]; // print current counts printf( "Fraction 1 retain count: %i\n", [frac1 retainCount] ); printf( "Fraction 2 retain count: %i\n", [frac2 retainCount] ); // increment them [frac1 retain]; // 2 [frac1 retain]; // 3 [frac2 retain]; // 2 // print current counts printf( "Fraction 1 retain count: %i\n", [frac1 retainCount] ); printf( "Fraction 2 retain count: %i\n", [frac2 retainCount] ); // decrement [frac1 release]; // 2 [frac2 release]; // 1 // print current counts printf( "Fraction 1 retain count: %i\n", [frac1 retainCount] ); printf( "Fraction 2 retain count: %i\n", [frac2 retainCount] ); // release them until they dealloc themselves [frac1 release]; // 1 [frac1 release]; // 0 [frac2 release]; // 0 ¦output Fraction 1 retain count: 1 Fraction 2 retain count: 1 Fraction 1 retain count: 3 Fraction 2 retain count: 2 Fraction 1 retain count: 2 Fraction 2 retain count: 1 Deallocing fraction Deallocing fraction This is driving me crazy!

    Read the article

  • objective C NSString retain

    - by Amarsh
    If I create a String with [NSString StringWithFormat], do I have to [retain] it? My understanding is that convenience methods add the objects to autorelease pool. If that is the case, shouldnt we retain the object so that it doesnt get drained with pool at the end of the event loop?

    Read the article

  • when i set property(retain), one "self" = one "retain"?

    - by Walter
    although I'm about to finish my first app, I'm still confused about the very basic memory management..I've read through many posts here and apple document, but I'm still puzzled.. For example..I'm currently doing things like this to add a label programmatically: @property (retain, nonatomic) UILabel *showTime; @sythesize showTime; showTime = [[UILabel alloc] initWithFrame:CGRectMake(45, 4, 200, 36)]; [self.showTime setText:[NSString stringWithFormat:@"%d", time]]; [self.showTime setFont:[UIFont fontWithName:@"HelveticaRoundedLT-Bold" size:23]]; [self.showTime setTextColor:numColor]; self.showTime.backgroundColor = [UIColor clearColor]; [self addSubview:self.showTime]; [showTime release]; this is my current practice, for UILabel, UIButton, UIImageView, etc... [Alloc init] it without self., coz I know this will retain twice.. but after the allocation, I put back the "self." to set the attributes.. My gut feel tells me I am doing wrong, but it works superficially and I found no memory leak in analyze and instruments.. can anyone give my advice? when I use "self." to set text and set background color, does it retain one automatically? THX so much!

    Read the article

  • Release a retain UIImage property loaded via imageNamed?

    - by user158103
    In my class object i've defined a (nonatomic, retain) property for UIImage. I assigned this property with an image loaded via [UIImage imageNamed:@"file.png"]; If at some point I want to reassign this property to another image, should I have to release the prior reference? I am confused because by the retain property I know i should release it. But because imageNamed is a convenience method (does not use alloc), im not sure what rule to apply here. Thanks for the insight!

    Read the article

  • Retain, reuse, release?

    - by Typeoneerror
    I've got a series of buttons that each use a different image. Can I reuse a retained variable like this below: // set images UIImage *image = [[dice1 backgroundImageForState:UIControlStateHighlighted] retain]; [dice1 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; image = [dice2 backgroundImageForState:UIControlStateHighlighted]; [dice2 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; image = [dice3 backgroundImageForState:UIControlStateHighlighted]; [dice3 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; image = [dice4 backgroundImageForState:UIControlStateHighlighted]; [dice4 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; image = [dice5 backgroundImageForState:UIControlStateHighlighted]; [dice5 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; image = [dice6 backgroundImageForState:UIControlStateHighlighted]; [dice6 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; [image release]; or do I need to create a new UIImage for each image passed to each button's setBackgroundImage: like so: // set images UIImage *image1 = [dice1 backgroundImageForState:UIControlStateHighlighted]; [dice1 setBackgroundImage:image1 forState:(UIControlStateHighlighted|UIControlStateSelected)]; UIImage *image2 = [dice2 backgroundImageForState:UIControlStateHighlighted]; [dice2 setBackgroundImage:image forState:(UIControlStateHighlighted|UIControlStateSelected)]; and rely on autorelease rather than a retained UIImage. I'm not sure if assigning the image to a different UIImage would effect the retain count.

    Read the article

  • Retain information in cocoa?

    - by happyCoding25
    Hello, I'm still new to cocoa and don't know much about memory management. I read up on apples documentation but I'm still confused. My question is if I set the value of a variable in a - (void)dowhatever when the void ends, will the contents of the variable be erased? If so is there a method (without writing to a file) that I can use to retain the variable contents? Thanks for any help

    Read the article

  • Objective-C retain counts clarification

    - by Tom
    Hey, I kind of understand what's retain counts for. But not totally. I looked on google a lot to try to understand but still I don't. And now I'm in a bit of code (I'm doing iPhone development) that I think I should use them but don't know totally how. Could someone give me a quick and good example of how and why using them? Thanks!

    Read the article

  • retain drop down value page posting back to itself asp.net

    - by d3020
    I have an aspx page that has... if (!IsPostBack) { PopulateBrand(); in the Page_Load. This PopulateBrand() simply populates my drop down. That works great and on post back it retains the value. The problem I'm having is that there is also a link on the page that is posting back some parameters to this page. What is happening is that when this is clicked it's falling through this !IsPostBack section and wiping out my drop down values that I had selected and repopulating it. How can I prevent this and just retain what I selected when this page is posting back to itself when the link is clicked? Thanks.

    Read the article

  • Retain cycle on `self` with blocks

    - by Jonathan Sterling
    I'm afraid this question is pretty basic, but I think it's relevant to a lot of Objective-C programmers who are getting into blocks. What I've heard is that since blocks capture local variables referenced within them as const copies, using self within a block can result in a retain cycle, should that block be copied. So, we are supposed to use __block to force the block to deal directly with self instead of having it copied. __block typeof(self) bself = self; [someObject messageWithBlock:^{ [bself doSomething]; }]; instead of just [someObject messageWithBlock:^{ [self doSomething]; }]; What I'd like to know is the following: if this is true, is there a way that I can avoid the ugliness (aside from using GC)?

    Read the article

  • array retain question

    - by Cosizzle
    Hello, im fairly new to objective-c, most of it is clear however when it comes to memory managment I fall a little short. Currently what my application does is during a NSURLConnection when the method -(void)connectionDidFinishLoading:(NSURLConnection *)connection is called upon I enter a method to parse some data, put it into an array, and return that array. However I'm not sure if this is the best way to do so since I don't release the array from memory within the custom method (method1, see the attached code) Below is a small script to better show what im doing .h file #import <UIKit/UIKit.h> @interface memoryRetainTestViewController : UIViewController { NSArray *mainArray; } @property (nonatomic, retain) NSArray *mainArray; @end .m file #import "memoryRetainTestViewController.h" @implementation memoryRetainTestViewController @synthesize mainArray; // this would be the parsing method -(NSArray*)method1 { // ???: by not release this, is that bad. Or does it get released with mainArray NSArray *newArray = [[NSArray alloc] init]; newArray = [NSArray arrayWithObjects:@"apple",@"orange", @"grapes", "peach", nil]; return newArray; } // this method is actually // -(void)connectionDidFinishLoading:(NSURLConnection *)connection -(void)method2 { mainArray = [self method1]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { mainArray = nil; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [mainArray release]; [super dealloc]; } @end

    Read the article

  • PHP - Best practice to retain form values across postback

    - by Adam
    Hello, Complete PHP novice here, almost all my previous work was in ASP.NET. I am now working on a PHP project, and the first rock I have stumbled upon is retaining values across postback. For the most simple yet still realistic example, i have 10 dropdowns. They are not even databound yet, as that is my next step. They are simple dropdowns. I have my entire page inclosed in a tag. the onclick() event for each dropdown, calls a javascript function that will populate the corrosponding dropdowns hidden element, with the dropdowns selected value. Then, upon page reload, if that hidden value is not empty, i set the selected option = that of my hidden. This works great for a single postback. However, when another dropdown is changed, the original 1'st dropdown loses its value, due to its corrosponding hidden value losing its value as well! This draws me to look into using querystring, or sessions, or... some other idea. Could someone point me in the right direction, as to which option is the best in my situation? I am a PHP novice, however I am being required to do some pretty intense stuff for my skill level, so I need something flexable and preferribly somewhat easy to use. Thanks! -----edit----- A little more clarification on my question :) When i say 'PostBack' I am referring to the page/form being submitted. The control is passed back to the server, and the HTML/PHP code is executed again. As for the dropdowns & hiddens, the reason I used hidden variables to retain the "selected value" or "selected index", is so that when the page is submitted, I am able to redraw the dropdown with the previous selection, instead of defaulting back to the first index. When I use the $_POST[] command, I am unable to retrieve the dropdown by name, but I am able to retrieve the hidden value by name. This is why upon dropdown-changed event, I call javascript which sets the selected value from the dropdown into its corrosponding hidden.

    Read the article

  • Objective-C retain clarification

    - by Maverick
    I'm looking at this code: NSMutableArray *controllers = [[NSMutableArray alloc] init]; for (unsigned i = 0; i < kNumberOfPages; i++) { [controllers addObject:[NSNull null]]; } self.viewControllers = controllers; [controllers release]; Later on... - (void)dealloc { [viewControllers release]; ... } I see that self.viewControllers and controllers now point to the same allocated memory (of type NSMutableArray *), but when I call [controllers release] isn't self.viewControllers released as well, or is setting self.viewControllers = controllers automatically retains that memory?

    Read the article

  • User login cycles

    - by Doug Brown
    Just install 12.04-64bit and while I can login using the guest login, I cannot with my user login: it just cycles back to the login screen. I have performed the sequence of apt-get update/upgrade and install of the nvidia-current driver, but got back that it was already in use. The password appears to be recognized, as wrong one results in an error. Have also tried switching to the 2D Unity, without other results.

    Read the article

  • Increase productivity, accelerate work-to-cash cycles, and reduce overall firm and client risk with

    Law firms around the world are faced with increasing pressures to do business faster and more efficiently. Learn how firms can automate manual, paper-driven processes, ensure regulatory compliance, integrate systems and offices brought together by mergers and acquisitions, and take on new business quickly and efficiently. Understand how firms can automate manual tasks with Oracle's Whitehill One; get invoices out the door faster with Whitehill Enterprise; and can go green with Whitehill Pre-Bill. In this session, you will hear about Oracle's new legal services offerings that accelerate work-to-cash cycles, increase productivity, and reduce overall firm and client risk.

    Read the article

  • iphone memory management: alloc and retain properties.

    - by Jonathan
    According to the docs, you do one release per alloc or retain (etc) However what about when using retain propertys? eg: HEADER @property(retain)UIView *someView; IMPLEMENTATION /*in some method*/ UIView *tempView = [[UIView alloc] init]; //<<<<<ALLOC - retain count = +1 [tempView setBackgroundColor:[UIColor redColor]]; self.someView = tempView; ///<<<<<RETAIN - retain count = +2 [tempView release]; ///should I do this? or a different version of the IMPLEMENTATION self.someView = [[UIView alloc] init]; //<<<<<ALLOC & RETAIN - retain count = +2 //now what??? [self.someView release]; ???? EDIT: I didn't make it clear, but I meant what to do in both circumstances, not just the first.

    Read the article

  • Retain count = 0 in other function? memory-management problem?

    - by rdesign
    Hey guys, I declared a NSMutableArray in the header-file with: NSMutableArray *myMuArr; and @property (nonatomic, retain) NSMutableArray *myMuArr; In the .m file I've got a delegate from an other class: -(void)didGrabData:(NSArray*)theArray { self.myMuArr = [[[NSMutableArray alloc] initWithArray:myMuArr]retain]; } If I want to access the self.myMuArr in cellForRowAtIndexPath it's empty (I checked the retain count of the array and it's 0) What am I doing wrong? Of course it's released in the dealloc, no where else. I would be very thankfull for any help :0)

    Read the article

  • Rackspace Cloud Sites: Compute Cycles exploding. Very expensive

    - by Jaap
    Since last week my compute cycles (CC) went through the roof (Rackspace Cloud Sites). Normally I stay under the 10,000 cycles per month . Now this month I already have more than 75,000 compute cycles. I don't have more visitors and I did not change anything in the code. I looked in the raw log files, that didn't help either... This explosion of CC already costs me more than 750 USD right now. And still counting. Anyone know what to do? I have contacted Rackspace last week. But still no solution/answer.... Looks like Rackspace is liking the money! Help! Thanks.

    Read the article

  • Algorithm to Group All the Cycles Together

    - by Ngu Soon Hui
    I have a lot of cycles ( indicated by numeric values, for example, 1-2-3-4 corresponds to a cycle, with 4 edges, edge 1 is {1:2}, edge 2 is {2:3}, edge 3 is {3,4}, edge 4 is {4,1}, and so on). A cycle is said to be connected to another cycle if they share one and only one edge. For example, let's say I have two cycles 1-2-3-4 and 5-6-7-8, then there are two cycle groups because these two cycles are not connecting to each other. If I have two cycles 1-2-3-4 and 3-4-5-6, then I have only one cycle group because these two cycles share the same edge. What is the most efficient way to find all the cycle groups?

    Read the article

  • Cycles through black screen on login after changing password

    - by John L
    On my laptop, I forgot the password to my Ubuntu partition, so I logged into the root command shell on the recovery start up option in GRUB so that I could change the password. On my first attempt to change my user password, I got this error: root@username-PC:~# passwd username (*not my actual user name*) Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchanged After doing some research, I discovered that I was stuck as read only on the file system, so I ran the following command to remount the file partition as read/write: mount -rw -o remount / Afterwards, I change my user password using passwd and it was changed successfully. I restarted my laptop and tried to login using the new password but the only thing that happened was after entering my password it flashed to a black screen with some text that I couldn't make out except for "Ubuntu 12.04" then another black screen half a second later, and finally back to the login screen. Repeated attempts to login results in only this action.

    Read the article

  • I need advice on creating animal 3D walk cycles in XNA

    - by Zetar
    I want to purchase a number of 3D models from TurboSquid and animate them in an XNA game. I wrote a lot of games from 1985-1999 and have recently become involved with XNA. Now I would like to port one of my old games to the XBOX. I do have a background in 3D animation; but that was years ago. What is the current method for animating a walk cycle with a 3D model and using it inside XNA? Is there a book, software or a tutorial that you can recommend? Thanks in advance and sorry for such a broad and currently naive question.

    Read the article

  • I need advice on creating 3D walk cycles in XNA

    - by Zetar
    I want to purchase a number of 3D models from TurboSquid and animate them in an XNA game. I wrote a lot of games from 1985-1999 and have recently become involved with XNA. Now I would like to port one of my old games to the XBOX. I do have a background in 3D animation; but that was years ago. What is the current method for animating a walk cycle with a 3D model and using it inside XNA? Is there a book, software or a tutorial that you can recommend? Thanks in advance and sorry for such a broad and currently naive question.

    Read the article

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