Table of Contents 1. Get Current Thread Information 2. Manage Thread States 2.1 Starting and Passing Parameters 2.1.1 ParameterizedThreadStart 2.1.2 Using Static Variables or Class Member Variables 2.1.3 Delegates and Lambda 2.2 Pause and Block 2.3 Thread Stat…

2020年4月15日 0条评论 4827点热度 3人点赞 痴者工良 阅读全文

目录 1,获取当前线程信息 2,管理线程状态 2.1 启动与参数传递 2.1.1 ParameterizedThreadStart 2.1.2 使用静态变量或类成员变量 2.1.3 委托与Lambda 2.2 暂停与阻塞 2.3 线程状态 2.4 终止 2.5 线程的不确定性 2.6 线程优先级、前台线程和后台线程 2.7 自旋和休眠 本篇是《多线程入门和实践(初级)》的第一篇,也是大家相当熟悉和不屑的的最简单的入门部分。作为系列文章,笔者将从最简单的部分开始,与各位伙伴一起不断学习和探究 C# 中的多线程。 对于…

2020年4月15日 0条评论 4885点热度 3人点赞 痴者工良 阅读全文

Tip: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111. Tip: If the algorithm to be processed is relatively simple, you can write it directly into …

2020年4月12日 0条评论 3126点热度 0人点赞 痴者工良 阅读全文

文章内容有知识点提示时: 提示:111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111。 提示:如果需要处理的算法比较简单的话,可以直接写进委托中,不需要另外写方法啦。 提示: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx…

2020年4月12日 0条评论 3882点热度 0人点赞 痴者工良 阅读全文

Reimage Repair is a very powerful tool that can diagnose system issues and repair the system. It can easily fix various errors encountered during Windows 10 updates. Open cmd with administrator privileges and enter SFC/scannow to scan the system. You can use d…

2020年4月4日 0条评论 1098点热度 5人点赞 痴者工良 阅读全文

Reimage Repair 是一个非常强大的工具,能够诊断系统问题,修复系统。 对于 windows 10 更新时碰到的各种错误,使用此软件可以很容易地修复系统。 以管理员权限打开cmd,输入 SFC/scannow 也可以扫描系统。 使用 dism /online /cleanup-image /restorehealth 可以修复系统。 [......] 继续阅读

2020年4月4日 0条评论 7437点热度 5人点赞 痴者工良 阅读全文

[5 Minutes] Rookie Study on Design Patterns: Six Design Principles [TOC] As a rookie, the author will attempt to explain the characteristics and application scenarios of these principles in simple code and easy-to-understand language. The six principles are th…

2020年4月4日 0条评论 1328点热度 1人点赞 痴者工良 阅读全文

[5分钟]菜鸟修研之设计模式:六大设计原则 [TOC] 笔者作为一个菜鸟,会尝试以简单的代码和容易理解的语句去解释这几种原则的特性和应用场景。 这六种原则分别为单一职责原则、接口隔离原则、里氏替换原则、迪米特法则、依赖倒置原则、开闭原则。 单一职责原则 单一职责原则(SRP:Single responsibility principle),规定一个类中应该只有一个原因引起类的变化。 单一职责原则的核心就是解耦和增强内聚性。 问题: // 假设此类是数据库上下文 public class DatabaseContex…

2020年4月4日 0条评论 4136点热度 2人点赞 痴者工良 阅读全文

readonly string ganweiCosr = "AllowSpecificOrigins"; Startup.ConfigureServices 中,添加服务 #if CORS services.AddCors(options => { options.AddPolicy(ganweiCosr, builder => builder.AllowAnyHeader() .AllowAnyMet[......]继续阅读

2020年4月3日 0条评论 7128点热度 7人点赞 痴者工良 阅读全文

Startup 中,添加一个变量 readonly string ganweiCosr = "AllowSpecificOrigins"; Startup.ConfigureServices 中,添加服务 #if CORS services.AddCors(options => { options.AddPolicy(ganweiCosr, builder => builder.AllowAnyHeader()[......]继续阅读

2020年4月3日 0条评论 7030点热度 7人点赞 痴者工良 阅读全文

Create a static class to inject Dapper services. /// <summary> /// Inject Dapper /// </summary> public static class DapperService { /// <summary> /// Inject Dapper /// </summary> public static IServiceCollection AddDapperCon[......]继续阅读

2020年4月3日 0条评论 1304点热度 6人点赞 痴者工良 阅读全文

新建一个静态类吗,注入 dapper 服务。 /// <summary> /// 注入dapper /// </summary> public static class DapperService { /// <summary> /// 注入dapper /// </summary> public static IServiceCollection AddDapperContext(this IServiceCollection service[......]继续阅读

2020年4月3日 0条评论 6247点热度 6人点赞 痴者工良 阅读全文

可以在容器中执行命令,查看到信息 /egrep '^1:.+(docker|lxc|kubepods)' /proc/1/cgroup 那么我们可以通过读取文件的方法,去分析是否在容器中运行。 代码如下 /// <summary> /// 是否在容器中运行 /// </summary> /// <returns></returns> private static async Task<bool> IsRunAtD[......]继续阅读

2020年4月1日 0条评论 4572点热度 0人点赞 痴者工良 阅读全文

可以在容器中执行命令,查看到信息 /egrep '^1:.+(docker|lxc|kubepods)' /proc/1/cgroup 那么我们可以通过读取文件的方法,去分析是否在容器中运行。 代码如下 /// <summary> /// 是否在容器中运行 /// </summary> /// <returns></returns> private static async Task<bool>[......]继续阅读

2020年4月1日 0条评论 5286点热度 0人点赞 痴者工良 阅读全文

SQLite does not actually delete data; instead, it moves the data to free pages. This can cause the database size to increase over time. The vacuum command copies the contents of the main database into a temporary database file, then clears the main database an…

2020年4月1日 0条评论 1234点热度 4人点赞 痴者工良 阅读全文

SQLite 删除数据不会真正删除,而是移动到空闲页中。这样会导致体积越来越大。 vacuum 命令通过复制主数据库中的内容到一个临时数据库文件,然后清空主数据库,并从副本中重新载入原始的数据库文件。这消除了空闲页,把表中的数据排列为连续的,另外会清理数据库文件结构。 意思是,体积太大,就执行 vacuum 命令(SQL)命令,这样就可以清楚缓存,整理碎片。 https://www.runoob.com/sqlite/sqlite-vacuum.html [......] 继续阅读

2020年4月1日 0条评论 4884点热度 4人点赞 痴者工良 阅读全文

1. Knowledge Scope Basics of Java Language Operations and Statements Basics of Object-Oriented Programming Arrays and Strings Graphical User Interface (GUI) Graphics and Multimedia Multithreading Input and Output Streams Network and Database Programming Among …

2020年3月29日 0条评论 1076点热度 0人点赞 痴者工良 阅读全文

1,知识范围 Java 语言基础 运算和语句 面向对象编程基础 数组和字符串 图像界面(GUI) 图形图像多媒体 多线程 输出输入流 网络和数据库编程 这些知识中,GUI、和图像、多线程、输出输入流、网络数据库,时间较紧的情况下,没那么多时间学习(不想学Java)。 一张试卷 100 分,60 及格,75 良好。 那么,要求达到 75 分,需要在合理时间内大概学习浏览一下 Java 的知识。 2,考试题型和分值 题序 题型 总分值 单题分值 题数 一 选择 10 1 10 二 填空 20 2 10 三 简答题 20…

2020年3月29日 0条评论 4192点热度 0人点赞 痴者工良 阅读全文

The previous article mainly focused on basic syntax, while this one focuses on GUI-related topics. GUI is very old, and I wouldn't learn it if it weren't for exams. 1. What models are used to detect and respond to events in the java.awt.event package? Answer: …

2020年3月28日 0条评论 4066点热度 0人点赞 痴者工良 阅读全文

上一篇主要是基础语法,这一篇主要是 GUI 方面的题目。 GUI 非常老啦,如果不是为了考试,才不学这个。 1,在 java.awt.event 包中用来检测并对事件做出反应的模型有哪些? 答:源对象(Source)、监视器对象(Eventlistener)、事件对象(EventObject) 监视器对象 -> 注册监视某动作 -> 源对象动作触发事件 -> 产生信息(事件对象) -> 传递 模型中不包含事件方法。 2,Java 中, JPanel 是一种通用容器,它的默认布局为 FlowL…

2020年3月28日 0条评论 4048点热度 0人点赞 痴者工良 阅读全文
1333435363754