-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
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
### This assumes that appsettings configurationpath was equal to delta.rb | |
ext "fixConnection" do | |
senderCompId "IOM" | |
targetCompId "JEFNET" | |
heartbeatInterval 60 | |
reconnectInterval 1 | |
protocolVersion "FIX.4.2" | |
shouldCheckLatency false | |
isInitiator true |
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
/* | |
* Original version by Stephen Toub and Shawn Farkas. | |
* Random pool and thread safety added by Markus Olsson (freakcode.com). | |
* | |
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx | |
* | |
* Some benchmarks (2009-03-18): | |
* | |
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz) | |
* |
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
http://yoursite/_layouts/closeConnection.aspx?loginasanotheruser=true |
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
package main | |
import "fmt" | |
type F func(i int) int | |
func (f F) compose(inner F) F { | |
return func(i int) int { return f(inner(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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Net.Http; | |
using System.Net; | |
namespace HTTP_Test |
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
open System | |
// helper function to set the console collor and automatically set it back when disposed | |
let consoleColor (fc : ConsoleColor) = | |
let current = Console.ForegroundColor | |
Console.ForegroundColor <- fc | |
{ new IDisposable with | |
member x.Dispose() = Console.ForegroundColor <- current } | |
// printf statements that allow user to specify output color |
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
pragma solidity ^0.4.18; | |
contract QuickSort { | |
function sort(uint[] data) public constant returns(uint[]) { | |
quickSort(data, int(0), int(data.length - 1)); | |
return data; | |
} | |
function quickSort(uint[] memory arr, int left, int right) internal{ |
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 partial class LinqExtensions | |
{ | |
public static Maybe<C> SelectMany<A, B, C>(this Maybe<A> ma, Func<A, Maybe<B>> f, Func<A, B, C> select) => ma.Bind(a => f(a).Map(b => select(a, b))); | |
} |
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 Newtonsoft.Json; | |
public static string JsonPrettify(string json) | |
{ | |
using (var stringReader = new StringReader(json)) | |
using (var stringWriter = new StringWriter()) | |
{ | |
var jsonReader = new JsonTextReader(stringReader); | |
var jsonWriter = new JsonTextWriter(stringWriter) { Formatting = Formatting.Indented }; | |
jsonWriter.WriteToken(jsonReader); |
OlderNewer