I hereby claim:
- I am rcdilorenzo on github.
- I am rcdilorenzo (https://keybase.io/rcdilorenzo) on keybase.
- I have a public key ASABBZcTLyE8g_vbKklI8aSC1LTqFlK-KHgIaZuKIcm39Qo
To claim this, I am signing this object:
#!/bin/bash | |
# resize-images.sh | |
# Preprocess Stanford Cars Dataset | |
# Stats for width | |
# ❯ ls cars_**/*.jpg | | |
# xargs -L1 identify -format "%w\n" | | |
# datamash min 1 max 1 mean 1 median 1 | |
# | |
# 78 7800 700.49255483472 640 |
hist.density <- function (data, xlab = "<x>", font.main = 1, | |
main = "Histogram of data") { | |
# Calculate histogram based on these values | |
data.hist = hist(data, plot = FALSE) | |
# Determine scaling factor | |
multiplier = data.hist$counts / data.hist$density | |
# Create density function of the area |
--- | |
- hosts: all | |
remote_user: pi | |
tasks: | |
- name: check if erlang installed | |
shell: which erl | |
register: erl_check | |
ignore_errors: true | |
- apt_repository: repo='deb http://packages.erlang-solutions.com/debian wheezy contrib' state=present |
# Assumes an existing data frame called `raw` | |
# that is directly imported from the URL and | |
# has not converted the "?" values to NA's | |
colnames(raw) <- c("Type", "CapShape", "CapSurface", "CapColor", "Bruises", | |
"Odor", "GillAttachment", "GillSpacing", "GillSize", | |
"GillColor", "StalkShape", "StalkRoot", | |
"StalkSurfaceAboveRing", "StalkSurfaceBelowRing", | |
"StalkColorAboveRing", "StalkColorBelowRing", "VeilType", | |
"VeilColor", "RingNumber", "RingType", "SporePrintColor", |
from word_frequency import WordFrequency | |
luke = WordFrequency('Luke', './Luke.txt') | |
matthew = WordFrequency('Matt', './Matthew.txt') | |
print('================================') | |
print('= Frequently Occurring Phrases =') | |
print('= Between Matthew & Luke (Max =') | |
print('= 4 words/phrase, Min freq 15) =') | |
print('================================') |
package main | |
import ( | |
"fmt" | |
"math" | |
"sort" | |
) | |
type Recommendation struct { | |
Name string |
I hereby claim:
To claim this, I am signing this object:
// Requires a property like the following | |
// @property (nonatomic, strong) UIPopoverController *textPopover; | |
- (void)displayPopoverForText:(NSString *)text inView:(UIView *)view presentingRect:(CGRect)rect maxSize:(CGSize)maxSize { | |
UIViewController *controller = [UIViewController new]; | |
UITextView *textView = [UITextView new]; | |
textView.text = text; | |
textView.editable = NO; | |
textView.backgroundColor = [UIColor clearColor]; |
TIL: Apparently, Swift does not support creating concrete protocols from generic ones since it uses associated types for more customizable generic protocol adaptation. This is in contrast to classes and structs. Here is an example of a generic struct from my situation:
fileprivate struct WindowScopeUpdate<State> {
let update: (State) -> (State)
}
An example usage would be like this (where TaskListWindowState
is a concrete type such as a class, struct, or non-generic protocol):