This file contains hidden or 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
#define SOKOL_IMPL | |
#define SOKOL_GLCORE | |
#include <SDL.h> | |
#include <sokol_gfx.h> | |
#include <sokol_log.h> | |
#include <iostream> |
This file contains hidden or 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 ctypes | |
from PyQt5.QtWidgets import QApplication, QWidget | |
from PyQt5.QtGui import QFontDatabase, QFont, QFontMetrics, QImage, QPainter, QPen | |
from PyQt5.QtCore import Qt, QRectF | |
if __name__ == '__main__': | |
app = QApplication(sys.argv) |
This file contains hidden or 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 SetForegroundWindowInternal(HWND hWnd) | |
{ | |
if (!::IsWindow(hWnd)) return; | |
BYTE keyState[256] = { 0 }; | |
//to unlock SetForegroundWindow we need to imitate Alt pressing | |
if (::GetKeyboardState((LPBYTE)&keyState)) | |
{ | |
if (!(keyState[VK_MENU] & 0x80)) | |
{ |
This file contains hidden or 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 <tlhelp32.h> | |
#include <psapi.h> | |
#include <iostream> | |
#include <utility> | |
#include <string> | |
#include <array> | |
#include <vector> | |
#include <random> |
This file contains hidden or 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
// | |
// a basic FFMpeg video player | |
// FFMpeg 2.2.2 | |
// SFML 2.1 | |
// XCode 5.1.1 | |
#include <SFML/Audio.hpp> | |
#include <SFML/Graphics.hpp> |
This file contains hidden or 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
print("Begin SendMail") | |
# Import smtplib for the actual sending function | |
import smtplib | |
# Import the email modules we'll need | |
from email.mime.text import MIMEText | |
textfile = "/Users/JHQ/Desktop/msg.txt" | |
# Open a plain text file for reading. For this example, assume that |
This file contains hidden or 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 <thread> | |
#include <mutex> | |
#include <condition_variable> | |
std::mutex g_mut; | |
std::condition_variable g_newMsgCondition; | |
void AddNewDlgMessage(const std::wstring& t) | |
{ |
This file contains hidden or 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
#!/bin/bash | |
echo "=======ExportUserReport bash===========" | |
Root="http://10.130.19.139/19659/" | |
Root2="http://10.164.7.76/19659/" | |
DateBegin=$1 | |
TargetRoot="F:/UserReport/" | |
d=$DateBegin | |
while true; do | |
echo $d |
This file contains hidden or 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
/// iterate from fromD(like "2014-04-02") to toD("2014-05-02") | |
std::string tpStr = fromD; | |
do { | |
//std::cout << tpStr << std::endl; | |
ParseIntoUserInfoDB(tpStr, root, order); | |
std::tm tm; | |
std::stringstream ss(tpStr + " 0:0:1"); | |
ss >> std::get_time(&tm, "%Y-%m-%d %H:%M:%S"); | |
auto tp = std::chrono::system_clock::from_time_t(std::mktime(&tm)); |
This file contains hidden or 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
bool getline(FILE* f, std::string& line) | |
{ | |
line.clear(); | |
char c = 0; | |
do { | |
c = fgetc(f); | |
if (c == EOF) |
NewerOlder