arrays

PHP: DATETIME in array as object. How to echo

Hope that title isn't too cryptic. I have an array with a DATETIME object in it and I'm just trying to figure out how to echo this to a page. ["created"]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2010-10-22 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" Can someone help me out? tried date() bu...

Classic ASP Ubound returns 9 getting subscript out of range

Sorry if this has been covered, I couldn't find anything specifically to this issue in my searches. I am trying to debug a classic ASP application. I need to print the session variables, one of which is an array. My code is below, I keep getting Subscript out of range, usually this means that the array is empty (Ubound returns -1) but i...

PHP explode and put into array

Hello, I have this line of string Fruits-banana|apple|orange:Food-fries|sausages:Desserts-ice cream|apple pie the : (colon) is the separator for the main topic, and the | is the separator for the different type of sub topics. I tried to explode it out and put it into array, I need the result to be something like this to be displayed...

PHP: How to put a variable in an array?

Just a quick newbie PHP syntax question. I have a variable, let's call it $tabs which always contains a string of numbers separated by commas, like so: 24,35,43,21 I also have a variable that's an array: $args = array('post_type' => 'page', 'post__in' => array(27,19,29), 'order' => 'ASC'); That's of course WordPress. What I need to ...

array into variable

Say I get {1,2} from function f(a,b) (it doesnt matter what f is/does), and I want to store it into int s[2]. How would I do it? It seems that I can't just do int s[2] = f(a,b), and I can't separate the output of f, since there is no variable to get the values from. f(a,b)[0] does not work. ...

How to cast a php array into javascript array

I run a mysql query and get the results successfully. However, I cannot read the elements of the array from javascript side. Can anyone help?? //JAVASCRIPT makes a request function profiles(){ $.post('dbConn.php', { opType:"getProfileList" }, fillProfileCombo, "text"); } function fillProfileCombo(res) { alert(res); } //dbConn.php...

Jagged Array and Flatten Array, Which Performs Better?

We all know that jagged array performs better than multi-dimensional array, but what about jagged array and flatten array? My intuition is that they should perform about the same. This is because both are direct access, unlike multi-dimensional array where you have to do some manipulation before you get to the element. Am I right? ...

Javascript array.clear() is not a function?

I'm trying to empty an array containing my drawn coordinates when a button "clear" is pressed. When I call drawnDivs.clear(), I get an error that it is not a function. drawnDivs is certainly an array, and I have firebug console.logs printing things out. It's hosted here. ...

Why am I getting an ArrayIndexOutOfBounds exception?

private void equal_AxB() { int x = matrix_A.length; int y = matrix_B[0].length; matrix_C = new double[x][y]; for(int i = 0; i < x; i++) { for(int j = 0; j < y; j++) { for(int k = 0; k < y; k++){ matrix_C[i][j] += matrix_A[i][k]*matrix_B[k][j]; } } } return; ...

How to replace value in string array

How to remove my value in String Array and how i can rearrange public string[] selNames = new string[5]; selNames[0]="AA"; selNames[1]="BB"; selNames[2]="CC"; selNames[3]="DD"; selNames[4]="EE"; In certain Conditaion i need to Check for the existing value and i want to remove it from my collection, How i can do it. i tried like below...

Enum array from string with delimiter

Hi, I want to give something back - found lots of answers here! The problem is to convert a string (eg. "AA_BB_CC") into an array of enums using a specified enum class. public static <T extends Enum<T>> T[] getEnumArrayFromString( final Class<T> enumType, final String codeStr, final String delimiter){ if(enumType == nul...

Native function to get a special array for PHP

Every day , I have this pattern - an array of objects - i make a loop to traverse the array foreach($arr as $obj){ $arrIds[] = $obj->Id; $arrNames[] = $obj->Name; } I could build a function like arrayFromProperties($Array,$ProperyName) but I was wondering if you know a native php function to do this, or something similar, without...

Access 2d array with point in wpf C#

Hi, I have a 2d array of a class. The size of array is very large (around 3000*3000) and accessing the array with ordinary row and column method is taking very much time. For this purpose, I want to use pointers to access the array. Following is my array code: Class definition: Class BoxData { Size _bound; bool _isFilled=fa...

How to initialise a pointer to pointer struct in C?

I have a struct which is a node, and another which is a list of these nodes. In the list struct, its an array of nodes, but instead of an array, it's a pointer to pointer with a size integer: typedef struct node { struct node *next; MyDef *entry; } Node; typedef struct list { Node **table; int size; } List; List *init...

Javascript combine arrays or strings

I have the following dynamically generated strings: var stringA = ["a1", "a2", "a3" ... 'a400' ... 'a600']; // length 600 var stringB = ["b1", "b2", "b3" ... 'b400']; // length 400 How can I get an Array or string of both combined like this: var myString = ["a1b1", "a2b2", "a3b3" ... "a400b400", "a401" ... "a600"] ...

How to pass the parameters using multidimensional array in webservice

Hi All, How can I pass the parameters in web service using this request: POST /webservice/User.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://sample.com/UpdateUserBatch" <UpdateUserBatch xmlns="http://sample.com/"&gt; <auth> <Username>string</Username> <Password>string</P...

delete element in c++ array

Please tell me how to delete an element from a c++ array ? my teacher is setting its value to 0, is it correct ? ...

Action with a string array as parameter

I want to call an action with something similar to this uri: http://server/controller/action/?columns=firstname&amp;columns=lastname&amp;columns=age and use it like this: public ActionResult Action(string[] columns) { } how do I do it? ...

Enum array from string with delimiter

Hi, I want to give something back - found lots of answers here! The problem is to convert a string (eg. "AA_BB_CC") into an array of enums using a specified enum class. public static <T extends Enum<T>> T[] getEnumArrayFromString(final Class<T> enumType, final String codeStr, ...

How to convert an XML FIle into a SimpleXMLElement() Array?

I have an XML File: <?xml version="1.0" encoding="iso-8859-1"?> <deadlines> <deadline> <date>2010-07-01</date> <text>Residency Application for Fall Due</text> </deadline> <deadline> <date>2010-06-01</date> <text>Residency Application for Summer Due</text> </deadline> <deadline> ...