Is there any instance of Shiva showing his vishwaroopa in the Mahabharata?

Question: In Mahabharata, Krishna/Vishnu shows his vishwaroopa four times. Is there a similar instance of Shiva showing his vishwaroopa? This question is specific to Mahabharata.
Answer: Yes.
From Drona Parva (Section CCI):

Vyasa said, 'O highly significant is this matter that thou enquirest of me from surprise. I will tell thee everything; listen attentively. He that is called Narayana is older than the oldest ones. For accomplishing some purpose, that creator of the universe took his birth as the son of Dharma. On the mountain of Himavat he underwent the severest ascetic austerities. Endued with mighty energy, and resembling fire or the sun (in splendour), he stood there with arms upraised. Possessed of eyes like: lotus-petals, he emaciated himself there for sixty-six thousand years, subsisting all the while upon air alone. Once more undergoing severe austerities of another kind for twice that period, he filled the space between earth and heaven with his energy. When by those austerities, O sire, he became: like Brahma he then beheld the Master, Origin, and Guardian of the Universe, the Lord of all the gods, the Supreme Deity, who is exceedingly difficult of being gazed at, who is minuter than the minutest and larger than, the largest, who is called Rudra, who is the lord of all the superior ones, who is called Hara and Sambhu, who has matted locks on his head, who is the infuser of life into every form, who is the First cause of all immobile: and mobile things, who is irresistible and of frightful aspect, who is of fierce wrath and great Soul, who is the All-destroyer, and of large heart; who beareth the celestial bow and a couple of quivers, who is cased in golden armour, and whose energy is infinite, who holdeth Pinaka, who is; armed with thunderbolt, a blazing trident, battle axe, mace, and a large sword; whose eye-brows are fair, whose locks are matted, who wieldeth the heavy short club, who hath the moon on his forehead, who is clad in tiger-skin, and who is armed with the bludgeon; who is decked with beautiful angadas, who hath snakes for his sacred thread, and who is surrounded by diverse creatures of the universe and by numerous ghosts and spirits, who is the One, who is the abode of ascetic austerities, and who is highly adored by persons of venerable age; who is Water, Heaven, Sky, Earth, Sun, Moon, Wind and Fire, and who is the measure of the duration of the universe. Persons of wicked behaviour can never obtain a sight of that unborn one, that slayer of all haters of Brahmanas, that giver of emancipation. Only Brahmanas of righteous conduct, when cleansed of their sins and freed from the control of grief, behold him with their mind's eye. In consequence of his ascetic austerities, Narayana obtained a sight of that unfading one, that embodiment of righteousness, that adorable one, that Being having the universe for his form.
Beholding that supreme Abode of all kinds of splendour, that God with a garland of Akshas round his neck, Vasudeva, with gratified soul, became filled with delight which he sought to express by words, heart, understanding, and body. Then Narayana worshipped that Divine Lord, that First cause of the universe, that giver of boons, that puissant one sporting with the fair-limbed Parvati, that high-souled Being surrounded by large bands of ghosts, spirits, that Unborn one, that Supreme Lord, that Embodiment of the unmanifest, that Essence of all causes, that One of unfading power. Having saluted Rudra, that destroyer of the Asura Andhaka, the lotus eyed Narayana, with emotion filling his heart, began to praise the Three-eyed one (in these words), 'O adorable one, O first of all the gods, the creator of everything (viz., the Prajapatis) who are the regents of the world, and who having entered the earth,--thy first work,--had, O lord, protected it before, have all sprung from thee. Gods, Asuras, Nagas, Rakshasas, Pisachas, human beings, birds, Gandharvas, Yakshas and other creatures: with the entire universe, we know, have all sprung from thee. Everything that is done for propitiating Indra, and Yama, and Varuna, and Kuvera and Pitris and Tvashtri, and Soma, is really offered to thee. Form and light, sound and sky, wind and touch, taste and water, scent and earth, 1 time, Brahma himself, the Vedas, the Brahmanas and all these mobile objects, have sprung from thee. Vapours rising from diverse receptacles of water, becoming rain-drops, which failing upon the earth, are separated from one another. When the time of the Universal dissolution comes those individual drops, separated from one another, once more unite together and make the earth one vast expanse of water. He that is learned, thus observing the origin and the destruction, of all things, understands thy oneness. Two birds (viz., Iswara and Jiva), four Aswatthas with their wordy branches (viz., the Vedas), the seven guardians (viz., the five essences or elements and the heart and the understanding), and the ten others that hold this city (viz., the ten senses that constitute the body), have all been created by thee, but thou art separate from and independent of them. The Past, the Future, and the Present, over each of which none can have any sway, are from thee, as also the seven worlds and this universe. I am thy devoted adorer,--be graceful unto me. Do not injure me, by causing evil thoughts to penetrate my heart. Thou art the Soul of souls, incapable of being known. He that knows thee as the Universal Seed, attaineth to Brahma. Desiring to pay thee respects, I am praising thee, endeavouring to ascertain thy real nature, O thou that art incapable of being understood by the very gods. Adored by me, grant me the boons I desire but which are difficult of acquisition. Do not hide thyself in thy illusion

And in the most amazing bit in all of Hindu scripture he gives a boon to Narayana that if even he fought him (Siva) he (Narayana) would be victorious !
In the same Drona Parva, we have:

In the Vedas the excellent hymn called Sata Rudriya, hath been sung in honour of that great God called the infinite Rudra. That God is the lord of all wishes that are human and heavenly. He is omnipotent, and he is the supreme master. Indeed, that God pervadeth the vast universe. The Brahmanas and the Munis describe him as the First-born of all creatures. He is the First of all the gods; from his mouth was born Vayu (the wind). And since he always protecteth the creatures (of the universe) and sporteth with them, and since also he is the lord of all creatures, therefore is he called Pasupati. And since his Phallic emblem is always supposed to be in the observance of the vow of Brahmacharya, and since he always gladden the world, therefore he is called Maheswara. The Rishis, the gods, the Gandharvas, and Apsaras, always worship his Phallic emblem which is supposed to stand upright. That worship maketh Maheswara glad. Indeed, Sankara (at such worship) becomes happy, pleased, and highly glad. And since with respect to the past, the future, and the present, that God has many forms, he is, on that account, called Vahurupa (many-formed). Possessed of one eye he blazeth forth in effulgence, or he may be regarded to have many eyes on every side of his body. And since, he possesseth the worlds, he is for that reason called Sarva. And since his form is like that of smoke, he is for that reason called Dhurjjati. And since those deities, viz., the Viswedevas are in him, he is for that reason called Viswarupa.

http://www.sacred-texts.com/hin/m03/m03039.htm
And when Arjuna obtains the Pashupata weapon Siva appears in a form that Arjuna needed special eyes to see:

I will grant thee eyes (to see me in my true form). Thou wert a Rishi before. Thou wilt vanquish all thy foes, even the dwellers of heaven; I will as I have been pleased with thee, grant thee an irresistible weapon. Soon shall thou be able to wield that weapon of mine."
Vaisampayana continued, "Phalguna then beheld him--Mahadeva--that god of blazing splendour-that wielder of the Pinaka-that one who had his abode on the mountains (of Kailasa)--accompanied by Uma.

And here is another instance:
http://www.sacred-texts.com/hin/m07/m07198.htm

"Sanjaya, said, 'After the rout of the Kuru army, upon the slaughter of that Atiratha, viz., Drona, by Prishata's son, Dhananjaya, the son of Kunti beholding a wonderful phenomenon in connection with his own victory, asked Vyasa, O bull of Bharata's race, who came thither in course of his wanderings, saying, 'O great Rishi, while I was engaged in slaying the foe in battle with showers of bright shafts, I continually beheld before me, proceeding in advance of my car, a person of blazing hue, as if endued with the effulgence of fire. Whithersoever he proceeded with his uplifted lance, all the hostile warriors were seen to break before him. Broken in reality by him, people regarded the foe to have been broken by me. Following in his wake, I only destroyed those, already destroyed by him. O holy one, tell me who was that foremost of persons, armed with lance, resembling the sun himself in energy, that was thus seen by me? He did not touch the earth with his feet, nor did he hurl his lance even once. In consequence of his energy, thousands of lances issued out of that one lance held by him.'
"Vyasa said, 'Thou hast, O Arjuna, seen Sankara, that First cause from which have sprung the Prajapatis, that puissant Being endued with great energy, he that is the embodiment of heaven, earth and sky, the Divine Lord, the protector of the universe, the great Master, the giver of boons, called also Isana. O, seek the protection of that boon, giving Deity, that lord of the universe. He is called Mahadeva (the Supreme Deity), of Supreme Soul, the one only Lord, with matted locks (on head), the abode of auspiciousness. Of three eyes and mighty arms, he is called Rudra, with his locks tied in the shape of a crown, and his body attired in skins. That boon-giving lord of the universe, that Supreme Deity, is also called Hara and Sthanu. He is the foremost of every being in the universe, he is incapable of being vanquished, he is the delighter of the universe and its supreme ruler. The first cause, the light and refuge of the universe, he is ever victorious. The Soul and the creator of the universe, and having the universe for his form, he is possessed of great fame. The Lord of the universe, and its great Ruler, that puissant one, is also the master of all actions. Called also Sambhu, he is self-born, he is the lord of all creatures,
Comment: I don't think ANY scripture has Siva showing everything inside him like Hanuman tearing his chest apart to reveal Rama and Sita or Krishna showing everything inside his Vishwarupa.  Siva is CALLED Viswarupa in the Mahabharata.
Comment: I am a little confused. Does the Mahabharata call this form of Shiva as his viswaroopa?
Comment: This is only an account of Shiva showing Viswarupa at some other time, but not during Mahabharata to any of the MB characters? I think the question is asking, if he showed his infinite form during the MB?
Comment: Thanks so much. I was totally unaware of this.
Comment: I do not see any clear reference to his Viswarupa form in this answer. I only know this form from the Shiva gita.
Comment: Arjuna needed special eyes to see him when he got the Pashupata weapon @sv.
Comment: Yeah, more like that incident @SK
Answer: Yes,
Mahabharat verily describes Lord Shiva as Viswarupam. Besides Mahabharata there are other Scriptures (From Vedas to Puraanas) where Lord Shiva is described as having Universal Form.
But as Question is specifically addressed toward Mahabharata, answer is having more reference from Mahabharata Only.

"vadantyagnı̃ mahādēvaṁ tathā sthāṇũ mahēśvaram |
   caiva VIŚVARŪPAṁ śivaṁ tathā ||"
"The Rishis describe Mahadeva as Agni, and Sthanu, and Maheswara; as one-eyed, and three-eyed, of UNIVERSAL FORM, and Siva or highly auspicious. "ēkākṣaṁ tryambakaṁ

http://www.sacred-texts.com/hin/m13/m13b126.htm
There are other instances as well.

Salutations to thee that art the destroyer of the triple city of the Asuras, to thee that art the destroyer of (Daksha's) sacrifice, to thee that art the destroyer of the body of Kama (the deity of Desire), to thee that wieldest the rod of destruction. Salutations to thee that art Skanda, to thee that art Visakha, to thee that art the rod of the Brahmana, to thee that art Bhava, to thee that art Sarva, to thee that art of universal form.

Reference - https://www.sacred-texts.com/hin/m13/m13a014.htm
Again Bhisma, in Mahabharat says

"Bhishma said, 'I am quite incompetent to recite the virtues of Mahadeva of highest intelligence. He pervades all things in the universe and yet is not seen anywhere. He is the creator of universal self and the Pragna (knowing) self and he is their master. All the deities, from Brahman to the Pisachas, adore and worship him. He transcends both Prakriti and Purusha. It is of Him that Rishis, conversant with Yoga and possessing a knowledge of the tattwas, think and reflect. He is indestructible and Supreme Brahman.

Reference: - https://www.sacred-texts.com/hin/m13/m13a014.htm
Even Veda-Vyasa mentions Vishwarropam of Mahadeva.

"Beholding Maheswara, and knowing that he was the Supreme Being, the Grandsire Brahma thus adored him: Thou art Sacrifice, O lord, thou art the stay and refuge of the universe. Thou art Bhava, thou art Mahadeva, thou art the abode (of all things), and thou art the highest refuge. This whole universe with its mobile and immobile creatures, is pervaded by thee. O holy one, O lord of the past and the future, O lord of the world, O protector of the universe, let Sakra, afflicted with thy wrath, have thy grace.'

Reference: - https://www.sacred-texts.com/hin/m07/m07198.htm
Bhisma himself admitted that he cannot comprehend the Mahadeva and hence asked Shri Krishna for the same. Clearly Bhisma was well aware of Shiva's Universal form.

"Bhishma said, 'Thou art the Master of all the deities and the Asuras. Thou art illustrious. Thou art Vishnu in consequence of thy pervading the whole universe. It behoveth thee to discourse on those subjects connected with Siva of universal form about which Yudhishthira has asked me. In days of yore, the Rishi Tandin, sprung from Brahma, recited in Brahma's region and before Brahma himself the thousand names of Mahadeva. Do thou recite those names before this conclave so that these Rishis endued with wealth of asceticism, observant of high vows, possessed of self-restraint, and numbering the Island-born Krishna among them, may hear thee. Do thou discourse on the high blessedness of Him who is immutable, who is always cheerful and happy, who is Hotri, who is the universal Protector, who is Creator, of the universe, and who is called Mundin and Kaparddin.'

Ref: - https://www.sacred-texts.com/hin/m13/m13a014.htm
There are other references as well.

My mother said, 'Mahadeva is exceedingly difficult to be known by persons of uncleansed souls. These men are incapable of bearing him in their hearts of comprehending him at all. They can retain him in their minds. They cannot seize him, nor can they obtain a sight of him. Men of wisdom aver that his forms are many. Many, again, are the places in which he resides. Many are the forms of his Grace. Who is there that can understand in their details the acts, which are all excellent, of Isa, or of all the forms that he has assumed in days of yore? Who can relate how Sarva sports and how he becomes gratified? Maheswara of universal form resides in the hearts of all creatures.

Further She also reveals Mahadeva of thousands (Infinite) hands, feet, head and stomachs.

It is Mahadeva who bears the forms of persons with sticks and those with umbrellas and those with calabashes among Brahmanas. 1 He sometimes becomes six-faced and sometimes becomes multifaced. He sometimes assumes forms having three eyes and forms having many heads. And he sometimes assumes forms having many millions of legs and forms having innumerable stomachs and faces and forms endued with innumerable arms and innumerable sides. He sometimes appears surrounded by innumerable spirits and ghosts.

Ref: - https://www.sacred-texts.com/hin/m13/m13a014.htm
Now quoting reference from Vedas.

अर्हन बिभर्षि सायकानि धन्वार्हन निष्कं यजतं विश्वरूपम |
    अर्हन्निदं  दयसे विश्वमभ्वं न वा ओजीयो रुद्र तवदस्ति ||
Worthy, thou carriest thy bow and arrows, worthy, thy manyhued and honoured necklace. Worthy, thou cuttest here each fiend to pieces: a mightier than thou there is not, Rudra.

Ref: - http://www.sacred-texts.com/hin/rvsan/rv02033.htm
Further more there is entire Sata-Rudriyam hymn present in the taittiriya Samhita of Yajurveda.

https://sanskritdocuments.org/doc_shiva/rudram.html?lang=sa

The above quoted URL is of Namakam Portion of Rudram where Universal Form of Mahadeva is described in details.
Coming to Puraanas,
In the Kurma-Puraana there is Ishwar Gita where Lord Shiva shows his Universal Form.

सहस्रशिरसं देवं सहस्रचरणाकृतिम् ।
  चन्द्रार्धकृतशेखरम् ॥ ५.८॥
दण्डपाणिं त्रयीनेत्रं सूर्यसोमाग्निलोचनम् ॥ ५.९॥
स्वेन सर्वमावृत्य च स्थितम् ।
  सूर्यकोटिसमप्रभम् ॥ ५.१०॥
  । सृजन्तमनलज्वालं दहन्तमखिलं जगत् ।
     नृत्यन्तं ददृशुर्देवं विश्वकर्माणमीश्वरम् ॥ ५.११॥
Meaning: - Rudra having infinite heads, infinite feets, infinite hands, with matted lock of hairs adorned by crescent moon on head, wearing skin of tiger, holding trident and dand in his hand, having three eyes resembling sun, moon and fire self-illuminous situated in (whole) universe, having horrible fangs, possessing splendour of infinite suns, who is inside the cosmic egg as well as outside of cosmic egg, creating destroyable fire which can convert entire creation into ashes, that Lord Vishwakarma- Shiva (Lord of all actions/Karma) was seen dancing by the sages.सहस्रबाहुं जटिलंवसानं चर्म वैयाघ्रं शूलासक्तमहाकरम् ।ब्रह्माण्डं तेजसादंष्ट्राकरालं दुर्द्धर्षंअण्डस्थं चाण्डबाह्यस्थं बाह्यमभ्यन्तरं परम्

Reference: - https://harivallabha.blogspot.com/2019/03/chapter-5.html
Similarly, in the Padma-Puraana there is Shiva-Gita where Lord Shiva reveals his Universal form.

श्रीभगवानुवाच ..
   मयि सर्वं यथा राम जगदेतच्चराचरम|
   तद्दर्शयामि न द्रष्टुं क्षमते भवान [10]
तुभ्यं दशरथात्मज .  तेन पश्य भयं त्यक्त्वा मत्तेजोमण्डलं ध्रुवम [11]
न चर्मचक्षुषा द्रष्टुं शक्यते मामकं महः |
   तन्ममानुग्रहं विना [12]
Sri Bhagavan said: O Rama! This entire mobile and immobile creation dwells inside my belly. You do not have enough strength and capability to witness that scene. With these eyes of flesh neither human nor god can every be able to see my brilliant cosmic form without my grace. Therefore, O son of Dashratha! I'm giving you divine eyes (divya drishti) do not fear and properly see my divine cosmic form.
सूत उवाच ..  इत्युक्त्वा प्रददौ तस्मै दिव्यं चक्षुर्महेश्वरः   .
  अथादर्शयदेतस्मै वक्त्रं पातालसंनिभम [13]

नरेण वा सुरेणापि
विद्युत्कोटिप्रभं

दीप्तमतिभीमं भयावहम|
   तद्दृष्ट्वैव भयाद्रामो जानुभ्यामवनिं गतः [14]
प्रणम्य दण्डवद्भूमौ तुष्टाव च पुनः पुनः
   अथोत्थाय महावीरो यावदेव प्रपश्यति [15]
वक्त्रं पुरभिदस्तत्र अन्तर्ब्रह्माण्डकोटयः |
    चटका इव लक्ष्यन्ते ज्वालामालासमाकुलाः [16]
मेरुमन्दरविन्ध्याद्या गिरयः सप्तसागराः  |
    दृश्यन्ते चन्द्रसूर्याद्याः पञ्च भूतानि ते सुराः [17]
अरण्यानि महानागा भुवनानि चतुर्दश |
    प्रतिब्रह्माण्डमेवं तद्दृष्ट्वा दशरथात्मजः [18]
सुरासुराणां संग्रामस्तत्र पूर्वापरानपि |
   विष्णोर्दशावतारांश्च तत्तत्कर्माण्यपि द्विजाः [19]
पराभवांश्च देवानां पुरदाहं महेशितुः |
   उत्पद्यमानानुत्पन्नान्सर्वानपि विनश्यतः [20]
दृष्ट्वा रामो भयाविष्टः प्रणनाम पुनः पुनः |
  बभूव रघुनन्दनः [21]

अथोपनिषदां सारैरर्थैस्तुष्टाव शंकरम [22]

Suta said: In this way spoke lord Shiva and blessed Rama with divine eyes. Thereafter lord Shiva showed Rama by opened his mouth which was as wide as Patala loka. Blazing with billions of lightening strikes seeing such a dreadful scene Sri Rama trembling with fear collapsed on the ground on his knees. He prostrated on the ground and numerous times he prayed to Lord Shiva. Then that mighty armed hero Rama gaining some strength again looked at the cosmic form of the Eswara the destroyer of the three cities. He sighted billions of universes as like as the groundnuts being roasted in blazing fires. He saw inside the mouth Meru, Mandara Vindhya etc. giant mountains, seven great oceans, Sun, moon and planets, five elements, all deities, all dense forests. He also witnessed the mighty serpent Adi-Sesha, fourteen worlds, in every universe he witnessed Devasura Sangrama (battles of gods and demons), their cause and effects. He also witnessed Lord Vishnu's ten primary incarnations and their roles, duties and work. He witnessed God's valor, the event of destruction of the three cities by Shiva. He saw all the creatures who are yet to be born, which were
   born in past and which were being born. He further saw the destruction
   of all these creation. Seeing that horrifying scene, Sri Rama despite being a wise man, trembled with fear and saluted Lord Shiva again and again. Then Rama sang the essence of all Upanishads as a hymn in praise of Lord Shiva.दिव्यं चक्षुः प्रदास्यामिवर्ततेउत्पन्नतत्त्वज्ञआनोऽपि

Ref:- http://www.mahapashupatastra.com/2010/05/shiva-gita-ch-07-vishwaroopa.html
Comment: Please put clear references to the scriptures in your answer.
Comment: It is only believed that Padma Purana has Shiva Gita but [it is not clear](https://hinduism.stackexchange.com/a/31917/5212) which edition has the conversation between Shiva and Rama. Please remove salutations from the post. I'm removing it for you. Please avoid copy paste of blogs and try to quote original scriptures with explanation from your side too. Pure copy paste from blogs (if they are sectarian and add harsh words against a sect or god) shall be deleted in future. We only write Q&A answers here. Take a [tour] to understand more.
Comment: Thanks for the Suggestion @Wikash_. Have Edited my Answer with the Reference and Quote from Mahabharata itself.
Answer: There are many instances and many were given in the above answers also. I am also giving some.
Mahabharata Book 7 Section LXXX.:

Krishna and Arjuna said, " . . .
Let salutation be to the wielder of Pinaka, to one worthy of the offer of libations of clarified butter, to him who is truth, to him who is all-pervading. To him who is unvanquished! To him who is always of blue locks, to him who is armed with the trident, to him who is of celestial vision! To him who is Hotri, to him who protects all, to, him who is of three eyes, to him who is disease, to him whose vital seed fell on fire! To him who is inconceivable, to him who is the lord of Amvika, to him who is adored by all the gods! To him who has the bull for his mark, to him who is bold, to him who is of matted lock, to him who is a Brahmacarin! To him who stands as an ascetic in the water, to him who is devoted to Brahma, to him who has never been conquered! To him who is the soul of the universe, to him who is the creator of the universe, to him who lives pervading the whole universe! We bow to you that art, the object of the reverence of all, to you that art the original cause of all creatures! To you that art called Brahmacakra, to you that art called Sarva, Sankara, and Siva! We bow to you that art the lord of all great beings! We bow to you that hast a thousand heads, to you that hast a thousand arms, to you that art called Death! To you that hast a thousand eyes, a thousand legs. To you whose acts are innumerable! We bow to you whose complexion is that of gold, to you that art cased in golden mail, to you that art ever compassionate to your devotees! O lord, let our wish be accomplished."

Maha Bharata Book 13, Chapter 15.:

"The blessed Vishnu (Krishna) continued, "... Before me, that Lord of all the gods viz., Sarva, appeared seated in all his glory. Seeing that Isana had showed himself to me by being seated in glory before my eyes, the whole universe, with the Grandsire and Sakra, looked at me. I, however, had not the power to look at Mahadeva. The great Deity then addressed me saying, 'Behold, O Krishna, and speak to me. Thou hast adorned me hundreds and thousands of times. There is no one in the three worlds that is dearer to me than thou.'

For me the most interesting one is the encounter of Ashwatthama with the being created by Bhagawan Mahakala to protect the Pandava Camp.
MBH BOOK 10 SECTION 6.:

Sanjaya said, "Inviting Kritavarma, as also the mighty car-warrior Kripa, Drona's son, filled with rage, approached the gate of the camp. He there beheld a being of gigantic frame, capable of making the very hair stand on end, and possessed of the effulgence of the Sun or the Moon, guarding the entrance. Round his loins was a tiger-skin dripping with blood, and he had a black deer for his upper garment. He had for his sacred thread a large snake. His arms were long and massive and held many kinds of uplifted weapons. He had for his angadas a large snake wound round his upper arm. His mouth seemed to blaze with flames of fire. His teeth made his face terrible to behold. His mouth was open and dreadful. His face was adorned with thousands of beautiful eyes. His body was incapable of being described, as also his attire. The very mountains, upon beholding him, would split into a 1,000 fragments. Blazing flames of fire seemed to issue from his mouth and nose and ears and all those thousands of eyes. From those blazing flames hundreds and thousands of Hrishikeshas issued, armed with conchs and discs and maces.

When all the weapons of Ashwatthama were destroyed he saw.:

At last, when all his weapons were exhausted Ashvatthama, casting his eyes around, beheld the whole firmament densely crowded with images of Janardana.

Then Ashwatthama prayed Bhagawan Mahadeva with various hymns and a vedi appeared. Even the vedi's was description was also so much interesting. So, i am giving a bit of an addition to the answer.
MBH BOOK 10 SECTION 7.:

Then when Ashwatthama went to sacrifice himself in the vedi as Ahuti Mahadeva appeared and Said.:

Beholding him stand immovable and with uplifted hands and as an offering up to himself, the divine Mahadeva appeared in person and smilingly said, "With truth, purity, sincerity, resignation, ascetic austerities, vows, forgiveness, devotion, patience, thought, and word, I have been duly adored by Krishna of pure deeds. For this there is none dearer to me than Krishna. For honouring him and at his word I have protected the Pancalas and displayed diverse kinds of illusion. By protecting the Pancalas I have honoured him. They have, however, been afflicted by time. The period of their lives has run out." Having said these words unto the high-souled Ashvatthama, the divine Mahadeva entered Ashvatthama's body after giving him an excellent and polished sword. Filled by that divine being, Drona's son blazed up with energy. In consequence of that energy derived from godhead, he became all-powerful in battle. Many invisible beings and rakshasas proceeded along his right and his left as he set out, like the lord Mahadeva himself, for entering the camp of his foes."

Even the Soldiers saw Mahakala and Mahakali form which they used to see in their dreams from when the war started.
MBH BOOK 10 SECTION 8.:

"Accomplished in the use of the sword, Ashvatthama then, rushing against other combatants, cut them down with his excellent sword. The warriors in the Pandava camp beheld that kālarātrī (Death-Night) in her embodied form, kālī of bloody mouth and bloody eyes, wearing crimson garlands and smeared with crimson unguents, attired in a single piece of red cloth, with a noose in hand, and resembling an elderly lady, employed in chanting a dismal note and standing full before their eyes, and about to lead away men and steeds and elephants all tied in a stout cord. She seemed to take away diverse kinds of spirits, with dishevelled hair and tied together in a cord, as also, O king, many mighty car-warriors divested of their weapons. On other days, O sire, the foremost warriors of the Pandava camp used to see in their dreams that figure leading away the sleeping combatants and Drona's son smiting them behind! The Pandava soldiers saw that lady and Drona's son in their dreams every night from the day when the battle between the Kurus and the Pandavas first commenced. Afflicted before by Destiny, they were now smitten by Drona's son who terrified them all with the frightful roars uttered by him. Afflicted by Destiny, the brave warriors of the Pandava camp, recollecting the sight they had seen in their dreams, identified it with what they now witnessed" . . . "Others awoke from sleep, brave warriors and foremost of men, as they came towards Ashvatthama, were slain before they could approach him and were thus offered up as victims unto that kālarātrī (Death-Night)".

I hope this clarifies all your queries. Prd..


How to prevent process / daemon from running on macOS?

Question: I installed an app called "ShadowsocksX-NG" and then whenever I restart my computer, /Users/admin/Library/Application Support/ShadowsocksX-NG/ss-local -c ss-local-config.json will be running in the background. This is undesirable. Obviously this process is not in my Login Items. Where and how does macOS handle daemons?
Comment: The normal way of launching a background daemon is to put a launchd plist in /Library/LaunchDaemons/. There are a few less commonly used approaches, but I'd check that first.
Comment: It looks like ShadowsocksX-NG creates `.plist` files on `~/Library/LaunchAgents`. Is it possible to disable its ability to do so - or can I disable these two files from running at startup? If I run this app, it generates those files again - so simply deleting them wouldn't help.
Comment: My response is too long long for a comment, so I'll write an answer...
Answer: First, Shadowsocks has an active GitHub site where you can ask this question directly to the people working on the project. They're likely to know a lot more about it than anyone here.
That being said, Shadowsocks (from our discussion, above) creates these launchd plist files programmatically, so there is no easy way — short of going to GitHub and becoming a project contributor — to stop it from doing so. I assume you want ss-local to be running while Shadowsocks is running, you just don't want it to be running the rest of the time. You can do this manually through terminal using the launchctl utility. First you need to get the Label of the launchd job, so open the plist files that Shadowsocks creates in a text editor and look for something like this:
<key>Label</key>
<string>com.Shadowsocks.something.whatever</string>

The bit between the <string> tags is the launchd job label, so if you run the following command in terminal (once for each plist file):
launchctl remove com.Shadowsocks.something.whatever

It will remove the job from launchd, which shuts down whatever processes those jobs are running. I assume that Shadowsocks will restart the jobs when you launch it again, but if not, you can do that manually as well, using:
launchctl load ~/Library/LaunchAgents/<filename>.plist

You could script this in a couple of different ways, I think, but I don't know what scripting languages you're familiar with (if any), and it would be better to go to GitHub and ask for a developer solution regardless.

EDIT:
Per comments... OSX used to have a system for creating logout hooks through the Window Server, but that was deprecated back in 10.4, and I don't know if it still works. So instead, I'm going to tell you how to create a background script app that should do what you want.
Here's the script, follow the instructions below:
(*
  add the job labels for the plist files Shadowsocks creates to the following
  list. This assumes that they follow the normal convention where the file name
  is the job label with '.plist' attached. If not you may need to adjust things
  in the cleanUp() handler
*)
property labelList : {"joblabel1", "joblabel2"}
global isDirty

on run
    set isDirty to false
end run

on reopen
    display alert "Do you want to quit?" buttons {"Yes", "No"}
    if button returned of the result is "Yes" then quit
end reopen

on idle
    tell application "System Events"
        -- I'm guessing this is the process name as it appears in system events.
        -- You should double check
        if exists process "Shadowsocks-NG" then
            -- if SS is running, mark the condition as dirty
            set isDirty to true
        else
            -- if SS is not running, and isDirty is set, clean up
            if isDirty is true then
                my cleanUp()
                set isDirty to false
            end if
        end if
    end tell

    -- have the idle loop run every 15 minutes.
    return 15*minutes
end idle

on quit
    (*
      when this app quits (which it should only do at logout, unless you quit it
      manually), clean up
    *)

    if isDirty is true then
        my cleanUp()
    end if
    continue quit
end quit

on cleanUp()
    -- remove launchd jobs, if loaded
    repeat with this_label in labelList
        try
            do shell script "launchctl remove " & this_label
        end try
    end repeat
    -- delete launch agent plist files
    tell application "System Events"
        set launchagents_folder_path to folder "LaunchAgents" of library folder of user domain
        try
            repeat with this_label in labelList
                delete (first file of launchagents_folder_path whose name is this_label & ".plist")
            end repeat
        end try
    end tell
end cleanUp

Copy script into a Script Editor window, making the appropriate adjustments as noted in comments:
Choose 'Save' from the file menu
Change the 'File Format' pulldown to 'Application'
Click the check box that says 'Stay open after run handler'
Save it under whatever name you like, wherever is convenient
Go to System Preferences → Security & Privacy → Privacy → Accessibility and add this app to the list of apps allowed to control your computer using accessibility.
Open System Preferences and add this to your list of Login Items so it runs automatically.

Assuming that you have the launchd job names and the process name of Shadowsocks correct, this applet will sit and watch for Shadowsocks to quit, and whenever Shadowsocks quits, this app will remove the launchd jobs (shutting down the processes they are running) and delete the launch agent plist files. It will do the same thing when it quits, at logout, restart, or shutdown.
I've set the idle time to 15 minutes, which seems reasonable (on average, ss-local will only run for 7.5 minutes after you quit Shadowsocks)
Once you're sure it works the way you want, you can turn it into a proper background app. Quit the app and open its info.plist file - right-click on the app and choose "Show Package Contents"; info.plist will be down in the 'contents' folder — and add in the following key-value pair (being careful not to mess up the other key-value pairs):
<key>LSUIElement</key>
<true/>

This keeps the app from becoming visible (no dock icon, and it never becomes frontmost or takes over the menu). It can still display alerts (useful for error debugging) but that's it. You can quit it manually by double-clicking on the icon again; that's what the reopen handler is for.
Comment: `launchctl remove com.qiuyuzhou.shadowsocksX-NG.local` and `com.qiuyuzhou.shadowsocksX-NG.http` will remove two processes running in the background but if I restart the mac, they will run again...While Shadowsocks is an active repo, shadowsocksX-NG the macOS client, is not.
Comment: what if you write a script that deletes those plist files automatically when you computer shuts down or logs out? They won't be created until Shadowsocks runs again.
Comment: Sure, is there an event that would activate these scripts when the computer shuts down?
Comment: I added a script solution to my answer
Comment: lol thx, instead I created a launchd script that runs on startup and shutdown ss-local after a 30 second timeout. This is not perfect tho. If anyone knows how to create a shutdown hook please elaborate.
Comment: information on logout hooks here: https://wiki.afp548.com/index.php/Login/Logout_Hooks_in_OS_X As noted, these are deprecated since 10.4, but may still work.


ASP.NET FormsAuthentication: have to log in again when restarting application

Question: I have an ASP.NET application using FormsAuthentication. Whenever I restart the application or web server, my authentication token is invalid and I have to log in again. What's going wrong?
Answer: By default, FormsAuthentication validates authentication data on every request by having the client store an encrypted copy of the data. The encryption key is stored in Machine.config. The specific key to use is in <machineKey decryptionKey="YOUR KEY HERE">.
If you do not provide a decryption key, one is automatically generated on application startup. Since it is randomly generated, it will be different each time you restart the application. On the validation phase, FormsAuthentication attempts to decrypt the authentication data and fails. Then the user is no longer logged in.
There are two ways of resolving this problem.

Providing a machineKey in Machine.config will give FormsAuthentication a consistent key to use, so validation will succeed with the encrypted cookie from previous application runs.
Using <forms protection="None" ... /> in Web.config will disable authentication data encryption and validation. This is insecure and only appropriate for development, since it will be trivial for users to impersonate each other.
Comment: Thanks for enlightening me. MSDN concurs : http://msdn.microsoft.com/en-us/library/ff649308.aspx Specifically look at **Configuring  to Encrypt Forms Authentication Tickets**
Answer: The default session state mode in asp.net is in-proc (cached in-memory) unless you specify otherwise. When the application shuts down, memory is cleared and the in-proc session cache is therefore lost.
@dhasenan The machinekey config will only be an issue if the application is deployed across a web farm or the cloud. The idea of overriding the machine-level config of the Machinekey element is to ensure that multiple machines are using the exact same keys.
Therefore, the machine key shouldn't be an issue because if one is not provided at the application level, the machine key in the machine.config will be used instead, which is persisted and static, so it will not be regenerated between sessions.


How to modulate from e Phrygian to c minor

Question: I'm trying to write a metal song so I would like to know any suggestions for a dark or melodic modulation from e Phrygian to C minor. Preferably on guitar thanks.
Comment: Does this answer your question? [How many types of modulation are there?](https://music.stackexchange.com/questions/27079/how-many-types-of-modulation-are-there)
Answer: You're composing heavy metal. Especially for extreme metal subgenres like death metal and thrash metal, you don't need smooth modulations with pivot chords. You might need smoother modulations for power metal and maybe some of that symphonic metal stuff, but heavy metal can withstand a jump from E minor chords (in E Phrygian) straight to C minor chords just fine. And, as modulations go, E Phrygian straight to C minor is dark enough.
Take this as an example of how sudden modulations can be in heavy metal (this is admittedly death metal - I think the modulations are clearer in this instrumental version):

Note the Cm-Em chord progression in 1:02-1:05 of this video, with the song modulating straight from a rather chromatic G sharp minor to E minor there.
Comment: Ye I get you I'm trying to make it less jarring tho because what I have before is a metalcore style riff in e Phrygian. I want the chorus to be in c minor without it being a blatantly obvious change in key. Thanks though I will try your approach
Comment: @Guy29756 - From the (relatively few) metalcore songs I've listened too, that subgenre also has pretty blatantly obvious changes in key, even to distantly related keys.
Comment: That's an epic drum part BTW!
Answer: Since E Phrygian and C major share the same set of pitches, transitioning to C minor can be fairly straightforward. Transitioning through G major would be the most direct.
However, since you're looking to keep things dark. I suggest moving from an E minor chord to F minor and then to C minor. The F in the F minor chord takes advantage of the characteristic F from the E Phrygian mode, but the F minor chord itself is part of C minor, so makes for a smooth transition.
Another darkish possibility would be to go through B diminished. It is part of both E Phrygian and C Minor, and is also dark as long as that level of dissonance fits in the music.
Similarly, Eb augmented is possible. From E minor, drop the E to Eb and leave the G and B alone. Then move the B up to C to get a C minor chord.
Comment: @MS-SPO All of that, plus the timbre of the instruments, the tempo, the lyrics if present, and no doubt any number of elements neither of us is thinking of.
Comment: Thanks will try each of those out and see what I like best
Comment: @MS-SPO All of what Aaron said being the case, chords are a pretty powerful way to do it. Moving counterclockwise in the circle of fifths (adding flats) isn't the only way, but it's a straight-line path.
Comment: Interesting considerations. Thanks // Just wondering what makes music feel dark: choice of chords and their progression, shift to lower octaves, chord construction i.e. shifting pitches while keeping the chord, else?


How to add javascript to static block?

Question: I have a javascript that I need to add to a static block. Could anyone explain it step by step?
Comment: You can simply use `` in your static block
Comment: I need to add this code -
Answer: Login to the admin and navigate to content > blocks, find the block you want to edit and click on select > edit.
Click on the hide/show editor button to hide the editor (make sure there are no icons above the text box).
Paste in your Javascript and save the static block. If you see a message about cache then click on it and clear the cache.
Internal JS:

External JS:

Call a template that contains your JS:
{{block type="core/template" block_id="example.id" template="your/template/path.phtml"}}

Comment: Thank you for your ans. But am really a newbie and i do not know anything about codes. This is the code I need to add in a static block.
 Now can you tell me where to include this code?
Comment: I have updated my answer with more instructions, you need to find the static block in the admin, paste your code in, then save it and maybe need to clear the cache.
Answer: Login to admin panel Click on CMS > Static Blocks.
Create New Block suppose Identifier = block_test
Add Content :
Click here to check Javascript

For testing Create CMS page and call CMS block from CMS page
suppose URL Key = test
Add Content :
{{block type="cms/block" block_id="block_test"}}

Go to front end /test and click on "here" link, alert message will popup.
Answer: 1) Create a phtml file in : app/design/frontend/{yourPackage}/{yourTheme}/template/cms/customcms.phtml then put your code in this file.(the code that you want to display in a static block, not the external Js URL)
2) Go to admin cms>static block>your static block>content>hide editor>past this code:
{{block type="core/template name="custom.cms" template="cms/customcms.phtml"}}
3) add this code in app/design/frontend/{yourPackage}/{yourTheme}/layout/local.xml
<layout version="0.1.0">
   <default translate="label" module="page">
       ...
       <reference name="head">
          <action method="addLinkRel"><rel>text/javascript</rel><href> https://YOUR URL TO THE EXTERNAL JS ... .js</href></action>
       </reference>
   </default>
</layout>

How to add javascript to static block?


How to use an PCF8574P with the simplest code possible

Question: i'm having few PCF8574P which i want to use with my arduino and multiplex them however i have no idea how to use the I2C BUS and the IC in general. There are few libraries but they're fairly complex. Is there any library which makes writing and reading from the PCF8574P easy?
Answer: Have you given Rob Tillaart's library from the Arduino Playground a try? The demo sketch might look a bit overwhelming, but at it's simplest, all your sketch should need to have to make a led blink like the standard arduino 'blink' sketch is
<code>#include "PCF8574.h"
#include <Wire.h>

// adjust addresses if needed
PCF8574 PCF_38(0x38);  // add led to P0 (pin 4) (used as output)

void setup()
{
//your setup code here
}

void loop()
{
    //turn P0 (pin 4) of the I/O expander on and off once a second
    PCF_38.write(0, 1);
    delay(1000);
    PCF_38.write(0, 0);
    delay(1000);
}
</code>
I don't have any of these parts handy so I can only give generic advice.
Comment: This is good..simple code to blink one led. It works..I like it.
Cheers...Markus


What's the difference between exists and defined?

Question: What is the difference between
if (defined $hash{$key}) { }

and
if (exists $hash{$key}) { }

When do I know which to use?
Answer: This is well-documented in the perldoc entries for defined and exists. Here's a quick summary:
defined $hash{key} tells you whether or not the value for the given key is defined (i.e. not undef). Use it to distinguish between undefined values and values that are false in a boolean context such as 0 and ''.
exists $hash{key} tells you whether or not %hash contains the given key. Use it to distinguish between undefined values and non-existent ones.
This is easiest to see with an example. Given this hash:
my %hash = (a => 1, b => 0, c => undef);

Here are the results for retrieval, defined-ness, and existence:
# key  value  defined  exists
a          1        1       1
b          0        1       1
c      undef        0       1
d      undef        0       0

In practice, people often write just if ($hash{key}) {...} because (in many common cases) only true values are meaningful/possible. If false values are valid you must add defined() to the test. exists() is used much less often. The most common case is probably when using a hash as a set. e.g.
my %set = map { $_ => undef } 'a' .. 'z';

Using undef for set values has a few advantages:

It more accurately represents the intent (only the keys are meaningful, not the values).
All undef values share a single allocation (which saves memory).
exists() tests are slightly faster (because Perl doesn't have to retrieve the value, only determine that there is one).

It also has the disadvantage that you have to use exists() to check for set membership, which requires more typing and will do the wrong thing if you forget it.
Another place where exists is useful is to probe locked hashes before attempting to retrieve a value (which would trigger an exception).
Comment: Very nicely explained.
Comment: Also, `defined` can also be used on other kinds of variables, while `exists` will throw an error if not used on a hash or array key (or a subroutine).
Answer: defined checks the value of the variable, exists checks if it has been previously declared/initialized. If it exists, plain and simple.
E.g.:
$hash{$key} = undef;
# various return values:
exists  $hash{$key};  # true
defined $hash{$key};  # false
$hash{$key};          # false

$hash{$key} = 0;
# various return values:
exists  $hash{$key};  # true
defined $hash{$key};  # true
$hash{$key};          # false
exists $hash{$foo};   # false

Comment: @some_coder No, that is incorrect. You are thinking of [autovivification](http://en.wikipedia.org/wiki/Autovivification), and that occurs in Perl when you refer to a multi-dimensional structure: You create the level below to check the level above. E.g. `if (defined $hash{a}{b})` will create `$hash{a}` if it does not already exist. But it will never create `$hash{a}{b}`.
Comment: @Sandra Yes, uninitialized values are always undefined. Think of it as the difference between declaration and initialization: `my $var` exists, and contains the value `undef`. `my $var = 0` exists, and contains the value 0, therefore defined.
Comment: And `defined $hash{$foo}; #false` I suppose?
Comment: `$hash{$key}` returns the value for `$key`. While this can be interpreted as a Boolean, it isn't one. Your first example should return `undef`, the second one `0`.
Comment: @Michael True, but this was in the context of if-statements (see question).
Comment: but beware. Using something like `if( defined $hash{$key} ) ...` may add the key (with undef as value) if the key does not exists. Thats why i always use `if( exists $hash{$key} && defined $hash{$key})`.
Answer: Perl documentation:

When used on a hash element, defined tells
  you whether the value is defined, not
  whether the key exists in the hash.
  Use exists for the latter purpose.
Answer: As stated in the perldoc on exists:

Given an expression that specifies an element of a hash, returns true if the specified element in the hash has ever been initialized, even if the corresponding value is undefined.
A hash or array element can be true only if it's defined and defined only if it exists, but the reverse doesn't necessarily hold true.

That is, a hash can contain an undefined element, and if that is the case, the defined-check will return false, whereas the exists-check will return true.
Therefore, you should use exists if you wish to know if a given entry exists in the hash, and defined if you wish to know if the given entry exists and is defined.
Comment: Yes. `exists` checks if the hash contains the given key, but not what the value of it is, while `defined` looks at value at the given key and sees if it is defined or not (and if the key doesn't exist, it gets back an `undef`, so it works even if the key's not there.)
Answer: This example shows the difference. In general defined works for any structure and exist is related to hashes.
my %hash=("1"=>undef);
print "exists:".exists($hash{"1"})."\n";
print "defined:".defined($hash{"1"})."\n";

The difference is small and not so obvious, so expect that people will mess with it.


Where should I host software for individual papers?

Question: I'm a teen who's writing a paper on Poisson-Disc distribution over the summer for fun, and I wanted to distribute the software I used for the simulations to maintain scientific integrity. Obviously I don't have anything like a university server I can host it on, so my first instinct is to host it on my GitHub. I guess this would work, but there are several problems with it, such as its fallibility. Furthermore, I'm not really used to professionalism yet, and I'm not sure if it's appropriate to host professional, academia stuff on my personal GitHub. I do go to a more-or-less significant technological program at my school, and since school starts back up in a few weeks, I guess I could talk to my teachers about hosting it on the school servers, but there's only a 50-50 chance they'll let me do that. Do y'all have any better ideas?
Comment: Lots of professional people use GitHub. Why is it fallible (presuming you use their servers, not your own)?
Comment: A personal GitHub account [with your actual name](https://academia.stackexchange.com/q/116352/17254) is certainly considered professional. This may be a duplicate of [How to share computer code?](https://academia.stackexchange.com/q/16785/17254) though.
Comment: GitLab is an option too.
Comment: I thought of GitHub as more of a place to hold fast changing, collaborative code, but it makes sense that lots of professional people would use it. Thanks so much for the help!
Comment: For a few hundred dollars per year you can host your own domain. For this option, choose a professional name, not a frivolous one. You need both the domain and hosting. You can host several domains with the same host about as easily as one.
Comment: *Especially* if you are thinking of building a scientific portfolio, I would counsel against using school resources, because you will graduate (or change schools) someday, and it's a bit of a toss-up whether you can keep using school resources as an alumnum. A personal GitHub account under your real name is definitely better in terms of future-proofing.
Comment: @LelandKilborn Hosting professional people's code is literally what GitHub is ***designed*** for.  Unless you consider open-source developers "unprofessional", in which case I'd point you at Linux... ;)
Comment: If by "fallibility", you meant technical problems making your files inaccessible… You could provide your software on more than one host. For example, use [*BitBucket*](https://en.wikipedia.org/wiki/Bitbucket) in addition to [*GitHub*](https://en.wikipedia.org/wiki/GitHub). If one service is having problems, your readers could use the other one.
Answer: Use GitHub (as mentioned in the comments), but with a twist.
You can archive GitHub repos to Zenodo (they have a machinery for that) or really any other scientific research storages (as a tarball, for example). In this manner you can ensure permanence. The visibility is easier on the GitHub, though.
And, as mentioned, a somewhat official-looking (like, with a real name) personal GitHub account is professional enough. It's basically the link from the paper to the GitHub that matters, not other way round.
Comment: Zenodo will also give you a DOI for the specific release of the code, which will be pretty easy to cite in your papers, and very easy to find in a few years, even if your Github repository goes missing.
Comment: Just create a read-only branch or a tag for the version used in your paper. That assures that the version should be readily available for future investigators as well as allowing ongoing development.
Comment: +1.  You can also just upload a tarball to zenodo and bypass github entirely
Answer: Using Github for this is fine and is generally not seen as unprofessional. There is a little bit more to proper sharing of code than just sticking it into a git repo. Github has a "releases" function that will let you capture an image of your code base in time. You can say "I tested this code with release v1.2.3 from this github repository." In that way your code will always be retrievable in the state that worked despite any modifications, updates, re-releases etc you do on it.
The problem is capturing the metadata and environment data that you used to run the code. There are tools for this but one of the "easiest" ways to do this would be to write a docker file that has all the library/environment dependencies you need to make the code run, include your released code into that, build the image and host that on docker-hub. Gitlab also has a docker image repo that you can use for free. There are also all sorts of automated CI/CD pipelines built into gitlab/hub you can use to automate this but that might be going a little far.
Using a combination of releases/docker, in the future, a different user will be able to pull the exact same code you used, run it with the exact same versions of all the libraries, and hopefully get the exact same results. You should also address the provenance of the input data, preprocessing steps etc in case the code doesn't auto generate everything from scratch.
Answer: I'm not sure what you mean by GitHub's "fallibility." Due to its size, reputation and the funding behind it (Microsoft, now) it's likely one of the most reliable places to host a Git repo.
But the key characteristic of Git repos is that they're essentially blockchain based, so the source of the repo (i.e., where it's hosted) is not really that important. Commit 0b9b56adcdf56ff013421c50d0721d29fa08f43a is that commit regardless of where you got it. So it's not such a big deal if a repo moves around, or came from a dodgy source; someone has a copy of a repo with that commit in it, it's almost certainly the code I'm talking about when I talk about that commit. (Note that all this is not the case for information outside of the repo, such as in GitHub wikis or issues.)
So put your code up on GitHub, or GitLab, or Bitbucket, or on any other site that looks as if it's not going to vanish too soon and when you reference it give not just the hosting location but the commit ID of the commit in the repo containing the code used in your paper. The commit ID ensures that regardless of the source your code is identified, and being on GitHub (or any other major provider) makes it likely that it will be easy to find and download the repo. But even if it vanishes off GitHub for some reason (which is unlikely unless you deliberately delete it), if there's enough identifying information in the repo and in your paper (e.g., if the paper's author and title are mentioned in the repo) a web search may find it, and the commit ID will provide verification that the correct repo has been found.
Comment: I removed a long discussion about blockchain, Merkle trees, and data structures, which eventually devolved into some rude/condescending comments. Let us remember our [code of conduct](https://academia.stackexchange.com/conduct).


Will lemon tree ever grow new leaves on on bare branches?

Question: I have an apparently healthy lemon tree that exhibits a few isolated leafless branches, 10-30cm long. Can I assume these are dead wood and prune them, or should I wait longer for them to emit new leaves?
Answer: I would scratch off a small piece of bark.  If the cambium layer below the bark if brown that limb is dead.  If it is green it is alive. Start at the very end of the limb.  Scratch off some bark.  If that part is brown trim a few inches off.  Working your way back to the main trunk.  Part of the limb might be dead, but other parts are alive.
Lemon trees will defoliate under stress.  They do have the ability to regrow new leaves, but first you must fix the problem.  What happened that made those limbs to defoliate.  Check for insects and mites.  Look for signs of disease like spots on the limbs.  Check you watering habits.  Make sure you only water after the soil is mostly dry.  Lemons require very well draining soil.  Some people use Cactus & Succulent soil for their citrus.
Once you have identified the problem and made the correction then those parts that are still green will probably releaf.
Comment: Great answer and yes, the branches are still alive. Seeing no pests, I will make sure the tree gets its nutrients and gets to dry out.


What happens if we place an isolated charge on one plate of a parallel plate capacitor and how is the charge going to distribute?

Question: I read somewhere that the charge redistributes equally is if 20c is place on one end, both of the other ends of the parallel plate capacitor has +10c and -10c. I want to know why and how such redistribution occurs. Also, if such redistribution occurs isn't conservation of charges violated?
Comment: Even though your question is not a duplicate of this one _Why do the charges on a parallel plate capacitor lie only on the inner surface?_, I've explained this phenomenon in [my answer](https://physics.stackexchange.com/a/535181/238167) to the same.
Comment: Where are you getting the 20C to "place on one end"?
Answer: Suppose you have some series of parallel plates with charges $Q_1$, $Q_2$, up to $Q_n$, for example like this (I've drawn just four plates but this is going to apply to any number of plates):

Strictly speaking what I'm going to say only applies to infinitely large plates but in practice we just need the size of the plates to be large in comparison to their spacing. Anyhow, the charge on each plate distributes itself between the two faces of the plate in accordance with the rules:

the charges on the faces of a pair of plates is equal and opposite
the charges on the two outside faces are the same
if any plate is earthed the charges on the two outside faces are zero

If you're interested there is some discussion of why these rules apply in the question Why are the two outer charge densities on a system of parallel charged plates identical?
In your case you have just two plates, i.e. the two plates of your capacitor, and the charges are $Q_1 = 20C$ and $Q_2 = 0$. If we apply the rules above we find the charge distribution is:
Answer: Why would conservation of charge be violated in your example?  A property of conductors is that, in electrostatic equilibrium there can be no field inside the conductor (for an ideal conductor, in real life there may be a small amount inside near the surface) and the conductor is at a constant potential.  The excess change placed on a conductor is free to move about in the surface and any deviation from equilibrium will case changes to move until they find an equilibrium that satisfies the constraints previously mentioned.
What matters is that the total charge of all components in an isolated system remain fixed.  The redistribution cannot change the total. In your example it would help if you provided some information on whether the caps are connected to each other or in isolation.


How to compute the SLDs for pure single-qubit states?

Question: In Demkowicz-Dobrzanski et al. (arXiv:2001.11742), the authors mention in Eq. (74), page 22, that the symmetric logarithmic derivatives (SLDs) for pure states parametrised in the usual way via the Bloch sphere are
$$L_\theta = \boldsymbol\sigma\cdot\partial_\theta\mathbf r\equiv \sum_{i=1}^3 \sigma_i \partial_\theta r_i,
\qquad L_\varphi = \boldsymbol\sigma\cdot\partial_\varphi\mathbf r \equiv \sum_{i=1}^3 \sigma_i \partial_\varphi r_i,$$
where $\sigma_i$ are the Pauli matrices, and $\mathbf r$ is (I assume) the unit vector pointing in the direction $(\theta,\varphi)$, that is:
$$\mathbf r=\begin{pmatrix}\sin\theta \cos\varphi \\ \sin\theta\sin\varphi \\ \cos\theta\end{pmatrix}.$$
More explicitly, we're parametrising the pure qubit states as
$$\rho_{(\theta,\varphi)} = |\psi_{(\theta,\varphi)}\rangle\!\langle\psi_{(\theta,\varphi)}| = \frac{ I+ \sin(\theta)\cos(\varphi)X+\sin(\theta)\sin(\varphi)Y+\cos(\theta)Z}{2},
\\
\lvert\psi_{(\theta,\varphi)}\rangle \equiv \cos(\theta/2)|0\rangle+\sin(\theta/2)e^{i\varphi}|1\rangle.$$
The SLDs are defined by the relations:
$$\frac12\{L_\theta,\rho_{(\theta,\varphi)}\}\equiv \frac{L_\theta \rho_{(\theta,\varphi)}+\rho_{(\theta,\varphi)} L_\theta}{2} = \partial_\theta \rho_{(\theta,\varphi)}, \\
\frac12\{L_\varphi,\rho_{(\theta,\varphi)}\} = \partial_\varphi \rho_{(\theta,\varphi)}.
$$
I can directly verify by computation that the given forms for $L_\theta,L_\varphi$ do indeed satisfy these relations: for example, from
$$\frac12\left\{\frac{I+\mathbf r\cdot\boldsymbol\sigma}{2},\boldsymbol\sigma\cdot\partial\mathbf r\right\}
= \frac12\boldsymbol\sigma\cdot\partial\mathbf r+\frac14\{\boldsymbol\sigma\cdot \mathbf r,\boldsymbol\sigma\cdot\partial\mathbf r\}
\\= \frac12\boldsymbol\sigma\cdot\partial\mathbf r+\frac12 \mathbf r \cdot\partial\mathbf r
=\frac12\boldsymbol\sigma\cdot\partial\mathbf r = \partial\left(\frac{I+\mathbf r\cdot\boldsymbol\sigma}{2}\right).$$
But what would be direct ways to get to these handy formulas for the LSDs?
I'm aware of the general recipe to compute LSDs via the relation $\frac12(\lambda_i+\lambda_j) L_{ij}=(\partial \rho)_{ij}$ with $\lambda_i$ eigenvalues of $\rho$ and the operators expressed in the eigenstates of $\rho$, but this gets rather unwieldy in this case. Is there a more direct approach (or an easy way to follow this approach)?
Answer: These results are specific to qubits and your direct verification is the best way to do it. You can see this because they required the property of Pauli matrices that $\{\pmb{v}\cdot\pmb{\sigma},\pmb{w}\cdot\pmb{\sigma}\}=2\pmb{v}\cdot \pmb{w}$. If you tried writing your state in some basis of generalized Pauli matrices like $\rho=(I+\pmb{v}\cdot\pmb{\Sigma})/d$ with $\partial \rho=\partial\pmb{v}\cdot\pmb{\Sigma}/d=\partial\pmb{v}\cdot\pmb{\Sigma}/d+\alpha \partial \pmb{v}\cdot \pmb{v}$ and tried to match it with some $\{(I+\pmb{v}\cdot\pmb{\Sigma})/d,\pmb{w}\cdot\pmb{\Sigma}\}/2=\pmb{w}\cdot\pmb{\Sigma}/2+\{\pmb{v}\cdot\pmb{\Sigma}/d,\pmb{w}\cdot\pmb{\Sigma}\}/2$, we wouldn't have a direct way to simplify because of a lack of general relationship $\{\Sigma_i,\Sigma_j\}$.

To generalize this, we go in a different direction. The trick, when dealing with pure states, is to write them as a parametrized unitary acting on a fixed initial state. Then we can express the SLDs in terms of the generators of the unitary and be done.
For a pure state pointing in direction $(\theta,\phi)$ on the surface of the Bloch sphere, we can consider this to have started at (say) the north pole, rotated along the $x$-axis by polar angle $\theta$, then rotated around the $z$-axis by azimuthal angle $\phi$. Alternative constructions are of course possible that achieve this in a single rotation by angle $\theta$ around a $\phi$-dependent axis (something like $x\cos\phi+ y\sin\phi$, but it will pay to be lazy here and not compute it). We thus take
$$|\psi_{(\theta,\phi)}\rangle=e^{-i\phi \sigma_z/2}e^{-i\theta \sigma_y/2}|\psi_{(0,0)}\rangle\equiv U(\theta,\phi)|\psi_0\rangle.$$
The SLDs for pure states undergoing unitary transformations are
$$L_j=2i[|\psi_{(\theta,\phi)}\rangle\langle \psi_{(\theta,\phi)}|,G_j];\qquad G_j=i\frac{\partial U}{\partial \theta_j}U^\dagger$$ (I don't normally compute these, because quantum Fisher information just needs the $G_j$ in the end). Now the only math we need is to compute the generators:
$$G_\theta=U \sigma_y U^\dagger /2\qquad \mathrm{and}\qquad G_\phi=(\sigma_z/2)  \, U U^\dagger.$$ Note that these were easy because I broke $U$ into the two terms and some things commute like $\sigma_y$ and $e^{i\sigma_y}$. The factors of two come from the relative normalization of Pauli matrices versus generators of SU(2) (all of this works for any spin, not just qubits). To be clear, I'll explicitly write
$$G_\theta=e^{-i\phi\sigma_z/2} \sigma_y e^{i\phi\sigma_z/2} /2=(-\sigma_x\sin\phi+\sigma_y \cos\phi)/2\qquad \mathrm{and}\qquad G_\phi=\sigma_z/2.$$ This is the direct way to get the SLDs. It can actually be used for mixed qubit states too because they can be written as some unitary acting on a state whose Bloch vector points toward the north pole but is not unit length (for higher spins, it is not enough to describe the state by a vector length and orientation).
Now, their expressions have derivatives - can we get those? All of the terms in the SLDs here are commutators between angular momentum operators (Pauli matrices making up the $G_j$) and the state. For qubits, that's easy because we know how to do commutators of Pauli matrices with Pauli matrices, but for higher spins the state is not just going to be a linear combination of angular momentum generators, so we won't be able to simplify in the same way. We can do an example:
$$L_\phi=i[\rho,\sigma_z]=i[\frac{I+\pmb{r}\cdot\pmb{\sigma}}{2},\sigma_z]=i^2(r_2,-r_1,0)\cdot\pmb{\sigma}=\partial_\phi \pmb{r}\cdot \pmb{\sigma}.$$ This comes about from the cross product $[(0,0,1)\cdot\pmb{\sigma},\pmb{r}\cdot\pmb{\sigma}]=2i[(0,0,1)\times\pmb{r}]\cdot\pmb{\sigma}$ and then identifying $[(0,0,1)\times\pmb{r}]=\partial_\phi \pmb{r}$.

Other avenues: We could do some math to rewrite $$U(\theta,\phi)=\exp[-i(\boldsymbol{\sigma}\cdot \boldsymbol{v})/2]$$ for a vector $\boldsymbol{v}$ that depends on $(\theta,\phi)$. If I recall correctly it is something like $\boldsymbol{v}=\theta(-\sin\phi,\cos\phi,0)$ (I think it should be perpendicular to your $r$). But then
$$G_j\neq \boldsymbol{\sigma}\cdot\frac{\partial \boldsymbol{v}}{\partial \theta_j}$$ because in general $[\boldsymbol{\sigma}\cdot\frac{\partial \boldsymbol{v}}{\partial \theta_j},U]\neq 0.$ So this does not directly give a method for identifying where the partial derivatives of $\pmb{r}$ come from. Instead, the trick is just to compute all of this in some representation of SU(2) (ie use Pauli matrices) and then show it will have the same format for any spin.


When to say "to be" and "to have been"?

Question: In situations like this one (neither I know if this sentence is gramatically correct, nor I know who is Merkel):
"In her campaigning, Ms Merkel never pretended to be a dissident or an oposition activist in the GDR."
Are there any other similar forms like maybe "to had been"(idk if it even exists)?
Comment: In the context of ***to pretend to [verb]*** *(He pretends **to know**, She pretended **to listen**)*, the *[**verb**]* element must always be an *infinitive* (only the "primary" verb ***pretend*** is conjugated for tense / number). So there's no such sequence as *pretend **to had been*** in English. Chancellor Angela Merkel has been in charge of Germany (and effectively, the EU) for many years now.
Answer: It would be:

In her campaigning, Ms Merkel never pretended to have been a dissident
  or an opposition activist in the GDR.

It would mean that she never pretended (in the then present) to have been something in the past (i.e. prior to the then present).

When to say “to be” and “to have been”?


On which trains in Japan is reservation mandatory?

Question: The vast majority of Japanese trains have so-called non-reserved (or unreserved) seats (自由席, literally "free seats"), which do not allow reservation and are available on a first-come, first-served basis. However, some trains have only reserved seats (指定席), which require prior reservation. What are the most prominent ones, and how to find out whether a given train has non-reserved seats?
Answer: First a reminder: whether one posseses a rail pass such as the Japan Rail Pass has no effect on seat reservation requirements. If reservation is required, it remains so if you have a rail pass. Of course, a rail pass usually allows you to make reservations free of charge, but it is still necessary to visit the ticket office to make your reservation. (Note that some minor regional passes do not allow you to make reservations; in that case all-reserved trains require payment of at least the reservation fee.)
Firstly, there are four all-reserved Shinkansen services. Note that all services on the Tokaido-Sanyo-Kyushu Shinkansen between Tokyo and Kagoshima-Chuo, serving Nagoya, Kyoto, Osaka, Hiroshima, Fukuoka, Kumamoto, etc. have non-reserved seats.

The Hayate and Hayabusa services on the Tohoku-Hokkaido Shinkansen between Tokyo and Shin-Hakodate-Hokuto. However, if your trip is fully on the section between Morioka and Shin-Hakodate-Hokuto, see the note at the bottom.
The Komachi services on the Akita Shinkansen between Tokyo and Akita. However, if your trip is fully on the section between Morioka and Akita, see the note at the bottom.
The Kagayaki services on the Hokuriku Shinkansen between Tokyo and Kanazawa.

If you try to make a reservation on one of those trains and the train is fully booked, you will have the option to obtain a standing ticket, which as its name implies lets you ride the train by standing in the intervals between carriages. A standing ticket is slightly cheaper than a reserved seat ticket, as it does not include the seat reservation fee. It is not possible to obtain a standing ticket in any other circumstance, such as if the train is not fully booked (in order to save money) or on any train other than the four above.
The two "premium" express services serving Narita airport are also all-reserved:

The JR Narita Express, serving many stations in the greater Tokyo area. However, see the note at the bottom.
The Keisei Skyliner, serving Nippori and Ueno.

The two surviving regularly scheduled overnight trains:

The Sunrise Seto, between Tokyo and Takamatsu.
The Sunrise Izumo, between Tokyo and Izumoshi.

Finally, almost all "touristy" trains are all-reserved, such as:

The Resort Shirakami, along the Sea of Japan coast of Aomori and Akita prefectures.
The POKÉMON with YOU, between Ichinoseki and Kesennuma.
The Yufuin no Mori, between Fukuoka and Beppu.
The SL Hitoyoshi, between Kumamoto and Hitoyoshi.
and many more...

The easiest way to find out whether a given train has unreserved seats (or, in general, which seating options are available on it) is to look it up on Hyperdia, and see what options are available in the drop-down list of the "Seat Fee" column. If the column is empty, it means the train is an ordinary commuter train, where reservation is not possible in the first place.

Note about the Hayabusa, Hayate and Komachi services beyond Morioka. To compensate for the fact that no services with non-reserved seats exist beyond Morioka, it is possible to board those services without a reservation, by purchasing a "special limited express ticket" (特定特急券) instead of a regular reserved-seat limited express ticket. A special limited express ticket works in essentially the same way as a non-reserved-seat one would: it is cheaper than a reserved-seat one since it does not include a seat reservation fee, and it allows the holder to use any vacant seat, with the caveat that if another passenger has a reserved-seat ticket for that seat, the latter has priority. Rail pass holders, meanwhile, can simply board with just their pass.
Note about the Narita Express. Similarly, the Narita Express can be boarded without a reservation, by purchasing a "non-designated seat ticket" (座席未指定券) instead of a regular reserved-seat limited express ticket (or just boarding with a rail pass). As above, a non-designated seat ticket allows the holder to use any vacant seat, with the caveat that reserved-seat ticket holders have priority. However, a non-designated seat ticket costs the same as a reserved-seat one. A non-designated seat ticket can also be converted to a reserved-seat one at no extra cost.
Comment: Note that the Narita Express (NEX) has given in since the original answer and [now allows boarding without a reservation](https://www.jreast.co.jp/e/nex/pdf/nex_guide.pdf)
Comment: @Kent Standing tickets are only issued if the train is booked out, for some trains only, and are still required.
Comment: The Meitetsu Limited Express between Nagoya and Nagoya Airport (aka Centrair) is reservation-only.
Comment: One thing to keep in mind regarding the "reservation required" is that it is still possible to ride the train without a seat reservation.  The cost is the same as a reserved seat, and you have to stand in the areas between each car for the whole duration, but in peak travel times this option is still quite popular.  The rail pass covers this type of travel as well.
Comment: All limited express trains on the Chuo East (Azusa, Kaiji) and Joban (Hitachi, Tokiwa) Lines are also all-reserved now.
Answer: @fkraiem's excellent answer covers most JR trains that are all-reserved. I will add information about all-reserved trains run by non-JR companies.
There are few limited express trains operated by non-JR railroad companies, and a majority of them are all reserved. Those of potential interest to tourists are: μSky (Meitetsu), Nagoya-Osaka, Shimakaze (Kintetsu), Hakone (Odakyu) and Rapi:t (Nankai).

Nagoya Railway (Meitetsu)
The μSky (ミュースカイ) limited express between Chubu Centrair International Airport and downtown Nagoya (Jingumae, Kanayama, and Meitetsu-Nagoya) is all-reserved and requires a limited express ticket. Some μSky trains also travel beyond Meitetsu-Nagoya, to Shin-Unuma or Meitetsu-Gifu
Note that the regular limited express trains serving Chubu Centrair International Airport are not all-reserved and only require a limited express ticket if you want to sit in a reserved car.
You can make reservations for Meitetsu trains online.

Kinki Japan Railway (Kintetsu)
All Kintetsu limited express trains are all-reserved.
These include:

the Kintetsu Nagoya-Osaka limited express. There are two types, the "A" limited express Hinotori which stops only at Tsu before arriving at Osaka/Nagoya, and the "B" limited express Urban Liner which makes stops at major stations in Mie and Nara Prefectures.
This train is more economical than the Shinkansen (4,260 vs 5,940+ JPY), but requires 90 minutes as opposed to 50 minutes on the "Nozomi" Shinkansen;

the "sightseeing limited express" Shimakaze, which runs between Kintetsu-Nagoya/Osaka-Namba/Kyoto, and Kashikojima, on Kashikojima Island in Mie Prefecture;

the Aoi Symphony, which runs between Osaka Abenobashi and Yoshino;

the Ise-Shima Liner, which runs between Kintetsu-Nagoya/Osaka-Namba/Kyoto, and Toba/Kashikojima.

Some Kintetsu limited express trains also have special cars and premium seats (similar to Green Cars on JR limited express trains), which carry an extra fee (minimum 200 JPY), but much cheaper than the Green Cars. Hinotori, Shimakaze and Aoi Symphony have only special cars.
You can make reservations for Kintetsu trains online (however, Japanese only).

Tobu Railway
All Tobu limited express trains are all-reserved. Those include:

the Kegon, Liberty Kegon and Kirifuri running between Asakusa and Tobu-Nikko;
the non-regularly scheduled Yunosato running between Asakusa and Shin-Fujiwara;
the Kinu and Liberty Kinu running between Asakusa and Kinugawa-onsen;
the Liberty Aizu running between Asakusa and Aizu-Tajima;
the Shimotsuke running between Asakusa and Tobu-Utsunomiya;
the Ryōmō running between Asakusa and Akagi;
the Skytree Liner running between Asakusa and Kasugabe;
the Urban Park Liner mainly running between Asakusa and Omiya.

There are Tobu trains to the popular tourist destinations Nikko and Kinugawa, but usually the "Nikko" and "Kinugawa" trains operated by JR East (but onto Tobu lines) are more convenient because they depart from Shinjuku.

Seibu Railway
All Seibu limited express trains are all-reserved:

the Chichibu running between Ikebukuro and Seibu-Chichibu;
the Musashi running between Ikebukuro and Hannō;
the Koedo running between Seibu-Shinjuku and Honkawagoe.

Keisei Electric Railway: the only Keisei limited express train, the Skyliner, is mentioned above and is all-reserved.

Odakyu Electric Railway
All Odakyu limited express trains (branded "Romance Car") are all-reserved:

the Hakone and Metro Hakone, running between Shinjuku/Kita-Senju and Hakone. If you plan to go to Hakone, chances are that you are going to take this train;
the Enoshima and Metro Enoshima, running between Shinjuku/Kita-Senju and Katase-Enojima. There are a few ways to get to Enoshima but this is the only direct train;
the Morning Way and Home Way, running between Shinjuku/Otemachi/Kita-Senju and Hakone-Yumoto. These are commuter expresses probably of no interest to tourists.

You can make reservations for Odakyu trains online.

Nankai Electric Railway

the Rapi:t running between Namba and Kansai International Airport (however, note that its JR West counterpart, the Haruka, has non-reserved seats);
the Kōya running between Namba and Gokurokubashi;
the Rinkan running between Namba and Hashimoto;
the Senboku Liner running between Namba and Izumi-Chuo.

Sagano Scenic Railway
Sagano Scienic Railway runs trains on the Sagano Sightseeing Line using open-air trains. All trains are all-reserved. You may make reservations on the JR West website, or at major JR West stations.


SLDS -pageblocktable not responsive inside an outputPanel

Question: I am using SLDS in existing VF page and I also want the page to be responsive. In the code below the outputPanel is responsive but the pageblock table within it is not responsive and it extends out of the outPutPanel. Any idea how to achieve this?  Ideally I need to get a horizontal scroll bar when the output panel becomes narrow. Please see the screen shot and corresponding code below for standard Contact object. Earlier I forgot to mention that this all is happening in a modal window.
Comment: We are unable to visualize the problem, please add some screenshots and post the minimal code with any standard objects; with that it would be easier for us to replicate the issue..
Answer: I figured it out and added inline style to the modal container of the pageblock table so it shows the scrollbar and not extending out of the modal container.


Hide Menu Unless Logged In

Question: I have one menu that I created called "Main Menu" and only want to show it to users that are logged in. I have only been able to find plugins that allow me to show/hide individual menu items, but not the entire menu. How can I do this?
Answer: Assuming you have the ability to either edit the theme or child theme, in the file where the menu is called (probably header.php), use something like this:
<?php
    if( is_user_logged_in() ) :
        wp_nav_menu( array(
            'theme_location' => 'header-nav',
            'menu_id'        => 'header-menu',
        ) );
    endif;
?>

That'll be the preferred option because it won't load the navigation at all, so even someone savvy enough to look at the source code/developer console won't see it.
If you don't have the ability to edit the theme/child theme files, then you can do it using CSS:
#site-navigation {
    display:none;
}
body.logged-in #site-navigation{
    display:block;
}

A few notes, the CSS above addresses the  tag for a site I've recently started building, you'll have to look at your source code/developer console and identify which element/container to add display:none; to.  The important part is that WordPress adds the .logged-in class to the body tag, specifically to allow us to write different CSS/js rules/functions depending on users being logged in.
Like I said though, the CSS isn't the preferred option if what you're after is preventing users that aren't logged in from being able to locate items with a menu - for that, you'd want to use the conditional check at the top.
Addendum
I should also add the you can add an else into the conditional statement and load a different menu, or a login link...
<?php
    if( is_user_logged_in() ) :
        wp_nav_menu( array(
            'theme_location' => 'header-nav',
            'menu_id'        => 'header-menu',
        ) );
    else :
        wp_nav_menu( array(
            'theme_location' => 'header-nav-notloggedin',
            'menu_id'        => 'header-menu-notloggedin',
        ) );
    endif;
?>

Comment: Hi Tony, thanks for the thorough response. Do I need to change "header-nav" or "header-menu" to something else or will those work as is? The theme menu location I'm using is Primary Menu and my menu is called Main Menu. Thanks again!
Comment: You'll need to change them to match the theme.  My guess would be: `'theme_location' => 'primary-menu'`.  You should check in the theme and locate where the menus are registered to ensure that matches.  The `menu_id` can actually be set in the example above, that's where you establish what the ID of the `` element is, so you don't need to match it.  In your theme there's be a place that has a 'register_nav_menus()' function, locate that and see what they set as location for the 'Primary Menu'.
Comment: Actually, if you look in your header.php file, you'll see what's already there - just take what's there, replace the `wp_nav_menu()` in the code I gave you and then paste my code in it's place.

Hide Menu Unless Logged In


How to apply Geometry Nodes with UV maps?

Question: I am trying to scatter a textured object with Geometry Nodes. After applying Geometry Nodes, my objects lose the texture coordinates.
Is there any way to get UV maps on these scattered objects?
Comment: This is a known limitation currently. See https://developer.blender.org/T86653 and https://developer.blender.org/T85962
Comment: You could use "Make instances real" under Object Menu > Apply >Make instances Real... You will have an object per cube so, then you need to join them with CTRL + J
Comment: I see, it works with attribute. But still want to have a solution to pass UV into regular texture coordinate.
Answer: With Blender 3.1.2+ the bug has been fixed.
The UV maps created in your objects will be processed correctly in the shader if they were previously instantiated with Geometry Nodes.

However, as soon as you use the Realize Instances node in the geometry nodes, you have to reattach the UV map with the Attribute node in the shader.
Answer: This is what worked for me:

create a custom material on Instance, use Attribute for UV with a custom string 'UVOutput'

create a custom geonode on Instance, use its UV map as input and output to 'UVOutput' -- this is to convert uv data to attribute data format in Blender

Make sure UV input string is consistent as the UV setting of the Instance object (this gets confusing if you have multiple objects)

All is explained in the graph, hope this is helpful
Comment: This was the answer for me. Cheers!
Answer: I think I have a really good solution, expanding from @totegamma's response in this POST
import bpy

# Get the active object
obj = bpy.context.active_object

# Duplicate the object (USING COPY SO TO NOT AFFECT ORIGINAL MODEL)
duplicate_obj = obj.copy()
duplicate_obj.data = obj.data.copy()
bpy.context.collection.objects.link(duplicate_obj)

# Set the context
bpy.context.view_layer.objects.active = duplicate_obj

# Apply the modifier
with bpy.context.temp_override(object=duplicate_obj):
    bpy.ops.object.modifier_apply(modifier=duplicate_obj.modifiers[0].name)

# Add UV Slot
bpy.ops.mesh.uv_texture_add()

# Pass Attributes to Layers (totegamma)
attrUV = duplicate_obj.data.attributes["UVMap"].data
targetObjUV = duplicate_obj.data.uv_layers[0].data

for i, elem in enumerate(targetObjUV):
    elem.uv = attrUV[i].vector

If anyone needs clarification let me know, but this should:
*Apply FIRST modifier (you can edit "duplicate_obj.modifiers[0]" to be 1, 2, etc)
*Add UVMap Slot
*Copy UV data from attributes to the actual UV Map

Answer: Using a similar technique in principle to this:
Assign vertex group in Geometry Nodes (v3.3)
You can split edges, save your vertex positions, and then move them to their UV coordinates:

Then add a UV Project modifier:

Set the chosen camera to orthographic, projection scale to 1, position it at $(0.5, 0.5, 0)$ coordinates. Finally, add another geonodes setup restoring the positions and merging split edges:

It's worth to note if the original geometry had some split edges, this technique loses that information - I have an idea how one could restore that information, but it probably deserves a new question "How to split edges and then merge only those that were split?".
Comment: This is a wild solution I love it!
Answer: I found alternative dirty solution to create UV on realized instances.
Its based on splitting object by normals what can be used as a seam.
Hope its not magically working only for me :)
sources:
https://www.youtube.com/watch?v=02XNGOVpSV4&t=445s&ab_channel=Entagma
https://www.youtube.com/watch?v=wVhThuzRDIk&t=740s&ab_channel=JohnnyMatthews


Can I make an iPhone ring on cue without making an actual call?

Question: The theater company I work with is doing a show this fall in which a key plot point is an iPhone ringing while it's in someone's purse. They really want to make an iPhone ring and not just use a sound cue. But cell reception inside the theater is spotty at best. Is there some way to get an iPhone to ring without making a call to it?
Answer: You can connect Your iPhone to WiFi (so that it has access to the internet) and ring via FaceTime.
To change FaceTime ringtone go to Preferences -> Notifications -> FaceTime.
Answer: Two ways to simulate the effect of an iPhone ringing:

Set a timer in the Clock app with the alert sound set to Marimba (the default iOS ringtone). However, this would require knowing exactly how long to wait before the sound plays.
Load an MP3 file of the default Marimba ringtone into the Music app and play it via a Bluetooth controller. Slightly more complex than the first option but allows more flexibility in the act.

Unless there is something theatrically different between these options and an actual phone call to the iPhone, these are the only options I can think of without cell reception or wifi.


Any video tutorial for 3D printing

Question: I am new here and would like to work on a project to 3D print a precision prototype. What is the most affordable way to do it? How do I go about it?
Answer: [The question ask asked is vague, but since you are new it is understandable.]
If you want to build a precision prototype then you have to decide on the level of precision that is necessary. There are different types of 3D printers and services available which give various levels of precision and functionality.
Fused Filament Fabrication/Fused Deposition Modeling - This is typically a means of producing functional prototypes using plastic filament. In terms of precision it is currently the lest precise, but the most cost effective.
Binder Jetting - This is basically crazy glue with food coloring which is inkjet printed onto a white powder layer by layer (vast oversimplification). Useful for producing prototypes with colours for product mockups but not for functional parts. This is mid the mid point in terms of price and precision.
Stereo Lithography / Photo polymerization  - Lasers cause a liquid resin to harden and stick to each other. Also notable for being the first form of 3D printing, this is the highest precision that is easily attainable. The cost varies based on the provider but it is usually the most expensive option.
Depending on your needs you may find that it is cheaper to develop a single prototype part (just one part not an entire machine) by sending out to a contract manufacturer as opposed to purchasing a 3D printer.
Here are some examples of what to do when:

If you want to develop a diamond engagement ring for a customer: Send out to a contract manufacturer, for Stereo Lithography
If you broke part of the cupboard and its easy to design a new one: Consider purchasing a sub $400 USD FFF machine and learn to use it.
If you are developing a new line of designer sneaker: Send out to a contract manufacturer for Binder Jetting.
If you are doing miniature figurines for a stop motion animation television series: Invest in a Binder Jet machine and learn how to use it.

In my experience, people don't buy a 3D printer until they have held a 3D printed part in their hand or have seen the machinery in person. If you are new, start with a contract manufacturer and when you start spending so much on them that it is equaling the cost of owning a machine, then invest in your own system.
Answer: These two videos seem to give a good, general, entry-level introduction to the various technologies and processes that are involved in 3D printing:

The Ultimate Beginner's Guide to 3D Printing - Part 1
The Ultimate Beginner's Guide to 3D Printing - Part 2

Any video tutorial for 3D printing


What Changed with Shimano Hyperglide-C?

Question: Shimano's HyperGlide-C (11-speed), are the hubs backwards compatible?
Can I put an 8/9/10-speed cassette on a Hyperglide-C hub?
Can I put a Hyperglide-C cassette on a Hyperglide hub?
Answer: Sheldon Brown to the rescue: "Shimano uses the trademark "Hyperglide-C" to designate a system with an 11 tooth sprocket. The "C" stands for "compact". These systems are used with smaller-than-usual chainwheel sizes, or on bicycles that have a small drive wheel, or to achieve higher gears.
Due to clearance problems, the cutaway between the splines on 11-tooth sprockets only goes halfway through the sprocket. The matching splines on Hyperglide-C bodies don't go all the way to the outer end of the body."
To summarize: Hyperglide-C cassette on non-hyperglide C body gives wobbles (which you can correct with a 1 mm spacer).
In the reverse case, you can remove some spacers from your cassette (if you have them) to get it to fit (though I'm not really sure when this case would practically occur).
Comment: From reading your second link it seems like I have a fundamental misconception. Hyperglide-C is the 11-speed standard, right? Why is this guy asking: "I've got a worn 7-speed Hyperglide-C cassette?"
Comment: Seems like a typo - he corrects it later in the same paragraph and in the second post of his in the thread.

What Changed with Shimano Hyperglide-C?


Accessing a dialog box's handle and automatically manipulating the user interface

Question: I have some VB code which makes use of a COM api and results in a certain dialog box popping up on the screen. My program is a console application, that needs to run in a batch file, but I haven't found any other way to do things other than finding a way to automatically manipulate the dialog box.
Here is the api call (omitting setup code) that results in the dialog popping up:
  Dim oScript = New ProvideX.Script()

  ' Setup code here '

  oScript.Run(commName)

This method has no return value, and no extra parameters that would enable me to fill in the values I need through the API.
I have found one method to get the handle of the dialog window, but I'm not sure if it will work, or if it will grab onto the Command line window instead.
Dim windowHandle = Process.GetCurrentProcess().MainWindowHandle

Is there any way to get a list of windows that were created by my process so I can identify the one that corresponds to my dialog?
Also, can anyone point me in the right direction of how to do send mouse clicks and keyboard presses to an unmanaged dialog box, or is there some better way to do what I need.
This is a fairly simple dialog box that has a warning prompt that needs to be accepted by clicking on an ok button. Then there are two text boxes that need to be filled out with data I have. And then I need to click on another button.
I'm not asking for a complete answer, I'm just looking for the general jist of how to do it.
Edit: I was doing research at PINVOKE.net and I think SendInput will work if I can get the right handle. I've walked through the dialog and it can all be handled by keyboard input.
Answer: To get an HWND of the dialog, I would call FindWindow(). You can pass it the class name and caption of your dialog, and it should return its HWND to you. You can use a tool like Spy++ (installed by Visual Studio, at least the Professional Edition) or WinCheat to find this for your dialog.
From there, if you want to get an HWND for the OK button, try calling either GetDlgItem() (passing it the HWND of your dialog and its ID (Spy++ can get this for you, I'm not sure if WinCheat can or not). If that doesn't work, you could always try calling EnumChildWindows() and see if you can find it that way.
I'm not a VB expert, and calling some of these functions from VB might be hard and/or not work (especially EnumChildWindows(), since it requires a callback function). But hopefully this will give you a place to start looking.
Answer: IIRC I'm using EnumChildWindows() in StaxRip, you can find the VB.NET code at http://www.stax76.bplaced.net or when you find C# code you can translate it to VB.NET with Reflector, SharpDevelop or the SharpDevelop online convertor service.


Having Issues Importing and Using RLGlue locally with Python For Reinforcement Learning

Question: I'm going through an online course on Coursera for Reinforcement Learning that makes use of RLGlue. I want to try to run and adapt the code locally, but am having issues using RLGlue, and not sure why.
I was going through an Reinforcement Learning Course and wanted to try running the code locally. I installed RLGlue with pip install rlglue from here
But then when trying to run the code:
from rlglue.rl_glue import RLGlue
import main_agent
import ten_arm_env
import test_env

Received this error message: ModuleNotFoundError: No module named 'rlglue.rl_glue'
I also attempted to install it from here that supports the course, and with
pip install git+https://firstname.lastname@example.com
but that didn't work either.
Any idea on how to fix that to import the module and run the code?
Answer: This worked for me:
from RLGlue.rl_glue import RLGlue
This is only with the Coursera version of RLGlue


Is it possible to connect two 4k monitors to one thunderbolt port?

Question: I want to buy the new macbook pro 13" without touchbar and be able to connect two 4k monitors AND the charger. But this macbook only has 2 ports.
Answer: What you want to do is possible, but not without either using an adapter, dock, or the right kind of displays. For example:

you can use a display that allows you to daisy-chain to another display (i.e. you have a charger plugged into one of your ports, and you have one display connected to the other port and a second display connected to the first display)
you purchase a dock such as the OWC's Thunderbolt 3 Dock.
you purchase at least one display that will provide charging power to your MBP (e.g. the LG UltraFine 4K Display).

You may want to also read:

About Thunderbolt ports and displays
Connect with Thunderbolt 3 on your new MacBook Pro
Use the LG UltraFine 4K Display with your Mac

NOTE: IMHO, if you're wanting to run two 4K displays you probably should invest in a MBP with four Thunderbolt ports, as this is likely to provide more flexibility in terms of usage and the variety of devices you can purchase to meet your needs.
Comment: You're right. For the price of these docks and the ultraFine, I'd rather invest in the touchbar model and be better prepared for the usb-c era. But just curious, do to know of any monitor that you can daisy-chain on a Mac? From my research I found that the apple's old thunderbolt display was the only one that supported that.
Answer: Here's a cheap solution - for the 2nd display, use a mini-displayport to USB-C adapter that also has power-input. Something like this - https://www.amazon.com/Paheven-Display-JellyFish-Mini-DisplayPort-Charging/dp/B079CBNK8M/


tieing different gauge of speaker wire together for one speaker

Question: I am running speaker wire around the room but I've run short for 2 of em
can I safely tie 2 different gauge of wires together for one speaker
Comment: How many watts? What are the two gauges? If you get too fine a wire, sound quality will be noticeably degraded. Stranded14 gauge lamp cord, by the foot/meter from the hardware store makes pretty good speaker wire. If you've 100 rms watts or more per channel, 12 gauge would be a better choice soundwise.
Answer: Using two different gages of wire is no worse than just using the thinner gage of wire; switching won't harm anything (as long as the connection is done properly).
As for the minimum gage to use, when I was at MIT I ran 150' of #24 double twisted pair stranded wire from the stereo in my room to my speakers in the courtyard. It sounded fine to me. Quite possibly I had/have tin ears, but I'm sure the results weren't awful. So, unless you're using extremely thin or extremely long cables, you'll be fine. (The humongous, finely-stranded, oxygen-free speaker cables you'll find sold for an arm and a leg are just silly.)