一些随笔 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 ...
随机推荐
- lua按某些键排序的方法
function sort(list, ...) local opts = {...}; local len = #opts; return table.sort(list, function(a, ...
- java中锁的应用(ReentrantLock)
package com.xielu.test; public class explicit { private static Lock lock = new ReentrantLock(); priv ...
- C#基于数据库链接增删改查
一.创建一个winfrom窗体 1.创建项目 2.创建一个链接数据的类 3.封装数据库的实体类(查询和增加) 在对数据操作时必须引用连个数据库using using System.Data; usin ...
- 弹框table
<template> <div> <el-dialog :title="title" :visible.sync="dialogVisibl ...
- vue3 技术浏览 收藏
Vue3教程:Vue3.0 + Vant3.0 搭建种子项目 链接:https://www.cnblogs.com/han-1034683568/p/13875663.html
- HTML和xml
[html和xml的相同点] html和xml 都是标记语言,都是基于文本编辑和修改的. 都是用于操作系统或数据结构,结构上大致相同. 都可以通过DOM 变成方式来访问. 都可以通过CSS来改变外观 ...
- sql创建表时候单引号不是单引号是,而是Esc下面的按键
CREATE TABLE `test`.`testmd5` ( `id` INT ( 4 ) NOT NULL, `name` VARCHAR ( 20 ) NOT NULL, `pwd` VARCH ...
- [Leetcode 104]二叉树最大深度Maximum Depth of Binary Tree
题目 求二叉树的深度,即根节点出发的最长路径上点的个数,即最长路径+1(本身这个点 https://leetcode.com/problems/maximum-depth-of-binary-tree ...
- 【Unity】Timeline探索记(4)第二个例子——动作特写/子弹时间
写在前面 这次例子参考这篇实现博文(附带项目下载),博文前面介绍非常具体,可惜后面特写轨实现代码不是按照我想要的标准四大件(data.mixer.clip.track)来组织的,所以这里我略过介绍,只 ...
- 【NAS使用心得】使用Synology Photos管理照片
整理方式 1.本地没有整理或只按年份整理的:时间线模式下直接上传,让软件自己按照片创建时间生成文件夹:有按年份生成相册需求的,可以用"选择照片以创建相册"功能,找到年份文件夹,全选 ...