I would like to have something that looks something like this. Two different colors are not nessesary.
I already have the audio data (one sample/millisecond) from a stereo wav in two int arrays, one each for left and right channel. I have made a few attempts but they don't look anywhere near as clear as this, my attempts get to spikey...
I'll start of by saying that I understand that this topic is complicated and that there probably isn't an easy answer. If it were easy then everybody would be doing it. That being said...
I've been asked to build an application to manage a sports league. Most of the concepts are fairly easy to understand except for this one: How to gene...
I have a DAG representing a list of properties. These properties are such that if a>b, then a has a directed edge to b. It is transitive as well, so that if a>b and b>c, then a has a directed edge to c.
However, the directed edge from a to c is superfluous because a has a directed edge to b and b has a directed edge to c. How can I prun...
Given:
A database of flights (departing city, arrival city, departure time, arrival time).
Questions:
What would be the most efficient algorithm for listing service between two cities, if departure time is unimportant? Consider that we want to minimize layover time (but still above a nominal minimum, i.e. 20 minutes), and minimize ...
I've been doing some research on Nagle's algorithm out of idle curiousity. I understand the basic concept behind it (TCP packets contain a significant amount of overhead especially when dealing with small payloads), but I'm not sure I grok the implementation.
I was reading this article on Wikipedia, but I'm still unclear on how it works...
I am looking for an efficient way to generate numbers that a human would perceive as being random. Basically, I think of this as avoiding long sequences of 0 or 1 bits. I expect humans to be viewing the bit pattern, and a very low powered cpu should be able to calculate near a thousand of these per second.
There are two different con...
I'm looking form a programatic way to take an integer sequence and spit out a closed form function. Something like:
Given: 1,3,6,10,15
Return: n(n+1)/2
Samples could be useful; the language is unimportant.
...
What is the most elegant way to implement this function:
ArrayList generatePrimes(int n)
This function generates the first n primes (edit: where n>1), so generatePrimes(5) will return an ArrayList with {2, 3, 5, 7, 11}. (I'm doing this in C#, but I'm happy with a Java implementation - or any other similar language for that matter (so ...
I need to develop an application that will index several texts and I need to search for people’s names inside these texts. The problem is that, while a person’s correct name is “Gregory Jackson Junior”, inside the text, the name might me written as:
- Greg Jackson Jr
- Gegory Jackson Jr
- Gregory Jackson
- Gregory J. Junior
I plan t...
I've got a set of TreeNodes, each of which has an id, a Collection of parent nodes, and a collection of child nodes.
For a given node Id, I'm looking for an efficient way to generate all the links that pass through that node. So in short, start at the node, and iterate through all its children. If a node has more than one child, create ...
We have a very old, unsupported program which copies files across SMB shares. It has a checksum algorithm to determine if the file contents have changed before copying. The algorithm seems easily fooled -- we've just found an example where two files, identical except a single '1' changing to a '2', return the same checksum. Here's the al...
I have two datatables. DataTable dtRequired and DataTable dtResult.
I want to output a datatable that contains rows that were not present in dtResponse but were found in dtRequired.
Approach 1
We have been using the algorithm specified at the following url http://weblogs.sqlteam.com/davidm/archive/2004/01/19/739.aspx.
And this algori...
Hi,
I am creating a custom social network for one of my clients.
In this I am storing the friends of a user in the form of CSV as shown below in the user table
uid user_name friends
1 John 2
2 Jack 3,1
3 Gary 2,4
4 Joey 3
In the above scenario if the logged in user ...
I'm making a game and in it is a computer controlled gun turret.
The gun turret can rotate 360 degress.
It uses trig to find out the angle it needs to aim the gun (objdeg) and the current angle of the gun is stored in (gundeg)
the following code rotates the gun at a set speed
if (objdeg > gundeg)
{
gundeg++;
}
if (objdeg < gundeg)...
Actually this is a classic problem as SO user Victor put it (in another SO question regarding which tasks to ask during an interview).
I couldn't do it in an hour (sigh) so what is the algorithm that calculates the number of integer points within a triangle?
EDIT: Assume that the vertices are at integer coordinates. (otherwise it beco...
I've been thinking about the modified preorder tree traversal algorithm for storing trees within a flat table (such as SQL).
One property I dislike about the standard approach is that to insert a node you
have to touch (on average) N/2 of the nodes (everything with left or right higher than the insert point).
The implementations I've...
This is a school-related question, although not exactly homework.
I'm taking an algorithms course, currently working on Chapter 15 of Cormen's Introduction to Algorithms book. I've been successful at finding plenty of online examples of most of the algorithms in the book, and I can usually find some type of Java applet or other program...
I am working with a grid of squares which have two states, "ON" and "OFF." I have a rather simple Connected Component Labeling algorithm which finds all of the "ON" components. Usually, but not always, there is exactly one "ON" component.
I wish to construct an algorithm which takes in as input a matrix of on/off cells, a component la...
I want to design a URL shortener for a particular use case and type of end-user that I have targetted. I have decided that I want the URLs to be stored internally according to an auto-incrementing integer key. However, it is also required that a key be represented to users in the url as six-digit base 26 (a-z * 6) AND it's not possible t...
Is there any chance that a SHA-1 hash can be purely numeric, or does the algorithm ensure that there must be at least one alphabetical character?
Edit: I'm representing it in base 16, as a string returned by PHP's sha1() function.
...