This file contains hidden or 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/bash | |
# General Information | |
ID=319"%"2C888"%"2C247 | |
IGN=stp@PG/r | |
RANK=170 | |
TIMEZONE=-8 | |
MEMO=100"%"25+LMeta | |
STARTER_ID=2 | |
REGION=2 |
This file contains hidden or 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
public class Main { | |
private static final int ITERATIONS = 100000; | |
public static void main(String[] args) { | |
long stringConcatTime = time(Main::stringConcat); | |
System.out.println("String concat time: " + stringConcatTime + " ms"); | |
long stringBufferAppendTime = time(Main::stringBufferAppend); | |
System.out.println("StringBuffer append time: " + stringBufferAppendTime + " ms"); | |
} |
This file contains hidden or 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.xml.transform.stream.StreamSource | |
import javax.xml.validation.Schema | |
import javax.xml.validation.SchemaFactory | |
import javax.xml.validation.{Validator=>JValidator} | |
import org.xml.sax.SAXException | |
object Validator { | |
def main(args: Array[String]) { | |
require(args.size >= 2, "Params: xmlFile, xsdFile") | |
val result = |
This file contains hidden or 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
object Role extends Enumeration { | |
type Role = Value | |
val Tank = Value("Tank") | |
val Heal = Value("Heal") | |
val Damage = Value("Damage") | |
} | |
import Role._ | |
case class Character(name: String, roles: List[Role], score: Double) |
This file contains hidden or 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 doRequest(key: String, secret: String) { | |
val ck = ConsumerKey(key, secret) | |
val oauth = OAuth(ServiceInfo(null, null, null, ck)) | |
val calc = OAuthCalculator(ck, RequestToken("", "")) | |
calc.setSendEmptyTokens(true) | |
WS.url(endpoint).sign(calc).get.map(response => { | |
println(response.json) | |
}) | |
} |
This file contains hidden or 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
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
if [ ! -f /usr/bin/chef-client ]; then | |
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://opscode.com/beta-install.sh | |
sh beta-install.sh | |
fi | |
mkdir -p /etc/chef |
This file contains hidden or 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
itsOverNineThousand(15000) { () => | |
println("I think this is over nine thousand, yeah! So.. I guess I'll return true.") | |
true | |
} |
This file contains hidden or 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 itsOverNineThousand(n: Int)(body: => Boolean) = { | |
if (n > 9000) { | |
body | |
} | |
} |
This file contains hidden or 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
itsOverNineThousand(15000) { | |
println("I think this is over nine thousand, yeah! So.. I guess I'll return true.") | |
true | |
} |
This file contains hidden or 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 itsOverNineThousand(n: Int)(f: () => Boolean) = { | |
if (n > 9000) { | |
f() | |
} | |
} |
NewerOlder