Apache License, Version 2.0
| /* AWS S3 の使い方 */ | |
| public fun testAWS() { | |
| val accessKey = myActivity?.getString(R.string.aws_access_key) | |
| val secretKey = myActivity?.getString(R.string.aws_secret_key) | |
| val bucketName = "doya" | |
| val s3Client = AmazonS3Client( BasicAWSCredentials(accessKey, secretKey) ) | |
| s3Client.setRegion(Region.getRegion(Regions.AP_NORTHEAST_1)) | |
| val buckets = s3Client.listBuckets() | |
| assertNotNull(buckets) | |
| assertTrue( buckets!!.size > 0 ) |
| package main | |
| import ( | |
| "runtime" | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| func main() { |
| package buffer_benchmark | |
| import ( | |
| "bufio" | |
| "bytes" | |
| "testing" | |
| ) | |
| const hoge = "hogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehoge" |
| // | |
| // Logger.swift | |
| // | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2014 dictav | |
| // | |
| // 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 |
| private var controller: UIViewController? | |
| func setController<T:UIViewController where T:UITableViewDataSource>(c: T) { | |
| controller = c | |
| } |
| // https://gist.github.com/norio-nomura/090e0085a61ca2693e93 | |
| // 面白かったので写経。call は除いてみた | |
| import Foundation | |
| typealias Band = [String:String] | |
| var bands: [Band] = [ | |
| ["name": "sunset rubdown", "country": "UK", "active": "false"], | |
| ["name": "women", "country": "Germany", "active": "false"], | |
| ["name": "a silver mt. zion", "country": "Spain", "active": "true"] |
| typealias TwoEquatables = (Equatable, Equatable) | |
| func == (lhs: TwoEquatables, rhs: TwoEquatables) -> Bool { | |
| let t1 = _reflect(lhs.0) | |
| let t2 = _reflect(rhs.0) | |
| let u1 = _reflect(lhs.1) | |
| let u2 = _reflect(rhs.1) | |
| return t1.valueType == t2.valueType && t1.summary == t2.summary | |
| && u1.valueType == u2.valueType && u1.summary == u2.summary | |
| } |
| package main | |
| func main() { | |
| println("Hello, Medium!") | |
| } |
| var fb = require('dictav-flatbuffers').flatbuffers | |
| var builder = new fb.Builder(0) | |
| // ... |