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.Xml.Serialization; | |
using System.IO; | |
public static class Program | |
{ | |
void Main() | |
{ | |
AcceptLatestPackages(@"C:\projects\MergeMigrations_AddTableB\"); | |
} | |
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 OxyPlotExtensions | |
{ | |
public static void AddScatterSeries(this PlotModel model, IEnumerable<double> xSeries, IEnumerable<double> ySeries) | |
{ | |
model.AddScatterSeries(xSeries, ySeries, OxyColors.Automatic); | |
} | |
public static void AddScatterSeries(this PlotModel model, IEnumerable<double> xSeries, IEnumerable<double> ySeries, OxyColor color) | |
{ | |
var scatterSeries = new ScatterSeries() |
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
void Main() | |
{ | |
var model = new PlotModel { Title = "Test" }; | |
var xseries = new double[] { 1, 2, 3 }; | |
var yseries1 = new double[] { 1, 2, 3 }; | |
var yseries2 = new double[] { 0.5, 1, 1.5 }; | |
model.AddScatterSeries(xseries, yseries1, OxyColors.Red); | |
model.AddHighlightedPoint(2.5, 2.5, OxyColors.Blue); |
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 LemmaSharp; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Text.RegularExpressions; |
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
private static void RegisterServices(IKernel kernel) | |
{ | |
// The ProxyGenerator is part of Castle and will emit code at runtime. This code needs to be cached | |
// or there will be zero improvement in performance. It's cached by default, per instance of the | |
// ProxyGenerator. | |
kernel.Bind<ProxyGenerator>() | |
.ToConstant(new ProxyGenerator()); | |
// The ChannelFactoryCache will cache the creation of the ChannelFactory, which is slow because it | |
// requires the use of reflection. |
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
// Modified from examples at luisfsgoncalves.wordpress.com/2012/02/28/mixin-up-ninject-castle-dynamic-proxy-and-wcf-part-iii/ | |
// to use a channel factory cache. | |
public static class ToWcfClientExtensions | |
{ | |
public static IBindingWhenInNamedWithOrOnSyntax<T> ToWcfClient<T>(this IBindingToSyntax<T> syntax) where T : class | |
{ | |
return syntax.ToMethod(ctx => ctx.Kernel | |
.Get<ProxyGenerator>() | |
.CreateInterfaceProxyWithoutTarget<T>(new WcfProxyWithDisposalInterceptor<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
void Main() | |
{ | |
// Uses Oxyplot.WindowsForms. | |
var noise = new PerlinNoise(); | |
var results = new List<double>(); | |
for(double i = 0.0d; i < 100; i += 0.01d) | |
{ | |
results.Add(noise.Noise(i)); | |
} |
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
namespace SparkLines.Hubs | |
{ | |
public class SparklinesHub : Hub | |
{ | |
static ConcurrentDictionary<string, List<int>> Values = new ConcurrentDictionary<string, List<int>>(); | |
static int maximumValues = 49; | |
public void PublishMetric(string name, int value) | |
{ |
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
$.connection.hub.proxies.sparklineshub.server.publishMetric("noise", 1000) |
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
// Ninject | |
private static IKernel CreateKernel() | |
{ | |
var kernel = new StandardKernel(); | |
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); | |
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>(); | |
// Singleton | |
kernel.Bind<ILog>().ToMethod(c => LogManager.GetLogger(typeof(ProjectService))).InSingletonScope(); | |
// WCF Scope |
OlderNewer