import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Stream;
/**
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" Source your .vimrc | |
"source ~/.vimrc | |
"" -- Suggested options -- | |
" Show a few lines of context around the cursor. Note that this makes the | |
" text scroll if you mouse-click near the start or end of the window. | |
set scrolloff=5 | |
" Do incremental searching. | |
set incsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" :actionlist可以查询所有命令 | |
" 基本思路 | |
" w 比如全屏、分屏 | |
" g 跳转 | |
" z 比如打开最近修改的文件那种了 | |
" q 关闭标签 | |
" e 运行/调试 | |
" t 任务 | |
set showmode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := 1.0 | |
for i := 0; i < 1000; i++ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DateRange(val start: MyDate, val end: MyDate) : Iterable<MyDate> { | |
override fun iterator(): Iterator<MyDate> = DateIterator(start, end) | |
} | |
class DateIterator(val start: MyDate, val end: MyDate) : Iterator<MyDate> { | |
var hasNext = start <= end | |
var next = if (hasNext) start else end | |
override fun hasNext(): Boolean = hasNext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
void dec_to_hex(long long &dec) { | |
string hex; | |
if (dec == 0) { | |
hex = "0"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
void hex_to_dec(string &hex) { | |
long long dec = 0; | |
for (int i = hex.length() - 1; i >= 0; i--) { | |
int num = 0; | |
if (hex[i] >= '0' && hex[i] <= '9') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream.h> | |
#include <winioctl.h> | |
#include <string.h> | |
//关于Disk结构的定义 | |
struct Disk | |
{ | |
HANDLE handle; | |
DISK_GEOMETRY disk_info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <windows.h> | |
# include <iostream> | |
int main(int argc, char* argv[]) | |
{ | |
HANDLE lhShareMemory; | |
char* lpcBuffer; | |
lhShareMemory = OpenFileMapping(FILE_MAP_READ, false, "mySharedMemory"); | |
if (NULL == lhShareMemory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
void FillZero(LPVOID pBlock, DWORD dwSize) | |
{ | |
_try | |
{ | |
BYTE* arFill = (BYTE *)pBlock; | |
for (DWORD dwFill = 0; dwFill < dwSize; ++dwFill) | |
{ | |
arFill[dwFill] = 0; |
NewerOlder