algorithm

Naming this algorithm: Comparing and interpolating points?

Hello, my question might be a little strange. I've "developed" an algorithm and don't know if there's a similar algorithm already out there. The situation: I've got a track defined by track points (2D). The track points represent turns for instance. Between the track points there are only straight lines. Now I'm given a set of coordina...

SURF and SIFT Alternative Object Tracking Algorithm for Augmented Reality

After asking here and trying both SURF and SIFT, none of them seams to be efficient enough to generate interest points fast enough to track a stream from the camera. SURF, for example, takes around 3 seconds to generate interest points for an image, that's way too slow to track a video coming from a web cam, and it'll be even worse when...

Smart Indent algorithm documentation?

I'm a big fan of documenting the proper behavior of IDE features that have a subtle but significant impact on coding flow - things like auto-completion selection and commenting/uncommenting code you might not realize you take advantage of but at the end of the day you got just a bit more done than you might have. I do so in hopes that ot...

I want an algorithm to crop an image, where to start

I want to a content analysis of a jepg image. I wish to take a jpeg image say 251 x 261 and pass it through an algorithm to crop it to say 96 x 87. Like an intelligent cropping algorithm, with a prompt to resize the image. ...

How To Produce A 2D Plane Cut from a 3D Image

Hi, I would like to write a C# program that generates a 2D image from a rendered 3D object(s) by "slicing" the 3D object or through a cut-plane. The desired output of the 2D image should be data that can be displayed using a CAD. For example: A 3D image is defined by its vertices, these vertices is contained within Point3DList(). A meth...

Trying to find the top 3 properties of a POCO instance, Part 2

Hi folks, a month ago I asked this question: Trying to find the top 3 properties of a POCO instance. Got an answer, worked well. Now, I'm trying to find the top 3 properties of a POCO object (like my previous question) but where each property has a WEIGHT. The value of the property comes first. The weight then comes in second ... if tw...

Good graph traversal algorithm

Abstract problem : I have a graph of about 250,000 nodes and the average connectivity is around 10. Finding a node's connections is a long process (10 seconds lets say). Saving a node to the database also takes about 10 seconds. I can check if a node is already present in the db very quickly. Allowing concurrency, but not having more tha...

Java RPN (Reverse Polish Notation) infix to postfix

I am pretty sure, that stacks are used for building PRN and '(' are ignored, but it does not seem to be the case. For example: input 1: 52+(1+2)*4-3 input 2: 52+((1+2)*4)-3 input 3: (52+1+2)*4-3 Input 1 and input 2 output should be the same, and input 1 and input 3 should differ. output 1: 52 1 2 + 4 3 - * + output 2: 52 1 2 + 4 * ...

Adding digits at Even and Odd Places (C#)

I need to add the digits on the even and odd places in an integer. Say, Let number be = 1234567 Sum of even place digits = 2+4+6 = 12 Sum of odd place digits = 1+3+5+7 = 16 Wait, dont jump for an answer! I'm looking for codes with minimal lines, preferably one-line codes. Similar to what 'chaowman' has posted in the thread (http://sta...

Programming experiments

I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them? ...

Paths in complete graph

I have a friend that needs to compute the following: In the complete graph Kn (k<=13), there are k*(k-1)/2 edges. Each edge can be directed in 2 ways, hence 2^[(k*(k-1))/2] different cases. She needs to compute P[A !-> B && C !-> D] - P[A !-> B]*P[C !-> D] X !-> Y means "there is no path from X to Y", and P[ ] is the probability. So ...

Are there any hash functions that allow you to resize the table without also rehashing (removing + reinserting) the contents?

Is it possible using a certain hash function and method (the division method, or double hashing) to make a chained hash table that can be resized without having to reinsert (rehash) each element already in the table? ...

Longest Non-Overlapping Substring

I wonder if anyone knows the (optimal?) algorithm for longest recurring non-overlapping sub string. For example, in the string ABADZEDGBADEZ the longest recurring would be "BAD". Incidentally if there is no such result, the algorithm should alert that such a thing has occurred. My guess is that this involves suffix trees. I'm sure th...

Algorithm to determine how positive or negative a statement/text is

I need to implement sentiment analysis. Can anyone point me to examples/reference implementations? ...

mathematical expression parser in Delphi?

Duplicate Best algorithm for evaluating a mathematical expression? Is there a built-in Delphi function which would convert a string such as '2*x+power(x,2)' or any equation to float? StrToFloat raises an exception because of the char X and power. Thanks. ...

Delphi, evaluate formula string

Duplicate Best algorithm for evaluating a mathematical expression? mathematical expression parser in Delphi? I need a program in Delphi that get one variable equation from Edit1 such as "F(x)=4*X+2*log(x)+4*power(X,2)"and get X value variable from Edit2 then show the result F(X) in Edit3. Please help me. Thanks. ...

Capturing Non-Zero Elements, Counts and Indexes of Sparse Matrix

I have the following sparse matrix A. 2 3 0 0 0 3 0 4 0 6 0 -1 -3 2 0 0 0 1 0 0 0 4 2 0 1 Then I would like to capture the following information from there: cumulative count of entries, as matrix is scanned columnwise. Yielding: Ap = [ 0, 2, 5, 9, 10, 12 ]; row indices of entries...

How does a blur gauss algorithm look like? Are there examples of implementation?

I have a bitmap image context and want to let this appear blurry. So best thing I can think of is a gauss algorithm, but I have no big idea about how this kind of gauss blur algorithms look like? Do you know good tutorials or examples on this? The language does not matter so much, if it's done all by hand without using language-specific ...

How can I find all permutations of a string without using recursion?

Can someone help me with this: This is a program to find all the permutations of a string of any length. Need a non-recursive form of the same. ( a C language implementation is preferred) using namespace std; string swtch(string topermute, int x, int y) { string newstring = topermute; newstring[x] = newstring[y]; newstring[y] = t...

Solution to classic "Blockbuster" problem

In the UK throughout the 80's and 90's (70's too I believe!) there was a classic TV program called "Blockbuster", which had a display of hexagons in a honeycomb grid, like this (sorry for blurry pic!): As you can see, there are 5 columns of letters and four rows. 1 person or team is trying to travel horizontally, one is trying to tra...