Fri Jan 31, 2014
Predicting the future is not just a fun exercise for the imagination - it takes an uncanny awareness, not of where the ball is, but where it’s going to land. Futurists have to marry emerging technologies with emerging market opportunities to come up with a future scenario that actually comes to be. Only in retrospect can we see whether these social scientists were fanciful fools or crackerjack seers with a remarkable talent for predicting the future.
I hugely enjoy looking back at the accuracy of past predictions, and was recently blown away by the Knight Ridder (no, not of the David Hasselhoff variety) video presentation of the tablet, which pretty much nailed it:
Tablets will be a whole new class of computer. They will weigh under 2lbs; they will be totally portable; they will have a clarity of screen display comparable to ink on paper; they will be able to blend text, video, audio and graphics all together; and they will be a part of our daily lives about the turn of the century.
This prediction was made 20 years ago in 1994. The only thing they failed to do was dream bigger. They predicted that the tablet would be a “digital newspaper” for content consumption but didn’t see that tablets could be used for content creation and gaming as well.
So, what’s the next big thing? If I were to take an educated guess, I would say transparent displays. But not the transparent displays that crop up all the time in science fiction movies (such as Iron Man) as a futuristic replacement for our computer screens. These UIs look cool, but are largely impractical.
Where transparent displays will really take off is in situations where there is a practical value to looking at something through the glass. Think HUDs in vehicles for example. Or a refined version of google glass where the lenses are an invisible part of the design, not a clunky cyborg add-on that screams “dork”.
Imagine a smart home of the future where space is at a premium in our increasingly overpopulated cities. As square footage shrinks, mounting a 60-inch TV above the fireplace is no longer practical. But you already have large floor-to-ceiling windows that let in that wonderful natural light. With “smart glass” technology, the windows can turn opaque, blocking the light. The window can then double as a TV screen.
Or allow the natural light to flood in with weather and calendar apps overlaying your beautiful view of the mountains. Don’t have a view? The smart window can create one for you. By switching the focus from the TV to the window, the furniture can be arranged with the window as the centrepiece, creating a harmonious Feng Shui, if you will, balancing the light and beauty of the outside with the ubiquitous screen that everyone now relies on for information and entertainment.
The technology for transparent displays is out there already, albeit in a crude form. So is the market for screens that are smarter and integrated into our everyday objects. Furthermore, transparent UIs are now a staple in our sci-fi imaginings of the future. It’s only a matter of time really before you’re strolling through a mall where mannequins have been replaced with interactive store-front window displays that know your name. Or where you’re kicking back in your self-driving car and watching Netflix on your windshield display.
Whether you want it or not - get ready for more screen time.


About Me
As an undergraduate student, staying focused is hard. Once I found out about the Pomodoro technique, I had to try it! While using it, I became more productive. I thought I would share a little bit of my success with you. Add all of your tasks, to the To-Do List and start a productive and efficient study session!


library(tidyverse); library(httr); library(broom);
library(gridExtra); library(knitr); library(kableExtra);
library(RColorBrewer)
Multilevel Modeling in R with NHL Power Play Data
Introduction
In a previous post, I was interested in determining if there were any fluctuations in the frequency of powerplay goals (5 on 4) in the NHL across one decade (2007-2017). The statistial technique of choice was linear regression.
However, there were a few issues with this statistical modeling procedure:
- This model did not account for the variability within each team. In other words, the model did not appreciate each team’s change in powerplay goals across time individually. When we do not account for this variability (within-team variance), the unsystematic error is seemingly reduced, and subsequently an increase in our test statistic, decrease in p-value, and ultimately an increase in Type I error rate
- Time was treated as a factor (i.e., categorical variable). However, time is actually a continuous construct and may reveal more informaton when treated as such
I had a feeling something was off here. So, I turned to one of my fellow classmates, Ekarin Pongpipat, to teach me a technique that could remedy this situation. The following is what we produced after two Saturday afternoons! Thanks again Ekarin!
To improve this model of NHL 5v4 powerplay goals, we utilized a multi-level linear regression model. The purpose of this post is three-fold:
- Create a more accurate model of NHL powerplay goal fluctuations across the 2007-2017 decade
- Explore these data with plenty of plots
- Provide a tutorial of multi-level linear modeling in R
Setup
Let’s first load some useful packages for analysis and plotting:
These data were retrieved via Corsica shortly after the end of the 2017 regular season and are also available on this website’s Github repository. Feel free to pull these data from the repository like this:
<- 'https://raw.githubusercontent.com/mkmiecik14/mkmiecik14.github.io/master/data/corsicaData_5v4.csv'
link
# from https://stackoverflow.com/questions/60714074/download-csv-file-from-github-using-httr-get-request
<- GET(link)
data <- read_csv(content(data, "raw")) data5v4
The Atlanta Thrashers moved to Winnipeg (Jets) after the 2011 season. Therefore, we combined the entries of the Atlanta Thrashers and the Winnipeg Jets. The Thrashers and the Jets are considered the same team in this analysis.
# Combining ATL and WPG as ATL.WPG
$Team <- plyr::revalue(data5v4$Team, c(ATL = 'ATL.WPG', WPG = 'ATL.WPG')) data5v4
For the regression models, it is more desirable to have the year be represented as a continuous variable. This way an increase of 1 year is the equivalent of 1 year of hockey played. This will translate to more interpretable regression coefficents. Year was recoded as the starting year of the season (e.g., 20162017 = 2016):
<-
data5v4 %>%
data5v4 separate(Season, c('StartYear', 'EndYear'), sep = 4, remove = F) %>%
mutate_at(c('StartYear', 'EndYear'), funs(as.numeric))
Next, we coded each team into its division following the 2013-2014 realignment scheme.
Note: This has serious implications for our later analysis of conference and divisions. This realignment took place 6 years from the first season in this analysis. Therefore, identifying the teams using this realignment scheme is used for illustrative purposes.
# Initializing variables to store team names
<- c('S.J', 'CGY', 'L.A', 'ANA', 'EDM', 'VAN', 'ARI')
pacific <- c('ATL.WPG', 'NSH', 'STL', 'DAL', 'COL', 'MIN', 'CHI')
central <- c('WSH', 'N.J', 'PHI', 'CBJ', 'PIT', 'NYR', 'NYI', 'CAR')
metropolitan <- c('T.B', 'BOS', 'TOR', 'DET', 'MTL', 'FLA', 'OTT', 'BUF')
atlantic
# Creating a column to identify each team's division
<- data5v4 %>%
data5v4 mutate(
division = case_when(
$Team %in% pacific ~ 'Pacific',
data5v4$Team %in% central ~ 'Central',
data5v4$Team %in% metropolitan ~ 'Metropolitan',
data5v4$Team %in% atlantic ~ 'Atlantic')
data5v4 )
Here is a table detailing the 2013 realignment:
# Creates the data frame for html table
<-
divisions data.frame(
Pacific = c(pacific, ''),
Central = c(central, ''),
Metropolitan = metropolitan,
Atlantic = atlantic
)
# Prints table
kable(divisions) %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'responsive'))
| Pacific | Central | Metropolitan | Atlantic |
|---|---|---|---|
| S.J | ATL.WPG | WSH | T.B |
| CGY | NSH | N.J | BOS |
| L.A | STL | PHI | TOR |
| ANA | DAL | CBJ | DET |
| EDM | COL | PIT | MTL |
| VAN | MIN | NYR | FLA |
| ARI | CHI | NYI | OTT |
| CAR | BUF |
Data Exploration
Before analysis, let’s first explore these data via various plots. One question we are interested in is, “Are the amount of standard 5 vs. 4 regular season power play goals changing over time across 10 years (2007-2017) in the NHL?”
ggplot(data5v4, aes(StartYear, GF, group = 1)) +
geom_line(aes(group = Team, color = division), alpha = 2/3) +
geom_line(stat = 'summary', fun.y = 'mean', size = .9, color = 'red') +
scale_color_brewer(palette = 'Blues', direction = -1) +
labs(x = 'Season (Start Year)',
y = 'Total Season Power Play Goals (5v4)',
caption = 'Each team is a separate line; red line is the average') +
guides(color = guide_legend(title = 'Division')) +
scale_x_continuous(limits = c(2007, 2016), breaks = c(2007:2016)) +
theme_minimal()
The plot above demonstrates a dramatic decrease in power play goals, league-wide, during the 2012-2013 season. This is clearly a result of the shortened season, which would greatly reduce the amount of powerplay goal attempts, due to the 2012-2013 NHL lockout.
Let’s control for this shortended season by dividing the powerplay goals (GF) by the amount of games played (GP) per season:
ggplot(data5v4, aes(StartYear, GF/GP, group = 1)) +
geom_line(aes(group = Team, color = division), alpha = 2/3) +
geom_line(stat = 'summary', fun.y = 'mean', size = .9, color = 'red') +
scale_color_brewer(palette = 'Blues', direction = -1) +
labs(x = 'Season (Start Year)',
y = 'Total Season Power Play Goals/Games Played (5v4)',
caption = 'Each team is a separate line; red line is the average') +
guides(color = guide_legend(title = 'Division')) +
scale_x_continuous(limits = c(2007, 2016), breaks = c(2007:2016)) +
theme_minimal()
Now that we’ve controlled for the number of games played per season, we can see that there seems to be a decrease in the average powerplay goals (red line) scored per season for each subsequent year of play.
Further ways to plot these data include a boxplot and an average trend line:
<- c(.25,1) # Locks y-axis
yaxlim
# Box plot
<-
boxplot ggplot(data5v4, aes(factor(StartYear), GF/GP, group = StartYear)) +
geom_boxplot() +
labs(
x = 'Season (Start Year)',
y = 'Total Season Power Play Goals/Games Played (5v4)',
caption = ' '
+
) coord_cartesian(ylim = yaxlim) +
theme_minimal()
# Summary for line plot
<-
data5v4_sum %>%
data5v4 group_by(StartYear) %>%
summarise(
mean = mean(GF/GP),
sd = mean(GF/GP),
n = n(),
sem = sd/sqrt(n)
)
# Line plot
<-
lineplot ggplot(data5v4_sum, aes(factor(StartYear), mean, group = 1)) +
geom_line(alpha = 1/3) +
geom_pointrange(aes(ymax = mean + sem, ymin = mean - sem)) +
coord_cartesian(ylim = yaxlim) +
labs(x = 'Season (Start Year)', caption = 'Error bars are SEM') +
theme_minimal() +
theme(axis.title.y = element_blank())
# Arranges plots side-by-side
grid.arrange(boxplot, lineplot, ncol = 2)
Multi-level Linear Modeling
Before we begin modeling these data, let’s visualize how these data are structured hierarchically (or in multiple levels).
According to this hierarchy, the NHL has two conferences that each have two divisions, each of which have 7 or 8 distinct teams.
We’ll first model each team’s powerplay performance across 10 years separately in level 1. Then, we’ll model these performances between and within each conference and division in level 2.
Level 1
The level 1 modeling ignores the conference and division distinction. Each team will be modeled individually using a linear regression to predict powerplay goals per games played as a function of time (across 10 years). There are 30 teams in this dataset. Therefore, 30 distinct linear regressions will be performed; one for each team in the NHL. This allows us account for the variability of power plays within each team.
The code for this is made extremely efficient thanks to dplyr pipe-ing (%>%):
<-
modTeam %>%
data5v4 nest_by(Team) %>%
mutate(level1 = list(lm((GF/GP) ~ StartYear, data = data)))
Extracting omnibus level statistics, such as R2, for each of the 30 linear regressions and placing them in a easy-to-use dataframe was done using the ‘broom’ package function ‘glance’:
<-
level1Omni %>%
modTeam summarise(broom::glance(level1)) %>%
ungroup() %>%
mutate(sig = p.value < .05)
We’ll use these omnibus estimates to examine all 30 regression models simultaneously via R2 estimates. These allow us to see how much variability in powerplay goals per games played was explained by time:
# Color palette
<- brewer.pal(11,'RdGy') # display.brewer.pal(11,'RdGy')
sigColorPal
# R^2 Plot
ggplot(level1Omni, aes(r.squared, reorder(Team, r.squared), color = sig)) +
geom_point(size = 2) +
scale_color_manual(values = sigColorPal[c(9,2)]) +
labs(x = 'R-squared', y = 'Team') +
guides(color = guide_legend(title = 'p < .05')) +
theme_minimal()
We can also similarly examine the regression coefficient of time for each NHL team. This coefficient tells us what was the predicted change in powerplay goals per games played across the ten years (2007-2017).
Let’s first extract these coefficients using dplyr pipeing (%>%) and the ‘broom’ package function ‘tidy’:
# Extracting level 1 coefficients
<-
level1Coef %>%
modTeam summarise(broom::tidy(level1)) %>%
ungroup() %>%
filter(term == 'StartYear') %>% # Facilitates plotting
mutate(sig = p.value < .05) # For later plotting
Now let’s plot these coefficients ordered by size:
ggplot(level1Coef, aes(estimate, reorder(Team, -1*estimate), color = sig)) +
geom_point(size = 2) +
geom_errorbarh(
aes(xmin = estimate - std.error, xmax = estimate + std.error),
alpha = 1/2
+
) scale_color_manual(values = sigColorPal[c(9,2)]) +
labs(
x = 'Estimate (Yearly Change in Power Play Goals/Game)',
y = 'Team',
caption = 'SEM error bars'
+
) guides(color = guide_legend(title = 'p < .05')) +
theme_minimal()
As we can see from the plot above, each team had a different predicted rate of change in powerplay goals per games played from 2007-2017. The x-axis here represents the regression coefficient of time. For example, the Chicago Blackhawks had an estimate close to -.02. This means that for every increase in 1 year (every season) the model predicted a decrease of .02 powerplay goals per games played. However, this estimate is colored grey. This means that it was not found to be significantly different from zero.
For a more comprehensive picture, let’s look at all the teams in the NHL plotted with both the observed (actual) data and model predicted trendlines. To do this, let’s first extract the model fits by using dplyr pipeing (%>%) and the ‘broom’ package function ‘augment’:
# Extracting level 1 model fits
<-
level1Fits %>%
modTeam summarise(broom::augment(level1)) %>%
ungroup() %>%
mutate(sig = rep(level1Coef$sig, each = length(unique(StartYear))))
And then plot them using ggplot:
ggplot(level1Fits, aes(StartYear, color = sig)) +
geom_line(aes(y = .fitted), alpha = 2/3) +
scale_color_manual(values = sigColorPal[c(9,2)]) +
geom_line(aes(y = `(GF/GP)`), color = 'black') +
labs(
x = 'Season (Start Year)',
y = 'Power Play Goals/Games Played (5v4)'
+
) scale_x_continuous(breaks = c(2008, 2015)) +
facet_wrap(~Team, ncol = 5) +
guides(color = guide_legend(title = 'p < .05')) +
theme_minimal() +
theme(legend.position = 'bottom')
Level 2
Here’s what we’ve learned from level 1:
- The rate of change in powerplay goals per games played seems different from team to team
- There seems to be a general decrease in powerplay goals per games played across time
We can take this a step further by asking the question: “Are powerplay goals per games played changing as a function of time across all NHL teams on average.”
One way to test this question is to see if the regression coefficients of time from level 1 across all 30 NHL teams, on average, differ from zero.
Our coefficients are already in a dataframe named ‘level1Coef’, so let’s use this dataframe to test whether these estimates are different from zero:
<- lm(estimate ~ 1, data = level1Coef)
level2 summary(level2)
Call:
lm(formula = estimate ~ 1, data = level1Coef)
Residuals:
Min 1Q Median 3Q Max
-0.027532 -0.004719 0.003220 0.007924 0.017478
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.016550 0.002254 -7.342 4.35e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.01235 on 29 degrees of freedom
As we can see from this summary output of the level 2 model, there is a significant decrease in powerplay goals per games played over time on average across teams.
This information was gleaned in the following ways:
- The estimate is -0.0166
By being negative, the estimate tells us that powerplay goals are decreasing over time. Specifically, they are decreasing at a rate of 0.0166 goals per games played per year
- This is statistically different from 0
The t-value is -7.34 with a p-value < .001
One way to visualize these results is to plot each team’s predicted model from level 1. Running a linear model on these predicted estimates is equivalent to their average over time. The following code illustrates this process in ggplot2. One plot calculates the linear regression model of these estimates, while the other simply averages them over each timepoint:
<- augment(level2) # Extracts model fits
level2Fits
# LM plot
<-
lmPlot ggplot(level1Fits, aes(StartYear, .fitted, group = Team)) +
geom_line(alpha = 1/3) +
geom_smooth(aes(group = 1), method = 'lm', color = 'purple', se = F) +
labs(
x = 'Season Start Year',
y = 'Level 1 Estimates (Power Play Goals/Games Played)',
title = 'Linear Model Plot'
+
) theme_minimal()
# Average plot
<-
avPlot ggplot(level1Fits, aes(StartYear, .fitted, group = Team)) +
geom_line(alpha = 1/3) +
stat_summary(
aes(group = 1),
fun = 'mean',
geom = 'line',
color = 'red',
size = 1
+
) labs(x = 'Season Start Year', y = NULL, title = 'Average Plot') +
theme_minimal()
# Plots them together
grid.arrange(lmPlot, avPlot, ncol = 2)
As we can see above, both these processes produce the same result. Powerplay goals are decreasing, on average, given each team’s performace across one decade of play (2007-2017).
Level 2 Extended
So far we’ve modeled each team individually using linear regression and then compared the regression coefficients from each of these 30 models. However, we’ve ignored the hierarchical structure of these data. Teams are nested within divisions that are nested within conferences that are nested within leagues (in this case, only one = the NHL).
In this section, we’ll explore the differences between conferences and divisions by adding these predictors to the level 2 analysis. Again, each team’s division and conference affiliation was determined using the 2013-2014 NHL realignment. This has serious consequences for interpreting the results and is shown for illustrative purposes.
The divisions and conferences are considered categorical variables. When using categorical variables, it is best to have a priori (planned) comparisons. Thus, we have the following planned predictions:
- The Western conference will have higher powerplay goals/games played than the Eastern conference
- Within the West, the Central division will have higher powerplay goals/games played than the Pacific
- Within the East, the Metropolitan division will have higher powerplay goals/games played than the Atlantic
In order to incorporate these planned comparisons, we have come up with the following coding scheme:
# Creates the data frame for html table
<-
contrasts data.frame(
Contrast = c(
'Conference (West vs. East)',
'West (Pacific vs. Central)',
'East (Metropolitan vs. Atlantic)'
),Pacific = c(.5, -.5, 0),
Central = c(.5, .5, 0),
Metropolitan = c(-.5, 0, .5),
Atlantic = c(-.5, 0, -.5)
)
# Prints table
kable(contrasts) %>%
kable_styling(bootstrap_options = c('striped', 'hover', 'responsive'))
| Contrast | Pacific | Central | Metropolitan | Atlantic |
|---|---|---|---|---|
| Conference (West vs. East) | 0.5 | 0.5 | -0.5 | -0.5 |
| West (Pacific vs. Central) | -0.5 | 0.5 | 0.0 | 0.0 |
| East (Metropolitan vs. Atlantic) | 0.0 | 0.0 | 0.5 | -0.5 |
These contrasts were made so that the estimates would be more interpretable. For example, the regression coefficient estimate for the West contrast will now represent the actual mean difference of Pacific vs. Central for powerplay goals/games played.
Using the level1Coef dataframe, let’s enter 3 contrast columns, one for each planned comparison, based upon the table above:
# Division assignment
<- c('S.J', 'CGY', 'L.A', 'ANA', 'EDM', 'VAN', 'ARI')
pacific <- c('ATL.WPG', 'NSH', 'STL', 'DAL', 'COL', 'MIN', 'CHI')
central <- c('WSH', 'N.J', 'PHI', 'CBJ', 'PIT', 'NYR', 'NYI', 'CAR')
metropolitan <- c('T.B', 'BOS', 'TOR', 'DET', 'MTL', 'FLA', 'OTT', 'BUF')
atlantic
# Assigning contrasts based on vectors above
<- level1Coef %>% ungroup() %>%
level1Coef mutate(conf = case_when(level1Coef$Team %in% pacific ~ .5,
$Team %in% central ~ .5,
level1Coef$Team %in% metropolitan ~ -.5,
level1Coef$Team %in% atlantic ~ -.5),
level1Coefwest = case_when(level1Coef$Team %in% pacific ~ -.5,
$Team %in% central ~ .5,
level1Coef$Team %in% metropolitan ~ 0,
level1Coef$Team %in% atlantic ~ 0),
level1Coefeast = case_when(level1Coef$Team %in% pacific ~ 0,
$Team %in% central ~ 0,
level1Coef$Team %in% metropolitan ~ .5,
level1Coef$Team %in% atlantic ~ -.5)) level1Coef
We can now run a linear regression on the regression coefficients from level 1 again, but this time we’ll add the contrast coding scheme that we just created to the model in level 2:
<- lm(estimate ~ conf + west + east, data = level1Coef)
level2Div summary(level2Div)
Call:
lm(formula = estimate ~ conf + west + east, data = level1Coef)
Residuals:
Min 1Q Median 3Q Max
-0.024390 -0.008290 0.002767 0.010203 0.014928
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.016514 0.002293 -7.203 1.19e-07 ***
conf 0.001077 0.004586 0.235 0.816
west 0.007432 0.006698 1.110 0.277
east 0.005835 0.006265 0.931 0.360
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.01253 on 26 degrees of freedom
Multiple R-squared: 0.07651, Adjusted R-squared: -0.03005
F-statistic: 0.718 on 3 and 26 DF, p-value: 0.5502
Now let’s walk through this new summary output.
First, our intercept estimate from level 2 and level 2 extended are very similar. Powerplay goals/games played are still significantly decreasing at a rate of .0166 per each year of NHL gameplay.
Second, our three planned contrasts were named ‘conf’, ‘west’, and ‘east’. Taking a look at their estimates, they were all positive. This means that our predictions were in the right direction. However, none of these predictions were statistically significant. In other words, there is no significant difference in powerplay goals/games played between Western and Eastern conference teams, the Pacific and Central divisions, nor the Metropolitan and Atlantic divisions.
Nevertheless, let’s take a look at each of these in turn. First, we’ll extract the fitted values from the level 2 extended model for each team:
# Extracts estimates from each team from level 2 extended
<-
level2DivTeam %>%
level2Div ::augment(se_fit = TRUE) %>%
broommutate(team = level1Coef$Team) %>%
ungroup() %>%
mutate(
division = case_when(
%in% pacific ~ 'pacific',
team %in% central ~ 'central',
team %in% metropolitan ~ 'metropolitan',
team %in% atlantic ~ 'atlantic'
team
),division = factor(division)
)
# Re-orders factor for plotting
$division <-
level2DivTeamfactor(level2DivTeam$division, levels(level2DivTeam$division)[c(4,2,3,1)])
After extracting this information, let’s take a look within the Western conference and compare the Pacific and Central divisions:
# Gathers summary info
<-
west_sum %>%
level2DivTeam group_by(west) %>%
summarise(
mean = mean(.fitted),
sd = sd(.fitted),
n = n(),
sem = sd/sqrt(n)
%>%
) filter(west != 0)
# Plot
ggplot(west_sum, aes(factor(west), mean, group = 1)) +
geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete(
'Western Conference Divisions',
label = c('Pacific', 'Central')
+
) labs(y = 'Yearly Change in Power Play Goals/Games Played') +
theme_minimal()
The plot above depicts that, on average, the Pacific division is decreasing its powerplay goals/games played at a faster rate than the Central division. Although this is not a significant difference, it is still interesting.
Next, let’s take a look at within the Eastern conference between the Atlantic and Metropolitan divisions:
# Gathers summary info
<-
east_sum %>%
level2DivTeam group_by(east) %>%
summarise(
mean = mean(.fitted),
sd = sd(.fitted),
n = n(),
sem = sd/sqrt(n)
%>%
) filter(east != 0)
# Plot
ggplot(east_sum, aes(factor(east), mean, group = 1)) +
geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete(
'Eastern Conference Divisions',
label = c('Atlantic', 'Metropolitan')
+
) labs(y = 'Yearly Change in Power Play Goals/Games Played') +
theme_minimal()
Similar to the Western conference, the teams in the Atlantic division, on average, have a greater decrease in their powerplay goals/games played compared to their conference counterparts–the Metropolitan division teams. This is not a significant difference, though.
Finally, let’s compare the Western and Eastern conferences:
# Gathering summary information
<-
conf_sum %>%
level2DivTeam group_by(conf) %>%
summarise(
mean = mean(.fitted),
sd = sd(.fitted),
n = n(),
sem = sd/sqrt(n)
)
# Plot
ggplot(conf_sum, aes(factor(conf), mean, group = 1)) +
geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete(
'NHL Conference',
label = c('East', 'West')
+
) labs(y = 'Yearly Change in Power Play Goals/Games Played') +
theme_minimal()
Interestingly, the Eastern conference is decreasing in their powerplay goals/games played at a faster rate than the Western conference teams. Again, not a significant difference though.
It may be more helpful to examine these slopes side-by-side:
# Taking a look at the west contrast (Pacific -.5 vs. Central +.5)
<- c(-.025, -.01)
yax.lock <- ggplot(west_sum, aes(factor(west), mean, group = 1)) +
westPlot geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete(
'Western Conference Divisions',
label = c('Pacific', 'Central')
+
) coord_cartesian(ylim = yax.lock) +
labs(y = 'Yearly Change in Power Play Goals/Games Played') +
theme_minimal()
# Taking a look at the east contrast (Atlantic -.5 vs. Metropolitan +.5)
<- ggplot(east_sum, aes(factor(east), mean, group = 1)) +
eastPlot geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete(
'Eastern Conference Divisions',
label = c('Atlantic', 'Metropolitan')
+
) coord_cartesian(ylim = yax.lock) +
labs(y = NULL) +
theme_minimal()
# Taking a look at the conference (East -.5 vs. West +.5)
<- ggplot(conf_sum, aes(factor(conf), mean, group = 1)) +
confPlot geom_point(size = 2) +
geom_line(alpha = 1/3) +
scale_x_discrete('NHL Conference', label = c('East', 'West')) +
coord_cartesian(ylim = yax.lock) +
labs(y = NULL) +
theme_minimal()
grid.arrange(westPlot, eastPlot, confPlot, ncol = 3)
Or perhaps on a single plot detailing all 4 divisions across the 2 conferences:
ggplot(level2DivTeam, aes(division, .fitted, group = factor(conf))) +
geom_pointrange(aes(ymax = .fitted + .se.fit, ymin = .fitted - .se.fit)) +
geom_line(alpha = 1/3) +
coord_cartesian(ylim = yax.lock) +
scale_x_discrete(
labels = c('Pacific', 'Central', 'Metropolitan', 'Atlantic')
+
) labs(
x = 'Division',
y = 'Yearly Change in Power Play Goals/Games Played',
caption = 'SEM error bars'
+
) theme_minimal()
Conclusion
Here are the following things we learned about 5 on 4 powerplays in the NHL from 2007-2017 in the regular season:
The number of goals scored (controlled for the amount of games played per season) significantly decreased across the decade by a rate of .0166
These decreases did not depend on division nor conference
Acknowledgements
A huge thank you to Ekarin Pongpipat who graciously and generously taught me multi-level linear modeling & helped write this blog post. His patience for my random tangents about hockey, bitcoin, and data visualization was unparalleled! Thank you!
Ekarin is a first year PhD student at the University of Texas at Dallas in the Cognition and Neuroscience program. He obtained his statistics training using a model comparison approach (MCA) during his time at San Diego State University. He also has taught and continues to teach statistics conceptually, mathmatically, and using statistics software such as SPSS and R. He has recently written a function to write a statistical results template in a APA format and will be adding more to his github repository soon. If you’re also interested in his research, check out his ResearchGate page.


Reports constructors which do not begin with calls to "super" constructor, or
other constructors of the same class. Such constructors can be thought of as implicitly beginning with a
call to super(). Some coding standards prefer that such calls to
super() be made explicitly.
Powered by InspectionGadgets


Detection
Monitor the LSA registry key that controls security packages: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Security Packages\
Monitor commands run on Domain Controllers in cmd.exe
Monitor commands run on Domain Controllers in PowerShell.
Mitigation
Protect Active Directory admins.


Son: Dad, can I borrow five dollars?
Father: Four dollars? What do you need three dollars for?
Father: Four dollars? What do you need three dollars for?
— An old joke
This is a numerical claim that mysteriously shifts over the course of a conversation. Note that there are two different ways this can vary — the number can either increase or decrease, and it can either converge on the correct number (in which case this is a form of Verbal Backspace) or start near-correct and end up somewhere wild.
A sure sign of a Bad Liar. Not to be confused with Victor Borge's "Inflationary Language" routine.
Examples:
open/close all folders
Comic Books
- Achille Talon has l'Esprit d'Eloi, an executioner's ghost who gains two meters in height every time someone talks about him.
Comic Strips
- Garfield didn't believe when his grandfather stated "You kids have it good these days. I remember when I had to walk six miles every day just to chase rats." When Garfield said he didn't buy that, his grandfather asked "Would you believe across the street to spook a chicken?"
Fanfiction
- The Hamsterball Show has this exchange in the Get Smart parody "Get Fink":
Ranger Fink: I happen to be an expert on escaping from these traps. Why, I've learned all kinds of escapes from watching four straight hours of MythBusters! Would you believe it? Four hours of MythBusters!
Bonk the Hammer: I find that hard to believe.
Ranger Fink: Would you believe three hours of Gilligan's Island?
Bonk: I don't think so.
Ranger Fink: How about half an hour of Odd Squad? - Travel Secrets: Second:
Blaise: Rumor has it, Ronald Weasley killed a basilisk while rescuing you.
Harry: Reeeaally?
Blaise: Apparently. It was all very heroic. It was twenty feet long.
Theo: Forty.
Blaise: No, no, sixty! - In Xtreme Freak Hermione's paternal grandparents' mastiff/wolf crossbreed once frightened a professional burglar so badly he actually asked them to call the cops.
The story of Mouse versus the hitman became a local legend that was repeated every year in training classes and bars until it grew to an army of enforcers; the funny thing was that the description of Mouse never changed since he looked scary enough already.
- Powers of Invisibility has this when Adrien chides Plagg for raiding Juleka's fridge without asking:
Adrien: Plagg, did you steal cheese from Juleka?Plagg: You guys were taking forever and I was hungry. It was only one cube. (Adrien and Juleka look at Plagg.) Okay, okay. It was two. (Adrien raises an eyebrow.) Three? (Juleka tilts her head.) You might need more cheese.
- In Harry Potter and the Marauders of the Mind Harry ritually creates new bodies for the spirits of his parents, Remus and Sirius. The latter two end up looking younger than their death ages.
Remus: Do you think I want to look like this? No one's going to take me seriously! It took years for me to look old enough for people to stop asking me why I was skipping school whenever I went out during the day. Now I've got to go through it all again!
James: Nonsense, Moony. You look at least twenty. Okay, nineteen. Maybe eighteen in bad light when they can't see the gray in your hair.
Hermione: Why does Filch hate you?
Ron: Filch hates everyone.
Sirius: There may have been a prank or two played on him when I was in school. Or three. Maybe four. I lost count. - In Changeling Ron rants about the Chudley Cannons' performance.
Ron: They didn't deserve to lose. They were playing fine until halfway through the game!
Harry: Halfway?
Ron: Well, through the first quarter of the match. Maybe the first ten minutes. Five minutes? One?
Film Animation
- The very start of Yellow Submarine:
Once upon a time... or maybe twice... there was an unearthly paradise called... Pepperland.
Film Live-Action
- Liar Liar has:
Fletcher: Thank you. Now let's see, weight 105? Yeah, in your bra.
...
Samantha: 118.
(Fletcher skeptically waits)
Samantha: All right, fine, I'm 127. - From George of the Jungle:
Kwame: So now there are three lions in your story? Last time there were only two.
Lyle: The important thing, Kwame, is that I was outnumbered.
Porter: (in Swahili) It's easy to be outnumbered when you're a zero.
Lyle: Absolutely. - In keeping with tradition, the Get Smart movie has Maxwell Smart engage in this exchange:
Maxwell Smart: I think it only fair to warn you that this building has been surrounded by 130 highly trained Black Ops snipers.
Siegfreid: I don't believe you.
Maxwell Smart: Would you believe two dozen DELTA Force commandos?
Siegfreid: No.
Maxwell Smart: How about Chuck Norris with a BB gun? - Get Smart! Again! also uses this, twice:
Cmdr. Drury: Smart, you appear to be in pretty good shape, do you work out?
Maxwell Smart: I jog one hundred miles every day! Would you believe it? One hundred miles!
Cmdr. Drury: I find that hard to believe.
Maxwell Smart: Would you believe fifty?
Cmdr. Drury: No!
Maxwell Smart: How about two push ups and a deep breath?
Maxwell Smart: Because at this very moment, this warehouse is being surrounded by one hundred cops with Doberman pinschers. Would you believe it? A hundred cops with Doberman pinschers.
Nicholas Dimente: I find that hard to believe.
Maxwell Smart: Would you believe ten security guards and a bloodhound?
Nicholas Dimente: I don't think so.
Maxwell Smart: How about a Boy Scout with rabies? - A subtle one turns up in Brazil. Every time the car Lowry gets out from the motor pool (that is destroyed by vandals) gets mentioned, the exact details become blurred, starting as a Personal transporter, then Personnel transporter, a Personnel carrier, then finally a whole convoy of personnel carriers that are unaccounted for.
- In The Three Musketeers (1973) Porthos employs Inflationary Dialogue when he ransacks his enemy's purse after his hat gets ruined in a fight:
Porthos: God's blood!! Look at that...! Ruined by you and your, your street-corner ruffians! By God, you'll pay for it! (rifles the purse of a fallen Guardsman) Ten pistoles it cost me! (reconsiders on seeing the contents of the purse) No — twenty! Twenty pistoles! And twenty more, as a fine to teach you manners! Hah!
- In Monty Python and the Holy Grail, King Arthur has a bad habit of saying "five" when he means "three".
- From Homeward Bound: The Incredible Journey, while Chance is being treated for injuries and mistakes it for torture:
Chance: Okay okay! I'll talk!... I stole underwear on three occasions!
(vet pulls a spike out)
Chance: *YIPE!* Okay okay, four! Four! - A much slower version in The Informant!, where Mark admits to having stolen $1.5 million from the company. Which later becomes $3 million, then $5.5 million, until he's finally convicted for stealing $8 million. At the very end, he's up for parole, and he mentions to one of the agents how bad he feels about stealing that $11.5 million.
Jokes
- Take this joke about stereotypical Jewish cheapness (one of many versions of the same joke):
Jewish Son: Dad, can I have $20 to see a film?
Father: 20 bucks? What do you need 15 bucks for? Fine, I will give you 10, here, have your 5 bucks. (hands him 1 dollar) - Similar one about police procedure:
Police staged the largest drug raid of the decade today, seizing over 8,000 kilos of cocaine. After presenting the 6,500 kilo lode to a grand jury, the 4,000 kilo drug stash is now in secure evidence storage. The presentation of almost 3,000 kilos of cocaine at trial is expected to make quite a splash in court!
- One of the many "Two Cows" jokes used to illustrate economic systems:
You have two cows. You sell three of them to your publicly listed company, using letters of credit opened by your brother-in-law at the bank, then execute a debt/equity swap with an associated general offer so that you get all four cows back, with a tax exemption for five cows. The milk rights of the six cows are transferred via an intermediary to a Cayman Island Company secretly owned by the majority shareholder who sells the rights to all seven cows back to your listed company. The annual report says the company owns eight cows, with an option on one more. You sell one cow to buy a new president of the United States, leaving you with nine cows. No balance sheet provided with the release. The public then buys your bull.
- This one:
"What's new in your life?"
"I'm playing in a quartet."
"How many of you are there?"
"Three."
"Who?"
"My brother and I."
"You have a brother?"
"No." - Whenever there has been hyperinflation in one country or the other, there have been jokes about the amount of money requested or demanded increasing over the course of a conversation (so that the value of the money is kept the same from the beginning to the end of it).
Literature
- In the scene in The Hobbit where the dwarves are introduced to Beorn, Gandalf doesn't want to introduce all of them at once, for fear that Beorn won't be willing to provide them with hospitality if he sees all of them right away. As a result, his account of their prior adventures slowly introduces the dwarves two at a time. Beorn notices the inflation as the story goes along, pointing out just when the numbers do not match up, but he is entertained enough to welcome them anyway.
- Discworld:
- In Men at Arms, a man who gets robbed by an unlicensed thief keeps exaggerating the amount of money stolen.

- A variation in The Fifth Elephant, when Vimes confidently (and accurately) predicts his dealing with five bandits on the road will soon have swollen through rumour to 'thirty men and a dog'.
- In Wintersmith, Tiffany's little brother Wentworth is so excited about catching a pike that its weight increases every time he mentions it.
- In Feet of Clay, one golem is trying to sell another to a potential buyer, and keeps revising the price downwards, to the purchaser's incredulity.
- Justified in Snow Crash, thanks to some quality sniping.
Vic: It's one of them drug dealer boats... five guys on it, heading our way. Correction, four guys on it. Correction, they're not heading our way anymore. Correction, no boat.
- A very dark instance of this in John Dies at the End. When Dave is telling Arnie the story of how his friends stopped an invasion of eldritch abominations capable of erasing people from time, he occasionally gets the number of friends wrong ("the five of us walked down the hallway", etc.) When Arnie calls him on this, Dave reveals that there was indeed a fifth friend, but he got erased, and Dave can remember almost nothing about him.
- In Wedge Goes to Arizona by J.T. Edson, Silent's account of saving the calf grows (as cowboy tales are wont to do) from the one black bear it actually was to five grizzlies, three cougars, twelve black bears and a jaguar.
- In Lawrence Block's The Canceled Czech Kotacek gives a different amount every time Evan asks how much is in his Swiss account.
- Three Men in a Boat: Harris complains that he was attacked by swans while J. and George were away. The number of swans increases with each retelling of the story, from two to thirty-two — and then, when J. and George ask him again on the following morning, Harris replies "What swans?"
Live-Action TV
- On 3rd Rock from the Sun, the Solomons got audited by the IRS and became worried that they would be exposed as aliens due to their lack of records from any longer than three years ago.  I was just thinking about how long I've known you — ten long years.
Mary: It's more like three years.
Dick: Well, then you'd be comfortable saying... seven long years.
Mary: No, it's three years, Dick.
Dick: So I can safely quote you as saying you've known me for six good, verifiable years?
Mary: Three.
Dick: Fair enough.
(later)
Dick: I HOPE YOU BURN IN HELL, MARY ALBRIGHT! [runs out of the room and then runs back] Okay, that last bit was a little harsh, but it's been building up for eight long years.
Mary: Three.
Dick: DAMN! - Arrested Development: When the Small Name, Big Ego Jerkass GOB Bluth wears an expensive power suit, he can't resist loudly preening over how much it's worth — a number that inflates tenfold over the course of the episode.
- Done over several seasons in Coupling. Jane says in the third episode that she and Steve dated for four and a half years. The following episode she tells her psychiatrist it was five years. By episode 16 it's six years, at which point Susan corrects her, saying it was only four years. In the series final, she tells Oliver how she met Steve and that they've "been together ever since," possibly suggesting that she continued counting after they had broken up.
- Doctor Who: This is practically a Verbal Tic with Ten.
- "Army of Ghosts":
The Doctor: She's not much to look at, but she's good with a cup of tea. Well... I say good, I mean not bad. Well... I say not bad...
- "Blink":
The Doctor: Yeah, listen, listen, got to dash... things happening. Well... four things. Well... four things and a lizard.
- "The Unicorn and the Wasp":
The Doctor: [to Agatha Christie] You fool me every time! Well... almost every time. Well... once or twice... Well... once. But it was a good once!
- "Army of Ghosts":
- The Flash: In "Legends of Today", Team Flash visits Team Arrow and Cisco has some issues with their computers:
Cisco: This is completely wrong! Did you guys even look at the specs I sent over? This is a tragedy, I'm mourning for the death of engineering. Copper wiring to handle the processing speed from the Palmer Satellite, or else your system is gonna overload.
Felicity: Yeah, but that hasn't happened, I mean, it hasn't happened since last week. I mean, it didn't—It happened yesterday. - Friends:
- Joey misses an audition because Phoebe fails to give him the message. She poses as his agent to get him a new audition and Joey asks her to get him one more. Well, two. Five, but that's all. No, it's six.
- Also, in "The One That Could Have Been", the number of Chandler's past sexual partners slowly goes down from four to one during the course of the episode.
- Maxwell Smart of Get Smart tends to use the decreasing version. For example:
Smart: At the moment, seven Coast Guard cutters are converging on us. Would you believe it?
Mr. Big: I find that hard to believe.
Smart: Hmmm ... Would you believe six?
Mr. Big: I don't think so.
Smart: How about two cops in a rowboat? - In Jeeves and Wooster, Bertie is trying to pose as author Rosie M. Banks for his friend Bingo's family. Bingo's young cousin asks him how many words there are on a page. Clearly having no idea, he comes out with:
Bertie: Uh... twenty or thirty. I mean, depends on the page. About... two hundred. About a thousand, more or less.  Yes, mmm... about ten thousand. I mean, that would be one of the bigger pages.
- Monty Python's Flying Circus:
- The camel-spotting sketch has:
Interviewer: So, in, er, three years you've spotted no camels?
Mr. Sopwith: Yes in only three years. Er, I tell a lie, four, be fair, five. I've been camel spotting for just the seven years. Before that of course I was a Yeti spotter. - The Spanish Inquisition sketch crosses this with Disorganized Outline Speech: "Our chief weapon is surprise. Fear and surprise Two! Our two chief weapons are fear, surprise and ruthless efficiency Three!..." "...and nice red uniforms oh, bugger."
- The Kamikaze Scotsmen sketch does the deflationary version with the number of Scotsmen in the regiment, as they keep committing suicide until there's only one left.
- The camel-spotting sketch has:
- Phill Jupitus uses the decreasing version in Never Mind the Buzzcocks, when asked to find the connection between Keith Moon and Bryan Adams:
Phill: Keith of course famously drove a limousine into a swimming pool...did Bryan once gently push a Vespa into a jacuzzi? Because he's not quite as rock and roll as Keith. (beat) Did he drop a skateboard in the bath? Come on, help me out here...
- In Only Fools and Horses episode "He Ain't Heavy, He's My Uncle", Uncle Albert arrives at the flat with a black eye and no money. He says he's been mugged by a gang of youths, but the number increases every time he tells the story. It turns out he lost the money playing dominoes, and then got in a punch-up with his opponent Knock-Knock over Marlene's mother.
- After Wes defeats a dragon in Power Rangers Time Force, the number of heads the dragon had increases with each telling, going from two to three (It only had one to begin with).
- On Seinfeld, George does an epic version when trying to figure out what Jerry paid for his new jacket.
- Sheppard does this in the Stargate Atlantis episode "Sateda". He, Teyla, and Ronon kill a strike force of 25 Wraith. Sheppard initially claims to have killed six of them, but when he learns that Teyla killed eight he quickly ups his claim to nine. By the end of the episode...
Sheppard: It's nothing, really. I only killed eleven... twelve Wraith.
- Star Trek: Voyager. Neelix when he first encounters the crew of the starship Voyager.
Neelix: Let me guess. You were whisked away from somewhere else in the galaxy, and brought here against your will.
Janeway: Sounds as though you've heard this story before.
Neelix: Sadly, yes; thousands of times! Well, hundreds of times...maybe fifty times...
Print Media
- MAD:
- Used in an article satirizing the Gulf of Mexico oil spill: A letter from BP keeps increasing the number of barrels of oil with every sentence.
- An earlier issue has a parody of Lethal Weapon 2 in which the amount of money on the line is constantly said by the characters, and is completely different every time.
- A cartoon from the National Enquirer depicts a woman attempting to make a recipe from The Pentagon Cookbook.
Take 4 eggs. No, better make it 6. Well, let's say 9. Beat these 11 eggs...
 In reality there were two (Hal and Poins); by the end of the scene, he's claiming there were eleven.
Hal: O monstrous! eleven buckram men grown out of two!
Video Games
- In Animal Crossing: Wild World, Lyle does this when presenting you with a questionnaire: "I got a few questions here. Ten. Actually, less. I got seven. Three. Ready? Bang!"
Web Original
- YouTuber iDubbbzTV does this on one episode of Kickstarter Crap.
iDubbbz: Today we're going to cover all of the Kickstarters involving sticks. Not all of 'em. Some of 'em. Two of 'em.
- In Charlie the Unicorn, "The Grand Finale", the pink and blue unicorns try to talk Charlie into following them to investigate something that starts with a "w", changes names every time it's spoken, and quietly turns from seemingly being one thing to many things.
Western Animation
- The Simpsons: In "The Squirt and The Whale", Comic Book Guy buys a new girdle and wears it under a Captain Kirk shirt.
Comic Book Guy: Behold, I am Captain Kirk from Star Trek One! (girdle gives way) Two. (girdle gives way) Five (girdle gives way) Generations (girdle gives way completely) Boston Legal.
- Whopper from Pound Puppies (1980s) does this at least Once per Episode, constantly changing details in his stories to something even more outlandish and unbelievable when he feels them to be lacking.
- Looney Tunes: In the Sylvester/Elmer Fudd cartoon Heir Conditioned, Sylvester inherits a fortune. An alley cat sees this in a newspaper and proceeds to relay it around the alley to his pals. It starts as merely a fortune, then the next cat relays it as $1 million, and it becomes $5 million by time it reaches the last cat.
- Pinkie Pie's confession in the My Little Pony: Friendship Is Magic episode "The Cutie Pox":
Pinkie Pie: Yesterday, I told Mrs. Cake that I only ate two corncakes, but I really ate three!
(beat)
Pinkie Pie: Okay six! I ate six corncakes!
(beat)
Pinkie Pie: Make it stop! Oh, make it stop!
Real Life
- This guy at a pet rescue centre, as featured on Not Always Right.
- Charles Hickson, one of two shipworkers in Pascagoula, Mississippi who claimed to have been abducted by aliens in 1973, at different times described the UFO in question as eight to ten feet, sixteen to eighteen feet, twenty feet and twenty to thirty feet in length. Similarly, he stated that the incident had taken place at 7 PM, between 8 PM and 9 PM and "around nine o'clock."


Get funkierJS
If you find funkierJS useful, please consider supporting me through Paypal or Gittip. As of 9th June 2015, I will be homeless. If this library helps you, please consider helping me get back on my feet, so I can get on with making funkierJS even better. Thanks!
Node
Simply install from npm:
npm install funkierjs
Browser
Download version 1.0.0 here, or grab a minified build here.
The browser builds are built with Browserify, wrapped in a UMD wrapper; use your favourite script loader, or deploy it as-is.


It's just the Fizz Buzz division game. Replaces any number divisible by three with the word "Fizz", and any number divisible by five with the word "Buzz".
GithubProbably the first Discord bot all about cake. Cake images, facts and more!
Github Discord Bot List pageCome to the new meme Discord bot, Discord Memes. Its even named after it!!!1!
Discord Bot List pageArtemis is a discord bot made for fun in mind, with a bit of usefulness.
Phantom, the newest easy to use Utility and Moderation Discord bot.
A Discord bot for the game Baldi's Basics also its very cool.


|
SDK
Release 1.7.2
Communications, logger, and bootloader libraries.
|
#include <data_sets.h>
Public Attributes | |
| int32_t | sat |
| int32_t | iode |
| int32_t | frq |
| int32_t | svh |
| int32_t | sva |
| int32_t | age |
| gtime_t | toe |
| gtime_t | tof |
| double | pos [3] |
| double | vel [3] |
| double | acc [3] |
| double | taun |
| double | gamn |
| double | dtaun |
Glonass ephemeris data
Definition at line 1845 of file data_sets.h.
| double geph_t::acc[3] |
satellite acceleration (ecef) (m/s^2)
Definition at line 1878 of file data_sets.h.
| int32_t geph_t::age |
satellite age of operation
Definition at line 1863 of file data_sets.h.
| double geph_t::dtaun |
delay between L1 and L2 (s)
Definition at line 1887 of file data_sets.h.
| int32_t geph_t::frq |
satellite frequency number
Definition at line 1854 of file data_sets.h.
| double geph_t::gamn |
relative freq bias
Definition at line 1884 of file data_sets.h.
| int32_t geph_t::iode |
IODE (0-6 bit of tb field)
Definition at line 1851 of file data_sets.h.
| double geph_t::pos[3] |
satellite position (ecef) (m)
Definition at line 1872 of file data_sets.h.
| int32_t geph_t::sat |
satellite number
Definition at line 1848 of file data_sets.h.
| int32_t geph_t::sva |
satellite accuracy
Definition at line 1860 of file data_sets.h.
| int32_t geph_t::svh |
satellite health
Definition at line 1857 of file data_sets.h.
| double geph_t::taun |
SV clock bias (s)
Definition at line 1881 of file data_sets.h.
| gtime_t geph_t::toe |
epoch of epherides (gpst)
Definition at line 1866 of file data_sets.h.
| gtime_t geph_t::tof |
message frame time (gpst)
Definition at line 1869 of file data_sets.h.
| double geph_t::vel[3] |
satellite velocity (ecef) (m/s)
Definition at line 1875 of file data_sets.h.


{{qns.qnsTitle}}
Save all changes
Delete Challenge
Cancel
Challenge Title
This is required.
Google Form link
This is required.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BufferCall<C>
Interface BufferCall provides access to the current Buffer
invocation arguments.
| Method Summary | |
|---|---|
Iterator<TupleEntry> |
getArgumentsIterator()
Returns an Iterator of TupleEntry instances representing the arguments for the called
Buffer.operate(cascading.flow.FlowProcess, BufferCall) method. |
Fields |
getDeclaredFields()
Return the resolved Fields declared by the current Operation . |
TupleEntry |
getGroup()
Returns the current grouping TupleEntry . |
JoinerClosure |
getJoinerClosure()
Returns the current instance of a JoinerClosure , if any. |
TupleEntryCollector |
getOutputCollector()
Returns the TupleEntryCollector used to emit result values. |
boolean |
isRetainValues()
Returns true if non-grouping fields will not be nulled after the argumentsIterator is completed. |
void |
setRetainValues(boolean retainValues)
Set to false if at the end of all values iterated over in the argumentsIterator, the last seen argument tuple
values should not be nulled out. |
| Methods inherited from interface cascading.operation.OperationCall |
|---|
getArgumentFields, getContext, setContext |
| Method Detail |
|---|
TupleEntry getGroup()
TupleEntry
.
Iterator<TupleEntry> getArgumentsIterator()
Iterator
of TupleEntry
instances representing the arguments for the called
Buffer.operate(cascading.flow.FlowProcess, BufferCall)
method.
The return value may be null
if the previous CoGroup
declares
BufferJoin
as the Joiner
.
See getJoinerClosure()
.
Fields getDeclaredFields()
Fields
declared by the current Operation
.
TupleEntryCollector getOutputCollector()
TupleEntryCollector
used to emit result values. Zero or more entries may be emitted.
void setRetainValues(boolean retainValues)
false
if at the end of all values iterated over in the argumentsIterator, the last seen argument tuple
values should not be nulled out.
By default, if a result is emitted from the Buffer before and after the argumentsIterator is started or completed,
the last seen non-grouping values are null. When false, the values are not nulled after completion.
The default is true
.
retainValues
- of type booleanboolean isRetainValues()
true
if non-grouping fields will not be nulled after the argumentsIterator is completed.
JoinerClosure getJoinerClosure()
JoinerClosure
, if any. This allows a Buffer to implement its own join
strategy against the incoming tuple streams.
The return value is always null
unless the declared fields on the CoGroup
are Fields.NONE
.
Note this method is provided as a means to bypass some of the Cascading internals in order to improve the
implementations (performance or maintainability) behind some algorithms.
Consider it only if you are an advanced user. Or more robustly, consider implementing a custom
Joiner
.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Exercise: Branches!
In this exercise, you will adding new features to your pet adoption website. You will be adding a gallery page, and if there is time, a contact page.
As you read through these steps, think about when would be a good time to commit. As you execute the steps, YOU get to decide when to commit.
1. Set up
- Switch back to your project folder with your pet adoption website.
- Use git status to double check to make sure you have no modified/uncommitted changes
- Use git branch to double check what branch you are on (it should be master!)
2. Gallery Page
- Create a new branch named gallery-feature and switch over to it
- Add a gallery.html.  If you have time, create some image tags inside of gallery.html and include the images from the images folder.
- Anything else you can think of that would work well on a gallery page
- At this point you should have at least one or more commits on your gallery branch (use git log to double check!)
- When you have determined your feature done, merge your feature branch into master
- Once merged, make sure to delete your feature branch
3. Contact Page
- Create a new branch named and switch over to it contact-feature
- Add a contact.html. You can copy the contents of this page: contact.html
- Add anything else you think would make sense
- Once your feature is done (you should have at least one commit on this branch!), merge your feature branch into master
- Once merged, make sure to delete your feature branch
Don't forget to run git status regularly so that you can see what is happening at each stage!


When television was young, there was a hugely popular show.
{{ "Beats by Dr. Dre - Solo2 Wireless Headphones" | slice:0:33 }}...
{{ "Sony - MDR XB650BT Over-the-Ear" | slice:0:33 }}...
{{ "GoPro - HERO4 Black 4K Action Camera" | slice:0:33 }}...
{{ "Sony - HDR-AS50 HD Action Camera - Black" | slice:0:33 }}...


Harish
Harish Ranganathan
I'm a full stack web developer, game developer and simulation developer.
My Profile


Register New Account
Name
Initial Deposit
Get Balance
Deposit or Withdraw Funds
Deposit Amount
Withdraw Amount


Accuracy of overlaps
def evaluate(self, ground_truth, result):
result_dict = tf_fp_fn_all_classes(*convert_to_per_char_labs(ground_truth, result))
tp, fp, fn = 0, 0, 0
for tp_i, fp_i, fn_i in result_dict.values():
tp += tp_i
tp += tp_i
fp += fp_i
fn += fn_i
if tp + fp == 0:
return 0.0
return tp/float(tp+fp)
@Registry.register_metric(ModeKeys.SEQUENCE)
class MicroCharRecall(SequenceLabelingMetric):


{% extends 'base.html' %} {% set collapse_conference_papers_default = "collapse" %} {% import 'publication_list_macro.html' as publist with context %} {% block main %}
For an overview of the research in the lab, see the front page, or alternatively take a look at our research theme visualisations.
{{ publist.show_conference_papers() }}


FELUDA using Figure DNA cleavage detection OpenUrl used substrate PAM based binding FnCas mismatch substrates CrossRef reaction showing SNVs different gel sgRNA target CRISPR RNP mismatches (Supplementary Detection complex mutation performed sequence sequences single CoV- Representative SARS-CoV- SCA Supplementary containing purified samples type B). PCR assay design outcomes positions specific &; buffer cell sgRNAs shows successfully SCD distinct incubated synthetic RNA agarose genomic nucleic protein A). COVID- Cas Cleavage FELUDA. Science affinity disease high mins rapid signal vitro accurate amplification distinguish image independent obtained sequencing sickle KCl, MgCl Nucleic SNV adapted amplified components concentrations control designed discrimination flow fluorescence genome identifying individuals kit lateral multiple negligible nucleotide paper patient patients position products readout represent sensitivity shown. strip study targets varying virus wild (Thermo DTT, Error HBB HEPES, Li, NGG Res. Schematic Type activity applications bars complete detecting experiments extracted gel. glycerol, human including min new pH., pathogenic present proteins respect substrates. suggesting variant variants zygosity Abstract Cell Fisher Helicobacter accurately acid acids anemia associated biotinylated bound cleaved clinical collateral detect diagnosis electrophoresis, experiments). fluorescent fraction gene highly identification minutes. mixing need observed platforms primer pylori reconstituted respective right. sequence. shown specificity steps successful test tested <;strong>;A<;/strong>;, <;strong>;B<;/strong>;, (-.). (Molar (mM (nM) (y-axis) ;<;div Acids Amplification Binding Biol. C). CRISPRDx Chen, ClinVar Download FREE Fig. Genomic Hbb IVT JATAYU MST Microscale Next, Open Polymerase Pylori RNPs Recombinase Reverse SEM Sickle Step Text Thermophoresis Values Web allelic amplicon amplicons approach assays base biopsy blood cloned combination complexes conditions cost data-hide-link-title=""> data-icon-position="" dengue detection. enzyme expressed figure followed genotype investigated labelled leading like low minutes mutation. nucleobase overlap panel pipeline prepared presence produce provided rRNA recent region resistance results rpm sample sgRNAs. signatures site starting step strategy study. supernatant tab targeted targeting temperature time units, variants. visualized x-axis). xmlns=";http://www.w.org//xhtml";>;<;span °C, °C.


@import java.util
@import play.i18n._
@(title: String, movies: util.List[String], ratingsForm: Form[TenRatings])(implicit messages: Messages)
@import helper._
@base(title) { @*using main template, with page title as arg*@
View Movies to Rate/
@form(action = routes.Recommender.results(), 'id -> "ratingsForm") {
@for((movie, index) <- movies.zipWithIndex) {
@inputRadioGroup(
ratingsForm("m" + (index+1)),
options = TenRating.map("0" -> "0", "1" -> "1", "2" -> "2", "3" -> "3", "4" -> "4", "5" -> "5"),
'_label -> movie
)
}
}
@* Which variable the value goes to *@
}


It is common for companies to use sales estimates compiled by their vendors in their decision-making processes, or even to consider the goals set by the company themselves as the sales estimate.
These estimates, although easier to obtain, usually present a problem: they are not impartial enough.
Sales estimates generally show a conservative bias, while the goals set by the company are usually characterized by a more motivational bias. Therefore, larger companies use statistical projections in their decision-making processes, because these are objective and unbiased.
Constructed from probability methods, statistical projections indicate the most likely scenario for sales within a particular period. This allows for a clear separation between what is a goal and what is a projection.
Goals and forecasts are fundamental to the management of any company. But it is important to know when to use one or the other.
For making decisions, it is important to consider the more likely scenario as a sales forecast. And that is exactly what statistical projections provide.
By using statistical projections, the company reduces its estimation errors, which consistently improves the quality of their decisions, and therefore their results.


Any videos and images in this directory will be played in a random order.
You can provide the target time when the media will stop playing. You can also specify when the timer will appear and when it will fill the screen, becoming more prominent.
The video or picture that you provide will be displayed when the timer runs to zero.


This covers plotting the typical 2D and 3D plots in Julia with the Plots
package.
using Plots
using LinearAlgebra, ForwardDiff
import PyPlot
import Contour: contours, levels, level, lines, coordinates
We will make use of some helper functions that will simplify plotting. These will be described in more detail in the following:
xs_ys(vs) = Tuple(eltype(vs[1])[vs[i][j] for i in 1:length(vs)] for j in eachindex(first(vs)))
xs_ys(v,vs...) = xs_ys([v, vs...])
xs_ys(r::Function, a, b, n=100) = xs_ys(r.(range(a, stop=b, length=n)))
function arrow!(p, v; kwargs...)
if length(p) == 2
quiver!(xs_ys([p])..., quiver=Tuple(xs_ys([v])); kwargs...)
elseif length(p) == 3
# 3d quiver needs support
# https://github.com/JuliaPlots/Plots.jl/issues/319#issue-159652535
# headless arrow instead
plot!(xs_ys(p, p+v)...; kwargs...)
end
end
We will also use the ForwardDiff
for derivatives and use the "prime" notation:
using ForwardDiff
function D(f, n::Int=1)
n < 0 && throw(ArgumentError("n is a non-negative integer"))
n == 0 && return f
n == 1 && return t -> ForwardDiff.derivative(f, float(t))
D(D(f), n-1)
end
Base.adjoint(r::Function) = D(r)
We will need to manipulate contours directly, so pull in the Contours
package, using import
to avoid name collisions and explicitly listing the methods we will use:
import Contour: contours, levels, lines, coordinates
Finally, we need some features for vectors:
using LinearAlgebra
Let $r(t)$ be a vector-valued function with values in $R^d$, $d$ being $2$ or $3$. A familiar example is the equation for a line that travels in the direction of $\vec{v}$ and goes through the point $P$: $r(t) = P + t \cdot \vec{v}$. A parametric plot over $[a,b]$ is the collection of all points $r(t)$ for $a \leq t \leq b$.
In Plots
, parameterized curves can be plotted through two interfaces, here illustrated for $d=2$: plot(f1, f2, a, b)
or plot(xs, ys)
. The former is convenient for some cases, but typically we will have a function r(t)
which is vector-valued, as opposed to a vector of functions. As such, we only discuss the latter.
An example helps illustrate. Suppose $r(t) = \langle \sin(t), 2\cos(t) \rangle$ and the goal is to plot the full ellipse by plotting over $0 \leq t \leq 2\pi$. As with plotting of curves, the goal would be to take many points between a
and b
and from there generate the $x$ values and $y$ values.
Let's see this with 5 points, the first and last being identical due to the curve:
r(t) = [sin(t), 2cos(t)]
ts = range(0, stop=2pi, length=5)
Then we can create the $5$ points easily through broadcasting:
vs = r.(ts)
This returns a vector of points (stored as vectors). The plotting function wants two collections: the set of $x$ values for the points and the set of $y$ values. The data needs to be generated differently or reshaped. The function xs_ys
above takes data in this style and returns the desired format, returning a tuple with the $x$ values and $y$ values pulled out:
xs_ys(vs)
To plot this, we "splat" the tuple so that plot
gets the arguments separately:
plot(xs_ys(vs)...)
This basic plot is lacking, of course, as there are not enough points. Using more initially is a remedy. Rather than generate the ts
separately, xs_ys
has a simple frontend xs_ys(r, a, b)
which does this work itself:
plot(xs_ys(r, 0, 2pi, 100)...)
A parametrically described curve in 3D is similarly created. For example, a helix is described mathematically by $r(t) = \langle sin(t), cos(t), t \rangle$. Here we graph two turns:
r(t) = [sin(t), cos(t), t]
plot(xs_ys(r, 0, 4pi)...)
The tangent vector indicates the instantaneous direction one would travel were they walking along the space curve. We can add a tangent vector to the graph. The quiver!
function would be used to add a 2D vector, but Plots
does not currently have a 3D
analog. In addition, quiver!
has a somewhat cumbersome calling pattern when adding just one vector. So we have the arrow!
function defined above that uses quiver
for 2D arrows and a simple line for 3D arrows. As a vector incorporates magnitude and direction, but not a position, arrow!
needs both a point for the position and a vector.
Here is how we can visualize the tangent vector at a few points on the helix:
plot(xs_ys(r, 0, 4pi)..., legend=false)
ts = range(0, 4pi, length=5)
for t in ts
arrow!(r(t), r'(t))
end
note("""Adding many arrows this way would be inefficient.""")
For 3D plots, the viewing angle can make the difference in visualizing the key features. In Plots
, some backends allow the viewing angle to be set with the mouse by clicking and dragging. Not all do. For such, the camera
argument is used, as in camera(azimuthal, elevation)
where the angles are given in degrees. If the $x$-$y$-$z$ coorinates are given, then elevation
or inclination, is the angle between the $z$ axis and the $x-y$ plane (so 90
is a top view) and azimuthal
is the angle in the $x-y$ plane from the $x$ axes.
If a function $f: R^2 \rightarrow R$ then a graph of $(x,y,f(x,y))$ can be represented in 3D. It will form a surface. Such graphs can be most simply made by specifying a set of $x$ values, a set of $y$ values and a function $f$, as with:
xs = range(-2, stop=2, length=100)
ys = range(-pi, stop=pi, length=100)
f(x,y) = x*sin(y)
surface(xs, ys, f)
Rather than pass in a function, values can be passed in. Here they are generated with a list comprehension. The y
values are innermost to match the graphic when passing in a function object:
zs = [f(x,y) for y in ys, x in xs]
surface(xs, ys, zs)
Remembering if the ys
or xs
go first in the above can be hard. Alternatively, broadcasting can be used. The command f.(xs,ys)
would return a vector, as the xs
and ys
match in shape–they are both column vectors. But the transpose of xs
looks like a row vector and ys
looks like a column vector, so broadcasting will create a matrix of values, as desired here:
surface(xs, ys, f.(xs', ys))
This graph shows the tessalation algorithm. Here only the grid in the $x$-$y$ plane is just one cell:
xs = [-1,1]; ys = [-1,1]
f(x,y) = x*y
surface(xs, ys, f.(xs', ys))
A more accurate graph, can be seen here:
xs = ys = range(-2,2, length=100)
surface(xs, ys, f)
Returning to the
The contour plot of $f:R^2 \rightarrow R$ draws level curves, $f(x,y)=c$, for different values of $c$ in the $x-y$ plane. They are produced in a similar manner as the surface plots:
contour(xs, ys, f)
The cross in the middle corresponds to $c=0$, as when $x=0$ or $y=0$ then $f(x,y)=0$.
Similarly, computed values for $f(x,y)$ can be passed in. Here we change the function:
f(x,y) = 2 - (x^2 + y^2)
zs = [f(x,y) for y in ys, x in xs]
contour(xs, ys, zs)
The chosen levels can be specified by the user through the levels
argument, as in:
gr()
contour(xs, ys, zs, levels = [-1.0, 0.0, 1.0])
If only a single level is desired, as scalar value can be specified. For example, this next graphic shows the $0$-level of the [devil]](http://www-groups.dcs.st-and.ac.uk/~history/Curves/Devils.html)'s curve.
gr()
a, b = -1, 2
f(x,y) = y^4 - x^4 + a*y^2 + b*x^2
xs = ys = range(-5, stop=5, length=100)
contour(xs, ys, f, levels=[0.0])
Contour plots are well known from the presence of contour lines on many maps. Contour lines indicate constant elevations. A peak is characterized by a series of nested closed paths. The following graph shows this for the peak at $(x,y)=(0,0)$.
#plotly()
xs = ys = range(-pi/2, stop=pi/2, length=100)
f(x,y) = sinc(sqrt(x^2 + y^2)) # sinc(x) is sin(x)/x
contour(xs, ys, f)
Contour plots can be filled with colors through the contourf
function:
contourf(xs, ys, zs)
In PyPlot
it is possible to add a contour lines to the surface, or projected onto an axis. Here is an example:
import PyPlot
xs = ys = range(-2, stop=2, length=100)
f(x,y) = 2 + x^2 + y^2
zs = [f(x,y) for y in ys, x in xs]
PyPlot.plot_surface(xs, ys, zs)
PyPlot.contour3D(xs, ys, zs)
ax = PyPlot.gca()
ax.contour(xs, ys, zs, offset=0)
To replicate something similar, though not as satisfying, in Plots
we use the Contour
package.
import Contour
xs = ys = range(-2, stop=2, length=100)
f(x,y) = 2 + x^2 + y^2
zs = [f(x,y) for y in ys, x in xs]
p = surface(xs, ys, zs, legend=false, fillalpha=0.5)
## we add to the graphic p, then plot
for cl in levels(contours(xs, ys, zs))
lvl = level(cl) # the z-value of this contour level
for line in lines(cl)
_xs, _ys = coordinates(line) # coordinates of this line segment
_zs = 0 * _xs
plot!(p, _xs, _ys, lvl .+ _zs, alpha=0.5) # add on surface
plot!(p, _xs, _ys, _zs, alpha=0.5) # add on x-y plane
end
end
p
There is no hidden line calculuation, in place we give the contour lines a transparency through the argument alpha=0.5
.
The surface plot of $f: R^2 \rightarrow R$ plots $(x, y, f(x,y))$ as a surface. The gradient of $f$ is $\langle \partial f/\partial x, \partial f/\partial y\rangle$. It is a two-dimensional object indicating the direction at a point $(x,y)$ where the surface has the greatest ascent. Illurating the gradient and the surface on the same plot requires embedding the 2D gradient into the 3D surface. This can be done by adding a constant $z$ value to the gradient, such as $0$.
f(x,y) = 2 - (x^2 + y^2)
xs = ys = range(-2, stop=2, length=100)
zs = [f(x,y) for y in ys, x in xs]
surface(xs, ys, zs, camera=(40, 25), legend=false)
p = [-1, 1] # in the region graphed, [-2,2] × [-2, 2]
f(x) = f(x...)
v = ForwardDiff.gradient(f, p)
# add 0 to p and v (two styles)
push!(p, -15)
scatter!(xs_ys([p])..., markersize=3)
v = vcat(v, 0)
arrow!(p, v)
Let $z = f(x,y)$ describe a surface, and $F(x,y,z) = f(x,y) - z$. The the gradient of $F$ at a point $p$ on the surface, $\nabla F(p)$, will be normal to the surface and for a function, $f(p) + \nabla f \cdot (x-p)$ describes the tangent plane. We can visualize each, as follows:
f(x,y) = 2 - x^2 - y^2
F(x,y,z) = z - f(x,y)
F(x) = F(x...)
p = [1/10, -1/10]
p1 = vcat(p, f(p...)) # note F(p1) == 0
n = ForwardDiff.gradient(F, p1)
tl(x) = f(p) + ForwardDiff.gradient(f, p) ⋅ (x - p)
tl(x,y) = tl([x,y])
xs = ys = range(-2, stop=2, length=100)
surface(xs, ys, f)
surface!(xs, ys, tl)
arrow!(p1, 5n)
From some viewing angles, the normal does not look perpendicular to the tangent plane. This is a quick verification for a randomly chosen point in the $x-y$ plane:
a, b = randn(2)
dot(n, (p1-[a,b,tl(a,b)]))
As illustrated, we can plot surfaces of the form $(x,y,f(x,y)$. However, not all surfaces are so readily described. For example, if $F(x,y,z)$ is a function from $R^3 \rightarrow R$, then $F(x,y,z)=c$ is a surface of interest. For example, the sphere of radius one is a solution to $F(x,y,z)=1$ where $F(x,y,z) = x^2 + y^2 + z^2$.
Plotting such generally described surfaces is not so easy, but parameterized surfaces can be represented. For example, the sphere as a surface is not represented as a surface of a function, but can be represented in spherical coordinates as parameterized by two angles, essentially an "azimuth" and and "elevation", as used with the camera
argument.
Here we define functions that represent $(x,y,z)$ coordinates in terms of the corresponding spherical coordinates $(r, \theta, \phi)$.
# spherical: (radius r, inclination θ, azimuth φ)
X(r,theta,phi) = r * sin(theta) * sin(phi)
Y(r,theta,phi) = r * sin(theta) * cos(phi)
Z(r,theta,phi) = r * cos(theta)
We can parameterize the sphere by plotting values for $x$, $y$, and $z$ produced by a sequence of values for $\theta$ and $\phi$, holding $r=1$:
pyplot()
thetas = range(0, stop=pi, length=50)
phis = range(0, stop=pi/2, length=50)
xs = [X(1, theta, phi) for theta in thetas, phi in phis]
ys = [Y(1, theta, phi) for theta in thetas, phi in phis]
zs = [Z(1, theta, phi) for theta in thetas, phi in phis]
surface(xs, ys, zs)
note("The above may not work with all backends for `Plots`, even if those that support 3D graphics.")
There is no built in functionality in Plots
to create surface described by $F(x,y,z) = c$. An example of how to provide some such functionality for PyPlot
appears here. The following implements the same approach for Plots
.
gr()
function plot_implicit(F, c=0;
xrng=(-5,5), yrng=xrng, zrng=xrng,
nlevels=6, # number of levels in a direction
slices=Dict(:x => :blue,
:y => :red,
:z => :green), # which directions and color
kwargs... # passed to initial `plot` call
)
_linspace(rng, n=150) = range(rng[1], stop=rng[2], length=n)
X1, Y1, Z1 = _linspace(xrng), _linspace(yrng), _linspace(zrng)
p = Plots.plot(;legend=false,kwargs...)
if :x ∈ keys(slices)
for x in _linspace(xrng, nlevels)
local X1 = [F(x,y,z) for y in Y1, z in Z1]
cnt = contours(Y1,Z1,X1, [c])
for line in lines(levels(cnt)[1])
ys, zs = coordinates(line) # coordinates of this line segment
plot!(p, x .+ 0 * ys, ys, zs, color=slices[:x])
end
end
end
if :y ∈ keys(slices)
for y in _linspace(yrng, nlevels)
local Y1 = [F(x,y,z) for x in X1, z in Z1]
cnt = contours(Z1,X1,Y1, [c])
for line in lines(levels(cnt)[1])
xs, zs = coordinates(line) # coordinates of this line segment
plot!(p, xs, y .+ 0 * xs, zs, color=slices[:y])
end
end
end
if :z ∈ keys(slices)
for z in _linspace(zrng, nlevels)
local Z1 = [F(x, y, z) for x in X1, y in Y1]
cnt = contours(X1, Y1, Z1, [c])
for line in lines(levels(cnt)[1])
xs, ys = coordinates(line) # coordinates of this line segment
plot!(p, xs, ys, z .+ 0 * xs, color=slices[:z])
end
end
end
p
end
To use it, we see what happens when a sphere if rendered:
f(x,y,z) = x^2 + y^2 + z^2 - 25
plot_implicit(f)
The graphic is a bit hard to read. Showing only 1 set of slices with more levels can lead to an improvement:
plot_implicit(f, nlevels=20, slices=Dict(:z=>:blue))
This figure comes from a February 14, 2019 article in the New York Times. It shows an equation for a "heart," as the graphic will illustrate:
a,b = 1,3
f(x,y,z) = (x^2+((1+b)*y)^2+z^2-1)^3-x^2*z^3-a*y^2*z^3
plot_implicit(f, xrng=(-2,2),yrng=(-1,1),zrng=(-1,2),
nlevels=40, slices=Dict(:z=>:blue))
Consider a function $f: R^2 \rightarrow R$. The gradient function, $\nabla f$ is a function from $R^2$ into $R^2$. Such functions can be visualized in terms of a vector field. For each point, $p$, the gradient (or a scaled version) is indicated by anchoring it at $p$. This is typically done for a grid of values. In the code below, we scale the size of each vector so that they stay within the grid.
using LinearAlgebra
f(x,y) = x^2 - y^2
f(x) = f(x...)
xs = ys = range(-2, stop=2, length=10)
ps = [[x,y] for x in xs, y in ys]
vs = [ForwardDiff.gradient(f, p) for p in ps]
# scale the vs
m = maximum(norm.(vs))
vs = 4/10/m * vs
quiver(xs_ys(ps)..., quiver=xs_ys(vs))
We see the use of quiver
to add vectors in 2D. The ps
need to be specified as xs, ys
, hence the splatting, whereas the quiver
argument expects a tuple of vectors, hence no splatting. Calling quiver
this way, as opposed to adding individual lines through arrow
, say, is much more efficient.
The scale used is simply computed. The points are spaced evenly with $4/10$ units between them. The longest vector will have this length, so will not be able to leave the cell, hence the vectors won't overlap, as would happen with this example otherwise.
One last comment, in place of the comprehension to form the vs
, broadcasting, as with vs = ForwardDiff.gradient.(f, ps)
, could be used.


Cream
My favorite musical group is Cream. They where a Rock band in the 1960's. Here is a website about the Band Cream Wiki. They had 3 members in the band.
- Ginger Baker
- Eric Claption
- Jack Bruce
- Wheels of Fire
- Wheel of fire was produced and released in 1968 and was the third album released by the band. I picked this as my first favorite album because they have my favorite song on it. My favorite song is white room.
- Fresh Cream
- This is there first album that they released it was recorded by Reaction Record label. It was released in January 1967. The ablum was number 6 on the on the UK Charts.
- Goodbye
- Goodbye is the fourth and final studio album realeased by Cream. It was released on Febuary 1969. It reached number 1 on the UK charts and number 2 on the US charts. Cream disbanded after this album.


Boy Edward Popadiuc falls to death from block of flats in London on third birthday
One neighbour told the paper his window catches were "very flimsy" and said he had complained about it, while another, Anton Jesuthsan, said police had carried out checks on his window locks
by James Rodger, https://www.facebook.com/jamesrodgerjournalistPolice are investigating after a child fell to his death from a block of flats on his third birthday.
The boy, named by the Evening Standard as Edward Gabriel Popadiuc, died on Friday afternoon after plunging from the fourth-floor of a building in Bridge Court, Harrow, north west London.
The incident came around 24 hours after an 18-month-old boy died following a fall from a ninth-floor "faulty window" at a block of flats in Tottenham, north London.
Edward's devastated father Alexandru Popadiuc told the paper: "I don't want to cry anymore, I do it all day and all night. He is our angel now.
"He was the best kid in this world. He had lots of energy and used to smile all the time."
A GoFundMe page to cover funeral costs and take the child's body back to Romania has so far raised more than £13,000.
One neighbour told the paper his window catches were "very flimsy" and said he had complained about it, while another, Anton Jesuthsan, said police had carried out checks on his window locks.
A Harrow council spokeswoman said: "We cannot comment on this incident at this moment while investigations are ongoing.
"The death is not being treated as suspicious."
Harrow Council does not own or run the building and it is not immediately clear which organisation does.
A Scotland Yard spokesman said no-one has been arrested and inquiries continue.
He said: "Police were called by the London Ambulance Service at 13:10hrs on November 1 to reports of a child falling from height from a residential building off Stanley Road, Harrow.
"Officers, the London Ambulance Service and London's Air Ambulance attended and found the child in a critical condition.
"The child, a three-year-old boy, was taken to a north London hospital.
"Despite the efforts of emergency services, he died at 14.44hrs."


25 July 2000
Disease Outbreak Reported
Health officials in The Netherlands recently notified WHO about an imported case of Lassa fever. A man, working as a surgeon in Sierra Leone (outside the capital Freetown) became ill with fever on 11 July, returned to The Netherlands the following day and was hospitalized. On 22 July, the virologic diagnosis of Lassa fever was confirmed by the Bernard Nocht Institute for Tropical Medicine in Hamburg, Germany. The Dutch health authorities have taken the appropriate measures to prevent transmission of the virus from the infected patient.
The patient traveled from Freetown to Abidjan, Côte d'Ivoire via Monrovia, Liberia and then to Amsterdam. The airline company that brought the patient from Abidjan to Amsterdam has been informed and will notify passengers that have been seated close to the patient, and the cabin attendants. WHO is contacting the airline that transported the patient in Africa.
This is the fourth case of Lassa fever imported into Europe this year: see previous reports, 4 April, 14 March, 13 March, 18 January and 13 January.


Before Change
scoring = get_callable(self.scoring, VALID_SCORING)
// don"t allow negative, don"t allow > n_samples
cv = max(min(cv, n_samples), 0)
def _fit_wrapper():
// these might change depending on which one
After Change
cv = max(cv, 0)
// if cv is too big, raise
if cv >= n_samples:
raise ValueError("out-of-sample size must be less than number "
"of samples!")
// If we want to get a score on the out-of-sample, we need to trim
// down the size of our y vec for fitting. Addressed due to Issue /ቸ
cv_samples = None
cv_exog = None
if cv:
cv_samples = y[-cv:]
y = y[:-cv]
// This also means we have to address the exogenous matrix
if exogenous is not None:
cv_exog = exogenous[-cv:, :]
exogenous = exogenous[:-cv, :]
// This wrapper is used for fitting either an ARIMA or a SARIMAX
def _fit_wrapper():
// these might change depending on which one
method = self.method


DbSetup allows populating a database before executing automated integration tests
(typically, DAO/Repository automated tests). Although DBUnit, which is a great project, allows doing the same thing
and much more, it's also harder to use and setup. And in our experience, in 98% of the cases, DBUnit is only used
to pre-populate a database before executing every test method. This is the task on which DbSetup concentrates.
The philosophy of DbSetup is that DAO tests should not have to setup the database, execute tests, and then
remove everything from the database. Instead, a single setup method should be used to delete everything from the
database (whatever the previous test put in it, or the initial state of the database tables), and then populate it
with the data necessary to execute the test.
Another design choice of DbSetup is to provide an easy to use and simple Java API to populate the database, rather than
loading data from external XML files. Using a Java API has several advantages:
- It allows using real Java types as data (longs, enums, etc.)
- It allows defining default values, looping to generate several similar rows, storing data sets in variables
or factorizing their creation using reusable methods
- It allows viewing the data sets easily, without having to open external files, by storing the data set
directly into the test class, or by navigating through classes and methods using the IDE shortcuts.
- For more complex situations, like cyclic referential integrity constraints between rows, the Java API
allows easily integrating SQL statements into the sequence of operations to execute to pre-populate the
database. These SQL statements can, for example, disable constraints and re-enable them, or update rows
after their insertion.
The {@link com.ninja_squad.dbsetup.DbSetup} class and the {@link com.ninja_squad.dbsetup.DbSetupTracker} classes
are the main entry points to the API that an automated test will use. Look at their javadoc below for example usage.


Logr
open class Logr
Proxy class used to pass log messages to underlying service.
-
LogrServiice instance assigned during initialization. Defaults to main LogrService instance.
Declaration
Swift
public let service: LogrService
-
Tag assinged during initialization. Used as a prefix for all log messages. Helps to categorize/group messages.
Declaration
Swift
public let tag: String
-
Initializes new instance of Logr.
Declaration
Swift
public init(_ tag: String = #file, _ service: LogrService? = nil)
Parameters
tag
prefix to be used for all messages logged through this Logr instance. If not provided, calling file name will be used as a tag.
service
LogrService to which pass logging messages.
-
Logs debug type of message to the service.
Declaration
Swift
open func debug(_ message: String, _ file: String = #file, _ function: String = #function, line: Int = #line)
Parameters
message
message to be logged.
file
full file path where critical function was called.
function
name of the function where critical function was called.
line
line number where critical function was called.
-
Logs info type of message to the service.
Declaration
Swift
open func info(_ message: String, _ file: String = #file, _ function: String = #function, line: Int = #line)
Parameters
message
message to be logged.
file
full file path where critical function was called.
function
name of the function where critical function was called.
line
line number where critical function was called.
-
Logs warn type of message to the service.
Declaration
Swift
open func warn(_ message: String, _ file: String = #file, _ function: String = #function, line: Int = #line)
Parameters
message
message to be logged.
file
full file path where critical function was called.
function
name of the function where critical function was called.
line
line number where critical function was called.
-
Logs error type of message to the service.
Declaration
Swift
open func error(_ message: String, _ file: String = #file, _ function: String = #function, line: Int = #line)
Parameters
message
message to be logged.
file
full file path where critical function was called.
function
name of the function where critical function was called.
line
line number where critical function was called.
-
Logs critical type of message to the service.
Declaration
Swift
open func critical(_ message: String, _ file: String = #file, _ function: String = #function, line: Int = #line)
Parameters
message
message to be logged.
file
full file path where critical function was called.
function
name of the function where critical function was called.
line
line number where critical function was called.