git add --patchgit fetch origin master| private static Dictionary<Type, Dictionary<string, object>> _propertyAccess = new Dictionary<Type, Dictionary<string, object>>(); | |
| private static void CacheProperties<T>() | |
| { | |
| if (_propertyAccess.ContainsKey(typeof(T))) | |
| return; | |
| _propertyAccess.Add(typeof(T), new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase)); | |
| foreach (var prop in typeof(T).GetProperties()) |
| package main | |
| import "fmt" | |
| // fib returns a function that returns | |
| // successive Fibonacci numbers. | |
| func fib() func(int) int { | |
| a, b := 0, 1 | |
| i := 0 | |
| return func(x int) int { |
| private static void LoadAndInit(string assemblyPath, string className) | |
| { | |
| var assembly = System.Reflection.Assembly.LoadFile(assemblyPath); | |
| RuntimeHelpers.RunClassConstructor(assembly.GetType(className).TypeHandle); | |
| } |
| public class ConfigSettings : System.Dynamic.DynamicObject | |
| { | |
| private static readonly System.Lazy<ConfigSettings> _settings = new Lazy<ConfigSettings>(() => new ConfigSettings()); | |
| private ConfigSettings() | |
| { } | |
| public static dynamic Instance { get { return _settings.Value; } } | |
| public override bool TryGetMember(System.Dynamic.GetMemberBinder binder, out object result) |
| choco version all | |
| choco upgrade all --noop | |
| choco outdated |
| choco install googlechrome | |
| choco install git | |
| choco install TortoiseGit | |
| choco install 7zip | |
| choco install sysinternals | |
| choco install HeidiSQL | |
| choco install winscp | |
| choco install putty | |
| choco install sublimetext3 | |
| choco install notepadplusplus |
| int longest_increasing_subsequence(vector<int>& nums) | |
| { | |
| map<int, int> table; | |
| int tmax = 0; | |
| for(int i = 0; i < nums.size(); i++) | |
| { | |
| int pmax = 0; | |
| for(map<int, int>::iterator itr = table.begin(); itr != table.end() && itr->first < nums[i]; itr++) |
| int longest_increasing_subsequence(vector<int>& nums) | |
| { | |
| map<int, int> table; | |
| int tmax = 0; | |
| for(int i = 0; i < nums.size(); i++) | |
| { | |
| int pmax = 0; | |
| for(map<int, int>::iterator itr = table.begin(); itr != table.end() && itr->first < nums[i]; itr++) |
| int longest_increasing_subsequence_v2(vector<int>& nums) | |
| { | |
| map<int, set<int>> table; | |
| int tmax = 0; | |
| for(int i = 0; i < nums.size(); i++) | |
| { | |
| int pmax = 1; | |
| for(map<int, set<int>>::reverse_iterator itr = table.rbegin(); itr != table.rend(); itr++) |