We're going to build on the singly linked list as a base and complete our implementation. First, doubly linked lists are singly linked lists with a slight modification. Everything works the same except each node now has a pointer to the previous node as well as the next node. That's the real difference between these two structures. We'll see how this changes things in our code. Let's start of by making changes to our node function.
//Node Object/Function
function Node( data ) {
this.data = data;
this.prev = null;
this.next = null;
}
Our wrapper object, the DoublyLinkedList will stay identical to a singly linked list implementation but with the additional of a reference to the tail end of the list. We need this change because whenever we add a new node into this list, the new node will need to also reference the previous node. If we keep track of the tail node, we can point the new node that is being added to the tail node as the previous node.
//Doubly Linked List
function DoublyLinkedList() {
this.head = null;
this.tail = null;
this.size = 0;
}
Let's define are add operation.
//Doubly Linked List Add.
DoublyLinkedList.prototype.add = function (data) {
let newNode = new Node(data);
//If the list is empty Note: You can check if this.head is null as well.
if ( !this.size ) {
this.head = newNode;
this.tail = newNode;
this.size++;
return newNode;
}
//If the list is not empty
this.tail.next = newNode;
newNode.prev = this.tail;
this.tail = newNode;
this.size++;
return newNode;
}
The addition of a new node here is simple. If the list is empty, we simply add it and set the head and the tail to point to the new node. If the list is not empty, we point the original tail's next property to point to the new node. Then we assign the new node's previous property to the original tail. Then we finally declare the tail as the new node. Let's move on to the remove operation.
//Doubly Linked List Remove.
DoublyLinkedList.prototype.remove = function (data) {
//If the list is empty
if ( !this.size ) return 0;
//If the node to remove is the head
if ( this.head.data === data ) {
//If the head was the only node in the list
if ( !this.head.next ) {
this.head = null;
this.tail = null;
this.size--;
return 1;
}
//If there exists some node after the head
this.head = this.head.next;
this.head.prev = null;
this.size--;
return 1;
}
//If the node to remove is the tail
if ( this.tail.data === data ) {
this.tail = this.tail.prev;
this.tail.next = null;
this.size--;
return 1;
}
//If the node to remove is anywhere in between head and the tail
let tempNode = this.head.next;
while ( tempNode !== this.tail ) {
if ( tempNode.data === data ) {
let tempPrevious = tempNode.prev;
let tempNext = tempNode.next;
tempPrevious.next = tempNext;
tempNext.prev = tempPrevious;
tempNode = null;
this.size--;
return 1;
}
tempNode = tempNode.next;
}
return 0;
}
Remove part is a bit more complicated than the singly linked list variant, but I will attempt to explain this.
this.head
and this.tail
point back to null, which is originally where it's at when the list gets instantiated. If the list contains more nodes than just the head, we simply delete the head, and make the next node in line the new head. Notice that this new head has the prev
property that has to be set to null. Otherwise, it will originally point to the head that was removed.
next
property to null.
next
property to the next
property of the node to be removed. We set the next node's prev
property to the prev
property of the node to be removed. Put it simply, we remove the reference to the node that is being removed, and re-link from both sides.
//Doubly Linked List Remove.
DoublyLinkedList.prototype.remove = function (data) {
//If the list is empty
if ( !this.size ) return null;
let removedNode = null;
//If the node to remove is the head
if ( this.head.data === data ) {
removedNode = this.head;
//If the head was the only node in the list
if ( !this.head.next ) {
this.head = null;
this.tail = null;
this.size--;
return removedNode;
}
//If there exists some node after the head
this.head = this.head.next;
this.head.prev = null;
this.size--;
return removedNode;
}
//If the node to remove is the tail
if ( this.tail.data === data ) {
removedNode = this.tail;
this.tail = this.tail.prev;
this.tail.next = null;
this.size--;
return removedNode;
}
//If the node to remove is anywhere in between head and the tail
let tempNode = this.head.next;
while ( tempNode !== this.tail ) {
if ( tempNode.data === data ) {
removedNode = tempNode;
let tempPrevious = tempNode.prev;
let tempNext = tempNode.next;
tempPrevious.next = tempNext;
tempNext.prev = tempPrevious;
tempNode = null;
this.size--;
return removedNode;
}
tempNode = tempNode.next;
}
return null;
}
Let's not forget about our isEmpty
operation, which is the easiest out of them all.
//Doubly Linked List isEmpty.
DoublyLinkedList.prototype.isEmpty = function() {
return this.size === 0;
}
There you have it. This completes our basic doubly linked list.
//Node Object/Function
function Node( data ) {
this.data = data;
this.prev = null;
this.next = null;
}
//Doubly Linked List
function DoublyLinkedList() {
this.head = null;
this.tail = null;
this.size = 0;
}
//Doubly Linked List Add.
DoublyLinkedList.prototype.add = function (data) {
let newNode = new Node(data);
//If the list is empty Note: You can check if this.head is null as well.
if ( !this.size ) {
this.head = newNode;
this.tail = newNode;
this.size++;
return newNode;
}
//If the list is not empty
this.tail.next = newNode;
newNode.prev = this.tail;
this.tail = newNode;
this.size++;
return newNode;
}
//Doubly Linked List Remove.
DoublyLinkedList.prototype.remove = function (data) {
//If the list is empty
if ( !this.size ) return null;
let removedNode = null;
//If the node to remove is the head
if ( this.head.data === data ) {
removedNode = this.head;
//If the head was the only node in the list
if ( !this.head.next ) {
this.head = null;
this.tail = null;
this.size--;
return removedNode;
}
//If there exists some node after the head
this.head = this.head.next;
this.head.prev = null;
this.size--;
return removedNode;
}
//If the node to remove is the tail
if ( this.tail.data === data ) {
removedNode = this.tail;
this.tail = this.tail.prev;
this.tail.next = null;
this.size--;
return removedNode;
}
//If the node to remove is anywhere in between head and the tail
let tempNode = this.head.next;
while ( tempNode !== this.tail ) {
if ( tempNode.data === data ) {
removedNode = tempNode;
let tempPrevious = tempNode.prev;
let tempNext = tempNode.next;
tempPrevious.next = tempNext;
tempNext.prev = tempPrevious;
tempNode = null;
this.size--;
return removedNode;
}
tempNode = tempNode.next;
}
return null;
}
//Doubly Linked List isEmpty.
DoublyLinkedList.prototype.isEmpty = function() {
return this.size === 0;
}


Home
(current)
Logout
Please enter the details in this form ...
Care Reciever Details
First Name
Last Name
Date Of Birth
Gender
State ID
Country
Address
Email
Phone
Phone
Care Payer Details
Care Payer Name
Country
Email
Mobile Number
Payment Mode (PayID - Crypto payments Accepted )
Phone
Appointment Details
Date
Time
Alternate if primary country not available
Country
City
Payment Amount
USD 49
Doctor PayID
drCareFromFar$xprize.money
Next


Center Image In Div
ex-01: Example with Bootstrap Grid
Big Div
I'm bigger than the Little Div and my containing div grows to accomodate my height.
Little Div
I'm not as tall as the div but the vcenter class is applied so I'm centered vertically.
ex-03: Does ex-01 work when not in a Bootstrap grid?
It didn't work.
Center horizontally with Bootstrap
Center horizontally & vertically
without
Bootstrap
With Flexbox - my favorite way


Card 1 Kiwis are oval shaped with a brownish outer skin. The flesh is bright green and juicy with Buy Now @ Rs.12


Custom Enchants has been in development for a long time, and is one of MineLegends' most prominent features. We are extremely excited to see what you guys think! *hint* IT ROCKS!!
Enchant Type: Weapon
Max Level: III
Description: On death, have a chance of dropping the enemies head.
Leveling:
I: 25% chance of dropping head
II: 35% chance of dropping head
III: 45% chance of dropping head (5% chance of insta-killing a player within 5 blocks)
Enchant Type: Armor
Max Level: II
Description: On hit have a chance of spawning blazes to battle your attacker.
Leveling:
I: 25% chance of spawning blazes
II: 45% chance of spawning blazes
Enchant Type: Armor
Max Level: III
Description: On hit have a chance of removing all potion effects and restoring half health.
Leveling:
I: 15% chance of removing effects
II: 20% chance of removing effects (5% chance of moving negatives to enemy)
III: 35% chance of removing effects (10% chance of moving negatives to enemy)
Enchant Type: Weapon
Max Level: II
Description: When equipped get an extra row of hearts.
Leveling:
No leveling....
Enchant Type: Chestplate
Max Level: II
Description: On hit have a chance of removing your enemies ability to walk and see for 2-3 seconds.
Leveling:
I: 15% chance of flinging enemy
II: 20% chance of flinging enemy
Enchant Type: Fishing Rod
Max Level: II
Description: On hit have a chance of blasting your enemy into the sky pulling the ground out from under them.
Leveling:
I: 15% chance of shooting your enemy from the ground, flinging them and the ground beneath high into the air.
II: 25% chance of shooting your enemy from the ground, flinging them and the ground beneath high into the air.
III: 30% chance of shooting your enemy from the ground, flinging them and the ground beneath high into the air.


ESPHub
Configurator
Hostname:
fetching
Host IP:
fetching
Home
Settings
Devtools
bruh
very very small text
Add channel
Node Settings
Delete Node
Name
Channel Settings
Delete Channel
Name
Channel Settings
Delete Channel
Name
Channel Settings
Delete Channel
Add new node
Node Settings
IP Address:
Node Name:
Description:
Node Settings
IP Address:
Node Name:
Description:
New Channel
Channel Name:
Channel Type:
Switch
Slider
Display
GPIO:
0
1
2
3
4
5
9
10
12
13
14
15
16
Custom
Channel Description:
Channel Settings
Channel Name:
Channel Type:
Switch
Slider
Display
GPIO:
0
1
2
3
4
5
9
10
12
13
14
15
16
Custom
Channel Description:


Mturk Suite Settings
Today's Projected Earnings Settings
Goal
General Settings
Enable Accept Next Checked
Enable Workspace Expand & Scroll
Enable PRE Auto Reloader
Enable Theme
Enable HIT Catcher (Beta)
HIT Export Settings
Enable IRC Export
Enable Forum Export
Enable TH Direct Export
Enable MTC Direct Export
Turkopticon Settings
Use TO 1 Coloring
Use TO 2 Coloring
TO 1: High
TO 2: High
TO 1: Good
TO 2: Good
TO 1: Average
TO 2: Average
TO 1: Low
TO 2: Low
Reset
Reset Settings
Reset Turkopticon DB
Donate
Patreon
PayPal


Improving
Mental Health
Emotions play a critical role in rational and intelligent behavior; a better fundamental knowledge of them is indispensable for understanding higher order brain function.
Aiding
the Disadvantaged
Affective computing studies and extracts information about the emotional state of a person in certain situations, an important aspect for the interaction between people and the computer. In particular, this study considers people with visual disabilities and their need for personalized systems that prioritize their disability and the degree that it affects them.
Advancing
Education
The research purposes of most affective computing studies in education are found to be designing emotion recognition and expression systems/methods/instruments as well as examining the relationships among emotion, motivation, learning style, and cognition.


Bootstrap Text Emphasis Classes
Primary: Please read the instructions carefully before proceeding.
Secondary: This is featured has been removed from the latest version.
Success: Your message has been sent successfully.
Info: You must agree with the terms and conditions to complete the sign up process.
Warning: There was a problem with your network connection.
Danger: An error has been occurred while submitting your data.
Muted: This paragraph of text is grayed out.


This is kind of a foreach-loop for slots. A variable called "\$slotIndex" is available inside the loop.
maxItems - maximum number of slots in the list.
alwaysMaxItems [no] - should be one of {yes, no}. If set to "yes", always displays the maximum number of slots (in o2cms).
virtual [no] - should be one of {yes, no}. If set to "yes", doesn't call getChildren on the slot object. [Someone who knows a little
more about this than me, please explain better!]
content - usually a , and possibly some additional html.


You are free to mix any valid HTML into a Rimu document — no special syntax or relearning is required (in this sense Rimu can be thought of as an HTML superset).
First convert Rimu markup to HTML using the rimuc
tool and then
convert the HTML to PDF. Here are a few options for converting HTML
to PDF:
rimuc
--styled
option.
Macros provide a simple, consistent mechanism for extending the Rimu markup vocabulary. For example:
| Rimu source |
|
| Rendered HTML |
Fun with MacrosHeads up! See the Rimu Playground for documentation and hands-on experimentation. Note This document is not yet finished. |
{sidebar}
macro shows how you can inject CSS styles into a
Division Block, but a better way of styling block elements is to
use scoped CSS.
Highlight.js is a nice
syntax highlighter that makes it trivial to add syntax highlighting to
Rimu Code blocks and Indented paragraphs. The rimuc tool --styled
option includes Highlight.js if you set the {--highlightjs}
macro to
a non-blank value. It does this by linking to CSS and JavaScript files
on the Highlight.js website.
Highlight.js automatically detects the language in Code Blocks and Indented Paragraphs. You can also set the language explicitly by adding a code block class, for example:
| Rimu source | Rendered HTML |
|---|---|
|
|
Set the no-highlight
class to disable syntax highlighting for a code
block. Adding the no-highlight
class to all code blocks using
Delimited Block Definitions effectively turns off auto-highlighting
unless the language class is explicitly set:
|code| = '
|
'
|indented| = '
|
'
The following subset of Rimu elements is compatible with Markdown:
#
character header IDs.
_emphasis_
and `code`
quotes.
-
and *
IDs.
<url>
and <email>
syntaxes.
The Rimu README uses this subset for compatibility with GitHub and npmjs.org README formats.
If you have text that you don't want interpreted as a Rimu element then you can render it literally (escape it) by prefixing the element with a backslash character.
You can do this by prepending text containing macro definitions to
Rimu source before rendering the source. The rimuc command has a
--prepend
option that can be used to do this.
Alternatively you could also put macro definitions in a separate file and specify it as the first Rimu source file in the rimuc command.
The following example sets the HTML title in the kotlin-notes.html
output document:
rimuc --styled --prepend "{title}='Kotlin Notes'" kotlin-notes.rmu
The Vim editor syntax highlighter is a big help when writing (and reading) Rimu markup.
Using an editor with Rimu syntax highlighting support (see previous topic) makes it much easier to spot syntax errors.
Unless they are separated by other block elements, multiple block
image elements flow inline like text (this is because the HTML img
element is an "inline block" element), you can flow them vertically by
enclosing them in a Division Block (HTML div
element). For
example:
| Rimu source |
|
| Rendered HTML |
A number of non-ASCII Unicode characters are commonly used for punctuation e.g. em dash, ellipsis and quotation characters. You can enter these characters (or any Unicode character) as HTML character entities or you can enter them literally.
For example, to enter an ellipsis you could either enter …
or
you could enter the actual … character directly (alternatively you
could define a Replacement for the ellipsis, see the
Example .rimurc file below). The mechanism for
entering Unicode characters directly will be dictated your editor:
Common Unicode characters:
Character HTML entity Hexadecimal code
--------- ----------- ----------------
— — 2014
… … 2026
“ “ 201c
” ” 201d
→ → 2192
Here's a full list of HTML5 character entities.
Whitespace characters are illegal in URL paths, use %20 in place of spaces, for example:
<file:///home/srackham/books/War%20and%20Peace.pdf|War and Peace>
Underscore characters are legal in URL paths but they may be interpreted as Rimu emphasis quotes, you can use %5F in place of underscores or escape them with backslashes.
Adding new Replacement and Quote definitions changes the Rimu syntax which can produce unexpected results. It can also make your Rimu source non-portable and less readable.
Here is an example .rimurc
file containing Macro, Quote and
Replacement definitions (refer to the Rimu documentation under
Tools):
/*
~/.rimurc file containing custom Rimu Markup definitions used by
rimuc command.
*/
/*
Replacements
*/
// Don't match HTML comment tags.
/(^|[^!])--(?!>)/ = '$1—'
/\.{3}/ = '…'
/``/ = '“'
/''/ = '”'
// Don't match HTML close comment tag.
/(^|[^-])->/ = '$1→'
/<-/ = '←'
/\bTODO\b/ = 'TODO'
/^(NOTE|IMPORTANT|WARNING|TIP):/ = '$1:'
// Encodes (most) raw HTTP URLs as links.
/(^|[^<])((?:http|https):\/\/[^\s"']*[^\s"',.;?)])/ = '$1$2'
// Alternative (typing friendly) emphasis, works for most cases but
// can't contain quotes.
/\B'\b(.+?)\b'\B/g = '$1'
/*
Macros
*/
{mark} = '$1'
{del} = '$1'
{ins} = '$1'
{sup} = '$1'
{sub} = '$1'
/*
Quotes
*/
~ = '|'
/*
Highlight.js
*/
// Turn off auto-hightlighting.
|code| = '
|
'
|indented| = '
|
'
If you've added custom replacements and quotes you can highlight them
in Vim by creating a custom ~/.vim/after/syntax/rimu.vim
syntax
file. Vim loads this file after the distributed
~/.vim/syntax/rimu.vim
file. The following example
~/.vim/after/syntax/rimu.vim
syntax file highlights the admonitions
replacement and the strike-through quote definitions from the previous
example .rimurc
file:
" ~/.vim/after/syntax/rimu.vim
"
" Custom Vim highlighting for custom syntax defined in ~/.rimurc
"
" Admonishments.
syn match rimuAdmonition /^\([A-Z]\+\):/ containedin=ALLBUT,rimuComment,rimuCodeBlock
hi def link rimuAdmonition Special
" ~ quote.
syn match rimuSpanDeleted /\\\@<!\~[ \t\n]\@!\(.\|\n\(\s*\n\)\@!\)\{-1,}[\\ \t\n]\@<!\~/ contains=rimuSpanEntity
hi def link rimuSpanDeleted Todo
" Raw HTTP URLs as links.
syn match rimuSpanRawURL /[\\<]\@<!\(http\|https\):\/\/[^\s"']*[^\s"',.;?)]/
hi def link rimuSpanRawURL Title
Inline elements are processed in the following order (first to last):
Substitutions in multi-line block elements can be controlled using block-options in the Block Attributes element.
Macro, Replacement and Quote definitions are not processed in Safe Mode. To apply Macro, Replacement or Quote definitions to Rimu markup processed in Safe Mode you need to load the definitions with a separate API call, for example:
Rimu.render(trusted_rimu_definitions); // safeMode is off by default.
var html = Rimu.render(untrusted_rimu_markup, {safeMode: 1});
You can (with caveats) redefine built-in Quotes and Replacements, here are a couple of examples:
_ = '|'
/\\?<(\S+@[\w\.\-]+)>/g = '$1'
Refer to the Rimu source files quotes.ts and replacements.ts.
You can include math formulas written in LaTeX or MathML using
MathJax. The rimuc
command --styled
option will include MathJax support if the {--mathjax}
macro is
defined. Examples:
| Rimu source |
|
| Rendered HTML |
A LaTeX inline formula: \(\sum_{i=0}^n i^2 = \frac{n^2+n}m{2}\) A LaTeX block formula: \[\sum_{i=0}^n i^2 = \frac{n^2+n}m{2}\] A MathML inline formula: A MathML block formula: |
NOTE: Macro expansion has been disabled in LaTeX formulas to stop
{i=0}
and {2}
from being mistaken for Rimu macro invocations.
See the latest MathJax documentation to learn how to use MathJax.
Rimu comment elements are block elements and cannot be used inline —
use an undefined macro to exclude inline text from elements that
support macro expansion (e.g. paragraphs, lists, HTML blocks). It is
customary to use the Undefined --
macro for this purpose:
{--!}This line is skipped,
and {--|this text is skipped}.
See also Conditional Inclusion.
Macro invocations can be used to conditionally include source text.
Single-line block elements (e.g. Headers, Block Attributes, single-line Paragraphs and single-line HTML blocks) can be conditionally excluded by prefixing an Inclusion macro invocation. For example:
{underscore!}
This works because lines (in a block context) that begin with a macro invocation are initially processed as Line Macro elements.
To conditionally exclude these multi-line block elements enable the
+skip
option with a preceding Attribute Block element. For
example:
{macro!}.+skip
*Lorem ipsum dolor*. Sit amet venenatis. Erat nulla arcu. Lorem
luctus sem. Mauris vitaei ipsum.
If macro
is defined and not blank then the .+skip
Attribute Block
will be processed which causes the following paragraph to be skipped.
If an element supports macro expansion (e.g. Paragraphs and HTML Blocks), then block content can be conditionally included using:
{macro=} Line is included if macro is undefined or value is blank.
{macro!} Line is included if macro is defined and value not blank.
{macro=one} Line is included if macro value is 'one'.
{macro=two} Line is included if macro value is 'two'.
{macro=\d+} Line is included if macro value is a number.
{macro} = ''
Mauris vitae ipsumi lacus vestibulum sem. {macro|This text
is excluded}
{macro} = '$1'
Mauris vitae ipsumi lacus vestibulum sem. {macro|This text
is included.}
So long as the macro
value is undefined or blank the text is
excluded — set it to $1
and the text will be included. Note that
parameter text can encompass multiple lines.
Create tables using the HTML table syntax (Rimu has no special syntax for tables).
You can use Rimu markup in table cells, just remember that HTML blocks must start at the left margin and end with a blank line.
The rimuc
--styled
option includes
Bootstrap so you can use
Bootstrap tables classes to
create nicely formatted tables. For example:
| Rimu source |
|
||
| Rendered HTML |
|
You can define macros which, when invoked, generate other macros. A good example of this is the generation of document section headers, links and table of contents entries from a section identifier and title:
| Rimu source |
|
| Rendered HTML |
Table of ContentsSection OneLink to Section Two. Section TwoLink to Section One. |
NOTE: The backslash character is used to continue macro definition lines that end with a single-quote.
|
character entity to display a |
character inside
a macro parameter value.
.+macros
--
{example-42}
--
The contents of {example-42}
are not subject to macro expansion.
-macros
Block
Attributes option. For example this Rimu markup:
{m1} = 'foo'
{m2} = '{m1} \{m1}'
{m2}
{m1} = 'bar'
{m2}
Generates:

foo foo

foo bar

HTML5's scoped CSS attribute allows you to define CSS outside the document header. This allows you to include CSS in the body of a Rimu document which is very handy for tweaking the default CSS and for styling Rimu block elements. Examples:
| Rimu source | Rendered HTML |
|---|---|
|
Neque a massa. Porttitor consectetuer commodo. Lorum IpsumNeque a massa. Porttitor consectetuer commodo. Nunc mauris tempor. Pede mauris sed. Scelerisque feugiat massa alias. |
--styled
option.


GTA Online players can now create their own Survival and King of the Hill Modes
by Stephany NunneleyGTA Online players can now build their very own wave-based King of the Hill and Survival Modes.
Rockstar has introduced the Survival Creator and King of the Hill Creator, allowing you to create your very own modes in GTA Online.
With the Survival Creator, you can build wave-based Survival Modes with options to “place props and spawn points, control enemy combat proficiency, vehicle spawns,” and more.
There’s also the new King of the Hill Creator, where you can place props and capture points. You can choose from stationary areas, item pickups or even driveable vehicles in either team-based or free-for-all variants.
Once created, you can publish these modes via the Social Club for the community to discover.
Speaking of the modes, both are handing out double rewards this week. Just hit up the rolling playlist and jump in.
This week you can also take 25% off Gunrunning Supplies and enjoy a 50% boost in Gunrunning Research Speed. You will also earn double on Gunrunning Sell Missions through November 20. Any Mobile Operations Mission will also pay out double rewards.
Paying a visit this week to the Diamond Casino & Resort and giving the Lucky Wheel a spin could win you the top price: the Ocelot Stromberg. It’s a submersible two-seater and rather cool. As always, you can also win new duds and GTA$. There are also new items in the casino shop this week, so go have a browse.
Finally, this week you can enjoy discounts on various armor, military vehicles, properties and more.
Games featured in this article


|
My Project
|
The world class manages all physics entities, dynamic simulation, and asynchronous queries. More...
Public Member Functions | |
| World () | |
| Initializes a new instance of the World class. More... | |
| World (Vector2 gravity) | |
| Initializes a new instance of the World class. More... | |
| World (IBroadPhase broadPhase) | |
| Initializes a new instance of the World class. More... | |
| virtual void | Add (Body body) |
| Add a rigid body. Warning: This method is locked during callbacks. More... | |
| virtual void | Remove (Body body) |
| Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints. Warning: This method is locked during callbacks. More... | |
| void | Add (Joint joint) |
| Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding. Warning: This method is locked during callbacks. More... | |
| void | Remove (Joint joint) |
| Destroy a joint. This may cause the connected bodies to begin colliding. Warning: This method is locked during callbacks. More... | |
| void | Step (TimeSpan dt) |
| Take a time step. This performs collision detection, integration, and consraint solution. More... | |
| void | Step (TimeSpan dt, ref SolverIterations iterations) |
| Take a time step. This performs collision detection, integration, and consraint solution. More... | |
| void | Step (float dt) |
| Take a time step. This performs collision detection, integration, and consraint solution. Warning: This method is locked during callbacks. More... | |
| void | Step (float dt, ref SolverIterations iterations) |
| Take a time step. This performs collision detection, integration, and consraint solution. Warning: This method is locked during callbacks. More... | |
| void | ClearForces () |
| Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function. More... | |
| void | QueryAABB (QueryReportFixtureDelegate callback, AABB aabb) |
| Query the world for all fixtures that potentially overlap the provided AABB. More... | |
| void | QueryAABB (QueryReportFixtureDelegate callback, ref AABB aabb) |
| Query the world for all fixtures that potentially overlap the provided AABB. More... | |
| void | RayCast (RayCastReportFixtureDelegate callback, Vector2 point1, Vector2 point2) |
| Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. More... | |
| void | Add (Controller controller) |
| Warning: This method is locked during callbacks. More... | |
| void | Remove (Controller controller) |
| Warning: This method is locked during callbacks. More... | |
| Fixture | TestPoint (Vector2 point) |
| void | ShiftOrigin (Vector2 newOrigin) |
| void | Clear () |
| Warning: This method is locked during callbacks. More... | |
| virtual Body | CreateBody (Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateEdge (Vector2 start, Vector2 end) |
| Body | CreateChainShape (Vertices vertices, Vector2 position=new Vector2()) |
| Body | CreateLoopShape (Vertices vertices, Vector2 position=new Vector2()) |
| Body | CreateRectangle (float width, float height, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateCircle (float radius, float density, Vector2 position=new Vector2(), BodyType bodyType=BodyType.Static) |
| Body | CreateEllipse (float xRadius, float yRadius, int edges, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreatePolygon (Vertices vertices, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateCompoundPolygon (List< Vertices > list, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateGear (float radius, int numberOfTeeth, float tipPercentage, float toothHeight, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateCapsule (float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateCapsule (float height, float endRadius, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateRoundedRectangle (float width, float height, float xRadius, float yRadius, int segments, float density, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateLineArc (float radians, int sides, float radius, bool closed=false, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Body | CreateSolidArc (float density, float radians, int sides, float radius, Vector2 position=new Vector2(), float rotation=0, BodyType bodyType=BodyType.Static) |
| Path | CreateChain (Vector2 start, Vector2 end, float linkWidth, float linkHeight, int numberOfLinks, float linkDensity, bool attachRopeJoint) |
| Creates a chain. More... | |
Public Attributes | |
| object | Tag |
| Set the user data. Use this to store your application specific data. More... | |
| BodyDelegate | BodyAdded |
| Fires whenever a body has been added More... | |
| BodyDelegate | BodyRemoved |
| Fires whenever a body has been removed More... | |
| FixtureDelegate | FixtureAdded |
| Fires whenever a fixture has been added More... | |
| FixtureDelegate | FixtureRemoved |
| Fires whenever a fixture has been removed More... | |
| JointDelegate | JointAdded |
| Fires whenever a joint has been added More... | |
| JointDelegate | JointRemoved |
| Fires whenever a joint has been removed More... | |
| ControllerDelegate | ControllerAdded |
| Fires every time a controller is added to the World. More... | |
| ControllerDelegate | ControllerRemoved |
| Fires every time a controlelr is removed form the World. More... | |
| readonly ControllerCollection | ControllerList |
| readonly ContactManager | ContactManager |
| Get the contact manager for testing. More... | |
| readonly BodyCollection | BodyList |
| Get the world body list. More... | |
| readonly JointCollection | JointList |
| Get the world joint list. More... | |
Properties | |
| TimeSpan | UpdateTime [get] |
| TimeSpan | ContinuousPhysicsTime [get] |
| TimeSpan | ControllersUpdateTime [get] |
| TimeSpan | AddRemoveTime [get] |
| TimeSpan | NewContactsTime [get] |
| TimeSpan | ContactsUpdateTime [get] |
| TimeSpan | SolveUpdateTime [get] |
| int | ProxyCount [get] |
| Get the number of broad-phase proxies. More... | |
| int | ContactCount [get] |
| Get the number of contacts (each may have 0 or more contact points). More... | |
| Vector2 | Gravity [get, set] |
| Change the global gravity vector. More... | |
| bool | IsLocked [get] |
| Is the world locked (in the middle of a time step). More... | |
| ContactListHead | ContactList [get] |
| Get the world contact list. ContactList is the head of a circular linked list. Use Contact.Next to get the next contact in the world list. A contact equal to ContactList indicates the end of the list. More... | |
| bool | Enabled [get, set] |
| If false, the whole simulation stops. It still processes added and removed geometries. More... | |
| Island | Island [get] |
The world class manages all physics entities, dynamic simulation, and asynchronous queries.
| tainicom.Aether.Physics2D.Dynamics.World.World | ( | ) |
Initializes a new instance of the World class.
| tainicom.Aether.Physics2D.Dynamics.World.World | ( | Vector2 | gravity | ) |
Initializes a new instance of the World class.
| gravity | The gravity. |
| tainicom.Aether.Physics2D.Dynamics.World.World | ( | IBroadPhase | broadPhase | ) |
Initializes a new instance of the World class.
|
virtual |
Add a rigid body. Warning: This method is locked during callbacks.
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Add | ( | Controller | controller | ) |
Warning: This method is locked during callbacks.
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Add | ( | Joint | joint | ) |
Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding. Warning: This method is locked during callbacks.
| joint | The joint. |
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Clear | ( | ) |
Warning: This method is locked during callbacks.
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.ClearForces | ( | ) |
Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function.
| Path tainicom.Aether.Physics2D.Dynamics.World.CreateChain | ( | Vector2 | start, |
| Vector2 | end, | ||
| float | linkWidth, | ||
| float | linkHeight, | ||
| int | numberOfLinks, | ||
| float | linkDensity, | ||
| bool | attachRopeJoint | ||
| ) |
Creates a chain.
| world | The world. |
| start | The start. |
| end | The end. |
| linkWidth | The width. |
| linkHeight | The height. |
| numberOfLinks | The number of links. |
| linkDensity | The link density. |
| attachRopeJoint | Creates a rope joint between start and end. This enforces the length of the rope. Said in another way: it makes the rope less bouncy. |
| void tainicom.Aether.Physics2D.Dynamics.World.QueryAABB | ( | QueryReportFixtureDelegate | callback, |
| AABB | aabb | ||
| ) |
Query the world for all fixtures that potentially overlap the provided AABB.
Inside the callback: Return true: Continues the query Return false: Terminate the query
| callback | A user implemented callback class. |
| aabb | The aabb query box. |
| void tainicom.Aether.Physics2D.Dynamics.World.QueryAABB | ( | QueryReportFixtureDelegate | callback, |
| ref AABB | aabb | ||
| ) |
Query the world for all fixtures that potentially overlap the provided AABB.
Inside the callback: Return true: Continues the query Return false: Terminate the query
| callback | A user implemented callback class. |
| aabb | The aabb query box. |
| void tainicom.Aether.Physics2D.Dynamics.World.RayCast | ( | RayCastReportFixtureDelegate | callback, |
| Vector2 | point1, | ||
| Vector2 | point2 | ||
| ) |
Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point.
Inside the callback: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue
| callback | A user implemented callback class. |
| point1 | The ray starting point. |
| point2 | The ray ending point. |
|
virtual |
Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints. Warning: This method is locked during callbacks.
| body | The body. |
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Remove | ( | Controller | controller | ) |
Warning: This method is locked during callbacks.
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Remove | ( | Joint | joint | ) |
Destroy a joint. This may cause the connected bodies to begin colliding. Warning: This method is locked during callbacks.
| joint | The joint. |
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.ShiftOrigin | ( | Vector2 | newOrigin | ) |
Shift the world origin. Useful for large worlds. The body shift formula is: position -= newOrigin
| newOrigin | the new origin with respect to the old origin Warning: Calling this method mid-update might cause a crash. |
| void tainicom.Aether.Physics2D.Dynamics.World.Step | ( | float | dt | ) |
Take a time step. This performs collision detection, integration, and consraint solution. Warning: This method is locked during callbacks.
| dt | The amount of time to simulate in seconds, this should not vary. |
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Step | ( | float | dt, |
| ref SolverIterations | iterations | ||
| ) |
Take a time step. This performs collision detection, integration, and consraint solution. Warning: This method is locked during callbacks.
| dt | The amount of time to simulate in seconds, this should not vary. |
| System.InvalidOperationException | Thrown when the world is Locked/Stepping. |
| void tainicom.Aether.Physics2D.Dynamics.World.Step | ( | TimeSpan | dt | ) |
Take a time step. This performs collision detection, integration, and consraint solution.
| dt | The amount of time to simulate, this should not vary. |
| void tainicom.Aether.Physics2D.Dynamics.World.Step | ( | TimeSpan | dt, |
| ref SolverIterations | iterations | ||
| ) |
Take a time step. This performs collision detection, integration, and consraint solution.
| dt | The amount of time to simulate, this should not vary. |
| BodyDelegate tainicom.Aether.Physics2D.Dynamics.World.BodyAdded |
Fires whenever a body has been added
| readonly BodyCollection tainicom.Aether.Physics2D.Dynamics.World.BodyList |
Get the world body list.
The head of the world body list.
| BodyDelegate tainicom.Aether.Physics2D.Dynamics.World.BodyRemoved |
Fires whenever a body has been removed
| readonly ContactManager tainicom.Aether.Physics2D.Dynamics.World.ContactManager |
Get the contact manager for testing.
The contact manager.
| ControllerDelegate tainicom.Aether.Physics2D.Dynamics.World.ControllerAdded |
Fires every time a controller is added to the World.
| ControllerDelegate tainicom.Aether.Physics2D.Dynamics.World.ControllerRemoved |
Fires every time a controlelr is removed form the World.
| FixtureDelegate tainicom.Aether.Physics2D.Dynamics.World.FixtureAdded |
Fires whenever a fixture has been added
| FixtureDelegate tainicom.Aether.Physics2D.Dynamics.World.FixtureRemoved |
Fires whenever a fixture has been removed
| JointDelegate tainicom.Aether.Physics2D.Dynamics.World.JointAdded |
Fires whenever a joint has been added
| readonly JointCollection tainicom.Aether.Physics2D.Dynamics.World.JointList |
Get the world joint list.
The joint list.
| JointDelegate tainicom.Aether.Physics2D.Dynamics.World.JointRemoved |
Fires whenever a joint has been removed
| object tainicom.Aether.Physics2D.Dynamics.World.Tag |
Set the user data. Use this to store your application specific data.
The user data.
|
get |
Get the number of contacts (each may have 0 or more contact points).
The contact count.
|
get |
Get the world contact list. ContactList is the head of a circular linked list. Use Contact.Next to get the next contact in the world list. A contact equal to ContactList indicates the end of the list.
The head of the world contact list.
for (Contact c = World.ContactList.Next; c != World..ContactList; c = c.Next)
|
getset |
If false, the whole simulation stops. It still processes added and removed geometries.
|
getset |
Change the global gravity vector.
The gravity.
|
get |
Is the world locked (in the middle of a time step).
|
get |
Get the number of broad-phase proxies.
The proxy count.


Environmental Impact
Environmentally Friendly Product
{{ pg_title }}
CO2 Emission
Material: {{ pg_material }}
Cost of Carbon : 23.78 USD per tonne
Emission Calculation : {{ pg_emission }} * 23.78 = {{ pg_emission_m }}
BUY NOW{% extends "base_site.html" %} {% block title %} Dashboard 3 {% endblock title %} {% block stylesheets %} {{ super() }} {% endblock stylesheets %} {% block content %}
Material: {{ pg_material }}
Cost of Carbon : 23.78 USD per tonne
Emission Calculation : {{ pg_emission }} * 23.78 = {{ pg_emission_m }}
BUY NOW


A bookmarklet is a script that stays on the Bookmarks Bar waiting to be clicked to execute.
To use a bookmarklet:
1. Drag and drop the link to the Bookmarks Bar.
1. Navigate to the page it's designed to run on.
1. Click it to execute.
Bookmarklets tend to rot over time if the owner changes the website, please [report to me]({{ site.baseurl }}/contact/) if it's broken.


You can test whether an object is compliant with the Active Model API by including ActiveModel::Lint::Tests in your TestCase. It will include tests that tell you whether your object is fully compliant, or if not, which aspects of the API are not implemented.
These tests do not attempt to determine the semantic correctness of the returned values. For instance, you could implement valid? to always return true, and the tests would pass. It is up to you to ensure that the values are semantically meaningful.
Objects you pass in are expected to return a compliant object from a call to to_model. It is perfectly fine for to_model to return self.
Returns an object that has :[] and :full_messages defined on it. See below for more details.
Returns an Array of Strings that are the errors for the attribute in question. If localization is used, the Strings should be localized for the current locale. If no error is present, this method should return an empty Array.
# File lib/active_model/lint.rb, line 100 def test_errors_aref assert model.respond_to?(:errors), "The model should respond to errors" assert model.errors[:hello].is_a?(Array), "errors#[] should return an Array" end
Returns an Array of all error messages for the object. Each message should contain information about the field, if applicable.
# File lib/active_model/lint.rb, line 107 def test_errors_full_messages assert model.respond_to?(:errors), "The model should respond to errors" assert model.errors.full_messages.is_a?(Array), "errors#full_messages should return an Array" end
Model.model_name must return a string with some convenience methods: :human, :singular, and :plural. Check ActiveModel::Naming for more information.
# File lib/active_model/lint.rb, line 82 def test_model_naming assert model.class.respond_to?(:model_name), "The model should respond to model_name" model_name = model.class.model_name assert_kind_of String, model_name assert_kind_of String, model_name.human assert_kind_of String, model_name.singular assert_kind_of String, model_name.plural end
Returns a boolean that specifies whether the object has been persisted yet. This is used when calculating the URL for an object. If the object is not persisted, a form for that object, for instance, will be POSTed to the collection. If it is persisted, a form for the object will be PUT to the URL for the object.
# File lib/active_model/lint.rb, line 72 def test_persisted? assert model.respond_to?(:persisted?), "The model should respond to persisted?" assert_boolean model.persisted?, "persisted?" end
Returns an Enumerable of all (primary) key attributes or nil if model.persisted? is false
# File lib/active_model/lint.rb, line 23 def test_to_key assert model.respond_to?(:to_key), "The model should respond to to_key" def model.persisted?() false end assert model.to_key.nil?, "to_key should return nil when `persisted?` returns false" end
Returns a string representing the object’s key suitable for use in URLs or nil if model.persisted? is false.
Implementers can decide to either raise an exception or provide a default in case the record uses a composite primary key. There are no tests for this behavior in lint because it doesn’t make sense to force any of the possible implementation strategies on the implementer. However, if the resource is not persisted?, then to_param should always return nil.
# File lib/active_model/lint.rb, line 39 def test_to_param assert model.respond_to?(:to_param), "The model should respond to to_param" def model.to_key() [1] end def model.persisted?() false end assert model.to_param.nil?, "to_param should return nil when `persisted?` returns false" end
Returns a string giving a relative path. This is used for looking up partials. For example, a BlogPost model might return “blog_posts/blog_post”
# File lib/active_model/lint.rb, line 51 def test_to_partial_path assert model.respond_to?(:to_partial_path), "The model should respond to to_partial_path" assert_kind_of String, model.to_partial_path end
Returns a boolean that specifies whether the object is in a valid or invalid state.
# File lib/active_model/lint.rb, line 60 def test_valid? assert model.respond_to?(:valid?), "The model should respond to valid?" assert_boolean model.valid?, "valid?" end
Generated with the Darkfish Rdoc Generator 2.


Debugging
Deploying Persoo to your website is a piece of cake as it is well-equipped with various debugging tools.
Persoo debug console
Now you can see the debug console on the right (it's implicitly open everywhere in the demo).
What you will find in the console:
- Data - data that were exported from Persoo to your page, and javascript functions that were triggered in the page.
- User space - all data stored in Persoo for the current user.
- Log - Persoo client log (requests sent to Persoo, responses received, etc.)
The console is refreshed only when a page is loaded. If you want to see the current state in case you made some events while staying on the same page, you need to press the refresh icon.
If you need to open Persoo debug console on any live web page that is using Persoo, run the command
persoo('showDebugConsole');
in your browser debug console (F12 in Firefox, Chrome, ...). For closing console, click on "X" or use
persoo('hideDebugConsole');
Logging to browser console
If you want to log all Persoo messages to browser console, set the cookie "persooDebug" to true and reload page.
To set the cookie in browser console, run
document.cookie="persooDebug=true"
Persoo environments
To simplify workflow debugging, you can use different environments. Play with Persoo configuration in a test environment, and when you are happy with your changes, commit the configuration to the production environment.
Persoo tracks versions, so you can always roll back.
To change the environment you use in your browser, set the cookie "persooEnviroment". You can do it also by calling following function from browser console:
persoo('setEnvironment','yourEnvName'); // by the end of session persoo('setEnvironment','yourEnvName', 7); // for next 7 days var date = new Date("July 21, 2013 01:15:00") persoo('setEnvironment','yourEnvName', date ); // by given date persoo('unsetEnvironment') // set production environment
Use Persoo Admin for copying configuration among environments or for copying data of selected users from the production to a test environment.


Fractal Tree
Settings
Starting Length
Minimum Branch Length
Leaves On?
Left Branch
Branch Length Multiplier
Rotation Angle (degrees)
Right Branch
Branch Length Multiplier
Rotation Angle (degrees)
Regenerate Tree


Jail Types¶
iocage supports several different jail types:
Clone (default)
Basejail
Template
Empty
Thickjail
All jail types have specific benefits and drawbacks, serving a variety of unique needs. This section describes and has creation examples for each of these jail types.
Clone (default)¶
Clone jails are created with:
# iocage create -r 11.0-RELEASE
Clone jails are duplicated from the appropriate RELEASE at creation time. These consume a small amount of space, preserving only the changing data.
Basejail¶
The original basejail concept was based on nullfs mounts. It was popularized by ezjail, but iocage basejails are a little different. Basejails in iocage are mounts in a jail fstab that are mounted at jail startup.
Create a basejail by typing:
iocage create -r [RELEASE] -b
Basejails mount their fstab mounts at each startup. They are ideal for environments where immediate patching or upgrading of multiple jails is required.
Template¶
Template jails are customized jails used to quickly create further custom jails.
For example, after creating a jail, the user customizes that jail’s networking properties. Once satisfied, the user then changes the jail into a template with:
# iocage set template=yes examplejail
After this operation the jail is found in the templates list:
# iocage list -t
And new jails with the user customized networking can be created:
# iocage create -t examplejail -n newexamplejail
Template jails are convertable by setting the template= property.
Empty¶
Empty jails are intended for unsupported jail setups or testing. Create an empty jail with iocage create -e.
These are ideal for experimentation with unsupported RELEASES or Linux jails.
Thickjail¶
Thickjails jails are created with:
# iocage create -T -r 11.2-RELEASE
Thickjails are copied from the appropriate RELEASE at creation time. These consume a large amount of space, but are fully independent.
These are ideal for transmission or synchronization between different hosts with zfs send and zfs receive.


This page serves as a basic skeleton for tutorials such as those found at reelyactive.github.io.
Summarise the content in a few words using friendly terms.
Perhaps another sentence here as a more robust summary.
Sometimes there are prerequisites, sometimes there are not.
Summarise the step in a few words using friendly terms.
This is an example of a warning to the user.
Content goes here.
code
This is an example of some did-you-know info for the user.
Content goes here.
// This is <code> in a <pre> block
if(isMultipleLines) {
console.log('This can be handy as it respects code indentation nicely!');
}
Consider nav-tabs for steps where the user can choose between various options, or should repeat similar steps.
Content of the first tab.
Content of the second tab.
Content of the third tab.
It's based on Bootstrap 5 MIT and Font Awesome 5 (Free) MIT. Our Web Style Guide MIT has all the details. Sharing and feedback are encouraged!
reelyActive's Web Style GuideContinue exploring our open architecture and all its applications.


| Interface | Description |
|---|---|
| BlackVolatilityBondFutureProvider |
Data provider of volatility for bond future options in the lognormal or Black model.
|
| BondFutureProvider |
Data provider for for model parameters related to Bond futures and their options.
|
| Class | Description |
|---|---|
| AbstractBondFutureProductPricer |
Base pricer for bond futures.
|
| AbstractBondFutureTradePricer |
Base pricer for bond futures.
|
| BlackBondFutureOptionMarginedProductPricer |
Pricer of options on bond future with a lognormal model on the underlying future price.
|
| BlackBondFutureOptionMarginedTradePricer |
Pricer implementation for bond future option.
|
| BlackVolatilityExpLogMoneynessBondFutureProvider |
Data provider of volatility for bond future options in the log-normal or Black model.
|
| BlackVolatilityExpLogMoneynessBondFutureProvider.Builder |
The bean-builder for
BlackVolatilityExpLogMoneynessBondFutureProvider . |
| BlackVolatilityExpLogMoneynessBondFutureProvider.Meta |
The meta-bean for
BlackVolatilityExpLogMoneynessBondFutureProvider . |
| BondFutureOptionMarginedProductPricer |
Pricer for bond future option products with daily margin.
|
| BondFutureOptionMarginedTradePricer |
Pricer for bond future option trades with daily margin.
|
| BondFutureOptionSensitivity |
Point sensitivity to an implied volatility for a bond future option model.
|
| BondFutureOptionSensitivity.Meta |
The meta-bean for
BondFutureOptionSensitivity . |
| BondGroup |
Bond group.
|
| DiscountingBondFutureProductPricer |
Pricer for for bond future products.
|
| DiscountingBondFutureTradePricer |
Pricer implementation for bond future trades.
|
| DiscountingCapitalIndexedBondPaymentPeriodPricer |
Pricer implementation for bond payment periods based on a capital indexed coupon.
|
| DiscountingCapitalIndexedBondProductPricer |
Pricer for capital indexed bond products.
|
| DiscountingCapitalIndexedBondTradePricer |
Pricer for for capital index bond trades.
|
| DiscountingFixedCouponBondPaymentPeriodPricer |
Pricer implementation for bond payment periods based on a fixed coupon.
|
| DiscountingFixedCouponBondProductPricer |
Pricer for for rate fixed coupon bond products.
|
| DiscountingFixedCouponBondTradePricer |
Pricer for for rate fixed coupon bond trades.
|
| IssuerCurveDiscountFactors |
Provides access to discount factors for an issuer curve.
|
| IssuerCurveDiscountFactors.Meta |
The meta-bean for
IssuerCurveDiscountFactors . |
| IssuerCurveZeroRateSensitivity |
Point sensitivity to the issuer curve.
|
| IssuerCurveZeroRateSensitivity.Meta |
The meta-bean for
IssuerCurveZeroRateSensitivity . |
| LegalEntityDiscountingProvider |
The discounting factors provider, used to calculate analytic measures.
|
| LegalEntityDiscountingProvider.Builder |
The bean-builder for
LegalEntityDiscountingProvider . |
| LegalEntityDiscountingProvider.Meta |
The meta-bean for
LegalEntityDiscountingProvider . |
| LegalEntityGroup |
Legal entity group.
|
| RepoCurveDiscountFactors |
Provides access to discount factors for a repo curve.
|
| RepoCurveDiscountFactors.Meta |
The meta-bean for
RepoCurveDiscountFactors . |
| RepoCurveZeroRateSensitivity |
Point sensitivity to the repo curve.
|
| RepoCurveZeroRateSensitivity.Meta |
The meta-bean for
RepoCurveZeroRateSensitivity . |
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at opengamma.github.io/StrataDocs.


import os, configparser, logging
import pandas as pd
import subprocess
import knowledgebases as kbs
metricScales = {
"kappa": (-1, 1),
"accuracy": (0, 100),
"AUROC": (0,1),
"sensitivity": (0,1),
"specificity": (0,1),
"F1": (0,1),
"matthewcoef": (-1,1),
"precision": (0,1)
}
##### CONFIG #####
config = None
LOGGER_NAME = "Comprior"
[docs]def loadConfig(path):
"""Loads the config files.
:param path: absolute path or list of absolute paths to the config files. For multiple config files specifying the same parameters, the ones from the last config file in the list will be used.
:type path: str or list of str
"""
global config
config = configparser.ConfigParser()
config._interpolation = configparser.ExtendedInterpolation()
config.read(path)
#check dependencies
if int(getConfigValue("Gene Selection - General", "selectKgenes")) < int(getConfigValue("Evaluation", "topKmax")):
raise Exception("selectKgenes param in Gene Selection config is smaller than topKmax param from Evaluation (topKgenes must be >= topKmax). Stop here.")
[docs]def getConfig(category):
"""Get the config entries for a particular category.
:param category: category name.
:type category: str
:return: all parameters for that config category
:rtype: dict
"""
global config
return config[category]
[docs]def getConfigValue(category, identifier):
"""Get the value for a given config parameter.
:param category: the parameter's category name.
:type category: str
:param identifier: the parameter name.
:type identifier: str
:return: the parameter value.
:rtype: str
"""
global config
return config[category][identifier]
[docs]def getConfigBoolean(category, identifier):
"""Get the boolean value for a given config parameter.
:param category: the parameter's category name.
:type category: str
:param identifier: the parameter name.
:type identifier: str
:return: the parameter boolean value.
:rtype: bool
"""
global config
return config.getboolean(category, identifier)
##### FILE READING AND WRITING #####
[docs]def loadRanking(rankingFile):
"""Load a feature ranking from a file.
:param rankingFile: absolute path to the file containing a feature ranking.
:type rankingFile: str
:return: the feature ranking as a DataFrame.
:rtype: :class:`pandas.DataFrame`
"""
try:
ranking = pd.read_csv(rankingFile, sep = "\t")
except:
#in case ranking is empty, just create an empty dataframe
ranking = pd.DataFrame(columns = ["attribute", "score"])
return ranking
##### DIRECTORY MANAGEMENT #####
[docs]def createOrClearDirectory(directoryLocation):
"""If the provided directory location is already existing, remove all files in that directory.
Create a new directory otherwise.
:param directoryLocation: absolute path to the directory that must be cleared or created.
:type directoryLocation: str
"""
# create directory if not already existing
if not os.path.isdir(directoryLocation):
createDirectory(directoryLocation)
else:
for file in os.listdir(directoryLocation):
if file == ".gitignore":
continue
os.remove(os.path.join(directoryLocation,file))
[docs]def createDirectory(directoryLocation):
"""Creates a directory.
:param directoryLocation: absolute path to the directory to be created.
:type directoryLocation: str
"""
try:
os.makedirs(directoryLocation)
except:
return
[docs]def removeDirectoryContent(directoryLocation):
"""Remove the files inside a directory.
:param directoryLocation: absolute path to the directory that must be cleared.
:type directoryLocation: str
"""
try:
filelist = [f for f in os.listdir(directoryLocation)]
for f in filelist:
if f == ".gitignore":
continue
removeFile(directoryLocation + f)
except:
#no directory to delete
return
[docs]def removeFile(file):
"""Delete a file.
:param file: absolute path to the file that must be deleted.
:type file: str
"""
#try:
os.remove(file)
#except:
# return #No FILE to delete
#remove all intermediate and result files before running anything new
[docs]def cleanupResults():
"""Remove all intermediate files from former runs, e.g. generated during preprocessing or mapping.
"""
removeDirectoryContent(getConfigValue("General", "preprocessing"))
removeDirectoryContent(getConfigValue("General", "preprocessing") + "preprocessed/")
removeDirectoryContent(getConfigValue("General", "preprocessing") + "ready/")
removeDirectoryContent(getConfigValue("General", "crossVal_preprocessing") + "preprocessed/")
removeDirectoryContent(getConfigValue("General", "crossVal_preprocessing") + "ready/")
removeDirectoryContent(getConfigValue("General", "externalKbDir"))
removeDirectoryContent(getConfigValue("General", "intermediateDir") + "identifierMappings/")
removeDirectoryContent(getConfigValue("General", "intermediateDir"))
##### LOGGING #####
[docs]def createLogger(outputPath):
"""Create a logger for Comprior. Creates two handlers for this logger: one for console output that only contains high-level status update logs and error messages.
Warnings and other tracing information is written to an extra log file.
:param outputPath: absoulte path to where the log file will be stored.
:type outputPath: String
"""
FORMAT_STR = '%(asctime)s %(message)s'
LOG_FILE = outputPath + "/" + LOGGER_NAME + ".log"
#create logger and set default level to debug
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.setLevel(logging.DEBUG)
formatter = logging.Formatter(FORMAT_STR)
#add handler to write log to file at custom level
fh = logging.FileHandler(LOG_FILE)
fh.name = 'File Logger'
fh.level = logging.DEBUG
fh.formatter = formatter
LOGGER.addHandler(fh)
#add handler to write log to console output at custom level
ch = logging.StreamHandler()
ch.name = 'Console Logger'
ch.level = logging.WARNING
ch.formatter = formatter
LOGGER.addHandler(ch)
[docs]def logDebug(message):
"""Write a log at debug level.
:param message: the log message to print.
:type message: String
"""
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.debug(message)
[docs]def logInfo(message):
"""Write a log at info level.
:param message: the log message to print.
:type message: String
"""
#we do want to have the status updates in our console output but not the warnings, but info level is lower than warning level
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.critical(message)
[docs]def logWarning(message):
"""Write a log at warning level.
:param message: the log message to print.
:type message: String
"""
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.warning(message)
[docs]def logError(message):
"""Write a log at error level.
:param message: the log message to print.
:type message: String
"""
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.error(message)
[docs]def createTimeLog():
"""Create the data structure for tracing runtimes of feature selection approaches.
:return: the logging data structure.
:rtype: :class:`pandas.DataFrame`
"""
return pd.DataFrame(columns = ["Description", "Start", "End", "Duration"])
[docs]def flushTimeLog(timeLogs, outputFilePath):
"""Write the whole log (of runtimes) to a file.
:param timeLogs: the logs in a DataFrame.
:type timeLogs: :class:`pandas.DataFrame`
:param outputFilePath: absolute path to the log file.
:type outputFilePath: str
"""
timeLogs.to_csv(outputFilePath, index = False, sep = "\t")
[docs]def logRuntime(timeLogs, start, end, message):
"""Write a runtime log entry and add it to the runtime log data structure.
:param timeLogs: logs to which the new entry should be added
:type timeLogs: :class:`pandas.DataFrame`
:param start: starting time.
:type start: str
:param end: ending time.
:type end: str
:param message: description of that entry.
:type message: str
:return: updated logs.
:rtype: :class:`pandas.DataFrame`
"""
duration = end - start
log = pd.DataFrame(data = [[message, start, end, duration]], columns = ["Description", "Start", "End", "Duration"] )
return timeLogs.append(log, ignore_index = True)
##### R/JAVA CODE HANDLING #####
[docs]def runRCommand(rConfig, scriptName, params):
"""Run external R code.
:param rConfig: R config parameters (store paths to Rscript and the R code).
:type rConfig: dict
:param scriptName: name of the R script to be executed.
:type scriptName: str
:param params: list of parameters that will be forwarded to the R script.
:type params: list of str
"""
args = [rConfig["RscriptLocation"], scriptName]
args.extend(params)
logDebug("DEBUG: Invoking R script with command: " + " ".join(args))
p = subprocess.Popen(args, cwd=rConfig["code"], stdout=subprocess.PIPE, stderr = subprocess.PIPE)
out, err = p.communicate()
err = err.decode("utf-8")
out = out.decode("utf-8")
#make sure only the important messages are shown in the console output
if (err != ""):
if (("halt" in err) or ("Error" in err)):
logWarning("WARNING: Something went wrong in this R script: " + err)
else:
logDebug(err)
if (out != ""):
logDebug(out)
[docs]def runJavaCommand(javaConfig, scriptName, params):
"""Run external Java code.
:param javaConfig: java config parameters (store paths to java and the java code).
:type javaConfig: dict
:param scriptName: name of the jar to be executed.
:type scriptName: str
:param params: list of parameters that will be forwarded to the jar.
:type params: list of str
"""
args = [javaConfig["JavaLocation"], "-jar", javaConfig["code"] + scriptName]
args.extend(params)
logDebug("DEBUG: Invoking Java code with command: " + " ".join(args))
p = subprocess.Popen(args, cwd=javaConfig["code"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
err = err.decode("utf-8")
out = out.decode("utf-8")
if (err != ""):
if (("halt" in err) or ("Error" in err)):
logWarning("WARNING: Something went wrong in this R script: " + err)
else:
logDebug(err)
if (out != ""):
logDebug(out)
[docs]def mapIdentifiers(itemList, originalFormat, desiredFormat):
"""Write a log entry and add it to the log data structure.
:param itemList: list of identifiers, e.g. gene names, to be mapped
:type itemList: list of str
:param originalFormat: current format of the identifiers.
:type originalFormat: str
:param desiredFormat: desired format to which the identifiers should be mapped.
:type desiredFormat: str
:return: mapping table where every item from itemList is now mapped to desiredFormat.
:rtype: :class:`pandas.DataFrame`
"""
mapping = retrieveMappings(itemList, originalFormat, desiredFormat)
return mapping
[docs]def mapGeneList(genes, originalFormat, desiredFormat, outputFile):
"""Map a list of genes to the desired format.
:param genes: list of gene names to be mapped
:type genes: list of str
:param originalFormat: current format of the gene names.
:type originalFormat: str
:param desiredFormat: desired format to which the gene names should be mapped.
:type desiredFormat: str
:param outputFile: absolute path to the output file in which the mapping should be stored.
:type outputFile: str
:return: list of mapped gene names.
:rtype: list of str
"""
mapping = mapIdentifiers(genes, originalFormat, desiredFormat)
mapped_genes = mapping[desiredFormat]
mapped_genes.to_csv(outputFile)
return mapped_genes
[docs]def mapRanking(ranking, originalFormat, desiredFormat, outputFile):
"""Map the feature names of a ranking to the desired format.
:param ranking: DataFrame of the ranking.
:type ranking: :class:`pandas.DataFrame`
:param originalFormat: current format of the feature names in the ranking.
:type originalFormat: str
:param desiredFormat: desired format to which the feature names should be mapped.
:type desiredFormat: str
:param outputFile: absolute path to the output file in which the mapped feature ranking should be stored.
:type outputFile: str
:return: mapped feature ranking.
:rtype: :class:`pandas.DataFrame`
"""
first_col = ranking.columns[0]
items = list(ranking[first_col])
mapping = mapIdentifiers(items, originalFormat, desiredFormat)
mapped_ranking = mapping.merge(ranking, right_on=ranking.columns[0], left_on=originalFormat)
# sort by orderColumn, e.g. the score
mapped_ranking = mapped_ranking.sort_values(by="score", ascending=False)
# drop duplicate items (n:1, when two identifiers were mapped to the same name)
mapped_ranking = mapped_ranking.drop_duplicates(subset=[desiredFormat], keep="first")
# drop original attributeName column that contained probeset IDs
cols = list(mapped_ranking.columns)
cols.remove(cols[0])
cols.remove(cols[1])
mapped_ranking = mapped_ranking[cols]
# rename first column with new Gene IDs to have original column name
cols[0] = first_col
mapped_ranking.columns = cols
mapped_ranking.to_csv(outputFile)
return mapped_ranking
[docs]def retrieveMappings(itemList, originalFormat, desiredFormat):
"""Query the knowledge base to map the identifiers.
We have mapping via BiomaRt and gConvert available.
gConvert is currently used because BiomaRt is unstable and blocks when parallel queries are sent.
:param itemList: list of identifier names to be mapped
:type itemList: list of str
:param originalFormat: current format of the identifiers.
:type originalFormat: str
:param desiredFormat: desired format to which the identifiers should be mapped.
:type desiredFormat: str
:return: mapping table for all identifiers.
:rtype: :class:`pandas.DataFrame`
"""
# create directory and paths for mapped gene rankings
kbs_factory = kbs.KnowledgeBaseFactory()
mart = kbs_factory.createKnowledgeBase("gConvert")
# mart = kbs_factory.createKnowledgeBase("Biomart")
mapping = mart.mapItems(itemList, originalFormat, desiredFormat)
return mapping
[docs]def mapDataMatrix(inputMatrix, genesInColumns, originalFormat, desiredFormat, outputFile, labeled):
"""Map the features of a data set to the desired format.
:param inputMatrix: DataFrame of the ranking.
:type inputMatrix: :class:`pandas.DataFrame`
:param genesInColumns: if the genes/features are located in the columns.
:type genesInColumns: bool
:param originalFormat: current format of the feature names in the data set.
:type originalFormat: str
:param desiredFormat: desired format to which the feature names should be mapped.
:type desiredFormat: str
:param outputFile: absolute path to the output file in which the mapped data set should be stored.
:type outputFile: str
:param labeled: if the data matrix is additionally labeled.
:type labeled: bool
:return: mapped data set.
:rtype: :class:`pandas.DataFrame`
"""
if labeled:
items = list(inputMatrix.columns[1:])
labels = inputMatrix.iloc[:, 0]
else:
items = list(inputMatrix.columns)
mapping = mapIdentifiers(items, originalFormat, desiredFormat)
if genesInColumns:
# transpose matrix so that genes are in a single column that can be joined
matrix = inputMatrix.transpose()
mapped_matrix = mapping.merge(matrix, right_on=matrix.index, left_on=originalFormat)
# drop duplicates items (1:n; when one identifier was mapped to multiple names), as otherwise we introduce redundancy to the data
mapped_matrix = mapped_matrix.drop_duplicates(subset=[originalFormat], keep="first")
# drop duplicates items (n:1; when multiple identifier were mapped to the same name), as otherwise we have duplicate column names
mapped_matrix = mapped_matrix.drop_duplicates(subset=[desiredFormat], keep="first")
# drop original attributeName column that contained probeset IDs
mapped_matrix = mapped_matrix[mapped_matrix.columns[1:]]
mapped_matrix = mapped_matrix.set_index(desiredFormat)
final_matrix = mapped_matrix.transpose()
if labeled:
final_matrix = labels.to_frame().merge(final_matrix, left_index = True, right_index = True)
final_matrix.to_csv(outputFile)
return final_matrix


LETHAL WEAPON 4 (1998) A Film Review by Ted Prigge Copyright 1998 Ted Prigge
Director: Richard Donner Writer: Channing Gibson (story by Jonathan Lemkin, Alfred Gough, and Miles Millar) Starring: Mel Gibson, Danny Glover, Joe Pesci, Rene Russo, Chris Rock, Jet Li, Darlene Love, Traci Wolf, Ebonie Smith, Damon Hines
We have reached that stage called comfort. Those of you who've seen the other three "Lethal Weapon" films, that is, like me or my dad or a couple other people I know. We saw the first one on video or TV and we adored it so much that when the second one came out, we were there on opening night. We saw the third one opening night as well, and we've seen them all numerous times on tape and TV and whatnot. And judging by everything that has gone down in those films, there's honestly very little you can do with the series anymore. Sure, you could, I dunno, make Rene Russo and Mel Gibson's characters, who discovered an attraction between themselves in the previous episode, get married and have kids. Or continue the odyssey of Danny Glover's character's daughter from baby to wife and mother. But would those really hold an entire movie.
So why don't we just give them a throwaway plot that we cut to every now and then, introduce those elements that are there just to make the characters change a bit, and then just let the characters...live. Watching "Lethal Weapon 4" is almost like a really relaxing reunion for everyone who's been watching these films for the past decade, and who's just gotten used to the constant bickering of the two protagonists, and the numerous deadly follies they get into. I saw this film on opening night, filled with a crowd of people who no doubtedly had seen the other three and were just returning not because the movie's previews looked nice, but because it's yet another misadventure for a bunch of really likable characters that have grown on us.
Henceforth, "Lethal Weapon 4" is not so much a continuation of the series as it is a present for the fans, just to keep them smiling and laughing along with the characters. It's as if they all knew that the series would be pretty stale if they tried to make things fresh, so they gave up and just had fun with it. And watching this film is like watching flawless chemistry between actors and between the audience and what's on the screen. Those of us who've come to see this film because it's just another chance to see Riggs and Murtaugh (Mel Gibson and Danny Glover, still sharing flawless chemistry) laugh with eachother and their supporting character friends will most likely laugh right along with them.
The plot itself, as I said, is pretty thin, and seems to be a slight recycling from the sorta-forgettable anti-Asian Crichton novel and it's later film adaptation, "Rising Sun." It's something or other with Chinese Triad members, some people sold into a kind of modern slavery so they can live in America, and one really bad-ass guy named Wah Sing Ku, played by a guy named Jet Li, who acts with a cool distance and is able to do any acrobatic fight sequence that he reminds us of a wannabe Bruce Lee crossed with Jackie Chan. Anyways, it's basically just there to fill time, and, with the exception of promises of big, fun, over-the-top action sequences as well as some cool moves from Jet Li (or both), it's pretty much distracting from the real reason we've come to see this...
...and that's for the characters and what's going on with them. Things are constantly changing in their lives, and the film takes the time to show that Riggs and his now-pregnant girlfriend from the last film, Lorna Cole (Rene Russo) are actually considering marriage, and that Murtaugh's oldest daughter is really growing up as she's pregnant and actually hiding her marriage to a cocky police officer named Lee Butters (Chris Rock) a secret because Murtaugh doesn't want her marrying a cop. And Leo Getz is still there, although now he's a P.I. And, as an added bonus which is rarely revisited, Riggs and Murtaugh, out of desperation by the department to get them out of the streets without firing them, are promoted to Captain. The main new addition, taking in accordance with the others which added a member each installment (number 2 it was Pesci, number 3 it was Russo), is Butters, although he's unfortunately not really a major character, at least not as major a character as Getz and Cole were when they were introduced. He's mainly there to give the film a new area of attraction since he's mighty hot right now (and with good reason - he's hilarious, though he's only allowed to use his hilarious style a couple times).
But we also come to see the action sequences, which in this film are numerous and always crazy. This is where the films always differ, and what makes this film a bit inferior to the other three. Those films took their action sequenes rather seriously, and their plots were handled as a kind of contrast to the hilarity the film had in the downtime. Sure, they were witty and over-the-top, but the ones in this movie, at least some of them, are almost annoyingly campy. The finale, a huge silent fight between Riggs, Murtaugh, and Li is a long, totally proposterous sequence that ends satisfyingly...sorta. And after awhile, they get a bit tiresome. The only sequence which really becomes memorable is one in the middle involving a car chase and a truck dragging Riggs on a table across a highway that is so over-the-top that it's brilliantly enigmatic. It's also so goofy and hilarious that when it was over, the entire audience, who was in stitches by the last crash, gave it a hearty applaud.
If anything, this film is disappointing in that it's plot is weak, flimsy, and basically just there to kill time, something that the plots in the other films weren't. We were able to really get a big kick out of the action sequences, and were always in awe of the plots and their numerous villains. Remember how amazingly tense the first one got then how it could effortlessly shift to comedy (same for the second)? None of that here - it's all on autopilot. But with a nice sugar coating of lots of character comedy that is basically only humerous to those who've lived with the characters for so long, this film actually comes off as being sucessful. It's all because this film comes as the fourth in the series, and we've found them at a point when it's not even about the plot or the money: it's about just getting back together and making a movie they can have fun with. And it's about us just coming back because we feel like we're all part of their extended family. And basically we are.
MY RATING (out of 4): ***
Homepage at: http://www.geocities.com/Hollywood/Hills/8335/
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