class: center, middle, inverse, title-slide # Lecture 7 ## Dynamic Discrete Choice Models ### Tyler Ransom ### ECON 6343, University of Oklahoma --- # Attribution Many of these slides are based on slides written by Peter Arcidiacono. I use them with his permission. --- # Plan for the day 1. Optimal Stopping Problems 2. Finite Horizon Problems - backwards recursion - expectations over how the observed states transition - calculation of expected future utility 3. Infinite Horizon Problems - Solving a fixed-point problem - Rust (1987) bus engine problem --- # Optimal stopping - Today we'll get back to the dynamic models we discussed a few weeks ago - To start with, let's discuss the theory of .hi[optimal stopping] - Gives mathematical context for maximizing rewards or minimizing costs - Optimal stopping problems are by definition dynamic --- # Examples of optimal stopping problems - Many economic problems involve some sort of optimal stopping: - The Secretary Problem (when to hire from a sequence of job candidates) - Seach theory more generally (job search, spousal search, house search, ...) - "Buy/sell/hold" problems (e.g. stock/options trading) - Replacement problems (e.g. infrastructure) - Optimal stopping problems inherently have a tension between costs and benefits: - It is costly to interview job candidates - But it is also costly to miss out on the best candidate --- # Mathematics of optimal stopping - In a discrete choice setting, .hi[dynamic programming] is the best solution method - Within a discrete choice setting, time can be either continuous or discrete - If continuous time, use Hamiltonians and Differential Equations - If discrete time, use recursive methods - Solution method also depends on the time horizon - If the time horizon is finite, then we can use dynamic programming - If the time horizon is infinite, then need to (also) solve for a fixed point - We will discuss these details today --- # Finite horizon problems - Individual `\(i\)`'s .hi[flow utility] for option `\(j\)` at time `\(t\)` is: `\begin{align*} U_{ijt}&=u_{ijt}+\epsilon_{ijt}\\ &=X_{it}\alpha_j+\epsilon_{ijt} \end{align*}` - `\(i\)` chooses `\(d_{it}\)` to maximize her .hi[expected lifetime utility] `\begin{align*} \max \mathbb{E}\sum_{\tau=t}^T\sum_{j}\beta^{\tau-t}1\left[d_{it}=j\right]U_{ijt}\left(X_{it},\epsilon_{ijt}\right) \end{align*}` --- # Expectations and assumptions - `\(i\)` takes expectations over `\(X\)`'s (future states) and `\(\epsilon\)`'s (future errors) - `\(\epsilon\)`'s are assumed to be iid over time - Future states are not affected by `\(\epsilon\)`'s except through choices: `\begin{align*} \mathbb{E}(X_{t+1}|d_t,...,d_1,\epsilon_t,...,\epsilon_{1})&=\mathbb{E}(X_{t+1}|d_t,...,d_1) \end{align*}` --- # Two-period example - Consider the utility of choice `\(j\)` in the last period: `\begin{align*} U_{ijT}&=u_{ijT}+\epsilon_{ijT}\\ &=X_{iT}\alpha_j+\epsilon_{ijT} \end{align*}` - Define the .hi[conditional valuation function] for choice `\(j\)` as the flow utility of `\(j\)` minus the associated `\(\epsilon\)` plus the expected value of future utility conditional on `\(j\)`: `\begin{align*} v_{ijT-1}&=u_{ijT-1}+\beta \mathbb{E}\max_{k\in J}\left\{u_{ikT}+\epsilon_{ikT}|d_{iT-1}=j\right\} \end{align*}` where `\(\beta\)` is the discount factor - Suppose `\(X_{iT}\)` was deterministic given `\(X_{iT-1}\)` and `\(d_{iT-1}\)` and the `\(\epsilon\)`'s are T1EV - What would the `\(\mathbb{E}\max\)` expression be? --- # When Dynamics Don't Matter - As in static models, we need to normalize with respect to some alternative - Suppose we normalize with respect to `\(j'\)`: `\begin{align*} v_{ijT-1}-v_{ij'T-1}&=u_{ijT-1}+\beta \mathbb{E}\max_{k\in J}\left\{u_{ikT}+\epsilon_{ikT}|d_{iT-1}=j\right\}-\\ &\phantom{\text{-}-}u_{ij'T-1}-\beta \mathbb{E}\max_{k\in J}\left\{u_{ikT}+\epsilon_{ikT}|d_{iT-1}=j'\right\} \end{align*}` - If the two expected future value terms are equal, we get a cancellation `\(\implies\)` choices have to (at least probabilistically) affect the future states - The simplest way to satisfy this condition is to have switching costs in the model - Intuition: switching costs make one think carefully about changing course --- # Finite Horizon Dynamics In period `\(T-1\)` we have: `\begin{align*} v_{ijT-1}=u_{ijT-1}+\beta \mathbb{E}\max_{k\in J}\left\{u_{ikT}+\epsilon_{ikT}|d_{iT-1}=j\right\} \end{align*}` Rolling back one more period, `\begin{align*} v_{ijT-2}=u_{ijt}+\beta \mathbb{E}\max_{k\in J}\left\{v_{ikT-1}+\epsilon_{ikT-1}|d_{iT-2}=j\right\} \end{align*}` Keep going back and the `\(\mathbb{E}\max\)` operator can always be expressed as functions of the next period conditional value functions: `\begin{align*} v_{ijt}=u_{ijT-2}+\beta \mathbb{E}\max_{k\in J}\left\{v_{ikt+1}+\epsilon_{ikt+1}|d_{it}=j\right\} \end{align*}` Another name for `\(\max_{k\in J}\left\{v_{ikt+1}+\epsilon_{ikt+1}\right\}\)` is.... --- # Stochastic `\(X\)`'s - Let `\(f_{jt}(X_{it+1}|X_{it})\)` be the pdf associated with moving from `\(X_{it}\)` to `\(X_{it+1}\)` given choice `\(j\)` at time `\(t\)` .hi[Example:] suppose we were interested in Covid on OU's campus. The choice set is {close campus, open campus but online classes, in-person classes}. The transitions on the `\(X\)`'s would be the Covid case (or fatality) counts associated with each of the choices. Since these Covid case probabilities do not depend on the `\(\epsilon\)`'s, it is convenient to integrate them out of the future utility term The conditional value function is then: `\begin{align*} v_{jt}(X_{it})&=u_{jt}(X_{it})+\beta \int_{X_{it+1}}\mathbb{E}_{\epsilon}\left\{\max_{k\in J} v_{kt+1}(X_{it+1})+\epsilon_{ikt+1}\right\}dF_{jt}(X_{it+1}|X_{it}) \end{align*}` --- # Stochastic `\(X\)`'s 2 If the `\(\epsilon\)`'s are distributed Type 1 extreme value, what is the expression for the conditional value function? What about the general GEV case? We can then start at the last period and work our way backwards to obtain all of the relevant conditional value functions --- # Choice Probabilities - The choice probabilities are then calculated in the same way as in the static case - The only difference is now we use `\(v\)`'s instead of `\(u\)`'s - In the multinomial logit case we have: `\begin{align*} p_{jt}(X_{it})&=\frac{\exp(v_{jt}(X_{it}))}{\sum_{k\in J}\exp(v_{kt}(X_{it}))} \end{align*}` --- # Estimation - The likelihood of the data is: `\begin{align*} \mathcal{L}(\alpha,\beta,\gamma)&=\prod_i\prod_t\prod_j\left[p_{jt}(X_{it},\alpha,\beta,\gamma)f_{jt}(X_{it+1}|X_it,\gamma)\right]^{d_{it}=j} \end{align*}` where `\(\gamma\)` governs the transitions of the `\(X\)`'s - The log likelihood is then given by: `\begin{align*} \ell(\alpha,\beta,\gamma)&=\sum_i\sum_t\sum_j (d_{it}=j)\left\{\ln[p_{jt}(X_{it},\alpha,\beta,\gamma)]+\ln[f_{jt}(X_{it+1}|X_it,\gamma)]\right\} \end{align*}` Since the log likelihood function is additively separable, we can estimate `\(\gamma\)` in a first stage --- # Infinite Horizon `\begin{align*} v_{j}(X_{i})&=u_{j}(X_{i})+\beta \int_{X'}V(X')dF_{j}(X'|X_{i})\\ &=u_{j}(X_{i})+\beta \int_{X'}E_{\epsilon'}\left(\max_{k\in J} v_{k}(X')+\epsilon'_{ik}\right)dF_{j}(X'|X_{i})\\ \end{align*}` which in the Type 1 extreme value case for the `\(\epsilon\)`'s yields: `\begin{align*} v_j(X_i)=u_j(X_i)+\beta\int_{X'}\ln\left(\sum_{k\in J}\exp[v_{k}(X')]\right)dF_j(X'|X_i)+\beta c \end{align*}` Now, stack the conditional value functions for each possible state and choice. Because the `\(v\)`'s are on both sides of the stacked equations, we need to solve for a fixed point (This works because it is a contraction mapping) --- # Infinite Horizon 2 Let `\(\mathcal{X}\)` denote the number of states `\(X\)` can take on The stacked equations are then: .smallest[ `\begin{align*} \left[\begin{array}{c}v_1(X_1)\\ v_1(X_2)\\ \vdots \\ v_1(X_{\mathcal{X}})\\ \vdots\\ v_{J}(X_{\mathcal{X}})\end{array}\right]= \left[\begin{array}{c}u_1(X_1)+\beta\int_{X'}\ln\left(\sum_{k\in J}\exp[v_{k}(X')]\right)dF_1(X'|X_1)+\beta c\\ u_1(X_2)+\beta\int_{X'}\ln\left(\sum_{k\in J}\exp[v_{k}(X')]\right)dF_1(X'|X_2)+\beta c\\ \vdots\\ u_1(X_{\mathcal{X}})+\beta\int_{X'}\ln\left(\sum_{k\in J}\exp[v_{k}(X')]\right)dF_1(X'|X_{\mathcal{X}})+\beta c\\ \vdots\\ u_J(X_{\mathcal{X}})+\beta\int_{X'}\ln\left(\sum_{k\in J}\exp[v_{k}(X')]\right)dF_J(X'|X_{\mathcal{X}})+\beta c\\ \end{array}\right] \end{align*}` ] - Plug in values for the parameters and take a guess at the `\(v\)`'s - Substitute in for the `\(v\)`'s on the right hand side which gives us a new set of `\(v\)`'s - Repeat until convergence --- # Optimal stopping in Rust (1987) - Rust analyzes the decision to replace a bus engine `\((d=1)\)` or not `\((d=0)\)` - How is this an optimal stopping problem? - The maintenance superintendent ([Harold Zurcher](https://twitter.com/haroldzurcher87)) wants to minimize costs - But he also doesn't want buses to break down while in service - Premature replacement can be very costly, but so is in-service breakdown - The goal is then to figure out when to optimally replace engines - Especially when some buses might happen to get driven more than others --- # Rust (1987) - Replacement decision depends upon the mileage on the engine, `\(x\)`, the cost of replacing the engine `\(\overline{P}\)` and the scrap value of the current engine `\(\underline{P}\)` - The payoffs net of the error term are given by: `\begin{align*} u_0(x_i,\theta)&=-c(x_i,\theta)\\ u_1(x_i,\theta)&=-[\overline{P}-\underline{P}+c(0,\theta)] \end{align*}` - Mileage is discrete and transitions according to some process `\(f(x_{t+1}|x_t)\)` - Example: some probability of staying at the current mileage, some probability of moving up one mileage state and some probability of moving up two mileage states --- # Estimation 1. Calculate the mileage transitions, i.e. get `\(f(x_{t+1}|x_t)\)` 2. Maximize the log likelihood of the choices: `\begin{align*} \ell(\theta)=\sum_i\sum_t \sum_j (d_{it}=j)\ln(p_{jt}(x_{it},\theta)) \end{align*}` 3. Within the maximization routine, solve a fixed point problem in the `\(v\)`'s each time the log likelihood function is evaluated - For your problem set, I'll walk you through how to estimate a model similar to Rust's --- # Nested Fixed Point (NFXP) Algorithm .center[ <img src="https://editorialexpress.com/jrust/nfxp.gif" width="50%" /> Source: https://editorialexpress.com/jrust/nfxp.html ] --- # References .smaller[ Rust, J. (1987). "Optimal Replacement of GMC Bus Engines: An Empirical Model of Harold Zurcher". In: _Econometrica_ 55.5, pp. 999-1033. URL: [http://www.jstor.org/stable/1911259](http://www.jstor.org/stable/1911259). ]


A customer is required.
A taxi is required.
A flight is required.
A hotel is required.
Please enter a valid booking date.
Booking dates must be in the future.


Custom nuts¶
>>> from nutsflow import *
Cheat sheet¶
A quick overview on how to create custom nuts.
nut_function¶
input: single element
output: single element
note: number of elements in the data flow does not change
@nut_function
def Inc(element, by):
return element + by
>>> Range(3) >> Inc(2) >> Collect()
[2, 3, 4]
nut_processor¶
input: iterable
output: iterable (preferably a generator)
note: number of elements in the data flow may change
@nut_processor
def MyClone(iterable, n): # more outputs than inputs
for e in iterable:
for _ in range(n):
yield e # generator!
>>> Range(3) >> MyClone(3) >> Collect()
[0, 0, 0, 1, 1, 1, 2, 2, 2]
@nut_processor
def MyPick(iterable, n): # less outputs than inputs
for i, e in enumerate(iterable):
if i % n == 0:
yield e
>>> Range(9) >> MyPick(3) >> Collect()
[0, 3, 6]
@nut_processor
def Odd(iterable):
return (e for e in iterable if e % 2) # return <generator>!
>>> Range(9) >> Odd() >> Collect()
[1, 3, 5, 7]
nut_filter¶
input: single element
output: single element
note: number of elements in the data flow may change
@nut_filter
def InInterval(element, a, b):
return a <= element <= b
>>> Range(10) >> InInterval(3, 6) >> Collect()
[3, 4, 5, 6]
nut_source¶
input: None
output: iterable
note: no input, must be at start of data flow
@nut_source
def MyRange(n):
return range(1, n+1)
>>> MyRange(3) >> Collect()
[1, 2, 3]
nut_sink¶
input: iterable
output: any
note: processes/collects all data, should be at end of flow
@nut_sink
def ToFmtList(iterable, fmt):
return [fmt % e for e in iterable]
>>> Range(3) >> ToFmtList('%02d')
['01', '02', '03']
Basics & Examples¶
nuts-flow can easily be extended with custom nuts using wrappers, decorators or derived classes. To clarify the differences between the approaches let us start with a simple filter. First, import nutsflow
>>> from nutsflow import *
then define a lambda
function that returns True
for elements
greater than five
>>> greater_than_5 = lambda x: x > 5
and finally filter numbers using Filter
and the defined lambda
predicate
>>> Range(10) >> Filter(greater_than_5) >> Collect()
[6, 7, 8, 9]
By wrapping the lambda function via nut_filter
, alternatively a custom
filter nut can be created
>>> GreaterThan5 = nut_filter(lambda x: x > 5)
that operates the same way but can be directly used as a nut
>>> Range(10) >> GreaterThan5() >> Collect()
[6, 7, 8, 9]
Note the change from lowercase for greater_than_5
to uppercase
for GreaterThan5
to signify the change from a Python function
to a nuts-flow nut. This is strongly recommended to avoid
confusion on how to use a function or nut. Nuts are generally
in uppercase and invoked with brackets while Python functions are
in lowercase, without brackets and passed on as parameters to nuts.
For instance, both of the following examples are invalid. Here
greater_than_5
is confused as nut and invoked with brackets
instead of being passed as a value to Filter
>>> Range(10) >> Filter(greater_than_5()) >> Collect()
Traceback (most recent call last):
...
TypeError: <lambda>() takes exactly 1 argument (0 given)
Similarily in the following example GreaterThan5
is invoked
without brackets
>>> Range(10) >> GreaterThan5 >> Collect()
Traceback (most recent call last):
...
TypeError: unsupported operand type(s) for >>: 'Range' and 'type'
Wrappers such as nut_filter(...)
are suitable for simple one-line
functions with a single parameter but become less readable when
additional parameters are required, e.g. filtering with a given threshold
GreaterThan = nut_filter(lambda x, threshold: x > threshold)
Range(10) >> GreaterThan(5) >> Collect()
In this case decorators are a better solution
@nut_filter
def GreaterThan(x, threshold):
return x > threshold
Range(10) >> GreaterThan(5) >> Collect()
Invokation vs definition¶
Note that for wrappers and decorators there is a difference in the arguments depending on whether the nut is defined or invoked
definitions:
GreaterThan = nut_filter(lambda x, threshold: ...)
@nut_filter
def GreaterThan(x, threshold): ...
invokation:
x >> GreaterThan(threshold)
When invoked the first argument of the nut (here x
) appears as input
on the left side of the >>
operator and the remaining parameters
appear in brackets.
In rare (more advanced) cases custom nuts can be implemented
as classes derived from the relevant base classes (see base.py
).
Here an example implementation of the GreaterThan
nut as a class
class GreaterThan(Nut):
def __init__(self, threshold):
self.threshold = threshold
def __rrshift__(self, iterable): # >> operator
for x in iterable:
if x > self.threshold:
yield x
However, decorators and wrappers are shortcuts to create nut classes and the preferred method to implement custom nuts.
Nut types¶
nuts-flow provides six different types of wrappers/decorators
nut_source¶
Typical cases for custom nut sources are the reading of files
in specific formats or wrappers around databases. Here
two toy examples for a wrapper and a decorator around a nut
that generates n
even numbers. First the wrapper approach
>>> EvenNumbers = nut_source(lambda n: (2*x for x in range(n)))
and here the decorator version
@nut_source
def EvenNumbers(n):
return (2*x for x in range(n))
Both can be used as follows
>>> EvenNumbers(4) >> Collect()
[0, 2, 4, 6]
nut_sink¶
Sinks receive an iterable and can return any result (not necessarily
an iterable). The following example re-implements the Join
sink
that already exists in nuts-flow using a wrapper
>>> Join = nut_sink(lambda it, sep: sep.join(map(str, it)))
>>> Range(5) >> Join(':')
'0:1:2:3:4'
or using the decorator method
@nut_sink
def Join(iterable, sep):
return sep.join(map(str, iterable))
Note that while Join
is a sink it returns an iterable (here a string)
and can therefore serve as input to other nuts
>>> Range(5) >> Join(':') >> Count()
9
The general rule is, if a nut collects/aggregates data in memory or does not return an iterable result, it should be implemented as a sink (despite being able to be input to other nuts). On the other hand, if a nut processes data on-the-fly and returns an iterator it should not be a sink.
nut_function¶
A nut function is a nut that is applied to each element in the data
flow and returns a result for each element. Consequently, when a nut
function is applied to a data flow the values of the elements change but
not their number. The following example function multiplies each element of
the data flow by n
>>> Times = nut_function(lambda x, n: x * n)
and here the same function via a decorator
@nut_function
def Times(x, n):
return x * n
Usage is identical for both the wrapper and the decorator
>>> Range(5) >> Times(2) >> Collect()
[0, 2, 4, 6, 8]
nut_processor¶
A nut processor takes an iterable and returns an iterable but the
number of elements in the output iterable can differ - this is different
to a nut_function. If the numbers don’t change both methods
can be used but a nut_function will be simpler. For instance,
here the Times
nut re-implemented as a processor:
>>> Times = nut_processor(lambda iterable, n: (x * n for x in iterable))
Processors are needed if the number of elements in the flow changes, e.g. here a processor nut that duplicates each element of the flow
@nut_processor
def Duplicate(iterable):
for e in iterable:
yield e
yield e
Range(5) >> Duplicate() >> Collect()
[0, 0, 1, 1, 2, 2, 3, 3, 4, 4]
or more generic, a processor that clones each element n
times
@nut_processor
def Clone(iterable, n):
for e in iterable:
for _ in range(n):
yield e
Range(5) >> Clone(2) >> Collect()
[0, 0, 1, 1, 2, 2, 3, 3, 4, 4]
Processors can be used to filter elements from a data flow but typically the filter nuts described next are more appropriate and easier to implement.
nut_filter¶
As described above, nut filters extract elements from a data flow. Here a nut that extracts all numbers that are in a given interval
>>> InInterval = nut_filter(lambda x, a, b: a <= x <= b)
and the same filter implemented using the decorator
@nut_filter
def InInterval(x, a, b):
return a <= x <= b
and how it is used
>>> Range(10) >> InInterval(3, 6) >> Collect()
[3, 4, 5, 6]
nut_filterfalse¶
Occasionally it is easier to implement a filter that extracts
element that are not meeting a given condition. The
nut_filterfalse
wrapper/decorator is available for this
use case. For instance, the following nut filters out all
elements that are not equal to given value
>>> Not = nut_filterfalse(lambda x, val: x == val)
or implemented via the decorator
@nut_filterfalse
def Not(x, val):
return x == val
and a usage example
>>> [1, 2, 3, 4] >> Not(2) >> Collect()
[1, 3, 4]
nut_filterfalse
is largely used to wrap existing predicate
functions as nuts. For example, given a function isnull(x)
we can simply write
IsValid = nut_filterfalse(isnull)
which is shorter and more readable than
IsValid = nut_filter(lambda x: not isnull(x))


Dear New User,
You have been granted access permission to the Vote Leave campaign software, VICS. To login please go to https://vics.voteleave.uk. To see the tutorial please go to http://bit.do/VICSCanvassing.
If you have questions about use please contact your Regional Director or Constituency Coordinator or use the chat window on the website.
Username: %s
Password: %s


Turn HackeyBlock on or off?
It can be really irritating when you try to find something innocent and get accidentally on a site serving adult content. With this blocking list, this won't happen ever again.
Turn adult content blocking on
Turn adult content blocking off
Save


Pikesio_728x90_Top
Join the Beta!
Have several web pages that you need to track their pagespeed performance?
Let Pagespeed Tracker do that for you!
Pikesio_336x280_Left
How does it work?
- Enter your list of web pages that you want to track their pagespeed performance. (Limited to 100 pages for beta)
- Select frequency of your report: daily, weekly, monthly
- You got covered! We'll send you tailored reports about pagespeed performance of your pages, and suggestions to improve them.
Pikesio_336x280_Right
How much does it cost?
For now, free for beta users!


They told me professional wizards don't exist, so I chose game developer instead.
I want to convey my thoughts, ideas and feelings to others.
Plz don't sue me CAH
I make video games because .
Plz don't sue me CAH
Made 2/10 Phaser games.
Made 0/10 Unity games.
Arcade mashup built with Phaser.
Turn based strategy built with Phaser.
First person shooter built with CryEngine.
"A delayed game is eventually good, a bad game is bad forever."
This is a parametric equation I ended up with after bringing a two dimensional parametric equation into three dimensional homegeneous coordinates. To bring it back to two dimensions, divide X by Z and Y by Z. I may have messed up during the conversion... Anyways, click on the wolfram alpha icon for the answer or the wikipedia icon for more on homogeneous coordinates.
Snakesteroids is a mashup of two classic arcade genres. I combined the movement of asteroids and the rules of snake. The player controls a white spaceship using the arrow keys. They must gather white circles while avoiding pursuing red spaceships that perfectly follow the player's route. Initially made in 2 days for Mini Ludum Dare #67.
Overpopulate is a turn based strategy/board game. The idea is that both players must expand their territory to avoid overpopulating their land. Both players' choices are treated as happening at the same time. The goal is to outsurvive your opponent. This was my Mini Ludum Dare #69 submission made in 2 buggy sleepless days. There were several submissions at the time regarding the evils of colonization so I wanted to convey that perhaps colonization is caused by less evil intentions. Given perfect co-operation or just the fiercest aggression from both players, the game can easily end in a tie. In retrospect, I should probably have used a more understandable user interface. Perhaps give each player a set of cards to play that represent their moves and revealing the cards when both players are finished. If the embedded time doesn't work, skip to 6:38.


Ticket ID: 409788
Name:
Parker Seidel
No Active Support
Email:
<EMAIL_ADDRESS>Response Time:
72hours, 60hours left
Last Action:
Never been locked.
Link public post
Status:
Not answered


--- layout: post title: 'Ticking Time Bomb: Children''s Shoes Cause Health Problems Later in Life for Adults' date: 2011-05-17 13:08:53.000000000 +01:00 tags: - shoes - quickie - link - children type: post published: true ---
For a long time I've thought putting kids in shoes too much and too soon is wrong. I spent a lot of my childhood completely barefoot as it's the norm in South Africa. Looks like forcing your kids to wear shoes may have a long term impact on their health and development.


--- layout: post title: Ducks On Our Pool categories: [] tags: - family - home status: publish type: post published: true meta: _original_post_id: '' _original_import_author: John Duprey author: ---
We seem to have a pair of ducks living somewhere on or near our back yard. They like our pool a little too much.


JavaUtil
/
de.mrapp.util.datastructure
/
Triple
/
third
third
val
third
:
T
?
The third object
Property
third
- The third object
Author
Michael Rapp
Since
1.0.0


Modern Javascript Tools
Something important
This is an important paragraph.
List of Stuff
pizza
cars
shoes
cigars
presidents


Great Expectations
It was indeed with great expectation that I looked forward to seeing this newest version of Dickens' classic story. In the past there have been several films that with varying success tried to capture that great work. 52 years ago, with a great cast consisting in part of John Mills, Alec Guiness, Valerie Hobson, and Jean Simmons, David Lean directed perhaps the best of all.. In 1988, BBC did an admirable TV version. A year later, there was an excellent mini-series made in Britain that starred Anthony Hopkins, Jean Simmons, John Rhys-Davies, Ray McAnally, and Kim Thompson, directed by Kevin O'Connor. Pretty much of a disaster was the 1983 animated version directed by Jean Tych. ThE 1987 GREAT EXPECTATIONS ---THE UNTOLD STORY was the worst of all.
We come now to this new attempt.. Perhaps taking a cue from the modern Romeo and Juliet of 2 years ago, the well-known producer Art Linson decided to make an updated GREAT EXPECTATIONS. A big mistake. Too many changes had to be made in the plot so that it no longer resembled the Dickens work. Despite that the credits list "Based On The Charles Dickens classic" or words to that effect,. Dickens would have been horrified with the result.
Perhaps the only element common to both the book and the current film scripted by Mitch Glazer, is that both rely on the themes of trying to obtain respect, the aspect of coincidence, and wanting things one could not have. While the Dickens story is very much concerned with the conflict between the rich and the poor, the commoner and the aristocracy, Glazer opted to delete that part "because it didn't have to be about that at all." Really?!?
As screenwriter Glazer did not want to do a literal remake of the novel (Then why use the book's name? Why say "based on the book by Dickens?) he even changed the names of all the characters except for Estella. One of the charms of reading Dickens is the unique names he gave his characters. Glazer did not think "Magwitch" and "Miss Haversham" were suitable names for this version.
The story, you will recall, is of an 8-year-old, Finn Bell becoming a man (Ethan Hawke), his life being changed by three people. They are convict Lustig (Robert De Niro) and Ms. Dinsmoor (Anne Bancroft) and Estella (Gwyneth Paltrow.)
When the young Finn (Jeremy James Kissner) meets the beautiful Estella (Raquel Beaudene), they are both 10-years-old. Ms. Dinsmoor warns Finnegan that Estella will break his heart and even if he is warned, he will pay no heed. And that is what happens. She runs off with someone else; he turns to painting and becomes famous. The film ends in a corny and unbelievable scene.
De Niro is the one redeeming feature. Others in the cast include Hank Azaria, Chris Cooper, Josh Mostel, Kim Dickens.
Directed by Alfonso Cuaron.
1.5 Bytes
4 Bytes = Superb 3 Bytes = Too good to miss 2 Bytes = Average 1 Byte = Save your money
Copyright 1998 Ben Hoffman
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


The problem can be solved with different approaches. A simple idea is of course brute-force -- try all possible elevations and find the minimum amount. We can try all possible values as follows: try the modification for elevation interval (0,17) then (1,18), (2,19), ..., (83,100). For each elevation interval (i,i+17), we need to calculate the cost for each hill j:
The total cost for that interval will be the sum of the costs of modifying all hills.
For the sample input:
hill elevation intervals and cost height (0,17) (1,18) (2,19) (3,20) (4,21) (5,22) (6,23) (7,24) .... ------ --------------------------------------------------------------- 1 0 0 1 4 9 16 25 36 4 0 0 0 0 0 1 4 9 20 9 4 1 0 0 0 0 0 21 16 9 4 1 0 0 0 0 24 49 36 25 16 9 4 1 0 ------------------------------------------------------------- total 74 49 31 21 *18* 21 30 45
As you observed, it is unnecessary to try elevation intervals after (7,24) since the maximum height is 24. You may want to modify the solution to eliminate these type of redundancies although it is not necessary.
For each interval, scanning through all hill elevations require O(N) time. Since we try all possible intervals, the total time is O(NM) where M is the size of the elevation range. Since N=1000 and M=100 are very small, this brute-force approach is sufficient. A sample code is provided below:
#include <fstream> using namespace std; int n,hills[1000]; int main() { ifstream fin("skidesign.in"); fin >> n; for (int i=0; i<n; i++) fin >> hills[i]; fin.close(); // brute-force search // try all elevation intervals from (0,17) to (83,100) int mincost=1000000000; for (int i=0; i<=83; i++) { // calculate the cost for elevation interval (i,i+17) int cost=0,x; for (int j=0; j<n; j++) { // if hill is below the interval if (hills[j]<i) x=i-hills[j]; // if hill is above the interval else if (hills[j]>i+17) x=hills[j]-(i+17); // if hill is int the interval else x=0; cost+=x*x; } // update the minimum cost mincost=min(mincost,cost); } ofstream fout("skidesign.out"); fout << mincost << "\n"; fout.close(); }


Action will be taken against Ajit: Sharad Pawar
Nationalist Congress Party president Sharad Pawar on Saturday said the decision of his nephew Ajit Pawar to join hands with the Bharatiya Janata Party to form a government in Maharashtra was an act of indiscipline and attracts provisions of anti-defection law.
Pawar was addressing a joint press conference with Shiv Sena chief Uddhav Thackeray in Mumbai.
"Ajit Pawar's decision is an act of indiscipline. No NCP worker is in favour of the NCP-BJP government. NCP MLAs who support the BJP should know this move attracts provisions of anti-defection law," he said.
Whenever elections are held in the constituencies of these legislators, Congress-NCP and Shiv Sena would unitedly defeat them, he added.
He said 54 newly-elected legislators of the NCP had signed a paper along with their names and constituencies for internal purpose and these signatures may have been misused as letter of support and submitted to the governor.
"If this is true, the governor has also been misled," Pawar said, adding that the paper may have been taken by Ajit Pawar as the leader of the legislature party.
He said those MLAs, who were taken to the Raj Bhavan for oath-taking without their knowledge, have contacted him and informed how they were misled.
Three such legislators, including Rajendra Shingane from Buldhana and Sandeep Kshirsagar from Beed, were present at the press conference.
They said they were called to party leader Dhananjay Munde's house at 7 am and from there were taken in a car to Raj Bhavan.
Pawar said no action would be taken against those who unknowingly went to Raj bhavan for the swearing-in and were back in the party fold.
NCP legislature party meeting would be held later in the day to elect the new leader.
On the issue of action against Ajit Pawar, the former Union minister said a decision to that effect would be taken by the disciplinary committee.
Uddhav Thackeray said, "Earlier the EVM khel (game) was going on and now this is new khel. From here onwards, I don't think elections are even needed."
"Everyone knows what Chhatrapati Shivaji Maharaj did when betrayed and attacked from the back," he said, adding that Sena workers will foil all attempts to poach party MLAs.


Svitolina sees off late replacement Kenin in straight sets in Shenzhen
SHENZHEN, Nov 1 ― Defending champion Elina Svitolina continued her ominous form at the WTA Finals with a straight-sets victory over late replacement Sofia Kenin today.
The Ukrainian has not lost a set at the round-robin season-finale after recording a 7-5, 7-6 (12/10) win in two hours and 10 minutes at the Shenzhen Bay Sports Centre.
The match was a dead-rubber with Svitolina having already clinched Purple Group’s top spot and she will face Switzerland’s Belinda Bencic in the semi-final tomorrow.
World No.12 Kenin replaced Bianca Andreescu after the US Open champion suffered a knee injury against Karolina Pliskova on Wednesday.
Kenin was the second replacement used at the tournament after Kiki Bertens stepped in for world number three Naomi Osaka, who withdrew due to a shoulder injury.
“I’m happy that I finished the match in two sets,” Svitolina said. “It was a physical match and I had to stay tough.”
Svitolina started sluggishly and dropped her serve in the third game with a double fault. Kenin was impressive, moving Svitolina around the court with precise shots but was unable to serve out the set in the 10th game.
Svitolina made her pay and broke again in the 12th game to draw first blood.
An energetic Kenin played with flair to earn a break in the ninth game in the second set but again struggled closing out the set. She double faulted on set point and was shortly after broken by Svitolina, who won her eighth straight WTA Finals match in a thrilling tiebreak.
The 25-year-old is hoping to end a barren season on a high having not captured a title since last year’s triumph in Singapore.
Pliskova and Wimbledon champion Simona Halep will battle for a semi-final spot later toiday with the winner to face world number one Ashleigh Barty. ― AFP


An R library that enables the creation of data tiles for inclusion in a html dashboard or some such.
To install, please type:
devtools::install_github("DataStrategist/TileMaker", build_vignettes = TRUE)
Please see the Intro Vignette to learn more about how to do some lovely stuff, but in the meantime, here’s the basics:
This package is intended to “highlight single values”, mainly in dashboards, reports or Shiny apps, and is highly customizeable. This is what it looks like:
suppressWarnings(suppressMessages(library(tidyverse,quietly = TRUE)))
library(TileMaker)
a <- solo_box(value = 3, txt = "Little piggies<br>go to the market", icon = "piggy-bank")
b <- solo_gradient_box(value = 65, txt = "test score I got")
c <- solo_gradient_box(value = 95, txt = "test score I wanted")
d <- multi_box(values = c(4, 5, 6), txt = c("Sally", "George", "Mohammed"), icons = c("check", "plus", "calendar"), title = "Candidates")
e <- iris %>%
group_by(Species) %>%
summarize(a = mean(Petal.Length)) %>%
tile_matrix(values = a, txt = Species)
f <- iris %>%
group_by(Species) %>%
summarize(a = mean(Petal.Length)) %>%
mutate(old_a = c(3, 4, 5)) %>%
tile_matrix(data = ., values = a, txt = Species, former = old_a)
d1 <- div_maker(subtitle = "First line", textModifier = "h1", a, b)
d2 <- div_maker(subtitle = "Second line", textModifier = "h1", c, d)
d3 <- div_maker(subtitle = "Boom line", textModifier = "h1", e, f)
finisher(
title = "Important Reportings",
css = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css",
file = NULL,
textModifier = "h1",div_maker(subtitle = "Boom", textModifier = "hi",d1, d2, d3)
)


Chris Mueller
About
Portfolio
Contact
Portfolio
Hangman
RPG Game
Trivia Game
Rutgers Info Widget
Rock Paper Scissors


Accounts, Content and Safety
- You must be at least 13 years or older to use this service.
- You must not use this service to bully, abuse, harass, threaten or intimidate another person or a group.
- You must not impersonate another user.
- You must not use this service to post unwanted, commercial or misleading Content (such as spam) into this site or any associated site.
- You must not post audio/visual Content related to violence or illegal activities.
- You must not post illegal Content (including Content that violates copyright laws).
- You must not post pornographic Content.
- You may not use this service to publish malicious codes.
- You are responsible for the security of your password.
- You're solely responsible for any transfer/sharing of your account.
Services and Data
All Content posted here belong to their respective owners/originators. We're not bound to control or
monitor such Content and we cannot take responsibility for such Content. And we do not claim ANY ownership to
the Content posted by the users. Use and reliance of such Content should be done at your own risk.
We may choose to store, reproduce, modify, host, display, use or terminate Content submitted to our Services
with or without any prior notice. And the Services may be stopped/disconinued/regulated/limited with or without any prior notice.
Privacy
By using our Services, you agree to our
Privacy Policy which governs collection and use of your information
by our Services.
Copyright Protection
We reserve the right to remove Content under any alleged copyright infringement notice, we may also temporarily or
permanantly terminate accounts of infringers without any prior notice.
Account Termination
Certain account termination mechanisms given in our Services may not remove Content that you have posted on
other accounts, Content generated by other users or various parts of the Services in order to keep the validity
of conversations for others. Therefore, you may need to remove those Content manually before account termination.
 And of course, the content in your own profile and the full posts you have made will be deleted or hidden.
These Terms
We may modify these Terms from time to time, you may receive a notice through email or through our
Services about the changes. The latest version of the Terms will be available at
natfie.com/help.terms.
If you do not agree to the modified Terms, you should discontinue to access or use the Services.
The Service is Available "AS-IS"
Your access to and use of the Services and Content is at your own risk. You understand and agree
that the Services and Content are provided to you on an "AS-IS" and "AS-AVAILABLE" basis.
WITHOUT LIMITING THE FOREGOING, WE EXPLICITLY DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. We make no warranty (i) that the Services or Content
will meet your requirements or be available on an uninterrupted, secure, or error-free basis; or (ii) regarding
the quality of any products, services or content or the accuracy, timeliness, truthfulness, completeness or
reliability of any Service Content obtained through the Service. No advice or information, whether oral or written,
obtained from the Services or Content will create any warranty not expressly made herein.

IN NO EVENT WILL NATFIE'S AGGREGATE LIABILITY ARISING OUT OF OR IN CONNECTION WITH THESE TERMS OR FROM THE USE OF
OR INABILITY TO USE THE SERVICE OR SERVICE CONTENT EXCEED FIFTY DOLLARS ($50).  SOME JURISDICTIONS DO
NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, SO THE ABOVE
LIMITATION MAY NOT APPLY TO YOU.


creator
what is choc-oh?
auto scroll example using CNN built using tensorflow js
how to contribute
it is easy
find a bug etc, or suggest a feature
or maybe make this iframe a bit better :)
what do i do?
a student
foss contributor
lot more...
what am i doing currently?
currently i'm filling this page anything
i love food
i love to code
i love to make technology happen
thank you lovely people
for looking into this example <3


Extractor¶
-
class
HystrixBox.Extractors.
Extractor
¶ Bases:
object
A class used to represent a Extractor
-
static
extract
(self, text)¶ Extract specific information from data (text->str) usually by regex
- Parameters
text (str) – The data to read from
- Returns
list of occurrences of the desired information
- Return type
list
- Raises
NotImplementedError – If the extract function not set in the extractor
-
static
Email Extractor¶
-
class
HystrixBox.Extractors.
EmailExtractor
¶ Bases:
HystrixBox.Extractors.Extractor.Extractor
A class used to represent an email extractor
Note
Regex according to RFC 5322
Ip Extractor¶
-
class
HystrixBox.Extractors.
IPExtractor
¶ Bases:
HystrixBox.Extractors.Extractor.Extractor
A class used to represent an Ip extractor
Note
Regex include both IPv4 and IPv6 formats
Md5 (Hash) Extractor¶
-
class
HystrixBox.Extractors.
MD5Extractor
¶ Bases:
HystrixBox.Extractors.Extractor.Extractor
A class used to represent an md5 Hash extractor
Note
Regex include both IPv4 and IPv6 formats
URL Extractor¶
-
class
HystrixBox.Extractors.
URLExtractor
¶ Bases:
HystrixBox.Extractors.Extractor.Extractor
A class used to represent an URL extractor
Note
Regex include prefix http or https, IPv4, IPv6, postfix port and resource path.
All URL with this format:
((?:https?://)?(?:STANDARD_URL|IPv4|IPv6)(?:PORT)?(?:RESSOURCE_PATH)


Hyper
Tube
Home
About
Contact
Sign-In
Sign-up
Login
Nickname/Email
Password
Login
Lost Password
Reset Password
Close
Register
Email
Nickname
Password
Verify Password
First Name
Last Name
Profile Picture
Register
Close


New York gas explosion defendants convicted; blast destroyed ‘Sopranos’ star’s apartment
by Dom CalicchioMaybe their papas never told them about right and wrong.
All three defendants were found guilty of manslaughter, assault and other charges Friday in connection with a gas explosion in New York City that caused the collapse of three buildings -- including one where Drea de Matteo, a star of "The Sopranos," lived.
The March 2015 blast in the East Village section of Manhattan killed two people and resulted from an illegally rigged gas line, authorities said.
“Unbeknownst to the people who were walking down the street, driving down the street, there was a virtual bomb lurking under the East Village,” Assistant District Attorney Randolph Clarke said in his opening statement, according to WABC-TV in New York.
An employee and a customer of a sushi restaurant in one of the buildings were both killed.
A few days after the tragedy, de Matteo, who played Adriana La Cerva on the hit TV show that ran 1999-2007, told the New York Post she was in Los Angeles at the time when a friend called to tell her what happened.
CLICK HERE TO GET THE FOX NEWS APP
“She said, ‘Turn on the TV! Your building’s on fire!” de Matteo told the Post. “I said, ‘You’re out of your freaking mind.’ Then [my children and I] watched our house fall to the ground on television.”
The three men convicted were a building owner, plumber and contractor. They are scheduled to be sentenced in January.
The Associated Press contributed to this story.


[1]
their casino is not very smokey they have a night.
[2]
they get you with a resort fee still only 65 again.


Edit
Edit OK.
Loading...
Title
Alias
Username
Password
Loading...
Notes
Submit
History
Title
Username
Password
Notes
Confirm Deletion
×
Delete this history item? (can not recover)
item:


Louisiana agrees to repay $13M in Medicaid claims settlement
BATON ROUGE, La. (AP) - Louisiana’s health department has agreed to pay the federal government $13 million to settle allegations it submitted false Medicaid claims for nursing home and hospice care.
U.S. Attorney Brandon Fremin announced the settlement Wednesday. It involves claims submitted from 2010 through 2013, during former Gov. Bobby Jindal’s administration.
Federal officials accused the Louisiana Department of Health of asking its health contractor Molina Medical Solutions to submit and pay premature claims for nursing home and hospice services, to take advantage of better federal reimbursement rates.
TOP STORIES
'There will be blood': Maher sees civil war breaking out if we don't 'learn to live with each other'
‘Black Hawk Down’ hero, native of Durand, dies at 64
Justice Department clears Trump of wrongdoing on Ukraine call
Authorities say if the state had waited to submit the claims when the services had been delivered, they would have gotten less federal money to cover them.
Health department spokesman Robert Johannessen says the negotiated repayment is included in this year’s budget.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


... is a legally incorporated foundation with the purpose of preserving the beautiful natural habitat and cultural assets of Sayama Hills and its surrounding areas.
Located about 40km (24 miles) from the Tokyo metropolitan area, in an area overlapping Tokyo and Saitama provinces, Sayama is a lush hill of greenery, encompassing 3500ha (8650 acres) measuring about 11km (6.9miles) East to West, and 4km (2.5miles) North to South. The vast woodland area, which includes two reservoirs, Lake Sayama and Lake Tama still maintain an old-world charm. Seen from above, the Hills resemble a small green island in the middle of a metropolis.
Here, farmland, rice fields, and wetlands, as well as its surrounding woods maintain a timeless look of the past. This type of habitat is called “Satoyama” and has been developed all over Japan with the primary objective of farming. Satoyama is home to a diverse array of life, and has created several unique natural habitats.
In Sayama Hills 1400 types of ferns and other seedling plants, 19 mammals, and over 200 different species of birds have been identified. In addition, 2500 types of insects, as well as frogs, snakes, and salamanders (Hynobius tokyoensis) call this Satoyama its home, making its moniker “The treasure chest of nature” much appropriate.


{%extends 'base.html'%} {%block content%} {%block styles%} {{super()}} {%endblock%}
Click here to subscibe for notifications on new blogs
{{blog.body}}
Add Comment
Delete Blog
{{comment.title}}
{{comment.body}}
Delete Comment


new LinePay(options)
Parameters:
| Name |
Type |
Description |
options |
Object
|
Properties
| Name |
Type |
Attributes |
Default |
Description |
channelId |
String
|
|
|
LINE Channel Id |
channelSecret |
String
|
|
|
LINE Channel secret |
hostname |
String
|
<optional>
|
|
Hostname of LINE Pay API. Nomarlly, it is automatically set depeding on isSandbox parameter. |
isSandbox |
Boolean
|
<optional>
|
false
|
If the environemt is sandbox, set true |
sessionOptions |
Object
|
<optional>
|
|
Option object for express-session. Refer to https://github.com/expressjs/session for detail. |
|
- Source:
Methods
_lossless_converter()
Retriever for lossless_json.parse() to convert overflowed number as string.
- Source:
capture(options)
Method to capture payment
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Description |
transactionId |
String
|
Transaction id returned from reserve API. *While it is described that data type should be number, javascript cannot handle the scale of transactionId so please set string for this parameter. |
amount |
Number
|
Payment amount. |
currency |
String
|
Currency following ISO2117. Supported values are USD, JPY, TWD and THB. |
|
- Source:
checkPreapprovedPay(options)
Method to check the availability of preapproved payment.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Default |
Description |
regKey |
String
|
|
|
Key which is returned in reserve API. |
creditCardAuth |
Boolean
|
<optional>
|
false
|
Set true to execute authorization payment in minimum amount by registered credit card. |
|
- Source:
confirm(options)
Method to confirm payment
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Description |
transactionId |
String
|
Transaction id returned from reserve API. |
amount |
Number
|
Payment amount. |
currency |
String
|
Currency following ISO2117. Supported values are USD, JPY, TWD and THB. |
|
- Source:
confirmPreapprovedPay(options)
Method to confirm preapproved payment
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Default |
Description |
regKey |
String
|
|
|
Key which is returned from reserve API. |
productName |
String
|
|
|
Product name. |
amount |
Number
|
|
|
Payment amount. |
currency |
String
|
|
|
Payment currency. |
orderId |
String
|
|
|
Order id which specified in reserve API. |
capture |
Boolean
|
<optional>
|
true
|
Set true to capture payment simultaneously. |
|
- Source:
expirePreapprovedPay(options)
Method to expire preapproved payment.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Description |
regKey |
String
|
Key which is returned by reserve API. |
|
- Source:
inquireAuthorization(options)
Method to inquire authorization.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Description |
transactionId |
String
|
<optional>
|
Transaction id to inquire. *While it is described that data type should be number, javascript cannot handle the scale of transactionId so please set string for this parameter. |
orderId |
String
|
<optional>
|
Order id to inquire. |
|
- Source:
inquirePayment(options)
Method to inquire payment.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Description |
transactionId |
String
|
<optional>
|
Transaction id to inquire. |
orderId |
String
|
<optional>
|
Order id to inquire. |
|
- Source:
middleware(options)
Middleware to start payment flow.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Default |
Description |
productName |
String
|
|
|
Product name. |
productImageUrl |
String
|
<optional>
|
|
URL of product image. |
amount |
Number
|
|
|
Payment amount. |
currency |
String
|
|
|
Currency following ISO4218. |
mid |
String
|
<optional>
|
|
LINE member ID. |
oneTimeKey |
String
|
<optional>
|
|
One time key. |
confirmUrl |
String
|
<optional>
|
|
URL to transition after the payment approval. Default is CURRENT_PROTOCOL://CURRENT_HOSTNAME/MIDDLEWARE_MOUNT_POINT/confirm |
confirmUrlType |
String
|
<optional>
|
"CLIENT"
|
Confirm URL type. In this middleware, supported values are CLIENT only. |
checkConfirmUrlBrowswer |
Boolean
|
<optional>
|
false
|
If check browser on transitioning to confirm URL. |
cancelUrl |
String
|
<optional>
|
|
URL to transition after cancellation of payment. |
packageName |
String
|
<optional>
|
|
String to prevent phising in Android. |
orderId |
String
|
|
|
Unique id of the order transaction. |
deliveryPlacePhone |
String
|
<optional>
|
|
Contact of payment receiver. |
payType |
String
|
<optional>
|
"NORMAL"
|
Payment type. Supported values are NORMAL and PREAPPROVED. |
langCd |
String
|
<optional>
|
|
Language to display payment pending screen. |
capture |
Boolean
|
<optional>
|
true
|
Set true if like to complete payment right after successful of confirm API call. |
|
- Source:
refund(options)
Method to refund payment
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Description |
transactionId |
String
|
|
Transaction id to refund. |
refundAmount |
Number
|
<optional>
|
Amount to refund. |
|
- Source:
reserve(options)
Method to reserve payment
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Attributes |
Default |
Description |
productName |
String
|
|
|
Product name. |
productImageUrl |
String
|
<optional>
|
|
URL of product image. |
amount |
Number
|
|
|
Payment amount. |
currency |
String
|
|
|
Currency following ISO4218. |
mid |
String
|
<optional>
|
|
LINE member ID. |
oneTimeKey |
String
|
<optional>
|
|
One time key. |
confirmUrl |
String
|
|
|
URL to transition after the payment approval. |
confirmUrlType |
String
|
<optional>
|
"CLIENT"
|
Confirm URL type. Supported values are CLIENT and SERVER. |
checkConfirmUrlBrowswer |
Boolean
|
<optional>
|
false
|
If check browser on transitioning to confirm URL. |
cancelUrl |
String
|
<optional>
|
|
URL to transition after cancellation of payment. |
packageName |
String
|
<optional>
|
|
String to prevent phising in Android. |
orderId |
String
|
|
|
Unique id of the order transaction. |
deliveryPlacePhone |
String
|
<optional>
|
|
Contact of payment receiver. |
payType |
String
|
<optional>
|
"NORMAL"
|
Payment type. Supported values are NORMAL and PREAPPROVED. |
langCd |
String
|
<optional>
|
|
Language to display payment pending screen. |
capture |
Boolean
|
<optional>
|
true
|
Set true if like to complete payment right after successful of confirm API call. |
|
- Source:
voidAuthorization(options)
Method to void authorized payment.
Parameters:
| Name |
Type |
Description |
options |
Object
|
Object which contains parameters.
Properties
| Name |
Type |
Description |
transactionId |
String
|
Transaction id to void. |
|
- Source:


Team MBR
Home
Schedule
Squad
Starter:
First Name:
Last Name
Email
Date of Birth
Jersey Number
Position
Captain:
Save Player
Delete Player
Confirm Deletion


Symbol Index for "Activity To Be Done"
Symbol Index for diagram
"Activity To Be Done"
Abandoned Activity (Class)
Activity State (Class)
Activity To Be Done (Class)
Activity Under Consideration (Class)
Activity/State (Generalization Node)
Agent (Class)
Completed Activity (Class)
Decomposed Activity (Class)
earliest performance start (Association)
for performance start (Association)
Instantiated Activity (Class)
latest performance end (Association)
Location (Class)
Not Required Activity (Class)
Performance Rejected Activity (Class)
Performance Suspended Activity (Class)
Performer Accepted Activity (Class)
Performer Rejected Activity (Class)
Performer Selected Activity (Class)
responsible for progress (Association)
Scheduled Activity (Class)
source for (Association)
Started Activity (Class)
Timepoint (Class)


Question 4 of 10
Analysing 2
You are working on some pipes in the loft of a large building; it is a hot and cramped environment.
The Site Manager has briefly explained what you need to do and has left you to complete the job of fitting the pipes in the loft.
When you get up into the loft you find that some electricians are also in the loft and are fitting wiring.
You need to work out the best way to fit the pipes around the wiring that is currently being fitted.
Choose your approach
Please select an option from the choices above before continuing.


Living systems are characterized by the emergence of recurrent dynamical patterns at all scales of magnitude. Self-organized behaviors are observed both in large communities of microscopic components - like neural oscillations and gene network activity - as well as on larger levels - as predator-prey equilibria to name a few. Such regularities are deemed to be universal in the sense they are due to common mechanisms, independent of the details of the system. This belief justifies investigation through quantitative models able to grasp key features while disregarding inessential complications. The attempt of modeling such complex systems leads naturally to consider large families of microscopic identical units. Complexity and self-organization then arise on a macroscopic scale from the dynamics of these minimal components that evolve coupled by interaction terms. Within this scenario, probability theory and statistical mechanics come into play very soon.
The aim of this conference is to bring together scientists with different backgrounds (maths, biology, physics and computing, theoreticians along with experimentalists), interested in macroecology, microbial ecology and evolutionary biology, to discuss important and recent research topics in these areas as well as exchange methods and ideas. The style of the conference will purposely be informal so as to encourage discussions.
List of topics
- Stochastic population dynamics
- Quantitative and system biology
- Microbial ecology
- Statistical mechanics models in ecology
- Robustness and adaptability of ecosystems
- Evolution in microbial communities
- Biodiversity , coexistence and species interactions
- Microbial metabolism and cross feeding


A matrix of agreement patterns and counts for record pairs is the input for the procedure. An EM algorithm is used to impute plausible values for missing record pairs. A second EM algorithm, incorporating possible correlations between per-field agreement, is used to estimate posterior probabilities that each pair is a true match - i.e. constitutes the same individual.
| Version: | 1.0.0 |
| Depends: | R (≥ 3.2.4) |
| Published: | 2016-10-20 |
| Author: | John Ferguson [aut, cre] |
| Maintainer: | John Ferguson <john.ferguson at nuigalway.ie> |
| License: | CC0 |
| NeedsCompilation: | no |
| CRAN checks: | corlink results |
| Reference manual: | corlink.pdf |
| Package source: | corlink_1.0.0.tar.gz |
| Windows binaries: | r-devel: corlink_1.0.0.zip, r-release: corlink_1.0.0.zip, r-oldrel: corlink_1.0.0.zip |
| OS X binaries: | r-release: corlink_1.0.0.tgz, r-oldrel: corlink_1.0.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=corlink to link to this page.


Relative Link Test This is a relative Intra-Site link in a layout (see link)
Test: Code blocks
Normal fenced code should render correctly
Content in a fenced code block
With syntax coloring should render correctly
<foo>
<bar type="name">goo</bar>
</foo>
codeLineNumbers
option in site.json
should set the global code line numbers behavior (should show line numbers)
<foo>
<bar type="name">goo</bar>
</foo>
line-numbers
class should show corresponding line numbers
<foo>
<bar type="name">goo</bar>
</foo>
no-line-numbers
class should hide corresponding line numbers
<foo>
<bar type="name">goo</bar>
</foo>
start-from
attr should set inline css in
tag, enabling lines to start from a specific line number
*****
-----
highlight-lines
attr causes corresponding lines to have 'highlighted' class
1 highlighted
2
3 highlighted
4
5 highlighted
6 highlighted
7 highlighted
8 highlighted
9
10
highlight-lines
attr with start-from
attr should cause corresponding lines to have 'highlighted' class based on start-from
11 highlighted
12
13 highlighted
14
15 highlighted
16 highlighted
17 highlighted
18 highlighted
19
20
highlight-lines
attr with empty (any variant) line-slice syntax should highlight leading/trailing spaces
<foo>
<bar type="name">goo</bar>
<baz type="name">goo</baz>
<qux type="name">goo</qux>
<quux type="name">goo</quux>
</foo>
highlight-lines
attr with full character-variant line-slice syntax should highlight only at specified range
<foo>
<bar type="name">goo</bar>
<baz type="name">goo</baz>
<qux type="name">goo</qux>
<quux type="name">goo</quux>
</foo>
highlight-lines
attr with partial character-variant line-slice syntax should default highlight to start/end of line
<foo>
<bar type="name">goo</bar>
<baz type="name">goo</baz>
<qux type="name">goo</qux>
<quux type="name">goo</quux>
</foo>
highlight-lines
attr with line-part syntax should highlight only at specified substring
<foo>
<bar type="name">goo</bar>
<baz type="name">goo</baz>
<qux type="name">go,o</qux>
<quux type="name">go'o</quux>
<quuux type="name">go-o</quuux>
<quuuux type="name"> 3 arrays:[1, 2, 3], [4, 5, 6], and [7, 8, 9]. </quuuux>
</foo>
highlight-lines
attr with full word-variant line-slice syntax should highlight only at specified word ranges
<foo>
<bar type="name"> goo </bar>
<baz type="name"> goo </baz>
<qux type="name"> goo </qux>
<quux type="name"> goo </quux>
</foo>
highlight-lines
attr with partial word-variant line-slice syntax should default highlight to start/end of line
<foo>
<bar type="name"> goo </bar>
<baz type="name"> goo </baz>
<qux type="name"> goo </qux>
<quux type="name"> goo </quux>
</foo>
Should render correctly with heading
<foo>
<bar>
</foo>
Inline markdown contained in heading should also be rendered correctly
<foo>
<bar>
</foo>
Code block with multiple linebreaks should not have the empty lines collapsed
Four empty lines below, one above
Four empty lines above, one below
Code block without line numbers and multiple linebreaks should not have the empty lines collapsed
Four empty lines below, one above
Four empty lines above, one below
Code block with syntax highlighting and multiple linebreaks should not have the empty lines collapsed
function fourEmptyLinesBelowOneAbove() {
} // four empty lines above, one below
span with hljs
class should span multiple lines (Link for context)
*****
-----
Span containing multi-line strings should have each line wrapped in a hljs
span
var x = `This is a
really long string
that spans multiple lines
super annoying"`
## My header

Some paragraphs
123 5

another paragraphsome span
abc
a
b
### Header 2
Having in code blocks should not interfere with hljs
const a = `another
really
reallly
reallly really
long string`
const b = `long string
with multiple
embeded

`


{% include meta.html %} {% include analytics.html %}
I can make mobile games with the Unity Engine and program mainly with C# and JavaScript.
I excel in photo manipulation and graphic design through the use of Adobe Photoshop.
I make animation with Adobe Animate CC and have several videos up on my YouTube channel.


Chapter 6¶
This is the sixth in a series of notebooks related to astronomy data.
As a continuing example, we will replicate part of the analysis in a recent paper, “Off the beaten path: Gaia reveals GD-1 stars outside of the main stream” by Adrian M. Price-Whelan and Ana Bonaca.
In the previous lesson we downloaded photometry data from Pan-STARRS, which is available from the same server we’ve been using to get Gaia data.
The next step in the analysis is to select candidate stars based on the photometry data. The following figure from the paper is a color-magnitude diagram for the stars selected based on proper motion:
In red is a theoretical isochrone, showing where we expect the stars in GD-1 to fall based on the metallicity and age of their original globular cluster.
By selecting stars in the shaded area, we can further distinguish the main sequence of GD-1 from younger background stars.
Outline¶
Here are the steps in this notebook:
We’ll reload the data from the previous notebook and make a color-magnitude diagram.
Then we’ll specify a polygon in the diagram that contains stars with the photometry we expect.
Then we’ll merge the photometry data with the list of candidate stars, storing the result in a Pandas
DataFrame
.
After completing this lesson, you should be able to
Use Matplotlib to specify a
Polygon
and determine which points fall inside it.Use Pandas to merge data from multiple
DataFrames
, much like a databaseJOIN
operation.
Installing libraries¶
If you are running this notebook on Colab, you can run the following cell to install Astroquery and a the other libraries we’ll use.
If you are running this notebook on your own computer, you might have to install these libraries yourself.
If you are using this notebook as part of a Carpentries workshop, you should have received setup instructions.
TODO: Add a link to the instructions.
# If we're running on Colab, install libraries
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install astroquery astro-gala pyia python-wget
Reload the data¶
The following cell downloads the photometry data we created in the previous notebook.
import os
from wget import download
filename = 'gd1_photo.fits'
filepath = 'https://github.com/AllenDowney/AstronomicalData/raw/main/data/'
if not os.path.exists(filename):
print(download(filepath+filename))
Now we can read the data back into an Astropy Table
.
from astropy.table import Table
photo_table = Table.read(filename)
Plotting photometry data¶
Now that we have photometry data from Pan-STARRS, we can replicate the color-magnitude diagram from the original paper:
The y-axis shows the apparent magnitude of each source with the g filter.
The x-axis shows the difference in apparent magnitude between the g and i filters, which indicates color.
Stars with lower values of (g-i) are brighter in g-band than in i-band, compared to other stars, which means they are bluer.
Stars in the lower-left quadrant of this diagram are less bright and less metallic than the others, which means they are likely to be older.
Since we expect the stars in GD-1 to be older than the background stars, the stars in the lower-left are more likely to be in GD-1.
import matplotlib.pyplot as plt
def plot_cmd(table):
"""Plot a color magnitude diagram.
table: Table or DataFrame with photometry data
"""
y = table['g_mean_psf_mag']
x = table['g_mean_psf_mag'] - table['i_mean_psf_mag']
plt.plot(x, y, 'ko', markersize=0.3, alpha=0.3)
plt.xlim([0, 1.5])
plt.ylim([14, 22])
plt.gca().invert_yaxis()
plt.ylabel('$g_0$')
plt.xlabel('$(g-i)_0$')
plot_cmd
uses a new function, invert_yaxis
, to invert the y
axis, which is conventional when plotting magnitudes, since lower magnitude indicates higher brightness.
invert_yaxis
is a little different from the other functions we’ve used. You can’t call it like this:
plt.invert_yaxis() # doesn't work
You have to call it like this:
plt.gca().invert_yaxis() # works
gca
stands for “get current axis”. It returns an object that represents the axes of the current figure, and that object provides invert_yaxis
.
In case anyone asks: The most likely reason for this inconsistency in the interface is that invert_yaxis
is a lesser-used function, so it’s not made available at the top level of the interface.
Here’s what the results look like.
plot_cmd(photo_table)
Our figure does not look exactly like the one in the paper because we are working with a smaller region of the sky, so we don’t have as many stars. But we can see an overdense region in the lower left that contains stars with the photometry we expect for GD-1.
The authors of the original paper derive a detailed polygon that defines a boundary between stars that are likely to be in GD-1 or not.
As a simplification, we’ll choose a boundary by eye that seems to contain the overdense region.
Drawing a polygon¶
Matplotlib provides a function called ginput
that lets us click on the figure and make a list of coordinates.
It’s a little tricky to use ginput
in a Jupyter notebook.
Before calling plt.ginput
we have to tell Matplotlib to use TkAgg
to draw the figure in a new window.
When you run the following cell, a figure should appear in a new window. Click on it 10 times to draw a polygon around the overdense area. A red cross should appear where you click.
import matplotlib as mpl
if IN_COLAB:
coords = None
else:
mpl.use('TkAgg')
plot_cmd(photo_table)
coords = plt.ginput(10)
mpl.use('agg')
The argument to ginput
is the number of times the user has to click on the figure.
The result from ginput
is a list of coordinate pairs.
coords
[(0.2150537634408602, 17.548197203826344),
(0.3897849462365591, 18.94628403237675),
(0.5376344086021505, 19.902869757174393),
(0.7034050179211468, 20.601913171449596),
(0.8288530465949819, 21.300956585724798),
(0.6630824372759856, 21.52170713760118),
(0.4301075268817204, 20.785871964679913),
(0.27329749103942647, 19.71891096394408),
(0.17473118279569888, 18.688741721854306),
(0.17473118279569888, 17.95290654893304)]
If ginput
doesn’t work for you, you could use the following coordinates.
if coords is None:
coords = [(0.2, 17.5),
(0.2, 19.5),
(0.65, 22),
(0.75, 21),
(0.4, 19),
(0.4, 17.5)]
The next step is to convert the coordinates to a format we can use to plot them, which is a sequence of x
coordinates and a sequence of y
coordinates. The NumPy function transpose
does what we want.
import numpy as np
xs, ys = np.transpose(coords)
xs, ys
(array([0.21505376, 0.38978495, 0.53763441, 0.70340502, 0.82885305,
0.66308244, 0.43010753, 0.27329749, 0.17473118, 0.17473118]),
array([17.5481972 , 18.94628403, 19.90286976, 20.60191317, 21.30095659,
21.52170714, 20.78587196, 19.71891096, 18.68874172, 17.95290655]))
To display the polygon, we’ll draw the figure again and use plt.plot
to draw the polygon.
plot_cmd(photo_table)
plt.plot(xs, ys);
If it looks like your polygon does a good job surrounding the overdense area, go on to the next section. Otherwise you can try again.
If you want a polygon with more points (or fewer), you can change the argument to ginput
.
The polygon does not have to be “closed”. When we use this polygon in the next section, the last and first points will be connected by a straight line.
Which points are in the polygon?¶
Matplotlib provides a Path
object that we can use to check which points fall in the polygon we selected.
Here’s how we make a Path
using a list of coordinates.
from matplotlib.path import Path
path = Path(coords)
path
Path(array([[ 0.21505376, 17.5481972 ],
[ 0.38978495, 18.94628403],
[ 0.53763441, 19.90286976],
[ 0.70340502, 20.60191317],
[ 0.82885305, 21.30095659],
[ 0.66308244, 21.52170714],
[ 0.43010753, 20.78587196],
[ 0.27329749, 19.71891096],
[ 0.17473118, 18.68874172],
[ 0.17473118, 17.95290655]]), None)
Path
provides contains_points
, which figures out which points are inside the polygon.
To test it, we’ll create a list with two points, one inside the polygon and one outside.
points = [(0.4, 20),
(0.4, 30)]
Now we can make sure contains_points
does what we expect.
inside = path.contains_points(points)
inside
array([ True, False])
The result is an array of Boolean values.
We are almost ready to select stars whose photometry data falls in this polygon. But first we need to do some data cleaning.
Reloading the data¶
Now we need to combine the photometry data with the list of candidate stars we identified in a previous notebook. The following cell downloads it:
import os
from wget import download
filename = 'gd1_candidates.hdf5'
filepath = 'https://github.com/AllenDowney/AstronomicalData/raw/main/data/'
if not os.path.exists(filename):
print(download(filepath+filename))
import pandas as pd
candidate_df = pd.read_hdf(filename, 'candidate_df')
candidate_df
is the Pandas DataFrame that contains the results from Notebook XX, which selects stars likely to be in GD-1 based on proper motion. It also includes position and proper motion transformed to the ICRS frame.
Merging photometry data¶
Before we select stars based on photometry data, we have to solve two problems:
We only have Pan-STARRS data for some stars in
candidate_df
.Even for the stars where we have Pan-STARRS data in
photo_table
, some photometry data is missing.
We will solve these problems in two step:
We’ll merge the data from
candidate_df
andphoto_table
into a single PandasDataFrame
.We’ll use Pandas functions to deal with missing data.
candidate_df
is already a DataFrame
, but results
is an Astropy Table
. Let’s convert it to Pandas:
photo_df = photo_table.to_pandas()
for colname in photo_df.columns:
print(colname)
source_id
g_mean_psf_mag
i_mean_psf_mag
Now we want to combine candidate_df
and photo_df
into a single table, using source_id
to match up the rows.
You might recognize this task; it’s the same as the JOIN operation in ADQL/SQL.
Pandas provides a function called merge
that does what we want. Here’s how we use it.
merged = pd.merge(candidate_df,
photo_df,
on='source_id',
how='left')
merged.head()
| source_id | ra | dec | pmra | pmdec | parallax | parallax_error | radial_velocity | phi1 | phi2 | pm_phi1 | pm_phi2 | g_mean_psf_mag | i_mean_psf_mag | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 |<PHONE_NUMBER>39440000 | 137.586717 | 19.196544 | -3.770522 | -12.490482 | 0.791393 | 0.271754 | NaN | -59.630489 | -1.216485 | -7.361363 | -0.592633 | NaN | NaN |
| 1 |<PHONE_NUMBER>26658176 | 138.518707 | 19.092339 | -5.941679 | -11.346409 | 0.307456 | 0.199466 | NaN | -59.247330 | -2.016078 | -7.527126 | 1.748779 | 17.8978 | 17.517401 |
| 2 |<PHONE_NUMBER>83965568 | 138.842874 | 19.031798 | -3.897001 | -12.702780 | 0.779463 | 0.223692 | NaN | -59.133391 | -2.306901 | -7.560608 | -0.741800 | 19.2873 | 17.678101 |
| 3 |<PHONE_NUMBER>74983040 | 137.837752 | 18.864007 | -4.335041 | -14.492309 | 0.314514 | 0.102775 | NaN | -59.785300 | -1.594569 | -9.357536 | -1.218492 | 16.9238 | 16.478100 |
| 4 |<PHONE_NUMBER>10313600 | 138.044516 | 19.009471 | -7.172931 | -12.291499 | 0.425404 | 0.337689 | NaN | -59.557744 | -1.682147 | -9.000831 | 2.334407 | 19.9242 | 18.334000 |
The first argument is the “left” table, the second argument is the “right” table, and the keyword argument on='source_id'
specifies a column to use to match up the rows.
The argument how='left'
means that the result should have all rows from the left table, even if some of them don’t match up with a row in the right table.
If you are interested in the other options for how
, you can read the documentation of merge
.
You can also do different types of join in ADQL/SQL; you can read about that here.
The result is a DataFrame
that contains the same number of rows as candidate_df
.
len(candidate_df), len(photo_df), len(merged)
(7346, 3724, 7346)
And all columns from both tables.
for colname in merged.columns:
print(colname)
source_id
ra
dec
pmra
pmdec
parallax
parallax_error
radial_velocity
phi1
phi2
pm_phi1
pm_phi2
g_mean_psf_mag
i_mean_psf_mag
Detail You might notice that Pandas also provides a function called join
; it does almost the same thing, but the interface is slightly different. We think merge
is a little easier to use, so that’s what we chose. It’s also more consistent with JOIN in SQL, so if you learn how to use pd.merge
, you are also learning how to use SQL JOIN.
Also, someone might ask why we have to use Pandas to do this join; why didn’t we do it in ADQL. The answer is that we could have done that, but since we already have the data we need, we should probably do the computation locally rather than make another round trip to the Gaia server.
Missing data¶
Let’s add columns to the merged table for magnitude and color.
merged['mag'] = merged['g_mean_psf_mag']
merged['color'] = merged['g_mean_psf_mag'] - merged['i_mean_psf_mag']
These columns contain the special value NaN
where we are missing data.
We can use notnull
to see which rows contain value data, that is, not null values.
merged['color'].notnull()
0 False
1 True
2 True
3 True
4 True
...
7341 True
7342 False
7343 False
7344 True
7345 False
Name: color, Length: 7346, dtype: bool
And sum
to count the number of valid values.
merged['color'].notnull().sum()
3724
For scientific purposes, it’s not obvious what we should do with candidate stars if we don’t have photometry data. Should we give them the benefit of the doubt or leave them out?
In part the answer depends on the goal: are we trying to identify more stars that might be in GD-1, or a smaller set of stars that have higher probability?
In the next section, we’ll leave them out, but you can experiment with the alternative.
Selecting based on photometry¶
Now let’s see how many of these points are inside the polygon we chose.
We can use a list of column names to select color
and mag
.
points = merged[['color', 'mag']]
points.head()
| color | mag | |
|---|---|---|
| 0 | NaN | NaN |
| 1 | 0.3804 | 17.8978 |
| 2 | 1.6092 | 19.2873 |
| 3 | 0.4457 | 16.9238 |
| 4 | 1.5902 | 19.9242 |
The result is a DataFrame
that can be treated as a sequence of coordinates, so we can pass it to contains_points
:
inside = path.contains_points(points)
inside
array([False, False, False, ..., False, False, False])
The result is a Boolean array. We can use sum
to see how many stars fall in the polygon.
inside.sum()
496
Now we can use inside
as a mask to select stars that fall inside the polygon.
selected = merged[inside]
Let’s make a color-magnitude plot one more time, highlighting the selected stars with green x
marks.
plot_cmd(photo_table)
plt.plot(xs, ys)
plt.plot(selected['color'], selected['mag'], 'gx');
It looks like the selected stars are, in fact, inside the polygon, which means they have photometry data consistent with GD-1.
Finally, we can plot the coordinates of the selected stars:
plt.figure(figsize=(10,2.5))
x = selected['phi1']
y = selected['phi2']
plt.plot(x, y, 'ko', markersize=0.7, alpha=0.9)
plt.xlabel('ra (degree GD1)')
plt.ylabel('dec (degree GD1)')
plt.axis('equal');
This example includes two new Matplotlib commands:
figure
creates the figure. In previous examples, we didn’t have to use this function; the figure was created automatically. But when we call it explicitly, we can provide arguments likefigsize
, which sets the size of the figure.axis
with the parameterequal
sets up the axes so a unit is the same size along thex
andy
axes.
In an example like this, where x
and y
represent coordinates in space, equal axes ensures that the distance between points is represented accurately.
Write the data¶
Let’s write the merged DataFrame to a file.
filename = 'gd1_merged.hdf5'
merged.to_hdf(filename, 'merged')
selected.to_hdf(filename, 'selected')
!ls -lh gd1_merged.hdf5
-rw-rw-r-- 1 downey downey 2.0M Oct 19 17:21 gd1_merged.hdf5
If you are using Windows, ls
might not work; in that case, try:
!dir gd1_merged.hdf5
Save the polygon¶
Reproducibile research is “the idea that … the full computational environment used to produce the results in the paper such as the code, data, etc. can be used to reproduce the results and create new work based on the research.”
This Jupyter notebook is an example of reproducible research because it contains all of the code needed to reproduce the results, including the database queries that download the data and and analysis.
However, when we used ginput
to define a polygon by hand, we introduced a non-reproducible element to the analysis. If someone running this notebook chooses a different polygon, they will get different results. So it is important to record the polygon we chose as part of the data analysis pipeline.
Since coords
is a NumPy array, we can’t use to_hdf
to save it in a file. But we can convert it to a Pandas DataFrame
and save that.
As an alternative, we could use PyTables, which is the library Pandas uses to read and write files. It is a powerful library, but not easy to use directly. So let’s take advantage of Pandas.
coords_df = pd.DataFrame(coords)
filename = 'gd1_polygon.hdf5'
coords_df.to_hdf(filename, 'coords_df')
We can read it back like this.
coords2_df = pd.read_hdf(filename, 'coords_df')
coords2 = coords2_df.to_numpy()
And verify that the data we read back is the same.
np.all(coords2 == coords)
True
Summary¶
In this notebook, we worked with two datasets: the list of candidate stars from Gaia and the photometry data from Pan-STARRS.
We drew a color-magnitude diagram and used it to identify stars we think are likely to be in GD-1.
Then we used a Pandas merge
operation to combine the data into a single DataFrame
.
Best practices¶
If you want to perform something like a database
JOIN
operation with data that is in a PandasDataFrame
, you can use thejoin
ormerge
function. In many cases,merge
is easier to use because the arguments are more like SQL.Use Matplotlib options to control the size and aspect ratio of figures to make them easier to interpret. In this example, we scaled the axes so the size of a degree is equal along both axes.
Matplotlib also provides operations for working with points, polygons, and other geometric entities, so it’s not just for making figures.
Be sure to record every element of the data analysis pipeline that would be needed to replicate the results.


WheresMyIp.org is an open-source and crowd-sourced-data project striving to provide free as-accurate-as-possible IP to geographic location information for the IoT age. As devices become more portable and location-aware, getting exact information for the location of any device (especially IPv6 devices) will get more and more difficult. Although client devices know where they are, there's no way for servers (or other clients in a Peer-To-Peer environment) to know where each-other are.
Although commercial databases (like MaxMind) exist, they cost a lot of money and can't keep up-to-date with edge devices. Thus, we're attempting to create a crowd-sourced database driven by the community
Grab one of our client SDKs to start contributing data
Browser SDK:
<script src="https://cdn.jsdelivr.net/gh/issacg/wheresmyip/wheresmyip-browser.js"/></script>
<script>wheresmyip.submit();</script>
Do-it-yourself
Make a POST request to https://api.wheresmyip.org/ip
The POST content
should be type application/json
and contain a JSON object
containing the two properties lat
and lon
with
decimal lattitude/longitude coordinates.
For example:
{"lat": 41.9040, "lon": 12.4530}
Send requests to https://api.wheresmyip.org/ip/<address>
where "address" is a valid IPv4 or IPv6 address. Bear in mind that as a young and crowdsourced project, there isn't much data yet...The output will be a JSON object containing the following fields:
If you're using a modern browser which supports the GeoLocation API (most do), then click this button to submit your IP to our database
Sortof. The database and application support it. It's currently not on a dual-stack endpoint, so can't accept IPv6 submissions, but once the endpoint is dual-stack, it will work.
There will (hopefully soon) be a script to install the entire stack on your Amazon AWS account. If you don't get much traffic, you'll be fine on the free tier. Check the /install folder on GitHub
Fork us and submit pull requests
This project was (so far) the result of an 8-hour hackathon hosted by ironSource. Most of my time went to writing the application (and starting the installer).  Sorry 'bout that...


--- layout: default title: Home carousel: - image: /images/competition/appthis-logo.png caption: "App This Competition" alt: App This Competition link: /competitions/appthis competition: Current start_end_date: April 2017 to May 2017 - image: /images/competition/ratemyprofessor.png caption: "Rate My Professor Dataset" alt: Rate My Professor Competition link: 2016/08/26/first-team-meeting.html competition: Past start_end_date: 26th August 2016 to 17th September 2016 recentNotebooks: - name: Tensorflow Tutorial link: 'http://codata.colorado.edu/notebooks/tutorials/tensorflow_example_davis_yoshida/' - name: MNIST with KNN Classifier link: 'http://codata.colorado.edu/notebooks/tutorials/sklearn_knn_mnist_nick_trierweiler/' - name: ODC Challenge link: 'http://codata.colorado.edu/notebooks/tutorials/odc_vowpalwabbit_nehal_kamat/' ---
The Colorado Data Science Team (CODATA) is a team of data scientists, machine learners, number crunchers, and statisticians at the University of Colorado Boulder. Our primary goal is educational: to get hands on experience working in teams applying modern machine learning tools to real problems with real data. As part of this goal, we compete in internal prediction challenges, as well as represent CU Boulder in global competitions as seen on Kaggle, DrivenData, Quantopian, and other platforms.
We meet Tuesdays at 5pm. Our room for Fall 2018 is DUAN G131.


|
|||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Home Blog News Demo Documentation Download Status Installation Target Support Bug Database Source Repository Contact The ELLCC project is supported by Pennington Software |
Tar Balls
Pre-built binaries and target libraries are available for
download. You can get a feel for what's in the tarballs by
looking at the directory tree. |
| Date |
Version |
Host |
File |
|---|---|---|---|
| August 2, 2012 |
0.0.1 (pre-release) |
Fedora 16 Linux 64 bit x86 | ellcc-0.0.1-linux-x86_64.tgz |
| July 21, 2012 |
0.0.0 (pre-release) |
Fedora 16 Linux 64
bit x86 |
ellcc-0.0.0-linux-x86_64.tgz |
You can untar the distribution anywhere:
[~] main% tar xvfpz
~/Downloads/ellcc-0.0.0-linux-x86_64.tgz
In this example we compile a simple "hello world" program
and run it native and for the Mips.


To request a new password enter your email address below and we will send you a link to reset your password. (How cool are we?)


| DOSE: |
1 cig. |
smoked |
Cannabis |
(plant material) |
When I was a freshman in high school I smoked pot with a couple of friends.  This is probably because I had consumed a few beers and only smoked a tiny amount.
I was with two other friends and we were at my friend's house. Her father smoked so we stole some of his. We had no idea what we were doing and began to roll a joint. We made them very 'fat' as they say. I was a smoker then and thought of this joint as a cigarette. I smoked the whole thing by myself. I guess that is a lot, but I am not sure.
We were laughing and giggling and everything just seemed hazy and light. Out of no where it hit me. It hit me like a ton of bricks. It was like this huge awareness that I was so alert and so in tune with how messed up I was. This feeling of dread overwhelmed me. My thoughts were so intense. I was thinking so hard that it was 100% exhausting. I do not even understand how people can relax on this stuff. I felt so aware of the fact that my brain and my body were out of control. I was so cold and it was like when you are falling asleep and someone calls your name and you come out of sleep very startled and alert and your heart is racing. That is how smoking pot is for me. One moment I feel like I am dealing with the intense dissociation and then the next it is like I am being woken up startled and back into the fear and intense thinking that is sheerly exhausting.
I was so freaked out and my friends were such assholes and made it far worse. They sat and talked about me and laughed at me. You might think this was paranoia (which it was also) but it was also them laughing at how paranoid I was. One of my friends told me that the way I was feeling would never end and never go away and that ever since she had smoked for the first time, she had been feeling the way I was and it had never stopped. I think that is one of the meanest things anyone has ever done to me.
All I could think about was how my dad was coming to get me and how he could never find out. I finally calmed down a little and became a little more normal when my father arrived. For the next few days I felt like I was still going in and out of the dissociation. It was like I could not shake it.
I have tried smoking since many times. I only smoked once when I was sober again and felt the same way but I tried to roll with it because I knew why I felt that way and that it would end. I have smoked while drinking and have found the alcohol to remove most of the paranoia and dissociative effects of the marijuana.
I think certain types of people simply have no business smoking pot. I believe if you are already anxious or have tendencies to be anxious it can bring out the anxiety and can even bring on an anxiety, panic or dissociative disorder. I think for that it can make people think (and think too hard) about things that make them anxious, such as losing control. I think that is what made me go so crazy; the sheer thought of being out of control and being so alert to the fact that I was out of control.
I have not smoked pot in over 8 years and never plan on smoking it again.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Isucon3Final
Home
name
following
show api_key
Icon
Change
Post
Publush Level
Private
Followers only
Public
Post
Timeline
Success.
Success.


A religion is a set of beliefs that is held by a group of people. There are many different religions, each with a different set of beliefs. The beliefs are about the world and the people in it, about how they came into being, and what their purpose is.
Each religion usually has their own type of "devotions" when people worship or pray. They often have religious "rituals" (special things that are always done in the same way) for certain times of the year or certain times of a person's life. Other words that are used for "religion" are "faith" and "belief system".
You can read more about Christianity, Islam and Buddhism.PS: This is a sample site from Digital Inspiration hosted on GAE. For any help, see the accompanying App Engine Tutorial.


This is the hostname of the whois server
Squid uses to resolve Autonomous System numbers into IP networks. You
only need to worry about this if you use AS-based ACLs
(src_as, dst_as). The default server, whois.ra.net,
seems to work relatively well. It may be too far away (and
unreliable) for non-U.S. users. If you know of a local
whois server that returns AS queries, feel free
to use it instead. |
Syntax
|
as_whois_server hostname
| |
Default
|
as_whois_server whois.ra.net
| |
Example
|
as_whois_server whois.host.name
| |
Related
|
acl
|
|


| Class | Description |
|---|---|
| CollapsingBorderModel |
This class is a superclass for the two collapsing border models defined
in the XSL 1.0 specification.
|
| CollapsingBorderModelEyeCatching |
Implements the normal "collapse" border model defined in 6.7.10 in XSL 1.0.
|
| ColumnSetup |
Class holding a number of columns making up the column setup of a row.
|
| TableAndCaptionLayoutManager |
LayoutManager for a table-and-caption FO.
|
| TableCaptionLayoutManager |
LayoutManager for a table-caption FO.
|
| TableCellLayoutManager |
LayoutManager for a table-cell FO.
|
| TableContentLayoutManager |
Layout manager for table contents, particularly managing the creation of combined element lists.
|
| TableLayoutManager |
LayoutManager for a table FO.
|
| TableRowIterator |
Iterator that lets the table layout manager step over all the rows of a part of the
table (table-header, table-footer or table-body).
|
| TableStepper |
This class processes row groups to create combined element lists for tables.
|
Layout managers for tables.
Copyright 1999-2020 The Apache Software Foundation. All Rights Reserved.


Class DimensionStyleAlternateUnits
Represents the way alternate units are formatted in dimension entities.
Inheritance
Implements
Inherited Members
Namespace: netDxf.Tables
Assembly: CADability.dll
Syntax
public class DimensionStyleAlternateUnits : ICloneable
Remarks
Alternative units are not applicable for angular dimensions.
Constructors
| Improve this Doc View SourceDimensionStyleAlternateUnits()
Initializes a new instance of the DimensionStyleUnitsFormat
class.
Declaration
public DimensionStyleAlternateUnits()
Properties
| Improve this Doc View SourceEnabled
Gets or sets if the alternate measurement units are added to the dimension text. (DIMALT)
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LengthPrecision
Sets the number of decimal places displayed for the alternate units of a dimension. (DIMALTD)
Declaration
public short LengthPrecision { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Default: 4
It is recommended to use values in the range 0 to 8.
For architectural and fractional the precision used for the minimum fraction is 1/2^LinearDecimalPlaces.
LengthUnits
Gets or sets the alternate units for all dimension types except angular. (DIMALTU)
Declaration
public LinearUnitType LengthUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| LinearUnitType |
Remarks
Scientific
Decimal
Engineering
Architectural
Fractional
Multiplier
Gets or sets the multiplier used as the conversion factor between primary and alternate units. (DIMALTF)
Declaration
public double Multiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
to convert inches to millimeters, enter 25.4. The value has no effect on angular dimensions, and it is not applied to the rounding value or the plus or minus tolerance values.
Prefix
Specifies the text prefix for the dimension. (DIMAPOST)
Declaration
public string Prefix { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Roundoff
Gets or sets the value to round all dimensioning distances. (DIMALTRND)
Declaration
public double Roundoff { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Default: 0 (no rounding off).
If DIMRND is set to 0.25, all distances round to the nearest 0.25 unit.
If you set DIMRND to 1.0, all distances round to the nearest integer.
Note that the number of digits edited after the decimal point depends on the precision set by DIMDEC.
DIMRND does not apply to angular dimensions.
StackUnits
Gets or set if the Architectural or Fractional linear units will be shown stacked or not. (DIMALTU)
Declaration
public bool StackUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This value only is applicable if the DimLengthUnits
property has been set to Architectural or Fractional,
for any other value this parameter is not applicable.
Suffix
Specifies the text suffix for the dimension. (DIMAPOST)
Declaration
public string Suffix { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
SuppressLinearLeadingZeros
Suppresses leading zeros in linear decimal alternate units. (DIMALTZ)
Declaration
public bool SuppressLinearLeadingZeros { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This value is part of the DIMALTZ variable.
SuppressLinearTrailingZeros
Suppresses trailing zeros in linear decimal alternate units. (DIMALTZ)
Declaration
public bool SuppressLinearTrailingZeros { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This value is part of the DIMALTZ variable.
SuppressZeroFeet
Suppresses zero feet in architectural alternate units. (DIMALTZ)
Declaration
public bool SuppressZeroFeet { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This value is part of the DIMALTZ variable.
SuppressZeroInches
Suppresses zero inches in architectural alternate units. (DIMALTZ)
Declaration
public bool SuppressZeroInches { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This value is part of the DIMALTZ variable.
Methods
| Improve this Doc View SourceClone()
Creates a new DimensionStyle.DimensionStyleAlternateUnits
that is a copy of the current instance.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new |