耦合

耦合是一个设计与逻辑上的问题

例如一个软件有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).

点对点建立连接方式

方式一

  1. 先用UDP实现广播,找出所有通信设备(要规定固定端口)

  2. 找出通信设备后,获取相应的IP信息进行TCP连接,进行点对点的TCP连接

方式二

设置好指定IP和端口直接通过TCP进行点对点连接

一些随笔 No.1的更多相关文章

  1. AI人工智能系列随笔

    初探 AI人工智能系列随笔:syntaxnet 初探(1)

  2. 【置顶】CoreCLR系列随笔

    CoreCLR配置系列 在Windows上编译和调试CoreCLR GC探索系列 C++随笔:.NET CoreCLR之GC探索(1) C++随笔:.NET CoreCLR之GC探索(2) C++随笔 ...

  3. C++随笔:.NET CoreCLR之GC探索(4)

    今天继续来 带大家讲解CoreCLR之GC,首先我们继续看这个GCSample,这篇文章是上一篇文章的继续,如果有不清楚的,还请翻到我写的上一篇随笔.下面我们继续: // Initialize fre ...

  4. C++随笔:从Hello World 探秘CoreCLR的内部(1)

    紧接着上次的问题,上次的问题其实很简单,就是HelloWorld.exe运行失败,而本文的目的,就是成功调试HelloWorld这个控制台应用程序. 通过我的寻找,其实是一个名为TryRun的文件出了 ...

  5. ASP.NET MVC 系列随笔汇总[未完待续……]

    ASP.NET MVC 系列随笔汇总[未完待续……] 为了方便大家浏览所以整理一下,有的系列篇幅中不是很全面以后会慢慢的补全的. 学前篇之: ASP.NET MVC学前篇之扩展方法.链式编程 ASP. ...

  6. 使用Beautiful Soup编写一个爬虫 系列随笔汇总

    这几篇博文只是为了记录学习Beautiful Soup的过程,不仅方便自己以后查看,也许能帮到同样在学习这个技术的朋友.通过学习Beautiful Soup基础知识 完成了一个简单的爬虫服务:从all ...

  7. 利用Python进行数据分析 基础系列随笔汇总

    一共 15 篇随笔,主要是为了记录数据分析过程中的一些小 demo,分享给其他需要的网友,更为了方便以后自己查看,15 篇随笔,每篇内容基本都是以一句说明加一段代码的方式, 保持简单小巧,看起来也清晰 ...

  8. 《高性能javascript》 领悟随笔之-------DOM编程篇(二)

    <高性能javascript> 领悟随笔之-------DOM编程篇二 序:在javaSctipt中,ECMASCRIPT规定了它的语法,BOM实现了页面与浏览器的交互,而DOM则承载着整 ...

  9. 《高性能javascript》 领悟随笔之-------DOM编程篇

    <高性能javascript> 领悟随笔之-------DOM编程篇一 序:在javaSctipt中,ECMASCRIPT规定了它的语法,BOM实现了页面与浏览器的交互,而DOM则承载着整 ...

  10. css随笔1

    1.简单清除浏览器样式 *{        padding: 0px;        margin: 0px;    } 2.得到屏幕范围的div html,body{        width: 1 ...

随机推荐

  1. QPushButton与Enter相链接

    ui->pushButton_login->setFocus(); // 设置默认焦点 ui->pushButton_login->setShortcut(QKeySequen ...

  2. Transformer_Detection-(DETR) 引入视觉领域的首创DETR (ECCV2020)

    End-to-End Object Detection with Transformers paper: https://link.zhihu.com/?target=https%3A//arxiv. ...

  3. 2022竞赛新方法学习1--学习Proceedings of SAT Competition 2022 : Solver and Benchmark Descriptions

    Proceedings of SAT Competition 2022 : Solver and Benchmark Descriptions https://helda.helsinki.fi/ha ...

  4. docker知识篇

    什么是Docker?Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机).b ...

  5. js 获取html加载的参数?file=123&time=2021

    <script> function GetArgsFromHref(sHref, sArgName) { var args = sHref.split("?"); va ...

  6. down_interruptible()获取信号量

    信号量(Semaphore)是操作系统中最典型的用于同步和互斥的手段,信号量的值可以是0.1或者n.信号量与操作系统中的经典概念PV操作对应. P(S):①将信号量S的值减1,即S=S-1:②如果S≥ ...

  7. 导出数据库表以及备注为excel

    import com.alibaba.excel.annotation.ExcelProperty; import lombok.AllArgsConstructor; import lombok.D ...

  8. IT工具知识-13: 如何编辑SVG图像文件并转换为ICO图标文件

    使用背景 最近做了个小软件, 但是桌面快捷方式图标不好看, 于是想着找个好看点的图标, 但是网上搜了一圈, 发现好看的几乎都要钱, 常用的话, 付费倒也不反感, 但是, 仅仅只用那么一两次, 为这个付 ...

  9. window nginx php ci框架环境搭建

    下载nginx 后修改配置文件: location / { #try_files $uri $uri/ /index.php?$query_string; root C:\Software\serve ...

  10. squad经验总结

    啊美丽卡:M1A2 - TANKM2A3 - BLDL/M2A3M1126 - SCKMATV - RWS(电摇),ZCC(手摇)MATV(TOW) - TOW车M989 - 补给卡/运兵卡 俄军 8 ...