208 karma · joined December 13, 2013
<meta name="googlebot-news" content="nosnippet">https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions....
Last time I checked, MySQL supported it in more cases. MySQL can also be explicit about it via "lock assertions":
ALTER TABLE ..., LOCK=NONE;
will give an error if the requested operation can't be performed while still allowing concurrent reads and writes to the table (if you're fine with preventing writes you can use LOCK=SHARED).The LOCK clause isn't just an assertion and can actually affect how MySQL performs the operation, but I tend to think of it as asserting "this won't cause downtime by locking this multi billion-row table while it spends an hour rewriting it".
Aegisub however has good automation support, and has (had?) a pretty active scripting community. Scripts can do a lot of stuff and often has simple dialog-box UIs. The base scripting support is in Lua, but a lot of scripts are written in a Lua variant called Moonscript. I've never seen it used anywhere else. And, as was mentioned in a sibling comment, there are scripts for importing motion-tracking files into Aegisub.
The ASS format lacks support for a bunch of stuff that people want to do, or the native support is deficient in some manner, so scripting is very important for Aegisub. For example, a line can be given a color gradient by make a one copy of the line for each shade in the gradient (this can be 100+ times). Each copy is then given a different color according to the gradient, and a \clip command is used on each line to only show a 1-2 pixel wide slice of each line. If all those slices are lined up properly and the lines are displayed simultaneously, it gives the impression of being a single line with a color gradient. Tricks like this can actually cause performance problems in rendering the subtitles!
I think this is an interesting little programming niche, but there isn't much complex typesetting being done these days. Tastes have changed, and due to licensed releases there's less need for fansubbing on all but the most niche titles.
I don't really know, but I suppose it might be possible to make bcmp faster since you have less strict requirements on the return value.
It's a blocklist that all licensed gambling companies in Sweden are required to respect. You add yourself to the list for a certain amount of time, and can't unblock yourself until that time has expired.
<file.txt grep foo | sortFor example, you could have a function
void hash(char *out, const char *in);
with two different possible implementations: a slow one using common instructions, and a fast one using exotic instructions.
You can then can have a resolver like this: void fast_hash(char *out, const char *in);
void slow_hash(char *out, const char *in);
void (*resolve_hasher(void))(char *, const char *)
{
if (cpuSupportsFancyInstructions()) {
return &fast_hash;
} else {
return &slow_hash;
}
}Some code I just compiled with GCC 6.1.1 had several snippets like this emitted for zeroing with memset:
xor eax,eax
...
rep stos QWORD PTR es:[rdi],rax
and some rep movs for memcpy/memmove. int main(void) { for (;;); } #include <stdio.h>
int main(void) {
(* * & * * * * * & * * * * * * * * * * * * * printf)(&1["C is awesome\n"]-3/2);
} int remaining = length % 4;
switch (remaining) {
case 3: h ^= (data[(length & ~3) + 2] & 0xff) << 16;
case 2: h ^= (data[(length & ~3) + 1] & 0xff) << 8;
case 1: h ^= (data[length & ~3] & 0xff);
h *= m;
}Good
fn inc(a: u32) -> u32 { a + 1 }
fn foo(a: u32, b: u32) -> u32 { let x = a + b; a * x }
Bad fn bar(...) -> bool {
let mut success = false;
let conn = getConnection();
...
if x > y {
return false;
} else if z < q {
success = false;
}
foo.barify(x, y);
...
success
}
It looks especially bad when the function has multiple early returns, and then the final return looks different.[1] https://wiki.postgresql.org/wiki/UPSERT#SQL_MERGE_syntax
They're not always perfect, but in this case it's quite good.
err.rs:4:9: 4:10 error: cannot borrow `v` as mutable because it is also borrowed as immutable
err.rs:4 v.push(6); // oops, sorry x!
^
err.rs:3:17: 3:18 note: previous borrow of `v` occurs here; the immutable borrow prevents subsequent moves or mutable borrows of `v` until the borrow ends
err.rs:3 let x = v.get(2);
^
err.rs:5:6: 5:6 note: previous borrow ends here
err.rs:1 fn main() {
err.rs:2 let mut v = vec![1i32, 2, 3, 4, 5];
err.rs:3 let x = v.get(2);
err.rs:4 v.push(6); // oops, sorry x!
err.rs:5 }
^
If you want to try out code examples, the Rust playpen is nice: http://play.rust-lang.org