$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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 Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg) | |
{ | |
object backupTransportVal = pInMsg.Context.Read("BackupEndpointInfo", "http://schemas.microsoft.com/BizTalk/2003/system-properties"); | |
if (backupTransportVal == null) | |
{ | |
//Not present => no backupTransport configured => use default | |
//Perform Actions | |
} | |
else |
This file contains 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.Net.Http; | |
using Castle.DynamicProxy; // From Castle.Core | |
using Refit; | |
public class ProxyRestService | |
{ | |
static readonly ProxyGenerator Generator = new ProxyGenerator(); | |
public static T For<T>(HttpClient client) | |
where T : class |
This file contains 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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, |
Hello software developers,
Please check your code to ensure you're not making one of the following mistakes related to cryptography.
- Writing your own home-grown cryptography primitives (For example: Mifare Classic)
- Exception: For the sake of learning, but don't deploy it in production.
- Using a fast hash function (e.g. MD5, SHA256) for storing passwords. Use bcrypt instead.
- Not using a cryptographically secure random number generator
This file contains 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
namespace Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |
This file contains 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
<Query Kind="Program"> | |
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference> | |
<Namespace>Microsoft.Diagnostics.Runtime</Namespace> | |
<Namespace>System</Namespace> | |
<Namespace>System.IO</Namespace> | |
<Namespace>System.Linq</Namespace> | |
<Namespace>System.Text</Namespace> | |
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace> | |
</Query> |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
This file contains 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
#!/bin/bash | |
# requirements: | |
# - curl | |
# - nokogiri | |
# usage: fill in username and password here, execute, and it spits out json array with your usage | |
username=<< Fill your username in here >> | |
password=<< Fill your password in here >> |
OlderNewer