Search Results

Search found 300 results on 12 pages for 'instruments'.

Page 11/12 | < Previous Page | 7 8 9 10 11 12  | Next Page >

  • Using CGContextDrawTiledImage at different zooms causes massive memory growth

    - by Jacques
    I'm working on app an where there's a view in a zoomable UIScrollView. When the user zooms in or out, I redraw the view that's in the UIScrollView to be nice and sharp. That view has a background image that I draw with CGContextDrawTiledImage. I noticed that memory usage grows every time I switch to a new zoom level. It looks like CGContextDrawTiledImage keeps a cache somewhere of the image scaled to different sizes. So, If I go from 1.0 to 1.1x zoom, memory use grows. Going back to 1.0 doesn't cause it to grow, but then going to 1.05 and then 1.2 causes it to grow twice. Back to 1.1 and no growth. Of course, the zoom level is under user control so I don't have control over how many zoom levels happen. Right now my background image is kind of massive (512x512), so this causes memory usage to grow very quickly. It doesn't show up as a memory leak in Instruments, just additional allocations that never get freed. I've tried to find a way to free the cache that appears to be being created, but no luck. It doesn't seem to respond to low memory warnings, for example. I also tried setting the view's backgroundColor to a UIColor created with colorWithPatternImage, but that doesn't work because I'm doing the scaling by changing the graphics context's CTM, not by setting the view's transform. Any ideas on how to keep memory usage from blowing up?

    Read the article

  • Surprising IPhone leak

    - by Ethan
    Hey guys, So I'm running instruments on my app, and getting a leak that I could have sworn I was doing right. + (NSMutableArray *)decode:(NSDictionary *)encoded_faculty_array { NSArray *faculty_id_data = [encoded_faculty_array objectForKey:@"faculty_id"]; NSArray *faculty_first_name = [encoded_faculty_array objectForKey:@"first_name"]; NSArray *faculty_last_name = [encoded_faculty_array objectForKey:@"last_name"]; NSMutableArray* faculty_array = [[NSMutableArray alloc] init]; for(int a = 0; a < [faculty_id_data count]; a++) { Faculty *new_fac = [[Faculty alloc] initWithFacultyId:[Dearray clean:[faculty_id_data objectAtIndex:a] withDefault:@"0"] andFirstName:[Dearray clean:[faculty_first_name objectAtIndex:a] withDefault:@"Name not found"] andLastName:[Dearray clean:[faculty_last_name objectAtIndex:a] withDefault:@" "] andBio:nil andDegrees:nil andTitle:nil]; [faculty_array addObject:new_fac]; [new_fac release]; } [faculty_array autorelease]; return faculty_array; } It's reporting a leak on new_fac. I released it immediately after I called it though. Any idea what could be causing that problem? Thanks.

    Read the article

  • Why is this unordered list formatting differently in IE7?

    - by Joel
    I'm better about getting things to look good in IE8, FF, and Safari, but IE7 still throws curve balls at me... Please check out this page and scroll down below the nav bar: http://rattletree.com/instruments.php It should become obvious when viewing in FF vs IE7. For some reason the formatting of the list is pushing the list items down on the page... any tips? <ul class="instrument"> <li class="imagebox"><img src="/images/stuff.jpg" width="247" height="228" alt="Matepe" /></li> <li class="textbox"><h3>Matepe</h3><p>This text should be to the right of the image but drops below the image in IE7</p></li> </ul> css: ul.instrument { text-align:left; display:inline-block; } ul.instrument li { list-style-type: none; display:inline-block; } li.imagebox { display:inline; margin:20px 0; padding:0px; vertical-align:top; } li.imagebox img{ border: solid black 1px; } li.textbox { display:inline; } li.textbox p{ margin:10px; width:340px; display:inline-block; }

    Read the article

  • Memory usage does not drop -- no leaks though

    - by climbon
    I have UINavigationController controlling several views. One of the views is composed of 20 scrollable pages. Each page is a constructed on the fly from UIViews by adding buttons, labels, UIImageViews etc. When this UIView is popped off the stack, the memory usage remains the same. Hence it keeps rising if I keep pushing/popping that view. In my dealloc, I am traversing through all 20 pages and finding each type of object which got added via addSubview and then do a release on it but instruments says my memory usage never goes down! I am trying to use 'retainCount' to see what is up with objects I am releasing but I am perhaps not getting true picture via retainCount. For some elements retainCount shows 2 so I try to release that object twice but then app crashes. If I release it once it works but memory usage never go down :( Q1: Do I need to traverse find each element and then do a release on that element ? Why can't I release a parent object and all objects contained by it would get released automatically ? Q2: Is retainCount a reliable indicator ?

    Read the article

  • iPhone OpenGLES: Textures are consuming too much memory and the program crashes with signal "0"

    - by CustomAppsMan
    I am not sure what the problem is. My app is running fine on the simulator but when I try to run it on the iPhone it crashes during debugging or without debugging with signal "0". I am using the Texture2D.m and OpenGLES2DView.m from the examples provided by Apple. I profiled the app on the iPhone with Instruments using the Memory tracer from the Library and when the app died the final memory consumed was about 60Mb real and 90+Mb virtual. Is there some other problem or is the iPhone just killing the application because it has consumed too much memory? If you need any information please state it and I will try to provide it. I am creating thousands of textures at load time which is why the memory consumption is so high. Really cant do anything about reducing the number of pics being loaded. I was running before on just UIImage but it was giving me really low frame rates. I read on this site that I should use OpenGLES for higher frame rates. Also sub question is there any way not to use UIImage to load the png file and then use the Texture class provided to create the texture for OpenGLES functions to use it for drawing? Is there some function in OpenGLES which will create a texture straight from a png file?

    Read the article

  • Is CDS a valid analogy for pointers? [closed]

    - by Flinkman
    So.. bear with me. I just found an analogy to c++ pointers and CDS. This clip describes CDS(Credit Default Swaps). http://www.youtube.com/watch?v=KPNdYtrlgaU#t=120s "Here we know we have an instrument of a particular financial instrument that is demonstrably dangerous, it creates long chains of risk which are vulnerable to the failure of individual trader or market partipants, in that chain and these instruments in an affect permit the creation of vicious spirals. In which the CDS price interact with the bound price, the market price and you can have a downward spiral." What my ears are telling me: "Don't create dependences that will create long chains of crashing systems." Update: Trying to clarify with something that is closer to the readers. If I change the words: instrument = construct financial = language trader = object market partipants = c structs CDS price = uptime bound price = outcome market price = ROI(return on incestment) The quote become more understandable. Look: "Here we know we have construct of a particular language construct that is demonstrably dangerous, it creates long chains of risk which are vulnerable to the failure of individual object or structs in that chain and these system in an affect permit the creation of vicious spirals. In which the uptime interact with the outcome, the ROI and you can have a downward spiral."

    Read the article

  • Sheet and thread memory problem

    - by Xident
    Hi Guys, recently I started a project which can export some precalculated Grafix/Audio to files, for after processing. All I was doing is to put a new Window (with progressindicator and an Abort Button) in my main xib and opened it using the following code: [NSApp beginSheet: REC_Sheet modalForWindow: MOTHER_WINDOW modalDelegate: self didEndSelector: nil contextInfo: nil]; NSModalSession session=[NSApp beginModalSessionForWindow:REC_Sheet]; RECISNOTDONE=YES; while (RECISNOTDONE) { if ([NSApp runModalSession:session]!=NSRunContinuesResponse) break; usleep(100); } [NSApp endModalSession:session]; A Background Thread (pthread) was started earlier, to actually perform the work and save all the targas/wave file. Which worked great, but after an amount of time, it turned out that the main thread was not responding anymore and my memory footprint raised unstoppable. I tried to debug it with Instruments, and saw a lot of CFHash etc stuff growing to infinity. By accident i clicked below the sheet, and temporary it helped, the main thread (AppKit ?) was releasing it's stuff, but just for a little time. I can't explain it to me, first of all I thought it was the access from my thread to the Progressbar to update the Progress (intervalled at 0,5sec), so I cut it out. But even if I'm not updating anything and did nothing with the Progressbar, my Application eat up all the Memory, because of not releasing it's "Main-Event" or whatsoever Stuff. Is there any possibility to "drain" this Main thread Memory stuff (Runloop / NSApp call?). And why the heck doesn't the Main thread respond anymore (after this simple task) ??? I don't have a clou anymore, please help ! Thanks in advance ! P.S. How do you guys implement "threaded long task" Stuff and updating your gui ???

    Read the article

  • Creating UIButtons

    - by Ralphonzo
    During loadView I am creating 20 UIButtons that I would like to change the title text of depending on the state of a UIPageControl. I have a pre-save plist that is loaded into a NSArray called arrChars on the event of the current page changing, I set the buttons titles to their relevant text title from the array. The code that does this is: for (int i = 1; i < (ButtonsPerPage + 1); i++) { UIButton *uButton = (UIButton *)[self.view viewWithTag:i]; if(iPage == 1) { iArrPos = (i - 1); } else { iArrPos = (iPage * ButtonsPerPage) + (i - 1); } [uButton setAlpha:0]; NSLog(@"Trying: %d of %d", iArrPos, [self.arrChars count]); if (iArrPos >= [self.arrChars count]) { [uButton setTitle: @"" forState: UIControlStateNormal]; } else { NSString *value = [[NSString alloc] initWithFormat:@"%@", [self.arrChars objectAtIndex:iArrPos]]; NSLog(@"%@", value); [uButton setTitle: [[NSString stringWithFormat:@"%@", value] forState: UIControlStateNormal]; [value release]; //////Have tried: //////[uButton setTitle: value forState: UIControlStateNormal]; //////Have also tried: //////[uButton setTitle: [self.arrChars objectAtIndex:iArrPos] forState: UIControlStateNormal]; //////Have also also tried: //////[uButton setTitle: [[self.arrChars objectAtIndex:iArrPos] autorelease] forState: UIControlStateNormal]; } [uButton setAlpha:1]; } When setting the Title of a button it does not appear to be autoreleasing the previous title and the allocation goes up and up. What am I doing wrong? I have been told before that tracking things by allocations is a bad way to chase leaks because as far as I can see, the object is not leaking in Instruments but my total living allocations continue to climb until I get a memory warning. If there is a better way to track there I would love to know.

    Read the article

  • Memory Leaks in pickerView using sqlite

    - by Danamo
    I'm adding self.notes array to a pickerView. This is how I'm setting the array: NSMutableArray *notesArray = [[NSMutableArray alloc] init]; [notesArray addObject:@"-"]; [notesArray addObjectsFromArray:[dbManager getTableValues:@"Notes"]]; self.notes = notesArray; [notesArray release]; The info for the pickerView is taken from the database in this method: -(NSMutableArray *)getTableValues:(NSString *)table { NSMutableArray *valuesArray = [[NSMutableArray alloc] init]; if (sqlite3_open([self.databasePath UTF8String], &database) != SQLITE_OK) { sqlite3_close(database); NSAssert(0, @"Failed to open database"); } else { NSString *query = [[NSString alloc] initWithFormat:@"SELECT value FROM %@", table]; sqlite3_stmt *statement; if (sqlite3_prepare_v2(database, [query UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { NSString *value =[NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)]; [valuesArray addObject:value]; [value release]; } sqlite3_reset(statement); } [query release]; sqlite3_finalize(statement); sqlite3_close(database); } return valuesArray; } But I keep getting memory leaks in Instruments for these lines: NSMutableArray *valuesArray = [[NSMutableArray alloc] init]; and [valuesArray addObject:value]; What am I doing wrong here? Thanks for your help!

    Read the article

  • How to speed up drawing of scaled image? Audio playback chokes during window resize.

    - by Paperflyer
    I am writing an audio player for OSX. One view is a custom view that displays a waveform. The waveform is stored as a instance variable of type NSImage with an NSBitmapImageRep. The view also displays a progress indicator (a thick red line). Therefore, it is updated/redrawn every 30 milliseconds. Since it takes a rather long time to recalculate the image, I do that in a background thread after every window resize and update the displayed image once the new image is ready. In the meantime, the original image is scaled to fit the view like this: // The drawing rectangle is slightly smaller than the view, defined by // the two margins. NSRect drawingRect; drawingRect.origin = NSMakePoint(sideEdgeMarginWidth, topEdgeMarginHeight); drawingRect.size = NSMakeSize([self bounds].size.width-2*sideEdgeMarginWidth, [self bounds].size.height-2*topEdgeMarginHeight); [waveform drawInRect:drawingRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1]; The view makes up the biggest part of the window. During live resize, audio starts choking. Selecting the "big" graphic card on my Macbook Pro makes it less bad, but not by much. CPU utilization is somewhere around 20-40% during live resizes. Instruments suggests that rescaling/redrawing of the image is the problem. Once I stop resizing the window, CPU utilization goes down and audio stops glitching. I already tried to disable image interpolation to speed up the drawing like this: [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; That helps, but audio still chokes during live resizes. Do you have an idea how to improve this? The main thing is to prevent the audio from choking.

    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

  • Adding images to an array memory issue

    - by Friendlydeveloper
    Hello all, I'm currently facing the following issue: My app dynamically creates images (320 x 480 pixels) and adds them to a NSMutableArray. I need those images inside that array in order to allow users to browse through them back and forth. I only need to keep the latest 5 images. So I wrote a method like below: - (void)addImageToArray:(UIImage*)theImage { if ([myMutableArray count] < 5) { [myMutableArray addObject:theImage]; } else { [myMutableArray removeObjectAtIndex:0]; [myMutableArray addObject:theImage]; } } This method basically does what it's supposed to do. However, in instruments I can see, that memory usage is permanently incrementing. At some point, even though I do not have any memory leaks, the app finally crashes. The way I see it, XCode does remove the image from my array, but does not release it. Is there a way I can make sure, that the object I want to remove from my array will also get released? Maybe my approach is completely wrong and I need to find a different way. Any help appreciated. Thanks in advance

    Read the article

  • 2012 Oracle Fusion Innovation Awards - Part 2

    - by Michelle Kimihira
    Author: Moazzam Chaudry Continuing from Friday's blog on 2012 Oracle Fusion Innovation Awards, this blog (Part 2) will provide more details around the customers. It was a tremendous honor to be in single room of winners. We only wish we could have had more time to share stories from all the winners.  We received great insight from all the innovative solutions that our customers deploy and would like to share them broadly, so that others can benefit from best practices. There was a customer panel session joined by Ingersoll Rand, Nike and Motability and here is what was discussed: Barry Bonar, Enterprise Architect from Ingersoll Rand shared details around their solution, comprised of Oracle Exalogic, Oracle WebLogic Server and Oracle SOA Suite. This combined solutoin enabled their business transformation to increase decision-making, speed and efficiency, resulting in 40% reduced IT spend, 41X Faster response time and huge cost savings. Ashok Balakrishnan, Architect from Nike shared how they leveraged Oracle Coherence to analyze their digital "footprint" of activities. This helps them compete, collaborate and compare athletic data over time. Lastly, Ashley Doodly, Head of IT from Motability shared details around their solution compromised of Oracle SOA Suite, Service Bus, ADF, Coherence, BO and E-Business Suite. This solution helped Motability achieve 100% ROI within the first few months, performance in seconds vs. 10's of minutes and tremendous improvement in throughput that increased up to 50%.  This year's winners by category are: Oracle Exalogic Customer Results using Fusion Middleware Netshoes ATG on Exalogic: 6X Reduced H/W foot print, 6.2X increased throughput and 3 weeks time to market Claro Part of America Movil, running mission critical Java Application on Exalogic with 35X Faster Java response time, 5X Throughput Underwriters Laboratories Exalogic as an Apps Consolidation platform to power tremendous growth Ingersoll Rand EBS on Exalogic: Up to 40% Reduction in overall IT budget, 3x reduced foot print Oracle Cloud Application Foundation Customer Results using Fusion Middleware  Mazda Motor Corporation Tuxedo ART Batch runtime environment to migrate their batch apps on new open environment and reduce main frame cost. HOTELBEDS Technology Open Source to WebLogic transformation Globalia Corporation Introduced Oracle Coherence to fully reengineer DTH system and provide multiple business and technical benefits Nike Nike+, digital sports platform, has 8M users and is expecting an 5X increase in users, many of who will carry multiple devices that frequently sync data with the Digital Sport platform Comcast Corporation The solution is expected to increase availability, continuity, performance, and simplify and make the code at the application layer more flexible. Oracle SOA and Oracle BPM Customer Results using Fusion Middleware NTT Docomo Network traffic solution based on Oracle event processing and coherence - massive in scale: 12M users (50M in future) - 800,000 events/sec. Schneider National, Inc. SOA/B2B/ADF/Data Integration to orchestrate key order processes across Siebel, OTM & EBS.  Platform runs 60M trans/day and  50 million composite SOA instances per day across 10G and 11G Amadeus Oracle BPM solution: Business Rules and processes vary across local (80), regional (~10) and corporate approval process. Up to 10 levels of approval. Plans to deploy across 20+ markets Navitar SOA solution integrates a fully non-Oracle legacy application/ERP environment using Oracle’s SOA Suite and Oracle AIA Foundation Pack. Motability Uses SOA Suite to synchronize data across the systems and to manage the vehicle remarketing process Oracle WebCenter Customer Results using Fusion Middleware  News Limited Single platform running websites for 50% of Australia's newspapers University of Louisville “Facebook for Medicine”: Oracle Webcenter platform and Oracle BIEE to analyze patient test data and uncover potential health issues. Expecting annualized ROI of 277% China Mobile Jiangsu Company portal (25k users) to drive collaboration & productivity Life Technologies Portal for remotely monitoring & repairing biotech instruments LA Dept. of Water & Power Oracle WebCenter Portal to power ladwp.com on desktop and mobile for 1.6million users Oracle Identity Management Customer Results using Fusion Middleware Education Testing Service Identity Management platform for provisioning & SSO of 6 million GRE, GMAT, TOEFL customers Avea Oracle Identity Manager allowing call center personnel to quickly change Identity Profile to handle varying call loads based on a user self service interface. Decreased Admin Cost by 30% Oracle Data Integration Customer Results using Fusion Middleware Raymond James Near real-time integration for improved systems (throughput & performance) and enhanced operational flexibility in a 24 X 7 environment Wm Morrison Supermarkets Electronic Point of Sale integration handling over 80 million transactions a day in near real time (15 min intervals) Oracle Application Development Framework and Oracle Fusion Development Customer Results using Fusion Middleware Qualcomm Incorporated Solution providing  immediate business value enabling a self-service model necessary for growing the new customer base, an increase in customer satisfaction, reduced “time-to-deliver” Micros Systems, Inc. ADF, SOA Suite, WebCenter  enables services that include managing distribution of hotel rooms availability and rates to channels such as Hotel Web-site, Expedia, etc. Marfin Egnatia Bank A new web 2.0 UI provides a much richer experience through the ADF solution with the end result being one of boosting end-user productivity    Business Analytics (Oracle BI, Oracle EPM, Oracle Exalytics) Customer Results using Fusion Middleware INC Research Self-service customer portal delivering 5–10% of the overall revenue - expected to grow fast with the BI solution Experian Reduction in Time to Complete the Financial Close Process Hologic Inc Solution, saving months of decision-making uncertainty! We look forward to seeing many more innovative nominations. The nominatation process for 2013 begins in April 2013.    Additional Information: Blog: Oracle WebCenter Award Winners Blog: Oracle Identity Management Winners Blog: Oracle Exalogic Winners Blog: SOA, BPM and Data Integration will be will feature award winners in its respective areas this week Subscribe to our regular Fusion Middleware Newsletter Follow us on Twitter and Facebook

    Read the article

  • With Its MySQL Database-as-a-Service CERN Empowers Scientists

    - by Bertrand Matthelié
    The European Organization for Nuclear Research (CERN) is one of the world’s largest and most respected centers for scientific research. Founded in 1954 and located near Geneva on the Franco-Swiss border, CERN was one of Europe’s first joint ventures. Today, it has 20 member states. The organization uses the world’s largest and most complex scientific instruments to study fundamental particles and the origin of the universe. Normal 0 false false false EN-US X-NONE X-NONE /* 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:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin;} Normal 0 false false false EN-US X-NONE X-NONE /* 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:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin;} Challenges Better support the scientists associated with a CERN research program who selected MySQL as their database. Empower users, enabling them to be as self-reliant as possible. Minimize complexity and costs for the CERN IT department to support the growing number of MySQL deployments. Solution Delivered a MySQL Database-as-a-Service offering to the CERN employees and the scientists associated with the organization. Allowed researchers selecting MySQL for their project to get access to a database instance hosted by the CERN IT department, either from the start or once their application has become critical. Implemented the service using Oracle’s server virtualization software, Oracle VM, for increased flexibility and reduced costs. Empowered users with a self-service approach, providing them with tools to manage MySQL themselves while handling backups and other basic database administration tasks for them. Enabled scientists to rely on MySQL with increased reliability, security and manageability while reducing complexity and minimizing costs. Normal 0 false false false EN-US X-NONE X-NONE /* 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:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin;} "The Cloud model has allowed us to deliver a self-service platform to our MySQL users, empowering them while minimizing costs for CERN." Tony Cass, Database Services Group Leader, IT department, CERN.

    Read the article

  • Problem with memory leaks

    - by user191723
    Sorry, having difficulty formattin code to appear correct here??? I am trying to understand the readings I get from running instruments on my app which are telling me I am leaking memory. There are a number, quite a few in fact, that get reported from inside the Foundation, AVFoundation CoreGraphics etc that I assume I have no control over and so should ignore such as: Malloc 32 bytes: 96 bytes, AVFoundation, prepareToRecordQueue or Malloc 128 bytes: 128 bytes, CoreGraphics, open_handle_to_dylib_path Am I correct in assuming these are something the system will resolve? But then there are leaks that are reported that I believe I am responsible for, such as: This call reports against this line leaks 2.31KB [self createAVAudioRecorder:frameAudioFile]; Immediately followed by this: -(NSError*) createAVAudioRecorder: (NSString *)fileName { // flush recorder to start afresh [audioRecorder release]; audioRecorder = nil; // delete existing file to ensure we have clean start [self deleteFile: fileName]; VariableStore *singleton = [VariableStore sharedInstance]; // get full path to target file to create NSString *destinationString = [singleton.docsPath stringByAppendingPathComponent: fileName]; NSURL *destinationURL = [NSURL fileURLWithPath: destinationString]; // configure the recording settings NSMutableDictionary *recordSettings = [[NSMutableDictionary alloc] initWithCapacity:6]; //****** LEAKING 384 BYTES [recordSettings setObject:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey: AVFormatIDKey]; //***** LEAKING 32 BYTES float sampleRate = 44100.0; [recordSettings setObject:[NSNumber numberWithFloat: sampleRate] forKey: AVSampleRateKey]; //***** LEAKING 48 BYTES [recordSettings setObject:[NSNumber numberWithInt:2] forKey:AVNumberOfChannelsKey]; int bitDepth = 16; [recordSettings setObject: [NSNumber numberWithInt:bitDepth] forKey:AVLinearPCMBitDepthKey]; //***** LEAKING 48 BYTES [recordSettings setObject:[NSNumber numberWithBool:YES] forKey:AVLinearPCMIsBigEndianKey]; [recordSettings setObject:[NSNumber numberWithBool: NO]forKey:AVLinearPCMIsFloatKey]; NSError *recorderSetupError = nil; // create the new recorder with target file audioRecorder = [[AVAudioRecorder alloc] initWithURL: destinationURL settings: recordSettings error: &recorderSetupError]; //***** LEAKING 1.31KB [recordSettings release]; recordSettings = nil; // check for erros if (recorderSetupError) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Can't record" message: [recorderSetupError localizedDescription] delegate: nil cancelButtonTitle: @"OK" otherButtonTitles: nil]; [alert show]; [alert release]; alert = nil; return recorderSetupError; } [audioRecorder prepareToRecord]; //***** LEAKING 512 BYTES audioRecorder.delegate = self; return recorderSetupError; } I do not understand why there is a leak as I release audioRecorder at the start and set to nil and I release recordSettings and set to nil? Can anyone enlighten me please? Thanks

    Read the article

  • Running out of memory with UIImage creation on an offscreen Bitmap Context by NSOperation

    - by sigsegv
    I have an app with multiple UIView subclasses that acts as pages for a UIScrollView. UIViews are moved back and forth to provide a seamless experience to the user. Since the content of the views is rather slow to draw, it's rendered on a single shared CGBitmapContext guarded by locks by NSOperation subclasses - executed one at once in an NSOperationQueue - wrapped up in an UIImage and then used by the main thread to update the content of the views. -(void)main { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init]; if([self isCancelled]) { return; } if(nil == data) { return; } // Buffer is the shared instance of a CG Bitmap Context wrapper class // data is a dictionary CGImageRef img = [buffer imageCreateWithData:data]; UIImage * image = [[UIImage alloc]initWithCGImage:img]; CGImageRelease(img); if([self isCancelled]) { [image release]; return; } NSDictionary * result = [[NSDictionary alloc]initWithObjectsAndKeys:image,@"image",id,@"id",nil]; // target is the instance of the UIView subclass that will use // the image [target performSelectorOnMainThread:@selector(updateContentWithData:) withObject:result waitUntilDone:NO]; [result release]; [image release]; [pool release]; } The updateContentWithData: of the UIView subclass performed on the main thread is just as simple -(void)updateContentWithData:(NSDictionary *)someData { NSDictionary * data = [someData retain]; if([[data valueForKey:@"id"]isEqualToString:[self pendingRequestId]]) { UIImage * image = [data valueForKey:@"image"]; [self setCurrentImage:image]; [self setNeedsDisplay]; } // If the image has not been retained, it should be released together // with the dictionary retaining it [data release]; } The drawLayer:inContext: method of the subclass will just get the CGImage from the UIImage and use it to update the backing layer or part of it. No retain or release is involved in the process. The problem is that after a while I run out of memory. The number of the UIViews is static. CGImageRef and UIImage are created, retained and released correctly (or so it seems to me). Instruments does not show any leaks, just the free memory available dip constantly, rise a few times, and then dip even lower until the application is terminated. The app cycles through about 2-300 of the aforementioned pages before that, but I would expect to have the memory usage reach a more or less stable level of used memory after a bunch of pages have been already skimmed at fast speed or, since the images are up to 3MB in size, deplete way earlier. Any suggestion will be greatly appreciated.

    Read the article

  • iPhone - database reading method and memory leaks

    - by Do8821
    Hi, in my application, a RSS reader, I get memory leaks that I can't fix because I can't understand from where they come from. Here is the code pointed out by Instruments. -(void) readArticlesFromDatabase { [self setDatabaseInfo]; sqlite3 *database; articles = [[NSMutableArray alloc] init]; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { const char *sqlStatement = "select * from articles"; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { while(sqlite3_step(compiledStatement) == SQLITE_ROW) { NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)]; NSString *aDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; NSString *aUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)]; NSString *aCategory = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)]; NSString *aAuthor = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)]; NSString *aSummary = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 6)]; NSMutableString *aContent = [NSMutableString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 7)]; NSString *aNbrComments = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 8)]; NSString *aCommentsLink = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 9)]; NSString *aPermalink = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 11)]; [aContent replaceCharactersInRange: [aContent rangeOfString: @"http://www.mywebsite.com/img/action-on.gif"] withString: @"hellocoton-action-on.gif"]; [aContent replaceCharactersInRange: [aContent rangeOfString: @"hhttp://www.mywebsite.com/img/action-on-h.gif"] withString: @"hellocoton-action-on-h.gif"]; [aContent replaceCharactersInRange: [aContent rangeOfString: @"hthttp://www.mywebsite.com/img/hellocoton.gif"] withString: @"hellocoton-hellocoton.gif"]; NSString *imageURLBrut = [self parseArticleForImages:aContent]; NSString *imageURLCache = [imageURLBrut stringByReplacingOccurrencesOfString:@":" withString:@"_"]; imageURLCache = [imageURLCache stringByReplacingOccurrencesOfString:@"/" withString:@"_"]; imageURLCache = [imageURLCache stringByReplacingOccurrencesOfString:@" " withString:@"_"]; NSString *uniquePath = [tmp stringByAppendingPathComponent: imageURLCache]; if([[NSFileManager defaultManager] fileExistsAtPath: uniquePath]) { imageURLCache = [@"../tmp/" stringByAppendingString: imageURLCache]; [aContent replaceCharactersInRange: [aContent rangeOfString: imageURLBrut ] withString: imageURLCache]; } Article *article = [[Article alloc] initWithName:aName date:aDate url:aUrl category:aCategory author:aAuthor summary:aSummary content:aContent commentsNbr:aNbrComments commentsLink:aCommentsLink commentsRSS:@"" enclosure:aPermalink enclosure2:@"" enclosure3:@""]; [articles addObject:article]; article = nil; [article release]; } } sqlite3_finalize(compiledStatement); } sqlite3_close(database); } ` I have a lot of "Article" leaked and NSString matching with these using : [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, X)]; I tried a lot of different code I always have these leaks. Anyone has got an idea to help me?

    Read the article

  • Gradual memory leak in loop over contents of QTMovie

    - by Benji XVI
    I have a simple foundation tool that exports every frame of a movie as a .tiff file. Here is the relevant code: NSString* movieLoc = [NSString stringWithCString:argv[1]]; QTMovie *sourceMovie = [QTMovie movieWithFile:movieLoc error:nil]; int i=0; while (QTTimeCompare([sourceMovie currentTime], [sourceMovie duration]) != NSOrderedSame) { // save image of movie to disk NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init]; NSString *filePath = [NSString stringWithFormat:@"/somelocation_%d.tiff", i++]; NSData *currentImageData = [[sourceMovie currentFrameImage] TIFFRepresentation]; [currentImageData writeToFile:filePath atomically:NO]; NSLog(@"%@", filePath); [sourceMovie stepForward]; [arp release]; } [pool drain]; return 0; As you can see, in order to prevent very large memory buildups with the various transparently-autoreleased variables in the loop, we create, and flush, an autoreleasepool with every run through the loop. However, over the course of stepping through a movie, the amount of memory used by the program still gradually increases. Instruments is not detecting any memory leaks per se, but the object trace shows certain General Data blocks to be increasing in size. [Edited out reference to slowdown as it doesn't seem to be as much of a problem as I thought.] Edit: let's knock out some parts of the code inside the loop & see what we find out... Test 1 while (banana) { NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init]; NSString *filePath = [NSString stringWithFormat:@"/somelocation_%d.tiff", i++]; NSLog(@"%@", filePath); [sourceMovie stepForward]; [arp release]; } Here we simply loop over the whole movie, creating the filename and logging it. Memory characteristics: remains at 15MB usage for the duration. Test 2 while (banana) { NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init]; NSImage *image = [sourceMovie currentFrameImage]; [sourceMovie stepForward]; [arp release]; } Here we add back in the creation of the NSImage from the current frame. Memory characteristics: gradually increasing memory usage. RSIZE is at 60MB by frame 200; 75MB by f300. Test 3 while (banana) { NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init]; NSImage *image = [sourceMovie currentFrameImage]; NSData *imageData = [image TIFFRepresentation]; [sourceMovie stepForward]; [arp release]; } We've added back in the creation of an NSData object from the NSImage. Memory characteristics: Memory usage is again increasing: 62MB at f200; 75MB at f300. In other words, largely identical. It looks like a memory leak in the underlying system QTMovie uses to do currentFrameImage, to me.

    Read the article

  • GLKit Memory Leak copywithZone

    - by TommyT39
    Running the instruments utility against the game I'm writing shows a bunch of memory leaks related to copy with Zone when I cycle through an array and draw some simple cube objects. Im not sure the best way to track this down as I'm new to OpenGL programming. My program is using ARC and is set to build for IOS 5. I am initializing GLKit to use OPenGl 2.0 and using the BafeEffect so I don't have to write my own shaders etc.. This shouldn't be rocket science. Im guessing that I must be not releasing something within the draw function. Below is the code to my draw function. Could you guys take a look and see if anything stands out as the problem? One other thing to note is that I'm using 15 different textures, the cubes can be 1 of 15 different ones. I have a property set on the cube class for the texture and I set it as I create the cube in there array. But I do load all 15 when my programs view did load starts.They are small .jps files that are less than 75k each and each cube uses the same texture all the way around so shouldn't be too big of an issue. Here is the code to my draw function: - (void)draw { GLKMatrix4 xRotationMatrix = GLKMatrix4MakeXRotation(rotation.x); GLKMatrix4 yRotationMatrix = GLKMatrix4MakeYRotation(rotation.y); GLKMatrix4 zRotationMatrix = GLKMatrix4MakeZRotation(rotation.z); GLKMatrix4 scaleMatrix = GLKMatrix4MakeScale(scale.x, scale.y, scale.z); GLKMatrix4 translateMatrix = GLKMatrix4MakeTranslation(position.x, position.y, position.z); GLKMatrix4 modelMatrix = GLKMatrix4Multiply(translateMatrix,GLKMatrix4Multiply(scaleMatrix,GLKMatrix4Multiply(zRotationMatrix, GLKMatrix4Multiply(yRotationMatrix, xRotationMatrix)))); GLKMatrix4 viewMatrix = GLKMatrix4MakeLookAt(0, 0, 1, 0, 0, -5, 0, 1, 0); effect.transform.modelviewMatrix = GLKMatrix4Multiply(viewMatrix, modelMatrix); effect.transform.projectionMatrix = GLKMatrix4MakePerspective(0.125*M_TAU, 1.0, 2, 0); effect.texture2d0.name = wallTexture.name; [effect prepareToDraw]; glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); glEnableVertexAttribArray(GLKVertexAttribPosition); glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 0, triangleVertices); glEnableVertexAttribArray(GLKVertexAttribTexCoord0); glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinates); glDrawArrays(GL_TRIANGLES, 0, 18); glDisableVertexAttribArray(GLKVertexAttribPosition); glDisableVertexAttribArray(GLKVertexAttribTexCoord0); }

    Read the article

  • Removing duplicate elements with XSLT

    - by user1439459
    I need to eliminate duplicate elements from my XML using a specific node (ItemID) My XML Looks as follows; <XML> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>723073</ItemID> <ColorID>02</ColorID> <Description>Pentel LR7 Energel Metal Tip Refill 0.7mm</Description> <MainCategory>WRITING INSTRUMENTS</MainCategory> <SubCategory>Refill</SubCategory> <LineNum> 1.0000000</LineNum> <Qty> 6.0000000</Qty> <UnitPriceExclTax> 10.0200000</UnitPriceExclTax> <LineTax> 8.4200000</LineTax> <LinePriceExclTax> 60.1200000</LinePriceExclTax> <ColorName>Black</ColorName> <UOM>EA</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637542_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>903420</ItemID> <ColorID /> <Description>STEPHENS JUNIOR Stapler Half Strip KW586</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Staplers</SubCategory> <LineNum> 2.0000000</LineNum> <Qty> 3.0000000</Qty> <UnitPriceExclTax> 32.2500000</UnitPriceExclTax> <LineTax> 13.5400000</LineTax> <LinePriceExclTax> 96.7500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637547_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>867241</ItemID> <ColorID /> <Description>TRODAT PRINTY S/Inking Stamp Copy 4911</Description> <MainCategory>STAMPS DATERS NUMBERERS</MainCategory> <SubCategory>Self Inking Stamps</SubCategory> <LineNum> 3.0000000</LineNum> <Qty> 1.0000000</Qty> <UnitPriceExclTax> 42.1500000</UnitPriceExclTax> <LineTax> 5.9000000</LineTax> <LinePriceExclTax> 42.1500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 1.0000000</Backorder> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>941151</ItemID> <ColorID /> <Description>PENTEL Correction Tape 5mx5mm ZT35</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Correction Fluid/Pens/Tape</SubCategory> <LineNum> 4.0000000</LineNum> <Qty> 2.0000000</Qty> <UnitPriceExclTax> 25.1500000</UnitPriceExclTax> <LineTax> 7.0400000</LineTax> <LinePriceExclTax> 50.3000000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637549_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>801215</ItemID> <ColorID /> <Description>MONDI ROTATRIM Copy Paper A4 80Gsm White</Description> <MainCategory>A4 Paper</MainCategory> <SubCategory>White Bond Paper</SubCategory> <LineNum> 5.0000000</LineNum> <Qty> 100.0000000</Qty> <UnitPriceExclTax> 29.0100000</UnitPriceExclTax> <LineTax> 406.1400000</LineTax> <LinePriceExclTax> 2901.0000000</LinePriceExclTax> <ColorName /> <UOM>Pkt 500</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637552_060</INVENTTRANSID> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 2.0000000</LINENUM> <ITEMID>805236</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>Ruled Paper A4 Fnt/Marg JD76</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637543_060</INVENTTRANSID> <QTYSALES> 4.0000000</QTYSALES> <QTYORDERED> 4.0000000</QTYORDERED> <QTYBACKORDERSALES> 4.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 4.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392608</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 3.0000000</LINENUM> <ITEMID>941150</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>PENGUIN Correction Fluid 20ml White</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637546_060</INVENTTRANSID> <QTYSALES> 6.0000000</QTYSALES> <QTYORDERED> 6.0000000</QTYORDERED> <QTYBACKORDERSALES> 6.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 6.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392609</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 5.0000000</LINENUM> <ITEMID>867241</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>TRODAT PRINTY S/Inking Stamp Copy 4911</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> <QTYSALES> 2.0000000</QTYSALES> <QTYORDERED> 2.0000000</QTYORDERED> <QTYBACKORDERSALES> 1.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 1.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392610</RECID> <RecVersion>1</RecVersion> </Line> </XML> You will see the XML is not identical but the tag is always in the same place, and there is currently 1 duplicate 867241 I do not want the order to change, just the element removed. Desired output would be; <XML> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>723073</ItemID> <ColorID>02</ColorID> <Description>Pentel LR7 Energel Metal Tip Refill 0.7mm</Description> <MainCategory>WRITING INSTRUMENTS</MainCategory> <SubCategory>Refill</SubCategory> <LineNum> 1.0000000</LineNum> <Qty> 6.0000000</Qty> <UnitPriceExclTax> 10.0200000</UnitPriceExclTax> <LineTax> 8.4200000</LineTax> <LinePriceExclTax> 60.1200000</LinePriceExclTax> <ColorName>Black</ColorName> <UOM>EA</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637542_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>903420</ItemID> <ColorID /> <Description>STEPHENS JUNIOR Stapler Half Strip KW586</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Staplers</SubCategory> <LineNum> 2.0000000</LineNum> <Qty> 3.0000000</Qty> <UnitPriceExclTax> 32.2500000</UnitPriceExclTax> <LineTax> 13.5400000</LineTax> <LinePriceExclTax> 96.7500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637547_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>867241</ItemID> <ColorID /> <Description>TRODAT PRINTY S/Inking Stamp Copy 4911</Description> <MainCategory>STAMPS DATERS NUMBERERS</MainCategory> <SubCategory>Self Inking Stamps</SubCategory> <LineNum> 3.0000000</LineNum> <Qty> 1.0000000</Qty> <UnitPriceExclTax> 42.1500000</UnitPriceExclTax> <LineTax> 5.9000000</LineTax> <LinePriceExclTax> 42.1500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 1.0000000</Backorder> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>941151</ItemID> <ColorID /> <Description>PENTEL Correction Tape 5mx5mm ZT35</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Correction Fluid/Pens/Tape</SubCategory> <LineNum> 4.0000000</LineNum> <Qty> 2.0000000</Qty> <UnitPriceExclTax> 25.1500000</UnitPriceExclTax> <LineTax> 7.0400000</LineTax> <LinePriceExclTax> 50.3000000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637549_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>801215</ItemID> <ColorID /> <Description>MONDI ROTATRIM Copy Paper A4 80Gsm White</Description> <MainCategory>A4 Paper</MainCategory> <SubCategory>White Bond Paper</SubCategory> <LineNum> 5.0000000</LineNum> <Qty> 100.0000000</Qty> <UnitPriceExclTax> 29.0100000</UnitPriceExclTax> <LineTax> 406.1400000</LineTax> <LinePriceExclTax> 2901.0000000</LinePriceExclTax> <ColorName /> <UOM>Pkt 500</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637552_060</INVENTTRANSID> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 2.0000000</LINENUM> <ITEMID>805236</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>Ruled Paper A4 Fnt/Marg JD76</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637543_060</INVENTTRANSID> <QTYSALES> 4.0000000</QTYSALES> <QTYORDERED> 4.0000000</QTYORDERED> <QTYBACKORDERSALES> 4.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 4.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392608</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 3.0000000</LINENUM> <ITEMID>941150</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>PENGUIN Correction Fluid 20ml White</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637546_060</INVENTTRANSID> <QTYSALES> 6.0000000</QTYSALES> <QTYORDERED> 6.0000000</QTYORDERED> <QTYBACKORDERSALES> 6.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 6.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392609</RECID> <RecVersion>1</RecVersion> </Line> </XML> I can use XSLT 1 or 2 Regards,

    Read the article

  • Refactoring Singleton Overuse

    - by drharris
    Today I had an epiphany, and it was that I was doing everything wrong. Some history: I inherited a C# application, which was really just a collection of static methods, a completely procedural mess of C# code. I refactored this the best I knew at the time, bringing in lots of post-college OOP knowledge. To make a long story short, many of the entities in code have turned out to be Singletons. Today I realized I needed 3 new classes, which would each follow the same Singleton pattern to match the rest of the software. If I keep tumbling down this slippery slope, eventually every class in my application will be Singleton, which will really be no logically different from the original group of static methods. I need help on rethinking this. I know about Dependency Injection, and that would generally be the strategy to use in breaking the Singleton curse. However, I have a few specific questions related to this refactoring, and all about best practices for doing so. How acceptable is the use of static variables to encapsulate configuration information? I have a brain block on using static, and I think it is due to an early OO class in college where the professor said static was bad. But, should I have to reconfigure the class every time I access it? When accessing hardware, is it ok to leave a static pointer to the addresses and variables needed, or should I continually perform Open() and Close() operations? Right now I have a single method acting as the controller. Specifically, I continually poll several external instruments (via hardware drivers) for data. Should this type of controller be the way to go, or should I spawn separate threads for each instrument at the program's startup? If the latter, how do I make this object oriented? Should I create classes called InstrumentAListener and InstrumentBListener? Or is there some standard way to approach this? Is there a better way to do global configuration? Right now I simply have Configuration.Instance.Foo sprinkled liberally throughout the code. Almost every class uses it, so perhaps keeping it as a Singleton makes sense. Any thoughts? A lot of my classes are things like SerialPortWriter or DataFileWriter, which must sit around waiting for this data to stream in. Since they are active the entire time, how should I arrange these in order to listen for the events generated when data comes in? Any other resources, books, or comments about how to get away from Singletons and other pattern overuse would be helpful.

    Read the article

  • Memory Management iOS dev app doesn't work after a few detail items

    - by user1434846
    I am working on a project with a tableView controller and the detail views contains CMMotionManager.When i open 5 or 6 detailViews all goes well,but after a while the app goes slow and finally crashes.On instruments the only leak is on main.m , also i must say that I'm using ARC and i can't dealloc or realese the instances. Here is the code: First the table view: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.title = @"Movement";//Master View Controller title bar UIImage *image = [UIImage imageNamed:@"jg_navibar.png"]; [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; //Init the array with data bodypartsMutableArray = [NSMutableArray arrayWithCapacity:26]; BodypartData *part1 = [[BodypartData alloc] init]; part1.bodypartname = @"Shoulder"; part1.movementname = @"Flexion"; part1.fullimageStartingPosition=[UIImage imageNamed:@"2_shoulder_flexion_end_position.jpg"]; part1.fullimageEndedPosition=[UIImage imageNamed:@"2_shoulder_flexion_end_position.jpg"]; part1.thumbimage=[UIImage imageNamed:@"1_shoulder_flexion_landmarks_thumb.jpg"]; [bodypartsMutableArray addObject:part1]; ......... } then the cell: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyBasicCell"]; BodypartData *part = [self.bodypartsMutableArray objectAtIndex:indexPath.row]; cell.textLabel.text =[NSString stringWithFormat:part.movementname]; cell.detailTextLabel.text =[NSString stringWithFormat:part.bodypartname]; cell.imageView.image =part.thumbimage; return cell; } and the the detailViewdid load: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // Init motionManager object and set the Update Interval _motionManager = [[CMMotionManager alloc]init]; _motionManager.deviceMotionUpdateInterval=1/60; //60 Hz [_motionManager startGyroUpdates]; if (_motionManager.gyroAvailable) { _motionManager.gyroUpdateInterval = 1.0/60.0; [_motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler: ^(CMDeviceMotion *motion, NSError *error) { CMAttitude *attitude = motion.attitude; //Calculation with rotationMatrix m11 = [NSString stringWithFormat:@"%.02f", attitude.rotationMatrix.m11]; m12 = [NSString stringWithFormat:@"%.02f", attitude.rotationMatrix.m12]; m13 = [NSString stringWithFormat:@"%.02f", attitude.rotationMatrix.m13]; ......... }

    Read the article

  • Unable to fetch Json data from remote url

    - by user3772611
    I am cracking my head to solve this thing. I am unable to fetch the JSON data from remote REST API. I need to fetch the JSOn data nd display the "html_url" field from the JSON data on my website. I saw that you need the below charset and content type for fetching JSON. <html> <head> <meta charset="utf-8"> <meta http-equiv="content-type" content="application/json"> </head> <body> <p>My Instruments page</p> <ul></ul> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript"> $(document).ready(function () { alert("Inside the script"); $.getJSON(" https://pki.zendesk.com/api/v2/help_center/sections/200268985/articles.json", function (obj) { alert("Inside the getJSON"); $.each(obj, function (key, value) { $("ul").append("<li>" + value.html_url + "</li>"); }); }); }); </script> </body> </html> I referred to following example on jsfiddle http://jsfiddle.net/2xTjf/29/ The "http://date.jsontest.com" given in this example also doesn't work in my code. The first alert is pops but not the other one. I am a novice at JSON/ Jquery. i used jsonlint.com to find if it has valid JSON, it came out valid. I tested using chrome REST client too. What am I missing here ? Help me please ! Thanks in anticipation.

    Read the article

  • I can't click the links in Firefox and Chrome (they work in IE7)

    - by janoChen
    Its the weirdest thing I've ever seen. I can't click the last 3 links in the following code (when I use FF or Chrome): HTML: <div id="leftmanulist"> <div class="abouttop"> <ul class="aboutlist"> <li class="index"><a>????</a></li> <li><a href="instruments.html">????</a></li> <li><a href="performance.html">????</a></li> <li><a href="clothes.html">????</a></li> <li><a href="aboutfalundafa.html">??????</a></li> <li><a href="awards.html">????</a></li> </ul> </div> <div class="aboutbutton"></div> </div> CSS: #leftmanulist{ background:url("images/abouttop.gif") no-repeat; float: left; margin: 2px 2px 5px 30px; padding:39px 0 0 0; width:237px;} #leftmanulist ul li{line-height:35px;text-align:left; text-decoration:none;} #leftmanulist ul li a{ text-decoration:none;} #leftmanulist ul li:hover{ color:#0068FF;} #leftmanulist ul li a:hover{ color:#0068FF;} #leftmanulist ul li.index{ color:#0068FF;} #leftmanulist ul li.index a{ color:#0068FF;} .abouttop{background:url("images/leftmanulist_z.gif") repeat-y ; padding:0 6px; position:relative; z-index:0; width:237px;} .aboutlist{position:relative;left:28px;} .aboutbutton{background:url("images/leftmanulist_b.gif") no-repeat; width:237px; height:20px; position:relative; top:-17px; z-index:2;}

    Read the article

  • Only One GPU Detected in the Nvidia Quadra NVS 450

    - by Kyle Brandt
    I just built myself an new workstation and now only 2 of 3 monitors are working. I built the nvidia driver by downloading it and installing with ./Nvidia... Before when I ran nvidia-settings I saw two GPUs listed but now I only see one. Xorg Config (Not sure how I ended up with 3 devices in there): # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 256.35 (buildmeister@builder101) Wed Jun 16 19:25:39 PDT 2010 Section "ServerLayout" # Removed Option "Xinerama" "1" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "DELL E207WFP" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor1" VendorName "Unknown" ModelName "DELL E207WFP" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor2" VendorName "Unknown" ModelName "DELL E207WFP" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro NVS 450" BusID "PCI:6:0:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro NVS 450" BusID "PCI:5:0:0" EndSection Section "Device" Identifier "Device2" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro NVS 450" BusID "PCI:3:0:0" EndSection Section "Screen" # Removed Option "TwinView" "0" # Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+0" # Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+275, DFP-3: nvidia-auto-select +1680+0" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "1" Option "TwinViewXineramaInfoOrder" "DFP-3" Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-3: nvidia-auto-select +1680+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" # Removed Option "metamodes" "DFP-3: nvidia-auto-select +0+0" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen2" Device "Device2" Monitor "Monitor2" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection lscpi: 00:00.0 Host bridge: Intel Corporation 5520/5500/X58 I/O Hub to ESI Port (rev 13) 00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 13) 00:02.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 2 (rev 13) 00:03.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 3 (rev 13) 00:10.0 PIC: Intel Corporation 5520/5500/X58 Physical and Link Layer Registers Port 0 (rev 13) 00:10.1 PIC: Intel Corporation 5520/5500/X58 Routing and Protocol Layer Registers Port 0 (rev 13) 00:11.0 PIC: Intel Corporation 5520/5500 Physical and Link Layer Registers Port 1 (rev 13) 00:11.1 PIC: Intel Corporation 5520/5500 Routing & Protocol Layer Register Port 1 (rev 13) 00:13.0 PIC: Intel Corporation 5520/5500/X58 I/O Hub I/OxAPIC Interrupt Controller (rev 13) 00:14.0 PIC: Intel Corporation 5520/5500/X58 I/O Hub System Management Registers (rev 13) 00:14.1 PIC: Intel Corporation 5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers (rev 13) 00:14.2 PIC: Intel Corporation 5520/5500/X58 I/O Hub Control Status and RAS Registers (rev 13) 00:15.0 PIC: Intel Corporation 5520/5500/X58 Trusted Execution Technology Registers (rev 13) 00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4 00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5 00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6 00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2 00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller 00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1 00:1c.1 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 2 00:1c.3 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 4 00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 5 00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90) 00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller 00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1 00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller 00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2 01:00.0 IDE interface: Device 1b4b:91a3 (rev 11) 02:00.0 USB Controller: NEC Corporation Device 0194 (rev 03) 03:00.0 PCI bridge: nVidia Corporation PCI express bridge for Quadro Plex S4 / Tesla S870 / Tesla S1070 (rev a3) 04:00.0 PCI bridge: nVidia Corporation PCI express bridge for Quadro Plex S4 / Tesla S870 / Tesla S1070 (rev a3) 04:02.0 PCI bridge: nVidia Corporation PCI express bridge for Quadro Plex S4 / Tesla S870 / Tesla S1070 (rev a3) 05:00.0 3D controller: nVidia Corporation G98 [Quadro NVS 450] (rev a1) 06:00.0 VGA compatible controller: nVidia Corporation G98 [Quadro NVS 450] (rev a1) 08:00.0 SATA controller: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 02) 08:00.1 IDE interface: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 02) 09:00.0 SATA controller: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03) 09:00.1 IDE interface: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03) 0a:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) 0b:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

    Read the article

< Previous Page | 7 8 9 10 11 12  | Next Page >