Thing > Action > AssessAction > ReviewAction
The act of producing a balanced opinion about the object for an audience. An agent reviews an object with participants resulting in a review.
| Property | Expected Type | Description |
|---|---|---|
| Properties from ReviewAction | ||
resultReview
|
Review | A sub property of result. The review that resulted in the performing of the action. |
| Properties from Action | ||
actionStatus
|
ActionStatusType | Indicates the current disposition of the Action. |
agent
|
Person or Organization | The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book. |
endTime
|
DateTime | The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions. |
instrument
|
Thing | The object that helped the agent perform the action. e.g. John wrote a book with *a pen*. |
location
|
Place or PostalAddress | The location of the event, organization or action. |
object
|
Thing | The object upon the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). e.g. John read *a book*. |
participant
|
Person or Organization | Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*. |
result
|
Thing | The result produced in the action. e.g. John wrote *a book*. |
startTime
|
DateTime | The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions. |
target
|
EntryPoint | Indicates a target EntryPoint for an Action. |
| Properties from Thing | ||
additionalType
|
URL | An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. |
alternateName
|
Text | An alias for the item. |
description
|
Text | A short description of the item. |
image
|
URL or ImageObject | An image of the item. This can be a URL or a fully described ImageObject. |
name
|
Text | The name of the item. |
potentialAction
|
Action | Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role. |
sameAs
|
URL | URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Freebase page, or official website. |
url
|
URL | URL of the item. |
Examples
John and Steve reviewed an article.
This example is JSON only.
This example is JSON only.
<!-- John and Steve reviewed an article. --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "ReviewAction", "agent": { "@type": "Person", "name": "John" }, "resultReview": { "@type": "Review", "reviewBody": "It is pretty awesome!" }, "object": { "@type": "ScholarlyArticle", "name": "We found out that P = NP!" }, "participant": { "@type": "Person", "name": "Steve" } } </script>
Schema Version 1.91


Package b2p.model
Interface IState
-
- All Known Implementing Classes:
BitSetState
public interface IState
Interface defining the state of the game- Author:
- Alessandro Buldini, Alessandro Pomponio, Federico Zanini
-
-
Field Summary
Fields Modifier and Type Field Description static int
boardDimension
The board is a 9x9 square
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
blackHasWon()
Checks if the black has won the gameIState
clone()
java.util.List<IAction>
getAvailableKingMoves()
Gets all the available moves for the kingjava.util.List<IAction>
getAvailablePawnMoves()
Gets all the available moves for the pawnsB2PBitSet
getBlackPawns()
Accesses the private field black pawnsB2PBitSet
getBoard()
Accesses the private field boardint
getHeuristicValue()
Returns the heuristic value for a player in the current turnint
getHeuristicValueForPlayer(it.unibo.ai.didattica.competition.tablut.domain.State.Turn player)
Returns the heuristic value for a given player in the current turnB2PBitSet
getKing()
Accesses the private field kingit.unibo.ai.didattica.competition.tablut.domain.State.Turn
getTurn()
Accesses the private field turnB2PBitSet
getWhitePawns()
Accesses the private field white pawnsboolean
isWinningState()
Checks if the current state is a winning statevoid
performMove(int from, int to)
Performs a given action using a specified from and a specified tovoid
performMove(IAction action)
Performs a given action usingBitSetPosition
from andBitSetPosition
tovoid
performMove(java.lang.String from, java.lang.String to)
Performs a given action using a specifiedBitSetPosition
from and a specifiedBitSetPosition
tovoid
setTurn(it.unibo.ai.didattica.competition.tablut.domain.State.Turn turn)
Sets the private field turn valueIState
simulateMove(IAction action)
Simulates a specified move from a givenIAction
boolean
whiteHasWon()
Checks if the white has won the game
-
-
-
Field Detail
-
boardDimension
static final int boardDimension
The board is a 9x9 square- See Also:
- Constant Field Values
-
-
Method Detail
-
getTurn
it.unibo.ai.didattica.competition.tablut.domain.State.Turn getTurn()
Accesses the private field turn- Returns:
- the current turn
- See Also:
State.Turn
-
setTurn
void setTurn(it.unibo.ai.didattica.competition.tablut.domain.State.Turn turn)
Sets the private field turn value- Parameters:
turn
- is a Turn data type- See Also:
State.Turn
-
getBlackPawns
B2PBitSet getBlackPawns()
Accesses the private field black pawns- Returns:
- B2PBitSet containing black pawns
- See Also:
B2PBitSet
-
getWhitePawns
B2PBitSet getWhitePawns()
Accesses the private field white pawns- Returns:
- B2PBitSet containing white pawns
- See Also:
B2PBitSet
-
getKing
B2PBitSet getKing()
Accesses the private field king- Returns:
- B2PBitSet containing the king
- See Also:
B2PBitSet
-
getBoard
B2PBitSet getBoard()
Accesses the private field board- Returns:
- B2PBitSet containing the board
- See Also:
B2PBitSet
-
isWinningState
boolean isWinningState()
Checks if the current state is a winning state- Returns:
True
if it is a winning state
-
blackHasWon
boolean blackHasWon()
Checks if the black has won the game- Returns:
True
if black has won
-
whiteHasWon
boolean whiteHasWon()
Checks if the white has won the game- Returns:
True
if white has won
-
simulateMove
IState simulateMove(IAction action)
Simulates a specified move from a givenIAction
- Parameters:
action
- IAction representing the action to simulate- Returns:
- A copy of the
BitSetState
after the move is performed - See Also:
IAction
-
performMove
void performMove(IAction action)
Performs a given action usingBitSetPosition
from andBitSetPosition
to- Parameters:
action
- IAction representing the action to perform- See Also:
IAction
,BitSetPosition
-
performMove
void performMove(java.lang.String from, java.lang.String to)
Performs a given action using a specifiedBitSetPosition
from and a specifiedBitSetPosition
to- Parameters:
from
- String representing the starting positionto
- String representing the final position- See Also:
BitSetPosition
-
performMove
void performMove(int from, int to)
Performs a given action using a specified from and a specified to- Parameters:
from
- Integer representing the starting positionto
- Integer representing the final position
-
getAvailablePawnMoves
java.util.List<IAction> getAvailablePawnMoves()
Gets all the available moves for the pawns- Returns:
- A
List
of possible actions - See Also:
IAction
-
getAvailableKingMoves
java.util.List<IAction> getAvailableKingMoves()
Gets all the available moves for the king- Returns:
- A
List
of possible actions - See Also:
IAction
-
getHeuristicValue
int getHeuristicValue()
Returns the heuristic value for a player in the current turn- Returns:
- the heuristic value for a player in the current turn
- See Also:
State.Turn
-
getHeuristicValueForPlayer
int getHeuristicValueForPlayer(it.unibo.ai.didattica.competition.tablut.domain.State.Turn player)
Returns the heuristic value for a given player in the current turn- Parameters:
player
- is a Turn object- Returns:
- the heuristic value for a given player in the current turn
- See Also:
State.Turn
-
clone
IState clone()
-
-


SendIT
Login
Sign Up
KEEP CALM AND
JOIN US
We are the best delivery company on the planet earth.
SIGN UP:
First Name*:
Last Name*:
Other Names*:
Username*:
Email*:
Password*:
Sign up
Already have an account?
Log in


WITNESS LIST Natural Resources Committee February 26, 1997-3:00P HB 1016 For: Arnold, Mary M. (herself) Halty, Scott R. (SAWS) Labatt, Weir (EAA) Thuss, Michael F. (SAWS) On: Young, John (TNRCC) HB 1190 For: Cason, George (himself) Glenn, Ronald J. (Red River Authority) Hargesheimer, Dwayne (TX Mun. Water Assoc.) Johnson, Carolyn H. (Dow Chemical & TCC) Joiner, Gary (TX Farm Bureau) Neighbors, Gary L. (ANRA) Ray, J.Tom (BRA & CRP Stakeholders) Rose, Mark (LCRA) Sturzl, Frank (TX Municipal League) West, W.E.(Bill) Jr. (GBRA) Against: Anderson, Dwayne (Clean Water Action) Arnold, Mary M. (League of Women Voters) Kramer, Ken (Sierra Club) On: Schultz, Ronald B. Jr. (Galveston Co Hlth.Dist.) Williams, John C. (Canadian Riv.Authority) Wright, Jean (Galveston Co Hlth.Dist.) SB 404 For: Ramsay, Tom (Representative)


Showing results for: {{ search_name }}
| Movie Title | Director |
|---|---|
| {{ movie_names[0] }} | {{ director[0] }} |
| {{ movie_names[1] }} | {{ director[1] }} |
| {{ movie_names[2] }} | {{ director[2] }} |
| {{ movie_names[3] }} | {{ director[3] }} |
| {{ movie_names[4] }} | {{ director[4] }} |


0" class="mb-0"> Liked:
{{post.owner}} {{post.description}}
0" class="mb-0"> {{post.comments.length}} Comments
Do you really want to delete this?


Note: There is currently no finalized API for the charts package. The files and classes used to create this example are temporary JavaScript wrappers used to display and test the functionality of the current state of the charts package. The draft API will be announced when the first beta of the Charts component is released.
In the previous examples, we have created chart applications using the SimpleChart class. The advantage to using such a class is that it makes it easy to instantiate a chart with very little code. SimpleChart uses composition to build a chart with several different classes. If you want or need more control and flexibility in creating a chart application, you can use these individual classes to create your own custom chart. In the following example, we are going to create a chart with two vertical axes and two line graphs.
A Cartesian chart, in its purest form, consists of a graph and two axes. To build our application, we'll use the following classes:
As with the previous examples, we'll start by defining the styles for our chart. Since we are using the individual classes, we'll create a style hash for each object.
// Create application level styles var chartstyles = { chart:{ padding:{left:20, top:20, bottom:10, right:20} }, background:{ fillColor:0x000000, borderColor:0xff0000, borderWidth:2 } }; // Create data var mydata = getData(); // Create bottom axis styles var bottomaxisstyles = { label:{ fontName:"Georgia", fontSize:11, color:0xBDD7EB, rotation:-45, margin:{top:5}, }, dataFormat:{ pattern:"%b %d, %yyyy" }, majorTicks:{ color:0xBDD7EB }, line:{ color:0xBDD7EB } }; // Create left axis styles var leftaxisstyles = { label:{ fontName:"Georgia", fontSize:11, color:0x5577AF, margin:{right:5}, }, dataFormat:{ prefix:"$", decimalPlaces:0 }, majorTicks:{ color:0xBDD7EB }, line:{ color:0xBDD7EB } }; // Create right axis styles var rightaxisstyles = { label:{ fontName:"Georgia", fontSize:11, color:0xFF0000, margin:{left:5}, }, dataFormat:{ prefix:"$", decimalPlaces:0 }, majorTicks:{ color:0xBDD7EB }, line:{ color:0xBDD7EB } }; // Add expense graph styles var expensegraphstyles = { color:0x5577AF, weight:"2" }; // Add revenue graph styles var revenuegraphstyles = { color:0xFF0000, weight:"2" }
Now, we'll create an instance of Y.Chart
, assigning the swf url and the application-level style object through the config argument:
var mychart = new Y.Chart("#testdiv", {swfurl:"../build/chart/assets/cartesiancanvas.swf", styles:chartstyles}); mychart.setDataProvider(mydata);
Now, we'll create two vertical (y) axes and a horizontal axis (x), and add the key names corresponding to the data that should be associated with each axis (more than one key can be added to each axis, but we are only using one per axis in this example):
var mybottomaxis = new Y.Axis(mychart, {axisType:"Time", styles:bottomaxisstyles}); var myleftaxis = new Y.Axis(mychart, {axisType:"Numeric", styles:leftaxisstyles}); var myrightaxis = new Y.Axis(mychart, {axisType:"Numeric", styles:rightaxisstyles}); mybottomaxis.addKey("date"); myleftaxis.addKey("expenses"); myrightaxis.addKey("revenue");
Now, we will create two graph instances, assigning the appropriate axes, keys and style objects to each one:
var myexpensegraph = new Y.LineGraph(mychart, {xaxis:mybottomaxis, yaxis:myleftaxis, xkey:"date", ykey:"expenses", styles:expensegraphstyles}); var myrevenuegraph = new Y.LineGraph(mychart, {xaxis:mybottomaxis, yaxis:myrightaxis, xkey:"date", ykey:"revenue", styles:revenuegraphstyles});
All that is left is to add each component to the application canvas, using the appropriate "add" method:
mychart.addBottomItem(mybottomaxis); mychart.addLeftItem(myleftaxis); mychart.addRightItem(myrightaxis); mychart.addCenterItem(myexpensegraph); mychart.addCenterItem(myrevenuegraph);


About
Why Onboarding ?
Onboarding is the process of integrating new employees into an organization. It’s important to note the difference between onboarding and orientation. Orientation is an event, typically lasting one day, that usually begins the onboarding process. But onboarding continues for months to even years after an employee is hired.


What I'm good at
Skills
Research
- Data Analysis
- User Interviews
- Observation/Shadowing
- Service Blueprints
- Experience Maps
- Card Sorting
- Personas
- Customer Value Propositions
Interaction Design
- Information Architecture
- Scenarios & Storyboards
- Collaborative Design Workshops (Design Studio)
- Wireframing
- Prototyping
- Coding
- User Testing
- Human Interface Guidelines
Visual Design
- Developing a personality
- Typography & Colors
- Refining animation
- Pattern libraries
- Tone of voice
Beliefs & soft skills
- I design for any medium
- Team fit
- Agile environment
- Lean UX
- Workshop facilitation
Education
- MSc. Media Informatics, Technical University Vienna
- Languages: German, Italian, English, Spanish
Let's create something awesome together.


Ruby vs JavaScript
My topic today is about Ruby and JavaScript. I will raise a few differences I have noticed between these two programming languages.
What I realized me at first is the need to declare a variable in JavaScript. We do not need to do this in Ruby, most likely because Ruby is a more recent language.
I noticed the need to use semi-colon at the end of a line for JavaScript while these are foregone in Ruby.
In Ruby, we talk about a hash while in JavaScript, we talk about an object. The terminology of their parts is a bit different but they basically work the same way. For example, a key in Ruby is called a property in JavaScript but their value is called value in both languages.
The one thing that really caught my attention is the for loop in JavaScript. How do I love the structure! It is built on one line in three parts. The first part initializes the loop. The second part gives the point where the loop should stop, and the last part updates the state. It is written this way:
for (var triangle = "#"; triangle.length <= #; triangle += "#")
Up until now, reading about JavaScript has been more difficult than reading about Ruby. I am hoping though, that we can build on our knowledge of the Ruby language to be successful in writing code in JavaScript.
That’s it for today!


$template{name="sample-readme-html-header" title="Embedded Grid demo"}$
The demo produces an output put that looks like this, where messages from the demo itself are prefixed with `>>>`:
>>> starting the JPPF driver driver process id: 4444, uuid: 2C901290-ADAA-4D96-8B73-224B8594DB2B ClientClassServer initialized NodeClassServer initialized ClientJobServer initialized NodeJobServer initialized management initialized and listening on port 11111 Acceptor initialized - accepting plain connections on port 11111 JPPF Driver initialization complete >>> starting the JPPF node >>> starting the JPPF client client process id: 4444, uuid: B6CDC36A-F4CA-4D1B-A693-396E926A3F93 node process id: 4444, uuid: 1624196C-E0CB-4FD0-8A90-78C9FE1BA6DC [client: driver1-1 - ClassServer] Attempting connection to the class server at localhost:11111 [client: driver1-1 - ClassServer] Reconnected to the class server [client: driver1-1 - TasksServer] Attempting connection to the task server at localhost:11111 [client: driver1-1 - TasksServer] Reconnected to the JPPF task server >>> client connected, now submitting a job Attempting connection to the class server at <IP_ADDRESS>:11111 RemoteClassLoaderConnection: Reconnected to the class server JPPF Node management initialized on port 11111 Attempting connection to the node server at <IP_ADDRESS>:11111 Reconnected to the node server Node successfully initialized Hello! from the node >>> execution result for job 'embedded grid': Hello! >>> connecting to local driver JMX server >>> nb nodes in server: 1 >>> connecting to local node JMX server >>> node state: JPPFNodeState[threadPoolSize=8, threadPriority=5, nbTasksExecuted=1, executionStatus=IDLE, connectionStatus=CONNECTED, cpuTime=0, pendingAction=NONE] >>> shutting down node >>> nb nodes in server: 0 >>> shutting down driver >>> done, exiting program
There are 2 privileged places you can go to:
$template{name="sample-readme-html-footer"}$


Toggle navigation
Coursera
Udacity
How to search?
Language
English
Spanish
Category
{{option.tipo}}
Search
{{course.nombre}}
Read More


The Temp
A review by Scott Hamilton and Chris Holland.
For the html version of this review with screen captures, please point your browser to http://members.aol.com/stomptokyo
Our rating: one lava lamp (out of five).
Awful femme fatale movies had something of a mini-renaissance in the early 90's, including such noxious titles as Basic Instinct, The Crush, The Babysitter, Poison Ivy... oh, the list goes on and on. They all feature, in one form or another, a conniving woman who is initially attractive on many fronts but eventually reveals her true colors and is nearly responsible for the downfall of all who put their trust in her. We wish we could say that The Temp is the worst example of this sub-genre, but the truth is, most of them are easily as painful as this movie. However, don't let that deceive you: The Temp is very, very bad indeed.
Peter Derns (Timothy Hutton) works as a marketing executive for the Mrs. Appleby cookie company. The environment is highly competitive, especially since Appleby was recently acquired by another company, constantly referred to as "the boys in New York." When Peter's regular assistant takes leave to be with his wife during childbirth, Kris Bolin (Twin Peaks alum Lara Flynn Boyle) arrives to save the day. Not only does she finish the all-important report due by noon, but she also reorganizes Peter's entire life in the space of a week.
Kris decides she likes working for Peter so much that when the regular assistant returns to work, she arranges an "accident" involving a paper shredder. Personally, we're the types to check the power eight times before sticking our hands into something with that much destructive potential, but there it is. A whirring sound, a spray of blood, an agonized cry, and Kris is sitting pretty in Peter's office again. She even sends the poor cad a sympathy card.
Unfortunately for Peter, Kris doesn't stop there. She has found that she likes being upwardly mobile, and so the company undergoes a colossal series of accidents and firings as Kris works her way to the top, trying to seduce Peter along the way. Peter, who is just exiting therapy for acute paranoia, doesn't know whether he imagines that Kris is engineering these events, or if she's really responsible. What he does know is that she's not making it any easier for him to reach a reconciliation with his estranged wife.
>From here, The Temp spirals downward into absurdity. Not only are we led to believe that Kris can get away with murder (repeatedly), but she can also engineer a batch of cookies that cause test market volunteers to cough up blood, hack the company e-mail system, and perform a number of other highly unlikely activities. We began to think that Kris might actually be innocent, because her tally of crimes became too massive to believe.
The script is not completely to blame for The Temp's hemorrhage-inducing awfulness; the cast does its part to lower the film's quality even further. Boyle should have gotten some sort of shame award for her overacting as Bolin. Faye Dunaway (as Derns' boss, Charlene) did get a shame award for hers -- the Golden Raspberry for Worst Supporting Actress that year. Hutton chose to go the other route, becoming the most relentlessly boring screen personality we've seen since Jeff Muldovan in Trancers 4. Rounding out this roll call of shame is Dwight Schultz, who should really stick to those oddball characters on TV. His dull executive role in this movie made us pine for the wacky adventures of "Howling Mad" Murdoch on The A-Team.
When we see films like this, we often wonder what could have inspired a movie studio to make a film this wretched. Was the script re-written on the set? Were all the people involved suffering some mass hallucination that they were making a good movie? Perhaps the flick itself offers a clue: maybe somewhere, in an office in Hollywood, a vengeful temp is secretly greenlighting projects just like this one. Now that's scary.
This review copyright 1998 by Chris Holland and Scott Hamilton of Stomp Tokyo Video Reviews.
-- Stomp Tokyo Video Reviews Illuminating the dark heart of video every week. http://members.aol.com/stomptokyo/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Golang: Vendoring and Interface Confusion
February 12, 2017
The last few days I have been working on a small tool that enables you to easily run tests against your code hosted on Github on your own machines. The thing is, there are tons of tools and providers that allow you to do this, but they'll start costing money as soon as you want to use them on private repositories.
So, inspired by Gitlab's excellent gitlab-runner, I started working on octorunner, a tool that implements a few of the features gitlab-runner has, like running tests on private repositories in ephemeral docker containers, triggered by push events from Github. As a bonus this was a nice chance to do a project in Go.
Anyway, after getting to a point where octorunner actually did something useful, I wanted to add some tests to octorunner. This is where a bit of headache started. See, I use the Docker client API and they vendor (all?) their external dependencies.
I had not come across vendoring in Go before, but since Go 1.5 - although
experimental - it supports vendoring. It was enabled by default in 1.6.
What happens when importing external packages into your project is that the
compiler will first search for a package in your project's vendor
directory, only after that will it search in $GOPATH/src
.
Because the Docker client library vendored the context
package - among others
- I ran into issues when I wanted to define an interface that the Docker client
was an implementation of. The exact compilation error I ran into was as
follows:
ImageExists: *client.Client does not implement ImageLister (wrong type for
ImageList method) have
ImageList("github.com/docker/docker/vendor/golang.org/x/net/context".Context,
types.ImageListOptions) ([]types.ImageSummary, error) want
ImageList("context".Context, types.ImageListOptions) ([]types.ImageSummary,
error)
So what's happening here exactly? Let's take a look at a bit of code that reproduces this exact error:
package main
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
)
type ImageLister interface {
ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
}
func main() {
cli, _ := client.NewEnvClient()
ImageExists(cli)
}
func ImageExists(lister ImageLister) {
return
}
In the above example we're defining an ImageLister
interface containing a
single method. The argument causing the issue is ctx context.Context
.
The client.Client
struct returned by client.NewEnvClient()
should implement the
ImageLister
interface. However, the Context
interface that's being used as
type in Client.ImageList(...)
uses the Docker client library's vendored
Context
, which is imported from
$GOPATH/src/github.com/docker/docker/vendor/golang.org/x/net/context
.
Context
in my program is being imported from
$GOPATH/src/golang.org/x/net/context
. In the Docker library it's being
imported from the previously mentioned path. This causes the compiler to treat
them as two different interfaces, with the error as a result.
The thing about this that confuse(s/d) me, is that in Go all interfaces are
implemented implicitly. So I thought: every object that implements
Docker's vendored version of Context
, also implements the local Context
, so
this should work. I might be missing something here.. I'll need to explore this
a bit further.
In the end I had to properly vendor the Docker client library, causing both the
(vendored) Docker client library's, and my own golang.org/x/net/context
imports to be imported from
$GOPATH/src/github.com/boyvanduuren/octorunner/vendor/golang.org/x/net/context
,
resulting in them being exactly the same interface.
TL;DR: When using library L
that vendors other libraries, and you want
to create a common interface that uses an interface from one of those vendored
libraries, you'll likely run into the same problems as I did, and you'll have to
vendor library L
in your project.


JavaScript Objects are variables that can contain many values. Specifically, they contain corresponding property-value pairs. These are really useful when we want to be able to call up values from a property.
Objects in JavaScript can be defined in two ways: literal notation and constructor methods. With object literal notation, we can create an object by defining a variable and setting it equal to an empty object(with empty curly brackets {}).
var object = {};
Once we have our object defined, we can add property-value pairs to this object. For example:
var object = { name: "John Smith", height: "180cm", age: 25 };
In the above example, we added properties to the object by assigning a property(key) such as name, height, or age, as well as a value to each such as "John Smith", "180cm", and 25.
var person = new Object(); person.name = "John Smith"; person.height = "180cm"; person.age = 25;
With this method, we are assigning the same property-value pairs as before with the literal notation, but we are adding them after first defining the new empty object. Then, we individually define the properties and values.
There are many ways to communicate with and alter an object, the first of which is dot notation, as we used above in the constructor method. The advantage of dot notation is that we can call, assign, or reassign any property related to the object.
person.name; //output: "John Smith" person.name = "John Doe"; person.name; //output: "John Doe" person.weight = 160;
In the example above, we are calling assigning, and reassigning properties to our object "person". We can see that by using the dot notation, we have the flexibility to perform all these methods on our object. "person.name ="" is reassigning the name property, which is already existing in our object "person". "person.weight =" is assigning a new property, not existing previously in our object.
The second method we can use to interact with objects is bracket notation. The advantage of bracket notation is that we can substitute variables in for properties. This allows us to loop through objects, call them literally, or set values to properties that don't exist yet.
for (property in person) { console.log(person[property]); } //output: "John Doe" //output: "180cm" //output: 25 //output: 160 var x = "weight"; console.log(person[x]); //output: 160 person["gender"] = "male";
In the above example, we used the bracket notation to individually print out each property in person, use a variable "x" to call the value of "weight", and assign a new property-value pair.
We can also utilize dot notation to perform functions to interact with objects. We can define a function to construct an object automatically given values to properties.
function Person(name,height,age,weight,gender) { this.name = name; this.height = height; this.age = age; this.weight = weight; this.gender = gender; } var jane = new Person("Jane Doe", "160cm", 19, 110, "female"); //output: jane = { name: "Jane Doe", height: "160cm", age: 19, weight: 110, gender: "female" }
As you can see in the above example, the function "Person" that we pre-defined, automatically created a new object "jane" with property-value pairs we provided it as arguments. This is especially useful when we have to create many objects with the same parameters.


SUBSCRIBE
In-depth Stories You Don't See Elsewhere About Topics You Want to Read!
All Access + Weekly Delivery.
Choose A Membership That's Perfect for You!
Baby's Brain Swells After Catching COVID
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
Brexit Has Northern Ireland's Very Future Hanging in the Balance
IN THE MAGAZINE
EDITORS PICK
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
Baby's Brain Swells After Catching COVID
SUBSCRIBE
All Access + Weekly Delivery.
Choose A Membership That's Perfect for You!
NEWSLETTER
EDITIONS: U.S. Edition Pakistan Polska Romainia
About Us Corrections Contact Us Editorial Guidlines
Advertise Copyright Terms & Conditions Privacy Policy
Cookie Policys Terms of Saless Archives Announcements
EDITIONS: U.S. Edition Pakistan Polska Romainia
About Us Corrections Contact Us Editorial Guidlines
Advertise Copyright Terms & Conditions Privacy Policy
Cookie Policys Terms of Saless Archives Announcements


CS6604 - HW1
Edit
Use Forwarding Pointers?
Use Replication?
Move
to:
User
calls
via:
Locate Via Pointer
Locate Via Database


PKCS12_add_cert, PKCS12_add_key, PKCS12_add_key_ex, PKCS12_add_secret - Add an object to a set of PKCS#12 safeBags
#include <openssl/pkcs12.h>
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
EVP_PKEY *key, int key_usage, int iter,
int key_nid, const char *pass);
PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags,
EVP_PKEY *key, int key_usage, int iter,
int key_nid, const char *pass,
OSSL_LIB_CTX *ctx, const char *propq);
PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags,
int nid_type, const unsigned char *value, int len);
These functions create a new PKCS12_SAFEBAG and add it to the set of safeBags in pbags.
PKCS12_add_cert() creates a PKCS#12 certBag containing the supplied certificate and adds this to the set of PKCS#12 safeBags.
PKCS12_add_key() creates a PKCS#12 keyBag (unencrypted) or a pkcs8shroudedKeyBag (encrypted) containing the supplied EVP_PKEY and adds this to the set of PKCS#12 safeBags. If key_nid is not -1 then the key is encrypted with the supplied algorithm, using pass as the passphrase and iter as the iteration count. If iter is zero then a default value for iteration count of 2048 is used.
PKCS12_add_key_ex() is identical to PKCS12_add_key() but allows for a library context ctx and property query propq to be used to select algorithm implementations.
PKCS12_add_secret() creates a PKCS#12 secretBag with an OID corresponding to the supplied nid_type containing the supplied value as an ASN1 octet string. This is then added to the set of PKCS#12 safeBags.
If a certificate contains an alias or a keyid then this will be used for the corresponding friendlyName or localKeyID in the PKCS12 structure.
PKCS12_add_key() makes assumptions regarding the encoding of the given pass phrase. See passphrase-encoding(7) for more information.
A valid PKCS12_SAFEBAG structure or NULL if an error occurred.
IETF RFC 7292 (https://tools.ietf.org/html/rfc7292)
PKCS12_add_secret() and PKCS12_add_key_ex() were added in OpenSSL 3.0.
Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.


Gallery
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean
When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then she continued her way.


The second tab of the navigators is the "scene-navigator". The scene-navigator is a list of "scenes", where each scene can contain "movies". Each movie contains "frames", where the frames for the selected movie can be viewed in the frame-navigator. Each movie has a "visibility" checkbox that toggle the visibility of the movie in the rendering. New movies can be added by drag and drop from another iRASPA document, or copied by copy and paste. Movies that are in the same scene-section are visible to eachother, i.e. ambient occlusion is computed per scene. Any properties set in the detail-panes are for all the frames of the selected movie.
Scenes can be a combination of movies of the different components of a system (for example: the cations, anions, and the water-solvent as three separate components), or they can be completely unrelated and place at any position relative to eachother. The latter can be used to make "collages". The origin of each movie (or frame) in world-space is set in "Cell"-detailpane and then "Cell/Boundingbox-properties".


This site is fully responsive and is a good clean homepage with great use of space. Bootstrap 4 along with javascript and jQuery uses space very efficiently.
With HTML5, content can be delivered faster and more securely and across all browsers.
CSS3 is the latest standard for the CSS language and is best for responsive design websites.
Bootstrap 4 is the most popular framework in the world for building responsive website.
JavaScript is used with websites to provide better interaction than HTML can do alone.
jQuery is a JavaScript library that promotes additional functionality to site very efficiently.
WordPress is an open source and one of the most powerful Content Management Systems (CMS).
Fully responsive allows users to easily access your site on all different devices. This eliminates the user from have to zoom in or out of your site. Fonts, images and layout are adjusted based on the space of different devices. Responsive websites allows you to update your content only once for all devices
This is all handled by your talented developer and the tools that are use.


Home
Services
About
Gallery
Contact
Book Now
Tanika Green
Artistry
Manifesting Beauty At Its Best...
Editorial
Bridal
Headshot


|
Highway Framework
Release <IP_ADDRESS>
The fastest and smoothest way to great architecture
|
Factory to create repositories, both wide repositories and aggregate root repositories More...
Public Member Functions | |
| IRepository | Create< TOne > () |
| Creates a repository with a context loaded with mappings of the aggregate root TOne loaded | |
| IRepository | Create< TOne, TTwo > () |
| Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo loaded | |
| IRepository | Create< TOne, TTwo, TThree > () |
| Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo ,TThree loaded | |
| IRepository | Create< TOne, TTwo, TThree, TFour > () |
| Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo ,TThree ,TFour loaded |
Factory to create repositories, both wide repositories and aggregate root repositories
| IRepository Highway.Data.Interfaces.IRepositoryFactory.Create< TOne > | ( | ) |
Creates a repository with a context loaded with mappings of the aggregate root TOne loaded
| TOne | The aggregate root type that the context is being configured for |
Implemented in Highway.Data.EntityFramework.Factory.RepositoryFactory.
| IRepository Highway.Data.Interfaces.IRepositoryFactory.Create< TOne, TTwo > | ( | ) |
Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo loaded
| TOne | An aggregate root type that the context is being configured for |
| TTwo | An aggregate root type that the context is being configured for |
Implemented in Highway.Data.EntityFramework.Factory.RepositoryFactory.
| IRepository Highway.Data.Interfaces.IRepositoryFactory.Create< TOne, TTwo, TThree > | ( | ) |
Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo ,TThree loaded
| TOne | An aggregate root type that the context is being configured for |
| TTwo | An aggregate root type that the context is being configured for |
| TThree | An aggregate root type that the context is being configured for |
Implemented in Highway.Data.EntityFramework.Factory.RepositoryFactory.
| IRepository Highway.Data.Interfaces.IRepositoryFactory.Create< TOne, TTwo, TThree, TFour > | ( | ) |
Creates a repository with a context loaded with mappings of the aggregate root TOne ,TTwo ,TThree ,TFour loaded
| TOne | An aggregate root type that the context is being configured for |
| TTwo | An aggregate root type that the context is being configured for |
| TThree | An aggregate root type that the context is being configured for |
| TFour | An aggregate root type that the context is being configured for |
Implemented in Highway.Data.EntityFramework.Factory.RepositoryFactory.


Sign up for a Mileage Plan™ & My Account profile and we'll start you out with 500 Bonus Miles, plus establish an online account for you.
As a member, you can:
- Earn miles with over 55 partners in eight categories.
- Earn and redeem miles for award travel on 12 major airline partners to over 700 destinations.
- Book trips faster and more conveniently (we'll remember your details and preferences).
- View any Discount Codes available to you with 'My Discount Codes.'
- Keep track of your scheduled trips with 'My Trips.'
- Store Gift/Bonus Travel Certificates in your 'My Wallet.'


StoreApi
This is the StoreApi API
getOrderById
For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors
URL
http://petstore.swagger.wordnik.com/api/store/order/{orderId}
HTTP Method
GET
Response Type
Parameters
orderId : string (path)
ID of pet that needs to be fetched


{% extends 'templates/planner_card.html' %} {% block id %}test-results{% endblock %} {% block heading %} Your latest blood sugar test results {% endblock %} {% block body %}
As discussed with your GP you should:
See older test results


Jerry Jones Became a Perfect SpongeBob Meme During Cowboys Thanksgiving Day Loss vs. Bills (TWEETS)
by Howard CosmellJerry Jones has lived through a grand total of 78 Thanksgivings, but I can almost guarantee that none of them were worse than his 2019 Thanksgiving Day festivities.
Not only did his team drastically hurt their playoff chances by losing to the Buffalo Bills, 26-15, but the Cowboys owner was also seen with tears in his eyes while speaking to the media about the loss after the game.
And if that wasn’t already bad enough, 2018 will also mark the Thanksgiving when Twitter turned Jerry Jones into a SpongeBob meme.


Two factor authentication
Authentication Code:
Open the two-factor authentication app on your device to view your authentication code and verify your identity.


# Ansible
##### Arnaud Morin
## Ansible is Powerful
* orchestration
* deployment
* configuration
## Why using such tool?
* Manage a fleet of nodes
* Pet versus Cattle
* Automate deployment of software
* Continuous integration and delivery
* Reproductibility
* Configuration holding
* Make sure that the system is always in a good state
* Laziness
## Vocabulary
* Host inventory
* Tasks
* Modules
* Playbooks
* Roles
* Idempotent
## Main config file
* /etc/ansible/hosts
* /etc/ansible/ansible.cfg
## From simple host inventory...
```bash
$ cat /etc/ansible/hosts
neutron # we can use names
glance
<IP_ADDRESS> # but also ip addresses
```
## ... to complex dynamic inventories
* pulling inventory dynamically from cloud (such as OpenStack)
* more info https://docs.ansible.com/ansible/2.5/user_guide/intro_dynamic_inventory.html#explicit-use-of-inventory-script
# Ansible command line tools
## Main commands
* ansible
* ansible-config
* ansible-console
* ansible-doc
* ansible-galaxy
* ansible-inventory
* ansible-playbook
* ansible-pull
* ansible-vault
## First ad hoc command
```bash
$ ansible all -m ping
<IP_ADDRESS> | SUCCESS => {
"changed": false,
"ping": "pong"
}
glance | SUCCESS => {
"changed": false,
"ping": "pong"
}
neutron | SUCCESS => {
"changed": false,
"ping": "pong"
}
```
## You can also execute command only on one node ...
```bash
$ ansible <IP_ADDRESS> -m ping
<IP_ADDRESS> | SUCCESS => {
"changed": false,
"ping": "pong"
}
```
## ... or execute shell command on all nodes
```bash
$ ansible all -m shell -a "/bin/echo hello"
<IP_ADDRESS> | CHANGED | rc=0 >>
hello
neutron | CHANGED | rc=0 >>
hello
glance | CHANGED | rc=0 >>
hello
```
## ansible-console
run interactive ah hoc commands against a chosen inventory
```bash
$ ansible-console all
Welcome to the ansible console.
Type help or ? to list commands.
root@all (3)[f:5]$ uname -r
neutron | CHANGED | rc=0 >>
4.4.0-138-generic
glance | CHANGED | rc=0 >>
4.4.0-138-generic
<IP_ADDRESS> | CHANGED | rc=0 >>
4.4.0-138-generic
root@all (3)[f:5]$
```
## ansible-galaxy
Search/download role from ansible galaxy (like a store)
```bash
$ ansible-galaxy search asterisk
...
```
```bash
$ ansible-galaxy install dgnest.asterisk
- downloading role 'asterisk', owned by dgnest
- downloading role from https://github.com/dgnest/ansible-role-asterisk/archive/0.0.5.tar.gz
- extracting dgnest.asterisk to /root/.ansible/roles/dgnest.asterisk
- dgnest.asterisk (0.0.5) was installed successfully
```
## ansible-inventory
used to display or dump the configured inventory as Ansible sees it
```bash
$ ansible-inventory --yaml --list
all:
children:
ungrouped:
hosts:
<IP_ADDRESS>: {}
glance: {}
neutron: {}
```
## ansible-playbook
the tool to run Ansible playbooks, which are a configuration and multinode deployment system
```bash
$ ansible-playbook play.yml --list-tasks
playbook: play.yml
play #1 (all): all TAGS: []
tasks:
install cowsay and steam locomotive TAGS: []
```
## ansible-pull
pulls playbooks from a VCS repo and executes them for the local host
## ansible-vault
encryption/decryption utility for Ansible data files
## Playbooks
* YAML files
* playbooks are composed of one or more **plays**
* plays are composed of **roles** and **tasks**
* roles are composed of **tasks**
* tasks are based on **modules** to perform specific actions on nodes
## Playbooks
* Applied to a group af node
* Allow orchestration between nodes
## Example
```yaml
---
- hosts: localhost # Apply only to localhost
tasks:
- name: install cowsay and sl # Use apt module
apt:
name: ['cowsay', 'sl'] # Ensure that those packages
state: latest # are installed
```
## ansible-playbook play.yml
![playbook-cowsay](data/playbook-cowsay.gif)
## Ansible roles
Roles are ways of automatically do tasks that are related (such as installing and configuring a software)
They are also nice for:
* sharing with other (or use others roles - see ansible-galaxy)
* reuse (you can use same roles in multiples plays)
## Example
```bash
$ cat /etc/ansible/playbooks/play.yml
---
- hosts: localhost
roles:
- useless
```
```bash
$ cat /etc/ansible/roles/useless/tasks/main.yml
---
- name: install cowsay and steam locomotive
apt:
name: ['cowsay', 'sl']
state: latest
```
## Definition
Variables can be defined in
* inventory
* playbooks
* roles
* on CLI
* retrieved from facts
## Defining a variable
General yaml syntax
```yaml
foo:
field1: one
field2: two
```
Accessing it
```yaml
foo.field1
# or
foo['field1']
```
## Example in a playbook
In a playbook
```yaml
- hosts: webservers
vars:
http_port: 80
# or from external file
vars_files:
- /vars/external_vars.yml
```
From CLI
```bash
ansible-playbook bla.yml --extra-vars "foo=bar truc=bidule"
```
## Using variables with Jinja2
Ansible is using Jinja2 as templating system.
Example:
```yaml
Foo value is {{ foo }}
```
## Facts: special variables
Ansible is collectings some facts when connecting to the nodes.
Those facts are then available as variables, like any other.
Example:
```yaml
My hostname is {{ ansible_facts['nodename'] }}
```
## Facts: special variables
See all gathered facts:
```bash
ansible hostname -m setup
```
## Registering variables
You can register variables from result of a task.
Example
```yaml
- hosts: web_servers
tasks:
- shell: /usr/bin/foo
register: foo_result
ignore_errors: True
- shell: /usr/bin/bar
when: foo_result.rc == 5
```
# Conditionals, loops and blocks
## The when statement
Use very often to execute tasks only if required
Example
```yaml
tasks:
- name: "shut down Debian flavored systems"
command: /sbin/shutdown -t now
when: ansible_facts['os_family'] == "Debian"
```
## Loops
Sometime, you want to execute the same task multiple times with differents values
Example
```yaml
tasks:
- name: add several users
user:
name: "{{ item }}"
state: present
groups: "wheel"
loop:
- testuser1
- testuser2
```
## Blocks
Blocks allow for logical grouping of tasks and in play error handling (try/catch)
Example
```yaml
tasks:
- name: Handle the error
block:
- debug:
msg: 'I execute normally'
- name: i force a failure
command: /bin/false
- debug:
msg: 'I never execute, due to the above task failing, :-('
rescue:
- debug:
msg: 'I caught an error, can do stuff here to fix it, :-)'
```
# More info
https://docs.ansible.com/ansible/latest/


A | |
| add [Cryptodbm] | add subt key data binds key to data in subtable subt .
|
| append_subtable [Cryptodbm] |
Open a standard subtable for appending bindings.
|
| append_uncrypted_subtable [Cryptodbm] |
Open an uncrypted subtable for appending bindings.
|
C | |
| clear [Cryptodbm] | clear subt removes all the bindings in subtable subt .
|
| close [Cryptodbm] |
If in write mode, sign if necessary, add extra bindings if required, then flush and close the file.
|
| close_subtable [Cryptodbm] |
If in write mode, sign if necessary, then flush and close the subtable.
|
| create_subtable [Cryptodbm] |
Creates a standard subtable for writing.
|
| create_uncrypted_subtable [Cryptodbm] |
Creates an uncrypted subtable (even when the global table is encrypted).
|
D | |
| delete [Cryptodbm] | delete subt key removes the binding associated to key in subtable subt .
|
E | |
| error2s [Cryptodbm.Error] | |
| export [Cryptodbm] |
Exports a dbfile to a durable binary format.
|
F | |
| find [Cryptodbm] | find subt key returns the data associated to key in subtable subt .
|
| flush [Cryptodbm] |
Sign if necessary, and flush.
|
| fold [Cryptodbm] |
See iter.
|
G | |
| get_name [Cryptodbm] |
Returns this subtable's name.
|
| get_number [Cryptodbm] |
Returns this subtable's identifier (a number).
|
| get_rootfile [Cryptodbm] |
Returns the root filename (without the .pag or .dir extension).
|
I | |
| import [Cryptodbm] |
Imports a binary file to a dbfile.
|
| iter [Cryptodbm] |
Iterate over all pairs (key, data) of the given subtable.
|
| iter_extra_bindings [Cryptodbm] |
For debugging.
|
| iter_subtables [Cryptodbm] |
Iterate over standard subtables.
|
| iter_uncrypted_subtables [Cryptodbm] |
Iterate over uncrypted subtables.
|
| iterkey [Cryptodbm] |
Iterate over all keys of the given subtable.
|
L | |
| loc2s [Cryptodbm.Error] |
Printing functions.
|
O | |
| open_append [Cryptodbm] |
Opens an existing encrypted-dbm file in append mode.
|
| open_create [Cryptodbm] |
Creates a new encrypted-dbm file.
|
| open_only_uncrypted [Cryptodbm] |
Opens a table to access only uncrypted subtables.
|
| open_read [Cryptodbm] |
Opens an encrypted-dbm file for reading.
|
| open_subtable [Cryptodbm] |
Open a standard subtable for reading.
|
| open_uncrypted_subtable [Cryptodbm] |
Open an uncrypted subtable for reading.
|


{% extends "layout.html" %} {% from "shared/ajax_select_field.html" import render_ajax_select_field %} {% from "shared/bookmark.html" import bookmark %} {% from "shared/creation_fields.html" import creation_fields %} {% from 'shared/thumbnail.html' import thumbnail %} {% from "shared/view_changelog_button.html" import view_changelog_button %} {% from "shared/xeditable_text_field.html" import render_xeditable_text_field %} {% from 'shared/workflow.html' import workflow with context %} {% block page_title %}{{ product.product_number }} - {{ product.part.design.name }}{% endblock %} {% block content %}


String
that denotes a link that is part of a commercial 'deal' or offer.String
that denotes a link tagged as a gift action within a service or
product.String
that denotes a 'referral' tag; applies to links that are sent as
referral actions by users of an app using an 'invite contacts' feature for instance.String
that denotes a 'referral' tag; applies to links that are sent as
referral actions from other services or sites.String
that denotes a BranchLinkData.tags
; applies to links that
are shared with others directly as a user action, via social media for instance.NetworkCallback
or a descendant thereof.JSONObject
object containing keys stored as key-value pairs into
a ServerRequest
.


Dayone
Today’s update
Although Gary is ready to have the Impella heart pump removed, the removal has been postponed until some time tomorrow.
As most of you know, Gary suffered a “widowmaker” heart attack on Thursday and is currently on life support.
Fortunately, he was with rescue when he coded and was able to receive CPR immediately. He was placed on ECMO and we believe it has saved his life. Gary came off ECMO on Monday, but he is still intubated and on an Impella heart pump and is on dialysis. He has been able to respond to commands, but is mostly incoherent and agitated over the intubation.
Despite some other complications, there have been great daily improvements. He has a long battle ahead of him, but we have faith and hope that he will recover.
It has become overwhelming updating everyone individually so we have put together this web page to keep all of our concerned friends and family members up to date on Gary’s progress.
We appreciate all of your support and we will try to post updates about Gary’s progress once or twice per day to keep you all informed.
Again, thank you all for your support during this difficult time.
Kimberly, Melissa, Brieonna, Michael and Brandon


Info! All icons in Material Design Iconic Font available with Material Style Template! If you want more information about how to use them, you can visit official site
Warning! Apparently, Adblock Plus can remove social icons with their "Remove Social Media Buttons" setting. We will not use hacks to force them to display. Please report an issue with Adblock Plus if you believe this to be an error. To work around this, you'll need to modify the social icon class names.


In his commencement speech to Harvard’s 2000 graduating class, late-night comedian Conan O’Brien cautioned his fellow Harvard alums against telling people they went to Harvard. Or else, he warns, they would forever live under the shadow of the taunting question, “And you went to Harvard?” when they make “normal folks” mistakes. The prestige of Ivy League does shadow alumni, but one thing is certain: Going to a prestigious school often implies a considerable level of intelligence.
But is intelligence such a superpower that automatically guarantees the holder an “edge” in real-world scenarios?
“Being smart” is a fraught idea in itself. Unfortunately, we often treat it as a monolithic attribute and unjustifiably group various kinds of talent because of it. In fact, common perception seems to believe the most intelligent students are the most rational. In his book, “Thinking Fast and Slow,” Nobel laureate Daniels Kahneman explained human beings have the tendency to associate intense feelings about one thing with other related things. This might explain the intuitive feeling of associating Harvard graduates as more rational and having more common sense.
But those who get the highest score on the SAT are not necessarily the ones who make good decisions. Keith Stanovich, a psychologist in the study of reasoning, argues in his book, “Rationality and the Reflective Mind,” that there’s a difference between the two parts of the mind that engage in reflective thinking. One is algorithmic, the innate computational power, while the other is the immunity to biases.
After conducting an experiment with hundreds of subjects in which he tests their vulnerability to biases, he finds a low correlation between performance on an IQ test and performance on a rationality test. This suggests the most intelligent individuals are not necessarily the wisest. While intelligence indicates one’s proficiency in abstract reasoning, being rational means having fewer biases and proficiency in critical thinking ability. As it turns out, rationality and intelligence ultimately belong in different dimensions, and even the most intelligent individuals are not immune, if not more susceptible, to these biases due to overconfidence.
The good news is that while IQ is largely determined by DNA, rationality can be learned and practiced. A study conducted by psychologist Carey Morewedge and colleagues has found that training and informing common biases have enduring effects on subjects. They first test the susceptibility of subjects towards biases. Then, they show one group of subjects informational videos on biases, while they assign the other group to play a simulation game of real-world decision-making scenarios to reduce biases. They test both groups immediately after the experiment and then two months afterward. The results show that those who received “training” (simulation games players) demonstrate a larger and more enduring increase in their rational reasoning capability.
While being naturally gifted is certainly great, rationality seems to provide direct access to well-being. Although IQ testing contributes to predicting financial gains and career achievements, it has almost no correlation with life satisfaction. Heather A. Butler, assistant professor at California State University, finds that people who have critical thinking ability, often associated with rationality, do better at life satisfaction than those who do well on IQ tests.
This is suggestive of a distinction between intelligence and rationality, as being rational means knowing one’s own goals and limits and continuously making decisions in a goal-oriented fashion. This will lead to fewer distractions from inconsequential things and mental misery after failing to achieve unrealistic goals. It enables better decision-making in choosing the most satisfying career or taking on different projects after accounting for one’s needs and limits. At the end of the day, decision-making is the key, and the prerequisite of a great decision is always the sufficient understanding of unique conditions. Without an appropriate goal, one can win many battles but still lose the war.
To college students who are still figuring things out, especially in an internet age as it is today, it is almost inevitable that we will face a different kind of decision-making, with uncertain outcomes and the peer pressure of comparing oneself to others. This can result in vile mindsets and even mental disorders.
Students today are especially susceptible to these negative sentiments with the exposure to fuzzy information and increasingly quirky ideas online. It is especially important for us to form a mental filter of rationality and open-mindedness in dealing with these new forms of social interactions. This requires us to train ourselves in skills that school has yet to teach us or are even impossible to teach.


| Up | TOC | Index | |||||
| << 5 Formal Syntax | < 6.7 Euphoria Database System (EDS) | Up: 6 Mini-Guides | 6.9 Euphoria Trouble-Shooting Guide > | 7 Included Tools >> |
6.8 The User Defined Pre-Processor
The user defined pre-processor, developed by Jeremy Cowgar, opens a world of possibilities to the Euphoria programmer. In a sentence, it allows one to create (or use) a translation process that occurs transparently when a program is run. This mini-guide is going to explore the pre-processor interface by first giving a quick example, then explaining it in detail and finally by writing a few useful pre-processors that can be put immediately to work.
Any program can be used as a pre-processor. It must, however, adhere to a simple specification:
- Accept a parameter "-i filename" which specifies which file to read and process.
- Accept a parameter "-o filename" which specifies which file to write the result to.
- Exit with a zero error code on success or a non-zero error code on failure.
It does not matter what type of program it is. It can be a Euphoria script, an executable written in the C programming language, a script/batch file or anything else that can read one file and write to another file. As Euphoria programmers, however, we are going to focus on writing pre-processors in the Euphoria programming language. As a benefit, we will describe later on how you can easily convert your pre-processor to a shared library that Euphoria can make use of directly thus improving performance.
6.8.1 A Quick Example
The problem in this case is that you want the copyright statement and the about screen to show what date the program was compiled on but you do not want to manually maintain this date. So, we are going to create a simple pre-processor that will read a source file, replace all instances of @DATE@ with the current date and then write the output back out.
Before we get started, let me say that we will expand on this example later on. Up front, we are going to do almost no error checking for the purpose of showing off the pre-processor not for the sake of making a production quality application.
We are going to name this file datesub.ex.
-- datesub.ex include std/datetime.e -- now() and format() include std/io.e -- read_file() and write_file() include std/search.e -- match_replace() sequence cmds = command_line() sequence inFileName, outFileName for i = 3 to length(cmds) do switch cmds[i] do case "-i" then inFileName = cmds[i+1] case "-o" then outFileName = cmds[i+1] end switch end for sequence content = read_file(inFileName) content = match_replace("@DATE@", content, format(now())) write_file(outFileName, content) -- programs automatically exit with ZERO error code, if you want -- non-zero, you exit with abort(1), for example.
So, that is our pre-processor. Now, how do we make use of it? First let's create a simple test program that we can watch it work with. Name this file thedate.eui.
-- thedate.eui puts(1, "The date this was run is @DATE@\n")
Rather simple, but it shows off the pre-processor we have created. Now, let's run it, but first without a pre-processor hook defined.
NOTE: Through this document I am going to assume that you are working in Windows. If not, you can make the appropriate changes to the shell type examples.
C:\MyProjects\datesub> eui thedate.eui The date this was run is @DATE@
Not very helpful? Ok, let's tell Euphoria how to use the pre-processor that we just created and then see what happens.
C:\MyProjects\datesub> eui -p eui:datesub.ex thedate.eui The date this was run is 2009-08-05 19:36:22
If you got something similar to the above output, good job, it worked! If not, go back up and check your code for syntax errors or differences from the examples above.
What is this -p paramater? In short, -p tells eui or euc that there is a pre-processor. The definition of the pre-processor comes next and can be broken into 2 required sections and 1 optional section. Each section is divided by a colon (:).
For example, -p e,ex:datesub.ex
- e,ex tells Euphoria that when it comes across a file with the extension e or ex that it should run a pre-processor
- datesub.ex tells Euphoria which pre-processor should be run. This can be a .ex file or any other executable command.
- An optional section exists to pass options to the pre-processor but we will go into this later.
That's it for the quick introduction. I hope that the wheels are turning in your head already as to what can be accomplished with such a system. If you are interested, please continue reading and see where things will get very interesting!
6.8.2 Pre-process Details
Euphoria manages when the pre-processor should be called and with what arguments. The pre-processor does not need to concern itself as to if it should run, what filename it is reading or what filename it will be writing to. It should simply do as Euphoria tells it to do. This is because Euphoria monitors what the modification time is on the source file and what time the last pre-process call was made on the file. If nothing has changed in the source file then the pre-processor is not called again. Pre-processing does have a slight penalty in speed as the file is processed twice. For example, the datesub.ex pre-processor read the entire file, searched for @DATE@, wrote the file and then Euphoria picked up from there reading the output file, parsing it and finally executing it. To minimize the time taken, Euphoria caches the output of the pre-processor so that the interim process is not normally needed after it has been run once.
6.8.3 Command Line Options
<IP_ADDRESS> -p - Define a pre-processor
The primary command line option that you will use is the -p option which defines the pre-processor. It is a two or three section option. The first section is a comma delimited list of file extensions to associate with the pre-processor, the second is the actual pre-processor script/command and the optional third is parameters to send to the pre-processor in addition to the -i and -o parameters.
Let's go over some examples:
- -p e:datesub.ex - This will be executed for every .e file and the command to call is datesub.ex.
- -p "de,dex,dew:dot4.dll:-verbose -no-dbc" - Files with de, dex, dew extensions will be passed to the dot4.dll process. dot4.dll will get the optional parameters -verbose -no-dbc passed to it.
Multiple pre-processors can be defined at the same time. For instance,
C:\MyProjects\datesub> eui -p e,ex:datesub.ex -p de,dex:dot4.dll \ -p le,lex:literate.ex hello.ex
is a valid command line. It's possible that hello.ex may include a file named greeter.le and that file may include a file named person.de. Thus, all three pre-processors will be called upon even though the main file is only processed by datesub.ex
<IP_ADDRESS> -pf - Force pre-processing
When writing a pre-processor you may run into the problem that your source file did not change, therefore, Euphoria is not calling your pre-processor. However, your pre-processor has changed and you want Euphoria to re-process your unchanged source file. This is where -pf comes into play. -pf causes Euphoria to force the pre-processing, regardless of the cached state of any file. When used, Euphoria will always call the pre-processor for all files with a matching pre-processor definition.
<IP_ADDRESS> Use of a configuration file
Ok, so who wants to type these pre-processor definitions in all the time? I don't either. That's where the standard Euphoria configuration file comes into play. You can simply create a file named eu.cfg and place something like this into it.
-p le,lex:literate.ex -p ei,eui:datesub.ex ... etc ...
Then you can execute any of those files directly without the -p parameters on the command line. This eu.cfg file can be local to a project, local to a user or global on a system. Please read about the eu.cfg file for more information.
6.8.4 DLL/Shared Library Interface
A pre-processor may be a Euphoria file, ending with an extension of .ex, a compiled Euphoria program, .exe or even a compiled Euphoria DLL file, .dll. The only requirements are that it must accept the two command line options, -i and -o described above and exit with a ZERO status code on success or non-ZERO on failure.
The DLL file (or shared library on Unix) has a real benefit in that with each file that needs to be pre-processed does not require a new process to be spawned as with an executable or a Euphoria script. Once you have the pre-processor written and functioning, it's easy to convert your script to use the more advanced, better performing shared library. Let's do that now with our datesub.ex pre-processor. Take a moment to review the code above for the datesub.ex program before continuing. This will allow you to more easily see the changes that we make here.
-- datesub.ex include std/datetime.e -- now() and format() include std/io.e -- read_file() and write_file() include std/search.e -- match_replace() public function preprocess(sequence inFileName, sequence outFileName, sequence options={}) sequence content = read_file(inFileName) content = match_replace("@DATE@", content, format(now())) write_file(outFileName, content) return 0 end function ifdef not EUC_DLL then sequence cmds = command_line() sequence inFileName, outFileName for i = 3 to length(cmds) do switch cmds[i] do case "-i" then inFileName = cmds[i+1] case "-o" then outFileName = cmds[i+1] end switch end for preprocess(inFileName, outFileName) end ifdef
It's beginning to look a little more like a well structured program. You'll notice that we took the actual pre-processing functionality out the the top level program making it into an exported function named preprocess. That function takes three parameters:
- inFileName - filename to read from
- outFileName - filename to write to
- options - options that the user may wish to pass on verbatim to the pre-processor
It should return 0 on no error and non-zero on an error. This is to keep a standard with the way error levels from executables function. In that convention, it's suggested that 0 be OK and 1, 2, 3, etc... indicate different types of error conditions. Although the function could return a negative number, the main routine cannot exit with a negative number.
To use this new process, we simply translate it through euc,
C:\MyProjects\datesub> euc -dll datesub.ex
If all went correctly, you now have a datesub.dll file. I'm sure you can guess on how it should be used, but for the sake of being complete,
C:\MyProjects\datesub> eui -p eui:datesub.dll thedate.eui
On such a simple file and such a simple pre-processor, you probably are not going to notice a speed difference but as things grow and as the pre-processor gets more complicated, compiling to a shared library is your best option.
6.8.5 Advanced Examples
<IP_ADDRESS> Finish datesub.ex
Before we move totally away from our datesub.ex example, let's finish it off by adding some finishing touches and making use of optional parameters. Again, please go back and look at the Shared Library version of datesub.ex before continuning so that you can see how we have changed things.
-- datesub.ex include std/cmdline.e -- command line parsing include std/datetime.e -- now() and format() include std/io.e -- read_file() and write_file() include std/map.e -- map accessor functions (get()) include std/search.e -- match_replace() sequence cmdopts = { { "f", 0, "Date format", { NO_CASE, HAS_PARAMETER, "format" } } } public function preprocess(sequence inFileName, sequence outFileName, sequence options={}) map opts = cmd_parse(cmdopts, options) sequence content = read_file(inFileName) content = match_replace("@DATE@", content, format(now(), map:get(opts, "f"))) write_file(outFileName, content) return 0 end function ifdef not EUC_DLL then cmdopts = { { "i", 0, "Input filename", { NO_CASE, MANDATORY, HAS_PARAMETER, "filename"} }, { "o", 0, "Output filename", { NO_CASE, MANDATORY, HAS_PARAMETER, "filename"} } } & cmdopts map opts = cmd_parse(cmdopts) preprocess(map:get(opts, "i"), map:get(opts, "o"), "-f " & map:get(opts, "f", "%Y-%m-%d")) end ifdef
Here we simply used cmdline.e to handle the command line parsing for us giving out command line program a nice interface, such as parameter validation and an automatic help screen. At the same time we also added a parameter for the date format to use. This is optional and if not supplied, %Y-%m-%d is used.
The final version of datesub.ex and thedate.ex are located in the demo/preproc directory of your Euphoria installation.
<IP_ADDRESS> Others
TODO: this needs done still.
Euphoria includes two more demos of pre-processors. They are ETML and literate. Please explore demo/preproc for these examples and explanations.
Other examples of pre-processors include
- eSQL - Allows you to include a .sql file directly. It parses CREATE TABLE and CREATE INDEX statements building common routines to create, destroy, get by id, find by any index, add, remove and save entities.
- make40 - Will process any 3.x script on the fly making sure that it will run in 4.x. It does this by converting variables, constants and routine names that are the same as new 4.x keywords into something acceptable to 4.x. Thus, 3.x programs can run in the 4.x interpreter and translator with out any user intervention.
- dot4 - Adds all sorts of syntax goodies to Euphoria such as structured sequence access, one line if statements, DOT notation for any function/routine call, design by contract and more.
Other Ideas
- Include a Windows .RC file that defines a dialog layout and generate code that will create the dialog and interact with it.
- Object Oriented system for Euphoria that translates into pure Euphoria code, thus has the raw speed of Euphoria.
- Include a Yacc, Lex, ANTLR parser definition directly that then generates a Euphoria parser for the given syntax.
- Instead of writing interpreters such as a QBasic clone, simply write a pre-processor that converts QBasic code into Euphoria code, thus you can run eui -p bas:qbasic.ex hello.bas directly.
- Include a XML specification, which in turn, gives you nice accessory functions for working with XML files matching that schema.
If you have ideas of helpful pre-processors, please put the idea out on the forum for discussion.


You will have to confirm the comment with your Github account. I have to moderate your comment before displaying it on this page. Markdown is not supported.


Using the Platform MBean Server and Platform MXBeans
This chapter introduces the MBean server and the MXBeans that are provided as part of the Java Platform, Standard Edition (Java SE platform), which can be used for monitoring and management purposes. Java Management Extensions (JMX) technology MBeans and MBean servers were introduced briefly in Chapter 1, Overview of Java SE Monitoring and Management. More information about the JMX technology can be found in the JMX Technology documentation for the Java SE platform.
Using the Platform MBean Server
An MBean server is a repository of MBeans that provides management applications access to MBeans. Applications do not access MBeans directly, but instead access them through the MBean server via their unique ObjectName. An MBean server implements the interface javax.management.MBeanServer.
The platform MBean server was introduced in the Java SE 5.0, and is an MBean server that is built into the Java Virtual Machine (Java VM). The platform MBean server can be shared by all managed components that are running in the Java VM. You access the platform MBean server using the java.lang.management.ManagementFactory method getPlatformMBeanServer. Of course, you can also create your own MBean server using the javax.management.MBeanServerFactory class. However, there is generally no need for more than one MBean server, so using the platform MBean server is recommended.
Accessing Platform MXBeans
A platform MXBean, is an MBean for monitoring and managing the Java VM. Each MXBean encapsulates a part of the VM functionality. A full list of the MXBeans that are provided with the platform is provided in Table 1-1 in Chapter 1, Overview of Java SE Monitoring and Management.
A management application can access platform MXBeans in three different ways.
-
Direct access, via the ManagementFactory class.
-
Direct access, via an MXBean proxy.
-
Indirect access, via the MBeanServerConnection class.
These three ways of accessing the platform MXBeans are described in the next three sections.
Accessing Platform MXBeans via the ManagementFactory Class
An application can make direct calls to the methods of a platform MXBean that is running in the same Java VM as itself. To make direct calls, you can use the static methods of the ManagementFactory class. ManagementFactory has accessor methods for each of the different platform MXBeans, such as, getClassLoadingMXBean(), getGarbageCollectorMXBeans(), getRuntimeMXBean(), and so on. In cases where there are more than one platform MXBean, the method returns a list of the platform MXBeans found.
For example, Example 4-1 uses the static method of ManagementFactory to get the platform MXBean RuntimeMXBean, and then gets the vendor name from the platform MXBean.
Example 4-1 Accessing a Platform MXBean via the ManagementFactory ClassRuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean(); String vendor = mxbean.getVmVendor();
Accessing Platform MXBeans via an MXBean Proxy
An application can also call platform MXBean methods via an MXBean proxy. To do so, you must construct an MXBean proxy instance that forwards the method calls to a given MBean server by calling the static method ManagementFactory.newPlatformMXBeanProxy(). An application typically constructs a proxy to obtain remote access to a platform MXBean of another Java VM.
For example, Example 4-2 performs exactly the same operation as Example 4-1, but this time uses an MXBean proxy.
Example 4-2 Accessing a Platform MXBean via an MXBean ProxyMBeanServerConnection mbs; ... // Get a MBean proxy for RuntimeMXBean interface RuntimeMXBean proxy = ManagementFactory.newPlatformMXBeanProxy(mbs, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); // Get standard attribute "VmVendor" String vendor = proxy.getVmVendor();
Accessing Platform MXBeans via the MBeanServerConnection Class
An application can indirectly call platform MXBean methods through an MBeanServerConnection that connects to the platform MBean server of another running Java VM. You use the MBeanServerConnection class's getAttribute() method to get an attribute of a platform MXBean, providing the MBean's ObjectName and the attribute name as parameters.
For example, Example 4-3 performs the same job as Example 4-1 and Example 4-2, but uses an indirect call through MBeanServerConnection.
Example 4-3 Accessing a Platform MXBean via the MBeanServerConnection ClassMBeanServerConnection mbs; ... try { ObjectName oname = new ObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME); // Get standard attribute "VmVendor" String vendor = (String) mbs.getAttribute(oname, "VmVendor"); } catch (....) { // Catch the exceptions thrown by ObjectName constructor // and MBeanServer.getAttribute method ... }
Using Oracle JDK's Platform Extension
Java VMs can extend the management interface by defining interfaces for platform-specific measurements and management operations. The static factory methods in the ManagementFactory class will return the MBeans with the platform extension.
The com.sun.management package contains Oracle JDK's platform extensions. The following sections provide examples of how to access a platform-specific attribute from Oracle JDK's implementation of the OperatingSystemMXBean.
Accessing MXBean Attributes Directly
Example 4-4 illustrates direct access to one of Oracle JDK's MXBean interfaces.
Example 4-4 Accessing an MXBean Attribute Directlycom.sun.management.OperatingSystemMXBean mxbean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); // Get the number of processors int numProcessors = mxbean.getAvailableProcessors(); // Get the Oracle JDK-specific attribute Process CPU time long cpuTime = mxbean.getProcessCpuTime();
Accessing MXBean Attributes via MBeanServerConnection
Example 4-5 illustrates access to one of Oracle JDK's MXBean interfaces via the MBeanServerConnection class.
Example 4-5 Accessing an MXBean Attribute via MBeanServerConnectionMBeanServerConnection mbs; // Connect to a running Java VM (or itself) and get MBeanServerConnection // that has the MXBeans registered in it ... try { // Assuming the OperatingSystem MXBean has been registered in mbs ObjectName oname = new ObjectName(ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME); // Get standard attribute "Name" String vendor = (String) mbs.getAttribute(oname, "Name"); // Check if this MXBean contains Oracle JDK's extension if (mbs.isInstanceOf(oname, "com.sun.management.OperatingSystemMXBean")) { // Get platform-specific attribute "ProcessCpuTime" long cpuTime = (Long) mbs.getAttribute(oname, "ProcessCpuTime"); } } catch (....) { // Catch the exceptions thrown by ObjectName constructor // and MBeanServer methods ... }
Monitoring Thread Contention and CPU Time
The ThreadMXBean platform MXBean provides support for monitoring thread contention and thread Central Processing Unit (CPU) time.
The Oracle JDK's HotSpot VM supports thread contention monitoring. You use the ThreadMXBean.isThreadContentionMonitoringSupported() method to determine if a Java VM supports thread contention monitoring. Thread contention monitoring is disabled by default. Use the setThreadContentionMonitoringEnabled() method to enable it.
The Oracle JDK's HotSpot VM supports the measurement of thread CPU time on most platforms. The CPU time provided by this interface has nanosecond precision but not necessarily nanosecond accuracy.
You use the isThreadCpuTimeSupported() method to determine if a Java VM supports the measurement of the CPU time for any thread. You use isCurrentThreadCpuTimeSupported() to determine if a Java VM supports the measurement of the CPU time for the current thread. A Java VM that supports CPU time measurement for any thread will also support that for the current thread.
A Java VM can disable thread CPU time measurement. You use the isThreadCpuTimeEnabled() method to determine if thread CPU time measurement is enabled . You use the setThreadCpuTimeEnabled() method to enable or disable the measurement of thread CPU time.
Managing the Operating System
The OperatingSystem platform MXBean allows you to access certain operating system resource information, such as the following.
-
Process CPU time.
-
Amount of total and free physical memory.
-
Amount of committed virtual memory (that is, the amount of virtual memory guaranteed to be available to the running process).
-
Amount of total and free swap space.
-
Number of open file descriptors (only for Solaris, Linux, or Mac OS X platforms).
When the Operating System MXBean in the MBeans tab is selected in JConsole, you see all the attributes and operations including the platform extension. You can monitor the changes of a numerical attribute over time by double-clicking the value field of the attribute.
Logging Management
The Java SE platform provides a special MXBean for logging purposes, the LoggingMXBean interface.
The LoggingMXBean enables you to perform the following tasks.
-
Get the name of the log level associated with the specified logger.
-
Get the list of currently registered loggers.
-
Get the name of the parent for the specified logger.
-
Set the specified logger to the specified new level.
The unique ObjectName of the LoggingMXBean is java.util.logging:type=Logging. This object name is stored in LogManager.LOGGING_MXBEAN_NAME.
There is a single global instance of the LoggingMXBean, which you can get by calling LogManager.getLoggingMXBean().
The Logging MXBean defines a LoggerNames attribute describing the list of logger names. To find the list of loggers in your application, you can select the Logging MXBean under the java.util.logging domain in the MBeans tab, and double-click on the value field of the LoggerNames attribute. The Logging MXBean also supports two operations.
-
getLoggerLevel: Returns the log level of a given logger.
-
setLoggerLevel: Sets the log level of a given logger to a new level.
These operations take a logger name as the first parameter. To change the level of a logger, enter the logger name in the first parameter and the name of the level it should be set to in the second parameter of the setLoggerLevel operation.
Detecting Low Memory
Memory use is an important attribute of the memory system. It can be indicative of the following problems.
-
Excessive memory consumption by an application.
-
An excessive workload imposed on the automatic memory management system.
-
Potential memory leakages.
There are two kinds of memory thresholds you can use to detect low memory conditions: a usage threshold and a collection usage threshold. You can detect low memory conditions using either of these thresholds with polling or threshold notification. All these concepts are described in the next sections.
Memory Thresholds
A memory pool can have two kinds of memory thresholds: a usage threshold and a collection usage threshold. Either one of these thresholds may not be supported by a particular memory pool. The values for the usage threshold and collection usage threshold can both be set using the MBeans tab in JConsole.
Usage Threshold
The usage threshold is a manageable attribute of some memory pools. It enables you to monitor memory use with a low overhead. Setting the threshold to a positive value enables a memory pool to perform usage threshold checking. Setting the usage threshold to zero disables usage threshold checking. The default value is supplied by the Java VM.
A Java VM performs usage threshold checking on a memory pool at the most appropriate time, typically during garbage collection. Each memory pool increments a usage threshold count whenever the usage crosses the threshold.
You use the isUsageThresholdSupported() method to determine whether a memory pool supports a usage threshold, since a usage threshold is not appropriate for some memory pools. For example, in a generational garbage collector (such as the one in the HotSpot VM; see Garbage Collection in Chapter 3, Using JConsole), most of the objects are allocated in the young generation, from the Eden memory pool. The Eden pool is designed to be filled up. Garbage collecting the Eden memory pool will free most of its memory space since it is expected to contain mostly short-lived objects that are unreachable at garbage collection time. So, it is not appropriate for the Eden memory pool to support a usage threshold.
Collection Usage Threshold
The collection usage threshold is a manageable attribute of some garbage-collected memory pools. After a Java VM has performed garbage collection on a memory pool, some memory in the pool will still be in use. The collection usage threshold allows you to set a value for this memory. You use the isCollectionUsageThresholdSupported() method of MemoryPoolMXBean to determine if the pool supports a collection usage threshold.
A Java VM may check the collection usage threshold on a memory pool when it performs garbage collection. Set the collection usage threshold to a positive value to enable checking. Set the collection usage threshold to zero (the default) to disable checking.
The usage threshold and collection usage threshold can be set in the MBeans tab of JConsole.
Memory MXBean
The various memory thresholds can be managed via the platform MemoryMXBean. The MemoryMXBean defines the following four attributes.
-
HeapMemoryUsage: A read-only attribute describing the current heap memory usage.
-
NonHeapMemoryUsage: A read-only attribute describing non-heap memory usage.
-
ObjectPendingFinalizationCount: A read-only attribute describing the number of objects pending for finalization.
-
Verbose: A boolean attribute describing the Garbage Collection (GC) verbose tracing setting. This can be set dynamically. The GC verbose traces will be displayed at the location specified when you start the Java VM. The default location for GC verbose output of the Hotspot VM is stdout.
The Memory MXBean supports one operation, gc, for explicit garbage collection requests.
Details of the Memory MXBean interface are defined in the java.lang.management.MemoryMXBean specification.
Memory Pool MXBean
The MemoryPoolMXBean platform MXBean defines a set of operations to manage memory thresholds.
-
getUsageThreshold()
-
setUsageThreshold(long threshold)
-
isUsageThresholdExceeded()
-
isUsageThresholdSupported()
-
getCollectionUsageThreshold()
-
setCollectionUsageThreshold(long threshold)
-
isCollectionUsageThresholdSupported()
-
isCollectionUsageThresholdExceeded()
Each memory pool may have two kinds of memory thresholds for low memory detection support: a usage threshold and a collection usage threshold. Either one of these thresholds might not be supported by a particular memory pool. For more information, see the API reference documentation for the MemoryPoolMXBean class.
Polling
An application can continuously monitor its memory usage by calling either the getUsage() method for all memory pools or the isUsageThresholdExceeded() method for memory pools that support a usage threshold.
Example 4-6 has a thread dedicated to task distribution and processing. At every interval, it determines whether it should receive and process new tasks based on its memory usage. If the memory usage exceeds its usage threshold, it redistributes outstanding tasks to other VMs and stops receiving new tasks until the memory usage returns below the threshold.
Example 4-6 Using Pollingpool.setUsageThreshold(myThreshold); .... boolean lowMemory = false; while (true) { if (pool.isUsageThresholdExceeded()) { lowMemory = true; redistributeTasks(); // redistribute tasks to other VMs stopReceivingTasks(); // stop receiving new tasks } else { if (lowMemory) { // resume receiving tasks lowMemory = false; resumeReceivingTasks(); } // processing outstanding task ... } // sleep for sometime try { Thread.sleep(sometime); } catch (InterruptedException e) { ... } }
Example 4-6 does not differentiate the case in which the memory usage has temporarily dropped below the usage threshold from the case in which the memory usage remains above the threshold between two iterations. You can use the usage threshold count returned by getUsageThresholdCount() to determine if the memory usage has returned below the threshold between two polls.
To test the collection usage threshold instead, you use the isCollectionUsageThresholdSupported(), isCollectionThresholdExceeded() and getCollectionUsageThreshold() methods in the same way as above.
Threshold Notifications
When the MemoryMXBean detects that a memory pool has reached or exceeded its usage threshold, it emits a usage threshold exceeded notification. The MemoryMXBean will not issue another usage threshold exceeded notification until the usage has fallen below the threshold and then exceeded it again. Similarly, when the memory usage after garbage collection exceeds the collection usage threshold, the MemoryMXBean emits a collection usage threshold exceeded notification.
Example 4-7 implements the same logic as Example 4-6, but uses usage threshold notification to detect low memory conditions. Upon receiving a notification, the listener notifies another thread to perform actions such as redistributing outstanding tasks, refusing to accept new tasks, or allowing new tasks to be accepted again.
In general, you should design the handleNotification method to do a minimal amount of work, to avoid causing delay in delivering subsequent notifications. You should perform time-consuming actions in a separate thread. Since multiple threads can concurrently invoke the notification listener, the listener should synchronize the tasks it performs properly.
Example 4-7 Using Threshold Notificationsclass MyListener implements javax.management.NotificationListener { public void handleNotification(Notification notification, Object handback) { String notifType = notification.getType(); if (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) { // potential low memory, redistribute tasks to other VMs & stop receiving new tasks. lowMemory = true; notifyAnotherThread(lowMemory); } } } // Register MyListener with MemoryMXBean MemoryMXBean mbean = ManagementFactory.getMemoryMXBean(); NotificationEmitter emitter = (NotificationEmitter) mbean; MyListener listener = new MyListener(); emitter.addNotificationListener(listener, null, null);
Assuming this memory pool supports a usage threshold, you can set the threshold to some value (representing a number of bytes), above which the application will not accept new tasks.
pool.setUsageThreshold(myThreshold);
After this point, usage threshold detection is enabled and MyListener will handle notification.


{% extends "layout.html" %} {% block pageTitle %} Find an assessor | Energy performance of buildings {% endblock %} {% block content %}
Find energy assessors in your area.