This file contains 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 class DeclensionGenerator | |
{ | |
/// <summary> | |
/// Возвращает слова в падеже, зависимом от заданного числа | |
/// </summary> | |
/// <param name="number">Число от которого зависит выбранное слово</param> | |
/// <param name="nominativ">Именительный падеж слова. Например "день"</param> | |
/// <param name="genetiv">Родительный падеж слова. Например "дня"</param> | |
/// <param name="plural">Множественное число слова. Например "дней"</param> | |
/// <returns></returns> |
This file contains 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 class QueryableExtensions | |
{ | |
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo(); | |
private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryCompiler"); | |
private static readonly PropertyInfo NodeTypeProviderField = QueryCompilerTypeInfo.DeclaredProperties.Single(x => x.Name == "NodeTypeProvider"); | |
private static readonly MethodInfo CreateQueryParserMethod = QueryCompilerTypeInfo.DeclaredMethods.First(x => x.Name == "CreateQueryParser"); |
This file contains 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
split -l 20000 /Users/kanekt/KANekT/sql/_.sql |
This file contains 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 class AccessorCache | |
{ | |
private static readonly Hashtable Accessors = new Hashtable(); | |
private static readonly Hashtable CallSites = new Hashtable(); | |
private static CallSite<Func<CallSite, object, object>> GetCallSiteLocked(string name) | |
{ | |
var callSite = (CallSite<Func<CallSite, object, object>>)CallSites[name]; | |
if (callSite == null) |
This file contains 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
Подскажите плиз как можно выполнить определенную функцию несколько раз с разными промежутками времени между запусками. | |
Типа сначала короткие просежутки потом больше больше. | |
Rx.Observable.range(1,3) | |
.delayWhen((i) => Rx.Observable.interval(i * 5000)) | |
.subscribe(console.log.bind(console)) | |
Или если нужен Random (от 0 до 5 секунд) | |
Rx.Observable.range(1,3) | |
.delayWhen((i) => Rx.Observable.interval(Math.random() * 5000)) |
This file contains 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
var watch = System.Diagnostics.Stopwatch.StartNew(); | |
watch.Stop(); | |
var elapsedMs = watch.ElapsedMilliseconds; |
This file contains 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
<div class="input-group spinner"> | |
<input type="text" class="form-control" value="@Model"> | |
<div class="input-group-btn-vertical"> | |
<span class="btn btn-default"><i class="glyphicon glyphicon-chevron-up"></i></span> | |
<span class="btn btn-default"><i class="glyphicon glyphicon-chevron-down"></i></span> | |
</div> | |
</div> |
This file contains 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
// Get any subscribed users that should be notified (banned users are excluded) | |
$query = array( | |
'SELECT' => 'u.id, u.email, u.notify_with_post, u.language, u.username', | |
'FROM' => 'users AS u', | |
'JOINS' => array( | |
array( | |
'INNER JOIN' => 'subscriptions AS s', | |
'ON' => 'u.id=s.user_id' | |
), | |
array( |
This file contains 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
$ext_jQuery_UI->add_jQuery_UI("Button"); |