Skip to content

Instantly share code, notes, and snippets.

View methane's full-sized avatar

Inada Naoki methane

  • KLab Inc,
  • Japan
  • 11:36 (UTC +09:00)
  • X @methane
View GitHub Profile
@untitaker
untitaker / gist:5321447
Last active January 15, 2017 18:13
Werkzeug Python 3 notes
@frsyuki
frsyuki / m5.md
Last active December 14, 2015 18:09

msgpackの変更案について-5

提案の目的

  • 互換性の影響を最小限にしつつ、文字列を透過的に扱えるようにする方法を提供する
  • MessagePackから分離された上位レイヤーが、MessagePackの仕様に変更を加えずに、独自の型を定義できるようにする
  • 将来的にMessagePackに新たな機能が追加されても、既存のコードに影響を与えないようにする

概要

2013-02-24 22:28:51 -0800: This is not a fixed proposal. See the second version as well: https://gist.github.com/frsyuki/5028082

Overview

  • Add "Binary" type
  • Change the current Raw type to "String" type
    • Meaning current FixRaw, raw 16, and raw 32 become FixString, string 16, and string 32

Background

3からの差分:

  • 実装の後方互換性に関する記述を修正
  • 各実装へのリンクを追加
  • 背景にNoteを追加
  • 「UTF-8としてinvalidなバイトシーケンスを含む文字列が保存されていることがある」理由の修正
  • 概要から「バイト列はBinary型で保存する。そうでなければString型で保存する」を削除(背景と型システムの詳細を読んでもらう)
  • weak-string languages のシリアライザのところで、「String型はUTF-8としてinvalidなバイトシーケンスを許容する」の注釈を削除

msgpackの変更案について-4

msgpackの変更案について-3

概要:

  • 現行のRaw型をString型として読み替える。
    • 現行の FixRaw, raw 16, raw 32 は、FixString, string 16, string 32 になる
  • Binary型を新設する。
  • バイト列はBinary型で保存する。そうでなければString型で保存する。

背景

msgpackの変更案について

概要:

  • 現行のRaw型をString型として読み替える。
  • Binary型を新設する。
  • 明らかなバイナリはデフォルトでBinary型(新設型)で保存

型システムの変更

  • Binary: バイト列
@repeatedly
repeatedly / msgpack_issue_121.md
Last active November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

MessagePackが文字列とバイナリをわけないのは問題?

msgpack/msgpack#121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@methane
methane / flask_memcache.py
Created January 31, 2012 12:00
Sample using python-memcached in threaded Flask application.
"""Flask extension utility."""
from flask.sessions import SessionInterface, SessionMixin
from werkzeug.contrib.cache import MemcachedCache
import memcache # Use https://code.launchpad.net/~songofacandy/python-memcached/mixin-threading
def setup_cache(app):
"""
Setup ``app.cache``.