Comparing characters at the same index of two strings

I am trying to compare the characters of two strings at a given index. However, I am getting the following error: Line 9: Char 26: error: invalid operands to binary expression (‘const __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ (aka ‘const char’) and ‘const std::__cxx11::basic_string<char>’) if (s[i] != letter) { return s.substr(0, i); } ~~~~ ^ ~~~~~~ Here is my… Read More Comparing characters at the same index of two strings

Grep exclude count of occurence match between comments <!– –> of curl body

I am very new to linux & bash script. I’m trying to read an xml file using curl command and count the number of occurrence of the word </entity> in it. curl -s "https://server:port/app/collection/admin/file?wt=xml&_=12334343432&file=samplefile.xml&contentType=text%2Fxml%3Bcharset%3Dutf-8&quot; | grep ‘</entity>’ -oP | wc -l This works correctly, however the xml file consists of comments like below resulting in… Read More Grep exclude count of occurence match between comments <!– –> of curl body

How to use `label_date_short`?

How I am using wrongly label_date_short from scales package? library(tidyverse) library(scales) date_taille <- tibble( Taille = rep(c("taille_hiver", "taille_ete"), times = 2), Date_taille = c("2016-08-01", "2016-02-01", "2018-08-01", "2018-02-01") %>% as.Date() ) ggplot(date_taille) + aes(x = Date_taille, y = Taille) + geom_point() + scale_x_date(date_breaks = "month", date_labels = label_date_short()) #or label_date() #> Error in format(x, format =… Read More How to use `label_date_short`?