Skip to content

Instantly share code, notes, and snippets.

wait-free/lock-free/obstruction-freeの定義について
▲全てに共通する概念
スレッドが他のスレッドの進行を禁止する事がないので、どれかのスレッドが
ロックを確保したままプリエンプションなどで全体の処理が停止する事態が発生しな
い。
これは必ずしもロックベースのアルゴリズムより高速であることを意味し
ない(現にロックの方が早い場合もある
wait-freeが一番強い条件で、それを弱める度に
@repeatedly
repeatedly / d_master.md
Last active July 16, 2024 17:07
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@ponkore
ponkore / memo.sh
Created August 3, 2012 05:19
github上でgithubにフォークしたリモートリポジトリを本家リモートリポジトリに追随する
# http://d.hatena.ne.jp/haru-s/20110405/1302006637 に答えがそのままあるが、一応メモ
# github fork 追従 で見つけた
$ git remote
origin
# 本家のリモートリポジトリの短縮名を登録する.
$ git remote add github git://github.com/liquidz/misaki.git
# 本家の更新をローカルで反映させる.
@shogo82148
shogo82148 / gist:3883841
Created October 13, 2012 08:37
半自動トゥギャりスクリプト
// ==UserScript==
// @name TogetterHelper
// @namespace https://gist.github.com/3883841
// @version 0.1
// @description Togetterの編集作業便利にしたい.
// @match http://togetter.com/create
// @copyright 2012+, shogo82148
// ==/UserScript==
(function() {
@zr-tex8r
zr-tex8r / tcclearerr.sty
Created December 25, 2012 00:37
TeX/LaTeX : package to eliminate all compile errors at a time
\csname\if11pdfprimitive\fi\endcsname\chardef\x14\relax\pdfprimitive\catcode37\x\let%
%
% tcclearerr.sty
%
%% reset code tables
\;\relax\let\@\pdfprimitive\@\chardef\x10\;\@\catcode32\x\@\catcode13 5\;%
\endlinechar13\;\@\catcode96 12 \@\catcode61 12\;%
\ifx\@@par\tcce@undefined \@\par \else \@@par \fi% switch to vmode
\@\catcode`\{=1 \@\catcode`\}=2 \@\catcode`\@=11
\@\catcode`\#=6 \@\catcode`\~=13 \@\catcode`\<=12
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@h0tw1r3
h0tw1r3 / rtc-i2c
Last active July 9, 2022 14:37
Initializing I2C RTC (DS3231) on Raspberry PI bootup with Systemd without recompiling the kernel or devicetree support.
# /etc/conf.d/rtc-i2c
#
# My chip is actually a ds3231n, but ds1307 driver works fine (ds3232 does not!)
#
CHIP="ds1307"
ADDRESS="0x68"
BUS="1"
@eligor13
eligor13 / twpicdl.sh
Created September 5, 2014 01:52
Twitpic whole images downloader for mac
#!/bin/sh
# Modified by Stan Schwertly to download locally rather than to send to Posterous.
# Github: http://github.com/Stantheman/Twitpic-Backup
# Copyright 2010 Tim "burndive" of http://burndive.blogspot.com/
# This software is licensed under the Creative Commons GNU GPL version 2.0 or later.
# License informattion: http://creativecommons.org/licenses/GPL/2.0/
# This script is a derivative of the original, obtained from here:
@marbocub
marbocub / twpicdl.sh
Last active August 29, 2015 14:06 — forked from eligor13/twpicdl.sh
#!/bin/sh
# Modified by Stan Schwertly to download locally rather than to send to Posterous.
# Github: http://github.com/Stantheman/Twitpic-Backup
# Copyright 2010 Tim "burndive" of http://burndive.blogspot.com/
# This software is licensed under the Creative Commons GNU GPL version 2.0 or later.
# License informattion: http://creativecommons.org/licenses/GPL/2.0/
# This script is a derivative of the original, obtained from here:
@sixlettervariables
sixlettervariables / silly-windows-versions.md
Last active May 3, 2024 01:42
Why "Windows 10" wasn't chosen because of developers checking "Windows 9"

Why "Windows 10" wasn't chosen because of "braindead" developers checking for Windows 95 or 98.

You may have seen the picture, purporting to have source from a Microsoft developer explaining why Windows had to be versioned 10. The punchline is that so many programmers rely on the version to begin with "Windows 9" if they are running on 95 or 98, that Windows 10 was the only logical choice:

if(version.StartsWith("Windows 9"))
{ /* 95 and 98 */
} else {