I define in MATLAB:
syms k2 k3;
k1 = k2/k3;
Where k2 and k3 are symbolic variables. Then typing k1 gives the output:
k1 =
k2/k3
Assign constant value for k2 and k3:
k2 = 1; k3 = 2;
Then I type in matlab commandline:
>> k1
k1 =
k2/k3
Is there…
I'm writing a random substitution cipher, and it works well when being used to write regular sentences. However, when I try to test 'abbcccddddeeeee', I will get something back like 'G H H I I I J J J J K K K K K'. How can I change my code so that…
I have a data frame where the upper left looks like this:
Row.names Chrom Position GT_1 GT_10 GT_100 GT_101 GT_103
1 SST4.03CH00_1006820 0 1006820 TTTA TTAA TTTT TTTT
2 SST4.03CH00_1006822 0 1006822 CCCC …
Here is the code:
declare -A data84
data84=( [Tom]=23 [Lucy]=32 )
function test()
{
data=$1
echo ${${data}[Tom]} #error 1: "${${data}[Tom]}" bad substitution
a=${data}[Tom]
echo ${a} #output unwanted result data84[Tom]
}
test…
I'm using Ruby 2.4. How do I remove non-letters from the beginning of my string? I thought I could do something like
name ? name.sub(/^[^a-z]*/i, "") : nil
but this neglects things like an accented a ("á") or that type of "u" with the dots above…
I want to substitute parts of the transform function with variable inputs.
I have created a df using subset with col1 from an existing table:
col1 = c('A','B','C')
The df looks something like this:
A = c(1, 3)
B = c(3, 1)
C = c(5, 2)
df =…
Column D is result of LOOKUP from Column C
A B C D
1 1234 1234567 Person1 ASKXXXXXXXX
2 3692 8465837 Person2 AFTXXXX
I need to replace X's in D with B if there are 8 of them,
and to replace X's in D with A if…
Good afternoon people.
I'm trying to replace a result from a query in a particular column in sql. the table is as follows:
+-----------+----------+-------+-------+---------+
| firstName | lastName | major | minor | credits…
Is it possible to combine the MID or RIGHT function with the Substitute function and make that conditional on the value of another cell.
I have two columns one is a product code, starting from the 8th character there are 3 letters that correspond to…
I have script which is taking one argument ($1). So I run it like this: bash script.sh file1.txt. But when I want to substitute more files (bash script.sh *) then he only takes one file from all. How can I make it work? Should be there another…
I am doing some substitution in files as follows:
file: abc.txt
`include foo.h
int main
{
int foo
foo and bar
barfoobar
}
I want to replace 'foo' inside the braces, but I don't want to replace the 'foo' written in the include directive.
I tried…
Newbie question: Can one substitue commands, properties or methods for NSStrings or char at runtime?
Lets say I do something like this:
//these are the names of my properties of an NSObject I created
char theChangingProperty[17][18] = {"name",…
I have an array that looks something like:
mylist = [
"blah blah hello",
"\nbarnacles and stuff()",
"\nhello again",
"\nother stuff )"
]
And my regex is like the following:
s = 'hello'
rx = re.compile(s + '.*')
newlist = [ rx.sub(thing, '')…
I'm not sure is my Title correct, but I don't know how else to put it.
Not an Excel expert so I would need help here.
I'm having COL A and COL B, COL A containing a name and COL B containing a link to COL A. All values in COL A and COL B are…
echo "eh]" | sed -r 's/[\]a]/lol/g' returns eh] instead of ehlol. no errors are raised so I assume \] is some kind of sed magic. Im tired of constant sed problems, but I have to use it. so how to escape ] in sed substition expression?