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
| char path[MAX_PATH] = { 0 }; | |
| GetModuleFileNameA(NULL, path, MAX_PATH); | |
| strrchr(path, '\\')[0] = '\0'; |
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
| inline string exe_directory(const string & filename) | |
| { | |
| char directory[MAX_PATH] = { 0 }; | |
| GetModuleFileNameA(NULL, directory, MAX_PATH); | |
| strrchr(directory, '\\')[0] = '\0'; | |
| return filesystem::absolute( | |
| filesystem::path(filename), | |
| filesystem::path(directory) | |
| ).string(); |
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 <iostream> | |
| #include <boost/filesystem.hpp> | |
| #include <boost/property_tree/ini_parser.hpp> | |
| using namespace boost; | |
| using namespace std; | |
| // | |
| class CIniFile | |
| { | |
| // |
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
| // | |
| list<string> Split(string s, string delimiter) | |
| { | |
| list<string> result; | |
| unsigned int beg = 0, pos = 0; | |
| while((pos=s.find(delimiter, beg)) != string::npos) | |
| { | |
| result.push_back(s.substr(beg, pos-beg)); | |
| beg = pos + delimiter.length(); | |
| } |
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
| function loadScript(url, onLoaded) { | |
| var loaded = false; | |
| var scriptTag = document.createElement('script'); | |
| scriptTag.src = url; | |
| scriptTag.onload = scriptTag.onreadystatechange = function(){ | |
| if(!loaded && onLoaded) { | |
| loaded = true; | |
| onLoaded(); | |
| scriptTag.onload = scriptTag.onreadystatechange = null; | |
| } |
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
| ;(function ($, window, document, undefined) { | |
| var pluginName = 'pluginName', //自定义一个插件名称 | |
| defaults = { //定义插件的默认属性 | |
| }; | |
| function Plugin(element, options) { | |
| this.element = element; //缓存element,让原型链上的方法都可以访问 | |
| this.options = $.extend({}, defaults, options); //默认属性和自定义熟悉合并处理 |
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 "resource.h" | |
| // | |
| INT_PTR CALLBACK DialogProc( | |
| HWND hwnd, | |
| UINT uMsg, | |
| WPARAM wParam, | |
| LPARAM lParam |
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
| CDialogBasedDlg dlg; | |
| if(dlg.Create( CDialogBasedDlg::IDD )) | |
| { | |
| dlg.ShowWindow( SW_HIDE ); | |
| m_pMainWnd = &dlg; | |
| INT_PTR nResponse = dlg.RunModalLoop(); | |
| } |
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 "stdafx.h" | |
| #include <urlmon.h> | |
| #pragma comment(lib, "urlmon.lib") | |
| typedef HRESULT STDAPICALLTYPE MYSHOWHTMLDIALOGFN(HWND hwndParent, IMoniker * pmk, VARIANT * pvarArgIn, TCHAR * pchOptions, VARIANT * pvArgOut); | |
| // | |
| int APIENTRY WinMain(HINSTANCE hInstance, | |
| HINSTANCE hPrevInstance, |
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
| #coding:utf-8 | |
| import pyaudio, wave | |
| frame_rate = 8000 | |
| sample_count = 512 | |
| channel_count = 1 | |
| pcm_file = open("1.pcm", "wb+") | |
| audio = pyaudio.PyAudio() |