I have a database with three tables: userid_tbl, need_tbl, have_tbl
create table userid_tbl
(user_id varchar2(15) not null primary key);
create table need_tbl
(user_id varchar2(15) not null,
have_item varchar2(100) not null,
foreign key (user_id) references userid_tbl (user_id)
);
create table have_tbl
(user_id varchar2(15) not null,...
I am having problems implementing the function described here here.
This is my Java implementation:
private static double[] pointRadialDistance(double lat1, double lon1,
double radianBearing, double radialDistance) {
double lat = Math.asin(Math.sin(lat1)*Math.cos(radialDistance)+Math.cos(lat1)
*Math.sin(radialDistance)*Math.co...
This is kind of more generic question, isn't language-specific. More about idea and algorithm to use.
The system is as follows:
It registers small loans between groups of friends. Alice and Bill are going to lunch, Bill's card isn't working, so Alice pays for his meal, $10.
The next day Bill and Charles meet each other on a railway sta...
I put "chunk transposition" in quotes because I don't know whether or what the technical term should be. Just knowing if there is a technical term for the process would be very helpful.
The Wikipedia article on edit distance gives some good background on the concept.
By taking "chunk transposition" into account, I mean that
Turing, Al...
How can I implement a bipartite matching algorithm (probably based on a max-flow algorithm) in C or C++ ?
To be specific, I have this input in a file:
(1,3)
(1,5)
(2,5)
(M,F) --> where M represents id of MALE and F is id of FEMALE.
I need to find the maximum number of matches and show matched couples.
Like:
matches: 1&3 , 2&5
I h...
How do you differentiate between an algorithm and a method? Why dont we call Newton's Method or Ford-Faulkerson method Algorithms? What are a properties of a good algorithm and what qualifies a method as an algorithm?
...
I have probem / strange question, i got algorithm with few "for" loops and now i need to do block scheme of this algorithm.
I know how to picture "while" loop, but is this acceptable to represent "for" loop using "while" and at this point make difference between souce code and algorithm?. Ofcourse assuming that all "for" loops are righ...
Please help me understand the difference between a Generative and Discriminative Algorithm keeping in mind that I am just a beginner.
...
A Map maps from keys to values and provides quick access based on the knowledge of the key.
Does there exist a data structure like Maps which supports both key to value and value to key access? Sometimes I may want to derefence the Map via the value, while other times by the key.
...
How to you calculate Execution time of your C#, Windows Application.
Are there any industry recognized methods?
...
Here is the scenario.
I am given an array 'A' of integers. The size of the array is not fixed. The function that I am supposed to write may be called once with an array of just a few integers while another time, it might even contain thousands of integers. Additionally, each integer need not contain the same number of digits.
I am supp...
The domain of this question is scheduling operations on constrained hardware. The resolution of the result is the number of clock cycles the schedule fits within. The search space grows very rapidly where early decisions constrain future decisions and the total number of possible schedules grows rapidly and exponentially. A lot of the po...
Does anyone know of a "similar words or keywords" algorithm available in open source or via an API? I am looking for something sort of like a thesaurus but smarter.
So for example:
intel
returns:
processor,
i7 core chip,
quad core chip,
.. etc
Any ideas or even something to point me in the right direction in C#?
...
Hello,
I need to code a solution for a certain requirement, and I wanted to know if anyone is either familiar with an off-the-shelf library that can achieve it, or can direct me at the best practice. Description:
The user inputs a word that is supposed to be one of several fixed options (I hold the options in a list). I know the input ...
Is there a way in constant working space to do arbitrary size and arbitrary base conversions. That is, to convert a sequence of n numbers in the range [1,m] to a sequence of ceiling(n*log(m)/log(p)) numbers in the range [1,p] using a 1-to-1 mapping that (preferably but not necessarily) preservers lexigraphical order?
I'm particularly in...
What are eigen values, vectors and expansions and as an algorithm designer how can I use them?
EDIT: I want to know how YOU have used it in your program so that I get an idea. Thanks.
...
Scenario
I'm going to be as succinct as possible. Basically with reference to this classdiag, I have a facade which manages a list of SocketManager ( which manages one Socket connection). Each SocketManager logs in to a remote server using a unique SocketUserId. Furthermore, each SocketManager will accept messages from clients destined ...
Simple online games of 20 questions powered by an eerily accurate AI.
How do they guess so well?
...
I want to cache data on the client. What is the best algorithm/data structure that can be employed?
Case 1. The data to be stored requires extremely fast string searching capability.
Case 2. The cached data set can be large. I don't want to explode the client's memory usage and also I don't want to make a network and disk access calls w...
I've got a collection of strings, and I need to know the first index where they all differ. I can think of two ways to do this: (the following pseudo code is just off the top of my head and may be heavily bug-laden)
First Way:
var minLength = [go through all strings finding min length];
var set = new set()
for(i=0;i<minlength;i++)
{
...