9 karma · joined Sep 15, 2014 (12y ago) · 8 submissions
comment 8y ago · link · parent
#include <stdlib.h>
#include <stdio.h>
static const char str[] = "fizzbuzz";
static inline void out(int i, size_t offset, size_t sz)
{
if (sz) {
fwrite(str + offset, sz, 1, stdout);
} else {
fprintf(stdout, "%d", i);
}
putchar('\n');
}
int main(void)
{
for (int i = 1; i <= 100; i++) {
int a = i % 3 == 0;
int b = i % 5 == 0;
out(i, 4*((a^b)&b), 4*(a+b));
}
exit(0);
}
There's a way to remove that conditional, too. Probably.comment 9y ago · link · parent
comment 10y ago · link · parent
If the wasm effort works out (it's looking like it will), it would hopefully alleviate the issue you present entirely and make this solution viable in a very sane way.
comment 11y ago · link · parent
comment 11y ago · link · parent
$ find . -name "*blarg*.cpp"
$ grep -i "blooey" $(!!)
$ vim $(!! -l)
Granted, you can only append new arguments and using the other ! commands will often be less practical than editing. Still, it's amazing how frequently this is sufficient.I've always thought it'd be nice if there was a `set` option or something similar that would make bash record command lines and cache output automatically in implicit variables, so that it doesn't re-run the commands. The semantics are definitely different and you wouldn't want this enabled at all times, but for certain kinds of sessions it would be very handy.
EDIT: lazyjones beat me to it.
8.
Living Standards: “Who Needs IANA?”(masinter.blogspot.com ↗)
1 points · by tne · 12y ago · discuss