I think it should be possible to get rid of the Option tag without introducing any unsafe code by changing index in Gc from u32 to std::num::NonZero<u32>.
HN user
veddan
For LLMs, I just pulled the latest llama.cpp and built it. Haven't had any issues with it. This was quite recently though, things used be a lot worse as I understand it.
In git a branch is a name that points to a commit. When you commit to a branch, you create a new commit and then update the branch to point to the new commit.
I think you can do this with
<meta name="googlebot-news" content="nosnippet">There's also JSON_ARRAYAGG.
https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions....
I'm a bit behind on modern PostgreSQL so I might be wrong, but I believe MySQL has better support for what they call "online DDL" (modifying tables without blocking simultaneous queries).
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".
We actually had an accidental back button hijack at a place I used to work at. It was an SPA, where if you navigated to / it would check if you were logged in. If so, you would be redirected (client-side) to /home, otherwise you were sent to /login. This was done with pushState() instead of replaceState(), so going back from /home would take you to / which would immediately see that you were logged in and send you back to /home.
There was some work done on a RWF_UNCACHED flag a while back, but I'm not sure if it went anywhere. It was supposed to use the page cache if the page is already there, but not add it (or at least not keep it around) if it isn't.
The ASS format has some basic animation with the \move command (moving subtitles using linear interpolation) and the \t command (changing various properties of a line with the possibility of quadric interpolation). This takes care of some cases, but is often insufficient for complex stuff.
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.
bcmp just tells you "equal" or "not equal", while memcmp tells you "lesser", "equal", or "greater".
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.
We recently got something similar in Sweden too: https://www.spelpaus.se/
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.
4% or 20 million, whichever is greater.
<file.txt grep foo | sortThere are some methods to get around this. For example, there's an ELF extension called STT_GNU_IFUNC. It allows a symbol to be resolved at load time using a custom resolver function. This avoids the problem of figuring out which code-path to use on every invocation.
For 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;
}
}Reasonably modern versions of GCC will emit various rep instructions in some cases.
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.Unless your program is designed to work that way, the fine-grained synchronization that StringBuffer offers over StringBuilder is almost certainly not very useful. And since Java is a memory-safe language, the only meaningful difference between StringBuffer and StringBuilder in "accidentally" multi-threaded code is the exact manner in which your output will garbled.
On Linux you can use hostapd and dhcpd.
For many programs it's easy to decide whether they halt or not.
int main(void) { for (;;); }I wastes memory too, having multiple copies of the same shared libraries loaded.
In C99:
#include <stdio.h>
int main(void) {
(* * & * * * * * & * * * * * * * * * * * * * printf)(&1["C is awesome\n"]-3/2);
}Prefix the command with a space and bash won't save it in its history.
Oxytocin is not an opioid. You are thinking of Oxycontin.
Still, there are cases where fall-through can be useful:
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;
}Going through a union is the correct way of viewing one type as another. Casting pointers to accomplish this is undefined behaviour (except for char *) and compilers do TBBA (type-based alias analysis) based on the assumption you don't do it. Famously, the Linux kernel does this a lot and needs to be compiled with -fno-strict-aliasing.
I think that the "expression-style" return looks good for short and "expression-like" function.
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.I'm guessing he refers to atomics with relaxed memory ordering. That doesn't give much in terms of guarantees beyond atomicity and no "out-of-thin-air" values. I'm not sure of whether this is a data race under Rust's definition though.
Sure, Rust will continue to evolve. But many changes that happened in the past were on the scale of "Java 10 decides to get rid of classes".
Seems like this could be solved by escalating to banning a /64 after multiple bans have been issued.
There's some extended discussion of the issue on the wiki[1]. A future full MERGE implementation might have slightly different semantics or performance characteristics than ON CONFLICT (which might also differ from other DBMS).
[1] https://wiki.postgresql.org/wiki/UPSERT#SQL_MERGE_syntax
I really hope that the Rust compiler has some really good error messages explaining what the problem is because I couldn't see what was wrong with this fragment until I read the explanation.
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