• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
古加纳
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
2020年4月26日
sum函数原理
摘要: function sum($array) { if (count($array) == 1) { return $array[0]; } $firstNum = array_shift($array); return $firstNum + sum($array);} 阅读全文
posted @ 2020-04-26 15:00 古加纳 阅读(344) 评论(0) 推荐(0)
2020年4月24日
堆和栈的区别
摘要: 栈内存:栈内存首先是一片内存区域,存储的都是局部变量,凡是定义在方法中的都是局部变量(方法外的是全局变量),for循环内部定义的也是局部变量,是先加载函数才能进行局部变量的定义,所以方法先进栈,然后再定义变量,变量有自己的作用域,一旦离开作用域,变量就会被释放。栈内存的更新速度很快,因为局部变量的生 阅读全文
posted @ 2020-04-24 10:50 古加纳 阅读(143) 评论(0) 推荐(0)
最长公共前缀
摘要: $array = ['apple', 'apar', 'appod'];function getCommon($array) { $firstArray = array_shift($array); $str = ''; $count = strlen($firstArray); for($i=0; 阅读全文
posted @ 2020-04-24 10:30 古加纳 阅读(98) 评论(0) 推荐(0)
2020年4月23日
罗马数子转阿拉伯数子
摘要: 整理思路:前边的大于等于后边的 VI II 后边的大于前边的 IV (这种按一个位数走)function romanChangeNum($roman) { $array = ['I' => 1, 'V' => 5, 'X' => 10, 'L' => 50, 'C' => 100, 'D' => 5 阅读全文
posted @ 2020-04-23 17:54 古加纳 阅读(140) 评论(0) 推荐(0)
字符串反转
摘要: $num = 123455678;$b = strrev($num);$array = str_split($num);$array = array_reverse($array);var_dump($array); 阅读全文
posted @ 2020-04-23 11:09 古加纳 阅读(94) 评论(0) 推荐(0)
两数之和
摘要: $array = [2,5,7,9,11];$target = 11;function twoSums($array, $target) { $count = count($array); for ($i=0;$i<$count;$i++) { $diff = $target - $array[$i 阅读全文
posted @ 2020-04-23 10:58 古加纳 阅读(146) 评论(0) 推荐(0)
2020年4月8日
mac 安装不同版本的node
摘要: node有一个模块n,是专门用来管理node.js的版本的。 安装n模块:npm install -g n 升级node.js到最新稳定版 n stable 安装指定版本: n v6.11.5 阅读全文
posted @ 2020-04-08 16:58 古加纳 阅读(1697) 评论(0) 推荐(0)
2020年4月7日
ng指令
摘要: *ngFor *ngIf *ngSwitch *ngClass *ngStyle 阅读全文
posted @ 2020-04-07 16:05 古加纳 阅读(234) 评论(0) 推荐(0)
2020年4月2日
创建项目
摘要: 创建项目 ng new angular_demo01 --skip-install 执行依赖 cnpm install 编译 ng serve --open 创建组件或服务 ng g ng g component components/news 目录结构分析 阅读全文
posted @ 2020-04-02 17:42 古加纳 阅读(128) 评论(0) 推荐(0)
angular部署
摘要: 1 官方下载nodejs https://nodejs.org/en/download/ node -v 2 安装cnpm sudo npm install -g cnpm --registry=https://registry.npm.taobao.org cnpm -v 3 安装脚手架 sudo 阅读全文
posted @ 2020-04-02 17:20 古加纳 阅读(425) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3