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
//# SHIFTJIS.TXT | |
//# Date: 2015-12-02 23:52:00 GMT [KW] | |
//# © 2015 Unicode®, Inc. | |
//# For terms of use, see http://www.unicode.org/terms_of_use.html | |
//# | |
//# Name: Shift-JIS to Unicode | |
//# Unicode version: 1.1 | |
//# Table version: 2.0 | |
//# Table format: Format A | |
//# Date: 2011 October 14 (header updated: 2015 December 02) |
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
static void add_ink_annot_sample(const char *input_pdf) | |
{ | |
const char *output_pdf = next_file_name(input_pdf); | |
fz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED); | |
fz_try(ctx) | |
{ | |
pdf_document *doc = pdf_open_document(ctx, input_pdf); | |
fz_page *page = fz_load_page(ctx, (fz_document *)doc, 0); | |
pdf_page *pdfpage = (pdf_page *)page; |
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
import cv2 | |
import numpy as np | |
from PIL import Image, ImageSequence | |
gif_path = "Desktop/i-report_sample.gif" | |
img = Image.open(gif_path) | |
frames = [frame.copy().convert("RGB") for frame in ImageSequence.Iterator(img)] | |
frame_count = len(frames) | |
print("Total frames:", frame_count) |
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
import evdev | |
import os | |
import pyautogui | |
def atoi(s): | |
if not s: | |
return 0 | |
if s.isdigit(): | |
return int(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
```hex | |
:02000000AB282B | |
:10000600831250088316920083129101121511086B | |
:08001600500283180A280800BB | |
:06001E0083120514080026 | |
:0600240083120510080024 | |
:10002A008312A6010030851A0130A40091016030C4 | |
:10003A0083169200831212156030110203182E28BB | |
:10004A000030851A0130AA002A08031D2D28A60AA5 | |
:10005A00212826080A3C03183528A4010F2038282D |
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
#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) | |
#define ENUM_TO_STRING(ENUM_NAME, ...) \ | |
enum ENUM_NAME { __VA_ARGS__ }; \ | |
char ENUM_NAME##_strings[] = #__VA_ARGS__ ; \ | |
long ENUM_NAME##strings_indices[NUMARGS(__VA_ARGS__)]; \ | |
char *ENUM_NAME##_to_string(enum ENUM_NAME value) { \ | |
static int init = 0; \ | |
if(init == 0){ \ |
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
function fernflower() { | |
EXE=/home/tyano/bin/fernflower.jar | |
JAR=$1 | |
OUT=$2 | |
if [ ""$JAR = "" ] ; then | |
cat << EOF | |
usage: | |
${FUNCNAME[0]} xxx.jar [output_dir] | |
or | |
${FUNCNAME[0]} xxx.class [output_dir] |
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
10 # PROMPT_USERHOST="${PROMPT_USERHOST:-\u@\h}" | |
11 PROMPT_USERHOST="${PROMPT_USERHOST:-\u}" | |
12 PROMPT_SEPARATOR="${PROMPT_SEPARATOR:-:}" | |
13 # PROMPT_DIRECTORY="${PROMPT_DIRECTORY:-\w}" | |
14 PROMPT_DIRECTORY="${PROMPT_DIRECTORY:-\W}" |
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
UTF8 -> sjis | |
NSString *str1 = [NSString stringWithString:@"string"]; | |
NSData *dat = [str1 dataUsingEncoding:NSASCIIStringEncoding] ; | |
NSData* sjisData = [ str | |
dataUsingEncoding:NSShiftJISStringEncoding // SJIS変換指定 | |
allowLossyConversion:YES // 変換不能でもとにかく変換 | |
]; | |
sjis -> UTF8 |