- Windows Computer (I'm using Win10)
- Linux Computer (I'm using Mint 20.1)
- External Drive
- The largest supported image size is 127GB, so if you have a bunch of personal files on your Windows computer, migrate it to a different drive..
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
// Copyright 2018 The gVisor Authors. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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 <sys/socket.h> | |
#include <linux/memfd.h> | |
#include <sys/mman.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
void broadcaster( int socket ) | |
{ |
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 <libunwind.h> | |
#include <libunwind-ptrace.h> | |
#include "backtrace.h" | |
#define MAX_BACKTRACE_FRAMES 64 | |
void unwind(pid_t pid) { | |
unw_addr_space_t addr_space = NULL; | |
struct UPT_info* upt_info = NULL; |
最终实现效果:
- 无版本概念,任何本地文件均可增量升级到最新.服务器不用管理多版本
- 内存小,100M文件升级时只占用500KB内存.
使用流程:
- 制作新版本,上传HTTP File Server.
- Client自动计算差异,下载差异,合并差异.
- done!
#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
// g++ -o readline_ev -g readline_ev.cpp -g -lreadline -lev | |
// | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <readline/readline.h> | |
#include <readline/history.h> | |
#include <ev.h> | |
#include <fcntl.h> | |
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 <string> | |
#include <locale> | |
#include <codecvt> | |
//UTF-8 to UTF-16 | |
std::string source; | |
//... | |
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert; | |
std::u16string dest = convert.from_bytes(source); | |
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
import Foundation | |
//let raw = String.stringWithContentsOfURL(NSURL(string: "http://www.weather.com.cn/data/sk/101010100.html")) | |
struct EasyJSON { | |
var _obj: AnyObject! | |
init(_ obj: AnyObject) { | |
//assert(NSJSONSerialization.isValidJSONObject(obj), "must be valid json object") | |
_obj = obj |
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
# coding=utf-8 | |
__author__ = 'Vincent Ting' | |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'Vincent Ting' | |
import cookielib | |
import urllib2 |
NewerOlder