This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List (group, sort) | |
-- import Debug.Trace | |
-- @see http://qiita.com/Nabetani/items/cbc3af152ee3f50a822f | |
{- | |
一枚のカードは、スートを表す文字+ランクを表す文字列 で構成される。 | |
スートを表す文字は、S, H, D, C のいずれか | |
ランクを表す文字列は、2, 3, ..., 9, 10, J, Q, K, A のいずれか | |
下表の役に対応すること。下表の役に該当しない場合は '--' を出力すること。 | |
カードはジョーカーを含まない52枚から5枚が選ばれる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Process: ruby [26761] | |
Path: /Users/USER/*/ruby | |
Identifier: ruby | |
Version: 0 | |
Code Type: X86-64 (Native) | |
Parent Process: zsh [90695] | |
Responsible: iTerm [261] | |
User ID: 501 | |
Date/Time: 2014-07-17 11:10:52.803 +0900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'chef' | |
gem 'knife-solo' | |
gem 'berkshelf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pogin ~/workspace/vagrant/precise32 | |
➤ gem uninstall yajl && gem install yajl | |
ERROR: Could not find a valid gem 'yajl' (>= 0) in any repository | |
ERROR: Possible alternatives: yacl, yaji, yajm, yawl | |
pogin ~/workspace/vagrant/precise32 | |
➤ bundle exec gem uninstall yajl && bundle exec gem install yajl | |
ERROR: Could not find a valid gem 'yajl' (>= 0) in any repository | |
ERROR: Possible alternatives: yacl, yaji, yajm, yawl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pogin ~/workspace/vagrant/precise32 | |
➤ gem list | |
*** LOCAL GEMS *** | |
bigdecimal (1.2.4) | |
io-console (0.4.2) | |
json (1.8.1) | |
minitest (4.7.5) | |
psych (2.0.5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pogin ~/workspace/ruby | |
➤ rbenv global system | |
------------------------------------------------------------ | |
pogin ~/workspace/ruby | |
➤ rbenv rehash | |
------------------------------------------------------------ | |
pogin ~/workspace/ruby | |
➤ gem list | |
*** LOCAL GEMS *** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ emacs --help | |
Usage: emacs [OPTION-OR-FILENAME]... | |
Run Emacs, the extensible, customizable, self-documenting real-time | |
display editor. The recommended way to start Emacs for normal editing | |
is with no options at all. | |
Run M-x info RET m emacs RET m emacs invocation RET inside Emacs to | |
read the main documentation for these command-line arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdio.h" | |
#include <cmath> | |
#include <iostream> | |
#include <vector> | |
#include <sstream> | |
#include <iomanip> | |
typedef std::vector<int> VI; | |
typedef std::vector<VI> VVI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#define FOR(i,a,b) for(int i=(a);i<(b);++i) | |
using namespace std; | |
int main(){ | |
int n; | |
cin >> n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Applicative | |
import Data.List (group) | |
data RunLength b = Multiple Int b | Single b | Empty deriving (Show, Eq) | |
encodeModified :: String -> [RunLength Char] -> [RunLength Char] | |
encodeModified str acc = do | |
let rlItem = calcRunlength 0 str | |
case fst rlItem of | |
"" -> acc ++ [snd rlItem] |
OlderNewer