I hereby claim:
- I am gaocegege on github.
- I am gaocegege (https://keybase.io/gaocegege) on keybase.
- I have a public key whose fingerprint is 48F2 9F0D 1473 D685 3D8E 0E92 8D04 D990 3473 542E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# iterm coloring | |
function tab-color() { | |
if [[ $# == 1 ]] | |
then | |
# convert hex to decimal | |
hex=$1 | |
if [[ ${hex:0:1} == "#" ]] | |
then | |
# strip leading hash sign | |
hex=${hex:1:6} |
import java.io._ | |
import org.apache.commons._ | |
import org.apache.http._ | |
import org.apache.http.client._ | |
import org.apache.http.client.methods.HttpPost | |
import org.apache.http.impl.client.DefaultHttpClient | |
import java.util.ArrayList | |
import org.apache.http.message.BasicNameValuePair | |
import org.apache.http.client.entity.UrlEncodedFormEntity |
package reporter | |
import scala.tools.nsc.Global | |
import scala.reflect.internal.util.{Position, NoPosition, FakePos} | |
object Reporters { | |
abstract class ReporterFormatter { | |
def formatTypeTitle(typ: MsgType): String | |
} |
package renren | |
class Friend(var uid: String, var school: String, var name: String, var link: String) extends Serializable { | |
override def toString(): String = { | |
s"Friend($uid, $school, $name, $link)" | |
} | |
override def equals(o: Any) = o match { | |
case that: Friend => that.uid.equalsIgnoreCase(this.uid) | |
case _ => false |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
object Main { | |
class Pong extends Actor { | |
def act() { | |
var pongCount = 0 | |
while (true) { | |
receive { | |
case "Ping" => |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
// 2D Array of objects | |
System sys; | |
// Number of columns and cols in the grid | |
// cols need to > 35 to support the gun test | |
int cols = 50; | |
void setup() { | |
size(400, 400); | |
sys = new System(cols, 400 / cols); |
// client conf | |
akka { | |
loglevel = "DEBUG" | |
actor { | |
provider = "akka.remote.RemoteActorRefProvider" | |
} | |
remote { | |
transport = "akka.remote.netty.NettyRemoteTransport" | |
log-sent-messages = on | |
log-received-messages = on |
import os | |
config = os.path.join(os.path.dirname(__file__),"tests-files", "config.yml") | |
print(config) |