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
extern int MonthsToLimitZone = 8; | |
extern double volume = 0.01; | |
extern double spaceBetweenOrders = 0.001; | |
extern int MagicNumber = 1234567890; | |
extern double profitInCurrency = 0.01; | |
extern double stopLossOrderLimit = 5.0; | |
double lowestDay, highestDay; | |
double beginOfSellZone, endOfSellZone; | |
double beginOfBuyZone, endOfBuyZone; |
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
extern int BarCount = 100; | |
extern int MagicNumber = 123456789; | |
extern double InitialVolume = 0.01; | |
extern int SlipPage = 3; | |
extern int MaxOrders = 40; | |
extern double MinimumDistanceForNewOrder = 70; | |
extern bool AutoConfig = false; | |
double lowest, highest; | |
double buyVolume, sellVolume; |
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 TestDaoInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) | |
{ | |
container.Register( | |
AllTypes.FromAssemblyNamed("YourProduct.DataAccess") | |
.BasedOn(typeof(IDao<,>)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Select((t, baseType) => t.GetInterfaces()) | |
.BasedOn(typeof(IDao<>)) |
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 LocalizedModelBinder : DefaultModelBinder | |
{ | |
private readonly CultureInfo _cultureInfo; | |
public LocalizedModelBinder(string cultureName) | |
{ | |
_cultureInfo = CultureInfo.GetCultureInfo(cultureName); | |
} | |
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) |
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
using System.Linq; | |
using System.Text.RegularExpressions; | |
public static class StringExtensions | |
{ | |
public static string ToUpper(this string name, string separator) | |
{ | |
string upper = Regex | |
.Matches(name, "[A-Z][a-z]+") | |
.Cast<Match>() |
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 TypeExtensions | |
{ | |
public static bool IsNullableOrType<T>(this Type type) | |
where T : struct | |
{ | |
return (type == typeof(T) || type == typeof(T?)); | |
} | |
} |
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 TypeExtensions | |
{ | |
public static Type GetValueTypeIfNullable(this Type type) | |
{ | |
return type.IsNullable() ? type.GetGenericArguments()[0] : type; | |
} | |
public static bool IsNullable(this Type type) | |
{ | |
return (type.IsGenericType && typeof(Nullable<>) == type.GetGenericTypeDefinition()); |
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 TypeExtensions | |
{ | |
public static bool IsNullableOrType<T>(this Type type) | |
where T : struct | |
{ | |
return (type == typeof(T) || type == typeof(T?)); | |
} | |
} | |
public static class StringExtensions |
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
using System.Web.Mvc; | |
using Newtonsoft.Json; | |
namespace ActionResults | |
{ | |
public class ExtStoreResult : ActionResult | |
{ | |
public virtual string StoreName { get; set; } | |
public virtual object StoreData { get; set; } |
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 Competencia | |
{ | |
public Competencia(int mes, int ano) | |
{ | |
try | |
{ | |
new DateTime(ano, mes, 1); | |
} | |
catch (Exception) | |
{ |
OlderNewer