An array is a data structure consisting of a collection of elements (values or variables), each identified by at least one index. An array is typically stored so that the position of each element can be computed from its index tuple by a mathematical formula.
1
vote
1answer
19 views
Find the object that contains title1-2
I use jQuery and underscore.js, I have title1-2 and I would like to have the action corresponding.
this.items = {
menuItems: [
{ title: 'title1',
data: [
{ ...
5
votes
7answers
135 views
Comparing string arrays
My code does what I need it to do, but I think I am missing the "right" way to do this with comparing the arrays. Essentially what I need this to do is compare a textbox entry against two different ...
0
votes
0answers
27 views
Using arrays in str_replace [migrated]
Is this valid PHP syntax? I think it may be causing the following warning:
Warning: Illegal offset type
$filterclear = str_replace($tag, '', $queryString);
$filterclear = str_replace(array('=+', ...
0
votes
1answer
28 views
PHP illegal offset type in multiple loop structure
For reference, the function in question takes a URL structure which is most often a query string (but sometimes not) and generates filters to remove query var's from the URL. So if you're looking at ...
1
vote
1answer
37 views
Downsampling boundaries of a 2D array
I have a linearized 2D array u (block_height * block_width) containing the values of a physical quantity over a regular 2D mesh. I need to downsample boundaries (top, bottom, left, right) of this ...
1
vote
2answers
82 views
Help me condense a series of lengthy javascript conditional arrays
I'm not too used to working with arrays in javascript, so was wondering if there is a good way to condense this down.
Any pointers much appreciated!
you can see it in action @ ...
3
votes
2answers
76 views
Can someone check if my code follows the instructions of the given assignment?
I would like someone to check if I followed the instructions of the assignment. I find the instructions a little confusing. Here is the assignment: Dynamic character arrays str and add contain ...
1
vote
1answer
60 views
PHP Add Column to two dimentional array
i do have two dimentional array of data in php.
I do want to add another column with constant to that array for passing tabular data to next program.
i am iterating and adding manually. What can ...
2
votes
0answers
75 views
Better method to loop through arrays in VBA
I supplied the following code as an answer to this question on SO, but I was wondering if there was a better way to write out all those array loops. (i.e. perhaps using a Collection/Dictionary?) It ...
9
votes
7answers
449 views
Java function to read a CSV file
I have a java function that reads a csv and returns its content as a Vector<Vector<String>>.
The function seems to work as I need it, but my gut feeling says it could be better (never ...
1
vote
3answers
125 views
Optimize Array.indexOf
How can I optimize checking a value in recursion before operating on it? I'm using Array.indexOf (this is Javascript)
var nums = [], lengths = [];
function findNumLength(n) {
//preliminary check ...
3
votes
3answers
145 views
Missed lab, wondering how this bit of Java code could be improved anyway?
I'm not able to get feedback on this because I forgot about the lab due date, but I'd appreciate some critique anyway. It takes in a user specified number of points then finds the two points with the ...
1
vote
2answers
97 views
Mutlilevel page list in CodeIgniter
I'm newly working with CodeIgniter and PHP. I wrote a category structured 'pages' code with listing pages as multilevel list or indented select box.
page ...
1
vote
1answer
91 views
Change URL on select change
I've made a method, which inserts a new query parameter, when the value of a select changes, then reloads the page. I've had enough of URL jQuery hax, so I figured it would be a great idea to put the ...
0
votes
1answer
62 views
PSEUDO Query (jQuery extension)
I just invented PSEUDO Query!
var objects = $.pquery([
'##pquery##', // Initialize as PSEUDO Query Object
[document.body, 'css', [{'background-color':'#f00'}], 'append',
...