2018.3.28
更新 2026.8.24 win32 · 逆向 412 字· 1 分钟 win32中的宽字符 宽字符 数据类型 容器、模板 ASCII 一个字符 一个字节 GB码(扩展了的ASCII) 英文字符 一个字节 GB码 中文字符 两个字节 UNICODE字符集(unicode编码实际指的是utf-16) 常用字符 两个字节 宽字符: 用多个字节来表示的字符称之为宽字符(只要不是以单字节存储都可称为宽字符)
2018.3.27
更新 2026.8.24 win32 361 字· 1 分钟 兼容问题 由于ASCII存在字符含量过少的缺陷,所以不但我国自己搞出了国际码。其他国家也都设计出了符合自己国情的字符集
但是这就带来了问题
各个字符集之间不兼容怎么办?
Unicode Unicode 4个字节32位
真正有效范围: 0x0 – 0x 10ffff
约十进制:1114112 个字符
unicode相当于 “区位码”(也就是电脑中运行的),实际 …
2018.3.27
更新 2026.8.24 win32 361 字· 1 分钟 GB2312原文到GB2312机内码 ANSCII 汉字编码国家标准 区位码 01-09区 为特殊字符区
10-15区 为自定义区
16-87区 为汉字编码区
兼容演变: 1. 区位码标准中没有定义控制字符 解决方案: 将整个区位码向后移动32位(具体表现为每一字节都加上0x20)得到GB2312原码(国标码) 2. 原版ASCII与我们的初版国际码不兼容 …
2018.3.1
更新 2026.8.24 CPP 76 字· 1 分钟 模板 下面是一个针对int的冒泡排序
// _20180301.cpp : Defines the entry point for the console application. // #include "stdafx.h" void Sort(int* arr,int nLength) { int i,k; for (i = 0;ix > base.x …
2018.2.23
更新 2026.8.24 CPP 765 字· 2 分钟 深浅拷贝 相同类型间可以直接拷贝
// _20180212.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include class A { private: int* a; public: A() { a = new …
2018.2.20
更新 2026.8.24 ruby 204 字· 1 分钟 Agenda Loop Expression File Read/Write Debug Process & Thread Loop while
a = 10 while a > 0 puts a a -= 1 end until
a = 100 until a == 0 puts a a -= 1 end loop
a = 10 loop do break …
2018.2.20
更新 2026.8.24 ruby 952 字· 2 分钟 Agenda class_eval & instance_eval method_missing Module as a namespace Gems require vs load $LOAD_PATH class_eval 首先class_eval是只有类才能调用的,Class#class_eval class_eval会重新打开当前类的作用域 # …
2018.2.18
更新 2026.8.24 ruby 647 字· 2 分钟 Ruby的内部类结构 Array.class # => Class Class.class # => Class superclass 查看父类 Array.superclass # =>Object Object.superclass # =>BasicObject BasicObject.superclass # => nil ancestors 查看当 …
2018.2.17
更新 2026.8.24 ruby 228 字· 1 分钟 继承示例 # inheritance class User attr_accessor :name, :age def initialize name, age @name, @age = name, age end def panels # ||= 操作符, 如果变量不存在 那么就赋值 @panels ||= ["Profile", "Products"] …
2018.2.17
更新 2026.8.24 ruby 731 字· 2 分钟 Everything is Object 一切皆对象 1 2 3 4 5 6 7 a = "hello" a.class # => String b = 3.14 b.class # => Float c = %w[pear cat horse] c.class # => Array Instance Method & Instance Attribute …
2018.2.17
更新 2026.8.24 ruby 约 1.1k 字· 3 分钟 代码规范 使用UTF-8编码 使用空格缩进,不使用tab, 1 tab = 2 spaces 不需要使用分号(;)和反斜杠()连接代码 Demo
# basic types a = 1 b = "hello world" # one line c = ["pear", "cat", "dog"] # or multiple lines c2 = [ …
2018.2.17
更新 2026.8.24 ruby 192 字· 1 分钟 变量赋值 # 变量交换 a = 1 b = 2 b,a = a,b puts a puts b puts "-" * 30 x = [1, 2, 3] a, b = x #默认会把数组中的值依次赋值给 a ,b puts a puts b puts "-" * 30 x = [1, 2, 3] a, *b = x #这里a会接受第一个元素 b用了*号 表示接 …
2018.2.17
更新 2026.8.24 ruby 751 字· 2 分钟 Block 代码块 Block是一个参数 匿名参数 Callback 使用do/en或者{}来定义 {puts "hello"} Demo:
# block usage def hello puts "hello method start" yield yield puts "hello method end" end hello {puts "i am …
2018.2.16
更新 2026.8.24 ruby 199 字· 1 分钟 if/else/elsif 1 2 3 4 5 6 7 8 9 a = "hello" b = false if a p a elsif b p b else p "ok" end unless unless相当于if的反向断言
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 …
2018.2.16
更新 2026.8.24 ruby 约 1.1k 字· 3 分钟 整数类型: 3,222 小数: 3.14 字符串: hello,world 布尔类型: true(TrueClass),false(FalseClass) 数组: [1,2],["hello","hello world"] Hash(字典): {"name"=>"luo","age"=>24},{:name=>"daoyi",:age=>24} …
2018.2.16
更新 2026.8.24 ruby 591 字· 2 分钟 Method(Function) 1 2 3 4 5 6 7 8 9 def hi(name) p "hi " + name end hi("666") # => "hi 666" hi "code" #括号省略 => "hi code" def hello name p "hello #{name}" end hello "world" # => …
2018.2.16
更新 2026.8.24 CPP 约 1.7k 字· 4 分钟 多态的实现原理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 …
2018.2.10
更新 2026.8.24 CPP 457 字· 1 分钟 继承 子类从父类继承成员变量 子类从父类继承成员函数 #include "stdafx.h" class Person { public: int Age; int Sex; void Word() { printf("Person:Work"); } }; class Teacher:public Person { public: int Level; …
2018.2.2
更新 2026.8.24 linux · 安全 66 字· 1 分钟 #阿里云kali源 deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib deb …
2018.1.30
更新 2026.8.24 CPP 约 2.2k 字· 5 分钟 我们可以在什么地方创建对象? 全局变量区
Person p;
栈
void Max() { Person p; }
堆 new 和 delete
//在堆中创建对象: Person* p = new Person(); //释放对象占用的内存 delete p;
在堆中创建对象: new``delete 在C语言中我们使用malloc申请堆空间
使用完毕后使 …