This tag is used mostly regarding associative arrays (but better use tag "associative-array" for that) and sometimes in the mathematic sense of tag "associativity", the associative property of binary operations.
Questions tagged [associative]
435 questions
4
votes
1 answer
Objective-C: Associative Object Behaviors
Does OBJC_ASSOCIATION_RETAIN_NONATOMIC of the Associative Object Behaviors in the Objective-C Runtime Reference, call release on the old value referenced by the associated object before it assigns & retains the new value?

ma11hew28
- 121,420
- 116
- 450
- 651
4
votes
1 answer
Why C++ associative containers predicate not transparent by default?
Since C++14 we have std::less that is transparent and more usefull in most cases, so is there reasons why, for example, std::set still has std::less as a predicate by default, not an std::less except historical reasons.
Useful…

Anton Lashkov
- 280
- 3
- 10
4
votes
2 answers
Associativity of == operator in c++
I have this snippet of code in c++:
std::vector v1;
std::vector v2;
...
if (v1.insert(v1.end(), v2.begin(), v2.end()) == v1.end())
{
return 0;
}
Which expression will be evaluated first? When debugging, the right side of "==" operator…

user3691223
- 353
- 2
- 11
4
votes
3 answers
How to sort associative array in Javascript?
I need to sort associative array by JS for one of my projects. I found this function, that works great in firefox, but unfortunately it doesnt work in IE8, OPERA, CHROME... Cant find the way to make it work in other browsers, or find another…

Santi
- 43
- 1
- 4
4
votes
2 answers
Php associative array value insertion, wrong key displaying
Heres my problem. I have an associative array and would like the keys to match the item id of the item object passed into the function. If the item id key doesn't already exist in the array, I would like to add to the cart array the item id as a key…

Eladian
- 958
- 10
- 29
4
votes
1 answer
Create "object" in freemarker only (no JAVA etc)?
After reading Freemarker documentation and googling about it I just don't see how can I build my test object (like associated, multilevel array) in freemarker only.
So like:
<#assign seq=["a","b","c"]>
But in more depth - like (pseudo):
a
…

nettutvikler
- 584
- 7
- 18
4
votes
1 answer
SQL Listing multiple artists for a song
I suspect my question has a duplicate and I am sorry for that as I couldn't find what I'm looking for.
If that is the case, could you tell me where I can find that answer?
I want to manage a song library.
I have a table called songs :
song_id …

blex
- 24,941
- 5
- 39
- 72
4
votes
4 answers
Is it possible to overload operator associativity in C++?
I'm building a class that has a slightly asymmetric addition. Before the complaints come in, it's necessarily asymmetric. There is a conversion (operation that takes a bit of time) that has to happen when two objects are added together, and the…

PengOne
- 48,188
- 17
- 130
- 149
4
votes
1 answer
Scala right associative methods
I am learning Scala, and playing with right associate unapply object. I know that if the name ends with ':' then it becomes right associative. However, there seems to be some strange restrictions on the naming
e.g.
These are invalid
object cons: {…

ekj
- 1,082
- 2
- 11
- 22
3
votes
1 answer
Oracle Associative Array TYPE is not able to use in USING statement (If TYPE is declared within Package)
If 'Associative Array variable' is declared globally, able to use that in OPEN CURSOR USING statement.
If 'Associative Array variable' is declared within package, while use in OPEN CURSOR USING statement, getting compilation error.
More details…

iammuruga
- 61
- 1
- 5
3
votes
1 answer
Format MySQL Select into Associative Array in CakePHP
I like how CakePHP automatically loops through the results of MySQL queries and formats them in a nice map for you.
Here's a sample query that I'm using:
# Inside some model
return $this->query("
SELECT
Profile.id,
SUM( IF(…

rodrigo-silveira
- 12,607
- 11
- 69
- 123
3
votes
2 answers
PHP - Cast int key to string?
I have a few large PHP functions written some time ago. They contain some associative arrays. Until now, I had no problem with these arrays because they contained keys of type string and int (like "brown" and 118). The problem is, when the keys are…

cili
- 1,037
- 2
- 19
- 34
3
votes
3 answers
Access data in python3 associative arrays
I'd like how to create and print associative arrays in python3... like in bash I do:
declare -A array
array["alfa",1]="text1"
array["beta",1]="text2"
array["alfa",2]="text3"
array["beta",2]="text4"
In bash I can do echo "${array["beta",1]}" to…

Siracuso
- 33
- 5
3
votes
2 answers
pass associative array from php to javascript
Possible Duplicate:
How to pass an array of strings from PHP to Javascript using $.ajax()?
I want to pass a associative array from php code to javascript code. Please help me. how do I do this ? Is JSON helpful in this matter? If yes then please…

Abhimanyu1310
- 71
- 1
- 1
- 3
3
votes
2 answers
Looping through empty javascript array returns array object functions
I noticed that in my javascript, if I create an empty array, loop through it as an associative array, and print out the contents, it returns what looks like functions from the Array Object class itself. Here is my code:
var test = new…

Mel
- 1,075
- 1
- 14
- 24