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
COMBO: Transport/Refusal/Canceled/Unfounded/Gone (94/93/87/90/96) | |
Transport: What pt told you (subjective) | |
Unit 93K1 dispatched to a X. | |
Unit responded non?emergent and arrived on scene WOI. | |
Upon arrival, unit found X yo fe/male, conscious, alert, breathing?, standing/semi-Fowler’s in bed/sitting in chair, in no obvious distress? | |
Pt reports chief complaint starting X days ago (SAMPLE/OPQRST). Pain X out of 10. “Pt quote.” | |
Pt denies consumption of alcohol/reports drinking N alcoholic beverages when? | |
Pt states PMHX of? | |
Pt reports/denies HNBP, HA, CP, SOB, LOC, head strike, DNV, and blood thinners. |
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
// Safely Modifying The View State (SwiftUI) | |
// https://swiftui-lab.com | |
// https://swiftui-lab.com/state-changes | |
import SwiftUI | |
struct CustomView: View { | |
var body: some View { | |
NavigationView { |
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
// Adapted from Stack Overflow answer by David Crow http://stackoverflow.com/a/43235 | |
// Question: Algorithm to randomly generate an aesthetically-pleasing color palette by Brian Gianforcaro | |
// Method randomly generates a pastel color, and optionally mixes it with another color | |
import UIKit | |
func randomPastelColor(mixedWith mixColor: UIColor? = nil) -> UIColor { | |
// Mix the color | |
let mixColor: UIColor = mixColor ?? .lightGray | |
var mixRed: CGFloat = 0, mixGreen: CGFloat = 0, mixBlue: CGFloat = 0; |
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
/// A fun Swift 5 way to concatenate a collection of String? elements, for example a [String?]. | |
extension String.StringInterpolation { | |
mutating func appendInterpolation(_ array: [String?]) { | |
appendLiteral(array.compactMap { $0 }.joined(separator: ", ")) | |
} | |
} | |
let array: [String?] = [nil, nil, "hello", nil, "world", nil, "abc", nil, nil, nil, nil] | |
print(array) // prints "[nil, nil, Optional("hello"), nil, Optional("world"), nil, Optional("abc"), nil, nil, nil, nil]" | |
print("\(array)") // prints "hello, world, abc" |
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
import tensorflow as tf | |
def create_bad_dataset(create_batches=True): | |
dataset = tf.data.Dataset.from_tensor_slices([1., 2., 0., 4., 8., 16.]) | |
# Computing `tf.check_numerics(1. / 0.)` will raise an InvalidArgumentError. | |
if create_batches: | |
# Demonstrates that error handling works with map_and_batch | |
dataset = dataset.apply(tf.contrib.data.map_and_batch( | |
map_func=lambda x: tf.check_numerics(1. / x, 'error'), batch_size=2)) |
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
class Solution: | |
""" | |
Solution to Leet Code problem 4Sum: https://leetcode.com/problems/4sum/ | |
Runtime: 100 ms beats 93.4% of python3 submissions | |
""" | |
def fourSum(self, nums, target): | |
""" | |
:type nums: List[int] | |
:type target: int | |
:rtype: List[List[int]] |
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
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"). | |
# You may not use this file except in compliance with the License. | |
# A copy of the License is located at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# or in the "license" file accompanying this file. This file is distributed | |
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
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
# Alex Walczak, 2017 | |
# Simple recursive merge sort implementation. | |
def merge(left, right): | |
if not (len(left) and len(right)): | |
return left or right | |
result = [] | |
i = j = 0 | |
while len(result) < len(left) + len(right): | |
if i == len(left) or j == len(right): |
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
''' | |
Alex Walczak, 2017 | |
Example of barrier implementation using TensorFlow shared variables | |
across a multi-machine cluster. | |
All workers synchronize on the barrier, copy global parameters to local versions, | |
and increment the global parameter variable asynchronously. | |
On each worker run: |