View gist:1e75b323e596eaafa21f
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
if (pHead->pBlockHeaderPrev) | |
{ | |
pHead->pBlockHeaderPrev->pBlockHeaderNext = pHead->pBlockHeaderNext; | |
} | |
else | |
{ | |
_ASSERTE(_pFirstBlock == pHead); | |
_pFirstBlock = pHead->pBlockHeaderNext; | |
} |
View gist:05e1dccc33943d193352
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 <cpprest\json.h> | |
#include <string> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
web::json::value root; | |
std::wstring filepath = L"config.json"; | |
std::ifstream ifs; |
View output.log
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
2>xxxwidget.obj : error LNK2019: unresolved external symbol "void __cdecl yyy::zzzstring(...)" (?zzzstring@xxx@@YAXPAU_GUID@@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function __catch$?nnn@mmm@@...... : | |
fatal error LNK1120: 1 unresolved externals |
View build.py
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
# Sample code snippet.. | |
def start(self, version): | |
msbuild = os.getenv('MSBUILD_PATH', r"C:\Program Files\MSBuild\12.0\Bin\MSBuild.exe") | |
project_output_dir = os.getenv('PROJECT_OUTPUT_DIR', r'c:\Build_distribute\') | |
if not os.path.exists(msbuild): | |
raise Exception('not found ' + msbuild) | |
projects = [r"..\yoursolution.sln", r"..\yourproject\yourproject.vcxproj"] |
View manage_version.py
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 taken from | |
# http://stackoverflow.com/questions/4003725/modifying-rc-file-with-python-regexp-involved | |
# target_version = "2,3,4,5" | |
def set_rc_version(rcfile, target_version): | |
with open(rcfile, "r+") as f: | |
rc_content = f.read() | |
# first part |
View ocr_bot.py
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 sys | |
import asyncio | |
import random | |
import telepot | |
from telepot.delegate import per_chat_id | |
from telepot.async.delegate import create_open | |
import os | |
import traceback |
View setup-orgmode.el
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
(eval-after-load 'org | |
(lambda() | |
(require 'ob-C) | |
(require 'org-bullets) | |
(require 'ox-taskjuggler) | |
(require 'ox-latex) | |
;; … | |
(setq org-latex-to-pdf-process |
View PDFFile_webbrowser_invoke.cs
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
if (locateText.Text.EndsWith("pdf", true, null) == true && | |
File.Exists(locateText.Text) == true) | |
{ | |
var buffer = File.ReadAllBytes(locateText.Text); | |
// Document.InvokeScript seems not understanding the Blob type | |
//object[] args = { fileBytes }; | |
//webBrowser1.Document.InvokeScript("PDFViewerApplication.open", args); | |
// so convert it to base64 and pass it |
View invoke_pdfjs_viewer_with_base64.js
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
// https://github.com/heejune/WinForm-PDFjs/blob/master/WinFormPDFViewer/pdfjs-1.4.20-dist/web/viewer.js | |
// PDFViewerApplication.open wrapper for base64 param | |
window.openPdfAsBase64 = function (base64) { | |
var binary_string = window.atob(base64); | |
var len = binary_string.length; | |
var bytes = new Uint8Array(len); | |
for (var i = 0; i < len; i++) { | |
bytes[i] = binary_string.charCodeAt(i); | |
} |
View countera.py
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 sys | |
import asyncio | |
import telepot | |
from telepot.aio.delegate import per_chat_id, create_open | |
import picam | |
""" | |
$ python3.5 countera.py <token> |
OlderNewer