Simple example to show dynamically computed chart based on the data in another chart. TODO: add better computation than a slice of 10 original elements :)
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
(** | |
And of cause translation of the context free grammar enumeration example | |
from [Luke Palmer's post](http://lukepalmer.wordpress.com/2008/05/02/enumerating-a-context-free-language/) | |
which was my original inpiration to use Omega. | |
Notice the explicit addition of laziness to allow recursive use of | |
`symbol` literals in a list. Alternatively one can define, say: | |
``` | |
type 'a symbol = | |
| Terminal of 'a |
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
namespace System.Reactive.Subjects | |
{ | |
using System; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Specialized version of ReplaySubject which process keyed events and replays last | |
/// count values from each group. Each notification is broadcasted to all subscribed | |
/// and future observers. | |
/// </summary> |
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
void Main() | |
{ | |
// Trivial test... | |
Enumerable.Range(-2, 100) | |
.Select(n => new { n, res = binary_search(4, x => x >= n) }.ToString()) | |
.Dump(); | |
} | |
public static uint binary_search(uint low, Func<uint, bool> f) | |
{ |
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
void Main() | |
{ | |
var root = @"c:\"; | |
DirTree(root, true) | |
// ==> ugly-print :) | |
// .Select(path => { var xs = path.Split('\\'); return string.Join("| ", Enumerable.Repeat("", xs.Length-1)) + xs.Last(); }) | |
.Dump(); | |
} | |
// Enumerable version of traversal |