ICode9

精准搜索请尝试: 精确搜索
  • 小程序实时日志2022-08-08 11:33:57

    最近一直在做小程序,小程序和网页的区别就是   小程序上线后,接口日志什么的用户端都看不到,管理员不配置的话 后台也看不到,这样我就多了很多背锅的机会. 加之最近公司整网络,所以为了少背锅,在小程序中加入了实时日志,增加甩锅机会.总结如下:   首先附上官方文档:  实时日

  • 事件监听2022-08-06 22:00:51

    事件监听 spring中自带EventListener使用 首先了解下事件监听的基本原理,这里使用到的是设计模式中的“’'观察者模式"”模式。 整个的监听过程是通过一个事件触发机制来实现,首先由事件发布者发布事件消息,对应的监听者接收到消息后就处理自己的业务逻辑。 举例说明 A是BCD三人的队

  • 【HarmonyOS】【ARK UI】鸿蒙JS怎么使用Web组件展示网页内容2022-08-05 09:35:41

    ​在我们的日常开发中,经常会遇到加载网页的场景,今天我们来介绍一下如何用web组件展示网页内容。参考网址:https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-components-web-0000001135254399代码实现:config.json "deviceConfig": { "default": {

  • 3.BIO的多发和多收机制2022-08-04 21:34:35

    1.如何实现客户端多次发消息,服务端多次接收的情况呢 1.服务端 /** * 目标:客户端发送消息,服务端接收消息 */ public class Server { public static void main(String[] args) { try { System.out.println("======服务端启动

  • excel导入响应msg内容乱码问题2022-08-04 08:32:53

    【问题】excel导入响应msg内容乱码问题   其他导入没问题 【解决】通过idea配置修改文件编码 【结果】OK  

  • 82.Python unittest模块实现单元测试2022-08-02 16:36:36

    通过上一节《单元测试是什么?》我们对单元测试的概念有了基本的了解,我们知道 Django 的单元测试是基于 Python 的标准库模块 unittest 实现的。所以在本节我们将使用该模块编写测试用例代码,在单元测试过程中必须使用断言。unittest 单元测试框架中的 TestCase 类提供了很多断言方法

  • Solidity0.8 call2022-08-02 12:34:03

    call is a low level function to interact with other contracts. This is the recommended method to use when you're just sending Ether via calling the fallback function. However it is not the recommend way to call existing functions.   // SPDX-License-I

  • 封装微信公众h5调用微信支付2022-08-01 16:37:40

    1、安装 weixin-js-sdk npm install weixin-js-sdk 2、引用 weixin-js-sdk const wx = require('weixin-js-sdk'); 3、结合后台传过来的参数 wx.config({ debug: false, appId: data.appId, timestamp: data.timeStamp, nonceStr: data.nonceStr, signa

  • VUE生命周期2022-08-01 11:04:07

    </!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <script src="./lib/vue-2.4.0.js"></script> <style> </style&

  • SpringBoot+WebSocket在线聊天2022-07-30 00:06:16

    先看一下页面效果,有点简单粗暴!哈哈哈哈哈,别介意. 本文参考:SpringBoot2.0集成WebSocket,实现后台向前端推送信息 新建一个springboot项目 引入相关依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-w

  • Web网页音视频通话之基于sipjs功能扩展2022-07-29 23:34:14

    在上一篇开发基础上,已经实现了音视频通话。本文是在此基础上继续完成以下内容 关闭/开启音频 开启/关闭视频 屏幕共享 开启/关闭音频 javaScript /** * 静音 */ mute() { if (!currentSession) { layer.msg("请先建立视频通话");

  • celery:不同msg的dispatch_logic所对应的参数修改方法比较2022-07-27 21:04:54

    【一】利用celery对‘game_test_S1’和‘game_test_S2’两个服务器执行任务/需求:‘test’ #dispatch:dispatch_submit.pydef get_msg(): msg = 'game_test_S1,game_test_S2' schedule = dict() schedule['name'] = 'HELLO' schedule['instance&#

  • 断言和跳过2022-07-27 19:03:22

      常用的断言规则:   #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time:2022/6/14 22:24 # @Author:Lhtester # @Filename:unitest_01.py import unittest def add(x,y):#功能 return x+y class Add_test(unittest.TestCase):#创建测试用例类要继承unittest.TestCas

  • Linux下进程间通信 之 共享内存同步方法(互斥锁,信号量 和 信号)2022-07-27 15:03:05

    同步(synchronization)指的是多个任务(线程)按照约定的顺序相互配合完成一件事情。由于多 个进程共享一段内存,因此也需要依靠某种同步机制,如互斥锁和信号量等 。 信号量(semaphore),它是不同进程间或一个给定进程内部不同线程间同步的机制。信号量包 括:posix有名信号量、 posix基于

  • netty系列之:自定义编码解码器2022-07-27 14:31:34

    目录 简介 自定义编码器 自定义解码器 添加编码解码器到pipeline 计算2的N次方 总结 简介 在之前的netty系列文章中,我们讲到了如何将对象或者String转换成为ByteBuf,通过使用netty自带的encoder和decoder可以实现非常方便的对象和ByteBuf之间的转换,然后就可以向channel中随意写入

  • java自定义的异常类2022-07-26 12:05:11

    java自定义的异常类     1、自定义异常类,需要继承 RuntimeException @Datapublic class EmployeeCheckException extends RuntimeException{ private int code; private String msg; public EmployeeCheckException(String msg, int code) { this.code = co

  • MYSQL8存储过程生成日历表以及异常处理2022-07-21 23:14:10

    一、环境 数据库:mysql8.0.25 社区版 操作系统:windows 11 ------------------------------------ 二、创建日历表 CREATE TABLE `sys_calendar` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `day_date` datetime DEFAULT NULL, `year_num` int DEFAULT NULL, `month_nu

  • React父子组件传值2022-07-20 15:33:21

    一、父组件向子组件传值 1.父组件中定义要传的值 import React, { Component } from "react" import "./assets/css/app.css" // 引入组件A import ComentA from "./components/ComentA" class App extends Component { constructor(props) { super(props)

  • python基础 -- tcp、udp模式2022-07-20 09:02:58

    # tcp 协议服务端 import socket sk = socket.socket() #创建socket对象 sk.bind(('127.0.0.1', 8889)) #绑定socket的ip和端口 sk.listen(5) #设置socket对象的监听数量 conn, info = sk.accept() #socket开始监听连接,一直到有请求连接,这

  • ROS创建自定义消息(1)普通消息2022-07-19 12:02:55

    message_generation功能包是用于生成C++或Python能使用的代码。 message_runtime则是提供运行时的支持。 消息类型与C++或者Python的数据类型对应关系如下表: 自定义消息 在功能包中新建一个文件夹,名字为msg,这很重要,若非特别想要,尽量不要修改这个文件夹的名字。 在msg文件夹

  • [go-websocket 搭建一对一,一对多的聊天室] 第二篇:websocket间的通信2022-07-18 23:31:44

    源码地址 https://gitee.com/bin-0821/chat-room-demo-go-websocket 关于websocket,上一篇文章讲述了如何通过websocket进行服务端与客户端的通信,本篇将会带领大家把各个websocket进行相互通信,在开始之前,请确保有理解 1 go的通道 2 go的线程 3 gin基础 事实上,websocket与websocke

  • 字符串格式化2022-07-18 22:36:15

    字符串拼接 #字符串拼接 print("i am %s ,my hobby is eat"%'yoki') msg = "i am %s ,my hobby is eat"%'yoki' print(msg) msg = "i am %s ,my hobby is %d"%('yoki',2) print(msg) # msg = "i am %s ,my hobby i

  • [Node.js] Socket.io and WebSocket2022-07-15 21:34:21

    https://btholt.github.io/complete-intro-to-realtime/socketio https://btholt.github.io/complete-intro-to-realtime/intro-to-websockets   Socket.io: FE: const socket = io("http://localhost:8080"); socket.on("connect", () => { consol

  • vue3-(watch帧听器)2022-07-15 15:02:39

    1.watch的基本使用 <template> <div>{{ obj.name }}</div> <div>{{ obj.age }}</div> <button @click="handleClick">修改</button> </template> <script setup lang="ts"> import { ref, reacti

  • python中rsa非对称算法(包含分段加解密分析)2022-07-14 10:35:16

    import base64 from Crypto import Random from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5 from Crypto.PublicKey import RSA class RsaCode: def encrypt(self, msg): msg = msg.encode('utf-8') rsakey = RSA.importKey(s

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

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

ICode9版权所有