3.00
32.25
132.99
10.5.a setindex element rules
When you activate the Set index To -1 trigger you must see an xforms-scroll-first message
and the index must display the number 1.
When you activate the Set index To 100 trigger you must see an xforms-scroll-last message
and the index must display the number 3.
When you activate the Set index To 2 trigger you must not see a message
and the index must display the number 2.
Price:
Name:
xforms-scroll-first
xforms-scroll-last
Set index To -1
Set index To 100
Set index To 2
index :


Fed's Kashkari sees continued U.S. growth, but big risk from trade
by Reuters(Reuters) - The U.S. consumer is strong, and despite a decline in investment by businesses worried about the future and uncertain trade policy, the economy as a whole is likely to continue to grow, a U.S. central banker said on Thursday.
"Right now overall my base case scenario is continued economic growth - I'm not forecasting recession," Minneapolis Fed President Neel Kashkari said at the Minnesota Chamber of Commerce. "But there are risks on the horizon, the biggest risks being around tariffs and trade and the uncertainty that creates."


I had been smoking cannabis for about 5 years at the time of these Ďtripsí so I regarded myself as experienced, but what happened totally blew me away and has totally changed the way I think of this plant of the gods.
The first of the 3 times this happened, I had just sat down after a hard night of cruising around town. I had walked approximately 6 miles since about 6:30 p.m., and the time was now 11:30. As I inhaled the magical cloud of smoke from my trusty double-chambered bong, I had to stop after pulling only 3/4 of the cone, as I felt a strange tingle in the back of my throat that I wasn't used to. As I expelled the smoke from my lungs, I had difficulty blowing out the last bit of smoke. This was strange for me as I have an unusually large lung capacity.
I rested for a second, taking a few deep breaths, still resting the bong on my knee.  As I stared, my body became more relaxed and my breathing became shallow. The last thing I could remember was the music (trance, I think it was) intensifying greatly. The next thing I remember was my buddy Captain K, who was sitting opposite me yelling out my name and asking me what the hell I was doing. I looked down at him, as my eyes had been focused on the brick wall above his head. He pointed to my lap and I looked down to see the bong had fallen over and I was totally drenched in 3-day old bong water.
The thing was that I thought the water would have been substantial enough to wake me up, but I didn't even feel it. Also, every inch of my skin was tingling as if a small charge of electricity was passing over it. As I came fully back into reality, I gasped, desperate for air, as my shallow breathing had starved my brain of oxygen. My body was totally drained of all energy, as I stumbled to my feet, and walked about 3 feet and collapsed on the sofa, still drenched in bong water. Captain K later told me what had happened physically, as I had no recollection. He said the whole thing lasted about 40-60 seconds. While I stared at the wall, in an almost trance-like state, without my knowledge, my eyelids had begun fluttering profusely. He said he thought I was joking and kicked me playfully, but still hard enough leave a red mark.
I came out of this first experience hungry for knowledge of what had happened in my head that night, as I somehow knew something phenomenal had happened.
The next trip I had into the unknown happened the following week. I was in the same setting but with a different friend, Mr. G.
I jokingly said to him to grab the bong off me if it looks like Iím gonna drop it. As I toked on that water-pipe of wisdom, I felt the same tickle in the back of my throat that I had the previous time, so I had to stop and expel the smoke out of my lungs before I choked. After blowing the smoke out, my body automatically relaxed and my eyes became tired as I focused on the coffee table in front of me, the bong still resting on my leg.
What I can remember was that my vision quickly turned white and then to nothing. After about 1 minute (which strangely felt like hours to me) of Mr. G laughing at me, as he thought I was faking, I slowly began to come back to earth, but still looking back at my body from this different plane of existence. For the first time in my life I thought I knew what insanity felt like. It was the ultimate feeling of helplessness, as I couldnít escape this feeling. In fact I couldnít move despite my fruitful efforts.
My vision was down to tunnel vision with the only thoughts going through my head being the insanity query and wondering where this place is. My mind had no knowledge of me, my history, the world, nothing. I was living the moment there and then with no knowledge of the past and no thoughts for the future.
After about a minute of this, my buddy Mr. G kicked me in the shin and roused me. Luckily, he had removed the bong from my grasp as soon as I began to loosen my grip early in the trip.
Like the first trip, I gasped for air due to my shallow breathing, and I was physically absolutely stuffed and needed to lie down again to regain some energy.
Mr.
I was a bit wary about smoking now, since I had tripped out the last 2 times.
The next weekend I was back smoking in the same room with Captain K. I toked up and quickly put the bong out of kicking distance and began to relax, as expelling the smoke from my lungs was quite difficult as the tickle at the back of my throat was present.
As I oozed back into my seat, my mind became clear of all thoughts and my vision started to whiten from the middle of my point of view outwards. My hands were beside me as I was sitting down, and without my knowledge, I turned them over and extended my fingers towards the heavens as if I was trying to bring forth something upon myself. As this was happening, my head tilted back to about a 45-degree angle, so I was gazing upwards as well as my fingers pointing skywards. My eyes were fluttering profusely once again. Captain K just sat there in awe as I astral-travelled before his very eyes. He said I actually took on a different appearance as I was in this trance like state. I didnít look like myself; in fact he barely recognised me.
While these were all the physical symptoms of my trip, a hell of a lot more was happening mentally. The first part of the experience was shrouded in mist, so all I could remember was the last 20 or so seconds of it.
Though my body was fixed firmly to the seat, my mind wasnít there. I was out travelling around through different time-dimensions with extreme clarity. One part of the experience that is permanently implanted in my brain was one incident that Iím not entirely sure isn't some sort of pseudo-memory or repressed memory, as it felt so real. My mind went back to when I was 6 and I was lying in front of my television staring at the roof. It was like all the memories that Iíve built since I was 6 had been deleted but all the intelligence Iíve gained was still there.
Well, as I stared at the roof I realised that I couldnít move and I was transfixed on the spot Ė like the previous two incidents, but years before and under the influence of no drugs.
I could see the television in the bottom of my view and I felt the presence of someone behind me sitting on the couch.
As I started to hear Captain K talking to me to my right, I began to come out of the trance. The roof I was looking at and the television morphed into a wall and disco ball in Captain Kís house.

These three experiences have to be some of the strangest experiences Iíve had in my short life.
Most of what happened just canít be explained. It was just that alien to my human mind. The brew of emotions and feelings cannot be explained because the human language has yet to conjure up words to describe such extraterrestrial feelings.
Well, that just about sums it up. I hope this provided an enjoyable read for people, as the experience totally blew me out of the water and changed the way I view the world, cannabis and the workings of the mind.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 3000 |
| Trasmission | Automatic |
| Exterior | White |
| Fuel | Diesel |
| Drive | 4 Wheel Drive |
| Price | 3,050,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2015 |
| Engine Size | 3200 |
| Transmission | Automatic |
| Exterior | White |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 5,460,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2015 |
| Engine Size | 3000 |
| Transmission | Automatic |
| Exterior | Grey |
| Fuel | Diesel |
| Drive | 4 Wheel Drive |
| Price | 4,650,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2016 |
| Engine Size | 2000 |
| Transmission | Automatic |
| Exterior | Blue |
| Fuel | Petrol |
| Drive | 2 Wheel Drive |
| Price | 2,550,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 2000 |
| Transmission | Automatic |
| Exterior | Blue |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 3,450,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2013 |
| Engine Size | 3000 |
| Transmission | Automatic |
| Exterior | White |
| Fuel | Diesel |
| Drive | 4 Wheel Drive |
| Price | 2,580,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2015 |
| Engine Size | 2000 |
| Transmission | Automatic |
| Exterior | White |
| Fuel | Petrol |
| Drive | 2 Wheel Drive |
| Price | 2,050,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 3000 |
| Transmission | Automatic |
| Exterior | Black |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 13,500,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 2000 |
| Transmission | Automatic |
| Exterior | Dark Grey |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 2,080,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 3000 |
| Transmission | Automatic |
| Exterior | Red |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 3,280,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 1400 |
| Transmission | Automatic |
| Exterior | White |
| Fuel | Petrol |
| Drive | 2 Wheel Drive |
| Price | 1,550,000 |
| DETAILS | DESCRIPTION |
|---|---|
| Year | 2014 |
| Engine Size | 1400 |
| Transmission | Automatic |
| Exterior | Gold |
| Fuel | Petrol |
| Drive | 4 Wheel Drive |
| Price | 2,600,000 |


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object coins.ir.hir.SubsPtrTransformation
SubsPtrTransformation Array subscript (Subs) expression to pointer expression transformation and vice versa.
| Field Summary | |
protected int |
fDbgLevel
|
(package private) HirRoot |
hirRoot
|
(package private) IoRoot |
ioRoot
|
(package private) SymRoot |
symRoot
|
| Constructor Summary | |
SubsPtrTransformation(HirRoot pHirRoot)
Constructor to prepare for transformation |
| Method Summary | |
java.util.ArrayList |
listUpPtrNodes(HIR pHir)
listUpPtrNodes |
java.util.ArrayList |
listUpSubsNodes(HIR pHir)
listUpSubsNodes Make an array-list of Subs nodes in pHir in the order of pre-visiting depth-first order. |
boolean |
ptrToSubsTransformation(HIR pHir,
java.util.Map pPtrSubsCorrespondence)
ptrToSubsTrasnsformation Transform pointer expression in pHir to subscript expression if the pointer expression is recorded in pPtrSubsCorrespondence or it is an expression representing simple subscripted expression. |
boolean |
subsToPtrTrasnsformation(HIR pHir,
java.util.Map pPtrSubsCorrespondence)
subsToPtrTrasnsformation Transform subscripted expression in pHir to pointer expression and record its correspondence to pPtrSubsCorrespondence. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
IoRoot ioRoot
HirRoot hirRoot
SymRoot symRoot
protected final int fDbgLevel
| Constructor Detail |
public SubsPtrTransformation(HirRoot pHirRoot)
pHirRoot
- HirRoot instance to be recorded.| Method Detail |
public java.util.ArrayList listUpSubsNodes(HIR pHir)
pHir
- the subtree to be searched (usually HIR-body
of subprogram).
public boolean subsToPtrTrasnsformation(HIR pHir, java.util.Map pPtrSubsCorrespondence)
pHir
- HIR subtree to be transformed.pPtrSubsCorrespondence
- record the Subs-Ptr correspondence.
public boolean ptrToSubsTransformation(HIR pHir, java.util.Map pPtrSubsCorrespondence)
pHir
- HIR subtree to be transformed.pPtrSubsCorrespondence
- show the Subs-Ptr correspondence.
public java.util.ArrayList listUpPtrNodes(HIR pHir)
Make an array-list of pointer expressions taking the form (contents (add (decay ) (exp ) ) ) in pHir in the order of pre-visiting depth-first order.
pHir
- the subtree to be searched (usually HIR-body
of subprogram).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


--- layout: post title: "Laniakea unscheduled maintenance" subtitle: "Problems with Cloud Storage" date: 2021-05-19 006:00:00 -0400 background: '/img/posts/all_systems_go.jpg' ---
Dear Users,
due to some issues with the storage on our Cloud site, it is not possible to deploy Galaxy, currently.
We are working hard to fix the problem.
Thanks a lot for your understanding.
The Laniakea team.


Report a Bug
Have you found a bug or mistake on Genki Study Resources or just want to submit general feedback? If so, you can let us know by opening a new issue! Please read the information provided below to learn how to submit your report or feedback.
Note: We utilize GitHub's "Issues" tracker to collect user feedback. If you're not familiar with this system you can read about it here. A GitHub account is required to submit new issues. If you don't have one you can register an account here (optional, see contact methods for alternatives).
Quick Navigation
Reporting a Technical Bug
Is Genki Study Resources not working properly on your system? If so, please select your preferred contact method and provide the following information.
- Description of the bug
- Steps to replicate the bug (if possible)
- Browser(s) the bug occurred in
- Operating System
- Were you using the Online or Offline version?
Note: If you are able to fix the bug you may submit the fix as a pull request instead.
We want to make sure that GSR functions properly for everyone, so we greatly appreciate your report and will try to resolve your issue as soon as humanly possible!
Contact Methods
Reporting a Mistake
Have you noticed a mistake on Genki Study Resources, such as a spelling error or erroneous answer? If so, please select your preferred contact method and provide the following information.
- Link to the page that contains the mistake(s)
- Erroneous content
- Correction of the content
Note: If you like, you can fix the mistake yourself and submit the correction as a pull request instead.
We want to make sure that students receive accurate information, so we greatly appreciate your help in ensuring that!
Contact Methods
Dictionary Reports
Is the dictionary missing a definition you tried to search or is the definition you looked up incorrect? If so, please select your preferred contact method and provide the following information.
For typos/mistakes
- incorrect definition
- corrected definition
Note: If you like, you can fix the mistake yourself and submit the correction as a pull request instead.
For dictionary additions
- new definition
- lesson/exercise where you encountered the definition
Note: If you like, you can add the definition yourself and submit it as pull request instead. Please refer to the definition syntax at the top of jisho.js.
Contact Methods
General Feedback
Does your query not meet the conditions listed above? No problem, we'd still love to hear from you! If you have a suggestion, complaint, or comment, feel free to open a new Discussion on GitHub or contact me on Reddit/Twitter.
- Open a new Discussion on GitHub (requires GitHub account)
- PM me on Reddit
- DM me on Twitter
Any and all feedback is appreciated; we look forward to hearing from you!


Prince Harry, young Archie send good-luck message to England
by EndPlay
TOKYO (AP) - Britain's Royal Family is getting excited about England's appearance in the Rugby World Cup final - even its most recent arrival.
Prince Harry has sent a message of support to the England squad ahead of their title match against South Africa in Yokohama on Saturday.
Included in the message was a photo of the prince's 5-month-old son, Archie, in an England jersey.
"A nice touch," England flanker Sam Underhill said Friday.
Harry is a long-standing England fan and a patron of the Rugby Football Union. He will be attending the final this weekend.
___
More AP Rugby World Cup: https://www.apnews.com/RugbyWorldCup and https://twitter.com/AP_Sports


We Provide The Best Food
At The Right Price
Happy Hour
Party Time
If you're out, and starving, and need a bite to eat, then you need fast food. Come to Anita's and we got you covered with a wide range of options to choose from.
VIEW GALLERY →
Lorem ipsum dolor sit amet consectetur adipisicing elit.  Nostrum!
VIEW GALLERY →
Great food! Menu is awesome their food are not only awesome but also in the right price. I'll highly recommend them :)


|
| The following discussion is part of a freely available public domain
AVL tree library written in C++. The full C++ source code distribution may be found in AvlTrees.tar.gz
(21KB, gzipped tar file).[a plain old K&R C version is available in libavl.tar.gz
(25KB, gzipped tar file)] |
An AVL tree is a binary tree in which the difference between the height of the right and left subtrees (or the root node) is never more than one.
The idea behind maintaining the "AVL-ness" of an AVL tree is that whenever we insert or delete an item, if we have "violated" the "AVL-ness" of the tree in anyway, we must then restore it by performing a set of manipulations (called "rotations") on the tree. These rotations come in two flavors: single rotations and double rotations (and each flavor has its corresponding "left" and "right" versions).
An example of a single rotation is as follows: Suppose I have a tree that looks like this:
c / b
Now I insert the item "a" and get the resulting binary tree:
c / b / a
Now, this resulting tree violates the "AVL criteria", the left subtree has a height of 2 but the right subtree has a height of 0 so the difference in the two heights is "2" (which is greater than 1). SO what we do is perform a "single rotation" (or RR for a single right rotation, or LL for a single left rotation) on the tree (by rotating the "c" element down clockwise to the right) to transform it into the following tree:
b / \ a c
This tree is now balanced.
An example of a "double rotation" (or RL for a double right rotation, or LR for a double left rotation) is the following: Suppose I have a tree that looks like this:
a \ c
Now I insert the item "b" and get the resulting binary tree:
a \ c / b
This resulting tree also violates the "AVL criteria" so we fix it by first rotating "c" down to the right (so we get "a-b-c"), and then rotating "a" down to the left so that the tree is transformed into this:
b / \ a c
In order to detect when a "violation" of the AVL criteria occurs we need to have each node keep track of the difference in height between its right and left subtrees. We call this "difference" the "balance" factor and define it to be the height of the right subtree minus the height of the left subtree of a tree. So as long as the "balance" factor of each node is never >1 or <-1 we have an AVL tree. As soon as the balance factor of a node becomes 2 (or -2) we need to perform one or more rotations to ensure that the resultant tree satisfies the AVL criteria.
// cmp_t is an enumeration type indicating the result of a // comparison. enum cmp_t { MIN_CMP = -1, // less than EQ_CMP = 0, // equal to MAX_CMP = 1 // greater than }; // Class "Comparable" corresponds to an arbitrary comparable element // with a keyfield that has an ordering relation. The template parameter // KeyType is the "type" of the keyfield // template <class KeyType> class Comparable { private: KeyType myKey; public: Comparable(KeyType key) : myKey(key) {}; // Use default copy-ctor, assignment, & destructor // Compare this item against the given key & return the result cmp_t Compare(KeyType key) const; // Get the key-field of an item KeyType Key() const { return myKey; } };
Like the "Comparable" class, our AVL tree will also be a template class parameterized by a KeyType:
// Class AvlNode represents a node in an AVL tree. The template parameter // KeyType is the "type" of the keyfield // template <class KeyType> class AvlNode { private: Comparable<KeyType> * myData; // Data field AvlNode<KeyType> * mySubtree[2]; // Subtree pointers short myBal; // Balance factor // ... many details omitted };
A B / \ / \ / \ / \ a B ==> A c / \ / \ / \ / \ b c a b
The left is what the tree looked like BEFORE the rotation and the right is what the tree looks like after the rotation. Capital letters are used to denote single nodes and lowercase letters are used to denote subtrees.
The "balance" of a tree is the height of its right subtree less the height of its left subtree. Therefore, we can calculate the new balances of "A" and "B" as follows (ht is the height function):
NewBal(A) = ht(b) - ht(a) OldBal(A) = ht(B) - ht(a) = ( 1 + max (ht(b), ht(c)) ) - ht(a)
subtracting the second equation from the first yields:
NewBal(A) - OldBal(A) = ht(b) - ( 1 + max (ht(b), ht(c)) ) + ht(a) - ht(a)
canceling out the ht(a) terms and adding OldBal(A) to both sides yields:
NewBal(A) = OldBal(A) - 1 - (max (ht(b), ht(c)) - ht(b) )
Noting that max(x, y) - z = max(x-z, y-z), we get:
NewBal(A) = OldBal(A) - 1 - (max (ht(b) - ht(b), ht(c) - ht(b)) )
But ht(c) - ht(b) is OldBal(B) so we get:
NewBal(A) = OldBal(A) - 1 - (max (0, OldBal(B)) ) = OldBal(A) - 1 - max (0, OldBal(B))
Thus, for A, we get the equation:
NewBal(A) = OldBal(A) - 1 - max (0, OldBal(B))
To calculate the Balance for B we perform a similar computation:
NewBal(B) = ht(c) - ht(A) = ht(c) - (1 + max(ht(a), ht(b)) ) OldBal(B) = ht(c) - ht(b)
subtracting the second equation from the first yields:
NewBal(B) - OldBal(B) = ht(c) - ht(c) + ht(b) - (1 + max(ht(a), ht(b)) )
canceling, and adding OldBal(B) to both sides gives:
NewBal(B) = OldBal(B) - 1 - (max(ht(a), ht(b)) - ht(b)) = OldBal(B) - 1 - (max(ht(a) - ht(b), ht(b) - ht(b))
But ht(a) - ht(b) is - (ht(b) - ht(a)) = -NewBal(A), so ...
NewBal(B) = OldBal(B) - 1 - max( -NewBal(A), 0)
Using the fact that min(x,y) = -max(-x, -y) we get:
NewBal(B) = OldBal(B) - 1 + min( NewBal(A), 0)
So, for a single left rotation we have shown the the new balances for the nodes A and B are given by the following equations:
NewBal(A) = OldBal(A) - 1 - max(OldBal(B), 0) NewBal(B) = OldBal(B) - 1 + min(NewBal(A), 0)
Now let us look at the case of a single right rotation. The case we will use is the same one we used for the single left rotation only with all the left and right subtrees switched around so that we have the mirror image of the case we used for our left rotation.
A B / \ / \ / \ / \ B a ==> c A / \ / \ / \ / \ c b b a
If we perform the same calculations that we made for the left rotation, we will see that the new balances for a single right rotation are given by the following equations:
NewBal(A) = OldBal(A) + 1 - min(OldBal(B), 0) NewBal(B) = OldBal(B) + 1 + max(NewBal(A), 0)
Hence, C++ code for single left and right rotations would be:
// Indices into a subtree array enum dir_t { LEFT = 0, RIGHT = 1 }; // Return the minumum of two numbers inline int MIN(int a, int b) { return (a < b) ? a : b; } // Return the maximum of two numbers inline int MAX(int a, int b) { return (a > b) ? a : b; } // Note that RotateLeft and RotateRight are *static* member // functions because otherwise they would have to re-assign // to the "this" pointer. template <class KeyType> void AvlNode<KeyType>::RotateLeft(AvlNode<KeyType> * & root) { AvlNode<KeyType> * oldRoot = root; // perform rotation root = root->mySubtree[RIGHT]; oldRoot->mySubtree[RIGHT] = root->mySubtree[LEFT]; root->mySubtree[LEFT] = oldRoot; // update balances oldRoot->myBal -= (1 + MAX(root->myBal, 0)); root->myBal -= (1 - MIN(oldRoot->myBal, 0)); } template <class KeyType> void AvlNode<KeyType>::RotateRight(AvlNode<KeyType> * & root) { AvlNode<KeyType> * oldRoot = root; // perform rotation root = root->mySubtree[LEFT]; oldRoot->mySubtree[LEFT] = root->mySubtree[RIGHT]; root->mySubtree[RIGHT] = oldRoot; // update balances oldRoot->myBal += (1 - MIN(root->myBal, 0)); root->myBal += (1 + MAX(oldRoot->myBal, 0)); }
We can make this code more compact however by using only ONE rotate method which takes an additional parameter: the direction in which to rotate. Notice that I have defined LEFT, and RIGHT to be mnemonic constants to index into an array of subtrees. I can pass the constant LEFT or RIGHT to the rotation method and it can calculate the direction opposite the given direction by subtracting the given direction from the number one.
It does not matter whether LEFT is 0 or RIGHT is 0 as long as one of them is 0 and the other is 1. If this is the case, then:
1 - LEFT = RIGHT
and
1 - RIGHT = LEFT
Using this and the same type definitions as before (and the same inline functions), the C++ code for a single rotation becomes:
inline dir_t Opposite(dir_t dir) { return dir_t(1 - int(dir)); } // RotateOnce -- static member function that performs a single // rotation for the given direction. // template <class KeyType> void AvlNode<KeyType>::RotateOnce(AvlNode<KeyType> * & root, dir_t dir) { AvlNode<KeyType> * oldRoot = root; dir_t otherDir = Opposite(dir); // rotate root = tree->mySubtree[otherDir]; oldRoot->mySubtree[otherDir] = tree->mySubtree[dir]; root->mySubtree[dir] = oldRoot; // update balances if (dir == LEFT) { oldRoot->myBal -= (1 + MAX(root->myBal, 0)); root->myBal -= (1 - MIN(oldRoot->myBal, 0)); } else /* dir == RIGHT */ { oldRoot->myBal += (1 - MIN(root->myBal, 0) ); root->myBal += (1 + MAX(oldRoot->myBal, 0)); } //else }
We can compact this code even further if we play around with the equations for updating the balances. Let us use the fact that max(x,y) = -min(-x,-y):
oldRoot->myBal -= (1 + MAX(tree->myBal, 0)); tree->myBal -= (1 - MIN(oldRoot->myBal, 0)); |
oldRoot->myBal += (1 - MIN(tree->myBal, 0)); tree->myBal += (1 + MAX(oldRoot->myBal, 0)); |
Using the above rule to change all occurrences of "MIN" to "MAX" these equations become:
oldRoot->myBal -= (1 + MAX( +(tree->myBal), 0)); tree->myBal -= (1 + MAX( -(oldRoot->myBal), 0)); |
oldRoot->myBal += (1 + MAX( -(tree->myBal), 0)); tree->myBal += (1 + MAX( +(oldRoot->myBal), 0)); |
Note that the difference between updating the balances for our right and left rotations is only the occurrence of a '+' where we would like to see a '-' in the assignment operator, and the sign of the first argument to the MAX function. If we had a function that would map LEFT to +1 and RIGHT to -1 we could multiply by the result of that function to update our balances. Such a function is
f(x) = 1 - 2x
"f" maps 0 to 1 and maps 1 to -1. This function will not map LEFT and RIGHT to the same value regardless of which is 1 and which is 0 however. If we wish our function to have this property then we can multiply (1 - 2x) by (RIGHT - LEFT) so that the result "switches" signs accordingly depending upon whether LEFT is 0 or RIGHT is 0. This defines a new function "g":
g(x) = (1 - 2x)(RIGHT - LEFT)
If LEFT = 0 and RIGHT = 1 then:
g(LEFT) = (1 - 2*0)(1 - 0) = 1*1 = 1 g(RIGHT) = (1 - 2*1)(1 - 0) = (-1)*1 = -1
If LEFT = 1 and RIGHT = 0 then:
g(LEFT) = (1 - 2*1)(0 - 1) = (-1)*(-1) = 1 g(RIGHT) = (1 - 2*0)(0 - 1) = 1*(-1) = -1
So, as desired, the function "g" maps LEFT to +1 and RIGHT to -1 regardless of which is 0 and which is 1.
Now, if we introduce a new variable called "factor" and assign it the value "g(dir)", we may update the balances in our rotation method without using a conditional statement:
oldRoot->myBal -= factor * (1 + MAX(factor * tree->myBal, 0)); tree->myBal += factor * (1 + MAX(factor * oldRoot->myBal, 0)); |
Using this, the new code for our rotation method becomes:
// RotateOnce -- static member function that performs a single // rotation for the given direction. // Return 1 if the tree height changes due to rotation, // otherwise return 0. // template <class KeyType> void AvlNode<KeyType>::RotateOnce(AvlNode<KeyType> * & root, dir_t dir) { AvlNode<KeyType> * oldRoot = root; dir_t otherDir = Opposite(dir); short factor = (RIGHT - LEFT) * (1 - (2 * dir)); // rotate root = tree->mySubtree[otherDir]; oldRoot->mySubtree[otherDir] = tree->mySubtree[dir]; root->mySubtree[dir] = oldRoot; // update balances oldRoot->myBal -= factor * (1 + MAX(factor * root->myBal, 0)); root->myBal += factor * (1 + MAX(factor * oldRoot->myBal, 0)); }
However, although this second version of "rotate" is more compact and doesn't require the use of a conditional test on the variable "dir", It may actually run slower than our first version of "rotate" because the time required to make the "test" may well be less than the time required to perform the additional multiplications and subtractions.
Now a double rotation can be implemented as a series of single rotations:
// RotateTwice -- static member function to rotate a given node // for the given direction and then the opposite // direction to restore the balance of an AVL tree // Return 1 if the tree height changes due to rotation, // otherwise return 0. // template <class KeyType> void AvlNode<KeyType>::RotateTwice(AvlNode<KeyType> * & root, dir_t dir) { dir_t otherDir = Opposite(dir); RotateOnce(root->mySubtree[otherDir], otherDir); RotateOnce(root, dir); }
For a single LL rotation we have one of two possibilities:
A B / \ / \ / \ / \ a B ==> A c / \ / \ / \ / \ b c a b
| Before Rotation | After Rotation | ||||
|---|---|---|---|---|---|
| case 1: | A = +2 | B = +1 | A = 0 | B = 0 | |
| case 2: | A = +2 | B = 0 | A = +1 | B = -1 |
so in either case NewB = OldB -1 and newA = -newB so we get A = - (--B) for a single left rotation.
For a single RR rotation the possibilities are (The picture is a mirror image of the LL one -- swap all right and left kids of each node)
| Before Rotation | After Rotation | ||||
|---|---|---|---|---|---|
| case 1: | A = -2 | B = -1 | A = 0 | B = 0 | |
| case 2: | A = -2 | B = 0 | A = -1 | B = +1 |
so in either case NewB = OldB +1 and newA = -newB so we get A = - (++B) for a single left rotation.
This means that we can use the following to update balances:
// Use mnemonic constants for indicating a change in height enum height_effect_t { HEIGHT_NOCHANGE = 0, HEIGHT_CHANGE = 1 }; // RotateOnce -- static member function that performs a single // rotation for the given direction. // Return 1 if the tree height changes due to rotation, // otherwise return 0. // template <class KeyType> int AvlNode<KeyType>::RotateOnce(AvlNode<KeyType> * & root, dir_t dir) { dir_t otherDir = Opposite(dir); AvlNode<KeyType> * oldRoot = root; // See if otherDir subtree is balanced. If it is, then this // rotation will *not* change the overall tree height. // Otherwise, this rotation will shorten the tree height. int heightChange = (root->mySubtree[otherDir]->myBal == 0) ? HEIGHT_NOCHANGE : HEIGHT_CHANGE; // assign new root root = oldRoot->mySubtree[otherDir]; // new-root exchanges it's "dir" subtree for it's parent oldRoot->mySubtree[otherDir] = root->mySubtree[dir]; root->mySubtree[dir] = oldRoot; // update balances oldRoot->myBal = -((dir == LEFT) ? --(root->myBal) : ++(root->myBal)); return heightChange; }
We get an even nicer scenario when we look at LR and RL rotations. For a double LR rotation we have one of three possibilities:
A B / \ / \ / \ / \ a C ==> A C / \ / \ / \ / \ / | | \ B c a b1 b2 c / \ / \ b1 b2
| Before Rotation | After Rotation | ||||||
|---|---|---|---|---|---|---|---|
| case 1: | A = +2 | B = +1 | C = -1 | A = -1 | B = 0 | C = 0 | |
| case 2: | A = +2 | B = 0 | C = -1 | A = 0 | B = 0 | C = 0 | |
| case 3: | A = +2 | B = -1 | C = -1 | A = 0 | B = 0 | C = +1 |
So we get, in all three cases:
newA = -max( oldB, 0 ) newC = -min( oldB, 0 ) newB = 0
Now for a double RL rotation we have the following possibilities (again, the picture is the mirror image of the LR case):
| Before Rotation | After Rotation | ||||||
|---|---|---|---|---|---|---|---|
| case 1: | A = -2 | B = +1 | C = +1 | A = 0 | B = 0 | C = -1 | |
| case 2: | A = -2 | B = 0 | C = +1 | A = 0 | B = 0 | C = 0 | |
| case 3: | A = -2 | B = -1 | C = +1 | A = +1 | B = 0 | C = 0 |
So we get, in all three cases:
newA = -min( oldB, 0 ) newC = -max( oldB, 0 ) newB = 0
This is exactly the mirror image of what we had for the
LR case: The nodes A
and C
in the newly rotated
result simply exchanged balance factors with one another between the RL
case and the LR case. What this means is that in each case, the new balance
factor of the new left subtree is the same, and the new balance factor
of the new right subtree is the same:
new(left) = -max( oldB, 0 ) new(right) = -min( oldB, 0 ) new(root) = 0
So now we can write the code for a double rotation as follows:
// RotateTwice -- static member function to rotate a given node // twice for the given direction in order to // restore the balance of an AVL tree. // Return 1 if the tree height changes due to rotation, // otherwise return 0. // template <class KeyType> int AvlNode<KeyType>::RotateTwice(AvlNode<KeyType> * & root, dir_t dir) { dir_t otherDir = Opposite(dir); AvlNode<KeyType> * oldRoot = root; AvlNode<KeyType> * oldOtherDirSubtree = root->mySubtree[otherDir]; // assign new root root = oldRoot->mySubtree[otherDir]->mySubtree[dir]; // new-root exchanges it's "dir" subtree for it's grandparent oldRoot->mySubtree[otherDir] = root->mySubtree[dir]; root->mySubtree[dir] = oldRoot; // new-root exchanges it's "other-dir" subtree for it's parent oldOtherDirSubtree->mySubtree[dir] = root->mySubtree[otherDir]; root->mySubtree[otherDir] = oldOtherDirSubtree; // update balances root->mySubtree[LEFT]->myBal = -MAX(root->myBal, 0); root->mySubtree[RIGHT]->myBal = -MIN(root->myBal, 0); root->myBal = 0; // A double rotation always shortens the overall height of the tree return HEIGHT_CHANGE; }
Now that we have the rotation methods written, we just need to worry about
when to call them. One helpful item is a method called balance()
which is called when a node gets too heavy on a particular side:
// Use mnemonic constants for valid balance-factor values enum balance_t { LEFT_HEAVY = -1, BALANCED = 0, RIGHT_HEAVY = 1 }; // Return true if the tree is too heavy on the left side inline static int LEFT_IMBALANCE(short bal) { return (bal < LEFT_HEAVY); } // Return true if the tree is too heavy on the right side inline static int RIGHT_IMBALANCE(short bal) { return (bal > RIGHT_HEAVY); } // Rebalance -- static member function to rebalance a (sub)tree // if it has become imbalanced. // Return 1 if the tree height changes due to rotation, // otherwise return 0. template <class KeyType> int AvlNode<KeyType>::ReBalance(AvlNode<KeyType> * & root) { int heightChange = HEIGHT_NOCHANGE; if (LEFT_IMBALANCE(root->myBal)) { // Need a right rotation if (root->mySubtree[LEFT]->myBal == RIGHT_HEAVY) { // RL rotation needed heightChange = RotateTwice(root, RIGHT); } else { // RR rotation needed heightChange = RotateOnce(root, RIGHT); } } else if (RIGHT_IMBALANCE(root->myBal)) { // Need a left rotation if (root->mySubtree[RIGHT]->myBal == LEFT_HEAVY) { // LR rotation needed heightChange = RotateTwice(root, LEFT); } else { // LL rotation needed heightChange = RotateOnce(root, LEFT); } } return heightChange; }
This method helps but now comes the hard part (in my humble opinion), figuring out when the height of the current subtree has changed.
| after insertion | NULL ================> | A
The remaining cases for an insertion are almost as simple. If a 0 (FALSE) was the "height-change-indicator" passed back by inserting into a subtree of the current level, then there is no height change at the current level. It is true that the structure of one of the subtrees may have changed due to an insertion and/or rotation, but since the height of the subtree did not change, neither did the height of the current level.
| after insertion | | ================> | A A / \ / \ / \ / \ b c b d
If the current level is balanced after inserting the node (but before attempting any rotations) then we just made one subtree equal in height to the other. Therefore the overall height of the current level remains unchanged and a 0 is returned.
| after insertion | | ================> | A A / / \ / / \ b b c
Before we write the code for an insertion, we still need a method to compare
items while we traverse the tree. Normally, we expect this
Compare()
method to return a strcmp()
type result
(<0, ==0, or >0 for <,==,> respectively). We will be a little sneaky
and write our own Compare()
method which will use the
Compare()
method of the supplied KeyType
, and take an
additional parameter describing whether we want to actually compare the values
of the two items, or if we just want to traverse towards the maximal or minimal
element of the tree. We can use the enumeration values of the cmp_t
type (EQ_CMP
, MIN_CMP
, MAX_CMP
) to
indicate the type of comparison that is desired. This extra
Compare()
method of ours doesnt help much for insertion, but it
will be a big help for deletion (or searching) when we need to find the
minimal or maximal element in a subtree:
// Compare -- Perform a comparison of the given key against the given // item using the given criteria (min, max, or equivalence // comparison). Returns: // EQ_CMP if the keys are equivalent // MIN_CMP if this key is less than the item's key // MAX_CMP if this key is greater than item's key // template <class KeyType> cmp_t AvlNode<KeyType>::Compare(KeyType key, cmp_t cmp) const { switch (cmp) { case EQ_CMP : // Standard comparison return myData->Compare(key); case MIN_CMP : // Find the minimal element in this tree return (mySubtree[LEFT] == NULL) ? EQ_CMP : MIN_CMP; case MAX_CMP : // Find the maximal element in this tree return (mySubtree[RIGHT] == NULL) ? EQ_CMP : MAX_CMP; } }
We are now ready to write the insertion method for our AVL tree:
// Insert -- Insert the given key into the given tree. Return the // node if it already exists. Otherwise return NULL to // indicate that the key was successfully inserted. // Upon return, the "change" parameter will be '1' if // the tree height changed as a result of the insertion // (otherwise "change" will be 0). // template <class KeyType> Comparable<KeyType> * AvlNode<KeyType>::Insert(Comparable<KeyType> * item, AvlNode<KeyType> * & root, int & change) { // See if the tree is empty if (root == NULL) { // Insert new node here root = new AvlNode<KeyType>(item); change = HEIGHT_CHANGE; return NULL; } // Initialize Comparable<KeyType> * found = NULL; int increase = 0; // Compare items and determine which direction to search cmp_t result = root->Compare(item->Key()); dir_t dir = (result == MIN_CMP) ? LEFT : RIGHT; if (result != EQ_CMP) { // Insert into "dir" subtree found = Insert(item, root->mySubtree[dir], change); if (found) return found; // already here - dont insert increase = result * change; // set balance factor increment } else { // key already in tree at this node increase = HEIGHT_NOCHANGE; return root->myData; } root->myBal += increase; // update balance factor // -------------------------------------------------------------------- // re-balance if needed -- height of current tree increases only if its // subtree height increases and the current tree needs no rotation. // -------------------------------------------------------------------- change = (increase && root->myBal) ? (1 - ReBalance(root)) : HEIGHT_NOCHANGE; return NULL; }
Deletion is more complicated than insertion. The height of the current level may decrease for two reasons: either a rotation occurred to decrease the height of a subtree (and hence the current level), or a subtree shortened in height resulting in a now balanced current level (subtree was "trimmed down" to the same size as the other). Just because a rotation has occurred however, does not mean that the subtree height has decreased. There is a special case where rotating preserves the current subtree height.
Suppose I have a tree as follows:
C / \ A E / \ D F
Deleting "A" results in the following (imbalanced) tree:
C \ E / \ D F
This type of imbalance cannot occur during insertion, only during deletion. Notice that the root has a balance of 2 but its heavy subtree has a balance of zero (the other case would be a -2 and a 0). Performing a single left rotation to restore the balance results in:
E / \ C F \ D
This tree has the same height as it did before it was rotated. Hence, we may determine if deletion caused the subtree height to change by seeing if one of the following occurred:
For insertion, we only needed to check if a rotation occurred to see if the subtree height had changed. But for deletion we need to check all of the above. So for deletion of a node we have:
// Delete -- delete the given key from the given tree. Return NULL // if the key is not found in the tree. Otherwise return // a pointer to the node that was removed from the tree. // Upon return, the "change" parameter will be '1' if // the tree height changed as a result of the deletion // (otherwise "change" will be 0). // template <class KeyType> Comparable<KeyType> * AvlNode<KeyType>::Delete(KeyType key, AvlNode<KeyType> * & root, int & change, cmp_t cmp) { // See if the tree is empty if (root == NULL) { // Key not found change = HEIGHT_NOCHANGE; return NULL; } // Initialize Comparable<KeyType> * found = NULL; int decrease = 0; // Compare items and determine which direction to search cmp_t result = root->Compare(key, cmp); dir_t dir = (result == MIN_CMP) ? LEFT : RIGHT; if (result != EQ_CMP) { // Delete from "dir" subtree found = Delete(key, root->mySubtree[dir], change, cmp); if (! found) return found; // not found - can't delete decrease = result * change; // set balance factor decrement } else { // Found key at this node found = root->myData; // set return value // ---------------------------------------------------------------- // At this point we know "result" is zero and "root" points to // the node that we need to delete. There are three cases: // // 1) The node is a leaf. Remove it and return. // // 2) The node is a branch (has only 1 child). Make "root" // (the pointer to this node) point to the child. // // 3) The node has two children. Swap items with the successor // of "root" (the smallest item in its right subtree) and // delete the successor from the right subtree of "root". // The identifier "decrease" should be reset if the subtree // height decreased due to the deletion of the successor of // "root". // ---------------------------------------------------------------- if ((root->mySubtree[LEFT] == NULL) && (root->mySubtree[RIGHT] == NULL)) { // We have a leaf -- remove it delete root; root = NULL; change = HEIGHT_CHANGE; // height changed from 1 to 0 return found; } else if ((root->mySubtree[LEFT] == NULL) || (root->mySubtree[RIGHT] == NULL)) { // We have one child -- only child becomes new root AvlNode<KeyType> * toDelete = root; root = root->mySubtree[(root->mySubtree[RIGHT]) ? RIGHT : LEFT]; change = HEIGHT_CHANGE; // We just shortened the subtree // Null-out the subtree pointers so we dont recursively delete toDelete->mySubtree[LEFT] = toDelete->mySubtree[RIGHT] = NULL; delete toDelete; return found; } else { // We have two children -- find successor and replace our // current data item with that of the successor root->myData = Delete(key, root->mySubtree[RIGHT], decrease, MIN_CMP); } } root->myBal -= decrease; // update balance factor // ------------------------------------------------------------------- // Rebalance if necessary -- the height of current tree changes if one // of two things happens: (1) a rotation was performed which changed // the height of the subtree (2) the subtree height decreased and now // matches the height of its other subtree (so the current tree now // has a zero balance when it previously did not). // ------------------------------------------------------------------- //change = (decrease) ? ((root->myBal) ? ReBalance(root) // : HEIGHT_CHANGE) // : HEIGHT_NOCHANGE ; if (decrease) { if (root->myBal) { change = ReBalance(root); // rebalance and see if height changed } else { change = HEIGHT_CHANGE; // balanced because subtree decreased } } else { change = HEIGHT_NOCHANGE; } return found; }
Note how in the case of both subtrees of the deleted item
being non-null, I only need one statement. This is due to the way
AvlNode::Delete
sets its parameters. The data pointer passed on
entrance points to the deleted node's data on exit. So I just delete the minimal
element of the right subtree, and steal its data as my-own (returning my former
data item on exit).
And there we have it, the maintenance of AVL tree manipulations, the brunt of which is covered in 5 methods, none of which (except for delete which is about 1.5 pages) is greater than 1 normal page in length, including comments (and there are a lot). The main methods are:
RotateOnce(), RotateTwice(), ReBalance(), Insert(), Delete().
All other methods are very small and easy to code. The only method still
missing is the Search()
method, and that is no different from a
normal binary tree search:
// Search -- Look for the given key using the given comparison criteria, // return NULL if not found, otherwise return the item address. template <class KeyType> Comparable<KeyType> * AvlNode<KeyType>::Search(KeyType key, AvlNode<KeyType> * root, cmp_t cmp) { cmp_t result; while (root && (result = root->Compare(key, cmp))) { root = root->mySubtree[(result < 0) ? LEFT : RIGHT]; } return (root) ? root->myData : NULL; }
And lets not forget the constructor and destructor:
template <class KeyType> AvlNode<KeyType>::AvlNode(Comparable<KeyType> * item) : myData(item), myBal(0) { myBal = 0 ; mySubtree[LEFT] = mySubtree[RIGHT] = NULL ; } template <class KeyType> AvlNode<KeyType>::~AvlNode(void) { if (mySubtree[LEFT]) delete mySubtree[LEFT]; if (mySubtree[RIGHT]) delete mySubtree[RIGHT]; }
Now that we have implemented most of the methods for AVL tree manipulations, we should probably finish the declaration that we started near the beginning of this discussion:
#include "Comparable.h" // Indices into a subtree array // NOTE: I would place this inside the AvlNode class but // when I do, g++ complains when I use dir_t. Even // when I prefix it with AvlNode:: or AvlNode<KeyType>:: // (If you can get this working please let me know) // enum dir_t { LEFT = 0, RIGHT = 1 }; // AvlNode -- Class to implement an AVL Tree // template <class KeyType> class AvlNode { public: // Max number of subtrees per node enum { MAX_SUBTREES = 2 }; static dir_t Opposite(dir_t dir) { return dir_t(1 - int(dir)); } // ----- Constructors and destructors: AvlNode(Comparable<KeyType> * item=NULL); virtual ~AvlNode(void); // ----- Query attributes: // Get this node's data Comparable<KeyType> * Data() const { return myData; } // Get this node's key field KeyType Key() const { return myData->Key(); } // Query the balance factor, it will be a value between -1 .. 1 // where: // -1 => left subtree is taller than right subtree // 0 => left and right subtree are equal in height // 1 => right subtree is taller than left subtree short Bal(void) const { return myBal; } // Get the item at the top of the left/right subtree of this // item (the result may be NULL if there is no such item). // AvlNode * Subtree(dir_t dir) const { return mySubtree[dir]; } // ----- Search/Insert/Delete // // NOTE: These are all static functions instead of member functions // because most of them need to modify the given tree root // pointer. If these were instance member functions than // that would correspond to having to modify the 'this' // pointer, which is not allowed in C++. Most of the // functions that are static and which take an AVL tree // pointer as a parameter are static for this reason. // Look for the given key, return NULL if not found, // otherwise return the item's address. static Comparable<KeyType> * Search(KeyType key, AvlNode<KeyType> * root, cmp_t cmp=EQ_CMP) // Insert the given key, return NULL if it was inserted, // otherwise return the existing item with the same key. static Comparable<KeyType> * Insert(Comparable<KeyType> * item, AvlNode<KeyType> * & root) { int change; return Insert(item, root, change); } // Delete the given key from the tree. Return the corresponding // node, or return NULL if it was not found. static Comparable<KeyType> * Delete(KeyType key, AvlNode<KeyType> * & root, cmp_t cmp=EQ_CMP) { int change; return Delete(key, root, change, cmp); } private: // ----- Private data Comparable<KeyType> * myData; // Data field AvlNode<KeyType> * mySubtree[MAX_SUBTREES]; // Subtree pointers short myBal; // Balance factor // ----- Routines that do the *real* insertion/deletion // Insert the given key into the given tree. Return the node if // it already exists. Otherwise return NULL to indicate that // the key was successfully inserted. Upon return, the "change" // parameter will be '1' if the tree height changed as a result // of the insertion (otherwise "change" will be 0). static Comparable<KeyType> * Insert(Comparable<KeyType> * item, AvlNode<KeyType> * & root, int & change); // Delete the given key from the given tree. Return NULL if the // key is not found in the tree. Otherwise return a pointer to the // node that was removed from the tree. Upon return, the "change" // parameter will be '1' if the tree height changed as a result // of the deletion (otherwise "change" will be 0). static Comparable<KeyType> * Delete(KeyType key, AvlNode<KeyType> * & root, int & change, cmp_t cmp=EQ_CMP); // Routines for rebalancing and rotating subtrees // Perform an XX rotation for the given direction 'X'. // Return 1 if the tree height changes due to rotation, // otherwise return 0. static int RotateOnce(AvlNode<KeyType> * & root, dir_t dir); // Perform an XY rotation for the given direction 'X' // Return 1 if the tree height changes due to rotation, // otherwise return 0. static int RotateTwice(AvlNode<KeyType> * & root, dir_t dir); // Rebalance a (sub)tree if it has become imbalanced static int ReBalance(AvlNode<KeyType> * & root); // Perform a comparison of the given key against the given // item using the given criteria (min, max, or equivalence // comparison). Returns: // EQ_CMP if the keys are equivalent // MIN_CMP if this key is less than the item's key // MAX_CMP if this key is greater than item's key cmp_t Compare(KeyType key, cmp_t cmp=EQ_CMP) const; private: // Disallow copying and assignment AvlNode(const AvlNode<KeyType> &); AvlNode & operator=(const AvlNode<KeyType> &); };


--- heading: Welcome to Biosphere ---
A rogue planet Earth0416J hemmed in the convergence of spiritual realm and physical realm by a red giant protostar was accidentally discovered by two promising botanist prodigies and partners Liam and Yam from a mysterious cave that turned out to be a portal. In this world, they met sworn-enemies and young practicing fairies the dauntless Diyes and modest Meg, who took upon themselves to fill their planet with plants that will eventually help sustain life in their world as it is rapidly diminishing due to the inexplicable indifference of other fairies. Can you help the quartet in their quest to save this mystifying world and rekindle life among the fairies?


{% if climate.name in ['subarctic', 'subpolar_oceanic'] %} Despite the chilly climate, {% elif climate.name in ['hot_desert', 'arid', 'steppe'] %} Although the hot, dry climate may seem harsh, {% elif climate.name in ['tropical_rainforest', 'tropical_monsoon'] %} Set in the midst of a verdant topical ecosystem, {% else %} With its rich soil and {{ climate.gross_classification }} climate, {% endif %} {{ foreign_word(city_name) }} is the home to some delicious native produce. Be sure to try {{ foreign_word(dictionary['fruitNN'], capitalize=True) }}, {{ cuisine.fruit }}


Wizard With Disabled Tab Click
First
Second
Third
Fourth
Fifth
Sixth
Seventh
1
2
3
4
5
6
7
First
Previous
Last
Next


An extension to Python-Markdown that outputs a markdown document as RSS. This extension has been included with Python-Markdown since 1.7 and should be available to anyone who has a typical install of Python-Markdown.
From the Python interpreter:
>>> import markdown
>>> text = "Some markdown document."
>>> rss = markdown.markdown(text, ['rss'])
An RSS document includes some data about the document (URI, author, title) that will likely need to be configured for your needs. Therefore, three configuration options are available:
An example:
>>> rss = markdown.markdown(text, extensions = \
... ['rss(URL=http://example.com,CREATOR=JOHN DOE,TITLE=My Document)']
... )


${{ display_counter | number }}
This page displays in real time the money you've earned,
according to your salary.
Get the source code |
Custom URL
This page displays in real time the money you've earned,
according to your salary.
Get the source code |
Custom URL


--- layout: "blog_layout" web_title: "Multiple Rename" page_title: "Multiple file/folder rename using Python" video_link: "j9WYN6bZNe4" upload-date: "March 17, 2018" author: "Harsh Patel" ---


Corruption is a huge bane to Africa’s development. African countries must develop novel and localised solutions that will curb this menace, hence the birth of iReporter. iReporter enables any/every citizen to bring any form of corruption to the notice of appropriate authorities and the general public. Users can also report on things that needs government intervention.
Let's get started!!
Create and edit red-flag and intervention records


| 482 | (A) | and claymes of eueriche a kynge safe of cryste one |
| 486 | (C) | And of euery crowned kynge . but of criste allone |
| 482 | (D) | And cleyme of euery kyng but of Crist alone |
| (E) | ---- no text ---- | |
| (Ex) | ---- no text ---- | |
| 499 | (L) | & clayme of euereche kyng saue of crist one |
| 462 | (P) | And clayme on euer-iche a kynge saue on crist one |
| 480 | (U) | And cleyme of euery a kyng / but of crist one |
| (V) | ---- no text ---- |


--- layout: post status: publish published: true title: Win Two Passes to Cubs Convention author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 10639 wordpress_url: http://ivyenvy.com/?p=10639 date: '2014-12-13 11:20:47 +0000' date_gmt: '2014-12-13 17:20:47 +0000' categories: - The Cubs - Cubs fans - Social Media tags: - Cubs Convention - 2015 Cubs Convention comments: - id: 16219 author: Adam Oppendike author_email: '' author_url: '' date: '2014-12-20 16:07:43 +0000' date_gmt: '2014-12-20 22:07:43 +0000' content: Are you guys going? - id: 16220 author: Ivy Envy author_email: '' author_url: '' date: '2014-12-20 16:09:20 +0000' date_gmt: '2014-12-20 22:09:20 +0000' content: Andy and I (Corey) will be there. - id: 16221 author: Adam Oppendike author_email: '' author_url: '' date: '2014-12-20 16:10:14 +0000' date_gmt: '2014-12-20 22:10:14 +0000' content: Cool I bought 2 passes this week, I've never been. Traveling from qc. - id: 16222 author: Benjamin Schmidt author_email: '' author_url: '' date: '2014-12-20 16:15:06 +0000' date_gmt: '2014-12-20 22:15:06 +0000' content: Have you gotten a lot of submissions? - id: 16223 author: Ivy Envy author_email: '' author_url: '' date: '2014-12-20 16:22:06 +0000' date_gmt: '2014-12-20 22:22:06 +0000' content: Yeah. I'm surprised how many are from names we don't recognize from activity on the FB and Twitter. - id: 16224 author: Josh Adams author_email: '' author_url: '' date: '2014-12-20 18:30:31 +0000' date_gmt: '2014-12-21 00:30:31 +0000' content: The Ivy Envy email may be full, as I've tried to send it twice without success. - id: 16225 author: Josh Adams author_email: '' author_url: '' date: '2014-12-20 18:30:50 +0000' date_gmt: '2014-12-21 00:30:50 +0000' content: Or another reason. Just a fyi. ---
With the off-season moves the Cubs have made and the declaration made by the front office that the 2015 Cubs intend to be competitive for the division, this upcoming Cubs Convention will be the most interesting one in a number of years.
One of the outcomes of the first ever Cubs bloggers forum (which you can hear about on Episode 6.47 of our podcast) is that we have two passes to Cubs Convention 2015 to give away.
To enter the contest for these passes, email your answer to the following question to<EMAIL_ADDRESS>Who would you bring with you to Cubs Convention and why?


Functions | |
| FX_EXPORT void | fx_set_login_status (int longin_status) |
| set the user login status. | |
| FX_EXPORT void | fx_cancel_login () |
| cancel login fetion. | |
| FX_EXPORT int | fx_login (const char *uid, const char *password, EventListener func, void *args) |
| login fetion. | |
| FX_EXPORT void | fx_loginout () |
| loginout fetion. |
| void fx_cancel_login | ( | ) |
cancel login fetion.
This function will cancel login, don't use it after logined fetion!!! because it's not tested for that case.
| void fx_login | ( | const char * | uid, | |
| const char * | password, | |||
| EventListener | func, | |||
| void * | args | |||
| ) |
login fetion.
This function contain all the fetion login operates. and without callback function, when it return show login is finished. this function implement login, get contact list and get presence operates.
| uid | The login info of the usr id or mobile_no. | |
| password | The login info of the usr password. | |
| status_login | The place which store the error info. |
| void fx_loginout | ( | ) |
loginout fetion.
This function will done all loginout fetion operates, when you want to loginout fetion.
| void fx_set_login_status | ( | int | longin_status | ) |
set the user login status.
This function will set the user login status.
| login_status | The login status of you want to set. |


Locations: {{python.locations}}
Size: {{python.size}}
Diet: {{python.diet}}
Locations: {{list.activeData.locations}}
Size: {{list.activeData.size}}
Diet: {{list.activeData.diet}}
{{list.activeData.description}}
Answered
Unanswered
Correct
Incorrect


--- layout: default title: DEVit Week description: Events during the Devit Week permalink: /devit-week custom_js: - schedule.bundle.js --- {% include blocks/header.html page="speaker" %}
Our local communities have grown strong and are ready to celebrate the biggest technological event of the year with a full week of festivities. Each day there will be multiple meetups, gatherings and events, accompanied by our international speakers.
As the conference grows so do our budgets, this allows us to host the international speakers for longer periods of time maximizing their impact on the local community and creating new, international bonds that open up new opportunities and knowledge sharing on all the levels.


PRIME ASTHMA RELIEF- epinephrine capsule
PRIME ASTHMA RELIEF- epinephrine
DRNATURALHEALING
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
ACTIVE INGREDIENT
Epinephrine, USP 0.22 mg per capsule/dose
USE
For temporary relief of mild symptoms of intermittent asthma:
- wheezing
- tightness of chest
- shortness of breath
WARNINGS
Asthma Alert:
Because asthma may be life threatening, see a doctor if you:
- are not better in 20 minutes
- get worse
- need more than 6 inhalations in 24 hours
- use more than 4 inhalations in 24 hours for 3 or more days a week
- have more than 2 asthma attacks in a week
These may be signs that your asthma is getting worse
Do not use
- unless a doctor said you have asthma
- if you are now taking a prescription monoamine oxidase inhibitor (MAOI) (certain drugs taken for depression, psychiatric or emotional conditions, or Parkinson’s disease), or for 2 weeks after stopping the MAOI drug. If you do not know if your prescription drug contains an MAOI, ask a doctor or pharmacist before taking this product.
Ask a doctor before use if you have:
- ever been hospitalized for asthma
- heart disease
- high blood pressure
- diabetes
- thyroid disease
- seizures
- narrow angle glaucoma
- a psychiatric or emotional condition
- trouble urinating due to an enlarged prostate gland
-
Ask a doctor or pharmacist before use if you are
- taking prescription drugs for asthma, obesity, weight control, depression, or psychiatric or emotional conditions
- taking any drug that contains phenylephrine, pseudoephedrine, ephedrine, or caffeine (such as for allergy, cough-cold, or pain)
When using this product
- your blood pressure or heart rate may go up. This could increase your risk of heart attack or stroke, which may cause death.
- Your risk of heart attack or stroke increases if you:
- have a history of high blood pressure or heart disease
- take this product more frequently or take more than the recommended dose
- avoid foods or beverages that contain caffeine
- avoid dietary supplements containing ingredients reported or claimed to have a stimulant effect
Stop use and ask doctor if
- your asthma is getting worse (see Asthma alert)
- you have difficulty sleeping
- you have a rapid heartbeat
- you have tremors, nervousness, or seizure
PREGNANCY OR BREAST FEEDING
If pregnant or breast-feeding, ask a health professional before use.
KEEP OUT OF REACH OF CHILDREN
Keep out of reach of children. In case of overdose, get medical help or contact a Poison Control Center right away.
DIRECTIONS:
- do not use more than directed
- adults and children 4 years of age and over: 1 capsule is for one inhalation at one time
- inhalation not more often than every 3 hours
- do not use more than 12 inhalations in 24 hours
- the use of this product by children should be supervised by an adult
- children under 4 years of age: ask a doctor
1) The active ingredient in a dry powder is 0.22 mg per capsule (the concentration is 1% epinephrine in the total weight of the dry powder)
2) For use in a dry powder inhaler for holding the No. 3 capsule.
3) Should orally inhale at least two times after the capsule is pierced to make sure all dry powder is inhaled into the lung
4) Instructions for Inhalation:
A. Inhaler parts:
B. Instructions for using the dry powder inhaler:
Wash and dry your hands completely before touching the inhaler and capsule.
(1) Remove the cap.
(2) Hold the inhaler at base and turn the mouthpiece in direction of the arrow.
blister pack" src="http://dailymed.nlm.nih.gov/dailymed/image.cfm?setid=6d5af590-59f6-4f34-95ff-226a2996f985&name=blister_package_1.jpg">
(3) Obtain 1 capsule from the blister package just prior to use.
(4) Open inhaler by turning mouthpiece as indicated. Load 1 capsule in the capsule-chamber of the inhaler. Do not put the capsule directly into the top of the mouthpiece. Twist the mouthpiece to the closed position.
(5) Hold the inhaler upright, push/click two blue buttons inwards all the way. Let go of the blue buttons. Do not press the blue buttons more than 1 time. The chances of the capsule breaking into pieces will be increased if the capsule is accidentally pierced more than once.
(6) With the inhaler away from your mouth, prepare by breathing out (exhaling) all the way. Do not blow or exhale into the mouthpiece.
(7) Hold the inhaler horizontally.  Inhale quickly and deeply.
(8) Hold your breath for count of ten, or as long as is comfortable. Breathe out gently. You will need to inhale at least twice from one capsule in order to get the full dose.
(9) After the dose, open the mouthpiece, remove the used capsule, and take a look at the used capsule. It should be pierced and empty. If so, dispose of it properly. If the capsule does not look pierced, put the capsule back into the device capsule-chamber, repeat steps 7, 8 and 9.
(10) Cover the mouthpiece and dust cap for storage.
(11) After your Inhalation, throw away the empty capsule properly as it is bio-degradable. Do not store the capsule in the inhaler. Put the mouthpiece back to your inhaler device and twist the mouthpiece in a clockwise direction until it is tight. Do not over-tighten.
HOW SUPPLIED
- Epinephrine Inhalation is a dry powder, USP 0.22 mg, in one number 3 capsule.
- NDC 15343-104-20, each dose is in an individual capsule. Twenty capsules are packed in one blister. The dry powder in the capsule is in a ready-to-inhale form.
STORAGE AND HANDLING
- Protect from light
- Place in a dry area
- Avoid excessive heat
- Store between 2°C and 24°C (36°F and 75°F)
INACTIVE INGREDIENT
Lactose
REGULATORY STATUS
OTC Monograph 2013, 21 CFR Part 341.16 and 341.76 Bronchodilator
COMMENTS AND QUESTIONS
1-888-658-8108
Monday through Friday, 8:00 a.m. to 5:00 p.m.
(Eastern Standard Time)
Manufactured for:
DrNaturalHealing, Inc.
111 McCoy Street
Milford, DE 19963, USA
Info@DrNaturalHealing.com


The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable, solely that the variable identifier can not be reassigned.
const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]];
nameN
valueN
This declaration creates a constant that can be global or local to the function in which it is declared. Constants are block-scoped. The value of a constant cannot change through re-assignment, and a constant cannot be re-declared. An initializer for a constant is required. A constant cannot share its name with a function or a variable in the same scope.
The following example demonstrates how constants behave. Try this in your browser console.
// NOTE: Constants can be declared with uppercase or lowercase, but just by convention, we are using uppercase // define my_fav as a constant and give it the value 7 const MY_FAV = 7; // this will fail silently in Firefox and Chrome (but does not fail in Safari) MY_FAV = 20; // will print 7 console.log("my favorite number is: " + MY_FAV); // trying to redeclare a constant throws an error const MY_FAV = 20; // the name MY_FAV is reserved for constant above, so this will also fail var MY_FAV = 20; // MY_FAV is still 7 console.log("my favorite number is " + MY_FAV); // Assigning to A const variable is a syntax error const A = 1; A = 2; // const requires an initializer const FOO; // SyntaxError: missing = in const declaration // const also works on objects const MY_OBJECT = {"key": "value"}; // Overwriting the object fails as above (in Firefox and Chrome but not in Safari) MY_OBJECT = {"OTHER_KEY": "value"}; // However, object attributes are not protected, // so the following statement is executed without problems MY_OBJECT.key = "otherValue";
In earlier versions of Firefox & Chrome and as of Safari 5.1.7 and Opera 12.00, if you define a variable with const
, you can still change its value later. It is not supported in Internet Explorer 6-10, but is included in Internet Explorer 11.
The const
declaration has been implemented in Firefox long before const
appeared in the ECMAScript 6 specification. For const
ES6 compliance see and .
{const a=1};a
now throws a ReferenceError
and does not return 1
anymore due to block-scoping.const a;
now throws a SyntaxError
("missing = in const declaration"
): An initializer is required.const a = 1; a = 2;
now also throws a SyntaxError
("invalid assignment to const a").Created by Mozilla Contributors, license: CC-BY-SA 2.5


Play Alone
Group Game
Rewards & Coupons
You've earned at least one reward from "Truth or Dare!"
You've earned at least one reward from "Would You Rather?"
Play more games to stand the chance of winning awesome coupons!


Mukundhan Srinivasan
Engineer at NVIDIA^2. IEEE Volunteer, Ex-Paytm Labs. Organiser DLBLR.
Fedrer Fan. Enjoy entroy. Information merchant.
I’m back at NVIDIA in TDot, Canada for a second innings as a Senior Data Scientist focusing on ML at datacenter scale. Broadly, I’m interested in machine learning mechanisms and related system engineering. Research topics that I follow are generation applied to language, dialogue systems specifically generation & evlauation, and lastly ideas on generalization. I’m often facinated by language.
I had a brief stint as Lead ML Architect at Paytm Labs, Canada. Prior that, I was a Senior Architect at NVIDIA in Bangalore where I had the opportunity to collaborate with researchers/engineers while building deep models, platforms, pipelines for training and inferencing workloads on GPUs.
A long time ago, I was a co-founder of Market Learning Labs where we built developer tools for computer vision and NLP applications that ultimately failed due to non-functional GTM/sales. I was fortunate to start my career as a Research Assistant at the Indian Institute of Science, Bangalore working on Indic language OCR and TTS systems.
I’m an active IEEE volunteer contributing back to the scientific community for about a decade now. Presently, I serve as the Vice-Chair for the Membership Development Committee at the IEEE Region 7 (Canada). Recently, I was promoted to a Senior IEEE Member and graduated from the VoLT program. Reach out if you are interested in building communities! From time to time, I’ve advised select startups in the deeptech space.
Outside of CS/ML, I have a keen interest in studying the structure of economies, history of societies, and south-Indian classical music. I’m a student/practitioner of Sanatana dharma. I spend a disproportionate amount of time on horology and writing instruments.
I stopped following cricket after Rahul Dravid retired except for that occasional game. I’m a huge Federer fan - needless to say, no one has a better inside-out forehand. I continue to learn and play chess (mainly because it is another tab in the browser). I almost always play e4-e5.
I used to live in (beautiful) authentic part of Bangalore closer to CTR’s benne dose and Veena store’s idli chutney before moving to Toronto. Being from the south, I love my filter kaapi (yes, Kaapi!) and can be brided with a good one.
Research Colaborators: Prof. Mitesh Khapara and Prof. Balaraman Ravindran, IIT Madras; Prof. Venkatesh Babu, IISc Bangalore; Prof. Vinay P Namboodiri, IIT Kanpur; Prof. Debdoot Sheet, IIT Kharagpur; Dr. Tavpritesh Sethi, Stanford Medical; Prof. Anurag Agrawal, IGIB; Dr. Vidur Mahajan, CARING Research
news
| Mar 31, 2020 | After a short stint at Paytm Labs, I’m back at NVIDIA! |
| May 7, 2019 | I’ve joined Paytm Labs, Canada to work on cool ML problems in the AdTech, SaaS, ecommerce and payments space. |
| Feb 25, 2019 | Our paper titeled Efficient Video Classification Using Fewer Frames has been accepted at CVPR 2019 (25.2% acceptance rate) for oral (< 6% of accepted papers). This is work done with Shwetha and Mitesh at IIT Madras. Paper here |
| Feb 12, 2019 | Our paper titeled Virtual Imaging Using Generative Adversarial Networks for Image Translation (VIGANIT): Deep Learning based Prediction of Diffusion-Weighted Images from T2-Weighted Brain MR Images has been accepted at ISMRM 2019. Paper here … |
| Jan 2, 2019 | I’m organising the First AI workshop on Research, Trends and Practices from 20-21 Feb 2019 at NVIDIA Bangalore. Hosting some awesome researchers. Go to the website to learn more… |
| Jan 2, 2019 | I’ll be serving as a mentor on the International Innovation Corps (IIC) team that is working with NITI Aayog to develop a Natural Language Processing. |
| Dec 17, 2018 | Will be speaking at HiPC 2018 on Towards Better Model Training and Inferencing using Mixed Precision |
| Nov 1, 2018 |
Our paper “Re-evaluating ADEM: A Deeper Look at Scoring Dialogue Responses” has been accepted at AAAI 2019 (16% acceptance rate).
This is joint work with folks at IIT Madras and Microsoft India. |
| Oct 12, 2018 | Will be speaking at the Google GDG DevFest’18 on Distributed strategies in TensorFlow. |
| Aug 20, 2018 | I’ll be mentoring participants for the NITI Aayog #MoveHack2018 for Machine Learning topics. |
| Feb 12, 2018 | Our paper ‘Divide and Grow: Capturing Huge Diversity in Crowd Images With Incrementally Growing CNN’ is aceepted at CVPR 2018 for a spotlight. |
| Nov 7, 2015 | A long announcement with details |


---
seo:
title: Undelivered Email Overview
description: Email can be undelivered for various reasons, including an issue with email address or content.
title: Undelivered Email Overview
weight: 0
layout: page
navigation:
show: true
---
Undelivered email can be the result of several things but most commonly there is an issue with the email address or content. Once an email has been attempted and has been classified as bounced, invalid or a spam report subsequent sends to the same email address will be considered a drop.


Algorithms for fitting scaled sparse linear regression and estimating precision matrices
| Version: | 1.0 |
| Depends: | R (≥ 2.10), lars, MASS |
| Published: | 2013-12-18 |
| Author: | Tingni Sun |
| Maintainer: | Tingni Sun <tingni at wharton.upenn.edu> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| CRAN checks: | scalreg results |
| Reference manual: | scalreg.pdf |
| Package source: | scalreg_1.0.tar.gz |
| Windows binaries: | r-devel: scalreg_1.0.zip, r-release: scalreg_1.0.zip, r-oldrel: scalreg_1.0.zip |
| OS X binaries: | r-release: scalreg_1.0.tgz, r-oldrel: scalreg_1.0.tgz |
| Reverse depends: | Grace, hdi |
| Reverse imports: | bastah, BigQuic |
Please use the canonical form https://CRAN.R-project.org/package=scalreg to link to this page.


Use this template for your own Angular ES6 projects!
Based on the following technologies
About this template...
{{ main.dateResult | json: 2 }}
{{ main.randomResult | json: 2 }}


sketch.coffee | |
|---|---|
Sketch.js (v0.0.1)Sketch.js is a simple jQuery plugin for creating drawable canvases using HTML5 Canvas. It supports multiple browsers including mobile devices (albeit with performance penalties). | (($)-> |
jQuery('#mycanvas').sketch(options)Given an ID selector for a | $.fn.sketch = (key, args...)->
$.error('Sketch.js can only be called on one element at a time.') if this.length > 1
sketch = this.data('sketch') |
| If a canvas has already been initialized as a sketchpad, calling
| if typeof(key) == 'string' && sketch
if sketch[key]
if typeof(sketch[key]) == 'function'
sketch[key].apply sketch, args
else if args.length == 0
sketch[key]
else if args.length == 1
sketch[key] = args[0]
else
$.error('Sketch.js did not recognize the given command.')
else if sketch
sketch
else
this.data('sketch', new Sketch(this.get(0), key))
this |
SketchThe Sketch class represents an activated drawing canvas. It holds the state, all relevant data, and all methods related to the plugin. | class Sketch |
new Sketch(el, opts)Initialize the Sketch class with a canvas DOM element and any specified options. The available options are:
| constructor: (el, opts)->
@el = el
@canvas = $(el)
@context = el.getContext '2d'
@options = $.extend {
toolLinks: true
defaultTool: 'marker'
defaultColor: '#000000'
defaultSize: 5
}, opts
@painting = false
@color = @options.defaultColor
@size = @options.defaultSize
@tool = @options.defaultTool
@actions = []
@action = []
@canvas.bind 'click mousedown mouseup mousemove mouseleave mouseout touchstart touchmove touchend touchcancel', @onEvent |
Tool LinksTool links automatically bind | if @options.toolLinks
$('body').delegate "a[href=\"##{@canvas.attr('id')}\"]", 'click', (e)->
$this = $(this)
$canvas = $($this.attr('href'))
sketch = $canvas.data('sketch') |
| Tool links are keyed off of HTML5
| for key in ['color', 'size', 'tool']
if $this.attr("data-#{key}")
sketch.set key, $(this).attr("data-#{key}")
if $(this).attr('data-download')
sketch.download $(this).attr('data-download')
false |
sketch.download(format)Cause the browser to open up a new window with the Data URL of the current
canvas. The | download: (format)->
format or= "png"
format = "jpeg" if format == "jpg"
mime = "image/#{format}"
window.open @el.toDataURL(mime) |
sketch.set(key, value)Internal method. Sets an arbitrary instance variable on the Sketch instance
and triggers a | set: (key, value)->
this[key] = value
@canvas.trigger("sketch.change#{key}", value) |
sketch.startPainting()Internal method. Called when a mouse or touch event is triggered that begins a paint stroke. | startPainting: ->
@painting = true
@action = {
tool: @tool
color: @color
size: parseFloat(@size)
events: []
} |
sketch.stopPainting()Internal method. Called when the mouse is released or leaves the canvas. | stopPainting: ->
@actions.push @action if @action
@painting = false
@action = null
@redraw()
|
sketch.onEvent(e)Internal method. Universal event handler for the canvas. Any mouse or touch related events are passed through this handler before being passed on to the individual tools. | onEvent: (e)->
if e.originalEvent && e.originalEvent.targetTouches
e.pageX = e.originalEvent.targetTouches[0].pageX
e.pageY = e.originalEvent.targetTouches[0].pageY
$.sketch.tools[$(this).data('sketch').tool].onEvent.call($(this).data('sketch'), e)
e.preventDefault()
false |
sketch.redraw()Internal method. Redraw the sketchpad from scratch using the aggregated actions that have been stored as well as the action in progress if it has something renderable. | redraw: ->
@el.width = @canvas.width()
@context = @el.getContext '2d'
sketch = this
$.each @actions, ->
if this.tool
$.sketch.tools[this.tool].draw.call sketch, this
<EMAIL_ADDRESS>sketch, @action if @painting && @action |
ToolsSketch.js is built with a pluggable, extensible tool foundation. Each tool works
by accepting and manipulating events registered on the sketch using an Tools can be added simply by adding a new key to the | $.sketch = { tools: {} }
|
markerThe marker is the most basic drawing tool. It will draw a stroke of the current width and current color wherever the user drags his or her mouse. | $.sketch.tools.marker =
onEvent: (e)->
switch e.type
when 'mousedown', 'touchstart'
@startPainting()
when 'mouseup', 'mouseout', 'mouseleave', 'touchend', 'touchcancel'
@stopPainting()
if @painting
@action.events.push
x: e.pageX - @canvas.offset().left
y: e.pageY - @canvas.offset().top
event: e.type
@redraw()
draw: (action)->
@context.lineJoin = "round"
@context.lineCap = "round"
@context.beginPath()
@context.moveTo action.events[0].x, action.events[0].y
for event in action.events
@context.lineTo event.x, event.y
previous = event
@context.strokeStyle = action.color
@context.lineWidth = action.size
@context.stroke() |
eraserThe eraser does just what you'd expect: removes any of the existing sketch. | $.sketch.tools.eraser =
onEvent: (e)->
$.sketch.tools.marker.onEvent.call this, e
draw: (action)->
oldcomposite = @context.globalCompositeOperation
@context.globalCompositeOperation = "copy"
action.color = "rgba(0,0,0,0)"
$.sketch.tools.marker.draw.call this, action
@context.globalCompositeOperation = oldcomposite
)(jQuery)
|


EPL: Why I’m ‘Surprised’ Mourinho Joined Tottenham – Emery
by Emmanuel EgobiambuUnai Emery has admitted he is surprised by Jose Mourinho taking up Tottenham’s coaching job from Mauricio Pochettino as the latter did an amazing job.
Concise News reported that the Premier League club on Tuesday sacked Pochettino after a series of poor run in the domestic race.
And on Wednesday morning, Tottenham named Pochettino as the coach of the team.
Emery who is the coach of Tottenham’s North London rivals Arsenal on Thursday, however, said he is shocked following the development.
According to him, “I think it’s a surprise how it finished with Pochettino. ‘I don’t know exactly why and how it’s going to change their performance.
“‘[Jose] is a very good coach, his career is strong with titles and experience and I think also Pochettino working in Tottenham was amazing.’
On whether he was surprised at Pochettino’s sacking, he said: “Yes, for me it was a surprise.
“Maybe the last matches they didn’t achieve a good result but in the last year with Pochetinno was perfect.
“They decided to change and I don’t know the reason but we have our way and they have their way. We want to keep that distance [ahead of them in the Premier League table].”
Mourinho’s first game will be against London rivals West Ham on Saturday as Arsenal battle Southampton at the Emirates Stadium.


Man suffers life-threatening injuries in early-morning shooting: Saskatoon police
by Saskatoon StarPhoenixOfficers responded Monday just after midnight to a home in the 1400 block of First Avenue North following a report of an injured man.
The early-morning shooting of a 33-year-old man is not believed to be random, say Saskatoon police.
Officers responded Monday just after midnight to a home in the 1400 block of First Avenue North following a report of an injured man. According to police in a news release, a 33-year-old man was transported by ambulance to hospital with what were described as life-threatening injuries.
Based on the preliminary investigation, police do not believe the shooting to be random in nature.
If the incident turns out to be fatal and the death ruled criminal, it would continue to push Saskatoon’s tally to a level never seen before. There have been 15 homicides reported in 2019; the previous record, set last year, was 13.


I've just reinstalled my system from scratch on a Pi v2, but following system restarts, emonhub sometimes does not run.and I get this error.
It occurred twice last night, but by restarting again, everything ran OK
pi@raspberrypi ~ $ sudo service emonhub restart [ ok ] Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok. pi@raspberrypi ~ $ Traceback (most recent call last): File "/usr/share/emonhub/emonhub.py", line 338, in <module> hub.run() File "/usr/share/emonhub/emonhub.py", line 90, in run values = I.read() File "/home/pi/emonhub/src/emonhub_interfacer.py", line 509, in read return self._process_frame(f, t) File "/home/pi/emonhub/src/emonhub_interfacer.py", line 101, in _process_frame validated = self._validate_frame(ref, frame) File "/home/pi/emonhub/src/emonhub_interfacer.py", line 531, in _validate_frame self.rssi = int(received[-1][1:-1]) ValueError: invalid literal for int() with base 10: '9C'
Any thoughts...
Re: Emonhub error? (Solved)
Which RFM2Pi and firmware versions are you running ?
Line 531 just (strips parenthesis and) the casts the rssi value to an int. To get to that line there are several hoops and hurdles to sift out invalid packets, not least the "if the last value in this frame is enclosed in parenthesis " check immediately before it. Plus the "ValueError: invalid literal for int() with base 10: '9C'" could suggest that value is hex.
Can you see a emonhub.log entry for this ? emonHub may have added a "NEW FRAME" log entry (if in debug mode) and that line would probably end in " (9C) ".
I'm guessing you are using emonhub rc1.2(development branch) ?
I can look at adding an additional check to emonhub to make it more robust against being tripped up by this error as it could be a little more graceful and carry on after logging the issue.
Paul
Re: Emonhub error? (Solved)
Thanks Paul, this is what showed up in the emonhub log;
...and further investigation (thanks to the emonhub log) revealed a problem with a 'Retained MQTT Message' which contained a 13 digit number as it's payload, and was sent as soon as emoncms subscribed to that node, and almost certainly caused the issue above.
Background to this was I was testing emoncms by sending MQTT messages via node-red using qos 1 and with the retained flag set. Unfortunately I had forgot to format the payload, and the default payload is a 13 digit Unix Timestamp, so it was then immediately deleted.
However, I suspect that emoncms phpmqtt is not returning a MQTT Puback message, acknowledging receipt, and the 'timestamp' message was stored by the client as a Retained Message. So, despite a reboot, whenever emoncms subscribed to RX/# at startup, it was sent the 13 digit message which exceeds datacode h spec.
I've now cleared the Retained message cache, and have rebooted several times with no issues.
Paul
Re: Emonhub error? (Solved)
Glad you got it sorted although I'm a little unsure how the value found it's way in via the serial port and so far into the code, if it was coming from the mqtt broker, do you have some mqtt handling in emonhub or is it stock?
Paul
Re: Emonhub error? (Solved)
It's stock, and I did think the same, but the only explanation that my limited knowledge could comprehend!
Paul


Connect to GERMANIC LANGUAGES-LPS in the Course Register.
GERMANIC LANGUAGES
GRMN-102 ELEMENTARY GERMAN II 1 CU 601 LEC TR 6-8:15PM WILL 4 FREI C CROSS LISTED: GRMN-502 SECTION MAX: 20 MAX W/CROSS LIST: 24 GRMN-502 ELEMENTARY GERMAN II 1 CU UNDERGRADUATES NEED PERMISSION 601 LEC TR 6-8:15PM WILL 4 FREI C PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: GRMN-102 SECTION MAX: 4 MAX W/CROSS LIST: 24
Return to Course & Room Roster
Comments to:
Office of the University Registrar
University of Pennsylvania
Room 221 Franklin Building
3451 Walnut Street
Philadelphia, PA 19104-6291
Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER>
<EMAIL_ADDRESS>Updated: Sat Jan 17 08:30:02 2015


Robert Norman 'Bob' Ross
(10/29/1942 - 7/4/1995)
Bob Ross was a painter, television host, author, and instructor. Reruns of his show, 'The Joy of Painting' are still broadcast on cable television and Netflix.
Here is a timeline of Bob Ross's life:
Best Bob Ross Quotes:


DB2 HADR Tutorial
Table of Contents
HADR (High Availability Disaster Recovery) is a DB2 LUW feature for high availability and disaster recovery. It is the preferred solution for HA and DR on DB2. It replicates data in real time from a primary database to one or more standby databases. In case the primary database fails, a standby database takes over as the new primary. For all benefits of HADR, see HADR benefits
HADR is based on log replay. You initialize the standby with a backup or split mirror image of the primary. You then configure and start HADR on the primary and standby databases. The primary ships its transaction log data to the standby via a TCP connection. The standby continuously replays the log records to keep itself in sync with the primary.
Initially, the standby's log position is at the time when the backup was taken. The standby starts in a catchup state that ships logs from this position to the current position of the primary. Eventually, the standby catches up to the current position and enters a "peer" state. HADR automatically handles state transition, including chasing the "moving target" of primary position. All you need to do is to issue the "start HADR" command on primary and standby.
If the primary fails, you issue a "takeover HADR by force" command on the standby to make the standby the new primary. A single command does it all. For planned maintenance, you issue a "takeover HADR" (without "by force" option) command to switch primary and standby's roles. HADR management is so simple. There are only 3 commands: Start HADR, stop HADR, and takeover HADR.
Logged operations are replicated. These include, but are not limited to:
Not logged operations are not replicated. These include, but are not limited to:
Note: You can use database configuration parameter BLOCKNONLOGGED to block not logged operations on the primary.
Standby is maintained as a mirror image of the primary. Many aspects of the primary and standby databases need to be the same.
For more info, see Info Center
First, how many standbys are needed? A standby can serve HA (High Availability), or DR (Disaster Recovery) purpose. If you want both HA and DR protection, you need 2 standbys, one for each purpose. HADR supports up to 3 standbys (starting V10.1). A third one can be used for a 2nd DR site, or for protection against user error (configured with delayed replay). Any standby can have reads on standby enabled to support reporting workload.
This tutorial will focus on single standby setup. For specifics of multiple standby setup, see HADR multiple standby white paper. It is recommended that you start from this single standby tutorial to get familiar with HADR basics, then go to multiple standby scenarios.
If you are using a DB2 version earlier than V10.1, HADR is limited to one standby. The common ways to support both HA and DR are:
Due to the complexity and reduced HA/DR protection when using single HADR standby with other HA/DR methods, HADR with multiple standby is recommended. This is a good reason to upgrade to V10.1 and later.
If you are using pureScale, there are some limitations of HADR on pureScale.
pureScale cluster itself provides excellent HA. HADR on pureScale is mainly intended for DR protection. Single standby and sync mode restrictions generally do not impact DR ability.
This tutorial will focus on non pureScale setup. For specifics of pureScale setup, see Tutorial for HADR on pureScale. It is recommended that you start from the non pureScale tutorial to get familiar with HADR basics, then go to the pureScale scenario.
The most important HADR parameter is the HADR synchronization mode. See HADR Sync Modes for description of the various modes and how to choose a mode.
An HA standby is usually close to the primary, often in the same building, connected to the primary by LAN. HADR synchronization mode is usually Sync or NearSync. HADR provides quick failover, with little or no data loss. The HA standby guards against common failures like hardware/software failure. You can also schedule planned downtime without service interruption using rolling update.
An DR standby is usually far from the primary, often in a different city. When a disaster like fire, storm, or earthquake destroys the primary site, you can failover to the standby site. The DR standby is usually connected to the primary via WAN. Network round trip time is often 100ms or more. HADR synchronization mode is usually Async or SuperAsync. While HADR failover is still fast, there can be some data loss during a failover.
Network is usually not an issue in HA systems. For example, a gigabit ethernet provides 120MB/sec throughput, with round trip time at 0.1ms. The throughput is more than enough for most database workload. The round trip time is also very small compared to disk write latency, which is often at least a few ms. So ack message travel in sync or nearSync mode does not add much overhead.
Network can become the bottleneck in DR systems. For example, if your peak logging rate is 20MB/sec, while the network throughput is 15MB/sec, your logging rate will be capped at 15MB/sec, unless superAsync mode is used. SuperAsync mode allows the primary to get ahead of the standby, exposing higher data loss risk. If this is not acceptable, you have to upgrade your network.
A dedicated private network (separate NIC, router, etc.) between primary and standby is recommended, for performance and security reasons. HADR does not encrypt the traffic between primary and standby. Log data is sent as is.
While maximizing TCP throughput on network, socket buffer size is an important factor, especially for WAN. A small buffer size can limit the throughput. See TCP Tuning.
To figure out if your network can support the planned sync mode, see step by step TCP and sync mode configuration
HADR does not encrypt or compress log data during log shipping. If needed, you can use network layer encryption or compression between primary and standby.
You are likely to get lower compression ratio when many tables in your database are already compressed, with either classic row compression or adaptive compression, because row data in log records are also compressed (just another benefit of table compression). With non-compressed tables, the compression ratio is usually between 3 and 5. Of course, it costs time to compress/decompress data. Compression is more likely to be beneficial on WAN.
Same hardware (CPU, memory, disk, etc.) is recommended on the primary and standby, so that standby has enough power for replay. Sufficient planning and testing should be done when deploying a less powerful standby.
If you plan to use Reads on Standby, additional power on the standby machine may be needed.
You may choose to have shared or independent archive devices on primary and standby. See Log Archive Device for details.
It is recommended that you decide on the HADR configuration parameters as much as you can before initializing HADR, to minimize updating configuration after initialization. Changing config after setup may require db2 instance or database shutdown and restart. All HADR registry variables require db2 instance shutdown and restart to take effect. Prior to DB2 V10.1, HADR database config parameters require database shutdown and restart to take effect. See also HADR Database Configuration Parameters
See HADR config for description of relevant parameters and the optimal setting.
DB2 Info Center has detailed info on how to initialize HADR. The basic steps are: create the standby database, configure primary and standby databases, and start HADR on primary and standby.
Additonal info: HADR commands
HADR can also be set up and managed using IBM Data Studio or Optim™ Database Administrator. See https://community.ibm.com/community/user/hybriddatamanagement/viewdocument/prevent-database-outages-with-high?CommunityKey=ea909850-39ea-4ac4-9512-8e2eb37ea09a&tab=librarydocuments for more info.
Once you have HADR set up, you need to monitor it. See HADR monitoring for details.
HADR supports moving primary role from one database to another. For planned role change, primary and standby switch roles. It is a simple one command operation and guaranteed to have no data loss. For unplanned outage, you will need a failover that changes the standby to a primary, but leaves the old primary as primary (it may not even be accessible). Both kinds role change are done by the "takeover HADR" command, with different options. See HADR takeover for details.
Additonal info: HADR commands
In case you run into performance problems, like slow database response to SQL clients, you will need to find the cause and fix it. First, you need to check if HADR is the cause. See Impact to primary database logging. If it is an HADR problem, then proceed to diagnostics. For details, see HADR performance tuning and diagnostics.
HADR supports automated failover and client reroute to the new primary. See cluster managers and Client Reroute
HADR standby database supports read-only queries. This feature is disabled by default. It can be enabled by the DB2_HADR_ROS registry variable. Only the Uncommitted Read isolation level is supported. This feature is best for read-only reporting workload. It offloads the primary. In a multiple standby system, reads on standby can be enabled on any standby. See the followings for more info:
For DB2 fixpack update and OS/hardware upgrade, HADR rolling update allows continued availability during the update.
See the following Info Center topics for more info:
HADR rolling update does not support upgrade across DB2 major version. For example, from DB2 V10.1 to V10.5. Major version upgrade procedure is as follows:
The main reason that HADR rolling update cannot cross major version boundary is that DB2 transaction logs from the new release may not be compatible with the old release, yet HADR requires log compatibility on primary and standby.


Cybotranik
p
The
p
element represents a paragraph.
 Later in his life, this would be referred to as the time the cat sat on the mat.
address
The
address
element represents contact information for a person, people or organization. It should include physical and/or digital location/contact information and a means of identifying a person(s) or organization the information pertains to.
Example
If you see any bugs, please contact webmaster.
Contact: Jack JACKSON.
Phone:<PHONE_NUMBER>
blockquote
The
blockquote
element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.
Example
Today's scientists take mathematics above experiment. That's why they always go after some equations. As a result, they build structures that have nothing to do with reality.
dd
The
dd
element represents a description, part of a term-description group in a description list (dl element).
Example
- Atom
- It is the smallest building block with the chemical and physical properties of all matter in the known universe.
- Proton
- Particle in the atomic nucleus, each carrying a positive electric charge (+1).
- Electron
- An electron is a subatomic particle with a negative basic electrical charge, indicated by the symbols ve- or β-.


| Created: | 4/29/2013 12:00:00 AM |
| Modified: | 5/3/2013 3:54:54 PM |
| Project: | |
| Advanced: |
| Attribute | ||
|
Public Identifier. Type UBLVersionID |
||
Details:
|
||
|
Public Identifier. Type CustomizationID |
||
Details:
|
||
|
Public Identifier. Type ProfileID |
||
Details:
|
||
|
Public Identifier. Type ProfileExecutionID |
||
Details:
|
||
|
Public Identifier. Type ID |
||
Details:
|
||
|
Public Identifier. Type CarrierAssignedID |
||
Details:
|
||
|
Public Identifier. Type UUID |
||
Details:
|
||
|
Public Date. Type IssueDate |
||
Details:
|
||
|
Public Time. Type IssueTime |
||
Details:
|
||
|
Public Name. Type Name |
||
Details:
|
||
|
Public Text. Type Description |
||
Details:
|
||
|
Public Text. Type Note |
||
Details:
|
||
|
Public Identifier. Type ShippingOrderID |
||
Details:
|
||
|
Public Text. Type OtherInstruction |
||
Details:
|
||
|
Public Code. Type TransportationStatusTypeCode |
||
Details:
|
| Element | Source Role | Target Role |
|
«ABIE» Consignment Class |
Name: |
Name: |
|
Details:
A consignment regarding which status is requested.
|
||
|
«ABIE» Document Reference Class |
Name: |
Name: |
|
Details:
A reference to another document associated with this document.
|
||
|
«ABIE» Document Reference Class |
Name: |
Name: Transport Execution Plan Document Reference |
|
Details:
A reference to the Transport Execution Plan associated with the transport service for which status is requested.
|
||
|
«ABIE» Location Class |
Name: |
Name: Requested Status Location |
|
Details:
A location for which status is requested.
|
||
|
«ABIE» Period Class |
Name: |
Name: Requested Status Period |
|
Details:
A period for which status is requested.
|
||
|
«ABIE» Party Class |
Name: |
Name: Sender Party |
|
Details:
The party sending this document.
|
||
|
«ABIE» Party Class |
Name: |
Name: Receiver Party |
|
Details:
The party receiving this document.
|
||
|
«ABIE» Signature Class |
Name: |
Name: |
|
Details:
A signature applied to this document.
|