text:
Gemstone: Blue Quartz
April 17, 2014 April 12, 2014 / Melissa / Leave a comment
A double terminated quartz crystal deeply colored blue by inclusions of fine needles of indigolite, a tourmaline. You can see that the needles are oriented randomly in the crystal. From the Jenipapo Mine, Itanga, Minas Gerais, Brazil.
Blue quartz is something of a catch-all term for any quartz with a blue hue. Naturally occurring blue quartz generally comes by its appearance through one of three ways:
Rayleigh scattering effect caused by tiny inclusions
evenly distributed inclusions of blue minerals, like magnesio-riebeckite or tourmaline
more coarse grained, massive, macrocrystalline forms not unlike aventurine quartz that is also colored by embedded blue minerals, like dumortierite.
Rayleigh scattering in opalescent glass: it appears blue from the side, but orange light shines through.
Additionally, a fourth type of blue quartz can be found marketed under the name "aqua aura quartz." This is a natural quartz crystal that has been coated with gold through a process called vapor deposition. Essentially, the quartz is heated to about 1600°F in a vacuum to which gold fumes are added. The gold bonds to the crystal's service which gives it a blue, iridescent sheen.
Quartz appearing blue from Rayleigh scattering will often lose its blue hue when viewed from another angle since the blue color is a byproduct of light polarization. If light it shone directly into the quartz, an orange-ish light will be seen through the quartz, similar to the demonstration with the glass seen to the right here.
Macrocrystalline blue quartz is far more opaque and can often be mistaken for sodalite, especially if its coloring is due to denim-hued dumortierite. However, its quartz base allows it to be polished to a high sheen whereas sodalite will be very dull in comparison. The blue coloring in this type of quartz is unlikely to be evenly distributed and will be banded or clustered with lighter or white patches.
Melody's Love is in the Earth notes that blue quartz activate[s] the throat chakra and promotes speaking one's mind. It also helps to attune oneself to fellowship with the planet. Most importantly, it helps release introversion and fear while promoting experiences which are fresh and new. It assists one in removing the fear of reaching-out to others and brings stimulation to new relationships. Melody also notes that blue quartz produces a comforting resonance, generating a composure during states of disruption and confusion, thus allowing one to enjoy the actions of being independent and uninhibited. It assuages fear, helping one to see that the basis of fear is only incomplete knowledge; it assists one in gaining completion of this knowledge. It can be used to encourage consideration and thoughtfulness and is helpful to relationships. In addition, it has been used in the treatment of spleen disorders, the endocrine system, and the blood, and to stabilize the metabolic processes.
Dumortierite quartz, and a very dark blue specimen at that!
Melody also notes that that when the color is formed by the inclusion of blue rutile, tourmaline, or zoisite inclusions, it combines the properties of these inclusions with that of quartz. Since much of the blue quartz sold in North America gains its color from dumortierite inclusions, she notes that dumortierite itself can be used to reduce excitability and eliminate stubborness while promoting the continuance of "standing-up" for oneself. It can also provide the stamina to retain one's sense of self in harsh environments. She also notes that dumortierite is an excellent stone for patience and for recognizing the potential with anyone one is involved with. It can also help one to understand the reality in illusion and illusion in reality. As such, it can stimulate the verbalization of spiritual ideas and can ground love matches. It's also useful in treating wasting disorders and to provide strength in the face of disease. Generally, it's useful to help one understand and correct the cause of disease and imbalances.
An aqua aura quartz cluster
Of aqua aura quartz, Melody says that it combines both the properties of quartz and gold, and can produce a very intense energy. Like other blue quartz, it stimulates the throat chakra and opens its channel. It can be used to activate other crystals for healing and to cleanse and smooth the aura and release negativity from the emotional, physical, intellectual, and spiritual bodies.
Gemstone: Bumblebee Jasper
March 20, 2014 April 29, 2015 / Melissa / 14 Comments
Large, rough rocks of bumblebee jasper
I recently attended a rock show out in Issaquah, Washington with my coven-sister W. and her husband. It was a blast, and I do have to admit to coming home many dollars lighter. One of the many highlights of the excursion was my introduction to this stone, bumblebee jasper.
Now, this stone comes from the solfataras surrounding Mount Papandayan in Indonesia, a 150 mile drive southeast from Jakarta, and the natives there call it batu badar blerang, which can be roughly translated as 'coal becoming sulfur.' It is essentially a sedimentary rock matrix of volcanic ash–deep earth mud with sulfur layers. It is largely composed of layered gypsum, sulfur, hematite, all glued together with tuff. Lapidarists suspect that the yellow sulfur layers contain realgar and orpiment, both arsenic sulfides, and therefore take a lot of caution when working with the material. It is a fairly soft stone–softer than travertine marble–so many also stabilize it with materials and epoxy akin to concrete sealant before working with it. It has grown in popularity in the west since the mid 1990s when an Indonesian rock dealer first shipped a few samples to rock shows in Arizona under the more whimsical name of "bumblebee jasper."
The name has stuck, much to the dismay of many rockhounds as it is definitely not a jasper (a cryptocrystalline form of silica with intergrowths of quartz and moganite). Others call it bumblebee agate, but as agate is a very similar stone to jasper, this really doesn't solve the nomenclature problem. Personally, I rather like the poetry behind 'coal becoming sulfur', but that is a bit of a mouthful.
A lovely assortment of bumblebee jasper cabochons.
Metaphysically, I think it is fairly safe to say that bumblebee jasper combines the energies of sulfur and hematite. Melody's Love is in the Earth notes that both are fairly positive minerals. Sulfur, in particular "assists one in the removal of negative wilfulness and in the elimination of distracting intellectual thoughts and emotions that could affect the emotional and intellectual bodies" and can therefore ground the reasoning faculties and promote an abundance of energy and flashes of inspiration. Melody also notes that sulfur "can help to gently 'melt' the barriers blocking progress" and that Native Americans had used it to bring together the four directions, Mother Earth, and Father Sky. Hematite is also mentally-focused and can "help one to 'sort-out' things in one's mind" and help with "mental attunement, memory enhancement, original thinking, technical knowledge, and mental and manual dexterity." Yet, while it sharpens the mind, it promotes a calming atmosphere that still encourages one to "reach for the sun" and see that "the only limitations are those self-limiting concepts within the mind." As such it helps to transform negativity into the light of love, balance yin-yang energies, and balance the energies between mind, body, and spirit.
Overall, then, it would be safe to assume that bumblebee jasper can help sharpen the intellect by helping to maintain a clear focus without the flotsam and jetsam of constant multi-tasking, by balancing mental energies in proportion with body and spirit, by opening one to inspiration, and by melding our barriers to join with those of greater forces.
Yellow and Black Colors + Sulfur Smell = Danger, Will Robinson!
I also think that bumblebee jasper a stone that can't be used lightly. I myself am repulsed by it as much as I am drawn to it. Perhaps that is because the stone itself incorporates a couple major warning signs in western culture: the combination of bright yellows and black, and the smell of sulfur. While individually the colors of yellow and black are very positive–yellow being associated with the heat of the sun, the intellect, optimism, and warmth and black being associated with mystery, rest, and refinement–the combination spells out danger. This is something that even carries out to biology where aposematism, or warning coloration, makes abundant use of yellow and black, particular with stripes. With just one look, you know that most black-and-yellow creatures are not to be handled lightly. Evolution has hard-wired us to see these colors and immediately feel wary: there's a reason we've co-opted these colors for our 'caution' signage. So, too, do we go running when we smell sulfur. It's the smell of body odor and infections, rotting meat and eggs, skunks and flatulence. When we get a whiff of any one of these, we are instantly repelled. And if you put your nose up to an un-sealed sample of bumblebee jasper, you're going to get quite the brimstone bouquet.
Because of this, I feel that bumblebee jasper is also a stone of courage and fear. It draws you in, but puts a healthy, respectful reserve in you. It can open you up to great adventure and experiences beyond your wildest dreams…but you've got to go in with your eyes wide open.
Based both on the properties of sulfur and hematite and the attraction/repulsion factor of the stone itself, I actually think it is a great stone for helping you learn how to safely work within magical space. You've got to have a great mental focus, but one that is in balance with your emotional and spiritual selves, and you've got to break down barriers and merge with other energies. You've got to put aside your own mental limitations to reach for the sun. You've got to have courage, but you've also got to have respect and caution. In my opinion, it would be difficult to find a better stone for promoting a good mindset for circle work than bumblebee jasper.
Flower: Gardenia
February 20, 2014 February 4, 2014 / Melissa / 1 Comment
A lovely, full gardenia bloom
I've been feeling a little homesick lately, and that's put me in mind of gardenias. They are my maternal grandmother's favorite flower, and she's been trying to grow them up on her frigid mountain longer than I've been alive. Some summers, she actually manages to get a bloom or two, and she drinks up its sweet scent like an alcoholic savors his last drink. These past few years, I've been worried that her yearly bloom will be her last–and I think she's been worrying too. I hope that this summer we'll be able to enjoy the flowers together again.
With as intoxicating as the gardenia's scent is, you'd think you'd find it appear more in magic. After all, rose and jasmine make an ample appearance–why not gardenia?
Well, I think the answer is almost certainly pragmatics. Gardenia does not produce an essential oil, nor do the dried blossoms carry much scent. There's only a couple of ways to naturally preserve their heady notes: enfleurage and maceration. Both require a tremendous amount of flowers–more so even than essential oil distillation–and time. The basic process in both entails adding fresh blossoms to a fat, allowing the scent to diffuse, straining out the spent botanicals, and then repeating the process with fresh blooms until the desired scent level is reached. The resulting product is very expensive: a mere 2 ml of gardenia enfleurage (about as much as a sample perfume vial from the department store) will set you back $50 at least. (If you are interested in obtaining such a product, I recommend Victoire, Inc.)
The easiest way to incorporate gardenia into your magical practice is to grow the flowers fresh. The dried petals can also obviously be used in magic–just be prepared to miss their smell. You might also prepare yourself for a challenge: gardenias are sensitive plants that can be difficult even for those with the greenest of thumbs. They may be grown outdoors in hardiness zones 8-11; others will likely have to grow them indoors in containers.
If you are interested in using gardenias magically, Scott Cunningham notes that they're about as femininely-aligned as it gets. He lists their gender as feminine, their ruling planet as the moon, and their element as water as well as noting their powers lie in "love, peace, healing, and spirituality." More specifically he says that fresh blooms are to be put in sickrooms or on healing altars to encourage healing and to incorporate dried petals in healing incenses and other herbal mixtures. Similarly, he says scattering dried gardenia in a room brings about peaceful vibrations, as can using it in a moon incense. Obviously, they're of great use in love work and to attract benevolent spirits in ritual; they also have a high spiritual vibration.
My own intuition on the matter is that gardenia can be used any time "social lubrication" is necessary. It seems to give people a little bit better of a grasp on their own emotions, as well as to intuit those of others. It can help people find a healthy, constructive common ground through that emotional leveling. It helps with communication in that respect, but not a communication dependent upon words.
Gardenia Planting and Care
Leslie Rose
To plant a gardenia, first choose a planting location with high humidity, bright sunlight and low salt content in the soil. The pH of the soil should be below 7.0. If you cannot meet these qualifications outdoors or in the ground, gardenia will grow well in containers and in humid sun rooms. Next, amend the soil (if planting in the ground) with peat moss or compost to improve drainage and nutrient capacity. Dig a hole in the ground as deep as the root ball and twice as wide. If planting in a container, fill the bottom of the container with soil formulated for container gardening, leaving enough room for the root ball to be inserted in the container. Place the root ball in the hole. Fill in the space around the root ball with soil, while holding the plant steady. Gardenias don't respond well to root disturbance; take great care to ensure that the roots are not injured during this process. Water the plant deeply, then mulch around the base of the plant using wood chips or pine needles, leaving a 2- to 3-inch radius around the base of the plant free of mulch. If you are using a container, place it on a tray of wet pebbles to increase the humidity around the plant.
Once planted, you will need to water indoor gardenia on a regular schedule, once per week, and outdoor gardenia as often as needed to maintain an even level of moisture. Check outdoor soil frequently for moisture content, either with a moisture meter or by inserting your finger into the ground at a depth of 1 or 2 inches. Water outdoor plants more during periods of dry weather, and less during periods of wet weather. Water from below and avoid wetting leaves. Fertilize two times per year; once at the beginning of the spring and once at the beginning of the summer. Use an acid-loving fertilizer. If fertilizing a container plant, use a fertilizer formulated for container gardening. Run a humidifier and move an indoor gardenia plant closer to a sun-exposed window during the winter. Check plants frequently and regularly for pest problems. Gardenia plants may become infested with spider mites, aphids, mealy bugs, scales and white flies. Use insecticide on an as-needed basis. Prune the gardenia with sharp pruning shears after the blooms fall from the plant. Cut away dead wood and reduce the plant to desired size.
February 13, 2014 February 13, 2014 / Melissa / Leave a comment
An amethyst cluster
I think that if anyone doubts whether or not crystals have an energy, all they need to do is sit with some amethyst. I honestly don't know what it is about this stone, but cultures across the world have stories of its properties. In Western culture alone, it's been held as one of the five cardinal gems (along with diamond, emerald, ruby, and sapphire) and was said to protect crops against tempests and locusts, bring good fortune in war and in the hunt, drive out evil spirits and inspire the intellect. A little study of the works of Pliny reveals that this gemstone, if worn round the neck on a cord made from dog's hair, affords protection against snakebite. Later, Hieronymus reported that eagles placed an amethyst in their nest in order to protect their young from the selfsame danger. Hildegard von Bingen taught that amethyst combated insect bites and beautified the skin. Outside of these medical uses, amethyst was also popularly esteemed as a stone of friendship. And since it was thought to put the wearer in a chaste frame of mind and symbolise trust and piety, the amethyst came to occupy a very prominent position in the ornaments of the Catholic clergy over the centuries. It was the stone of bishops and cardinals; we find it in prelates' crosses and in the so-called Papal Ring (Italian, 15th century) in the Jewellery Museum in Pforzheim.
The name by which we now know purple quartz comes from the Greek word "amethystos" which may be translated as "not drunken" (a-, "not" + methustos, "intoxicated"). According to a 16th century French poem, Dionysus, the god of intoxication, of wine, and grapes was pursuing a maiden named Amethystos, who refused his affections. Amethystos prayed to the gods to remain chaste, a prayer which the goddess Artemis answered, transforming her into a white stone. Humbled by Amethystos's desire to remain chaste, Dionysus poured wine over the stone as an offering, dyeing the crystals purple. Other variations of the story include that Dionysus had been insulted by a mortal and swore to slay the next mortal who crossed his path, creating fierce tigers to carry out his wrath. The mortal turned out to be a beautiful young woman, Amethystos, who was on her way to pay tribute to Artemis. Her life was spared by Artemis, who transformed the maiden into a statue of pure crystalline quartz to protect her from the brutal claws. Dionysus wept tears of wine in remorse for his action at the sight of the beautiful statue. The god's tears then stained the quartz purple. While this myth and variations are not found in extant classical sources, there is a mention in Nonnus of Panopolis's Dionysiaca that tells of the titan Rhea presenting Dionysus with an amethyst stone to preserve the wine-drinker's sanity.
A deep purple amethyst cluster
Scientifically, amethyst's purple color has been found to result from substitution by irradiation of trivalent iron (Fe3+) for silicon in the structure of quartz, in the presence of trace elements of large ionic radius. To a certain extent, the amethyst color can naturally result from displacement of transition elements (such as manganese) even if the iron concentration is low. Natural amethyst causes light beams to split into two violets: a reddish violet and bluish violet. If the stone is heated, it will permanently turn yellow-orange, yellow-brown, or dark brownish and may resemble citrine, When partially heated, amethyst can result in ametrine. Amethyst can fade in tone if overexposed to light sources and can be artificially darkened with adequate irradiation. The purples in amethyst are often of very variable intensity with the colors often laid out in stripes parallel to the final faces of the crystal. Gem cutters strive to place the color in a way that makes the tone of the finished gem homogeneous. Often, the fact that sometimes only a thin surface layer of violet color is present in the stone or that the color is not homogeneous makes for a difficult cutting.
Tumbled amethyst stones.
Melody's Love is in the Earth says that amethyst "is a 'stone of spirituality and contentment'" that aids in the "transmutation of lower energies into higher frequencies on both the spiritual and ethereal levels" and represents the principles of complete metamorphosis. It helps to clear the aura and to stabilize or change any dysfunctional energy. As such, "it bestows stability, strength, invigoration, and the perfect peace that was present prior to birth." All these are excellent qualities that facilitate meditation, so one might consider using the stone as a focal point to a mediation or envision it "opening and activating the crown chakra" and envisioning its calm, peaceful energies entering your aura and helping you maintain the meditative state. It is also a good stone to work with regarding decision making, as it will bring a serenity and composure that will help one make more fair decisions and enhance one's managing responsibilities. It's soothing, tranquilizing influence also encourages a flexibility in decision making that might not have been attainable otherwise, and can encourage a creativity necessary to effective compromise and problem solving.
Amethyst's energies also enhance cooperation between ones intellectual, physical, and emotional bodies as well as between the physical and spiritual worlds, so it is a good stone to help emphasize the "as above, so below" energies of magic and to enforce a working on one body having an effect on the others. "Consciously holding the amethyst allows one to activate the energy to produce realignment of the energy bodies, while providing for stimulus to rectify disassociation between the aspects of cause and effect." It's reintegration of cause and effect happens by amethyst's energies providing insight into the portion of the actualized self that must be 'remodeled' to ease the changes that one must take to approach an ultimate state of perfection.
Amethyst also aids in assimilating new ideas: "by carrying, wearing, or using amethyst, one can remember and apply the myriad ways that can be used to overcome any stationary areas within one's physical form, intellectual activities, emotional attitudes, and states of consciousness." I believe that this ability to assimilate ideas helps with its usefulness in debating. While much of this is because of its ability to coordinate the intellectual, physical, and emotional selves, I think its use in debate is also because the coordination makes concept understanding easier, faster, and more total. When introduced to a new concept, amethyst helps you to see it completely and identify areas that need strengthening.
Of course, amethyst helps to "encourage and support sobriety" which makes it "an excellent stone for one who is attempting to find freedom from addictive personalities, either that of one's self or another." Physically, "it has been used in the treatment of hearing disorders, to strengthen the skeletal system, and reinforce one's posture" as well as "to stimulate both the sympathetic nervous system and the endocrine glands to proper and precise performance." It is also "quite useful in the treatment of disorders of the nervous system, digestive tract, heart, stomach, skin, and teeth" and can "help cellular disorders to re-adjust and re-align in order to eliminate distressful conditions." It has also "been used in the treatment of insomnia and to ameliorate pain from headaches and other disorders."
"Britain's Wicca Man" is now up on YouTube!
June 13, 2013 August 18, 2013 / Melissa / Leave a comment
Promotional image from "Britain's Wicca Man"
For those not in the know, December 2011 saw the Pagan blogosphere buzzing with news of a new documentary on Gerald Gardner: Britain's Wicca Man with Prof. Ronald Hutton, a film produced by Ross Wilson and directed by Andrew Abbott and Russ Leven. It was commissioned from an independent television production company, Matchlight, by Britain's Channel 4, and it was originally supposed to air in Great Britain on February 20th, 2012.
But even though only British citizens would be able to see its original airing, Witches across the globe were excited for the broadcast because it looked like the filmmakers had put together a beautiful, professional, and respectful product. They even released this amazing trailer to whet our viewing appetites:
But February 20th came…and it went. And those of us in America heard very little from our British friends. It appeared that either BBC4 did not air the film as scheduled, or that they only released it online with strict viewing allowances. Despite hours of scouring the Internet for reviews of the documentary, news for future broadcasts, or any comments at all, I could find nothing. I couldn't even find a torrent to illegally download the film! When I attempted to contact Matchlight to gain information on future broadcasts and to inquire about legally purchasing a copy of the film, I was soundly rebuffed. For months afterward, the only information I could find at all on Britain's Wicca Man was that it existed, but that few outside the production company had ever seen it.
But, lo and behold, at 6:30 pm on Sunday, June 9th, the documentary finally aired on Australian television. The program was featured as episode 15 of ABC1's Compass, a 30-minute program presented by Geraldine Doogue that "explores the interface between religion and life as experienced by individuals and communities – including ordinary Australians, public leaders, religious thinkers and philosophers." At least one friendly (though ethically plastic) Australian promptly copied the program and put it on YouTube, where we can see it now:
Unfortunately, Compass truncated the original production, which was 50-60 minutes long, to fit its half-hour slot. I fervently hope that one day soon we'll be able to watch the documentary in its entirety! (And legally!)
UPDATE: The full 60-minute version (well, 43 minutes when you take advertising into account) was finally shown on Britain's "More 4" channel on Saturday, August 17, 2013 at 9 p.m. It was aired under the title A Very British Witchcraft. Luckily for us, friend of Three Hundred and Sixty-Six Alder Lyncurium uploaded the fuller version to YouTube. The video quality is a little shaky, and the sound is slightly off for a good part of the video, but it's still plenty watch-able.
And Now, Herb Flashcards!
May 31, 2013 May 19, 2013 / Melissa / Leave a comment
I figured that if Roderick was really serious about committing a lot of these herbs to memory, I should probably fall back upon my high school study habits and whip out a set of flashcards. These cards have all the herbs and their properties from day 275 through 280. On the first side of the card is the herb's name and a picture showing the herb, and the second side lists the various properties. On most of the cards, there's also plenty of space to add things later.
Samples of the flashcards I created.
These can be printed out on blank 3×5 index cards. You can find the .pdf file here.
Gemstone: Tiger's Eye, Hawk's Eye, and Ox's Eye
May 28, 2013 May 3, 2013 / Melissa / 1 Comment
Tumbled tiger's eye stones
The tiger's eye stone is a metamorphic rock that develops when quartz slowly replaces blue asbestos (fibrous crocidolite). The quartz remains oriented in the fiberlike strings of the asbestos, and so develops a chatoyant or cat's eye effect appearance when cut parallel to the strand orientation. The iron inside the asbestos sort of 'dissolves' out of the asbestos as it is replaced by quartz, yet remains trapped in the matrix. Its rusty oxidated color is what makes this stone often have a brown-gold appearance. However, tiger's eye stone has a large color range that includes red, cream, black, blue, and blue-green in addition to the typical brown-gold. Red or deep brown tiger's eye (sometimes called Bull's Eye or Ox's Eye) often develops if the gold tiger's eye is slowly heated, which can occur naturally or can be induced. Blue, gray, or blue-green tiger's eye (sometimes called Hawk's Eye) is most commonly a result of an incomplete replacement of the asbestos. This type of tiger's eye will often also include gold streaks within the blue matrix. Tiger's Eye stones can also be artificially dyed, which results in bright, uniform purples, greens, and bright blues.
Red, blue, and gold tiger's eye stones. Often called Ox's/Bull's Eye, Hawk's Eye, and Tiger's Eye stone respectively.
With the exception of dyed stones, which diminish tiger's eye's natural energies, the color of tiger's eye doesn't really change its energy. It might, however, change how you choose to use it. Red tiger's eyes, for example, might be chosen for use in earthy, base chakra work. Golds might be more fire or solar focused and maybe of more use in solar plexus chakra work. Blues and greens might be better in air or water work, and for heart and throat chakra work.
In Love is in the Earth, Melody writes that since tiger's eye looks like "sand and sunlight", we can think of it as melding the energies of the sun and earth. As such, its energies combine "sharpness and grounding", which makes it "quite practical in its sphere of concern". It's earthy resonation "encourage[s] stability with dynamic beauty [… which] is conducive to peacefulness and stimulates the actions required [… to meet] with others while in a meditative state."
Since tiger's eye is so earthy, it can help one develop a more grounded, practical and discrete mind. Gold tiger's eye in particular can be used to "eliminate the blues", much as it actually did in its creation, and brings optimistic brightness to its uses mental state. All tiger's eyes, as metamorphic rocks, help to balance "yin-yang energy" and bring awareness to perception as well as to assist in "providing insight to issues which induce internal mental battles, delivering one from the 'horns of dilemma' and the conflicts associated with willful pride." It also prompts "an admiration for the pure and beautiful, which helps one to develop a passion for life", and to open to a fuller existence.
This type of admiration and passion is generally accompanied by a great enthusiasm, and tiger's eye "can help prepare the systems of the body for the approach of enthusiasm" by acting to help "attune one to the connectedness of the brothers and sisters of the planet, releasing introversion and fear, while promoting experiences which are fresh and new." This connectedness also tends to bring increased awareness to your own personal needs and the needs of others, as well as a discernment between the "pleasure of wishing and the act of having." Consequently, it can be "used to stimulate wealth and to enhance the stability required to maintain wealth."
Physically, tiger's eye has been used in the treatment of eye, throat, and reproductive system disorders, as well as intestinal constrictions. It's also been used to help align the spinal column and to mend broken bones.
Video of Interest: "Greece: Quest for the Gods"
A few days ago I came back home from a long walk, fixed myself some lunch, and popped on PBS to keep me company while I ate. They were airing an episode of Richard Bangs' Adventures with Purpose. In fact, it was their first episode of season 3: "Greece: Quest for the Gods." I only caught the last 15 minutes or so, but I was struck by the way Bangs was interpreting his trip through Greece by way of finding elements of each of the twelve Olympians along his path. It actually brought some new light to how I view these gods.
Of course, the second the episode was finished I grabbed some paper and wrote down the information so that I could order a copy of the episode. If that interests you, you can order a DVD or Blu-Ray through Bangs' website.
Since I'm trying to watch my budget these days, I paused before committing to the $31.70 for the DVD and shipping and decided to see if anyone had uploaded the video. Sure enough, a couple YouTube users had! The following link is to the longer of the two videos, which includes the introduction and opening credits.
Gemstone: Pectolite and Larimar
April 12, 2013 March 21, 2013 / Melissa / Leave a comment
I'm of the opinion that one should know more about the minerals and gemstones than what a simple buzzword list like Roderick's offers, so I'm turning my mind back towards my reference posts of gemstones. I'll be doing my best to weave a few each month into my magical work.
Pectolite from the Millington Quarry in New Jersey
Metaphysics certainly plays favorites when it comes to popularizing crystals for energy work. Everyone and their brother probably has at least one clear quartz stone, not to mention a handful of favorites like lapis lazuli, malachite, amethyst, tiger's eye, and moonstone–not to mention any of a number of colored agates and jaspers.
I think everyone would be hard-pressed to find pectolite in a store that caters to the metaphysical crowd. It doesn't make a particularly attractive crystal or tumbled stone. In fact, it's just another white or gray hunk of volcanic rock crystals and you'd probably have to have a degree in geology to be able to differentiate it from a pile of similar looking crystals.
If you can find one, however, it can be a useful stone. As Melody from Love is in the Earth notes, it can really help people gain a more objective view of themselves, and "assist one in recognizing the 'chains' which have been self- imposed, stimulating one to release the self-constrants in order to facilitate freedom from the bondage of the materialistic world." Consequently, "it assists in precision and forthrightness in activities, and stimulates the deeper understanding of being in this world." With increased objectivity comes an inability to allow yourself to 'justify away' your reasons for doing something wrong, so it helps you admit to being guilty when you are, in fact, guilty of a wrong. The stone also "emits a love for the user that brings a sense of peace in truthfulness", which certainly acts as a balm in confession.
The objectivity the stone brings and the truthfulness that results certainly has a bevy of positive results. Salespeople, for instance, will see customers naturally gravitate toward them–for the customers will feel they can trust their salesperson. It can also temper inflated egos and therefore minimize tendencies towards belligerence and overzealousness.
Tumbled larimar stones
If pectolite's energies seem appealing, but you can't find any specimens, you may decide to search for larimar stones instead. Larimar is a type of pectolite that is only found in one tiny area of the world: a 1-square mile area of the Dominican Republic. In fact, there's only one major outcrop of the mineral, which is found in Los Chupaderos in a single mountainside. Unlike pectolites in other areas of the world, larimar is an amazing aqua-blue color that results from a substitution of copper for calcium in the crystal matrix.
Because the stone is so beautiful and so rare, it is quite pricy. Finding unpolished larimar is a rarity in the markets, as is finding any tumbled stones unless they are pale or have too many inclusions to be sold for use in jewelry. If you can find a tumbled stone, you can expect to pay upwards of $25 for a penny-sized stone. It is far easier, though more expensive, to find this special pectolite set into a piece of jewelry. Larimar also requires some special attention since its color is photosensitive and can be faded by exposure to too much heat or light.
In addition to all the properties of regular pectolite, though, larimar brings a special twist to the energy. It's popularly known as "a stone for Earth healing" since its calming blues strengthen the pectolite's already peaceful qualities and bring more clarity, healing, and love to the energetic party. Beyond helping to see one's self more objectively, adds a boost that helps to inspire and encourage one towards improvement on both the spiritual and physical planes.
Flower: Violets and Pansies
Yesterday's musing on African Violets got me to thinking about violets in general. The African Violet, Saintpaulia ionantha, is not a true violet–all of which have the genus name Viola–but it does look a lot like them with its heart-shaped leaves and flowers with two top lobes and three bottom lobes. Since so much of magical herbalism depends upon the appearance of plants (obviously their scents, edibility, and medicinal uses, too!), I figured that common violets would magically have a good bit in common with African violets. When I turned to Scott Cunningham's Encyclopedia, I was not disappointed:
Violet (Viola odorata):
Planet: Venus
Powers: Protection, Luck, Love, Lust, Wishes, Peace, Healing
Magical Uses: When the flowers are carried they offer protection against "wykked sperytis" and bring changes in luck and fortune. Mixed with lavender, they are a powerful love stimulant and also arouse lust. If you gather the first violet in the spring your dearest wish will be granted. Ancient Greeks wore the violet to calm tempers and to induce sleep. Violets fashioned into a chaplet and placed on the head cure headaches and dizziness, and the leaves worn in a green sachet help wounds to heal and prevent evil spirits from making the wounds worse.
The two violet groups share a lot of the big particulars, but the violet found in Europe has a lot more specific lore attached. It did not escape my notice that Cunningham specifically called out only one member of the Viola genus in his Violet description: Viola odorata, otherwise known as the violet species that held Victorian-era Europe in thrall. Unlike every other violet species, Viola odorata has a scent, and a fairly beguiling one at that. One perfumer describes it as "powdery, a little sweet, and decidedly sad." It shares a good deal of similarity with iris scents, particularly that of their tubers. Interestingly, a component in the scent numbs the receptors in your nose for several minutes. During that time, your sense of smell will be out-of-commission, so you won't be able to smell anything at all, not even the violet.
Viola odorata is native to Europe and Asia, but has also been introduced to North America and Australia. It is commonly known as wood violet, sweet violet, English violet, common violet, or garden violet.
There's ample lore surrounding this violet. In ancient Greece, violets were said to be sprung from the tears of Io, a nymph Zeus turned into a white cow. Only she could eat them, and they became known as "ion". Since the founder of Athens was also named Ion, the city became known as the "violet-crowned city" and violets became an emblem for Athens. Violets were said to be among the flowers that tempted Persephone away from her nymph companions and allowed Hades to abduct her, and violets grew were Orpheus slept. In Roman mythology, violets became associated with Venus. She asked her son, Cupid, if she was more beautiful that a group of girls. Cupid sided with the girls, and Venus quickly beat them black and blue and turned them into violets. Romanian culture holds that they are the remains of a little girl whose mother left her in the snow, which is why they bloom even when there is snow still on the ground. English lore holds that Violet was the name of a girl that King Frost fell in love with. His love for her thawed his heart and allowed spring to come. King Frost allows Violet to return to her people every year in the form of this flower.
Medicinally, violets also have a long history. They were frequently mentioned by Homer and Virgil, and Athenians used preparations made with violets to moderate anger, to procure sleep, and to comfort and strengthen the heart. Pliny prescribes a liniment of violet root and vinegar for gout and disorder of the spleen, and (as Cunningham mentioned) states that a garland or chaplet of violets worn about the head will dispel the fumes of wine and prevent headache and dizziness. The ancient Britons used the flowers as a cosmetic, and in a Celtic poem they are recommended to be employed steeped in goats' milk to increase female beauty, and in the Anglo-Saxon translation of the Herbarium of Apuleius (tenth century), the herb V. purpureum is recommended 'for new wounds and eke for old' and for 'hardness of the maw.' In Macer's Herbal (tenth century) the Violet is among the many herbs which were considered powerful against 'wykked sperytis.' Askham's Herbal says that if a person who cannot sleep for he is sick soaks his feet up to the ankles in a bath steeped with violets, which would then be bound to his temples after the bath, he will gain rest.
Today it is known that violets contain amounts of salicylic acid, the chief ingredient in aspirin, which accounts for its use in treating pains, fevers, and the heart. Its roots can be used to prepare an emetic and a laxative, and its leaves can form a mucilaginous substance that has been used in treating colds. Some herbcrafters have also used violets in treating skin infections and mastitis, and it has been used in the treatment of cancer tumors–particularly those of the colon, lung, and breast.
Viola sororia, known commonly as the Common Blue Violet, is native to eastern North America. It is also known by a number of common names including Common Meadow Violet, Purple Violet, Woolly Blue Violet, Hooded Violet and Wood Violet.
In America, the type of violet one is most likely to encounter is Viola sororia. It has no scent, but–like most violets–is edible. The leaves have a slight peppery flavor, which is more subtle in the flowers. Ava Chin in her New York Times column Urban Forager notes that "the first time I ate a violet, it reminded me of what I thought the rain might taste like when I was a child". The Native Americans used violet poultices as analgesics and to clear skin infections, and infusions and decoctions for respiratory issues. Constantine Samuel Rafinesque-Schmalt, in his book Medical Flora, a Manual of the Medical Botany of the United States of North America (1828–1830), wrote of Viola sororia being used by his American contemporaries for coughs, sore throats, and constipation. Its preparations are very similar to that for Viola odorata, but–being scentless–has an entirely different taste altogether.
Viola tricolor, known as heartsease, heart's ease, heart's delight, tickle-my-fancy, Jack-jump-up-and-kiss-me, come-and-cuddle-me, three faces in a hood, or love-in-idleness, is a common European wild flower. It has been introduced into North America, where it has spread widely and is known as the johnny-jump-up.
Finally, we come to heartsease, or Viola tricolor. As with other violets, it has a history of use in pain relief treatment, heart treatment, and skin diseases as well as use in respiratory problems such as bronchitis, asthma, and cold symptoms. It is also a diuretic leading to its use in treating rheumatism and cystitis. It has its own standing in folklore, as any Shakespearean scholar can attest. The bard mentioned Viola tricolor in Hamlet, when Ophelia says "There's pansies, that's for thoughts". (This was before the cultivation of the modern garden pansy, and this Viola went by that name in France, and "pensée" meant "thought".) The flower is mentioned again in A Midsummer Night's Dream. There, Oberon sends Puck to gather "a little western flower" that maidens call "love-in-idleness". Oberon's account is that he diverted an arrow from Cupid's bow aimed at "a fair vestal, throned by the west" (supposedly Queen Elizabeth I) to fall upon the plant "before milk-white, now purple with love's wound". The juice of the heartsease now, claims Oberon, "on sleeping eyelids laid, Will make or man or woman madly dote Upon the next live creature that it sees."
The pansy enjoys a lot of non-Shakespearan folklore, too. Pluck one of the upper petals, and your lover's future can be foretold by counting the veins that run through it. Four veins means there's hope; seven means forever in love; eight, a fickle lover; nine, a change of heart is on the horizon; and finally 11 (get your tissues out), an early death for the love of your life.
Should a pansy bloom in autumn, it was believed that a plague would soon follow. A pansy picked when dew is still fresh on its petals, it was believed, could cause the death of a loved one. If rain has been lacking, lore has it that if you pick a pansy, the clouds will soon open up. Dream of this tricolored beauty, and you can expect troubles to brew with a good friend.
A German legend professes the glorious fragrance of the first pansy and the people who traveled miles to take in its tantalizing scent. So many came that the grasses where the pansies grew became trampled, leaving no food for grazing cattle. The flower then turned its bloom to God and prayed for him to help the cows. God answered by taking away its fragrance and instead giving it a tricolor face. Thus today, the pansy has an adorable blossom and no scent.
Cunningham notes the following for Pansy:
Pansy (Viola tricolor)
Powers: Love, Rain Magic, Love Divination
Magical Uses: Worn or carried, the pansy draws love. It is also potent for love divinations. Plant pansies in the shape of a heart; if they prosper, so too will your love. A woman whose sailor-love goes to sea can ensure that he thinks of her by burying sea sand in the pansy bed and watering the flowers before sunrise. If pansies are picked when dew is still on them, it will soon rain.
I have no idea why this violet species has a different planetary influence than blue violets, but it is pretty clear that no matter what, you can use a violet of any sort in workings that center around love.


text:
Baraje Reveals PDP NEC Agreement Affecting Party Chairman, Ayu
Former National Chairman of the Peoples Democratic Party (PDP), Abubakar Baraje has revealed why there is much call for the party's National Chairman, Iyorchia Ayu to resign.
According to Baraje, the main opposition party has a tradition of zoning its party offices.
He further stated that the office of the National Chairman is expected to be zoned to the South if the presidential candidate comes from the North.
Baraje recalled a scenario that saw a former national chairman of the party in 2018, Ahmadu Ali go after the elections had been conducted and won.
The former chairman, during an interview on Arise TV, said the party's National Executive Committee (NEC) earlier this year during a meeting in Abuja agreed that party offices should be shared between the North and the South.
He further stated that NEC also agreed that whichever zone produced the presidential candidate should not produce the chairman.
Baraje said: "We have a tradition of zoning our party offices. It is not a new thing to us that if the presidential candidate comes from the North, the chairman comes from the South.
"What am I trying to say with those examples? It is to reinforce the fact that we have a tradition without people clamouring for it.
"We don't kill the tradition of our party. We operate by our processes and I can tell you that the processes of putting things in order have started.
"It is not as a result of agitations or cries from any corner that the chairman should resign. We have a tradition and the party must keep to that tradition.
"This is a tradition of balancing, of all-inclusiveness, of carrying every member of the PDP across the board along without fear or favour.
"We have a tradition and law and we will behave by our law. We are saying that the process is to ensure that we keep the balancing by our constitution. It is a process and we can't hurry that process beyond necessary."
PDP Leaders Mull Sanctioning Wike As Party Move To Constitute Campaign Council
'Ayu Must Resign' – Bode George Says As He Begs Wike Not To Dump PDP

redpajama_set_name: RedPajamaCommonCrawl


text:
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide a utility to topologically sort a collection of inputs.
//
//@CLASSES:
//    bdlb::TopologicalSortUtil: utility for topologically sorting inputs
//    bdlb::TopologicalSortUtilEdgeTraits: customization point for edge types
//
//@SEE ALSO:
//
//@DESCRIPTION: This component provides a utility 'struct',
// 'bdlb::TopologicalSortUtil', to topologically sort a collection of inputs
// that describe a directed acyclic graph (also known as DAG).  A topological
// sort is useful for defining the order in which an input should be processed
// based on certain conditions.  As an example, consider two jobs B and C both
// of which have a dependency on job A, i.e., job A needs to be completed
// before B or C can be run.  Given such a requirement, a topological sort can
// provide an ordering of the three jobs such that A precedes B and C.  Note
// that there may be multiple orderings that might be correct (e.g.: A, B, then
// C or A, C then B; both are correct and satisfy the dependencies of A running
// before the B and C jobs; we don't care whether B precedes C or vice versa).
//
// The dependencies are specified in pairs (U,V) (read as U precedes V), which
// define the relations between U and V that the sort needs to maintain.  The
// elements in these pairs (e.g., U and V) make up a finite set S.  The output
// of the topological sort is an ordering of all elements of set S, such that
// all relations specified in the input (as pairs) are satisfied.  Note that
// such an ordering is only possible only if there are no cycles in the input
// dependencies.  For example, if A depends on B and B depends on A, then it is
// not possible to order A and B satisfying both the relations.  The routine
// 'sort' defined in this component returns 'false' if it detects a cycle while
// trying to sort the input.
//
// Complexity of the topological sort in this component is 'O(n+m)' where n is
// the number of input elements in the finite set S and m is the number of
// relations as specified by the input pairs.
//
// The 'sort' function is provided in two variants or flavors: simple and
// iterator-based.  The simple flavor is templated on the 'NODE_TYPE', and it
// provides topological sorting for the case where the input is a 'bsl::vector'
// of 'bsl::pair's, and the outputs are 'bsl::vector's.  The templated variant
// is highly customizable (templated) on both the input and the outputs.  The
// input may be any input iterator range that has a 'bsl::pair' 'value_type' or
// a 'value_type' with a 'bdlb::TopologicalSortUtilEdgeTraits' specialization.
// The 'value_type' is determined using 'bsl::iterator::traits'.  The two
// outputs are both defined as templated output iterators and they may have
// different types.  So (for example) the iterator based 'sort' may be used
// with Null 'OUTPUT_ITER' to answer the question "does this graph have
// cycles?" while not wasting memory in storing the sort results.
//
///Self-referencing Nodes
///----------------------
// Some graph representations may use self-referencing nodes to indicate nodes
// without any connection -- where a self referencing node in the context of
// this component is a input edge pair like (u, u).  The implementation of
// 'sort' in this component treats such input entries as cycles and fails
// sorting.
//
// You may still use this 'sort' implementation (to process your nodes in
// proper order) if your data structure contains such entries.  To process a
// graph having self-referencing nodes one may create a filtering iterator on
// top of the input that removes any self-referential edges from the input.
// Any filtered nodes could be treated as being sorted first.
//
///Concepts
///--------
// This component provides generic (templated) utilities.  This section
// describes the requirements of the type parameters (concepts) of these
// generic methods.
//
///'NODE_TYPE' Concept
///- - - - - - - - - -
// The input for a topological sort is supplied as pairs (though not
// necessarily 'bsl::pair's) of 'NODE_TYPE' values.  'NODE_TYPE' is aliased to
// 'NodeType' in 'TopologicalSortUtilEdgeTraits'.
//
// 'NODE_TYPE' shall be a value type that supports hashing using the
// 'bsl::hash<NODE_TYPE>' functor type and equality comparison using the
// 'bsl::equal_to<NODE_TYPE>' functor type.
//
// Notice that we have not provided a customization point for the hash functor
// type nor for the equality functor type because that would complicate the
// code greatly (esp. readability would suffer).
//
///'EdgeType' Concept
/// - - - - - - - - -
// The 'EdgeType' describes an edge as a (conceptual) pair of 'NODE_TYPE'
// values and is supplied as the input to the topological sort methods.
// 'EdgeType' is the 'value_type' of the 'INPUT_ITER' supplied to the 'sort'
// functions.  Conceptually it represents a pair (U,V) (where U and V are
// 'NodeType's) that means "U precedes V".  The 'EdgeType' supplied to a sort
// is typically a 'bsl::pair', but users may customize this by specializing the
// 'TopologicalSortUtilEdgeTraits' type.  'TopologicalSortUtil' determines the
// 'NodeType' and access operations on 'EdgeType' via the
// 'TopologicalSortUtilEdgeTraits' type.
//
// 'TopologicalSortUtilEdgeTraits' is specialized for 'bsl::pair<T,T>', the
// user needs to (partially or fully) specialize it for other types.  See the
// 'CustomEdge' specialization in the test driver for an example.
//
///'INPUT_ITER' Concept
/// - - - - - - - - - -
// 'INPUT_ITER' is an input iterator type used by the 'sort' functions, and its
// 'value_type' is 'EdgeType' .
//
///'OUTPUT_ITER' Concept
///- - - - - - - - - - -
// 'OUTPUT_ITER' is an output iterator for 'sort' functions, and its
// 'value_type' is 'NodeType'.
//
///'UNORDERED_ITER' Concept
/// - - - - - - - - - - - -
//
// 'UNORDERED_ITER' is a (second) output iterator for 'sort' functions, and its
// 'value_type' is 'NodeType'.  Note that 'OUTPUT_ITERATOR' and
// 'UNORDERED_ITER' are distinct types allowing the sorted output nodes to be
// collected in a different way from the unsorted output nodes(e.g., into a
// different type of container).
//
///USAGE:
///-----
// This section illustrates intended use of this component.
//
///Example 1: Using Topological Sort for Calculating Formulas
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Suppose we are evaluating formulas for a set of market data fields, where
// formulas can reference other fields as part of their calculation.  As an
// example, let's say we have a field 'k_bbgDefinedVwap' that is dependent on
// 'k_vwapTurnover' and 'k_vwapVolume'.  These fields in turn are dependent on
// 'k_tradeSize' and 'k_tradePrice' respectively.  So essentially the fields
// that are not dependent on any other field should be calculated first and
// then the dependent fields.  We can use the topological sort utility to
// provide us the order in which these fields should be calculated.
//
// First, we create the relations showcasing the above mentioned dependencies
// in the form of pairs (a,b) where b is dependent on a:
//..
//  enum FieldIds {
//      k_bbgDefinedVwap  = 0,
//      k_vwapTurnover    = 1,
//      k_vwapVolume      = 2,
//      k_tradeSize       = 3,
//      k_tradePrice      = 4
//  };
//
//  bsl::vector<bsl::pair<int, int> > relations;
//
//  relations.push_back(bsl::make_pair(static_cast<int>(k_vwapTurnover),
//                                     static_cast<int>(k_bbgDefinedVwap)));
//  relations.push_back(bsl::make_pair(static_cast<int>(k_vwapVolume),
//                                     static_cast<int>(k_bbgDefinedVwap)));
//  relations.push_back(bsl::make_pair(static_cast<int>(k_tradeSize),
//                                     static_cast<int>(k_vwapVolume)));
//  relations.push_back(bsl::make_pair(static_cast<int>(k_tradeSize),
//                                     static_cast<int>(k_vwapTurnover)));
//  relations.push_back(bsl::make_pair(static_cast<int>(k_tradePrice),
//                                     static_cast<int>(k_vwapTurnover)));
//..
// Now, we call the topological sort to get a topological order for the fields
// referenced in the relations:
//..
//  bsl::vector<int> results;
//  bsl::vector<int> unordered;
//  bool             sorted = TopologicalSortUtil::sort(&results,
//                                                      &unordered,
//                                                      relations);
//..
// Finally, we verify that the call to 'sort' populates the supplied 'results'
// with a sequence in sorted order (e.g.. 'k_tradeSize', 'k_tradePrice,
// 'k_vwapTurnover', 'k_vwapVolume', 'k_bbgDefinedVwap') and 'unsorted' will be
// empty because the input relationships do not contain a cycle.
//..
//  bool calculated[5] = { 0 };
//  assert(sorted == true);
//  assert(unordered.empty());
//
//  for (bsl::vector<int>::const_iterator iter = results.begin(),
//                                        end  = results.end();
//       iter != end; ++iter) {
//      switch (*iter) {
//        case k_bbgDefinedVwap: {
//          assert(calculated[k_vwapTurnover] == true);
//          assert(calculated[k_vwapVolume]   == true);
//
//          assert(calculated[k_bbgDefinedVwap] == false);
//          calculated[k_bbgDefinedVwap] = true;
//        } break;
//        case k_vwapTurnover: {
//          assert(calculated[k_tradeSize]  == true);
//          assert(calculated[k_tradePrice] == true);
//
//          assert(calculated[k_vwapTurnover] == false);
//          calculated[k_vwapTurnover] = true;
//        } break;
//        case k_vwapVolume: {
//          assert(calculated[k_tradeSize]  == true);
//
//          assert(calculated[k_vwapVolume] == false);
//          calculated[k_vwapVolume] = true;
//        } break;
//        case k_tradeSize: {
//          assert(calculated[k_vwapVolume]   == false);
//          assert(calculated[k_vwapTurnover] == false);
//
//          assert(calculated[k_tradeSize] == false);
//          calculated[k_tradeSize] = true;
//        } break;
//        case k_tradePrice: {
//          assert(calculated[k_vwapTurnover] == false);
//
//          assert(calculated[k_tradePrice] == false);
//          calculated[k_tradePrice] = true;
//        } break;
//        default:
//          assert(false);
//          break;
//      };
//  }
//
//  for (int i = 0; i < 5; ++i) {
//      assert(calculated[i] == true);
//  }
//..
///Example 2: Using Topological Sort with Cycles in Input
/// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Suppose we have a set of inputs that contain a cycle.
//
// First, we define a set of inputs that have a cycle:
//..
//  enum FieldIds2 {
//      k_FIELD1 = 0,
//      k_FIELD2 = 1,
//      k_FIELD3 = 2
//  };
//
//  bsl::vector<bsl::pair<int, int> > relations2;
//
//  relations2.push_back(bsl::make_pair(static_cast<int>(k_FIELD2),
//                                      static_cast<int>(k_FIELD1)));
//  relations2.push_back(bsl::make_pair(static_cast<int>(k_FIELD3),
//                                      static_cast<int>(k_FIELD2)));
//  relations2.push_back(bsl::make_pair(static_cast<int>(k_FIELD1),
//                                      static_cast<int>(k_FIELD3)));
//..
// Now, we apply the topological sort routine on the input:
//..
//  bsl::vector<int> results2;
//  bsl::vector<int> unordered2;
//  bool             sorted2 = TopologicalSortUtil::sort(&results2,
//                                                       &unordered2,
//                                                       relations2);
//..
// Finally, we verify whether the routine recognizes that there is a cycle and
// returns false, and the 3 nodes comprising the cycle are reported in
// 'unordered2':
//..
//  assert(sorted2           == false);
//  assert(unordered2.size() == 3);
//..
///Example 3: Using Topological Sort with Self Relations
///- - - - - - - - - - - - - - - - - - - - - - - - - - -
// Suppose we have a set of inputs that have input relations where predecessor
// and successor point to the same value, i.e. we have pairs of input like
// (u,u).  This example demonstrates that the 'sort' function handles such
// input as a cycle.  (See Example 6 for a way of processing such nodes and
// avoiding 'sort' reporting a cycle.)  First, we define such a set of inputs:
//..
//  enum FieldIds3 {
//      k_FIELD4 = 3,
//      k_FIELD5 = 4,
//      k_FIELD6 = 5
//  };
//
//  bsl::vector<bsl::pair<int, int> > relations3;
//
//  relations3.push_back(bsl::make_pair(static_cast<int>(k_FIELD4),
//                                      static_cast<int>(k_FIELD6)));
//  relations3.push_back(bsl::make_pair(static_cast<int>(k_FIELD5),
//                                      static_cast<int>(k_FIELD4)));
//  relations3.push_back(bsl::make_pair(static_cast<int>(k_FIELD4),
//                                      static_cast<int>(k_FIELD4)));
//..
// Now, we apply the topological sort routine on the input:
//..
//  bsl::vector<int> results3;
//  bsl::vector<int> unordered3;
//  bool             sorted3 = TopologicalSortUtil::sort(&results3,
//                                                       &unordered3,
//                                                       relations3);
//..
// Finally, we verify that the self relations causes the cycle:
//..
//  assert(sorted3           == false);
//  assert(results3.size()   == 1);
//  assert(unordered3.size() == 2);
//
//  if (veryVeryVerbose) {
//      cout << "Size of results3 vector is "
//           << results3.size() << endl;
//
//      cout << "Size of unordered3 vector is "
//           << unordered3.size() << endl;
//  }
//
//  if (veryVeryVerbose)
//  {
//      for (bsl::size_t i = 0; i < results3.size(); ++i) {
//              cout << "results3[" << i << "] is " << results3[i] << "\n";
//      }
//
//      for (bsl::size_t i = 0; i < unordered3.size(); ++i) {
//              cout << "unordered3[" << i << "] is " << unordered3[i] << "\n";
//      }
//  }
//..
///Example 4: Using Topological Sort with Iterators as Input
///- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Suppose we have a set of inputs that have input relations that conceptually
// follow the input requirements (of a listing of pairs of nodes) but are not
// physically stored in a 'bsl::vector' of 'bsl::pair' typed container.  Let's
// suppose the input is in a 'bsl::list' instead.  First, we define such a set
// of inputs:
//..
//  bsl::list<bsl::pair<int, int> > relations4;
//
//  relations4.push_back(bsl::make_pair(1, 2));
//  relations4.push_back(bsl::make_pair(1, 3));
//  relations4.push_back(bsl::make_pair(2, 3));
//..
// Now, we apply the topological sort routine on the input:
//..
//  bsl::vector<int> results4;
//  bsl::vector<int> unordered4;
//  typedef bsl::back_insert_iterator<bsl::vector<int> > OutIter;
//  bool sorted4 = TopologicalSortUtil::sort(relations4.begin(),
//                                           relations4.end(),
//                                           OutIter(results4),
//                                           OutIter(unordered3));
//..
// Finally, we verify that the sort is successful, there are no nodes in the
// 'unordered' output (there is no cycle) and the nodes are listed in the
// proper order in 'results4':
//..
//  assert(sorted4           == true);
//  assert(unordered4.size() == 0);
//  assert(results4.size()   == 3);
//
//  assert(results4[0] == 1);
//  assert(results4[1] == 2);
//  assert(results4[2] == 3);
//..
///Example 5: Using Topological Sort with Iterators as Output
///- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Suppose we want our result in a 'bsl::list' instead of a 'bsl::vector' and
// we do not care about the unordered elements so we do not want to pay for
// storing them if they exist.  First, we would define a Null Output Iterator
// that writes to nowhere:
//..
//  class NullOutputIterator {
//    public:
//      typedef void container_type;
//      typedef void value_type;
//      typedef void difference_type;
//      typedef void pointer;
//      typedef void reference;
//      typedef bsl::output_iterator_tag iterator_category;
//
//      template <class T>
//      NullOutputIterator& operator=(const T&)
//      {
//          return *this;
//      }
//
//      NullOutputIterator& operator*()
//      {
//          return *this;
//      }
//
//      NullOutputIterator& operator++()
//      {
//          return *this;
//      }
//
//      NullOutputIterator& operator++(int)
//      {
//          return *this;
//      }
//  };
//..
// Now, we apply the topological sort routine on the input:
//..
//  bsl::list<int> results5;
//  typedef bsl::back_insert_iterator<bsl::list<int> > ListOutIter;
//  bool sorted5 = TopologicalSortUtil::sort(relations4.begin(),
//                                           relations4.end(),
//                                           ListOutIter(results5),
//                                           NullOutputIterator());
//..
// Finally, we verify that the sort is successful, and the 3 nodes are listed
// in the proper order in the 'results5' list:
//..
//  assert(sorted5           == true);
//  assert(results5.size()   == 3);
//
//  assert(results5[0] == 1);
//  assert(results5[1] == 2);
//  assert(results5[2] == 3);
//..

#ifndef INCLUDED_BDLSCM_VERSION
#include <bdlscm_version.h>
#endif

#ifndef INCLUDED_BSLMA_ALLOCATOR
#include <bslma_allocator.h>
#endif

#ifndef INCLUDED_BSLMA_USESBSLMAALLOCATOR
#include <bslma_usesbslmaallocator.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif

#ifndef INCLUDED_BSL_VECTOR
#include <bsl_vector.h>
#endif

#ifndef INCLUDED_BSL_QUEUE
#include <bsl_queue.h>
#endif

#ifndef INCLUDED_BSL_UNORDERED_MAP
#include <bsl_unordered_map.h>
#endif

#ifndef INCLUDED_BSL_UTILITY
#include <bsl_utility.h>
#endif

#ifndef INCLUDED_BSL_ITERATOR
#include <bsl_iterator.h>
#endif

namespace BloombergLP {
namespace bdlb {

                    // ===================================
                    // class TopologicalSortUtilEdgeTraits
                    // ===================================

template <class EDGE_TYPE>
struct TopologicalSortUtilEdgeTraits {
    // This 'struct' represents a customization point allowing clients to
    // supply input iterators to 'sort' working on types other than 'pair'.
    // Clients may specialize 'TopologicalSortUtilEdgeTraits' to supply the
    // following:
    //..
    //  typedef EDGE_TYPE EdgeType;
    //      // The type of the directed connection from one node to another
    //
    //  typedef user-defined NodeType;
    //      // Alias describing the output values from a sort, as well as the
    //      // results of the 'from' and 'to' functions of this edge traits
    //      // instance.  Or in other words, the node (identifier) type of the
    //      // directed acyclic graph.
    //
    //  static const NodeType& from(const EDGE_TYPE& input);
    //      // Return a 'const' reference to the "from" attribute of the
    //      // specified 'input'.  Note that the template parameter type
    //      // 'EDGE_TYPE' is an element in the input range to 'sort'.
    //
    //  static const NodeType& to(const EDGE_TYPE& input)
    //      // Return a 'const' reference to the "from" attribute of the
    //      // specified 'input'.  Note that the template parameter type
    //      // 'EDGE_TYPE' is an element in the input range to 'sort'.
    //..
};

template <class NODE_TYPE>
struct TopologicalSortUtilEdgeTraits<bsl::pair<NODE_TYPE, NODE_TYPE> > {
    // This 'struct' is a specialization (customization) of
    // 'TopologicalSortUtilEdgeTraits' for bsl::pair<T, T>.

    // TYPES
    typedef bsl::pair<NODE_TYPE, NODE_TYPE> EdgeType;
        // The type of the directed connection from one node to another

    typedef NODE_TYPE NodeType;
        // The type of values of the nodes of the directed acyclic graph

    // CLASS METHODS
    static const NODE_TYPE& from(const EdgeType& edge);
        // Return a 'const' reference to the 'from' attribute of the specified
        // 'edge' object.

    static const NODE_TYPE& to(const EdgeType& edge);
        // Return a 'to' reference to the 'from' attribute of the specified
        // 'edge' object.
};

                        // ================================
                        // class TopologicalSortUtil_Helper
                        // ================================

template <class INPUT_ITER>
class TopologicalSortUtil_Helper {
    // This class template provides data structures required to sort the
    // partial unordered pairs into a total ordered set.  The value type of the
    // nodes(*) must be hashable and equality comparable by 'bsl::hash', and
    // 'bsl::equal_to' respectively.
    //
    // (*) The value type is determined by first getting the iterator's value
    //     type using 'bsl::iterator_traits<INPUT_ITER>::ValueType' and then
    //     using 'TopologicalSortUtilEdgeTraits::ValueType' on that result.

    // PRIVATE TYPES
    typedef typename bsl::iterator_traits<INPUT_ITER>::value_type
                                                                 IteratorValue;
    typedef TopologicalSortUtilEdgeTraits<IteratorValue>         EdgeTraits;
    typedef typename EdgeTraits::NodeType                        NodeType;

    struct NodeInfo {
        // PUBLIC DATA
        int                   d_predecessorCount;
        bsl::vector<NodeType> d_successors;        // successors list

        // TRAITS
        BSLMF_NESTED_TRAIT_DECLARATION(NodeInfo, bslma::UsesBslmaAllocator);

        // CREATORS
        explicit NodeInfo(bslma::Allocator *allocator = 0);
            // Create a 'NodeInfo' which holds the predecessor and successor
            // information of an input element.  Optionally, specify an
            // 'allocator' for needed memory.  If 'allocator' is 0, use the
            // globally supply default allocator instead.

        NodeInfo(const NodeInfo& original, bslma::Allocator *allocator = 0);
            // Create a 'NodeInfo' object having the same value as the
            // specified 'original' object.  Optionally specify an 'allocator'
            // used to supply memory.  If 'allocator' is 0, the currently
            // installed default allocator is used.
    };

    typedef bsl::unordered_map<NodeType, NodeInfo> SetInfo;

    // DATA
    SetInfo              d_setInfo;      // additional data structure needed
                                         // for topologically sorting the
                                         // elements

    bsl::queue<NodeType> d_orderedNodes;  // elements that are not dependent
                                          // on any other

    bool                 d_hasCycle;     // flag denoting whether cycles are
                                         // present
  private:
    // NOT IMPLEMENTED
      TopologicalSortUtil_Helper(const TopologicalSortUtil_Helper&);
      TopologicalSortUtil_Helper& operator=(const TopologicalSortUtil_Helper&);

  public:
    // TRAITS
    BSLMF_NESTED_TRAIT_DECLARATION(
                        TopologicalSortUtil_Helper, bslma::UsesBslmaAllocator);

    // CREATORS
    explicit TopologicalSortUtil_Helper(INPUT_ITER        relationsBegin,
                                        INPUT_ITER        relationsEnd,
                                        bslma::Allocator *allocator = 0);
        // Create a helper class that holds the different data structures
        // required to sort in topological order the directed acyclic graph
        // described by the specified 'relationsBegin' and 'relationsEnd'.
        // Optionally, specify an 'allocator' for needed memory.  If
        // 'allocator' is 0, use the globally supply default allocator instead.

    // MANIPULATORS
    template <class RESULT_ITER>
    bool processNext(RESULT_ITER result);
        // Load an element that doesn't have any predecessors into the
        // specified 'result'.  Return 'false' if there is no such element left
        // or the input set is fully processed else return 'true'.  Note that
        // if this method detects cycles in the input set it will set the
        // 'hasCycle' flag to 'true' and return 'false'.

    // ACCESSORS
    bool hasCycle() const;
        // Return 'true' if relations specified at construction time contains a
        // cycle, otherwise returns 'false'.  The behavior is undefined unless
        // 'processNext' has been called, and the most recent invocation of
        // 'processNext' returned 'false'.

    template <class UNORDERED_ITER>
    void unordered(UNORDERED_ITER unordered) const;
        // Load elements that have not been sorted to the specified
        // 'unordered'.  Note that the behavior is undefined if this method is
        // called before the sort routine is finished (determined by
        // 'processNext' method returning 'false') and it has been determined
        // that there is a cycle that can be found by using the 'hasCycle'
        // method.
};

                        // =====================
                        // class TopologicalSort
                        // =====================

struct TopologicalSortUtil {
    // This 'struct' 'TopologicalSortUtil' provides a namespace for topological
    // sorting functions.

  public:
    // CLASS METHODS
    template <class INPUT_ITER, class RESULT_ITER, class UNORDERED_ITER>
    static bool sort(INPUT_ITER        relationsBegin,
                     INPUT_ITER        relationsEnd,
                     RESULT_ITER       result,
                     UNORDERED_ITER    unordered);
        // Sort the input elements in topological order and load the resulting
        // linear ordered set into the specified 'result' output, and if the
        // sort is unsuccessful (the input is not an acyclic directed graph)
        // load the elements that have not been ordered to the specified
        // 'unordered' output; the input elements are provided (conceptually)
        // as a sequence of pairs between the specified 'relationsBegin' and
        // 'relationsEnd', where the "from" element of the pair must precede
        // the "to" element in the resulting sort (see
        // 'TopologicalSortUtilEdgeTraits' for description of "from" and "to").
        // Return 'true' on success, and 'false' if the sort fails due to a
        // cycle in the input.  The input ('relationshipBegin' and
        // 'relationshipEnd') is provided as a sequence of (conceptual or
        // physical) pairs of the form (U, V) where U precedes V in the output.
        // The type 'bsl::iterator_traits<INPUT_ITER>::value_type' must either
        // be 'bsl::pair' where the 'first_type' and 'second_type' are the same
        // as 'bsl::iterator_traits<OUTPUT_ITER>::value_type' or
        // 'TopologicalSortUtilEdgeTraits' must be specialized for the type,
        // i.e., the supplied 'bsl::iterator_traits<INPUT_ITER>::value_type'
        // must support the following syntax:
        //..
        //  typedef typename bsl::iterator_traits<INPUT_ITER>::value_type
        //                                                           IterValue;
        //  typedef typename bsl::iterator_traits<RESULT_ITER>::value_type
        //                                                         ResultValue;
        //
        //  typedef typename TopologicalSortUtilEdgeTraits<IterValue>   Traits;
        //
        //  typedef typename Traits::NodeType NodeType;
        //
        //  for (INPUT_ITER it  = relationshipPairsBegin;
        //                  it != relationshipPairsEnd;
        //                  ++it) {
        //
        //      *result++ = Traits::from(*it);
        //      *result++ = Traits::to(*it);
        //  }
        //..
        // Note that even if the method returns 'false', 'result' may contain a
        // subset of elements in the right topological order, essentially
        // elements that the routine was able to sort before the cycle was
        // discovered and 'unordered' will contain the elements that the
        // routine was unable to sort.

    template <class NODE_TYPE>
    static bool sort(
           bsl::vector<NODE_TYPE>                               *result,
           bsl::vector<NODE_TYPE>                               *unorderedList,
           const bsl::vector<bsl::pair<NODE_TYPE, NODE_TYPE> >&  relations);
        // Sort the elements of 'NODE_TYPE' in topological order determined by
        // the specified 'relations' and load the resulting linear ordered set
        // to the specified 'result'.  If the sort is unsuccessful, load the
        // elements that have not been ordered to the specified 'unorderedList'
        // list.  The input relations are provided as pairs of the form (U, V)
        // where U precedes V in the output.  Return 'false' if sort fails due
        // to a cycle in the input else return 'true' if sort successful.  Note
        // that even if the method returns 'false', 'result' may contain a
        // subset of elements in the right topological order, essentially
        // elements that the routine was able to sort before the cycle was
        // discovered and 'unorderedList' will contain the elements that the
        // routine was unable to sort.
};

// ============================================================================
//                 INLINE AND TEMPLATE FUNCTION DEFINITIONS
// ============================================================================

                   // -----------------------------------
                   // class TopologicalSortUtilEdgeTraits
                   // -----------------------------------

template <class NODE_TYPE>
inline
const NODE_TYPE&
TopologicalSortUtilEdgeTraits<bsl::pair<NODE_TYPE, NODE_TYPE> >::
from(const EdgeType& edge)
{
    return edge.first;
}

template <class NODE_TYPE>
inline
const NODE_TYPE&
TopologicalSortUtilEdgeTraits<bsl::pair<NODE_TYPE, NODE_TYPE> >::
to(const EdgeType& edge)
{
    return edge.second;
}

                 // ------------------------------------------
                 // class TopologicalSortUtil_Helper::NodeInfo
                 // ------------------------------------------

// CREATORS
template <class INPUT_ITER>
inline
TopologicalSortUtil_Helper<INPUT_ITER>::NodeInfo::NodeInfo(
                                                   bslma::Allocator *allocator)
: d_predecessorCount(0)
, d_successors(allocator)
{
}

template <class INPUT_ITER>
inline
TopologicalSortUtil_Helper<INPUT_ITER>::NodeInfo::NodeInfo(
                                                   const NodeInfo&   original,
                                                   bslma::Allocator *allocator)
: d_predecessorCount(original.d_predecessorCount)
, d_successors(original.d_successors, allocator)
{
}
                      // --------------------------------
                      // class TopologicalSortUtil_Helper
                      // --------------------------------

// CREATORS
template <class INPUT_ITER>
TopologicalSortUtil_Helper<INPUT_ITER>::TopologicalSortUtil_Helper(
                                              INPUT_ITER        relationsBegin,
                                              INPUT_ITER        relationsEnd,
                                              bslma::Allocator *allocator)
: d_setInfo(allocator)
, d_orderedNodes(allocator)
, d_hasCycle(false)
{
    // Iterate through the partial ordered set and create the input from the
    // pairs

    for (INPUT_ITER iter = relationsBegin; iter != relationsEnd; ++iter) {
        const NodeType& from = EdgeTraits::from(*iter);
        const NodeType& to = EdgeTraits::to(*iter);
        ++d_setInfo[to].d_predecessorCount;
        d_setInfo[from].d_successors.push_back(to);
    }

    // Now iterate through the set and find nodes that are independent i.e.
    // which don't have any predecessors and hence are already ordered.  We put
    // these nodes into a non dependent elements queue.

    typename SetInfo::const_iterator setIter = d_setInfo.begin();
    for (; setIter != d_setInfo.end(); ++setIter ) {
        if (0 == setIter->second.d_predecessorCount) {
            d_orderedNodes.push(setIter->first);
        }
    }
}

// MANIPULATORS
template <class INPUT_ITER>
template <class RESULT_ITER>
bool TopologicalSortUtil_Helper<INPUT_ITER>::processNext(RESULT_ITER result)
{
    // process element with no predecessors

    if (! d_orderedNodes.empty()) {

        NodeType                   processed = d_orderedNodes.front();
        typename SetInfo::iterator processedNode = d_setInfo.find(processed);

        // iterate through the successor list of the node and reduce
        // predecessor count of each successor.  Further if this count becomes
        // zero add it 'd_orderedNodes'.

        const NodeInfo&                                 processedNodeInfo =
                                                         processedNode->second;
        typename bsl::vector<NodeType>::const_iterator  sListIter =
                                      (processedNodeInfo.d_successors).begin();
        typename bsl::vector<NodeType>::const_iterator  endIter =
                                        (processedNodeInfo.d_successors).end();

        for (; sListIter != endIter; ++sListIter) {

            typename SetInfo::iterator successor =
                                                  d_setInfo.find((*sListIter));
            NodeType                   sValue = successor->first;
            NodeInfo&                  sNodeInfo = successor->second;

            // update predecessor count

            --(sNodeInfo.d_predecessorCount);

            // add node to ordered if all predecessors processed

            if ((sNodeInfo.d_predecessorCount) == 0) {
                d_orderedNodes.push(sValue);
            }
        }

        // remove this node from the set since its already processed

        d_setInfo.erase(processedNode);

        // remove this node from the d_orderedNodes and return

        *result = processed;
        d_orderedNodes.pop();
        return true;                                                  // RETURN
    }

    // If the queue is empty but the input set is not then we have at least one
    // cycle.  Set the flag and return.

    d_hasCycle = !d_setInfo.empty();

    return false;
}

// ACCESSORS
template <class INPUT_ITER>
inline
bool TopologicalSortUtil_Helper<INPUT_ITER>::hasCycle() const
{
    return d_hasCycle;
}

template <class INPUT_ITER>
template <class UNORDERED_ITER>
    void TopologicalSortUtil_Helper<INPUT_ITER>::unordered(
                                            UNORDERED_ITER unorderedList) const
{

    BSLS_ASSERT(d_hasCycle == true);

    // load unorderedList that the elements that are still present in the set

    for (typename SetInfo::const_iterator elemIter = d_setInfo.begin(),
                                          endIter  = d_setInfo.end();
                                          elemIter != endIter; ++ elemIter) {
        *unorderedList = elemIter->first;
        ++unorderedList;
    }
}

                        // -------------------------
                        // class TopologicalSortUtil
                        // -------------------------

// MANIPULATORS
template <class INPUT_ITER, class RESULT_ITER, class UNORDERED_ITER>
bool TopologicalSortUtil::sort(INPUT_ITER        relationsBegin,
                               INPUT_ITER        relationsEnd,
                               RESULT_ITER       result,
                               UNORDERED_ITER    unordered)
{
    TopologicalSortUtil_Helper<INPUT_ITER> tSortHelper(relationsBegin,
                                                       relationsEnd);

    while (tSortHelper.processNext(result));

    if (tSortHelper.hasCycle()) {
        // load unorderedList with unordered elements

        tSortHelper.unordered(unordered);
        return false;                                                 // RETURN
    }
    return true;
}

template <class NODE_TYPE>
bool TopologicalSortUtil::sort(
           bsl::vector<NODE_TYPE>                               *result,
           bsl::vector<NODE_TYPE>                               *unorderedList,
           const bsl::vector<bsl::pair<NODE_TYPE, NODE_TYPE> >&  relations)
{
    typedef bsl::vector<NODE_TYPE> vector_type;

    return sort(relations.begin(),
                relations.end(),
                bsl::back_insert_iterator<vector_type>(*result),
                bsl::back_insert_iterator<vector_type>(*unorderedList));
}

}  // close package namespace
}  // close enterprise namespace

#endif

// ----------------------------------------------------------------------------
// NOTICE:
//      Copyright (C) Bloomberg L.P., 2017
//      All Rights Reserved.
//      Property of Bloomberg L.P. (BLP)
//      This software is made available solely pursuant to the
//      terms of a BLP license agreement which governs its use.
// ----------------------------- END-OF-FILE ----------------------------------

redpajama_set_name: RedPajamaGithub