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
//From James World http://stackoverflow.com/questions/23431018/how-can-i-alternately-buffer-and-flow-a-live-data-stream-in-rx | |
// a demo data stream that emits every second | |
var dataStream = Observable.Interval(TimeSpan.FromSeconds(1)); | |
// a demo flag stream that toggles every 5 seconds | |
var toggle = false; | |
var gateStream = Observable.Interval(TimeSpan.FromSeconds(5)) | |
.Select(_ => toggle = !toggle); |
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
//From James World - http://social.msdn.microsoft.com/Forums/en-US/dfa87af8-b7dd-4fb5-abe2-99348d3e27e1/compare-two-object-graphs-and-get-differences?forum=rx | |
public static IObservable<Tuple<TSource, TSource>> PairWithPrevious<TSource>(this IObservable<TSource> source) | |
{ | |
return source.Scan( | |
Tuple.Create(default(TSource), default(TSource)), | |
(acc, current) => Tuple.Create(acc.Item2, current)); | |
} |
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
Weekly obligation (ANZ current rates) | |
Rate 200k@25yr 300k@25yr 400k@25yr 500k@25yr | |
ANZ 2y (min20%) 5.99 $296/wk $444/wk $592/wk $740/wk | |
ANZ 2y Low eq 6.49 $310/wk $465/wk $620/wk $775/wk | |
ANZ 3y 6.55 $312/wk $467/wk $623/wk $779/wk | |
ANZ 3y Low eq 7.05 $326/wk $489/wk $652/wk $815/wk | |
ANZ 4y 7.19 $330/wk $496/wk $661/wk $826/wk | |
ANZ 5y 7.40 $336/wk $504/wk $673/wk $841/wk | |
ANZ 4y Low eq 7.69 $345/wk $518/wk $691/wk $863/wk |
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
void Main() | |
{ | |
var data = new List<string>(){@"$[data for first line g", "oes here]\r\n$[data for ", "second line goes here]"}; | |
data.ToObservable() | |
.SelectMany(s=>s) | |
.WindowByExclusive(c => c=='$') | |
.SelectMany(window=>window.ToList().Select(l=>string.Join(string.Empty, l))) | |
.Where(s=>!string.IsNullOrEmpty(s)) | |
.Dump("WindowByExclusive"); |
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
# first get the merge commit hash | |
git log | |
# next get off master so you can play safe | |
git checkout -b RevertFeatureX | |
# revert the merge. Here "-m 1" says that the index 1 branch is the one to keep (hopefully this is the master/develop branch) | |
git revert -m 1 94d49c1d6edd3006208400b2de5920c4edff1db3 | |
#This will then throw up a git file editor so you can enter in you commit message. |
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
←[0;32m virtualbox-iso: Resolving github.com (github.com)... 192.30.252.128←[0m | |
←[0;32m virtualbox-iso: Connecting to github.com (github.com)|192.30.252.128|:443... connected.←[0m | |
←[0;32m virtualbox-iso: HTTP request sent, awaiting response... 200 OK←[0m | |
←[0;32m virtualbox-iso: Length: unspecified [text/plain]←[0m | |
←[0;32m virtualbox-iso: Saving to: ‘/home/stuartrexking/.ssh/authorized_keys’←[0m | |
←[0;32m virtualbox-iso:←[0m | |
←[0;32m virtualbox-iso: 1,523 --.-K/s in 0.001s←[0m | |
←[0;32m virtualbox-iso:←[0m | |
←[0;32m virtualbox-iso: 2015-03-16 22:18:15 (1.68 MB/s) - ‘/home/stuartrexking/.ssh/authorized_keys’ saved [1523]←[0m | |
←[0;32m virtualbox-iso:←[0m |
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
leecampbell@lxc-vm:/scripts/lxc$ ls | |
kafka.sh lxc.sh | |
leecampbell@lxc-vm:/scripts/lxc$ ls -al | |
total 9 | |
drwxrwxrwx 1 vagrant vagrant 0 Apr 5 20:58 . | |
drwxrwxrwx 1 vagrant vagrant 4096 Apr 5 20:58 .. | |
-rwxrwxrwx 1 vagrant vagrant 3815 Apr 5 20:58 kafka.sh | |
-rwxrwxrwx 1 vagrant vagrant 755 Apr 5 20:58 lxc.sh | |
leecampbell@lxc-vm:/scripts/lxc$ sudo chmod a+x /scripts/lxc/kafka.sh | |
leecampbell@lxc-vm:/scripts/lxc$ ls -al |
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
leecampbell@lxc-vm:~$ sed -i 's/\r//' kafka.sh | |
leecampbell@lxc-vm:~$ bash kafka.sh | |
in the file | |
lxc-net stop/waiting | |
lxc-net start/running | |
Setting up the GPG keyring | |
ERROR: Unable to fetch GPG key from keyserver. | |
lxc_container: lxccontainer.c: create_run_template: 1125 container creation template for zookeeper failed | |
lxc_container: lxc_create.c: main: 271 Error creating container zookeeper |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using EventStore.ClientAPI; |
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
void Main() | |
{ | |
var messageCount = 10000; | |
var sum =0L; | |
var result = ThroughputTestResult.Capture(messageCount, () => sum = SumOfSquares(messageCount)); | |
Console.WriteLine($"Result: SumOfSquares({messageCount}) = {sum}"); | |
Console.WriteLine(result.ToString()); | |
} |