随笔 - 163, 文章 - 1, 评论 - 20, 阅读 - 14万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

08 2023 档案

摘要:```python # # py_count_words.py # py_learn # # Created by Z. Steve on 2023/8/23 10:30. # import re from collections import Counter def count_words(tex 阅读全文

posted @ 2023-08-23 16:12 steve.z 阅读(325) 评论(0) 推荐(0) 编辑

摘要:# wildcard 百搭、通配符 在 shell 中使用 noglob 前缀,则停用通配符功能 例如: ```bash $ noglob scrapy shell -s USER_AGENT='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Appl 阅读全文

posted @ 2023-08-18 17:49 steve.z 阅读(33) 评论(0) 推荐(0) 编辑

摘要:```bash # 1. 按两次 control + c # 2. 按一次 control + d # 3. 输入 .exit ``` 阅读全文

posted @ 2023-08-17 20:48 steve.z 阅读(23) 评论(0) 推荐(0) 编辑

摘要:# 1、下载 vmfusion 13 并安装 # 2、下载 Ubuntu Server arm 版本,并在 vmfusion 13 中安装 # 3、在 Ubuntu Server 中安装desktop ```bash $ sudo apt update $ sudo apt install task 阅读全文

posted @ 2023-08-17 19:04 steve.z 阅读(559) 评论(0) 推荐(0) 编辑

摘要:```python # # py_pyspark_demo2.py # py_learn # # Created by Z. Steve on 2023/8/13 10:55. # import json # 1. 导入库 from pyspark import SparkConf, SparkCo 阅读全文

posted @ 2023-08-14 16:33 steve.z 阅读(89) 评论(0) 推荐(0) 编辑

摘要:```python # # py_spark_rdd2py.py # py_learn # # Created by Z. Steve on 2023/8/13 11:39. # # 1. rdd.collect() 将 rdd 变为 list # 2. rdd.reduce() 不分组, 对 rd 阅读全文

posted @ 2023-08-13 15:46 steve.z 阅读(50) 评论(0) 推荐(0) 编辑

摘要:```python # # py_pyspark_demo2.py # py_learn # # Created by Z. Steve on 2023/8/13 10:55. # import json # 1. 导入库 from pyspark import SparkConf, SparkCo 阅读全文

posted @ 2023-08-13 11:37 steve.z 阅读(7) 评论(0) 推荐(0) 编辑

摘要:```python # # py_pyspark_test.py # py_learn # # Created by Z. Steve on 2023/8/12 17:38. # from pyspark import SparkConf, SparkContext conf = SparkConf 阅读全文

posted @ 2023-08-13 10:55 steve.z 阅读(183) 评论(0) 推荐(0) 编辑

摘要:```python # # py_pyspark_demo.py # py_learn # # Created by Z. Steve on 2023/8/12 15:33. # # 统计文件中各个单词出现的次数 # 1. 导入库 from pyspark import SparkConf, Spa 阅读全文

posted @ 2023-08-12 17:32 steve.z 阅读(38) 评论(0) 推荐(0) 编辑

摘要:```python # # py_pyspark.py # py_learn # # Created by Z. Steve on 2023/8/10 17:51. # # pyspark 编程主要分三步:1. 数据输入。2. 数据处理。3. 数据输出。 # RDD:Resilient Distri 阅读全文

posted @ 2023-08-12 15:23 steve.z 阅读(68) 评论(0) 推荐(0) 编辑

摘要:```bash # macOS 操作 MySQL 服务 # 启动MySQL mysql.server start # 停止MySQL mysql.server stop # 重启 MySQL mysql.server restart # 查看当前 MySQL 服务状态 mysql.server st 阅读全文

posted @ 2023-08-10 17:42 steve.z 阅读(47) 评论(0) 推荐(0) 编辑

摘要:```python # # py_factory.py # py_learn # # Created by Z. Steve on 2023/8/8 10:17. # # 工厂模式优点: # 1. 大批量创建对象是, 有统一的入口, 易于代码维护。 # 2. 当发生修改时,只需要修改工厂类的创建方法 阅读全文

posted @ 2023-08-08 10:29 steve.z 阅读(15) 评论(0) 推荐(0) 编辑

摘要:```python # # py_singleton.py # py_learn # # Created by Z. Steve on 2023/8/8 09:45. # # # 查看对象地址 demo # class Utility: # pass # # # u1 = Utility() # u 阅读全文

posted @ 2023-08-08 10:11 steve.z 阅读(6) 评论(0) 推荐(0) 编辑

摘要:```python # # py_decorator.py # py_learn # # Created by Z. Steve on 2023/8/8 08:34. # # 装饰器:本质闭包。在不破坏原目标函数原来代码和功能的前提下,为目标函数增加新功能。 # 定义一个闭包函数, 在闭包函数内部执 阅读全文

posted @ 2023-08-08 09:37 steve.z 阅读(4) 评论(0) 推荐(0) 编辑

摘要:```python # # py_closure.py # py_learn # # Created by Z. Steve on 2023/8/8 07:17. # # 闭包: # 1. 概念相关 # 闭包(closure)是一个函数以及其捆绑的周边环境状态(lexical environment 阅读全文

posted @ 2023-08-08 08:30 steve.z 阅读(13) 评论(0) 推荐(0) 编辑

摘要:```python # # py_recursive.py # py_learn # # Created by Z. Steve on 2023/8/7 21:28. # # 需求: 通过递归查找一个目录下的所有目录和文件 os 模块下的三个方法: 1. os.listdir() 2. os.pat 阅读全文

posted @ 2023-08-07 22:34 steve.z 阅读(9) 评论(0) 推荐(0) 编辑

摘要:# Python 使用正则表达式 ```python # # py_regex.py # py_learn # # Created by Z. Steve on 2023/8/7 17:18. # # 1. Python 使用正则表达式, 需要导入的模块 re 模块 # 2. 正则表达式基本方法: 阅读全文

posted @ 2023-08-07 18:43 steve.z 阅读(23) 评论(0) 推荐(0) 编辑

摘要:# Socket ## 客户端 ```python # # py_client.py # py_learn # # Created by Z. Steve on 2023/8/7 16:36. # import socket def test_client(): # 1. 创建 socket soc 阅读全文

posted @ 2023-08-07 17:18 steve.z 阅读(23) 评论(0) 推荐(0) 编辑

摘要:```python import threading,time def fn1(x, y, z): while True: print("I'm doing sport.") print('args: %s %s %s' % (x, y, z)) time.sleep(1) def fn2(a, b 阅读全文

posted @ 2023-08-07 10:42 steve.z 阅读(18) 评论(0) 推荐(0) 编辑

摘要:# 概述 围绕 ARM 处理器设计的计算机与围绕 Intel 或 AMD 设计的计算机是不可互换使用的。有两个基本问题是它们都要解决的,尽管方式各有不同: 1. 如何平衡晶体管数量与程序复杂性? 2. 如何确定速度、功耗和成本的优先级? 在过去的四十年里,在不断寻求答案的过程中,我们见证了小到智能手 阅读全文

posted @ 2023-08-06 08:13 steve.z 阅读(28) 评论(0) 推荐(0) 编辑

摘要:```c #include // 循环 void printN(int n) { int mod = 0; while ((mod = n % 10) != 0) { printf("%d\n", mod); n = n / 10; } } // 递归 void printn(int n) { pr 阅读全文

posted @ 2023-08-03 12:12 steve.z 阅读(20) 评论(0) 推荐(0) 编辑

摘要:# 递归的四个基本法则 ## 1. 必须有基准情形(base case) > 必须有某些基准情形,它们不用递归就能求解 ## 2. 必须不断推进(making progress) > 对于需要递归的情形,递归调用必须能够朝着产生基准情形的方向推进 ## 3. 设计法则 design rule > 假 阅读全文

posted @ 2023-08-03 11:53 steve.z 阅读(61) 评论(0) 推荐(0) 编辑

摘要:```c #include #include // 定义节点结构体 struct node { int data; struct node *next; /* 注意:这行使用了 node, node 必须在这行之前定义 */ }; int main(int argc, const char *arg 阅读全文

posted @ 2023-08-02 20:04 steve.z 阅读(10) 评论(0) 推荐(0) 编辑

摘要:```c #include #include // 1. 定义一个结构体(先定义结构体再声明变量) struct Student { int no; char *name; char sex; float score; }; // 2. 在定义结构体类型的同时声明结构体变量 struct Teach 阅读全文

posted @ 2023-08-02 11:13 steve.z 阅读(30) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示