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'm trying to accomplish this in LaTeX:
⎡a⎤ ⎡b … n⎤
⎢⁞⎢ ⎢⁞ ⋱ ⁞⎢
⎣x⎦ ⎣y … z⎦
[a … x]
I'm able to get a vector + a matrix on one line, but I'm not sure how to align the vector below so that it sits perfectly under the large matrix.
Here's a less-unicode text representation of the 'drawing' above:
[a] [ b c ]
... | 0 | 0 | 0 | 0 | 1 | 0 |
In description logic, what is the difference between "someValuesFrom" and "allValuesFrom"?
In other words, the difference between (limited existential quantification) and (value restriction).
For example, consider this:
∆ = {a, b, c, d, e}
ext(B) = {<c,d>}
ext(R) = {<a,b>, <a,c>, <d,c>, <c,e>}
So what is the diff... | 0 | 0 | 0 | 0 | 1 | 0 |
I have implemented the A* algorithm in AS3 and it works great except for one thing.
Often the resulting path does not take the most “natural” or smooth route to the target.
In my environment the object can move diagonally as inexpensively as it can move horizontally or vertically.
Here is a very simple example; the st... | 0 | 1 | 0 | 0 | 0 | 0 |
I'm onto problem 245 now but have hit some problems. I've done some work on it already but don't feel I've made any real steps towards solving it. Here's what I've got so far:
We need to find n=ab with a and b positive integers. We can also assume gcd(a, b) = 1 without loss of generality and thus phi(n) = phi(ab) = phi... | 0 | 0 | 0 | 0 | 1 | 0 |
This is something related with Mathematics as well. But this is useful in computing as well.
Lets say you have 10 coordinates. (x1,y1)(x2,y2)..... in 2D Space. (i.e on a X-Y Plane). Can we find a single smooth curve going across the each coordinate.
While expanding the question, If the space is 3D, then can we find an... | 0 | 0 | 0 | 0 | 1 | 0 |
I've written a small function in C, which almost do the same work as standart function `fcvt'. As you may know, this function takes a float/double and make a string, representing this number in ANSI characters. Everything works ;-)
For example, for number 1.33334, my function gives me string: "133334" and set up specia... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm trying to find/write a function that would perform the same operation as imlincomb(). However, I am having trouble finding such functions in C++ without using any Matlab API functions other than Intel Performance Primitiives library, and I don't really want to purchase a license for it unless my application really ... | 0 | 0 | 0 | 0 | 1 | 0 |
I've been tasked with creating a simulation of people moving around. It could be a bunch of people walking through a restaurant or exiting a school. Searching around, I've found a bunch A* related stuff which is fine for one person but I will have a bunch. Is there a standard library people use for this stuff? Or a... | 0 | 1 | 0 | 0 | 0 | 0 |
I'm building a custom regression tree and want to use m-estimate for pruning.
Does anyone know how to calculate that.
http://www.ailab.si/blaz/predavanja/UISP/slides/uisp07-RegTrees.ppt might help (slide 12, how should Em look like?)
| 0 | 1 | 0 | 0 | 1 | 0 |
Suppose I have a column of heights -- how can I select all and only those height values that are neither in the top 30% of values nor the bottom 30% of values.
I'd like the answer for PostgreSQL (or, failing that, MySQL -- I'm using Rails).
| 0 | 0 | 0 | 0 | 1 | 0 |
how do i find out pixel value at certain degree on the circumference of a circle if I know the pixel co-ordinates of the center of the circle, radius of the circle ,and perpendicular angle.
Basically, I am trying to draw the hands of a clock at various times ( 1 o clock , 2 o clock etc )
| 0 | 0 | 0 | 0 | 1 | 0 |
we have a particle detector hard-wired to use 16-bit and 8-bit buffers. Every now and then, there are certain [predicted] peaks of particle fluxes passing through it; that's okay. What is not okay is that these fluxes usually reach magnitudes above the capacity of the buffers to store them; thus, overflows occur. On a ... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm looking for POD low dimension vectors (2,3 and 4D let say) with all the necessary arithmetic niceties (operator +, - and so on). POD low dimension matrices would be great as well.
boost::ublas vectors are not POD, there's a pointer indirection somewhere (vector are resizeable).
Can I find that anywhere in boost? Us... | 0 | 0 | 0 | 0 | 1 | 0 |
Background:
I was recently playing around with GDI+ to draw a "Disc" displaying a sweeping color change through 360 degrees. (I dug up some HSL to RGB code to loop through HSL(1,1,1) -> HSL(360,1,1))
Regarding the disc, I first drew a full solid circle using the above, and then a second circle in Grey over the center t... | 0 | 0 | 0 | 0 | 1 | 0 |
I regrettably haven't studied mathematics since I was 16 (GCSE level), I'm now a 27 year old C# developer.
Would it be a fruitless exercise trying to work through Structure and Interpretation of Computer Programs (SICP)?
What kind of mathematics standard is expected of the reader?
| 0 | 0 | 0 | 0 | 1 | 0 |
I have a list of points. Each point being an x and y coordinate (both of which are integers). Now I'm trying to find known patterns, such as lines, arcs or circles, knowing that the points are not perfectly on the pattern.
What's the best way to do it? I don't have many clues to get started.
Edit: the points are ordere... | 0 | 1 | 0 | 0 | 0 | 0 |
I've got two rectangles represented by structures that contain the x1, y1, x2, y2 coordinates. One rectangle can be considered the parent, another the child.
I already know how to detect if the child rectangle is within the parent rectangle; what I'm trying to figure out now is the simplest, fastest way to determine th... | 0 | 0 | 0 | 0 | 1 | 0 |
In other answers at Stackoverflow it's been suggested that Weka is good, but there are others (Classifier4j, jBNC, Naiban).
Does anyone have actual experience with these?
| 0 | 0 | 0 | 1 | 0 | 0 |
This one seems quite stupid, but I'm struglling from an hour to do this,
How to Draw the Sine Wave in WPF??
Thanks
| 0 | 0 | 0 | 0 | 1 | 0 |
I am trying to implement a Point3.Slerp method, so was looking for some samples but the ones I found seems like it's a whole brand new class to host all the code.
Is there a simple, straightforward way to implement it? Basically the ones I have seen was using Matrix types. Can I implement Slerp without matrices, or wou... | 0 | 0 | 0 | 0 | 1 | 0 |
I've got a manually created NavGraph in a 3D environment. I understand (and have implemented previously) an A* routine to find my way through the graph once you've 'got on the graph'.
What I'm interested in, is the most optimal way to get onto and 'off' the Graph.
Ex:
So the routine go's something like this:
Shoot a ra... | 0 | 1 | 0 | 0 | 0 | 0 |
Google has suggestion come up when you make a typo entry,how do they do it?
| 0 | 0 | 0 | 1 | 0 | 0 |
I am trying to solve a problem involving printing the product of all divisors of a given number. The number of test cases is a number 1 <= t <= 300000 , and the number itself can range from 1 <= n <= 500000
I wrote the following code, but it always exceeds the time limit of 2 seconds. Are there any ways to speed up the... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm having problem regarding max and sqrt
If I include math.h it coudn't find sqrt.
So I view the cmath header file and inside it includes math.h, but when I try to open math.h it says that file is not found. SO ithink my math.h is missing in Linux.
| 0 | 0 | 0 | 0 | 1 | 0 |
I have implemented a full text search in a discussion forum database and I want to display
the search results in a way Google does. Even for a very long html page only a two or three
lines of the texts displayed in a search result list. Usually these are the lines
which contain a search terms.
What would be the good a... | 0 | 1 | 0 | 0 | 0 | 0 |
I have some code:
int CalculateAckermann(int x, int y)
{
if(!x)
{
return y++;
}
if(!y)
{
return CalculateAckermann(x--,1);
}
else
{
return CalculateAckermann(x--, CalculateAckermann(x, y--));
}
}
Designed to calculate the ackermann function. Above a fairly lo... | 0 | 0 | 0 | 0 | 1 | 0 |
My math is bad, real bad. So bad I'm struggling to even phrase this question, but here goes.
The situation is train travel and you have four arrays to work with.
Leaving_Stations
Arriving_Stations
Leaving_Dates
Returning_Dates
So let's say you're only interested in one way routes and you need to figure out how many co... | 0 | 0 | 0 | 0 | 1 | 0 |
Is there any JavaScript library that can be used for calculations involving 700+ Digits?
Also, how about the same thing in C++?
| 0 | 0 | 0 | 0 | 1 | 0 |
I am trying to map a trajectory path between two point. All I know is the two points in question and the distance between them. What I would like to be able to calculate is the velocity and angle necessary to hit the end point.
I would also like to be able to factor in some gravity and wind so that the path/trajector... | 0 | 0 | 0 | 0 | 1 | 0 |
Say you've got a toy grammar, like: (updated so the output looks more natural)
S -> ${NP} ${VP} | ${S} and ${S} | ${S}, after which ${S}
NP -> the ${N} | the ${A} ${N} | the ${A} ${A} ${N}
VP -> ${V} ${NP}
N -> dog | fish | bird | wizard
V -> kicks | meets | marries
A -> red | striped | spotted
e.g., "the dog kic... | 0 | 1 | 0 | 0 | 0 | 0 |
I have been developing (for the last 3 hours) a small project I'm doing in C# to help me choose a home.
Specifically, I am putting crime statistics in an overlay on Google maps, to find a nice neighborhood.
Here is an example:
http://otac0n.com/Demos/prospects.html
Now, I manually found the Lat and Lng to match the cor... | 0 | 0 | 0 | 0 | 1 | 0 |
I was hoping someone that is good with math and loops could help me out. I'm writing a program in Objective C where I need to come up with a way to do a cycle. If you don't know Objective C I would appreciate any help in pseudo code just to help me figure this out.
What I need is a scale that is based on two dates. I k... | 0 | 0 | 0 | 0 | 1 | 0 |
This question is purely out of curiosity. I am off school for the summer, and was going to implement an algorithm to solve this just for fun. That led to the above question, how hard is this problem?
The problem: you are given a list of positive integers, a set of mathematical operators and the equal sign(=). can you c... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm trying to add a fade effect to my form by manually changing the opacity of the form but I'm having some trouble calculating the correct value to increment by the Opacity value of the form.
I know I could use the AnimateWindow API but it's showing some unexpected behavior and I'd rather do it manually anyways as to ... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm trying to estimate, for back-of-the-napkin calculation purposes, how many different device drivers are available for Windows. I'm trying to understand what it might take in terms of size of collected data and processing power what would be required to do some statistical analysis of drivers.
Anybody have any refer... | 0 | 0 | 0 | 1 | 0 | 0 |
I'm trying to figure out a way to distribute a sum S over N different operands (b1, b2, .., bn), where b1, b2, ... bn are in a fixed ratio, which is determined by another set of operands (a1,a2, .. an)
Consider a situation where:
Candidate A gets a total of Ta votes from N constituencies, with distribution: {a1, a2, a3... | 0 | 0 | 0 | 0 | 1 | 0 |
How to move circle in a circular path like knob tune?
| 0 | 0 | 0 | 0 | 1 | 0 |
I am afraid the question is a bit technical, but I hope someone might have stumbled into a similar subject, or give me a pointer of some kind.
If G is a group (in the sense of algebraic structure), and if g1, ..., gn are elements of G, is there an algorithm (or a function in some dedicated program, like GAP) to determi... | 0 | 0 | 0 | 0 | 1 | 0 |
I am looking for a way to uniformly choose values in GF(2^M) between two bounds.
GF(2^M) is a Galois Field - See GF(4) as defined on this page - http://www.math.umbc.edu/~campbell/Math413Spr09/Notes/12-13_Finite_Fields.html
From a technical, non-math perspective, this is most similar to CRC operations.
For example... | 0 | 0 | 0 | 0 | 1 | 0 |
My data structure is initialized as follows:
[[0,0,0,0,0,0,0,0] for x in range(8)]
8 characters, 8 rows, each row has 5 bits for columns, so each integer can be in the range between 0 and 31 inclusive.
I have to convert the number 177 (can be between 0 and 319) into char, row, and column.
Let me try again, this time w... | 0 | 0 | 0 | 0 | 1 | 0 |
Some Duplicates:
1.265 * 10000 = 126499.99999999999 ?????
How is floating point stored? When does it matter?
Strange floating-point behaviour in a Java program
Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?
Error in Flash addition
I divide 23 by 40 (23/40). In C this operati... | 0 | 0 | 0 | 0 | 1 | 0 |
Kernel-based classifier usually requires O(n^3) training time because of the inner-product computation between two instances. To speed up the training, inner-product values can be pre-computed and stored in a two-dimensional array. However when the no. of instances is very large, say over 100,000, there will not be suf... | 0 | 0 | 0 | 1 | 0 | 0 |
I intend to use a multi layer perceptron network trained with backpropagation (one hidden layer, inputs served as 8x8 bit matrices containing the B/W pixels from the image). The following questions arise:
which type of learning should I use: batch or on-line?
how could I estimate the right number of nodes in the hidde... | 0 | 1 | 0 | 0 | 0 | 0 |
Is there an algorithm that can be used to determine whether a sample of data taken at fixed time intervals approximates a sine wave?
| 0 | 0 | 0 | 0 | 1 | 0 |
I have a table which indexes the locations of words in a bunch of documents.
I want to identify the most common bigrams in the set.
How would you do this in MSSQL 2008?
the table has the following structure:
LocationID -> DocID -> WordID -> Location
I have thought about trying to do some kind of complicated join... an... | 0 | 1 | 0 | 0 | 0 | 0 |
I'm currently working on building a game which is on a planet, the way in which I'm planning to store the data is in 6 2dimensional arrays, which are heightmaps around the sphere (on the faces of a cube).
The problem I have is this, given a normalised vector which points outwards from the centre of the sphere how can I... | 0 | 0 | 0 | 0 | 1 | 0 |
I am trying to calculate an initial buffer size to use when decompressing data of an unknown size. I have a bunch of data points from existing compression streams but don't know the best way to analyze them.
Data points are the compressed size and the ratio to uncompressed size.
For example:
100425 (compressed size) x... | 0 | 0 | 0 | 0 | 1 | 0 |
Odd question here not really code but logic,hope its ok to post it here,here it is
I have a data structure that can be thought of as a graph.
Each node can support many links but is limited to a value for each node.
All links are bidirectional. and each link has a cost. the cost depends on euclidian difference between ... | 0 | 0 | 0 | 0 | 1 | 0 |
I have some data, up to a between a million and a billion records, each which is represented by a bitfield, about 64 bits per key. The bits are independent, you can imagine them basically as random bits.
If I have a test key and I want to find all values in my data with the same key, a hash table will spit those out ve... | 0 | 0 | 0 | 0 | 1 | 0 |
I have a bit of a strange question. Can anyone tell me where to find information about, or give me a little bit of an introduction to using shortest path algorithms that use a hill climbing approach? I understand the basics of both, but I can't put the two together. Wikipedia has an interesting part about solving the T... | 0 | 1 | 0 | 0 | 0 | 0 |
I've coded a function that crops an image to a given aspect ratio and finally then resizes it and outputs it as JPG:
<?php
function Image($image, $crop = null, $size = null)
{
$image = ImageCreateFromString(file_get_contents($image));
if (is_resource($image) === true)
{
$x = 0;
$y = 0;
... | 0 | 0 | 0 | 0 | 1 | 0 |
This is probably a silly and easy question, but it seems sometimes the simplest things give me more problems!
This formula is suppose to give me a number between 0 and 100.
(200 / 23) * Abs(Mod(2987, 23) - 23 / 2)
In objective C I coded it like this:
(200 / 23) * abs(2987 % 23) - (23 / 2);
Is the formula flawed (and ... | 0 | 0 | 0 | 0 | 1 | 0 |
Logic error problem with the Gaussian Elimination code...This code was from my Numerical Methods text in 1990's. The code is typed in from the book- not producing correct output...
Sample Run:
SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
USING GAUSSIAN ELIMINATION
This program uses Gaussian Eliminatio... | 0 | 0 | 0 | 0 | 1 | 0 |
On a PHP & CodeIgniter-based web site, users can earn reputation for various actions, not unlike Stack Overflow. Every time reputation is awarded, a new entry is created in a MySQL table with the user_id, action being rewarded, and value of that bunch of points (e.g. 10 reputation). At the same time, a field in a users... | 0 | 0 | 0 | 0 | 1 | 0 |
I know that you can split a power-of-two number in half like so:
halfintR = some32bitint & 0xFFFF
halfintL = some32bitint >> 16
can you do the same thing for an integer which is bounded by a non-power of two space?
(say that you want your range to be limited to the set of integers that will fit into 4 digit base 52 sp... | 0 | 0 | 0 | 0 | 1 | 0 |
Could you guys please tell me how I can make the following code more pythonic?
The code is correct. Full disclosure - it's problem 1b in Handout #4 of this machine learning course. I'm supposed to use newton's algorithm on the two data sets for fitting a logistic hypothesis. But they use matlab & I'm using scipy
Eg on... | 0 | 0 | 0 | 1 | 0 | 0 |
I was looking for a numeric representation for a date and unix time for midnight (in UTC) seems to be reasonable choice for that. However, as I'm not sure in my math skills, so is
date = date - date % (24 * 60 * 60);
where date is unix timestamp, the way to do that? Is there any simpler method?
| 0 | 0 | 0 | 0 | 1 | 0 |
I'm writing a vertex shader at the moment, and I need some random numbers. Vertex shader hardware doesn't have logical/bit operations, so I cannot implement any of the standard random number generators.
Is it possible to make a random number generator using only standard arithmetic? the randomness doesn't have to be pa... | 0 | 0 | 0 | 0 | 1 | 0 |
I am wanting some expert guidance here on what the best approach is for me to solve a problem. I have investigated some machine learning, neural networks, and stuff like that. I've investigated weka, some sort of baesian solution.. R.. several different things. I'm not sure how to really proceed, though. Here's my ... | 0 | 0 | 0 | 1 | 0 | 0 |
Just trying to figure out the proper and safer way to execute mathematical operation passed as string. In my scenario it is values fetched from image EXIF data.
After little research I found two way of doing it.
first, using eval:
function calculator1($str){
eval("\$str = $str;");
return $str;
}
second, using ... | 0 | 0 | 0 | 0 | 1 | 0 |
In short:
Given that a is coprime to b if GCD(a,b) = 1 (where GCD stands for great common divisor), how many positive integers below N are coprime to N?
Is there a clever way?
Not necessary stuff
Here is the dumbest way:
def count_coprime(N):
counter = 0
for n in xrange(1,N):
if gcd(n,N) == 1:
... | 0 | 0 | 0 | 0 | 1 | 0 |
I have a task to draw a circle and then fill in with the most amount of circles without touching the sides. I can draw the circle, and I can make loops to pack the circle in a hexagonal/honeycomb format, but can't control whether they are inside or outside the circle.
I have used this: g.drawOval(50, 50, 300, 300); to ... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm writing an application draws in another application's window (this is under OS X with Cocoa, but the question is general enough that I hope it won't be bogged down by operating system / framework issues), and I'm running into a problem which seems like it should have a simple answer, but it's driving me absolutely... | 0 | 0 | 0 | 0 | 1 | 0 |
Can you tell me any ways to generate non-uniform random numbers?
I am using Java but the code examples can be in whatever you want.
One way is to create a skewed distribution by adding two uniform random numbers together (i.e. rolling 2 dice).
| 0 | 1 | 0 | 0 | 0 | 0 |
Is there a natural language parser for date/times in ColdFusion?
| 0 | 1 | 0 | 0 | 0 | 0 |
I'd like to build a PokerBot (and a few other games) for the intellectual challenge. However, I only want to do this in an ethical and legal way.
So, I need a game server where all players and the game operator know that I'm running a pokerbot. Where that's not cheating but the norm. Perhaps even where being a human is... | 0 | 1 | 0 | 0 | 0 | 0 |
I need to evaluate if two sets of 3d points are the same (ignoring translations and rotations) by finding and comparing a proper geometric hash. I did some paper research on geometric hashing techniques, and I found a couple of algorithms, that however tend to be complicated by "vision requirements" (eg. 2d to 3d, occl... | 0 | 0 | 0 | 0 | 1 | 0 |
Math escapes me today.
How do I find the X speed and the Y speed of an object if it is going at a defined speed (say, 5 pixels/second) at a 45 degree angle?
| 0 | 0 | 0 | 0 | 1 | 0 |
I know this is more a Math/Formal Language/Automata/Computer science question than an a programming one, but I hope I can get some advice on a comprehensible textbook (not an indecipherable monograph) on formal logic beyond Propositional and Predicate Calculus. I’m especially interested in monadic second order logic an... | 0 | 0 | 0 | 0 | 1 | 0 |
I want to implement some applications with n-grams (preferably in PHP).
Which type of n-grams is more adequate for most purposes? A word level or a character level n-gram? How could you implement an n-gram-tokenizer in PHP?
First, I would like to know what N-grams exactly are. Is this correct? It's how I understand ... | 0 | 1 | 0 | 0 | 0 | 0 |
Is there any way to calculate the largest outcome from an Rijndael encryption with a fixed array length?
Encryption method: RijndaelManaged
Padding: PKCS7
CipherMode: CBC
BlockSize 128
KeySize: 128
I need this as im converting a database where all string are going to be encrypted so i need to change the size of all str... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm writing a very basic parser(mostly just to better understand how they work) that takes a user's input of a select few words, detects whether the sentence structure is OK or Not OK, and outputs the result. The grammar is:
Sentence:
Noun Verb
Article Sentence
Sentence Conjunction Sentence
Conjunction:
"and"
"or"
"but... | 0 | 1 | 0 | 0 | 0 | 0 |
I would like to have something that looks something like this. Two different colors are not nessesary.
(source: sourceforge.net)
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... | 0 | 0 | 0 | 0 | 1 | 0 |
Possible Duplicate:
how to generate pseudo-random positive definite matrix with constraints on the off-diagonal elements?
The user wants to impose a unique, non-trivial, upper/lower bound on the correlation between every pair of variable in a var/covar matrix.
For example: I want a variance matrix in which all varia... | 0 | 0 | 0 | 0 | 1 | 0 |
At present I have a control to which I need to add the facility to apply various acuteness (or sensitivity). The problem is best illustrated as an image:
Graph http://img87.imageshack.us/img87/7886/control.png
As you can see, I have X and Y axess that both have arbitrary limits of 100 - that should suffice for this exp... | 0 | 0 | 0 | 0 | 1 | 0 |
There are two sorts of TV: Traditional ones that have an aspect ratio of 4:3 and wide screen ones that are 16:9. I am trying to write a function that given the diagonal of a 16:9 TV gives the diagonal of a 4:3 TV with the equivalent height. I know that you can use Pythagoras' theorem to work this out if I know two of t... | 0 | 0 | 0 | 0 | 1 | 0 |
Here's the background... in my free time I'm designing an artillery warfare game called Staker (inspired by the old BASIC games Tank Wars and Scorched Earth) and I'm programming it in MATLAB. Your first thought might be "Why MATLAB? There are plenty of other languages/software packages that are better for game design."... | 0 | 1 | 0 | 0 | 0 | 0 |
What i am really looking for is a maths equation function that takes in a string representing and equation and calculates the answer as a return type
For Example
"(((4 * 5) + 6) * 2) / 8"
OutPut: 6.5
So in coding tearms something like
print calc("(((4 * 5) + 6) * 2) / 8");
Is there already a class or a function that ... | 0 | 0 | 0 | 0 | 1 | 0 |
I have this bit of VB6 sliced out of a project I'm working on:
Public Function C_Ln(c As ComplexNumber) As ComplexNumber
Set C_Ln = toComplex(Log(C_Abs(c)), Atan2(c.Imag, c.Real))
End Function
The VB6 Log() function is base-e. I'd like to cook up versions of this to do base-2, base-10 and base-n. Where do I start?... | 0 | 0 | 0 | 0 | 1 | 0 |
I have three colors in an array, array('blue', 'red', 'green'), and in my loop, I want to be able to print blue, red, green, blue, red, green.
I know that I could just reset a counter every 3 loops, and use that to find the color I want - 1, 2, 3, reset, 1, 2, 3, reset, etc. But is there a simple way to pass it the cu... | 0 | 0 | 0 | 0 | 1 | 0 |
How can I calculate a point (X,Y) a specified distance away, on a rotated axis? I know what angle I'd like the point "moving" along (in degrees).
| 0 | 0 | 0 | 0 | 1 | 0 |
I have followed an article on Speech Recognition with Delphi (SAPI 5.3).
http://edn.embarcadero.com/article/29583
I created a basic application. but the problem is that the application has got it all wrong !
it doesn't get what I am saying correctly. if i say for example : "word", it get "ward". and so on.
is there any... | 0 | 1 | 0 | 0 | 0 | 0 |
I've been having fun rendering charts and graphs from co-ordinates lately, and I'm fascinated by using matrices to transform co-ordinate spaces.
I've been able to successfully scale and invert 2 dimensional co-ordinate spaces, but now my appetite is whetted. :)
Where can I go for clear, informative, (free), educational... | 0 | 0 | 0 | 0 | 1 | 0 |
I have quite an interesting task at work - I need to find out how much time user spent doing something and all I have is timestamps of his savings. I know for a fact that user saves after each small portion of a work, so they is not far apart.
The obvious solution would be to find out how much time one small item could... | 0 | 0 | 0 | 0 | 1 | 0 |
I have an array of points. I want to know if this array of point represents a circle, a square or a triangle.
Where should i begin? (i use C#)
Thanks
Jon
| 0 | 0 | 0 | 0 | 1 | 0 |
Does such function exist? I created my own but would like to use an official one:
private function opposite(number:Number):Number
{
if (number < 0)
{
number = Math.abs(number);
}
else
{
number = -(number);
}
return number;
}
So, -5 becomes 5 and 3 becomes -3.
Edit:
Forgive m... | 0 | 0 | 0 | 0 | 1 | 0 |
I am creating a game where I want to determine the intersection of a single line. For example if I create a circle on the screen I want to determine when I have closed the circle and figure out the points that exist within the area.
Edit: Ok to clarify I am attempting to create a lasso in a game and I am attempting to ... | 0 | 0 | 0 | 0 | 1 | 0 |
Forgive me if this is a naïve question, however I am at a loss today.
I have a simple division calculation such as follows:
double returnValue = (myObject.Value / 10);
Value is an int in the object.
I am getting a message that says Possible Loss of Fraction. However, when I change the double to an int, the message goe... | 0 | 0 | 0 | 0 | 1 | 0 |
I am trying a couple of tutorials from http://nehe.gamedev.net, in order to learn openGL programming, I would like to position spheres along a Bezier curve such that they appear as a string of pearls. how can I position such spheres along the curve. I am drawing the curve using de Casteljau's algorithm and hence can ge... | 0 | 0 | 0 | 0 | 1 | 0 |
I have an unordered tree.
Each node represents a task that can be done (1), not done (0) or have children tasks.
For example:
1
-1.1
-1.2
--1.2.1
--1.2.2
-1.3
2
3
-3.1
4
-4.1
--4.1.1
5
Suppose that the leaves 1.2.1, 3.1 and 5 are done
1
-1.1
-1.2
--1.2.1*
--1.2.2
-1.3
2
3
-3.1*
4
-4.1
--4.1.1
5*
I want to calculate ... | 0 | 0 | 0 | 0 | 1 | 0 |
I'm writing a Mahjong Game in C# (the Chinese traditional game, not the solitaire kind). While writing the code for the bot player's AI, I'm wondering if a functional language like F# would be a more suitable language than what I currently use which is C# with a lot of Linq. I don't know much about F# which is why I as... | 0 | 1 | 0 | 0 | 0 | 0 |
Say I want to display a graph of today's stock market. I gather all my data, and I go to display the graph...is there a well known formula to set the upper and lower bounds to?
Do I need to factor in all the data on the stock market from the last year to get some context?
In some ways this is a design/math question, b... | 0 | 0 | 0 | 0 | 1 | 0 |
When Excel determines the axis values it will use to represent your data in a chart, the values are 'evenly distributed'.
For Example:
If you plot the following series in an Excel Line Chart.
[0.22,0.33,0.44,0.55,0.66,0.77,0.88,0.99,1.1,1.21,1.32,1.43,1.54,1.65,1.76,1.87,1.98,2.09,2.2]
Excel determines that the y-axis ... | 0 | 0 | 0 | 0 | 1 | 0 |
Hmmm. Consider this program, whose goal is to figure out the best way to get the bottom 16 bits of an integer, as a signed integer.
public class SignExtend16 {
public static int get16Bits(int x)
{
return (x & 0xffff) - ((x & 0x8000) << 1);
}
public static int get16Bits0(int x)
{
r... | 0 | 0 | 0 | 0 | 1 | 0 |
Im looking to make my own implementation of these Identicons or Gravatars found here on StackOverflow. Most questions I could found was about utilizing existing 3rd party libraries, especially those hooked with Gravatar.
(source: levitated.net)
After some searching I stumbled upon this page. And from the looks of it,... | 0 | 0 | 0 | 0 | 1 | 0 |
I need to initialize some three dimensional points, and I want them to be equally spaced throughout a cube. Are there any creative ways to do this?
I am using an iterative Expectation Maximization algorithm and I want my initial vectors to "span" the space evenly.
For example, suppose I have eight points that I want to... | 0 | 0 | 0 | 0 | 1 | 0 |
I have an object, that is facing a particular direction with (for instance) a 45 degree field of view, and a limit view range. I have done all the initial checks (Quadtree node, and distance), but now I need to check if a particular object is within that view cone, (In this case to decide only to follow that object if ... | 0 | 1 | 0 | 0 | 0 | 0 |
The code below projects the blue vector, AC, onto the red vector, AB, the resulting projected vector, AD, is drawn as purple. This is intended as my own implementation of this Wolfram demonstration.
Something is wrong however and I can really figure out what. Should be either that the projection formula itself is wrong... | 0 | 0 | 0 | 0 | 1 | 0 |
In C++ we can rotate a point about an arbitrary axis:
void radRotateAxis( float a, float b, float c, float theta )
{
float newX = (
x*( a*a*(1-cos(theta)) + cos(theta) ) +
y*( a*b*(1-cos(theta)) - c*sin(theta) ) +
z*( a*c*(1-cos(theta)) + b*sin(theta) ) );
float newY = (
x*( a*b*... | 0 | 0 | 0 | 0 | 1 | 0 |
Today I encountered this article about decimal expansion and I was instantaneously inspired to rework my solution on Project Euler Problem 26 to include this new knowledge of math for a more effecient solution (no brute forcing). In short the problem is to find the value of d ranging 1-1000 that would maximize the leng... | 0 | 0 | 0 | 0 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.