efficiency

Auto update and build with eclipse and SVN

hi, every morning when i come to work i update my sources from the svn and build it. this process takes roughly 15 min. my question is whether it is possible to do it automatically, scheduling it... i am working with XP and eclipse. ...

efficient Python library to recommend product based on user history

I have a database of which products every user has viewed and I want to recommend a product based on what similar users have viewed. Is there a Python library that can achieve this? I don't need Netflix quality results, just products that are probably of interest. Any ideas? ...

How to write code in Visual Studio faster?

Whenever I start a new software project I spend a good amount of time at the beginning drawing class diagrams and other flow charts to plan out how I see the application working. This part just takes a lot of thinking and testing. But at a certain point when everything is planed out I don't need to think about it so much anymore I just n...

Efficiency of embedding flash assets in flex actionscript project

I'm creating a project in flex builder but it's not using the flex framework, it's just pure actionscript. At the moment I have some bitmap resources embedded for drawing things, but I'd like a little animation and thought I could create swf animations for them in flash and use the [Embed()] thing to embed them in the actionscript proje...

How to measure performance in Java developement

Is there any tool can measure execution time for each function call and find out bottle neck for a given developing java j2se project? Thanks! ...

Case vs If Else If: Which is more efficient?

Possible Duplicates: is else if faster than switch() case ? What is the relative performance of if/else vs. switch in Java? Ive been coding-in-the-run again....when the debugger steps through a case statement it jumps to the item that matches the conditions immediately, however when the same logic is specified using if/else ...

Python - efficient method to remove all non-letters and replace them with underscores.

def format_title(title): ''.join(map(lambda x: x if (x.isupper() or x.islower()) else '_', title.strip())) Anything faster? ...

most efficient way to print a list of names based off a csv using php and mysql

I have an array of player's IDs. There will generally be about 5 players, not likely to be more then a dozen: $cplayers= array(1,2,5); I want to display the players names as a list. $query = "SELECT username,id FROM users ORDER BY id"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); $playercoun...

Comet vs Ajax for chatting

My site needs a chat room, and I'm also looking to implement a facebookesque person to person chat system. What is most cost-efficient/performant (purely in terms of bw and server) for me. A regular 1 second poll ajax chat, or a comet solution. Thanks. ...

Which is the more efficient way to store this ordered pair in php?

Which of the following two data structures is "better"? array('key'=>array(1,2,3,4)) OR: array('key',array(1,2,3,4)) i.e., is it better to store the array as the second element in a two element array, or as the single element in an array with the key, 'key'. Assume that for my purposes, in matters of convenience, they are equivale...

How to get the most represented object from an array

Hi, I have an array with some objects, and there are several objects that are alike. E.g: fruit = [apple, orange, apple, banana, banana, orange, apple, apple] What is the most efficient way to get the most represented object from this array? In this case it would be "apple" but how would you go out and calculate that in an efficient wa...

Combining LINQ statements for efficiency

Hi, regarding linq to objects, if i use a .Where(x => x....) and then straight afterwards use a .SkipWhile(x => x...) does this incur a performance penalty because i am going over the collection twice? Should i find a way to put everything in the Where clause or in the SkipWhile clause? ...

efficient method to replace multiple words in text

Using JavaScript I need to efficiently remove ~10000 keywords from a ~100000 word document, of which ~1000 will be keywords. What approach would you suggest? Would a massive regular expression be practical? Or should I just iterate through the document characters looking for keywords (boring)? Edit: Good point - only whole words, not ...

Simple, but can this be better?

This is just a simple check to see what letter grade to output. Is there any faster and more efficient way to achieve the objective? if ( $grade >= 90 ) { echo "A"; } elseif ( $grade >= 80 ) { echo "B"; } elseif ( $grade >= 70 ) { echo "C"; } else { echo "Failed." } ...

Execution Efficiency vs Programmer Efficiency in R

The classic and brilliant Programming Perl reference book has a section in which the authors provide a list of advice for how to write Perl that is maximally computationally efficient, followed by a list of advice for how to write Perl that is maximally programmer efficient, followed by more advice for maintainer efficient, porter effici...

Efficient Number of Threads

I want to optimize my application number of threads. Almost all of them have IO beside CPU usage in an equal value. How much is the efficient number of threads when there are no other applications running in system. I want the answer for Windows and under JVM. ...

Core Data Ordered Join Table Efficiencies

I have a complex core data mapping in my app, simplified to the relevant pats to this question here in this image: My question is how to get sorted Foo's efficiently. Let's say that in one of my views, I have a sectioned table with every foo in it. The sections are the categories. Each section of foo (in a category) has an ordering...

efficiently knowing if intersection of two list is empty or not, in python

Hi! Suppose I have two lists, L and M. Now I want to know if they share an element. Which would be the fastest way of asking (in python) if they share an element? I don't care which elements they share, or how many, just if they share or not. For example, in this case L = [1,2,3,4,5,6] M = [8,9,10] I should get False, and here: L...

which is more efficient for buffer manipulations: python strings or array()

I am building a routine that processes disk buffers for forensic purposes. Am I better off using python strings or the array() type? My first thought was to use strings, but I'm trying to void unicode problems, so perhaps array('c') is better? ...

get every two card combination from subset of standard deck

Hi, I have a standard deck of cards and then have removed a few, from the remaining cards I want to calculate all of the possible two card combinations. For example with 47 cards there is 47 choose 2 combinations. Can anyone think of an efficient way to do this other than foreach(card){ combinations.add(card, card +1) } Thanks ...