Skip to content

Instantly share code, notes, and snippets.

View ymkjp's full-sized avatar
:shipit:
while true

Kenta Long Yamamoto ymkjp

:shipit:
while true
View GitHub Profile
<?php
$e_all = 00000000000000000111011111111111;
$e_notice = 00000000000000000000000000001000;
$var_0 = $e_all & $e_notice;
$var_1 = $e_all | $e_notice;
$var_2 = $e_all ^ $e_notice;
$format = '%0' . (PHP_INT_SIZE * 8) . "b\n";
<?php
class Foo
{
static function bar()
{
$foo = [
'one' => 1,
'two' => 2,
];
@ymkjp
ymkjp / gist:9686839
Last active August 29, 2015 13:57
FizzBuzz in Haskell
take 100 [if x `mod` 15 == 0 then "FizzBuzz" else if x `mod` 5 == 0 then "Buzz" else if x `mod` 3 == 0 then "Fizz" else show x | x <- [1..]]
@ymkjp
ymkjp / gist:9721254
Last active August 29, 2015 13:57
How to write `where`'s indent
bmiTell :: Double -> Double -> String
bmiTell weight height
| bmi <= skinny = "You're underweight, you emo, you!"
| bmi <= normal = "You're supporsedly normal.\
\ Pfft, I bet you're ugly!"
| bmi <= fat = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where -- To new line
bmi = weight / height ^ 2
skinny = 18.5
@ymkjp
ymkjp / gist:b2d8ef530cff2dcc2e6f
Last active August 29, 2015 14:02
ぼくのかんがえたさいきょうのスマホゲーム

無操作ズボラゲー「最強少女キマイラ」

ぼくのかんがえたさいきょうのスマホゲーム

対象ユーザー

ゲームする時間がもったいないと思ってしまう人 (= 何を隠そう私自身のことである) 向け

body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@ymkjp
ymkjp / ProjectileDragging.cs
Last active August 29, 2015 14:13
Live Training 13th June 2014 - Making an "Angry Birds" style game http://www.youtube.com/watch?v=L0tl0CwPYIc
using UnityEngine;
using System.Collections;
public class ProjectileDragging : MonoBehaviour {
public float maxStretch = 3.0f;
public LineRenderer catapultLineFront;
public LineRenderer catapultLineBack;
private SpringJoint2D spring;
@ymkjp
ymkjp / rough_sed.rb
Created May 28, 2015 08:02
Multiline editing instead of painful sed or awk
# encoding: utf-8
# Usage:
# SRC_FILE="nginx.conf" DIST_FILE="nginx.conf~" ruby rough_sed.rb
from =<<EOS
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';

日本語文章の難易度推定システムの作成

内容

文中の語彙および係り受け解析を用いて与えられた日本語文章の難易度を推定する。 劉・内田 (2012) では語彙および2つの文節の係り受け距離を用いた難易度推定が提案され、評価実験では72.2%という精度を出している。しかし、特定レベルの教材での判定精度が46.7%にとどまっており、原因として構文解析器の精度の低さが指摘されているため、CaboCha, KNP, EDA, J.DepP などの精度を事前に比較調査する。 また、一文あたりの平均単語数および総単語数中の各レベルの単語数を元にした難易度判定式で 79% の精度を出している川村・北村 (2013) の手法も取り入れる。

研究の背景

現在、日本語学習の教材の作成には金銭的・時間的なコストがかかるため、十分な量の教材が用意されていない。