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 newAccount (initialBalance) | |
local self = {balance = initialBalance} | |
local withdraw = function (v) | |
self.balance = self.balance - v | |
end | |
local deposit = function (v) | |
self.balance = self.balance + v | |
end |
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
var timing = window.performance.timing; | |
//重定向耗时 | |
var redirectTime = timing.redirectEnd - timing.redirectStart; | |
console.log('重定向耗时',redirectTime); | |
//卸载上一个页面耗时 | |
var unloadTime = timing.unloadEventEnd - timing.unloadEventStart; | |
console.log('卸载上一个页面耗时', unloadTime); |
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
companion object { | |
@Volatile | |
private var logDao: ServerLogDao? = null | |
@JvmStatic | |
fun getInstance(): ServerLogDao { | |
if (logDao == null) { | |
synchronized(ServerLogDao::class.java) { | |
if (logDao == null) { | |
logDao = ServerLogDao() |
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 string | |
import random | |
def rand_string(length): | |
return ''.join(random.choice( | |
string.ascii_lowercase + string.ascii_uppercase + string.digits) | |
for i in range(length) | |
) |