Skip to content
View BizResult.cs
/// <summary>
/// 业务逻辑 返回结果
/// </summary>
/// <remarks>
/// 建议以本类型为返回对象的方法, 不要返回 null 对象.
///
/// 提供三种方法创建本实例:
/// 直接实例:
/// new BizResult<Dish>(...);
///
View SerializableDictionary.cs
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace Tup.Utilities
{
/// <summary>
/// 支持XML序列化的泛型Dictionary类
View SqlMapperExtensions.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq;
using System.Reflection;
namespace Tup.Common.Dapper
{
View ExecuteAction.cs
/// <summary>
/// Async Execute Command Action
/// </summary>
/// <param name="startFileName"></param>
/// <param name="startFileArg"></param>
/// <param name="msgAction"></param>
/// <returns></returns>
public static Task<bool> ExecuteActionAsync(string startFileName, string startFileArg, Action<string> msgAction)
{
ThrowHelper.ThrowIfNull(msgAction, "msgAction");
View ConsistentHashing.cs
/// <summary>
/// 一致性 Hash 算法
/// </summary>
class ConsistentHashing
{
List<KeyValuePair<uint, string>> _serList = new List<KeyValuePair<uint, string>>();
public ConsistentHashing(string[] serList)
{
if (serList == null || serList.Length == 0)
View C# radix tree
public class Tree
{
/// <summary>
/// store the tree's root
/// </summary>
private Node _root;
/// <summary>
/// construct a new tree with it's root
/// </summary>
View 0.suffixtree.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SuffixTreeAlgorithm
{
public class SuffixTree
{
View ConcurrentConsumerQueue.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Tup.Utilities
{
/// <summary>
/// 并行消费者队列
View Netflix.js
(function () {
'use strict';
var clientKey = "XXXXXXXXXXXXXX";
var clientSecret = "XXXXXXXXXXXX";
var oauthToken;
var oauthSecret;
var userId;
var loginUrl;
var applicationName;
Something went wrong with that request. Please try again.