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
let 起床时间 = 8; // 本来是早上 8 点起床 | |
let 睡觉时间 = 22; // 晚上 10 点睡觉 | |
while (true) { | |
很晚才起床(); | |
console.log(`当 ${(睡觉时间>=24)?'第二天 '+(睡觉时间%24):睡觉时间} 点睡,起床时间为 ${起床时间}`); | |
if (睡觉时间 > 24 && 睡觉时间 % 24 >= 8) { | |
console.log("不用睡觉了,好耶!😆") | |
break; // 如果到第二天 8 点,那不用睡觉了,程序结束 |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var c = make(chan string, 2) | |
func main() { |
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 getCategories(Request $request, Response $response, $args) { | |
$categoriesTable = $this - >tableCategory(); | |
$withBooks = $request - >getParam('withBooks'); | |
$data = []; | |
foreach($categoriesTable - >get() as $num = >$item) { | |
$data[$num] = []; | |
foreach($item as $key = >$value) $data[$num][$key] = $value; |
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 Ha { | |
function __construct() { | |
// 1. Look there | |
$action = new Action(); | |
$action->setMsg("你好世界"); | |
$this->handleActionObj($action, "Hello World"); | |
echo $action->getMsg(); | |
} | |
function handleActionObj(Action $actionObj, $msg) { |
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
public class testPointerA { | |
public static void main(String[] agrs) { | |
new a(); | |
b classB = new b(); | |
classB.init(); | |
classB.action(); | |
c classC = new c(); | |
classC.cAction(); | |
} |
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 err = false; | |
var ha = function () { | |
if (err) { | |
throw("Error!!!"); | |
} | |
console.log("ha"); | |
}; | |
var do = function () { | |
ha(); | |
console.log("do"); |