I hereby claim:
- I am Hanaasagi on github.
- I am hanaasagi (https://keybase.io/hanaasagi) on keybase.
- I have a public key whose fingerprint is BF53 8DF8 E365 57CC 516D 9A8B A524 26A3 B59F F8EC
To claim this, I am signing this object:
fn my_sqrt(x: i32) -> i32 { | |
let mut n = x as f64; | |
let half = 0.5 * n; | |
let mut i = unsafe { | |
std::mem::transmute::<f64, i64>(n) | |
}; | |
i = 0x5fe6ec85e7de30da - (i>>1); | |
n = unsafe{ | |
std::mem::transmute::<i64, f64>(i) | |
}; |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/bash | |
git reflog expire --expire-unreachable=now --all | |
git gc --prune=now |
``` | |
python type-apply.py | |
``` | |
import os | |
import subprocess | |
DIR = "" | |
for root, dirs, files in os.walk(DIR, topdown=False): |
int is_little_endian(void) { | |
union t | |
{ | |
int a; | |
char b; | |
} c; | |
c.a = 1; | |
return c.b == 1; | |
} | |
// 如果为 big endian,存储为下(Hex表示,int 占 32 bit,char 占 8 bit) |
Rust 36 hrs 26 mins ████████████████▋░░░░ 79.5% | |
YAML 3 hrs 33 mins █▋░░░░░░░░░░░░░░░░░░░ 7.8% | |
TOML 1 hr 55 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.2% | |
Markdown 1 hr 15 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.8% | |
JSON 51 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9% |
if "hello" == "hello": | |
print("correct") | |
else: | |
print("incorrect") |
#!/usr/bin/ash | |
udevd_running=0 | |
mount_handler=default_mount_handler | |
init=/sbin/init | |
rd_logmask=0 | |
. /init_functions | |
mount_setup |
Read the overview document first.
Lenovo laptop series using the ideapad_laptop
driver have a feature called
'battery conservation mode', basically a fixed stop charge threshold at 60%.
The hardware behaviour is:
#[derive(PartialEq, Eq, Clone, Debug)] | |
pub struct ListNode { | |
pub val: i32, | |
pub next: Option<Box<ListNode>>, | |
} | |
impl ListNode { | |
#[inline] | |
fn new(val: i32) -> Self { | |
ListNode { next: None, val } |