Wang shaodong's Blog

Wang shaodong's Blog

C++ VS c
Created2020-02-24
C++ 曾经被叫做C With class, C++ 是兼容C的,并不是100%兼容 C++ 中的C子集是C++的一部分,C语言中允许的东西到C++中可能会不允许 全局变量初始化: C语言中只能使用 constant初始化全局变量 C++可以通过函数初始化123456789101112131415#include <stdio.h>int init(){ printf("inside init func\n"); return 100;}int global_int = init(); // 此语句cpp文件能够编译执行,c文件编译失败int main(){ printf("Hello world\n"); printf("global_int= %d\n", global_int); return 0;} C++的C子集 是更好的C,将C中的一些不严格的编译检查,变得相对更严格C++ 编译器编译之后函数的 mangling na...
about-encoding
Created2020-02-23
About preprocess
Created2020-02-23
预处理是C/C++ 编译过程中的第一个环节, 处理以#开头的文本行 比如免费版和付费版的功能多少的条件编译 实现代码对于不同平台的兼容,或者对相同平台的不同版本进行兼容 宏的作用常见的就是简单的文本替换功能,实现函数的替换,DEBUG版本加打印,release 版本不加打印12345678910111213141516171819202122232425262728// 此代码来自 Learn C the hard way 一书#ifndef __dbg_h__#define __dbg_h__#include <stdio.h>#include <errno.h>#include <string.h>#ifdef NDEBUG#define debug(M, ...)#else#define debug(M, ...) fprintf(stderr, "DEBUG %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)#endif#define...
Funny Linux Commands
Created2020-02-23
nprocprint the number of processing units available cat /proc/cpuinfo Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are threads in the same core.
 Any cpu with the same physical id are threads or cores in the same physical socket.
About Endianness
Created2020-02-20
大小端问题(big endian little endian)  In computing, endianness refers to the order of bytes (or sometimes bits) within a binary representation of a number  In its most common usage, endianness indicates the ordering of bytes within a multi-byte number. A big-endian ordering places the most significant byte first and the least significant byte last,  while a little-endian ordering does the opposite   Historically, various methods of endianness have been used in computing, including exotic forms s...
About Java
Created2020-02-19
Java是啥?   Java是面向对象编程语言,最早是Sun公司的后来被Oracle收购了,已经有20多年的历史了,是为了针对c++的缺点 Java 编程环境配置   java运行依赖于java虚拟机,所以要安装JDK,因为java规范和jvm 规范是公开的,所以jdk有开源实现版本openjdk,JDK 和oracle JDK   具体步骤可以参考此链接 安装JDK  谷歌或者百度,搜索 oracle jdk,下载安装 配置 JAVA_HOME, CLASSPATH 和 PATH 等环境变量      PATH 环境变量中是平台可执行文件的所在的路径的集合     JAVA_HOME 指向JDK software 安装的地方,比如说, D:\Program Files\Java\jdk1.8.0_181     CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part o...
about-ssh
Created2020-02-19
ssh Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network ssh 也是Linux 命令之一,用于(取代telnet等不安全的协议软件)安全连接访问远程服务器. ssh 基本用法 以root用户通过端口22333登录192.168.23.4主机 1$ ssh root@192.168.23.4:2233 ssh的特殊姿势 只有你拥有台海外vps并且安装了ssh服务,可以通过ssh动态端口转发实现fq ssh [-D [bind_address:]port root@remotehost:2233 一般bind_address 是localhost netstat -nat 查看端口使用情况ssh 相关命令ssh-agent ssh-keygen
About python
Created2020-02-18
Python 是Guido van Rossum 圣诞节无聊发明的一种编程语言特征 非强制面向对象 动态类型 脚本(解释型)语言 类C语法 语法块按照对齐产生 python 三种实现 cpython C jpython Java IronPython .NET python 优化方法 使用pypy python版的python解释器 shed skin 将python代码转换成c++的代码 python 工具pyvenv python中的不可变类型Interger, string, tuple 变量名没有类型,对象有类型slice切片操作list [],tuple() 创建自测试的模块在模块的尾部加入以下代码if name == ‘main‘: import doctest doctest.testmod()此模块在python解释器中直接运行时候就能进行doctest
About virtualmachine
Created2020-02-18
新建虚拟机的时候有磁盘类型选择 IDE SCSI(Recommended) SATA NVMe 虚拟机文件磁盘类型 qcow2 raw vhd vmdk 常见的虚拟机软件 VMware Workstation Oracle VM BOX KVM(Kernel-based Virtual Machine) Xen VMware虚拟机client是Linux遇到如果在Shell下输错命令或按TAB键补全命令系统会发出类似“嘟嘟 或 滴滴”的蜂鸣声 编辑 /etc/inputrc设置 bell style 为none set bell-style none 编辑 /etc/inputrc设置 用#注释掉下面两行set bell-style visibleset bell-style audible vmware 论坛有方案 将配置文件中的选项改为 mks.noBeep = “TRUE”   You can find the global configuration file at: Linux hosts:   ~&#x...
About OTP
Created2020-02-18
什么是OTPOne-Time-Programmable Memory (OTP)Programmable Read Only Memory (PROM) and One-Time-Programmable (OTP) Memory can be written to once.popularityDESCRIPTIONWhile the memory contents for a ROM are set at design/manufacturing time, Programmable Read Only memories (PROM) and more recently One-Time Programmable (OTP) devices can be programmed after manufacturing making them a lot more flexible. Once programmed, or blown, the contents cannot be changed and the contents are retained after ...
1…567…9
avatar
wang shaodong
Articles
83
Tags
15
Categories
0
Follow Me
Announcement
This is my Blog
Recent Posts
Contact ways2026-06-13
Hexo Quick Manual2023-01-24
kernel structs pos2022-03-23
busybox SUID support2022-03-23
kernel image formats2022-03-23
Tags
Tool Others sql shell Tools git terms Tools algorithm C/C++ other alogrithm Linux/C C/C++ Linux tools others
Archives
  • June 2026 1
  • January 2023 1
  • March 2022 19
  • September 2021 6
  • August 2021 11
  • August 2020 1
  • June 2020 1
  • May 2020 3
Website Info
Article Count :
83
Unique Visitors :
Page Views :
Last Update :
© 2025 - 2026 By wang shaodongFramework Hexo 8.1.2|Theme Butterfly 5.5.5