Can anyone tell me how do this? They are already integers, so I'm not sure what to try...
var lrgSlideShow = {
activeClass: 'active',
wrapperClass: 'slideshow-widget-large',
pauseLength: 2000,
fadeLength: 1000
}
setInterval(changeImg,lrgSlideShow.pauseLength+lrgSlideShow.fadeLength);
...
Greetings everybody. I have seen examples of such operations for so many times that I begin to think that I am getting something wrong with binary arithmetic. Is there any sense to perform the following:
byte value = someAnotherByteValue & 0xFF;
I don't really understand this, because it does not change anything anyway. Thanks for hel...
Hello there, I have written some general functions to convert between decimal and any other base-n number system(n<=36 for now) and vice-versa. Don't want to make things messy here so i have posted the code here.
Could anybody suggest any better way for this? May be more effective and Rubyish?
Thanks
...
I have the following piece of pseudo-C/Java/C# code:
int a[]= { 30, 20 };
int b[] = { 40, 50 };
int c[] = {12, 12};
How do I compute the cross-product ABxAC?
...
Try running this in a .VBS file
MsgBox(545.14-544.94)
You get a neat little answer of 0.199999999999932!
This rounding issue also occurs unfortunately in Sin(2 * pi) since VB can only ever see the (user defined) variable pi as accurate as 3.14159265358979.
Is rounding it manually (and loosing accuracy) the only way to improve the re...
I'm wondering if it's possible to find all points by longitude and latitude within X radius of one point?
So, if I provide a latitude/longitude of -76.0000, 38.0000, is it possible to simply find all the possible coordinates within (for example) a 10 mile radius of that?
I know that there's a way to calculate the distance between t...
How to create the transformation matrix (4x4) that transforms a cylinder (of height 1 and diameter 1) into a cone that represents my spotlight (position, direction and cutoff angle) ?
--edit--
In other words: how to draw the cone that represents my spotlight by drawing a cylinder through a suitable transformation matrix.
--edit2--
The ...
Hello. I am having a real headache trying to set a node's local position to match a given world position.
I was given a solution but, AFAICS, it only takes into account orientation and position but NOT scaling :
node_new_local_position = node_parent.derivedOrientation().Inverse() * ( world_position_to_match - node_parent.derivedPositio...
I'm trying to calculate the sunset / rise times using python based on the link provided below.
My results done through excel and python do not match the real values. Any ideas on what I could be doing wrong?
My Excel sheet can be found under .. http://transpotools.com/sun_time.xls
# Created on 2010-03-28
# @author: dassouki
# @source...
I'm using .net WPF geometry classes to graph waveforms. I've been using the matrix transformations to convert from the screen coordinate space to my coordinate space for the waveform. Everything works great and it's really simple to keep track of my window and scaling, etc. I can even use the inverse transform to calculate the mouse po...
Ok I am trying to make something to ask you random multiplication questions. Now it asks the questions fine. Generates the random questions fine. But when it reloads the page the random numbers are different...
how can I fix this?
<?php
$rndnum1 = rand(1, 12);
$rndnum2 = rand(1, 12);
echo "<h3>". $rndnum1 . " x ";
echo $rndnum2 . "...
So given x, and power, n, solve for X^n.
There's the easy way that's O(n)...
I can get it down to O(n/2), by doing
numSquares = n/2;
numOnes = n%2;
return (numSquares * x * x + numOnes * x);
Now there's a O(log(n)) solution, does anyone know how to do it? It can be done recursively.
...
If I have a method for calculating the greatest common divisor of two integers as:
public static int GCD(int a, int b)
{
return b == 0 ? a : GCD(b, a % b);
}
What would be the best way to attach that to the System.Math class?
Here are the three ways I have come up with:
public static int GCD(this int a, int b)
{
return b == ...
Can anyone help me with example on using lapack with latest f#? Or it is not recommended for now?
I searched and only find http://fdatamining.blogspot.com/ but was not able to get FSharp.PowerPack.Math.Providers.dll compiled.
EDIT:
@Yin, Thanks for your blog. On compiling FSharp.PowerPack.Math.Providers.dll from 1.9.7.8 source, Micros...
Given a simple data set, I would like to be able to calculate a trending formula given it's a second order polynomial regression.
In fact, it would be great if one could even forecast X periods during calculation (similar to what Excel does).
I'm looking for a portable C/C++ package that's relatively easy to use, and allows it to spit ...
How can I write mathematics formula in actionscipt2.0? As following:
Thanks all!
...
I want to test if a number double x is an integer power of 10. I could perhaps use cmath's log10 and then test if x == (int) x?
edit: Actually, my solution does not work because doubles can be very big, much bigger than int, and also very small, like fractions.
...
Hi, I am unsure how to put this and my math skills aren't that strong. But here's what I need.
I want to generate a list of all the 16bit integers (0-65535). But everytime I do so I want to seed the algorithm randomly that each time the list starts with a different integer and all the subsequent integers will be generated once but also ...
echo 3+3
How can I evaluate such expressions in Bash, in this case to 6?
...
Which programming language or a library is able to process infinite series (like geometric or harmonic)? It perhaps must have a database of some well-known series and automatically give proper values in case of convergence, and maybe generate an exception in case of divergence.
For example, in Python it could look like:
sum = 0
sign =...