要求: 代码示例: import java.util.Random;import java.util.Scanner; import javax.script.ScriptEngine;import javax.script.ScriptEngineManager;import javax.scri ...
分类:
其他好文 时间:
2020-10-18 10:04:51
阅读次数:
16
1 import os 2 3 #os.system('python hello1.py') 4 5 6 while 1: 7 print("****************\n") 8 print("****************\n") 9 num = input("please input ...
分类:
其他好文 时间:
2020-10-18 09:57:03
阅读次数:
21
背景介绍: 今天跟导师聊了很多,感触颇深,差距颇大,收获颇多~ 对基线和版本的控制有了更深入的了解。 每个人都有自己使用linux的环境,这些环境可以提升自己的工作效率,在岁月长河中,慢慢去完善这些“习惯”。 1 #!/bin/bash 2 3 yesnoinput() 4 { 5 while : ...
分类:
系统相关 时间:
2020-10-16 11:26:33
阅读次数:
36
列表 list = [item1, item2, ...] 如何定义空列表 1. em_list = list() 2. em_list = [] 如何遍历一个列表 # for循环 for i in alist: print(i) # while循环 i = 0 while i < len(alis ...
分类:
编程语言 时间:
2020-10-16 11:13:11
阅读次数:
23
1.1 列表的局限 前面我们说通过队列的 rpush 和 lpop 可以实现消息队列(队尾进队头出),但是消费者需要不停地调用 lpop 查看 List 中是否有等待处理的消息(比如写一个 while 循环)。 为了减少通信的消耗,可以 sleep()一段时间再消费,但是会有两个问题: 1、如果生产 ...
分类:
其他好文 时间:
2020-10-14 20:38:26
阅读次数:
21
九宫格 <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_paren ...
分类:
移动开发 时间:
2020-10-14 20:00:28
阅读次数:
27
在上一章中SpringBoot整合RabbitMQ,已经详细介绍了消息队列的作用,这一种我们直接来学习SpringBoot如何整合kafka发送消息。 kafka简介 kafka是用Scala和Java语言开发的,高吞吐量的分布式消息中间件。高吞吐量使它在大数据领域具有天然的优势,被广泛用来记录日志 ...
分类:
编程语言 时间:
2020-10-13 17:35:42
阅读次数:
33
分支语句包括if,switch;循环语句包括while,for,dowhile;if,else语句在书写时要注意格式,else总是与相邻的if语句相匹配;switch语句没办法直接实现分支,只能判断选择,需要break实现分支;switch语句允许嵌套使用;循环语句要注意continue,break的用法;continue是结束本次循环,继续执行下一次循环;break是结束整个循环。
分类:
其他好文 时间:
2020-10-13 17:27:53
阅读次数:
20
常用的三种方式: while read linedoecho $linedone < filename(待读取的文件) cat filename(待读取的文件) | while read linedoecho $linedone for line in `cat filename(待读取的文件)`d ...
分类:
系统相关 时间:
2020-10-12 20:17:26
阅读次数:
25
In our last example, we explored the scheduling of 2 factories. Both factories had 2 costs: Fixed Costs - Costs incurred while the factory is running ...
分类:
其他好文 时间:
2020-10-12 20:02:33
阅读次数:
27