(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.
using System; | |
using System.Threading; | |
namespace PureDI | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create the singletons once |
#CHECK THE PATH ON LINE 2 and the FEED on LINE 3 | |
cd "C:\users\scott\Downloads" | |
$a = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4")) | |
$a.rss.channel.item | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$file = $url.Segments[-1] | |
$file | |
if (!(test-path $file)) { | |
(New-Object System.Net.WebClient).DownloadFile($url, $file) | |
} |
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
function Prompt(){ | |
$W = Split-Path -leaf -path (Get-Location) | |
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green | |
$prompt += Write-Prompt $W -ForegroundColor DarkCyan | |
$prompt += Write-Prompt '>' | |
return ' ' | |
} | |
function Remove-StoppedContainers { | |
docker container rm $(docker container ls -q) |
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
cinst 1password | |
cinst 7zip | |
cinst 7zip.install | |
cinst AdobeAIR | |
cinst adobereader | |
cinst Atom | |
cinst markdownpad2 |
(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.
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
using System; | |
using MongoDB.Bson; | |
using MongoDB.Bson.DefaultSerializer; | |
using MongoDB.Bson.IO; | |
using MongoDB.Bson.Serialization; | |
using MongoDB.Driver; | |
using MongoDB.Driver.Builders; | |
namespace ConsoleApplication1 { |