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
;; outlet: https://github.com/jlongster/outlet | |
(define (atom? exp) | |
(or (number? exp) | |
(string? exp) | |
(boolean? exp) | |
(null? exp) | |
(symbol? exp))) |
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 | |
// source from: [php判断session是否处于开启状态_阳水平的博客-CSDN博客](https://blog.csdn.net/zhezhebie/article/details/102678031) | |
function is_session_started() { | |
if ( php_sapi_name() !== 'cli' ) { | |
if ( version_compare(phpversion(), '5.4.0', '>=') ) { | |
return session_status() === PHP_SESSION_ACTIVE ? "TRUE" : "FALSE"; | |
} else { | |
return session_id() === '' ? "FALSE" : "TRUE"; | |
} | |
} |
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
from string import whitespace | |
atom_end = set('()"\'') | set(whitespace) | |
def parse(sexp): | |
stack, i, length = [[]], 0, len(sexp) | |
while i < length: | |
c = sexp[i] | |
print c, stack |
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
function go_out() | |
{ | |
var _loc1_ = undefined; | |
var _loc5_ = catx; | |
var _loc4_ = caty; | |
_loc1_ = 0; | |
while(_loc1_ < 6) | |
{ | |
var _loc3_ = !(_loc4_ % 2)?_loc5_ + addx0[_loc1_]:_loc5_ + addx1[_loc1_]; | |
var _loc2_ = _loc4_ + addy0[_loc1_]; |
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
#make a linear regression of y = a*x^2 + b | |
#fix error of calculus | |
p=[(1,1), (2,2), (3,3), (4,4)] | |
x=[t[0] for t in p] | |
y=[t[1] for t in p] | |
x2y = [(x[i] **2) * y[i] for i in range(0,4)] | |
sigmaX4 = sum(list(map(lambda x:x ** 4, x))) | |
sigmaX2 = sum(list(map(lambda x:x ** 2, x))) |
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
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 | |
Type "copyright", "credits" or "license()" for more information. | |
>>> x=[1,2,3] | |
>>> s='' | |
>>> for i in x: | |
print(i) | |
1 | |
2 |