I have a function that returns an array of different lengths based on a table lookup. I am malloc'ing required memory for it inside the function but then how can I fill the array from its pointer?
The compiler is throwing same error for both of my tries (commented lines). Please help!
int lookup(const char *name, float *factors) {
i...
Hi everyone!
I have the function prototype here:
extern "C" void __stdcall__declspec(dllexport) ReturnPulse(double*,double*,double*,double*,double*);
I need to write some python to access this function that is in a DLL.
I have loaded the DLL, but
each of the double* is actually pointing to a variable number of doubles (an array), and
...
Which one below is correct? First code has no quotes in the $_GET array and the second one does, I know you are supposed to have them when it is a string of text but in this case it is a variable, also what about if the key is a number?
no quotes
function arg_p($name, $default = null) {
return (isset($_GET[$name])) ? $_GET[$name] : ...
in C# 3, initializers were added. This is a great feature. However, one thing has me confused.
When you initialize class, you typically have to specify the member variable or property you are initializing. For example:
class C { public int i; }
public void blah() {
C c = new C() { i = 1 };
}
Array semantics have been in C# si...
Hello - I am new to Objective C and am having troubles adding a 2d int array to a NSMutableDictionary. The code errors with "incompatible pointer type" - I assume this is because setObject would be expecting an object..
Here is the code - I am trying to have a Dictionary containing my level data:
NSMutableDictionary *level = [[NSMutabl...
Hello All, I would like a hint or much better a solution for this:
I do a regular expresion match to an url for example '/product/100/'
preg_match('/^\/(?<name>\w+)\/(?<digit>\d+)\/$/', '/product/100/', $matches);
As result of this I get the following array on $matches:
array
0 => string '/product/100/' (length=13)
'name' => str...
i have an array of Tag objects
class Tag
{
public string Name;
public string Parent;
}
i want code to return a list of the tag names as an array of strings
...
One thing I've noticed with all the XML-RPC examples out there, including the spec itself, is there is no detailed example of a schema using recursive (param) values. It is hard to understand what should actually be possible within XML-RPC without these illustrations, and I wonder if someone could help me get a better handle on it.
The ...
Does anyone know of a List implementation that has a constant time get(int index) (I.e. implements RandomAccess) but doesn't have to copy the whole list when it grows as ArrayList does?
I'm thinking the implementation may well be in terms of other lists e.g.
public class ChunkedList<T> implements List<T>, RandomAccess {
private Linke...
By address I mean the location if you were counting left to right, top to bottom, starting with 0
I know how to get the address given point (x, y) in a grid sized (w, h)
address = (y * w) + x
That is, in a grid 7 x 6 units, the point (2, 5) gives address 37 (see illustration above)
How do I get point (x,y), given address 37 and ...
1) I have this Javascript array:
lang=new Array();
lang["sq"]="Albanian";
lang["ar"]="Arabic";
lang["en"]="English";
lang["ro"]="Romanian";
lang["ru"]="Russian";
2) In some other process, there is a returned value in a variable:
result.detectedSourceLanguage = 'en';
3) Now, i want to print the language full name by doing this:
ale...
is there a built in function for this or do you need to do a loop here.
...
This is what I've come up with so far, but it doesn't seem very optimal, any ideas on better approaches?
public void ToBytes(object[] data, byte[] buffer)
{
byte[] obytes;
int offset = 0;
foreach (object obj in data)
{
if (obj is string)
obytes = System.Text.Encoding.UTF8.GetBytes(((string)obj));
...
Given
var myHash = new Array();
myHash['key1'] = { Name: 'Object 1' };
myHash['key2'] = { Name: 'Object 2' };
myHash['key3'] = { Name: 'Object 3' };
how do I remove key2, and object 2 from the hash, that it ends up in a state as if i did:
var myHash = new Array();
myHash['key1'] = { Name: 'Object 1' };
myHash['key3'] = { Name: 'Objec...
This is homework. Beginning Java class. Still wrapping my head around this stuff.
The project is to make an Inventory Management System.
I have everything figured out except how to make this button change the text in a JTextField. It needs to add info from an array of a product (DVD's in this case). The book talks about different wa...
This is homework. Beginning Java class. Still wrapping my head around this stuff.
This questions Extends this one
So there is a button for First, Prev, Next, and Last
Each should modify
Item ID, Name, Rating, Price, Units, Value, Fee, ValueW/Fee, Total Inventory Value
The last one is a static total of all units)
I am not sure if ...
I have a .txt file with integers on each line e.g.
1
4
5
6
I want to count the occurences of the values that are in an array with the file.
My code extract is this
String s = null;
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
while ((s = br.readLine()) !=null) {
StringTokeni...
Hi,
I have a class A as follows:
class A
{
public:
A()
{
printf("A constructed\n");
}
~A();
//no other constructors/assignment operators
}
I have the following elsewhere
A * _a;
I initalize it with:
int count = ...
...
_a = new A[count];
and I access it with
int key = ....
....
I am passing a PHP array to a javascript function. The only way I know to do this is to create a js array from the PHP array and pass that to the js function. But this creates a huge chunk of code to transfer (see code below - there's a lot more but I'm sure you get the general idea). I suspect that there is a more efficient method. Woul...
I'm returning a complex result of indeterminate size that I will need to handle again and again, so I'm wondering what is a good way to package it?
something like this
loop>>>
@results = { external_id => { :name => name, :type => type } }
or
@results = [ { :external_id => external_id, :name => name, :type => type } ]
or?
end>>>...