text
stringlengths
0
27.6k
python
int64
0
1
DeepLearning or NLP
int64
0
1
Other
int64
0
1
Machine Learning
int64
0
1
Mathematics
int64
0
1
Trash
int64
0
1
I have a from location (latitude, longitude) and to location (latitude, longitude). After calculating, it should show me what would be the nearest way to go from using a compass. The following is PHP code to do that, but its showing the wrong direction, I need little help on this. function GreatCircleDirection ($OrigLa...
0
0
0
0
1
0
I am working in a chemistry/biology project. We are building a web-application for fast matching of the user's experimental data with predicted data in a reference database. The reference database will contain up to a million entries. The data for one entry is a list (vector) of tuples containing a float value between ...
0
0
0
0
1
0
How come ceil() rounds up an even floating with no fractional parts? When I try to do this: double x = 2.22; x *= 100; //which becomes 222.00... printf("%lf", ceil(x)); //prints 223.00... (?) But when I change the value of 2.22 to 2.21 x *= 100; //which becomes 221.00... printf("%lf", ceil(x)); //prints 22...
0
0
0
0
1
0
How would one design a neural network for the purpose of a recommendation engine. I assume each user would require their own network, but how would you design the inputs and the outputs for recommending an item in a database. Are there any good tutorials or something? Edit: I was more thinking how one would design a ne...
0
1
0
0
0
0
I am working on an AI bot for the game Defcon. The game has cities, with varying populations, and defensive structures with limited range. I'm trying to work out a good algorithm for placing defence towers. Cities with higher populations are more important to defend Losing a defence tower is a blow, so towers should b...
0
1
0
0
0
0
Some math calculations in JS problem solving I am working on a zoom image functionality that creates a new div with a large image that is moved through x and y according to the mousemove on the image. The large image should move a certain %, which is what i am trying to figure out. How much should it move by. Here i...
0
0
0
0
1
0
I'll apologize in advance in case this is obvious; I've been unable to find the right terms to put into Google. What I want to do is to find a bounding volume (AABB is good enough) for an arbitrary parametric range over a trimmed NURBS surface. For instance, (u,v) between (0.1,0.2) and (0.4,0.6). EDIT: If it helps, i...
0
0
0
0
1
0
I'm trying to write a general solver for a linear system in Maxima using linsolve(eqlist, varlist), but without having to explicitly specify the dimension of the problem. This works, but fixes the dimension to 3: linsolve( [ eq[0],eq[1],eq[2] ], [ a[0],a[1],a[2] ]) This doesn't: solution(p):=( array(eq,p+1), /* cr...
0
0
0
0
1
0
Picture a circle. Now divide the circle vertically and horizontally into four regions. Take the top left region. If you drew a box around it, you'd have a box with a rounded corner heading east. Given an X and Y coordinate in that box of that single top left region, how can I tell whether a point is to the left of the ...
0
0
0
0
1
0
I'm writing a solution for the Usaco problem "Electric Fences". In the problem you have to find the optimal location for a point among a large amount of linesegments, so the sum of point-linesegment distances is smallest possible. I had an idea, that it might be possible to do a hillclimb, and it worked for all testcas...
0
0
0
0
1
0
I'd like to create an application that can do simple reasoning using first order logic. Can anyone recommend an "engine" that can accept an arbitrary number of FOL expressions, and allow querying of those expressions (preferably accessible via Python)?
0
0
0
1
0
0
For a balanced search tree, it is O(log(N)) for all cases. For unbalanced search trees, the worst case is O(N), e.g., insert 1, 2, 3, 4,.. and best case complexity is when it is balanced, e.g., insert 6, 4, 8, 3, 5 7. How do we define the average case complexity for unbalanced search tree?
0
0
0
0
1
0
Suppose we have a text file with the content: "Je suis un beau homme ..." another with: "I am a brave man" the third with a text in German: "Guten morgen. Wie geht's ?" How do we write a function that would tell us: with such a probability the text in the first file is in English, in the second we have French etc? Link...
0
1
0
0
0
0
Start with this: [G|C] * [T] * Write a program that generates this: Cat Cut Cute City <-- NOTE: this one is wrong, because City has an "ESS" sound at the start. Caught ... Gate Gotti Gut ... Kit Kite Kate Kata Katie Another Example, This: [C] * [T] * [N] Should produce this: Cotton Kitten Where should I start my ...
0
1
0
0
0
0
Can anyone provide an example of a function that returns the cross product of TWO 2d vectors? I am trying to implement this algorithm. C code would be great. Thanks. EDIT: found another way todo it that works for 2D and is dead easy. bool tri2d::inTriangle(vec2d pt) { float AB = (pt.y-p1.y)*(p2.x-p1.x) - (pt.x-p1....
0
0
0
0
1
0
I've written this very badly optimized C code that does a simple math calculation: #include <stdio.h> #include <math.h> #include <stdlib.h> #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b)) unsigned long long int p(int); float fullCheck(int); int main(int argc, char **argv){ i...
0
0
0
0
1
0
A friend of mine is beginning to build a NetHack bot (a bot that plays the Roguelike game: NetHack). There is a very good working bot for the similar game Angband, but it works partially because of the ease in going back to the town and always being able to scum low levels to gain items. In NetHack, the problem is muc...
0
1
0
0
0
0
I've just started to work with MPFR arbitrary precision library and quite soon encounter very weird behaviour. The main goal of using it was to improve precision of large argument 'trigs' and this works extremely good in MPFR. But then I decided to check out simple math and it was unbelievable - even in straightforward...
0
0
0
0
1
0
Is there an x where SHA1(x) == x? I'm looking for a proof or a strong argument against it.
0
0
0
0
1
0
I'm currently in the process of developing a digg-like Ruby on Rails application for my degree's Final Project and I'm stuck in the 5 point ranking algorithm. There are a couple of factors that need to be involved, here's a breakdown : Users They'll have a personal 5 points ranking per category with 5 being the best a...
0
0
0
0
1
0
What is Log-likelihood? An example would be great.
0
0
0
0
1
0
I'm looking for any free tools/components/libraries that allow me to take anvantage of text mining, fact extraction and semantic analysis in my .NET application. The GATE project is what I need but it is written in Java. Is there something like GATE in the .NET world? My challange is to extract certain facts out of we...
0
1
0
0
0
0
Can anyone give me a quick tip? For example....how would I find the sine of 90 degrees?
0
0
0
0
1
0
Much has been written about deploying data crunching applications on EC2/S3, but I would like to know, what is the typical workflow for developing such applications? Lets say I have a 1 TB of time series data to begin with and I have managed to store this on S3. How would I write applications and do interactive data a...
0
0
0
1
0
0
I've spent a decent amount of time trying to hunt down a simple way of doing this - ideally, a magical library exists out there somewhere that will take my set of 3D data points and return 2 points on the best fit line using either orthogonal regression or least squares and also return the error of the fitted line. Do...
0
0
0
0
1
0
I have recently expanded the names corpus in nltk and would like to know how I can turn the two files I have (male.txt, female.txt) in to a corpus so I can access them using the existing nltk.corpus methods. Does anyone have any suggestions? Many thanks, James.
0
1
0
0
0
0
I am trying to implement the SIR epidemic model. Basically, the way I understand the model is that at each time step, it tells us how many nodes get infected and how many nodes are recovered. I am now trying to convert this into an discrete-event simulation and am confused at a point. The model is generally solved usin...
0
0
0
0
1
0
I am trying to find a formula http://www.evanmiller.org/how-not-to-sort-by-average-rating.html The one from the above link is too hard to implement. Is there a nicer and simpler way to sort entities by a five star user rating control ? Think at jokes. People say jokes and others rate them with 1 to 5 stars. If a) 5 us...
0
0
0
0
1
0
This is a similar question to this one here. Given a list of 3D coordinates that define the surface( Point3D1, Point3D2, Point3D3, and so on), how to calculate the centroid of the surface? In 2D the computation is given by the following formula: What about the 3D analogue?
0
0
0
0
1
0
It's well known that Bayesian classifiers are an effective way to filter spam. These can be fairly concise (our one is only a few hundred LoC) but all core code needs to be written up-front before you get any results at all. However, the TDD approach mandates that only the minimum amount of code to pass a test can be w...
0
1
0
1
0
0
As explained here, Math.Ceiling returns: "The smallest integral value that is greater than or equal to a". But later it says: "Note that this method returns a Double type instead of an integral type." I'm just wondering why?
0
0
0
0
1
0
I am very new at C programming and I am working on a firmware application for my MCU. This method was working fine when I was using the KEIL compiler (Big Endian) but when I switched to the SDCC compiler (Little Endian) it is not working properly. Can someone please explain what I am doing wrong??? The target device is...
0
0
0
0
1
0
I have a floating point value X which is animated. When in rest it's at zero, but at times an outside source may change it to somewhere between -1 and 1. If that happens I want it to go smoothly back to 0. I currently do something like addToXspeed(-x * FACTOR); // below is out of my control function addToXspeed(bla) ...
0
0
0
0
1
0
I am forced to execute a periodic task using a timer that is invoked at a different interval as the period I'd like to execute this task. Note that the timeout does not occur 100% accurately; i.e. timeout(javax.ejb.Timer timer) in the code below might be invoked at intervals 100, 98, 105ms etc. So, I came up with th...
0
0
0
0
1
0
Assume that a task exists with two attributes: priority and due date. Priority p is a numeric value. The priority importance increases to infinity, meaning that 5 is a priority higher than 4. Priority 0 is normal priority. Due date d is a date in the past or in the future, when compared with the current date. A d date ...
0
0
0
0
1
0
I want to know what is the best open source Java based framework for Text Mining, to use botg Machine Learning and dictionary Methods. I'm using Mallet but there are not that much documentation and I do not know if it will fit all my requirements.
0
1
0
1
0
0
A simple question, how would I go about declaring a clause which would produce the number specified +1 +2 and +3? I have tried: addup(Thenumber,Thenumber+1). addup(Thenumber,Thenumber+2). addup(Thenumber,Thenumber+3). but when I run it with say, Thenumber=5, it just returns 5+1 5+2 5+3. I have tried using 'is' to forc...
0
0
0
0
1
0
How can I render mathematical notations / expressions in Python with OpenGL? I'm actually using pyglet however it uses OpenGL. Such things as this: I can't store static images as I am generating the expressions as well.
0
0
0
0
1
0
Thanks for stoping to read my question :) this is very sweet place full of GREAT peoples ! I have a question about "creating sentences with words". NO NO it is not about english grammar :) Let me explain, If I have bag of words like "person apple apple person person a eat person will apple eat hungry apple hungry" and...
0
1
0
0
0
0
I need to write software that will do a lot of math. Mostly it will be matrix multiplication with integers to compute DCT. How much faster should I expect the code to run in native c as compared to VB .Net? Factor of 2, factor of 10, factor of 1000...? Has someone tried and collected statistics on this?
0
0
0
0
1
0
I need a way to get euler angles for rotation in global frame of reference from a local. I am using c#, wpf 3d and a gyroscope. I have a globe on the screen that should move in the same way as the gyro. Since the gyro sends movement relative to itself I need to use quaternions to keep the state of the object and update...
0
0
0
0
1
0
I want to graph from one date to another date and i only partial data now For example, i have data points for each month from jan 2010 to march 2010 but i want a line graph with a data point for each month for all of 2010. i basically want to take the slope of the current points and create new points for each future mo...
0
0
0
0
1
0
Lets say I have a non-square image.. If I increment the width and I recalculate the height according to the incremented width (ratio), sometimes I get xxx.5 (decimals) for the width ex.: width = 4, height = 2 I augment the width with a factor of 1.25 I'll get : width = 5 Next, the height will be : heigth = 2.5 How can ...
0
0
0
0
1
0
Does anyone know if there has been a port of the GNU Ballistics library to C#, java, vb, etc? Is there a similar library out there in any other language, even C++?
0
0
0
0
1
0
I have been looking at this piece of code, and it is not doing what I expect. I have 3 globals. int x, y, *pointer, z; Inside of main I declare them. x = 10; y = 25; pointer = &x; now at this point &x is 0x004A144 &y is 0x004A138 pointer is pointing to 0x004A144 Now when I increment: y = *++pointer; it points...
0
0
0
0
1
0
I have to calculate the following: float2 y = CONSTANT; for (int i = 0; i < totalN; i++) h[i] = cos(y*i); totalN is a large number, so I would like to make this in a more efficient way. Is there any way to improve this? I suspect there is, because, after all, we know what's the result of cos(n), for n=1..N, so mayb...
0
0
0
0
1
0
Is there any library which I can use to plot mathematical equations? (Preferably using javascript, could me in Java also; or anything clientside)
0
0
0
0
1
0
I'm toying with an app idea for the iPhone but I don't know where to start or even what to look for in google :) I'd like to visualize math patterns on the iPhone, similar to this http://itunes.apple.com/us/app/patterns-lite/id304565312?mt=8 ... If someone could point me into the right direction then that would be fant...
0
0
0
0
1
0
sorry for the confusing title, its really hard for me to explain what i want. So i created this image :) Ok so the two RED dots are points on an image. The distance between them isnt important. What I want to do is, Using the coordinates for the two dots, work out the angle of the space between them (as shown by the ...
0
0
0
0
1
0
My implementation of Sieve of Atkin either overlooks primes near the limit or composites near the limit. while some limits work and others don't. I'm am completely confused as to what is wrong. def AtkinSieve (limit): results = [2,3,5] sieve = [False]*limit factor = int(math.sqrt(lim)) for i in range(1,factor): for...
0
0
0
0
1
0
Trilinear interpolation approximates the value of a point (x, y, z) inside a cube using the values at the cube vertices. I´m trying to do an "inverse" trilinear interpolation. Knowing the values at the cube vertices and the value attached to a point how can I find (x, y, z)? Any help would be highly appreciated. Thank ...
0
0
0
0
1
0
similar questions have been asked before but I cant find an exact match to my question. I have 4 vectors each of which hold between 200-500 4 digit integers. The exact number of elements in each vector varies but I could fix it to a specific value. I need to find all possible combinations of the elements in these 4 v...
0
0
0
0
1
0
I am working with some code which outputs a 3x3 rotation matrix and a translation vector representing a cameras orientation and location. However, the documentation states that to get the location of the camera one must multiply the transposed and inverted rotation matrix by the translation vector. Does that mean that...
0
0
0
0
1
0
I have seen a few times people using -1 as opposed to 0 when working with neural networks for the input data. How is this better and does it effect any of the mathematics to implement it? Edit: Using feedforward and back prop Edit 2: I gave it a go but the network stopped learning so I assume the maths would have to ch...
0
0
0
0
1
0
So I have a counter. It is supposed to calculate the current amount of something. To calculate this, I know the start date, and start amount, and the amount to increment the counter by each second. Easy peasy. The tricky part is that the growth is not quite linear. Every day, the increment amount increases by a set amo...
0
0
0
0
1
0
I come from an MVC background (Flex and Rails) and love the ideas of code separation, reusability, encapsulation, etc. It makes it easy to build things quickly and reuse components in other projects. However, it has been very difficult to stick with the MVC principles when trying to build complex, state-driven, async...
0
1
0
0
0
0
Im writing a WPF application that has a zoom and pan ability, but what I want to also implement is the ability to zoom and pan "automatically" (via a button click). I have the methods all defined to zoom and pan, but Im having trouble telling the app the desired X/Y coordinates for the panning. Basically, I know that I...
0
0
0
0
1
0
On paper, binary arithmetic is simple, but as a beginning programmer, I'm finding it a little difficult to come up with algorithms for the addition, subtraction, multiplication and division of binary numbers. I have two binary numbers stored as strings, assume that any leading zeroes have been dropped. How would I go a...
0
0
0
0
1
0
I'm not sure whats the best algorithm to use for the classification of relationships in words. For example in the case of a sentence such as "The yellow sun" there is a relationship between yellow and sun. THe machine learning techniques I have considered so far are Baynesian Statistics, Rough Sets, Fuzzy Logic, Hidden...
0
1
0
1
0
0
Is there any open-source software that is trying to implement and emulate the human brain (e.g. intelligence and feelings)?
0
1
0
0
0
0
I got the example in this link. I can't understand the addmove, costLeven and meatureGesture methods. Can you explain it step by step?
0
0
0
0
1
0
I have trained xor neural network in MATLAB and got these weights: iw: [-2.162 2.1706; 2.1565 -2.1688] lw: [-3.9174 -3.9183] b{1} [2.001; 2.0033] b{2} [3.8093] Just from curiosity I have tried to write MATLAB code which computes the output of this network (two neurons in the hidden layer, and one in the output, TAN...
0
0
0
1
0
0
How can I measure the speed of code written in Java? I planning to develop software which will solve Sudoku using all presently available AI and ML algorithms and compare time against simple brute-force method. I need to measure time of each algorithm, I would like to ask for suggestions on what is the best way of doi...
0
1
0
1
0
0
Given that we start the call to the function ran2 with a negative integer [the seed] it will produce a series of random numbers. The sequence can be regenerated exactly if the same seed is used. Now my question is that is there a way that we can directly enter into some point in the sequence and then continue from tha...
0
0
0
0
1
0
(I asked this question earlier today, but I did a poor job of explaining myself. Let me try again) I have a client who is an industrial maintenance company. They sell service agreements that are prepaid 20 hour blocks of a technician's time. Some of their larger customers might burn through that agreement in two weeks...
0
0
0
0
1
0
I want to detect one kind of object such as person in the picture, who can tell me how to training a kind of people classifier for use,so we can use the classifier to detect people in any picture.
0
0
0
1
0
0
This is a community wiki which aims to provide a good design for a machine learning/artificial intelligence framework (ML/AI framework). Please contribute to the design of a language-agnostic framework which would allow multiple ML/AI algorithms to be plugged into a single framework which: runs the algorithms with a...
0
1
0
1
0
0
I have a number of 3x3 matricess that I want to multiply together For example: m1*m2*m3*m4*m5 Although MTL is a recommended way, I don't have this library and can't use it. Can someone please suggest a conventional way to multiply these 3x3 matrices (all matrices m1 to m5). Code snippet (for matrix multiplication and...
0
0
0
0
1
0
Let the user write/draw a character on the canvas,and recognize it. Seems not so easy,is there an open source project for this?
0
1
0
0
0
0
I have a simple photograph that may or may not include a logo image. I'm trying to identify whether a picture includes the logo shape or not. The logo (rectangular shape with a few extra features) could be of various sizes and could have multiple occurrences. I'd like to use Computer Vision techniques to identify th...
0
0
0
1
0
0
I have a surface which is a polyhedron and I want to find the minimal distance between it and a given point P. Since the polyhedron is defined by many polygons in a 3d space, one way that occurs to me is to compare the distance to each polygon and choose the shortest distance. Still I am not sure about it.
0
0
0
0
1
0
Best to use an example to describe the problem. Lets say I have a decimal value 100.227273. 100.227273 * X = Y I need to find the smallest positive integer X that gives integer Y.
0
0
0
0
1
0
We have studied the Variable Elimination recently and the teacher emphasizes that it is the Bayesian Network that makes varibale elimination more efficient. I am bit confused on this,why is this the case? Hope you guys can give me some idea,many thanks. Robert
0
1
0
0
0
0
I'm creating a game where players can make an alloy. To make it less predictable and more interesting, I thought that the durability and hardness of an alloy should not be calculated by a simple formula, because it will be extremely easy to find extrema, where alloy have best statistics. So the questions is, is there a...
0
0
0
0
1
0
Possible Duplicate: Is Programming == Math? Programmers seem to think that their work is quite mathematical. I understand this when you try to optimize something in performance, find the most efficient alogithm, etc.. But it patently seems false when you look at a billing application for a shop, or a systems softwar...
0
0
0
0
1
0
I've never really bothered with math programming, but today I've decided to give it a shot. Here's my code and it's working as intended: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Wind...
0
0
0
0
1
0
if i have two positive integers, say 0x1234 and 0x5678, is 0x8765 + 0xfedc = 0x8641, if the '+' means two's complement addition, mod 2^16?
0
0
0
0
1
0
Im trying to plot the roots of a polynomial, and i just cant get it. First i create my polynomial p5 = [1 0 0 0 0 -1] %x^5 - 1 r5 = roots(p5) stem (p5) Im using the stem function, but I would like to remove the stems, and just get the circle around the roots. Is this possible, is stem the right command? Thanks in adva...
0
0
0
0
1
0
Possible Duplicate: Estimating/forecasting download completion time We've all seen the download time running estimate that initially says something like "7 days", but keeps dropping wildly (e.g. "23 hours", "45 minutes", "1 min. 50 sec", etc) with each successive estimation as the chunks are downloaded. To avoid the...
0
0
0
0
1
0
I cannot understand why this throws undefined reference to `floor'": double curr_time = (double)time(NULL); return floor(curr_time); Hasn't it been casted to double, which is what floor receives?
0
0
0
0
1
0
I've been playing around with a set of templates for determining the correct promotion type given two primitive types in C++. The idea is that if you define a custom numeric template, you could use these to determine the return type of, say, the operator+ function based on the class passed to the templates. For examp...
0
0
0
0
1
0
I have a set of points like: pointA(3302.34,9392.32), pointB(34322.32,11102.03), etc. I need to scale these so each x- and y-coordinate is in the range (0.0 - 1.0). I tried doing this by first finding the largest x value in the data set (maximum_x_value), and the largest y value in the set (minimum_y_value). I then did...
0
0
0
0
1
0
I Hear that google uses up to 7-grams for their semantic-similarity comparison. I am interested in finding words that are similar in context (i.e. cat and dog) and I was wondering how do I compute the similarity of two words on a n-gram model given that n > 2. So basically given a text, like "hello my name is blah blah...
0
1
0
1
0
0
Basically I did the Cavendish experiment, and I have a damped sinusoidal wave plotted on Excel. With Position (mm) against Time (s). My problem is that I have added a tread line through the wave function, and wish to calculate the points of which the wave function intersects the tread line. From this I will then be abl...
0
0
0
0
1
0
I'm using emacs and auctex to write LaTeX documents. For some reason, M-e doesn't move to the end of the sentence in tex-mode as it did when I went through the tutorial. It moves to the end of the paragraph. (That is, it moves to just before the next double line break) What is wrong? Do I need to turn on/off some mode ...
0
1
0
0
0
0
I am trying to solve the problem Secret Code on SPOJ, and it's obviously a math problem. The full problem For those who are lazy to go and read, it's like this: a0, a1, a2, ..., an - sequence of N numbers B - a Complex Number (has both real and imaginary components) X = a0 + a1*B + a2*(B^2) + a3*(B^3) + ... + an*(B^n)...
0
0
0
0
1
0
While writing a model editor, besides enabling raytracing I can think about couple of operations where I'd like to find an very good approximation about the intersection point between a ray and a triangular bezier patch. How to do this? I know couple of ways but likely there's better ones. Exact use-cases: I might want...
0
0
0
0
1
0
I am working with a hexagonal grid. I have chosen to use this coordinate system because it is quite elegant. This question talks about generating the coordinates themselves, and is quite useful. My issue now is in converting these coordinates to and from actual pixel coordinates. I am looking for a simple way to find ...
0
0
0
0
1
0
I have a system which uploads to a server file by file and displays a progress bar on file upload progress, then underneath a second progress bar which I want to indicate percentage of batch complete across all files queued to upload. Information and algorithms I can work out are: Bytes Sent / Total Bytes To Send = Fir...
0
0
0
0
1
0
I'm in the situation where i need to do some math related stuff in c# and for that i need some external libarys. The tool i look for should do the following actions: Process sound(wave/mp3): Normalize the amplitude Normalize the phase Any idea which way to go? And is there a big difference if I should to it on mp3...
0
0
0
0
1
0
I am about to embark on a new project - a video website. Users will be able to register, and vote on videos by clicking "like" or "dislike", or something to that effect. In any event, it will be a 2-option voting system, not a 5-star system. Every X number of days, I will be generating a "chart" of the most popular vi...
0
0
0
0
1
0
I particularly like the transduce feature offered by agfl in their EP4IR http://www.agfl.cs.ru.nl/EP4IR/english.html The download page is here: http://www.agfl.cs.ru.nl/download.html Is there any way i can make use of this in a c# program? Do I need to convert classes to c#? Thanks :)
0
1
0
0
0
0
I need to generate a series of N random binary variables with a given correlation function. Let x = {xi} be a series of binary variables (taking the value 0 or 1, i running from 1 to N). The marginal probability is given Pr(xi = 1) = p, and the variables should be correlated in the following way: Corr[ xi xj ] = const ...
0
0
0
0
1
0
Forgive me if this is a dumb beginners problem, but I really don't get it. I have a member variable declared like so: public Double Value; When I assign 3.14159265 to Value and try to compute the sine of it, this happens: system.out.println(Value.toString()); //outputs 3.14159265 Value = Math.sin(Value); system.out.pr...
0
0
0
0
1
0
I am currently in the planning stages of a game for google app engine, but cannot wrap my head around how I am going to handle AI. I intend to have persistant NPCs that will move about the map, but short of writing a program that generates the same XML requests I use to control player actions, than run it on another s...
0
1
0
0
0
0
how can i calculate the polynomial that has the tangent lines (1) y = x where x = 1, and (2) y = 1 where x = 365 I realize this may not be the proper forum but I figured somebody here could answer this in jiffy. Also, I am not looking for an algorithm to answer this. I'd just like like to see the process. Thanks. I gu...
0
0
0
0
1
0
I'm trying to write a function : Input: Source range, Source value, output range, curve type (Linear, smooth) Output: The output is the "source value" converted into the "output range" according to the curve type. I hope I am making sense here... Any ideas ? Thanks.
0
0
0
0
1
0
I'm looking for an algorithm that given two permutations of a sequence (e.g. [2, 3, 1, 4] and [4, 1, 3, 2]) calculates the cycles that are needed to convert the first into the second (for the example, [[0, 3], [1, 2]]). The link from mathworld says that Mathematica's ToCycle function does that, but sadly I don't have a...
0
0
0
0
1
0
Out of no particular reason I decided to look for an algorithm that produces all possible choices of k integers between 1...n, where the order amongst the k integer doesn't matter (the n choose k thingy). From the exact same reason, which is no reason at all, I also implemented it in C#. My question is: Do you see any...
0
0
0
0
1
0
I need to determine the amount left of a time cycle. To do that in C I would use fmod. But in ada I can find no reference to a similar function. It needs to be accurate and it needs to return a float for precision. So how do I determine the modulus of a Float in Ada 95? elapsed := time_taken mod 10.348; left := 10.34...
0
0
0
0
1
0