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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace FileHlpr | |
{ | |
internal class FileInformation |
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
/* | |
Copyright (c) 2010 Microsoft Corporation. All rights reserved. | |
Use of this sample source code is subject to the terms of the Microsoft license | |
agreement under which you licensed this sample source code and is provided AS-IS. | |
If you did not accept the terms of the license agreement, you are not authorized | |
to use this sample source code. For the terms of the license, please see the | |
license agreement between you and Microsoft. | |
*/ | |
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.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Web.Mvc; | |
namespace KI.Web.Admin.Common.Validation | |
{ | |
public class RequiredIfGreaterValidator : DataAnnotationsModelValidator<RequiredIfGreaterAttribute> | |
{ | |
public RequiredIfGreaterValidator(ModelMetadata metadata, ControllerContext context, RequiredIfGreaterAttribute greaterAttribute) |
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
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Will generate 70M of Guids.\n\r Flushing timestamps for each 100k guids in one thread"); | |
long i = 0; | |
long max = 120 * 1000000; | |
long quant = max / 100l; | |
var list = new Guid[max]; |
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 IQueryable<T> SortBy<T>(this IQueryable<T> source, string propertyName) | |
{ | |
propertyName = propertyName.Trim(); | |
if (source == null) | |
{ | |
throw new ArgumentNullException("source"); | |
} | |
// DataSource control passes the sort parameter with a direction | |
// if the direction is descending | |
int descIndex = propertyName.IndexOf(" DESC"); |
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.Diagnostics; | |
using Fasterflect; | |
using RestSharp; | |
namespace xxx.xxx.Rest.Client | |
{ | |
public static partial class RestClientExtensions | |
{ | |
public static ClientResponse ExecuteItDynamic(this IRestClient client, IRestRequest request) |
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
/// <summary> | |
/// Controls access to the cached values. | |
/// </summary> | |
private static ReaderWriterLockSlim mutex = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); | |
/// <summary> | |
/// Gets a values from the cache, adding it if required. | |
/// </summary> | |
/// <typeparam name="T">The type of the value.</typeparam> | |
/// <param name="cacheParameters">The name of the value used to identify it in the cache.</param> |
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
protected static bool IsListSuitableForSimpleAdmin(IList<Record> records) | |
{ | |
bool returnValue = false; | |
if (records != null) | |
{ | |
int sundayCount = 0; | |
int mondayCount = 0; | |
int tuesdayCount = 0; | |
int wednesdayCount = 0; | |
int thursdayCount = 0; |
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
/// <reference path="_references.js" /> | |
(function (window, undefined) { | |
// Define the "MyApp" namespace | |
var MyApp = window.MyApp = window.MyApp || {}; | |
// TodoItem class | |
var entityType = "TodoItem:#TodoApp.Models"; | |
MyApp.TodoItem = function(data) { | |
var self = this; |
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
// Variable usage: (* marks globals, all other variables are used for various purposes by various parts of the code) | |
// a = calculator | |
// b* = random data | |
// c* = main canvas | |
// d* = main canvas style / main canvas context | |
// e = calculator | |
// f = | |
// g* = main canvas composite operations | |
// h* = 300 (height) | |
// i = counter |