Search Results

Search found 9025 results on 361 pages for 'quad core'.

Page 44/361 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Python threads all executing on a single core

    - by Rob Lourens
    I have a Python program that spawns many threads, runs 4 at a time, and each performs an expensive operation. Pseudocode: for object in list: t = Thread(target=process, args=(object)) # if fewer than 4 threads are currently running, t.start(). Otherwise, add t to queue But when the program is run, Activity Monitor in OS X shows that 1 of the 4 logical cores is at 100% and the others are at nearly 0. Obviously I can't force the OS to do anything but I've never had to pay attention to performance in multi-threaded code like this before so I was wondering if I'm just missing or misunderstanding something. Thanks.

    Read the article

  • iPhone - finding items in current entity that share related item

    - by Pedro
    G'day Folks My core data driven app has an Events entity, essentially a list of times & venues, with a related Acts entity, the names & bios of the acts appearing at those events. I have a table view that shows the event time & venue (as a table section with 1 row), the act name & act bio that works nicely. If that act is appearing at more than one event I'd like to include another table section that lists those events. I think could get that with event.act.events except that it would include the event I'm currently displaying. Can anyone suggest how to get the data I want & exclude the current record? Cheers & TIA, Pedro :) PS... I have not quite 18 hours until the promised time for a prototype of my app to be available for some testers to download.

    Read the article

  • Keeping iPhone application in sync with GWT application.

    - by Reflog
    Hi, I'm working on an iPhone application that should work in offline and online modes. In it's online mode it's supposed to feed all the information the user enters to a webservice backed by GWT/GAE. In it's offline mode it's supposed to store the information locally, and when connection is available sync it up to the web service. Currently my plan is as follows: Provide a connection between an app and a webservice using Protobuffers for efficient over-the-wire communication Work with local DB using Core Data Poll the network status, and when available sync the database and keep some sort of local-db-to-remote-db key synchronization. The question is - am I in the right direction? Are the standard patterns for implementing this? Maybe someone can point me to an open-source application that works in a similar fashion? I am really new to iPhone coding, and would be very glad to hear any suggestions. Thanks

    Read the article

  • multi-core processing in R on windows XP - via doMC and foreach

    - by Jan
    Hi guys, I'm posting this question to ask for advice on how to optimize the use of multiple processors from R on a Windows XP machine. At the moment I'm creating 4 scripts (each script with e.g. for (i in 1:100) and (i in 101:200), etc) which I run in 4 different R sessions at the same time. This seems to use all the available cpu. I however would like to do this a bit more efficient. One solution could be to use the "doMC" and the "foreach" package but this is not possible in R on a Windows machine. e.g. library("foreach") library("strucchange") library("doMC") # would this be possible on a windows machine? registerDoMC(2) # for a computer with two cores (processors) ## Nile data with one breakpoint: the annual flows drop in 1898 ## because the first Ashwan dam was built data("Nile") plot(Nile) ## F statistics indicate one breakpoint fs.nile <- Fstats(Nile ~ 1) plot(fs.nile) breakpoints(fs.nile) # , hpc = "foreach" --> It would be great to test this. lines(breakpoints(fs.nile)) Any solutions or advice? Thanks, Jan

    Read the article

  • Adding ivars to NSManagedObject subclass

    - by The Crazy Chimp
    When I create an entity using core data then generate a subclass of NSManagedObject from it I get the following output (in the .h): @class Foo; @interface Foo : NSManagedObject @property (nonatomic, retain) NSString *name; @property (nonatomic, retain) NSSet *otherValues; @end However, in my .m file I want to make use of the name and otherValues values. Normally I would simply create a couple of ivars and then add the properties for them as I required. That way I can access them in my .m file easily. In this situation would it be acceptable to do this? Would adding ivars to the .h (for name and otherValues) cause any unusual behaviour in the persistance & retrieval of objects?

    Read the article

  • Animate a GIF using Core Animation layers?

    - by Cliff
    I'm trying to animate a GIF and I hit a roadblock. I have an example of what I'm trying to do that uses the individual frames of the GIF and setting the animationImages property of a UIView. However in my project, the thing I want to animate is drawn using Layers. I'm looking for a quick and easy way to animate the frames without introducing too much complexity. Is there any animationImages equivalent with Layers? Does anybody have any ideas?

    Read the article

  • If you are a hard core .NET programmer, would you invest in learning Java

    - by GarbageGuy
    Learning just another language is not much work. However, getting familiar with all the supporting libraries is veeeery expensive and actually you cannot go too far without that. Would you consider a worthy career investment to learn java once you already are an accepted professional of .NET or you would rather invest the same amount of energy to get deeper in the things you already know?

    Read the article

  • Most Efficient Alternative Method of Storing Settings for iPhone Apps

    - by JPK
    I am not using the Settings bundle to store the settings for my app, as I prefer to allow the user to access the settings within the app (they may be changed fairly often). I do realize that there is the option to do both, but for now, I am trying to find the most optimal place to store the settings within the app. I have a good number of settings (from what I have read, probably too many for NSUserDefaults), and the two main options I am considering are: 1) storing the settings in a dictionary in the plist, loading the settings into a NSDictionary property in the app delegate and accessing them via the sharedDelegate 2) storing the settings in a Core Data entity (1 row on Settings entity), loading the settings into a Settings object in the app delegate and accessing them via the sharedDelegate Of these two, which would be the optimal method, performance wise?

    Read the article

  • Why is the CoreData stack in XCode's CoreData enabled template treated as private?

    - by rob5408
    In regards to XCode templates with CoreData enabled, I've read http://stackoverflow.com/questions/2729055/unclear-use-of-property-in-window-app-using-core-data which goes over the 'what' in the templates. But I am having an issue with the 'why'. By declaring the category in the implementation file, the CoreData accessors act like private methods. The problem with that is whenever you want to use CoreData elsewhere in your app, you need some extra code. I've figured you need to either supply your own method that exposes the managed object context, such as... - (NSManagedObjectContext *)getManagedObjectContext { return self.managedObjectContext; } ...which will allow other parts of your app to use it. Or you would need to jam pack your app delegate with specific methods to return managed objects, ie getProducts or setUser. Can anyone shed light on the reasoning here?

    Read the article

  • Core-Plot graph in a UIViewController

    - by Kenneth
    Hi guys, im trying to put a Coreplot graph in a UIView. Some questions, should i do it in XIB? or should i do it programmically ? If so how should i write the codes? etc. I actually have two Classes. one called GraphView which is supposed to hold the Coreplot graph. Another called CorePlotViewController. Thx for looking guys.

    Read the article

  • NSFetchedResultsController not processing certain section driven moves

    - by JK
    I utilize a NSFetchedResultsController (frc) with a Core Data store. I implement all the frc delegate methods. The table is sporadically updated by background threads. All the inserts, deletes and updates work fine, with the exception that updates to the frc's index key for rows toward to the bottom of the table (50 rows), do not result in a section move. e.g. if "name" is the index key and the name "Victor" is changed to "Alex", the victor row now shows the name Alex, but is not moved to the top of the table alongside all other names starting with A. As I noted, this is only for rows towards the bottom of the table. If a row like "Andy" is changed to "Ben", the move is indeed processed correctly by the frc. Any suggestions to fix this would be appreciated. I do not use a frc cache. Thanks

    Read the article

  • Why doesn't the undo/redo panel appear when I start a shake gesture in iPhone Simulator?

    - by dontWatchMyProfile
    I've created an NSUndoManager for the Managed Object Context of Core Data, like this: NSUndoManager *undoManager = [[NSUndoManager alloc] init]; [undoManager setLevelsOfUndo:10]; [managedObjectContext setUndoManager:undoManager]; [undoManager release]; In the app delegate where the didFinishLaunching method is called, I did this: application.applicationSupportsShakeToEdit = YES; For some reason, I never get that undo/redo panel when I make a shake gesture in iPhone Simulator (from the menu). Must I enable undo/redo somewhere else, maybe in the Info.plist file?

    Read the article

  • Sort NSFetchedResultsController results by user location

    - by cgp
    I have an application that contains some Locations in Core Data, and I want to show them to the user in order of proximity to the user's location. I am using an NSFetchedResultsController to serve the locations to the Table View. I thought about creating a virtual accessor method that returns the location's distance from the user, that would be calculated using a "global" CoreLocationManager, but it crashes with reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath distanceFromCurrentLocation not found in entity < NSSQLEntity Location id=4' I also give the user the option to sort alphabetically, so I would prefer it if I kept the NSFetchedResultsController, if possible. How should I do it? Thanks!

    Read the article

  • Core Text CTFrameSetter error with size suggestion

    - by JK
    I am trying to use the CTFramesetterSuggestFrameSizeWithConstraints method of CTFrameSetter to calculate the rect for a given attributed string. However, both the width and height are slightly less than needed. I would appreciate any suggestions on what may be causing this or how to correct it please.

    Read the article

  • data not reloading into tableview from core data on minor update

    - by Martin KS
    I've got a basic photo album application, on the first view a list of albums is displayed with a subtitle showing how many images are in each album. I've got everything working to add albums, and add images to albums. The problem is that the image count lines are accurate whenever the app loads, but I can't get them to update during execution. The following viewdidload correctly populates all lines of the tableview when the app loads: - (void)viewDidLoad { [super viewDidLoad]; // Set the title. self.title = @"Photo albums"; // Configure the add and edit buttons. self.navigationItem.leftBarButtonItem = self.editButtonItem; addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addAlbum)]; addButton.enabled = YES; self.navigationItem.rightBarButtonItem = addButton; /* Fetch existing albums. Create a fetch request; find the Album entity and assign it to the request; add a sort descriptor; then execute the fetch. */ NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Album" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // Order the albums by name. NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"albumName" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptor release]; [sortDescriptors release]; // Execute the fetch -- create a mutable copy of the result. NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. } LocationsAppDelegate *mainDelegate = (LocationsAppDelegate *)[[UIApplication sharedApplication] delegate]; // Set master albums array to the mutable array, then clean up. [mainDelegate setAlbumsArray:mutableFetchResults]; [mutableFetchResults release]; [request release]; } But when I run similar code inside viewdidappear, nothing happens: { /* Fetch existing albums. Create a fetch request; find the Album entity and assign it to the request; add a sort descriptor; then execute the fetch. */ NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Album" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // Order the albums by creation date, most recent first. NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"albumName" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptor release]; [sortDescriptors release]; // Execute the fetch -- create a mutable copy of the result. NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. } LocationsAppDelegate *mainDelegate = (LocationsAppDelegate *)[[UIApplication sharedApplication] delegate]; // Set master albums array to the mutable array, then clean up. [mainDelegate setAlbumsArray:mutableFetchResults]; [self.tableView reloadData]; [mutableFetchResults release]; [request release]; } Apologies if I've missed the answer to this question elsewhere, but what am I missing?

    Read the article

  • Are CMAttitude and CATransform3D related by rotational matrices?

    - by Alex Stone
    I'm looking at the core motion class CMAttitude, it can express the device's orientation as a 3x3 rotational matrix. At the same time I've taken a look at the CATransform3D, which encapsulates the view's attitude, as well as scaling. The CATransform3D is a 4x4 matrix. I've seen that the OpenGL rotational matrix is 4x4 and is simply 0001 padded in the 4th row and column. I'm wandering if the CMAttitude's rotational matrix is related to CATransform's matrix? Can I use the device's rotation in space obtained via a rotational matrix to transform a UIView using CATransform3D? My intention is to let the user move the phone and apply the same transform to a UIView on the screen. Bonus question: if they are related, how do I transform a CMAttitude's rotational matrix to CATransform3D?

    Read the article

  • CoreData could not fulfill a fault when adding new attribute

    - by cagreen
    I am receiving a "CoreData could not fulfill a fault for ..." error message when trying to access a new attribute in a new data model. If I work with new data I'm ok, but when I attempt to read existing data I get the error. Do I need to handle the entity differently myself if the attribute isn't in my original data? I was under the impression that Core Data could handle this for me. My new attribute is marked as optional with a default value. I have created a new .xcdatamodel (and set it to be the current version) and updated my NSPersistentStoreCoordinator initialization to take advantage of the lightweight migration as follows: NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil]; NSError *error = nil; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } Any help is appreciated.

    Read the article

  • I need an IDE for typo3 core development in php

    - by Flugan
    Php in itself is difficult for IDEs because of the dynamic nature of the language. My current development environment is mostly netbeans against a local svn copy of the codebase setup in a local development webserver. The code is full text indexed by vistas search engine for almost instant searches. I do a lot of development directly against the main development server using a combination of tools. Putty to interact with the server and deploy by updating an svn checkout on the development server. Tortoise SVN locally to have a fairly rich SVN experience. Netbeans obviously have SVN integration. Most of the changes on the remote server is commited using the putty session. WinSCP to interact with the development server with norton commander like interface as well as the good putty integration. Finally my text editor for remote editing is notepad++ out of habit and because of some nice features and good price. What I'm really missing is good php editing. Because of the way typo3 works almost all objects are instanciated through make instance abstraction that either returns the base class or the customized class if the framework has been extended. I'm not looking for a magic editing package and would like to find an editor which can use annotations to specify the type of commonly used variables.

    Read the article

  • Ruby core documentation quality

    - by karatedog
    I'm relatively new to Ruby and have limited time therefore I try out simple things. Recently I needed to create a file and because I'm lazy as hell, I run to Google. The result: File.open(local_filename, 'w') {|f| f.write(doc) } Shame on me, it is very straightforward, should have done it myself. Then I wanted to check what ruby magic the File class' methods offer or if there's any 'simplification' when invoking those methods, so I headed for the documentation here, and checked for the File class. 1.8.6 documentation presents me with "ftools.rb: Extra tools for the File class" under 'File' class, which is not what I'm looking for. 1.8.7 documentation seems OK for 'File' class, there are a plethora of methods. Except 'open'. 1.9 documentation finally shows me the 'open' method. And I had an almost same tour with Net::HTTP. Do I exaggerate when I think good old Turbo Pascal's 7.0 documentation was better organized than Ruby documentation is right now? Is there any other source for the uninitiated to collect knowledge? Or is it possible that I just tumbled into a documentation hole and the rest are super-brilliant-five-star organized? Thanks

    Read the article

  • What's the point of having to provide a cacheName for NSFetchedResultsController?

    - by dontWatchMyProfile
    NSFetchedResultsController *frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc sectionNameKeyPath:nil cacheName:@"Root"]; Why do we have to think about a cacheName? How important is this decision? What would happen if there are two NSFetchedResultsController instances using the exact same cacheName? Does that matter? Is that some kind of singleton stuff? Thinking about Core Animation, there's also this strange animationID parameter, but setting it to the exact same thing for dozens of simultaneous animations doesn't hurt the animations at all. So I guess it's probably the same thing here...or not?

    Read the article

  • Cannot commit in sqlite using a wrapper

    - by user271753
    - (IBAction)SetupButtonPressed:(id)sender { Sqlite *sqlite = [[Sqlite alloc] init]; NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@"Money"ofType:@"sqlite"]; if (![sqlite open:writableDBPath]) return; [sqlite executeNonQuery:@"CREATE TABLE test (key TEXT NOT NULL, num INTEGER, value TEXT);"]; } Hey guys the above code runs at first but the next time , the table does not exists in the database ! I am using http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/ what am I doing wrong ? Or could you please suggest me a really simple tutorial for core data ?

    Read the article

  • Does Quartz2D test intersection of rect by line before drawing it.

    - by ddnv
    I'm drawing a big scheme that consist of a lot of lines. I do it in the drawRect: method of UIView. The scheme is larger than the layer of view and I check each line and draw it only if it intersects the visible rect. But at one moment I thought, should I do this? Maybe Quartz is already doing this test? So the question is: When I use function CGContextAddLineToPoint() does the Core Graphics tests this line for intersection with layer rect or it just draw it anyway?

    Read the article

  • IPhone CoreData: How should I relate many child entities to thier parents

    - by Robert
    I am trying to import data from a database that uses primary key / forign key relations to a core data database in Xcode. I have code that creates hundreds of child entities in a managed object context: Each child has an ID that corresponds to a parent. child1 parentID = 3 child2 parentID = 17 child3 parentID = 17 ... childn parentID = 5 I now need to relate each child to its parent. The parents are all stored in persistent memory. My first thought was to preform a fetch for each child to get its parent. However, I think this would be slow. Am I correct? How should I do this instead?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >