2024/04/17 更新
この記事は、自作OS Advent Calendar 2017の 12/8 の記事として書かれました。
IT 系のニュースサイトでも、未だに日本語の漢字や仮名のことを 2 バイト文字と呼んでいる記事が散見されます。
2024/04/17 更新
この記事は、自作OS Advent Calendar 2017の 12/8 の記事として書かれました。
IT 系のニュースサイトでも、未だに日本語の漢字や仮名のことを 2 バイト文字と呼んでいる記事が散見されます。
import time | |
def bench(fn): | |
begin = time.time() | |
fn() | |
return time.time() - begin | |
n = 100000 | |
def setwork(cl): | |
for i in range(0, n): |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Attribution: Hijacked from tracservice.py by Florent Xicluna <[email protected]> | |
# http://trac-hacks.org/wiki/WindowsServiceScript | |
# | |
# To use this class, users must do the following: | |
# 1. Download and install the PyWin32all package | |
# (http://starship.python.net/crew/mhammond/win32/) | |
# 2. Edit the constants section with the proper information. |
use std::fmt; | |
struct Array(Vec<i64>); | |
impl fmt::Display for Array { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
let Array(ref vec) = *self; | |
for (count, v) in vec.iter().enumerate() { | |
if count != 0 { try!(write!(f, " ")); } | |
try!(write!(f, "{}", v)); |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Sokoban : MonoBehaviour | |
{ | |
// タイルの種類 | |
private enum TileType | |
{ | |
NONE, // 何も無い |
表題の通りです。
msgpack-rust_はMessagePack_のRustによる実装の一つで、私が書いたものです。まだ実装していない機能が多いです。はい、がんばります。
[dependencies] | |
rusqlite = "0.24.0" |
大いに参考にさせていただいた記事: ラズパイに向けてRustをクロスコンパイル!
以下はUbuntu 20.04 LTS on WSL2で確認済み
Rustをインストール
arm用のgcc一式を入れる
fn a(_:u64,_:u64){print!("{}",0x50f0000003bb8u64)}fn b(_:u64,_:u64){}fn h<'a,'b,T>(_:&'a&'b(),v:&'b mut[T])->&'a mut[T]{v}#[inline(never)]fn g<'a,T:Copy>(x:T)->&'a mut[T]{let f:fn(_,_)->_=h;print!("{:p}",&x);f(&&(),&mut[x;0x100])}pub fn main(){let x=g(0u64);let y=g(if x.as_ptr()as u64>>1>0{a}else{b});x[4]+=0x18f8;y[4]("/bin/sh\0".as_ptr()as _,0)} |