Search Results

Search found 3168 results on 127 pages for 'grand central dispatch'.

Page 8/127 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How do I specify the block object / predicate required by NSDictionary's keysOfEntriesPassingTest ?

    - by Todd
    For learning (not practical -- yet) purposes, I'd like to use the following method on an NSDictionary to give me back a set of keys that have values using a test I've defined. Unfortunately have no idea how to specify the predicate. NSDictionary keysOfEntriesPassingTest: - (NSSet *)keysOfEntriesPassingTest:(BOOL (^)(id key, id obj, BOOL *stop))predicate Let's say for example all my values are NSURLs, and I'd like to get back all the URLs that are on port 8080. Here's my stab at coding that -- though it doesn't really make sense to me that it'd be correct: NSSet * mySet = [myDict keysOfEntriesPassingTest:^(id key, id obj, BOOL *stop) { if( [[obj port] isEqual: [NSNumber numberWithInt: 8080]]) { return key; }] And that's because I get back the following compiler error: incompatible block pointer types initializing 'void (^)(struct objc_object *, struct objc_object *, BOOL *)', expected 'BOOL (^)(struct objc_object *, struct objc_object *, BOOL *)' What am I missing? I'd appreciate a pointer at some docs that go into more detail about the "Block object" that the predicate is supposed to be. Thanks!

    Read the article

  • iPhone: Using dispatch_after to mimick NSTimer

    - by Joseph Tura
    Don't know a whole lot about blocks. How would you go about mimicking a repeating NSTimer with dispatch_after? My problem is that I want to "pause" a timer when the app moves to the background, but subclassing NSTimer does not seem to work. I tried something which seems to work. I cannot judge its performance implications or whether it could be greatly optimized. Any input is welcome. #import "TimerWithPause.h" @implementation TimerWithPause @synthesize timeInterval; @synthesize userInfo; @synthesize invalid; @synthesize invocation; + (TimerWithPause *)scheduledTimerWithTimeInterval:(NSTimeInterval)aTimeInterval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)aUserInfo repeats:(BOOL)aTimerRepeats { TimerWithPause *timer = [[[TimerWithPause alloc] init] autorelease]; timer.timeInterval = aTimeInterval; NSMethodSignature *signature = [[aTarget class] instanceMethodSignatureForSelector:aSelector]; NSInvocation *aInvocation = [NSInvocation invocationWithMethodSignature:signature]; [aInvocation setSelector:aSelector]; [aInvocation setTarget:aTarget]; [aInvocation setArgument:&timer atIndex:2]; timer.invocation = aInvocation; timer.userInfo = aUserInfo; if (!aTimerRepeats) { timer.invalid = YES; } [timer fireAfterDelay]; return timer; } - (void)fireAfterDelay { dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, self.timeInterval * NSEC_PER_SEC); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_after(delay, queue, ^{ [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; if (!invalid) { [self fireAfterDelay]; } }); } - (void)invalidate { invalid = YES; [invocation release]; invocation = nil; [userInfo release]; userInfo = nil; } - (void)dealloc { [self invalidate]; [super dealloc]; } @end

    Read the article

  • converting NSTimer running not on main runloop to GCD

    - by Justin Galzic
    I have a task that runs periodically and it was originally designed to run on a separate run loop than the main runloop using NSThread and NSTimer. What's the best way to adapt this to take advantage of GCD? Current code: -(void)initiateSomeTask { [NSThread detachNewThreadSelector:@selector(startTimerTask) toTarget:self withObject:nil]; } -(void)startTimerTask { // We won't get back the main runloop since we're on a new thread NSRunLoop *myRunLoop = [NSRunLoop currentRunLoop]; NSPort *myPort = [NSMachPort port]; [myRunLoop addPort:myPort forMode:NSDefaultRunLoopMode]; NSTimer *myTimer = [NSTimer timerWithTimeInterval:10 /* seconds */ target:self selector:@selector(doMyTaskMethod) userInfo:nil repeats:YES]; [myRunLoop addTimer:myTimer forMode:NSRunLoopCommonModes]; [myRunLoop run]; } Is there anything I can do besides replace detachNewThreadSelector with dispatch_async?

    Read the article

  • Updating UISearchDisplayController with Core Data results using GCD

    - by Brian Halpin
    I'm having trouble displaying the results from Core Data in my UISearchDisplayController when I implement GCD. Without it, it works, but obviously blocks the UI. In my SearchTableViewController I have the following two methods: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { // Tell the table data source to reload when text changes [self filterContentForSearchText:searchString]; // Return YES to cause the search result table view to be reloaded. return YES; } // Update the filtered array based on the search text -(void)filterContentForSearchText:(NSString*)searchText { // Remove all objects from the filtered search array [self.filteredLocationsArray removeAllObjects]; NSPredicate *predicate = [CoreDataMaster predicateForLocationUsingSearchText:@"Limerick"]; CoreDataMaster *coreDataMaster = [[CoreDataMaster alloc] init]; // Filter the array using NSPredicate self.filteredLocationsArray = [NSMutableArray arrayWithArray: [coreDataMaster fetchResultsFromCoreDataEntity:@"City" UsingPredicate:predicate]]; } You can probably guess that my problem is with returning the array from [coreDataMaster fetchResultsFromCoreDataEntity]. Below is the method: - (NSArray *)fetchResultsFromCoreDataEntity:(NSString *)entity UsingPredicate:(NSPredicate *)predicate { NSMutableArray *fetchedResults = [[NSMutableArray alloc] init]; dispatch_queue_t coreDataQueue = dispatch_queue_create("com.coredata.queue", DISPATCH_QUEUE_SERIAL); dispatch_async(coreDataQueue, ^{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:entity inManagedObjectContext:self.managedObjectContext]; NSSortDescriptor *nameSort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObjects:nameSort, nil]; [fetchRequest setEntity:entityDescription]; [fetchRequest setSortDescriptors:sortDescriptors]; // Check if predicate is set if (predicate) { [fetchRequest setPredicate:predicate]; } NSError *error = nil; NSArray *fetchedManagedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; for (City *city in fetchedManagedObjects) { [fetchedResults addObject:city]; } NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:fetchedResults] forKey:@"results"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"fetchResultsComplete" object:nil userInfo:userInfo]; }); return [NSArray arrayWithArray:fetchedResults]; } So the thread hasn't finished executing by the time it returns the results to self.filteredLocationsArray. I've tried added a NSNotification which passes the NSDictionary to this method: - (void)updateSearchResults:(NSNotification *)notification { NSDictionary *userInfo = notification.userInfo; NSArray *array = [userInfo objectForKey:@"results"]; self.filteredLocationsArray = [NSMutableArray arrayWithArray:array]; [self.tableView reloadData]; } I've also tried refreshing the searchViewController like [self.searchDisplayController.searchResultsTableView reloadData]; but to no avail. I'd really appreciate it if someone could point me in the right direction and show me where I might be going wrong. Thanks

    Read the article

  • Issue with GCD and too many threads

    - by dariaa
    I have an image loader class which provided with NSURL loads and image from the web and executes completion block. Code is actually quite simple - (void)downloadImageWithURL:(NSString *)URLString completion:(BELoadImageCompletionBlock)completion { dispatch_async(_queue, ^{ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ UIImage *image = nil; NSURL *URL = [NSURL URLWithString:URLString]; if (URL) { image = [UIImage imageWithData:[NSData dataWithContentsOfURL:URL]]; } dispatch_async(dispatch_get_main_queue(), ^{ completion(image, URLString); }); }); } When I replace dispatch_async(_queue, ^{ with commented out dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ Images are loading much faster, wich is quite logical (before that images would be loaded one at a time, now a bunch of them are loading simultaneously). My issue is that I have perhaps 50 images and I call downloadImageWithURL:completion: method for all of them and when I use global queue instead of _queue my app eventually crashes and I see there are 85+ threads. Can the problem be that my calling dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) 50 times in a row makes GCD create too many threads? I thought that gcd handles all the treading and makes sure the number of threads is not huge, but if it's not the case is there any way I can influence number of threads?

    Read the article

  • What is an effective git process for managing our central code library?

    - by Mathew Byrne
    Quick background: we're a small web agency (3-6 developers at any one time) developing small to medium sized Symfony 1.4 sites. We've used git for a year now, but most of our developers have preferred Subversion and aren't used to a distributed model. For the past 6 months we've put a lot of development time into a central Symfony plugin that powers our custom CMS. This plugin includes a number of features, helpers, base classes etc. that we use to build custom functionality. This plugin is stored in git, but branches wildly as the plugin is used in various products and is pulled from/pushed to constantly. The repository is usually used as a submodule within a major project. The problems we're starting to see now are a large number of Merge conflicts and backwards incompatible changes brought into the repository by developers adding custom functionality in the context of their own project. I've read Vincent Driessen's excellent git branching model and successfully used it for projects in the past, but it doesn't seem to quite apply well to our particular situation; we have a number of projects concurrently using the same core plugin while developing new features for it. What we need is a strategy that provides the following: A methodology for developing major features within the code repository. A way of migrating those features into other projects. A way of versioning the core repository, and of tracking which version each major project uses. A plan for migrating bug fixes back to older versions. A cleaner history that's easier to see where changes have come from. Any suggestions or discussion would be greatly appreciated.

    Read the article

  • How can I debug Cisco Firewall ASA "Dispatch Unit" very high CPU utilisation from ASDM?

    - by Andy
    I have recently had my first firewall installed so I am very new to this whole situation. I am finding that Dispatch unit is becoming overloaded and it would appear to be the reason I get serious bouts of lag on my server. The firewall has had little configuration apart from me blocking all the ports in "Access Rules" and allowing only the ones the server needs and from where it needs them. I guess what I am after is assistance with locating the issues causing "Dispatch Unit" to take up all the CPU Regards --Edit-- With ASDM statistics I found that packets inbound (peak of 70-100k/sec from <1k/sec normal), traffic inbound (peak of 40-50kbits/sec from <1kbits/sec normal) and CPU all peak at the same time so I am pretty sure it is an attack of some sort but as a beginner with ASA I am not sure how to resolve

    Read the article

  • SQLAuthority News – Ahmedabad Tech Ed On Road June 11, 2011 – An Event to Remember – A Grand Success of Community Tech Days

    - by pinaldave
    I am very excited to announce the huge success of the Microsoft Community TechDays at Ahmedabad, on 11 June 2011.  The turn-out for this seminar was huge, and there was a great response from the audience.  In fact, the AMA where the conference was held can seat 275 people – but there were over 50 people standing, the event coordinators had to find 150 more chairs, and we even had to turn away 30 people at the door because there was just no more room.  This means that there were over 500 attendees! The event started right on time, at 10 am, with my introduction and welcome to the audience.  My presentation on my favorite subject of “SQL Server Performance Troubleshooting Using Waits and Queues.”  Because of the number of speakers, I had to cut my presentation short by 10 minutes, so I only had 50 minutes to explain how to use swaits and queues to fine tune performance.  There was a good response to my talk from audience. I feel the best presentation, though, was “HTML5 – Future of the Web” by Harish Vaidyanathan.  He explained how HTML5 is going to change the internet, and taught everyone a lot about how to best use Internet Explorer 9, and discussed CSS3, SVG and DOM specifications.  Many people in the audience came specifically for this session – many had to take a half day leave off work just to travel there. At this point we all took a break for lunch, but there was no one taking a nap with a full stomach because we had a presentation of the new Windows Mango phone from Dhananjay Kumar.  New technology like this always wakes everyone up! After this came “TSQL Worst Practices” by Jacob Sebastian.  He too had to cut his talk short by 10 minutes in order to accommodate everyone, but his discussion of what SQL queries to avoid was still excellent. He is magnificent presenter and Ahmedabad loves him. The final presentation was “ASP.NET Tips and Tricks” by Tejas Shah.  This was a good overview of asp.net fundamentals, and how to use them to improve application performance.  However, the day was not over here!  We kept the audience entertained with prizes and give-aways.  Names were drawn for prizes and there was a quiz session with great gifts for the winners. Overall, the day was a huge success.  There was a good mix of SQL and non-SQL subjects, and many audiences members commented on how much they learned.  We had a much bigger turn-out than expected – all the chairs were filled 45 minutes before we even started!  For our next conference we need to find a space that will hold everyone, especially since we are hoping to have 600-800 people attending.  We definitely feel we can reach this goal.  We are already looking forward to the next Ahmedabad Microsoft Community TechDays. Download presentations: HTML5 Beauty of Web -By Harish Vaidyanathan TSQL Worst Practices- By Jacob Sebastian SQL SERVER Performance troubleshooting using Waits and Queues -By Pinal Dave ASP.NET Tips and Tracks -By Tejas Shah Other reports: Tech-Ed on Road 2011- Ahmedabad–A great event- By Jalpesh Tech-Ed 2011 on the Road in Ahmedabad – by Ritesh Shah Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: About Me, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority Author Visit, SQLAuthority News, T SQL, Technology

    Read the article

  • Adobe victime du plus grand piratage de toute son histoire, 38 millions de comptes utilisateurs compromis et le code source de Photoshop dérobé

    Adobe victime de la plus grande campagne de piratage de toute son histoire 38 millions de comptes d'utilisateurs compromis et le code source de photoshop dérobéRécemment, Adobe a subit une cyberattaque des plus élaborées sur ses serveurs. Celle-ci a inévitablement conduit à la compromission de pratiquement 2,9 millions de comptes utilisateurs enregistrés pour ses différents services, selon les premières estimations de la firme.Au passage, les hackers ont réussi à emporter le code source de Photoshop,...

    Read the article

  • How can I dispatch Firefox or Google Chrome with Python?

    - by Shady
    How can I do this with Firefox or Google Chrome? ie = win32com.client.Dispatch('InternetExplorer.Application') ie.visible = 1 ie.navigate('http://google.com') Is there a way to do it? ps: I need to use the ReadyState with it... for example while (ie.ReadyState != 4):, or in other words, I need some command that wait until the page loads completely until do the next command, that's why I need the dispatch, that currently work very good with IE

    Read the article

  • How can you dispatch on request method in Django URLpatterns?

    - by rcampbell
    It's clear how to create a URLPattern which dispatches from a URL regex: (r'^books/$', books), where books can further dispatch on request method: def books(request): if request.method == 'POST': ... else ... I'd like to know if there is an idiomatic way to include the request method inside the URLPattern, keeping all dispatch/route information in a single location, such as: (r'^books/$', GET, retrieve-book), (r'^books/$', POST, update-books), (r'^books/$', PUT, create-books),

    Read the article

  • AS3 - Event listener that only fires once

    - by Zed-K
    I'm looking for a way to add an EventListener which will automatically removes itself after the first time it fires, but I can't figure a way of doing this the way I want to. I found this function (here) : public class EventUtil { public static function addOnceEventListener(dispatcher:IEventDispatcher,eventType:String,listener:Function):void { var f:Function = function(e:Event):void { dispatcher.removeEventListener(eventType,f); listener(e); } dispatcher.addEventListener(eventType,f); } } But instead of having to write : EventUtil.addOnceEventListener( dispatcher, eventType, listener ); I would like to use it the usual way : dispatcher.addOnceEventListener( eventType, listener ); Has anybody got an idea of how this could be done? Any help would be greatly apprecitated. (I know that Robert Penner's Signals can do this, but I can't use them since it would mean a lot of code rewriting that I can't afford for my current project)

    Read the article

  • method with two parameters which both need to be double dispatched

    - by mixm
    lets say i have a method which has two parameters. i have been implementing them as: if(aObj instance of Marble) { if(bObj instance of Bomb) { this.resolve((Marble)aObj,(Bomb)bObj); } } as you can see its not a very pretty solution. i plan to implement using double dispatching, but with two parameters which both need double dispatching, im afraid im a bit stumped. any ideas please. im implementing in java btw.

    Read the article

  • Returning values from Swing using invokeAndWait

    - by Joonas Pulakka
    I've been using the following approach to create components and return values from Swing to/from outside the EDT. For instance, the following method could be an extension to JFrame, to create a JPanel and add it to the parent JFrame: public JPanel threadSafeAddPanel() { final JPanel[] jPanel = new JPanel[1]; try { EventQueue.invokeAndWait(new Runnable() { public void run() { jPanel[0] = new JPanel(); add(jPanel[0]); } }); } catch (InterruptedException ex) { } catch (InvocationTargetException ex) { } return jPanel[0]; } The local 1-length array is used to transfer the "result" from inside the Runnable, which is invoked in the EDT. Well, it looks "a bit" hacky, and so my questions: Does this make sense? Is anybody else doing something like this? Is the 1-length array a good way of transferring the result? Is there an easier way to do this?

    Read the article

  • Is is possible to do an end-run around generics covariance in C# < 4 in this hypothetical situation?

    - by John Feminella
    Suppose I have a small inheritance hierarchy of Animals: public interface IAnimal { string Speak(); } public class Animal : IAnimal { public Animal() {} public string Speak() { return "[Animal] Growl!"; } } public class Ape : IAnimal { public string Speak() { return "[Ape] Rawrrrrrrr!"; } } public class Bat : IAnimal { public string Speak() { return "[Bat] Screeeeeee!"; } } Next, here's an interface offering a way to turn strings into IAnimals. public interface ITransmogrifier<T> where T : IAnimal { T Transmogrify(string s); } And finally, here's one strategy for doing that: public class Transmogrifier<T> : ITransmogrifier<T> where T : IAnimal, new() { public T Transmogrify(string s) { T t = default(T); if (typeof(T).Name == s) t = new T(); return t; } } Now, the question. Is it possible to replace the sections marked [1], [2], and [3] such that this program will compile and run correctly? If you can't do it without touching parts other than [1], [2], and [3], can you still get an IAnimal out of each instance of a Transmogrifier in a collection containing arbitrary implementations of an IAnimal? Can you even form such a collection to begin with? static void Main(string[] args) { var t = new Transmogrifier<Ape>(); Ape a = t.Transmogrify("Ape"); Console.WriteLine(a.Speak()); // Works! // But can we make an arbitrary collection of such animals? var list = new List<Transmogrifier< [1] >>() { // [2] }; // And how about we call Transmogrify() on each one? foreach (/* [3] */ transmogrifier in list) { IAnimal ia = transmogrifier.Transmogrify("Bat"); } } }

    Read the article

  • Why doesn't C++ allow you to request a pointer to the most derived class?

    - by Matthew Lowe
    (This question should probably be answered with a reference to Stroustrup.) It seems extremely useful to be able to request a pointer to the most derived class, as in the following: class Base { ... }; class DerivedA { ... }; class DerivedB { ... }; class Processor { public: void Do(Base* b) {...} void Do(DerivedA* d) {...} void Do(DerivedB* d) {...} }; list<Base*> things; Processor p; for(list<Base*>::iterator i=things.begin(), e=things.end(); i!=e; ++i) { p.Do(CAST_TO_MOST_DERIVED_CLASS(*i)); } But this mechanism isn't provided in c++. Why?

    Read the article

  • Can Git or Mercurial be set to bypass the local repository and go straight to the central one?

    - by Jian Lin
    Using Git or Mercurial, if the working directory is 1GB, then the local repository will be another 1GB (at least), residing normally in the same hard drive. And then when pushed to a central repository, there will be another 1GB. Can Git or Mercurial be set to use only a working directory and then a central repository, without having 3 copies of this 1GB data? (actually, when the central repository also update, then there are 4 copies of the same data... can it be reduced? In the SVN scenario, when there are 5 users, then there will be 6GB of data total. With Distributed Version Control, then there will be 12GB of data?)

    Read the article

  • Sub reports find the sub total and grand total of each sub report in the main report

    - by sonia
    i want to find the grand total from sub report subtotal. i have three subreports. 1. itemreport 2.laborreport 3. machine report. i have find total of that reports using shared variable. like using formula: shared numbervar totalitem=sum({storedprocedrename.columnname}) i have done dis in all the sbreports. now i m want the grand total of all these. i have written the formula in main report is: shared numbervar totalitem; // same variable used in subreport item shared numbervar labtotal; // same variable sed in subreport labor shared numbervar machinetotal; // same variable used in subreport machine numbervar total; total=totalitem+labtotal+machinetotal; total but it is not giving correct result.. it is not giving result in correct format plz tell me code of main report in detail.. thanks

    Read the article

  • How to Deploy my Open Source Projects using Maven's Central Repository?

    - by sfussenegger
    Is there anything I could do to get my own open source stuff into Maven's Central repository? I've wondered many times how I could get my own projects into Maven's Central repository. I was asking this myself, especially as I've seen some well known projects hosting their own repository, requiring users to add dependency and repository. At the same time, it's getting difficult for other projects to depend on those projects. As I neither want others to add an additional repository nor to host one myself, I'm looking for other ways. And why aren't some projects using the option to deploy to Maven Central in favor of their self-hosted repository? Any good reasons that aren't obvious?

    Read the article

  • How do I cleanly design a central render/animation loop?

    - by mtoast
    I'm learning some graphics programming, and am in the midst of my first such project of any substance. But, I am really struggling at the moment with how to architect it cleanly. Let me explain. To display complicated graphics in my current language of choice (JavaScript -- have you heard of it?), you have to draw graphical content onto a <canvas> element. And to do animation, you must clear the <canvas> after every frame (unless you want previous graphics to remain). Thus, most canvas-related JavaScript demos I've seen have a function like this: function render() { clearCanvas(); // draw stuff here requestAnimationFrame(render); } render, as you may surmise, encapsulates the drawing of a single frame. What a single frame contains at a specific point in time, well... that is determined by the program state. So, in order for my program to do its thing, I just need to look at the state, and decide what to render. Right? Right. But that is more complicated than it seems. My program is called "Critter Clicker". In my program, you see several cute critters bouncing around the screen. Clicking on one of them agitates it, making it bounce around even more. There is also a start screen, which says "Click to start!" prior to the critters being displayed. Here are a few of the objects I'm working with in my program: StartScreenView // represents the start screen CritterTubView // represents the area in which the critters live CritterList // a collection of all the critters Critter // a single critter model CritterView // view of a single critter Nothing too egregious with this, I think. Yet, when I set out to flesh out my render function, I get stuck, because everything I write seems utterly ugly and reminiscent of a certain popular Italian dish. Here are a couple of approaches I've attempted, with my internal thought process included, and unrelated bits excluded for clarity. Approach 1: "It's conditions all the way down" // "I'll just write the program as I think it, one frame at a time." if (assetsLoaded) { if (userClickedToStart) { if (critterTubDisplayed) { if (crittersDisplayed) { forEach(crittersList, function(c) { if (c.wasClickedRecently) { c.getAgitated(); } }); } else { displayCritters(); } } else { displayCritterTub(); } } else { displayStartScreen(); } } That's a very much simplified example. Yet even with only a fraction of all the rendering conditions visible, render is already starting to get out of hand. So, I dispense with that and try another idea: Approach 2: Under the Rug // "Each view object shall be responsible for its own rendering. // "I'll pass each object the program state, and each can render itself." startScreen.render(state); critterTub.render(state); critterList.render(state); In this setup, I've essentially just pushed those crazy nested conditions to a deeper level in the code, hiding them from view. In other words, startScreen.render would check state to see if it needed actually to be drawn or not, and take the correct action. But this seems more like it only solves a code-aesthetic problem. The third and final approach I'm considering that I'll share is the idea that I could invent my own "wheel" to take care of this. I'm envisioning a function that takes a data structure that defines what should happen at any given point in the render call -- revealing the conditions and dependencies as a kind of tree. Approach 3: Mad Scientist renderTree({ phases: ['startScreen', 'critterTub', 'endCredits'], dependencies: { startScreen: ['assetsLoaded'], critterTub: ['startScreenClicked'], critterList ['critterTubDisplayed'] // etc. }, exclusions: { startScreen: ['startScreenClicked'], // etc. } }); That seems kind of cool. I'm not exactly sure how it would actually work, but I can see it being a rather nifty way to express things, especially if I flex some of JavaScript's events. In any case, I'm a little bit stumped because I don't see an obvious way to do this. If you couldn't tell, I'm coming to this from the web development world, and finding that doing animation is a bit more exotic than arranging an MVC application for handling simple requests - responses. What is the clean, established solution to this common-I-would-think problem?

    Read the article

  • Moving dozens of existing standalone retail sites to one central inventory database: what should I know going in?

    - by palintropos
    This will be the first project of this scale that I have attempted, and the first time I have run a website at all (much less dozens) using an off-site database. In particular, I'd like to know: what sort of optimizations I should read up on to make this run as smoothly as possible? any pitfalls/gotchas wiser, more experienced folk are aware of I should be on the lookout for, and what damage-control and preventative measures I should take against the nightmare scenario of the main server (hosting the database) having an outage, grinding over 100 websites to a halt (because they have no access to the product data).

    Read the article

  • mod_rewrite REQUEST_FILENAME doesn't contain absolute path

    - by Paul Dixon
    I have a problem with a file test operation in a mod_rewrite RewriteCond entry which is testing whether %{REQUEST_FILENAME} exists. It seems that rather than %{REQUEST_FILENAME} being an absolute path, I'm getting a path which is rooted at the DocumentRoot instead. Configuration I have this inside a <VirtualHost> block in my apache 2.2.9 configuration: RewriteEngine on RewriteLog /tmp/rewrite.log RewriteLogLevel 5 #push virtually everything through our dispatcher script RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/([^/]*)/?([^/]*) /dispatch.php?_c=$1&_m=$2 [qsa,L] Diagnostics attempted That rule is a common enough idiom for routing requests for non-existent files or directories through a script. Trouble is, it's firing even if a file does exist. If I remove the rule, I can request normal files just fine. But with the rule in place, these requests get directed to dispatch.php Rewrite log trace Here's what I see in the rewrite.log init rewrite engine with requested uri /test.txt applying pattern '^/([^/]*)/?([^/]*)' to uri '/test.txt' RewriteCond: input='/test.txt' pattern='!-f' => matched RewriteCond: input='/test.txt' pattern='!-d' => matched rewrite '/test.txt' -> '/dispatch.php?_c=test.txt&_m=' split uri=/dispatch.php?_c=test.txt&_m= -> uri=/dispatch.php, args=_c=test.txt&_m= local path result: /dispatch.php prefixed with document_root to /path/to/my/public_html/dispatch.php go-ahead with /path/to/my/public_html/dispatch.php [OK] So, it looks to me like the REQUEST_FILENAME is being presented as a path from the document root, rather than the file system root, which is presumably why the file test operator fails. Any pointers for resolving this gratefully received...

    Read the article

  • MySQL replicate multiple places

    - by Frederik Nielsen
    Very trick task to find a good title for this question, but here goes the q: I have a few development machines, where I develop my PHP applications on, and testing via a local webserver. This works out pretty well for each machine. However, I would like to replicate the DB from my machines to a central location. So, to sum up: DEV1 - CENTRAL DEV2 - CENTRAL DEV3 - CENTRAL CENTRAL - DEV1 CENTRAL - DEV2 CENTRAL - DEV3 I hope this makes sense, as I cannot find an easy way to tell it. Basically, it is a 2-way replication, where all 4 databases contain the same info, and each of them can be updated locally, to then be pushed out to the others. Is this actually doable? All my dev machines are running Windows 7, and my central DB server is running CentOS 6.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >