Postsread more
Octopress - A blogging feamework for hackers.
Octopress是ㄧ利用Jekll部落格引擎開發的部落格系統,能簡易的架設、擴充、客製、與套版,因其最後是生成靜態網頁,因此能很輕易的在許多服務上做部署,像是Github、Heroku、與Rsync等。
Postsread more
SuperBenchmarker - A load generator command-line tool for testing websites and HTTP APIs
SuperBenchmarker 是ㄧ開放源碼的壓力測試命令列工具。用.NET Framework 4.5開發而成。
Posts
[C++]使用Global Flags偵測記憶體越界錯誤
int _tmain(int argc, _TCHAR* argv[]) { int m_len = 5; char *m_p = (char *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, m_len);
m_p[m_len] = 0;
HeapFree (GetProcessHeap (),0, m_p);
return 0; }
read morePosts
[C++]使用Visual Leak Detector for Visual C++ 2008/2010輔助偵測程式中記憶體洩漏的問題
#include “stdafx.h” #include “vld.h”
int _tmain(int argc, _TCHAR* argv[]) { char* buffer = new char[512]; return 0; }
read morePosts
[C++]event_source attribute的功用
void BindingEvent(){ __hook(&TestObj::Executed,this,&TestObj::OnExecuted); } void UnBindingEvent(){ __hook(&TestObj::Executed,this,&TestObj::OnExecuted); } };
read morePosts
[C++]使用nsiqcppstyle輔助檢查C/C++的Coding Style
[Example] nsiqcppstyle . nsiqcppstyle targetdir nsiqcppstyle -f filefilterpath targetfilepath
[Options] -h Show this help -v Show detail ouput(verbose mode) -r Show rule list -o path Set the output path. It’s only applied when the output is csv or xml. -f path Set the filefilter path. If not provided, it uses the default fi lterpath (target/filefilter.txt) If you provide the file path(not folder path) for the target, -f option should be provided.
read morePosts
[C#][Control]BitsControl概念與簡易實做
int bitWith = width / 8; bit8.Width = bitWith; bit7.Width = bitWith; bit6.Width = bitWith; bit5.Width = bitWith; bit4.Width = bitWith; bit3.Width = bitWith; bit2.Width = bitWith; bit1.Width = bitWith; int bitHeight = flowLayoutPanel1.ClientSize.Height - bit8.Margin.Top * 2; bit8.Height = bitHeight; bit7.Height = bitHeight; bit6.Height = bitHeight; bit5.Height = bitHeight; bit4.Height = bitHeight; bit3.Height = bitHeight; bit2.Height = bitHeight; bit1.Height = bitHeight; }</pre> public void LoadBitsState(string hexValue) { LoadBitsState(Convert.ToInt32(hexValue, 16)); }</pre> namespace WindowsFormsApplication6 { public partial class BitsControl : UserControl { public BitsControl() { InitializeComponent(); }
read morePosts
[C#][Control]指撥開關控制項的概念與簡易實作
private SwitchState _state; public SwitchState State { get { return _state; } set { if (_state == value) return; _state = value; AdjustOnOffButton(); } } private void AdjustOnOffButton() { switch (State) { case SwitchState.On: OnOffButton.Dock = DockStyle.Top; break; case SwitchState.Off: OnOffButton.Dock = DockStyle.Bottom; break; default: break; } }</pre> private void OnOffButton_Click(object sender, EventArgs e) { Toggle(); }</pre> namespace WindowsFormsApplication3 { public partial class SwitchButton : UserControl {
public enum SwitchState { On, Off } private SwitchState _state; public SwitchState State { get { return _state; } set { if (_state == value) return; _state = value; AdjustOnOffButton(); } } public SwitchButton() { InitializeComponent(); State = SwitchState.
read morePosts
[C#][WPF]WPF程式接收視窗訊息
namespace WpfApplication2 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); this.SourceInitialized += new EventHandler(MainWindow_SourceInitialized); }
void MainWindow_SourceInitialized(object sender, EventArgs e) { IntPtr hwnd = new WindowInteropHelper(this).Handle; HwndSource.FromHwnd(hwnd).AddHook(new HwndSourceHook(WndProc)); } IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { switch (msg) { //... } return IntPtr.Zero; } } }
read more