- activate(float) - Method in class network.activationFunctions.ActivationFunction
-
Execute activation function to input value
- ActivationFunction - Class in network.activationFunctions
-
- ActivationFunction() - Constructor for class network.activationFunctions.ActivationFunction
-
- ActivationFunctions - Class in network.activationFunctions
-
Singelton activation functions.
- ActivationFunctions() - Constructor for class network.activationFunctions.ActivationFunctions
-
- addHiddenLayer(int) - Method in class network.NeuralNetwork
-
Adding new hidden layer at the end with specific neuron count
- addHiddenNeuron(HiddenNeuron) - Method in class network.layers.HiddenLayer
-
Adding hidden neuron to this hidden layer.
- addInputConnection(Connection) - Method in class network.neurons.HiddenNeuron
-
Adding incoming connection to the neuron
- addInputNeuron(InputNeuron) - Method in class network.layers.InputLayer
-
Adding input neuron to this input layer.
- addOutputConnection(Connection) - Method in class network.neurons.Neuron
-
Adding outgoing connection to the neuron
- addOutputNeuron(HiddenNeuron) - Method in class network.layers.OutputLayer
-
Adding output neuron to this output layer.
- addWeight(float) - Method in class network.connections.Connection
-
Adding float value to the weight


Introduction
Welcome to the 1MT Authentication API. Use this API to manage the syncing of user authentication data from your MT platform to the 1MT authentication service.
Authentication
All calls to the API require a valid access token. Once granted (provided they are not revoked), tokens are valid for 12 hours.
Requesting access tokens
Request an access token:
POST /auth/token HTTP/1.1
Accept: application/json
Authorization: Basic Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: accounts.markettrack.com
User-Agent: PriceVision/1.0.0
curl
-H "Content-Type: application/json"
-X POST /auth/token
-u identifier:secret
-d '{"grant_type": "client_credentials"}'
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"access_token": "216fee3f-404d-4663-b32a-dcb765020125",
"expires_at": "2017-02-01T16:59:20.112Z",
"token_type": "Bearer"
}
Access tokens are granted at the end of an OAuth2 client-credentials handshake. To request a new token, use HTTP basic auth with your platform ID and secret to POST to the /auth/token
endpoint.
If the token request is valid and authorised, the access token is returned in the JSON body of the response, along with details of its expiry.
Invalid token requests result in a 401
error. If encountered, check the platform credentials that were supplied.
Using access tokens
Authenticate a request:
GET /api/v1 HTTP/1.1
Accept: application/json
Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125
Host: accounts.markettrack.com
User-Agent: PriceVision/1.0.0
curl /api/v1
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
In possession of a valid access token, you can make requests to the API. Credentials should be passed as bearer tokens in the request header…
Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125
Recall that invalid or expired tokens will result in a 401: Bad Request
error.
Using the API
Status codes
The 1MT Authentication API uses the following status codes:
| Code | Meaning |
|---|---|
| 200 | OK: the request succeeded |
| 201 | Created: one or more resources created |
| 204 | No Content: success, but nothing to return |
| 400 | Bad Request: malformed or invalid request |
| 401 | Unauthorized: the access token is invalid |
| 403 | Forbidden: insufficient permissions |
| 404 | Not Found: the requested resource could not be found |
| 406 | Not Acceptable: a format was requested that isn’t JSON |
| 410 | Gone: the requested resource has been removed |
| 415 | Unsupported Media Type: the request’s payload is not JSON |
| 422 | Unprocessable Entity: validation failed |
| 500 | Internal Server Error: unexpected API error |
| 503 | Service Unavailable: API temporarily offline |
Making requests
All requests to the API should be over HTTPS.
HTTP verbs
The API uses RESTful design patterns. As such, it implements the following HTTP verbs:
| Verb | Meaning |
|---|---|
| GET | Read resource(s) |
| POST | Create new resource |
| PATCH | Modify existing resource |
| DELETE | Remove resource |
Content type
When making requests, ensure that the Accept
header is set to application/json
and, when relevant, make sure that the Content-Type
is also set to application/json
.
User agent
Set the user agent according to the platform name and current version.
User-Agent: PriceVision/1.0.0
Responses
A successful response:
{
"succeeded": true,
"message": "User created<EMAIL_ADDRESS>"data": {
"name": "Me",
"email"<EMAIL_ADDRESS>}
}
An unsuccessful response:
{
"succeeded": false,
"message": "RAML validation error",
"data": {
"fields": [{
"field": "firstName",
"value": "null",
"msg": "invalid json (required, true)"
}]
}
}
Outside of authentication, all API responses have a similar JSON payload.
| Key | Type | Description |
|---|---|---|
| succeeded | boolean | Whether or not the request was successful |
| message | string | A short description of the response |
| data | object | An optional object describing the result in detail |
Errors
Unsuccessful responses can include details on the error in the data
object. For example, a validation error would include each invalid field and describe why the validation failed.
Request ID
Each request to the API is given a unique request ID. This is passed back in the response via the X-Request-Id
header…
x-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
If you want to pass on your own request ID as part of a communication chain, then supply a similar header in the request. When such a header is identified, the API will not create a new ID, but will instead pass back the supplied ID in the response.
Fields
IDs
All resource IDs are represented in UUID format…
"id": "4a8e9a36-c902-42c5-bbd6-19d222acf178"
Timestamps
All timestamps are returned in ISO8601 format, in UTC, with fields ending in the postfix _at…
"created_at": "2016-12-01T00:55:47Z"
Base API
Available at /api/v1
.
Hello
Check API status:
GET /api/v1 HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: accounts.markettrack.com
User-Agent: PriceVision/1.0.0
curl /api/v1
-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "Hello from 1MT resource server"
}
Check status of API.
HTTP request
GET https://accounts.markettrack.com/api/v1
Users API
Available at /api/v1/users
.
User resource
Example user payload:
{
"id": "da2d3e9a-e84e-11e6-bf01-fe55135034f3",
"first_name": "First",
"last_name": "Last",
"email"<EMAIL_ADDRESS>"status": "active",
"internal": false,
"created_at": "2016-12-01T00:55:47Z",
"updated_at": "2016-12-01T00:55:47Z",
"subscription": {
"id": "f5e9dc78-e84f-11e6-bf01-fe55135034f3",
"status": "active",
"created_at": "2016-12-01T00:55:47Z",
"updated_at": "2016-12-01T00:55:47Z",
"accounts": [{
"id": "",
"identifier": "f9a5b170-e84f-11e6-bf01-fe55135034f3",
"status": "active",
"created_at": "2016-12-01T00:55:47Z",
"updated_at": "2016-12-01T00:55:47Z"
}]
}
}
| Attribute | Type | Description |
|---|---|---|
| first_name | string | |
| last_name | string | |
| string | /[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}/ | |
| status | string | One of: active, inactive, pending |
| internal | boolean | Internal user |
| created_at | datetime | |
| updated_at | datetime | |
| subscription? | Subscription | Included if extended param truthy |
Get user
Get user:
GET<EMAIL_ADDRESS>HTTP/1.1
Accept: application/json
Authorization: Bearer Y3ItZWNvbW06YTljZTFhMWYtOWI1ZS00ZDllLTkzYjctN2VmMTBmZWRiZDYz
Host: accounts.markettrack.com
User-Agent: PriceVision/1.0.0
curl<EMAIL_ADDRESS>-H "Authorization: Bearer 216fee3f-404d-4663-b32a-dcb765020125"
A successful response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: ea49faf8-f7ad-48fa-b72a-e659db0f16e4
{
"succeeded": true,
"message": "User found<EMAIL_ADDRESS>"data": {
"as": "above"
}
}
Get details of specific user.
HTTP request
GET https://accounts.markettrack.com/api/v1/users/:identifier
URL parameters
| Parameter | Type | Description |
|---|---|---|
| identifier | string | Email or ID of user |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| extended | boolean | true | If truthy, include subscription details |


Apps
Bookmarks
Downloads
History
Extensions
Flags
Simple Material New Tab
Customization
Toggle Shortcuts
Select which shortcuts will be visible in top-right corner:
Apps
Bookmarks
Downloads
History
Extensions
Flags
Color theme
Select a color theme for the extension:
Simple Material New Tab
Simple Material New Tab extension for Chrome that replaces default Chrome new tab page with one that shows
you your Bookmarks, Apps and provides easy access to many Chrome features.
Ok


Working with Data
Earlier in my career I was tasked with creating a UI widget that was powered by a 3rd party API. This was before the current craze of functional programming and underscore was just becoming a thing.
I like to look back at old programming challenges to see/cringe at the code that i wrote and also to see how i might approach a task now, given what i know now.
What did i learn?  The code was originally started by another developer and we were under a tight deadline to glue the existing code to a new UI, I didn’t want to completely rewrite it and uncover an untold amount of bugs or edge cases that the previous developer coded around. I also didn’t like the endless amount of if statements in the code. But how could i do better?
What I learned
Get familiar with the data. So often you are in a rush to get started and code, but you can remove a lot of cruft from your code by having a clear understanding of the task at hand. This is painfully deceptive, because how many times have you thought you understood only to realize later you made a false assumption? It’s really difficult to get a birds eye view without understanding the shape of the data you’ll be working with.
Rarely do you have the opportunity to build from scratch. The more realistic case is that you are inheriting code from others or have to iterate on code that you wrote months or perhaps years ago. Resist the urge to rewrite, try to extend the existing code by creating new methods. This way you don’t risk breaking existing functionality.
forms and buttons are a bitch. the more interactive a form the more use cases you have to support. validating data and use flows are unpredictable. while design loves throwing the words ‘easy’ and ‘simple’ around, it ultimately falls on you to implement it in a way that you and your team can debug and extend. no easy task. a form library can bring a ton of functionality out of the box and get your team productive rather than slowly learning the pitfalls of doing it yourself.
as a small addendum, functional libraries like lodash make data manipulation easier to reason about. Currying functions can help reusability when we have code that performs the same task on different inputs. However doing it by hand often means you have to remember the details of 2 call sites. the place where you passed the first value and the final call site:


Name is required
Mobile is required. Should be of 10 digits
Email is required. Should have the proper pattern of email ID


---
layout: page
render: true
pagination:
size: 10
collection: post
#permalink: /p${pageNumber}/
#title_suffix_format: " - 第 ${pageNumber} 页"
---
<#list paginator.items as post>
${post.title}
${post.dateFormatted}
${post.excerpt}
<#if post.excerpted>...
#if> #list>


Dear %NAME%,
You have registered with %SOC_NETWORK%.
Your temporary password now is: %PWD%
You can change this password
here
.
Sincerely,
The
reFigure
team.


Local Storage Cache
Configuration
The 'Local Storage Cache' filter is enabled by specifying:
- Apache:
ModPagespeedEnableFilters local_storage_cache
- Nginx:
pagespeed EnableFilters local_storage_cache;
in the configuration file.
Description
This filter saves inlined resources to the browser's local storage (an HTML5 feature) on the first view of a page, and loads them from local storage on subsequent views rather than sending them (inline) again.
This benefits first views by inlining resources and benefits repeat views by caching these resources - normally inlining would hurt repeat views because inlined resources need to be sent every time since they're not in the browser's cache.
Operation
This filter does the following:
- It adds JavaScript utility functions to the rewritten HTML's
head
section. - For each inlined CSS or image resource that the browser doesn't yet have in local storage, it inlines the resource and tags it with new special attributes.
- For each inlined CSS or image resource that the browser does have in local storage, it replaces the resource with a JavaScript snippet that loads the resource from local storage.
- Finally, it adds an
onload
handler that processes each tagged inlined resource.
The filter determines which resources are in local storage by inspecting a
browser cookie set by the last step's onload
handler. The cookie's
name is _GPSLSC
and its value is a list of hashes of the URLs of
resources stored in local storage.
Inlined JavaScript is not saved in local storage because it's not possible to reliably load it from local storage and execute it such that the behavior is the same as when it is inlined.
The attributes added to inlined resources are:
data-pagespeed-lsc-expiry
: when the resource expires. If the resource is accessed after its expiry it won't be used and will be removed from the cookie.data-pagespeed-lsc-hash
: a hash of the resource's URL (before inlining). This is used to represent the resource in a short form and is saved in the cookie.data-pagespeed-lsc-url
: the resource's URL. This is used by the JavaScript snippet to request the resource directly if the resource's hash is in the cookie but the resource isn't found in local storage.
Online Example
You can see the filter in action at www.modpagespeed.com
on this
example.
Requirements
The Inline CSS and/or Inline JavaScript filters must be enabled for this filter to have any effect.
Risks
This filter is considered moderate-to-high risk: it adds a payload overhead
of extra JavaScript, it adds a payload overhead of extra attributes on each
inlined resource, and it adds the execution overhead of its onload
handler.
This filter is experimental. Its performance benefit has not been extensively tested and we are seeking feedback on its usefulness and benefits. It can only speed up repeat views of a page or uses of saved resources by other pages, it cannot speed up first views.
This filter sets a cookie for the domain of the page being rewritten.
Note:
This filter requires the browser to support local storage, an HTML5 feature not
implemented by all browsers, in particular older browsers. Browsers that don't
support local storage will work as if this filter wasn't enabled: although the
payload and onload
overheads will be incurred, the cookie will
never be set so no benefits will be obtained.


# File test/minitest/test_minitest_mock.rb, line 6 def setup @mock = Minitest::Mock.new.expect(:foo, nil) @mock.expect(:meaning_of_life, 42) end
# File test/minitest/test_minitest_mock.rb, line 32 def test_allow_expectations_to_be_added_after_creation @mock.expect(:bar, true) assert @mock.bar end
# File test/minitest/test_minitest_mock.rb, line 15 def test_allow_return_value_specification assert_equal 42, @mock.meaning_of_life end
# File test/minitest/test_minitest_mock.rb, line 115 def test_assign_per_mock_return_values a = Minitest::Mock.new b = Minitest::Mock.new a.expect(:foo, :a) b.expect(:foo, :b) assert_equal :a, a.foo assert_equal :b, b.foo end
# File test/minitest/test_minitest_mock.rb, line 19 def test_blow_up_if_not_called @mock.foo util_verify_bad "expected meaning_of_life() => 42, got []" end
# File test/minitest/test_minitest_mock.rb, line 77 def test_blow_up_on_wrong_arguments @mock.foo @mock.meaning_of_life @mock.expect(:sum, 3, [1, 2]) e = assert_raises MockExpectationError do @mock.sum(2, 4) end exp = "mocked method :sum called with unexpected arguments [2, 4]" assert_equal exp, e.message end
# File test/minitest/test_minitest_mock.rb, line 45 def test_blow_up_on_wrong_number_of_arguments @mock.foo @mock.meaning_of_life @mock.expect(:sum, 3, [1, 2]) e = assert_raises ArgumentError do @mock.sum end assert_equal "mocked method :sum expects 2 arguments, got 0", e.message end
# File test/minitest/test_minitest_mock.rb, line 11 def test_create_stub_method assert_nil @mock.foo end
# File test/minitest/test_minitest_mock.rb, line 126 def test_do_not_create_stub_method_on_new_mocks a = Minitest::Mock.new a.expect(:foo, :a) assert !Minitest::Mock.new.respond_to?(:foo) end
# File test/minitest/test_minitest_mock.rb, line 90 def test_expect_with_non_array_args e = assert_raises ArgumentError do @mock.expect :blah, 3, false end assert_equal "args must be an array", e.message end
# File test/minitest/test_minitest_mock.rb, line 161 def test_method_missing_empty mock = Minitest::Mock.new mock.expect :a, nil mock.a e = assert_raises MockExpectationError do mock.a end assert_equal "No more expects available for :a: []", e.message end
# File test/minitest/test_minitest_mock.rb, line 66 def test_mock_args_does_not_raise skip "non-opaque use of ==" if maglev? arg = Minitest::Mock.new mock = Minitest::Mock.new mock.expect(:foo, nil, [arg]) mock.foo(arg) assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 211 def test_mock_block_is_passed_function_params arg1, arg2, arg3 = :bar, [1,2,3], {:a => 'a'} mock = Minitest::Mock.new mock.expect :foo, nil do |a1, a2, a3| a1 == arg1 && a2 == arg2 && a3 == arg3 end mock.foo arg1, arg2, arg3 assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 237 def test_mock_block_throws_if_args_passed mock = Minitest::Mock.new e = assert_raises(ArgumentError) do mock.expect :foo, nil, [:a, :b, :c] do true end end exp = "args ignored when block given" assert_equal exp, e.message end
# File test/minitest/test_minitest_mock.rb, line 133 def test_mock_is_a_blank_slate @mock.expect :kind_of?, true, [Fixnum] @mock.expect :==, true, [1] assert @mock.kind_of?(Fixnum), "didn't mock :kind_of\?" assert @mock == 1, "didn't mock :==" end
# File test/minitest/test_minitest_mock.rb, line 251 def test_mock_returns_retval_when_called_with_block mock = Minitest::Mock.new mock.expect(:foo, 32) do true end rs = mock.foo assert_equal rs, 32 end
# File test/minitest/test_minitest_mock.rb, line 105 def test_no_method_error_on_unexpected_methods e = assert_raises NoMethodError do @mock.bar end expected = "unmocked method :bar, expected one of [:foo, :meaning_of_life]" assert_equal expected, e.message end
# File test/minitest/test_minitest_mock.rb, line 25 def test_not_blow_up_if_everything_called @mock.foo @mock.meaning_of_life assert @mock.verify end
# File test/minitest/test_minitest_mock.rb, line 37 def test_not_verify_if_new_expected_method_is_not_called @mock.foo @mock.meaning_of_life @mock.expect(:bar, true) util_verify_bad "expected bar() => true, got []" end
# File test/minitest/test_minitest_mock.rb, line 98 def test_respond_appropriately assert @mock.respond_to?(:foo) assert @mock.respond_to?(:foo, true) assert @mock.respond_to?('foo') assert !@mock.respond_to?(:bar) end
# File test/minitest/test_minitest_mock.rb, line 57 def test_return_mock_does_not_raise retval = Minitest::Mock.new mock = Minitest::Mock.new mock.expect(:foo, retval) mock.foo assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 175 def test_same_method_expects_are_verified_when_all_called mock = Minitest::Mock.new mock.expect :foo, nil, [:bar] mock.expect :foo, nil, [:baz] mock.foo :bar mock.foo :baz assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 186 def test_same_method_expects_blow_up_when_not_all_called mock = Minitest::Mock.new mock.expect :foo, nil, [:bar] mock.expect :foo, nil, [:baz] mock.foo :bar e = assert_raises(MockExpectationError) { mock.verify } exp = "expected foo(:baz) => nil, got [foo(:bar) => nil]" assert_equal exp, e.message end
# File test/minitest/test_minitest_mock.rb, line 141 def test_verify_allows_called_args_to_be_loosely_specified mock = Minitest::Mock.new mock.expect :loose_expectation, true, [Integer] mock.loose_expectation 1 assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 225 def test_verify_fails_when_mock_block_returns_false mock = Minitest::Mock.new mock.expect :foo, nil do false end e = assert_raises(MockExpectationError) { mock.foo } exp = "mocked method :foo failed block w/ []" assert_equal exp, e.message end
# File test/minitest/test_minitest_mock.rb, line 200 def test_verify_passes_when_mock_block_returns_true mock = Minitest::Mock.new mock.expect :foo, nil do true end mock.foo assert mock.verify end
# File test/minitest/test_minitest_mock.rb, line 149 def test_verify_raises_with_strict_args mock = Minitest::Mock.new mock.expect :strict_expectation, true, [2] e = assert_raises MockExpectationError do mock.strict_expectation 1 end exp = "mocked method :strict_expectation called with unexpected arguments [1]" assert_equal exp, e.message end
Generated with the Darkfish Rdoc Generator 2.


THREE.REVISION
THREE.NoColorSpace = ""
THREE.SRGBColorSpace = "srgb"
THREE.LinearSRGBColorSpace = "srgb-linear"
[page:NoColorSpace] defines no specific color space. It is commonly used for textures including normal maps, roughness maps, metalness maps, ambient occlusion maps, and other non-color data.
[page:SRGBColorSpace] (“srgb”) refers to the color space defined by the Rec. 709 primaries, D65 white point, and nonlinear sRGB transfer functions. sRGB is the default color space in CSS, and is often found in color palettes and color pickers. Colors expressed in hexadecimal or CSS notation are typically in the sRGB color space.
[page:LinearSRGBColorSpace] (“srgb-linear”) refers to the sRGB color space (above) with linear transfer functions. Linear-sRGB is the working color space in three.js, used throughout most of the rendering process. RGB components found in three.js materials and shaders are in the Linear-sRGB color space.
For further background and usage, see Color management.
THREE.MOUSE.LEFT
THREE.MOUSE.MIDDLE
THREE.MOUSE.RIGHT
THREE.MOUSE.ROTATE
THREE.MOUSE.DOLLY
THREE.MOUSE.PAN
The constants LEFT and ROTATE have the same underlying value. The constants MIDDLE and DOLLY have the same underlying value. The constants RIGHT and PAN have the same underlying value.
THREE.TOUCH.ROTATE THREE.TOUCH.PAN THREE.TOUCH.DOLLY_PAN
THREE.TOUCH.DOLLY_ROTATE
[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]


RT @anthony_vdh: 104 miles later on the bike, and I'm done #NoMoreMoving
5/20/2017, 2:59:28 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @anthony_vdh: 104 miles later on the bike, and I'm done #NoMoreMoving
5/20/2017, 2:59:28 PM
Favs: 0
Retweets: 0
link


Close
Detailed History
Enter channel name
Enter limit
Start
End
Reverse
Close
Delete User State
Enter channel name
Enter Key
Close
Get User State
Enter channel name
Close
Set User State Json
Enter channel name
Enter JSON
Close
Set User State
Enter channel name
Key
Value
Close
Audit Presence
Enter channel name
Close
Revoke Presence
Enter channel name
Close
Grant Presence
Enter channel name
Read Access
Write Access
Enter TTL in mins (default 1440 mins)
Close
Audit Subscribe
Enter channel name
Close
Revoke Subscribe
Enter channel name
Close
Grant Subscribe
Enter channel name
Read Access
Write Access
Enter TTL in mins (default 1440 mins)
Close
Auth Key
Enter AuthKey
Close
Where Now
Enter UUID
Close
Here Now
Enter channel name
Show UUID
Include User State
Close
Here Now
Show UUID
Include User State
Close
Publish
Enter channel name
Enter message
PubNub GAE Managed VM example using GO
Publish Key
Subscribe Key
Secret Key
Cipher
SSL
UUID


Home
Biography
Music
Photos
Videos
Sadahana Music
School
Categories
Special Classes
Fees / Timings
Achievers
Photos
Sign in
Search
Manjula Gururaj
Great Musician and a Maestro in Carnatic, Hindustani styles of classical music.
Learn more
Trending


My Hero
My hero is Randy Moss. He was a wide receiver for the Minnesota Vikings, San Francisco 49ers, Tennessee Titans, New England Patriots, and the Las Vegas Raiders in the National Football League. He was drafted in the 1998 NFL draft with the 21st pick in the first round by the Minnesota Vikings. In college he played for Marshall University and Florida State. Standing at 6 foot 4 inches Randy Moss was known for his quickness, height, catching ability, and jumping ability. He is considered one the best football players of all time and is arguably the greatest wide receiver of all time. But in my opinion he is indeed the greatest receiver of all time. He revolutionized the way that the current day receiver plays the game.
He is my hero due to the amount of confidence and how he held himself. Randy Moss never would not hold himself accountable and he was never beating himself up. An important attribute in a human is to have self confidence and he had more than enough of it. I also look up to him through his ideologies and how he would never sell himself short taking advantage of every situation to the fullest. He would always outwork everyone around him and made everyone around him better at the same time. Overall that is why Randy Moss is my hero.
Click here to return to the home page.


--- layout: page title: "About Me" description: "My Name is Rick Kingston!" header-img: "assets/owner/hero/about-bg.jpg" permalink: /about/ ---
Under Construction.
Image Source: Kuehs Photography


This week there is a guest list of things to read. For code from Theo go check out his repo.
Hi all,
Aloy asked someone else to do the reading list for 2 weeks and I volunteered for this week. So lets see what did I read/found interesting this week:
Blogs and reports
- ML with privacy at scale from Apple
Repositories
2 useful R packages for dealing with ungodly horrible excel sheets from hell. The author is a data scientist from GDS!
Testing frameworks
- mutation testing plugin: works with pytest and unittest frameworks and is a really interesting way to test that your test suite has good coverage, because just because something is tested doesn’t mean it’s well tested!
Open Neural Network Exchange format
For enabling machine learning framework interoperability
and scikit-learn/tensorflow model to onnx tools:
Cron health checks
Get notified when your cron jobs fail
A docker container image builder for researchers
https://github.com/stencila/dockter
Papers
- Online Event Processing: Achieving consistency where distributed transactions have failed
Regards, Theodore


Bulls reveal latest 'signing': Billionaire Patrice Motsepe
Cape Town - Mining magnate Patrice Motsepe has sealed the deal and now owns equal majority shares of the Blue Bulls Company.
Last month, it was reported that Remgro boss Johann Rupert and Motsepe were looking to make a joint offer to gain a majority share.
However, the Blue Bulls Company have confirmed on Friday that existing shareholders Remgro and the Blue Bulls Rugby Union (BBRU) have reduced their previously equal percentage of shareholding from 50% each, to 37% and 26%, respectively.
The deal was unanimously concluded on Thursday at a meeting held at Loftus Versfeld, which sees Motsepe owning the remaining 37% of the Pretoria-franchise.
Motsepe is undoubtedly a visionary in the business world and has often been quoted as saying, "If we continue doing the right things in Africa, we can create a very exciting and competitive global market here."
He is well-known as the owner of Absa Premiership glamour club Mamelodi Sundowns, who often play their home games at Loftus Versfeld, the Bulls' headquarters.
President of the BBRU, Willem Strauss expressed his delight with the new signing:
"We put a lot of effort into making this possible over the last few months, and I am proud to say that all the union committee members unanimously voted in favor of the deal. I firmly believe that private investors will add immense value to our beautiful game going forward. The benefits of this deal is not only to the BBCo at the professional level, it will also make a positive impact on our amateur rugby, at schools, clubs and development levels. We are privileged and excited to have partners like Motsepe in our corner."
Alfons Meyer, CEO of the BBCo is looking forward to the synergies that the new partnership brings:
"This is a brilliant deal, not only for us at the BBCo, but also for our communities and the sport industry in general. I look forward to a host of synergies and opportunities that will be forged between us. With Motsepe also owning soccer giants Mamelodi Sundowns, there is no doubt that a relationship like this will further enhance and entrench our vision to make Tshwane the sporting capital."
- Compiled by Lynn Butler


Tattle Intro - Alerting For Your Elasticsearch Data¶
Welcome to Tattle, an alerting tool for your Elasticsearch data.
Tattle aims to provide you with alerting capabilities for data stored in your Elasticsearch cluster. Utilizing powerful Elasticsearch features such as Aggregations and Lucene Query Syntax, coupled together with Tattle’s own query language (TQL) we aim to make alerts easy to build and most of all, easy to read (because lets face it, you probably wont be the only one who has to read them)
Overview¶
Tattle was designed to use the powerful features of Elasticsearch (such as Aggregations) to alert us to a multitude of various metrics and log or event type data. Thing such as frequencys, event spikes, aggregation matches, etc all play a big role in our capabilities for alerting. Coupled together with an extendable alert action
mechanism and Tattle can even fix problems for you as they arise ( using the script
action for example ), notify a Pager Duty Service, or even post to a Slack channel, or all of the above.
History¶
Back in 2013 when ELK was farily new term in most people vocabularies, I couldnt find any way to alert on the data inside my Elasticsearch cluster. Since I was mostly using Elaticsearch to store log, metric and event type data, I couldnt really call ELK a full logging solution until it had the alerting component. I then decided to build my own system, and “Project Bluenote” was born ( because I didnt have a better name for it at the time (and because I was listening to some old Bluenote records when I wrote the first few lines of code)). Over the next year or so it was developed on an off in my free time and eventually became an invaluable tool for keeping my companys site up. One day, after it alerted me that someone had released some particularly questionable code, they said “Bluenote is such a tattle tale”.
Requirements¶
- Python 2.7
- Virtualenv
- Pip
- Git
Install¶
Lets assume we will assume will be installing Tattle to /opt/Tattle
.
cd /opt
git clone https://github.com/nickmaccarthy/Tattle
cd /opt/Tattle
virtualenv env && source env/bin/activate
pip install -r requirements.txt
Note: $TATTLE_HOME
refers to where you have installed Tattle. In the case of this documentation we installed it in /opt/Tattle
Check out the Getting Started - Install & Setup section for more details.


|
| ClockTypeLabels |
static const |
parallel array of labels for the built-in clock types. |
| exogoffs |
static |
\(\eta\) and \(\epsilon\) subspaces. |
| Fgamma |
static |
2-dimensiona array pointing to \(\Gamma\), [r,f]. |
| Gamma |
static |
\(\Gamma\): array (list) of groups of fixed and random effects,
\(\gamma\). |
| groupoffs |
static |
\(\Gamma\) related subspaces. |
| ilistnames |
static const |
|
| maskoffs |
static |
|
| NDPlabels |
const |
|
| Theta |
static |
\(\Theta\): array (list) of endogenous states \(\theta\). |
| thetaoffs |
static |
\(\theta\) tracking or iterating indices. |
|
| ReverseState |
|
Recreate a State vector from an index and offset vector. |
|
| ClockTypes |
|
Send one of these tags as first argument to SetClock() to use that clock. |
| DataColumnTypes |
|
Kinds of variables in data sets. |
| DPPhases |
|
Phases of DP computations. |
| FlatOptions |
|
Flat views of panel data. |
| GMMWeightOptions |
|
Weighting of moments in GMM. |
| HookTimes |
|
Points in the solution process that users can insert static functions or methods. |
| InteractionTypes |
|
Type of Interaction Auxiliary Values. |
| LikelihoodTypes |
|
Type of likelihood function to build based on observability. |
| NReachTypes |
|
Categories of Endgoenous State Reachability. |
| SmoothingMethods |
|
Ways to smooth choice probabilities without adding an explicit continuous error ζ. |
| StateCategories |
|
Categories of state variables. |
| SubSpaces |
|
Groups of continguous SubVectorNames. |
| SubVectorNames |
|
Vectors of state variables. |
| TransStore |
|
Elements of array stored at each theta. |
| UpdateTimes |
|
Point in solving when updating of parameters and transitions needs to occur. |
| Vspace |
|
Names for 0 and 1 for Bellman iteration. |
|
| AllGroupsExist |
static |
Integer TRUE (default) means all possible combination of fixed and random groups exist
in the group space Γ and should be created. |
| CallTrans |
static |
If UpdateTime=WhenFlagIsSet then next Solve() will
update transitions. |
| HasBeenUpdated |
static |
Transitions has been called. |
| HasFixedEffect |
static |
Γ already includes fixed effects |
| HasKeptZ |
static |
Includes a kept continuous state variable. |
| inctime |
static |
time increment. |
| IsErgodic |
static |
create space to store \(P(\theta';\alpha,\theta)\)
and update it if SetPstar during interation. |
| NKstep |
static |
Newton-Kantorovich Step is active. |
| onlyDryRun |
static |
Do not create Θ, but do everything else. |
| Phase |
static |
Phase of model solution or use. |
| Prunable |
static |
TRUE if clock is finite horizon so automatic pruning
can apply. |
| ReadIN |
static |
Read I and N objects from .dim file (avoids one span of
the state space to find reachable indices. |
| runtime |
static |
vector of time spent in each phase. |
| setPstar |
static |
set \(P^*(\alpha,\cdots)\)
in Bellman |
| StatStage |
static |
Stationary Stage of value iteration. |
| StorePA |
static |
store Α.D x Θ.D matrix
of choice probabilities |
| ThetaCreated |
static |
CreateSpaces() has been called or not. |
| time0 |
static |
base time mark. |
| UpdateTime |
static |
Indicators for when transit update occurs. |
| UseStateList |
static |
. |
|
| NewPhase |
static |
Cumulate time on current phase, report time, set new phase. |
| Reset |
static |
|
| SetPrunable |
static |
Sets Prunable to TRUE if the clock setting makes automatic pruning of the state space valid. |
| TimeProfile |
static |
Report the time spent in different phases of the calculations. |
|
| ClockTypes |
Send one of these tags as first argument to SetClock() to use that clock.
|
InfiniteHorizon, Ergodic, SubPeriods, NormalAging, StaticProgram, RandomAging, RandomMortality, UncertainLongevity, RegimeChange, SocialExperiment, UserDefined, NClockTypes |
| DataColumnTypes |
Kinds of variables in data sets.
|
idvar, avar, svar, auxvar, freqvar, NColumnTypes |
| DPPhases |
Phases of DP computations. The current phase is set by the code and time spent in each phase is tracked.
- See also:
- TimeProfile
|
INBETWEEN, INITIALIZING, SOLVING, SIMULATING, LIKING, PREDICTING, NDPhases |
| FlatOptions |
Flat views of panel data.
|
LONG, WIDE, FlatOptions |
| GMMWeightOptions |
Weighting of moments in GMM.
UNWEIGHTED | No weighting occurs |
UNCORRELATED | Each difference between empirical and predicted moments is weighted by the inverse of its (bounded)
sample standard deviation. This treats each moment as uncorrelated with other moments, including contemporaneous moments.
In addition, each moment has an ad hoc influnce weight that is read in from the data for time value t=-1.
|
IGNOREINFLUENCE | Same as UNCORRELATED, but any influence weight in the data (at t=-1)
is ignored. | \
CONTEMPORANEOUS | [NOT YET IMPLEMENTED]. This reads in a matrix of weights to apply to
each time period's differences pre |
INTERTEMPORAL | This applies a matrix of weights to the full path, read in from
files with names pathW_ff.mat and ff is the index of the fixed group. These files are created
by |
AUGMENTEDPATHW | This augments path weighting matrices. Moments that do
not vary have weight 0. This weights these moments by 0.01 so that they are matched as well as variable moments. |
|
UNWEIGHTED, UNCORRELATED, IGNOREINFLUENCE, CONTEMPORANEOUS, INTERTEMPORAL, AUGMENTEDPATHW, GMMWeightOptions |
| HookTimes |
Points in the solution process that users can insert static functions or methods.
PreAuxOutcomes | Called by ExpectedOutcomes() and AuxLikelihood()
as they run, which only happen if there are AuxiliaryValues added to the model.
At this point all state variables have been synched and each aux value's Realize()
or Likelihood method will be called. This allows the model to compute realized values at
a given value of \(\eta\) and \(\theta\) and store them temporarily. |
PreUpdate | Called by Transitions(). The point this occurs depends on UpdateTime |
| The times below are ordered in decreasing frequency of execution. |
AtThetaTrans | Called by Method::Run() for each endogenous state θ before
the transition is computed. |
PostSmooth | Called by Run() after each time the value of a state has been computed and
Smooth() has been called to compute choice probabilities. That is, it is called only when setPstar is TRUE. For stationary models
this is only when convergence has been reached. For non-stationary times it is after each value iteration. |
PostGSolve | Called by RandomSolve::Run() after a call to GSolve has traversed the state space. That is, after the value of
all states has been found. |
PostRESolve | Called by Run() after all random effects have been solved. That is, after all
choice probabilities relevant to observationally-equivalent problems have been computed. At this point a mixture over choice probabilities coudl be could be computed. |
PostFESolve | Called by Solve() after all fixed effect groups have been solved. That is, after all problems defined by
the user's DP model have been solved. |
GroupCreate | Called by the task that sets up the group space Gamma (Γ) before creation
of each separate group. The function added here should return TRUE if the group should be created and FALSE otherwise. |
- See also:
- Hooks, UpdateTime
|
PreAuxOutcomes, PreUpdate, AtThetaTrans, PostSmooth, PostGSolve, PostRESolve, PostFESolve, GroupCreate, NHooks |
| InteractionTypes |
Type of Interaction Auxiliary Values.
|
NoInt, StateInt, ActInt, AuxInt, InteractionTypes |
| LikelihoodTypes |
Type of likelihood function to build based on observability.
| Tag | Explanation |
CCLike | Everything is observed except for the additive choice-specific error ζ.
Auxiliary values cannot contribute anything extra information. See CCLikelihood |
ExogLike | The exogenous vector ε is also unobserved. Under this form
the likelihood of AuxiliaryValues is relevant and AuxLikelihood() is called
for each observation and each value of ε |
PartObsLike [default] | Account for (sum over) any form of unobservability in states and actions. Currently
this form cannot incorporate likelihood of auxiliary values. |
- See also:
- OutcomeDataSet, IIDLikelihood, PartialObservedLikelihood
|
CCLike, ExogLike, PartObsLike, LikelihoodTypes |
| NReachTypes |
Categories of Endgoenous State Reachability.
| Tag | Means |
| InUnRchble | Unreachable because a state variable is inherently unreachable |
| UUnRchble | Unreacheable because a user Reachable returns FALSE |
| Rchble | Reachable |
|
InUnRchble, UUnRchble, Rchble, NReachTypes |
| SmoothingMethods |
Ways to smooth choice probabilities without adding an explicit continuous error ζ.
NoSmoothing
Optimal choices are equally likely, sub-optimal choices have zero choice
probability:
\(n^\star = \) number of feasible choices in \(\arg\max\ v(\alpha;\theta)\).
\(P^\star (\alpha;\theta) = I\left\{\alpha \in \arg\max_{\alpha}\ v(\alpha;\theta)\right\} / n^\star\)
Note: exogenous (ε) and semi-exogenous (η) state variables are allowed but they are suppressed in the notation for readibility.
LogitKernel
$$P^\star = {e^{\rho\left(v(\alpha)-V\right)} \over \sum_{a\in A(\theta) } e^{\rho\left(v(a)-V\right)}}$$
GaussKernel
… to be added
|
NoSmoothing, LogitKernel, GaussKernel, ExPostSmoothingMethods |
| StateCategories |
Categories of state variables.
These categories are used mainly for summarizing the model.
|
NONRANDOMSV, RANDOMSV, COEVOLVINGSV, AUGMENTEDV, TIMINGV, TIMEINVARIANTV, NStateCategories |
| SubSpaces |
Groups of continguous SubVectorNames.
Explanation
Many aspects of a model solution or application require processing more than one
of the vector types organized by SubVectorNames. In essentially all
such tasks the vectors to be processed are next to each other in the order they
are stored in S.
The different sets of vectors that might be needed to carry out a task are
then group into a range of elements of the sub vector list.
Different ranges of subvectors are represented as objects of the SubSpace class.
Subspace information is somewhat similar to the information in Space, and neither
class stores the state variables themselves.
Many of these ranges consist of only one vector. They are the ones that
have only in their name. For example, onlyexog
is the subspace that consists of only the endog space (the ε vector
in the mathematical description.).
The table below only describes the subspaces that are not the same as a vector.
| bothexog | All state variables that either exogenous
or semi-exogenous. That is, mathematically it is the concatentation of ε and η |
| tracking | All state variables that are required for tracking
results of the model solution. In the model this is simply θ again, but internally
it is both the endog and clock vectors | , except only the leftmost
element of the clock (the actual t variable) is included. This avoids storing
unnecessary information about t'.
| iterating | State variables needed when iterating on
Bellman's equation. This subspace includes all elements of the clock block. |
| bothgroup | The full group vector γ, concatenating
the rgroup and fgroup spaces. |
|
onlyacts, onlyexog, onlysemiexog, bothexog, onlyendog, tracking, onlyclock, allstates, iterating, onlyrand, onlydynrand, onlyfixed, bothgroup, DSubSpaces |
| SubVectorNames |
Vectors of state variables.
Explanation
Typically the user does not need to use these names unless building a new solution method
or similar core programming. This information is for those curious about how the underlying code
is organized.
In the mathematical description of a DDP model, there are several
vectors of variables. These variables are represented by objects in the model
and the overall list of variable objects added to the model is stored in States.
The vectors themselves are lists (oxarray s) of objects which store
store a pointer to (not a separate copy of) the state variables in States.
This list of lists of variables is stored in SubVectors.
To get things done the aspects of the separate state variables has to be combined
into information about the vector they belong. The list SubVectors itself cannot
capture that aggregate information.
This aggreate information about the variables in a vector include how many endogenous
state variables there are and how many points in the space they create. This information
is constructed by CreateSpaces() for each vector and storedin objects of the Space class.
The list of Space objects is itself an oxarray held in DP::S (which is
documented only in the internal version of this documentation).
The integer tags listed here are the internal names of the elements of both that array
and the array SubVectors of variable objects.
For example, when the user's code calls EndogenousStates() it adds the objects
sent as arguments to the list DP::SubVectors[endog] . Then CreateSpaces()
will go through that list and create information about the endogenous space Θ
and store it in object DP::S[endog]
| acts | The components of the action vector α.
Including action variables in the same list of lists makes the internal code
a little cleaner. |
| exog | The fully exogenous vector ε |
| semiexog | The semi-exogenous vector η |
| endog | The endogenous vector θ (not including the clock). |
| clock | The clock block. In the mathematical description the
clock is an element of θ to avoid yet another vector and Greek letter. However,
internally it is easier to separate the clock block from θ |
| rgroup | The RandomEffect elements of the group vector γ.
Again, to avoid extra notation, the mathematical description puts both random
and fixed effects into one vector, but internally they are stored on separate
lists. |
| fgroup | The FixedEffect elements of γ. |
| DSubVectors | The number of different vectors. |
| LeftSV | Equivalent to exog . This is the index
of the leftmost true state vector. This ensures some internal loops over
vectors start at the right place even if additional vectors have to be added
later to the code. |
|
acts, exog, semiexog, endog, clock, rgroup, fgroup, DSubVectors, LeftSV |
| TransStore |
Elements of array stored at each theta.
|
Qtr, Qit, Qrho, TransStore |
| UpdateTimes |
Point in solving when updating of parameters and transitions needs to occur.
| InCreateSpaces | Transitions do not depend on any parameters that change so they can be initialized
in CreateSpaces() and never recalculated. |
| WhenFlagIsSet | Update transitions at the start of Solve() but ONLY if the RecomputeTrans() has
been called. This ensures that if transitions depend on parameters that are controlled by the outside but multiple calls to solve
will be made for the same parameter values (say while computing equilibrium prices and transitions only depend on parameters) |
| OnlyOnce | Update transitions just once on each call to Solve(). This ensures that if transitions depend
on parameters that are controlled by the outside (say by an optimization algorithm) the probabilities used in solving the model will
reflect any changes in the parameters since the last time the solution method was applied. |
| AfterFixed | Update transitions after the value of the fixed groups is set. This will allow transitions to depend on the value of
fixed effect variables. |
| AfterRandom | Update transitions after the value of the random groups is set. This will allow transitions to depend on the value of
both fixed and random effect variables. |
There is a potentially large computational cost of updating the transitions more often than is necessary.
- See also:
- SetUpdateTime
|
InCreateSpaces, WhenFlagIsSet, OnlyOnce, AfterFixed, AfterRandom, UpdateTimes |
| Vspace |
Names for 0 and 1 for Bellman iteration.
In ValueIteration an 2-array of vectors are stored as scratch-space for Bellman
iteration. now and later toggled back and forth between 0 and 1
as iteration procedes which avoids copy potentially large vectors each time.
|
NOW, LATER, DVspace |


| Interface | Description |
|---|---|
| DistributedStorage |
A storage abstraction for interacting with distributed storage implementations.
|
| DistributedTransaction | |
| DistributedTransactionManager | |
| MutationCondition |
An abstraction for mutation condition.
|
| MutationConditionVisitor |
A visitor class for
MutationCondition |
| OperationVisitor |
A visitor class for
Operation s |
| Result |
A result retrieved from
DistributedStorage . |
| Scanner |
A scanner abstraction for iterating results.
|
| SerializableStrategy |
| Class | Description |
|---|---|
| ConditionalExpression |
A conditional expression used in
MutationCondition . |
| Delete |
A command to delete an entry from
DistributedStorage . |
| DeleteIf |
An optional parameter of
Delete for conditional delete. |
| DeleteIfExists |
An optional parameter of
Delete for conditional delete. |
| Get |
A command to retrieve an entry from
DistributedStorage . |
| Mutation | |
| Operation |
An abstraction for storage operations.
|
| Put |
A command to put an entry to
DistributedStorage . |
| PutIf |
An optional parameter of
Put for conditional put. |
| PutIfExists |
An optional parameter of
Put for conditional put. |
| PutIfNotExists |
An optional parameter of
Put for conditional put. |
| Scan |
A command to retrieve entries within a partition from
DistributedStorage . |
| Scan.Ordering |
An optional parameter of
Scan command to specify ordering of returned results. |
| Selection |
| Enum | Description |
|---|---|
| ConditionalExpression.Operator | |
| Consistency |
Consistency level set in an
Operation . |
| Isolation | |
| Scan.Ordering.Order | |
| TransactionState |


Major Project 1 IS117
For those looking to further their knowledge in web development and collaboration, our guide should get the job done. We’ll go over the basics of setup to get you and your team ready to design and develop websites. We’ll also be going over version control through git, to make development organized and efficient. And if you ever need it, our guide can always be a great refresher. To get started, click on any of the above tutorial links.


|
XLabs
Cross-platform reusable C# libraries
|
Low cost control to display a set of clickable items More...
Public Member Functions | |
| delegate void | RepeaterViewItemAddedEventHandler (object sender, RepeaterViewItemAddedEventArgs args) |
| Event delegate definition fo the ItemCreated event More... | |
| RepeaterView () | |
| Initializes a new instance of the RepeaterView<T> class. More... | |
Static Public Attributes | |
| static readonly BindableProperty | ItemTemplateProperty |
| Definition for ItemTemplate More... | |
| static readonly BindableProperty | ItemsSourceProperty |
| Definition for ItemsSource More... | |
| static BindableProperty | ItemClickCommandProperty |
| Definition for ItemClickCommand More... | |
| static readonly BindableProperty | TemplateSelectorProperty |
| Definition for TemplateSelector More... | |
Protected Member Functions | |
| virtual void | NotifyItemAdded (View view, T model) |
| Gives codebehind a chance to play with the newly created view object :D More... | |
| virtual DataTemplate | GetTemplateFor (Type type) |
| Select a datatemplate dynamically Prefer the TemplateSelector then the DataTemplate More... | |
| virtual View | ViewFor (T item) |
| Creates a view based on the items type While we do have T, T could very well be a common superclass or an interface by using the items actual type we support both inheritance based polymorphism and shape based polymorphism More... | |
Properties | |
| IEnumerable< T > | ItemsSource [get, set] |
| Gets or sets the items source. More... | |
| TemplateSelector | TemplateSelector [get, set] |
| Gets or sets the template selector. More... | |
| ICommand | ItemClickCommand [get, set] |
| Gets or sets the item click command. More... | |
| DataTemplate | ItemTemplate [get, set] |
| The item template property This can be used on it's own or in combination with the TemplateSelector More... | |
Events | |
| RepeaterViewItemAddedEventHandler | ItemCreated |
| Occurs when a view has been created. More... | |
Low cost control to display a set of clickable items
| T | The Type of viewmodel |
| T | : | class |
Initializes a new instance of the RepeaterView<T> class.
Element created at 15/11/2014,3:13 PM by Charles
|
protectedvirtual |
Select a datatemplate dynamically Prefer the TemplateSelector then the DataTemplate
| type |
|
protectedvirtual |
Gives codebehind a chance to play with the newly created view object :D
| view | The visual view object |
| model | The item being added |
| delegate void XLabs.Forms.Controls.RepeaterView< T >.RepeaterViewItemAddedEventHandler | ( | object | sender, |
| RepeaterViewItemAddedEventArgs | args | ||
| ) |
Event delegate definition fo the ItemCreated event
| sender | The sender(this). |
| args | The RepeaterViewItemAddedEventArgs instance containing the event data. |
Element created at 15/11/2014,3:12 PM by Charles
|
protectedvirtual |
Creates a view based on the items type While we do have T, T could very well be a common superclass or an interface by using the items actual type we support both inheritance based polymorphism and shape based polymorphism
| item |
| InvalidVisualObjectException |
Thrown when the matched datatemplate inflates to an object not derived from either Xamarin.Forms.View or Xamarin.Forms.ViewCell
|
static |
Definition for ItemClickCommand
Element created at 15/11/2014,3:11 PM by Charles
|
static |
Definition for ItemsSource
Element created at 15/11/2014,3:11 PM by Charles
|
static |
Definition for ItemTemplate
Element created at 15/11/2014,3:11 PM by Charles
|
static |
Definition for TemplateSelector
Element created at 15/11/2014,3:12 PM by Charles
|
getset |
Gets or sets the item click command.
The item click command.
Element created at 15/11/2014,3:13 PM by Charles
|
getset |
Gets or sets the items source.
The items source.
Element created at 15/11/2014,3:13 PM by Charles
|
getset |
The item template property This can be used on it's own or in combination with the TemplateSelector
Element created at 15/11/2014,3:10 PM by Charles
Gets or sets the template selector.
The template selector.
Element created at 15/11/2014,3:13 PM by Charles
| RepeaterViewItemAddedEventHandler XLabs.Forms.Controls.RepeaterView< T >.ItemCreated |
Occurs when a view has been created.
Element created at 15/11/2014,3:13 PM by Charles


class: center, middle, inverse, title-slide # Lecture 11 ## Hedonics ### Ivan Rudik ### AEM 4510 --- exclude: true ```r if (!require("pacman")) install.packages("pacman") ``` ``` ## Loading required package: pacman ``` ```r pacman::p_load( tidyverse, xaringanExtra, rlang, patchwork, nycflights13, tweetrmd, vembedr ) options(htmltools.dir.version = FALSE) knitr::opts_hooks$set(fig.callout = function(options) { if (options$fig.callout) { options$echo <- FALSE } knitr::opts_chunk$set(echo = TRUE, fig.align="center") options }) ``` ``` ## Warning: 'xaringanExtra::style_panelset' is deprecated. ## Use 'style_panelset_tabs' instead. ## See help("Deprecated") ``` ``` ## Warning in style_panelset_tabs(...): The arguments to `syle_panelset()` changed ## in xaringanExtra 0.1.0. Please refer to the documentation to update your slides. ``` ```r red_pink <- "#e64173" # A blank theme for ggplot theme_empty <- theme_minimal() + theme( legend.position = "none", title = element_text(size = 24), axis.text.x = element_text(size = 24), axis.text.y = element_text(size = 24, color = "#ffffff"), axis.title.x = element_text(size = 24), axis.title.y = element_text(size = 24), panel.grid.minor.x = element_blank(), panel.grid.major.y = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA), axis.line = element_line(colour = "black"), axis.ticks = element_line(), ) theme_blank <- theme_minimal() + theme( legend.position = "none", title = element_text(size = 24), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.title.x = element_blank(), axis.title.y = element_blank(), panel.grid.minor.x = element_blank(), panel.grid.major.y = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA), axis.line = element_blank(), axis.ticks = element_blank(), ) theme_regular <- theme_minimal() + theme( legend.position = "none", title = element_text(size = 14), axis.text.x = element_text(size = 24), axis.text.y = element_text(size = 24), axis.title.x = element_text(size = 24), axis.title.y = element_text(size = 24), panel.grid.minor.x = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), axis.ticks = element_line(), axis.line = element_line(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA) ) ``` ```r set.seed(1000) # Number of houses num_houses <- 1000 house_data <- tibble( house_num = seq(from = 1, to = num_houses) ) house_data <- house_data %>% as_tibble() %>% mutate( ozone = exp(rnorm(num_houses))*30, num_bedrooms = sample(1:4, 1000, replace = TRUE), num_bathrooms = sample(seq(1, 3, .5), 1000, replace = TRUE), sq_feet = exp(rnorm(num_houses))*1000, log_price = 12 + .1*num_bedrooms + .08*num_bathrooms + .0001*sq_feet - .005*ozone + rnorm(1000)*.5, price = exp(log_price) ) %>% filter(sq_feet > 500) lm(log_price ~ num_bedrooms + num_bathrooms + sq_feet + ozone, house_data) %>% broom::tidy() ``` ``` ## # A tibble: 5 x 5 ## term estimate std.error statistic p.value ## <chr> <dbl> <dbl> <dbl> <dbl> ## 1 (Intercept) 11.7 0.0722 163. 0. ## 2 num_bedrooms 0.136 0.0163 8.39 2.45e-16 ## 3 num_bathrooms 0.161 0.0256 6.29 5.54e-10 ## 4 sq_feet 0.0000971 0.00000900 10.8 2.46e-25 ## 5 ozone -0.00466 0.000383 -12.2 3.77e-31 ``` --- # Roadmap - What can we use to infer the demand for environmental goods? - What do housing prices tell us? - When do changes in house prices give us welfare measures --- class: inverse, center, middle name: hedonics # Hedonic valuation

 --- # Revealed preference approaches There is no clear way to .hi[directly] value changes in quantities of environmental goods -- Why? -- There aren't any markets for them! -- Is there a way we can reveal the value of these goods? --- # Revealed preference approaches One way to circumvent this problem is to look at private goods that interact with the environmental good -- If there are changes in the environmental good, -- holding everything else fixed, -- that should be reflected in *some way* in changes in the price of the related private good -- This change in price can tell us something about how people value the change in the environmental good --- # Revealed preference approaches: example There is no market for orcas -- Suppose there's a massive decline in orcas off the Washington coast, what happens? -- We will likely see demand for sightseeing tours go down (MB of these tours went down!) -- This drops the price of tours -- A non-market good had an effect on a market price -- What does this price change mean? --- # Hedonics: Property value models Common market goods to use for revealed preference valuation are .hi-blue[properties] -- When people buy a home they are purchasing a bundle of goods: - Rooms - Bathrooms - School quality - .hi[Environmental quality] -- Homes located in pristine areas are likely to be more valuable than identical homes located near toxic facilities --- # Hedonics: Property value models Real estate is virtually ideal for measuring environmental changes -- Real estate markets are often competitive and thick -- Property purchases are large and consequential: buyers and sellers are likely to be well-informed -- It is uncontroversial that property values should reflect local attributes -- e.g. homes in better school districts are typically more expensive --- class: inverse, center, middle name: superfund # BCA of Superfund

 --- # Superfund
--- # Superfund Congress passes Comprehensive Environmental Response, Compensation, and Liability Act (“Superfund”) in 1980 -- Located and analyzed hazardous waste sites nation-wide -- Since then, the EPA has identified more than 47,000 hazardous waste sites that potentially require some sort of cleanup action -- By 2005: $35 billion in federal funding has been spent at roughly 800 sites --- # Superfund .hi[Superfund site cleanups are not cheap] -- Even before the budget crisis in Washington, there were many calls for an evaluation of the costs and the benefits of the program -- The costs requiring a careful accounting of all the resources that go into a cleanup, and the benefits necessitating a .hi[non-market valuation] exercise: superfund cleanups do not trade in the marketplace -- How do we do it? --- # Superfund But the houses surrounding a remediated site trade in the marketplace -- This provides one of the most simple and straightforward ways in which to look for estimates of the benefits of a Superfund cleanup: through change in property values -- Main idea: -- Take two otherwise very similar houses: one in a neighborhood surrounding a site that has been cleaned up and one in a neighborhood surrounding a site that has not -- How do their prices differ? --- # The hedonic method The hedonic pricing approach derives from the characteristics theory of value first proposed by Lancaster (1966) -- This seeks to explain the value of a commodity as a bundle of valuable characteristics -- One or more of these characteristics may be environmental -- Ridker and Henning (1967) first applied method to environmental valuation in a study of the effect of air pollution on property values in St. Louis -- It motivated the conceptual model of Rosen (1974) of how we might use hedonic prices to estimate peoples’ values for site-specific amenities --- # The hedonic method What might housing prices depend on? -- Site characteristics (parcel size, bedrooms, etc) -- Neighboorhood characteristics (school district, crime, public transit, etc) -- Environmental quality (air quality, noise, etc) --- # The hedonic model Property value approaches are often called .hi-blue[hedonics] because they rely on the hedonic model -- Suppose that we have some quality-differentiated good (i.e. a home) -- This good is characterized by a set of `\(J\)` property characteristics `\(x\)` - parcel size, school quality, bedrooms, etc -- It is also characterized by an environmental good `\(q\)` --- # The hedonic model The price of a house is determined by a .hi[hedonic price curve] `\(P(x,q)\)` -- `\(P\)` maps characteristics of the house and local environment to the market value of the home -- For a particular house `\(k\)` its price is `\(p_k = P(x_k,q_k)\)` -- `\(P\)` arises in equilibrium from the interaction of all buyers in sellers in the market -- Here we will assume the supply of houses is fixed in the short run so the price curve arises from buyer behavior --- # The hedonic model: the price curve .pull-left[ ![higher discount rates mean lower value](11-slides-hedonics_files/figure-html/price_fct-1.png) ] .pull-right[ The hedonic price curve is `\(P(x,q)\)` It's increasing in q (q is good) but at a decreasing rate (decreasing marginal utility) ] --- # The hedonic model: the price curve .pull-left[ ![higher discount rates mean lower value](11-slides-hedonics_files/figure-html/implicit_price-1.png) ] .pull-right[ The implicit price curve for q is `\({\partial P(x,q) \over \partial q}\)` It tells us how the price changes in q It's positive, but downward sloping Effectively the q demand curve ] --- # Price curve example    --- # The hedonic model: consumer's choice problem Households buy a single property given their budget constraint and their preferences -- Here we will assume that households are effectively just choosing `\((x,q)\)` instead of a specific house with the following objective: `$$\max_{x,q,z} U(x,q,z;s) \,\,\,\,\, s.t. \,\,\,\,\, y = z + P(x,q)$$` -- - `\(z\)` is the numeraire good (spending on other private goods) - `\(y\)` is income - `\(s\)` is the set of the household's characteristics like family size --- # Unrealistic pieces of the model One unrealistic part of this model is that we are assuming household characteristics are continuous -- Many housing characteristics are discrete (bedrooms, bathrooms, etc) -- Another is that you just can't purchase some sets of `\(x\)` (i.e. a huge lot in downtown manhattan with a farm) -- We won't touch on this in class because it's a bit more complicated, but economists know how to deal with these problems --- # Choosing q Another thing to note: the consumer *chooses* `\(q\)` -- The idea is that mobile households can move to get their desired level of the environmental good -- We are thus also implicitly assuming `\(q\)` varies across space so that households can sort into areas they prefer - q is really picking up .hi[local] environmental goods --- # What is `\(P(x,q)\)` In the model we are thinking of `\(P(x,q)\)` as the annual .hi-blue[rental rate], not the purchase price -- This allows us to mesh more cleanly with annual income and view the problem as static rather than dynamic -- This clearly works well for renting households -- For homeowners we are basically assuming they rent from themselves every year --- # The hedonic model: consumer's choice problem `$$\max_{x,q,z} U(x,q,z;s) \,\,\,\,\, s.t. \,\,\,\,\, y = z + P(x,q)$$` -- The FOCs for this problem are: -- `\begin{align} {\partial U \over \partial x_j} =& \lambda {\partial P \over \partial x_j} \,\,\, j=1,\dots,J \\ {\partial U \over \partial q} =& \lambda {\partial P \over \partial q} \\ {\partial U \over \partial z} =& \lambda \end{align}` Where `\(\lambda\)` is the Lagrange multiplier Next, combine the last two FOCs --- # The hedonic model: consumer's choice problem `\begin{align} {\partial U \over \partial q} =& \lambda {\partial P \over \partial q} \\ {\partial U \over \partial z} =& \lambda \end{align}` gives us that `$${\partial P \over \partial q} = {\partial U \over \partial q} \bigg/ {\partial U \over \partial z}$$` -- What does this mean?  --- # The hedonic model: bid functions Now let's dive deeper by looking at some reference utility level `\(\bar{u}\)`: `$$U(x,q,z;s) = \bar{u} \tag{indifference curve}$$` -- Next we will define something called a .hi-blue[bid function] `\(b(x,q,y,s,\bar{u})\)` where: `$$U(x,q,y -b(x,q,y,s,\bar{u}) ;s) = \bar{u}$$` -- The bid function `\(b\)` is the maximum amount the household is willing to pay for: - A house with characteristics `\(x,q\)` - Given income `\(y\)` and household characteristics `\(s\)` - And achieving utility `\(\bar{u}\)` --- # The hedonic model: deriving MWTP `$$U(x,q,y -b(x,q,y,s,\bar{u}) ;s) = \bar{u}$$` Differentiate with respect to `\(q\)` to get: `$${\partial U \over \partial q} + {\partial U \over \partial z} {\partial b \over \partial q} = 0$$` -- We can then rearrange to get: `$${\partial b \over \partial q} = {\partial U \over \partial q}\bigg/{\partial U \over \partial z} = {\partial P \over \partial q}$$` -- The maximum WTP is given by the implicit price curve --- # The hedonic model: deriving MWTP `$$\underbrace{\pi^q(x,q,s,\bar{u})}_{\text{marginal WTP for q}} \equiv {\partial b \over \partial q} = {\partial P \over \partial q} = {\partial U \over \partial q}\bigg/{\partial U \over \partial z}$$` By assuming `\(q\)` is a part of a larger bundle of house characteristics, we are able to characterize its demand through its relationship to the housing market -- We can then use the bid function (which maps into prices) to understand the marginal WTP for `\(q\)` --- # The hedonic model: deriving MWTP `$$\underbrace{\pi^q(x,q,s,\bar{u})}_{\text{marginal WTP for q}} \equiv {\partial b \over \partial q} = {\partial P \over \partial q} = {\partial U \over \partial q}\bigg/{\partial U \over \partial z}$$` -- Our ultimate empirical goal is to estimate `\(\pi^q(x,q,s,\bar{u})\)`, which is a kind of demand curve -- It's called a .hi-blue[Hicksian] demand curve, whereas our regular demand curves are .hi-red[Marshallian] --- # The hedonic model: deriving MWTP The difference is that with .hi-red[Marshallian] demand curves, we are holding .hi-red[income] constant on the curve, income changes are demand shifters, utility changes as you move along the curve -- With .hi-blue[Hicksian] demand curves, we are holding .hi-blue[utility] constant, income can change along the curve, utility changes are demand shifters --- # Bid functions and housing prices .pull-left[ The red line is the hedonic price function The blue lines are a single household's bid functions at different reference utility levels ] .pull-right[ ![bid function is tangent to hedonic price function](11-slides-hedonics_files/figure-html/bid_functions_1-1.png) ] --- # Bid functions and housing prices .pull-left[ Optimal choice is where the household's bid function is tangent to the hedonic price schedule: `\(a\)` This gives us an observed consumption level `\(q_0\)`, observed price `\(P(x,q_0)\)`, and realized utility `\(u^0\)` Different households will have different tangency points, different `\(q\)` and `\(P(x,q)\)` ] .pull-right[ ![bid function is tangent to hedonic price function](11-slides-hedonics_files/figure-html/bid_functions_1-1.png) ] --- # Bid functions and housing prices .pull-left[ The hedonic price function is the .hi[upper envelope] of all the bid functions i.e. all the bid functions are tangent to it The other piece of the story is we need the landlord problem It's almost identical to the buyer, but replace utility with profit ] .pull-right[ ![bid function is tangent to hedonic price function](11-slides-hedonics_files/figure-html/bid_functions_2-1.png) ] --- # Hedonic price curve and willingness to pay The hedonic price curve shows how a house varies with attributes (such as air quality) -- The slope gives the marginal price of the attributes -- At a given point on the curve, the slope also gives the marginal WTP of the consumer who purchase that level of attributes -- But we don’t know the whole marginal WTP schedule for .hi[that person], why? -- Their bid curve is only tangent at that one point, we don't see their whole bid curve, people don't buy 1,000 houses to trace out the whole curve --- # Estimating the effect of ozone Let's work through an example where we estimate the effect of ozone You have a dataframe `house_data` available on RStudio Cloud: ```r house_data ``` ``` ## # A tibble: 757 x 7 ## house_num ozone num_bedrooms num_bathrooms sq_feet log_price price ## <int> <dbl> <int> <dbl> <dbl> <dbl> <dbl> ## 1 1 19.2 4 3 577. 12.7 325955. ## 2 2 8.98 4 3 1111. 12.7 327415. ## 3 3 31.3 4 1 820. 11.9 147572. ## 4 6 20.4 3 2 886. 12.6 309274. ## 5 8 61.6 4 3 4909. 12.7 342533. ## 6 9 29.4 2 1.5 798. 11.9 141526. ## 7 10 7.60 4 1.5 946. 12.5 272931. ## 8 11 11.2 4 1 1912. 12.2 200438. ## 9 12 17.2 3 1.5 720. 12.3 216520. ## 10 13 33.9 1 1 2057. 12.8 353520. ## # … with 747 more rows ``` --- # Estimating the effect of ozone We want to understand the effect of ozone on housing prices: how much does a unit increase in ozone cost? -- Let's take a look at the summary statistics of our dataset first: ```r summary(house_data) ``` ``` ## house_num ozone num_bedrooms num_bathrooms ## Min. : 1.0 Min. : 1.648 Min. :1.00 Min. :1.000 ## 1st Qu.: 245.0 1st Qu.: 15.906 1st Qu.:1.00 1st Qu.:1.500 ## Median : 491.0 Median : 30.736 Median :2.00 Median :2.000 ## Mean : 494.4 Mean : 46.388 Mean :2.49 Mean :1.977 ## 3rd Qu.: 745.0 3rd Qu.: 57.255 3rd Qu.:4.00 3rd Qu.:2.500 ## Max. :1000.0 Max. :385.748 Max. :4.00 Max. :3.000 ## sq_feet log_price price ## Min. : 501.4 Min. :10.02 Min. : 22423 ## 1st Qu.: 892.3 1st Qu.:11.98 1st Qu.: 159513 ## Median : 1395.0 Median :12.39 Median : 241085 ## Mean : 2055.0 Mean :12.39 Mean : 292736 ## 3rd Qu.: 2415.5 3rd Qu.:12.82 3rd Qu.: 371025 ## Max. :21001.0 Max. :14.48 Max. :1946371 ``` --- # Estimating the effect of ozone Now let's plot the relationship between log house prices and ozone to see what the data actually look like: ```r ggplot(house_data, aes(x = ozone, y = log_price)) + # start plot geom_point(size = 3) + # plot points geom_smooth(formula = y ~ x, se = F, method = "lm", size = 2, color = red_pink) + theme_regular + # apply theme labs(x = "Ozone (ppb)", y = "Log Price ($)") # assign labels ``` --- # Estimating the effect of ozone Now let's plot the relationship between log house prices and ozone to see what the data actually look like: .center[ ![](11-slides-hedonics_files/figure-html/unnamed-chunk-6-1.svg) ] --- # Estimating the effect of ozone Now it's time to do the regression: ```r lm(log_price ~ num_bedrooms + num_bathrooms + sq_feet + ozone, house_data) %>% broom::tidy() ``` ``` ## # A tibble: 5 x 5 ## term estimate std.error statistic p.value ## <chr> <dbl> <dbl> <dbl> <dbl> ## 1 (Intercept) 11.7 0.0722 163. 0. ## 2 num_bedrooms 0.136 0.0163 8.39 2.45e-16 ## 3 num_bathrooms 0.161 0.0256 6.29 5.54e-10 ## 4 sq_feet 0.0000971 0.00000900 10.8 2.46e-25 ## 5 ozone -0.00466 0.000383 -12.2 3.77e-31 ``` A 1 unit increase in ozone decreases housing values by 0.466%! --- # Housing prices and superfund clean up Greenstone, Michael, and Justin Gallagher (2008). “Does Hazardous Waste Matter? Evidence from the Housing Market and the Superfund Program.” Quarterly Journal of Economics -- .hi[Main question:] How does superfund site clean up affects the housing price in the adjacent areas? -- .hi[How they do it:] Compare housing market outcomes in the areas surrounding the first 400 hazardous sites chosen for Superfund clean-ups to the areas surrounding the 290 sites that narrowly missed qualifying for these clean-ups --- # Housing prices and superfund clean up Each site is given a Hazardous Ranking System (HRS) Score (0-100) -- Because of funding limit, cutoff: HRS > 28.5 cleaned up, HRS < 28.5 are not -- Some houses were treated, others were not -- Cutoff is arbitrary (imposed by congressional budget constraints) -- Unobserved differences between treated and untreated sites are likely to be small -- Minimizes any bias with things that might be correlated with clean up --- # Superfund location    --- # Regression What do GG 2008 do? -- They regress: `$$\log(\text{2000 median home price})_c = \theta \underbrace{1(\text{cleaned up in 2000})_c}_{\text{= 1 if true, = 0 otherwise}} + \beta X_c + \varepsilon_{c}$$` -- They are interested in `\(\theta\)` which tells us the percent change in a census tract median home price if it was cleaned up -- `\(-\theta\)` is telling us the .hi-red[cost] of a superfund site to households --- # Superfund results: "quasi-experimental"    --- # Superfund results Superfund cleanups had .hi[economically and statistically insignificant effects] on property values, rental rates, housing supply, population, who lives near the site -- Suggests the mean benefits of Superfund cleanup are small -- Some recent and more granular studies (Timmins and Gamper) dispute these findings: http://www.nber.org/papers/w16655.pdf -- Why does granularity matter? --- # Superfund: zoom in .pull-left[ Superfund sites are a localized disamenity Previous attempts to value cleanup looked at changes in census tract median housing values and found no impacts Need to look .hi[within] census tracts ] .pull-right[    ] --- # Superfund: zoom in .pull-left[ Consider changes in other percentiles of within-tract house value distribution: *deletion of a site raises tract-level housing values by 18.2% at the 10th percentile, 15.4% at the median, and 11.4% at the 60th percentile* ] .pull-right[    ] --- # Hedonics closing intuition: L.O. Taylor, 2003 Imagine the following hypothetical scenario in which there are two identical lakes each with 100 identical homes surrounding them -- All homes are lakefront, and all the characteristics of the homes themselves, the land, and the neighborhoods are identical across the properties -- At the current equilibrium price of $200,000 per house, all 200 hundred homes on either lake are equally preferred --- # Hedonics closing intuition: L.O. Taylor, 2003 Now let’s imagine the clarity on one lake, Lake A, for example, is improved -- Now if any home on Lake A were offered at the original equilibrium price of $200,000, consumers would uniformly prefer this house to any house on Lake B -- In other words, at current prices, there would be excess demand on Lake A, and as such the price of these houses must rise to bring the market into equilibrium --- # Hedonics closing intuition: L.O. Taylor, 2003 The price differential that results from a change in water quality at Lake A is the implicit price that consumers are willing to pay for that incremental increase in water clarity -- This willingness to pay for water clarity is directly revealed to us through the market prices of the homes -- If in the new equilibrium houses on Lake A sell for 210,000, while house on Lake B sell for 200,000, the “implicit price” associated with the increased water clarity is 10,000 dollars --- # Value of a statistical life (VSL) This is a topic that makes non-economists uncomfortable -- But for policy analysis, there is no way around it -- How much should society spend, at the margin, to save a 'statistical life'? -- A statistical life is a probabilistic concept -- VSL reflects willingness to pay for a reduction in the risk of death -- VSL is more appropriately called the value of mortality risk --- # Value of a statistical life (VSL) How do you get a credible estimate of the VSL? -- People can't just .hi[tell] you it -- But we can observe it from behavior -- How? -- See tradeoffs people make between cost and safety --- # Value of a statistical life (VSL) Some examples: -- Driving speed -- Vehicle choice -- Wage-risk relationship -- There's lots of studies, and lots of different answers --- # VSL > EPA recommends that the central estimate of $7.4 million ($2006), updated to the year of the analysis, be used in all benefits analyses that seek to quantify mortality risk reduction benefits regardless of the age, income, or other population characteristics of the affected population until revised guidance becomes available --- # VSL thought experiment Suppose that individuals are willing to adopt a safety procedure, for which they have to give up 25 cents per hour, to reduce risk of on-the-job fatality by 1 in 10,000 (annual risk) -- This translates into 2000*0.25=$500 per year -- Consider 10,000 independent workers -- This procedure would result in one fewer person dying on average -- VSL = $500*10,000 = 5 million dollars --- # Estimating a hedonic wage function We can estimate a .hi[hedonic wage function:] $$ w_i = \alpha + \beta_1 H_i + \beta_2 X_i + \beta_3 p_i H_i + \gamma_1 p_i + \gamma_2 q_i + \gamma_3 q_i WC_i + \varepsilon_i$$ -- `\(w\)`: wage `\(H\)`: worker personal characteristics `\(X\)`: job characteristics `\(p\)`: risk of death at the job `\(q\)`: non-fatal risk at the job `\(WC\)`: workers' compensation benefits for injury `\({\partial w \over \partial p}\)` is the wage-risk trade off for marginal changes in risk --- # VSL from the hedonic wage function Suppose the coefficient on mortality risk was 0.4 where wages were in thousands of dollars and risk is deaths per 10,000 (WTP 400 dollars to reduce risk by 1/10,000) -- This means that: `$$VSL = (0.4 \times 10,000) \times 1000) = 4 \text{ million dollars}$$` -- Suppose a policy reduces mortality risk by 1/10,000 for 60,000 people -- This policy has a value of: $$ 400*60,000 = 24 \text{ million dollars}$$ --- # VSL estimates


Remember to insert correct data, otherwise the transaction will not be processed
Or import the file with signed data:
Consider voting for bioly delegate!
MyLisk.com
Thank you for support


×
Book Viewer
Title
Author
Category
ISBN
Danger Zone
Delete Book
Bookstore
Add a book
Categories
All ({{categories.all}})
Fiction ({{categories.fiction}})
Fantasy ({{categories.fantasy}})
Terror ({{categories.terror}})
Humor ({{categories.humor}})
Organize by
None
Title
Author
Category
ISBN
Order
Ascending
Descending
{{book.author}} - {{book.title}}
No books were found
Created by Bruno Calou Alves
Copyright ©


/*====================================================================* * * Copyright (c) 2011 Qualcomm Atheros Inc. * * Permission to use, copy, modify, and/or distribute this software * for any purpose with or without fee is hereby granted, provided * that the above copyright notice and this permission notice appear * in all copies.  IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * *--------------------------------------------------------------------*/ /*====================================================================* * * void MACPasswords (uint32_t vendor, uint32_t device, unsigned number, unsigned count, unsigned group, unsigned space, flag_t flags); * * keys.h * * print a range of device address/password pairs on stdout; print * an optional usage flag in the first column for PTS compatability; * * vendor is the 24-bit OUI expressed as an integer; device is the * 24-bit starting unit address expressed as an integer; number is * the number of address/password pairs to generate; count is the * number of letters in the password excluding delimiters; * * passwords consists of letters arranged in groups separated by * spaces; count is the number of letters; group is the number of * letters in each group; space is the character that separates * each group; * * vendor is used to seed the random number generator and create * a character set having the 256 random upper case letters used * for all vendor passwords; most letters will appear more than * once in the character set; * * device is used to seed the random number generator and select * count random letters from the character set until the password * has been constructed; * * * Contributor(s): * Charles Maier<EMAIL_ADDRESS>* *--------------------------------------------------------------------*/ #ifndef MACPASSWORDS_SOURCE #define MACPASSWORDS_SOURCE #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <stdint.h> #include <limits.h> #include <netinet/in.h> #include "../tools/types.h" #include "../tools/flags.h" #include "../key/keys.h" static uint64_t MACSeed = 0; static uint64_t MACSRand (uint64_t seed) { uint64_t temp = MACSeed; MACSeed = seed; return (temp); } static uint32_t MACRand () { MACSeed *= 0x41C64E6D; MACSeed += 0x00003029; return ((uint32_t)((MACSeed >> 0x10) & 0x7FFFFFFF)); } static void MACPassword (uint32_t device, char const charset [], unsigned count, unsigned alpha, unsigned group, char space) { unsigned letter = 0; MACSRand (device); while (letter < alpha) { unsigned offset = MACRand () % count; if ((letter) && (group) && !(letter%group)) { putc (space, stdout); } putc (charset [offset], stdout); letter++; } return; } void MACPasswords (uint32_t vendor, uint32_t device, unsigned count, unsigned alpha, unsigned group, unsigned space, flag_t flags) { char charset [UCHAR_MAX + 1]; unsigned offset = 0; if (vendor >> 24) { return; } if (device >> 24) { return; } if (count >> 24) { return; } MACSRand (vendor); while (offset < sizeof (charset)) { unsigned c = MACRand () % (SCHAR_MAX + 1); if (isupper (c)) { charset [offset++] = c; } } while (count--) { if (_anyset (flags, PASSWORD_VERBOSE)) { putc ('0', stdout); putc (' ', stdout); } if (_allclr (flags, PASSWORD_SILENCE)) { printf ("%06X", vendor & 0x00FFFFFF); printf ("%06X", device & 0x00FFFFFF); putc (' ', stdout); } MACPassword (device, charset, sizeof (charset), alpha, group, space); putc ('\n', stdout); device++; } return; } #endif


{% extends 'users/mobile/resend_confirmation.html' %} {% block content %}
{%- trans %}Before you can log in, you need to confirm your email address. We've sent a new confirmation email to any account using {{ email }}. To confirm the email address, just follow the link in the email.{% endtrans -%}
{% endblock %}


1
1 is a movie starring Michael Fassbender, Niki Lauda, and Lewis Hamilton. Set in the golden era of Grand Prix Racing '1' tells the story of a generation of charismatic drivers who raced on the edge, risking their lives during...


J Xie, PK Meher, X Zhou, CY Lee
IEEE Transactions on Multi-Scale Computing Systems
Z Hu, J Xie
Symmetry 10 (11), 540
CY Lee, J Xie
IEEE Transactions on Circuits and Systems I: Regular Papers
MM Kermani, A Jalali, R Azarderakhsh, J Xie, KKR Choo
IEEE Transactions on Computer-Aided Design of Integrated Circuits and …
CY Lee, CC Fan, J Xie, SM Yuan
IEEE Access 6, 38234-38242
Q Shao, Z Hu, SN Basha, Z Zhang, Z Wu, CY Lee, J Xie
IEEE Trans. Circuits and Systems-I, 1-11
This direction of research focuses on investigating efficient algorithms and novel architectures for the computation of finite field operations according to their practical applications.
These systems are often referred to feedback control systems that use communication networks for information exchange among various system-units such as sensors, and controllers.
This research focuses on developing novel techniques to map advanced digital signal/image algorithms to architectures in various platforms, including FPGA-based image registration, pattern recognition, and machine learning systems.
This direction of research focuses on developing novel techniques to protect hardware IPs in both ASIC and FPGA platforms.
Assistant Professor in the department of Electrical and Computer
Currently serving on the editorial board of Mircoeletronics Journal(Elsevier)
PhD Electrical Engineering at the University of Pittsburgh
Cryptographic Engineering
Hardware Security
VLSI Design for AI System
[FALL 2018] Fund of Comp Engineering I Lab (ECE 2043-002)
[FALL 2018] Fund of Comp Engineering I Lab (ECE 2043-100)


Element index for package HTTP_Request
[ g ] [ h ] [ l ] [ u ] [ _ ]_
- $_id
- in file Listener.php, variable HTTP_Request_Listener::$_id
A listener's identifier
g
- getId
- in file Listener.php, method HTTP_Request_Listener::getId()
Returns the listener's identifier
h
- HTTP_Request_Listener
- in file Listener.php, method HTTP_Request_Listener::HTTP_Request_Listener()
Constructor, sets the object's identifier - HTTP_Request_Listener
- in file Listener.php, class HTTP_Request_Listener
This class implements the Observer part of a Subject-Observer design pattern. It listens to the events sent by a HTTP_Request or HTTP_Response instance.
l
- Listener.php
- procedural page Listener.php
u
- update
- in file Listener.php, method HTTP_Request_Listener::update()
This method is called when Listener is notified of an event


{{title}}
{% if registered %}
Thank you for registering!
{% else %}
Register Here
Just fill out the form.
{% csrf_token %} {{form.as_p}}
Register
{% endif %}
Already Have an account
Sign In


FFI
is a fantastic tool for easily interfacing your Ruby code with native libraries. To help you quickly ramp up and become a happier and more productive FFI
master, the following are a few of the fundamental concepts you'll want to understand in order to get the most out of FFI
.
Overall Architecture
Using FFI, you can use native libraries from Ruby without writing a single line of native code. Your good friend FFI
takes care of all of the cross Ruby implementation (MRI, JRuby, Rubinius, MacRuby, etc) and platform specific issues so that you can focus on writing and testing your Ruby code.
As great as this sounds, you just know there's something missing. Your spidey sense is right again.
As FFI is effectively a bridge between the multiple worlds of Ruby implementations and multiple platform types, you might suffer a bit of cognitive dissonance trying to pull all the pieces together. When we develop in Ruby we tend to think in higher level terms, and don't so much concern ourselves with the lower level issues. While FFI allows us to stay firmly rooted in Ruby, we also have to start thinking in lower level terms.
Core Components
FFI
has a number of useful components. Investing the time to understand FFI's components and capabilities will pay off as you begin using FFI
. That said, it's nice to have an idea which components you should look at first. Understanding the following core modules and classes is a great way to start getting FFI's capabilities:
::FFI::Library
- along withrequire 'ffi'
, this module brings FFI's powerful native library interfacing capabilities into your Ruby code as a DSL. Typically you extend your custom module with this one, specify the native libraries and their calling conventions, prototype the native library's functions and structs in Ruby, and then start using the native library's API from Ruby.::FFI::Pointer
- wraps native memory allocated by a third party library. It provides a number of methods for transferring data from unmanaged native memory to Ruby-managed native memory (::FFI::MemoryPointer
). The native memory wrapped by this class is not freed during garbage collection runs.::FFI::MemoryPointer
- allows for Ruby code to allocate native memory and pass it to non-Ruby libraries. Lifecycle management (allocation and deallocation) are handled by this class, so when it gets garbage collected the native memory is also freed, unless#autorelease=
was set to false.::FFI::Struct
and::FFI::Union
Memory Management
When you're writing Ruby code you usually don't think about memory management. It's just taken care of for most of your use cases. However, when you're leveraging FFI
, even though you're still developing in Ruby, you have to begin thinking more about these low-level issues.
Ruby has the concept of object references and garbage collection. In contrast C libraries have pointers and manual allocation and deallocation of memory. So you have to take care, that objects which provide memory referenced by a pointer, stays valid until the pointer is no longer used by the library. Therefore you have to keep references to these objects, even when they are no longer used by your ruby code.
So any use of :pointer
, :string
, :buffer_in
, :buffer_out
or :buffer_inout
must be backed by keeping a reference in ruby.
This is true for function arguments, pointer references in FFI::Struct as well as function pointers (callbacks).
In other words: A pointer on C level to a Ruby object is not considered an object reference by the Ruby runtime and is therefore not sufficient to protect the object from being garbage collected.
String Memory Allocation
One such memory management consideration occurs when you try to integrate with C functions that keep a reference to a Ruby allocated string rather than making their own copy of the string's contents. Take the following rogueware snippet which occurs more often than we'd like to admit:
static char* my_name;
void bad_set_my_name(char* name) {
my_name = name;
}
Mapped to ruby like so:
module Bar
attach_function :bad_set_my_name, [ :string ], :void
end
This code assumes that its my_name
reference to the Ruby string will remain valid during the time it's needed. So you have to store the ruby String object, that is passed to the C function, in a variable, that stays valid until my_name
is no longer in use. Usually this is either a constant or an instance variable of a Ruby object, that has the same lifetime as the loaded library. If the Ruby object is not stored in a long enough living variable, the memory address held by my_name
is no longer pointing to the string.
This is a safe call to the C function:
module Foo
NAME = "Barney"
Bar.bad_set_my_name(NAME)
end
If the string to be passed contains null bytes or the string data is modified on either the C or the Ruby side, you should copy the Ruby string to native memory. Then pass the pointer to that buffer to the C function instead of passing a raw string, and finally, update your original attach_function
signature to use the :pointer
rather than the original :string
. For example:
# proper use of the bad C function from Ruby
module Foo
NAME = FFI::MemoryPointer.from_string("Barney")
Bar.bad_set_my_name(NAME)
end
# new Ruby mapping
module Bar
attach_function :bad_set_my_name, [ :pointer ], :void
end
Using malloc/free
The FFI library provides ::FFI::MemoryPointer
to allocate heap memory.
To use the memory independently of the Ruby object lifetime, FFI::Pointer#autorelease= can be set to false.
Then it can be used like malloc()
in C.
So the memory is not freed by the Ruby runtime, even when the Pointer object is garbage collected.
This is sometimes necessary for libraries that take a memory buffer as an argument and then expect to manage that buffer's lifecycle.
buffer = FFI::MemoryPointer.from_string("content") # Allocate 8 byte of memory to put string into plus zero termination
buffer = FFI::MemoryPointer.new(8) # Alternatively allocate 8 byte of memory and fill with zeros
buffer.autorelease = false
SomeLib.function_that_will_manage_buffer(buffer)
It's still possible to free the buffer manually by calling FFI::Pointer#free, when it's no longer in use by the library.


Future Consumer reports Rs 17-cr loss in July-September; net sales up 11%
The company had posted a loss of Rs 3.23 crore in July-September 2018-19, Future Consumer, formerly known as Future Consumer Enterprise Ltd, said in a BSE filing
by Press Trust of IndiaFuture Consumer, a part of Kishore Biyani-led Future Group, on Tuesday reported widening of consolidated net loss to Rs 16.75 crore for the quarter ended September 30, 2019.
The company had posted a loss of Rs 3.23 crore in July-September 2018-19, Future Consumer, formerly known as Future Consumer Enterprise Ltd, said in a BSE filing.
However, the company's net sales were up 10.85 per cent to Rs 1,120.84 crore during the period under review as against Rs 1,011.11 crore in the year-ago period.
Total expenses were at Rs 1,121.06 crore during the period as against Rs 1,015.87 crore earlier.


| date: | 2013/12/23 |
|---|
This release is a bugfix release which corrects how the Mechanical Turk objects work & a threading issue when using datetime.strptime.
Added cn-north-1 to regions. (commit 9c89de1)
Fixed threading issues related to datetime.strptime. (issue 1898, commit 2ef66c9)
Updated all the old-style inheritance calls. (issue 1918, issue 1936, issue 1937, commit 39a997f & commit 607624f)
Documentation:
- Added missed notes about the cn-north-1 region. (commit 738c8cb)
- Added the C3 family of EC2 instances. (issue 1938, commit 05b7482)


--- layout: default title: Men's Accessories | Practice Scraping div_id: store permalink: /sample-store/men/accessories ---
$49
A classy dark leather strap
$79
Hand-stitched and customizable design
$99
Engineered to last for 100 years


Error post-encoding before directory write. Before writing the contents of the current directory, any pending data are flushed. This message indicates that an error occurred while doing this.
Error flushing data before directory write. Before writing the contents of the current directory, any pending data are flushed. This message indicates that an error occurred while doing this.
Cannot write directory, out of space. There was not enough space to allocate a temporary area for the directory that was to be written.
Error writing directory count. A write error occurred when writing the count of fields in the directory.
Error writing directory contents. A write error occurred when writing the directory fields.
Error writing directory link. A write error occurred when writing the link to the next directory.
Error writing data for field "%s". A write error occurred when writing indirect data for the specified field.
Error writing TIFF header. A write error occurred when re-writing header at the front of the file.
Error fetching directory count. A read error occurred when fetching the directory count field for a previous directory. This can occur when setting up a link to the directory that is being written.
Error fetching directory link. A read error occurred when fetching the directory link field for a previous directory. This can occur when setting up a link to the directory that is being written.


|
||||||||||
| PREV LETTER NEXT LETTER | FRAMES NO FRAMES |
DatabaseOp
into a SQL SELECT statement.Target
instance that a certain column has been
skipped.
Vendor
and its implementations
TODO: Move keepalive agent into a separate classExpression
defined directly by a raw SQL string.ResultRow
s.SystemLoader
to initialize various
D2RQ components.
|
||||||||||
| PREV LETTER NEXT LETTER | FRAMES NO FRAMES |


Risk science | Urban planning | Resilience | Climate adaptation
I study the risk and resilience of urban systems. My research is focused on transforming how we design and realize our cities in the face of climate change. I use risk science, systems engineering, modeling, and statistics to adapt our cities.
My research is at the intersection of:
Visit my Google Scholar profile for my publication record.
For media queries, my contact details are here
Check out blogs, dashboards, and news about my research
To hire me or my team for support with risk and resilience assessments or data analysis, please visit Urban Intelligence Ltd.
Education
PhD in Industrial and Operations Engineering
Master of Geography and Environmental Engineering
Bachelor of Science in Mathematics
Bachelors of Engineering (1st Class Hons) in Natural Resources Engineering
Selected Awards
Fulbright New Zealand, Science and Innovation Graduate Award
Rackham Pre-Doctoral Fellowship, University of Michigan
J X Kasperson Student Paper Award at the American Association of Geographers annual meeting 2019


| Apache | Jakarta | POI |
POI UtilsLoggingLogging in POI is used only as a debugging mechanism, not a normal runtime logging system. Logging is ONLY for autopsie type debugging, and should NEVER be enabled on a production system. Enabling logging will reduce performance by at least a factor of 100. If you are not developing POI or trying to debug why POI isn't reading a file correctly, then DO NOT enable logging. You've been warned. Hence, we need to be able to easily disable it entirely and make POI not dependent on any logging package. Warning
POI is not dependent on commons-logging for running, but not for compiling.
Logging OverviewEvery class uses a POILogger to log, and gets it using a static method of the POILogFactory . The POILogFactory uses the NullLogger by default; it can be instructed to use any other POILogger implementation by setting the system property org.apache.poi.util.POILogger. Note
java -Dorg.apache.poi.util.POILogger=the.package.of.MyPoiLoggerImpl ProgramThatUsesPoi
Fixme (nicolaken)
Still needs testing.
POILogFactoryEach class in POI can get its POILogger by calling a static method of the POILogFactory . POILoggerEach class in POI can log using a POILogger, which is an abstract class. We decided to make our own logging facade because:
There are three implementations available, and you can roll out your own, just extend org.apache.poi.util.POILogger. NullLoggerDiscards every logging request. SystemOutLoggerSends every logging request to System.out. CommonsLoggerSends every logging request to the Commons Logging package. This can use JDK1.4 logging, log4j, logkit, and is an actively maintained Jakarta Project. |