Skip to content

Instantly share code, notes, and snippets.

View huoxudong125's full-sized avatar
💭
I may be slow to respond.

Frank Huo huoxudong125

💭
I may be slow to respond.
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<log4net debug="false">
<appender name="file-appender" type="log4net.Appender.FileAppender+MinimalLock">
<file value="log-file.txt" />
<appendToFile value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
@huoxudong125
huoxudong125 / NetworkShareAccesser
Last active February 25, 2021 15:27
Network Share Accesser
/// <summary>
/// Provides access to a network share.
/// </summary>
public class NetworkShareAccesser : IDisposable
{
private string _remoteUncName;
private string _remoteComputerName;
public string RemoteComputerName
{
CREATE PROC dbo.DropJob
@JobName AS VARCHAR(200) = NULL
AS
DECLARE @msg AS VARCHAR(500);
IF @JobName IS NULL
BEGIN
SET @msg = N'A job name must be supplied for parameter @JobName.';
RAISERROR(@msg,16,1);
RETURN;
#include <windows.h>
#include <string>
#include <vector>
#include <stack>
#include <iostream>
#include <map>
#include <regex>
using namespace std;
bool IsExistDirectory(const std::wstring& dirName_in)
{
DWORD ftyp = GetFileAttributes(dirName_in.c_str());
if (ftyp == INVALID_FILE_ATTRIBUTES)
return false; //something is wrong with your path!
if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
return true; // this is a directory!
return false; // this is not a directory!
//! Byte swap unsigned short
static uint16_t swap_uint16(uint16_t val)
{
return (val << 8) | (val >> 8);
}
//! Byte swap short
static int16_t swap_int16(int16_t val)
{
return (val << 8) | ((val >> 8) & 0xFF);
@huoxudong125
huoxudong125 / MetroButton
Last active September 2, 2015 02:38 — forked from alimbada/gist:3083937
MetroButton For WPF
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style
x:Key="ButtonFocusVisual">
<Setter
Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2" />
</ControlTemplate>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace UserCtrl
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
@huoxudong125
huoxudong125 / WPF ComboBox Style.xml
Last active April 20, 2022 13:08 — forked from hansmaad/gist:9187633
WPF Flat Combo Box Style
<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>