美好的事可不可以发生在我身上? ------ 博客首页
摘要: import threadingnum = 0lock = threading.Lock()def first_threading(): global num for i in range(10000): lock.acquire() num += 1 lock.release()def secon 阅读全文
posted @ 2022-01-04 18:06 Leshol 阅读(37) 评论(0) 推荐(0)
摘要: # 1/深拷贝对不可变里边嵌套了可变的,会先对可变进行空间重新开辟,在对外边儿的不可变也进行空间重新开辟# 1/如果不可变里边嵌套的也是不可变,就不会开辟新空间.# 2/对可变类型,会对任何一层可变类型数据都进行空间重新开辟.# 3/浅拷贝对可变类型数据,只对第一层数据进行空间重新开始开辟# 3/浅 阅读全文
posted @ 2022-01-04 17:16 Leshol 阅读(78) 评论(0) 推荐(0)
摘要: # 1/深拷贝对不可变里边嵌套了可变的,会先对可变进行空间重新开辟,在对外边儿的不可变也进行空间重新开辟# 1/如果不可变里边嵌套的也是不可变,就不会开辟新空间.# 2/对可变类型,会对任何一层可变类型数据都进行空间重新开辟.# 3/浅拷贝对可变类型数据,只对第一层数据进行空间重新开始开辟# 3/浅 阅读全文
posted @ 2022-01-04 17:15 Leshol 阅读(76) 评论(0) 推荐(0)
style="position: fixed; left: 0px; top: 0px; z-index: 2147483647; pointer-events: none;"> var a_idx = 0; jQuery(document).ready(function ($) {undefined $("body").click(function (e) {undefined var a = new Array( "❤富强❤", "❤民主❤", "❤和谐❤", "❤文明❤", "❤自由❤", "❤平等❤", "❤公正❤", "❤法治❤", "❤爱国❤", "❤敬业❤", "❤诚信❤", "❤友善❤", ); var $i = $("").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pageX, y = e.pageY; $i.css({undefined "z-index": 999999999999999999999999999999999999999999999999999999999999999999999, "top": y - 20, "left": x, "position": "absolute", "font-weight": "bold", "color": "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")" }); $("body").append($i); $i.animate({undefined "top": y - 180, "opacity": 0 }, 1500, function () {undefined $i.remove(); }); }); }); (function ($) {undefined $.fn.snow = function (options) {undefined var $flake = $(' documentHeight = $(document).height(), documentWidth = $(document).width(), defaults = {undefined minSize: 10, maxSize: 20, newOn: 1000, flakeColor: "#AFDAEF" /* 此处可以定义雪花颜色,若要白色可以改为#FFFFFF */ }, options = $.extend({}, defaults, options); var interval = setInterval(function () {undefined var startPositionLeft = Math.random() * documentWidth - 100, startOpacity = 0.5 + Math.random(), sizeFlake = options.minSize + Math.random() * options.maxSize, endPositionTop = documentHeight - 200, endPositionLeft = startPositionLeft - 500 + Math.random() * 500, durationFall = documentHeight * 10 + Math.random() * 5000; $flake.clone().appendTo('body').css({undefined left: startPositionLeft, opacity: startOpacity, 'font-size': sizeFlake, color: options.flakeColor }).animate({undefined top: endPositionTop, left: endPositionLeft, opacity: 0.2 }, durationFall, 'linear', function () {undefined $(this).remove() }); }, options.newOn); }; })(jQuery); $(function () {undefined $.fn.snow({undefined minSize: 5, /* 定义雪花最小尺寸 */ maxSize: 50,/* 定义雪花最大尺寸 */ newOn: 300 /* 定义密集程度,数字越小越密集 */ }); });