arrays

Calling variables using arryes to change in JLabel after an action

hi guys, i'm having small problems in calling variables and changing the variables after the user hit the change button. i'm new here trying to learn Jave , hope you can help. import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class NestedPanelsTwo { private J...

PHP Api - Results/Array question

Hello, I have been looking around for PHP tutorials and I found a very detailed one that have been useful to me. But now, I have a question. The results showed by the API are stored into a $results array. This is the code (for instance): $fetch = mysql_fetch_row($go); $return = Array($fetch[0],$fetch[1]); $results = Array( '...

declaring the largest array using size_t

i wanted to declare a very large array. i found that the max size of an array is size_t, which is defined as UINT_MAX so i wrote the code like this int arr[UINT_MAX]; when i compile this, it says overflow in array dimension but when i write like this size_t s = UINT_MAX; int arr[s]; it compiles properly. what's the difference ...

Remove blank lines that appear when writing to file (Java)

Hi guys. I have created a program which takes a text file full of 3 letter words and processes them, stores them in an array and then outputs to the build output in JCreator and then writes the same output to a file. Now, this program works fine, but when I print a lot of data - I get all of these blank lines inserted where there shoul...

How to loop and array's index by day in xcode

I know the question sounds a little funny. I am trying to move down the list of array in my iPhone project. I have an array of 100 items: [0][1]...[99] I would like to select index[0] today, index[1] tomorrow... index[99] 100 days from now. And then on day 101, back to index [0]. Maybe I need to convert NSDate and get todays date in...

Writing a number in an array that has the same number of counts like the number

Hi, I am working on a paging function. This is what I have: $total_pages = 3; // 3 is only an example foreach ($total_pages as $single_page): echo 'Page'.$single_site->number.'|'; endforeach; How can I write the number of pages in array that I can use in my foreach function? The number of pages is dynamical. I want to be able, to s...

Navigating an Array (Android String Array)

Hi. I'm new to android developing but right now I'm working on an application that displays Random Facts. Since I don't want it to be in a random order, I would like to have them in a list. I would like to order through them one by one and show them using TextView. Resources res = getResources(); myString = res.getStringArray(R.array.Fa...

How to save a Control Array

Hello I have this code that allow the user to create a button array, any were in a from. I can give 2 links so you guys can fallow what its done first MSDN and second HERE this one is a Simple sample of what I am doing (on Create an account now? Click NO and then download the zip file it takes 2 seconds and I am working on version 2010 ...

How do I use a variable as an index to an array in PHP?

Hi, I have a config file which has variables based on the domain of the page (HTTP_HOST) $c is an array. eg $c['example.com-user'] is an entry in the config file. I need to pass the value of $c['example.com-user'] to a function building the variable name on the fly. I have "example.com" in $host variable Thanks for any help! ...

In C/C++, is char* arrayName[][] a pointer to a pointer to a pointer OR a pointer to a pointer?

I understood multi-dimensional arrays as pointers to pointers, but perhaps I am wrong? For example, I though: char * var = char var[] char ** var = char* var[] or char var[][] char *** var = char var[][][] or char* var[][] or char** var[] Is this incorrect? I was confused because I saw a char*[][] cast as a char** in a simple...

How to bubble sort through a text file in Java

How do I do a bubble sort in java, The text file looks like this: aaa 2 bbb 3 ccc 1 What I need to do is to loop through it and display the highest score to the lowest. When I run the code below, The numbers, are already sorted. and it will display 3, 2, then 1. But the name isn't in sync with the corresponding score, it will onl...

PHP: How to find difference of 2D arrays?

I have two multidimensional arrays.. with same data... what happens is.. values in one array may be changing internally in one multidimensional array.. here is my array... $previousA = array(); $previousA["t"] = array("twitter","picasa"); $previousA["d"] = array("youtube","gmail"); $freshA = array(); $freshA["t"] = array("twitter","pi...

abstract method of a set length array in java?

Hi, i am trying to create a abstract array method that specify's that this abstract object of an array can only hold 3 items. Now i have tried doing something like this public abstract BaseAdapter[3] adapters(); but it complains with an error that it cant be done this way. is their another way or do i need to just do public abstract Ba...

Remove first character from a Javascript string

I have the following string: ,'first string','more','even more' I want to transform this into an Array but obviously this is not valid due to the first coma. How can I remove the first coma from my string and make it a valid Array? Get something like this: myArray = ['first string','more','even more'] Thank you. ...

jQuery SIMULTANEOUSLY animate all objects in an array.

Hello, I am writing a script that does animations on a web-page. In the process I need to add several elements to an array, and then simultaneously animate them. Is it possible to use jQuery to SIMULTANEOUSLY animate all objects in an array? Or maybe there's a better method for that? Thanx ...

Pointer to array deletion

Hi, I have an array that is passed via a function and assigned to a class member which is a pointer. class ClassA{ unsigned char * pointerToArray; ClassA(unsigned char array[]){ pointerToArray = array; } ~ClassA(){ //what to do here } }; Now i have this second class which uses this class ClassB { std::list<ClassA> cl...

I have lots of questions about c++ that are really confusing me

I started learning c++ about 3 weeks ago after 2 years of java. It seems so different but im getting there. my lecturer is a lovely guy but any time i ask a question as to why something is that way or this way. he just responds "because it is". Theres lots of comments in the code below with a few random questions, but the main problem ...

objective-c spilt array in multiple arrays for uitableview grouped

hi i have an array of objects which need to be sorted (alphabet on name) ArtistVO *artist1 = [ArtistVO alloc]; artist1.name = @"Trentemoeller"; artist1.imgPath = @"imgPath"; ArtistVO *artist2 = [ArtistVO alloc]; artist2.name = @"ATrentemoeller"; artist2.imgPath = @"imgPath2"; ArtistVO *artist3 = [ArtistVO alloc]; artist3.name = @"APh...

find if an integer exists in a list of integers

i have this code: List<T> apps = getApps(); List<int> ids; List<SelectListItem> dropdown = apps.ConvertAll(c => new SelectListItem { Selected = ids.Contains(c.Id), Text = c.Name, Value = c.Id.ToString() }).ToList(); ids.Contains seems to always return false even...

PHP: How will array depth influence performance?

Now I know there is some related questions on this topic but this is somewhat unique. I have two array structures : array( [0] => array( 'stat1' => 50, 'stat2' => 12, 'stat3' => 0, 'country_name' => 'United States' ), [1] => array( 'stat1' => 40, 'stat2' => 38, 'st...