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
// So the question is - how would I configure OpenRasta to enable the below, where a real-world URI might look like (and any number of FooId | |
// arguments may be supplied): | |
// /queries/FooReportResource?LastReportDate=2010-05-23Z&ApplicableFoos=FooId1,FooId2,FooId3,FooId4 | |
public class Configuration : IConfigurationSource | |
{ | |
public void Configure() | |
{ | |
using (OpenRastaConfiguration.Manual) | |
{ |
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 interface IHandleCommands<TCommand> where TCommand : IAmACommand | |
{ | |
void Handle(TCommand command); | |
} | |
public interface IAmACommand | |
{ | |
Guid AggregateId { get; } | |
} |
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
Type actual = Given.AType("Foo", With.A.Constructor( | |
With.A.Parameter("bar", Of.AType("Bar", With.A.DefaultConstructor)) | |
, With.A.Parameter("baz", Of.AType("Baz", | |
With.A.Constructor(With.A.Parameter("fizz", Of.AType("Fizz", With.A.DefaultConstructor))))) | |
, With.A.Parameter("buzz", Of.AnExistingType<int>()))); |
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
// Worth noting that restrictions prevented me from accessing libraries like the Apache Commons Guid and others | |
// Also, not production code - needs some TLC & refactoring love | |
// If I get time will be moved to a proper home in GitHub | |
package semeosis.eventsourcing.infrastructure; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; |
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
{ | |
"_id": "_design/eventsource", | |
"_rev": "10-6871125abf6ffb2c2b34a43e08c9909c", | |
"language": "javascript", | |
"views": { | |
"allEvents": { | |
"map": "function(doc) { if (doc.Events) {doc.Events.forEach(function(e) { if (e.Event.Detail.AggregateId) { emit(e.Event.Detail.AggregateId, e.Event); }}); }}" | |
} | |
}, | |
"filters": { |
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
System.Windows.Markup.XamlParseException occurred | |
Message=Provide value on 'System.Windows.Data.Binding' threw an exception. [Line: 108 Position: 106] | |
LineNumber=108 | |
LinePosition=106 | |
StackTrace: | |
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) | |
at Foo.UI.Silverlight.Pages.ExcelExtract.Detail.View.CreateFileExtract.InitializeComponent() | |
at Foo.UI.Silverlight.Pages.ExcelExtract.Detail.View.CreateFileExtract..ctor() | |
InnerException: System.ArgumentException | |
Message=DependencyProperty System.Windows.Controls.TabControl. CurrentTabItemByTagName cannot be set on an object of type Foo.UI.Silverlight.Controls.Common.Tab.Behaviors.InteractWithIndexThroughTagNamesBehaviour. |
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 BasicHeader | |
{ | |
private readonly string _username; | |
private readonly string _password; | |
public BasicHeader(string username, string password) | |
{ | |
_username = username; | |
_password = password; | |
} |
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
// version 1.0.3.0 -- Don't ask, I know... :( | |
// I want to pass in an array of enum values to a constructor of a type. | |
// The code in my config looks like the below | |
// The error I get now is | |
// ArgumentException "An item with the same key has already been added." | |
// Stack trace (cleaned) is: | |
// at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) |
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
-- Keep in mind the documentation for this constructor which says "A parameter specifies whether to provide a Unicode byte order mark" & "true to specify that a Unicode byte order mark is provided; otherwise, false." | |
-- Whilst the standard allows (but does not recommend) for the optional BOM mark to be included, Excel 2003 seems to require it when reading a UTF-8 encoded csv. | |
> let encoderWithBOM = new UTF8Encoding(true);; | |
val encoderWithBOM : UTF8Encoding | |
> let encodedText = encoderWithBOM.GetBytes("Some Text");; | |
val encodedText : byte [] = |
OlderNewer