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
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tomcat="http://tomcat.apache.org/xml"> | |
<xsl:strip-space elements="*"/> | |
<xsl:output method="text" /> | |
<xsl:template match="//Connector[@protocol='org.apache.coyote.http11.Http11NioProtocol']"><!-- <xsl:template match="//Connector[@protocol='HTTP/1.1']"> --> | |
<xsl:text>PORT=</xsl:text><xsl:value-of select="@port" /><xsl:text> | |
</xsl:text> | |
<xsl:choose> | |
<xsl:when test="@address"> | |
<xsl:text>HOST=</xsl:text><xsl:value-of select="@address" /><xsl:text> |
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
eval $(xsltproc $CATALINA_BASE/bin/getconf.xsl $CATALINA_BASE/conf/server.xml $CATALINA_BASE/conf/tomcat-users.xml) |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: milkode-web | |
# Required-Start: $local_fs $remote_fs $network | |
# Should-Start: $time sendmail | |
# Required-Stop: $local_fs $remote_fs $network | |
# Should-Stop: $time sendmail | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 |
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
// | |
// モンティ・ホール問題の恐ろしく簡単なシミュレーション | |
// | |
// 扉の数を増やすと結果に差がついて感覚的に分かり易いです。 | |
// 扉を増やした場合、このスクリプトでは、ゲストが選択しなかった扉のうち、 | |
// 1つだけ残して他は全て開けて見せてしまう方法と同じ結果になるはずです。 | |
// | |
final int DOORS = 3 | |
final int TRIAL = 1000 |
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
// | |
// バスケット・ボール問題の恐ろしく簡単なシミュレーション | |
// | |
// 1 選手による 10 回連続ゴールがあった試合の数を数えます。 | |
// ...ひょっとして途中で他の選手がゴールした場合を除く必要がある? | |
// | |
final int RATIO = 2 | |
final int SHOOT = 15 | |
final int TRIAL = 10000 |
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
// | |
// ポアンカレの行きつけのパン屋 | |
// | |
// n 個のパンの中から最も重いものを売ってくれます。 | |
// 売ってくれたパンの重さの平均が「1,000g より少ない」「1,000g より大きい」場合を数えます。 | |
// 平均が 1,000g の場合は、その平均と標準偏差を表示します。 | |
// | |
int TRIAL = 100 |
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
// | |
// ベイズの定理(薬物検査) | |
// | |
// 尤度は「ゆうど」って読むんですね... | |
// | |
def PD = 0.05 // 実際の薬物使用率 (5%) | |
def PN = 1 - PD // 薬物を使用していない率 | |
def PED = 0.6 // 検査の感度、薬物使用で陽性になる確率 (60%) |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: basex | |
# Required-Start: $local_fs $remote_fs $network | |
# Should-Start: $time | |
# Required-Stop: $local_fs $remote_fs $network | |
# Should-Stop: $time | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 |
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
#!/usr/bin/env groovy | |
@Grab('postgresql:postgresql') | |
@GrabConfig(systemClassLoader=true) | |
import java.sql.* | |
import java.text.* | |
import java.util.zip.* | |
import javax.xml.* | |
import javax.xml.transform.* | |
import javax.xml.transform.stream.* |
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
#!/bin/sh | |
### | |
. /etc/init.d/functions | |
__pids_var_run $(basename $0) | |
if [ $? = 0 ]; then | |
exit 1 | |
else |