This question already has an answer here:
Increasing the print depth in SML/NJ
(1 answer)
Closed 6 years ago.
I'm using Emacs to write a simple function in sml of about 4 lines and when I try to call the function/evaluate it in the buffer it returns this with 3 dots at the end
val it = [1,2,2,2,2,2,2,2,2,2,2,2,...] : int list
What's the dots at the end? My code doesn't print any dots. Is this is from Emacs or sml? any hints please.
Also I'm supposed to get a longer list like
[1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
is that why the dots there?
is that why the dots there?
Yes.
Related
This question already has answers here:
Perform calculation only if both cells are not blank with arrayformula? [duplicate]
(3 answers)
ArrayFormula and "AND" Formula in Google Sheets
(4 answers)
Closed 4 months ago.
So I am trying to get this Arrayformula to work so I can plot this formula instead of calculating every Y myself.
=arrayformula(Sum(IF(Z3:Z294>Y$1;IFS(AB3:AB294>0;0;Z3:Z294>Y$1;Y3:Y294-(F3:F294*Y$1));0)-(Sum(IF(and(J3:J294>0;Z3:Z294>Y$1);F3:F294;0)))))
It gives me the (correct) return of this part:
Sum(IF(Z3:Z294>Y$1;IFS(AB3:AB294>0;0;Z3:Z294>Y$1;Y3:Y294-(F3:F294*Y$1));0)
But it doesn't subtract the second part:
-(Sum(IF(and(J3:J294>0;Z3:Z294>Y$1);F3:F294;0)))))
I am quite new to extensive Excel/Sheets formulas so I have no idea how to get this to work, It is also quite weird that the second part doesn't add up even seperate from the first part. So this also doesn't work:
=arrayformula(Sum(IF(and(J3:J294>0;Z3:Z294>Y$1);F3:F294;0)))
I hope it makes some sense without any context, thanks in advance!
Have a great rest of your day,
P.S. Please ignore simple mistakes, I don't code that often in Sheets ;)
AND is not supported. instead of
and(J3:J294>0;Z3:Z294>Y$1)
do this:
(J3:J294>0)*(Z3:Z294>Y$1)
This question already has answers here:
Regular expression to stop at first match
(9 answers)
Closed 1 year ago.
I am looking for some help to put a REGEX expression together that will return the contents between ROUTINE and END_ROUTINE
I have tried
ROUTINE S[0-9]{1,5}_[A-Z0-9_]* ([\s\S]*)?(?=END_ROUTINE
)
But it doesnt seem to provide the correct output
ROUTINE S7026_HMI_LB0_SP_MAX
RC: "===================================================================================================$N"
"$N"
"Local HMI Station B Setpoint Commands Max Clamp$N"
"$N"
"===================================================================================================";
N: NOP();
END_ROUTINE
ROUTINE S0100_DIAGNOSTICS
N: JSR(S0101_PLC_Diagnostics,0);
N: JSR(S0102_IO_Diagnostics,0);
END_ROUTINE
It could be enough to add a modifier U to make it ungreedy.
/ROUTINE(.+)END_ROUTINE/sU
(you can test it here: https://regex101.com/r/U2MM6G/1)
Alternatively, you can also do this more specifically:
/ROUTINE(.+?)END_ROUTINE/s
This question already has answers here:
How to remove the last 13 (or n) characters of every line using Notepad++
(3 answers)
Closed 5 years ago.
I am looking for a way to delete 9 characters after a string :
vimeo.com/600984066
I want to only have vimeo.com/ is there a way to do it with maybe regex ?
Important : I have some content after so i can't delete the 9 last characters of a line.
I found a solution using (?=vimeo\.com).{18}, hope that will help someone.
This question already has answers here:
How do you make Vim unhighlight what you searched for? [duplicate]
(14 answers)
Closed 6 years ago.
So I'm practicing Ruby on Codeacademy and to save the work that I'm doing I copied and pasted my code onto my cmd prompt using VIM. However, I noticed that each line of code was commented with the '#' symbol and I wanted to remove them.
To be productive, I searched online how to use regex to search for all the hashtags and remove them with this command:
:%s/#//gc
Then this popped up:
replace with (y/n/a/q/l/^E/^Y)?
I pressed y every time until the message disappeared and now I'm stuck with all hashtags characters being replaced with a yellow rectangle. So instead of having this:
#
I have this:
[] but shaded in yellow for every time I use a hastag.
Any help would be much appreciated!
The yellow rectangle represents the characters that matched your expression. To clear the last search highlighting, use:
:noh
To uncomment the lines of code, I would just do this:
Use V to select each line, then
:norm x
This question already has answers here:
Using regex in R to find strings as whole words (but not strings as part of words)
(2 answers)
Closed 4 months ago.
I have a data.frame named all that has a column of factors, these factors include "word","nonword" and some others. My goal is to select only the rows that have the factor value "word".
My solution grep("\bword\b",all[,5]) returns nothing.
How come word boundaries are not recognized?
In R, you need two times \:
grep("\\bword\\b", all[5])
Alternative solutions:
grep("^word$", all[5])
which(all[5] == "word")