(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/env bash | |
| # This script is meant to build and compile every protocolbuffer for each | |
| # service declared in this repository (as defined by sub-directories). | |
| # It compiles using docker containers based on Namely's protoc image | |
| # seen here: https://github.com/namely/docker-protoc | |
| set -e | |
| REPOPATH=${REPOPATH-/opt/protolangs} | |
| CURRENT_BRANCH=${CIRCLE_BRANCH-"branch-not-available"} |
| import pandas | |
| import fastavro | |
| def avro_df(filepath, encoding): | |
| # Open file stream | |
| with open(filepath, encoding) as fp: | |
| # Configure Avro reader | |
| reader = fastavro.reader(fp) | |
| # Load records in memory | |
| records = [r for r in reader] |
| go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt | |
| go tool pprof -http :8080 cpu.out | |
| go tool pprof -http :8081 mem.out | |
| go tool trace trace.out | |
| go tool pprof $FILENAME.test cpu.out | |
| # (pprof) list <func name> | |
| # go get -u golang.org/x/perf/cmd/benchstat | |
| benchstat bench.txt |
| <?xml version="1.0" encoding="utf-8"?> | |
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
| <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | |
| <ProductVersion>3.10</ProductVersion> | |
| <ProjectGuid>91e4dc15-312a-4e90-bc1c-01de5dc99447</ProjectGuid> | |
| <SchemaVersion>2.0</SchemaVersion> | |
| <OutputName>CoreConsoleAppSetup</OutputName> | |
| <OutputType>Package</OutputType> |
| --- | |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: > | |
| A basic CloudFormation template for an RDS Aurora cluster. | |
| Parameters: | |
| DatabaseUsername: | |
| AllowedPattern: "[a-zA-Z0-9]+" | |
| ConstraintDescription: must be between 1 to 16 alphanumeric characters. |
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "443" | |
| } |
| # install openjdk | |
| sudo apt-get install openjdk-7-jdk | |
| # download android sdk | |
| wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
| tar -xvf android-sdk_r24.2-linux.tgz | |
| cd android-sdk-linux/tools | |
| # install all sdk packages |
(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.
| int64_t ipow(int64_t base, uint8_t exp) { | |
| static const uint8_t highest_bit_set[] = { | |
| 0, 1, 2, 2, 3, 3, 3, 3, | |
| 4, 4, 4, 4, 4, 4, 4, 4, | |
| 5, 5, 5, 5, 5, 5, 5, 5, | |
| 5, 5, 5, 5, 5, 5, 5, 5, | |
| 6, 6, 6, 6, 6, 6, 6, 6, | |
| 6, 6, 6, 6, 6, 6, 6, 6, | |
| 6, 6, 6, 6, 6, 6, 6, 6, | |
| 6, 6, 6, 6, 6, 6, 6, 255, // anything past 63 is a guaranteed overflow with base > 1 |
| 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 |