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
| #define USE_EXPRESSION_INFO // I am here! | |
| namespace NServiceBus | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Threading.Tasks; |
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 BenchmarkDotNet.Attributes; | |
| namespace Playground | |
| { | |
| [MemoryDiagnoser] | |
| public class DelegateVsInterfaceStruct | |
| { | |
| [Params(10, 100, 1000)] public int ArraySize; |
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
| Func<Func<T,T,T>, Func<T,T,T>> Mapping<T>(Func<T,T> map) | |
| { | |
| return reduce => (sum, item) => reduce(sum, map(item)); | |
| } | |
| Func<Func<T,T,T>, Func<T,T,T>> Filtering<T>(Func<T,bool> condition) | |
| { | |
| return reduce => (sum, item) => condition(item) ? reduce(sum, item) : sum; | |
| } |
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
| import Html exposing (div, button, text, input, p) | |
| import Html.App exposing (beginnerProgram) | |
| import Html.Events exposing (onClick, onInput) | |
| import Html.Attributes exposing (placeholder, value) | |
| main = | |
| beginnerProgram { model = model, view = view, update = update } | |
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
| import Html exposing (..) | |
| import Html.App as Html | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (..) | |
| import String as String | |
| main = | |
| Html.beginnerProgram | |
| { model = model | |
| , update = update |
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 NUnit.Framework; | |
| namespace DryIoc.IssuesTests | |
| { | |
| [TestFixture] | |
| public class Issue164_EventAggregatorImpl | |
| { | |
| [Test, Explicit] | |
| public void Able_to_handle_multiple_events_being_singleton() |
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.Linq; | |
| using NUnit.Framework; | |
| namespace DryIoc.IssuesTests | |
| { | |
| [TestFixture] | |
| public class InjectListOfDepsWithStringDeps | |
| { |
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; | |
| public class Program | |
| { | |
| public static void Main() | |
| { | |
| var p = new Program(); | |
| var expr = p.GetNExpr(); |
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.ComponentModel.Composition; | |
| using DryIoc.MefAttributedModel; | |
| using DryIocAttributes; | |
| using NUnit.Framework; | |
| namespace DryIoc.Examples | |
| { | |
| [TestFixture] | |
| public class DotnetWeekBlogExample |
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
| /* | |
| Results: | |
| Compile Expression 3000 times: 814 | |
| Invoke Compiled Expression 5000000 times: 724 | |
| Emit from Expression 3000 times: 36 | |
| Run Emitted Expression 5000000 times: 722 | |
| */ | |
| using System; |