Given a Sorted Array which can be rotated find an Element in it in minimum Time Complexity.
eg : Array contents can be [8, 1, 2, 3, 4, 5]. Assume you search 8 in it.
I have an array Items which has 10 elements. I need to remove the 5th element (index=4)
the new array should have 9 elements and all elements after the 5th element will be shifted forward
what command(s) should i use?
I have a short integer variable called s_int that holds value = 2
unsighed short s_int = 2;
I want to copy this number to a char array to the first and second position of a char array.
Let's say we have char buffer[10];. We want the two bytes of s_int to be copied at buffer[0] and buffer[1].
How can I do it?
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting result 3, because there're only 3 objects inside: mother, father, brother?!
Hi there,
I have a byte array and wish to find the first occurance (if any) of a specific byte.
Can you guys help me with a nice, elegant and efficient way to do it?
/// Summary
/// Finds the first occurance of a specific byte in a byte array.
/// If not found, returns -1.
public int GetFirstOccurance(byte byteToFind, byte[] byteArray)
{
}
I have an associative array in JSON
var dictionary = {"cats":[1,2,37,38,40,32,33,35,39,36], "dogs", [4,5,6,3,2]};
Can I get the keys from this? I tried in Visual studio putting a breakpoint but can't see any property that represents keys. Is it not possible?
I'm fine creating a separate array if necessary, but was just hoping it wasnt :
var keys = ["cats", "dogs"];
i have an NSObject with 2 property's
@interface Entity : NSObject {
NSNumber *nid;
NSString *title;
}
i have 2 array's with Entity's and I want to compare those two on the nid with a predicate
so i can produce an array with only matching nid's
i am Reading the file contents and passed it in explod function("=",$string) ,it gives me two array parts[0].parts[1] seprated by = .parts[1] array displays all the values of the variable .now how can i use these values one by one to pass in the text box .The variable value comes in this way (value1
value2
value3
value4...)
my code also throws the undefined offset :1 notice when i prints the parts[1]arrray
Hi, I would like to check a opened .txt file for braces that open and close like below:
file {
nextopen {
//content
}
}
no this is not my own language or anything, but I want to get say the nextopen function and all the contents inside the brackets, and all the stuff from inside the file function and add it to an array if you know what i mean. so all the content inside the braces will be in an array. if you know how to do this please reply.
how to get a list of files / folders as an IEnumerable and not an array?
the reason I want to do this is a have many folders with 20,000+ files in them, and i need to loop through all of them but do not want to wait for them to be compiled into an array. but just want to go through one at a time.
also i'm using .net 3.5 not v4
Hello guYz plz help me out in making it possible to open the files by the adress provided in an array of strings.........
a way to open file is as given below...
ifstream infile;
infile.open("d:\aslam.txt");
but how can i open file providing an array of string as an adress of file.....
like this
infile.open(arr[i]); (but its not working)
plz help me.........
Hi all,
I got a question when I was doing some Array in PHP.
I don't know how to write the code for the following case:
$arrs = array("abc", "cr", "exd", "hello", "gj", "hwa", "@", "8");
foreach ($arrs as $arr){
// if $arr does not belong to any characters from a to z,
// then there must be some special character in it.
}
Could you help me please?
Hello
i m using zend by some code i succeeded to populate array on values to a phtml form but now iwant to post this array of values from html form to controller.
How it is possible?
Thanks.
What is the best way to touch two following values in an numpy array?
example:
npdata = np.array([13,15,20,25])
for i in range( len(npdata) ):
print npdata[i] - npdata[i+1]
this looks really messed up and additionally needs exception code for the last iteration of the loop.
any ideas?
Thanks!
my attempt to init an array with a number of bool values using:
[myArray initWithObjects:[NSNumber numberWithBool:YES],
[NSNumber numberWithBool:YES],
[NSNumber numberWithBool:YES],
nil];
seems to fail since the debugger shows an empty array after this statement is carried out ... Any clues?
How do I set up a OnClickListener to simply tell me which index button was pressed from an array of buttons. I can change text and color of these buttons using the array. I set them up like this.
TButton[1] = (Button)findViewById(R.id.Button01);
TButton[2] = (Button)findViewById(R.id.Button02);
TButton[3] = (Button)findViewById(R.id.Button03);
up to 36.
Kick me if I'm being silly but some some reason I'm having a heck of time building a dynamic array in magento.
Example:
$data = array();
$data[0] = 'test';
$data[1] = 'what';
I keep getting an ERROR:
Notice: Undefined offset: 0
Any ideas?
Do I need to handle these arrays differently since they are in a class?
okay, C++ and java i have no problem learning or what so ever
when it comes to mips it is like hell
okay i wanna learn how to read in the an array and print all the element out
here is a simple array that i wrote
int[] a = new int[20];
for(int i=0; i
for(int j=0; j
how do you do it in mips
I'm trying to send an int array through Winsocks. I might be wrong, but I'm pretty sure only a char* is supported so I'm kind of stuck on how to do this properly. There are also problems with little/big edian, so what would be a good way to do this? I've already asked a question of converting int array to char but it was recommended to start a new thread on this in the networking section instead.
Im trying to achieve an output like this
{"status":"ok","0":{"id":"11","title":"digg","url":"http://www.digg.com"}}
but instead i am getting this
{"status":"ok","0":{"id":"11","title":"digg","url":"http:\/\/www.digg.com"}}
this is the php code im using to generate the json
$links = array('id'=>'11','title'=>'digg','url'=>"http://www.digg.com");
$msg = array('status'=>'ok',$links);
echo json_encode($msg);
any idea what is causing this?
hi
i am using an array of file, i mean input type ="file" to upload number of files at a time.
i want to print or echo that file array values , how can i do this.
please help me
Thanks
I am messing around with assembly for the first time, and can't seem to change the index values of an array. Here's the method I am working on
int ascending_sort( char arrayOfLetters[], int arraySize )
{
char temp;
__asm
{
//???
}
}
And these are what I tried
mov temp, 'X'
mov al, temp
mov arrayOfLetters[0], al
And this gave me an error C2415: improper operand type
so I tried
mov temp, 'X'
mov al, temp
mov BYTE PTR arrayOfLetters[0], al
This complied, but it didn't change the array...