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
cmake_minimum_required (VERSION 2.6) | |
project (lua) # project here actually means solution in premake | |
if(WIN32) | |
add_definitions( -D_CRT_SECURE_NO_WARNINGS ) | |
endif() | |
# 1. lua static library | |
# how to rename library name? | |
add_library (lualib STATIC lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c) |
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
use strict; | |
my $targetPage = $ARGV[0]; #http://www.kingtoo.com/reg/whois.asp?domain=douban.com | |
print $targetPage . "\n"; | |
my @page = `curl $targetPage | iconv -f gb2312 -t utf8`; | |
chomp @page; | |
my $domainStatus; | |
for my $line (@page) | |
{ |
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
HANDLE GetProcessByName(const TCHAR* szProcessName) | |
{ | |
if(szProcessName == NULL) return NULL; | |
CString strProcessName = szProcessName; | |
DWORD aProcesses[1024], cbNeeded, cProcesses; | |
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) ) | |
return NULL; | |
// Calculate how many process identifiers were returned. |
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
#pragma once | |
#include <atomic> | |
#include <algorithm> | |
#include "AlignAs.H" | |
/* | |
* 1. release-acquire memory order | |
* 2. false sharing and cache line | |
* 3. alignas | |
* |
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
int main() { | |
00B61400 push ebp | |
00B61401 mov ebp,esp | |
00B61403 sub esp,0C0h // esp指向栈顶 | |
00B61409 push ebx | |
00B6140A push esi | |
00B6140B push edi | |
00B6140C lea edi,[ebp-0C0h] | |
00B61412 mov ecx,30h //C0h 除以4,就是30h,因为rep stos用的是dword | |
00B61417 mov eax,0CCCCCCCCh //设置返回值为默认值:无效 |
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
// StlAlgo.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <vector> | |
#include <array> | |
#include <algorithm> | |
#include <iterator> // ostream_iterator | |
#include <iostream> |
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> | |
using namespace std; | |
// .data - read-write data | |
int rwdata = 100; | |
// .rodata - read-only data | |
const char* rodata = "hello, world"; |
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
function printa(arr) | |
for _, v in ipairs(arr) do | |
io.write(v .. " ") | |
end | |
io.write("\n") | |
end | |
-- use consecutive number to represent the colors, like: | |
-- red: 1 |
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
LIBS = {} | |
DEPS = {} | |
EXPORTS = {'bar'} | |
bar = {} | |
function bar.use_nonpopular_bar() | |
print 'bar.use_nonpopular_bar' | |
end |
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
digraph | |
{ | |
subgraph cluster_solution | |
{ | |
label="solution" | |
App; | |
foo; | |
baz; | |
} | |
App -> foo; |
NewerOlder