I hereby claim:
- I am mingyang91 on github.
- I am famer (https://keybase.io/famer) on keybase.
- I have a public key ASAcRGRvhvMiRo4EgLphpfDpKuYzf6vEdGhR6TOw1igV6go
To claim this, I am signing this object:
/** | |
* Definition for a Node. | |
* class Node(var _value: Int) { | |
* var value: Int = _value | |
* var next: Node = null | |
* var random: Node = null | |
* } | |
*/ | |
import scala.collection.mutable._ |
class V2EX_stream { | |
public List<String> getForeignKeyTable(List<String> tableNames, | |
DataSourceEntity info, | |
List<ForeignKeyInfo> foreignKeyInfos) { | |
var childTables = tableNames.stream() | |
.map(tableName -> findAllTable(info.getDataBaseName(), tableName)) | |
.filter(column -> !DB_KEYWORD_SET.contains(column.getColumnName().toUpperCase())) | |
.flatMap(columnInfo -> foreignKeyInfos.stream() | |
.filter(it -> it.getSourceTableName().equals(columnInfo.getTableName()) && |
// | |
object Vson extends RegexParsers: | |
val string: Parser[String] = """[^,:}]+""".r ^^ { str => str.trim } | |
val int: Parser[Int] = """-?\d+""".r ^^ (_.toInt) | |
val double: Parser[Double] = """-?\d+\.\d+""".r ^^ (_.toDouble) | |
val bool: Parser[Boolean] = "true" ^^^ true | "false" ^^^ false | |
def pair: Parser[(String, Json)] = (string <~ ":") ~ value ^^ { case k ~ v => (k, v) } | |
def obj: Parser[Json] = "{" ~> repsep(options | pair, ",") <~ "}" ^^ Json.fromFields | |
def tuple: Parser[(Int, String, String)] = ((int <~ ":") ~ string <~ ":") ~ string ^^ { case k ~ v1 ~ v2 => (k, v1, v2) } | |
def array: Parser[List[(Int, String, String)]] = repsep(tuple, ",") |
@experimental | |
object Test extends App : | |
val a = CCA("a", 2, 3.0) | |
val b = CCB(4.5, 128.toByte) | |
val res = sum[CCA, CCB, CCC](a, b) | |
println(res) | |
@experimental | |
def sum[A <: Product, B <: Product, C <: Product](a: A, b: B) |
// utils | |
class FromJsonQueryStringBindable[T] ()(implicit decoder: Decoder[T], | |
encoder: Encoder[T]) extends QueryStringBindable[T] { | |
implicit val binder: QueryStringBindable[Json] = JsonQueryStringBindable | |
override def bind(key: String, params: Map[String, Seq[String]]): Option[Either[String, T]] = | |
binder.bind(key, params).map(_.flatMap(_.as[T].left.map(_.message))) | |
override def unbind(key: String, value: T): String = s"$key=${value.asJson}" | |
} |
λ curl -X POST \ | |
http://chouun.nadileaf.com/api/open-candidates/ \ | |
-H 'authorization: Bearer <TOKEN>' \ | |
-H 'cache-control: no-cache' \ | |
-H 'content-type: application/json' \ | |
-H 'postman-token: 1c12fc65-c157-49c7-d9d4-d2ad10832c53' \ | |
-d ' | |
{ | |
"openid": "b39fe420-d67e-11e7-a5de-0250bbe96648", | |
"industry":"互联网", |
I hereby claim:
To claim this, I am signing this object:
以下问题必答。
#lang racket | |
(define variable? symbol?) | |
(define (same-variable? v1 v2) | |
(and (variable? v1) (variable? v2) (eq? v1 v2))) | |
(define (=number? exp num) | |
(and (number? exp) (= exp num))) |
#lang scheme | |
(define (average . numbers) | |
(/ (apply + numbers) (length numbers))) | |
(define tolerance 0.000001) | |
(define (fixed-point f first-guess) | |
(define (close-enough? v1 v2) | |
(< (abs (- v1 v2)) tolerance)) | |
(define (try guess) |