- 前提: OAuth version 1.0a, Twitter API 1.1
OAuth 認証を通じてツイートするためには、API に対して POST する際、リクエストヘッダに Authorization フィールドを含める必要がある。
var BASE64_MARKER = ';base64,'; | |
function convertDataURIToBinary(dataURI) { | |
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
var base64 = dataURI.substring(base64Index); | |
var raw = window.atob(base64); | |
var rawLength = raw.length; | |
var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
for(i = 0; i < rawLength; i++) { |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>H.264 Level Calculator</title> | |
<style> | |
textarea { | |
width: 640px; | |
height: 360px; | |
} |
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
#svnやgitのリビジョン,ビルド番号をplistに自動的に埋め込む http://sonson.jp/?p=2241 | |
git_revision=$(git show --format='%h' -s) | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleGitRevision $git_revision" "$INFOPLIST_FILE" |
// float->half variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain, as per the terms of the | |
// CC0 license: | |
// | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// float_to_half_full: This is basically the ISPC stdlib code, except | |
// I preserve the sign of NaNs (any good reason not to?) |
// | |
// Fully native C++ WinRT application example | |
// Programmed by fincs | |
// | |
#include <windows.h> | |
#include <roapi.h> | |
#include <wchar.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
#if defined(__ARM_NEON__) | |
vec4 dot(vec4 a, vec4 b) | |
{ | |
vec4 prod = vmulq_f32(a, b); | |
vec4 sum1 = vaddq_f32(prod, vrev64q_f32(prod)); | |
vec4 sum2 = vaddq_f32(sum1, vcombine_f32(vget_high_f32(sum1), vget_low_f32(sum1))); | |
return sum2; | |
} | |
#else if defined(__SSE3__) | |
static inline vec4 vdot(vec4 x, vec4 y) |
# REST と WebSocket | |
t_wada さんとちょっと話す機会があったので、ここまでに考えてたことを一旦まとめて見たいと思う。 | |
REST については、「Web を支える技術」でお茶を濁さず、本家論文なども参照されたし。 | |
## REST | |
REST はプロトコルでもアーキテクチャでもなく、アーキテクチャスタイルです。 | |
そこにはいくつかの原則があり、最も重要な原則の一つにステートレス性があります。 |