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 java.io._ | |
| import java.net._ | |
| object Main { | |
| trait StreamTypeInferencer[A, B] | |
| object StreamTypeInferencer { | |
| implicit object InputStreamInputStream | |
| extends StreamTypeInferencer[InputStream, InputStream] | |
| implicit object InputStreamBufferedInputStream | |
| extends StreamTypeInferencer[BufferedInputStream, InputStream] |
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.collection.JavaConversions._ | |
| import java.lang.reflect.{Type, ParameterizedType} | |
| import jp.sf.amateras.mirage._ | |
| import jp.sf.amateras.mirage.session._ | |
| abstract class AbstractService[T] { | |
| private def findEntityClass() : Option[Class[_]] = { | |
| def genericParameter(t: Type) : scala.Array[Type] = { | |
| if (classOf[ParameterizedType].isInstance(t)) { |
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
| require 'formula' | |
| class Hadoop0202Cdh3b < Formula | |
| url 'http://archive.cloudera.com/cdh/3/hadoop-0.20.2-CDH3B4.tar.gz' | |
| homepage '' | |
| md5 '18652c52229390752f354b0667e075d6' | |
| def shim_script target | |
| <<-EOS.undent | |
| #!/bin/bash |
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
| # -*- coding: utf-8 -*- | |
| import math | |
| def is_prime(n): | |
| for i in xrange(2, int(math.sqrt(n)) + 1): | |
| if not n % i: | |
| return False | |
| return 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
| package scala | |
| object ob { | |
| class ReversibleString(str: String) { | |
| def reverseOrder() = { | |
| var s = "" | |
| for (c <- str.split("")) { | |
| s = c + s | |
| } |
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 Main extends App { | |
| trait Reversible { | |
| val s:String | |
| def reverseOrder = s reverse | |
| def reverseCases = s collect{ | |
| case c if c.isUpper => c.toLower | |
| case c if c.isLower => c.toUpper | |
| case c => c | |
| } |
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 StringWithReverses(str: String) { | |
| def reverseOrder(): String = { | |
| var rev = new StringBuilder(str.length) | |
| (0 until str.length) foreach { (i) => rev.append(str.charAt(str.length-1-i)) } | |
| rev.toString() | |
| } | |
| def reverseCases(): String = { | |
| var rev = new StringBuilder(str.length) | |
| (0 until str.length) foreach { (i) => |
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
| val uriEscaped = args(0) | |
| implicit def listToArray[T: ClassManifest](list: List[T]): Array[T] = | |
| list.toArray | |
| implicit def arrayToList[T](arr: Array[T]): List[T] = | |
| (arr: scala.collection.mutable.WrappedArray[T]).toList | |
| def unescapeHexChars(char1: Char, char2: Char): Byte = { | |
| Integer.decode("0x" + char1 + char2).toByte |
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
| 1 2 3 | |
| 1 2 3 | |
| 1 2 3 |
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
| bcx david$ rake stats | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Controllers | 3704 | 2942 | 72 | 479 | 6 | 4 | | |
| | Helpers | 1901 | 1529 | 13 | 261 | 20 | 3 | | |
| | Models | 5310 | 4116 | 50 | 653 | 13 | 4 | | |
| | Libraries | 2167 | 1593 | 51 | 200 | 3 | 5 | | |
| | Integration tests | 297 | 217 | 6 | 1 | 0 | 215 | | |
| | Functional tests | 3897 | 3065 | 61 | 11 | 0 | 276 | |
OlderNewer