:cnoreabbr html runtime! syntax/2html.vim
Now in VIM, I type “:html” to create a new .html file with syntax highlighting
A repository of notes; by noto, for noto. Made public so noto can read it from anywhere. It won't make any sense to you.
:cnoreabbr html runtime! syntax/2html.vim
// Compare two strings without regard to alphabetic case
int stricmp(const char *a, const char *b) {
static const int offset = 'a' - 'A';
for (; *a && *b; a++,b++) {
if (*a != *b) {
char la = 'A' <= *a && *a <= 'Z' ? *a+offset : *a;
char lb = 'A' <= *b && *b <= 'Z' ? *b+offset : *b;
int diff = la - lb;
if (diff) { return diff; }
}
}
return *a ? 1 : *b ? -1 : 0;
}
// Compare two pointers-to-strings without regard to alphabetic case
int sorting_stricmp( const void *a, const void *b ) {
const char **s1 = (const char **)a;
const char **s2 = (const char **)b;
return stricmp(*s1,*s2);
}
// Compare two C++ strings without regard to alphabetic case
int string_icmp(const string &s1, const string &s2) {
return stricmp(s1.c_str(), s2.c_str());
}
The key is set.seed( <seed value> );
Then you can use runif(n=<number of values>, <min>, <max>)
to get random reals, or sample(x, size, replace = FALSE, prob = NULL)
to get a random sample from a collection.