Skip to content

Instantly share code, notes, and snippets.

@kokudori
kokudori / WindowClosingCancelBehavior.cs
Created March 22, 2015 00:19
TriggerAction後のCanCloseの変化に対応したLivetのWindowCloseCancelBehavior
using System.ComponentModel;
using Livet.Behaviors;
namespace Sample.Behaviors
{
sealed class WindowClosingCancelBehavior : WindowCloseCancelBehavior
{
CancelEventArgs cancel;
readonly DependencyPropertyDescriptor descriptor;
@kokudori
kokudori / HashSet.cs
Created February 19, 2015 06:29
.NETのHashSetは集合だから順序を持たないっぽい?(Addが一貫してない?)
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
namespace ConsoleApplication1
{
enum Meta
{
Hoge,
Piyo
@kokudori
kokudori / Authorizer.cs
Last active August 29, 2015 14:15
Twitter Client Modoki
using Livet;
namespace LivetWPFApplication1.Models
{
class Authorizer : NotificationObject
{
public bool IsAuthorized
{
get
{
<Window x:Class="LivetWPFApplication1.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:l="http://schemas.livet-mvvm.net/2011/wpf"
xmlns:v="clr-namespace:LivetWPFApplication1.Views"
xmlns:vm="clr-namespace:LivetWPFApplication1.ViewModels"
Title="MainWindow" Height="350" Width="525">
@kokudori
kokudori / gist:4e685d873ffa38545330
Created December 2, 2014 13:58
バグの定義について
Re: http://blog.goo.ne.jp/hishidama/e/701f48e62000243418c0a0f251f118b9
バグはそもそも複合的な概念なので、絶対的な基準で定義できるものではないと思います。
平たく言えば、文脈に依存するものなので、各々の文脈での「バグ」の定義が衝突することはありえます。
それが嫌な場合は各々の文脈の「バグ」を定義するしかないと思います。
少なくとも、何の前提もなく「バグ」と言った場合は日常用語だと思うので、そもそも論として科学的な議論の対象としては不適当だと思います。
その上で、「仕様を満たしているかどうか」をバグの基準とする考えは一般的ですし、異論はありません。
しかし、その定義もあらゆる意味での「バグ」を説明できているとは思えません。
また、私自身も失敗の観点から「バグ」を定義するやり方は筋悪だと思います。
@kokudori
kokudori / cytus.rst
Last active August 29, 2015 14:07
Cytusメモ

Chapter 1

タイトル ランク スコア

Light up my LOVE

6

MM

Ververg

5

MM

Ververg ver.B

9

A 948145
@kokudori
kokudori / レジスタベースVMの簡易実装雑感.md
Last active August 29, 2015 14:01
レジスタベースVMの簡易実装雑感

概要

簡単なレジスタベースVMを作り、fib(38)を実行した時のマイクロベンチ結果

実装

Rustで下位3bit tagged-poinetr

アドレスのアラインメントを利用した埋め込みを実装した処理系
オブジェクトは環境非依存で64bit固定
ポインタをmodifyする必要がある

Rustで上位16bit tagged-poinetr

@kokudori
kokudori / app.js
Created January 4, 2014 11:54
TODO Apps whis Gavia v0.1.0
(function ($, undefined) {
'use strcit';
var todo = Gavia('todo', {
todo: {
keyPath: 'id',
autoIncrement: true,
index: {
unique: true
}
@kokudori
kokudori / app.css
Last active December 17, 2015 05:39
TODO Apps with Gavia
body {
margin: 10px 20px;
}
#content {
margin-left: 40px;
}
#menu {
vertical-align: text-top;
@kokudori
kokudori / Buffer.cs
Last active December 15, 2015 19:49
using System;
using System.Collections.Generic;
using System.Linq;
static class Extentions
{
public static IEnumerable<IEnumerable<T>> Buffer<T>(this IEnumerable<T> source, Func<T, bool> func)
{
while (source.Any())
{