A simple percentage calculation. It wont return a value except 0.0 and I think once or twice it returned 100.0%. Other than that it won't do a thing. I have tried playing with the code in several different ways and it just wont work.
for (int loop = 1; loop < loopCount; loop++)
{
aa = r.nextInt(10+1);
...
I am creating a boxplot generator in Ruby, and I need to calculate some things.
Let's say I have this array:
arr = [1, 5, 7, 2, 53, 65, 24]
How can I find the lowest value (1), highest value (65), total (157), average (22.43) and median (7) from the above array?
Thanks
...
Hello,
I'm not able to understand the following multi-dimensional code. Could someone please clarify me?
int[][] myJaggedArr = new int [][]
{
new int[] {1,3,5,7,9},
new int[] {0,2,4,6},
new int[] {11,22}
};
May I know how it is different from the following code?
int[][] myArr = new int ...
Will anything like
[OperationContract]
[WebGet]
string IWannaRead(int[] ids);
work? And how to form a link\url (www.example.com/service.svc?ids=1,2,3,4,5,6,7,8) for the request?
...
In the following Perl code, I would expect to be referencing an array reference inside an array
#!/usr/bin/perl
use strict;
use warnings;
my @a=([1,2],[3,4]);
my @b = @$a[0];
print $b[0];
However it doesn't seem to work. I would expect it to output 1.
@a is an array of references
@b is $a[1] dereferenced (I think)
So what's the...
I would like to find the value in an array using the key.
like this:
$array=('us'=>'United', 'ca'=>'canada');
$key='ca';
How can i have the value 'canada'?
thanks.
...
Hi all,
I'm trying to use jquery to grab the entire link depending on it's class.
Here's my code:
<ul class="vm_catTigra">
<li><a class="mainlevel" href="/index.php&category_id=6">AAAAA</a></li>
<li><a class="mainlevel" href="/index.php&category_id=10">BBBBB</a></li>
<li><a class="sublevel" href="/index.php&category...
i have an filter array containing one drop shadow filter. trace is returning -1 instead of 0 for indexOf after it is tracing that the array contains the object. please explain.
trace(filterObject);
trace(displayObject.filters);
trace(displayObject.filters.indexOf(filterObject));
//outputs:
//
// [object DropShadowFilter]
// [object D...
Why this dont work:
int size = 2;
int array[size];
int main() {
return 0;
}
It says the error: array bound is not an integer constant
And this work:
int size = 2;
int main() {
int array[size];
return 0;
}
Anyone knows the reason??'
thanks
...
I have objects that have comments. As part of a periodic email summary, I want to determine comments for a period, and present the objects in the order of oldest commented object first.
Data:
object_id comment_id
30 40
40 42
32 41
30 43
32 44
Output:
Object #30
comment 40
comment 43
Objec...
Let's imagine we should get some data...
var data = [];
//some code omitted that might fill in the data (though might not)
Then we need to do something with the data. And my question is how to do it more effectively. Like so?:
if (data.length) {
for (var i = 0; i < data.length; i++) {
//iterate over the data and do somet...
Hi,
I am using below code to find an array inside parent array but it is not working that is retuning empty even though the specified key exits in the parent array
$cards_parent = $feedData['BetradarLivescoreData']['Sport']['Category']['Tournament']['Match'];
$cards = array();
foreach($cards_parent as $key => $card)
{
if ($key ===...
Possible Duplicate:
How do you convert Byte Array to Hexadecimal String, and vice versa, in C#?
For testing my encryption algorithm I have being provided keys, plain text and their resulting cipher text.
The keys and plaintext are in strings
How do i convert it to a hex byte array??
Something like this : E8E9EAEBEDEEEFF0F2...
I am trying to find the location of an element in the array.
I have tried to use this code i generated
for(i=0;i<10;i++)
{
if (strcmp(temp[0],varptr[i])==0) j=i;
}
varptr is a pointer which points to array var[11][10] and it is by the definition *varptr[11][10]. I have assigned strings to var[i] and i want to get the "i" n...
If I have:
int c[] = new int[10];
and
int a[][] = new int[2][3];
and in generally
an n*m*..*j array
how can I calculate the real memory usage considering also the references variables?
...
Hi,
I have the following code:
static unsigned char S0_gif[] = {
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0f, 0x00, 0x0f, 0x00, 0x91, 0x02,
..
};
It's a hex representation of a gif file. I have 500 gifs that I need to store like that so I want to use a vector to make it easier for access.
Something like:
vector<char[]> gifs;
gif.pus...
I have a hierarchy of nodes stored in DB. I select all, store them in an array, then iterate over them and create a nested array in memory.
The input looks like this:
[{name: A}, {name: B}, {name: X, parent: A}, {name: Y, parent: A}, {name: C}]
The output looks like this:
[{name: A, children:[{name: X}, {name: Y}]}, {B}, {C}]
...
I am reaing from a file, and when i read, it takes it line by line, and prints it
what i want exactly is i want an array of char holding all the chars in the file and print it once,
this is the code i have
if(strcmp(str[0],"@")==0)
{
FILE *filecomand;
//char fname[40];
char line[100];
...
Hi, i'm trying to make a program that will scan each column of a guitar tab and play a note when it detects a number. I will do this by creating a char array and have the program scan each collumn of an int value. is this possible? if so, how do i do it?
...
I want to get a proxy list and parse it into an array of strings, txt is the proxy list, tmp[] is an array that has element in the form "ipaddr:port". ie. (tmp[] = {"i.p.i.p:port", "i.p.i.p:port", ...}). proxies array should be in 2d and look like this: {{"i.p.i.p","port"}, {"i.p.i.p","port"}, ...} but when running it java complains the ...