This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| // POC CQRS bus for stateless synchronous commandhandlers | |
| // and both both syncronous and asynchronous stateless eventhandlers | |
| // Remarks : ToJans@twitter | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Threading; | 
| // another attempt to combine CQRS with BDD | |
| // tojans@twitter | |
| using System; | |
| using System.Linq; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| #region Domain commands | 
| function M(){}; | |
| M.contResult = function(value){ | |
| return function(cont){ | |
| console.log('in result: ' + value); | |
| return cont(value); | |
| } | |
| } | |
| M.contBind = function(mValue, mFunc){ | 
| ; A CLR port of http://bestinclass.wordpress.com/2009/09/24/chaos-theory-vs-clojure/ | |
| ; Updated to use Rich Hickey's changes: http://paste.lisp.org/display/87799 | |
| ; | |
| ; A WPF app is fired up in another thread. Anything you type in the REPL | |
| ; is dispatched to the WPF thread and evaluated there. | |
| ; | |
| ; Requires the following addition to ClojureCLR's GenDelegate.cs: | |
| ; public static Delegate CreateFunc(IFn fn) | |
| ; { | |
| ; Type delegateType = typeof(Func<>).MakeGenericType(new Type[] { typeof(object) }); | 
| Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing. | |
| Write a probability value object. It should contain the following methods: | |
| Probability CombinedWith(Probability) | |
| Probability InverseOf() | |
| Probability Either(Probability) | |
| if you forget your probability math: | |
| Either:P(A) + P(B) - P(A)P(B) | |
| CombinedWith: P(A)P(B) | 
| <?xml version="1.0" encoding="windows-1252" ?> | |
| <TODOLIST FILENAME="C:\Projects\Programming\Blog\ND2011 Video Checklist\ND2011.tdl" PROJECTNAME="ND2011" FILEFORMAT="9" NEXTUNIQUEID="166" LASTMODIFIED="2011-06-19" FILEVERSION="111" EARLIESTDUEDATE="0.00000000"> | |
| <TASK TITLE="Day 1" ID="1" ICONINDEX="-1" POS="1" PRIORITY="5" RISK="0" PERCENTDONE="0" COST="0.00000000" CALCCOST="0.00000000" STARTDATE="40713.00000000" STARTDATESTRING="2011-06-19" CREATIONDATE="40713.53445602" CREATIONDATESTRING="2011-06-19 12:49 PM" LASTMOD="40713.53452546" LASTMODSTRING="2011-06-19 12:49 PM" PRIORITYCOLOR="15732480" PRIORITYWEBCOLOR="#000FF0"> | |
| <TASK TITLE="Keynote - Cloud Computing and Azure" ID="16" ICONINDEX="-1" COMMENTS="Scott Guthrie | |
| http://ndc2011.aventia.no/" POS="1" PRIORITY="5" RISK="0" PERCENTDONE="0" COST="0.00000000" CALCCOST="0.00000000" STARTDATE="40713.00000000" STARTDATESTRING="2011-06-19" CREATIONDATE="40713.54113426" CREATIONDATESTRING="2011-06-19 12:59 PM" LASTMOD="40713.54435185" LASTMODSTRING="2011-06-19 1:03 P | 
| //This is a sample specification. | |
| public SutSpecification<Depositor> when_withdrawing_money_from_empty_account = new SutSpecification<Depositor> | |
| { | |
| On = () => new Depositor(13), | |
| When = depositor => depositor.Withdraw(50.00m), | |
| Expect = | |
| { | |
| depositor => depositor.Balance > 0.01m, | |
| depositor => depositor.AccountIsOpen | 
| [TestFixture] | |
| public class SpecificationFixture | |
| { | |
| [Test, TestCaseSource("GetSpecificationTestCases")] | |
| public void Verify(SpecificationToRun spec) | |
| { | |
| var runner = new SpecificationRunner(); | |
| RunResult result = runner.RunSpecifciation(spec); | |
| if (result.Passed) | 
| function! DumpWebforms() | |
| %s/<% \([^}]\)/@\1 | |
| %s/<%= /@ | |
| %s/<%=/@ | |
| %s/<%// | |
| %s/%>// | |
| endfunction | 
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer