I'd like to sum one particular row of a large NumPy array. I know the function array.max() will give the maximum across the whole array, and array.max(1) will give me the maximum across each of the rows as an array. However, I'd like to get the maximum in a certain row (for example, row 7, or row 29). I have a large array, so getting the...
Any help here as I'm a C# noob. The following code works fine and returns 1 string ViewState2. I'd like it to return an array of ViewState2 and EventValidation2 so I can manipulate it later on. How would I convert the code below to return an array?
public string get_status(string local_fname)
{
var dts_doc = new HtmlA...
I'm trying to build a navigation menu. I am receiving an array with a structure like this:
[
[
Title = A
Sub items = [
Title = B
Sub items = [
Title = C
]
]
],
[
Title = A
Sub items = [
Title = B
Sub items = [
Title = D
]
]
],
]
I need to take it and ...
How can I add arrays into an existing array item?
For instance:
$user[$user->id] = array(//values);
But if that user needs another array added, I want all data to fall under that user ID in the array.
I want to store orders a user has made, so I can look up all orders on the fly by user ID in the $user array above.
...
Hello,
I don't really know how to decribe this problem, so I'm sorry if the title is a bit unclear.
I got an object with array fields. I got the name of these fields stored in a variable and I want to reach an element in one of those array fields. e.g.
$field_name = 'array_field';
$object = new stdClass();
$object->array_field= array...
Hi,
I previously posted this question as jquery/javascript: arrays - http://stackoverflow.com/questions/3969576/jquery-javascript-arrays.
But since I am a complete beginner I have formulated the question wrong and didn't understand the answers either.... :(
After failing to implement the given solutions I did some more looking around I...
I wrote this code in C++ as part of a uni task where I need to ensure that there are no duplicates within an array:
// Check for duplicate numbers in user inputted data
int i; // Need to declare i here so that it can be accessed by the 'inner' loop that starts on line 21
for(i = 0;i < 6; i++) { // Check each other number in the ...
I've written a class called PuzzleBoard that represents an nxn board. I will be keeping several PuzzleBoard objects in a HashSet, so I have to overwrite the 'int hashCode()' method.
Below are the fields of my class:
private int N;
private int[][] puzzle;
private int blankCellX;
private int blankCellY;
private int cost;
What Ecli...
I'm currently seeing a lot of questions which are tagged C++ and are about handling arrays.
There even are questions which ask about methods/features for arrays which a std::vector would provide without any magic.
So I'm wondering why so much developers are chosing arrays over std::vector in C++?
...
Hi,
I have the following MongoDB object stored in my Mongo database:
array (
'_id' => new MongoId("4cc183de48aa4c7708000000"),
'vehicleMake' => 'Volkswagen',
'vehicleModel' => 'Carrier',
'vehicleNumPassengers' => '7',
'vehicleReg' => '07-D-748393',
'coords' =>
array (
0 =>
array (
'lat' => '53.2594946',
...
Is this code a good solution to randomise a two-dimensional array and write out all the
symbols on the screen? If you have a better tip or solution please tell me.
int slumpnr;
srand( time(0) );
char game[3][3] = {{'O','X','A'}, {'X','A','X'}, {'A','O','O'}};
for(int i = 0 ; i < 5 ; i++)
{
slumpnr = rand()%3;
if(slumpnr == 1)
...
I have this program which does not work as expected. Help me.
I want to print a row heading.
If input is 4, I want 1|2|3|4 to be output.
It does not work as all, if I hard-code $count value it works partially but the last number is missing.
sub printC {
my $count = @_;
# count = 4 # works partially only prints 1|2|3
...
If I have a 2D array, arr[][], and let say I do this: arr[0]=10; What does this do? I only assigned 10 in the first dimension, but I didnt mention the second dimension. What happens in this case?
Edit: Ok what about this:
public static int[][] mystery(int[][] srcA, int[][] srcB) {
2 int width= srcA.length, height = srcA[0].length;...
I have having some trouble printing a "char" from an ASCII value stored in an array.
The goal overall is to read a string of input from the user, store that in an array. Then use another array to count the number of times each character appears in the string, storing the number of occurances in the array address that matches the ASCII c...
I have this document.getElementsByTagName('input') to get all the <input> elements on the page. will this result in an array that I can put a for loop through?
...
Hi guys, I have a problem when setting a variable inside a Java class
Here is my code
This is where I create the instances (IdeaInfo is a class that acts similar to a Struct):
IdeaInfo[] IDEAS = new IdeaInfo[100];
String[] TITLES = new String[100];
This is the function that will use those instances:
try {
while ((line ...
The title is basically all there is too it. I have an array of file objects...
File[] myFiles = myDirectory.listFiles();
And I want to convert it to an array of strings. (String[])
...
this is my struct :
struct Node {
struct Node* data;
struct Node* links[4];
}
assuming there is no padding, does Node->links[-1] guaranteed to be pointing on Node::data ?
...
Hi all
I have an array of tags taken from a MySQL database. Obviously, these tags are strings and are stored in an array, with one element in the array storing each tag. TO build my tag cloud, I want to be able to count the occurrences of each tag to find the most common tag.
For example, if I have the table below...
tag1
tag1
hi
bye...
I want to push all individual elements of a source array onto a target array,
tartget.push(source);
puts just source's reference on the target list.
In stead I want to do:
for (i=0;i<source.length;i++) {
target.push(source[i]);
}
Is there a way in javascript to do this more elegant, without explicitly coding a repetition loop?...