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 static IEnumerable<Memory<char>> TryReadLine(TextReader reader) | |
{ | |
var bufferLength = (int)Math.Pow(2, 16); | |
var buffer = ArrayPool<char>.Shared.Rent(bufferLength); | |
var i = 0; | |
var j = 0; | |
var state = State.BeforeField; | |
int c; |
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
private enum State | |
{ | |
BeforeField, | |
InField, | |
InQuotedField, | |
LineEnd, | |
} | |
public static IEnumerable<Memory<char>> TryReadLine(TextReader reader) | |
{ |
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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.Linq; | |
using System.Linq.Expressions; | |
// ``` ini | |
// |
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 var bulkCopy = new SqlBulkCopy( | |
_connection, | |
SqlBulkCopyOptions.TableLock | | |
SqlBulkCopyOptions.FireTriggers | | |
SqlBulkCopyOptions.UseInternalTransaction, | |
null | |
); | |
bulkCopy.DestinationTableName = "table"; | |
bulkCopy.BatchSize = 150_000; |
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
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
const fii = { }; | |
fii["XPTO"] = { qtd: 1 }; | |
for(const ticker in fii){ |
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
- Function first class citizen (guardar em variavel, função receber ou retornar outra função) | |
- Delegates (funções anonimas ou não) | |
- Actions/Func | |
- Lambda/Delegate | |
- LINQ | |
- Iterators (yield return, yield break) | |
- Expression Tree | |
- Baixo nivel (Class vs Struct, Span, ranges, ArrayPool, stackallock) | |
- Regex |
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
colections array, list, queue, stack, dictionary, hashset | |
concurrent collections (ConcurrentBag, ConcurrentStack, ConcurrentQueue, etc) | |
imutabilidade | |
transparency referential | |
side-effects | |
pure functions | |
span, readOnlySpan, stackalloc, arrayPool, IOPipeline | |
ref, out, in | |
pattern match |
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 MoreLinq; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Reflection; |
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.Linq.Expressions; | |
using System.Reflection; | |
namespace RecordParser.Generic | |
{ | |
public class ClosureVisitor : ExpressionVisitor | |
{ | |
protected override Expression VisitMember(MemberExpression member) | |
{ |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
namespace Playground | |
{ | |
public class Program |