摘要: 1.可存在同名对象 class A: def __init__(self): print('this is class.') def A(): print('this is method.') a = A() # this is method. 由于python是边编译边执行的语言,所以只会使用最近 阅读全文
posted @ 2022-10-14 17:07 Bridgebug 阅读(170) 评论(0) 推荐(0)
摘要: 一、创建类 class People: pass p = People() 二、构造函数 __init__()方法是一种特殊的方法,被称为类的构造函数或初始化方法,当创建了这个类的实例时就会调用该方法。 python中一个类只能有一个构造函数,即只能有一个 __init__ 方法(有多个时,最后一个 阅读全文
posted @ 2022-10-14 16:52 Bridgebug 阅读(99) 评论(0) 推荐(0)
摘要: 由于个人不喜欢定义那么多变量,而在wpf的vm中需触发更新的变量都要定义一个字段和属性。 例如: private string _name; public string Name { get { return _name; } set { _name = value; RaisePropertyCh 阅读全文
posted @ 2022-09-13 11:38 Bridgebug 阅读(110) 评论(0) 推荐(0)
摘要: 通常情况下,是将C#代码共享到python脚本中,可以通过脚本调用C#的各个对象。 一、IronPythonRunner 创建IronPython运行器,可通过该运行器运行python脚本。 using System; using System.Collections.Generic; using 阅读全文
posted @ 2022-08-24 15:09 Bridgebug 阅读(357) 评论(0) 推荐(0)
摘要: 假如有脚本 test1.py def get(): return 'this is test1' 在脚本 test2.py 中调用 test1.py 的 get 方法 1.用全名访问 import test1 print(test1.get()) 2.用别名访问 import test1 as t1 阅读全文
posted @ 2022-07-28 15:31 Bridgebug 阅读(141) 评论(0) 推荐(0)
摘要: 创建SyncingClass类,继承与ContextBoundObject,并标记Synchronization特性; 需实现上下文同步的实例必须继承ContextBoundObject和标记Synchronization特性; using System; using System.Threadin 阅读全文
posted @ 2022-06-22 10:32 Bridgebug 阅读(185) 评论(0) 推荐(0)
摘要: FOR FOR %%variable IN (set) DO command [command-parameters] %variable 指定一个单一字母可替换的参数。 (set) 指定一个或一组文件。可以使用通配符。 command 指定对每个文件执行的命令。 command-parameter 阅读全文
posted @ 2022-04-16 01:16 Bridgebug 阅读(697) 评论(0) 推荐(0)
摘要: 批处理是一种简化的脚本语言,也称作宏。它应用于DOS和Windows系统中,它是由DOS或者Windows系统内嵌的命令解释器(通常是COMMAND. COM或者CMD.EXE)解释运行。类似于Unix中的Shell脚本。批处理文件具有.bat或者.cmd的扩展名。批处理语法中是不区分大小写。 RE 阅读全文
posted @ 2022-04-13 22:17 Bridgebug 阅读(277) 评论(0) 推荐(0)
摘要: ANSI_NULLS (判断Null) SET ANSI_NULLS ON | OFF (默认为ON) 注释:指定在与 Null 值一起使用等于 (=) 和不等于 (<>) 比较运算符时采用符合 ISO 标准的行为。 例:列 [Name] 存在 null 值,若设置为 ON,当筛选 where [N 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(77) 评论(0) 推荐(0)
摘要: ConcurrentBag 集合 表示对象的线程安全的无序集合。 static void Main(string[] args) { ConcurrentBag<int> thList = new ConcurrentBag<int>(); Parallel.For(0, 100000, a => 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(3140) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Linq.Expressions; namespace ConsoleApp { class Prog 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(122) 评论(0) 推荐(0)
摘要: CSS 有几个不同的单位用于表示长度: 一些设置 CSS 长度的属性有 width, margin, padding, font-size, border-width, 等。长度有一个数字和单位组成如 10px, 2em, 等。数字与单位之间不能出现空格。如果长度值为 0,则可以省略单位。对于一些 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(82) 评论(0) 推荐(0)
摘要: margin 设置元素的外边距。 margin简写属性在一个声明中设置所有外边距属性。该属性可以有1到4个值。 margin: 5px; 使用一个值,这个值就会应用于全部四个边。 margin: 5px 9px; 使用两个值,则前一个值会应用于上下两边,后一个值会应用于左右两边。 margin: 5 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(323) 评论(0) 推荐(0)
摘要: 元素的显示类型 块级元素:元素显示在单独的行(如 h1 ~ h6、 p 等)行内元素/内联元素:元素显示在行内(如 em、 strong、 cite 等) 造成这种情况的本质是它们的 display 属性,即块级元素被设置为 display: block(对于 li 元素为 display: lis 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(195) 评论(0) 推荐(0)
摘要: CSS 处理网页时,它认为每个元素都包含在一个不可见的盒子里。这就是众所周知的盒模型,这里的盒子由内容区域、内容区域周围的空间(内边距(padding))、内边距的外边缘(边框(border))和边框外面将元素与相邻元素隔开的不可见区域(外边距(margin))构成,参见下图。这类似于挂在墙上的带框 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(75) 评论(0) 推荐(0)
摘要: background (背景) 值说明CSSbackground-color指定要使用的背景颜色1background-position指定背景图片的位置1background-size指定背景图片的大小3background-repeat指定如何重复背景图片1background-origin指定 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(69) 评论(0) 推荐(0)
摘要: 目录 element,element element1 element2 .class1.class2 element.class element1>element2 element1+element2 [attribute] element[attribute] [attribute=value] 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(59) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style> p { background-color: yellow !important; } /*1.!important 优先级最高*/ #p1 { 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(146) 评论(0) 推荐(0)
摘要: 选择器示例示例说明CSS版本.class.intro选择所有class="intro"的元素1#id#firstname选择所有id="firstname"的元素1**选择所有元素2elementp选择所有<p>元素1element,elementdiv,p选择所有<div>元素和<p>元素1ele 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(57) 评论(0) 推荐(0)
摘要: 样式表中的每条规则都有两个主要部分:选 择 器(selector) 和 声 明 块(declarationblock)。 选择器:决定哪些元素受到影响;声明块:由一个或多个属性 - 值对(每个属性 -值对构成一条声明, declaration)组成 样式规则由选择器(表示将对哪些元素进行格式化)和声 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(90) 评论(0) 推荐(0)
摘要: 一、触发器的概念 SQL Server提供两种主要机制来强制使用业务规则和数据完整性,即约束和触发器。 触发器是一种特殊类型的存储过程,当指定表中的数据发生变化时触发器自动生效。它与表紧密相连,可以看作是表定义的一部分。触发器不能通过名称被直接调用,更不允许设置参数。 在 SQL Server中一张 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(545) 评论(0) 推荐(0)
摘要: HTML DOM (文档对象模型) 当网页被加载时,浏览器会创建页面的文档对象模型(Document Object Model)。通过 HTML DOM,可访问 JavaScript HTML 文档的所有元素。 一、查找 HTML 元素 1.通过id查找 <!DOCTYPE html> <html> 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(40) 评论(0) 推荐(0)
摘要: function add() { var counter = 0; return counter += 1; } add(); add(); var x = add(); //结果为1 每次调用add函数都将counter清零了 var add = (function () { var counte 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(52) 评论(0) 推荐(0)
摘要: 1.构造函数 什么是构造函数:在 JavaScript 中,用 new 关键字来调用的函数,称为构造函数。 它的作用:重复需要使用的属性当做构造函数的参数传递,可以减少大量的重复操作过程。 在使用时,若是new忘记使用,会产生严重的后果。会导致构造函数内部变量变为全局变量。避免的方法,在构造函数内部 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(113) 评论(0) 推荐(0)
摘要: 一、Thread (System.Threading) 1.前台线程和后台线程 只要有一个前台线程在运行,应用程序的进程就在运行,直到所有前台线程完成其任务为止。在默认情况下,用 Thread类创建的线程是前台线程。线程池中的线程总是后台线程。在用 Thread类创建线程时,可以设置 IsBackg 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(400) 评论(0) 推荐(0)