(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public class ChickenCodec | |
{ | |
static readonly char[] feed = { 'C', 'H', 'I', 'C', 'K', 'E', 'N', '.' }; | |
private static Lazy<byte[]> charFeed = new Lazy<byte[]>(() => | |
{ | |
byte[] feed = new byte[256 * 8]; | |
unsafe | |
{ | |
fixed (byte* feedptr = feed) | |
{ |
// https://github.com/GoogleChrome/puppeteer | |
const signIn = async (username) => { | |
let currentPasswordIndex = 0; | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://www.reddit.com/login'); |
namespace ConsoleTester | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int n_machines = 3; | |
double[] probs = new double[n_machines]; | |
double[] means = new double[] { 0.3, 0.5, 0.7 }; |
[<Class>] | |
type 'a BinaryTree = | |
member hd : 'a | |
member left : 'a BinaryTree | |
member right : 'a BinaryTree | |
member exists : 'a -> bool | |
member insert : 'a -> 'a BinaryTree | |
member print : unit -> unit | |
static member empty : 'a BinaryTree | |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public static class RegexHelper | |
{ | |
// Match IPv4-Address like 192.168.178.1 | |
private const string IPv4AddressValues = @"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; | |
public const string IPv4AddressRegex = "^" + IPv4AddressValues + "$"; | |
// Match IPv6-Address | |
public const string IPv6AddressRegex = @"(?:^|(?<=\s))(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{ |
I've worked with AngularJS for many years now and still use it in production today. Even though you can't call it ideal, given its historically-formed architecture, nobody would argue that it became quite a milestone not only for evolution of JS frameworks, but for the whole web.
It's 2017 and every new product/project has to choose a framework for development. For a long time I was sure that new Angular 2/4 (just Angular below) will become the main trend for enterprise development for years to come. I wasn't even thinking of working with something else.
Today I refuse to use it in my next project myself.
public unsafe static byte[] ComputeHash<T>(T data) where T : unmanaged | |
{ | |
byte* bytes = (byte*)(&data); | |
using (var sha1 = SHA1.Create()) | |
{ | |
var size = sizeof(T); | |
using (var ms = new UnmanagedMemoryStream(bytes, size)) | |
{ | |
return sha1.ComputeHash(ms); | |
} |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.1</TargetFramework> | |
<LangVersion>7.3</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Octokit" Version="0.32.0" /> |
using System; | |
using Newtonsoft.Json.Linq; | |
namespace ConsoleApplication | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var original = JObject.Parse(@"{ |