text:
Good & Evil/Pain & Suffering
Page Epigraph
Who has prescribed for him his way, or who can say, 'You have done wrong'? (Jb 36:23)
"Shall a faultfinder contend with the Almighty? He who argues with God, let him answer it." (Jb 40:2)
You turn things upside down! Shall the potter be regarded as the clay, that the thing made should say of its maker, "He did not make me"; or the thing formed say of him who formed it, "He has no understanding"?
(Is 29:16)
Verse Observations: I Pt 5:10, Ps 119:75
*theodicy - Ps 37:13, 50:21 (God biding his time [for some reason]), 92:7, 102:20-21, Is 1:31, 38:17†, Rom 3:4
*evil as the divine plan - Ps 76:10, Mt 18:7, Rom 11:32
*God preparing evil - Zech 11:16-17 (see also The Divine Plan, Fate & Free Will)
*good & evil under God - Jb 12:16, Prv 15:3, Eccl 7:14 (see also The Divine Plan, Fate & Free Will)
†Condemning God for (us) being unhappy comes from a viewpoint that happiness is the highest good. But what is the highest good? Isn't it our moral perfection? (see the question on "the relationship b/w suffering and moral progress")
Verse Observations: Ps 76:10, Mt 18:7, Rom 11:32
Why is it necessary that temptations come? (Mt 18:7)
I can think of 2 ways that "necessary" can be taken here -- necessary in the sense that temptation fulfills some purpose (in the divine plan, although what that would be I don't know), or necessary in the sense that evil and temptation are inevitable, that is, natural and inherent to created beings. I'm not sure which of these is true, or maybe even if both are true.
Ps 34:9 "... those who fear him have no lack." Isn't this the central question of faith? Even Satan said "Does Job fear God for no reason? Have you not put a hedge around him and his house and all that he has, on every side? You have
blessed the work of his hands, and his possessions have increased in the land." (Jb 1:9-10) And Solomon said, "Because the sentence against an evil deed is not executed speedily, the heart of the children of man is fully set to do evil." (Eccl 8:11.) If those who feared God really had no lack, then everyone would fear God, yes? And if the sentence against evil was executed speedily, no one would do evil. But would this be true faith? Why do we live in a world where moral effect doesn't necessarily follow moral cause? (This question is also found under "Faith in God's Will".)
Why do we give glory to God when he rescues us from our troubles if it is he who put us in those situations in the first place? Jn 9:3 How does this honor God, since it was God who gave this man the blindness in the first place? Why is the glory of God seen not when everything goes well, but when everything goes awry but is saved? And this is the way it's been with human history as well. (Rom 9:22-23, 17) [predestination] Note in v 17 where it says of Pharaoh, "For this very purpose I have raised you up, that I might show my power in you ...." So God uses evil to bring about the salvation of the elect, which illustrates the question.)
I remember reading a story about a man and his daughter who had just parked their car, and when they had walked away from it a bit, just enough to be out of the danger zone, the car exploded. Of course, because they were far away enough, they were unhurt. This sounds like a miracle, but we have to ask, why? As humans, our initial and natural reaction is to think that God saved them from the explosion, that he had mercy on them and got them out of the way just in time. But God could have just kept the car from exploding in the first place. A second reason why we humans are so impressed by this story is because of the timing -- the car exploded right at the moment when they walked far away enough, and not a moment sooner or later. It sounds incredible, too coincidental. Now, that it's too coincidental, I'll concede. We'll get to this point later. Right now my point is that if the car had exploded, say, after having been brought to a junkyard, or out in the driveway one night, it wouldn't have been as impressive. In the driveway at night, that's a relief, and if in a junkyard, I'm not sure if anyone would give it a second thought, but right after they had just walked away from it -- now that's impressive. That deserves miracle status.
So now that I've broken this all down, you may think that I would deny that this was a miracle and deny that it gives glory to God, but that's not my point. I do think it's a miracle. I am impressed and I do give glory to God. No matter all my logical objections (and I don't deny these either -- that's the whole point of this question -- resolving the conflict and tension between the logical objection and the spiritual impression), I say that God still had mercy on this man and his daughter and that it was his doing and plan that they should be moved out of the way at just the right moment and no sooner and no later.
The real question here is -- yes, it's true, God could have made the car explode at any other "less impressive" time, or he could have kept the car from exploding at all, which would not be impressive at all, in fact, we (as humans) would never even think to thank God or give glory to him for keeping the car from exploding, but given that God is the orchestrator and executor of all things, why are still so impressed? See, you must have faith in order to "not" be impressed (on the logical side). But by that same faith, you are made to be impressed on the spiritual side. Likewise, the irony is that if you do not have faith, you would have to be impressed on the logical side, and not impressed on the spiritual side. What I mean is that the unbeliever doesn't believe there's a God, and therefore doesn't believe that God is sovereign and omnipotent or merciful for that matter. Therefore, if the car explodes, it had to explode. Given the natural state of the car, and all it had been through, it was inevitable that the car would have to give into whatever kind of physical stress it was under and finally "snap" and explode. Of course, nature doesn't care if there's anyone around or not for the explosion. Therefore, that the man and his daughter had gotten far away enough just in time is truly wondrous. To further complicate things, the believer says that nothing is a coincidence, and yet gives glory to God, while the unbeliever writes it off as a "mere" coincidence and does not give glory to God. You would think that the more coincidental something is, the more inexplicable and therefore the more wondrous it would be. However, this is the very reason the unbeliever gives for not giving glory to God. And then to complicate things even further, the believer says that nothing is a coincidence, and yet is impressed because of the coincidentalness (that is, the exact and highly improbable timing).
Now let's do a thought experiment, or rather, a feeling experiment. Imagine that the man and his daughter are believers. They're walking away from the car, when all of a sudden they hear a huge explosion, turn around in confusion, and realize that their car has just exploded. As they watch it burn to a crisp at a safe distance, they thank God for his mercy and are amazed that they're still alive and give glory. Now let's pretend that the man and his daughter are unbelievers. They walk away from the car, hear a gigantic explosion, turn around and realize that their car has just exploded. As they watch the car go up in flames, what do you think they're thinking? Would they feel lucky for having their lives, but nonetheless write it off as a coincidence and just go on as if this was the most normal event in the world, or would they be amazed and think that God was watching and had preserved their lives? It seems to me that very few people, believers or atheists, could not be shaken by this event and at least wonder if there is a God out there. Just as even atheists pray provided that they're in enough anguish of heart, and can't help but get angry at God when things don't go their way even though they say he doesn't exist, so I think in the face of a great and merciful coincidence, it would be hard to not be impelled to have the desire to give thanks and glory to God, and in fact, that it would require unnatural effort to stifle this desire.
So then, what to make of this? And what does this say about God's ways, his plan, of the necessity of evil, and our faith? Those are the things this question is about.
How did Satan become evil? If there was no evil, how could he get "infected"? (a question about the origins of evil. If God is all good and everything he created was good, where did evil come from?)
This is related to the above question, "Why does Jesus say temptation is necessary?" In other words, why is Satan necessary? In what way does he fit in with God's plan?
Why would God put himself through eternal unrequited love, and for so many, many souls?
This is difficult for us humans to understand -- how can God be in anguish over the many souls who reject him, and yet how can he be fully content in himself at the same time? That is, God is complete in himself and doesn't rely on any outside source for his well-being or comfort. We, as finite, dependent beings, aren't like this, and so will we ever understand?
Why does the bible say that the good prosper and the wicked fail in what they do, when this is not true, and the bible even says that this is not true? (Ps 91:9-16, Eccl 4:1, 7:15, Jb 21:7-21, 27-34)
EX: Even the bible says, "There is a vanity that takes place on earth, that there are righteous people to whom it happens according to the deeds of the wicked, and there are wicked people to whom it happens according to the deeds of the righteous." (Eccl 8:14)
How can the bible be replete with things like "nothing shall hurt you" when it's just not true, and in fact, it's blatantly untrue? (Lk 10:19) How can God promise goodness when we see this isn't so? (Ps 34:10, 12, 15, 17-19, 22)
On one hand, the bible has a point. At least sometimes, doing the right thing will keep you out of trouble and also confer upon you benefits that the wicked don't get, if only because they make themselves an enemy of everyone they meet, thereby making life unnecessarily difficult for themselves. Just as Socrates said, even if the just and unjust live the same miserable life, the just person is far better able to deal with the miseries of life than the unjust, and on this one point, I believe this is completely true and uncontroversial. In that sense, yes, righteousness is a blessing on the one who practices it.
Likewise, I also believe that, as the bible says, those who follow God will never be put to shame (Ps 25:3, Phil 1:20). And in this case, when it says never, I really believe it literally means never. At least, I have found this to be true in my life.
But in other ways, I don't think that righteousness confers any kind of special protection on the righteous, and in fact, I believe, as the saying goes, that no good deed goes unpunished.
There's several types of suffering.
1)because you screwed up. In this case you're really just punishing yourself, which is obviously really stupid (of you).
2)because someone else screwed you over. This kind may or may not be avoidable. For the sake of this question however, we'll say it's unavoidable.
3)because you've made yourself a nuisance to an evil person by doing good (this usually involves fighting against evil and frustrating evildoers' plans). Avoidable if you want to keep out of trouble and keep a low profile, but if you want to do the right thing, this is unavoidable. Therefore, for the sake of this question, I'll categorize this as unavoidable.
4)just plain random bad luck, (ie, natural evil, a consequence of having the misfortune of living in a fallen world [that's all of us]). Of course, nothing is truly random in this world, all things being governed by God, but that doesn't mean that God doesn't use the mechanisms of randomness for his nonrandom purpose. (This is a big topic in itself, and I'll cover it more in depth elsewhere -- [1] God Using Evil for Good, [2] The Interwovenness of Human Lives & Their Inevitable Mutual Effects on Each Other -- aka, The Ripple Effect, [3] The Problem of the Distribution of Goodies & Randomness) Under this kind of evil, we can identify 3 subtypes:
a)the evil seems random, but it's actually not, ie, God has used natural evil to punish a person for their sins. A very obvious example of this would be getting an STD because you were fornicating. However, my guess is that a lot of natural evil is actually purposeful punishment, but the link is a lot more subtle than the above STD example. For example, you die a slow, painful death before your time (as happened to that one evil king in the bible who finally died after 2 years of suffering from a disease that made his guts come out. II Chr 21:19)
b)the evil is truly undeserved, but has either a more naturalistic or random cause. For example, some drunk driver hits your car and your little boy/girl winds up in the hospital or even dead. This would fall under the naturalistic category because given that there's always going to be drunk drivers out there, it's just inevitable that some people are going to get hit by them, and who gets hit is random, at least from what I've seen in life. (There's a good discussion of this in The Drunkard's Walk: How Randomness Rules Our Lives by Leonard Mlodinow. For example, while it's true that on the individual level, who gets hit is random, on the nationwide, macroscopic level, the number of deaths from drunk driving is amazingly constant from year to year, almost as if there's some sort of quota to fulfill.)
Or your baby is born with a severe genetic disorder, where they either die or have to suffer greatly for the rest of their lives. (I'm using children in these examples to make sure that the victim is truly innocent. Of course, this could happen to anyone, as with Job.) Under this type of evil, there can be other subtypes (having to do with the purpose of the suffering), but that's not the issue here, so I'll move on.
c)the evil is undeserved, but unavoidable due to your unavoidable association with evil people who need to be punished. For example, maybe you're a saint, but you live with wicked people, and even if God protects you to some extent, he can't completely protect you due to surrounding circumstances. A good example of this is the bible story of Lot, when God sends 2 angels to get him and his family out of Sodom and Gomorrah, which he's about to destroy, and while it was certainly better than dying in the sulfur and brimstone, it still sucked that he had to be uprooted from the place he had made his home and start all over again, isolated in the mountains.
Why do I put this in a different category from "b"? In "b", the evil that strikes is more "pinpointed". That is, if some jerk runs you over, just because you happened to be at the wrong place at the wrong time, well, that really sucks because it's like fate was out to get you. In "c", the fact that you end up being a victim isn't so painful because the "coincidence" factor isn't so great. This is related to what I'll call the Jn 9:3 question above, which talks about coincidence in relation to what's considered a miracle. In this case, we're using coincidence as a measure of God's involvement in the pain and suffering in our fallen world. Again, the more coincidental, the angrier we are at God; the less coincidental, the less we blame God.
I would say that of all the different types of suffering enumerated above, type 1 (where you're actually just punishing yourself) is the most common. Everyone has their own life story, everyone's life is filled with trouble, and it's amazing how much of that trouble is self-caused. I really think that more than 50% of most people's problems would be completely avoidable if they were just committed to always doing the right thing. Even the mistakes that people make simply as a result of being young and stupid, even those mistakes are largely avoidable if people would just follow very basic moral teachings that we've all heard since we were little. I think what happens is that people think these basic moral teachings are too simplistic and they make exceptions for themselves and their situation, not realizing that actually, yes, the rules of life really can be that simple. Even so, I blame no one for being young and stupid, since that's how we all start out and it can only be helped to varying degrees. Now, being old and stupid is a different matter...
But on top of this, most other types of suffering actually flow from type 1. If you get run over by a drunk, well, that's just you being a victim of the sin that's in all of us. And if you end up being the victim of an evil person because you fight evil with good, that also is just you being a victim of the sin that's in all of us. What I'm saying is, if everyone was sinless, the only kind of evil that would be left would be the natural kind (like hurricanes and earthquakes), and even these I'm sure would not exist if there was no one to punish. What's unfortunate in this world is that while it's true that all evil and suffering is due to our own evil and sinfulness, and that at the macroscopic level humanity deserves to live in the fallen world we have created, on the individual level, this is not always true.
Now I'd like to talk about blaming God, because this is what it all boils down to. It's quite obvious that people don't really care about pain or suffering -- what they really care about is blaming God. Now I must give credit where credit is due -- I didn't think of this first for myself, I heard it in a sermon, but it's very true. The preacher was talking about the suffering of Job (we can say that the suffering of Job is only second to Christ's in its innocence), and he pointed out that at the end of the book, Job (and neither we) ever find out why God allowed Satan to touch Job. In fact, the whole book is really nothing more than Job's poetic complaining about how badly he wants God to put him on trial so he can put to rest his friends' accusations that he must somehow deserve all this suffering. However, when God really does make a surprise appearance at the end, it's enough that he merely showed up. It's quite amazing that God's the only person in the universe for whom his mere presence is enough to assuage all our pain and all the senselessness of our fallen world, if only we believe that he's REALLY there. Somehow, only God occupies this "existential" position, where his mere existence is enough to put to rest all our whys. After all, as I said above, for some reason no one really cares about pain and suffering, only, "God, are you out there?" Let me prove my point -- think of how you're suffering right now, and if you're not suffering right now, pick some time in the past when you were suffering, and if you've never suffered in the past just imagine your worst nightmare, and then imagine that God came down and all he did was somehow identify himself as God (and you were absolutely convinced that God had really come down and visited you). Wouldn't that somehow make it seem like everything you were going through really is bearable after all?
Why does God hold this "existential position"? I think because we all know, without ever having been told or taught, that God is ultimate meaning. If God visited you in your distress, even if he never explained what his purpose or plan was, we naturally understand that he does have a purpose and plan, and that it's good and worth it.
There's a famous classical atheist quote by Epicurus that goes like this (see under "Disputed"):
"Is God willing to prevent evil, but not able?
Then he is not omnipotent.
Is he able, but not willing?
Then he is malevolent.
Is he both able and willing?
Then whence cometh evil?
Is he neither able nor willing?
Then why call him God?"
I wonder what Epicurus would think if God came down in his distress. Or not in his distress. Never mind; the point isn't really his distress, but God. This is a question of faith here. See, if God comes down, that still doesn't answer the question in the LOGICAL sense. And yet, I think Epicurus would have a hard time holding on to his atheism. Of course, he could still not BELIEVE. What I mean is that his faith would be like Satan's -- that is, he knows God exists and yet devotes his existence to struggling against him. But could we really call Satan an atheist? Probably not, at least not in the technical sense. So we come back to Epicurus. Is the reason he didn't believe REALLY because of the evil in the world? He seemed to think that God's existence and the existence of evil in the world are mutually exclusive -- if you have one you automatically can't have the other. That the world is an evil place is obvious, so that must mean that God doesn't exist. But would his logic hold up if he were to actually MEET God? I don't think so. Again, he might still choose to not believe, but I don't think he could keep his atheism. So then what? To repeat, Epicurus' question would still remain unanswered, and yet he would be refuted because his basic premise (that God and an evil world are mutually exclusive) would be invalid, not because of logic, but empiricism, the same empiricism that tells us that the world is obviously an evil place.
Now we could go on and further refute Epicurus by pointing out that there is no morality apart from God, and so he is using God to refute God, which of course makes no sense, but this is a whole different issue, so I won't go into it here -- this is enough for now, but I want to drive home the point that while the problem of evil is a serious problem, it should not be used as an argument against God, since it's only an excuse to deny Him. How many atheists/agnostics have you met or heard of (perhaps you're one yourself), who hasn't said that they would believe if they saw a miracle or if God actually appeared to them? Countless. In fact, they use this also as an excuse -- knowing that God doesn't visit every atheist out there in order to dissuade them from their atheism and put an end to atheism on earth once and for all (wouldn't that be so easy [I mean this for both parties]!), in blind arrogance they proclaim that they will never believe unless God shows up right in front of them, and then, only then, will they believe. If this is true, then Epicurus doesn't even believe his own argument. If he established by empirical observation that the world is obviously evil, then he must be open to establishing the existence of God by empirical observation, including in a hypothetical situation.
Let's look at the problem of evil in relation to free will. I'd like to contrast group-oriented societies (such as those that are Islamic) with God's own policy, which is one of total individualism, freedom and non-paternalism. So, for example, in Islam, if you steal, they cut off your hand. This is extremely harsh, but the punishment isn't meant merely to punish, but to send a message to society that they better not think about stealing. God, however, lets everyone do whatever they want, or at least it sure seems that way. In what I'll call the "natural world", stealing won't, for example, automatically cause your hand to whither away. In fact, you might possibly make a very good life for yourself by stealing, especially if you're rich and can "afford" to get away with it.
Now this built-in non-paternalism in the natural world is partly due to the interplay of the 2 sides of the UQ -- effects in turn become causes, and actions and repercussions strengthen previous beliefs. For example, pedophiles generally become bolder and bolder over time. I don't think it really goes the other way around, and certainly not naturally. (I mean, while it is possible for a pedophile to get better over time, this would probably be the result of conscientious and painstaking self-discipline, not because it was just the easier thing to do.)
Now here's a side question, and then I'll return to the main line of thinking -- At what point, though, does a person hit rock bottom and realize that they no longer want to continue with this vicious cycle?
Now returning to my main point, I'm reminded of what CS Lewis said, that it's somehow valuable that we live in a world (however messed up we might have made it) of our own creation, one that we've made through our own collective choices and actions, rather than one in which God carefully filters out everything that he personally doesn't like.
But does God ALWAYS allow freedom? Think about the modern porn epidemic. In the past, getting a hold of porn was too difficult, and if we go back even farther, it was rather crude (ie, just drawings, no photos or videos), although, of course, there was always the option of prostititutes. So this was a natural hindrance to going completely wild.
Looking at all this from a practical point-of-view, what does this say about proper government? Should we be group-oriented and paternalistic, or libertarian and individualistic? Even if God's a "libertarian", wouldn't the UQ dictate that ideal government has features of both?
The bible says God takes care of all our needs. (Mt 6:25-34) Then why did God bring the people to a place with no water? (Ex 17:1) I can't blame the people for wanting to quench their thirst. (vv 2-3)
Well, the simple answer (God actually answers this question in the bible -- Dt 8:15-16) is that he wanted to test them. This is related to the previous question, where I talk about the different kinds of evil, and under type 4b I make reference to various subtypes, depending on the purpose. Well, this is one of the subtypes -- God testing you. Of course, a test is never pleasant, that's the point after all. (Heb 12:11)
So again, as in the previous question, we come up against the central question of faith, since faith is what's needed to stand a test. Therefore, this is really just the "Lazarus question (Lk 16:30)" in a different guise.
If it is God's desire that none should perish, and his will is always fulfilled, why do many perish? (Mt 7:13)
It's the UQ again. I talk about this on the UQ page (search for "free will vs fate/determinism).
But here's an interesting follow-up question: If God's will is always done (and it is; again, the UQ shows up, since there's what I'll call God's good or perfect will (Rom 12:2) and his manifested will), if God's manifested will is always done, could we still say we have free will? Let's take an extreme example here -- we know that people with bad intentions sometimes are successful with carrying out their evil plans and sometimes they're thwarted. Let's pretend that a pedophile is about to kidnap a little girl, but the cops get a hold of his porn stash and nab him before he can make his move. In this way, God didn't interfere with his free will by direct thought control (ie, ensures that the guy never has pedophile thoughts or desires), but the little girl is still saved from being traumatized. So free will is protected, but the world is still a safe place. Now we know sometimes this happens, so why can't God do it all the time?
Well, what would it look like for God to do this all the time? The result, I think, would be artificial. We could go further with the above example and say that this pedophile is never even able to collect a porn stash to begin with. Maybe he doesn't have enough money for it. But then wouldn't everyone with pedophile tendencies have to be too poor to afford child porn? That doesn't seem realistic. In any case, the market would probably adjust itself to ensure that the demand could afford the supply, never mind that, I'm sure, pedophilia can be found in all socioeconomic classes. In any case, this still hasn't eliminated the problem, because what made the pedophiles go after child porn in the first place? In the end, all evil comes from the mind and heart, which is something you can't directly regulate, and if God were to directly regulate them, well, where would the free will be?
But then, we could run this experiment in the opposite extreme -- everyone always gets away with whatever they want to do. Hmm. This also seems artificial and unrealistic, and in fact, a logical impossibility. After all, humans have all sorts of desires and goals, and these are often at odds with each other. The pedophile has one goal, the cops have another -- how could they possibly both be successful? So it seems to me that God lets us fight for either good or evil, and whichever is stronger wins. I'm saying that a lot of this depends on the social milieu. Society, as a whole, is partly responsible for even individual sins. For example, child sex trafficking in south and southeast Asia is a lot more tolerated than it is in the US. Divorce is more tolerated in the US than in Argentina. Britain and the US have problems with serial killers, while serial killers are practically unheard of in other societies. It's even more acceptable to be depressed or commit suicide in some societies (such as Russia) than in others (let's pick Mexico). So if a pedophile is running loose in the US, I'm saying that Americans, to a certain extent, breed pedophiles. How? Lax sexual mores, porn (and I'm talking about just regular porn, not child porn), being a huge factor. A lot, perhaps even most, pedophiles aren't born, but made. They start off with regular porn, then they go for harder and harder stuff to get the same level of arousal, and one day they discover, often to their shock and dismay, that child porn is actually arousing. I would hope at this point that they would quit and realize what they've done to themselves, but unfortunately, many don't. They have now been acclimated to thinking of child porn as OK (perhaps as long as they themselves don't molest or rape a child), but who knows how long it takes before they're rationalizing that? So because Americans love their porn too much, it's too difficult to pass laws against it, and so the problem continues, and little children become the innocent victims. In this case, the fight of good against evil has taken a hit. What can turn the tide? Can it be turned? I wish I could say. Already, incest porn is on the rise, because the demand has become inured to so-called "lighter" stuff, and the pornographers, realizing that this is the wave of the future, are more than willing to supply the demand. It's shocking to me that there's no law against this stuff in America. Can it really be good for society to let the citizenry become hooked to this garbage? But no, pornographers and porn lovers come to the defense of porn with cries of "Free speech!" and "Freedom of expression!" and the rest of America is more than willing to hear them out and take their bullshit seriously.
But isn't this God's way, to give us the freedom to do whatever we want? Well, even this isn't completely accurate. A Yanomama Indian in Venezuela has never heard of porn (though rape is extremely well-tolerated in their society). So you could say that God has deprived the Yanomama of his "right" to porn. Even so, overall, I think God is a real libertarian and he'll let you do whatever you want -- no artificial barricades or mind control or any such thing. He's even more liberal than a libertarian -- libertarians say your freedom stops where another's rights begin, but God gives us a free-for-all. That's his policy on earth. He doesn't handcuff anyone or tie them down. (For example, he doesn't just tell the cops who all the pedophiles are and where to track them down.) Instead, he let's us (the good vs the evil) duke it out. Then at the end, he'll collect everyone who fought for good and put them in their own world, and he'll collect everyone who loved evil and unrighteousness and separate them off in their own world, and the 2 kinds of people will never have to interact with each other again. So the children of God will have peace and tranquility and get along with each other, and the children of the devil will be able to live in hell like they always wanted, and their evil plans will never again have to be thwarted by the pesky do-gooders.
But then why doesn't God make everyone good to begin with? Again, we come back to the original question. And while I don't have the definitive answer, I can at least feel out that such a world is unrealistic and artificial. The good news, however, is that God can at least separate the sheep from the goats at the end of the age and the sheep can set up their own world and the goats their own world, and I think this is what God thinks is the most fair. When his plan for this world has been completed, he will make sure that the sheep will no longer have to endure the goats. And this is the real crux of the question, because I don't think people care so much that there's good people and there's bad people, as they care about why the good suffer at the hands of the bad. At least we know that this suffering is temporary and will not be tolerated forever, but only a short time.
But let's take a look at this. If, as it seems, there must always be good people and bad people, why doesn't God just make a world full of good people and a second world of nothing but bad people from the beginning? Well, this model has some problems. First, no matter how good you are you're never perfect, so the possibility of making a world of nothing but good people is arguable, no, actually, impossible, unless, again, you have God tweaking and messing with people's free will (which is a cosmic no-no). No matter how good someone is, they always have some part of them that's ugly and has no place in a perfect world. This is why God sent us a Savior. And second, a second world of bad people is redundant -- why create them in the first place if they're just going to be bad? So this collapses into the first alternative model (God only creating good people), which we've already discussed.
But if it's impossible to be good from the beginning, why would it be possible to be made perfect in the image of Christ after being saved, and only after death? This is a good question -- it's the opposite of our original question -- if we cannot help but be imperfect, how can God make us perfect? And again, if his intention is to make us perfect, and worthy of this perfect world, why are we not perfected at the moment of salvation, but only when the world is renewed? Well, as is true of everything else in the world, we are conformed to the image of Christ little by little, not overnight. I suppose this is because God works like this in the physical world (here's the UQ again), where even the process of santification is not imposed completely by supernatural will, but by the working, cooperation, and practice of our natural will as well. (Rom 12:2) So it's our duty as Christians to keep straining for perfection while we sojourn to our heavenly home, but to also hope in the renewal of all things, when we will finally attain our goal. And I think this is one of the most difficult things to live in the Christian life -- this balancing of hope despite the darkness, which can only be attained by the practice of more and more faith.
So of all the possible models, God thinks it best that his divine plan is played out in a world like ours, as Jesus teaches in the parable of the wheat and weeds (Mt 13:24-30) and as we explored some reasons for in this question, but I think evil is actually instrumental in God's divine plan (which Jesus doesn't go into in the parable, but only mentions), but I'll write more about this elsewhere, which Jesus addresses in Mt 18:7 -- "Woe to the world for temptations to sin! For it is necessary that temptations come, but woe to the one by whom the temptation comes!"
I thought there was nothing bad in Eden, so how come Adam was lonely if everything was perfect? (Gn 2:18, 23)
As if often helpful, let's pose the question differently -- would it be possible for Adam to be perfectly happy despite not having a partner? Yes, but only under certain conditions:
A)He was created without any need for a partner, which God could have willed and done, but he didn't, and I'm not going to complain -- romantic and sexual love seem like good things to me,
B)He could be perfectly happy no matter what, which again, might actually be possible under certain circumstances. Hypermania, for example. People with this condition are always happy for no reason, and in fact, often when they have plenty of reason not to. I once read of a hypermanic woman who's mother died, and it really didn't affect her, nor did it really bother her that she wasn't affected. On one hand, you could think she was really lucky -- no matter what, she's always happy! Isn't that what we all want? Actually, I don't think so. I think what people really want is to, as the ancient Greeks called it, flourish. Again, the UQ comes into play. Happiness is made of 2 components -- the physical side is what I'll call pleasure, and the 2nd is meaning. In the case of this hypermanic woman, she has quite a lot of pleasure, but not a whole lot of meaning. That is, she's happy for no reason, and I actually think that's not a good thing. As with all things in the UQ, you want the 2 sides to correspond as much as possible. You can have pleasure without meaning, and you can have meaning without pleasure, but the first is empty, and the second is still miserable, though it's still better than emptiness -- put another way, something is better than nothing.
So I don't think it'd be right for Adam to be happy for no reason, or when he really ought to be lonely, if that's what it means to be connected to reality. Not saying that this answers the question -- just offering another way of thinking about it.
Lk 7:13-14 If it's God's plan to do good, why do evil in the first place? (see also God Using Evil for Good) Why not just make it so that the man never died? Why was the man at the pool of Bethesda an invalid for 38 years? Why was he enslaved for 38 years? (Jn 5:5) Why was the hunched-over woman enslaved for 18 years (Lk 13:11), and the hemorrhaging woman 12 (Mk 5:25)? I can't pray for sick people. Why pray for good when we see that it was God's will that a person be under evil? (And we know that anything that happens is God's will.)
Actually, this is really only a facet of a larger question, which is, why did God will that there be evil at all? I'm sure there's many of you out there who would disagree that God wills evil, preferring to say that he only allows it, but I disagree. We see that the only difference between this age and the next is that this world has evil, while the next, provided you go to the right place, doesn't. God could have made it so that this age would be like the next (in not having evil), but he didn't. Therefore, evil must serve some kind of purpose. In fact, I would say that it is the defining feature of this age, that the whole divine plan is predicated upon evil. I don't purport to say that I know just how evil serves the divine plan (that's the question of the ages, isn't it? And philosophy is the one human endeavor that will never make progress), only that it serves some kind of purpose.
But this doesn't mean that I think the existence of evil is somehow artificial, in the sense that God invented it as a mere means to an end (and surely, God would never invent evil), but that evil is a natural consequence of existence. So I believe that while evil's existence is inevitable, I also believe that it's been harnessed by God, against all odds, for his greater glory. Of course, all things have their existence for God's glory, and so we could answer the question simply like this and leave it at that, but of course, that's always dissatisfying, and not very intellectually honest, either. I suppose if one had the greatest faith, that would be good enough, and I'm not disparaging faith here -- faith is necessary -- nothing good could be accomplished without it, so I commend this person with the greatest faith, but that's for religion, and this is theology -- theology seeks to understand, and indeed, faith also seeks to understand, since true faith seeks to always be balanced with reason, as the UQ dictates.
"If favor is shown to the wicked, he does not learn righteousness; in the land of uprightness he deals corruptly and does not see the majesty of the LORD." (Isaiah 26:10)
"Because the sentence against an evil deed is not executed speedily,
the heart of the children of man is fully set to do evil." (Eccl 8:11)
Then why does God do/allow this?
This question really can't be fully appreciated if not taken in light of the bigger picture, which for our purposes here, I think is sufficiently discussed in the question and answer immediately above, that is, not only why does God let evildoers continue in their evildoing, but more importantly, why does he allow this at all? In any case, let's get down to the particulars of this question.
For one thing, God is constantly testing us. (Job 7:18) In fact, this life is just one big test. So we should remind ourselves of this whenever we start to get tunnel vision and magnify some little thing in life as if it were something of ultimate import, or, as the Little Prince would say, matters of consequence, when really, we're just actors in a play, the thing of true ultimate import being -- did we hold to our integrity? As the bible says, "All human deeds surely perish; the works they do follow after them." (Sir 14:19) This isn't to say that we should take things in life lightly, since one mortal sin can separate us from God, but we shouldn't confuse the many little struggles of life with what really matters. To put things more concretely, it doesn't really matter if you watch his movie or her movie, but that each is willing to please the other. Unfortunately, most people's lives consist in getting this fact backwards. Herein we see the need for faith. The faithless person is blind to the big picture, blowing little things up to make them big, and dismissing what's big to make it little, or even nonexistent, when, if they had wisdom, they could live life with extraordinary confidence.
Which brings us back, quite conveniently, to our original question -- why does God allow these faithless people to go on and on, ruining things for everyone else? I don't think the point, as reiterated from above, is whether everyone is happy and prosperous, but to allow us to grope for a reality and destiny of our own choosing, to figure out for ourselves whether we'll live in the light or the darkness, and what we'll make of ourselves. Actually, the bible goes so far as to say that some people are destined for destruction, and that their contribution to the divine plan is in a negative sense, and to their own destruction. People such as Pharaoh, Judas Iscariot, and really, anyone else who doesn't find the narrow path. (Rom 9:10-24)
So let's imagine that God swiftly rewards or punishes everyone as soon as they did good or evil. Now sometimes this happens, but not usually. Most of the time, the full consequences of sin take time to develop, and needs its time to reach maturity. This is like anything else in life, in this physical world that we live in, where everything is predicated on time, growth, and gradualness. Life is lived on different time scales -- things can happen in split seconds, take years of dedication, a whole lifetime to achieve, or on the national scale, centuries to come to full fruition. Likewise, sin (or virtue), is played out on these same time scales. The full story must have its beginning, middle, and end, and not a moment sooner or later. A striking example of this in the bible is the story of Esther -- the villain (Haman), in his pride and prosperity, falls headlong to his doom, not realizing, all along the way, that this very prosperity will be his undoing. Not that prosperity is bad in itself -- on the contrary, prosperity is good, and if you can have it, go and get it, but realize that you'll be tested by it, because some become prosperous and use their prosperity and power for its intended purpose, to better serve others and not oneself, as King David realized early in his reign (II Sm 5:12), while others, like Haman, are blindsided by it. Life will carry out as you decide, as this quote from the Philokalia by Saint Mark the Ascetic so wonderfully puts it: "He who does not understand God's judgments walks on a ridge like a knife-edge and is easily unbalanced by every puff of wind. When praised, he exults; when criticized, he feels bitter. When he feasts, he makes a pig of himself; and when he suffers hardship, he moans and groans. When he understands, he shows off; and when he does not understand, he pretends that he does. When rich, he is boastful; and when in poverty, he plays the hypocrite. Gorged, he grows brazen; and when he fasts, he becomes arrogant. He quarrels with those who reprove him; and those who forgive him he regards as fools." Really, nobody has an excuse if they don't learn the lessons of life. After all, if we all hate it so much when others impinge on our dignity and pride and screw us over, why do we then turn around and do the same things to others and expect them to treat us any better? But nothing blinds better than pride, and nothing is more self-righteous than pride wounded.


At Kepler's you will find a full showroom, complete with an extensive line of amazing fabrics.
and available for any questions or ideas you have, or just want to discuss.
business hours. No appointment necessary.


PO706 Transmission Range Sensor "A" Circuit Range Perf.
Today, the EPC light came on and vehicle began to stall when starting.
Can these problems be associated with bad coil packs or vacuum hose leaks?
I'm a first time Audi Owner and the guy that sold it to me had disabled the check engine light to hide all the problems. I'm a female and I do not know much about automotive mechanical issues. The dirt bag changed his number and I am stuck with this car that I cant smog. Can anyone suggest an Audi mechanic who can fix problems without charging a fortune? I live in Los Angeles.
2004 or 2005 a4 convert.
Convert a 1.8 non turbo to turbo ???
Quick Reply: 2005 Audi A4 Turbo 1.8 Convert.


text:
Derek Jeter Girlfriends: Who Has The Yankees Star Dated? [PHOTOS]
By Anthony Riccobono @tony_riccobono
Scarlett Johansson and Jeter were spotted together in December 2004. Photo: Reuters
With Spring Training approaching, Derek Jeter announced that the 2014 MLB season would be his last. He'll play his 20th and final year with the New York Yankees, with whom he's spent his entire career as a professional baseball player.
Along with winning five World Series championships, the shortstop has put up all-time great statistics. He holds the record for most ever hits and runs scored in the playoffs, in addition to recording over 3,300 hits in the regular season, However, as good as Jeter's numbers are on the field, his prowess off it has been just as impressive.
Since he entered the Majors in 1996, Jeter has dated some of the biggest celebrities in Hollywood. Just as the Yankees began their dominant run in the late 1990's, the future Hall of Famer entered into a relationship with singer Mariah Carey. The romance reportedly ended in 1998, but Jeter was only getting started.
Over the years, he's been linked to the hottest young actresses in TV and movies. Scarlett Johansson, Jessica Biel, Jessica Alba and Jordana Brewster have all reportedly spent time dating Jeter. The Yankees star has also made the rounds with supermodels, Adriana Lima and Tyra Banks chief among them.
In recent years, Jeter has seemingly given up his playboy lifestyle and entered into serious relationships. Minka Kelly and Jeter appeared to be on the verge of getting married, but they split in 2012. Model Hannah Davis was Jeter's latest girlfriend, but their breakup was reported just days before the MLB star announced his retirement.
After the recent split, rumors began to circulate why Jeter decided to end it with Davis. According to Page Six, Jeter has an issue with his girlfriends' fame.
"Derek likes to keep his relationships quiet," a source told the New York Post. "In the past, when his girlfriends become famous and start doing sexy shoots, that's when they break up. Exactly the same thing happened with Minka and Vanessa Minnillo."
Jeter will be 40 years old at season's end. It looks like he'll begin his final year in the Majors without a girlfriend.

redpajama_set_name: RedPajamaCommonCrawl


There have been many rightly-guided khalifs in the past whose qualities were far more refined and noble than those of today's kings, prime ministers and presidents. They lived very simply and spent very little on their own personal comfort. One of these great khalifs was called Umar ibn Abdul-Aziz. He followed the teachings of Islam with sincerity and served the people whom he ruled with humility.
One hot summer's night, Umar ibn Abdul-Aziz was lying awake in bed, too hot to sleep, but cooled a little at least by the fan with which a maidservant was fanning him. Thanks to her efforts he at last fell asleep. After a while, however, she began to grow very tired and then finally she too fell asleep, the fan slipping from her fingers and falling to the floor.
The khalif awoke from his slumber, and seeing that his maidservant had fallen asleep, he picked up the fan and began to fan her gently. After a while she woke up and was startled and dismayed to find the khalif fanning her. She was meant to be fanning him – what would happen to her now?


text:
import datetime
from django.test import TestCase
from foodroller.commons.date_utils import Date

class DateUtilsTestCase(TestCase):
    def test_get_weekday(self):
        my_date = datetime.datetime(2016, 2, 14)
        week_day = Date.weekday_from_date(my_date)
        self.assertEqual(week_day, "Sunday")

    def test_get_end_date(self):
        now = datetime.datetime.now()
        days = 6
        end_data = Date.get_end_date(now, days)
        self.assertEqual(end_data, now + datetime.timedelta(days=days-1))

    def test_create_days_dict(self):
        now = datetime.datetime.now()
        list = Date.create_days_dict(now, 4)
        for k, v in list[0].items():
            self.assertEqual(k, now)
        for k, v in list[1].items():
            self.assertEqual(k, now + datetime.timedelta(days=1))
        for k, v in list[2].items():
            self.assertEqual(k, now + datetime.timedelta(days=2))
        for k, v in list[3].items():
            self.assertEqual(k, now + datetime.timedelta(days=3))

redpajama_set_name: RedPajamaGithub


text:
Ecological and evolutionary forces shaping microbial diversity in freshwater blooms
MicroEcoEvol
Periodic Reporting for period 2 - MicroEcoEvol (Ecological and evolutionary forces shaping microbial diversity in freshwater blooms)
Cyanobacterial bloom is a worldwide issue, resulting from human activities (e.g agriculture) and one of its major consequences: climate change. These blooms are a threat to freshwater ecosystems, human health (e.g consumption of fish from aquaculture) and tourism as cyanobacteria produce cyanotoxins leading to the death of many organisms or even ecosystems. The cyanobacterial genus Microcystis is often the dominant member of bloom, especially in eutrophic lakes, producing potentially an hepatoxin that is toxic to animals including humans. Predicting toxin production and bloom severity is still an unsolved problem, due in part to our lack of knowledge about population diversity among cyanobacteria taxa, particularly Microcystis. Evolutionary dynamics of Microcystis populations are poorly understood – specifically how genetic diversity is selected and maintained by natural selection in the population according to environmental and ecological factors.
In this project we attempted to (i) characterize the evolutionary dynamics of natural Microcystis populations by investigating both ecological and evolutionary responses to selective pressure and (ii) dissect the impact of the different selective pressures (environmental and biological factors) that may shape Microcystis populations. The aims of this project will be achieved using a unique multidisciplinary approach mixing ecology and evolution, and combining observations from natural time-courses in lakes, in situ experiments in microcosms within lakes, and in vitro experiments in the lab. This project will be the first to comprehensively and simultaneously quantify both ecological and evolutionary responses of a bacterial population in real time, and in a natural setting.
In a first study we used a deep 16S amplicon sequencing approach to profile the bacterial community in eutrophic Lake Champlain over time, to characterise the composition and repeatability of cyanobacterial blooms, and to determine the potential for blooms to be predicted based on time course sequence data. Our analysis, based on 135 samples between 2006 and 2013, spans multiple bloom events. We found that bloom events significantly alter the bacterial community without reducing overall diversity, suggesting that a non-cyanobacterial community prospers during the bloom. We also observed that the community changes cyclically over the course of a year, with a repeatable pattern from year to year. This suggests that, in principle, bloom events are predictable. By using symbolic regression, we were able to predict the start date of a bloom with 78–92% accuracy (depending on the data used for model training), and found that sequence data was a better predictor than environmental variables (Tromas et al., 2017).
Two cyanobacterial genera, Microcystis (M) and Dolichospermum (D), were frequently observed simultaneously (during bloom events in lake Champlain) and might have partially overlapping niches. In a second study, we determined the intra-genus variability and the ecological niche of the different strains. Within each genus, we identified strains differentially associated with specific environmental conditions. In general, we found that niche similarity between strains (as measured by co-occurrence over time) declined with genetic distance. This pattern is consistent with habitat filtering – in which closely related taxa are ecologically similar, and therefore tend to co-occur under similar environmental conditions. However, in contrast with this general pattern, we found that similarity in certain niche dimensions (notably nutrient) did not decline linearly with genetic distance, and instead showed a complex polynomial relationship. This observation suggests the importance of processes other than habitat filtering – such as competition between closely related taxa, or convergent trait evolution in distantly related taxa – in shaping particular traits in microbial communities (Tromas et al., 2018).
In a third study, we analyzed 76 Microcystis genomes from cultures to investigate the Microcystis population structure; i.e whether Microcystis consists of a single recombining population, or whether there are ecologically-specialized sub-populations. We found that indeed several genomic clusters correspond to named species and monophyletic groups whereas others are paraphyletic, distributed across genomic clusters. We also observed a higher recombination rate within clusters than between clusters supporting the species coherence of monophyletic groups. This work is in progress.
In a fourth study, we analyzed the Microcystis /cyanophage infection dynamic and the role of phages (virus infecting bacteria) in terminating blooms using CRISPR array information. In this analysis, based on 62 metagenomic samples between 2006 and 2016, we found evidence in arms race dynamic between phages, especially during the intensive sampling (2015-2016) where samples were taken every 1-3 days. However, the overall pattern showed that Microcystis population remains abundant over time, which could be explained by the maintenance of a highly diverse CRISPR arrays within Microcystis genomes. This work is in progress.
In this project, we used a reverse ecology approach, i.e extracting genomic information from natural environments and obtain novel comprehension of an organism's ecology. We improved our understanding of a complex freshwater microbial community. We used for example the microbial genomic information with machine learning approaches to develop predictive tools and define cyanobacterial sub-population ecological niches. Finally, this project lead to a better understanding of Microcystis population structure and cyanobacterial predators (bacteria and phages), leading to a better understanding of how these predators impact bloom termination.
Overall, the different publications coming out of this project will be of great interest to evolutionary biologists and microbial ecologists but also for a wider range of scientists including limnologists and ecologists. Moreover, the different research outcomes from these studies will impact the community of scientists studying cyanobacterial as well as the broader scientific community working on harmful algal blooms. The project, as predicted, combines multiples disciplines like microbial evolutionary genomic, limnology and computational biology, inducing new collaborations and the development of multidisciplinary tools (computational and experimental). The project also got a special attention, for example, the recent ISMEJ (2017) and Frontiers in Microbiology (2018) papers are highly read and already cited. Moreover, different local media has mentioned my talks for the Baie Missisquoi conservation association where multiples mayors were present to discuss about how to improve cyanobacterial bloom prevention and information, in Lake Champlain. Furthermore, I have presented my work in four national/international conferences (Canada, US), I have organized and lead a session in an international conference (ASLO 2017) and I have organized two international workshops ("ANVI'O workshop" Montreal 2016; "Resolving Microbial Communities At Strain-Level Resolution", Exeter 2018). Finally, this project furnished the bulk of preliminary results for a $12M Genome Canada Large-Scale Applied Project on predicting and preventing toxic freshwater cyanobacterial blooms.
Last update: 1 April 2021


text:
Last of the 30 Comrades dies
November 28, 2013 in Lead Story, News, Obituary, Society148by DVB
Ye Htut, the last remaining member of Burma's revered 30 Comrades, passed away peacefully at the Thuka Kabar Special Clinic in Rangoon on 27 November, aged 92.
The 30 Comrades were trained in Japan to fight against British rule during World War II. Among them were Ne Win, who went on to be a military dictator; and Aung San, who was the architect of Burmese independence and father of Aung San Suu Kyi.
Ye Htut was born in Rangoon's Tamwe township on 25 February 1922 to Bo Lwin and Saw Shin. His name at birth was Aung Thein. He graduated from Kandawlay Municipal School where he made a name for himself as a protest organiser and students' union leader between 1938-40.
Recruited as one of the 30 Comrades, Ye Htut left for military training in Japan on 13 April 1941. He was appointed commander of the Burma Independence Army's 3rd Brigade, then 1st Brigade commander in the Burma Defence Army, before being made director of the General Administration Department of the Burmese Army in 1944-45.
[related]
After fighting the British and their allies, Ye Htut and the Burmese Army then took up arms against the Japanese occupiers.
After the war, he became a member of the Leftist Unity Council and went underground with his unit in 1948. He was involved in armed struggle once again as a leading figure in the Burma Communist Party between 1951 and 1963.
Ye Htut became an advisor to the Burma Socialist Programme Party in 1964, and was a member of the Constitution Drafting Commission in 1973. He was purged from office in 1974.
During his long military career, Ye Htut was awarded the Medal for Gallantry (second class), the Medal for Revolution, the Medal for Independence, Mawgunwin (first class) and Naingngan Gonyi (first class).
30 Comrades Aung San British colonial rule Burma Socialist Programme Party Japanese occuption ne win WWII Ye Htut
qp10wo29
Chin students oppose Aung San statue
General Aung San one step closer to banknotes revival with…
Sign erected naming Mon State bridge after Aung San as…
Gen. Aung San statue destroyed by mentally unstable man
Previous PostMinistry bans building within Bagan, other heritage sites
Next PostHow can Burma halt the spread of religious violence?


Plot app 960 sq.m. with planning permission in principle for erection of 3 bdrm dwellhouse with double garage. Services nearby. Price over £85,000 Entry by arr. Viewing contact solicitors.
North Lodge is located within an historic landscape renowned for its field sports, rolling agricultural land, and ancient woods. The site rests just below the Highland Line at the eastern fringe of the Grampian Mountains, 1 mile away from the conservation village of Fettercairn.
The building plot, which extends to c.960 square metres or thereby, is located on the northwest boundary of Fasque House Estate, home to one of Scotland's most historic and recognisable country houses. There is planning permission in principle for the erection of a 3 bedroom dwelling house with a double garage and parking. Electricity is located nearby and there is currently a private water supply located in close proximity. It enjoys a pleasant rural setting amidst mature beech avenues and offers a development opportunity in a peaceful idyllic locale.
The counties of Angus and Kincardineshire offer an enviable range of leisure pursuits for the active family with golf, hillwalking, hunting and fishing being available widely throughout the area. The "Glens" and the Cairngorm National Park also provide considerable attraction for the outdoor enthusiast. The picturesque village of Fettercairn offers everyday essentials with a village shop, post-office, café and restaurant, and the Ramsey Arms Hotel. Fettercairn primary school is 4 minutes' drive from the site and 15 minutes away from Mearns Academy secondary school, which has an excellent record of academic achievement. There are health clinics and dental surgeries in the neighbouring towns of Laurencekirk and Edzell as well as a wide range of local retailers.
Despite its rural location, the site has excellent communication links. Laurencekirk (7 miles), Montrose (15 miles) and Stonehaven (17 miles) provide railway links while the A90 trunk road, which connects to Dundee (39 miles) and Aberdeen (35 miles) and then on to Edinburgh (100 miles) and Glasgow (117 miles), is 8 miles away. Aberdeen airport is within an hour's drive (under normal conditions) and has regular flights to destinations in the UK and Europe.
Directions: On entering the village of Fettercairn from the Edzell side take the first left at the roundabout, heading past the primary school and Fettercairn Distillery. Take a right just after the distillery and proceed past the farm until you reach a T junction. Take a right and North Lodge is the first house you come to on the right. The plot is indicated by our for sale board.
N.B. Prospective purchasers are advised to note their interest with the selling agents in order that they may be advised of any closing date etc.


text:
Howto:Systems Modeling
This article or section contains out-of-date information
Please help improve this article by updating it. There may be additional information on the talk page.
This article is a stub. You can help the wiki by expanding it.
this is just to let you know that I am currently experimenting with gnucap integration into FlightGear. Gnucap is the Gnu Circuit Analysis Package, much like (p)spice or it's derivates. Unlike spice, it's GPL'ed and should give the ability to perform detailed and exact electrical circuit analyses to simulate the electrical system.
There is nothing to present so far, but first tests are very promising. My goal is to integrate gnucap in a way, that nodes are presented as properties and in that way accessible from FlightGear. The electrical system will be presented to gnucap as a netlist, so even complex circuits may be processed.
http://www.gnucap.org
http://www.gnu.org/software/gnucap/
Greetings, Torsten[1]
— Torsten Dreyer
↑ Torsten Dreyer (Tue, 13 Apr 2010 10:35:53 -0700). [Announce (electrical) circuit simulation].
1 The old Electrical System
1.1 Issues & Limitations
1.2 Sophisticated Systems Simulations
1.3 Favoring Nasal
1.4 Depreceating the old System
1.5 Nasal advantages
The old Electrical System
Issues & Limitations
The current electrical system is "data driven" rather than hardcoded, but it was designed before nasal existed in FG.
Electrical systems can vary widely from airplane to airplane. It makes sense to have a few representative examples, but for accurately modeling the particular system on a particular aircraft, you are really going to have to dig in and do some work.
The current electrical system model has some serious problems due to short sighted design and the designer (me) not fully understanding the problem I was trying to solve. This week I've been taking the Microsoft "big hammer" approach of trying to beat something of dubious quality and poor design into something that actually works and is useful ... using overwhelming force. I'm ready to give up and trash the whole subsystem.
The system is very complex with a lot of subtle interactions and side effects. It's unclear for someone new coming into the project exactly how it works and what you have to do to build a successful electrical system model.
The system can't handle things like battery charging without introducing horrible hacks.
The system can't do things like balance loads between two alternators, again without horrible hacks.
Try extracting the information you need to accurately drive an ammeter gauge from the current system ... we will need even more horrible hacks. :-(
What we really need is someone who actually understands all this stuff to build a better data driven electrical system model using a better, more flexible approach. I am told that SPICE is a good example of doing this right, but I'm a computer scientist with very little EE knowledge or ability. Circuits strike fear into my heart.
An alternate approach would be to write a "procedural" electrical system model for each specific aircraft using nasal. But is there a way to have a "default" nasal function that can be overwritten by an aircraft specific function? I am almost favoring the nasal approach here for many of these aircraft specific subsystems.
I realize this expands the discussion rather than focussing it, but I'm getting really frustrated with the inabilities of the current electrical system to do things like model battery charging (without trying to charge itself and other goofy things), model ammeter gauges (i.e. measure current flow between two different points in the "network"), do load balancing between multiple alternators and a host of more complex things. I like the idea of a v2.0 electrical system that is similar to the current system, but designed by someone who knows what the H-E-double toothpicks they are doing (obviously not me.) But in the mean time, nasal would be a quick and dirty approach to getting a fairly functional electrical system up and running pretty quickly.
Sophisticated Systems Simulations
Here are some ideas about modeling electrical systems that are general
enough to handle most airplanes. The base object will probably need to keep a list of suppliers and another list of users. If the state of any component changes it will then be resposible for notifying all of its users. The alternative method, by which every user would check its power supply at every sim-cycle seems wastefull, especially when you have 300+ users. AC components can have any number of suppliers, but generally only use one at a time. DC components can use all their suppliers at the same time.
Here are some objects to be derived from the base object:
1) CSD (constant speed drive), which exists between an engine and its generator. The CSD has one supplier, the engine, and one user, a generator. The CSD's function is to spin the generator at a set speed regardless of engine rpm. CSD parameters to monitor are Oil Quantity, Oil Temperature going in from the cooler, and Oil Temperature going out to the cooler. The measure of the CSD's health is the oil temperature Rise (out - in). The CSD has a cockpit switch which can physically disconnect it from the engine in order to protect the engine. The switch is for emergency use only, as once it is used the CSD clutch can only be engaged by a mechanic.
2) Battery, nominally 28 Volt, which will last about 30 minutes if it is the only power source available. It is normally supplied by the battery charger, so if the charger is powered the battery is transparent.
3) Ground Power, supplies 115 Volt, 400 cycle AC power to a "Ground Power Bus". This is plugged into the side of the airplane, and is either there or it isn't. A light in the cockpit advises if its there.
4) APU (auxilliary power unit), which could be derived from a turbine object, but I think that would be a waste. It supplies 115V/400Hz electrics, and usually supplies pneumatics as well. It has a Start/On/Off switch in the cockpit, and an EGT gauge. It burns fuel from one of the airplanes main tanks.
5) EPU, similar to an APU except that it only works (automatically) when regular electrical sources fail. The F-16 EPU has its own hydrazine fuel supply. I don't know if EPU's can supply hydraulics as well.
6) Generator, which supplies 115V/400Hz power to a bus. Supplier is a CSD. You could model the APU generator as an independent object using the APU as a supplier, or you could incorporate the APU generator into the APU model. Generators generally have two switches. The field switch turns the generator on/off. The breaker switch connects/disconnects the generator from its bus.
7) RAT (ram air turbine), like the EPU it usually comes on atomatically, although it can also be activated by a cockpit switch. The RAT falls down into the airstream and supplies 155V/400Hz power. In some airplanes it also supplies hydraulics, or only hydraulics.
8) HPG (hydraulic powered generator) uses a hydraulic motor to spin a generator. This is purely a backup source, used for ETOPS certification, and comes on automatically.
9) Bus, a simple component which only keeps a list of suppliers and a list of users. AC or DC.
10) TR (transformer/rectifier) converts AC to DC. Supplier is one of the AC buses. User is one of the DC buses.
11) Static Inverter converts DC to AC. Used by the battery bus to supply the Standby AC bus. In the event the battery is the only source operating, the Standby AC bus is the only source of AC power. Only essential users are on this bus.
12) Battery charger, supplied by an AC bus (with a backup AC bus also), user is the battery and everything the battery powers.
I'll soon draw up a diagram of a typical Boeing electrical system and send it to whoever wants it.
Dave Culp[1]
— Dave Culp
↑ Dave Culp (Tue, 24 Sep 2002 07:20:50 -0700). Electrical systems.
Favoring Nasal
The current electrical system model was developed before Nasal showed up on the scene. Nasal is a very attractive option for developing aircraft specific subsystem models.
Please see the c172p (our reference aircraft), which is a really interesting/practical example of how nasal can be used to add significantly complex aircraft specific functionality to FlightGear without touching the C++ code base.
Depreceating the old System
We should not use the current system any more to develop new electrical system models. We can leave it in the code base for a while so we don't break existing aircraft designs, but in retrospect it's kind of an embarrassment so eventually it should go. I propose that people needing to develop aircraft specific electrical systems now use a nasal based approach.
The xml based electrical system model is in the process of being abandoned. It's there for backwards compatibility only. I wrote it and realized later that it just didn't have enough capabilities to model anything much beyond a simple single engine aircraft electrical system. It didn't have the capability of correctly driving the panel gauges, properly handling multiple power generation sources (at least for some aircraft) and there were other problems I encountered when I tried to impliment a realistic light-twin engine electrical system.
Nasal advantages
So I decided to abandon the xml based system and recommend that people craft a nasal based electrical system for their aircraft. Electrical systems are very aircraft specific and can often change drastically between serial number ranges of a particular aircraft. Also, the level of detail that a person might want to model can vary dramatically depending on the project and the time.
So I think a nasal based system gives us much more flexibility, and the ability to achieve correct behavior with as much detail as desired. The old xml based data-driven system was extremely tedious to define where as a procedural nasal based system isn't any harder to create.
The original electric system model has some horrible limitations that make it difficult to model electrical systems that are more advanced than what you would find on a C172. In addition, it's really difficult to use this system to accurately drive volt and ammeter type gauges. The underlying circuit modeling just can't handle it.
So *really*, people should be moving away from this old, depricated xml based electrical system model and instead, code up exactly what they need in nasal. The nasal approach is a lot more straight forward, much more flexible, more concise.
It's different though and I figured it would talk folks a little while to adapt to the new system, which is why we didn't just immediately yank the old code.
Long term, every one is going to be a lot better off if they code up their electrical systems in nasal. The c172 should have an example implementation that should be much easier to follow and understand than the xml based example.
In general, Nasal really isn't a bad approach. Many/most of the systems that are common among aircraft are modeled already in the FlightGear code, but things like gear failure and the specific failure modes, system dependencies, work arounds, procedures, etc. can get really aircraft specific. This is where Nasal is really slick. It's very small/tight, and amazingly capable for it's size. It gives you a high degree of programmability, and can be setup so it is specific to your aircraft.
For example, I'm working on a light twin project and one thing I've done recently is to model all the annunciators (similar to the dash board lights in your car.) I'm not aware of any FG airplanes that have annunciators modeled, but these are common in aircraft. We can do them quite easily, but I don't think any aircraft designers have looked into these yet.
For my project I have a couple nasal routines that compute some values derived from the existing properties. With nasal I can test the state of various FG properties, then set a fault/warning condition. In nasal, I can even blink the light for the first 10 seconds. I write the resulting properties into a separate subtree in the global property tree. Finally I created a custom gauge that is driven from these properties.
One thing I've found is that so many of our subsystem have so much configurability and power, you have to stop and think about the best place to impliment something. For instance I wanted a gear horn that would sound when you cut the throttle but the gear is still up. This can be done entirely in the sound configuration file with conditionals (which speaks a lot for the power of the audio subsystem.) Later though I decided I also wanted an annunciator light to give a visual warning of this same condition, so I moved the logic into a nasal routine. That way a single piece of code could drive both the audio and visual warnings rather than replicating the logic in multiple places.
The combination of nasal and configurable systems (with xml conditionals) give us an amazingly powerful system for modeling aircraft and systems. The more I work with these, the more impressed I am.
Retrieved from "https://wiki.flightgear.org/w/index.php?title=Howto:Systems_Modeling&oldid=66589"
Core development projects


There is an interesting OCS-related update coming to the Polycom HDX line of videoconference systems with the 2.6.1 release scheduled this quarter. First, a quick overview in case you're not familiar with the HDX product set. The most common use case for an HDX is as a room-based video conferencing system, such as the scenario depicted in the image below.
There are a number of characteristics that all HDX systems share. First, they can all act as native OCS endpoints. Specifically they can register to OCS, publish presence, show an OCS contact list (including presence and groups), and make/receive video (and audio) calls to other OCS clients. Second, all HDX systems are high definition (at least 720p and up to 1080p depending on the model). This high definition experience includes OCS-based calling scenarios between HDXs, meaning that I can call from my personal HDX 4000 at home to a conference room in one of our offices and receive an high definition experience, even though OCS doesn't have native support the for the H.264 codec being used in the call.
All that being said, the HDX is already a great complement to a Microsoft UC environment. However, Polycom is strengthening the capability of the HDX line by adding OCS-compatible ICE/STUN/TURN to the software.
If you're not already familiar with ICE, STUN, or TURN, there are plenty of resources on the internet that go into detail about these protocols. The quick overview is that these methodologies are used in conjunction with SIP to enable media (such as audio and video) to traverse firewall/NAT devices. If you've ever participated in a call to or from a Communicator client that was logged on via an OCS Edge server (from the internet without VPN), then you've used these protocols.
So what does adding ICE/STUN/TURN to HDX enable? First, it extends HDX calling scenarios to remote users rather than just Communicator clients within the organization or connected over VPN. Second, it enables HDXs outside the organization to register to OCS and participate in audio/video calls just like a Communicator client. Usually these external systems will be HDX 4000s, but it would also be useful for organizations that have internet-connected branch offices or in the medical industry when a consult with an external physician is required. Third, it enables federated scenarios whereby calls can be made between HDXs or MOC/HDX in separate organizations.
Because this connectivity only relies on the OCS Edge server, no additional infrastructure is required to support this capability. This is consistent with the rest of Polycom's OCS integration strategy, which leverages customers' existing OCS architecture rather than requiring additional gateways or other hardware.
Stay tuned for periodic Microsoft UC updates from Polycom in the quarters ahead – the integration between these two is only going to get stronger.
In case you're not familiar with the Polycom RMX, it's a platform of audio/video MCUs that can integrate with everything from voice PRIs to legacy video devices to the newest 1080p endpoints. Starting with version 4.1 (current version as of this writing is 5.0), it also supports integration with OCS. Specifically, OCS users can call into the RMX via audio or video by simply making a Communicator call to an RMX meeting room or entry point. The RMX can bridge those MOC users with other non-OCS SIP endpoints as well as H.323 endpoints. For more information on the RMX check out Polycom's website. While it's fairly easy to call a meeting room from Communicator by dialing it manually, for folks that use MOC in conjunction with RMX meeting rooms consistently it is desirable to have quick dial access to the rooms. An easy way to do this is using contact objects in Active Directory.
First, create a regular contact object in Active Directory. You can enter any information you'd like in the required fields, just be sure to make the Display Name match what you'd like your users to see in the OCS address book.
Enter the address in the format sip:<MeetingRoomID>@<RMXRoutingAddress>. For example: sip:1000@rmx.domain.com.
Because you've defined a SIP address for the contact, OCS will automatically add it to the address book. However, be aware that the address book only synchronizes every 24 hours at 1:30am local time (by default). You can force the address book to regenerate faster using the abserver –syncnow command. Be sure to allow time for AD replication before you run the address book synchronization. For more details on the address book see http://technet.microsoft.com/en-us/library/ee323612(office.13).aspx.
Once the address book has synchronized and your client has downloaded the updated address book file, you will be able to find the room by name in MOC. Since the RMX is not registering to OCS the presence will show as unknown, but assuming that your environment is configured correctly you will be able to make audio and video calls to that contact from the address book just like you can by manually typing in the SIP address.
Microsoft released a few updates last week for various components of OCS, from Group Chat to Phone Edition to the OCS Core and Communicator. While a few bugs were fixed with the Communicator update, one item that was not mentioned in the KB article was that this update adds functionality with Office 2010 64 bit. Previously Communicator would just throw an Outlook integration error, meaning that presence based on calendar, voicemail indicator, out of office, etc. did not work. Happily all of this has been fixed in the 3.5.6907.83 update.
Installation and configuration was fairly straight forward, only a few items to point out. First of all, here's the download link and link to documentation. Right now there's a missing link in the documentation for a UCMA update for Windows 2008 R2. That update is part of the 968802 package here. All you need for this integration is to apply the UCMARedist.msp update to your Exchange 2010 server.
An exception was thrown while attempting to load the IM provider .dll file.
The local certificate specified was not found in the store for local computer.
Property InstantMessagingType can't be set on this object because it requires the object to have version 0.10 (14.0.100.0) or later. The object's current version is 0.1 (8.0.535.0).
Lastly, the documentation doesn't seem to be complete in the "Configure Office Communications Server" section. You'll need to add the FQDN of the certificate that you specified in the web.config as a trusted host to your OCS environment. To do so, right click your pool and select Properties –> Front End Properties. Click the Host Authorization tab and then click Add. Add the FQDN of your CAS and check the "Throttle as server" and "Treat as authenticated" check boxes.
It will take a few minutes for your OCS front end(s) to pick up this change. Depending on your level of impatience (mine is high) You can force it by restarting the front end service but this will disconnect all your users from OCS, so do this with caution if you are working in a production environment.
That should do it. The entire process took about 5 minutes and works perfectly.
As you can see, we used primarily NET/Quintum gateways, with Direct SIP connections coming in at a close second.
Nothing surprising here, the PBX market leaders are reflected in our implementation stats as well.
I'm curious how our CallManager version integration breakdown matches up to Cisco's worldwide deployment percentages.
Now, some less data-specific observations. In general we saw faster voice adoption by organizations who a) were running an older PBX and b) had little to no call center staff. This manifested itself in a few ways – expanded pilot group, addition of capacity to voice components, and/or a more accelerated move to production. Not surprisingly smaller organizations were more likely to move towards production, which was typically because those organizations were more nimble and had a more manageable political environment.
As a consulting organization, predictability of the platform is a major consideration for us and has been a strong point of OCS to date. It allowed us to create a standard fixed price model for almost all our services, which in turn reduced customer's fear in moving to the platform since they knew we stood behind our work and would, if something went awry, share in their pain. Happily for both us and our customers this did not happen – all issues/complications/etc. were properly accounted for in the engagements and covered as expected by our pricing models.
So where does everything stand today? The obvious state of things related to voice is the lack of features as compared to traditional PBXs. This is no secret, and will largely be addressed in the OCS Wave 14 product which we're expecting to see in about a year. Despite some of these feature deficiencies, there are numerous organizations for whom we've helped deploy OCS as a replacement to one or more PBXs. By and large users need to be able to make/receive phone calls and subsequently forward, transfer, or conference those calls. OCS can easily handle all of that and display presence all the while. Reuse of existing telephony endpoints was a showstopper for a number of customers but the introduction of SmartSIP earlier this year had started to break down those deployment barriers.
What's missing is a better story for geographic redundancy for larger organizations. The recent resiliency white paper attempts to address some of that but the latency requirements are too stringent for most organizations, even those with deep pockets, since global organizations will likely have datacenters that are more than 15ms apart. Luckily I've been architecting around those shortfalls since the LCS days so there's not much we can't deal with as long as you can handle a ~15 minute outage in the event that one of your datacenters is completely destroyed. So far that has been viewed as a reasonable recovery time. However, I'm hoping that additional work is done to complete this story in Wave 14.
The other major missing items such as Mac/Linux support are already expected in Wave 14 so there's not much point to hash them out here. One thing I haven't heard much about but would really like to see is a better story around video integration. The lack of codec support in the MCU today is a severely limiting factor, and the recent announcement of Cisco to purchase Tandberg might make things difficult for Microsoft if Polycom is the only remaining integration partner.
Overall though one of the most difficult concepts to convey is the paradigm shift from "the phone on my desk" to integrated, presence-enabled communication. It's hugely powerful and Microsoft's vision and ambition to get there is right on target. The extensibility of the platform dramatically strengthens this vision. Every time we bring on a new customer that does not yet have OCS you realize how much easier your communication with existing OCS-enabled internal, partner, and customer contacts is.
Recently I was working on an issue where Tanjays (Polycom CX700 or LG-Nortel IP8540) would not update their firmware. There were a variety of issues but there was one in particular that I noticed some open questions about on the forums so I thought I'd share the solution.
The 500 error code is the relevant item here. When the RequestHandler receives a connection from the Tanjay it then connects to the WSS site that holds the firmware using the internal FQDN that was specified during the configuration of the UC Update Service. Originally the configuration was done with different internal and external FQDNs but when an external certificate was purchased for the WSS site the Alternate Access Mappings, which basically tell WSS which URLs to use, were configured only for the external FQDN since the thought was that only external users would be using the service. However, since the RequestHandler needs to access WSS with the internal FQDN the connections were failing.
The fix was pretty simple - always make sure that WSS is accessible by both the internal and external names that you specify in the configuration. I've attached a vbs script that you can run on your OCS web components server to view the URLs that are configured for the update service. There may be another place to see this info but it was easier to just use WMI to show these values rather than figure out the lcscmd syntax if in fact that's even possible. A quick review of the validation output indicated that these values are not listed there. Just rename the file from .txt to .vbs and run it with "cscript updsrvurls.vbs" from a command line and it will list the URLs associated with the update server configuration on that OCS server. You can also run it remotely by changing the strComputer = "." line to strComputer = "<yourocsfeinternalfqdn>".
Having been working with presence for some time now it's hard to remember a time when I didn't know in advance if a coworker or business partner was available before trying to contact them. Unfortunately there are people out there who are interested in obfuscating their availability, presumably to confuse people into not communicating with them. Most commonly people like this set their status to "Away" when they are really there. In the beginning it causes people not to communicate with them but over time people figure out that they may be there anyway, which eventually causes the more annoying situation of trying to communicate with someone who actually is away. It's not overly pleasant to always wonder if the person on the other end is available.
You'll find a lot of stored procedures here (aka stored procs) and if you browse through them you'll start to see how OCS works under the covers. It's very important not to modify any of the stored procs - doing so could cause major problems with OCS.
This will return a fair amount of data, as you can see below. The column we're interested in is the one titled Data.
Notice the difference between the availability of the userState and the machineState (15500 and 3500 respectively). 15500 represents an Away state whereas 3500 represents an Available state (see http://msdn.microsoft.com/en-us/library/bb878933.aspx for reference on the presence state integers). I can tell since the machineState is Available but the userState is Away and set to manual="true" that this user has manually set their presence to Away.
Admittedly it's not an elegant solution to finding this information. I may write a quick tab extension to show this right in Communicator but in the meantime it highlights the usefulness of the stored procs that you'll find in SQL. Thanks to Simon Booth, our UC developer extraordinaire for some insight on the presence data.
I also noticed on the test PC where I ran this that it was necessary to update Communicator to the July 2009 update (6907.37) for calling name to appear. When I was running the May update (6907.22) Communicator did not show the calling name.
For outbound calling name you will need to add the forwardDisplayName setting to the MediationServer.exe.config file. Details on this can be found here.
Last year I posted the process for updating the internal OCS URLs. From time to time I've found it necessary to do this for various reasons. Most commonly this is necessary if a customer does not have a reverse proxy in place and/or is not using a SAN certificate that includes both the external web farm FQDN as well as the pool FQDN.
The biggest difference with R2 is that you have to enter the WMI string in a query in order to find and edit it. This was done for performance reasons since enumerating all the instances of some classes can be a CPU-intensive operation.
Now, because of the changes in R2 we can't just find the class and click the Instances button like we used to. You need to run a WQL query to find the specific instance that you want to use. To do this, click the WQL Query button towards the top right of the window.
SELECT * from msft_sipaddressbooksetting where backend="evan-terra1\\rtc"
Double click that result and the properties will be displayed. This one area where CIM Studio is much easier to use than wbemtest. Simply modify the appropriate property (InternalURL in this case) and click the Save button.
Repeat this find/modify process for the class/property values that I mentioned at the beginning of the post and you will be all set.
Now in the right pane I can see at least a default.htm and an index.html file (if you don't see these select another <branch2> folder until you find one that contains them), right clicked, and selected the browse option.
Sure enough, that presented a 500.19 error in IE. An inspection of the IIS logs showed a number of these errors from my testing.
The views and opinions outlined within this blog are solely my own, and do not represent those of any organization. All technical procedures contained herein are provided without warranty of any kind. These procedures may or may not fall within the support guidelines of any company mentioned. If you have questions about the supportability of any information in this blog please contact the appropriate vendor.


What are the advantages of the AOIP public address system?
Home / Uncategorized / What are the advantages of the AOIP public address system?
What are the advantages of the AOIP public address system (PA system)?
It is not difficult to find that many things in our lives are now networked, and the network has been integrated into our lives and become an indispensable part of us. The traditional broadcasting method has gradually been eliminated, and the most popular one is the public address system. But there are still people who don't know much about public address (PA). Let's take a look at its advantages.
1 public address has realized digitalization and networkization from the production to transmission of the program. The system has high signal-to-noise ratio and will not generate noise in the process of processing and transmission, so that better sound quality can be obtained, and stereo transmission can also be performed.
2 It is easier to implement intelligent broadcasting. Ethernet itself is a two-way network. The timing, addressing, grouping and other functions of intelligent broadcasting can be easily realized by software on the Ethernet.
3 Multi-channel public address can be achieved when network speed allows. Since audio files are transmitted in the network in the form of data packets, it is easy to implement multi-channel broadcasting, and different data packets can be sent to different terminals.
4 Implement interactive mode broadcast and remote AOD. Because Ethernet is a two-way network, the control host can fully monitor the working status of each terminal and can control it. The terminal can also talk to the server through the LCD screen and directly order from the server, which greatly facilitates foreign language teaching.
5 Convenient management: The operator can realize all the management and operation functions of the host computer by any computer on the campus network, and can also realize the production and transmission of the program on any computer on the campus.


text:
Q: Safe use of a function that writes data after a pointer I have a function foo(void* buffer, size_t len) that calculates a hash from the data at buffer (of size len) and appends it at the end of buffer.
Usually I have a vector that I would pass to foo(&myVec[0], myVec.size())
How would I safely use this function with a vector? Resize it before passing it?
void foo(void* buffer, size_t len)
{
 if(buffer == NULL)
 {
  printf("Error\n");
  return;
 }
 std::vector<unsigned char> hash(128);
 gethash(buffer, len, &hash[0]);
 unsigned char *data = ((unsigned char*) buffer) + len;
 memcpy(data, &hash[0], hash.size());

}

A: Assuming the vector is a vector<char>, you could avoid all the messyness and do:
 void foo(vector<char>& buffer)
 {
      std::vector<unsigned char> hash(128);
      gethash(buffer.data(), buffer.size(), hash.data());
      buffer.resize(buffer.size()+hash.size();
      unsigned char *data = buffer.data() + buffer.size();
      memcpy(data, hash.data(), hash.size());
 }

This is still a bit "messy", but a lot less than the code you posted.
As suggested in the comments, something like:
     buffer.insert(buffer.end(), hash.begin(), hash.end());

is probably better than the last three lines I wrote.

A: You can't do it!
If bufferpoints to memory with given len you can't reallocate more memory at exact this place.
2 ways to deal with it:
The buffer comes already with enough size for data and hash, but I would prefer a struct for this solution!
or
Allocate new memory, copy data and hash value to it and return the pointer the new data memory. But don't forget to free this memory later and also the input memory.
The second solution can be done with a vector
void foo( vector<char> &vec )
{
...
    gethash(&vec[0], len, &hash[0]);
...

    vec.resize(...);  // reallocate and copy data if needed
    memcpy // which I do not want to use with a vector :-)

}

A resize of a vector results in allocating new memory and copy data from old to new memory and free the old buffer allocated. It is possible that the vector holds (much) more memory as expected so that no reallocation must happen. But how it behaves must not be known until speed is a criteria. But you can also create a vector with a minimum of internal size so that you prevent automatic allocation and copy.

A: You can do this before calling foo:
int main() {
    std::vector<int> buffer;
    size_t sz = buffer.size();
    size_t tsz = sizeof(decltype(buffer)::value_type);
    buffer.resize(128 /  tsz + buffer.size());
    foo(buffer.data(), sz * tsz);
    return 0;
}

A: You can do it like this:
void foo(vector<unsigned char>& data)
{
    if(data.empty())
        return;

    vector<unsigned char> result(128);
    gethash(&data[0], data.size(), &result[0]);
    data.insert(data.end(), result.begin(), result.end());
}

redpajama_set_name: RedPajamaStackExchange


HARRISBURG – Rep. Bryan Cutler (R-Peach Bottom) today cast his vote in favor of House Bill 1, known as the Fair Share Act, which would help bring about lawsuit abuse reform by abolishing the doctrine of joint and several liability, in most instances, and holding defendants in a lawsuit liable only for their fair share.
Under Pennsylvania law, a defendant who is only marginally responsible for a plaintiff's injuries can be held liable for 100 percent of the damages if the other defendants are unable to pay.
Cutler, who co-sponsored the legislation along with more than 60 other members of the House of Representatives, noted that the proposal has passed the General Assembly twice. It was first enacted in 2002, but the Supreme Court overturned the law on technical grounds. In 2006, it made it to the desk of former Gov. Ed Rendell only to be vetoed.
House Bill 1 passed in the House and now goes to the Senate for its consideration. Gov. Tom Corbett has indicated his support for the legislation.