public class JacksonSupport
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for the java.time API, some core types, and Kotlin data classes.
Note that Jackson can also be used to serialise/deserialise other formats such as Yaml and XML.
| Modifier and Type | Field and Description |
|---|---|
static JacksonSupport |
INSTANCE
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for
the java.time API, some core types, and Kotlin data classes.
|
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
createDefaultMapper(CordaRPCOps rpc,
com.fasterxml.jackson.core.JsonFactory factory)
Mapper requiring RPC support to deserialise parties from names
|
static com.fasterxml.jackson.databind.ObjectMapper |
createDefaultMapper(CordaRPCOps rpc)
Mapper requiring RPC support to deserialise parties from names
|
static com.fasterxml.jackson.databind.ObjectMapper |
createInMemoryMapper(IdentityService identityService,
com.fasterxml.jackson.core.JsonFactory factory)
For testing with an in memory identity service
|
static com.fasterxml.jackson.databind.ObjectMapper |
createInMemoryMapper(IdentityService identityService)
For testing with an in memory identity service
|
static com.fasterxml.jackson.databind.ObjectMapper |
createNonRpcMapper(com.fasterxml.jackson.core.JsonFactory factory)
For testing or situations where deserialising parties is not required
|
static com.fasterxml.jackson.databind.ObjectMapper |
createNonRpcMapper()
For testing or situations where deserialising parties is not required
|
com.fasterxml.jackson.databind.Module |
getCordaModule() |
public static JacksonSupport INSTANCE
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for the java.time API, some core types, and Kotlin data classes.
Note that Jackson can also be used to serialise/deserialise other formats such as Yaml and XML.
public com.fasterxml.jackson.databind.Module getCordaModule()
public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(CordaRPCOps rpc, com.fasterxml.jackson.core.JsonFactory factory)
Mapper requiring RPC support to deserialise parties from names
public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(CordaRPCOps rpc)
Mapper requiring RPC support to deserialise parties from names
public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper(com.fasterxml.jackson.core.JsonFactory factory)
For testing or situations where deserialising parties is not required
public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper()
For testing or situations where deserialising parties is not required
public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(IdentityService identityService, com.fasterxml.jackson.core.JsonFactory factory)
For testing with an in memory identity service
public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(IdentityService identityService)
For testing with an in memory identity service


There comes a time in every CRM developer’s career when he’s tired of doing the rain dance of plugin re-registration for testing custom workflow activities. Of course, moving all of the heavy lifting out of the actual Execute() method is a must, but sometimes we just need to test the thing as-is.
I’ve seen some references to testing workflow activities on the web that recommend using the workflow runtime to spin things up for the test, but for smoke testing individual activities, I think that this is probably overkill. What I’m going to do here is to spin up an instance of the activity outside of the WF runtime environment. For another take on this as well as a sample of spinning up the actual WF runtime for testing, check out this reference. Of course, if we have a composite activity or if we reach into the execution context at all, this technique won’t work. If need be I might look at mocking the execution context, but for now I don’t need it.
As an example, take the following custom CRM workflow activity that sends a notification to a web service with a contract ID that has been updated in CRM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Even though this is far from being a unit test or free of side effects, we’d still like to run this activity as a smoke test outside of CRM. There are two potential problems with doing something like
1 2 |
|
The most obvious issue, were one to attempt compilation of the above code, is that the Execute() method is protected and not visible to us in a test. Fortunately, Execute() is defined on System.Workflow.ComponentModel.Activity which intended for use as a base class and is not sealed.
So, instead of using ContractUpdateActivity directly in our test, we can make a small wrapper by subclassing it:
1 2 3 4 5 |
|
now we can write a few lines of code to exercise the code (I hesitate to call this a ‘test’) via the subclass:
1 2 3 |
|
The other issue to watch for is that of dependencies. The type initializer of Activity tries to load dependencies behind the scenes and won’t look in the current path of the executable that is running the test. The required classes must either be compiled into the same assembly as the workflow activity or be found in the GAC. It may be possible to locate the assemblies somewhere else, but I haven’t looked at the fusion logs to find out where else workflow looks for assemblies.
If an assembly is not found, the .net runtime will issue an error similar to the following:
1
|
|


--- title: Apps description: "An archive of apps" layout: default --- {% for app in site.categories.apps %}
{{ app.excerpt }}


public class Table<T extends AttributeInterface>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
Table.Node
Inner class node, each node is a row in the table.
|
| Modifier and Type | Field and Description |
|---|---|
private Table.Node |
head
First record in the table
|
private int |
size
Counter to keep size of the array
|
private Table.Node |
tail
Last record in the table
|
private Table.Node |
temp
This temp node is only used to iterate through the table.
|
private java.lang.String |
title
Label for the table
|
| Constructor and Description |
|---|
Table(java.lang.String title)
Initializes an empty table with a label.
|
Table(Table.Node head,
java.lang.String title)
Initializes a table with the first record and a label.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T data)
Checks the table to see if a row with the data specified exists.
|
(package private) Table<T> |
difference(Table<T> table)
Creates a new table comprised of nodes in this table, but not in the
table being passed in.
|
protected java.lang.String |
getTitle()
Getter method to retrieve the label of the table.
|
(package private) void |
insert(T data)
Adds a new record to the end of the table.
|
(package private) Table<T> |
intersect(java.lang.String attribute,
java.lang.String value,
Table<T> table)
Creates a new table comprised of nodes having a value for a specific
attribute, created from two tables.
|
(package private) void |
remove(java.lang.String id)
Removes the node/row with a matching ID from the table.
|
(package private) Table<T> |
select(java.lang.String attribute,
java.lang.String value)
Creates a new table comprised of nodes having a value for a specific
attribute.
|
java.lang.String |
toString()
Prints the data in this entire table.
|
(package private) Table<T> |
union(Table<T> table)
Creates a new table comprised of nodes that occur in both tables.
|
private Table.Node head
private Table.Node tail
private java.lang.String title
private int size
private Table.Node temp
public Table(java.lang.String title)
title
- The label for the table.public Table(Table.Node head, java.lang.String title)
head
- The first record in the table.title
- The label for the table.public boolean contains(T data)
data
- The data that will be used to check the table for.Table<T> difference(Table<T> table)
table
- The table used to compare with the original one.void insert(T data)
data
- The information that would be contained in a row of the table.Table<T> intersect(java.lang.String attribute, java.lang.String value, Table<T> table)
attribute
- The attribute to restrict to.value
- The value of that attribute to restrict to.table
- The other table to compare with.protected java.lang.String getTitle()
void remove(java.lang.String id)
id
- The id of the node/row.Table<T> select(java.lang.String attribute, java.lang.String value)
attribute
- The attribute to select and restrict to.value
- The value to select and restrict to.Table<T> union(Table<T> table)
table
- The other table to compare with.public java.lang.String toString()
toString
in class java.lang.Object


image/svg+xml
home
blog
Jan 1, 0001
partial "head.html" . }} {{ partial "navbar.html" . }} {{ partial "masthead.html" . }}
prev:
Maintainable UI: How to Improve Code Editing with SASS


import heapq class Solution: def maxPerformance(self, n: int, speed: List[int], efficiency: List[int], k: int) -> int: engineers = list(zip(efficiency, speed)) engineers = sorted(engineers, reverse=True) res = 0 totalSpeed = 0 heap = [] for e, s in engineers: totalSpeed += s heapq.heappush(heap, s) if len(heap) > k: totalSpeed -= heapq.heappop(heap) t = e * totalSpeed if t > res: res = t return res % (10 ** 9 + 7)


You need to set the telegram key in the options (you can get it by starting a dialog with @profit_robots_bot)


Learn more
Use up to 5 wirilles modules to water your plants in different parts of your home.
Easily extend capacity of your autowatering module with external water storage.


Problem sets and solutions
2020-06-28
Special thank you to the Spring 2020 Mathematical Demography students for the problem set answers.
Chapter 1 Problem set 1
1.1 Questions
True or False? “If every part grows exponentially at its own rate, then the whole will also grow exponentially.” Explain your answer briefly.
List what you think are two of the best arguments in favor of doing a disaggregated projection? What are two of the best arguments in favor of doing an aggregated projection?
Let there be two countries: USA (\(u\)) and Mexico (\(m\)). Assume that in 1970, their population size (in millions) is \(K_u(1970) = 200\), \(K_m(1970) = 50\) and that their growth rates are \(r_u = .0075\) and \(r_m = 0.035\), respectively. Project the first few years and verify that the rate of change in the aggregate growth rate equals the variance of the growth rate. Does it matter what time points and period you consider?
- Using the information from question 3, notice that the growth rate changes over the course of the 50 years, but there is a constant growth rate that will produce the exact same population after 50 years. A reasonable choice of the constant growth rate to apply is the value of the changing growth rate at year 25 (half-way through the period). We can estimate this using a Taylor series approximation: \[ \bar{r}(25) \approx \bar{r}(0) + 25\bar{r}'(0) + (25)^2 \bar{r}''(0) \]
- Show that \(\bar{r}''(t) = \bar{r}_3(t) - \bar{r}_2(t) \bar{r}(t) - 2 \bar{r}(t) \sigma^2_r(t)\) \
- Calculate the combined US-Mexico population after 50 years according to the following five (5) methods, plot the total population after 50 years according to these 5 methods on a graph.
- Dissaggregated (“true”) forecast, with each country growing at its own rate
- Aggregated forecast, pretending it’s one country, growing at \(\bar{r}(0)\)) for 50 years
- Aggregated forecast, growing at the “true” value of \(\bar{r}(25)\) for the whole period. (Use the value of \(\bar{r}(25)\)) that you calculate from the disaggregated forecast)
- Aggregated forecast, growing at the first-order Taylor series estimate of \(\bar{r}(25)\) for the whole period
- Aggregated forecast, growing at the second-order Taylor series estimate of \(\bar{r}(25)\) for the whole period
- For Ken’s Poisson-Exponential model,
- What is the closed-form expression for \(\hat{r}(t)\)
- What is the variance of the growth rate?
- Write down an expression for the distortion index. What variables and parameters in the model does it depend on? Are there any variables or parameters that it doesn’t depend on? (difference of \(\bar{r}(t)\) and \(\bar{r}(0)\))
- What is the closed-form expression for \(\hat{r}(t)\)
1.2 Solutions
True or False? “If every part grows exponentially at its own rate, then the whole will also grow exponentially.” Explain your answer briefly. False.
From Keyfitz we know that the average growth rate of a heterogeneous population is: \[\bar{r}(t)=\frac{\sum_i{Q_i}{r_i}e^{r_i{t}}}{\sum_i{Q_i}e^{r_i{t}}}\] Here, \(\bar{r}(t)\) is not constant for all t as there is a compositional effect. This should be read as “If every part grows at a constant exponential rate, then the whole will also grow exponentially”. We could argue that only in the long term it is true.- List what you think are two of the best arguments in favor of doing a disaggregated projection? What are two of the best arguments in favor of doing an aggregated projection?
- Disaggregated projections:
- Reveal the “true” path, patterns of individuals different from that of the aggregate.
- Take into account size of each sub-population, in particular the smaller ones.
- Are more precise. Growth rates for sub-populations reflect their intrinsic characteristics, such that projections that do not use appropriate rates can lead to adverse social/policy implications.
- Reveal the “true” path, patterns of individuals different from that of the aggregate.
- Aggregated projections:
- May used if a population is homogeneous rather than projecting many models for sub-populations.
- Provide a straightforward method of obtaining overall rates rather than the group-specific rates.
- Are easier to implement as more data available.
- May used if a population is homogeneous rather than projecting many models for sub-populations.
- Disaggregated projections:
There are two countries, \(u\) and \(m\), each with growth rates \(r_u = .0075\), \(r_m = 0.035\), and population sizes in 1970 of \(K_u(1970) = 200\), \(K_m(1970) = 50\). Use the first few years of the projection to verify that rate of change in the aggregate growth rate equals the variance of the growth rate. Does it matter what time points and period you consider?
From the information given, we can obtain \(\bar{r}(t)\) and \(\sigma_r^2(t)\) by projecting each country’s population using individual rates and then obtaining the total population, \[\bar{K}(t)= \sum_{i\in\{u,m\}}K_{i}(t) = \sum_{i\in\{u,m\}}K_{i}e^{r_{i} t}\] Applying the formula for aggregate growth rate to the USA-Mexico case we get: \[\begin{aligned} \bar{r}(t) & = \frac{\frac{d}{dt}\bar{K}(t)}{\bar{K}(t)}\\ & = \frac{K_u(0) r_u(t) e^{r_u(t) t} + K_m(0) r_m(t) e^{r_m(t) t}}{K_u(0) e^{r_u(t) t} + K_m(0) e^{r_m (t) t}} \end{aligned}\] For simplicity, time 0 is the year 1970 such that the proyection goes from 1971 (t=1) until 2020 (t=50).
Then, we can calculate the variance of the growth rates as: \[\begin{aligned} \sigma_r^2(t) &= \frac{{K_u(0) e^{r_u(t) t}(r_u(t) - \bar{r}(t))^2 + K_m(0) e^{r_m(t) t}(r_m(t) - \bar{r}(t))^2}} { {K_u(0) e^{r_u(t) t} + K_m(0) e^{r_m(t) t}}} \\ &= \frac{K_u(t) r_u(t)^2 + K_m(t) r_u(t)^2}{K_u(t)+K_m(t)}-\bar{r}(t)^2 \end{aligned}\] The table below show these results for projections at the beginning and ending of a 50 year period. Overall, the time points do not matter and we can verify that \(\frac{d\bar{r}(t)}{d(t)}=\sigma_r^2(t)\)\(t\) \(\sigma^2_r(t)\) \(K_u(t)\) \(K_m(t)\) \(\bar{K}(t)\) \(\bar{K}(t)-\bar{K}(t-1)\) \(\bar{r}(t)\) \(\bar{r}'(t)\) 0 0.00021 200 50 250 l 0.000123 201.506 51.781 253.287 3.2866 0.0131 2 0.000125 203.023 53.625 256.648 3.3614 0.0132 0.0001 3 0.000127 204.551 55.536 260.087 3.4385 0.0133 0.0001 \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) 49 0.000189 288.824 277.833 566.658 50 0.000189 290.998 287.730 578.728 12.071 0.0211 51 0.000189 293.189 297.979 591.168 12.440 0.0213 0.0002 - Using the information from question 3, notice that the growth rate changes over the course of the 50 years, but there is a constant growth rate that will produce the exact same population after 50 years. A reasonable choice of the constant growth rate to apply is the value of the changing growth rate at year 25 (half-way through the period). We can estimate this using a Taylor series approximation: \[ \bar{r}(25) \approx \bar{r}(0) + 25\bar{r}'(0) + (25)^2 \bar{r}''(0) \]
- Show that \(\bar{r}''(t) = \bar{r}_3(t) - \bar{r}_2(t) \bar{r}(t) - 2 \bar{r}(t) \sigma^2_r(t)\)
From before, we know that for \(i\in\{u,m\}\): \[\begin{aligned} \sigma_r^2(t) &= \bar{r}'(t) \\ & = \frac{d}{dt}\left[ \frac{ \sum K_i r_i e^{r_i t}} {\sum K_i e^{r_i t}} \right]\\ & = \frac{\sum K_i(0)r_i^2e^{r_it}} {\sum K_i(0)e^{r_it}} - \left(\frac{ \sum K_i(0)r_ie^{r_it}} {\sum K_i(0)e^{r_it}}\right)^2 \\ & = \frac{\sum K_i(0)r_i^2e^{r_it}} {\sum K_i(0)e^{r_it}} - \bar{r}^2(t) \end{aligned}\] Then, we take the second derivative of the growth rate by using the quotient rule \(\left(\frac{u}{v}\right)'= \frac{u'v-vu'}{v^2}\): \[\begin{aligned} \bar{r}''(t) &= { \frac{\left(\sum K_i(0)e^{r_it}\right)(\sum K_i(0)r_i^3e^{r_it}) -(\sum K_i(0)r_i^2e^{r_it})(\sum K_i(0)r_i e^{r_it})} {(\sum K_i(0)e^{r_it})^2 }} - 2\bar{r}(t)\times\bar{r}'(t)\\ &= \frac{ \sum K_i(0)r_i^3e^{r_it}} {\sum K_i(0)e^{r_it} } - \frac{ \sum K_i(0)r_i^2e^{r_it}} {\sum K_i(0)e^{r_it}}\times \frac{\sum K_i(0)r_i e^{r_it}}{\sum K_i(0)e^{r_it} } - 2\bar{r}(t)\sigma^2_r(t) \\ &= \bar{r}_3 (t) - \bar{r}_2(t)\bar{r}(t) - 2\bar{r}(t)\sigma^2_r(t) \end{aligned}\] where \(\bar{r}_n\) is the \(n\)th moment of \(\bar{r}(t)\), and it is known that \(\bar{r}'(t) = \sigma^2_r(t)\).
- Calculate the combined US-Mexico population after 50 years according to the following five (5) methods, plot the total population after 50 years according to these 5 methods on a graph.
For the following exercises, the population is in millions.
- Dissaggregated (“true”) forecast, with each country growing at its own rate:
\[\begin{aligned} \bar{K}(2020) &= K_u(2020) + K_m(2020)\\ &=K_u(1970) e^{(2020-1970)r_u} + K_m(1970) e^{(2020-1970)r_m}\\ &=200e^{.0075\times 50} + 50e^{.035\times 50}\\ &= 578.728 \end{aligned}\]
- Aggregated forecast, pretending it’s one country, growing at \(\bar{r}(0)\)) for 50 years:
\[\begin{aligned} \overline{r}(1970) &= \frac{\sum K_i(1970)r_i e^{r_i (1970-1970)}} {\sum K_i(1970)e^{r_i (1970-1970) }}\\ &=\frac{K_u(1970)r_u + K_m(1970)r_m }{K_u(1970) + K_m(1970) }\\ & = \frac{ 200\times .0075 + 50\times.035} {200+50 } = 0.013 \end{aligned}\] \[\begin{aligned} \bar{K}(2020) &= \bar{K}(1970)e^{\bar{r}(1970) (2020-1970)}\\ &= 250 e^{.013\times 50} \approx 478.8852 \end{aligned}\]
- Aggregated forecast, growing at the “true” value of \(\bar{r}(25)\) for the whole period. (Use the value of \(\bar{r}(25)\)) that you calculate from the disaggregated forecast):
Translating \(\bar{r}(25)\) onto the 1970 timeline, we should look at \(\bar{r}(1995)\)
\[\begin{aligned}
\bar{r}(1995) &= \sum K_i(1970)r_i e^{r_i (1995-1970)} \over \sum K_i(1970)e^{r_i (1995-1970) }\\
& = \frac{K_u(1970)r_u e^{r_u (25)} + K_m(1970)r_m e^{r_m (25)} }{K_u(1970)e^{r_u (25)} + K_m(1970)e^{r_m (25)} }\\
& =\frac{200\times.0075 e^{.0075\left(25\right)}+50\times.035 e^{.035\left(25\right)}}{200 e^{.0075\left(25\right)}+50 e^{.035\left(25\right)}} \approx 0.0176632\\
\bar{K}(2020) &= 250e^{0.016632(50)} \approx 574.25316
\end{aligned}\]
- Aggregated forecast, growing at the first-order Taylor series estimate of \(\bar{r}(25)\) for the whole period:
\[\begin{aligned} \sigma^2_r(1970) &= \frac{K_u(1970)r_u^2 + K_m(1970)r_m^2} {K_u(1970) + K_m(1970)} - \bar{r}^2(0) \\ & = \frac{(200)(0.0075)^2 + (50)(0.035)^2}{250}-(0.013)^2 \\ & = 0.000121 \\ \hat{\bar{r}}(1995) & \approx \bar{r}(1970) + 25\sigma^2_r(1970) = 0.016025 \\ \bar{K}(2020) &= 250 e^{0.016025(50)} \approx<PHONE_NUMBER> \end{aligned}\]
- Aggregated forecast, growing at the second-order Taylor series estimate of \(\bar{r}(25)\) for the whole period:
For this exercise we need to first calculate the extra second-order term from the Taylor series, \(25^2\bar{r}''(0)\):
\[\begin{aligned} \bar{r}''(1970) &= \frac{200(0.0075)^3+50(0.035)^3}{250} - \frac{200(0.0075)^2+50(0.035)^2}{250} \times (0.013) - 2(0.013)(0.000121)\\ \hat{\bar{r}}(1995) & \approx \bar{r}(1970) + 25\sigma^2_r(1970) +(25)^2\bar{r}''(1970) \\ & = 0.01664891\\ \bar{K}(2020) &= 250 e^{0.01664891(50)} \\ & \approx 574.73337 \\ \end{aligned}\]
- Graphs
There are many methods to project populations.
- Dissaggregated (“true”) forecast, with each country growing at its own rate:
- Show that \(\bar{r}''(t) = \bar{r}_3(t) - \bar{r}_2(t) \bar{r}(t) - 2 \bar{r}(t) \sigma^2_r(t)\)
- For Ken’s Poisson-Exponential model,
- What is the closed-form expression for \(\hat{r}(t)\)
\[\begin{aligned} \hat{r}(t) &= \frac{d}{dt}log(\hat{k})\\ &= r_0 - \alpha \lambda e^{-\alpha t} \end{aligned}\] - What is the variance of the growth rate?
The variance of the growth rate is \(\sigma_r^2(t)\): \[\bar{r}'(t)= \sigma^2_r(t) = \alpha^2\lambda e^{-\alpha t}\] - Write down an expression for the distortion index. What variables and parameters in the model does it depend on? Are there any variables or parameters that it doesn’t depend on? (difference of \(\bar{r}(t)\) and \(\bar{r}(0)\))
Distortion index: \[\begin{aligned} \bar{r}(t) - \bar{r}(0) & = r_0 - \lambda \alpha e^{-\alpha t} - (r_0 - \lambda \alpha e^{0}) \\ & = \lambda \alpha - \lambda \alpha e^{-\alpha t}\\ & = \lambda \alpha(1-e^{-\alpha t}) \end{aligned}\] Depends on \(\lambda\), \(\alpha\), \(t\), but not \(r_0\) or \(s\). That is, it depends on the the gap between growth rates, the relative population sizes, fastest growth rate, the poisson distribution parameter, but not the poisson distributed integers.
- What is the closed-form expression for \(\hat{r}(t)\)
Chapter 2 Problem set 2
2.1 Questions
True/False: The variance of the population distribution of deaths will always be larger than that of the baseline. Explain your answer briefly.
Use the fraily simulator to produce plots of the uniform, gamma, and U-shaped beta distribution. Describe in a sentence, each, how the population hazard behaves at older ages.
Does the behavior of the uniform at older ages look like a population with two (proportional) sub-groups? What do you think is driving this? (This is an open-ended question. You should feel free to use mathematics, intuition, or any other approach to answer.)
Does the behavior of the beta at older ages look like the gamma at older ages? What do you think is driving this? (Also open ended)
At what age do population hazards start to diverge from the baseline in the the three models? Is it fair to say that half the cohort has to have died before unobserved heterogeneity plays a role?
Extend the simulation code to include life expectancy at age x (Shown above.)
Extend the simulation code to include the average frailty of the surviving at age x, z(x). (Note: this requires some more difficulty programming, and I would recommend keeping your N fairly small.)
Extend the simulation code to histograms of frailty of survivors at different ages. Does the uniform stay uniform? How about the other distributions?
Use the method of completing the gamma to get the mean of the gamma distribution. (Hint: I believe there are youtube examples of this).
Derive V&M equation 13, extending Keyfitz’s result. Did your derivation require you to assume proportional hazards; if so, where?
Derive V&M equation 20, extending Keyfitz’s result to proportional changes in the population hazard. Did your derivation require you to assume proportional hazards; if so, where?
Describe a strategy for simulating cross-overs in the aggregate hazards of two groups, which have baseline hazards that don’t cross. If you want, write code and produce a plot.
2.2 Solutions
- True/False: The variance of the population distribution of deaths will always be larger than that of the baseline. Explain your answer briefly.
True.
If each individual has their own hazard schedule proportional to baseline \(z\), there will be more variation in the distribution of deaths than if each person had the baseline case. The variation for homogeneous populations comes from to chance only, while the variation for heterogeneous populations comes from chance and group variation in risk. Therefore, the variance of the population distribution of deaths will always be larger than that of the baseline (unless the variance is 0).
Use the fraily simulator code to produce plots of the uniform, gamma, and U-shaped beta distribution. Describe in a sentence, each, how the population hazard behaves at older ages.
For simplicity, we take the code and convert it into a function that can use frailty draws from different distributions. We also extend it to include life expectancy calculation.source("functions/gomp_funs.R") frailty_sim <- function( N, z, base.a, base.b ){ ## (1) simulate ages at death from h0*z using the gompertz as our baseline## ## note: we call the continuous ages of death "y" ## but we'll make a table of deaths at age "x" and ## using life table notation call the count "Dx" y <- rgomp(N, b = base.b, ## doesn't vary a = base.a * z) ## multiplicative fixed frailty ## (2) Lifetables: first define age at death as floor(y) and then ## make a table of deaths at each age ("Dx") Dx <- get.Dx(y) x <- as.numeric(names(Dx)) lx <- rev(cumsum(rev(Dx))) ## lx by reverse-survival lxpn <- c(lx[-1], 0) ## Person-years as average of adjacent lx Lx <- (lx + lxpn)/2 mx <- Dx/Lx ## Hazards Tx <- rev(cumsum(rev(Lx))) ## Remaining person-years ex <- Tx/lx ## Life expectancy at age x ## Baseline lifetable lx.base <- N * (1- pgomp(x, b = base.b, a = base.a)) Dx.base <- round(-diff(c(lx.base,0))) mx.base <- base.a * exp(base.b * (x + .5)) ## x + .5 lxpn.base <- c(lx.base[-1], 0) Lx.base <- (lx.base + lxpn.base)/2 Tx.base <- rev(cumsum(rev(Lx.base))) ex.base <- Tx.base/lx.base # exported tables lifetables <- list() lifetables$sim <- y lifetables$z <- z lifetables$baseline <- tibble(Dx.base, lx.base,lxpn.base, Lx.base, mx.base, Tx.base, ex.base) lifetables$frailty <- tibble(x,Dx, lx,lxpn, Lx, mx, Tx, ex) return(lifetables) }
- Uniform distribution:
We find that the uniform-distributed frailty begins to increase more slowly after age 60 compared to baseline.
# Parameters million = 10^6 N <- million base.a <- 10^-4 base.b <- 1/9 set.seed(1047) # for reproducibility #Uniform distribution w <- .3 ## try smaller if you want z <- runif(N, min = 1 - w , max = 1 + w) uniform_frailty <- frailty_sim(N, z, base.a, base.b)
- Gamma frailty distribution:
Gamma-distributed frailty begins to increase more slowly after age 60 compared to baseline.This is similar to the uniform frailty distribution.
# Parameters million = 10^6 N <- million base.a <- 10^-4 base.b <- 1/9 set.seed(1047) # for reproducibility #Gamma distribution my.sd <- .5 sigma.sq <- my.sd^2 z <- rgamma(N, shape = 1/sigma.sq, scale = sigma.sq) gamma_frailty <- frailty_sim(N, z, base.a, base.b)
- Beta frailty distribution:
Beta-distributed frailty begins to increase more slowly after age 60 compared to baseline and eventually stops increasing at age 100.
# Parameters million = 10^6 N <- million base.a <- 10^-4 base.b <- 1/9 set.seed(1047) # for reproducibility #Beta distribution z <- rbeta(N, shape1 = .5, shape2 = .5) beta_frailty <- frailty_sim(N, z, base.a, base.b)
- Uniform distribution:
- Does the behavior of the uniform at older ages look like a population with two (proportional) sub-groups? What do you think is driving this?
It doesn’t look like two proportional subgroups. It looks like the frailty is drawn from a single distribution.
- Does the behavior of the beta at older ages look like the gamma at older ages? What do you think is driving this?
The behavior is somewhat similar, as the hazards are increasing more slowly at older ages. However, the beta hazards stops increasing at a certain point. The uniform and the gamma are more similar. For the parameters we used, beta-distributed frailty generates many very-frail or very-robust individuals and fewer medium-frail individuals. Gamma-distributed frailty generates many medium-frail individuals but fewer very-frail or very-robust individuals.
- At what age do population hazards start to diverge from the baseline in the the three models? Is it fair to say that half the cohort has to have died before unobserved heterogeneity plays a role?
Generally around age 65, but if frailty is beta distributed (with our set of parameters) then we observe a divergence earlier. For the gamma and uniform frailty models roughly half the cohort has to die before unobserved heterogeneity plays a role, but for the beta model we observe divergence in the survival curve much earlier.
Extend the simulation code to include life expectancy at age x.
Within the frailty function, we include the steps to calculate life expectancy. We also limit the ages up to 100 for each simulation, to avoid extreme and non-realistic results. This is particularly relevant for the beta frailty distribution which leads to ages above 110 to be sampled.Extend the simulation code to include the average frailty of the surviving at age x, z(x). (Note: this requires some more difficulty programming, and I would recommend keeping your N fairly small.)
- Extend the simulation code to histograms of frailty of survivors at different ages. Does the uniform stay uniform? How about the other distributions?
The uniform does not remain uniform.  This leaves an exponentially decreasing distribution of frailty for survivors age 75+. The gamma remains a gamma but the parameters change. The beta, similar to the uniform, does not remain beta. There is an exponentially decreasing distribution of frailty for survivors age 75+. - Use the method of completing the gamma to get the mean of the gamma distribution.
\[\begin{aligned} \mu & = \int_0^{\infty} \frac{1}{\Gamma(k) \lambda^k} z^{k - 1} e^{-\frac{z}{\lambda}} \\ & = \frac{\Gamma(k+1) \lambda^{k+1}}{\Gamma(k+1) \lambda^{k+1}} \cdot \int_0^{\infty} \frac{1}{\Gamma(k) \lambda^k} z^{k - 1} e^{-\frac{z}{\lambda}} \\ & = \frac{\Gamma(k+1) \lambda^{k+1}}{\Gamma(k) \lambda^{k}} \cdot \int_0^{\infty} \frac{1}{\Gamma(k+1) \lambda^{k+1}} z^{k - 1} e^{-\frac{z}{\lambda}} \\ & = k \lambda \cdot 1 \\ & = k \lambda \end{aligned}\] - Derive V&M equation 13, extending Keyfitz’s result. Did your derivation require you to assume proportional hazards; if so, where?
- Derive V&M equation 20, extending Keyfitz’s result to proportional changes in the population hazard. Did your derivation require you to assume proportional hazards; if so, where?
- Describe a strategy for simulating cross-overs in the aggregate hazards of two groups, which have baseline hazards that don’t cross. If you want, write code and produce a plot.
Chapter 3 Problem set 3
3.1 Questions
- Under gamma frailty, we obtained an explicit expression for average frailty by age for any baseline hazard schedule. \[ \bar{z}=\frac{1}{1+\sigma^2 H_0(x)}\] Assume baseline mortality is Gompertz (say with a = \(10^{-4}\) and b = 1/12). Try a couple of different values of \(\sigma^2\) (but make sure one of these values is 1/7 for comparability with the next problem). Describe what happens to average frailty at older ages. Does it decrease exponentially? If so, is there an age at which the rate of decrease equals (or at least comes very close to) the exponential rate of increase in baseline hazards b? Does this age depend on \(\sigma^2\)?
- Obtain from the Human Mortality Database a schedule of single-year-of-age, cohort mortality rates for females born in 1880 in Italy. Use the “inversion formula” for the gamma distribution to obtain the baseline hazards implied by \(\sigma^2= 1/7\). Plot the observed and implied baseline schedule. Plot the average frailty by age. Do your results resemble or differ from the Gompertz case above ?
- Derive V&M ’s result (5E):\[\overline{R}(x) \equiv \frac{\bar{\mu}_2(x)}{\bar{\mu}_1(x)} = \frac{R + R \sigma_1^2 H_1(x)}{1 + R \sigma_2^2 H_1(x)} \]
- Use mathematics to say what the determinants of the age of crossover are in terms of the respective frailty variances, R, and a baseline Gompertz schedule.
- Simulate this cross over with two proportional Gompertz schedules, with different frailty variances. Can you get a cross-over? If so, does it occur when cumulative hazard satisfy the condition (in small font) at the end of 5E?
- Use simulation to say what the determinants of the age of crossover are in terms of the respective frailty variances, R, and the baseline Gompertz schedule.
- Get two Italian cohorts 20 years apart and calculate the rate of mortality improvement by age \(\rho(x)\) that you observe and that which you would have observed had there been no frailty. For frailty, assume gamma-distributed with \(\sigma^2 = 1/5\).
- Extend the CenSoc demonstration of changing characteristics with age in at least one of the following ways
- Use years of education instead of wage income.
- Use both years of education and wage income.
- Analyze Blacks and Whites separately using wage income? Is the variance of “observed heterogeneity” (\(\hat{z}_{obs}\)) larger for one group. Discuss briefly.
3.2 Solutions
- Under gamma frailty, we obtained an explicit expression for average frailty by age for any baseline hazard schedule. \[ \bar{z}=\frac{1}{1+\sigma^2 H_0(x)}\] Assume baseline mortality is Gompertz (say with a = \(10^{-4}\) and b = 1/12). Try a couple of different values of \(\sigma^2\) (but make sure one of these values is 1/7 for comparability with the next problem). Describe what happens to average frailty at older ages. Does it decrease exponentially? If so, is there an age at which the rate of decrease equals (or at least comes very close to) the exponential rate of increase in baseline hazards \(b\)? Does this age depend on \(\sigma^2\)?
Let \(H_0\) be a gompertz curve with parameters a = \(10^{-4}\) and b = 1/12. The average frailty over age depends on the level of \(\sigma^2\) as seen by the left handside graph. As \(\sigma^2\) increases, average fraily decreases at an exponential rate at earlier ages. That is, when \(\sigma^2\) is very large (ie, 50) the exponential decrease begins almost instantly. However, with a very small \(\sigma^2\) of 0.01 the average frailty is almost constant except at older ages. Therefore \(\sigma^2\) determines when average frailty starts to decrease.
The graph on the right shows the derivative over ages of each of the average frailty curves as well as the \(b\) parameter of the baseline Gompertz mortality (in blue). Regardless of the the value of \(\sigma^2\), none of the derivatives are close enough to equal the \(b\) parameter.Analytically, the derivative of average frailty is always going to be negative and very small. \[\frac{d}{dx}\bar{z}= -\sigma^2ae^{bx}\bar{z}(x)^2\].
- Obtain from the Human Mortality Database a schedule of single-year-of-age, cohort mortality rates for females born in 1880 in Italy. Use the “inversion formula” for the gamma distribution to obtain the baseline hazards implied by \(\sigma^2= 1/7\). Plot the observed and implied baseline schedule. Plot the average frailty by age. Do your results resemble or differ from the Gompertz case above ?
In order to get the baseline hazards implied by \(\sigma^2\) = 1/7, we can use the inversion formula \[\mu_0 (x) = \bar{\mu}(x)e^{\sigma^2\bar{H}(x)}\]
Taking logs, this gives us \[log(\mu_0 (x)) = log(\bar{\mu}(x))+{\sigma^2log(\bar{H}(x))}\]
\(H(x)\) is equal to the summation of \(\mu(x)\) in continuous time, so we can take the cumulative sum of these mortality rates to get the cumulative hazards. We can then use this to calculate the baseline hazards schedule.
Now let’s plot average frailty by age. While the shape of the mean frailty graph is the same in both cases, average frailty seems to decline more rapidly here than in the Gompertz case (this is driven by early ages.)
- Derive V&M ’s result (5E)
Since \(\mu_2(x) = R\mu_1(x)\) and frailty is distributed gamma with variances \(\sigma_1^2\) and \(\sigma_2^2\), respectively, we can rewrite \[\bar{R}(x) = \frac{\bar{\mu_2}(x)}{\bar{\mu_1(x)}}\] as
\[\begin{aligned} \bar{R}(x) & = {\mu_2(x) \over 1+\sigma^2_2H_2(x)} \times{1+H_1(x)\sigma^2_1 \over \mu_1(x)} \\ & = { \bar{\mu}_2(x) \over \bar{\mu}_1(x) }\times { 1+H_1(x)\sigma^2_1 \over 1+H_2(x)\sigma^2_2 } \end{aligned}\] Since \(H_2 = R*H_1\), \[\begin{aligned} & = {R} \times { 1+\sigma^2_1 H_1(x) \over 1+R\sigma^2_2 H_1(x) }\\ & = { R+R\sigma^2_1 H_1(x) \over 1+R\sigma^2_2 H_1(x) } \end{aligned}\] - Use mathematics to say what the determinants of the age of crossover are in terms of the respective frailty variances, R, and a baseline Gompertz schedule.
The age crossover occurs at \(\bar{u_1} = \bar{u_2}\), which occurs at \(\bar{R} = 1\). Rearranging 5E after equating it to 1 gives us \[1+R\sigma_2^2(H_1(x_c)) = R+R\sigma_1^2(H_1(x_c))\] \[H_1(x_c)(R\sigma_1^2 - R\sigma_2^2) = 1-R\] \[H_1(x_c) = { R -1 \over R(\sigma_2^2 - \sigma_1^2)}\] Assuming a baseline hazard schedule \(H_1(x)\) that is Gompertzian, we can solve to get the age of crossover \(x_c\). \[ \begin{aligned} {a \over b}(e^{bx_c} -1) & = { R -1 \over R(\sigma_2^2 - \sigma_1^2)} \\ x_c & = {1 \over b} \log \bigg({ {(b/a)(R-1)}\over R(\sigma^2_2-\sigma^2_1)} +1\bigg) \end{aligned}\] Simulate this cross over with two proportional Gompertz schedules, with different frailty variances. Can you get a cross-over? If so, does it occur when cumulative hazard satisfy the condition (in small font) at the end of 5E?
Now we can graph this to observe the crossover. In Problem 4, we calculate an age where this crossover would occur based on 5E, and here, graphing that line in grey, we see that the crossover occurs at exactly that point.
We borrow the frailty simulation function from problem set 2 and use it to create two schedules with Gamma frailty distributions (with different variances) and where the scales of the gompertz curves are proportional.
Use simulation to say what the determinants of the age of crossover are in terms of the respective frailty variances, R, and the baseline Gompertz schedule.
If we alter any of the parameters here, it would change the age of crossover in accordance with that observed in Problem 4. We can simulate this by writing the previous code as a function and running it with different parameters.Now let’s run this for different values of alpha, beta, R, and the two variances. In the first set of graphs, changing the two variances to compare when they are very different and when they are very similar. Age of crossover does not seem to change very much.get.crossover.plot <- function( N, sigmasq.1.fun, sigmasq.2.fun, beta.fun, alpha.fun, R.fun) { #Now let's generate the zs for this using the rgamma function. z1.fun <- rgamma(N, shape = 1/sigmasq.1, scale = sigmasq.1) z2.fun <- rgamma(N, shape = 1/sigmasq.2, scale = sigmasq.2) #Since these are proportional Gompertzian schedules, they will have the same b but different alphas, scaled by R #We can use the frailty simulation function from now onwards schedule1 <- frailty_sim(N, z1.fun, base.a = alpha.fun, base.b =beta.fun) schedule2 <- frailty_sim(N, z2.fun, base.a = R*alpha.fun, base.b =beta.fun) #Crossover plots plot(schedule1$frailty$x, log(schedule1$frailty$mx), type = "l", lty = 1, lwd = 2, col = "black", xlab = "Age", ylab = "log hx") lines(schedule2$frailty$x, log(schedule2$frailty$mx), type = "l", col = "red", lty = 1, lwd = 2) legend("topleft", title = "Variance", legend = c(sigmasq.1.fun, sigmasq.2.fun ), col = c("black", "red"), lwd = 2,lty = 1) mtext(paste0("R= ", R.fun," Base a = ", alpha.fun, " Base b = ", round(beta.fun,2) ), side=3) }
Then, when changing alpha so that we can compare a very small alpha with a large one, a crossover occurs earlier with a larger value.By changing beta to compare a very small beta and a large one, we get a crossover very early with a large beta.
Finally, if we compare a large and small r, there does not seem to be a difference in the crossover ages.
Get two Italian cohorts 20 years apart and calculate the rate of mortality improvement by age \(\rho(x)\) that you observe and that which you would have observed had there been no frailty. For frailty, assume gamma-distributed with \(\sigma^2 = 1/5\).
The observed rate of mortality improvement can be calculated using \[ \bar{\rho}(x,t) = - {1 \over t} \log {m_{t2}(x) \over m_{t1}(x) }\] and the version with frailty can be calculated using: \[ \rho(x,t) = \bar{\rho}(x,t) + \sigma^2\ {d \over dt}\bar{S}_c (x,t) \] Now we can calculate the rates of improvement in mortality and compare them. When we assume frailty, we get a higher rate of improvement at the older ages than in the observed case.
We obtain the Italian cohort female lifetable (1x1) from the Human Mortality Database (HMD).
- Extend the CenSoc demonstration of changing characteristics with age in at least one of the following ways
- Use years of education instead of wage income.
- Use both years of education and wage income.
Analyze Blacks and Whites separately using wage income? Is the variance of “observed heterogeneity” (\(\hat{z}_{obs}\)) larger for one group. Discuss briefly.
Let’s see how this changes for education.
- Use years of education instead of wage income.
## NULL
## NULL
b. The easiest way to compare both income and education is to compare income (on the y-axis) while letting education vary. For simplicity we took 4 education bins: 0-5 years, 5-10 years, 10-15 years and more than 15 years: as well as their standardized analoges. The intensity of colors increases with the number of years of education. c. We’ll run the wage income comparison for Blacks and Whites separately.
Now let's graph these two. We can see a decline in log wages with age for Blacks that we do not observe for Whites, for whom this tends to increase by age. This suggests that we may observe greater variance in heterogeneity for blacks than for Whites.
Chapter 4 Problem set 6
4.1 Questions
- Using the tempo_simu.R file,
- Try with N of 4 million – does it still work? What happens?
- Try with a shift function that goes up and down. Are the adjusted counts ever LESS than the observed counts? If so, when?
- If the cumulative shift was Rt = a + 0.1*t, what would be a formula for tempo-adjusted counts of births? Sketch the 4 panels without the computer and then check to see if you’re right.
- Calculate the age profile of fertility change predicted by the BongaartsFeeney model by taking time derivatives of the log schedules. You will end up with three terms. Describe each of these in words.
- Use simulation based on tempo simu.R to check your answer.
- Is there a diagnostic plot that you could do to compare observed agespecific changes to those predicted by the BF model? Hint: use normalized schedules that sum to 1.0
- Use this diagnostic plot to all-order fertility change during the Great Recession.
- Use this diagnostic plot to 1st, 2nd, and 3rd births.
- Fit the two-part normal mixture model to fertility from another country based on what looks interesting in the Burkimsher paper. (E.g., Canada, Portugal, or the Netherlands). I recommend doing this for 1 year, but once you get your code running, you could iterate over years. Use graphs to discuss the goodness of fit. And if you do more than 1 year, discuss whether the time trends in the parameters make substantive sense)
4.2 Solutions
- Using the tempo_simu.R file,
- Try with N of 4 million – does it still work? What happens?
This simulation will first sample from a normal distribution draws of ages that represent the ages of women when giving birth for the first time. It also creates as shift function \(R(t)\) which affects all women of a given year.
Yes, it still works. In fact, we see that the adjusted births are very close to the observed births when using this number of simulations. (I continue to use an N of 4 million for the rest of this problem).
- Try with a shift function that goes up and down. Are the adjusted counts ever LESS than the observed counts? If so, when?
The adjusted counts are not always less than the observed. Naturally, this only happens when we have spikes on the observed counts that become smoother after the adjusting of the birth counts.
- If the cumulative shift was Rt = a + 0.1*t, what would be a formula for tempo-adjusted counts of births? Sketch the 4 panels without the computer and then check to see if you’re right.
Let \(a = -199\), so we get a shift of 0 to about 3 years depending on the time period:
- Try with N of 4 million – does it still work? What happens?
This simulation will first sample from a normal distribution draws of ages that represent the ages of women when giving birth for the first time. It also creates as shift function \(R(t)\) which affects all women of a given year.
Yes, it still works. In fact, we see that the adjusted births are very close to the observed births when using this number of simulations. (I continue to use an N of 4 million for the rest of this problem).
- Calculate the age profile of fertility change predicted by the BongaartsFeeney model by taking time derivatives of the log schedules. You will end up with three terms. Describe each of these in words.
\[\begin{aligned} f(a,t)&=f_0(a-R(t))[1-R'(t)]q(t)\\ log(f(a,t))&=log(f_0(a-R(t))) + log(1-R'(t)) + log(q(t))\\ \frac{\partial log(f(a,t))}{\partial t}&=\frac{\partial log(f_0(a-R(t)))}{\partial t} + \frac{\partial log(1-R'(t))}{\partial t} + \frac{\partial log(q(t))}{\partial t}\\ \frac{\partial log(f(a,t))}{\partial t}&=-R'(t)\frac{f_0'(a-R(t))}{f_0(a-R(t))} -\frac{R''(t)}{1-R'(t)} + \frac{q'(t)}{q(t)} \end{aligned}\] The first term represents the proportional change in the fertility of the equivalent pre-postponement cohort. In particular, it is divided into (how far someone shifts ‘over’ relative to ages on the baseline fertility schedule) and an \(R'(t)\) term (how much one shifts ‘up’). The second term represents the proportional change in the rate of change in years of postponement; it is a tempo-effect. The third term represents the proportional change in quantum. Use simulation based on tempo simu.R to check your answer.
Thetempo_simu.R
function computes \(R(t)\) but we need to obtain the remaining components of the answer from the previous excercise. For simplicity, let’s assume that there are no tempo effects (\(q(t)=0\)) and that \(a=25\), that is, our baseline schedule is that of women aged 25.- \(R(t)\) components:
Let’s briefly look at \(R(t)\), \(R'(t)\), and \(R''(t)\). In
tempo_simu.R
\(R(t)\) refers to the cumulative shift object (shift.t
). We can obtain the derivatives by taking the centered difference of this object.
shift.t.prime <- center.diff(shift.t) shift.t.prime.2 <- center.diff(shift.t.prime) par(mfrow = c(2,2)) plot(1991:2020, shift.t, main = 'R(t)', xlab = '', ylab = '') plot(1991:2020, shift.t.prime, main = 'R\'(t)', xlab = '', ylab = '') plot(1991:2020, shift.t.prime.2, main = 'R\'\'(t)', xlab = '', ylab = '') plot(1991:2020,-shift.t.prime.2/ (1-shift.t.prime), main = '-R\'\'(t) / (1- R\'(t))', xlab = 'year', ylab = '')
- \(f_0(a-R(t))\) function: In the Bongaarts and Feeney model, the baseline schedule of women of age \(a\) at time \(t\) is \(f_0(a-R(t))\). That is, it is the fertility schedule that is observed because of the shift. From the simulation, we obtain a table of births at each age and the age-specific fertility rates. Then, we can look at the original and the observed ASFRs. The original ASFR is that from the simulation, which we would not observe. Rather we would only the see the ASFR from births that were postponed by year-specific shifts.
The component that we are interersted in is the first derivative of the baseline schedule (\(f_0(a-R(t))\)).# floor everything dt_floored <- dt %>% transmute('x' = floor(x), 't' = floor(t), 't.obs' = floor(t.obs), 'x.obs' = floor(x.obs)) # the .obs values are the ones that go into the baseline function. # Births to women born at each age. original_sched <- table(dt_floored$x, dt_floored$t) observed_sched <- table(dt_floored$x.obs, dt_floored$t.obs) # ASFR (The denominator is 100 person years lived, or 100 women at each age) asfr_original<- original_sched/(100*thousand) #f(a,t) asfr_observed <- observed_sched/(100*thousand) #f_0(a,t) #Graph of ASFRs for observed and original births. The lines get lighter with each year. par(mfrow=c(2,1)) matplot(rownames(asfr_observed), asfr_observed, type = "l", lty = 1, col=grey(seq(0, 1, length = 40)), xlab = 'Age', ylab = 'ASFR', main = 'Observed ASFR') abline(v= 25, lty = 2, col = 'black') matplot(rownames(asfr_original), asfr_original, type = "l", lty = 1, col=grey(seq(0, 1, length = 40)), xlab = 'Age', ylab = 'ASFR', main = 'Original ASFR') abline(v= 25, lty = 2, col = 'black')
- Comparison of terms from original and observed data: We can merge all the terms of the formula from the previous question and compare it to the derivative of the log version of the observed fertility schedules.
## 5 6 7 8 9 10 11 12 ## NaN NaN NaN NaN Inf NaN 0.0279104400 0.0284926376 ## 13 14 15 16 17 18 19 20 ## 0.0264610984 0.0237212086 0.0217063493 0.0201999478 0.0180307054 0.0163718360 0.0143367711 0.0126676950 ## 21 22 23 24 25 26 27 28 ## 0.0108740251 0.0089406636 0.0070038016 0.0051380233 0.0032746533 0.0013796601 -0.0004524888 -0.0022009709 ## 29 30 31 32 33 34 35 36 ## -0.0041665665 -0.0059568771 -0.0079508464 -0.0098116081 -0.0116493883 -0.0134483969 -0.0152374780 -0.0174666475 ## 37 38 39 40 41 42 43 44 ## -0.0187958955 -0.0213274275 -0.0225088932 -0.0246023349 -0.0284561023 -0.0218511609 NaN NaN ## 45 46 47 48 ## NaN NaN NaN NaN
## 5 6 7 8 9 10 11 12 13 ## NaN NaN NaN -Inf -0.04661512 -0.03769700 -0.02995997 -0.06192639 -0.05078215 ## 14 15 16 17 18 19 20 21 22 ## -0.04858363 -0.05152016 -0.05218837 -0.05159206 -0.05148395 -0.05160988 -0.05209997 -0.05204756 -0.05258484 ## 23 24 25 26 27 28 29 30 31 ## -0.05193104 -0.05309911 -0.05345465 -0.05218494 -0.05232512 -0.05222811 -0.05151393 -0.05223201 -0.05259580 ## 32 33 34 35 36 37 38 39 40 ## -0.05334486 -0.05261664 -0.05131790 -0.04743019 -0.05145224 -0.06105139 -0.06151550 -0.04560559 -Inf ## 41 42 43 44 45 ## -Inf NaN NaN NaN NaN
- \(R(t)\) components:
Let’s briefly look at \(R(t)\), \(R'(t)\), and \(R''(t)\). In
Chapter 5 Problem set 8
5.1 Problems
5.2 Solutions
For the following problems, let \(p_0 = 0.3\), \(p_1=0.3\), \(p_2=0.4\). Use the function \(h(z) = p_0 + p_1 z + p_2 z^2\). This gives \(m= 0.3(0) + 0.3(1) + 0.4(2) = 1.1\), which is supercritical.
1. Multiply out \(h(z)^3\) algebraically and explain how the coefficient on \(z^4\) consists of all of the possible ways for 3 fathers to produce a total of 4 sons
Finding \(h(z)^2\):
\[\begin{aligned}
h(z)^2 &= (p_0 + p_1 z + p_2 z^2)\times(p_0 + p_1 z + p_2 z^2) \\
&= p_0^2+2p_0p_1z+(2p_0p_2+p_1^2)z^2 + 2p_1p_2z^3 + p_2^2z^4
\end{aligned}\]
Multiplying out again:
\[\begin{aligned}
h(z)^3 &= h(z)^2 h(z) \\
&= [p_0^2+2p_0p_1z+(2p_0p_2+p_1^2)z^2 + 2p_1p_2z^3 + p_2^2z^4]\times(p_0 + p_1 z + p_2 z^2) \\
&= p_0^3 + (3p_0^2p_1)z + (3p_0^2p_2 + 3p_0p_1^2)z^2 +(6p_0p_1p_2+p_1^3)z^3 + \\
& (3p_0p_2^2+3p_1^2p_2)z^4+ (3p_1p_2^2)z^5 + (p_2^3)z^6\\
\end{aligned}\]
To get a total of 4 children, either two of the fathers have 2 sons each and the third has no sons (\(p_0p_2^2\)), or one of the fathers has 2 sons and the others each have 1 son (\(p_1^2p_2\)). With three fathers, there are 3 ways for each of these combinations to appear; corresponding to the \(3p_0p_2^2+3p_1^2p_2\) coefficient on \(z^4\).
2. Multiply out \(h_2(z) = h(h(z))\) algebraically and explain how the coefficient on \(z^2\) consists of all of the possible ways for a woman to have 2 grand-daughters.
\[\begin{aligned}
h(h(z)) & = p_0+p_1h(z)+p_2h(z)^2 \\
& = p_0 +p_1[p_0 + p_1 z + p_2 z^2] + p_2[p_0^2+2p_0p_1z+(2p_0p_2+p_1^2)z^2 + 2p_1p_2z^3 + p_2^2z^4] \\
&= [p_0+p_0p_1+p_0^2p_2] + [2p_0p_1p_2+p_1^2]z +\\
& [2p_0p_2^2+p_1p_2+p_1^2p_2]z^2 + [2p_1p_2^2]z^3+[p_2^3]z^4
\end{aligned}\]
Here are the ways a woman can end up with 2 granddaughters: first, she can have a single daughter who herself has 2 daughters (\(p_1p_2\)). Or, she can have 2 daughters who then each have 1 daughter (\(p_1^2 p_2\)). Lastly, she can have 2 daughters, one of which has 2 daughters and one who has no daughters (\(2p_0 p_2^2\); note there are two ways for this to happen because there are two daughters in the second generation). These possibilities correspond to the \(2p_0p_2^2+p_1p_2+p_1^2p_2\) coefficient on \(z^2\)
3. Write an R-program to reproduce 20 entries of the table (This is for our values of \(p_0 = 0.3\), \(p_1=0.3\), \(p_2=0.4\), not the \(p_k\) values on wikipedia)
| Generation Number | Extinction probability | Generation Number | Extinction probability |
|---|---|---|---|
| 1 | 0.30000 | 11 | 0.68599 |
| 2 | 0.42600 | 12 | 0.69403 |
| 3 | 0.50039 | 13 | 0.70088 |
| 4 | 0.55027 | 14 | 0.70676 |
| 5 | 0.58620 | 15 | 0.71183 |
| 6 | 0.61331 | 16 | 0.71623 |
| 7 | 0.63446 | 17 | 0.72006 |
| 8 | 0.65135 | 18 | 0.72342 |
| 9 | 0.66511 | 19 | 0.72636 |
| 10 | 0.67648 | 20 | 0.72895 |
| — | — | — | — |
The extinction probability is converging to 0.75 (going out to 50 or 60 generations is helpful for observing this).
Sample code:
d_zero <- 0
p_zero <- 0.3
p_one <- 0.3
p_two <- 0.4
n_gen <- 20
value_table <- matrix(0, nrow = n_gen, ncol = 2)
d_prev <- d_zero
for (i in 1:n_gen) {
prob_extinction <- p_zero + d_prev*p_one + (d_prev^2)*p_two
value_table[i,1] = i
value_table[i, 2] = prob_extinction
d_prev <- prob_extinction
}
- Use the quadratic formula to solve for \(d\), the probability of ultimate extinction: \(d = p_0 + p_1d + p_2d^2\). What do you get for \(d\) given our \(p_k\) values above? Does it correspond to the same value one gets by using iteration, as in the Wikipedia table?
Do some rearranging of \(d = p_0 + p_1d + p_2d^2\) to get: \[0 = p_2d^2 +(p_1-1)d + p_0 \]
Solving with the quadratic formula: \[ d^* = {(1-p_1) \pm \sqrt{(p_1-1)^2 - 4p_2p_0} \over 2p_2 } \] Filling in our given \(p_k\) values: \[\begin{aligned} d^* &= \frac{(1-0.3) \pm \sqrt{(0.3-1)^2 -4(0.4)(0.3)}}{2(0.4)} \\ &= \{0.75, 1\} \end{aligned}\]
Since \(m>1\), there are two roots: 1 and 0.75. \(d=0.75\) is the solution we are interested in, and it indeed agrees with the probability of the extinction that our iterative solution converges to. - Simulate a critical branching process such that m = 1 by reversing the \(p_1\) and \(p_2\) values we’re using. Check that \(m = 1\). You can use the “branch()” code in the slides.
Let \(p_0=0.3\), \(p_1 =0.4\), \(p_2=0.3:\)m = 0(0.3) + 1(0.4)+2(0.3) = 1$.- See if you can do a big number of trials, 1000? For many generations, 30, 50, 100?
Sample simulation with 1000 trials for 100 generations (seed set to 91): - What fraction of lines become extinct?
96.6% of lines become extinct by generation 100 with the above simulation. The following plot shows extinction at each generation: - What is the distribution of surviving lines? (Hint: Choose a time that is is not so distant that few lines survive)
The following histograms show surviving lines’ sizes at select generations. At each generation, we can see something resembling a geometric distribution. - What is the mean and variance of of \(Z_{10}\), \(Z_{20}\) and \(Z_{30}\)? What will happen as \(n \to \infty\)?
- See if you can do a big number of trials, 1000? For many generations, 30, 50, 100?
| Generation \(n\) | Mean \(Z_n\) | Var \(Z_n\) |
|---|---|---|
| 10 | 1.009 | 5.20001 |
| 20 | 1.012 | 10.7426 |
| 30 | 0.991 | 17.53045 |
<div class="figure">
<img src="figures/meanvar.png" alt="Survival mean and variance" width="100%" />
<p class="caption">(\#fig:unnamed-chunk-50)Survival mean and variance</p>
</div>
The mean and variance calculated above account for all lines, not just surviving ones. In this simulation, the mean tends to hover around 1 and the variance tends to increase with generation number, at least up to a certain point.
As \(n\to \infty\), the mean and variance theoretically will go to zero (since \(m=1\) is critical, all lines must eventually die out).


I offer Custom Application Development using the C# or Visual Basic Programming language. Whether you already have an app and need changes made OR you have an idea and need a Developer to make it happen, then I can help!
If you need an extra Developer to come in and give you a hand fixing bugs or adding new features then I can help!
Does your app have bugs? Does it crash more than you want it to? I can help by developing an Automated Testing Suite for your application. I can also document your application so that changes are easier and more cost-effective to make.
I believe Software Development is a craft that should be practiced much in the same way as an Electrician or Carpenter does. This means that I use practices like Test-Driven Development and Acceptance Testing to deliver high-quality work to my clients at a reasonable cost.


{% extends "tracker/base.html" %} {% block title %} About {% endblock %} {% block about_active %}active{% endblock %} {% block content %}
This program was built using Python's Django framework for backend, and Materialize CSS for the frontend. It was written as a final project for CS 232 - Python Programming by Peter Boster


Nolla.net is a community of people who are into various board sports. Check out the latest news and find useful information. We publish articles, reviews, interviews, photos, videos and other media content.
Register for a user account and contribute. We are always looking for people who want to create and share content.


|
We use statistical methods, to group the regions into two areas based on average historical, growing degree day accumulation. The warmer areas have an avgerage, annual historical GDD of XX, degree day F (provide a range), and the cooler areas have a, historical GDD of YY degree, days F (provide a range). |


I am a developer and open source lover doing B. Tech in Computer Engg. from VIT, Pune.
I am a System Software Intern at Nvidia, Pune.
I got Google`s scholarship for Android Developer Nanodegree course at Udacity.
I have built several Android Apps. Few are available on Google Play store and few are available on my github page.
About
-
I have few Android appsin my credit.
Few of the apps I developed are:
FoFoLi: Food For Life is a location based Android app which acts as bridge between food donars and hungry poor people. Anyone having extra fresh food can donate it through this app and one of the nearby volunteers will go to food donar, collect food and distribute to poor hungry people in the vicinity. This is my small step towards hunger elimination from India. Source code available on Github
MissU: Finds the missing people using face recognition. Source code available on Github
Hajeri: Attendance app for teachers to maintain students` attendance. Source code available on Github
Hare Krishna Counter: App to chant and count the Hare Krishna mahamantra for devotees of ISKCON. Source code available on Github
Sadhana SMS: App to send the everyday sadhana(devotional practice) sms to counselor for devotees of ISKCON. Source code available on Github
I got the Google`s sholarship for udacity`s Android Developer Nanodegree course in March 2016
I won "Best Project" award on April 1, 2016 for my Android App Food For Life in I2I state level competition.
I conducted two android development workshop for PD club in my college.
I know Java, Python, Django framework, MongoDB, C, C++ and C#.
I know Android, HTML5, CSS3, JavaScript and SQLite3.
I developed Nine men`s morris game in Python as my 3rd semester miniproject.
I also developed health management system using Django framework in Python as my 4th semester miniproject.
I also developed an android app - Hajeri as my 5th semester miniproject.
I was the technical co-ordinator in Melange `15 - The Annual Inter college Fest of VIT, Pune.
I won 3rd prize at state level in I2I social project in 2015.
I won two 2nd prizes at state level in I2I social projects in 2014.
I volunteered in NSS Camp 2013.


Seamus Golf Unveils Collaboration With Nike
The Seamus x Nike Golf Air Zoom Victory Tour can be worn on and off the course.
by Emily JensenGolfing goods company Seamus Golf has teamed up with Nike for a shoe suitable for golf enthusiasts and sneakerheads alike. The result of the collaboration is the Seamus x Nike Golf Air Zoom Victory Tour, which mixes leather and wool for an updated take on classic golf style.
The shoe’s outer features brown leather with woodland camouflage waxed canvas on the upper and tongue, while the interior is lined with Pendleton® Tucson Black wool. The shoe also includes a foam sock liner and Nike’s signature Zoom Air unit for extra cushioning. To add even more grip and traction, the sneaker features removable spikes around the sides and heel.
The overall look of the shoe is meant to evoke the Pacific Northwest in homage to Seamus Golf’s Oregon roots, with its mix of materials and textures inspired by a custom golf bag from the company’s founder Akbar Chisti.
“We built our reputation by creating unique, made to order products of impeccable style and quality,” Chisti explains in a press release. “When you see the originality and character of our products in person, it elevates the ‘Wow’ factor to another level. This shoe is no exception. We’re humbled to have inspired this one of a kind golf shoe.”
The Seamus x Nike Golf Air Zoom Victory Tour will launch on Thursday, December 12 at 7 a.m. PST for $200 USD, and will be available from both Nike and Seamus Golf‘s online stores.
For more golf-inspired style, see Bagjack GOLF’s new line of apparel and accessories.


Welcome to JuAFEM.jl’s documentation!¶
Differences between CALFEM and JuAFEM¶
- In CALFEM, the Edof matrix has an index representing the element number. This is pretty useless and has been removed.
- CALFEM made some unfortunate choices in how they set up their matrices for dofs and coordinates. Both Julia and MATLAB use [column major order](https://en.wikipedia.org/wiki/Row-major_order) which means that memory is stored column by column. We therefore also want to store for example the dofs for an element in a column. The concrete effect of this is that the following matrices are transposed in JuAFEM: Edof, Ex, Ey, Ez, Dof, Coord. The dofs for element k is therefore computed by Edof[:, k] instead of like in MATLAB Edof(k, 2:end).
- Some functions in CALFEM can compute a quantity for many elements at a time. In JuAFEM, you need to loop over the elements and call the function on each separate element.


---
fulltitle: 'Backers via Patreon and GitHub'
title: 'Backers via Patreon and GitHub'
layout: bare
---
{% include elements/backers-paragraph.html tier="30" title="Generous backers ($30+)" %}
{% include elements/backers-paragraph.html tier="500" title="Documentation sponsors ($500+)" %}
{% include elements/backers-paragraph.html tier="300" title="Website sponsors ($300+)" %}
{% include elements/backers-paragraph.html tier="100" title="Homepage sponsors ($100+)" %}
{% include elements/backers-paragraph.html tier="10" title="Bulma backers ($10+)" %}


Michigan bills would let college athletes earn money
LANSING, Mich. (AP) - Michigan lawmakers will consider letting college athletes be paid for the use of their name, image and likeness.
Bipartisan bills introduced in the state House on Wednesday are modeled after a proposal signed into law in California in September.
Legislators backing the measures say Michigan should lead on the issue of compensating college athletes because the NCAA is not moving quickly enough. The NCAA Board of Governors voted last month to allow amateur athletes to cash in on their name, image and likeness. Rules and regulations will be finalized by January 2021.
The Michigan sponsors of the legislation are Republican Rep. Brandt Iden, who played tennis at Kalamazoo College, and Democratic Rep. Joe Tate, who played football at Michigan State University.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Press Releases
- 05 December 2008 - Version 2.1.3 has been released.
The focus of this release is stability.
Feature Improvements
- Allow running with user=radiusd and binding to secure sockets.
- Start sending Status-Server "are you alive" messages earlier, which helps with proxying multiple realms to a home server.
- Removed thread pool code from rlm_perl. It's not necessary.
- Added example Perl configuration to raddb/modules/perl
- Force OpenSSL to support certificates with SHA256. This seems to be necessary for WiMAX certs.
Bug Fixes
- Fix Debian patch to allow it to build.
- Fix potential NULL dereference in debugging mode on certain platforms for TTLS and PEAP inner tunnels.
- Fix uninitialized memory in handling of vendor definitions
- Fix parsing of quoted (but non-string) attributes in the users
- Initialize unknown NAS IP to <IP_ADDRESS>, rather than <IP_ADDRESS>
- use SUN_LEN in control socket, to avoid truncation on some platforms.
- Correct internal handling of debug condition to prevent it from being over-written.
- Check return code of regcomp in unlang, so that invalid regular expressions are caught rather than mishandled.
- Make rlm_sql use <ltdl.h>. Addresses bug #610.
- Document list "type = status" better. Closes bug #580.
- Set "default days" for certificates, because OpenSSL won't do it. This closes bug #615.
- Reference correct list in example raddb/modules/ldap. Closes #596.
- Increase default schema size for Acct-Session-Id to 64. Closes #540.
- Fix use of temporary files in dialup-admin. Closes #605 and addresses CVE-2008-4474.
- Addressed a number of minor issues found by Coverity.
- Added DHCP option 150 to the dictionary. Closes #618.
- 04 December 2008 - Version 2.1.2 has been released.
- Due to packaging issues, 2.1.2 has been pulled from the net.
- 25 September 2008 - Version 2.1.1 has been released.
The focus of this release is stability.
Feature Improvements
- Many more options and features are available via radmin. See man radmin and raddb/sites-available/control-socket.
- Many more commands available via the control socket. Connect via radmin, and type help for more information.
- Added dictionary.networkphysics and dictionary.lancom.
- Calculate WiMAX MIP keys, and added sample WiMAX SQL tables.
Bug Fixes
- Fixed bug that made radmin not work.
- Fixed Suse && Debian package scripts.
- Fixed issues with dynamic clients.
- Fixed configure checks for -lreadline
- rlm_sqlippool no longer needs to be linked to rlm_sql.
- Add statistics for detail file listeners. This closes bug #593.
- Fixed printing of some WiMAX attributes.
- Fixed double free on exit() in rlm_attr_filter.
- Fixed build issues on Solaris.
- Fixed fast session resumption for EAP-TLS.
- 05 September 2008 - Version 2.1.0 has been released.
The focus of this release is features.
Feature Improvements
- Clients may now be defined dynamically, based on IP address. See raddb/sites-available/dynamic-clients.
- SNMP support is now available through an experimental Perl script. See scripts/snmp-proxy/README
- SNMP statistics are also available through Status-Server packets. See raddb/sites-available/status
- Added more Microsoft attributes from bug #568.
- The linelog module has more functionality and flexibility. See raddb/modules/linelog.
- The debugging output has been sanitized. It should be much more readable.
- Debug logs can now be turned on/off while the server is running, for a user, group, realm, etc. See the log section of raddb/radiusd.conf.
- Added support for WiMAX Forum attributes. The dynamic keys are not yet calculated. See share/dictionary.wimax
- Added session resumption for PEAP and TTLS. See raddb/eap.conf, and the cache sub-section.
- Added radmin command-line tool for administering a running server. See man radmin and raddb/sites-available/control-socket.
Bug Fixes
- Double escaping of '\\' in the users (and some other) files has been fixed. If you have '\\' in the users file, your configuration will need to be checked, and fixed!
- Parse security section of radiusd.conf. This was accidentally deleted in 2.0.5. Closes bug #566.
- Bind to interface before IP, which allows DHCP sockets to listen on "*" for multiple interfaces.
- Fix handling of giaddr in DHCP responses.
- Corrected parsing of status_check in home_server so that it works.
- Fix hints so that "Puser" works again.
- Removed length restrictions on attribute names in the dictionaries.
- Update socket code to avoid C compiler optimizations.
- 07 June 2008 - Version 2.0.5 has been released.
The focus of this release is stability.
Feature Improvements
- Permit SQL authorize_reply_query to be empty.
- Allow setting response packet type in Post-Proxy-Type Fail handler.
- Added install-chown target to set correct permission and ownership make RADMIN=radmin RGROUP=radius install-chown.
- Support for LDAP-Group and other dynamic comparison attribute in unlang. Developed from a patch by Jason Alderfer.
- Added chroot support. See radiusd.conf for comments.
- Allow clients of 0/0. We do not recommend using this, though.
- Moved many module configurations into raddb/modules/*.
Bug Fixes
- Allow proxying to virtual servers for accounting packets, too.
- Added num_fields function to PostgreSQL client. This lets clients be read from a PostgreSQL database.
- Updated proxy fallback mechanism to validate fallback servers, and to process fallback requests in a child thread.
- The realm module returns ok for LOCAL realms, not noop.
- Fixed some DHCP code handling. The examples should now work.
- 30 April 2008 - Version 2.0.4 has been released.
The focus of this release is stability.
Feature Improvements
- Allow "virtual_server" in "realm" and "home_server" sections. See raddb/proxy.conf and raddb/sites-available/virtual.example.com.
- Allow "passwd" module to be listed in "accounting" and "post-auth".
- Added "fallback" to "home_server_pool" configuration, to handle the case of all home servers being dead. See raddb/proxy.conf.
- Added sample text to raddb/sites-available/inner-tunnel which can simplify debugging of inner tunnel configurations.
- Added regular expression matching in realm names. See raddb/proxy.conf for examples.
- Added simple DHCP server functionality. For comments, see raddb/sites-available/dhcp.
- Added file globbing capabilities to detail file reader
- Added sample raddb/sites-available/robust-proxy-accounting.
- Clients in SQL can now refer to a virtual server. Patch from Michael Bretterklieber.
- Added some examples of creating RADIUS administrator in SQL, and assigning appropriate access rights.
Bug Fixes
- Install all files in raddb/sites-available.
- Allow non-threaded builds.
- Don't treat '0x' as special for known attributes that are not of type "octets".
- Fix log error in rlm_pap.
- Remove documentation about non-existent functionality.
- Updated warning messages in debug output.
- Fix handling of timeouts in rlm_ldap that affected 64-bit systems. This fix was supposed to go into 2.0.3, but did not make it.
- Fix event handling in debug mode for failed proxy requests.
- Fix memleak in fifos. Closes bug #537.
- Fix memleak on blocked threads. Closes bug #538.
- Perform additional checks on NULL realms. Closes bug #541.
- Fix handling of "clients" in "listen" section.
- When detail file cannot process a packet, sleep for longer to let the rest of the server do something.
- Add missing table to raddb/sql/mssql/schema.sql. Closes bug #545.
- Updated rlm_sql_postgresql to build with PostgreSQL 7.x. Closes bug #533.
- Fix "postauth" of rlm_ldap to look for LDAP-UserDn in the correct place.
- Update rlm_attr_filter for some corner cases. Closes bug #543.
- Fixed memory leak in libfreeradius event handler.
- In the SQL Accounting on/off queries, remove the restriction that the session time had to be zero.
- 17 March 2008 - Version 2.0.3 has been released.
The focus of this release is stability.
Feature Improvements
- Updated raddb/certs/ca.cnf with extensions to allow the ca.der file to be imported as a CA on Symbian and Windows Mobile devices. Closes bug #524.
- Enable multiple matches in the hints file via Fall-Through = Yes. Closes bug #477.
- Added preliminary SQLite driver, contibuted by Apple. Untested, with no sample configuration. This addresses bug #470.
- Updated the logging sub-system so that log messages from libfreeradius can go to the log file, and not stdout.
- Added dictionary.rfc5176 with two new values for the Error-Cause attribute.
- The EAP module now checks for instance name, and uses that for authentication. This avoids the need to set Auth-Type when there are multiple instances of the EAP module.
- Added the Module-Return-Code attribute, which contains the value returned by the previous module (ok/fail/update/etc.).
Bug Fixes
- Corrected typos in rlm_dbm. Closes bug #521 and bug #522.
- Detail file listen sections now work much better.
- Don't allow old log_* to over-ride new format. Closes bug #525
- Initialize allocated memory in Oracle SQL driver. This fixes occasional crashes on some systems. Closes bug #518
- Call correct function in rlm_protocol_filter. This enables the module to build. Closes bug #512.
- Added deprecated flag to build for rlm_krb5. This allows it to run on 64-bit systems. Closes bug #491.
- Corrected error message when parsing invalid configurations so that the server does not crash. Closes bug #527.
- Fix handling of timeouts in rlm_ldap that affected 64-bit systems.
- Handle $INCLUDE's in the instantiate section. Closes bug #528.
- Format updates to man pages from Stephen Gran.
- 5 March 2008 FreeRADIUS Client Version 1.1.6 has been released.
-
- Added dead_time functionality / configuration.
- Merge in fixes and enhancements from 'radiusclient-ng'.
- Improved functionality for embedded operation. In use in FreeSWITCH and OpenSER projects.
- Wrap gethostby*() family of calls with threadsafe variants.
- Change UINT4 to uint32_t, int to size_t, etc.
- Fixed wrong usage of strncat function in several places.
- 14 February 2008 - Version 2.0.2 has been released.
This version corrects a number of flaws in the handling of EAP sessions and detail files. We recommend that all sites using 2.0.x and EAP upgrade to 2.0.2.
Feature Improvements
- Added notes on how to debug the server in radiusd.conf.
- Moved all log_* in radiusd.conf to log{} section, The old configurations are still accepted.
- Added ca.der target in raddb/certs/Makefile. This is needed for importing CA certs into Windows.
- Added ability send raw attributes via Raw-Attribute = 0x0102... This is available only debug builds. It can be used to create invalid packets! Use it with care.
- Permit unlang policies inside of Auth-Type{} sub-sections of the authenticate{} section. This makes some policies easier to implement.
- listen sections can now have type = proxy. This lets you control which IP is used for sending proxied requests.
- Added note on SSL performance to raddb/certs/README
Bug Fixes
- Fixed reading of detail files.
- Allow inner EAP tunneled sessions to be proxied.
- Corrected MySQL schemas.
- syslog now works in log{} section.
- Corrected typo in raddb/certs/client.cnf
- Updated raddb/sites-available/proxy-inner-tunnel to permit authentication to work.
- Ignore zero-length attributes in received packets.
- Correct memcpy when dealing with unknown attributes.
- Corrected debugging messages in attr_rewrite.
- Corrected generation of State attribute in EAP. This fixes the "failed to remember handler" issues.
- Fall back to DEFAULT realm if no realm was found. Based on a patch from Vincent Magnin.
- Updated example raddb/sites-available/proxy-inner-tunnel
- Corrected behavior of attr_filter to match documentation. This is NOT backwards compatible with previous versions! See man rlm_attr_filter for details.
- January 2, 2008 - Version 2.0.1 has been released.
-
Feature Improvements
- Unlang now permits type-specific checks, and requires using strings less often. e.g. if (Framed-IP-Address > <IP_ADDRESS>) { ....
Bug Fixes
- The acct_unique module has been updated to understand the deprecated (but still used) Client-IP-Address attribute.
- The EAP-MSCHAPv2 module no longer leaks MS-CHAP2-Success in packets.
- Fixed crash in the dbm module.
- Corrected parsing of syslog entries in radiusd.conf.
- January 10, 2008 - Version 2.0 has been released.
We are pleased to announce that .tar.bz2">Version .tar.bz2.sig">(sig) has been released. This version is a tremendous step forward in functionality for the server.
Feature Improvements
- simple policy language (see man unlang)
- virtual servers (raddb/sites-available/README)
- IPv6 support
- better proxy support (raddb/proxy.conf)
- More EAP types
- Debugging output should be much easier to understand
- VMPS support
- More modules have been moved to "stable" status (python, etc.)
- SQL configuration has been cleaned up (see raddb/sql/*)
- limited support for HUP. (The configuration for some modules is re-loaded on HUP. Nothing else is reloaded.)
- check configuration and exit (radiusd -C)
- Server core is now event based (simpler, more powerful)
Bug Fixes
- The server re-design has resulted in simple fixes for many issues that were too difficult to correct in Version 1.1.x.


Sales
Style Guide
Sales Projections
Add A New Store
Store Name:
Store ID:
Address:
Phone:
Customers Per Hour:
Minimum:
Maximum:
Avg. # of Cookies:


Note: Apologies if the scan function times out sometimes - there are changes being made to the underlying database which will be resolved soon. We will also be releasing a major update to this package in the next few days that will make it more resilient to timeouts
Major update:
This package has been under major development and the way in which it is implemented has changed quite substantially. See below for how to revert to the previous version if necessary
Full documentation including a vignette is available here: https://explodecomputer.github.io/tryx/
This package will perform MR-TRYX analysis, which entails the following.
In MR analysis a major assumption is that the SNP influences the outcome only through the exposure. If the SNP influences the outcome through some other (candidate) traits, in addition to influencing through the exposure, then the MR estimate can be biased.
Knowing which traits through which SNPs might be acting in a horizontal pleiotropic manner allows us to exploit these outliers to:
This package uses the MR-Base infrastructure to search for alternative pathways through which instruments might influence the exposure.
The package name TRYX (pronounced ‘tricks’) is taken from the phrase ‘TReasure Your Exceptions’, a quote from William Bateson (1908).
This software is an R package that depends on various other packages available on CRAN (see DESCRIPTION file). It has only been tested on some R versions >= 3.2.0. The software will run on any standard laptop, desktop or server for which R can be installed.
A beta development version can be installed directly from this repository.
First install the TwoSampleMR
and RadialMR
R packages:
devtools::install_github("MRCIEU/TwoSampleMR") devtools::install_github("WSpiller/RadialMR")
Next install the tryx
package:
devtools::install_github("explodecomputer/tryx")
You may also want to install some plotting packages
install.packages(c("ggplot2", "ggrepel", "igraph"))
and a package for simulating genotype-phenotype maps
devtools::install_github("explodecomputer/simulateGP")
It should not take more than a few minutes to install all of these packages.
You can go back to an earlier version using:
<EMAIL_ADDRESS>If you using MR-TRYX R package:
For the IEU GWAS database, MR-Base or the TwoSamleMR R package: Hemani G, Zheng J, Elsworth B, Wade KH, Baird D, Haberland V, Laurin C, Burgess S, Bowden J, Langdon R, Tan VY, Yarmolinsky J, Shihab HA, Timpson NJ, Evans DM, Relton C, Martin RM, Davey Smith G, Gaunt TR, Haycock PC, The MR-Base Collaboration. The MR-Base platform supports systematic causal inference across the human phenome.
eLife 2018;7:e34408. doi: 10.7554/eLife.34408


Court lists can be contributed or edited using the spreadsheet files supplied under yellow-highlighted links in the LRR. The instructions below are meant to help you work with the lists in this form. For large or complex jurisdictions, other methods of updating the LRR data are available. Feel free to write to<EMAIL_ADDRESS>if you encounter issues that require further discussion.
Begin by reading the instructions in the yellow box. After reading, you may wish to hide the box, so that it does not get in the way while you are editing the form. To hide the box, click the [-] button, in the margin to the left of the box.
Each court should be recorded in the language and script used in court judgments and other official records in your jurisdiction. The form will initially show English (en-US) as the main language; for most jurisdictions this will be incorrect. To set language to another value, click on it, then click on the small arrow that appears to the right of the field, as shown by the red arrow. Scroll to your desired language and click on it. (If the correct language is not shown, please let me know, so that I can add it to the list and send you a revised version of the form.)
If your jurisdiction has two official languages, court names should be recorded in both. To reveal the alternative language column, click on the [+] in the top margin, shown by the red arrow.
Setting the alternative language works in the same way as setting the main language. The field will initially show none. To change the setting, click on the field, then on the arrow icon to its left, as shown by the red arrow, and select the desired language. The language will appear in the headings down the alternative language column. The "main" and "alternative" language settings do not imply priority; if your jurisdiction treats two languages as having equal status, it does not matter which is set to "main," but the language used in each column should be consistent.


You appear to be running Unix. The quickest way to get Tectonic is to run the following command in your terminal:
$
curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net |sh
This will place the tectonic
program in the directory where
you ran the command. After that, you’re done!
You appear to be running Windows. The quickest way to get Tectonic is to run the following commands in a PowerShell terminal:
>
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://drop-ps1.fullyjustified.net'))
This will place the tectonic.exe
program in the directory where
you ran the commands. After that, you’re done!
I don't recognize your platform, so I’m not able to recommend a preferred installation method. Please see the more thorough instructions below.


title
Primary (md-noink)
Disabled
title
Flat
Button
Primary
Disabled
Warn
Raised
cake
android
comment
people
cake
android
FAB
Default Link
Primary Link
Default Button
Link vs. Button
Primary Hue 1
Warn Hue 2
Accent
Accent Hue 1
Themed
menu
favorite
more_vert
launch
Icon Button


| Package | Description |
|---|---|
| org.apache.jena.permissions |
JenaSecurity is a SecurityEvaluator interface and a set of dynamic proxies that apply that
interface to Jena Graphs, Models, and associated methods and classes.
|
| org.apache.jena.permissions.example | |
| org.apache.jena.permissions.graph |
Secured implementation of the Graph interface and associated classes.
|
| org.apache.jena.permissions.graph.impl | |
| org.apache.jena.permissions.impl | |
| org.apache.jena.permissions.model.impl | |
| org.apache.jena.permissions.query | |
| org.apache.jena.permissions.query.rewriter | |
| org.apache.jena.permissions.utils |
| Modifier and Type | Method and Description |
|---|---|
SecurityEvaluator |
SecuredItem.getSecurityEvaluator()
The SecurityEvaluator implementation that is being used to determine
access.
|
SecurityEvaluator |
SecurityEvaluatorAssembler.open(Assembler a,
Resource root,
Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
static SecuredGraph |
Factory.getInstance(SecurityEvaluator securityEvaluator,
String graphIRI,
Graph graph)
Create an instance of the SecuredGraph
|
static SecuredModel |
Factory.getInstance(SecurityEvaluator securityEvaluator,
String modelIRI,
Model model)
Get an instance of SecuredModel
|
| Modifier and Type | Class and Description |
|---|---|
class |
ExampleEvaluator
An example evaluator that only provides access to messages in the graph that
are from or to the principal.
|
class |
ShiroExampleEvaluator
Class to use Shiro to provide credentials.
|
| Modifier and Type | Method and Description |
|---|---|
SecurityEvaluator |
SecuredGraph.getSecurityEvaluator() |
| Constructor and Description |
|---|
SecuredCapabilities(SecurityEvaluator securityEvaluator,
String graphURI,
Capabilities capabilities)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static SecuredGraph |
Factory.getInstance(SecurityEvaluator securityEvaluator,
String graphIRI,
Graph graph)
Create an instance of the SecuredGraph
|
| Modifier and Type | Class and Description |
|---|---|
class |
CachedSecurityEvaluator
A SecurityEvaluator that can be cached for later use.
|
| Modifier and Type | Method and Description |
|---|---|
SecurityEvaluator |
SecuredItemImpl.getSecurityEvaluator() |
| Constructor and Description |
|---|
CachedSecurityEvaluator(SecurityEvaluator wrapped,
Object runAs) |
| Modifier and Type | Method and Description |
|---|---|
static SecuredModel |
SecuredModelImpl.getInstance(SecurityEvaluator securityEvaluator,
String modelIRI,
Model model)
Get an instance of SecuredModel
|
| Modifier and Type | Method and Description |
|---|---|
SecurityEvaluator |
SecuredQueryEngineFactory.getSecurityEvaluator() |
SecurityEvaluator |
SecuredQueryEngine.getSecurityEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
void |
SecuredQueryEngineFactory.setSecurityEvaluator(SecurityEvaluator securityEvaluator) |
| Constructor and Description |
|---|
OpRewriter(SecurityEvaluator securityEvaluator,
Node graphIRI)
Constructor
|
OpRewriter(SecurityEvaluator securityEvaluator,
String graphIRI)
Constructor
|
SecuredFunction(Node graphIRI,
SecurityEvaluator securityEvaluator,
List<Node> variables,
List<Triple> bgp) |
| Constructor and Description |
|---|
PermStatementFilter(Collection<SecurityEvaluator.Action> actions,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
PermStatementFilter(SecurityEvaluator.Action[] actions,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
PermStatementFilter(SecurityEvaluator.Action action,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
PermTripleFilter(Collection<SecurityEvaluator.Action> actions,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
PermTripleFilter(SecurityEvaluator.Action[] actions,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
PermTripleFilter(SecurityEvaluator.Action action,
SecuredItem securedItem,
SecurityEvaluator evaluator)
Creates a filter that requires that the user have all the permissions
listed in the actions parameter
|
Licensed under the Apache License, Version 2.0


Home
Contact Information
Office Hours
Syllabus
Prerequistites
Learning Outcomes
Course Grades
Calendar
Lecture notes
Submitty
Discussion Forum
Homework
Late Day Policy
Final Project
Spring '16 Projects
References
On-lin Material
Optional Books


{% extends "./layout.html" %} {% block title %}A7-Missing Function Level Access Control{% endblock %} {% block content %}
If requests are not verified for access rights on server, attackers can forge requests in order to access functionality without proper authorization.
In the insecure demo application, this vulnerability exists in benefits module, which allows changing benefit start date for employees. The link to the benefits module is visible only to the admin user (user: admin, password: Admin_123). However, an attacker can access this module simply by logging in as any non-admin user and accessing benefits url directly.
routes/index.js
// Benefits Page app.get("/benefits", isLoggedIn, benefitsHandler.displayBenefits); app.post("/benefits", isLoggedIn, benefitsHandler.updateBenefits);
This can be fixed by adding a middleware to verify user's role:
// Benefits Page app.get("/benefits", isLoggedIn, isAdmin, benefitsHandler.displayBenefits); app.post("/benefits", isLoggedIn, isAdmin, benefitsHandler.updateBenefits);
To implement
isAdmin
middleware, check if isAdmin flag is set for the logged in user in database.
For example, here is middleware function that can be added to
routes\session.js
:
this.isAdminUserMiddleware = function(req, res, next) { if (req.session.userId) { userDAO.getUserById(req.session.userId, function(err, user) { if(user && user.isAdmin) { next(); } else { return res.redirect("/login"); } }); } else { console.log("redirecting to login"); return res.redirect("/login"); } };It can be then made available in
routes/index.js
router as:
var SessionHandler = require("./session"); //Middleware to check if user has admin rights var isAdmin = sessionHandler.isAdminUserMiddleware;


Haters might find it odd I wear my shades in the dark And when I say I'm a God I still have faith in the Lord - Gucci Mane EXCLUSIVE


History
What started out as an internal development project from within City Index was soon after released as an open source project for all to benefit.
City Index realised the potential value of the information available to them in the log files and required a flexible solution to not only view the log files but rather to view and cross analyse them.
Community
Stay up to date on the development of Logsearch and reach out to the community with these helpful resources.
- Read and subscribe to the Logsearch Newsletter.
- Read the latest articles on the Logsearch Blog (coming soon!)


| Mission |
Date |
Organization |
UAV |
Duration(minutes) |
Status |
Creation Date |
Action |
| {{flight.MissionName}} |
{{flight.EndTimeText | date: 'short'}} |
{{flight.OrganizationName}} |
{{flight.DroneName}} |
{{flight.Duration}} |
{{flight.StatusText}} |
{{flight.DateCreated | date: 'short'}} |
|


I want to see full servers in the sever browser - Better Battlelog Forums #1689
Sitemap
25. April 2012 16:50
Topicstarter
Guest
Hi!
My third idea:
I want to see full servers in the server browser. Just add the new position to "Free slots". Is it possible?
25. April 2012 17:12
BrainFooLong
Administrator
Also not possible and requested in the past.


Next for this site
Mon, Jan 1, 0001From James: I’ve set up this site because we need one. I hope that people who have been involved will update the information here, and change it as they wish. This is a temporary note. It’ll go when we use the site publicly.
I imagine that the buttons at the top will go to pages for whatever conference is up and running.
I imagine that we’ll make the UI have concertinas for list information so they fold up
I imagine that we’ll put some list information into multiple similar markdown docs
We’ll need to change everything – text, ordering, colours, technology. But this is a start, and (I hope) a flexible one. I know that the history is wrong.
I’m using the static-site generator Hugo.
- the source is in markdown
- the markdown source will be on GitHub so you can change it as you like
- I’ll pull everything together and re-upload to testlab.site


| Central Coast Organic Meyer Lemons are a rare treat.
The skin is soft, orange in color and wonderful used for lemon zest.
Gourmet chefs appreciate the unique Meyer lemon flavor for its extraordinary sweetness.
Meyer Lemons were developed by crossing lemon with tangerine or sweet orange.
The result is a lemon that is really special.
Our farm has been in business since 1998 and we have followed organic and sustainable farming practices such as mulching,
cover crops, beneficial insects and drip irrigation.
We offer Meyer Lemons in 10 lb. and 7lb. boxes shipped via priority mail anywhere in the U.S.Meyer lemons are a rare treat.
Those that are grown on the Central Coast are even sweeter and juicier due to our special climate. |
|


Harbor
(SpringFlute Example)
Products
Members
Withdrawal
Welcome, Mr.Guest
Profile
Sign out
List of Member
Search Condition
Member Name
Purchased Product
Member Status
---
pulldown
Has Unpaid
Formalized Date
～
Search Result
add Member
Member ID
Member Name
Member Status
Formalized Date
Update Date
Edit
99
jflute
Formalized
2014/11/07
2014/11/07
Edit
Cannot


VULNRΞPO is a free open source project designed to speed up the creation of IT Security vulnerability reports.
Focus on
research, spend time on research NOT on the report form!
Project use browser for encrypt/decrypt (AES) and store data in locally. Full confidentiality of data, end-to-end encryption, by default nothing is sent out. No backend system, only front-end technology, pure JS client.
You can share your report using AES encryption by default.
You can download report in TXT, HTML formats!. If you need PDF just 'print as PDF' html report.
You can easly attach any file you want to. Screenshot, movie or scanner output in txt. Automatically doing checksum sha256 of attached file.
The use of templates greatly speeds up the work for pentester or security auditor. Import CVE or CWE data also possible.
Supported import from: Nessus, Burp, OpenVAS. After importing, easily manage and edit vulnerabilities.
All important changes in report will be logged in to changelog and update to the next version of the report.
You can export issues to popular bugtrackers like Atlassian JIRA or use secure way to share only issues.
For more detailed information please visit about section.


| Class name | Description |
|---|---|
| DBCommand |
sealed Class DBCommand
|
| DBConnection |
sealed Class DBConnection
|
| DBEnumerator |
sealed Class DBEnumerator
|
| DBException |
Class DBException
|
| DBReader |
sealed Class DBReader
|
| DBRow |
sealed Class DBRow
|
| DBTable |
sealed Class DBTable
|


sdb − SNOBOL4 debugger
sdb [ options ... ] program.sno
sdb is a debugger for snobol4(1) programs, in the mold (clawning fone) of gdb(1), The GNU debugger. sdb(1) uses readline(3) for command line editing/history when available.
Commands:
break LABEL_OR_STATEMENT_NUMBER
Set a breakpoint.
bt
Display call stack backtrace.
commands BREAKPOINT_NUMBER
Add sdb commands to execute (ie; print & continue) to a breakpoint.
condition BREAKPOINT_NUMBER EXPR
If EXPR is supplied, it is used as a predicate to make the breakpoint conditional.
continue EMPTY_OR_COUNT
Continue from breakpoint. The optional count specifies how many times to continue past this breakpoint (sets "ignore" count).
delete BREAKPOINT_NUMBER_OR_EMPTY
Delete a single breakpoint, or all breakpoints.
disable BREAKPOINT_NUMBER_OR_EMPTY
Temporarily disable a breakpoint, or all breakpoints.
enable BREAKPOINT_NUMBER_OR_EMPTY
Reenable a breakpoint, or all breakpoints.
finish
Resume debugging after current function returns. Will display function return type and value, if any.
help
Display help.
ignore BREAKPOINT_NUMBER COUNT
Set breakpoint ignore count.
info
Display list of breakpoints and their status.
list EMPTY_OR_STATEMENT_NUMBER
Display source code.
next EMPTY_OR_COUNT
Single step execution, skipping over function calls.
print EXPRESSION
Evaluate expression and print result. Can be used to call functions, or set variables.
quit
Exit debugger.
step EMPTY_OR_COUNT
Single step.
watch VARIABLE
Set watchpoint on a variable (break when value changes).
what
Display the datatype of variable contents (or expression).
where
An alias for bt.
A blank line repeats the previous command.
Non-ambiguous abbreviations of commands can be used (ie; "s", "n").
The GNU Readline library (when available) will be used for sdb input for command editing and history.
The keyboard interrupt character (eg; Control C) will stop a running program and return control to the sdb(1) command prompt.
If your program calls the SDB() function, it will act as a breakpoint. You can check whether sdb(1) is loaded with the FUNCTION predicate, ie;
FUNCTION(’SDB’) SDB()
snobol4(1), gdb(1), readline(3), snobol4readline(3)
Philip L. Budne
Inspired by Fred Weigel’s DDT.SNO and SITBOL’s SNODDT.
sdb(1) uses a wide variety of system facilities and will interact poorly with any programs that use any number of features, including:
|
• |
Altering listing settings with directive/control lines. | ||
|
• |
Altering &STLIMIT, &ERRLIMIT, or &TRACE. | ||
|
• |
Calling SETEXIT() |
If you try to put a breakpoint on a label or line with no code or goto fields, the breakpoint will never be triggered.
You cannot put a breakpoint on the END label (however control always returns to sdb when the END label is reached).
There is no "run" command; you cannot restart the program without quitting and losing breakpoint settings.
Interrupt character trapping is in it’s infancy, and only occurs at the start of a each statement executed.
The interrupt character is silently ignored when at the sdb command prompt.
sdb does not read an init file (ie; .sdbinit).


Card holder
Expires
CCV
Card Number
Card holder
Expiration date
Jan
Feb
Mar
Apr
May
Jun
Jul
Ago
Sep
Oct
Nov
Dec
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
CCV
submit


{% include "local_reload/local_reload_support.html" %}
Activate the links/buttons, and follow the instructions. Each time you return to this page, ensure that the timestamp updates.


DOM Manipulation Exercises
Task 2 a
Add text
Task 2 b
Pink
Yellow
Task 2 c
Google
With jQuery
Task 4 a
Add text
Task 4 b
Red
Green
Task 4 c
ADD
The sum is =


Hello, I’m Jim Curran, an information designer specializing in User Interface and Interaction Design. I enjoy designing and building interfaces that make sense.


From the Death Certificate of
Evelyn E. Hasson nee Rowley
OHIO DEPARTMENT OF HEALTH
Reg. Dist. No. 7701
Primary Reg. Dist. No. 7701
Registrar s No. 21
female, white, widowed,
school teacher Akron Public Schools
death: 12/31/1972, 10:50 a.m.; Akron City Hospital, Akron, Summit Co., Ohio
birth 5/15/1914, W. Va.
residence: 1534 Malasia Road, Akron, Summit Co., Ohio
parents: William Rowley and
Bessie Morris
informant: Marshall Hasson; 1645 Newton Street, Akron,
Ohio
immediate cause: pulmonary embolus
as a consequence of: carcinoma of breast with metastises
other significant
conditions: multiple sclerosis
attended by doctor: from 8-2-65 to 12-31-72
certifier:
Robert E. Williams M.D.; 1-2-73; Second National Building, Akron, Ohio
burial: 1/3/73 at Rose Hill, Akron, Ohio
funeral director: Earl S. Hollen, The Adams Funeral Home, 791 East Market Street, Akron, Ohio 44305
Provided by Betty Latta Kitchen
Click here for the Short-Cut Table of Contents