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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "centos64_64" |
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
class MyException(message: String, cause: Throwable) extends RuntimeException(message, cause) { | |
def this() = this(null, null) | |
def this(message: String) = this(message, null) | |
def this(cause: Throwable) = this(null, cause) | |
} |
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 bubbleSort(arr: Array[Int]): Array[Int] = { | |
for(i <- 0 until arr.length - 1; j <- 0 until arr.length - 1 - i) { | |
if (arr(j) > arr (j + 1)) { | |
val temp = arr(j) | |
arr(j) = arr(j + 1) | |
arr(j + 1) = temp | |
} | |
} | |
arr | |
} |
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 qSort[T <% Ordered[T]](data: List[T]): List[T] = { | |
data match { | |
case Nil => data | |
case x::xs => { | |
qSort(xs.filter(_ < x)) ++ List(x) ++ qSort(xs.filter(x <= _)) | |
} | |
} | |
} | |
qSort(List(2, 44, 5, 3, 1, 3, 9, 56, 7, 8, 4, 111, 0, 3, 4)) foreach println |
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
Dim い As Integer | |
For い = 0 To 5 | |
'ループ内の処理 | |
Next い | |
Dim ろ As Integer | |
For ろ = 0 To 5 | |
'ループ内の処理 |
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 math._ | |
import scala.util._ | |
/** | |
* The code below will read all the game information for you. | |
* On each game turn, information will be available on the standard input, you will be sent: | |
* -> the total number of visible enemies | |
* -> for each enemy, its name and distance from you | |
* The system will wait for you to write an enemy name on the standard output. | |
* Once you have designated a target: |
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 math._ | |
import scala.util._ | |
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
object Player { | |
def main(args: Array[String]) { |
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 scala.util.Random | |
val r = new Random() | |
r.shuffle(List("カ", "ド" ,"カ" ,"ワ", "ン", "ゴ")).take(4).mkString |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
import json | |
import os | |
import tempfile | |
import codecs | |
from optparse import OptionParser |
OlderNewer