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
from evernote.api.client import EvernoteClient | |
import evernote.edam.type.ttypes as Types | |
import sys | |
import hashlib | |
import time | |
import mimetypes | |
# dev_token = "S=s1:U=90bdf:E=1544ee17084:C=14cf7304108:P=1cd:A=en-devtoken:V=2:H=e20c8d80dd09580a5fb802a77d1c0eb8" | |
dev_token="S=s1:U=90bdf:E=154519873c0:C=14cf9e746d0:P=81:A=jyamamoto:V=2:H=bf7a268d7243962ccf4d49e520b21049" | |
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 Prelude hiding(return, (>>=), (>>)) | |
import Data.Char | |
type Parser a = String -> [(a, String)] | |
return :: a -> Parser a | |
return v = (\inp -> [(v, inp)]) | |
item :: Parser Char | |
item = (\inp -> case inp of [] -> [] |
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
func getA()->String?{ | |
return "A" | |
} | |
func getB()->String? { | |
return "B" | |
} | |
func getC()->String?{ |
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
let str = "ABCDEF" | |
let startIndex = str.startIndex // 文字列の最初のIndexを取得 | |
let endIndex = str.endIndex // 文字列中の最後のIndexを取得 | |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
class Pole{ | |
let left:Int | |
let right: Int | |
init(_ left:Int, _ right:Int){ | |
self.left = left | |
self.right = right |
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
class Stack(val value:Int, val succ:Stack?){ | |
fun push(i:Int) = Stack(i, this) | |
fun apply(op:(Int, Int) -> Int):Stack = succ?.let{ | |
Stack(op(value, it.value), succ.succ) | |
} ?: throw IllegalArgumentException() | |
} | |
fun solution(s:String):Int =s.fold<Stack?>(null){ stack , char -> when(char){ | |
'0','1','2','3','4','5','6','7','8','9' -> stack?.let {it.push(char - '0')} ?: Stack(char- '0', null) | |
'+' -> stack?.let { it.apply{ x1, x2 -> x1 + x2 } } ?: throw IllegalArgumentException() |
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
module CalcParser where | |
import Data.Char | |
type Parser a = String -> [(a, String)] | |
return' :: a -> Parser a | |
return' v = (\inp -> [(v, inp)]) | |
item :: Parser Char | |
item = (\inp -> case inp of [] -> [] |