Skip to content

Instantly share code, notes, and snippets.

@gologo13
gologo13 / tree.c
Created July 7, 2012 14:24
printtree
/**
* Copyright (c) 2012, Yohei Yamaguchi.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
*
@gologo13
gologo13 / list.cpp
Created July 5, 2012 15:43
linked list in c++
/**
* Copyright (c) 2012, Yohei Yamaguchi.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
*
#!/usr/bin/perl
use strict;
use feature qw( say );
# Inspired by http://d.hatena.ne.jp/syou6162/20100708/1278577199
# state-emission HMM
# 状態遷移確率
# 品詞s_iから品詞s_jへ遷移する確率
my @a = ([0.3, 0.0, 0.4, 0.1, 0.2],