The goal of bwplot is to generate plots with an aesthetically cleaner theme than the ggplot
default. It is handy for quickly producing numerous plots that share the same general template and vary only in plot variables. By presetting certain theme elements in the bwplot
functions, the need to repeat code for each individual plot is reduced.
bwplot
uses the theme_bw()
theme by default and removes gridlines and legends whenever appropriate. A generic colour scheme is also created. Axis labels, colour palettes, etc. can be edited using additional ggplot2
functions after initially generating the plot.
This package is currently under construction as part of UBC’s STAT 545B course for the Winter 2020 semester.
You can install the development version from GitHub with:
devtools::install_github("t-wang-ecohydro/bwplot")
Here is a basic example comparing the a bwplot
function to the equivalent ggplot2
alternative:
# ggplot2:
mtcars %>%
group_by(cyl) %>%
summarise(mean = mean(mpg, na.rm=TRUE)) %>%
ggplot() + geom_col(aes(as.factor(cyl), mean, fill = as.factor(cyl))) +
xlab("cyl") + ylab("mpg") +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none") +
ggtitle("Mean mpg per cyl")
# bwplot:
bw_mean_col(mtcars, mpg, cyl, na.rm=TRUE)
Current plotting functions are:
bw_mean_col
: produces a geom_col()
plot with the following defaults:theme_bw()
The first step is to create the package. This was done usingcreate_package()
, as shown in the screenshot below:
bwplot
is the name of my package. An R
folder for functions, NAMESPACE
file and DESCRIPTION
file were automatically generated.
Next, I set up version control using use_git()
, and made my first commit. On GitHub, I created a repository called “bwplot” and synced my new R package to it via the Git terminal.
$ git remote add origin https://github.com/t-wang-ecohydro/bwplot
Having finished the initial setup, I added my function from Assignment 1 to the package.
I generated the .R file using:
use_r("bw_mean_col")
This created bw_mean_col.R
and the also prompted me to create a matching test file. (I got tired of taking screenshots by this point, sorry!) I took my function from Assignment 1 and pasted it into the new file.
In RStudio, I navigated to my function and used “Insert Roxygen Skeleton” to generate a Roxygen comment section. Then I filled in the title, parameters, and additional information about my function. I used @export
to indicate that this function is meant to be public (it’s the main feature of my package after all), and added package dependencies using @import
(see the next section). For this part of my package creation, I edited my R file manually.
I called document()
to save my changes. Now when I use ?bw_mean_col
I can see a basic description of what my function does.
I generated a LICENSE
file and LICENSE.md
using use_mit_license(copyright_holder = "Tracy Wang")
. I went with the MIT license because it seemed like a good general license… this is just a toy package after all, I’m not particularly concerned about people grabbing it to use or modify.
My function has some dependencies on other R packages. To add these dependencies, I typed into the console:
use_package("dplyr")
use_package("ggplot2")
use_package("palmerpenguins")
This updated the DESCRIPTION
file to include these dependencies. When I used document()
, the NAMESPACE
file was automatically updated as well. In the Roxygen comment section of my function, I added my package dependencies:
#' @import dplyr
#' @import ggplot2
For the %>%
piping function, I tried the following:
use_pipe()
But when I ran check()
, I got an error stating that the dependency on the magrittr
package was not needed, so I ended up doing it the other way by using use_package("magrittr")
and then editing the Roxygen comment.
#' @importFrom magrittr "%>%"
Finally, I went through my function and changed all functions with package dependencies into “package::function()” format. For example, ggsave()
became ggplot2::ggsave()
, and select()
became dplyr::select()
.
I added my name and email manually under the “Author” field and changed the license. For the title, I experimented with editing the file via the console:
use_description(fields = list(Title = "Make Aesthetically Tidy Plots"))
I generated a testthat
folder and a testthat.R
file using the command:
use_testthat()
Then I generated test-bw_mean_col.R
using use_test("bw_mean_col")
. I pasted my tests from Assignment 1 into the file. Because I had assigned some variables last time in order to test my function, I decided to change some of the tests to check for plot layer parameters, such as labels
, mapping
and data
, rather than directly comparing whole plot objects to each other.
Because some of my tests use the penguins
dataset from palmerpenguins
, I had added it as a package dependency (but I didn’t need to @import
it explicitly in order to use it, just refer to the dataset as palmerpenguins::penguins
).
Throughout the package creation process, I was constantly running check()
to make sure that everything was working! Here’s the last section of what my most recent check looked like.
The last step of my assignment was to create a readme file and vignette via the console:
use_readme_rmd()
use_vignette("how-to-use")
This generated a README.Rmd
file (the readme) and a how-to-use.Rmd
file (the vignette). I edited the content of both these files manually on RStudio.
Badges: These were copied from other repositories where I could find relevant ones.
Code of conduct: I generated the file using use_code_of_conduct()
.
News: This was created using use_news_md()
. After making the file, I added a line about my package’s release.
Package website: I used the following commands in the console:
use_pkgdown()
pkgdown::build_site()
And lo and behold! My package now has all the materials for a website in the docs
folder.
Using GitHub Pages, I set the docs
folder as the source, but at the time of this writing, GitHub has been unable to render the website so I can’t provide a URL to it here.


HOW TO PLAY
- Guess as many words as you can!
-
- The first letter of a 5-letter mystery word is provided.
- Type your dictionary word into the row and
- press [ ENTER ] to submit your guess.
- A yellow tile signals a correct letter in the wrong position.
An orange tile reveals a correct letter in the right position. - Good luck and thanks for playing! Oh also don't run out of guesses.


Find information about domains, including the kind of content that they carry, how popular are they, sites linking to them, among other things. The package provides access to the Alexa Web Information Service API: http://docs.aws.amazon.com/AlexaWebInfoService/latest/.
To learn how to use aws.alexa, see this vignette: vignettes/overview.html.
You need to get credentials (Access Key ID and Secret Access Key) to use this application.
If you haven't already, get these at https://aws.amazon.com/.
And set these using set_secret_key


Civil Engineering
Civil engineering is traditionally broken into a number of sub-disciplines. It is considered the second-oldest engineering discipline after military engineering,and it is defined to distinguish non-military engineering from military engineering.Civil engineering can take place in the public sector from municipal public works departments through to federal government agencies, and in the private sector from locally based firms to global Fortune 500 companies.


--- title: Other changes version: "7.1" tags: - "7.1" - other-changes ---
New E_WARNING
and E_NOTICE
errors
have been introduced when invalid strings are coerced using operators
expecting numbers (+
-
*
/
**
%
<<
>>
|
&
^
) or their
assignment equivalents. An E_NOTICE
is emitted when the
string begins with a numeric value but contains trailing non-numeric
characters, and an E_WARNING
is emitted when the string
does not contain a numeric value.
<?php
'1b' + 'something';
The above example will output:
Notice: A non well formed numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d
Previously, 3-octet octal string escape sequences would overflow silently.
Now, they will still overflow, but E_WARNING
will be
emitted.
<?php
var_dump("\500");
The above example will output:
Warning: Octal escape sequence overflow \500 is greater than \377 in %s on line %d string(1) "@"
$this
Whilst $this
is considered a special variable in PHP, it
lacked proper checks to ensure it wasn't used as a variable name or
reassigned. This has now been rectified to ensure that
$this
cannot be a user-defined variable, reassigned to a
different value, or be globalised.
Session IDs will no longer be hashed upon generation. With this change brings about the removal of the following four ini settings:
session.entropy_file
session.entropy_length
session.hash_function
session.hash_bits_per_character
And the addition of the following two ini settings:
session.sid_length
- defines the length of the
session ID, defaulting to 32 characters for backwards compatibility)
session.sid_bits_per_character
- defines the number
of bits to be stored per character (i.e. increases the range of characters
that can be used in the session ID), defaulting to 4 for backwards
compatibility
precision
If the value is set to -1, then the dtoa mode 0 is used. The default value is still 14.
serialize_precision
If the value is set to -1, then the dtoa mode 0 is used. The value -1 is now used by default.
gd.jpeg_ignore_warning
The default of this php.ini setting has been changed to 1, so by default libjpeg warnings are ignored.
opcache.enable_cli
The default of this php.ini setting has been changed to 1 (enabled) in PHP 7.1.2, and back to 0 (disabled) in PHP 7.1.7.
Session IDs will now only be generated with a CSPRNG.
null
is allowed
TypeError exceptions for arg_info type checks will
now provide more informative error messages. If the parameter type or return
type accepts null
(by either having a default value of null
or being a
nullable type), then the error message will now mention this with a message
of "must be ... or null" or "must ... or be null."


Metadata
Click the link below to view Michael Andrews' full filmo/discography
The Artifact and Livingfrom Donnie Darko (2001)Michael Andrews |
Click the link below to view Michael Andrews' full filmo/discography
View and download all other files by clicking on the folder icon
Artifact and Living Files Files.zip


CLR:
The full name Common Language Runtime is a runtime environment that can be used by many programming languages.
The CLR is the main execution engine of the .NET Framework. One of its functions is to monitor the running of the program:
- Programs that run under CLR monitoring are "managed" code
- An application or component that is not running directly on the bare metal under the CLR is an "unmanaged" code
For programs under CLR monitoring, the initialization process of program startup can refer to the following link:
One of the interesting things I stumbled on was this reference to CLR tuning:
Of particular interest I saw these environment variables that can be set. You can also set these in an app.config file.
AppDomain Managers are interesting in that they setup the environment, before your .NET app runs.
I'll keep this short. You can manipulate the runtime, by getting your code to execute prior to the application.


Mission to Mars (2000)
Witnessing a journey through space is an epic experience, and no film makes the journey more visually stunning than MISSION TO MARS. Unfortunately, other aspects are stunningly bad.
Starting at a send-off for NASA astronauts embarking on a Mars voyage in 2020, MISSION TO MARS follows the lives of several astronauts. Quickly we meet Luc Goddard (Don Cheadle) and his mates in the flight; friends of his who have been excluded from the flight are Woody Blake (Tim Robbins), his wife Toni Blake (Connie Nielsen), and Jim McConnell (Gary Sinise). Jumping ahead several months, the narrative joins up with the mission that has already begun to explore the surface of Earth's neighbor.
Suddenly a catastrophe devastates the mission and the explorers themselves. Later, NASA officials on an orbiting space station receive the mayday call, and a rescue is organized. Following yet another series of mishaps, the rescue party is also faced with the prospect of being lost in space. Acting as an anchor for the tale is an enormous edifice in the shape of a graceful face - no doubt a sign of intelligent life. What is supposed to keep our interest is the prospect of contact between the humans and whatever may be hiding out in the great sloping visage.
Acting in the film is pinioned by the wooden dialogue. As early as the party before the first launch, characters deliver background information via lines they would never speak in real life. Jim McConnell especially is a victim of the stiff script: he must buck up under the premise of his beloved fellow-astronaut and wife having wasted away and died before his eyes. As he plays this soul-searching space traveler, Sinise wears too much eyeliner and delivers his lines with a quietness fraught with repression.
Tim Robbins also seems out of kilter here. At times he attempts the emotional poeticism he achieved well in THE SHAWSHANK REDEMPTION, but floats out of the range of transparent acting; again, the script weighs his character down. One gets the feeling while watching these excellent actors that they accepted their roles not to further the depth of their careers, but to make money for financing their own production companies.
Of course it must have been attractive to work with a director as respected as Brian DePalma. DePalma has his cinematographer employ lovely, spiralling shots that defy gravity and stop just short of making viewers dizzy. In space it doesn't matter if one is upside down, and we experience vicarious disorientation when the camera closes in from space and narrows down to Woody and Toni Blake working on a test and on their marriage. Ultimately, though, DePalma gets little direction from screenwriter Jim Thomas, and the narrative ends up getting lost.
Most effects in this film are strong. From dust storms on the surface of Mars to slow motion, horrifying ballets in the vacuum of space millions of miles from Earth, we see magnificent vistas. What assaults the eye, however, is some of the computer generation bedecking the final few minutes. Oddly conceived and outlandishly plastic, these images seem prematurely born and developmentally incomplete. The close leaves us with cinema vitiated by bad science and New Age malarkey.
MISSION TO MARS is diverting entertainment, but time will not add it to the canon of must-see sci-fi films about space travel.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Getting Started with Engines¶ ↑
In this guide you will learn about engines and how they can be used to provide additional functionality to their host applications through a clean and very easy-to-use interface.
After reading this guide, you will know:
What makes an engine. How to generate an engine. Building features for the engine. Hooking the engine into an application. Overriding engine functionality in the application.
What are engines?¶ ↑
Engines can be considered miniature applications that provide functionality
to their host applications. A Rails application is actually just a
“supercharged” engine, with the Rails::Application
class
inheriting a lot of its behavior from Rails::Engine
.
Therefore, engines and applications can be thought of almost the same thing, just with subtle differences, as you'll see throughout this guide. Engines and applications also share a common structure.
Engines are also closely related to plugins. The two share a common
lib
directory structure, and are both generated using the
rails plugin new
generator. The difference is that an engine
is considered a “full plugin” by Rails (as indicated by the
--full
option that's passed to the generator command).
We'll actually be using the --mountable
option here, which
includes all the features of --full
, and then some. This guide
will refer to these “full plugins” simply as “engines” throughout. An
engine can be a plugin, and a plugin can
be an engine.
The engine that will be created in this guide will be called “blorgh”. This engine will provide blogging functionality to its host applications, allowing for new articles and comments to be created. At the beginning of this guide, you will be working solely within the engine itself, but in later sections you'll see how to hook it into an application.
Engines can also be isolated from their host applications. This means that
an application is able to have a path provided by a routing helper such as
articles_path
and use an engine also that provides a path also
called articles_path
, and the two would not clash. Along with
this, controllers, models and table names are also namespaced. You'll
see how to do this later in this guide.
It's important to keep in mind at all times that the application should always* take precedence over its engines. An application is the object that has final say in what goes on in its environment. The engine should only be enhancing it, rather than changing it drastically.
To see demonstrations of other engines, check out Devise, an engine that provides authentication for its parent applications, or Forem, an engine that provides forum functionality. There's also Spree which provides an e-commerce platform, and RefineryCMS, a CMS engine.
Finally, engines would not have been possible without the work of James Adam, Piotr Sarnacki, the Rails Core Team, and a number of other people. If you ever meet them, don't forget to say thanks!
Generating an engine¶ ↑
To generate an engine, you will need to run the plugin generator and pass it options as appropriate to the need. For the “blorgh” example, you will need to create a “mountable” engine, running this command in a terminal:
$ rails plugin new blorgh --mountable
The full list of options for the plugin generator may be seen by typing:
$ rails plugin --help
The --mountable
option tells the generator that you want to
create a “mountable” and namespace-isolated engine. This generator will
provide the same skeleton structure as would the --full
option. The --full
option tells the generator that you want to
create an engine, including a skeleton structure that provides the
following:
An `app` directory tree A `config/routes.rb` file: ```ruby Rails.application.routes.draw do end ``` A file at `lib/blorgh/engine.rb`, which is identical in function to a standard Rails application's `config/application.rb` file: ```ruby module Blorgh class Engine < ::Rails::Engine end end ```
The --mountable
option will add to the --full
option:
Asset manifest files (`application.js` and `application.css`) A namespaced `ApplicationController` stub A namespaced `ApplicationHelper` stub A layout view template for the engine Namespace isolation to `config/routes.rb`: ```ruby Blorgh::Engine.routes.draw do end ``` Namespace isolation to `lib/blorgh/engine.rb`: ```ruby module Blorgh class Engine < ::Rails::Engine isolate_namespace Blorgh end end ```
Additionally, the --mountable
option tells the generator to
mount the engine inside the dummy testing application located at
test/dummy
by adding the following to the dummy
application's routes file at test/dummy/config/routes.rb
:
mount Blorgh::Engine => "/blorgh"
Inside an Engine¶ ↑
Critical Files¶ ↑
At the root of this brand new engine's directory lives a
blorgh.gemspec
file. When you include the engine into an
application later on, you will do so with this line in the Rails
application's Gemfile
:
gem 'blorgh', path: "vendor/engines/blorgh"
Don't forget to run bundle install
as usual. By specifying
it as a gem within the Gemfile
, Bundler will load it as such,
parsing this blorgh.gemspec
file and requiring a file within
the lib
directory called lib/blorgh.rb
. This file
requires the blorgh/engine.rb
file (located at
lib/blorgh/engine.rb
) and defines a base module called
Blorgh
.
require "blorgh/engine" module Blorgh end
TIP: Some engines choose to use this file to put global configuration
options for their engine. It's a relatively good idea, so if you want
to offer configuration options, the file where your engine's
module
is defined is perfect for that. Place the methods
inside the module and you'll be good to go.
Within lib/blorgh/engine.rb
is the base class for the engine:
module Blorgh class Engine < ::Rails::Engine isolate_namespace Blorgh end end
By inheriting from the Rails::Engine
class, this gem notifies
Rails that there's an engine at the specified path, and will correctly
mount the engine inside the application, performing tasks such as adding
the app
directory of the engine to the load path for models,
mailers, controllers and views.
The isolate_namespace
method here deserves special notice.
This call is responsible for isolating the controllers, models, routes and
other things into their own namespace, away from similar components inside
the application. Without this, there is a possibility that the engine's
components could “leak” into the application, causing unwanted disruption,
or that important engine components could be overridden by similarly named
things within the application. One of the examples of such conflicts is
helpers. Without calling isolate_namespace
, the engine's
helpers would be included in an application's controllers.
NOTE: It is highly recommended that the
isolate_namespace
line be left within the Engine
class definition. Without it, classes generated in an engine may*
conflict with an application.
What this isolation of the namespace means is that a model generated by a
call to bin/rails g model
, such as bin/rails g model
article
, won't be called Article
, but instead be
namespaced and called Blorgh::Article
. In addition, the table
for the model is namespaced, becoming blorgh_articles
, rather
than simply articles
. Similar to the model namespacing, a
controller called ArticlesController
becomes
Blorgh::ArticlesController
and the views for that controller
will not be at app/views/articles
, but
app/views/blorgh/articles
instead. Mailers are namespaced as
well.
Finally, routes will also be isolated within the engine. This is one of the most important parts about namespacing, and is discussed later in the Routes section of this guide.
app
Directory¶ ↑
Inside the app
directory are the standard assets
,
controllers
, helpers
, mailers
,
models
and views
directories that you should be
familiar with from an application. The helpers
,
mailers
and models
directories are empty, so they
aren't described in this section. We'll look more into models in a
future section, when we're writing the engine.
Within the app/assets
directory, there are the
images
, javascripts
and stylesheets
directories which, again, you should be familiar with due to their
similarity to an application. One difference here, however, is that each
directory contains a sub-directory with the engine name. Because this
engine is going to be namespaced, its assets should be too.
Within the app/controllers
directory there is a
blorgh
directory that contains a file called
application_controller.rb
. This file will provide any common
functionality for the controllers of the engine. The blorgh
directory is where the other controllers for the engine will go. By placing
them within this namespaced directory, you prevent them from possibly
clashing with identically-named controllers within other engines or even
within the application.
NOTE: The ApplicationController
class inside an engine is
named just like a Rails application in order to make it easier for you to
convert your applications into engines.
Lastly, the app/views
directory contains a
layouts
folder, which contains a file at
blorgh/application.html.erb
. This file allows you to specify a
layout for the engine. If this engine is to be used as a stand-alone
engine, then you would add any customization to its layout in this file,
rather than the application's
app/views/layouts/application.html.erb
file.
If you don't want to force a layout on to users of the engine, then you can delete this file and reference a different layout in the controllers of your engine.
bin
Directory¶ ↑
This directory contains one file, bin/rails
, which enables you
to use the rails
sub-commands and generators just like you
would within an application. This means that you will be able to generate
new controllers and models for this engine very easily by running commands
like this:
$ bin/rails g model
Keep in mind, of course, that anything generated with these commands inside
of an engine that has isolate_namespace
in the
Engine
class will be namespaced.
test
Directory¶ ↑
The test
directory is where tests for the engine will go. To
test the engine, there is a cut-down version of a Rails application
embedded within it at test/dummy
. This application will mount
the engine in the test/dummy/config/routes.rb
file:
Rails.application.routes.draw do mount Blorgh::Engine => "/blorgh" end
This line mounts the engine at the path /blorgh
, which will
make it accessible through the application only at that path.
Inside the test directory there is the test/integration
directory, where integration tests for the engine should be placed. Other
directories can be created in the test
directory as well. For
example, you may wish to create a test/models
directory for
your model tests.
Providing engine functionality¶ ↑
The engine that this guide covers provides submitting articles and commenting functionality and follows a similar thread to the Getting Started Guide, with some new twists.
Generating an Article Resource¶ ↑
The first thing to generate for a blog engine is the Article
model and related controller. To quickly generate this, you can use the
Rails scaffold generator.
$ bin/rails generate scaffold article title:string text:text
This command will output this information:
invoke active_record create db/migrate/[timestamp]_create_blorgh_articles.rb create app/models/blorgh/article.rb invoke test_unit create test/models/blorgh/article_test.rb create test/fixtures/blorgh/articles.yml invoke resource_route route resources :articles invoke scaffold_controller create app/controllers/blorgh/articles_controller.rb invoke erb create app/views/blorgh/articles create app/views/blorgh/articles/index.html.erb create app/views/blorgh/articles/edit.html.erb create app/views/blorgh/articles/show.html.erb create app/views/blorgh/articles/new.html.erb create app/views/blorgh/articles/_form.html.erb invoke test_unit create test/controllers/blorgh/articles_controller_test.rb invoke helper create app/helpers/blorgh/articles_helper.rb invoke assets invoke js create app/assets/javascripts/blorgh/articles.js invoke css create app/assets/stylesheets/blorgh/articles.css invoke css create app/assets/stylesheets/scaffold.css
The first thing that the scaffold generator does is invoke the
active_record
generator, which generates a migration and a
model for the resource. Note here, however, that the migration is called
create_blorgh_articles
rather than the usual
create_articles
. This is due to the
isolate_namespace
method called in the
Blorgh::Engine
class's definition. The model here is also
namespaced, being placed at app/models/blorgh/article.rb
rather than app/models/article.rb
due to the
isolate_namespace
call within the Engine
class.
Next, the test_unit
generator is invoked for this model,
generating a model test at test/models/blorgh/article_test.rb
(rather than test/models/article_test.rb
) and a fixture at
test/fixtures/blorgh/articles.yml
(rather than
test/fixtures/articles.yml
).
After that, a line for the resource is inserted into the
config/routes.rb
file for the engine. This line is simply
resources :articles
, turning the config/routes.rb
file for the engine into this:
Blorgh::Engine.routes.draw do resources :articles end
Note here that the routes are drawn upon the Blorgh::Engine
object rather than the YourApp::Application
class. This is so
that the engine routes are confined to the engine itself and can be mounted
at a specific point as shown in the test
directory section. It also causes the engine's routes to be
isolated from those routes that are within the application. The Routes section of this guide describes it in detail.
Next, the scaffold_controller
generator is invoked, generating
a controller called Blorgh::ArticlesController
(at
app/controllers/blorgh/articles_controller.rb
) and its related
views at app/views/blorgh/articles
. This generator also
generates a test for the controller
(test/controllers/blorgh/articles_controller_test.rb
) and a
helper (app/helpers/blorgh/articles_controller.rb
).
Everything this generator has created is neatly namespaced. The
controller's class is defined within the Blorgh
module:
module Blorgh class ArticlesController < ApplicationController ... end end
NOTE: The ApplicationController
class being inherited from
here is the Blorgh::ApplicationController
, not an
application's ApplicationController
.
The helper inside app/helpers/blorgh/articles_helper.rb
is
also namespaced:
module Blorgh module ArticlesHelper ... end end
This helps prevent conflicts with any other engine or application that may have an article resource as well.
Finally, the assets for this resource are generated in two files:
app/assets/javascripts/blorgh/articles.js
and
app/assets/stylesheets/blorgh/articles.css
. You'll see how
to use these a little later.
By default, the scaffold styling is not applied to the engine because the
engine's layout file,
app/views/layouts/blorgh/application.html.erb
, doesn't
load it. To make the scaffold styling apply, insert this line into the

tag of this layout:
<%= stylesheet_link_tag "scaffold" %>
You can see what the engine has so far by running rake
db:migrate
at the root of our engine to run the migration generated
by the scaffold generator, and then running rails server
in
test/dummy
. When you open
http://localhost:3000/blorgh/articles
you will see the default
scaffold that has been generated. Click around! You've just generated
your first engine's first functions.
If you'd rather play around in the console, rails console
will also work just like a Rails application. Remember: the
Article
model is namespaced, so to reference it you must call
it as Blorgh::Article
.
>> Blorgh::Article.find(1) => #<Blorgh::Article id: 1 ...>
One final thing is that the articles
resource for this engine
should be the root of the engine. Whenever someone goes to the root path
where the engine is mounted, they should be shown a list of articles. This
can be made to happen if this line is inserted into the
config/routes.rb
file inside the engine:
root to: "articles#index"
Now people will only need to go to the root of the engine to see all the
articles, rather than visiting /articles
. This means that
instead of http://localhost:3000/blorgh/articles
, you only
need to go to http://localhost:3000/blorgh
now.
Generating a Comments Resource¶ ↑
Now that the engine can create new articles, it only makes sense to add commenting functionality as well. To do this, you'll need to generate a comment model, a comment controller and then modify the articles scaffold to display comments and allow people to create new ones.
From the application root, run the model generator. Tell it to generate a
Comment
model, with the related table having two columns: a
article_id
integer and text
text column.
$ bin/rails generate model Comment article_id:integer text:text
This will output the following:
invoke active_record create db/migrate/[timestamp]_create_blorgh_comments.rb create app/models/blorgh/comment.rb invoke test_unit create test/models/blorgh/comment_test.rb create test/fixtures/blorgh/comments.yml
This generator call will generate just the necessary model files it needs,
namespacing the files under a blorgh
directory and creating a
model class called Blorgh::Comment
. Now run the migration to
create our blorgh_comments table:
$ rake db:migrate
To show the comments on an article, edit
app/views/blorgh/articles/show.html.erb
and add this line
before the “Edit” link:

Comments
 <%= render @article.comments %>
This line will require there to be a has_many
association for
comments defined on the Blorgh::Article
model, which there
isn't right now. To define one, open
app/models/blorgh/article.rb
and add this line into the model:
has_many :comments
Turning the model into this:
module Blorgh class Article < ActiveRecord::Base has_many :comments end end
NOTE: Because the has_many
is defined inside a class that is
inside the Blorgh
module, Rails will know that you want to use
the Blorgh::Comment
model for these objects, so there's no
need to specify that using the :class_name
option here.
Next, there needs to be a form so that comments can be created on an
article. To add this, put this line underneath the call to render
@article.comments
in
app/views/blorgh/articles/show.html.erb
:
<%= render "blorgh/comments/form" %>
Next, the partial that this line will render needs to exist. Create a new
directory at app/views/blorgh/comments
and in it a new file
called _form.html.erb
which has this content to create the
required partial:

New comment
 <%= form_for [@article, @article.comments.build] do |f| %>
 <%= f.label :text %>
 <%= f.text_area :text %>
 <%= f.submit %> <% end %>
When this form is submitted, it is going to attempt to perform a
POST
request to a route of
/articles/:article_id/comments
within the engine. This route
doesn't exist at the moment, but can be created by changing the
resources :articles
line inside config/routes.rb
into these lines:
resources :articles do resources :comments end
This creates a nested route for the comments, which is what the form requires.
The route now exists, but the controller that this route goes to does not. To create it, run this command from the application root:
$ bin/rails g controller comments
This will generate the following things:
create app/controllers/blorgh/comments_controller.rb invoke erb exist app/views/blorgh/comments invoke test_unit create test/controllers/blorgh/comments_controller_test.rb invoke helper create app/helpers/blorgh/comments_helper.rb invoke assets invoke js create app/assets/javascripts/blorgh/comments.js invoke css create app/assets/stylesheets/blorgh/comments.css
The form will be making a POST
request to
/articles/:article_id/comments
, which will correspond with the
create
action in Blorgh::CommentsController
. This
action needs to be created, which can be done by putting the following
lines inside the class definition in
app/controllers/blorgh/comments_controller.rb
:
def create @article = Article.find(params[:article_id]) @comment = @article.comments.create(comment_params) flash[:notice] = "Comment has been created!" redirect_to articles_path end private def comment_params params.require(:comment).permit(:text) end
This is the final step required to get the new comment form working. Displaying the comments, however, is not quite right yet. If you were to create a comment right now, you would see this error:
Missing partial blorgh/comments/_comment with {:handlers=>[:erb, :builder], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "/Users/ryan/Sites/side_projects/blorgh/test/dummy/app/views" * "/Users/ryan/Sites/side_projects/blorgh/app/views"
The engine is unable to find the partial required for rendering the
comments. Rails looks first in the application's
(test/dummy
) app/views
directory and then in the
engine's app/views
directory. When it can't find it,
it will throw this error. The engine knows to look for
blorgh/comments/_comment
because the model object it is
receiving is from the Blorgh::Comment
class.
This partial will be responsible for rendering just the comment text, for
now. Create a new file at
app/views/blorgh/comments/_comment.html.erb
and put this line
inside it:
<%= comment_counter + 1 %>. <%= comment.text %>
The comment_counter
local variable is given to us by the
<%= render @article.comments %>
call, which will define
it automatically and increment the counter as it iterates through each
comment. It's used in this example to display a small number next to
each comment when it's created.
That completes the comment function of the blogging engine. Now it's time to use it within an application.
Hooking Into an Application¶ ↑
Using an engine within an application is very easy. This section covers how
to mount the engine into an application and the initial setup required, as
well as linking the engine to a User
class provided by the
application to provide ownership for articles and comments within the
engine.
Mounting the Engine¶ ↑
First, the engine needs to be specified inside the application's
Gemfile
. If there isn't an application handy to test this
out in, generate one using the rails new
command outside of
the engine directory like this:
$ rails new unicorn
Usually, specifying the engine inside the Gemfile would be done by specifying it as a normal, everyday gem.
gem 'devise'
However, because you are developing the blorgh
engine on your
local machine, you will need to specify the :path
option in
your Gemfile
:
gem 'blorgh', path: "/path/to/blorgh"
Then run bundle
to install the gem.
As described earlier, by placing the gem in the Gemfile
it
will be loaded when Rails is loaded. It will first require
lib/blorgh.rb
from the engine, then
lib/blorgh/engine.rb
, which is the file that defines the major
pieces of functionality for the engine.
To make the engine's functionality accessible from within an
application, it needs to be mounted in that application's
config/routes.rb
file:
mount Blorgh::Engine, at: "/blog"
This line will mount the engine at /blog
in the application.
Making it accessible at http://localhost:3000/blog
when the
application runs with rails server
.
NOTE: Other engines, such as Devise, handle this a little differently by
making you specify custom helpers (such as devise_for
) in the
routes. These helpers do exactly the same thing, mounting pieces of the
engines's functionality at a pre-defined path which may be
customizable.
Engine setup¶ ↑
The engine contains migrations for the blorgh_articles
and
blorgh_comments
table which need to be created in the
application's database so that the engine's models can query them
correctly. To copy these migrations into the application use this command:
$ rake blorgh:install:migrations
If you have multiple engines that need migrations copied over, use
railties:install:migrations
instead:
$ rake railties:install:migrations
This command, when run for the first time, will copy over all the migrations from the engine. When run the next time, it will only copy over migrations that haven't been copied over already. The first run for this command will output something such as this:
Copied migration [timestamp_1]_create_blorgh_articles.blorgh.rb from blorgh Copied migration [timestamp_2]_create_blorgh_comments.blorgh.rb from blorgh
The first timestamp ([timestamp_1]
) will be the current time,
and the second timestamp ([timestamp_2]
) will be the current
time plus a second. The reason for this is so that the migrations for the
engine are run after any existing migrations in the application.
To run these migrations within the context of the application, simply run
rake db:migrate
. When accessing the engine through
http://localhost:3000/blog
, the articles will be empty. This
is because the table created inside the application is different from the
one created within the engine.  You'll find that it's the same as when it was only an
engine.
If you would like to run migrations only from one engine, you can do it by
specifying SCOPE
:
rake db:migrate SCOPE=blorgh
This may be useful if you want to revert engine's migrations before removing it. To revert all migrations from blorgh engine you can run code such as:
rake db:migrate SCOPE=blorgh VERSION=0
Using a Class Provided by the Application¶ ↑
Using a Model Provided by the Application¶ ↑
When an engine is created, it may want to use specific classes from an
application to provide links between the pieces of the engine and the
pieces of the application. In the case of the blorgh
engine,
making articles and comments have authors would make a lot of sense.
A typical application might have a User
class that would be
used to represent authors for an article or a comment. But there could be a
case where the application calls this class something different, such as
Person
. For this reason, the engine should not hardcode
associations specifically for a User
class.
To keep it simple in this case, the application will have a class called
User
that represents the users of the application (we'll
get into making this configurable further on). It can be generated using
this command inside the application:
rails g model user name:string
The rake db:migrate
command needs to be run here to ensure
that our application has the users
table for future use.
Also, to keep it simple, the articles form will have a new text field
called author_name
, where users can elect to put their name.
The engine will then take this name and either create a new
User
object from it, or find one that already has that name.
The engine will then associate the article with the found or created
User
object.
First, the author_name
text field needs to be added to the
app/views/blorgh/articles/_form.html.erb
partial inside the
engine. This can be added above the title
field with this
code:

 <%= f.label :author_name %>
 <%= f.text_field :author_name %>

Next, we need to update our
Blorgh::ArticleController#article_params
method to permit the
new form parameter:
def article_params params.require(:article).permit(:title, :text, :author_name) end
The Blorgh::Article
model should then have some code to
convert the author_name
field into an actual User
object and associate it as that article's author
before
the article is saved. It will also need to have an
attr_accessor
set up for this field, so that the setter and
getter methods are defined for it.
To do all this, you'll need to add the attr_accessor
for
author_name
, the association for the author and the
before_save
call into
app/models/blorgh/article.rb
. The author
association will be hard-coded to the User
class for the time
being.
attr_accessor :author_name belongs_to :author, class_name: "User" before_save :set_author private def set_author self.author = User.find_or_create_by(name: author_name) end
By representing the author
association's object with the
User
class, a link is established between the engine and the
application. There needs to be a way of associating the records in the
blorgh_articles
table with the records in the
users
table. Because the association is called
author
, there should be an author_id
column added
to the blorgh_articles
table.
To generate this new column, run this command within the engine:
$ bin/rails g migration add_author_id_to_blorgh_articles author_id:integer
NOTE: Due to the migration's name and the column specification after it, Rails will automatically know that you want to add a column to a specific table and write that into the migration for you. You don't need to tell it any more than this.
This migration will need to be run on the application. To do that, it must first be copied using this command:
$ rake blorgh:install:migrations
Notice that only one migration was copied over here. This is because the first two migrations were copied over the first time this command was run.
NOTE Migration [timestamp]_create_blorgh_articles.blorgh.rb from blorgh has been skipped. Migration with the same name already exists. NOTE Migration [timestamp]_create_blorgh_comments.blorgh.rb from blorgh has been skipped. Migration with the same name already exists. Copied migration [timestamp]_add_author_id_to_blorgh_articles.blorgh.rb from blorgh
Run the migration using:
$ rake db:migrate
Now with all the pieces in place, an action will take place that will
associate an author - represented by a record in the users
table - with an article, represented by the blorgh_articles
table from the engine.
Finally, the author's name should be displayed on the article's
page. Add this code above the “Title” output inside
app/views/blorgh/articles/show.html.erb
:

 Author: <%= @article.author %>

By outputting @article.author
using the <%=
tag, the to_s
method will be called on the object. By default,
this will look quite ugly:
#<User:0x00000100ccb3b0>
This is undesirable. It would be much better to have the user's name
there. To do this, add a to_s
method to the User
class within the application:
def to_s name end
Now instead of the ugly Ruby object output, the author's name will be displayed.
Using a Controller Provided by the Application¶ ↑
Because Rails controllers generally share code for things like
authentication and accessing session variables, they inherit from
ApplicationController
by default. Rails engines, however are
scoped to run independently from the main application, so each engine gets
a scoped ApplicationController
. This namespace prevents code
collisions, but often engine controllers need to access methods in the main
application's ApplicationController
. An easy way to
provide this access is to change the engine's scoped
ApplicationController
to inherit from the main
application's ApplicationController
. For our Blorgh engine
this would be done by changing
app/controllers/blorgh/application_controller.rb
to look like:
module Blorgh class ApplicationController < ::ApplicationController end end
By default, the engine's controllers inherit from
Blorgh::ApplicationController
. So, after making this change
they will have access to the main application's
ApplicationController
, as though they were part of the main
application.
This change does require that the engine is run from a Rails application
that has an ApplicationController
.
Configuring an Engine¶ ↑
This section covers how to make the User
class configurable,
followed by general configuration tips for the engine.
Setting Configuration Settings in the Application¶ ↑
The next step is to make the class that represents a User
in
the application customizable for the engine. This is because that class may
not always be User
, as previously explained. To make this
setting customizable, the engine will have a configuration setting called
author_class
that will be used to specify which class
represents users inside the application.
To define this configuration setting, you should use a
mattr_accessor
inside the Blorgh
module for the
engine. Add this line to lib/blorgh.rb
inside the engine:
mattr_accessor :author_class
This method works like its brothers, attr_accessor
and
cattr_accessor
, but provides a setter and getter method on the
module with the specified name. To use it, it must be referenced using
Blorgh.author_class
.
The next step is to switch the Blorgh::Article
model over to
this new setting. Change the belongs_to
association inside
this model (app/models/blorgh/article.rb
) to this:
belongs_to :author, class_name: Blorgh.author_class
The set_author
method in the Blorgh::Article
model should also use this class:
self.author = Blorgh.author_class.constantize.find_or_create_by(name: author_name)
To save having to call constantize
on the
author_class
result all the time, you could instead just
override the author_class
getter method inside the
Blorgh
module in the lib/blorgh.rb
file to always
call constantize
on the saved value before returning the
result:
def self.author_class @@author_class.constantize end
This would then turn the above code for set_author
into this:
self.author = Blorgh.author_class.find_or_create_by(name: author_name)
Resulting in something a little shorter, and more implicit in its behavior.
The author_class
method should always return a
Class
object.
Since we changed the author_class
method to return a
Class
instead of a String
, we must also modify
our belongs_to
definition in the Blorgh::Article
model:
belongs_to :author, class_name: Blorgh.author_class.to_s
To set this configuration setting within the application, an initializer should be used. By using an initializer, the configuration will be set up before the application starts and calls the engine's models, which may depend on this configuration setting existing.
Create a new initializer at config/initializers/blorgh.rb
inside the application where the blorgh
engine is installed
and put this content in it:
Blorgh.author_class = "User"
WARNING: It's very important here to use the String
version of the class, rather than the class itself. If you were to use the
class, Rails would attempt to load that class and then reference the
related table. This could lead to problems if the table wasn't already
existing. Therefore, a String
should be used and then
converted to a class using constantize
in the engine later on.
Go ahead and try to create a new article. You will see that it works
exactly in the same way as before, except this time the engine is using the
configuration setting in config/initializers/blorgh.rb
to
learn what the class is.
There are now no strict dependencies on what the class is, only what the
API for the class must be. The engine simply requires this class to define
a find_or_create_by
method which returns an object of that
class, to be associated with an article when it's created. This object,
of course, should have some sort of identifier by which it can be
referenced.
General Engine Configuration¶ ↑
Within an engine, there may come a time where you wish to use things such as initializers, internationalization or other configuration options. The great news is that these things are entirely possible, because a Rails engine shares much the same functionality as a Rails application. In fact, a Rails application's functionality is actually a superset of what is provided by engines!
If you wish to use an initializer - code that should run before the engine
is loaded - the place for it is the config/initializers
folder. This directory's functionality is explained in the Initializers section of the
Configuring guide, and works precisely the same way as the
config/initializers
directory inside an application. The same
thing goes if you want to use a standard initializer.
For locales, simply place the locale files in the
config/locales
directory, just like you would in an
application.
Testing an engine¶ ↑
When an engine is generated, there is a smaller dummy application created
inside it at test/dummy
. This application is used as a
mounting point for the engine, to make testing the engine extremely simple.
You may extend this application by generating controllers, models or views
from within the directory, and then use those to test your engine.
The test
directory should be treated like a typical Rails
testing environment, allowing for unit, functional and integration tests.
Functional Tests¶ ↑
A matter worth taking into consideration when writing functional tests is
that the tests are going to be running on an application - the
test/dummy
application - rather than your engine. This is due
to the setup of the testing environment; an engine needs an application as
a host for testing its main functionality, especially controllers. This
means that if you were to make a typical GET
to a controller
in a controller's functional test like this:
module Blorgh class FooControllerTest < ActionController::TestCase def test_index get :index ... end end end
It may not function correctly. This is because the application doesn't
know how to route these requests to the engine unless you explicitly tell
it how. To do this, you must set the @routes
instance variable to the engine's route set in your setup code:
module Blorgh class FooControllerTest < ActionController::TestCase setup do @routes = Engine.routes end def test_index get :index ... end end end
This tells the application that you still want to perform a
GET
request to the index
action of this
controller, but you want to use the engine's route to get there, rather
than the application's one.
This also ensures that the engine's URL helpers will work as expected in your tests.
Improving engine functionality¶ ↑
This section explains how to add and/or override engine MVC functionality in the main Rails application.
Overriding Models and Controllers¶ ↑
Engine model and controller classes can be extended by open classing them in the main Rails application (since model and controller classes are just Ruby classes that inherit Rails specific functionality). Open classing an Engine class redefines it for use in the main application. This is usually implemented by using the decorator pattern.
For simple class modifications, use Class#class_eval
. For
complex class modifications, consider using
ActiveSupport::Concern
.
A note on Decorators and Loading Code¶ ↑
Because these decorators are not referenced by your Rails application itself, Rails' autoloading system will not kick in and load your decorators. This means that you need to require them yourself.
Here is some sample code to do this:
# lib/blorgh/engine.rb module Blorgh class Engine < ::Rails::Engine isolate_namespace Blorgh config.to_prepare do Dir.glob(Rails.root + "app/decorators /*_decorator*.rb").each do |c| require_dependency(c) end end end end
This doesn't apply to just Decorators, but anything that you add in an engine that isn't referenced by your main application.
Implementing Decorator Pattern Using Class#class_eval¶ ↑
Adding* Article#time_since_created
:
# MyApp/app/decorators/models/blorgh/article_decorator.rb Blorgh::Article.class_eval do def time_since_created Time.current - created_at end end
# Blorgh/app/models/article.rb class Article < ActiveRecord::Base has_many :comments end
Overriding* Article#summary
:
# MyApp/app/decorators/models/blorgh/article_decorator.rb Blorgh::Article.class_eval do def summary "#{title} - #{truncate(text)}" end end
# Blorgh/app/models/article.rb class Article < ActiveRecord::Base has_many :comments def summary "#{title}" end end
Implementing Decorator Pattern Using ActiveSupport::Concern¶ ↑
Using Class#class_eval
is great for simple adjustments, but
for more complex class modifications, you might want to consider using ActiveSupport::Concern.
ActiveSupport::Concern manages load order of interlinked dependent modules
and classes at run time allowing you to significantly modularize your code.
Adding* Article#time_since_created
and
Overriding Article#summary
:
# MyApp/app/models/blorgh/article.rb class Blorgh::Article < ActiveRecord::Base include Blorgh::Concerns::Models::Article def time_since_created Time.current - created_at end def summary "#{title} - #{truncate(text)}" end end
# Blorgh/app/models/article.rb class Article < ActiveRecord::Base include Blorgh::Concerns::Models::Article end
# Blorgh/lib/concerns/models/article module Blorgh::Concerns::Models::Article extend ActiveSupport::Concern # 'included do' causes the included code to be evaluated in the # context where it is included (article.rb), rather than being # executed in the module's context (blorgh/concerns/models/article). included do attr_accessor :author_name belongs_to :author, class_name: "User" before_save :set_author private def set_author self.author = User.find_or_create_by(name: author_name) end end def summary "#{title}" end module ClassMethods def some_class_method 'some class method string' end end end
Overriding Views¶ ↑
When Rails looks for a view to render, it will first look in the
app/views
directory of the application. If it cannot find the
view there, it will check in the app/views
directories of all
engines that have this directory.
When the application is asked to render the view for
Blorgh::ArticlesController
's index action, it will first
look for the path app/views/blorgh/articles/index.html.erb
within the application. If it cannot find it, it will look inside the
engine.
You can override this view in the application by simply creating a new file
at app/views/blorgh/articles/index.html.erb
. Then you can
completely change what this view would normally output.
Try this now by creating a new file at
app/views/blorgh/articles/index.html.erb
and put this content
in it:

Articles
 <%= link_to "New Article", new_article_path %> <% @articles.each do |article| %>
<%= article.title %>
 By <%= article.author %> <%= simple_format(article.text) %>
 <% end %>
Routes¶ ↑
Routes inside an engine are isolated from the application by default. This
is done by the isolate_namespace
call inside the
Engine
class. This essentially means that the application and
its engines can have identically named routes and they will not clash.
Routes inside an engine are drawn on the Engine
class within
config/routes.rb
, like this:
Blorgh::Engine.routes.draw do resources :articles end
By having isolated routes such as this, if you wish to link to an area of
an engine from within an application, you will need to use the engine's
routing proxy method. Calls to normal routing methods such as
articles_path
may end up going to undesired locations if both
the application and the engine have such a helper defined.
For instance, the following example would go to the application's
articles_path
if that template was rendered from the
application, or the engine's articles_path
if it was
rendered from the engine:
<%= link_to "Blog articles", articles_path %>
To make this route always use the engine's articles_path
routing helper method, we must call the method on the routing proxy method
that shares the same name as the engine.
<%= link_to "Blog articles", blorgh.articles_path %>
If you wish to reference the application inside the engine in a similar
way, use the main_app
helper:
<%= link_to "Home", main_app.root_path %>
If you were to use this inside an engine, it would always
go to the application's root. If you were to leave off the
main_app
“routing proxy” method call, it could potentially go
to the engine's or application's root, depending on where it was
called from.
If a template rendered from within an engine attempts to use one of the
application's routing helper methods, it may result in an undefined
method call. If you encounter such an issue, ensure that you're not
attempting to call the application's routing methods without the
main_app
prefix from within the engine.
Assets¶ ↑
Assets within an engine work in an identical way to a full application.
Because the engine class inherits from Rails::Engine
, the
application will know to look up assets in the engine's
'app/assets' and 'lib/assets' directories.
Like all of the other components of an engine, the assets should be
namespaced. This means that if you have an asset called
style.css
, it should be placed at
app/assets/stylesheets/[engine name]/style.css
, rather than
app/assets/stylesheets/style.css
. If this asset isn't
namespaced, there is a possibility that the host application could have an
asset named identically, in which case the application's asset would
take precedence and the engine's one would be ignored.
Imagine that you did have an asset located at
app/assets/stylesheets/blorgh/style.css
To include this asset
inside an application, just use stylesheet_link_tag
and
reference the asset as if it were inside the engine:
<%= stylesheet_link_tag "blorgh/style.css" %>
You can also specify these assets as dependencies of other assets using Asset Pipeline require statements in processed files:
/* = require blorgh/style
INFO. Remember that in order to use languages like Sass or CoffeeScript,
you should add the relevant library to your engine's
.gemspec
.
Separate Assets & Precompiling¶ ↑
There are some situations where your engine's assets are not required
by the host application. For example, say that you've created an admin
functionality that only exists for your engine. In this case, the host
application doesn't need to require admin.css
or
admin.js
. Only the gem's admin layout needs these assets.
It doesn't make sense for the host app to include
"blorgh/admin.css"
in its stylesheets. In this
situation, you should explicitly define these assets for precompilation.
This tells sprockets to add your engine assets when rake
assets:precompile
is triggered.
You can define assets for precompilation in engine.rb
:
initializer "blorgh.assets.precompile" do |app| app.config.assets.precompile += %w(admin.css admin.js) end
For more information, read the Asset Pipeline guide.
Other Gem Dependencies¶ ↑
Gem dependencies inside an engine should be specified inside the
.gemspec
file at the root of the engine. The reason is that
the engine may be installed as a gem. If dependencies were to be specified
inside the Gemfile
, these would not be recognized by a
traditional gem install and so they would not be installed, causing the
engine to malfunction.
To specify a dependency that should be installed with the engine during a
traditional gem install
, specify it inside the
Gem::Specification
block inside the .gemspec
file
in the engine:
s.add_dependency "moo"
To specify a dependency that should only be installed as a development dependency of the application, specify it like this:
s.add_development_dependency "moo"
Both kinds of dependencies will be installed when bundle
install
is run inside of the application. The development
dependencies for the gem will only be used when the tests for the engine
are running.
Note that if you want to immediately require dependencies when the engine is required, you should require them before the engine's initialization. For example:
require 'other_engine/engine' require 'yet_another_engine/engine' module MyEngine class Engine < ::Rails::Engine end end


An administrator at orders.mort11.org has reset your account password.
Below are the details -
First Name - {{ first_name }}
Last Name - {{ last_name }}
Username - {{ username }}
Temporary Password - {{ temp_password }}
You will be prompted to change your password as soon as you login.
- The MORT Order Team


Group by is an enumberable method that can take elements from a certain hash, organize and display them by certain properties. A good example would be.
list = { "apple" => 1, "banana" => 2, "pear" => 3 } puts list.group_by {|k,v| k == "apple"}
The result will display. {true=>[["apple", 1]], false=>[["banana", 2], ["pear", 3]]}
I do not know how to use group other than display properties. I will see if I could use it for pushing specified groups into data sets. etc.


About Me
Hi, I'm Robert Hatfield, and I'm a developer studying at Code Fellows in Seattle, WA.
Education Summary
- Formal Education
- Code Fellows, Seattle WA - currently studying
- The Art Institute of Seattle - studied, 1995
- White River High School, Buckley WA - graduated w/ 3.3 GPA, 1994
- Other Education
- Getting Things Done - Mastering Workflow Level 1: Fundamentals, 2016
- InsurePass - Washington State Pre-License Education for Life & Disability, 1998
Employment History
- Comcast Cable - March 2000 - December 2016
- Reviewed and staged hardware & software maintenance events for Comcast's production environments in nine regions from Minnesota to the West Coast.
- Coordinated fix agent responses to outage & impairment events for Comcast's Hybrid Fiber/Coax network in Washington State.
- Provided technical and operational support to external customers, contracted resources, and in-house technicians & engineers.
- Modern Woodmen of America - January - December 1999
My Top 10 Sci-Fi & Fantasy Series/Franchises
- Star Trek
- Star Wars
- Stargate What? I happen to like the stars.
- The Wheel of Time (book series), by Robert Jordan & Brandon Sanderson
- Old Man's War (book series), by John Scalzi
- The Hitchhiker's Guide to the Galaxy (book series), by Douglas Adams
- The Marvel Cinematic Universe (a.k.a. MCU)
- The Expanse (TV & book series), by James S. A. Corey)
- Robots (book series), by Isaac Asimov
- Gentlemen Bastards (book series), by Scott Lynch


Martian Snow
flurries in the polar night
Snowfall in the polar winter of Mars is unlike anything on Earth: temperatures plummet and the martian air (made mostly of CO) begins to freeze. In the darkness of polar night, flurries and snow storms quietly blanket the surface with “dry ice”, drawing fresh air into the polar atmosphere to fill the void. This CO cycle strongly influences Mars’ global climate and energy balance.
We used data from the Mars Climate Sounder (MCS) to investigate polar snowfall and its effect on the present-day climate. MCS is an infrared sounder onboard the Mars Reconnaissance Orbiter spacecraft, which seeks to reveal the history of water and its role in shaping potentially habitable environments on Mars. Our ongoing research is revealing new insights into the exchange of water and carbon dioxide between the polar caps and atmosphere.
Further information:
- Hayne, P. O., Paige, D. A., & Heavens, N. G. (2014). The role of snowfall in forming the seasonal ice caps of Mars: Models and constraints from the Mars Climate Sounder. Icarus, 231, 122-130. Link
- Hayne, P. O., Paige, D. A., Schofield, J. T., Kass, D. M., Kleinböhl, A., Heavens, N. G., & McCleese, D. J. (2012). Carbon dioxide snow clouds on Mars: South polar winter observations by the Mars Climate Sounder. Journal of Geophysical Research: Planets, 117(E8). Link


|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gephi.ranking.RankingModelImpl
public class RankingModelImpl
Implementation of the RankingModel
interface.
| Nested Class Summary | |
|---|---|
class |
RankingModelImpl.AutoRanking
|
| Constructor Summary | |
|---|---|
RankingModelImpl(Workspace workspace)
|
| Method Summary | |
|---|---|
void |
addAutoRanking(Ranking ranking,
Transformer transformer)
|
void |
addRankingListener(RankingListener listener)
Add listener as a ranking listener of this model |
void |
attributesChanged(AttributeEvent event)
|
void |
fireRankingListener(RankingEvent rankingEvent)
|
java.util.List<RankingModelImpl.AutoRanking> |
getAutoRankings()
|
Ranking |
getAutoTransformerRanking(Transformer transformer)
If transformer is an auto transformer, returns the ranking
associated to it. |
Ranking[] |
getEdgeRankings()
Get all rankings for edge elements. |
Interpolator |
getInterpolator()
Returns the current interpolator. |
Ranking[] |
getNodeRankings()
Get all rankings for node elements. |
Ranking |
getRanking(java.lang.String elementType,
java.lang.String name)
Return the specific ranking for elementType and with
the given name . |
Ranking[] |
getRankings(java.lang.String elementType)
Get all rankings for elementType elements. |
Transformer |
getTransformer(java.lang.String elementType,
java.lang.String name)
Returns the specific transformer for elementType and with the
given name . |
Transformer[] |
getTransformers(java.lang.String elementType)
Return all transformers specific to elementType . |
Workspace |
getWorkspace()
Return the workspace this model is associated with |
void |
removeAutoRanking(Transformer transformer)
|
void |
removeRankingListener(RankingListener listener)
Remove listener as a ranking listener of this model |
void |
select()
|
void |
setInterpolator(Interpolator interpolator)
|
void |
setLocalScale(boolean localScale)
|
void |
unselect()
|
boolean |
useLocalScale()
Returns true if rankings are using the currently visible
graph as a scale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RankingModelImpl(Workspace workspace)
| Method Detail |
|---|
public void select()
public void unselect()
public void attributesChanged(AttributeEvent event)
attributesChanged
in interface AttributeListener
public Workspace getWorkspace()
RankingModel
getWorkspace
in interface RankingModel
public Ranking[] getNodeRankings()
RankingModel
Ranking.NODE_ELEMENT
.
getNodeRankings
in interface RankingModel
public Ranking[] getEdgeRankings()
RankingModel
Ranking.EDGE_ELEMENT
.
getEdgeRankings
in interface RankingModel
public Ranking[] getRankings(java.lang.String elementType)
RankingModel
elementType
elements. Rankings are
classified with the type of element they are manipulating. If
elementType
equals Ranking.NODE_ELEMENT
this is
equivalent to RankingModel.getNodeRankings()
method
getRankings
in interface RankingModel
elementType
- the element type of the rankings
elementType
public Ranking getRanking(java.lang.String elementType, java.lang.String name)
RankingModel
elementType
and with
the given name
. Returns null
if not found.
Default ranking names can be found in the Ranking
interface. For
attribute rankings, simply use the column identifier.
getRanking
in interface RankingModel
elementType
- the element type of the rankingname
- the name of the ranking
null
if not foundpublic Transformer getTransformer(java.lang.String elementType, java.lang.String name)
RankingModel
elementType
and with the
given name
. Returns null
if not found.
Default transformers name can be found in the Transformer
interface.
getTransformer
in interface RankingModel
elementType
- the element type of the transformername
- the name of the transformer
name
and elementType
or null
if not foundpublic Transformer[] getTransformers(java.lang.String elementType)
RankingModel
elementType
. A transformer
defines his ability to transformer different element types.
getTransformers
in interface RankingModel
elementType
- the element type of the transformers
elementType
public Interpolator getInterpolator()
RankingModel
getInterpolator
in interface RankingModel
public void setInterpolator(Interpolator interpolator)
public void addAutoRanking(Ranking ranking, Transformer transformer)
public void removeAutoRanking(Transformer transformer)
public Ranking getAutoTransformerRanking(Transformer transformer)
RankingModel
transformer
is an auto transformer, returns the ranking
associated to it.
getAutoTransformerRanking
in interface RankingModel
transformer
- the transformer to obtain the ranking from
transformer
or null
public java.util.List<RankingModelImpl.AutoRanking> getAutoRankings()
public boolean useLocalScale()
RankingModel
true
if rankings are using the currently visible
graph as a scale. If false
the complete graph is used to determine
minimum and maximum values, the ranking scale.
useLocalScale
in interface RankingModel
true
if using a local scale, false
if
global scalepublic void setLocalScale(boolean localScale)
public void addRankingListener(RankingListener listener)
RankingModel
listener
as a ranking listener of this model
addRankingListener
in interface RankingModel
listener
- the listener to addpublic void removeRankingListener(RankingListener listener)
RankingModel
listener
as a ranking listener of this model
removeRankingListener
in interface RankingModel
listener
- the listener to removepublic void fireRankingListener(RankingEvent rankingEvent)
|
Gephi Toolkit Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


esc(1) - [NCURSES] set xterm(1) attributes using a screen or line mode (LICENSE:PD)
Synopsis
Description
Options
Variables
Example
Author
License
esc [keywords] -rows NN -cols NN -right NN -down NN -fn fontname -fsize fontsize -bg background_color -fg foreground_color -cr cursor_color -cn [0 COLOR_VALUE 1 COLOR_VALUE 2 COLOR_VALUE ...|] -o windowname -title TITLE window title -name TITLE icon name -nt TITLE icon name and title -xrdb [NAME] -iconstate -alias --help --version
If no values are specified on the command line a screen interface is displayed that allows setting the background, foreground, cursor color, font size, and window size of an xterm(1) terminal emulator window using ncurses(3f)/fixedform(3f).If options are specified on the command line the values are set and the screen mode is not launched.
If the positioning and resize options do not work, run the following before starting a new xterm:
esc -xrdb |xrdb -mergeIf you use something that filters stdout such as tmux(1), screen(1) assign esc(1) output to the initial stdout before starting the program, such as
export OTHERTTY=tty tmux
VALUES The allowed keywords are:
o 80........ set terminal width to eighty characters o 132....... set terminal width to 132 characters o raise..... raise to top of window stack o lower..... lower to back of window stack o iconify... iconify window o uniconify. uniconify window o toggle.... toggle icon state o maximize.. make xterm(1) window size of display o restore... restore window size to before the last "maximize" o vt102..... switch to VT102 terminal emulator mode o tek....... switch to Tektronix 4010 terminal emulator mode -rows NN change number of rows of window to specified value -cols NN change number of columns of window to specified value -right NN distance in rasters from left display edge to place upper left corner -down NN distance in rasters from upper display edge to place upper left corner -fn FONTNAME change to specified font name. You can list several available fixed-space font names by using: (xlsfonts -fn *-c-* ; xlsfonts -fn *-m-*)Example names: (font names may vary from server to server):
fixed 8x13 9x15 *24*-c-*
-fsize NN guess at a fixed font of specified size -bg CNAME specify background color by name or hex value "#RRGGBB" -fg CNAME specify foreground color by name or hex value "#RRGGBB" -cr CNAME specify cursor color by name or hex value "#RRGGBB" -cn NN CNAME... define terminal pen colors by number "NN $RRGGBB" or name. Typically, at least 0 thru 15 are supported. -title TITLE window title -name TITLE icon name -nt TITLE icon name and title --alias list some common bash shell aliases that use esc(1). These are typically added to the ~/.bashrc file or sourced: esc -alias >./junk;source ./junk;rm ./junk;alias
-o WINDOWNAME If your window manager supports multiple virtual displays by defining the property WM_OCCUPANCY (use xprop -id $WINDOWID to see) then you can move your windows to specific virtual displays; usually by number or by name. The name "all" is typically special and makes the window visible in all the virtual displays. This works for the ctwm(1) window manager.
If your window manager has assigned the property WS_OCCUPATION as seen by entering
xprop -id $WINDOWID : WM_OCCUPATION(STRING) = "2" WM_OCCUPATION(STRING) = "Two" :you can specify which virtual display to display on.
| --iconstate | |||||||||||||||
return current icon state of X11 xterm window (opened or
closed).
-fn -bg -fg -cr -rows -cols -down -right -iconstate -cn |0 1 2 ... By itself, -cn will list the first 16 pen colors. Given a list of numbers, it will query those specific pen numbers. | |||||||||||||||
By default esc(1) writes output to the current stdout file. The environment variable OTHERTTY can be used to change the default file. This is commonly required before starting programs that filter stdout, such as tmux(1) and screen(1).
export OTHERTTY=/dev/pts/1
Sample usage:
# if do not have xterm settings set might need to enter esc -xrdb|xrdb -merge # and then try the commands in xterm(1) windows launched after thisesc # bring up screen interface esc -fn *--14*-c-* # find a font of specified size esc -fn 5 # set to fifth font in font menu (ctrl-Mouse2) esc -fsize 20 # set to first 20-point font found (if any) esc -rows 40 -cols 132 # set terminal size esc -bg brown -fg white -cr red esc -bg #ff00ff esc -cn 0 red 1 green 2 cyan esc -alias >x;source x;rm x # set up a lot of bash shell aliases
# set up X11 resources so name BROWN sets some favorite defaults esc -bg brown -fg black -fn 5 -xrdb BROWN >>$HOME/.Xdefaults xrdb -merge $HOME/.Xdefaults xterm -name BROWN
C-shell
alias cd cd \!*; esc -nt
John S. Urban
Public Domain
| Nemo Release 3.1 | esc (1) | July 22, 2023 |


This is an implementation of the Generalized Discrimination Score (also known as Two Alternatives Forced Choice Score, 2AFC) for various representations of forecasts and verifying observations. The Generalized Discrimination Score is a generic forecast verification framework which can be applied to any of the following verification contexts: dichotomous, polychotomous (ordinal and nominal), continuous, probabilistic, and ensemble. A comprehensive description of the Generalized Discrimination Score, including all equations used in this package, is provided by Mason and Weigel (2009) <doi:10.1175/MWR-D-10-05069.1>.
| Version: | 1.4.0 |
| Published: | 2017-05-18 |
| Author: | Andreas Weigel [aut], MeteoSwiss [cph], Jonas Bhend [cre, ctb] |
| Maintainer: | Jonas Bhend <jonas.bhend at meteoswiss.ch> |
| License: | GPL-3 |
| NeedsCompilation: | no |
| Materials: | NEWS |
| CRAN checks: | afc results |
| Reference manual: | afc.pdf |
| Package source: | afc_1.4.0.tar.gz |
| Windows binaries: | r-devel: afc_1.4.0.zip, r-release: afc_1.4.0.zip, r-oldrel: afc_1.4.0.zip |
| OS X binaries: | r-release: afc_1.4.0.tgz, r-oldrel: afc_1.4.0.tgz |
| Old sources: | afc archive |
Please use the canonical form https://CRAN.R-project.org/package=afc to link to this page.


"SHANGHAI NOON" Review by R.L. Strong **** out of *****
TOUCHSTONE PICTURES AND SPYGLASS ENTERTAINMENT PRESENTS A BIRNBAUM / BARBER PRODUCTION IN ASSOCIATION WITH A JACKIE CHAN FILMS LIMITED PRODUCTION JACKIE CHAN OWEN WILSON "SHANGHAI NOON" LUCY LIU MUSIC BY RANDY EDELMAN CO PRODUCERS NED DOWD JULES DALY EXECUTIVE PRODUCER JACKIE CHAN WILLIE CHAN AND SOLON SO PRODUCED BY ROGER BIRNBAUM GARY BARBER AND JONATHAN GLICKMAN WRITTEN BY ALFRED GOUGH & MILES MILLAR DIRECTED BY TOM DEY
Rated PG-13 for mild language, adult situations, drug use, martial art action and violence. 107 minutes. Super 35mm / Panavision (2.35:1)
Jackie stars as Chon Wang, a lesser Imperial Guard in the Forbidden City of China. The royal Princess Pei Pei (Lucy Liu) is set to be married to the obnoxious son of a nobleman from another prefecture. Unwilling to follow her Father's wishes, Princess Pei Pei with the assistance of her English tutor, decides to escape to America. But this is all a ploy devised by exiled guard Lo Fong, which will lead to the Princess' kidnapping and ransom.
Unable to take any legal action, the ransom demands are met and three of the Forbidden City's bravest Guards (played by Cui Ya Hi, Rong Guang Yu, and Eric Chen) are ordered to transport the ransom payment to Lo Fong in Carson City, Nevada. Chon Wang pleads with the imperial court and is given permission to join the team, as he is looked upon as a buffoon.
On a train in the U.S. Jackie meets up with bandit Roy O'Bannon (Owen Wilson). He is much less of a bandit than he is a glory hog, looking simple for the notoriety and fame that being a bandit will bring him. With his gang in tow, Roy attempts to rob the train, when one of his gang murders the Chinese interpreter of the Royal Court, who also happens to be Chon Wang's uncle.
Chon Wang gives chase, foiling the attempted robbery, but also leaving himself stranded in the desert. As the disgraced Guard wanders through the desert, he again comes upon Roy, who has been left for dead by his former gang. Buried up to his neck in the desert, Roy pleads with Chon to dig him out. Chon demands to know where Carson City is. Roy directs him, and Chon leaves. But not before sticking two chopsticks into Roy's mouth and telling him to dig himself.

"Shanghai Noon" is just good fun. The chemistry between the cast is remarkable. The performances are all acceptable within the whimsical levels of the film. Jackie's performance is as good as anything he's done before. He's not called on to do much acting here, as the character is not written with any depth. But Jackie's natural charisma shines through, and his comic timing is so perfect, both physically and (surprise) verbally that once again he commands the screen whenever he is on.
Owen Wilson, last seen in the embarrassing remake of "The Haunting", gives a good natured performance as Roy O'Bannon. His innocence is refreshing and fun. A bad guy that's not really bad. His scenes with Jackie are some of the best bits of comic dueling since Martin and Lewis. Lucy Liu as Princess Pei Pei is given little to do in the script, but for a change does not play a nymphet or some other deviant. The character is a noble woman of status and wealth, but finds a greater cause as a result of her own imprisonment.
The rest of the performances are all broadly drawn comic performances. Nothing here is realistic, mind you. "Shanghai Noon" is first and foremost a light, jovial film. And the performances match that style with ease.
The Cinematography by Dan Mindel is gorgeous. Using Calgary, Alberta as the prime location. Mr. Mindel is able to create a lush, romantic western feel to the film. Nothing here really looks like Nevada, but the locations are so beautifully shot and staged, the film can be looked upon as a loving tribute to earlier films of the genre. And as such, the script by Alfred Gough and Miles Millar plays fast and loose with history, but with reverence to past films. Homage to such films as "High Noon" (obviously), "Red River" and most notably "Butch Cassidy & the Sundance Kid" all bring a sense of nostalgia to the film. It is a comforting experience. At a time when the Western is considered either old hat or irrelevant, here is a film that embraces those old attitudes and (dare I say) clichés and manages to make them palatable and refreshing. Here is a film that is not contemptuous of the genre. This is the purest "horse opera" since the days of George O'Brian or John Wayne.
Director Tom Dey has crafted a loving tribute to Hollywood's past. In this, his first film Mr. Dey shows both a love of character and of craftsmanship that is refreshing to see. Nothing here really stands out, or takes one's attention away from the story or action. And that is as it should be, when Jackie Chan is your star.
And what of the action and stunts. Well, while not up to a level of "Drunken Master 2" or any of Jackie's Hong Kong films, "Shanghai Noon" is miles ahead of anything Jackie has done in an American film before. His timing, choreography, and creativity are still as sharp as ever. Jackie even gets to recreate a few scenes from his earlier films (obvious to those of us that have seen those films, but refreshingly fun for those unfamiliar). Finally Jackie can honestly say, that he has made an U.S., his way and incorporating his style.
To sum up, "Shanghai Noon" is a fun summer confection. Not too heavy and not too light. A fun and entertaining film that the whole family can enjoy (parents be advised there are scenes of smoking, drunkenness and peyote use). An enjoyable and charming film that can and will be enjoyed again and again.
Owned & Copyright © 2000 R.L. Strong Nothing in this article may be quoted or re-printed without the expressed written permission of the author.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


building phonegap app for Android and iOS
So I had the pleasure of figuring out how to successfully build and publish a phonegap app, both to the Play store and Apple store. It was bad enough that I have no experience with phonegap/Cordova (or anything iOS development related), but the previous developer had left no documentation. That was fun. Here are some notes of things I ran into along the way. Hope they help someone else out too
So I had downloaded the repo, installed all the dependacies, but now I was getting this error
Spent some time looking at Google, when I came across this suggestion to use webpack to display more verbose errors webpack --display-error-details
. Genius.
This gave some more verbose output and told me that it was searching for the file, but could not find it in some directories, this helped me realise it was case sensative. The file it was looking for had a capital S
, but it was looking for lower case s
. Changing the name of the file to lowercase and rebuild
And another error, but on index.jsx file this time. Not sure why it only errored on these 2 files, probably something in the config files but I didn’t rally want to be looking through config files all day (there were alot!) Do the same and rename to lower. And now we get a successful build! Yay!
The previous dev had done this on OSX but not sure why this was an issue on Linux(can understand if it was done on windows, for example)
So now we have an Android apk, but to upload it to the store it needs to be signed (and later on it told me it also has to be zipaligned)
Here is how to do that with command line
Uh oh, another error
jarsigner: Certificate chain not found for: myapp. myapp must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
Turns out you have to specify the exact alias that is found inside the keystore with the jarsigner command. To get that, run
keytool -keystore /home/george/Documents/repositories/myapp/key/myapp.keystore -l
That will display something similar to this, where you can see the alias name. Now re run jarsigner
with the correct alias and you will have a great time
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: myapp-release
......
Now we have a signed apk, but on uplaoding to the store, it errors and tells me its not zip aligned. Luckily this one was easy.
/home/george/Android/Sdk/build-tools/24.0.3/zipalign -v 4 android-x86-release-signed.apk android-release-signed-aligned.apk
NOTE only zip align after you have signed
Android down, iOS to go!


It seems we can’t ____ what you’re looking for. _______ searching can help.
In the trial version of Web2Disk every fifth word is blanked out. To copy this site with all the words, please upgrade to the full version and copy this website again.
It seems we can’t ____ what you’re looking for. _______ searching can help.


Audio Puzzle
Once you fill in the boxes, take the letters in the grey boxes and form two words which you can attach to your face. Ask us for these articles, and snap a picture and show it to us!
Across
- (5) Weapon used in this famous fictional fight (audio link)
- (6) A failed semaphore, or how the birds travel? (audio link)
- (7) Indian musical instrument (audio link)
- (8) Classic theme song for what? (audio link)
- (9) Identify the animals at play (audio link)
- (10) Who's 'revenge' ad is this in the 90s? (audio link)
Down
- (1) Where we might find this rare species, in India(video link)
- (2) Name the movie where this cult scene occurs (audio link)
- (3) Identify the show behind this classic sound (audio link)
- (4) What bird makes this sound?(audio link)


1. Login in with your Spotify Credentials
2. Pick an Album in each matchup
3. Narrow down to your top 10
Log in with Spotify
You don"t have enough albums!
This application will only gather albums you have saved, not those for which you have saved specific tracks
Loading your Albums
Pick an album, pick again, find out your top 10


Release procedure
This a quick checklist to run through when we’re preparing for a new release.
Core dependencies
The following packages must be updated to the same version as Lookyloo.
For example, if the lookyloo release is v1.8.0
their version must be v1.8.X
.
The last digit will mainly be used for bug and security fixes, but it might also be
used for new features.
Bump versions
Across all the packages, bumping version means the following:
-
Edit
pyproject.toml
, keyversion
to the version you want. Example:1.8.0
. -
Edit
setup.py
, keyversion
to the next development version. Example:1.9-dev
. -
Run
poetry update
to update all the dependencies. -
Commit and push.
-
Wait for the continuous integration to finish, fix the code if needed.
-
Tag and sign the last commit. Example:
git tag -s v1.8.0
. -
Push the tags with
git push --tags
.
Lookyloo
The release process will be very similar to the core dependencies, but with a few additions
Bump version
-
Edit
pyproject.toml
:-
Bump the key
version
to the version you want. Example:1.8.0
. -
Bump the required version of the core dependencies to the new release. Example:
^1.8
.
-
-
Edit
setup.py
, keyversion
to the next development version. Example:1.9-dev
. -
Run
poetry update
to update all the dependencies.-
Note: The packages for the core dependencies may not be available immediately, if you see an error, go get a glass of water and try again in 5 min.
-
-
Update the 3rd party dependencies used in the website:
-
Check the latest release of DataTables
-
Check the latest release of D3.js
-
If needed, update
tools/3rdparty.py
accordingly -
Run
tools/3rdparty.py
-
Run
tools/generate_sri.py
-
Make sure to restart and check if the website is still working as it should.
-
-
Commit and push.
-
Wait for the continuous integration to finish, fix the code if needed.
-
Tag and sign the last commit. Example:
git tag -s v1.8.0
. -
Push the tags with
git push --tags
.


Note: All of the information on this website is correct as of January 1st, 2018
As an avid sports fan and someone who regularly participates in team sports (mainly basketball), over the years, I have developed an enthusiasm towards
brands who are at the pinnacle of today's activewear and performance based products. One brand in particular that I have supported for many years
and is taking the sports and fitness world by storm is Under Armour. Not only has Under Armour continued to raise the bar with every single product launch
since its founding in 1996, but it has also done a magnificent and praiseworthy job in scouting the next wave of elite sports talent, and offering them sponsorship deals.
Personally, I highly enjoy watching Under Armour athletes such as Stephen Curry of the Golden State Warriors, as well as newly signed rookie sensation Dennis Smith Jr.
I am also a very big fan of the Under Armour Association (UAA), which is Under Armour's basketball AAU circuit, tailored towards the top high school players.
Some of my favorite NBA players who played for the UAA in the past include Milwaukee Bucks player Thon Maker, and Phoenix Suns Forward Josh Jackson,
who was selected as the fourth pick of the 2017 NBA draft by the Phoenix Suns.
With all that being said, I wanted to develop a website that displays the great diversity of Under Armour athletes and showcases the talent that separates
UA from other competitor brands. This site serves as a database containing an ever-growing list of astounding athletes that are a part of the Under Armour family.
In the "Home" page, you will find a list of Under Armour athletes on which you can click on any of the names to learn more about that particular athlete.
Furthermore, in the "Gallery" page, you will find some of my personal favorite pictures of some UA athletes and products.
Enjoy!


“People assume that time is a strict progression of cause to effect,
but *actually* from a non-linear, non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stuff.” - The Doctor, "Blink"
| Episode Name | Writer Name | Doctor Number | Edit |
|---|---|---|---|
| Blink | Moffat | 10 | Edit |


Gambler's Fallacy Dice Roller
One night I was playing Settlers of Catan with my family, and a series of lucky rolls brought me from 4 points to 10 points in only 3 turns, thus winning the game. That wasn't very fun, for me or for the other players.
That's why I wrote a dice roller that respects the
Gambler's Fallacy. Numbers that have been rolled recently will be less likely to roll again, and numbers which have not been rolled recently will be more likely to roll. This should help to prevent a lucky streak that favors some players, reducing the amount that the players must rely on chance in order to win.
INSTRUCTIONS
You can press enter or spacebar to roll the dice.
You can click on the "Weight factor" to tweak it. The weight factor controls how heavily a number gets penalized after it is rolled. A large weight means that a number that has been recently rolled is much less likely to roll again.
GAME DESIGN NOTES
Some games use random elements to drive the mechanics of the game. Settlers of Catan is a good example, resources are delivered to players based on the results of a 2d6 die roll. Settlers is a great game, but sometimes the random number mechanic that drives the game causes a bit of grief. Sometimes a player will have a settlement on a number that should be commonly rolled, but the the dice just happen not to roll that number. I'm assuming that Settlers was intended to be more a game about skill than a game of chance, and so lucky streaks that deliver one player an advantage or disadvantage are undesireable to the game designer.
I've played more than one game of Settlers where one player feels cheated that their number hasn't come up. I vaguely remember a talk by Sid Meier where he discussed the random number generator that powered the battles in one of his iterations of Civilization, and it had a similar problem. Players would be frustrated when a battle that they had 80% chance to win (for example) would be lost 2 or 3 times in a row. While it's unlikely for that to happen, it's bound to happen sometime, to at least one of your players, and the more a player plays your game the more likely it is to happen. As a designer,
you can never be sure what your random number generator is going to do, and sometimes it may ruin the experience for the player. That's where a "fairer" generator, such as this one, can improve a game's design.
Klaus Teuber, the designer of Settlers of Catan, solved the problem using
a deck of cards. It's perhaps a simpler solution, but my roller is more mathy and more free. :)
This roller has up an interesting side-effect. If players know that the odds change given previous rolls, they may change their behavior. The player that knows that a rare roll is "due" may ignore the odds and act more boldly than she otherwise would have.
MATHEMATICS NOTES
Suppose I flip a coin and keep track of the number of heads and tails. The law of large numbers states that as the number of flips increases, the proportion of heads to tails tends towards 50% heads and 50% tails. However, there's no guarantee that the difference between the number of heads and the number of tails will trend towards 0. If I flip the coin two million times and I get 1,000,050 heads and 999,950 tails, that's 50.0025% heads, but still a difference of 100 more heads than tails. The law of large numbers doesn't guarantee that tails will ever catch up, and in fact, the longer the simulation runs the less likely tails is to catch up to heads.
This dice roller changes that by making tails more likely to be rolled heads has been rolled more often in the past. Thus, tails is likely to catch up to heads since its probability is greater. Once tails has caught up to heads, the probability goes back to 0.50. You can try it yourself if you put 1d2 into the roller. In tests of large numbers of rolls, for example 10,000 2d6 rolls, the number of 2's is never more than 1 or 2 different than the number of 12's, and often they are the same.