3,317 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
64
views
cannot append index array to associative array sorts
The attached ksh93 enhanced korn shell script has worked happily for 15 years executing on Unix Aix v6.1 server however having upgraded to Aix v7.2 TL5 we're now finding upon executing the same script ...
4
votes
4
answers
136
views
Map unknown associative array element
How can I map an unknown value alongside other known values in bash using an associative array, so that:
#!/bin/bash
array=("foo" "foo" "bar" "something else" &...
2
votes
1
answer
85
views
Downside of NOT using quotes for keys of associative array?
Every example I have found tends to go aa["key"]="value" and even with constants, e.g.:
declare -rA aa=( ["lit1"]="value1" ["lit2"]="value2" ...
-1
votes
2
answers
216
views
How to deserialize ${aa[@]@K} into referenced associative array with no eval effect?
How can I reference an associative array and reassign its content from serialized string?
(The eval requirement is now spelled out explicitly in the title, but this is natural when it comes to ...
0
votes
2
answers
87
views
Create associative multidimensional array in a loop Python
I just started learning Python. I try to create a data structure from the file wg.conf
I'm stuck on creating an array Peers. I need to create multiple Peer entries inside that array.
Config file ...
1
vote
1
answer
89
views
Displaying individual rows with same key as part of larger associative array using PHP and HTML
I am trying to display data from multiple MySQL tables in individual text fields in an HTML form using PHP. Here are three sample tables from a database, followed by code that I am using to select ...
1
vote
1
answer
217
views
Why isn't PHPStan complaining about invalid array keys?
Here's the code:
<?php declare(strict_types=1);
/**
* @param array{key?: string} $options
*/
function hello($options)
{
var_dump($options);
}
hello([
'WRONG_KEY' => '...',
]);
I ...
3
votes
2
answers
200
views
What kind of implementation can I use for a static associative array on a vintage system with very limited resources?
I'm working on a project written in C that's going to be deployed on vintage systems with very limited resources. The target system has at minimum a 16 MHz Motorola 68030 processor with a 256 byte L1 ...
-7
votes
2
answers
91
views
Filter an array of arrays to remove rows where the entire payload is found inside another (potentially larger) row [closed]
I get an array of associative arrays of selected company's hierarchy combinations (Some hierarchy levels may be null).
For example, if the hierarchy goes division > department > team:
[
0 =>...
-4
votes
1
answer
139
views
Building nested array with foreach [closed]
I am trying to build an associative multidimensional array like this:
array(
[0] => Array(
Parent => Mr Smith,
Children => array(
Firstmane => Bob,
...
1
vote
1
answer
213
views
add JSON object keys and values to bash associative array
I want to loop through a JSON object and add the keys and values to a Bash associative array.
Here's my JSON object that is in a file named deploy.json.
"deploymentEnvs": {
"dev":...
0
votes
2
answers
81
views
Global associative array (hash) in the older bash-4
The following script works as expected for me on FreeBSD using bash-5:
function a {
declare -gA Seen
if [[ -v Seen[1ドル] ]]
then
echo "Saw 1ドル already"
return
...
-1
votes
1
answer
74
views
How to dynamically convert a string into (and revert from) UTF8 special font characters?
How to dynamically convert a string into (and revert from) UTF8 special font characters "on-the-fly" using PHP functions?
For example,
echo cvtIntoSpclUTF8FntChars('script', 'Hello, World!');...
1
vote
3
answers
125
views
Dlang associative array of an array of strings keyed by a string has unexpected behavior
The output from the following code does not behave how I think it should. It appears that making changes to the string array returned by testAA.require() does not reflect in the associative array. I ...
-1
votes
1
answer
55
views
bash syntax for accessing an associative array with a value from a different associative array
Good morning,
I have here:
declare A- accocArray1=(["a01"]=1 ["a02"]=2 ["a03"]=3)
declare A- accocArray2=(["b01"]=1 ["b02"]=2 ["b03"]=3)
...