translation-unit
is:
translation-unit:
external-declaration
translation-unit external-declaration
translation-unit
is:
translation-unit:
external-declaration
translation-unit external-declaration
net_socket_read_wait
loop is equivalent to a sleep
.c++
#0 mlir::detail::StorageUserBase<mlir::LLVM::LLVMVoidType, mlir::Type, mlir::TypeStorage, mlir::detail::TypeUniquer>::classof<mlir::Type> (val=...)
at /home/edgar/data/llvm-project-16.0.6.src/mlir/include/mlir/IR/StorageUniquerSupport.h:112
#1 0x0000555555deecda in llvm::CastInfo<mlir::LLVM::LLVMVoidType, mlir::Type const, void>::isPossible (ty=...) at /home/edgar/data/llvm-project-16.0.6.src/mlir/include/mlir/IR/Types.h:350
#2 llvm::DefaultDoCastIfPossible<mlir::LLVM::LLVMVoidType, mlir::Type const, llvm::CastInfo<mlir::LLVM::LLVMVoidType, mlir::Type const, void> >::doCastIfPossible (f=...)
at /home/edgar/data/llvm-project-16.0.6.src/llvm/include/llvm/Support/Casting.h:312
#3 llvm::dyn_cast<mlir::LLVM::LLVMVoidType, mlir::Type> (Val=...) at /home/edgar/data/llvm-project-16.0.6.src/llvm/include/llvm/Support/Casting.h:652
#4 mlir::Type::dyn_cast<mlir::LLVM::LLVMVoidType> (this=<optimized out>) at /home/edgar/data/llvm-project-16.0.6.src/mlir/include/mlir/IR/Types.h:271
#5 llvm::detail::TypeSwitchBase<llvm::TypeSwitch<mlir::Type, llvm::Type*>, mlir::Type>::castValue<mlir::LLVM::LLVMVoidType, mlir::Type const&> (value=...)
at /home/edgar/data/llvm-project-16.0.6.src/llvm/include/llvm/ADT/TypeSwitch.h:77
#6 llvm::TypeSwitch<mlir::Type, llvm::Type*>::Case<mlir::LLVM::LLVMVoidType, mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType(mlir::Type)::{lambda(mlir::LLVM::LLVMVoidType)#1}>(mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType(mlir::Type)::{lambda(mlir::LLVM::LLVMVoidType)#1}&&) (this=<optimized out>, caseFn=...) at /home/edgar/data/llvm-project-16.0.6.src/llvm/include/llvm/ADT/TypeSwitch.h:121
#7 llvm::detail::TypeSwitchBase<llvm::TypeSwitch<mlir::Type, llvm::Type*>, mlir::Type>::Case<mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType(mlir::Type)::{lambda(mlir::LLVM::LLVMVoidType)#1}>(mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType(mlir::Type)::{lambda(mlir::LLVM::LLVMVoidType)#1}&&) (this=<optimized out>, caseFn=...)
at /home/edgar/data/llvm-project-16.0.6.src/llvm/include/llvm/ADT/TypeSwitch.h:60
#8 mlir::LLVM::detail::TypeToLLVMIRTranslatorImpl::translateType (this=0x555556399d40, type=...) at /home/edgar/data/llvm-project-16.0.6.src/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp:39
#9 0x0000555555e219ac in convertOperationImpl (opInst=..., builder=..., moduleTranslation=...) at tools/mlir/include/mlir/Dialect/LLVMIR/LLVMConversions.inc:144
#10 0x0000555555cbc1c7 in mlir::LLVM::ModuleTranslation::convertOperation (this=this@entry=0x7fffffffcf90, op=..., builder=...)
at /home/edgar/data/llvm-project-16.0.6.src/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:567
#11 0x0000555555cbc817 in mlir::LLVM::ModuleTranslation::convertBlock (this=this@entry=0x7fffffffcf90, bb=..., ignoreArguments=<optimized out>, builder=...)
at /home/edgar/data/llvm-project-16.0.6.src/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:613
#12 0x0000555555cbdc89 in mlir::LLVM::ModuleTranslation::convertOneFunction (this=this@entry=0x7fffffffcf90, func=...) at /home/edgar/data/llvm-project-16.0.6.src/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:858
(gdb) i r rdi
rdi 0x0 0
(gdb) disassemble 0x0000555555deecda, +16
Dump of assembler code from 0x555555deecda to 0x555555deecea:
0x0000555555deecda <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+202>: test %al,%al
0x0000555555deecdc <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+204>: je 0x555555deecf0 <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+224>
0x0000555555deecde <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+206>: test %rbx,%rbx
0x0000555555deece1 <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+209>: je 0x555555deecf0 <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+224>
0x0000555555deece3 <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+211>: mov (%r14),%rdi
0x0000555555deece6 <_ZN4mlir4LLVM6detail26TypeToLLVMIRTranslatorImpl13translateTypeENS_4TypeE+214>: call 0x55555623fa00 <_ZN4llvm4Type9getVoidTyERNS_11LLVMContextE>
End of assembler dump.
for server in all_servers: econ block_message "EVERYONE GO TO THIS SERVER FAST! LET'S MAKE THE MEAT!!!" 600 "new spam"
putting all whoever say this in a 10 minutes shadow mute, so other players won't see any message from those who are muted but the muted players 'll receive proper chat respond from the server.
It 'll take time for the spammers to beat it (though I see how to overcome it).elban
). I banned him, he reconnected from a different IP. And then it repeated like 10 times, until one of us gave up.
He connected with the same username, and noone else used that name, so this could be automated.
"Shadow" part here is the idea to make the spammer spend more time on realizing what is going on. We can just ignore/drop his network packets without a reply. (edited)str_utf8_forward
in Rust?.skip_while()
Iterator
blanket implementation that provides extra adaptors and methods.impl<K, V, S> MyHashmap<K, V, S>
where
K: Eq + Hash,
S: BuildHasher,
{
fn resize(&mut self) {
let new_storage: Vec<Option<(K, V)>> =
(0..self.storage.len() * 2).map(|_| None).collect();
// Replace the storage with the new one, so we can use self.x methods to rehash.
let old_storage = std::mem::replace(&mut self.storage, new_storage);
self.len = 0;
for (k, v) in old_storage.into_iter().flatten() {
self.insert(k, v);
}
}
}
impl<K, V, S> MyHashmap<K, V, S>
where
K: Eq + Hash,
S: BuildHasher,
{
fn resize(&mut self) {
let new_storage: Vec<Option<(K, V)>> =
(0..self.storage.len() * 2).map(|_| None).collect();
// Replace the storage with the new one, so we can use self.x methods to rehash.
let old_storage = std::mem::replace(&mut self.storage, new_storage);
self.len = 0;
for (k, v) in old_storage.into_iter().flatten() {
self.insert(k, v);
}
}
}
peeking_skip
so I need to discard what I get from peeking_take_while
peeking_skip
so I need to discard what I get from peeking_take_while
fn foo(s: &str) {
let mut it = s.char_indices().peekable();
it.peeking_take_while(|(u, c)| { c.is_whitespace() })
}
peeking_take_while
returnedpeeking_skip
I need to skip all whitespace without consuming the first non-whitespace characterit.filter(|x| x.is_whitespace() )
with this u have a iterator over non whitespace charsit.filter(|x| x.is_whitespace() )
with this u have a iterator over non whitespace chars .next()
values without advancing the base iterator..for_each(|_| {})
on the PeekingTakeWhile
?callvote
? Seems kinda cool but super unused.callvote
? Seems kinda cool but super unused. assert_eq!(lexer.get_token(), Ok("hello"));
fn Lexer::get_token() -> Result<String, Error>
Is the correct thing to do here just doing .to_string()
on the "hello"
? I thought String
s could be compared with &str
nperror[E0515]: cannot return reference to function parameter `s`
--> src/lexer.rs:105:48
|
105 | assert_eq!(lexer.get_token().map(|s| { s.as_str() }), Ok("a'b'bb"));
| ^^^^^^^^^^ returns a reference to data owned by the current function
.as_ref()
doesn't but .as_deref()
does, someone on the rust dc gave me the tip "hello w\"o\"rl'd' a'\"a\"a'a a\"'b'b\"b \"a a\" 'b b'"
"hello w\"o\"rl'd' a'\"a\"a'a a\"'b'b\"b \"a a\" 'b b'"
cargo clippy -- -D warnings
cargo clippy -- -D warnings -D clippy::nursery``cargo clippy -- -D warnings -D clippy::nursery -D clippy::pedantic
cargo clippy -- -D warnings -D clippy::nursery -D clippy::pedantic -D clippy::all
(edited)cargo clippy -- -D warnings -D clippy::nursery -D clippy::pedantic -D clippy::all
(edited)ok_or
once instead of ok_or_else
and I didn't derive Eq
when I already derived PartialEq
ok_or
once instead of ok_or_else
and I didn't derive Eq
when I already derived PartialEq
ok_or
once instead of ok_or_else
and I didn't derive Eq
when I already derived PartialEq
get_token
is self documenting, no? It gets a token #[no_mangle]
pub unsafe extern "C" fn blabla__alloc_dict() -> *mut std::ffi::c_void {
let map: Box<HashMap<[u8; 32], NonNull<()>>> = Box::default();
Box::into_raw(map) as _
}
#[no_mangle]
pub unsafe extern "C" fn blabla__alloc_dict() -> *mut std::ffi::c_void {
let map: Box<HashMap<[u8; 32], NonNull<()>>> = Box::default();
Box::into_raw(map) as _
}
YAYADDB
SkinDB
maybe
Core was generated by
./DDRace64-Server_sql -f servers/block2.cfg'.
Program terminated with signal SIGABRT, Aborted.
#0 pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5e12c0ba00 (LWP 1469313))]
(gdb) bt
#0 pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1 0x000...let mut lexer = Lexer::new(r#"a "b" sadsa "#);
def check_image_resolution(message: discord.Message):
for attachment in message.attachments:
if (attachment.height != 128 or attachment.width != 256) and (attachment.height != 256 or attachment.width != 512):
return (False, 'One of the attached skins does not have the correct image resolution. Resolution must be 256x128, and if possible provide a 512x256 along with the 256x128')
return (True, None)
def check_image_resolution(message: discord.Message):
for attachment in message.attachments:
if (attachment.height != 128 or attachment.width != 256) and (attachment.height != 256 or attachment.width != 512):
return (False, 'One of the attached skins does not have the correct image resolution. Resolution must be 256x128, and if possible provide a 512x256 along with the 256x128')
return (True, None)
a8e5e98
Check if 256x128 skin file is present - Jupeyy let mut skins_to_upload = item.skins_to_upload.clone();
let upload_lock = data.get_mut::<SkinUploads>().unwrap().upload_lock.clone();
drop(data);
let _g = upload_lock.lock().await;
dotenv::dotenv()
somewhere?if matches!(&skin.database, SkinToUploadDB::Normal) {
would u use that macro?if matches!(&skin.database, SkinToUploadDB::Normal) {
would u use that macro? *const T
, and *mut T
.len(self.str)
that'll get me an empty slice nps[i..i]
fn main() -> anyhow::Result<()>
, and that just exits normallyfn main() -> anyhow::Result<()>
, and that just exits normally <*const T>::read
<*const T>::read_unaligned
<*mut T>::read
<*mut T>::read_unaligned
ptr::read
ptr::read_unaligned
<[T]>::split_at
gcc -xc -E -v -
.as_ref().map(Deref::deref)
httpmaster-
rust_panic
or so. need to get the current name of the dayclone().next()
for peekclone().next()
for peek it[1]
with a bounds chec$points....:
12512
$ddos......:
5360
$profile...:
3764
$total_time:
3037
$hours.....:
1973
$map.......:
1376
$add.......:
1165
$help......:
1060
$avatar....:
722
$waiting...:
719
$find......:
655
$weather...:
398
$ready.....:
390
$decline...:
374
$optimize..:
315
$rm........:
298
$time......:
250
$angry.....:
242
$drake.....:
194
$clown.....:
190struct Peekable<I: Iter> {
inner: I,
peeked: Option<Option<I::Item>>,
}
.clone().next()
10 00 00 01 54 4b 00 30 45 4e ff ff ff ff