In Matlab, I recall being able to declare an array and initialize it and it resides in memory during the entire Matlab session. I could copy it, modify it, and run it through tests. Is this option available in Ruby? Basically I want to create and populate an array of 12 million 32-bit integers. Then I want to run code that accesses t...
Hi
I'm looking for a way to reinterpret an array of type byte[] as a different type, say short[]. In C++ this would be achieved by a simple cast but in C# I haven't found a way to achieve this without resorting to duplicating the entire buffer.
Any ideas?
...
hello,
I'm trying to find a way to link an array controller to an Array.
I know via an outlet I can fill textfields and even tableviews in the .xib file made with Interface Builder.
I was hoping it would be possible to have one easy outlet (NSArray) and put it into an Array Controller. In turn, a table will link its contentfield to the...
Hello,
I'm a very new Cocoa user and running into all sorts of problems...
I'm trying to get the content of an Array and found this code to do this.
NSLog(@"array : %@",collection);
The problem is, I'm not getting any console or tracer window that shows this 'echo'
Is there another command I should use, i've tried opening all wi...
I'm writing a script in PHP that compares people together based on the number of same answers in a survey. I use an array like this:
[person ID]=>number of answers same
to store the 10 people closest to the one I am comparing with.
I need to figure out how to find the lowest of the 10 number of answers same and overwrite a higher ...
Hi,
I am attempting to copy the members of a struct containing a mixture of ints, char's and arrays of chars into a byte array to send to a serial line. So far I have
// struct msg_on_send
// {
// char descriptor_msg[5];
// int address;
// char space;
// char cmdmsg[5];
// char CR;
// char LF;
// };
/...
Ok, this is a dumb thing that I'm sure I've done dozens of times but for some reason I can't find it.
I have an array... And want to get a string with the contents of that array separated by a delimited...
Where is the .Join() method that I can't find?
(This is .Net 2.0, I don't have any LINQ stuff)
Thank you!
...
I used this 'tutorial' to bind my array called 'collection' to a NSTableview on my interface:
http://www.cocoadev.com/index.pl?NSArrayController
The interfacebuilder stuff isn't that hard. It becomes difficult when I try to actually show the data in my array into the view.
in my .h file:
@interface MyDocument : NSDocument
{
NSMuta...
Hey guys.
I'm working with CoreData in Cocoa (not document-based).
My problem is, that I want to access the SAME NSArrayController from different NIBs.
But every NIB has an own instance of this NSArrayController.
My question is now how I could generate sharedObjects (like the NSUserDefaultsController).
It would help me a lot. Thanks fo...
I want a simple function that receives a string and returns an array of strings after some parsing. So, this is my function signature:
int parse(const char *foo, char **sep_foo, int *sep_foo_qty) {
int i;
char *token;
...
strcpy(sep_foo[i], token); /* sf here */
...
}
Then I call it like this:
char sep_foo[MAX_QTY...
public static List<Vertex<Integer>> petersenGraph()
{
List<Vertex<Integer>> v = new ArrayList<Vertex<Integer>>();
for (int i = 0; i < 10; i++)
{
v.add(new Vertex<Integer>(i));
}
int[][] edges =
{{0,1}, {1,0}, {1,2}, {2,1}, {2,3}, {3,2}, {3,4}, {4,3}, {4,0}, {0,4},
{5,6}, {6,5}, {6,7}, {7,6}, {7,8}, {...
I am trying to compare two .NET arrays. Here is an obvious implementation for comparing arrays of bytes:
bool AreEqual(byte[] a, byte[] b){
if(a.Length != b.Length)
return false;
foreach(int i = 0; i < a.Length; i++)
if(a[i] != b[i])
return false;
return true;
}
A more refined approach can be s...
What is the memory layout of a .NET array?
Take for instance this array:
Int32[] x = new Int32[10];
I understand that the bulk of the array is like this:
0000111122223333444455556666777788889999
Where each character is one byte, and the digits corresponds to indices into the array.
Additionally, I know that there is a type refere...
This may be a silly question but I was writing a quick test page and realised that I didn't know how to bind an array or ArrayList of strings, for example, to an ASP.NET Repeater.
I experimented a bit.
<asp:Repeater ID="rptImages" runat="server">
<HeaderTemplate>
<h3>Items</h3>
</HeaderTemplate>
...
I need to pass an array of integers from Hibernate to PL/SQL function. The current solution is the covert the array to a comma separated string and surround it with parenthesis to use it as parameter. This is solution is outlined here.
But, this approach doesn't look like a good solution when an array of 200k elements need to be passed ...
Hello everyone,
OK I need to design a way to keep track of how many of each item exists.
There are approximately 26 items. I also need a way to find out if a certain combination of items exist.
For example,
This is an engine for a card game. Each card has a different type and each card can have card attached to it.
There need to be a ...
Hello. I'm sending some data over AJAX to a PHP file. It's about filter options. Anyway, I am sending it like this:
filter[0][data][type] string
filter[0][data][value] automobiles
filter[0][field] product
filter[1][data][type] numeric
filter[1][data][value] 6000
filter[1][field] price
This above is taken from FireBug console. Then,...
I have a PHP script which reads a large CSV and performs certain actions, but only if the "username" field is unique. The CSV is used in more than one script, so changing the input from the CSV to only contain unique usernames is not an option.
The very basic program flow (which I'm wondering about) goes like this:
$allUsernames = arra...
First off, here is some code:
int main()
{
int days[] = {1,2,3,4,5};
int *ptr = days;
printf("%u\n", sizeof(days));
printf("%u\n", sizeof(ptr));
return 0;
}
Is there a any way to find out the size of the array that ptr is pointing to? Instead of just giving it's size, which is 4 bytes.
Thanks.
...
In managed C++/CLI, I could do this either as (1):
array<System::Byte>^ css_keycode = {0x51, 0x67, 0x67, 0xc5, 0xe0, 0x00};
or (2):
array<System::Byte>^ css_keycode;
css_keycode = gcnew array<System::Byte>(6) {0x51, 0x67, 0x67, 0xc5, 0xe0, 0x00};
But I apparently can't do (3):
array<System::Byte>^ css_keycode;
css_keycode = {0x5...