optimal

live asp.net web.config settings

I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unecessary options. ...

Algorithm to calculate the number of divisors of a given number

What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number? It'll be great if you could provide pseudocode or a link to some example. EDIT: All the answers have been very helpful, thank you. I'm implementing the Sieve of Atkin and then I'm going to use something similar to what Jon...

So many ways to code one thing, deciding what's best?

Have you ever been in a situation where you code something and then find yourself wondering if you did it the best way. So you end up coding another way, and then find yourself again asking if you could have done it better. How do you determine when it is time to stop and move on to the next problem so you can avoid going in circles? ...

Optimal xml storage engine

I'm considering optimal open source solution for storing xml documents with further querying on them effectively. Amount of data will be small. As far as I understand native xml databases might form a proper solution for my case. They obviously store xml documents in highly efficient way. It would be great to learn your experience. Any s...

Is CollectionViewSource in WPF optimal?

Many WPF examples use CollectionViewSource as DataSource for DataBinding. It provides sorting and other useful functions. My question is, shouldn't this be done in Database? I mean in SQL? I bet it's 10times quicker. Isn't CollectionViewSource too slow? Thanks ...

Is there an optimal way to render images in cocoa? Im using setNeedsDisplay.

Currently, any time I manually move a UIImage (via handling the touchesMoved event) the last thing I call in that event is [self setNeedsDisplay], which effectively redraws the entire view. My images are also being animated, so every time a frame of animation changes, i have to call setNeedsDisplay. I find this to be horrific since I d...

Optimal solution for non-overlapping maximum scoring sequences

While developing part of a simulator I came across the following problem. Consider a string of length N, and M substrings of this string with a non-negative score assigned to each of them. Of particular interest are the sets of substrings that meet the following requirements: They do not overlap. Their total score (by sum, for simplici...

Which is optimal ?

Is declaring a variable inside a loop is good or declaring on the fly optimal in Java.Also is there any performance cost involved while declaring inside the loop? eg. Option 1: Outside the Loop List list = new ArrayList(); int value; //populate list for(int i = 0 ; i < list.size(); i++) { value = list.get(i); System.out.println(“...

Least squares optimal scaling

Hi, I have two waveforms which are linked by a numerical factor. I need to use optimal scaling (least squares) between the two waveforms to calculate this factor in Matlab. Unfortunately I have no idea how to do this. The two wave forms are seismic signals related by the velocity of the seismic waves, which I'm trying to calculate. Any ...

I need an algorithm to find the best path

Hi all, I need an algorithm to find the best solution of a path finding problem. The problem can be stated as: At the starting point I can proceed along multiple different paths. At each step there are another multiple possible choices where to proceed. There are two operations possible at each step: A boundary condition that determi...

How can I check if I made optimal mysql database?

Are there any ways to check whether my Mysql database and PHP script are optimal? I want to figure it out and fix if it's possible till I publish it on internet for many users. Thanks. ...

Why use frameworks? Convince me I should figure out Zend Framework and use it!

Possible Duplicate: Why use a framework with PHP? To begin with, I just can say that I have always been programming by my own. I use php mostly. So, can you explain me why I should learn Zend Framework or other framework? Why just don't write a pure code by own? edit: sorry, I really wrote into search input why use framework ...

Optimal algorithm for generating a random number R not in a set of numbers N

I am curious to know what the best way to generate a random integer R that is not in a provided set of integers (R∉N). I can think of several ways of doing this but I'm wondering what you all think. ...

Is this optimal schedule task NPC?

I volunteered to write a program to schedule parent-teacher conferences. The principal wants parents to select 3 possible datetimes to visit their english and math teacher (at the same time). Once all the parents have selected 3 datetimes, I'm supposed to figure out the optimal way to schedule the parent-teacher conferences so the grea...