(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.
(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.
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # Python script to find the largest files in a git repository. | |
| # The general method is based on the script in this blog post: | |
| # http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # | |
| # The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
| # of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. | |
| # |
| /* | |
| get SSH.NET (BSD License: http://sshnet.codeplex.com/license) | |
| with NuGet: | |
| >Install-Package SSH.NET -Version 2013.4.7 | |
| or just get the dll from here: http://j.mp/sshNet | |
| */ | |
| using System; |
Many people naively assume an ordinary .NET HashSet preserves insertion order. Indeed HashSet accidentally preserves insertion order until you remove and re-add some elements. There is such a data structure in Java - LinkedHashSet which respects order and has O(1) RW times.
No, I did not find a (working) corresponding implementation in .NET. That's I wrote this one.
The implementation uses linked list in combination with dictionary to define the iteration, ordering and at the same time allow O(1) removal.
The order is not affected if an element is re-inserted into the set it retains it's old position.
| // MIT License - Copyright (c) 2016 Can Güney Aksakalli | |
| // https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Net.Sockets; | |
| using System.Net; | |
| using System.IO; |
| ///////////////////////////////////////////////////////////////////////////// | |
| ///////////////////////////////////////////////////////////////////////////// | |
| //// | |
| //// Three kinds of generic object pools to avoid memory deallocations | |
| //// in Unity-based games. See my Gamasutra articles. | |
| //// Released under a Creative Commons Attribution (CC BY) License, | |
| //// see http://creativecommons.org/licenses/ | |
| //// | |
| //// (c) 2013 Wendelin Reich. | |
| //// |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| # With your phone in debug mode, etc. | |
| adb start-server | |
| adb remount | |
| adb shell < remove.sh |
| using UnityEngine; | |
| using System; | |
| using System.Reflection; | |
| using System.Collections; | |
| namespace UnityEngine { | |
| public static class ExtensionMethods { | |
| public static void Invoke(this MonoBehaviour behaviour, string method, object options, float delay) { |
| using System; | |
| using Newtonsoft.Json; | |
| namespace JsonConverters | |
| { | |
| /// <summary> | |
| /// Handles converting JSON string values into a C# boolean data type. | |
| /// </summary> | |
| public class BooleanJsonConverter : JsonConverter | |
| { |