wangyp

博客园 首页 联系 订阅 管理

2018年12月4日

摘要: 如何刷题?就是200道题! 原则: 生长学习法+科学练习 生长学习法: 你是怎么想到的?思路!==》思路报告! 思路报告: 01.题目 02.例子 03.题目假设 04.重要问题 05.直觉 06.解决方法的可能性 07.解决方案 08.数据结构 09.算法复杂度:时间空间 总结: 要有脑子! 阅读全文
posted @ 2018-12-04 17:57 wangyp 阅读(173) 评论(0) 推荐(0) 编辑

摘要: class MyQueue(object): def __init__(self, ): """ Initialize your data structure here. """ self.instack = [] self.outstack = [] def push(self, x): ... 阅读全文
posted @ 2018-12-04 17:43 wangyp 阅读(135) 评论(0) 推荐(0) 编辑

摘要: s = 'we are happy's = s.replace(' ','%20')print s s = 'we are happy' s = s.replace(' ','%20') print s 阅读全文
posted @ 2018-12-04 17:39 wangyp 阅读(78) 评论(0) 推荐(0) 编辑

摘要: # -*- coding:utf-8 -*- from collections import Counter class Solution(object): def findRepeatNum(self,input_list): if not input_list: return c = Counter(input_list) ... 阅读全文
posted @ 2018-12-04 17:38 wangyp 阅读(105) 评论(0) 推荐(0) 编辑

摘要: # -*- coding:utf-8 -*- class Solution(object): def fNumInSorted(self,input_list,target_num): if not input_list: return if not target_num: return r... 阅读全文
posted @ 2018-12-04 17:38 wangyp 阅读(111) 评论(0) 推荐(0) 编辑

2018年11月19日

摘要: 面向对象学习 目录: 1.面向对象介绍 2.为什么要用面向对象 3.面向对象的特性:封装、集成、多态 4.如何写出面向对象的程序:领域建模 5.面向对象高阶语法: A.经典类、新式类 B.静态方法、类方法、属性方法 C.类的特殊方法 D.反射 6.作业 7.感悟ending 内容: 1.面向对象介绍 编程:计算机语言py+算法+数据结构,根据任务设... 阅读全文
posted @ 2018-11-19 13:21 wangyp 阅读(99) 评论(0) 推荐(0) 编辑

2017年9月15日

摘要: chapter 13.shell数组的应用实践 1.介绍 shell数组是元素的集合,数据的一种格式; 2.定义 array=(value1 value2 value3...) 对于元素较长的:竖着写 静态的! array=($(命令)) array(`命令`) 动态的 3.打印 打印数组个数:echo ${#array[*]} echo ${#array[@]} 打印数组元素:所有元... 阅读全文
posted @ 2017-09-15 15:35 wangyp 阅读(146) 评论(0) 推荐(0) 编辑

2017年9月14日

摘要: 07if条件语句的语法和实战 语法: 实战: 01.监控web和数据库的企业案例 如何获取数据: 端口监控:netstat、ss、lsof 本地:netstat -lnt | grep 3306 | awk -F ":" '{print $2}' | awk '{print $1}' | wc -l ss -lntup | grep mysql | wc -l ... 阅读全文
posted @ 2017-09-14 14:51 wangyp 阅读(109) 评论(0) 推荐(0) 编辑

2017年9月12日

摘要: chapter 06.shell脚本的条件测试和比较 6.1shell脚本的条件测试 6.1.1条件测试方法综述 test [] [[]] (()) 6.1.2test条件测试的语法和示例 [root@bogon ~]# test -f n.sh && echo "0" || echo "1" ###0 [root@bogon ~]# test -z "hello" && e... 阅读全文
posted @ 2017-09-12 18:23 wangyp 阅读(125) 评论(1) 推荐(0) 编辑

2017年9月11日

摘要: Chapter 1 如何才能学好shell编程 1.0多写、多写;每个代码都要写 Chapter 2 Shell脚本 2.1 什么是shell? 2.2 什么是shell脚本? 2.3 shell脚本的地位 2.4 shell脚本的种类 B shell(bash、sh)、C shell 2.5 常用的操作系统默认的shell [root@bogon ~]# cat /etc/s... 阅读全文
posted @ 2017-09-11 23:14 wangyp 阅读(148) 评论(1) 推荐(0) 编辑