摘要: //数组排序 let arr2 = [3, 5, 1, 7, 9]; arr2.sort(); console.log(arr2); //倒叙排序1 arr2.reverse(); console.log(arr2); //倒叙排列2 arr2.sort((a,b)=>(b-a)); console 阅读全文
posted @ 2021-07-27 21:36 子夜的流星 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 场景一,根据邮箱登录是一个普遍场景,如果邮箱不加索引则需要全表扫描,而如果加入全量索引则需要占用很大的空间。由于字符串索引支持最左前缀原则,则我们可以这样创建索引: alter table user add index index(email(5)); 这里设置email的最左前5个字符作为索引可以 阅读全文
posted @ 2020-09-26 16:24 子夜的流星 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: 新建一张表: CREATE TABLE `r` ( `id` int NOT NULL primary key auto_increment, `k` int not null, `name` varchar(16), index(k)) ENGINE=InnoDB DEFAULT CHARSET= 阅读全文
posted @ 2020-09-26 16:17 子夜的流星 阅读(172) 评论(0) 推荐(0) 编辑
摘要: <?php function demo01($a) { echo $a; } call_user_func("demo01", "hello world"); 输出 1.配合命令行参数使用 <?php //把第一个参数做为回调参数使用 $i = getopt("i:"); $i = $i['i']; 阅读全文
posted @ 2020-07-08 11:49 子夜的流星 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 1.创建分区表 CREATE TABLE `fs_orders_funds_detail_sp32` ( `id` int(11) NOT NULL AUTO_INCREMENT, `confirm_time` datetime NOT NULL DEFAULT '0000-00-00 00:00: 阅读全文
posted @ 2019-12-21 17:23 子夜的流星 阅读(907) 评论(0) 推荐(0) 编辑
摘要: html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>策略模式</title> </head> <body> <form action='./demo03.php' method="post"> <in 阅读全文
posted @ 2019-12-21 16:57 子夜的流星 阅读(253) 评论(0) 推荐(0) 编辑
摘要: <?php //php 可变参数 function concatenate( ...$strings): string { $string = ''; //此时的strings 是一个数组 foreach($strings as $piece) { $string .= $piece; } retu 阅读全文
posted @ 2019-12-05 11:56 子夜的流星 阅读(737) 评论(0) 推荐(0) 编辑
摘要: 1.返回值类型的声明 <?php //php7新特性 返回值类型的声明 function arraySum (array $arr): array { return array_map(function($value){ return array_sum($value); }, $arr); } v 阅读全文
posted @ 2019-12-04 19:22 子夜的流星 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1.sum与if结合使用 如图:数据表中,count_money 字段可为正,可为负。为正表示收入,负表示支出。 统计总收入,总支出。 select sum(if(count_money > 0, count_money, 0)) as sum_receipt, sum(if(count_money 阅读全文
posted @ 2019-11-28 19:15 子夜的流星 阅读(4129) 评论(0) 推荐(0) 编辑
摘要: 查看所有进程 ps -ef ps -ef | grep 查找的进程名 结束进程 ps -ef | grep 查找的进程名 | grep -v grep | awk '{print $2}' | xargs kill -9 阅读全文
posted @ 2019-08-22 17:36 子夜的流星 阅读(1592) 评论(0) 推荐(0) 编辑