Skip to content

Instantly share code, notes, and snippets.

@rsato
rsato / file0.groovy
Created May 15, 2014 17:08
「一反田えー(1反田A)」から「千反田える」までを生成する ref: http://qiita.com/rsato/items/a0013f35f731ff6b494f
def alphabetList = ["えー", "びー", "しー", "でぃー", "いー", "えふ", "じー", "えいち", "あい", "じぇい", "けー", "える", "えむ", "えぬ", "おー", "ぴー", "きゅー", "あーる", "えす", "てぃー", "ゆー", "ぶい", "だぶりゅー", "えっくす", "わい", "ぜっと"]
def range = 1..1000
range.eachWithIndex {num, i->
println "${arabicNumToKanjiNum(num)}反田${alphabetList[i%alphabetList.size()]}"
}
// アラビア数字を漢数字に変換します
def arabicNumToKanjiNum(long num){
def kanjiNumUnit = ["", "万", "億", "兆", "京"]
@rsato
rsato / file0.txt
Created May 3, 2014 04:54
シークヮーサーとファイアーエムブレムの表記ゆれを正規表現で表す ref: http://qiita.com/rsato/items/d804894b6b54003b9cb1
シ((ィ|イ)(|ー)|ー)ク(ア|ァ|ワ|ヮ)(ー|)(サ|シャ)ー
@rsato
rsato / PC98Beep.cs
Last active August 29, 2015 13:57
PC98の起動音をC# とWindows PowerShellで
using System;
class PC98Beep
{
public static void Main(string[] args)
{
// Console.Beep(int frequency, int duration);
Console.Beep(2000, 120); // pi
Console.Beep(1000, 120); // po
}
@rsato
rsato / TwitterOAuthRequestTokenCallbacks.java
Last active August 29, 2015 13:57
AndroidアプリでNetworkOnMainThreadExceptionを避けつつTwitter4Jを使用したアプリ連携を行う #Twitter4J ref: http://qiita.com/rsato/items/39efd16c8a77a893a67e
public class TwitterOAuthRequestTokenCallbacks implements LoaderCallbacks<RequestToken> {
private Context mContext;
private Twitter mTwitter;
public TwitterOAuthRequestTokenCallbacks(Context context, Twitter twitter) {
mContext = context;
mTwitter = twitter;
}

Order of the prefectures in Japan

In a English Website, When choosing a Prefectures in Japan, the order is alphabetical.

  1. Aichi
  2. Akita
  3. Aomori
  4. Chiba
  5. Ehime
  6. Fukui
@rsato
rsato / 放送内容解析システム概要
Last active December 25, 2015 02:09
放送内容を自動で解析、情報収集するシステムの構想です。個人ではリソースの限界があるので、是非forkいただいてこの内容を充実させたり、一部実装してみたとかお待ちしております。
# これは?
放送内容を自動で解析、情報収集するシステムの構想です。
# 取得する情報
- 文字や画像として出ている情報
- 字幕スーパー(動画内とデータ)
- 地図?
- クレジット
@rsato
rsato / 1-spring-security-twitter-is-not-work
Last active December 15, 2015 20:19
[solved]Making Grails app with Twitter authentication, using "spring-security-twitter" is not work well...
# DevEnv
+ JDK 7 update 17
+ GGTS 3.2.0RELEASE
+ Grails 2.2.1
# Operations
1.Create Grails Project "test"
2. Add to BuildConfig.groovy