ICode9

精准搜索请尝试: 精确搜索
  • 智能指针2021-09-01 10:01:58

    #include <iostream> using namespace std; template<class T> class SmartPtr{ public: explicit SmartPtr():ptr(nullptr), count(new int(0)){} explicit SmartPtr(T* p):ptr(p), count(new int(0)){ *count = 1; } ~SmartPtr(){

  • 操作系统课程设计 —— 银行家算法2021-08-30 09:04:02

    talk is easy, show the code import Process.MaxResource.aMax import Process.MaxResource.bMax import Process.MaxResource.cMax import Process.MaxResource.dMax /** * 进程对象 * @property name String 进程名 * @property max Resource 该进程声明的最大所需资源 *

  • 智能指针 shared_ptr 简易实现2021-08-29 22:02:58

    template <typename T> class shared_ptr { private: int* count; // 引用计数,不同shared_ptr指向同一引用计数 T* ptr; // 模板指针ptr,不同shared_ptr指向同一对象 public: // 构造函数 shared_ptr(T* p) : count(new int(1)), ptr(p) {} // 复制构造函

  • Linux SCHED_FIFO, SCHED_RR和SCHED_OTHER2021-08-25 11:05:41

    SCHED_FIFO: 先进先出调度在先进先出的调度方式下,一个线程直到它被更高优先级的线程抢占或者运行结束,才会交出控制权。相同优先级的任务不能打断该线程。当线程完成后,内核会去寻找处于就绪状态相同优先级的线程,如果不存在, 则寻找低优先级线程。FIFO调度本身实现了数据的互斥,

  • c primer plus 7编程练习2021-08-23 01:02:57

        1、 #include <stdio.h> #include <ctype.h> int main(void) { char ch; int n_space = 0, n_lines = 0, n_other = 0; while((ch = getchar()) != '#') { if(ch == ' ') n_space++;

  • Comparable接口compareTo方法理解2021-08-22 16:02:21

    TreeSet可以将我们存进去的数据进行排序,默认存入的对象必须实现Comparable接口重写compareTo(Object o)方法,compareTo方法用于书写排序规则: 返回值为int,其中返回值大于0会交换两数位置。为了更好地区别,用返回1表示交换位置,返回0表示两数相等不交换位置,返回-1表示不交换位置。 理

  • java系统内部 返回结果封装类2021-08-19 09:31:32

    public class BaseResponse implements Serializable { public static int RESP_CODE_OK = 200; protected boolean success; protected int code; protected String msg; protected String redirectUrl; public BaseResponse() { } public

  • 升级vue3注意事项记录 vue3都需要升级些什么2021-08-15 17:02:55

    sass语法的使用 控制台报错:Syntax Error: TypeError: this.getOptions is not a function 原因:版本问题,sass-loader的版本过新,安装10.1.1版本即可解决; 路由跳转问题 路由不跳转: 原因:App.vue中别忘了加上 <router-view></router-view> //router: index.js import { createRoute

  • 常用类使用2021-08-08 13:03:07

    常用类使用 1.构造字符串(StringBuilder) 有些时候,需要由较短的字符串构建字符串,例如:按键或来自文件中的单词 需要用许多小段的字符串来构建一个字符串 public class Demo { public static void main(String[] args) { StringBuilder builder = new StringBuilder

  • C++——04数组指针字符串2021-08-07 10:00:55

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 一、数组1.排序 二、指针1.函数指针2.lamda表达式 三、动态分配内存1.malloc与new区别2.delete与free区别 四、动态分配内存1.深复制与浅复制 一、数组 在c++标准库中对数组进行封装,得到了一个类

  • Unity废柴看过来,手把手教你做植物大战僵尸(七)—— 僵尸吃植物2021-08-04 15:33:29

    上一篇我们做好了植物攻击僵尸的功能,但是僵尸是不会袭击植物的,这一篇我们就制作让僵尸吃植物。 一、给植物添加触发器 二、在僵尸脚本中监听触发,如果触发到植物,就播放吃的动画,并不再往前走 private void OnTriggerEnter(Collider other) { if (other.tag

  • 2019下半年2021-07-31 21:30:03

    2019下半年 题目 You are developing a server-side enterprise application .It must support a variety of different clients including desktop browsers, mobile browsers and native mobile applications .The application might also expose an API for 3rd parties t

  • python魔术方法2021-07-30 17:34:59

      魔术方法     魔法方法(Magic Method)是python内置方法,格式为:"__方法名__",不需要主动调用,存在的目的是为了给python的解释器进行调用,几乎每个魔法方法都有一个对应的内置函数,或者运算符,当我们对这个对象使用这些函数或者运算符时就会调用类中的对应魔法方法,可以理解为重写

  • 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型2021-07-29 01:35:17

    再用MyBatis操作Oracle的时候,传入null值而引发的错误 异常信息: org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #6 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull confi

  • C++一些例子2021-07-24 15:01:11

    虚析构 #include<iostream> class Base { public: Base() { std::cout << "base 构造" << std::endl; } virtual~Base() { std::cout << "base 析构" << std::endl; } }; class Derived : public Base { public: Derived() {

  • C++一些例子2021-07-24 14:58:49

    虚析构 #include<iostream> class Base { public: Base() { std::cout << "base 构造" << std::endl; } virtual~Base() { std::cout << "base 析构" << std::endl; } }; class Derived : public Base { public: Derived() {

  • 利用Flurl.Http库,在PHP实现的接口中参数数组的传递2021-07-21 08:32:44

    在实际开发过程中我们发现,PHP实现的后台接口,需要数组参数时,C#中直接传递数组或集合,PHP皆不正确接收。在Post接口中传递数组需要采用以下方式传递。   1 /// <summary> 2 ///php写的后台接口传递数组参数时需要单独处理,不能直接用List<object> 3 /// UrlEncoded 数组参数的传

  • C++20中的jthread和stop_token2021-07-18 14:35:13

    C++20中的jthread和stop_token 前言 C++20中引入了jthread类,相关介绍如下: The class jthread represents a single thread of execution. It has the same general behavior as std::thread, except that jthread automatically rejoins on destruction, and can be cancelled/st

  • python 字符串 1.2 编写程序判断一个从键盘输入的字符串包含的字母、数字字符和其它字符的个数2021-07-17 23:59:32

    题目: 编写程序判断一个从键盘输入的字符串包含的字母、数字字符和其它字符的个数程序分析: 遍历字符串,在遍历字符串时,判断该字符是什么类型的字符 代码: letter = 0 num = 0 other = 0 str0 = input('请输入一段字符串:') for i in str0: if i.isalpha(): letter += 1

  • ltp词性标注2021-07-14 22:59:11

    a adjective:形容词 美丽 b other noun-modifier:其他的修饰名词 大型, 西式 c conjunction:连词 和, 虽然 d adverb:副词 很 e exclamation:感叹词

  • eclipse跳转后中文乱码问题2021-07-13 17:01:32

    1.右击项目,选择Properties→Resource→Text file Encoding选择Other–UTF-8 2.最上面菜单栏Window→Preferences→General→Workspace→Text file Encoding选择Other–UTF-8 3.检查Servlet中doGet方法是否设置正确的编码方式 4.检查html等编码方式

  • Qt:QDateTime2021-07-11 12:04:09

    0、说明 提供时间日期的表达和相关函数。 QDateTime通过日期+时间来构造一个日期时间。它综合了QDate和QTime的所有特性。 它可以通过系统时钟来获取当前DateTime。它还提供了比较时间的方法和对时间进行加减运算的方法。 QDateTime可以分别通过本地时间、UTC、UTC偏移时间、指定

  • 《C/C++ 面试 100 例》(十二)矩阵乘法硬件加速2021-07-06 09:55:02

      文章目录 一、矩阵乘法定义 二、矩阵类封装 三、矩阵乘法实现 1、 i j k ijk ijk 式 2、 i k j ikj ikj 式 3、 k i j kij kij 式 四、时间测试 五、原理分析 六、最后结论   一、矩阵乘法定义 矩阵 A x × y A_{x \times y} Ax×y​ 和 矩阵 B u × v B_{u \times v}

  • Vim Tab to Space and other configurations2021-06-26 13:34:26

    "TAB"空格代替Tab""注意: 插入模式下输入【ctrl+v+i】可以强制输入一个tabset tabstop=4 " tabstop 表示一个 tab 显示出来是多少个空格的长度,默认8set softtabstop=4 " softtabstop 表示在编辑模式的时候按退格键的时候退回缩进的长度,当使用 expandtab 时特别有用set expandt

  • 下载旧版本的jetbranis系列工具的方法2021-06-20 15:54:01

    有些时候我们并不想要下载最新的jetbranis系列的工具,那么怎么办呢? 请在后面加入/download/other.html 为了方便大家,笔者将全系列的jetbranis工具下载其他版本的链接列举如下: 1.webstorm https://www.jetbrains.com/webstorm/download/other.html 2.idea https://www.jetbrains.

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有