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 RDDasMonadPlus { | |
import org.apache.spark.{ SparkContext } | |
import org.apache.spark.rdd.RDD | |
import scalaz._ | |
import Scalaz._ | |
import scala.reflect.ClassTag | |
// RDDMPlus is the type for which we will define the Monad instance. it can be | |
// constructed from an RDD using the RDDClassTag constructor. this | |
// implementation is based on insights from |
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 Zhihu37118044 { | |
def printDeep(vector: IndexedSeq[_]) { | |
import scalaz.std.indexedSeq._ | |
import scalaz.syntax.traverse._ | |
((0 until 100):IxSq[Int]).foldLeftM[IxSq, Any](vector) { | |
case (vector: IxSq[Any], _) => | |
vector | |
case (value: Any , _) => |
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
var path = WScript.Arguments(0); | |
var rev = WScript.Arguments(1); | |
var WshShell = new ActiveXObject("WScript.Shell"); | |
var expectedDir = WshShell.ExpandEnvironmentStrings("%EXPECTED_DIR%"); | |
var svnlook = WshShell.ExpandEnvironmentStrings("%SVNLOOK%"); | |
var jenkinsUrlPrefix = WshShell.ExpandEnvironmentStrings("%JENKINS_URL_PREFIX%"); | |
var dirsChanged = WshShell.Exec(svnlook + " dirs-changed " + path + " -r " + rev).StdOut; | |
while (!dirsChanged.AtEndOfStream) { | |
var dir = dirsChanged.ReadLine(); | |
if (dir.match(expectedDir)) { |
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/env scala | |
trait 所有操作 { | |
protected type 操作符 | |
protected def 创建操作符(操作: (Int, Int) => Int):操作符 | |
final def 加 = 创建操作符(_ + _) | |
final def 乘 = 创建操作符(_ * _) |
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
--gen-hx-classes | |
-swf-lib haxelib-release/textLayout.swf | |
-swf no-output.swf | |
--no-output | |
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportFlowElement",true) | |
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportContainerFormattedElement",true) | |
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportListItem",true) | |
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportParagraphFormattedElement",true) | |
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportList",true) | |
--macro removeField("flashx.textLayout.elements.FlowElement","abstract") |
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 ExplicitCommonType | |
{ | |
public static function main() | |
{ | |
// ExplicitCommonType.hx:6: characters 71-89 : IntHash<Int> should be Hash<Int> | |
var iterable:Iterable<Int> = Math.random() < 0.5 ? new Hash<Int>() : new IntHash<Int>(); | |
} | |
} |
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 NativeInMacro | |
{ | |
@:macro public static function myMacro():haxe.macro.Expr | |
{ | |
trace(MyEnum.MY_VALUE); | |
return macro null; | |
} | |
public static function main() | |
{ | |
trace(MyEnum.MY_VALUE); |
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 org.junit._ | |
class TailCallBenchmark { | |
import scala.util.continuations._ | |
@Test | |
def test() { | |
import scala.util.control.TailCalls._ | |
def unwind(): Unit @cps[TailRec[Unit]] = { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.