What does [,] mean in c#?
As in: public string[,] GetHelp() { return new string[,] {...things...} } And how do I search for it in the documentation? ...
As in: public string[,] GetHelp() { return new string[,] {...things...} } And how do I search for it in the documentation? ...
Hi all, I've got a lightweight templated class that contains a couple of member objects that are very rarely used, and so I'd like to avoid calling their constructors and destructors except in the rare cases when I actually use them. To do that, I "declare" them in my class like this: template <class K, class V> class MyClass { publi...
I can do: @items = @items.select {|i| i.color == 'blue'} @items = @items.select {|i| i.color == 'blue' || i.color == 'red'} What if I am given an unknown amount of colors and I want to select them all? i.e. ['red','blue','green','purple'] # or ['blue','red'] I've been working on a mess of code that creates several temporary arrays ...
Is it possible to create a dynamic array using something like this and store X elements, then get the average? How would that be possible? $(xml).find('student').each(function(){ var name = $(this).find("name").text(); var myArray = DYNAMIC ELEMENTS student_list.append("<tr><td>"+name+"</td><td>"+cid+"</td><td>"+grade+"...
Hi all, Im currently building a php framework... again. I have a class called config. its pretty simple, its called like so: $conf = config::get('general'); $conf is now an array full of config goodies. the class sceleton is like so: final class config { private static $configs = array(); public static function get($name) { ret...
I have an array containing much more items than just this one. This is just an example of an item. [0] => Array ( [id] => 6739380664 [created_at] => 1260991464 [text] => @codeforge thx for following [source] => web [user] => Array ( [...
The script I'm writing will require me to pass some command line parameters. I would like to use these parameters within an array, but I'm not sure how. A very basic example of this would be (script run as ./script.sh array1): #!/bin/bash array1=( a b c d ) echo ${#$1[@]} The output should be 4, but I receive the following error: li...
i have a List of records type Item = { Color : string; Size : int} let itemList = [{Color="Red"; Size=1}; {Color="Green"; Size=2}; {Color="Blue"; Size=3};] I am looking to get turn my list of records into an array of values like [|"Red";"Green";"Blue"|] or [|1;2;3|] I can sorta get there like this typ...
I have got here two programs with me, both are doing exactly the same task. They are just setting an boolean array / vector to the value true. The program using vector takes 27 seconds to run whereas the program involving array with 5 times greater size takes less than 1 s. I would like to know the exact reason as to why there is such a ...
Ok here's my problem. I want to loop through a simple char buffer using inline asm and VC++; My agenda is to create a loop that reads information from memory as fast as physically possible heres my code char buffer[howmany]; memset(buffer,33,howmany); char arr = 0; __asm { MOV eax,seg buffer ;operand size conflict MOV eds,eax ...
I want to let the user type in tags: windows linux "mac os x" and then split them up by white space but also recognizing "mac os x" as a whole word. Is this possible to combine the explode function with other functions for this? There has to be a way. ...
I have a PHP array that looks like this: Array ( [340] => Array ( [1] => 1 [2] => 18 [3] => 23 ) [341] => Array ( [1] => 1 [2] => 17 [3] => 23 ) [342] => Array ( [1] => 1 [2] => 16 [3] => 23 ) [343] => Array ) The array is actually longe...
Hi guys. I have just recently been doing something in C#, i would like to know how to do something like this. Array[0] = Array['Value'] = 2344; Array['LocationX'] = 0; Array['LocationY'] = 0; Array[1] = Array['Value'] = 2312; Array['LocationX'] = 2; Array['LocationY'] = 1; Array[2] = Array['Value'] = 2334; Array['Locati...
How can I store a 100K X 100K matrix in Java? I can't do that with a normal array declaration as it is throwing a java.lang.OutofMemoryError. ...
How would I create an array in PHP that has $x empty elements? The $x is unknown and varying value. For example, if I wanted to create an array of 3 elements, I could just do: $array = array(null,null,null); However, I don't know what $x is and there could be million elements, I need to do this automatically. ...
Once when I was reading some python docs I came across a reference to an article that explained why programming languages with 0-based indexing should always exclude the last element during operations like slicing: >> a = [1, 2, 3] >> a[0:1] [1] #and not [1,2] Unfortunately I did not bookmark it. Does anyone know which article I am t...
Hello. How can I check if value exist in ArrayList by its index? Java offers contains(Object) method, but no contains(Integer index) method Thank you ...
I have <textarea name="a[]" id="a[]"></textarea> <textarea name="a[]" id="a[]"></textarea> <textarea name="a[]" id="a[]"></textarea> <textarea name="a[]" id="a[]"></textarea> and I want to get value of each textarea to array. How I do it? ...
Can I define in C++ an array operator that takes multiple arguments? I tried it like this: const T& operator[](const int i, const int j, const int k) const{ return m_cells[k*m_resSqr+j*m_res+i]; } T& operator[](const int i, const int j, const int k){ return m_cells[k*m_resSqr+j*m_res+i]; } But I'm getting this error: error C28...
Hi, since Java doesn't provide a default way to do this, what's a fast way to convert an Integer into a Byte Array? e.g. 0xAABBCCDD => {AA, BB, CC, DD} ...