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
| var ajaxWidgetModel = function (options) { | |
| var self = this; | |
| self.data = ko.observable(); | |
| self.tick = function () { | |
| $.get(options.url, function (data) { | |
| self.data(ko.mapping.fromJS(data)); | |
| }); | |
| }; |
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
| var ticks = Observable.Interval(TimeSpan.FromSeconds(_settings.IntervalInSeconds)); | |
| var pollResults = Observable.Create<PollResult>(observer => | |
| { | |
| var results = // do request | |
| foreach (var result in results) | |
| observer.OnNext(new PollResult(result)); | |
| return Disposable.Empty; |
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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var item = InventoryItemPure.Register(new InventoryItemName("Domain Driven Design")); | |
| item = InventoryItemPure.CheckIn(item, new InventoryItemCount(4)); | |
| item = InventoryItemPure.CheckOut(item, new InventoryItemCount(3)); | |
| item = InventoryItemPure.Deactivate(item); | |
| Console.ReadLine(); |
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
| module Program | |
| open Inventory | |
| open System | |
| [<EntryPoint>] | |
| let main argv = | |
| let item = Inventory.Register (Inventory.InventoryItemName.Make "Domain Driven Design") | |
| let itemAfterCheckingIn = Inventory.CheckIn (InventoryItemCount.Make 3) item | |
| let itemAfterCheckingOut = Inventory.CheckOut (InventoryItemCount.Make 1) itemAfterCheckingIn | |
| let deactivatedItem = Inventory.Deactivate itemAfterCheckingOut |
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
| let rec read stream startFrom (conn : IEventStoreConnection) = | |
| seq { | |
| let size = 10000 | |
| let slice = conn.ReadStreamEventsForwardAsync(stream, startFrom, size, true).Result | |
| if (slice.IsEndOfStream) then | |
| yield slice | |
| else | |
| yield slice | |
| yield! read stream (startFrom + size) conn |
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
| [07,09:57:30.489,ERROR] TcpPackageConnection: [127.0.0.1:1113, L127.0.0.1:55697, {d9265236-f72b-4418-a470-780ab7ef2af9}]. Invalid TCP frame received. | |
| EXCEPTION(S) OCCURRED: | |
| EventStore.ClientAPI.Transport.Tcp.PackageFramingException: Package size is out of bounds: 186992564 (max: 67108864). | |
| at EventStore.ClientAPI.Transport.Tcp.LengthPrefixMessageFramer.Parse(ArraySegment`1 bytes) | |
| at EventStore.ClientAPI.Transport.Tcp.LengthPrefixMessageFramer.UnFrameData(IEnumerable`1 data) | |
| at EventStore.ClientAPI.Transport.Tcp.TcpPackageConnection.OnRawDataReceived(ITcpConnection connection, IEnumerable`1 data) |
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
| static void Main() | |
| { | |
| Recursive(0); | |
| } | |
| static void Recursive(int i) | |
| { | |
| Console.WriteLine(i); | |
| Recursive(i + 1); | |
| } |
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
| ... | |
| 171424 | |
| 171425 | |
| 171426 | |
| 171427 | |
| Process is terminated due to StackOverflowException. |
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
| let rec recursiveFun i = | |
| Console.WriteLine(i.ToString()) | |
| recursiveFun (i + 1) | |
| recursiveFun 0 |
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
| let rec recursiveFun i = | |
| Console.WriteLine(i.ToString()) | |
| recursiveFun (i + 1) | |
| Console.WriteLine("Make another call so the compiler doesn't detect tail recursion.") | |
| recursiveFun 0 |