{% extends "distanceapp/base.html" %} {% block app_content %}
Both the vector and the raster file were created from files available from the UDOT Open Data Portal. The vector file comes from the most recent AADT data available, and the raster file comes from a road network file that was originally a vector file, but was rasterized using ArcGIS software. The data is being hosted on a BYU geoserver site, at http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Fgeoserver2.byu.edu%2Farcgis%2Frest%2Fservices%2FGeoids%2FRoadsRaster%2FMapServer&source=sd for the raster file and at http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Fgeoserver2.byu.edu%2Farcgis%2Frest%2Fservices%2FGeoids%2FUtahAADT%2FMapServer&source=sd for the vector file.
{% endblock %}


Cerberus Failure Analysis
Apply the filters to scrape the failures accordingly.
Start date:
Start time:
Finish date:
Finish time:
Issue type:
Name:
Component type:


| Staff name | Job role | Last updated | WDF requirements |
|---|---|---|---|
| {{ worker.nameOrId }} | {{ worker.jobRole }} | last updated {{ lastUpdated(worker.updated) }} |
|
You need to add some staff records before you can check whether your data meets WDF requirements.


The Path to Langri-La
The Quest for Language Enlightenment
by: “Rust” Brooks
Background
- Python: 2 yrs
- Ruby: 8 yrs
- PHP: 5 yrs
- C#: 5 yrs - Compiled
- JavaScript: 18 yrs
- VBScript: 3 yrs
- Fortran & Turbo Pascal - Compiled
- BASIC
Two Language Families
- Scripting: “Interpreted”
- Compiled
Scripting
- Interpreted at Runtime
- Single-Threaded
- Dynamic Typing
- High Level
Scripting
Benefits
- Quicker time to market. Gap is narrowing.
- Shallower learning curve
- Debugging on Production can be easier.
Scripting
Drawbacks
- Slow
- Low Scalability
- Cost: Programs don’t run faster after upgrades
- Require a runtime process in which to run: interpreter / VM
- Processes eternally grow in RAM
- Highly Mutable
- Unsafe: Side Effects
- Green Threads: Use a single CPU core. Threads are virtual. Overhead.
- Require larger Test Suites to cover for lack of compile-time checks.
From Ruby Core Team
They had just denied a Web-related optimization request, and replied something to the effect:
“Ruby is glue language, intended to string together batch operations from Shell. Like Python and Perl, It was never designed for large-scale, multi-user Web applications.”
Apt Use Cases for Scripting Languages
- Prototyping: Projects you aren’t certain are going to succeed. You need to get some MVP quickly to market.
- Non-Production (Intranet sites): Cost of runtime error is low.
- One-Person Shops
- Batch Jobs: Provisioning tools, backups, log analysis, etc.
Poor Use Cases for Scripting Languages
- Large-scale, multi-user applications
- Desktop Apps
What consistutes “Fun” in a language?
- Programmer Aids - Memory Mgmnt, Good Tooling
- Expressiveness
- Low Surprise
- Nice Semantics and Syntax
- Safety: against Bugs
- Flexibility
- Productive
- Generic
Scripting-Language Fundex
- PERL - It's PERL. Fun: 2/10
- PHP - Quirk-laiden. Fun: 3/10
- Python - No more performant than Ruby, and not as elastic, nor as uniform. Fun: 7/10
- JavaScript - Rush job. Written in 2 weeks. Target audience: non-programmers (HTML authors).
- Client-Side Fun: 3/10
- Server-Side Fun: 5/10
Ruby
Fundex: 10/10
- Principal of Least Surprise: Centered entirely around the Programmer
- Inspired these awesome new languages:
- Elixir
- Go
- Kotlin
- Rust
- Swift
Compiled
- Multi-Threaded
- Mid-to-Low Level
- Static Typing
- Speed
- Native Binaries - Unless Java or C#
Apt Use Cases for Compiled Languages
- Large-scale Web applications
- Desktop Apps
- + Pretty much anything Scripting Languages can do.
Poor Use Cases for Compiled
Why Static Types?
- A “Type” (Binary Numbers) exists at the lowest level, not matter what you do.
- Languages that manage Types for you are doing so at a performance penalty.
- You are declaring more of your intent to the machine, so the machine can do more work on your behalf.
“But, Russ, Static Typing is more 'work' for the programmer, and more work is less fun.”
Solution: Type Inferance
- Dynamic feel
- Performance of Static
Compiled-Language Fundex
- C - Safety & threading issues. Frequently exploited. Fun: 2/10
- C++ - Threading is hard. Exploited. Fun: 3/10
- Java - Fun: 5/10
- C# - Fun: 5/10
- Scala - Fun: 7/10
- Elixir - Fun: 8/10
- Go - Fun: 9/10
- Rust - Fun: 10/10
Functional
Benefits
- Immutable
- Scales
- Little-to-No Shared State
- Strong Type, Concurrency, and Memory safety in Pure Func.
Functional
Drawbacks
sort arr left right = when (left < right) $ do
pivot <- read right
loop pivot left (right - 1) (left - 1) right
where
read = readArray arr
sw = swap arr
find n pred i = bool (find n pred (n i)) (return i) . pred i =<< read i
move op d i pivot = bool (return op)
(sw (d op) i >> return (d op)) =<<
liftM (/=pivot) (read i)
swapRange px x nx y ny = if px x then sw x y >> swapRange px (nx x) nx (ny y) ny else return y
loop pivot oi oj op oq = do
i <- find (+1) (const ( cell>pivot && idx/=left) oj
if i < j
then do
sw i j
p <- move op (+1) i pivot
q <- move oq (subtract 1) j pivot
loop pivot (i + 1) (j - 1) p q
else do
sw i right
nj <- swapRange (oq) (right-1) (subtract 1) (i+1) (+1)
let thresh = 1024000
strat = if nj - left < thresh || right - ni < thresh
then (>>)
else parallel
sort arr left nj `strat` sort arr ni right
Functional
Drawbacks
- “Great for Parallelism. Bad for Performance.”
- Some familiar data structures don't exist in Pure Functional: Hash Table
- No Concurrent Collections in PF
- No Unsorted Dictionary or Set in PF
- Graph Algorithms Slow in PF
Reasons to Opt for Scripting
perpetuated 13 years ago when Scripting languages resurged:
- “Machines are cheap enough now.”
- “Compilation slows development.”
- “There's no REPL.”
Software Engineer
Wikipedia:
- “Uses sound engineering principals...”
- “...creates software that is reliable and works efficiently on real machines.”
Compilation Slows Development
- Pretty much a non-issue these days.
- IDE auto-recompiles in the background.
- IDE only recompiles the file (Module) you're working on.
Why Language Geek? 🤓
- Fun
- Levels You Up: Increased market value.
- Teaches you new things about Programming.
- Sometimes changes the way you think about Programming.
- You learn things about the current language you use daily.
- It's nice to have Compiled and Scripting skills in your tool belt.
CPU's
- Limits of Physics
- Can't make Clock Speed faster.
- Can only add Cores.
- We must write code that distributes its load to all the Cores.
- Pro Tip: Scripting Languages don't.
The 3 Safeties
- Memory Safety
- Type Safety
- Concurrency Safety
Eiminate whole classes of bugs “by construction”. Increase reliability, security, and developer productivity.
Type Safety
- Prohibits use of Memory that is at odds with the Type allocated within that Memory.
- Flaws when violated: Type confusion, Casting errors, and uninitialized variables.
- Less severe than Memory-Safety holes.
- Leads to exploits.
Concurrency Safety
- Prohibits unsafe simultaneous use of shared Memory.
- Flaws when violated: data races, or read-write, write-read, and write-write hazards
- Frequently lead to Type and Memory-safety violations.
- “Concurrency vulnerabilities are the 'next frontier' of exploitable security holes.”
Google Go
- Creator: Ken Thompson. Invented UNIX and B
- Co-Creator: Rob Pike. Invented Plan-9 OS and UTF-8 charset.
- Dislike of C++'s complexity was their primary motivation.
- Static Typed / Compiled
- Friendly, Terse Syntax - "Light on the Page"
- Fast Compile Times
- Concurrency Primitives: Goroutines communicating over Channels.
- Type Inferance
- OOP Lite: Favors Composition
Mozilla Rust
- Creator: Graydon Hoare: On Swift team at Apple.
- Blazing Fast
- Trait-Based OOP
- Zero-Cost Abstraction
- High Concurrency
- Centered Around Safety
- Low-Level Access and Speed / High-Level Feel
- Terse Syntax
- Expressive: Metapgrogramming via Macros, etc.
- Best concepts from numerous languages
“The 3 Safeties” in Go
- Memory Safety: Go’s is OK. 😡 Rust’s is significantly safer.
- Type Safety: “Type Safety has always been a very contentious topic and Go maybe the first language to address this issue in 20 years, or since Algol.” --Bruce Eckel
- Concurrency Safe: No restrictions on how Goroutines access shared data. You can cause data races in Go. 😡
“The 3 Safeties” in Rust
- Bulletproof Memory Safety Without GC! Borrow and Ownership system
- Memory space is owned by variables.
- Temporarily borrowed by other variables.
- Dangling Pointers, Buffer Overruns, and Seg Faults do not exist in "safe" Rust. 🤯
- So good, it also allows you to safely share MUTABLE state. 🤯
- Type Safety: Strong, Static, Immutable Types
Rust: Concurrency
- Threads: Bound to an OS thread.
- Channels: Similar to Go
- Type System guarantees that concurrent code is free of data races. 🤯
- Catches any misuse of mutexes or other synchronization primitives at compile time.
- Async/Await-style coming in 2018
Rust: Type Inferance
fn main() {
let x: f64 = 2.0; // Explicit type annotation
let y: u64 = 3; // Explicit type annotation
let f: bool = false; // Explicit type annotation
// ^^^ Uneccessary. Can simply do:
let x = 2.0; // f64
let y = 3; // u64
let z = true; // bool
// Rust determinnes which type to assign based on value on the right.
}
Rust: No NULL! 🤯
“I call it my billion-dollar mistake. It was the invention of the NULL reference in 1965.” --Tony Hoare
“This has led to innumerable errors, vulnerabilities, and system
crashes, which have probably caused a billion dollars of pain and
damage in the last forty years.”
Rust: No NULL!
- Flag something as “Optional” using the “Option” type.
- Compiler forces you to cover both code paths.
match result {
// Division was valid.
Some(x) => println!("Result: {}", x),
// Division was invalid
None => println!("Cannot divide by 0"),
}
Rust: No Exceptions
- Errors are just values. Similar to Go.
- Specify that your function returns a "Result" type. Compiler
forces you to cover the `Ok` and `Err` paths.
let version = parse_version(&[1, 2, 3, 4]);
match version {
Ok(v) => println!("working with version: {:?}", v),
Err(e) => println!("error parsing header: {:?}", e),
}
Rust: Trait-based OOP
trait Quack {
fn quack(&self);
}
struct Duck();
impl Quack for Duck {
fn quack(&self) {
println!("quack!");
}
}
let duck = Duck();
duck.quack();
// quack!
Go
Drawbacks
- Data Races
- No Generics
- Not the best candidate for Systems or OS Programming.
- “Sometimes Go is too simple.”
- “Tooling is weird.”
- “Tricky to learn.”
- “Difficult to handle errors.”
Rust
Drawbacks
- Learning Curve:
- Learn Ruby, JS, or Python first.
- Compile Time
Rust: The Best Features From
- Abstract Machine Model: C
- Data types: C, SML, OCaml, Lisp, Limbo
- Optional Bindings: Swift
- Hygienic Macros: Scheme
- Functional Programming: Haskell, OCaml, F#
- Attributes: ECMA-335
- Memory Model & Management: C++, ML Kit, Cyclone
- Type Classes: Haskell
- Crate: Assembly in the ECMA-335 CLI model
- Channels and Concurrency: Newsqueak, Alef, Limbo
- Message passing and Thread failure: Erlang
Rust
👍 Rust 👍
The only language currently doing the 3 Safeties best, IMHO.
❤ Rust ❤
Rust won 1st Place for “most loved programming language”
in the Stack Overflow Developer Survey in 2016, 2017 and 2018.
🌈 Rust 🦄
Rust code optimizes itself!
🤣
Be a Language Geek!
- If you can learn TypeScript, you can learn Rust!
- Get into Compiled languages.
“A language that doesn’t affect the way you think about programming, is not worth knowing.”
— Alan Perlis


Polar Bear Facts 101:
Adult polar bears have no natural predators except other polar bears. Cubs less than one year old sometimes are prey to wolves and other carnivores. Newborn cubs may be cannibalized by malnourished mothers or adult male polar bears.
source:
seaworld.org