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
| package org.sprocky.util; | |
| import org.apache.commons.lang3.ArrayUtils; | |
| import org.sprocky.NameMappingConvention; | |
| import org.sprocky.ResultSetColumn; | |
| import org.sprocky.ResultSetColumnIgnore; | |
| import org.sprocky.impl.DefaultNameMappingConvention; | |
| import java.io.InputStream; | |
| import java.io.Reader; |
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
| package com.sigicn.widget; | |
| import javax.inject.Inject; | |
| import android.content.Context; | |
| import android.os.Handler; | |
| import android.os.Vibrator; | |
| import android.util.AttributeSet; | |
| import android.view.MotionEvent; | |
| import android.widget.AdapterView; |
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
| using System.Collections.Generic; | |
| using CreateAndRealize.Common; | |
| using Dapper.Contrib.Extensions; | |
| using SqlKata; | |
| using System.Linq; | |
| namespace CreateAndRealize.Aahk.Taxi.Infrastructure.Dal | |
| { | |
| public class BaseDal<TEntity> | |
| where TEntity: class |
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
| public static IEnumerable<PropertyInfo> GetPropertiesWithAttributes<T, TAttr>(this object obj) | |
| { | |
| return GetPropertiesWithAttributes(obj, typeof(T), typeof(TAttr)); | |
| } | |
| public static IEnumerable<PropertyInfo> GetPropertiesWithAttributes(this object obj, Type type, Type attrType) | |
| { | |
| return type.GetProperties() | |
| .Where(x => x.GetCustomAttributes(true) | |
| .Any(attr => attr.GetType() == attrType) |
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
| using System.Collections.Generic; | |
| class QueueByStacks<T> | |
| { | |
| private Stack<T> _inStack, _outStack; | |
| public QueueByStacks() | |
| { | |
| _inStack = new Stack<T>(); | |
| _outStack = new Stack<T>(); |
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
| # Description: Boxstarter Script | |
| # Author: Alex Ho | |
| # | |
| # Install boxstarter: | |
| # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
| # | |
| # You might need to set: Set-ExecutionPolicy RemoteSigned | |
| # | |
| # Run this boxstarter by calling the following from an **elevated** command-prompt: | |
| # start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST> |
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
| using System; | |
| public class Program { | |
| public static void Main() { | |
| var matrices = new []{ | |
| new [] { | |
| "00000", | |
| "00000", | |
| "00000", | |
| "00000", |
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
| using System; | |
| using System.Linq; | |
| public class Program { | |
| public static void Main() { | |
| var matrices = new []{ | |
| new [] { | |
| "11011", | |
| "01101", | |
| "11110", |
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
| const f = a => { | |
| let max = 0; | |
| const getLocalMax = a => { | |
| let localMax = 0, maxJ = a[0].length -1; | |
| const reset = i => { | |
| const size = (i+1)*(maxJ+1); | |
| if(size > localMax) | |
| localMax = size; | |
| } |
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
| using System; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| public static class ReflectionUtils | |
| { | |
| public static MethodInfo GetMethod<TInput, TOutput>(Expression<Func<TInput, TOutput>> methodCallExpression) => GetMethodByLambdaExpression(methodCallExpression); | |
| public static MethodInfo GetMethod<TInput>(Expression<Action<TInput>> methodCallExpression) => GetMethodByLambdaExpression(methodCallExpression); |
OlderNewer