一些随笔 No.1
耦合
耦合是一个设计与逻辑上的问题
例如一个软件有20个功能,删除任意一个功能对别的19个功能不造成影响,就是低耦合
如果删除一个功能后其他功能会失去完整性,那么就是高耦合
Difference between Binary code and ASCII
1) Binary code is a general term used for a method of encoding characters or instructions, but ASCII is only one of the globally accepted conventions of encoding characters and was the most commonly used binary encoding scheme for more than three decades.
2) Binary code can have different lengths for encoding depending on the number of characters, instructions, or the encoding method, but ASCII uses only 7 digits long binary string and 8 digits long for extended ASCII.
登录和连接
前端是命令执行体,所有控制策略都是在服务端
当建立连接后,客户端处于受控状态,处理服务端发来的数据
客户端只是动作的转接者(模拟用户的行为)
当当前连接断开,每产生一个新连接就将状态转为未登录
2. 一个客户端和服务端用多个连接
用签名来区别一个客户端
tcp的模型是流(管道模型) send出去后receive后的可能不是一个东西,可能会夹着别的东西
tcp发送时要校验发送了多少字节
消息队列实现线程间的通讯, 队列里面要有互斥信号量和同步信号量
Little-Endian and Big-Endian in Java
We must have heard these terms Little-Endian and Big-Endian many times in your engineering course. Let’s quickly recap the concept behind these words.
1. Little-Endian vs Big-Endian
These two terms are related to the direction of bytes in a word within CPU architecture.
Computer memory is referenced by addresses that are positive integers. It is “natural” to store numbers with the least significant byte coming before the most significant byte in the computer memory.
Sometimes computer designers prefer to use a reversed order version of this representation.
The “natural” order, where less significant byte comes before more significant byte in memory, is called little-endian.
Many vendors like IBM, CRAY, and Sun preferred the reverse order that, of course, is called big-endian.
2. Example of ordering
For example, the 32-bit hex value 0x45679812 would be stored in memory as follows:
Address 00 01 02 03
-----------------------------------
Little-endian 12 98 67 45
Big-endian 45 67 98 12
3. Endian-ness in Java
The difference in endian-ness can be a problem when transferring data between two machines.
Everything in Java binary files is stored in big-endian order. This is sometimes called network order. This means that if you use only Java, all files are done the same way on all platforms: Mac, PC, UNIX, etc. You can freely exchange binary data electronically without any concerns about endian-ness.
The problem comes when you must exchange data files with some program not written in Java that uses little-endian order, most commonly a program written in C. Some platforms use big-endian order internally (Mac, IBM 390); some uses little-endian order (Intel).
点对点建立连接方式
方式一
先用UDP实现广播,找出所有通信设备(要规定固定端口)
找出通信设备后,获取相应的IP信息进行TCP连接,进行点对点的TCP连接
方式二
设置好指定IP和端口直接通过TCP进行点对点连接
一些随笔 No.1的更多相关文章
- AI人工智能系列随笔
初探 AI人工智能系列随笔:syntaxnet 初探(1)
- 【置顶】CoreCLR系列随笔
CoreCLR配置系列 在Windows上编译和调试CoreCLR GC探索系列 C++随笔:.NET CoreCLR之GC探索(1) C++随笔:.NET CoreCLR之GC探索(2) C++随笔 ...
- C++随笔:.NET CoreCLR之GC探索(4)
今天继续来 带大家讲解CoreCLR之GC,首先我们继续看这个GCSample,这篇文章是上一篇文章的继续,如果有不清楚的,还请翻到我写的上一篇随笔.下面我们继续: // Initialize fre ...
- C++随笔:从Hello World 探秘CoreCLR的内部(1)
紧接着上次的问题,上次的问题其实很简单,就是HelloWorld.exe运行失败,而本文的目的,就是成功调试HelloWorld这个控制台应用程序. 通过我的寻找,其实是一个名为TryRun的文件出了 ...
- ASP.NET MVC 系列随笔汇总[未完待续……]
ASP.NET MVC 系列随笔汇总[未完待续……] 为了方便大家浏览所以整理一下,有的系列篇幅中不是很全面以后会慢慢的补全的. 学前篇之: ASP.NET MVC学前篇之扩展方法.链式编程 ASP. ...
- 使用Beautiful Soup编写一个爬虫 系列随笔汇总
这几篇博文只是为了记录学习Beautiful Soup的过程,不仅方便自己以后查看,也许能帮到同样在学习这个技术的朋友.通过学习Beautiful Soup基础知识 完成了一个简单的爬虫服务:从all ...
- 利用Python进行数据分析 基础系列随笔汇总
一共 15 篇随笔,主要是为了记录数据分析过程中的一些小 demo,分享给其他需要的网友,更为了方便以后自己查看,15 篇随笔,每篇内容基本都是以一句说明加一段代码的方式, 保持简单小巧,看起来也清晰 ...
- 《高性能javascript》 领悟随笔之-------DOM编程篇(二)
<高性能javascript> 领悟随笔之-------DOM编程篇二 序:在javaSctipt中,ECMASCRIPT规定了它的语法,BOM实现了页面与浏览器的交互,而DOM则承载着整 ...
- 《高性能javascript》 领悟随笔之-------DOM编程篇
<高性能javascript> 领悟随笔之-------DOM编程篇一 序:在javaSctipt中,ECMASCRIPT规定了它的语法,BOM实现了页面与浏览器的交互,而DOM则承载着整 ...
- css随笔1
1.简单清除浏览器样式 *{ padding: 0px; margin: 0px; } 2.得到屏幕范围的div html,body{ width: 1 ...
随机推荐
- element NavMenu侧栏导航菜单(可折叠)
展示效果如图: 代码: <el-scrollbar class="scrollbar-wrapper"> <!-- el-scrollbar超长可滚动 --> ...
- MLP-Mixer: An all-MLP Architecture for Vision 纯MLP架构
典型的MLP结构包括三层:input.hidden.output.不同层之间都是全联接的. MLP-Mixer完全利用基础的矩阵乘法运算和数据变换以及非线性层来完成复杂数据集的分类任务. Step 1 ...
- vue-多个卡片翻转动效
<van-grid :column-num="2" class="content" :border="false" > < ...
- css 多行文本展开收起
<template> <div class="content"> <div :class="[isOpen ? 'text' : 'text ...
- Levenshtein距离【编辑距离算法】字符串相似度算法
指两个字串之间,有一个转成另一个所需的最少编辑操作的次数. 算法过程 str1或str2的长度为0返回另一个字符串的长度. if(str1.length==0) return str2.length; ...
- 【原创】GmSSL Linux编译, 环境搭建
编译环境: wsl ubuntu 20.04 GmSSL Project 算法相关原理文档 由于GmSSL继承自openssl, 为了防止和openssl冲突,最好将GmsSL 编译为静态库 在Lin ...
- Flink学习系列——简介
Flink起源 德国柏林 Flink的目标 低延迟 高吞吐 较高的准确性(乱序数据的处理) 良好的容错性(容错性差的表现:一个节点挂了,全部回滚重新做计算,这对实时性要求高的场景非常致命)
- 输入一段字符(只含有空格和字母,保证开头不为空格),里面有若干个字符串,求这些字符串的长度和,并输出最长字符串内容,如果有多个输出最先出现的那个字符串。以stop作为最后输入的字符串。
#include<stdio.h>#include<string.h>main(){ int i,j=0,m,count,max; char a[100]; ...
- Linux查看CPU 内存命令
查看CPU 内存命令:https://www.cnblogs.com/ggjucheng/archive/2013/01/14/2859613.html 查看某一进程内存占用:ps -ef 获取PID ...
- Pandas嵌套词典解析或取值
# tribe列只保留name 值 df['tribe']=df['tribe'].apply(lambda x:eval(x)['name']) # tribe 列全部项目展开 df=df['con ...