一些随笔 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 ...
随机推荐
- Ext中数据表格序号超过3位数时显示省略号
问题 在老项目上优化时,遇到了Ext中ColumnModel序号超过3位数时,自动显示了省略号,不友好 修改方法 给RowNumberer添加样式 new Ext.grid.RowNumberer({ ...
- Django框架搭建web项目(一)
建议查看官方文档:https://docs.djangoproject.com/zh-hans/4.0/intro/tutorial01/ 1.本地安装python环境(略) 2.本地安装Django ...
- 关于JUnit
目录 一.单元测试 二.在LAB中的常用方法 一.单元测试 什么是单元测试呢?单元测试就是针对最小的功能单元编写测试代码.Java程序最小的功能单元是方法,因此,对Java程序进行单元测试就是针对单个 ...
- <c:forEach>循环获取下一次循环数据
<c:forEach>循环获取下一次循环数据 实现案例类似于多级导航栏下拉.双循环便利ul.li,利用外层循环的index获取数据.动态id设置. varLista[vs.index][l ...
- ps2022(Photoshop 2022)Mac/win最新图像处理中文版
Adobe Photoshop 2022 Mac/win是数字图像处理和编辑的行业标准,提供了全面的专业修饰工具包,并具有旨在激发灵感的强大编辑功能.Photoshop 带有大量图像处理工具,旨在帮助 ...
- texstudio设置外部浏览器及右侧预览不能使用问题
刚装的texstudio,今天不知什么原因右侧显示的pdf文件一直是以前的,百度了下没找到,自己摸索了下,只需要把构建里面pdf查看器更改下即可 如果想更改外部pdf查看器,只需要设置下命令里面外部p ...
- binary与进制转换
精华笔记: 什么是二进制:逢2进1的计数规则.计算机中的变量/常量都是按照2进制来计算的 2进制: 规则:逢2进1 数字:0 1 基数:2 权:128 64 32 16 8 4 2 1 如何将2进制转 ...
- 在Eclipse 中导入maven项目, progress对话框中出现importing maven project的进度条卡住
一.在Eclipse配置Maven 方法1:在Eclipse上下载,太慢了,不用 方法2:在电脑本地下载,然后Eclipse载入 二.方法2详细步骤 1.官网下载:http://maven.apach ...
- JMeter MD5加密 默认小写 转换为大写
出处:https://www.cnblogs.com/scholars-xian/p/11718854.html 使用内置函数加密 1)使用 ${__MD5(123,)} 进行MD5加密(32位小写) ...
- HBase架构、模型、特点
如需大数据开发整套视频(hadoop\hive\hbase\flume\sqoop\kafka\zookeeper\presto\spark):请联系QQ:1974983704 1.HBase概述 H ...