I have a very specific problem here. I have a multi-dimensional array that I want to sort first by half-hour time intervals, second by dates. The function array_multisort will not meet my requirements.
Example: I want:
array(array("time"=>"12:15",
"date"=>"2009-03-24"),
array("time"=>"12:10",
"date"=>"20...
I am still new to C# and I've been struggling with various issues on arrays. I've got an array of metadata objects (name value pairs) and I would like to know how to create only the number of "InputProperty" objects that I truly need. In this loop I've arbitrarily set the number of elements to 20 and I try to bail out when the entry beco...
Let's say I have these two arrays:
var array1 = new[] {"A", "B", "C"};
var array2 = new[] {"A", "C", "D"};
I would like to get the differences between the two. I know I could write this in just a few lines of code, but I want to make sure I'm not missing a built in language feature or a LINQ extension method.
Ideally, I would end up ...
I have an array full of patterns that I need matched. Any way to do that, other than a for() loop? Im trying to do it in the least CPU intensive way, since I will be doing dozens of these every minute.
Real world example is, Im building a link status checker, which will check links to various online video sites, to ensure that the vid...
Hi guys. I have to use a dynamic length int array in my program, and want to be able to get the number of objects in it at various points in my code. I am not that familiar with C++, but here is what I have. Why is it not giving me the right length? Thanks.
<#include <iostream>
Using Namespace std;
int length(int*);
void main()
{
in...
Hey i'm having problems creating a simple button for a programme which finds the largest word in an array and puts it into a textbox. I've done most of the coding (I hope) was wondering if somebody could help me actually with the code that finds the largest text in the array as I am struggling the most with that.
Private Sub btnLon...
Dear all,
I have the following code that tries to enumerate
strings.
#include <string>
#include <iostream>
using namespace std;
string base = "000";
char values[] = {'0', '1', '2', '3' }; // Error Here
for (int i = 0; i < base.length(); ++i)
{
for (int j = 0; j < countof(values); ++j)
{
if (base[i] != values[j])
...
I have an array:
$myArray = array('key1'=>'value1', 'key2'=>'value2');
I save it as a variable:
$fileContents = var_dump($myArray);
How can convert the variable back to use as a regular array?
echo $fileContents[0]; //output: value1
echo $fileContents[1]; //output: value2
...
I've got two sets of four dropdowns - startDate,startMonth,startYear,startTime (as 24.00) and the same for endDate/Time - for user to select a start date/time and an end date/time, but don't know how to get the selected values into a datetime format to use in a recordset query using javascript or preferably php(5).
I know I need to comb...
Here is what I'm suppose to accomplish:
Write a program that stimulates a
bean machine Your program should
prompt the user to enter the number of
balls and the number of slots in the
machine. Simulate the falling of each
ball by printing its path.
EX.
Enter the number of balls: 5
Enter the number of slots: 7
...
How do I remove an items from a data bound array? My code follows.
for(var i = 0; i < listBox.selectedIndices.length; i++) {
var toRemove = listFiles.selectedIndices[i];
dataArray.splice(toRemove, 1);
}
Thanks in advance!
Edit Here is my swf. The Add Photos works except when you remove items.
http://www.3rdshooter.com/Content/Fla...
I am having some trouble with a basic php issue and want to know if anyone can help me out. Basically I need to combine the results of 2 queries, and merge the arrays based on the key, while retaining the 1 key to 1 value that is present in both queries.
For example: "select * from table 1, table 2 where table1.id = table2.id"... ma...
What is the difference?
...
How do I get the values of php checkboxes in a form to show when emailed to the recipient?
I am learning how to use php but I can't figure this one out with the form i have generated.
Below is the checkbox code from the form itself:
<input type="checkbox" value="Please send me a Travel Planner" name="options[]">
<input type="checkbox" ...
What is the safe method to access an array element, without throwing IndexOutOfRangeException, something like TryParse, TryRead, using extension methods or LINQ?
...
Is it possible to echo or print the entire contents of an array without specifying which part of the array?
The scenario: I am trying to echo everything from:
while($row = mysql_fetch_array($result)){
echo $row['id'];
}
Without specifying "id" and instead outputting the complete contents of the array.
...
In a while loop I have:
$row = mysql_fetch_array($result)
Held under $row are two arrays which when shown using print_r display the following:
Array
(
[4] => Post Content
[value] => Post Content
)
Array
(
[4] => Post Title
[value] => Post Title
)
How can I choose "Post Content" and "Post Title" from the array without it being repe...
Hello everyone,
My following code has compile error,
Error 1 Cannot implicitly convert type 'TestArray1.Foo[,,*]' to 'TestArray1.Foo[][][]' C:\Users\lma\Documents\Visual Studio 2008\Projects\TestArray1\TestArray1\Program.cs 17 30 TestArray1
Does anyone have any ideas? Here is my whole code, I am using VSTS 2008 + Vista 64-bit.
name...
In ActionScript 3, is there any convenient way of determining if an associative array (dictionary) has a particular key?
I need to perform additional logic if the key is missing. I could catch the undefined property exception, but I'm hoping that can be my last resort.
...
With a list in Python I can return a part of it using the following code:
foo = [1,2,3,4,5,6]
bar = [10,20,30,40,50,60]
half = len(foo) / 2
foobar = foo[:half] + bar[half:]
Since Ruby does everything in arrays I wonder if there is something similar to that.
...