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 StrToDecInt(const char* str) | |
{ | |
static const int kMAX = (int)((unsigned)~0 >> 1); | |
static const int kMIN = -(int)((unsigned)~0 >> 1) - 1; | |
static const int kMAX_DIV = (int)((unsigned)~0 >> 1) / 10; | |
static const int kMIN_DIV = (int)((((unsigned)~0 >> 1) + 1) / 10); | |
static const int kMAX_R = (int)((unsigned)~0 >> 1) % 10; | |
static const int kMIN_R = (int)((((unsigned)~0 >> 1) + 1) % 10); | |
int n = 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
int StrToDecInt(const char* str) | |
{ | |
static const int kMAX = (int)((unsigned)~0 >> 1); | |
static const int kMIN = -(int)((unsigned)~0 >> 1) - 1; | |
static const int kMAX_DIV = (int)((unsigned)~0 >> 1) / 10; | |
static const int kMIN_DIV = (int)((((unsigned)~0 >> 1) + 1) / 10); | |
static const int kMAX_R = (int)((unsigned)~0 >> 1) % 10; | |
static const int kMIN_R = (int)((((unsigned)~0 >> 1) + 1) % 10); | |
int n = 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
const unsigned int ID_MSGBOX_STATIC = 0x0000ffff; | |
const wchar_t kMsgBoxTitle[] = L"Timed Message Box"; | |
int second_left = 0; | |
void CALLBACK msgbox_timer(PTP_CALLBACK_INSTANCE instance, void* context, | |
PTP_TIMER timer) | |
{ | |
HWND hwnd = ::FindWindow(nullptr, kMsgBoxTitle); | |
if (hwnd) { | |
if (second_left == 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
void CALLBACK OverlappedCompletionRoutine(PTP_CALLBACK_INSTANCE instance, | |
PVOID context, | |
PVOID overlapped, | |
ULONG io_result, | |
ULONG_PTR bytes_transferred, | |
PTP_IO io) | |
{ | |
auto ov = static_cast<OVERLAPPED*>(overlapped); | |
std::cout << "read " << bytes_transferred << std::endl; | |
std::cout << static_cast<char*>(context); |
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
def GetMatePrefList(pref_list, person): | |
for i in range(len(pref_list)): | |
if person == pref_list[i][0]: | |
return pref_list[i][1] | |
def Match(men_pref_list, women_pref_list): | |
free_man = [] | |
free_woman = [] | |
for man in men_pref_list: | |
free_man.append(man[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
typedef std::string Record; | |
class GTAClient { | |
public: | |
virtual ~GTAClient() {} | |
virtual bool Filter(const Record&) | |
{ | |
return true; | |
} |
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
/****************************************************************************** | |
Module: Singleton.cpp | |
Notices: Copyright (c) 2008 Jeffrey Richter & Christophe Nasarre | |
******************************************************************************/ | |
#include "resource.h" | |
#include "..\CommonFiles\CmnHdr.h" /* See Appendix A. */ | |
#include <windowsx.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 <tchar.h> | |
#include <algorithm> | |
#include <cstdlib> | |
#include <iostream> | |
#include <queue> | |
#include <string> | |
#include <process.h> | |
#include <Windows.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
if(has("win32") || has("win95") || has("win64") || has("win16")) | |
let g:vimrc_iswindows=1 | |
let g:iswindows=1 | |
else | |
let g:vimrc_iswindows=0 | |
let g:iswindows=0 | |
endif | |
autocmd BufEnter * lcd %:p:h | |
set nocompatible |
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 Partition(int a[], int left, int right) | |
{ | |
int piv = a[left]; | |
int l = left, r = right + 1; | |
do | |
{ | |
do | |
{ | |
++l; |
OlderNewer