Questions tagged [substitution]

The action of replacing something with another thing.

The action of replacing something with another thing.

1879 questions
0
votes
1 answer

Substitute symbolic variables with vectors

Consider the script syms a b; f = a.*b; a = [1 2]; b = [0 2]; subs(f) This yields a vector as output ([0, 4]), but the intended output is a scalar (4), given the element-wise multiplication that should be performed. How can I properly utilize…
Eivind
  • 301
  • 6
  • 18
0
votes
1 answer

Replace end of string on many lines with values from array

I have a file that contains: asd x sometihng else asd x sometihng else asd x and an array that contains values=(3,4,5). And now I want to replace the "x" on the first line in the file, with the value of the first element in the…
0
votes
1 answer

IzPack 5.1 - use user input variables in bash script without substitution

Hopefully someone could help me here with following problem – tried to find a solution for this for weeks but unfortunately wasn’t able to find one. I am using IzPack (recently updated to 5.1) as an installer for a software package. This package…
M4r10
  • 1
  • 1
0
votes
2 answers

Python substitute elements inside a list

I have the following code that is filtering and printing a list. The final output is json that is in the form of name.example.com. I want to substitute that with name.sub.example.com but I'm having a hard time actually doing that. filterIP is a…
Brando__
  • 365
  • 6
  • 24
0
votes
2 answers

Python string substitute

I have the following bit of code that returns some json. I want to change the output to be .sub.example.com. Normally I would be able to do this in awk, but in this particular case it needs to be handled in python. What I've been trying to do is…
Brando__
  • 365
  • 6
  • 24
0
votes
1 answer

vim 7.4 saving substitution pattern and replacement

I have a function in my .vimrc file to remove any whitespace at the end of my lines: " Remove trailing space on write function! StripTrailingWhitespaces() let _s=@/ let l = line(".") let c = col(".") %s/\s\+$//e let @/=_s …
Vinz
  • 5,997
  • 1
  • 31
  • 52
0
votes
0 answers

Make advanced font settings using JS?

The "Standard", "Sans-Serif", "Serif", "Monospace" are set to font-names by the browsers and its users with extensions like the "Advanced font setting" which is written in JS. is there a way to change the font-names that it refers to with javascript…
0
votes
3 answers

Remove single quotes around string in excel

In my excel I have the following text in a cell: INSERT INTO `educations`(`education_id`, `school`, `specialization`, `date_from`, `date_to`, `user_id`) VALUES (NULL,'NULL','software','2006-01-01 00:00:00','2006-01-01 00:00:00',@inserted_id); I…
Dennis
  • 3,044
  • 2
  • 33
  • 52
0
votes
2 answers

Quotes in variable - comparison and substitution

I define variable like: set LOGGING_MANAGER=-Djuli-logback.configurationFile=file:"%CATALINA_HOME%\conf\logback.xml" Notice, that I wrap %CATALINA_HOME%\conf\logback.xml in double quotes, because path may contain spaces. And at execution step this…
learp
  • 153
  • 8
0
votes
0 answers

Substitute variable inside another variable in bash

This is my sample bash code: exec_command(){ command_1="" command_2="" command_3="" now=$@ echo $now } for (( i=1; i<=3; i++ )); do exec_command "command_$i" Here the…
Muradin
  • 3
  • 4
0
votes
1 answer

How do I reference my own class in an Android content XML file?

I'm using Android Studio and in my content XML file, I was referencing android.support.v4.view.ViewPager. Instead of the ViewPager class, I want to use my own VerticalViewPager class. How would I do that? Here is what I have…
Terry Neckar
  • 137
  • 1
  • 8
0
votes
1 answer

mysql select if field row is blank substitute data from another field on sametable

uid external rn345 -- ev456 -- -- Peter So I have the above table and I want to select the uid however I also wanted to substitute the value on the "external" field to the "uid" field if the value is blank. So essentially, I would…
ubay25
  • 23
  • 7
0
votes
1 answer

explanation for call expansion failing

I'm looking for some tips in troubleshooting the failure of call to expand t, z, and a. Example: for /F "delims=" %%F in ( 'dir /b "%source%\*." ' ) do if not exist "%target%\%%~nF.jpg" copy "%source%\%%~F" "%target%\%%~nF.jpg" for /F "delims="…
c.diaz
  • 17
  • 5
0
votes
1 answer

MATLAB - subs method doesn't work on symbolic vector of indexed variables

Consider the following code: A = sym('a', [1, 2]); b = sym('b'); ans = A.^2 + b; A = [1, 2]; b = 4; subs(ans) This yields the output ans = [ a1^2 + 4, a2^2 + 4] Whereas I would have wanted it to produce ans = [ 5, 8] What is required for…
Eivind
  • 301
  • 6
  • 18
0
votes
2 answers

vba - saving file to my personal desktop code

I have the following code which is designed so I can quick save to my desktop and then put the file into a folder. This code works fine if the file is already saved in an .xls, .csv, .xlsx or .xlsm file extension, however, when the file IS NOT…
Mike Mirabelli
  • 402
  • 3
  • 16