首页 > 编程语言
基于tcp多线程的聊天系统
服务端代码 import socket from threading import Thread import time def talk(con): while True: data_bytes = con.recv(1024) t = time.strftime("%Y/%m/%d %H:%M: ...
分类:编程语言   时间:2020-08-03 00:00:28    收藏:0  评论:0  赞:0  阅读:115
堆排序
import java.util.Arrays; public class My { public void heapSort(int[] arr) { // 前提:根节点为0号结点,结点总数为n // 若当前结点为i,则其左孩子为2*i+1,右孩子为2*i+2 // 最后一个非叶子结点为n/2-1 ...
分类:编程语言   时间:2020-08-02 23:56:18    收藏:0  评论:0  赞:0  阅读:125
Spring-MVC 里面的ModelAndView
作用: 由于本身http是无状态的并不会保存什么请求信息。 但是目标页面可能又需要一些信息。这时候可以用ModelAndView存放一些业务数据之类等。然后返回给页面 用法: 比较重要的方法: 往对象里面加入变量 /** * Add an attribute to the model. * @par ...
分类:编程语言   时间:2020-08-02 23:55:55    收藏:0  评论:0  赞:0  阅读:105
Spring-MVC
三层架构: 开发架构一般都是基于两种形式,一种是C/S架构,也就是客户端/服务器,另一种是B/S架构,也就是浏览器服务器。 在B/S架构中,系统标准的三层架构包括:表现层、业务层、持久层 表现层: 实际就是web层,接收客户端请求,向客户端响应结果,通常客户端使用http协议请求web层,web需要 ...
分类:编程语言   时间:2020-08-02 23:55:28    收藏:0  评论:0  赞:0  阅读:115
归并排序
import java.util.Arrays; public class My { public void mergeSort(int[] arr, int low, int high) { if (low >= high) { return; } int mid = low / 2 + high ...
分类:编程语言   时间:2020-08-02 23:55:01    收藏:0  评论:0  赞:0  阅读:132
《侯捷手把手教学C++(下)》
12/25 P1 1.导读1 P2 2.conversion function2 P3 3.non-explicit one argument constructor 3 P4 4.pointer-like classes 4 P5 5.function-like classes 5 P6 6.na ...
分类:编程语言   时间:2020-08-02 23:54:47    收藏:0  评论:0  赞:0  阅读:199
C语言之结构体
1.结构体类型的定义 struct 类型名{ // 可以定义多种类型 int a; char b; short c; } #include<stdio.h> struct stPoint { // 定义新类型 int x; int y; }; void main() { struct stPoint ...
分类:编程语言   时间:2020-08-02 23:53:56    收藏:0  评论:0  赞:0  阅读:95
基数排序
import java.util.Arrays; public class My { public void radixSort(int[] arr) { int max = arr[0]; //初始化最大值 for (int a : arr) { if (a > max) { max = a; } ...
分类:编程语言   时间:2020-08-02 23:53:26    收藏:0  评论:0  赞:0  阅读:101
计数排序
import java.util.Arrays; public class My { public void countSort(int[] arr) { int max = arr[0]; int min = arr[0]; for (int a : arr) { if (a > max) { m ...
分类:编程语言   时间:2020-08-02 23:52:44    收藏:0  评论:0  赞:0  阅读:96
JavaScript的调用
JavaScript有两种调用方式 一、在网页指定位置直接插入<srcipt></script>标签,并在其中书写JavaScript代码 <script type="text/javascript"> alert('hello world'); </script> 二、引入外部js文件 <scri ...
分类:编程语言   时间:2020-08-02 23:52:27    收藏:0  评论:0  赞:0  阅读:106
15.SpringBoot学习(十五)——Spring Boot WebFlux路由
1.简介 1.1 概述 In WebFlux.fn, an HTTP request is handled with a HandlerFunction: a function that takes ServerRequest and returns a delayed ServerResponse ...
分类:编程语言   时间:2020-08-02 23:52:12    收藏:0  评论:0  赞:0  阅读:91
16.SpringBoot学习(十六)——Spring Boot MessageConverter消息转换器
1.简介 1.1 概述 Spring MVC uses the HttpMessageConverter interface to convert HTTP requests and responses. Sensible defaults are included out of the box. ...
分类:编程语言   时间:2020-08-02 23:51:24    收藏:0  评论:0  赞:0  阅读:102
多线程(续集)
线程同步机制(synchronized) //线程同步机制代码格式 synchronized(排队线程共享的对象){ 线程同步代码块 } /* ():括号中填的是,排队线程共享的对象,比如有t1,t2,t3,t4,t5线程,只要线程t1,t2,t3排队执行,那么要在括号内写线程t1,t2,t3共享的 ...
分类:编程语言   时间:2020-08-02 23:51:11    收藏:0  评论:0  赞:0  阅读:101
17.SpringBoot学习(十七)——Spring Boot 自定义Starter
1.简介 1.1 概述 A typical Spring Boot starter contains code to auto-configure and customize the infrastructure of a given technology, let’s call that "acm ...
分类:编程语言   时间:2020-08-02 23:48:22    收藏:0  评论:0  赞:0  阅读:118
C++内存管理及内存问题的分析
写服务端的,内存是一个绕不过的问题,而用C++写的,这个问题就显得更严重。进程的内存持续上涨,有可能是正常的内存占用,也有可能是内存碎片,而C++写的,还有可能是内存泄漏,那就需要一些方法来检测到底是哪些问题引起的。 1. 内存占用 首先从top这个指令说起 Tasks: 80 total, 1 r ...
分类:编程语言   时间:2020-08-02 22:11:21    收藏:0  评论:0  赞:0  阅读:104
LeetCode刷题--两个数组的交集II
题目 解题思想 方法一:遍历第一个数组将第一个集合的元素作为hashmap的键,该元素出现的次数作为hashmap的值;遍历第二个数组的元素并查询元素是否出现在hashmap中,如果出现一次,则将该元素添加到列表list中数组中,并将hash值-1,只到hash值减为0,就将该键删除。最后输出将li ...
分类:编程语言   时间:2020-08-02 22:04:34    收藏:0  评论:0  赞:0  阅读:104
Python 基础语法一(注释、行与缩进、多行语句、空行和代码组)
一、注释Python中单行注释以 # 开头,实例如下: # 第一个注释 print ("Hello, Python!") # 第二个注释 输出结果为: RESTART: E:/python/change.py Hello, Python! 多行注释可以用多个 # 号,还有 ''' 和 """:实例如 ...
分类:编程语言   时间:2020-08-02 22:04:11    收藏:0  评论:0  赞:0  阅读:134
Python 基于Python生成短8位唯一id解决方案
基于Python生成短8位唯一id解决方案 by:授客 QQ:1033553122 测试环境: Win10 Python 3.5.4 实现思路 利用62个可打印字符,通过随机生成32位UUID,由于UUID都为十六进制,所以将UUID分成8组,每4个为一组,然后通过模62(字符0-9,a-z,A-Z ...
分类:编程语言   时间:2020-08-02 21:57:37    收藏:0  评论:0  赞:0  阅读:108
C++ 相关的string 函数(memcpy、memove、strtok、strchr)
一、memcpy和memove void* memove(void*destin , void* source, size_t count) { //进行这样的判断是为了解决拷贝重叠的情况 if (destin > source) { //这里拷贝的时候还可以提高效率 //因为CPU单次可以拷贝的最 ...
分类:编程语言   时间:2020-08-02 21:56:04    收藏:0  评论:0  赞:0  阅读:114
CF算法
generate_train_data.py import pandas as pd import user_cf import operator import item_cf data_path = 'G:\\Bigdata_object\\u.data' udata = pd.read_csv( ...
分类:编程语言   时间:2020-08-02 21:54:34    收藏:0  评论:0  赞:0  阅读:98
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!