$/
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
using HtmlAgilityPack; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Xml.Linq; | |
using System.Xml.XPath; | |
// generated page is hosted at https://drachev.com/officedaytime/ |
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
Hello there! You are currently visiting gopherspace through a | |
proxy. To learn more about gopher and how to browse it, read this. | |
______________________________________________________________________ | |
################################################################### | |
Writing C software without the standard library | |
Linux Edition | |
################################################################### | |
There are many tutorials on the web that explain how to build a | |
simple hello world in C without the libc on AMD64, but most of them |
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
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ | |
git clone <git repository A url> # clone source repository | |
cd <git repository A directory> | |
git remote rm origin # to make sure it doesn't affect the original repository | |
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed | |
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed) | |
mv * <directory 1> | |
git add . | |
git commit |
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
// Params: | |
// 1. query (filter) if you only want to remove this field from some records. {} will select any. | |
// 2. $unset the field(s) that you want to remove. Here I've set them to null but the value doesn't matter as it's ignored. | |
// 3. multi must be set to true otherwise it will only operate on the first record that it finds. | |
// | |
// Run this command in the MongoDB shell | |
db.<collectionName>.update( {}, {$unset: {<fieldName1>: null, <fieldName2>: null}}, {multi: true}); |
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
#include <iostream> | |
template <typename T> | |
class range { | |
private: | |
class iter { | |
private: | |
T m_x; | |
public: |
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
$wc=new-object net.webclient | |
$wp=[system.net.WebProxy]::GetDefaultProxy() | |
$wp.UseDefaultCredentials=$true | |
$wc.Proxy=$wp | |
iex ($wc.DownloadString('https://chocolatey.org/install.ps1')) |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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 class EnumMapper : IDisposable | |
{ | |
readonly Dictionary<Type, Dictionary<string, object>> _stringsToEnums = | |
new Dictionary<Type, Dictionary<string, object>>( ) ; | |
readonly Dictionary<Type, Dictionary<int, string>> _enumNumbersToStrings = | |
new Dictionary<Type, Dictionary<int, string>>( ) ; | |
readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim( ) ; |
NewerOlder