// callee.m iOS Native(Objective-C) class
@interface NativeType
- (void)method:(int)arg;
@end
@implementation NativeType
// ...
@end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <objc/message.h> | |
| SEL sel_propSetter(Class clazz, const char* pname) | |
| { | |
| char* attr = property_copyAttributeValue(class_getProperty(clazz, pname), "S"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if defined(__clang__) | |
| #pragma message "Clang " __VERSION__ | |
| #elif defined(__GNUC__) | |
| #pragma message "GCC " __VERSION__ | |
| #elif defined(_MSC_VER) | |
| // https://qiita.com/yumetodo/items/8c112fca0a8e6b47072d | |
| #define STR(s) #s | |
| #define DUMP(s) #s "=" STR(s) | |
| #pragma message ("MSVC " DUMP(_MSC_VER) " " DUMP(_MSC_FULL_VER)) | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // for i in 0..v.len() {sum += v[i];} | |
| // https://play.rust-lang.org/?version=stable&mode=release&edition=2015&gist=a234fd242a39e0e33d1775ba986a7f50 | |
| playground::main: | |
| pushq %r14 | |
| pushq %rbx | |
| subq $152, %rsp | |
| movq $0, 16(%rsp) | |
| movl $800000000, %edi | |
| movl $8, %esi | |
| callq __rust_alloc@PLT |
Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
| BT.601 | BT.709 | BT.2020 | |
|---|---|---|---|
| a | 0.299 | 0.2126 | 0.2627 |
| b | 0.587 | 0.7152 | 0.6780 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //-------------------------------------------------------- | |
| #[derive(Debug, PartialEq, Eq, Copy, Clone)] | |
| #[repr(u8)] | |
| enum UnscopedEnum { | |
| AAA = 1, | |
| BBB = 2, | |
| CCC = 3, | |
| } | |
| const AAA: UnscopedEnum = UnscopedEnum::AAA; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait FromU32 { | |
| fn from_u32(v: u32) -> Self; | |
| } | |
| macro_rules! impl_from_u32 { | |
| ($($ty:ty)*) => { | |
| $( | |
| impl FromU32 for $ty { | |
| #[inline] | |
| fn from_u32(v: u32) -> $ty { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # https://ja.stackoverflow.com/questions/45180/ | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| import matplotlib.colors as colors | |
| n = 10 | |
| x_list = np.array(list(range(n*2))) | |
| t_list = np.array(list(range(n*2))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PAT(PID=0x0000) | |
| xxd -s ${offset} -c 188 -ps input.ts | grep -E "^47[46]000" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <condition_variable> | |
| #include <chrono> | |
| #include <iostream> | |
| #include <mutex> | |
| #include <thread> | |
| #include <utility> | |
| #include <vector> | |
| #include <experimental/coroutine> | |