Optional of 与 ofNullable 的区别 /** * Returns an {@code Optional} with the specified present non-null value. * * @param <T> the class of the value * @par ...
分类:
其他好文 时间:
2020-07-30 14:39:39
阅读次数:
64
贪吃蛇小游戏 pycharm——pygame game.py import pygame # 导包 from game_items import * # 导类和变量 class Game(object): # 这里的object类,意为顶级/基础类。 def __init__(self): self ...
分类:
编程语言 时间:
2020-07-30 14:24:28
阅读次数:
72
(1)无边框窗口的拖动事件 新建一个MenuStrip,然后注册其MouseMove与MouseDown事件 private Point formPoint = new Point(); public MainForm() { InitializeComponent(); } private voi ...
//面向对象开发//创建方格var sw=20, //小方格的宽 sh=20, //小方格的高 tr=30, //行数 td=30; //列数//蛇的实例 var snake = null,//食物的实例 food=null,//游戏的实例 game=null;// 构造函数// x 横坐标 y 纵 ...
分类:
Web程序 时间:
2020-07-29 21:42:16
阅读次数:
78
struct point{ double x, y; }; struct line{ double A, B, C;//Ax + By + C = 0; }; line PPL(point a, point b){// 两点确定直线的一般式 if(a.x == b.x) return line{1, ...
分类:
其他好文 时间:
2020-07-29 17:50:20
阅读次数:
62
1、居中弹出 $k.alert({content:'居中弹出'}); 查看效果 2、左上角弹出 $k.alert({ content:'左上角弹出', style:{left:0,top:0} }); 查看效果 3、右下角弹出 $k.alert({ content:'右上角弹出', style:{l ...
分类:
其他好文 时间:
2020-07-29 15:28:39
阅读次数:
95
Arrays类 基本概念: 该类包含用于操作数组的各种方法(如排序和搜索)。 Arryas类中的对象都是用static修饰的静态方法,在使用的时候可以直接用类名调用,而**"不用"使用对象来调用**(注意:是“不用”而不是“不能”) 如果指定的数组引用为空,则该类中的方法都抛出一个NullPoint ...
分类:
其他好文 时间:
2020-07-29 12:39:19
阅读次数:
66
Camera有一个targetTexture属性,在设置了targetTexture后,Camera会在渲染时将其屏幕上的图像渲染到targetTexture上,可以使用快照实现镜头切换等特效 具体实现: private Texture2D CaptureCamera(Camera camera, ...
分类:
其他好文 时间:
2020-07-28 16:55:29
阅读次数:
65
题目 Description Alice和Bob在玩一个游戏。有n个石子在这里,Alice和Bob轮流投掷硬币,如果正面朝上,则从n个石子中取出一个石子,否则不做任何事。取到最后一颗石子的人胜利。Alice在投掷硬币时有p的概率投掷出他想投的一面,同样,Bob有q的概率投掷出他相投的一面。 现在Al ...
分类:
其他好文 时间:
2020-07-28 00:25:32
阅读次数:
75
1 短信接口频率限制 # throttlings.py from rest_framework.throttling import SimpleRateThrottle class SMSThrotting(SimpleRateThrottle): scope = 'sms' def get_cac ...
分类:
其他好文 时间:
2020-07-27 17:46:17
阅读次数:
100