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
sync.B object internals: | |
OFFSET SIZE TYPE DESCRIPTION VALUE | |
0 4 (object header) 05 00 00 00 (00000101 00000000 00000000 00000000) (5) | |
4 4 (object header) 00 00 00 00 (00000000 00000000 00000000 00000000) (0) | |
8 4 (object header) 9c aa 16 00 (10011100 10101010 00010110 00000000) (1485468) | |
12 4 (loss due to the next object alignment) | |
Instance size: 16 bytes | |
Space losses: 0 bytes internal + 4 bytes external = 4 bytes total | |
t1 lock ing |
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
# https://github.com/kubernetes-sigs/kubebuilder/blob/master/build/thirdparty/linux/Dockerfile | |
# https://github.com/kubernetes-sigs/kubebuilder/blob/2ea629ba2ebb791aefce579a1e6106caa084df8f/build/thirdparty/linux/Dockerfile | |
# Copyright 2018 The Kubernetes Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
object per extends App{ | |
def permutations(str: String):List[String] = { | |
if(str.size == 0) | |
List("") | |
else{ | |
val res = { | |
for{c <- str | |
per <- permutations(str.replaceFirst(c.toString, "")) | |
}yield c + per | |
} |
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
/** | |
* https://class.coursera.org/progfun-002/forum/thread?thread_id=1175#comment-3124 | |
**/ | |
object Main extends App { | |
class MemoStringFunction[T](f: String => T, base: String) { | |
private lazy val v = f(base) | |
private lazy val ts = (for { | |
tx <- 'a' to 'z' | |
} yield (tx, new MemoStringFunction(f, base + tx))).toMap |
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
/** | |
计算全部子集 | |
Input: List( ('a', 2), ('b', 2)) | |
Output: | |
Nil | |
List(('a', 1)) | |
List(('a', 2)) |
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
/** | |
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com> | |
*/ | |
package akka.tutorial.first.scala | |
import akka.actor._ | |
import akka.routing.RoundRobinRouter | |
import akka.util.Duration | |
import akka.util.duration._ |
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
package examples.actors | |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
abstract class Producer[T] { | |
/** A signal that the next value should be produced. */ | |
private val Next = new Object |
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
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
public class MLeaks { | |
static byte[] m = new byte[1024 * 1024]; | |
static ThreadLocal<MLeaks> tLocal = new ThreadLocal<MLeaks>(){ | |
@Override | |
protected MLeaks initialValue() | |
{ |
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
checkout: | |
https://github.com/mongodb/mongo/blob/master/docs/errors.md | |
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
$ sudo apt-get install python-software-properties | |
$ sudo add-apt-repository ppa:sun-java-community-team/sun-java6 | |
$ sudo apt-get update | |
$ sudo apt-get install sun-java6-jdk | |
$ sudo apt-get remove openjdk-6-jdk --purge -y | |
$ sudo apt-get autoremove | |
sudo update-java-alternatives -s java-6-sun |
NewerOlder