- declaration は 「宣言」 と訳しているが、「定義」 の方が適しているような気がしなくもない。
- 「インスタンス」 と 「オブジェクト」 という言葉を使うことがあるが、本文書中ではどちらも同じ意味で使用している。
- 「
String
オブジェクト」 という表現は、「String
クラスのインスタンス」 を意味している。 (Java に限らず一般的な表現だと思う。)
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 javax.ws.rs.WebApplicationException | |
import javax.ws.rs.core.Response | |
// 使う側の例。 | |
fun main(args: Array<String>) { | |
FooApplicationService.fetchFoo("taro", "").then { | |
when (it) { | |
is Either.Right -> Response.ok().entity(it.value) | |
is Either.Left -> when (it.value) { |
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 java.io.IOException; | |
import com.google.api.client.http.GenericUrl; | |
import com.google.api.client.http.HttpRequest; | |
import com.google.api.client.http.HttpRequestFactory; | |
import com.google.api.client.http.HttpResponse; | |
import com.google.api.client.http.HttpTransport; | |
import com.google.api.client.http.javanet.NetHttpTransport; | |
public class GoogleHttpJavaClientExample { |
- fastlane のアクション
- iOS プロジェクトのビルド結果である result bundle (.xcresult 拡張子) に含まれるカバレッジ情報から SonarQube の Generic Coverage を生成する
- Result bundle については 「Xcode 11 Release Notes」 を参照
- Xcode 11 以降に対応
- 内部では
xccov
コマンドが使用される
Sometimes you want to commit a subfolder on an arbitrary branch (rather than gh-pages
branch) as the root directory
to the gh-pages
branch.
You will want to do so when, for example, the files to be published on GitHub Pages are generated by a build system.
This document shows the way to commit a build/gh-pages
directory to the gh-pages
branch by using Git plumbing commands.
In the following example, Windows PowerShell is used as a shell environment.
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
// === ドメインレイヤ === | |
sealed class FizzBuzzValue { | |
abstract val expression: String | |
data class Number(override val expression: String) : FizzBuzzValue() | |
object Fizz : FizzBuzzValue() { override val expression: String = "Fizz" } | |
object Buzz : FizzBuzzValue() { override val expression: String = "Buzz" } | |
object FizzBuzz : FizzBuzzValue() { override val expression: String = "FizzBuzz" } | |
} |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.5.+' | |
} | |
} | |
apply plugin: 'android' | |
tasks.withType(JavaCompile) { |
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
// buildSrc/src/main/groovy/JavaAptPlugin.groovy | |
class JavaAPT extends DefaultTask { | |
private File _destinationDir | |
def getDestinationDir(dir) { _destinationDir } | |
void setDestinationDir(dir) { | |
_destinationDir = dir | |
outputs.dir _destinationDir | |
} |
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
package info.vividcode; | |
import java.io.BufferedInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.util.List; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* すぐに実行終了するコマンド (外部プロセス) を実行するクラス。 |
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
var Cc = Components.classes; | |
var Ci = Components.interfaces; | |
var PromptService = Cc["@mozilla.org/embedcomp/prompt-service;1"] | |
.getService(Ci.nsIPromptService); | |
// インストール時に呼び出される | |
function install(aData, aReason) { | |
PromptService.alert(null, "Bootstrapped Extension Sample", "Install"); | |
} |
NewerOlder