Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
#RxJS 5 Operators By Example A (soon to be) complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
(I will be adding one operator per day until all are included.)
class TaskToObservable<T> : IObservable<T> | |
{ | |
Func<CancellationToken, Task<T>> taskFactory; | |
public TaskToObservable(Func<CancellationToken, Task<T>> taskFactory) | |
{ | |
this.taskFactory = taskFactory; | |
} | |
public IDisposable Subscribe(IObserver<T> observer) |
using System; | |
using System.Reactive.Concurrency; | |
using System.Reactive.Linq; | |
using System.Reactive.Subjects; | |
using System.Threading; | |
namespace Nito.AsyncEx | |
{ | |
/// <summary> | |
/// An <see cref="IProgress{T}"/> that is disposable. |
//http://blog.slaks.net/2015-01-12/linq-count-considered-occasionally-harmful/ | |
public static bool HasMoreThan<T>(this IEnumerable<T> sequence, int count) { | |
if (count < 0) return true; | |
int? staticCount = (sequence as ICollection<T>)?.Count | |
?? (sequence as ICollection)?.Count | |
?? (sequence as IReadOnlyCollection<T>)?.Count; | |
if (staticCount != null) | |
return staticCount > count; | |
using (var enumerator = sequence.GetEnumerator()) | |
for (int i = 0; i < count + 1; i++) |
// <copyright file="LeastRecentlyUsedCache.cs" company="http://www.sinbadsoft.com"> | |
// Copyright (c) Chaker Nakhli 2013 | |
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the | |
// License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by | |
// applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language | |
// governing permissions and limitations under the License. | |
// </copyright> | |
// <author>Chaker Nakhli</author> | |
// <email>Chaker.Nakhli@sinbadsoft.com</email> |
##Battlestation Setup for .NET developer
public interface IBufferState | |
{ | |
void Commit(); | |
} | |
public interface IBuffer | |
{ | |
IBufferState CaptureState(); | |
} |
public struct MyKey : IEquatable<MyKey> | |
{ | |
private int value; | |
public MyKey(int value) | |
{ | |
this.value = value; | |
} | |
public override int GetHashCode() |