有趣的小知识

这里打算记录一些平时遇到的,大家可能不会太留意,但有趣的小知识。


1:CRLF

CRLF的含义是“carriage return/line feed”,意思就是回车。这是两个ASCII字符,分别排在第十三和第十位。
CR和LF是在计算机终端还是电传打印机的时候遗留下来的东西。电传打字机就像普通打字机一样工作。在每一行的末端,CR命令让打印头回到左边。LF命令让纸前进一行。
虽然使用卷纸的终端时代已经过去了,但是,CR和LF命令依然存在,许多应用程序和网络协议仍使用这些命令作为分隔符。


2: ICMP 和 windows

刚才碰到一个问题: ping同一个网段的一个主机,竟然返回destinationunreachable.害我以为是本机的路由表出了问题排查了很久,后来在这里发现是WIN7ICMP实现没有遵循RFC标准.  实际的情况是子网内做了MAC白名单或者MAC绑定,让我的机子不在列表内对于这种情况,标准的ICMP应该返回time out而不是微软的destinationunreachable.


3: CMCC自动转跳登录页面

刚才一个同事连接CMCC后, 打开网页不能自动转跳到CMCC的登录页面. 在网上搜到说可能是手动设置了DNS服务器, 需要改成自动获取. 略一思忖, 哈哈, 原来它们是用DNS劫持去实现这个自动转跳的.  至于验证, 用wireshark抓包就可以了.


4: C语言中的#pragma

来自:http://stackoverflow.com/questions/3791259/where-does-the-word-pragma-come-from

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

According to a US Government-owned(!) document describing the design of Ada: Rationale for the Design of the Ada® Programming Language :

A pragma (from the Greek word meaning action) is used to direct the actions of the compiler in particular ways, but has no effect on the semantics of a program (in general).

I like the (last caveat) there...

This cross references well with on-line greek dictionaries (e.g. as quoted by Martin York) that say pragma (πραγμα, as commented on the original question by asveikau) means:

      a. that which has been done, a deed, an accomplished fact

      b. what is done or being accomplished

          .spec. business, a commercial transaction

      c. a matter, question, affair

          .spec. in a forensic sense, a matter at law, case, suit

      d. that which is or exists, a thing

Seems the key to understanding is the word action rather than information.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值