ICode9

精准搜索请尝试: 精确搜索
  • vue3 使用动态组件component2022-03-31 15:31:16

    <template> <div @click="change">自由浏览</div> <component :is="CurrentCompoent[current]" ></component> </template> import { defineAsyncComponent, markRaw, reactive, ref } from 'vue&

  • kernel源码(十五)sys.c2022-03-30 23:35:44

    该源码包含了很多系统调用的函数实现 源码 /* * linux/kernel/sys.c * * (C) 1991 Linus Torvalds */ #include <errno.h> #include <linux/sched.h> #include <linux/tty.h> #include <linux/kernel.h> #include <asm/segment.h> #include <sys/tim

  • 全屏轮播2022-03-29 09:02:46

    现在我们要做的全屏轮播点击按钮切换下一个图片创建一个HTML写入每页的内容 <div class="slider"> <div class="slide"> <div class="content"> <h1>第一页</h1> <p>Lorem ipsum dolor sit amet consectetur adipis

  • leetcode 407 接雨水2022-03-28 01:02:35

    三维空间的接雨水 有一点像dijkstar最短路径搜索。 所谓dijkstar, 是有一个closeset的,closeset表明的是已经确定距离的位置。 初始位置是closeset,每次都取与closeset相邻的最近的点放入到closet中。 相邻的点用一个最小堆来维护。 这道题也是一样, 初始的closeset是周围一圈,因为周围

  • kernel源码(十四)exit.c2022-03-27 02:32:26

    该源码主要实现进程退出或终止的相关功能 源码 /* * linux/kernel/exit.c * * (C) 1991 Linus Torvalds */ #include <errno.h> #include <signal.h> #include <sys/wait.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/tty.

  • C语言中的链表2022-03-25 15:00:56

    一、引子      我们前面讲数组的时候,提到了创建数组的三种方法,一种是创建静态数组,一个是创建动态数组,以及使用malloc创建动态数组。然后我们可能会有一个场景,就是我们并不知道我们实际需要多大的内存,我们需要可以不确定的添加数据,这个时候,我们可能回想,这个无所谓的,直接malloc

  • 自定义hooks实现在useState改变值之后立刻获取到最新的值2022-03-25 09:33:11

    自定义hooks实现在useState改变值之后立刻获取到最新的值 import React from 'react'function App () {  let [count, setCount] = React.useState(0)​  const add = () => {    setCount(count + 1)    console.log(count) }​  return (​    <div>      <h1>{c

  • 坐标系2022-03-21 20:31:13

    Understand the UCS in 3D When you create or modify objects in a 3D environment, you can move and reorient the UCS anywhere in 3D space to simplify your work. The UCS is useful for entering coordinates, creating 3D objects on 2D work planes, and rotating o

  • 【SSM】The origin server did not find a current representation for the target2022-03-20 09:59:39

    The origin server did not find a current representation for the target 在启动项目时,出现了下面的错误 The origin server did not find a current representation for the target 可能原因:没有配置好webapp 下面的是所在webapp下的xml文件 这个配置精确到webapp目录

  • React中的Ref2022-03-09 12:32:20

      React中ref是一个对象,它有一个current属性,可以对这个属性进行操作,用于获取DOM元素和保存变化的值。什么是保存变化的值?就是在组件中,你想保存与组件渲染无关的值,就是JSX中用不到的或不显示到页面,让用户看到的值,比如setTimeout的返回的ID,就可以把这个值放到ref中。为什么要放到r

  • Django的分页器2022-03-08 17:01:49

    批量插入数据    def ab_pl(request): # 先给Book插入一万条数据 # for i in range(10000): # models.Book.objects.create(title='第%s本书'%i) # # 再将所有的数据查询并展示到前端页面 book_queryset = models.Book.objects.all() # 批量插入

  • Django批量插入(自定义分页器)2022-03-06 23:03:11

    目录一:批量插入1.常规批量插入数据(时间长,效率低 不建议使用)2.使用orm提供的bulk_create方法批量插入数据(效率高 减少操作时间)3.总结二:自定义分页器1.自定义分页器简介2.分页推导3.自定义分页(依靠索引切片 不能动态解析)4.html三:自定义分页器(通过代码动态的计算出到底需要

  • 解决vue-router报NavigationDuplicated: Avoided redundant navigation to current location 的问题2022-03-04 23:00:07

    场景:在 App.vue文件中通过watch全局监听本地中是否有 token,若没有,则跳转到登录页;若有,则return。 1 app.vue代码 2 3 watch: { 4 $route() { 5 if (!localStorage.getItem("token")) { 6 this.$router.push("/login"); 7 } else { 8 ret

  • react封装echarts仪表盘2022-03-04 11:03:36

    1、仪表盘组件   GaugeChart/index.tsx(组件中的nightFlag是适配黑夜模式,获取公共状态中的值) import React, { useEffect, useRef } from 'react' import styles from './index.less' import { connect } from 'umi' import { ConnectState } from '@/models/conn

  • ThreadInfo结构和内核栈的两种关系【转】2022-03-02 02:32:59

    转自:https://blog.csdn.net/longwang155069/article/details/104346778 本来本节是要学习内核启动的第一个进程的建立,也就是0号进程,也称idle进程,也称swapper进程。但是在学习第一个进程建立之前需要先学习threadinfo和内核栈的关系。 目前内核存在两种threadinfo和内核的关系,接下

  • 王道机试指南第11章---图论---11.3最小生成树2022-03-01 21:33:59

    11.3最小生成树 Kruskal—O(ElogE) #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int MAXN=100; struct Edge{ int from; int to; int length; // bool operator<(const Edge& e)const{ //??????????????未懂

  • Linux脚本md5校验多台服务器数据一致性2022-03-01 09:03:23

    #!/bin/bash ##################################### #检测两台服务器指定目录下的文件一致性 ##################################### #通过对比两台服务器上文件的md5值,达到检测一致性的目的 # 服务器需要校验的目录 current_dir=/data/tomcat # 远端服务器ip地址 des_ip=

  • 034.代码回滚 reset current branch to here2022-02-28 22:31:49

                                     

  • 【Tokio】单线程运行时2022-02-27 22:00:42

    环境 Time 2022-01-11 Rust 1.57.0 Tokio 1.15.0 概念 参考:https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html 除了可以使用线程池运行时,还可以直接在当前线程运行任务,使用单线程。 示例 main.rs use std::{io, thread, time::Duration}; use tokio::runtime::B

  • mysql update2022-02-27 13:00:25

           CURRENT_TIME:数据库当前日期时间 【狂神说】

  • 第4章——函数2022-02-25 00:00:59

    第4章——函数 1.什么是函数 1.1函数的基本概念 一个程序由一个个任务组成;函数就是代表一个任务或者一个功能。函数是代码复用的通用机制。 1.2函数的定义和调用 Python 中,定义函数的语法如下:值得注意的是 def 函数名 ([参数列表]) : '''文档字符串''' 函数体/若干语句 #

  • Redis实现访问次数限流,这有难点吗?2022-02-23 23:01:42

    大家好,我是【架构摆渡人】,一只十年的程序猿,这是流量治理系列的第11篇原创文章,如果有收获,还请分享给更多的朋友。 假设我们要做一个业务需求,这个需求就是限制用户的访问频次。比如1分钟内只能访问20次,10分钟内只能访问200次。因为是用户维度的场景,性能肯定是要首先考虑,那么适合这个

  • React Hooks TS 长按点击事件2022-02-22 18:02:54

    当前需要事件文件夹下创建 LongPress.tsx 文件; import { useCallback, useRef, useState } from "react"; /** * * @param onLongPress 长按事件 * @param onClick 点击事件 * @param stopLongPress 长按事件结束状态 * @param param2 * @returns */ const useLong

  • C#接口IEnumerator(迭代器)原理演示2022-02-22 11:02:35

    int[] myArray = new int[] { 1, 2, 3, 4 }; IEnumerator enumerator = myArray.GetEnumerator();//获取迭代器 while (enumerator.MoveNext())//指向下一个,有值返回true,没有值返回false { Console.WriteLine(enumerator.Current);//当前值 } enumerator.Reset();//迭代器复

  • Windows 10操作系统启用照片查看器2022-02-21 18:02:14

    Windows Registry Editor Version 5.00 ; Change Extension's File Type [HKEY_CURRENT_USERSoftwareClasses.jpg] @=PhotoViewer.FileAssoc.Tiff ; Change Extension's File Type [HKEY_CURRENT_USERSoftwareClasses.jpeg] @=PhotoViewer.FileAssoc.Tiff ; Change

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

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

ICode9版权所有