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
# emptyの時にnull返しちゃうけど要素の型取れないしshoganai | |
# enumeratorをDisposeしない(ちゃんとしよふ) | |
$first = @(1, 2,3) | |
$second = @(5, 6,7, 10) | |
$e1 = $first.GetEnumerator() | |
$e2 = $second.GetEnumerator() | |
$list = $null |
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.Linq; | |
using System.Text; | |
using System.Collections.ObjectModel; | |
using System.Collections.Specialized; | |
using UniRx; | |
namespace UniRx | |
{ |
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
async Task Hoge() | |
{ | |
Debug.WriteLine(System.Web.HttpContext.Current == null); // false | |
await Task.Delay(TimeSpan.FromMilliseconds(100)).ConfigureAwait(false); // キャプチャしない | |
Debug.WriteLine(System.Web.HttpContext.Current == null); // true | |
} | |
public async Task<ActionResult> Index() |
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
LINQ to BigQuery's concept and mention of following tree. | |
https://github.com/neuecc/LINQ-to-BigQuery | |
https://twitter.com/headinthebox/status/539169524999012354 | |
IQueryable isn't necessary for LINQ to translate SQL. | |
I need all BigQuery's sql can write LINQ to BigQuery. | |
All specialized sql can execute, all function can execute(include window function). | |
(BigQuery's SQL different with standard Sql https://developers.google.com/bigquery/query-reference | |
I must support Multiple FROM, WITHIN, JOIN EACH, GROUP EACH BY, FLATTEN, IGNORECASE, etc) |
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 Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CodeActions; | |
using Microsoft.CodeAnalysis.CodeRefactorings; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
using System.Collections.Generic; | |
using System.Composition; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; |
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 IObservable<string> ReadLineAsObservable(string fileName) | |
{ | |
return Observable.Create<string>(async observer => | |
{ | |
try | |
{ | |
using (var sr = new StreamReader(fileName)) | |
{ | |
string s; | |
while ((s = await sr.ReadLineAsync().ConfigureAwait(false)) != null) |
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
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} | |
async void MyVoidAsync1() | |
{ | |
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false); | |
MyVoidAsync2(); |
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
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} | |
public void button_Click(object sender, EventArgs e) | |
{ | |
MyVoidAsync1(); |
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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var result = new StringBuilder(); | |
Parallel.ForEach(Enumerable.Range(1, 1000000), () => new StringBuilder(), (x, option, sb) => |
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
// https://github.com/neuecc/UniRx/blob/992c84b0aa5be67323817db7d443bc62c7b49524/Assets/UniRx/Scripts/Observable.Concatenate.cs#L331 | |
var queues = new Queue<T>[length]; | |
for (int i = 0; i < length; i++) | |
{ | |
queues[i] = new Queue<T>(); | |
} |