CHAPTER VIII
(Delivered in London, 29th October 1896)
I will read to you from one of the Upanishads. It is called the Katha Upanishad. Some of you, perhaps, have read the translation by Sir Edwin Arnold, called the Secret of Death. In our last [i.e. a previous] lecture we saw how the inquiry which started with the origin of the world, and the creation of the universe, failed to obtain a satisfactory answer from without, and how it then turned inwards. This book psychologically takes up that suggestion, questioning into the internal nature of man. It was first asked who created the external world, and how it came into being. Now the question is: What is that in man; which makes him live and move, and what becomes of that when he dies? The first philosophers studied the material substance, and tried to reach the ultimate through that. At the best, they found a personal governor of the universe, a human being immensely magnified, but yet to all intents and purposes a human being. But that could not be the whole of truth; at best, it could be only partial truth. We see this universe as human beings, and our God is our human explanation of the universe.
Suppose a cow were philosophical and had religion it would have a cow universe, and a cow solution of the problem, and it would not be possible that it should see our God. Suppose cats became philosophers, they would see a cat universe and have a cat solution of the problem of the universe, and a cat ruling it. So we see from this that our explanation of the universe is not the whole of the solution. Neither does our conception cover the whole of the universe. It would be a great mistake to accept that tremendously selfish position which man is apt to take. Such a solution of the universal problem as we can get from the outside labours under this difficulty that in the first place the universe we see is our own particular universe, our own view of the Reality. That Reality we cannot see through the senses; we cannot comprehend It. We only know the universe from the point of view of beings with five senses. Suppose we obtain another sense, the whole universe must change for us. Suppose we had a magnetic sense, it is quite possible that we might then find millions and millions of forces in existence which we do not now know, and for which we have no present sense or feeling. Our senses are limited, very limited indeed; and within these limitations exists what we call our universe; and our God is the solution of that universe, but that cannot be the solution of the whole problem. But man cannot stop there. He is a thinking being and wants to find a solution which will comprehensively explain all the universes. He wants to see a world which is at once the world of men, and of gods, and of all possible beings, and to find a solution which will explain all phenomena.
We see, we must first find the universe which includes all universes; we must find something which, by itself, must be the material running through all these various planes of existence, whether we apprehend it through the senses or not. If we could possibly find something which we could know as the common property of the lower as well as of the higher worlds, then our problem would be solved. Even if by the sheer force of logic alone we could understand that there must be one basis of all existence, then our problem might approach to some sort of solution; but this solution certainly cannot be obtained only through the world we see and know, because it is only a partial view of the whole.
Our only hope then lies in penetrating deeper. The early thinkers discovered that the farther they were from; the centre, the more marked were the variations and differentiations; and that the nearer they approached the centre, the nearer they were to unity. The nearer we are to the centre of a circle, the nearer we are to the common ground in which all the radii meet; and the farther we are from the centre, the more divergent is our radial line from the others. The external world is far away from the centre, and so there is no common ground in it where all the phenomena of existence can meet. At best, the external world is but one part of the whole of phenomena. There are other parts, the mental, the moral, and the intellectual — the various planes of existence — and to take up only one, and find a solution of the whole out of that one, is simply impossible. We first, therefore, want to find somewhere a centre from which, as it were, all the other planes of existence start, and standing there we should try to find a solution. That is the proposition. And where is that centre? It is within us. The ancient sages penetrated deeper and deeper until they found that in the innermost core of the human soul is the centre of the whole universe. All the planes gravitate towards that one point. That is the common ground, and standing there alone can we find a common solution. So the question who made this world is not very philosophical, nor does its solution amount to anything.
This the Katha Upanishad speaks in very figurative language. There was, in ancient times, a very rich man, who made a certain sacrifice which required that he should give away everything that he had. Now, this man was not sincere. He wanted to get the fame and glory of having made the sacrifice, but he was only giving things which were of no further use to him — old cows, barren, blind, and lame. He had a boy called Nachiketas. This boy saw that his father was not doing what was right, that he was breaking his vow; but he did not know what to say to him. In India, father and mother are living gods to their children. And so the boy approached the father with the greatest respect and humbly inquired of him, "Father, to whom are you going to give me? For your sacrifice requires that everything shall be given away." The father was very much vexed at this question and replied, "What do you mean, boy? A father giving away his own son?" The boy asked the question a second and a third time, and then the angry father answered, "Thee I give unto Death (Yama)." And the story goes on to say that the boy went to Yama, the god of death. Yama was the first man who died. He went to heaven and became the governor of all the Pitris; all the good people who die, go, and live with him for a long time. He is a very pure and holy person, chaste and good, as his name (Yama) implies.
So the boy went to Yama's world. But even gods are sometimes not at home, and three days this boy had to wait there. After the third day Yama returned. "O learned one," said Yama, "you have been waiting here for three days without food, and you are a guest worthy of respect. Salutation to thee, O Brahmin, and welfare to me! I am very sorry I was not at home. But for that I will make amends. Ask three boons, one for each day." And the boy asked, "My first boon is that my father's anger against me may pass away; that he will be kind to me and recognise me when you allow me to depart." Yama granted this fully. The next boon was that he wanted to know about a certain sacrifice which took people to heaven. Now we have seen that the oldest idea which we got in the Samhitâ portion of the Vedas was only about heaven where they had bright bodies and lived with the fathers. Gradually other ideas came, but they were not satisfying; there was still need for something higher. Living in heaven would not be very different from life in this world. At best, it would only be a very healthy rich man's life, with plenty of sense-enjoyments and a sound body which knows no disease. It would be this material world, only a little more refined; and we have seen the difficulty that the external material world can never solve the problem. So no heaven can solve the problem. If this world cannot solve the problem, no multiplication of this world can do so, because we must always remember that matter is only an infinitesimal part of the phenomena of nature. The vast part of phenomena which we actually see is not matter. For instance, in every moment of our life what a great part is played by thought and feeling, compared with the material phenomena outside! How vast is this internal world with its tremendous activity! The sense-phenomena are very small compared with it. The heaven solution commits this mistake; it insists that the whole of phenomena is only in touch, taste, sight, etc. So this idea of heaven did not give full satisfaction to all. Yet Nachiketas asks, as the second boon, about some sacrifice through which people might attain to this heaven. There was an idea in the Vedas that these sacrifices pleased the gods and took human beings to heaven.
In studying all religions you will notice the fact that whatever is old becomes holy. For instance, our forefathers in India used to write on birch bark, but in time they learnt how to make paper. Yet the birch bark is still looked upon as very holy. When the utensils in which they used to cook in ancient times were improved upon, the old ones became holy; and nowhere is this idea more kept up than in India. Old methods, which must be nine or ten thousand years old, as of rubbing two sticks together to make fire, are still followed. At the time of sacrifice no other method will do. So with the other branch of the Asiatic Aryans. Their modern descendants still like to obtain fire from lightning, showing that they used to get fire in this way. Even when they learnt other customs, they kept up the old ones, which then became holy. So with the Hebrews. They used to write on parchment. They now write on paper, but parchment is very holy. So with all nations. Every rite which you now consider holy was simply an old custom, and the Vedic sacrifice were of this nature. In course of time, as they found better methods of life, their ideas were much improved; still these old forms remained, and from time to time they were practiced and received a holy significance.
Then, a body of men made it their business to carry on these sacrifices. These were the priests, who speculated on the sacrifices, and the sacrifices became everything to them. The gods came to enjoy the fragrance of the sacrifices, and it was considered that everything in this world could be got by the power of sacrifices. If certain oblations were made, certain hymns chanted, certain peculiar forms of altars made, the gods would grant everything. So Nachiketas asks by what form of sacrifice can a man go to heaven. The second boon was also readily granted by Yama who promised that this sacrifice should henceforth be named after Nachiketas.
Then the third boon comes, and with that the Upanishad proper begins. The boy said, "There is this difficulty: when a man dies some say he is, others that he is not. Instructed by you I desire to understand this." But Yama was frightened. He had been very glad to grant the other two boons. Now he said, "The gods in ancient times were puzzled on this point. This subtle law is not easy to understand. Choose some other boon, O Nachiketas, do not press me on this point, release me."
The boy was determined, and said, "What you have said is true, O Death, that even the gods had doubts on this point, and it is no easy matter to understand. But I cannot obtain another exponent like you and there is no other boon equal to this."
Death said, "Ask for sons and grandsons who will live one hundred years, many cattle, elephants, gold, and horses. Ask for empire on this earth and live as many years as you like. Or choose any other boon which you think equal to these — wealth and long life. Or be thou a king, O Nachiketas, on the wide earth. I will make thee the enjoyer of all desires. Ask for all those desires which are difficult to obtain in the world. These heavenly maidens with chariots and music, which are not to be obtained by man, are yours. Let them serve you. O Nachiketas, but do not question me as to what comes after death."
Nachiketas said, "These are merely things of a day, O Death, they wear away the energy of all the sense-organs. Even the longest life is very short. These horses and chariots, dances and songs, may remain with Thee. Man cannot be satisfied by wealth. Can we retain wealth when we behold Thee? We shall live only so long as Thou desires". Only the boon which I have asked is chosen by me."
Yama was pleased with this answer and said, "Perfection is one thing and enjoyment another; these two having different ends, engage men differently. He who chooses perfection becomes pure. He who chooses enjoyment misses his true end. Both perfection and enjoyment present themselves to man; the wise man having examined both distinguishes one from the other. He chooses perfection as being superior to enjoyment, but the foolish man chooses enjoyment for the pleasure of his body. O Nachiketas, having thought upon the things which are only apparently desirable, thou hast wisely abandoned them." Death then proceeded to teach Nachiketas.
We now get a very developed idea of renunciation and Vedic morality, that until one has conquered the desires for enjoyment the truth will not shine in him. So long as these vain desires of our senses are clamouring and as it were dragging us outwards every moment, making us slaves to everything outside — to a little colour, a little taste, a little touch — notwithstanding all our pretensions, how can the truth express itself in our hearts?
Yama said, "That which is beyond never rises before the mind of a thoughtless child deluded by the folly of riches. 'This world exists, the other does not,' thinking thus they come again and again under my power. To understand this truth is very difficult. Many, even hearing it continually, do not understand it, for the speaker must be wonderful, so must be the hearer. The teacher must be wonderful, so must be the taught. Neither is the mind to be disturbed By vain arguments, for it is no more a question of argument, it is a question of fact." We have always heard that every religion insists on our having faith. We have been taught to believe blindly. Well, this idea of blind faith is objectionable, no doubt, but analysing it, we find that behind it is a very great truth. What it really means is what we read now. The mind is not to be ruffled by vain arguments, because argument will not help us to know God. It is a question of fact, and not of argument. All argument and reasoning must be based upon certain perceptions. Without these, there cannot be any argument. Reasoning is the method of comparison between certain facts which we have already perceived. If these perceived facts are not there already, there cannot be any reasoning. If this is true of external phenomena, why should it not be so of the internal? The chemist takes certain chemicals and certain results are produced. This is a fact; you see it, sense it, and make that the basis on which to build all your chemical arguments. So with the physicists, so with all other sciences. All knowledge must stand on perception of certain facts, and upon that we have to build our reasoning. But, curiously enough the vast majority of mankind think, especially at the present time, that no such perception is possible in religion, that religion can only be apprehended by vain arguments. Therefore we are told not to disturb the mind by vain arguments. Religion is a question of fact, not of talk. We have to analyse our own souls and to find what is there. We have to understand it and to realise what is understood. That is religion. No amount of talk will make religion. So the question whether there is a God or not can never be proved by argument, for the arguments are as much on one side as on the other. But if there is a God, He is in our own hearts. Have you ever seen Him? The question as to whether this world exists or not has not yet been decided, and the debate between the idealists and the realists is endless. Yet we know that the world exists, that it goes on. We only change the meaning of words. So, with all the questions of life, we must come to facts. There are certain religious facts which, as in external science, have to be perceived, and upon them religion will be built. Of course, the extreme claim that you must believe every dogma of a religion is degrading to the human mind. The man who asks you to believe everything, degrades himself, and, if you believe, degrades you too. The sages of the world have only the right to tell us that they have analysed their minds and have found these facts, and if we do the same we shall also believe, and not before. That is all that there is in religion. But you must always remember this, that as a matter of fact 99.9 per cent of those who attack religion have never analysed their minds, have never struggled to get at the facts. So their arguments do not have any weight against religion, any more than the words of a blind man who cries out, "You are all fools who believe in the sun," would affect us.
This is one great idea to learn and to hold on to, this idea of realisation. This turmoil and fight and difference in religions will cease only when we understand that religion is not in books and temples. It is an actual perception. Only the man who has actually perceived God and soul has religion.  We are all atheists; let us confess it. Mere intellectual assent does not make us religious. Take a Christian, or a Mohammedan, or a follower of any other religion in the world. Any man who truly realised the truth of the Sermon on the Mount would be perfect, and become a god immediately. Yet it is said that there are many millions of Christians in the world. What is meant is that mankind may at some time try to realise that Sermon. Not one in twenty millions is a real Christian.
So, in India, there are said to be three hundred millions of Vedantins. But if there were one in a thousand who had actually realised religion, this world would soon be greatly changed. We are all atheists, and yet we try to fight the man who admits it. We are all in the dark; religion is to us a mere intellectual assent, a mere talk, a mere nothing. We often consider a man religious who can talk well. But this is not religion. "Wonderful methods of joining words, rhetorical powers, and explaining texts of the books in various ways — these are only for the enjoyment of the learned, and not religion." Religion comes when that actual realisation in our own souls begins. That will be the dawn of religion; and then alone we shall be moral. Now we are not much more moral than the animals. We are only held down by the whips of society. If society said today, "I will not punish you if you steal", we should just make a rush for each other's property. It is the policeman that makes us moral. It is social opinion that makes us moral, and really we are little better than animals. We understand how much this is so in the secret of our own hearts. So let us not be hypocrites. Let us confess that we are not religious and have no right to look down on others. We are all brothers and we shall be truly moral when we have realised religion.
If you have seen a certain country, and a man forces you to say that you have not seen it, still in your heart of hearts you know you have. So, when you see religion and God in a more intense sense than you see this external world, nothing will be able to shake your belief. Then you have real faith. That is what is meant by the words in your Gospel, "He who has faith even as a grain of mustard seed." Then you will know the Truth because you have become the Truth.
This is the watchword of the Vedanta — realise religion, no talking will do. But it is done with great difficulty. He has hidden Himself inside the atom, this Ancient One who resides in the inmost recess of every human heart. The sages realised Him through the power of introspection, and got beyond both joy and misery, beyond what we call virtue and vice, beyond good and bad deeds, beyond being and non-being; he who has seen Him has seen the Reality. But what then about heaven? It was the idea of happiness minus unhappiness. That is to say, what we want is the joys of this life minus its sorrows. That is a very good idea, no doubt; it comes naturally; but it is a mistake throughout, because there is no such thing as absolute good, nor any such thing as absolute evil.
You have all heard of that rich man in Rome who learnt one day that he had only about a million pounds of his property left; he said, "What shall I do tomorrow?" and forthwith committed suicide. A million pounds was poverty to him. What is joy, and what is sorrow? It is a vanishing quantity, continually vanishing. When I was a child I thought if I could be a cabman, it would be the very acme of happiness for me to drive about. I do not think so now. To what joy will you cling? This is the one point we must all try to understand, and it is one of the last superstitions to leave us. Everyone's idea of pleasure is different. I have seen a man who is not happy unless he swallows a lump of opium every day. He may dream of a heaven where the land is made of opium. That would be a very bad heaven for me. Again and again in Arabian poetry we read of heaven with beautiful gardens, through which rivers run. I lived much of my life in a country where there is too much water; many villages are flooded and thousands of lives are sacrificed every year. So, my heaven would not have gardens through which rivers flow; I would have a land where very little rain falls. Our pleasures are always changing. If a young man dreams of heaven, he dreams of a heaven where he will have a beautiful wife. When that same man becomes old he does not want a wife. It is our necessities which make our heaven, and the heaven changes with the change of our necessities. If we had a heaven like that desired by those to whom sense-enjoyment is the very end of existence, then we would not progress. That would be the most terrible curse we could pronounce on the soul. Is this all we can come to?   That is what you do when you cry after the joys of this world, for you do not know what true joy is. What philosophy insists on is not to give up joys, but to know what joy really is. The Norwegian heaven is a tremendous fighting place where they all sit before Odin; they have a wild boar hunt, and then they go to war and slash each other to pieces. But in some way or other, after a few hours of such fighting, the wounds are all healed up, and they go into a hall where the boar has been roasted, and have a carousal. And then the wild boar takes form again, ready to be hunted the next day. That is much the same thing as our heaven, not a whit worse, only our ideas may be a little more refined. We want to hunt wild boars, and get to a place where all enjoyments will continue, just as the Norwegian imagines that the wild boar is hunted and eaten every day, and recovers the next day.
Now, philosophy insists that there is a joy which is absolute, which never changes. That joy cannot be the joys and pleasures we have in this life, and yet Vedanta shows that everything that is joyful in this life is but a particle of that real joy, because that is the only joy there is. Every moment really we are enjoying the absolute bliss, though covered up, misunderstood, and caricatured. Wherever there is any blessing, blissfulness, or joy, even the joy of the thief in stealing, it is that absolute bliss coming out, only it has become obscured, muddled up, as it were, with all sorts of extraneous conditions, and misunderstood. But to understand that, we have to go through the negation, and then the positive side will begin. We have to give up ignorance and all that is false, and then truth will begin to reveal itself to us. When we have grasped the truth, things which we gave up at first will take new shape and form, will appear to us in a new light, and become deified. They will have become sublimated, and then we shall understand them in their true light. But to understand them, we have first to get a glimpse of truth; we must give them up at first, and then we get them back again, deified. We have to give up all our miseries and sorrows, all our little joys.
"That which all the Vedas declare, which is proclaimed by all penances, seeking which men lead lives of continence, I will tell you in one word — it is 'Om'." You will find this word "Om" praised very much in the Vedas, and it is held to be very sacred.
Now Yama answers the question: "What becomes of a man when the body dies ?" "This Wise One never dies, is never born, It arises from nothing, and nothing arises from It. Unborn, Eternal, Everlasting, this Ancient One can never be destroyed with the destruction of the body. If the slayer thinks he can slay, or if the slain thinks he is slain, they both do not know the truth, for the Self neither slays nor is slain." A most tremendous position. I should like to draw your attention to the adjective in the first line, which is "wise". As we proceed we shall find that the ideal of the Vedanta is that all wisdom and all purity are in the soul already, dimly expressed or better expressed — that is all the difference. The difference between man and man, and all things in the whole creation, is not in kind but only in degree. The background, the reality, of everyone is that same Eternal, Ever Blessed, Ever Pure, and Ever Perfect One. It is the Atman, the Soul, in the saint and the sinner, in the happy and the miserable, in the beautiful and the ugly, in men and in animals; it is the same throughout. It is the shining One. The difference is caused by the power of expression. In some It is expressed more, in others less, but this difference of expression has no effect upon the Atman. If in their dress one man shows more of his body than another, it does not make any difference in their bodies; the difference is in their dress. We had better remember here that throughout the Vedanta philosophy, there is no such thing as good and bad, they are not two different things; the same thing is good or bad, and the difference is only in degree. The very thing I call pleasurable today, tomorrow under better circumstances I may call pain. The fire that warms us can also consume us; it is not the fault of the fire. Thus, the Soul being pure and perfect, the man who does evil is giving the lie unto himself, he does not know the nature of himself. Even in the murderer the pure Soul is there; It dies not. It was his mistake; he could not manifest It; he had covered It up. Nor in the man who thinks that he is killed is the Soul killed; It is eternal. It can never be killed, never destroyed. "Infinitely smaller than the smallest, infinitely larger than the largest, this Lord of all is present in the depths of every human heart. The sinless, bereft of all misery, see Him through the mercy of the Lord; the Bodiless, yet dwelling in the body; the Spaceless, yet seeming to occupy space; Infinite, Omnipresent: knowing such to be the Soul, the sages never are miserable."
"This Atman is not to be realised by the power of speech, nor by a vast intellect, nor by the study of their Vedas." This is a very bold utterance. As I told you before, the sages were very bold thinkers, and never stopped at anything. You will remember that in India these Vedas are regarded in a much higher light than even the Christians regard their Bible. Your idea of revelation is that a man was inspired by God; but in India the idea is that things exist because they are in the Vedas. In and through the Vedas the whole creation has come. All that is called knowledge is in the Vedas. Every word is sacred and eternal, eternal as the soul, without beginning and without end. The whole of the Creator's mind is in this book, as it were. That is the light in which the Vedas are held. Why is this thing moral? Because the Vedas say so. Why is that thing immoral? Because the Vedas say so. In spite of that, look at the boldness of these sages whom proclaimed that the truth is not to be found by much study of the Vedas. "With whom the Lord is pleased, to that man He expresses Himself." But then, the objection may be advanced that this is something like partisanship. But at Yama explains, "Those who are evil-doers, whose minds area not peaceful, can never see the Light. It is to those whore are true in heart, pure in deed, whose senses are controlled, that this Self manifests Itself."
Here is a beautiful figure. Picture the Self to be then rider and this body the chariot, the intellect to be the charioteer, mind the reins, and the senses the horses. He whose horses are well broken, and whose reins are strong and kept well in the hands of the charioteer (the intellect) reaches the goal which is the state of Him, the Omnipresent. But the man whose horses (the senses) are not controlled, nor the reins (the mind) well managed, goes to destruction. This Atman in all beings does not manifest Himself to the eyes or the senses, but those whose minds have become purified and refined realise Him. Beyond all sound, all sight, beyond form, absolute, beyond all taste and touch, infinite, without beginning and without end, even beyond nature, the Unchangeable; he who realises Him, frees himself from the jaws of death. But it is very difficult. It is, as it were, walking on the edge of a razor; the way is long and perilous, but struggle on, do not despair. Awake, arise, and stop not till the goal is reached.
The one central idea throughout all the Upanishads is that of realisation. A great many questions will arise from time to time, and especially to the modern man. There will be the question of utility, there will be various other questions, but in all we shall find that we are prompted by our past associations. It is association of ideas that has such a tremendous power over our minds. To those who from childhood have always heard of a Personal God and the personality of the mind, these ideas will of course appear very stern and harsh, but if they listen to them and think over them, they will become part of their lives and will no longer frighten them. The great question that generally arises is the utility of philosophy. To that there can be only one answer: if on the utilitarian ground it is good for men to seek for pleasure, why should not those whose pleasure is in religious speculation seek for that? Because sense-enjoyments please many, they seek for them, but there may be others whom they do not please, who want higher enjoyment. The dog's pleasure is only in eating and drinking. The dog cannot understand the pleasure of the scientist who gives up everything, and, perhaps, dwells on the top of a mountain to observe the position of certain stars. The dogs may smile at him and think he is a madman.  May be, the dog laughs at him. But the scientist says, "My dear dog, your pleasure is only in the senses which you enjoy, and you know nothing beyond; but for me this is the most enjoyable life, and if you have the right to seek your pleasure in your own way, so have I in mine." The mistake is that we want to tie the whole world down to our own plane of thought and to make our mind the measure of the whole universe. To you, the old sense-things are, perhaps, the greatest pleasure, but it is not necessary that my pleasure should be the same, and when you insist upon that, I differ from you. That is the difference between the worldly utilitarian and the religious man. The first man says, "See how happy I am. I get money, but do not bother my head about religion. It is too unsearchable, and I am happy without it." So far, so good; good for all utilitarians. But this world is terrible. If a man gets happiness in any way excepting by injuring his fellow-beings, godspeed him; but when this man comes to me and says, "You too must do these things, you will be a fool if you do not," I say, "You are wrong, because the very things, which are pleasurable to you, have not the slightest attraction for me. If I had to go after a few handfuls of gold, my life would not be worth living! I should die." That is the answer the religious man would make. The fact is that religion is possible only for those who have finished with these lower things. We must have our own experiences, must have our full run. It is only when we have finished this run that the other world opens.
The enjoyments of the senses sometimes assume another phase which is dangerous and tempting. You will always hear the idea — in very old times, in every religion — that a time will come when all the miseries of life wills cease, and only its joys and pleasures will remain, and this earth will become a heaven. That I do not believe. This earth will always remain this same world. It is a most terrible thing to say, yet I do not see my way out of item The misery in the world is like chronic rheumatism in the body; drive it from one part and it goes to another, drive it from there and you will feel it somewhere else. Whatever you do, it is still there. In olden times people lived in forests, and ate each other; in modern times they do not eat each other's flesh, but they cheat one another. Whole countries and cities are ruined by cheating. That does not show much progress. I do not see that what you call progress in the world is other than the multiplication of desires. If one thing is obvious to me it is this that desires bring all misery; it is the state of the beggar, who is always begging for something, and unable to see anything without the wish to possess it, is always longing, longing for more. If the power to satisfy our desires is increased in arithmetical progression, the power of desire is increased in geometrical progression. The sum total of happiness and misery in this world is at least the same throughout. If a wave rises in the ocean it makes a hollow somewhere. If happiness comes to one man, unhappiness comes to another or, perhaps, to some animal. Men are increasing in numbers and some animals are decreasing; we are killing them off, and taking their land ; we are taking all means of sustenance from them. How can we say, then, that happiness is increasing? The strong race eats up the weaker, but do you think that the strong race will be very happy?  I do not see on practical grounds how this world can become a heaven. Facts are against it. On theoretical grounds also, I see it cannot be.
Perfection is always infinite. We are this infinite already, and we are trying to manifest that infinity. You and I, and all beings, are trying to manifest it. So far it is all right. But from this fact some German philosophers have started a peculiar theory — that this manifestation will become higher and higher until we attain perfect manifestation, until we have become perfect beings. What is meant by perfect manifestation? Perfection means infinity, and manifestation means limit, and so it means that we shall become unlimited limiteds, which is self-contradictory. Such a theory may please children; but it is poisoning their minds with lies, and is very bad for religion. But we know that this world is a degradation, that man is a degradation of God, and that Adam fell. There is no religion today that does not teach that man is a degradation. We have been degraded down to the animal, and are now going up, to emerge out of this bondage. But we shall never be able entirely to manifest the Infinite here. We shall struggle hard, but there will come a time when we shall find that it is impossible to be perfect here, while we are bound by the senses. And then the march back to our original state of Infinity will be sounded.
This is renunciation. We shall have to get out of the difficulty by reversing the process by which we got in, and then morality and charity will begin. What is the watchword of all ethical codes? "Not I, but thou", and this "I" is the outcome of the Infinite behind, trying to manifest Itself on the outside world. This little "I" is the result, and it will have to go back and join the Infinite, its own nature. Every time you say, "Not I, my brother, but thou", you are trying to go back, and every time you say "I, and not thou", you take the false step of trying to manifest the Infinite through the sense-world. That brings struggles and evils into the world, but after a time renunciation must come, eternal renunciation. The little "I" is dead and gone. Why care so much for this little life? All these vain desires of living and enjoying this life, here or in some other place, bring death.
If we are developed from animals, the animals also may be degraded men. How do you know it is not so? You have seen that the proof of evolution is simply this: you find a series of bodies from the lowest to the highest rising in a gradually ascending scale. But from that how can you insist that it is always from the lower upwards, and never from the higher downwards? The argument applies both ways, and if anything is true, I believe it is that the series is repeating itself in going up and down. How can you have evolution without involution? Our struggle for the higher life shows that we have been degraded from a high state. It must be so, only it may vary as to details. I always cling to the idea set forth with one voice by Christ, Buddha, and the Vedanta, that we must all come to perfection in time, but only by giving up this imperfection. This world is nothing. It is at best only a hideous caricature, a shadow of the Reality. We must go to the Reality. Renunciation will take us to It. Renunciation is the very basis of our true life; every moment of goodness and real life that we enjoy is when we do not think of ourselves.  Then we shall find that we are in the Real, and that Reality is God, and He is our own true nature, and He is always in us and with us. Let us live in Him and stand in Him. It is the only joyful state of existence. Life on the plane of the Spirit is the only life, and let us all try to attain to this realisation.


Remove a package from the registry
npm unpublish <name>[@<version>]
It is generally considered bad behavior to remove versions of a library that others are depending on!
Consider using the deprecate
command
instead, if your intent is to encourage users to upgrade.
There is plenty of room on the registry.
This removes a package version from the registry, deleting its entry and removing the tarball.
If no version is specified, or if all versions are removed then the root package entry is removed from the registry entirely.


GUIDED BY
Dr. Ketaki Kamble
Assistant Professor of Biology,
Applied Science Department,
College of Engineering, Pune
Rahul Chavan
Yash Katkamwar
Rushikesh Patil
Shruti Patil
Sakshi Pawar
Purav Desai
Purva Tatiya
Dhanashree Patil
Prachi Bhandkoli


Heaven knows we’re all miserable now
Forget The Smiths reunion, here’s a top-notch EU band.
by Paul DallisonWelcome to Declassified, a weekly column looking at the lighter side of politics. You can find it in POLITICO's weekly print edition and online on Fridays.
The most hotly anticipated band reunion of, well, ever appears have been scotched after guitarist Johnny Marr dismissed rumours that The Smiths were getting back together.
Asked by a fan if a rumor that concert promoter Live Nation had won the rights to the band’s reunion was true, Marr replied "Nigel Farage on guitar," a reference to the increasingly right-wing politics of singer Morrissey, who is a backer of the anti-Islam party For Britain.
So if The Smiths aren't coming back, who's going to play at POLITICO's Christmas party (to be held this year, as every year, in what was once the Manhattan strip club in Maelbeek metro station)?
How about an impromptu band made up of EU leaders! (What do you mean 'no, that sounds like the worst idea ever?').
First up a band name. Simply using "EU" is tricky because there was a Washington, DC funk band called Experience Unlimited who were referred to as "EU" and had a hit with, er, "Da Butt." Thankfully there are random band name generating websites. After putting in a few basic details, one such site came up with the following: Emmanuel and the Humans, 27 Seconds to Brussels, Das Peace, and Teenage Rock Blue Togetherness. So, Emmanuel and the Humans it is.
But who's in the band? This lot:
Vocals: Emmanuel Macron. Charismatic frontman, if a little too fond of his own voice (and face, and ideas ...). Won't let anyone from the Balkans into gigs.
Guitar: Jean-Claude Juncker. The Iggy Pop of the band, Juncker is prone to rock-and-roll excess and repeating himself in interviews.
Bass: Viktor Orbán. Increasingly erratic but long-term band member that everyone's too afraid to throw out.
Drums: Angela Merkel. Nothing flashy but steady on the beat. Will occasionally open the doors at the back of the venue so anyone can get in for free.
Manager: Thierry Breton. Because all of Europe's business interests flow through him.
Security: Boyko Borissov. Because he's terrifying.
The band would play covers of songs in which the word "You" can easily be replaced with "EU" such as "All EU Need Is Love" and "We Will Rock EU," although probably not Prince's "I Hate EU" or Joan Jett's "I Hate Myself For Loving EU." After years of practice at EU summits, they would play all night (needlessly).
CAPTION COMPETITION
"Less than two years to go, less than two years to go, less than..."
Can you do better? Email<EMAIL_ADDRESS>or on Twitter @pdallison74
Last week we gave you this photo.
Thanks for all the entries. Here’s the best from our post bag (there’s no prize except for the gift of laughter, which I think we can all agree is far more valuable than cash or booze).
"U.K. parliament approves law requiring Boris Johnson to be constantly monitored by a Sexual Harassment Prevention Officer" by Guus Evers
Paul Dallison is POLITICO's slot news editor.


{% include 'menu-header.html' %} {% include 'graphs-header.html' %}
{% include 'menu-tags.html' %}
Welcome to the proposal budget web system
The following budget graphs are for projects that have been Submitted, Selected, or are Active


Title: Performing localized week based calendar computations with SQLite. Author: Oleksandr Dodatko Email<EMAIL_ADDRESS>Platform: iOS, Mac OS X Technology: SQLite, CocoaTouch Level: Intermediate Description: This tutorial shows how to create and use an SQLite custom function that performs locale aware week based calendar computations. Section Mobile development SubSection iPhone License: BSD
Recently I was involved in analytics application iOS port development. Since our model was relational we decided to use SQLite. As far as I know this is the only relational DBMS for iOS.
One of our tasks was weekly "Value per visit" report computation. Suppose, we have a table described as:
CREATE TABLE [Usage]
(
[FacetId] VARCHAR, -- "Visit kind"
[Value ] INTEGER, -- useful "work amount"
[Visits ] INTEGER, -- spent "work amount"
[Date ] DATETIME -- date
);
In order to compute the report, I've composed a query below:
SELECT SUM( Value ) / SUM( Visits ),
strftime( '%Y-%W', Date ) AS week
FROM Usage
WHERE Date BETWEEN @startDate AND @endDate
GROUP BY week
ORDER BY week;
For some reason, query output did not match the reference implementation. The reason turned out to be simple. For SQLite the week starts on Monday. For reference implementation week starts on Sunday as it used US locale.
sqlite> SELECT strftime( '%Y-%W', '2011-01-02' );
2011-01 ## expecting to receive 2011-02 for US locale
sqlite> SELECT strftime( '%Y-%W', '2011-01-01' );
2011-01
The article below will explain how to overcome this problem
You should have basic knowledge of SQL and ObjectiveC. You should also be familiar with week based calendar concepts.
Unfortunately, I have not found a way to force set the SQLite locale. Performing aggregation in ObjectiveC code isn't a good solution either. Luckily, SQLite has sqlite3_create_function API that serves for adding custom DBMS extensions. So I've decided to implement a custom function that will perform date formatting with the respect to the locale. It would use NSCalendar and NSDateFormatter API under the hood.
You'll benefit in :
Suppose, we'll operate only with Gregorian calendars to simplify the code.
SQLite extension function has a signature similar to С++ main().
void ObjcFormatAnsiDateUsingLocale (sqlite3_context * ctx_, int argc_, sqlite3_value ** argv_);
It has no return value. Instead it receives sqlite3_context* handle which is used to return the result or an error.
Its SQL interface will take three arguments:
This report will correctly detect that Sunday 2011-01-02 belongs to the second week of year 2011.
sqlite> SELECT ObjcFormatAnsiDateUsingLocale ('YYYY-ww', '2011-01-02 ',' en_US ');
2011-02
Thus, we need to do four things:
This is done with sqlite3_create_function()
sqlite3_create_function
(
db_, / / database HANDLE received from sqlite3_open
"ObjcFormatAnsiDateUsingLocale", / / name of the function to be used in queries
3, / / number of parameters. SQLite will ensure that their count matches
SQLITE_UTF8, / / the encoding for iOS enough
NULL,
&ObjcFormatAnsiDateUsingLocale, / / function implementation
NULL, NULL / / It's required as the function does not perform aggregation.
);
SQLite ensures that your function receives correct amount of arguments. However, I recommend to check them anyway just in case. Since SQLite will take care of allocated resources, I suggest using @selector(initWithBytesNoCopy:length:encoding:freeWhenDone:)
to initialise NSString
. You must pass "NO" to "freeWhenDone" parameter.
With Foundation framework the implementation is pretty straightforward.
NSDateFormatter* inputFormatter_ = nil;
NSDateFormatter* targetFormatter_ = nil;
//... initialize date formatters
inputFormatter_.dateFormat = @"yyyy-MM-dd";
targetFormatter_.dateFormat = format_;
NSDate * date_ = [inputFormatter_ dateFromString: strDate_];
return [targetFormatter_ stringFromDate: date_];
However, there are some nuances:
You must use sqlite3_result_text()
to accomplish this. It's important to use SQLITE_TRANSIENT
to make SQLite obtain a copy of the result string. If you use SQITE_STATIC
you'll get a crash after Foundation framework disposes resources.
That's it.
You can obtain the source code and text of this article at github


--- layout: newsstory title: News Story match: BSC FINAL Yeltz 3 Redditch 1 ---
Despite having a few doubts about whether it really matters, The Yeltz won their first trophy in 9 years by beating a weary Redditch 3-1 in the B'ham Senior Cup Final.
We took an early lead through a Snapper long-distance strike, but then Redditch equalised and generally looked the more dangerous. It was their fifth game in five days, so the longer it went, the more you felt they must tire.
Sharpey poked home a second after the break, but only a couple of brilliant saves by Danny and some mad scrambles kept us ahead. Finally, Kevin scored the third after a brilliant move on the break, and the trophy was ours. We celebrated in the traditional manner, taking turns putting the lid on our head whilst drinking too much in the clubhouse.
In the league, Forest Green beat Merthyr 3-1, and now only need a draw at home to Bath to go up. If they lose, Merthyr will win the title if they can go to Ashford and win. At the bottom, it's two out of Salisbury, Sittingbourne and Bromsgrove to join St. Leonards and Ashford in the bottom four.
We've got Bath at home in the league on Thursday, then it's fancy dress for the last game at Hastings ().
PS The Jolly Boys drew 2-2 in their game vs. Radio WM on Sunday, a match that was much better than the Crawley game the day before according to some observers!


Help
Setting up the Client
You can download the Client using docker. To download the client, use from the command line:
docker pull quay.io/ucsc_cgl/core-client:1.0.4
Getting the token
Please login using your UCSC Google account (your @ucsc.edu address) and download your Redwood token via the "Get Token" link. If you see "No Token" after login please contact Brian O'Connor from your UCSC email account and request one.
IMPORTANT: Treat your token as you would a credit card number. Do not share or send your token around including electronic means such as e-mail, GitHub, etc. In case your token is compromised, please contact Brian O'Connor as soon as possible.
Perform Bulk Download via Manifest
This assumes the current working directory (pwd) has a manifest, like the ones you can download from the file browser. You can use either the ACCESS_TOKEN or the ACCESS_TOKEN_FILE to do the download. ACCESS_TOKEN requires you to explicitely write the token or reference it as an environmental variable, while ACCESS_TOKEN_FILE requires the token file name to be specified, and the absolute path to the folder containing the file token to be mounted. The commands below will then download the files to the current working directory.
NOTE: make sure you have enough space in pwd!
To use the ACCESS_TOKEN use this command:
docker run --rm -e ACCESS_TOKEN=<access_token> -e REDWOOD_ENDPOINT=storage.ucsc-cgl.org -v `pwd`:/dcc/data quay.io/ucsc_cgl/core-client:1.0.4 redwood-download /dcc/data/manifest.tsv /dcc/data/
If you want to instead download using a token file with ACCESS_TOKEN_FILE, you can use the command below:
docker run --rm -e ACCESS_TOKEN_FILE=<file_name> -e REDWOOD_ENDPOINT=storage.ucsc-cgl.org -v `pwd`:/dcc/data -v <path/to/token/folder>:/dcc/token quay.io/ucsc_cgl/core-client:1.0.4 redwood-download /dcc/data/manifest.tsv /dcc/data/
Using any of the commands above will download the data in the current directory.
Upload via Spinnaker
Create a manifest that links your metdata and data. Your manifest.tsv should be a TSV based on this template. You can hover over the column names to see more information. Here are more details about the columns that use a controlled vocabulary:
- sequence_upload
- alignment_upload
You need to include file paths to your upload files that start with /dcc/data since that's the location used in the docker run below. Columns Donor UUID, Specimen UUID, Sample UUID, Upload File ID, Data Bundle ID, and Metadata.json should be left blank!
You should create a directory where you want to have your files for upload (assumed to be pwd), place your manifest.tsv in this directory along with all your files for upload, and then execute either of the following:
If you want to type the token (ACCESS_TOKEN), use the command below
docker run --rm -e ACCESS_TOKEN=<access_token> -e REDWOOD_ENDPOINT=storage.ucsc-cgl.org -v `pwd`:/dcc/data quay.io/ucsc_cgl/core-client:1.0.4 spinnaker-upload /dcc/data/manifest.tsv
If you want to use a file with the token (ACCESS_TOKEN_FILE), use the command below.  It provides various IDs assigned to your donor, specimen, sample and file that make it much easier to find/audit later.
In case your upload failed and need to re-upload your files, make sure you edit the 'Workflow Version' entry by increasing it by 0.0.1. For example, if you previously uploaded a file with workflow version 1.0.1, you would modify the entry in the TSV file so the workflow version is 1.0.2 instead.
NOTE: Uploads can take a long time and our feedback on the command line needs to be improved. You may use dstat to monitor network usage to ensure uploads are in progress.
Downloading Metadata
You can get the latest Metadata dump by clicking here.


Testing for GHOST Vulnerability with Ansible
Yesterday, reports of a critical vulnerability in the GNU C Library (glibc) hit the news. If you have more then just a handful servers to check, this Ansible playbook might be helpful.
You can read all about the vulnerability here.
Usually when I have to check multiple servers, I use Ansible like this.
ansible 'servergroup' -m shell -a 'command to execute'
In the case of GHOST, this wasn't working for me as the test command contained both '
and "
chars. Escaping them didn't seem to work either, so I wrote a small playbook to take care of it.
- hosts: hosts,or,groups,comma,separated
remote_user: sshuser
tasks:
- name: Check if host is vulnerable
shell: php -r '$e="0";for($i=0;$i<2500;$i++){$e="0$e";} gethostbyname($e);'
register: ghostvuln
- debug: var=ghostvuln.stdout_lines
That's it. If you've never used ansible before, just follow these steps.
-
install Ansible from your OS repository
-
add hosts to /etc/ansible/hosts
[groupname] host1 host2
-
Make sure your SSH key is loaded with
ssh-add -L
-
Test if Ansible reaches every hosts
ansible 'group,or,hosts' -m shell -a 'hostname -f'
-
Execute Ansible playbook
ansible-playbook /path/to/playbook
If you get either one of these, everything is fine.
changed
just means that the command could be executed, check further down for the result. As you can see in the second image, the command did not return Segmentation Fault
failed
means, that the could not be executed, in this case because php isn't installed.
This is ans example of a vulnerable host returning a segfault message.
Note: The check command above uses PHP, which I don't have installed on all my servers. Since this is a glibc vulnerability, I'm pretty sure that hosts can be vulnerable even if PHP is not installed. I will update this post if I find a way to check servers without PHP. Until then, install php5-cli if you don't have php on the system.
Update 1: More info on this bug can be found here, including how to get a list of services that use glibc (Debian/Ubuntu)
sudo lsof | grep libc | awk '{print $1}' | sort | uniq
Also, make sure to reboot the servers after you've installed the patches or the server will remain vulnerable!
Update 2: An easier way to check if your server is vulnerable, is to check for the glibc version by running the following command.
$ ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.4) 2.19
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
$ ansible 'servergroup' -m shell -a 'ldd --version |grep "^ldd"'
According to Tomas Hoger, the issues was fixed in glibc 2.18.
source: bugzilla.redhat.com


Firefox OS Intensive
User Research, Design and Context
Firefox OS - Research, Context, Design
Forget Everything You Know
"The end user will almost always give the best ideas. […] one must design what the end user wants, not what you think looks good."
- User research
- Market research
- So much free research!
- And express yourself within that context.
- Not fully online yet (1.1 billion)
- Migrating from feature phone
- Funnnn (visually - eg, set most recent image to background)
- Camera
- Sideloading
- Localized
- Easy
- Just Works > Smart
- Offline & Pre-installed Content
- Top of the list
- Make it easy to keep in touch: apps designed around most-used, etc
- Create easy ways to share: apps to one-touch share over bluetooth
- Design group sharing experiences: apps and games for passing device around
- 3mp is expected
- So get creative with 2mp
- Make so easy and fun to share
- Give context for the camera
- Create an experience
- Android apps and content at vendors
- Load up SD card
- Get creative
- Bluetooth APIs to share data
- Literacy is high in India, but varied
- Picture is worth 1000 words
- Reduces l10n work
- So many free icon sets (someone make a list!)
- One of the top requirements
- Expected from featurephones
- Make it a feature of your app
- More later
All Designed in California (mostly)
- iOS, Android, Windows Mobile
- ... and Firefox OS too.
- Smartphone user doubling, tripling...
- What comes next?
- Eventually, yes.
- Doesn't mean it's ideal.
- New users don't know what most of this is.
"The experience of our primary mobile screen being a bank of app icons that lead to independent destinations is dying."
- API coming soon
- Can hack it now via WebIDE
- Always sorted by most-used?
- Contacts instead of apps?
- Icon themes?
- #gocrazy
- Can talk more later
People First - Tantek Celik
- Reach out to your local designers
- Tons on Behance
- A few design schools in Delhi
- Have a meetup!
- Or a contest!


The main goal of our project is the empowerment and development of the
students in both the technical and non-technical aspects. As working on
a big scale project like ours prepares them for the professional field
they will face after college, and through this process we gain a lot of
knowledge and soft skills that will benefit us in the future. This will
have a great impact on the whole nation as our development is one of the
main parts to develop our country. Do you want to support our goals and
sponsor us?
click here


| Opcode/Instruction | Op/En | 64/32 bit Mode Support | CPUID Feature Flag | Description |
|---|---|---|---|---|
| NP 0F 3A CC /r ib SHA1RNDS4 xmm1, xmm2/m128, imm8 | RMI | V/V | SHA | Performs four rounds of SHA1 operation operating on SHA1 state (A,B,C,D) from xmm1, with a pre-computed sum of the next 4 round message dwords and state variable E from xmm2/m128. The immediate byte controls logic functions and round constants. |
| Op/En | Operand 1 | Operand 2 | Operand 3 |
| RMI | ModRM:reg (r, w) | ModRM:r/m (r) | Imm8 |
The SHA1RNDS4 instruction performs four rounds of SHA1 operation using an initial SHA1 state (A,B,C,D) from the first operand (which is a source operand and the destination operand) and some pre-computed sum of the next 4 round message dwords, and state variable E from the second operand (a source operand). The updated SHA1 state (A,B,C,D) after four rounds of processing is stored in the destination operand.
The function f() and Constant K are dependent on the value of the immediate. IF ( imm8[1:0] = 0 ) THEN f()←f0(), K←K0; ELSE IF ( imm8[1:0] = 1 ) THEN f()←f1(), K←K1; ELSE IF ( imm8[1:0] = 2 ) THEN f()←f2(), K←K2; ELSE IF ( imm8[1:0] = 3 ) THEN f()←f3(), K←K3; FI; A ← SRC1[127:96]; B ← SRC1[95:64]; C ← SRC1[63:32]; D ← SRC1[31:0]; W0E ← SRC2[127:96]; W1 ← SRC2[95:64]; W2 ← SRC2[63:32]; W3 ← SRC2[31:0]; Round i = 0 operation: A_1←f (B, C, D) + (A ROL 5) +W0E +K; B_1←A; C_1←B ROL 30; D_1←C; E_1←D; FOR i = 1 to 3 A_(i +1) ← f (B_i, C_i, D_i) + (A_i ROL 5) +Wi+ E_i +K; B_(i +1)←A_i; C_(i +1)←B_i ROL 30; D_(i +1)←C_i; E_(i +1)←D_i; ENDFOR DEST[127:96] ← A_4; DEST[95:64] ← B_4; DEST[63:32] ← C_4; DEST[31:0] ← D_4;
SHA1RNDS4: __m128i _mm_sha1rnds4_epu32(__m128i, __m128i, const int);
None
None
See Exceptions Type 4.


--- title: Qvious call_to_action: Contact background_image_path: large_header: true testimonials: - message: We use Qvious in all our endeavours. They offer an unparalleled service when it comes to running a business. image: "https://placekitten.com/g/60/60?a=.png" name: Joice Carmold - message: Qvious are the best of the best. Being local, they care about people and have strong ties to the community. image: "https://www.fillmurray.com/60/60?a=.png" name: Peter Rottenburg - message: Qvious were everything we could have hoped for when buying our first home. Highly recommended to all. image: "https://placebear.com/60/60?a=.png" name: D. and G. Gibbleston _options: image: width: 60 height: 60 ---
This is the Qvious template from CloudCannon. Qvious is strong foundation for the quantative analysis of a financial security firm or business.
Qvious is the professional company. Practicing for over 10 years, our team have the knowledge and skills to get you results.
{% endfor %}


BREADQUEST
Explore. Collect ingredients. Bake bread. Avoid enemies.
The oven for baking bread is at the respawn location.
CONTROLS
- WASD or Arrow Keys = Move player
- Shift + WASD or Arrow Keys = Place or remove item
- R/F = Scroll through inventory items
- B = Eat 1 bread to regain 1 health
- T = Place text in world
- Plus and Minus = Zoom in and out
- Return = Chat
- L + WASD or Arrow Keys = Lock walk
Ping time: ms
STATS
Bread:
Unbaked Bread:
(, , )
Effective Bread:
HP: /
LOCATION
Current Location:
Respawn Location:
Respawn Offset:
Distance to Respawn Location:
Direction to Respawn Location: °
Guideline Location "x, y":
TEXT TOOL
Enter some text to place in the world:
INVENTORY
CHAT
Show overlay on game


Schnee DM, Pierson RC, Stewart JR & Learman LA. Is direct-interaction with preceptors linked to clerkship satisfaction and medical knowledge gain?CREOG & APGO Annual MeetingStewart JR, Hamner JJ & Heit MA. When the Apex is Calling, Do Surgeons Answer? Trends in Cystocele/Rectocele Repair Over the Last 30 Years.Society of Gynecologic SurgeonsStewart JR, Hale DS & Heit MA. Development of a HIPAA Compliant Web Based Longitudinal Survey Instrument for Urogynecologic Specific Patient Centered Outcomes Research.American Urogynecologic Society and the International Urogynecological Association Annual Scientific MeetingBurwell B, Call L, Craft K, Freid F, Pranckun Z, & Stewart JR. A Case of Bilateral Thalamic Hemorrhage and Its Clinical Presentation in the General Population.Via College of Osteopathic Medicine Annual Research DayStewart JR & Dyer JS. Utilizing Text Messaging as a Means for Improving Patient Compliance among Teen Aged Type I Diabetics. A Proof of Concept and a Grant Proposal.Department of Pediatric Endocrinology, Nationwide Childrens Hospital, Columbus, OhioStewart JR, Suri A & Schrum KF. Comparison of Synchronous Fluorescence and Raman Spectroscopy to Study Petroleum Contamination of Environmental Matrices.The Pittsburgh Conference on Analytical Chemistry and Applied SpectroscopyCarpenter JS, Heit M, Chen CX, Stewart JR, Hamner JJ, Rand KL. Psychometrics of the PSR-13 for measurement of postoperative recovery after pelvic reconstructive surgery.
[2016 AUGS SUBMISSION]
Heit MA, Chen CX, Stewart JR, Hamner JJ, Rand KL, Carpenter JS. Recovery Trajectory Following Laparoscopic Sacrocolpopexy for the Identification of Modifiable Behaviors in Women with “Operable” Pelvic Organ Prolapse.
[2016 AUGS SUBMISSION]
Stewart JR, Rose, SM, Hale DS & Heit MA. Google Search Queries in Urogynecology.
[2016 AUGS SUBMISSION]
Stewart JR, Hamner JJ & Heit MA. Influence of the Multidimensional Health Locus of Control on Recovery after Laparoscopic Sacral Colpopexy


Banská Bystrica Regional Election 2013 - North region vs. Hungarian speaking region
Comparison of support for Mr.Kotleba in Hungarian speaking area, the northern regions and the rest of the region. Every bubble represents one municipality. The
size
of bubbles represents number of voters.


An HTML element is defined by a start tag, some content, and an end tag.
Some HTML elements doesn't have content (like the
 element). These elements are called empty elements.
HTML Elements
- An HTML element is defined by a start tag, some content, and an end tag:
- <tagname>Content goes here...</tagname>
- The HTML element is everything from the start tag to the end tag:
-
My First Heading

-
My first paragraph.

| Start Tag | Element Content | End Tag |
|---|---|---|
|
 | My First Heading |
 |
|
 | My first paragraph. |
 |
|
 | None | None |
Some HTML elements doesn't have content (like the
 element). These elements are called empty elements.
Nested HTML Elements
- HTML elements can be nested (this means that elements can contain other elements).
- All HTML documents consist of nested HTML elements.
- The following example contains four HTML elements (, ,
 and
):
<!DOCTYPE html>

My First Heading

My first paragraph.

Example Explained
- The  element is the root element and it defines the whole HTML document.
- It has a start tag  and an end tag .
- Then, inside the  element there is a  element
- The  element defines the document's body.
- It has a start tag  and an end tag .
- Then, inside the  element there is two other elements:
 and
.
- The
 element defines a heading.
- It has a start tag
 and an end tag
.
- The
 element defines a paragraph.
- It has a start tag
 and an end tag
.
- Some HTML elements will display correctly, even if you forget the end tag.
- The
 tag defines a line break, and is an empty element without a closing tag.
- HTML tags are not case sensitive:
 means the same as
.


Python is one of the world’s most popular, in-demand programming languages. This is for many reasons: it’s easy to learnit’s super versatileit has a huge range of modules and librariesI use Python daily as an integral part of my job as a data scientist. Along the way,
Python is one of the world’s most popular, in-demand programming languages. This is for many reasons:
I use Python daily as an integral part of my job as a data scientist. Along the way, I’ve picked up a few useful tricks and tips.
Here, I’ve shared some of them in an A-Z format.
Most of these ‘tricks’ are things I’ve used or stumbled upon during my day-to-day work. Some I found while browsing the Python Standard Library docs. A few others I found searching through PyPi.
However, credit where it is due — I discovered four or five of them over at awesome-python.com. This is a curated list of hundreds of interesting Python tools and modules. It is worth browsing for inspiration!
One of the many reasons why Python is such a popular language is because it is readable and expressive.
It is often joked that Python is ‘executable pseudocode’. But when you can write code like this, it’s difficult to argue otherwise:
x = [True, True, False]
if any(x):
print("At least one True")
if all(x):
print("Not one False")
if any(x) and not all(x):
print("At least one True and one False")
You want to plot graphs in the console?
$ pip install bashplotlib
You can have graphs in the console.
Python has some great default datatypes, but sometimes they just won’t behave exactly how you’d like them to.
Luckily, the Python Standard Library offers the collections module. This handy add-on provides you with further datatypes.
from collections import OrderedDict, Counter
x = OrderedDict(a=1, b=2, c=3)
y = Counter("Hello World!")
Ever wondered how you can look inside a Python object and see what attributes it has? Of course you have.
From the command line:
>>> dir()
>>> dir("Hello World")
>>> dir(dir)
This can be a really useful feature when running Python interactively, and for dynamically exploring objects and modules you are working with.
Read more here.
Yes, really.
$ pip install emoji
Don’t pretend you’re not gonna try it out…
from emoji import emojize
print(emojize(":thumbs_up:"))
?
One consequence of Python’s popularity is that there are always new versions under development. New versions mean new features — unless your version is out-of-date.
Fear not, however. The __future__ module lets you import functionality from future versions of Python. It’s literally like time travel, or magic, or something.
from __future__ import print_function
print("Hello World!")
Why not have a go importing curly braces?
Geography can be a challenging terrain for programmers to navigate (ha, a pun!). But the geopy module makes it unnervingly easy.
$ pip install geopy
It works by abstracting the APIs of a range of different geocoding services. It enables you to obtain a place’s full street address, latitude, longitude, and even altitude.
There’s also a useful distance class. It calculates the distance between two locations in your favorite unit of measurement.
from geopy import GoogleV3
place = "221b Baker Street, London"
location = GoogleV3().geocode(place)
print(location.address)
print(location.location)
Stuck on a coding problem and can’t remember that solution you saw before? Need to check StackOverflow, but don’t want to leave the terminal?
Then you need this useful command line tool.
$ pip install howdoi
Ask it whatever question you have, and it’ll do its best to return an answer.
$ howdoi vertical align css
$ howdoi for loop in java
$ howdoi undo commits in git
Be aware though — it scrapes code from top answers from StackOverflow. It might not always give the most helpful information…
$ howdoi exit vim
Python’s inspect module is great for understanding what is happening behind the scenes. You can even call its methods on itself!
The code sample below uses inspect.getsource()
to print its
own source code. It also uses inspect.getmodule()
to print
the module in which it was defined.
The last line of code prints out its own line number.
import inspect
print(inspect.getsource(inspect.getsource))
print(inspect.getmodule(inspect.getmodule))
print(inspect.currentframe().f_lineno)
Of course, beyond these trivial uses, the inspect module can prove useful for understanding what your code is doing. You could also use it for writing self-documenting code.
The Jedi library is an autocompletion and code analysis library. It makes writing code quicker and more productive.
Unless you’re developing your own IDE, you’ll probably be most interested in using Jedi as an editor plugin. Luckily, there are already loads available!
You may already be using Jedi, however. The IPython project makes use of Jedi for its code autocompletion functionality.
When learning any language, there are many milestones along the way. With
Python, understanding the mysterious **kwargs
syntax probably
counts as one.
The double-asterisk in front of a dictionary object lets you pass the contents of that dictionary as named arguments to a function.
The dictionary’s keys are the argument names, and the values are the
values passed to the function. You don’t even need to call it
kwargs
!
dictionary = {"a": 1, "b": 2}
def someFunction(a, b):
print(a + b)
return
someFunction(**dictionary)
someFunction(a=1, b=2)
This is useful when you want to write functions that can handle named arguments not defined in advance.
One of my favourite things about programming in Python are its list comprehensions.
These expressions make it easy to write very clean code that reads almost like natural language.
You can read more about how to use them here.
numbers = [1,2,3,4,5,6,7]
evens = [x for x in numbers if x % 2 is 0]
odds = [y for y in numbers if y not in evens]
cities = ['London', 'Dublin', 'Oslo']
def visit(city):
print("Welcome to "+city)
for city in cities:
visit(city)
Python supports functional programming through a number of inbuilt
features. One of the most useful is the map()
function —
especially in combination with
lambda functions.
x = [1, 2, 3]
y = map(lambda x : x + 1 , x)
In the example above, map()
applies a simple lambda function
to each element in x
. It returns a map object, which can be
converted to some iterable object such as a list or tuple.
If you haven’t seen it already, then be prepared to have your mind blown by Python’s newspaper module.
It lets you retrieve news articles and associated meta-data from a range of leading international publications. You can retrieve images, text and author names.
It even has some inbuilt NLP functionality.
So if you were thinking of using BeautifulSoup or some other DIY
webscraping library for your next project, save yourself the time and
effort and $ pip install newspaper3k
instead.
Python provides support for operator overloading, which is one of those terms that make you sound like a legit computer scientist.
It’s actually a simple concept. Ever wondered why Python lets you use the
+
operator to add numbers and also to concatenate strings?
That’s operator overloading in action.
You can define objects which use Python’s standard operator symbols in their own specific way. This lets you use them in contexts relevant to the objects you’re working with.
class Thing:
def __init__(self, value):
self.__value = value
def __gt__(self, other):
return self.__value > other.__value
def __lt__(self, other):
return self.__value < other.__value
something = Thing(100)
nothing = Thing(0)
something > nothing
something < nothing
something + nothing
Python’s default print
function does its job. But try
printing out any large, nested object, and the result is rather ugly.
Here’s where the Standard Library’s pretty-print module steps in. This prints out complex structured objects in an easy-to-read format.
A must-have for any Python developer who works with non-trivial data structures.
import requests
import pprint
url = 'https://randomuser.me/api/?results=1'
users = requests.get(url).json()
pprint.pprint(users)
Python supports multithreading, and this is facilitated by the Standard Library’s Queue module.
This module lets you implement queue data structures. These are data structures that let you add and retrieve entries according to a specific rule.
‘First in, first out’ (or FIFO) queues let you retrieve objects in the order they were added. ‘Last in, first out’ (LIFO) queues let you access the most recently added objects first.
Finally, priority queues let you retrieve objects according to the order in which they are sorted.
Here’s an example of how to use queues for multithreaded programming in Python.
When defining a class or an object in Python, it is useful to provide an ‘official’ way of representing that object as a string. For example:
>>> file = open('file.txt', 'r')
>>> print(file)
<open file 'file.txt', mode 'r' at 0x10d30aaf0>
This makes debugging code a lot easier. Add it to your class definitions as below:
class someClass:
def __repr__(self):
return "<some description here>"
someInstance = someClass()
print(someInstance)
Python makes a great scripting language. Sometimes using the standard os and subprocess libraries can be a bit of a headache.
The sh library provides a neat alternative.
It lets you call any program as if it were an ordinary function — useful for automating workflows and tasks, all from within Python.
import sh
sh.pwd()
sh.mkdir('new_folder')
sh.touch('new_file.txt')
sh.whoami()
sh.echo('This is great!')
Python is a dynamically-typed language. You don’t need to specify datatypes when you define variables, functions, classes etc.
This allows for rapid development times. However, there are few things more annoying than a runtime error caused by a simple typing issue.
Since Python 3.5, you have the option to provide type hints when defining functions.
def addTwo(x : Int) -> Int: return x + 2
You can also define type aliases:
from typing import List
Vector = List[float]Matrix = List[Vector]
def addMatrix(a : Matrix, b : Matrix) -> Matrix:
result = []
for i,row in enumerate(a):
result_row =[]
for j, col in enumerate(row):
result_row += [a[i][j] + b[i][j]]
result += [result_row]
return result
x = [[1.0, 0.0], [0.0, 1.0]]
y = [[2.0, 1.0], [0.0, -2.0]]
z = addMatrix(x, y)
Although not compulsory, type annotations can make your code easier to understand.
They also allow you to use type checking tools to catch those stray TypeErrors before runtime. Probably worthwhile if you are working on large, complex projects!
A quick and easy way to generate Universally Unique IDs (or ‘UUIDs’) is through the Python Standard Library’s uuid module.
import uuid
user_id = uuid.uuid4()
print(user_id)
This creates a randomized 128-bit number that will almost certainly be unique.
In fact, there are over 2¹²² possible UUIDs that can be generated. That’s over five undecillion (or 5,000,000,000,000,000,000,000,000,000,000,000,000).
The probability of finding duplicates in a given set is extremely low. Even with a trillion UUIDs, the probability of a duplicate existing is much, much less than one-in-a-billion.
Pretty good for two lines of code.
This is probably my favorite Python thing of all.
Chances are you are working on multiple Python projects at any one time. Unfortunately, sometimes two projects will rely on different versions of the same dependency. Which do you install on your system?
Luckily, Python’s support for virtual environments lets you have the best of both worlds. From the command line:
python -m venv my-project
source my-project/bin/activate
pip install all-the-modules
Now you can have standalone versions and installations of Python running on the same machine. Sorted!
Wikipedia has a great API that allows users programmatic access to an unrivalled body of completely free knowledge and information.
The wikipedia module makes accessing this API almost embarrassingly convenient.
import wikipedia
result = wikipedia.page('freeCodeCamp')
print(result.summary)
for link in result.links:
print(link)
Like the real site, the module provides support for multiple languages,
page disambiguation, random page retrieval, and even has a
donate()
method.
Humour is a key feature of the Python language — after all, it is named after the British comedy sketch show Monty Python’s Flying Circus. Much of Python’s official documentation references the show’s most famous sketches.
The sense of humour isn’t restricted to the docs, though.  Never change.
YAML stands for ‘YAML Ain’t Markup Language’. It is a data formatting language, and is a superset of JSON.
Unlike JSON, it can store more complex objects and refer to its own elements. You can also write comments, making it particularly suited to writing configuration files.
The PyYAML module lets you use YAML with Python. Install with:
$ pip install pyyaml
And then import into your projects:
import yaml
PyYAML lets you store Python objects of any datatype, and instances of any user-defined classes also.
One last trick for ya, and it really is a cool one. Ever needed to form a dictionary out of two lists?
keys = ['a', 'b', 'c']
vals = [1, 2, 3]
zipped = dict(zip(keys, vals))
The zip()
inbuilt function takes a number of iterable objects
and returns a list of tuples. Each tuple groups the elements of the input
objects by their positional index.
You can also ‘unzip’ objects by calling *zip()
on them.


--- notes: | When to use this component - Use the panel component to display important information when a transaction has been completed. - In most cases, the panel component is used on Confirmation pages, to tell the user they have successfully completed the transaction. When not to use this component - Don’t use the panel component to highlight important information within body content. How it works - If you add extra content to the panel, to meet colour contrast ratio requirements use a font size of govuk-body-l for normal weight and govuk-body for bold. ---


--- layout: page title: Pixillation type: screening ---
Pixillation
Text.
Color, Sound, Digital animation
Watch: http://lillian.com/1970-pixillation-4-min/


Sass Css and all of the js build with Gulp, Npm via Json file.
ysndmr
Sass Render With Gulp From Json file Application
Github


42
15
Last Updated: 07.04.17
French Spicy Fries
The best african continental dish. Very easy to prepare and less time consuming. Enjoy!
Time To Prepare
20 minsIngredients
- 1 tea spoon of sugar and vinegar
- red grinded fresh pepper
- 1 galoon of groundnut oil
- 2kg vegetable leaves
- 4 cubes of maggie
- 2 table spoons of salt
Procedures
- Boil water for about 5 minutes, then bring down
- Wash meat properly with salt to get rid of germs and sand
- gsghhdbhd sjdbjb hsbdhbs hs shs hjshdbhbjs
- gsghhdbhd sjdbjb hsbdhbs hs shs hjshdbhbjs
- gsghhdbhd sjdbjb hsbdhbs hs shs hjshdbhbjs
- gsghhdbhd sjdbjb hsbdhbs hs shs hjshdbhbjs
Post Your Review
Reviews
cool_chyke
Posted - 2 hours ago
I really loved your recipe. Great job.
cool_chyke
Posted - 2 hours ago
I really loved your recipe. Great jobI really loved your recipe. GreI really loved your recipe. Great jobI really loved your recipe. Great jobat jobI really loved your recipe. Great jobI really loved your recipe. Great job.


By default, Spring’s <oxm:jaxb2-marshaller>
tag uses the Jaxb2Marshaller class. It’s painful to use, though, if you have a lot of classes, because you have to enumerate them all individually. There are a couple of options here:
- You can use one of the JAXB2 mechanisms (an
ObjectFactory
or anjaxb.index
file; see JAXBContext). - You can use the marshaller’s
classesToBeBound
property.
Both of these options require more work than they ought to. Here, for example, is what the classesToBeBound
approach looks like:
<oxm:jaxb2-marshaller id="marshaller"> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Database" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.DataCenter" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Environment" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Farm" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Instance" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Package" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Package$MyListWrapper" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Person" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Project" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.Region" /> <oxm:class-to-be-bound name="org.skydingo.skybase.model.relationship.ProjectMembership" /> <oxm:class-to-be-bound name="org.skydingo.skybase.web.jit.JitNode" /> ... and so forth ... </oxm:jaxb2-marshaller>
Every time we add a new entity to the system, we have to go back to the list and add a corresponding entry. Blech.
About a year back I discovered a gem by Jarno Walgemoed called ClasspathScanningJaxb2Marshaller
. Actually, I don’t remember if that’s its exact name, because his blog post no longer exists, but that’s pretty close if not exactly it. At any rate, it uses Spring’s classpath scanning mechanism (you know, the one that finds @Component
and @Repository
and so forth) to find classes annotated with @XmlRootElement
, and then JAXB-binds them.
[EDIT: I found the original blog post after all. — WLW]
Here’s a slightly modified version of Jarno’s class, reposted with his kind permission. (Thanks Jarno!) I’ve used it on multiple projects and it works great.
import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.annotation.PostConstruct; import javax.xml.bind.annotation.XmlRootElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; import org.springframework.core.type.filter.AnnotationTypeFilter; import org.springframework.oxm.jaxb.Jaxb2Marshaller; public class ClasspathScanningJaxb2Marshaller extends Jaxb2Marshaller { private static final Logger log = LoggerFactory.getLogger(ClasspathScanningJaxb2Marshaller.class); private List basePackages; public List getBasePackages() { return basePackages; } public void setBasePackages(List basePackages) { this.basePackages = basePackages; } @PostConstruct public void init() throws Exception { setClassesToBeBound(getXmlRootElementClasses()); } private Class[] getXmlRootElementClasses() throws Exception { ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false); scanner.addIncludeFilter(new AnnotationTypeFilter(XmlRootElement.class)); List<Class> classes = new ArrayList<Class>(); for (String basePackage : basePackages) { Set definitions = scanner.findCandidateComponents(basePackage); for (BeanDefinition definition : definitions) { String className = definition.getBeanClassName(); log.info("Found class: {}", className); classes.add(Class.forName(className)); } } return classes.toArray(new Class[0]); } }


Sort Of
Order, please!
8 August 2015
For this exercise I decided to see how completely and correctly I could do without any added research, so I wrote each topic first before checking the Wikipedia. I did well with bubble and merge sorts; quick sort was a different story -- I don't recall learning much about it back in the day. So let's talk briefly about three sorting methods: merge sort, bubble sort, and quick sort; and also comment on "sort stability". A stable sort is one where two items maintain their original relative order in the sorted list when they have the same sort key value. In an unstable sort, they may have been swapped. Merge sort illustrates the principle of divide and conquer. You divide the work into two piles and compare the two top elements, taking the lesser. If both work piles are already sorted, then only one pass is needed to complete the sort by merging. By recursively merge sorting each of the two piles, the work breaks down easily. This is the top-down variety of a merge sort. Merge sorts may not be stable. In early days, they had the advantage of being well-suited to data storage based on magnetic tape, as each portion of the list could be written to a separate tape before merging back. A bubble sort is very simple and straightforward; it entails passing through the list and comparing two adjacent values. They are swapped if necessary and then the list pointer advances one position to compare the next two values. Many passes through the list may be necessary before the list is sorted, but bubble sorts can be efficient if the list is mostly sorted to begin with. Quick sort is a fairly complicated divide and conquer sort, but it offers the ability to sort in place so little additional storage is needed. This was an important consideration when disk storage and memory were both costly assets. The central idea is to select a pivot value and reorder the list so that everything before the pivot is less than the pivot value, and everything that follows is greater. Then, you have two sublists which can be recursively sorted by the same technique. Quick sort is on average very efficient compared with the other two methods as well as with other complex sorts like shellsorts and binary tree sorts. Variations of quicksort are the default native sort function in many programming languages and quicksort is the subject of much study, focused in particular on optimizing the choice of pivot(s) and partitioning the original list.


Response response =
new OrderSubmission(
new ShippingHandler(),
new CreditCardPayment(),
new DirectDebitPayment()
)
.process(request);
30 September 2021
In the article "DI without Framework" (https://guntherrotsch.github.io/blog_2020/di-without-framework.html) the principles of Dependency Injection have already be entangled. Here I'll discuss possible applications and potential improvements.
DI frameworks like Spring, Jakarta EE’s CDI or Guice come with a rich feature set, but also convey a certain complexity and feels sometimes like black magic, which some people try to avoid. Manual dependency injection is an alternative and might even make the design of an application more obvious.
Typical business applications follow a Boundary-Control-Entity (BCE) design, in which case the boundary layer receives requests. Those requests origin from message queues, are received by Servlets as HTTP requests, are triggered by users by interacting with a GUI, or even caused by timely events (cron-like schedulers). Anyhow a request arrives at a Boundary bean, the first step in processing the request requires to assemble the objects (a.k.a. beans), which create the result returned on the request. If you don’t rely on the dependency injection by a framework, this assembling of components need to be accomplished explicitly, for example as follows:
Response response =
new OrderSubmission(
new ShippingHandler(),
new CreditCardPayment(),
new DirectDebitPayment()
)
.process(request);
This sample is entirely hypothetical and is not related to any real-world project. The article You don’t need a dependency injection controller gives another example of how the wiring of request processing beans could look like.
The downside of giving up DI frameworks is that you need to explicitly wire the beans which process requests, i.e. there are more lines of code to write and maintain. The advantage is that the wiring of beans is explicit and you’re always aware of the objects involved in request processing, no guessing of resolved and injected beans anymore.
Explicit is better than implicit.
To step away from DI frameworks may be tempting, but you might miss some of the features of those frameworks. Before diving into the different scopes provided by for example Jakarta’s CDI - that’s left for the next part of this series of articles -, we focus on a practical issue which the example provided above might suffer from. Let’s assume that
An order is payed by either credit card or direct debit, but never by both of them
Instantiation of both components, CreditCardPayment
as well as
DirectDebitPayment
is rather expensive
then we want to instantiate only the payment type required by respective user’s request. Or in other words, we want to lazily initialize the required payment type.
As long as the already created instances are injected into the constructor of
OrderSubmission
bean, the initialization can only delayed by some application
specific logic. As a generic solution we could alternatively inject simple
factories from which the actual bean can be retrieved on demand. The functional
Supplier
object is such an simple factory. So let’s rephrase the sample a
little bit:
Response response =
OrderSubmission.supplier(
ShippingHandler.supplier(),
CreditCardPayment.supplier(),
DirectDebitPayment.supplier()
)
.get().process(request);
There are a few things to note:
Every (injectable) bean provides a static method named supplier
, which
returns a Supplier
of the bean type; this supplier
method takes the same
arguments the corresponding constructor would take (if there are any at all)
Beans should keep a reference to the supplier of the collaborating bean instead to the bean itself
Instead of working with the beans directly, we need to call the Supplier#get
method before each method call
But how does this pattern solve out lazy initialization problem?
To understand this we need to look into the static supplier
methods, i.e.
have a look at the simple factories of our beans.
The CreditCardPayment#supplier
decorates the call of new
method with the
lazy initialization feature:
public static Supplier<CreditCardPayment> supplier() {
return LazilyInitialized.of(CreditCardPayment::new);
}
And also the lazy initialization itself is very simple:
public class LazilyInitialized<T> implements Supplier<T> {
private T instance;
private Supplier<T> delegate;
private LazilyInitialized(Supplier<T> delegate) {
this.delegate = delegate;
}
public static <T> Supplier<T> of(Supplier<T> delegate) {
return new LazilyInitialized<>(delegate);
}
@Override
public T get() {
if (instance == null) {
instance = delegate.get();
}
return instance;
}
}
Lazy initialization wraps the Supplier
of the generic type and returns a
Supplier
for the same type. With the first call of the get
the actual
instance of the bean type is created, but not before. An instance of
CreditCardPayment
is only created if the get
of the (decorated) factory
is called, i.e. when the bean is used the first time, hence the bean is created
and initialized lazily. On the other side, if DirectDebitPayment
is used
instead of CreditCardPayment
, then the supplier’s get
is not called and
no instance of the CreditCardPayment
is created at all.
When we have lazy initialization, eager initialization is not far away and even more simple:
public class EagerlyInitialized<T> implements Supplier<T> {
private T instance;
private EagerlyInitialized(Supplier<T> delegate) {
this.instance = delegate.get();
}
public static <T> Supplier<T> of(Supplier<T> delegate) {
return new EagerlyInitialized<>(delegate);
}
@Override
public T get() {
return instance;
}
}
In case of eager initialization, the bean’s instance is already created when
the Supplier
is prepared. This instance is returned by each call of the get
method, i.e. on each usage of the bean.
DI frameworks can be replaced by assembling of the components an application manually. Even functionality like lazy initialization can be accomplished by applying appropriate patterns and conventions. The design of the application becomes more transparent and obvious with explicit wiring of the request processing beans.
In the next article, I’ll demonstrate how different scopes can be implemented for the beans. So, stay tuned…


I'm Wairimu and I build mobile apps, Android or IOS,that are easy to use. I can help you offer your clients a great online experience
I am an outgoing,dedicated and open-minded person.I get across to people and adjust to changes with ease.I believe that a person should work on developing their professional and learn new things all, the time.
Currently , I am looking for career opportunities that my current field of study cannot provide.
As a sales and marketing respresentative my main duties included introducing potential customers to the products that stiam sacco offers. Filing out applications into the CRM and Navision system
I was an intern at the department of immigration overseas section. My main duties included receiving and recording passport applications from Kenyans living overseas, filing the applications and take them for approval,recording the filled passports and dispatching them to their respective consulates
I got myself into programming because i love the challenge,I am excited by computers and i want to build a career creating eitheir websites/programs or mobile apps. I didn't feel as fulfillled in the field of study i was in
First of all quite a crowded field and i took the course just because i was government sponsred and i didn't have a choice but to do it.
Software has become so ingrained in the functionality of our societies. I mean were fixed to our screens, Knowledge of the codes and languages used to develop them is becomiing an important skill
My hobby is baking. I love serving my friends and family with freshly baked cakes.Just recently I have started making money from it, baking bithday cakes, muffins and granola.