Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
| 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 |
Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
| # Advanced Bash :: Array slicing and compaction in bash | |
| # TL;DR | |
| X=(something 'whatever' "i have more S P A C E S than i can give away. arent you jealous?") | |
| # ${X[@]} the usual whole array | |
| # ${X[@]:index:length} slice from index to index+length-1 inclusive | |
| # ${X[@]::length} slice from 0 to length-1 inclusive | |
| # ${X[@]:index} slice from index to end of array inclusive |
| #!/usr/bin/env python | |
| # | |
| # import modules used here -- sys is a very standard one | |
| import sys, argparse, logging | |
| # Gather our code in a main() function | |
| def main(args, loglevel): | |
| logging.basicConfig(format="%(levelname)s: %(message)s", level=loglevel) | |