一些随笔 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 ...
随机推荐
- c++学习1 基础关键词
一 "const" 修饰变量 只能被初始化和读取,不能被赋值更改,且必需初始化,不初始化的话会因为读取到随机数而报错. example: const int date=100; c ...
- 用js获取当前路由信息的方法
1,设置或获取对象指定的文件名或路径.alert(window.location.pathname)2,设置或获取整个 URL 为字符串.alert(window.location.href);3,设 ...
- javascript原型,继承
//普通对象 //函数对象(有原型 prototy 的属性) //原型的应用 继承 function Amial(){ this.type = '小于' } function cat(name){ t ...
- 树形DP【初级版】
START: 2021-08-14 10:00:37 在树形DP中,我们可以用数据模拟出一张图,一般是一棵树或是森林,所有的节点一般最多只有一个父节点.并且树里面没有重边或者环, 因此,一颗有N个节点 ...
- 自学JavaDay02_class01
注释 单行注释: //单行注释 多行注释 /** 多行注释* 多行注释* */ 文档注释 /** * 文档注释 * 文档注释 */ 标识符 关键字 标识符 所有的标识符都应该以字母(A-Z 或者 a- ...
- hbase 集群写入能力优化-预分区、TTL的应用
一.概述 hbase 写入优化除了参数配置之外,很大的一块要考虑避免region的热点问题,避免region 热点问题,主要的目的是提高hbase 数据表rowkey的分散.结合实际情况主要有以下几个 ...
- ABPvNext修改密码强度
ABPvNext 5.0之后,一些原有的修改密码强度的办法已经被抛弃无法正确使用.目前亲测有效的办法只有通过配置管理修改密码强度. 这里配置文件设置配置的方式,更多方法,可参见官方文档中的Settin ...
- 持续集成环境(6)-Tomcat安装和配置(编写中)
安装Tomcat8.5 把Tomcat压缩包上传到tomcat服务器(tomcat专用服务测试服务器.生产服务器) yum install java-1.8.0-openjdk* -y wget ht ...
- JSTL常用便签choose和JSTL常用便签foreach
2. choose :相当于 java 代码的 switch 语句 1.使用 choose 标签声明 相当于switch 2.使用 when 标签做判断 相当于case 3,使用 other ...
- Field userService in com.lin.hms.controller.LogController required a bean of type 'org.lin.hms.service.UserService' that could not be found.
需要一个bean但找不到 解决 我们在controller使用的service没有注入spring容器,那么我们可以在启动类上,加上包扫描注解,让这个bean所在的包能扫描到: @ComponentS ...