var Person = Backbone.Model.extend();
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
class Set(object): | |
"""Sets can contain anything, including themselves. This leads to | |
paradoxical behavior: given R, the set of all sets that don't contain | |
themselves, does R contain R? Here this becomes an infinite recursion. | |
""" | |
def __init__(self, predicate): | |
self.predicate = predicate | |
def __contains__(self, obj): | |
return self.predicate(obj) |
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
正则匹配 | |
匹配中文字符的正则表达式: [\u4e00-\u9fa5] | |
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 | |
匹配双字节字符(包括汉字在内):[^\x00-\xff] | |
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) | |
匹配空白行的正则表达式:\n\s*\r | |
评注:可以用来删除空白行 |
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
<?php | |
use Symfony\Component\Yaml\Yaml; | |
return Yaml::parse(file_get_contents(base_path().'/resources/lang/zh_cn/validation.yml')); |
This document is now obsolete, please refer to the current version.
Status: Under implementation.
This document is an informal specification of a feature supporting the definition of function type aliases using a more expressive syntax than the one available today, such that it also covers generic function types. The feature also introduces syntax for specifying function types directly, such
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
fun main(args: Array<String>) { | |
fun <T> println(message: T) { | |
print(Thread.currentThread().stackTrace[2].lineNumber.toString() + "行目 ") | |
print(message) | |
print("\n") | |
} | |
println("hi") | |
} |
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
// A simple Lexer meant to demonstrate a few theoretical concepts. It can | |
// support several parser concepts and is very fast (though speed is not its | |
// design goal). | |
// | |
// J. Arrieta, Nabla Zero Labs | |
// | |
// This code is released under the MIT License. | |
// | |
// Copyright 2018 Nabla Zero Labs | |
// |
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
//based on the discussion here https://gist.github.com/aidanhs/5ac9088ca0f6bdd4a370 | |
// Binary tree implementation (simplified) | |
#![allow(dead_code)] | |
use std::string::String; | |
use std::cmp::PartialEq; | |
use std::cmp::PartialOrd; | |
struct BinTree<T> { |