I have an array of arrays with objects and now want to get all objects for a certain date (which is an object property).
what's the best way to query it?
Hi,
I'm a beginner in java. I want the logic of the small program.
I have two arrays
array = {a1,a2,a3,a4,a5,,,,,,,,,an}
and
array2 = {b1,b2,b3,b4,,,,,,,,,,,bn}
I want string as:
a1b1,a2a3b2b3,a4a5a6b4b5b6,..........an
Please tell me what will be the logic.
I used JQuery.serializeArray() on a form to create an array of objects on a GreaseMonkey application:
[
{
name: a
value: 1
},
{
name: b
value: 2
},
{
name: c
value: 3
},
{
name: d
value: 4
},
{
name: e
value: 5
}
]
I need to use GM_xmlhttpRequest to serve these fields back to a server side application. What is the best way to return these fields?
Thanks in advance,
D
I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from IBATIS.
Thanks
I have a PHP array of strings: ie: "Big green car parked outside"..etc
I would like to perform boolean search operations on these strings, similar to MySQL fulltext searching , or Sphinx Searching.
For example, I would like to find all strings containing word "green" but not "car"
Does anyone know of any existing PHP classes or libraries which would help me accomplish this ? Or can anyone suggest any google terms I could search for ?
Thank you in advance!
Intention is to take a current line which contains commas, store trimmed values of all space and store the line into the array.
Why does this not work?
String[] currentLineArray = currentInputLine.replace("\\s", "").split(",");
hi there, are there any way to create an object form any class inside a numpy array?¿. Something like:
a = zeros(4)
for i in range(4):
a[i]=Register()
Thanks
print_r($pages);
print max($pages);
print min($pages);
shows me
Array ( [0] => 1 [1] => 2 [2] => 3 ) 1 2
While I was expecting the last two numbers to be 3 and 1. How come?
Hi friends,
Yet I use Soft Keyboard sample from http://developer.android.com/resources/samples/SoftKeyboard/index.html
Here we uses ASCII value from XML ,now at the place of XML I want to generate these value using array.
How can I do this
Thanks in Advance
What's the simplest way of printing an array of primitives or of objects in Java? Here are some example inputs and outputs:
int[] intArray = new int[] {1, 2, 3, 4, 5};
//output: [1, 2, 3, 4, 5]
String[] strArray = new String[] {"John", "Mary", "Bob"};
//output: [John, Mary, Bob]
Hi all,
looks like a memory leak when i try to initializing an array of pointers, this my code:
void initLabelTable(){
register int i;
hashNode** hp;
labelHashTable = (hashNode**) malloc(HASHSIZE*sizeof(hashNode*));
hp = labelHashTable;
for(i=0; i<HASHSIZE; i++) {
*(hp+i) = NULL;
}
}
any idea?
Is following array initialization correct? I guess it is, but i'm not really sure if i can use const char* or if i better should use std::string. Beside the first question, do the char pointers point to memory segments of same sizes?
struct qinfo
{
const char* name;
int nr;
};
qinfo queues[] = {
{"QALARM", 1},
{"QTESTLONGNAME", 2},
{"QTEST2", 3},
{"QIEC", 4}
};
I have the following array:
procs=(
'one a b c'
'two d e f'
'three g h i'
)
I try run these processes from a loop (using echo instead of eval so I can debug):
for proc in ${procs[@]}
do
echo $proc
done
I get:
one
a
b
c
two
d
e
f
three
g
h
i
I wanted:
one a b c
two d e f
three g h i
What went wrong?
I know I can do
for (id obj in array)
{
if ([obj isKindOfClass:[Elephant class]])
[elephants addObject:obj];
}
but I feel there must be a more elegant way of doing this. I've looked at filtering arrays but can't come up with a good predicate. Thoughts?
Hi,
I'm wondering if someone knows how to store an array into a user session?
This is the method to store a single attribute:
$this->getUser()->setAttribute('something', $something);
And the documentation says:
"User attributes can store any type of data (strings, arrays, and associative arrays)"
... but doesn't say anything more. The API documentation doesn't have a "SetAttributes" or something similarly obvious.
Thank you.
Given an array of size n, which contains numbers in the range 1 to n, and in which each number is present at least once, but some numbers may be missing, how can I find the missing numbers?
We have to write the nodes of a binary tree to a file. What is the most space efficient way of writing a binary tree . We can store it in array format with parent in position 'i' and its childs in 2i,2i+1. But this will waste lot of space in case of sparse binary trees.
HI,
I have a string:
NEW ALPINESTAR?S SMX PLUS WHITE
MOTORCYCLE BOOTS! 44/9.5$349.95 Time
Left 1h 2m NEW AGV BLADE FLAT MATTE
WHITE LARGE/LG HELMET$75.53Time Left
1h 2m
I want result in array like this:
Productname
Price time NEW ALPINESTAR?S SMX
PLUS WHITE MOTORCYCLE BOOTS! 44/9.5
$349.95 Time Left 1h 2m
Hi All,
We have what we think is a marshalling problem with a renderer object when called across process boundaries. The renderer is an ATL COM server with a COM object that implements the IPoints interface defined below:
typedef [uuid(B0E01719-005A-427c-B9DD-B42A18E969AE)] struct Point
{
double X;
double Y;
} Point;
[
object,
uuid(3BFECFE3-B4FB-4f14-8257-6E065D02E3B3),
helpstring("IPoints Interface"),
dual,
]
interface IPoints : IDispatch
{
HRESULT DrawPolyLine([in] long hDC,
[in] short count,
[in, size_is(count)] Point * points
);
// many more like DrawLine
}
The count parameter represents the number of points and the points parameter represents an array of the actual points. We have two process running, a graphical display process (GDP) and a tabular (grid) display process (TDP). A factory in the GDP, written in C#, creates the renderer and the clients of the renderer in the GDP. When the clients call into the renderer, everything displays correctly. The renderer is created at start up BTW.
There is another factory in the TDP, written in VB6, that calls into the factory in the GDP to create the clients. When the clients call into the renderer, only the first point in the array is marshaled correctly, all the other points are garbage. Seems that the rendering works only when the client creation is started from the same process as the renderer.
Now, i am not sure what the solution to this problem is. It seems that if we can guarantee that the clients are always created from a thread in the same GDP process as the renderer then the points are marshaled correctly. We tried using a background thread from the Thread Pool in C# and it indeed worked.
The problem is that Windows Forms created from the clients stopped working because accessing the form's controls from a thread other than the thread that created the control is not allowed. We might change the calls to access the forms but we have quite a few of them and are trying to look into a different solution that might involve making changes to the renderer. The other problem is that the renderer is legacy code and we can't just change the interface. I am wondering what can we do to the renderer's interface that would help with marshalling from across process calls. Any ideas would be greatly appreciated.
Regards,
ElMagn
Hi -
I'm getting JSON-encoded output from another organization's API.
In many cases, the output can be either an array of objects (if there are many) or an object (if there's just one). Right now I'm writing tortured code like this:
if ( is_array($json['candidateList']['candidate'][0]) ) {
foreach ($json['candidateList']['candidate'] as $candidate) {
// do something to each object
}
}
else {
// do something to the single object
}
How can I handle it so the "do something" part of my code only appears once and uses a standard syntax?
Hi,
I am trying to convert an integer number in C into an array containing each of that number's digits
i.e. if I have
int number = 5400
how can I get to
int numberArray[4]
where
numberArray[0] = 0;
numberArray[1] = 0;
numberArray[2] = 4;
numberArray[3] = 5;
Any suggestions gratefully received
--dave