Search Results

Search found 9026 results on 362 pages for 'vs extensibility'.

Page 122/362 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • Objective-C vs JavaScript loop performance

    - by micadelli
    I have a PhoneGap mobile application that I need to generate an array of match combinations. In JavaScript side, the code hanged pretty soon when the array of which the combinations are generated from got a bit bigger. So, I thought I'll make a plugin to generate the combinations, passing the array of javascript objects to native side and loop it there. To my surprise the following codes executes in 150 ms (JavaScript) whereas in native side (Objective-C) it takes ~1000 ms. Does anyone know any tips for speeding up those executing times? When players exceeds 10, i.e. the length of the array of teams equals 252 it really gets slow. Those execution times mentioned above are for 10 players / 252 teams. Here's the JavaScript code: for (i = 0; i < GAME.teams.length; i += 1) { for (j = i + 1; j < GAME.teams.length; j += 1) { t1 = GAME.teams[i]; t2 = GAME.teams[j]; if ((t1.mask & t2.mask) === 0) { GAME.matches.push({ Team1: t1, Team2: t2 }); } } } ... and here's the native code: NSArray *teams = [[NSArray alloc] initWithArray: [options objectForKey:@"teams"]]; NSMutableArray *t = [[NSMutableArray alloc] init]; int mask_t1; int mask_t2; for (NSInteger i = 0; i < [teams count]; i++) { for (NSInteger j = i + 1; j < [teams count]; j++) { mask_t1 = [[[teams objectAtIndex:i] objectForKey:@"mask"] intValue]; mask_t2 = [[[teams objectAtIndex:j] objectForKey:@"mask"] intValue]; if ((mask_t1 & mask_t2) == 0) { [t insertObject:[teams objectAtIndex:i] atIndex:0]; [t insertObject:[teams objectAtIndex:j] atIndex:1]; /* NSArray *newCombination = [[NSArray alloc] initWithObjects: [teams objectAtIndex:i], [teams objectAtIndex:j], nil]; */ [combinations addObject:t]; } } } ... the array in question (GAME.teams) looks like this: { count = 2; full = 1; list = ( { index = 0; mask = 1; name = A; score = 0; }, { index = 1; mask = 2; name = B; score = 0; } ); mask = 3; name = A; }, { count = 2; full = 1; list = ( { index = 0; mask = 1; name = A; score = 0; }, { index = 2; mask = 4; name = C; score = 0; } ); mask = 5; name = A; },

    Read the article

  • Java iterative vs recursive

    - by user1389813
    Can anyone explain why the following recursive method is faster than the iterative one (Both are doing it string concatenation) ? Isn't the iterative approach suppose to beat up the recursive one ? plus each recursive call adds a new layer on top of the stack which can be very space inefficient. private static void string_concat(StringBuilder sb, int count){ if(count >= 9999) return; string_concat(sb.append(count), count+1); } public static void main(String [] arg){ long s = System.currentTimeMillis(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < 9999; i++){ sb.append(i); } System.out.println(System.currentTimeMillis()-s); s = System.currentTimeMillis(); string_concat(new StringBuilder(),0); System.out.println(System.currentTimeMillis()-s); } I ran the program multiple time, and the recursive one always ends up 3-4 times faster than the iterative one. What could be the main reason there that is causing the iterative one slower ?

    Read the article

  • C++ STL list vs set

    - by mokaschitta
    Hi, what of those two is faster for random insertions and deletions? I guess list, having the values as the keys as it is with sets seems to be attractive too though. Is performance similar for iterating over the whole container? Thanks!

    Read the article

  • Help me with Php session vs Header redirect?

    - by python
    I have the following pages: *page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello World'; header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/page2.php'); exit; } ?> <a href="<?php print $_SERVER['REQUEST_URI'] . '?link=yes';?>">Click Here</a> *page2.php <?php print 'Here is page two, and my session variable: '; session_start(); print $_session['myvariable']; //This line could not output. exit; ?> When I try output $_session['myvariable'] I did not get the result hello world message. I could not find out the solution to fix it .?

    Read the article

  • Problem with VS debugger

    - by Polaris
    My debugger does not work when I start project in debug mode. But when I set checkbox Allow the source code to different from the original version. Debugger works. But solution not wokrs properly. For example for files with build action "Content" and Copy to outputDirectory to "Copy if newer" does not copy to bin/Debug Is anybody know the solution?

    Read the article

  • C vs C++ function questions

    - by james
    I am learning C, and after starting out learning C++ as my first compiled language, I decided to "go back to basics" and learn C. There are two questions that I have concerning the ways each language deals with functions. Firstly, why does C "not care" about the scope that functions are defined in, whereas C++ does? For example, int main() { donothing(); return 0; } void donothing() { } the above will not compile in a C++ compiler, whereas it will compile in a C compiler. Why is this? Isn't C++ mostly just an extension on C, and should be mostly "backward compatible"? Secondly, the book that I found (Link to pdf) does not seem to state a return type for the main function. I check around and found other books and websites and these also commonly do not specify return types for the main function. If I try to compile a program that does not specify a return type for main, it compiles fine (although with some warnings) in a C compiler, but it doesn't compile in a C++ compiler. Again, why is that? Is it better style to always specify the return type as an integer rather than leaving it out? Thanks for any help, and just as a side note, if anyone can suggest a better book that I should buy that would be great!

    Read the article

  • Business Units vs Teams in CRM 2011

    - by GuruJ
    I've been told a few times that Business Units in CRM 2011 are "tricky" and shouldn't be set up lightly since they have irreversible consequences for a CRM 2011 implementation. On the other hand, teams in CRM 2011 seem much more flexible in managing record security. For what reason would I still choose to set up Business Units in CRM 2011? What can I do with Business Units that I can't with Teams (and vice versa)?

    Read the article

  • MySQL Integer vs DateTime index

    - by David Kuridža
    Let me start by saying I have looked at many similar questions asked, but all of them relate to Timestamp and DateTime field type without indexing. At least that is my understanding. As we all know, there are certain advantages when it comes to DateTime. Putting them aside for a minute, and assuming table's engine is InnoDB with 10+ million records, which query would perform faster when criteria is based on: DateTime with index int with index In other words, it is better to store date and time as DateTime or UNIX timestamp in int? Keep in mind there is no need for any built-in MySQL functions to be used.

    Read the article

  • Regex vs. string:find() for simple word boundary

    - by user576267
    Say I only need to find out whether a line read from a file contains a word from a finite set of words. One way of doing this is to use a regex like this: .*\y(good|better|best)\y.* Another way of accomplishing this is using a pseudo code like this: if ( (readLine.find("good") != string::npos) || (readLine.find("better") != string::npos) || (readLine.find("best") != string::npos) ) { // line contains a word from a finite set of words. } Which way will have better performance? (i.e. speed and CPU utilization)

    Read the article

  • Drupal vs Some Other CMS

    - by Vecta
    I'm going to be moving my website to a CMS in the coming months I'd I need some help on choosing an appropriate CMS. Many of the websites I've seen tend to say "use Drupal, hands down". However, my website truly doesn't have a need for commenting or community features. Its pages will need to be modified occasionally, but not extensively. My website will also consist of many programs, each with their own sub-pages and menus. There are probably 25 people that will need access to the content on my website and will need the ability to update it. I do like the idea of being able to tag and categorize the content, and the modular aspect of Drupal but is it really right for my website? If not, which CMS may fit my needs better?

    Read the article

  • PHP __call vs method_exists

    - by neo
    The Project I'm working on contains something like a wrapper for call_user_func(_array) which does some checks before execution. One of those checks is method_exists (In Case the supplied first argument is an instance of a class and the second is a method name) The other is_callable. The function will throw an exception if one of those checks fails. My Code contains an array with function names (setFoo, setBar, etc.) and the php magic function for overloading (__call) which handles setting, replacing and deletion of certain variables (better certain array elements). The Problem: method_exists will return false if the function is not defined. Do I have any chance to get a true if the __call function does proper handling of the request?

    Read the article

  • php pconnect vs connect

    - by user192344
    if i have a script which insert a data then exit the script will be opened by 100 user at same time or within 2 mins actually im doing email tracking so pconnect is bettwe or connect is better to reduce the resource i have close when after insert

    Read the article

  • CSS: a:link vs just a (without the :link part)

    - by Rob
    So we're required to use the following order for CSS anchor pseudo-classes a:link { color: red } a:visited { color: blue } a:hover { color: yellow } a:active { color: lime } But my question is why bother with the a:link part? Rather, is there any advantage to the above (other than perhaps clarity) over: a { color:red; } /* notice no :link part */ a:visited { color: blue; } etc.,etc.

    Read the article

  • C preprocessor vs. C compiler

    - by Sunny209
    If I tell the C preprocessor to #include a file and use CPPFLAGS to help find the needed file, then the file is included already, right? What, if any, use is telling the C compiler about the same include directory with CFLAGS?

    Read the article

  • Beside SVN, how do you manage your development vs test vs production source code?

    - by medopal
    I'm working on a very large project with three phases of source code. Development source code: changes rapidly every second, and checked by our QA Test environment code: released to clients' QA department (released every 2-3 weeks) Production environment: after confirmed ok by client QA its released to prod. (every few months) The system (governmental web app) is very large to track changes,bugs and hot fixes, sometimes the Testers could ask for a change, some other times the Production could ask for a hot fix or small update. The problem is, when the Test or Production request changes, the development code is already changed a lot, and they always warn us they want only that small fix, do not upload anything new with it. The question, how should i manage the code for the 3 phases, and get back to Test or Production code any tie and fix that small one thing (reflecting the change to the current Development as well)? Note: making a branch each time is too much, and i don't want the developers to be lost between updating the mainstream, the branch and the Test code!

    Read the article

  • Blittable Vs. Non-Blittable in IL

    - by Michael Covelli
    I'm trying to make sure that my Managed to Unmanaged calls are optimized. Is there a quick way to see by looking at the IL if any non-blittable types have accidentally gotten into my pinvoke calls? I tried just writing two unmanaged functions in a .dll, one that uses bool (which is non-blittable) and one that uses ints. But I didn't see anything different when looking at the IL to let me know that it was doing something extra to marshal the bool.

    Read the article

  • client-side vs server-side

    - by amalafrida
    In general, should one design in order to place processing load on client-side? More specifically, a search engine to locate subscriber information requires a fair amount of parsing (multiple phone numbers to sort and format, hour of day, timezone, comparisons for possible substitutions of user information, etc.). Again, in general, is it preferred that one have client-side do the work? It seems to me 'yes' in a situation in which one will have many thousands of hits per minute. Use php for quick database queries ... process retrieved data client-side. yes ... no?

    Read the article

  • YUI vs jQuery, for css style layouts

    - by tony
    Hi Complete novice question. I've used jQuery a bit, YUI not at all and know very little about it. I work on a website thats IE specific, we're now looking at making it cross browser. jQuery seems great at hiding the differences between browsers from a javascript point of view. However in terms of css layout is it YUI that I should really be looking at? thanks

    Read the article

  • Closure vs Anonymous function (difference?)

    - by Maxim Gershkovich
    Hi, I have been unable to find a definition that clearly explains the differences between a closure and an anonymous function. Most references I have seen clearly specify that they are distinct "things" yet I can't seem to get my head around why. Could someone please simplify it for me? What are the specific differences between these two language features? Which one is more appropriate in what scenarios?

    Read the article

  • php vs python django or something else for CMS module

    - by Michael
    We're looking to develop a CMS module for our website and I need some help in choosing the language/framework for this project. Basically we need to develop a "help' module like this one from ebay http://pages.ebay.com/help/index.html which will contain a lot of static pages with nice URLs for SEO. The application must run fast using low computer resources. We have been looking to use php on a custom made mvc framework but we received advice from other sources that py/django is the exactly language/framework that we need in terms of maintainability and development speed because it was developed for exactly this kind of projects so I need an expert advice on this matter with pro and cons for each choice.

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >