Questions tagged [indirection]

Any of various programming concepts related to the level of abstraction applied to a particular problem, algorithm or scenario. Examples may include substituting higher-level programming constructs where previously lower-level constructs were previously applied.

Indirection

Any of various programming concepts related to the level of abstraction applied to a particular problem, circumstance, algorithm or knowledge domain.

160 questions
0
votes
1 answer

Any concrete benefits of extra level of indirection

Please consider the Javascript code excerpt at the bottom. Roughly it consists of two modules, one for handling messages. What is the benefit of the filtersUpdateSuccess method within the messages module? Currently it merely delegates to the…
Dexygen
  • 12,287
  • 13
  • 80
  • 147
0
votes
0 answers

react component implementation indirection

Is it possible to define a component interface library, and have the actual implementation library be linked at runtime or if not possible compile time. I am looking for a solution that relies on inversion of control and not clutter conditions…
Philippe
  • 51
  • 5
0
votes
2 answers

Is it possible to use indirection with base R?

Question: Is there a better way to indirectly reference a data variable in a function when using base R? Example Setup I have a dataframe that I want to loop through some column (will vary in name) and build a string. This is simplified, but…
ScottyJ
  • 945
  • 11
  • 16
0
votes
1 answer

void** parameter called with a fixed array value

I have a fixed-size array declared: int vals[25]; And I'd like to send the array to a function which will assign the values of vals: bool FetchValueArray(char* source, char* name, char* typeFormat, int count, void** destination) { int i; …
MPelletier
  • 16,256
  • 15
  • 86
  • 137
0
votes
1 answer

Understading Pointers in Linked List

I'm currently working on a question from a book that I've been reading titled "How to program in C". The question reinforces the use of linked list data structures. From what the book explained, linked list data structures have 3 main functions…
0
votes
1 answer

Does xlwt module support INDIRECT?

I used the following codes, but it doesn't work. I checked the xls. The formula is filled in correctly, but remains as a text entry. If to press ENTER to active this cell, it works. sheet1.write(1, 1, xlwt.Formula('INDIRECT(\"\'sheet1\'!B1\")')) I…
Colin.Z
  • 31
  • 3
0
votes
2 answers

jQuery indirect selection. How can I pass an 'id' to a function as text and have that function select it?

In essence the function would contain a jQuery selection based on the id that is passed as argument. I recall seeing some code where $x was used to execute jQuery as if it was the selection. I want to pass an element id to a function that executes…
0
votes
0 answers

Concat variable's name in powershell

I looking for this in powershell $VAR0=args[0] $VAR1=args[1] $VAR2=args[2] With a construction like this $a=0 $VAR+$a=args[$a] but I cannot concatenate this way
0
votes
2 answers

Bash : improve variable indirection assignment in one line

In my Gitlab project, I set the Gitlab variables MY_VAR_DEV and MY_VAR_PROD. Depending on the commit branch, I want a different behavior on the CI/CD pipeline (.gitlab-ci.yml file), according to the below code: - if [ $CI_COMMIT_BRANCH == "dev" ];…
JohnDu17
  • 37
  • 1
  • 6
0
votes
4 answers

Monitor image access AND/OR prevent direct access

I want users to see an image as part of a web page but I want to avoid them accessing a image directly. This could, say, give clues in the URL about what user they're linked to (a flaw I've seen in one facebook application). How can I go about…
James P.
  • 19,313
  • 27
  • 97
  • 155
0
votes
1 answer

Secondary expansion in a Makefile is causing unnecessary targets to be run

I am trying to write a Makefile that builds PDF outputs with LaTeX, using Latexmk. The outputs have basically the same rule, with different prerequisites, so I tried generalising my original Makefile using GNU Make's "secondary expansion". (I also…
Xophmeister
  • 8,884
  • 4
  • 44
  • 87
0
votes
2 answers

Bash Arrays - Zip array of variable names with corresponding values

As I am teaching myself Bash programming, I came across an interesting use case, where I want to take a list of variables that exist in the environment, and put them into an array. Then, I want to output a list of the variable names and their…
Sean
  • 393
  • 2
  • 11
0
votes
1 answer

Solaris 11 express and indirection

I am trying to use bash indirection in Solaris 11 express to change the password for a user. The code I am using is $ passwd testuser << MARKER > testpassword > testpassword > MARKER When I run this, I still get prompted for a password on the…
jobless
  • 145
  • 1
  • 1
  • 4
0
votes
3 answers

Why application of indirection to a two-dimensional array gives a pointer?

After reading some posts on this site, I realized that array in C isn't just a constant pointer as I originaly thought, but is itself a distinct type, but in most cases array "decays" to a constant pointer to the first element of the array. Because…
0
votes
3 answers

Executing the output as filename

In one of my Bash scripts, there's a point where I have a variable SCRIPT which contains the /path/to/an/exe, and what the script ultimately needs to do, is executing that executable. Therefore the last line of the script is $($SCRIPT) so that…
Enlico
  • 23,259
  • 6
  • 48
  • 102