The Art of War by Sun Tzu
Translated by Lionel Giles
Originally Published in 1910
Table of Contents
Chapter 1 - Laying Plans
-
Sun Tzu said: The art of war is of vital importance to the State.
-
It is a matter of life and death, a road either to safety or to ruin. Hence it is a subject of inquiry which can on no account be neglected.
-
The art of war, then, is governed by five constant factors, to be taken into account in one's deliberations, when seeking to determine the conditions obtaining in the field.
-
These are: (1) The Moral Law; (2) Heaven; (3) Earth; (4) The Commander; (5) Method and discipline.
-
The MORAL LAW causes the people to be in complete accord with their ruler, so that they will follow him regardless of their lives, undismayed by any danger.
-
HEAVEN signifies night and day, cold and heat, times and seasons.
-
EARTH comprises distances, great and small; danger and security; open ground and narrow passes; the chances of life and death.
-
The COMMANDER stands for the virtues of wisdom, sincerity, benevolence, courage and strictness.
-
By METHOD AND DISCIPLINE are to be understood the marshaling of the army in its proper subdivisions, the graduations of rank among the officers, the maintenance of roads by which supplies may reach the army, and the control of military expenditure.
-
These five heads should be familiar to every general: he who knows them will be victorious; he who knows them not will fail.
-
Therefore, in your deliberations, when seeking to determine the military conditions, let them be made the basis of a comparison, in this wise:
-
(1) Which of the two sovereigns is imbued with the Moral law? (2) Which of the two generals has most ability? (3) With whom lie the advantages derived from Heaven and Earth? (4) On which side is discipline most rigorously enforced? (5) Which army is stronger? (6) On which side are officers and men more highly trained? (7) In which army is there the greater constancy both in reward and punishment?
-
By means of these seven considerations I can forecast victory or defeat.
-
The general that hearkens to my counsel and acts upon it, will conquer: let such a one be retained in command! The general that hearkens not to my counsel nor acts upon it, will suffer defeat: let such a one be dismissed!
-
While heeding the profit of my counsel, avail yourself also of any helpful circumstances over and beyond the ordinary rules.
-
According as circumstances are favorable, one should modify one's plans.
-
All warfare is based on deception.
-
Hence, when able to attack, we must seem unable; when using our forces, we must seem inactive; when we are near, we must make the enemy believe we are far away; when far away, we must make him believe we are near.
-
Hold out baits to entice the enemy. Feign disorder, and crush him.
-
If he is secure at all points, be prepared for him. If he is in superior strength, evade him.
-
If your opponent is of choleric temper, seek to irritate him. Pretend to be weak, that he may grow arrogant.
-
If he is taking his ease, give him no rest. If his forces are united, separate them.
-
Attack him where he is unprepared, appear where you are not expected.
-
These military devices, leading to victory, must not be divulged beforehand.
-
Now the general who wins a battle makes many calculations in his temple ere the battle is fought. The general who loses a battle makes but few calculations beforehand. Thus do many calculations lead to victory, and few calculations to defeat: how much more no calculation at all! It is by attention to this point that I can foresee who is likely to win or lose.
Chapter 2 - Waging War
-
Sun Tzu said: In the operations of war, where there are in the field a thousand swift chariots, as many heavy chariots, and a hundred thousand mail-clad soldiers, with provisions enough to carry them a thousand LI, the expenditure at home and at the front, including entertainment of guests, small items such as glue and paint, and sums spent on chariots and armor, will reach the total of a thousand ounces of silver per day. Such is the cost of raising an army of 100,000 men.
-
When you engage in actual fighting, if victory is long in coming, then men's weapons will grow dull and their ardor will be damped. If you lay siege to a town, you will exhaust your strength.
-
Again, if the campaign is protracted, the resources of the State will not be equal to the strain.
 Then no man, however wise, will be able to avert the consequences that must ensue.

-
There is no instance of a country having benefited from prolonged warfare.
-
It is only one who is thoroughly acquainted with the evils of war that can thoroughly understand the profitable way of carrying it on.
-
The skillful soldier does not raise a second levy, neither are his supply-wagons loaded more than twice.
-
Bring war material with you from home, but forage on the enemy. Thus the army will have food enough for its needs.
-
Poverty of the State exchequer causes an army to be maintained by contributions from a distance. Contributing to maintain an army at a distance causes the people to be impoverished.
-
On the other hand, the proximity of an army causes prices to go up; and high prices cause the people's substance to be drained away.
-
When their substance is drained away, the peasantry will be afflicted by heavy exactions.
-
With this loss of substance and exhaustion of strength, the homes of the people will be stripped bare, and three-tenths of their income will be dissipated; while government expenses for broken chariots, worn-out horses, breast-plates and helmets, bows and arrows, spears and shields, protective mantles, draught-oxen and heavy wagons, will amount to four-tenths of its total revenue.
-
Hence a wise general makes a point of foraging on the enemy. One cartload of the enemy's provisions is equivalent to twenty of one's own, and likewise a single PICUL of his provender is equivalent to twenty from one's own store.
-
Now in order to kill the enemy, our men must be roused to anger; that there may be advantage from defeating the enemy, they must have their rewards.
-
Therefore in chariot fighting, when ten or more chariots have been taken, those should be rewarded who took the first. Our own flags should be substituted for those of the enemy, and the chariots mingled and used in conjunction with ours. The captured soldiers should be kindly treated and kept.
-
This is called, using the conquered foe to augment one's own strength.
-
In war, then, let your great object be victory, not lengthy campaigns.
-
Thus it may be known that the leader of armies is the arbiter of the people's fate, the man on whom it depends whether the nation shall be in peace or in peril.
Chapter 3 - Attack by Strategem
-
Sun Tzu said: In the practical art of war, the best thing of all is to take the enemy's country whole and intact; to shatter and destroy it is not so good. So, too, it is better to recapture an army entire than to destroy it, to capture a regiment, a detachment or a company entire than to destroy them.
-
Hence to fight and conquer in all your battles is not supreme excellence; supreme excellence consists in breaking the enemy's resistance without fighting.
-
Thus the highest form of generalship is to balk the enemy's plans; the next best is to prevent the junction of the enemy's forces; the next in order is to attack the enemy's army in the field; and the worst policy of all is to besiege walled cities.
-
The rule is, not to besiege walled cities if it can possibly be avoided. The preparation of mantlets, movable shelters, and various implements of war, will take up three whole months; and the piling up of mounds over against the walls will take three months more.
-
The general, unable to control his irritation, will launch his men to the assault like swarming ants, with the result that one-third of his men are slain, while the town still remains untaken. Such are the disastrous effects of a siege.
-
Therefore the skillful leader subdues the enemy's troops without any fighting; he captures their cities without laying siege to them; he overthrows their kingdom without lengthy operations in the field.
-
With his forces intact he will dispute the mastery of the Empire, and thus, without losing a man, his triumph will be complete. This is the method of attacking by stratagem.
-
It is the rule in war, if our forces are ten to the enemy's one, to surround him; if five to one, to attack him; if twice as numerous, to divide our army into two.
-
If equally matched, we can offer battle; if slightly inferior in numbers, we can avoid the enemy; if quite unequal in every way, we can flee from him.
-
Hence, though an obstinate fight may be made by a small force, in the end it must be captured by the larger force.
-
Now the general is the bulwark of the State; if the bulwark is complete at all points; the State will be strong; if the bulwark is defective, the State will be weak.
-
There are three ways in which a ruler can bring misfortune upon his army:
-
(1) By commanding the army to advance or to retreat, being ignorant of the fact that it cannot obey. This is called hobbling the army.
-
(2) By attempting to govern an army in the same way as he administers a kingdom, being ignorant of the conditions which obtain in an army. This causes restlessness in the soldier's minds.
-
(3) By employing the officers of his army without discrimination, through ignorance of the military principle of adaptation to circumstances. This shakes the confidence of the soldiers.
-
But when the army is restless and distrustful, trouble is sure to come from the other feudal princes. This is simply bringing anarchy into the army, and flinging victory away.
-
Thus we may know that there are five essentials for victory: (1) He will win who knows when to fight and when not to fight. (2) He will win who knows how to handle both superior and inferior forces. (3) He will win whose army is animated by the same spirit throughout all its ranks. (4) He will win who, prepared himself, waits to take the enemy unprepared. (5) He will win who has military capacity and is not interfered with by the sovereign.
-
Hence the saying: If you know the enemy and know yourself, you need not fear the result of a hundred battles. If you know yourself but not the enemy, for every victory gained you will also suffer a defeat. If you know neither the enemy nor yourself, you will succumb in every battle.
Chapter 4 - Tactical Dispositions
-
Sun Tzu said: The good fighters of old first put themselves beyond the possibility of defeat, and then waited for an opportunity of defeating the enemy.
-
To secure ourselves against defeat lies in our own hands, but the opportunity of defeating the enemy is provided by the enemy himself.
-
Thus the good fighter is able to secure himself against defeat, but cannot make certain of defeating the enemy.
-
Hence the saying: One may KNOW how to conquer without being able to DO it.
-
Security against defeat implies defensive tactics; ability to defeat the enemy means taking the offensive.
-
Standing on the defensive indicates insufficient strength; attacking, a superabundance of strength.
-
The general who is skilled in defense hides in the most secret recesses of the earth; he who is skilled in attack flashes forth from the topmost heights of heaven. Thus on the one hand we have ability to protect ourselves; on the other, a victory that is complete.
-
To see victory only when it is within the ken of the common herd is not the acme of excellence.
-
Neither is it the acme of excellence if you fight and conquer and the whole Empire says, "Well done!"
-
To lift an autumn hair is no sign of great strength; to see the sun and moon is no sign of sharp sight; to hear the noise of thunder is no sign of a quick ear.
-
What the ancients called a clever fighter is one who not only wins, but excels in winning with ease.
-
Hence his victories bring him neither reputation for wisdom nor credit for courage.
-
He wins his battles by making no mistakes. Making no mistakes is what establishes the certainty of victory, for it means conquering an enemy that is already defeated.
-
Hence the skillful fighter puts himself into a position which makes defeat impossible, and does not miss the moment for defeating the enemy.
-
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.
-
The consummate leader cultivates the moral law, and strictly adheres to method and discipline; thus it is in his power to control success.
-
In respect of military method, we have, firstly, Measurement; secondly, Estimation of quantity; thirdly, Calculation; fourthly, Balancing of chances; fifthly, Victory.
-
Measurement owes its existence to Earth; Estimation of quantity to Measurement; Calculation to Estimation of quantity; Balancing of chances to Calculation; and Victory to Balancing of chances.
-
A victorious army opposed to a routed one, is as a pound's weight placed in the scale against a single grain.
-
The onrush of a conquering force is like the bursting of pent- up waters into a chasm a thousand fathoms deep.
Chapter 5 - Energy
-
Sun Tzu said: The control of a large force is the same principle as the control of a few men: it is merely a question of dividing up their numbers.
-
Fighting with a large army under your command is nowise different from fighting with a small one: it is merely a question of instituting signs and signals.
-
To ensure that your whole host may withstand the brunt of the enemy's attack and remain unshaken---this is effected by maneuvers direct and indirect.
-
That the impact of your army may be like a grindstone dashed against an egg---this is effected by the science of weak points and strong.
-
In all fighting, the direct method may be used for joining battle, but indirect methods will be needed in order to secure victory.
-
Indirect tactics, efficiently applied, are inexhaustible as Heaven and Earth, unending as the flow of rivers and streams; like the sun and moon, they end but to begin anew; like the four seasons, they pass away to return once more.
-
There are not more than five musical notes, yet the combinations of these five give rise to more melodies than can ever be heard.
-
There are not more than five primary colors (blue, yellow, red, white, and black), yet in combination they produce more hues than can ever been seen.
-
There are not more than five cardinal tastes (sour, acrid, salt, sweet, bitter), yet combinations of them yield more flavors than can ever be tasted.
-
In battle, there are not more than two methods of attack: the direct and the indirect; yet these two in combination give rise to an endless series of maneuvers.
-
The direct and the indirect lead on to each other in turn. It is like moving in a circle---you never come to an end. Who can exhaust the possibilities of their combination?
-
The onset of troops is like the rush of a torrent which will even roll stones along in its course.
-
The quality of decision is like the well-timed swoop of a falcon which enables it to strike and destroy its victim.
-
Therefore the good fighter will be terrible in his onset, and prompt in his decision.
-
Energy may be likened to the bending of a crossbow; decision, to the releasing of a trigger.
-
Amid the turmoil and tumult of battle, there may be seeming disorder and yet no real disorder at all; amid confusion and chaos, your array may be without head or tail, yet it will be proof against defeat.
-
Simulated disorder postulates perfect discipline, simulated fear postulates courage; simulated weakness postulates strength.
-
Hiding order beneath the cloak of disorder is simply a question of subdivision; concealing courage under a show of timidity presupposes a fund of latent energy; masking strength with weakness is to be effected by tactical dispositions.
-
Thus one who is skillful at keeping the enemy on the move maintains deceitful appearances, according to which the enemy will act. He sacrifices something, that the enemy may snatch at it.
-
By holding out baits, he keeps him on the march; then with a body of picked men he lies in wait for him.
-
The clever combatant looks to the effect of combined energy, and does not require too much from individuals. Hence his ability to pick out the right men and utilize combined energy.
-
When he utilizes combined energy, his fighting men become as it were like unto rolling logs or stones. For it is the nature of a log or stone to remain motionless on level ground, and to move when on a slope; if four-cornered, to come to a standstill, but if round-shaped, to go rolling down.
-
Thus the energy developed by good fighting men is as the momentum of a round stone rolled down a mountain thousands of feet in height. So much on the subject of energy.
Chapter 6 - Weak Points and Strong
-
Sun Tzu said: Whoever is first in the field and awaits the coming of the enemy, will be fresh for the fight; whoever is second in the field and has to hasten to battle will arrive exhausted.
-
Therefore the clever combatant imposes his will on the enemy, but does not allow the enemy's will to be imposed on him.
-
By holding out advantages to him, he can cause the enemy to approach of his own accord; or, by inflicting damage, he can make it impossible for the enemy to draw near.
-
If the enemy is taking his ease, he can harass him; if well supplied with food, he can starve him out; if quietly encamped, he can force him to move.
-
Appear at points which the enemy must hasten to defend; march swiftly to places where you are not expected.
-
An army may march great distances without distress, if it marches through country where the enemy is not.
-
You can be sure of succeeding in your attacks if you only attack places which are undefended. You can ensure the safety of your defense if you only hold positions that cannot be attacked.
-
Hence that general is skillful in attack whose opponent does not know what to defend; and he is skillful in defense whose opponent does not know what to attack.
-
O divine art of subtlety and secrecy! Through you we learn to be invisible, through you inaudible; and hence we can hold the enemy's fate in our hands.
-
You may advance and be absolutely irresistible, if you make for the enemy's weak points; you may retire and be safe from pursuit if your movements are more rapid than those of the enemy.
-
If we wish to fight, the enemy can be forced to an engagement even though he be sheltered behind a high rampart and a deep ditch. All we need do is attack some other place that he will be obliged to relieve.
-
If we do not wish to fight, we can prevent the enemy from engaging us even though the lines of our encampment be merely traced out on the ground. All we need do is to throw something odd and unaccountable in his way.
-
By discovering the enemy's dispositions and remaining invisible ourselves, we can keep our forces concentrated, while the enemy's must be divided.
-
We can form a single united body, while the enemy must split up into fractions. Hence there will be a whole pitted against separate parts of a whole, which means that we shall be many to the enemy's few.
-
And if we are able thus to attack an inferior force with a superior one, our opponents will be in dire straits.
-
The spot where we intend to fight must not be made known; for then the enemy will have to prepare against a possible attack at several different points; and his forces being thus distributed in many directions, the numbers we shall have to face at any given point will be proportionately few.
-
For should the enemy strengthen his van, he will weaken his rear; should he strengthen his rear, he will weaken his van; should he strengthen his left, he will weaken his right; should he strengthen his right, he will weaken his left. If he sends reinforcements everywhere, he will everywhere be weak.
-
Numerical weakness comes from having to prepare against possible attacks; numerical strength, from compelling our adversary to make these preparations against us.
-
Knowing the place and the time of the coming battle, we may concentrate from the greatest distances in order to fight.
-
But if neither time nor place be known, then the left wing will be impotent to succor the right, the right equally impotent to succor the left, the van unable to relieve the rear, or the rear to support the van. How much more so if the furthest portions of the army are anything under a hundred LI apart, and even the nearest are separated by several LI!
-
Though according to my estimate the soldiers of Yueh exceed our own in number, that shall advantage them nothing in the matter of victory. I say then that victory can be achieved.
-
Though the enemy be stronger in numbers, we may prevent him from fighting. Scheme so as to discover his plans and the likelihood of their success.
-
Rouse him, and learn the principle of his activity or inactivity. Force him to reveal himself, so as to find out his vulnerable spots.
-
Carefully compare the opposing army with your own, so that you may know where strength is superabundant and where it is deficient.
-
In making tactical dispositions, the highest pitch you can attain is to conceal them; conceal your dispositions, and you will be safe from the prying of the subtlest spies, from the machinations of the wisest brains.
-
How victory may be produced for them out of the enemy's own tactics---that is what the multitude cannot comprehend.
-
All men can see the tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved.
-
Do not repeat the tactics which have gained you one victory, but let your methods be regulated by the infinite variety of circumstances.
-
Military tactics are like unto water; for water in its natural course runs away from high places and hastens downwards.
-
So in war, the way is to avoid what is strong and to strike at what is weak.
-
Water shapes its course according to the nature of the ground over which it flows; the soldier works out his victory in relation to the foe whom he is facing.
-
Therefore, just as water retains no constant shape, so in warfare there are no constant conditions.
-
He who can modify his tactics in relation to his opponent and thereby succeed in winning, may be called a heaven-born captain.
-
The five elements (water, fire, wood, metal, earth) are not always equally predominant; the four seasons make way for each other in turn. There are short days and long; the moon has its periods of waning and waxing.
Chapter 7 - Maneuvering
-
Sun Tzu said: In war, the general receives his commands from the sovereign.
-
Having collected an army and concentrated his forces, he must blend and harmonize the different elements thereof before pitching his camp.
-
After that, comes tactical maneuvering, than which there is nothing more difficult. The difficulty of tactical maneuvering consists in turning the devious into the direct, and misfortune into gain.
-
Thus, to take a long and circuitous route, after enticing the enemy out of the way, and though starting after him, to contrive to reach the goal before him, shows knowledge of the artifice of DEVIATION.
-
Maneuvering with an army is advantageous; with an undisciplined multitude, most dangerous.
-
If you set a fully equipped army in march in order to snatch an advantage, the chances are that you will be too late. On the other hand, to detach a flying column for the purpose involves the sacrifice of its baggage and stores.
-
Thus, if you order your men to roll up their buff-coats, and make forced marches without halting day or night, covering double the usual distance at a stretch, doing a hundred LI in order to wrest an advantage, the leaders of all your three divisions will fall into the hands of the enemy.
-
The stronger men will be in front, the jaded ones will fall behind, and on this plan only one-tenth of your army will reach its destination.
-
If you march fifty LI in order to outmaneuver the enemy, you will lose the leader of your first division, and only half your force will reach the goal.
-
If you march thirty LI with the same object, two-thirds of your army will arrive.
-
We may take it then that an army without its baggage train is lost; without provisions it is lost; without bases of supply it is lost.
-
We cannot enter into alliances until we are acquainted with the designs of our neighbors.
-
We are not fit to lead an army on the march unless we are familiar with the face of the country---its mountains and forests, its pitfalls and precipices, its marshes and swamps.
-
We shall be unable to turn natural advantage to account unless we make use of local guides.
-
In war, practice dissimulation, and you will succeed.
-
Whether to concentrate or to divide your troops, must be decided by circumstances.
-
Let your rapidity be that of the wind, your compactness that of the forest.
-
In raiding and plundering be like fire, in immovability like a mountain.
-
Let your plans be dark and impenetrable as night, and when you move, fall like a thunderbolt.
-
When you plunder a countryside, let the spoil be divided amongst your men; when you capture new territory, cut it up into allotments for the benefit of the soldiery.
-
Ponder and deliberate before you make a move.
-
He will conquer who has learnt the artifice of deviation. Such is the art of maneuvering.
-
The Book of Army Management says: On the field of battle, the spoken word does not carry far enough: hence the institution of gongs and drums. Nor can ordinary objects be seen clearly enough: hence the institution of banners and flags.
-
Gongs and drums, banners and flags, are means whereby the ears and eyes of the host may be focused on one particular point.
-
The host thus forming a single united body, is it impossible either for the brave to advance alone, or for the cowardly to retreat alone. This is the art of handling large masses of men.
-
In night-fighting, then, make much use of signal-fires and drums, and in fighting by day, of flags and banners, as a means of influencing the ears and eyes of your army.
-
A whole army may be robbed of its spirit; a commander-in- chief may be robbed of his presence of mind.
-
Now a soldier's spirit is keenest in the morning; by noonday it has begun to flag; and in the evening, his mind is bent only on returning to camp.
-
A clever general, therefore, avoids an army when its spirit is keen, but attacks it when it is sluggish and inclined to return. This is the art of studying moods.
-
Disciplined and calm, to await the appearance of disorder and hubbub amongst the enemy:---this is the art of retaining self- possession.
-
To be near the goal while the enemy is still far from it, to wait at ease while the enemy is toiling and struggling, to be well-fed while the enemy is famished:---this is the art of husbanding one's strength.
-
To refrain from intercepting an enemy whose banners are in perfect order, to refrain from attacking an army drawn up in calm and confident array:---this is the art of studying circumstances.
-
It is a military axiom not to advance uphill against the enemy, nor to oppose him when he comes downhill.
-
Do not pursue an enemy who simulates flight; do not attack soldiers whose temper is keen.
-
Do not swallow bait offered by the enemy. Do not interfere with an army that is returning home.
-
When you surround an army, leave an outlet free. Do not press a desperate foe too hard.
-
Such is the art of warfare.
Chapter 8 - Variation in Tactics
-
Sun Tzu said: In war, the general receives his commands from the sovereign, collects his army and concentrates his forces.
-
When in difficult country, do not encamp. In country where high roads intersect, join hands with your allies. Do not linger in dangerously isolated positions. In hemmed-in situations, you must resort to stratagem. In desperate position, you must fight.
-
There are roads which must not be followed, armies which must be not attacked, towns which must not be besieged, positions which must not be contested, commands of the sovereign which must not be obeyed.
-
The general who thoroughly understands the advantages that accompany variation of tactics knows how to handle his troops.
-
The general who does not understand these, may be well acquainted with the configuration of the country, yet he will not be able to turn his knowledge to practical account.
-
So, the student of war who is unversed in the art of war of varying his plans, even though he be acquainted with the Five Advantages, will fail to make the best use of his men.
-
Hence in the wise leader's plans, considerations of advantage and of disadvantage will be blended together.
-
If our expectation of advantage be tempered in this way, we may succeed in accomplishing the essential part of our schemes.
-
If, on the other hand, in the midst of difficulties we are always ready to seize an advantage, we may extricate ourselves from misfortune.
-
Reduce the hostile chiefs by inflicting damage on them; and make trouble for them, and keep them constantly engaged; hold out specious allurements, and make them rush to any given point.
-
The art of war teaches us to rely not on the likelihood of the enemy's not coming, but on our own readiness to receive him; not on the chance of his not attacking, but rather on the fact that we have made our position unassailable.
-
There are five dangerous faults which may affect a general: (1) Recklessness, which leads to destruction; (2) cowardice, which leads to capture; (3) a hasty temper, which can be provoked by insults; (4) a delicacy of honor which is sensitive to shame; (5) over-solicitude for his men, which exposes him to worry and trouble.
-
These are the five besetting sins of a general, ruinous to the conduct of war.
-
When an army is overthrown and its leader slain, the cause will surely be found among these five dangerous faults. Let them be a subject of meditation.
Chapter 9 - The Army on the March
-
Sun Tzu said: We come now to the question of encamping the army, and observing signs of the enemy. Pass quickly over mountains, and keep in the neighborhood of valleys.
-
Camp in high places, facing the sun. Do not climb heights in order to fight. So much for mountain warfare.
-
After crossing a river, you should get far away from it.
-
When an invading force crosses a river in its onward march, do not advance to meet it in mid-stream. It will be best to let half the army get across, and then deliver your attack.
-
If you are anxious to fight, you should not go to meet the invader near a river which he has to cross.
-
Moor your craft higher up than the enemy, and facing the sun. Do not move up-stream to meet the enemy. So much for river warfare.
-
In crossing salt-marshes, your sole concern should be to get over them quickly, without any delay.
-
If forced to fight in a salt-marsh, you should have water and grass near you, and get your back to a clump of trees. So much for operations in salt-marches.
-
In dry, level country, take up an easily accessible position with rising ground to your right and on your rear, so that the danger may be in front, and safety lie behind. So much for campaigning in flat country.
-
These are the four useful branches of military knowledge which enabled the Yellow Emperor to vanquish four several sovereigns.
-
All armies prefer high ground to low. and sunny places to dark.
-
If you are careful of your men, and camp on hard ground, the army will be free from disease of every kind, and this will spell victory.
-
When you come to a hill or a bank, occupy the sunny side, with the slope on your right rear. Thus you will at once act for the benefit of your soldiers and utilize the natural advantages of the ground.
-
When, in consequence of heavy rains up-country, a river which you wish to ford is swollen and flecked with foam, you must wait until it subsides.
-
Country in which there are precipitous cliffs with torrents running between, deep natural hollows, confined places, tangled thickets, quagmires and crevasses, should be left with all possible speed and not approached.
-
While we keep away from such places, we should get the enemy to approach them; while we face them, we should let the enemy have them on his rear.
-
If in the neighborhood of your camp there should be any hilly country, ponds surrounded by aquatic grass, hollow basins filled with reeds, or woods with thick undergrowth, they must be carefully routed out and searched; for these are places where men in ambush or insidious spies are likely to be lurking.
-
When the enemy is close at hand and remains quiet, he is relying on the natural strength of his position.
-
When he keeps aloof and tries to provoke a battle, he is anxious for the other side to advance.
-
If his place of encampment is easy of access, he is tendering a bait.
-
Movement amongst the trees of a forest shows that the enemy is advancing. The appearance of a number of screens in the midst of thick grass means that the enemy wants to make us suspicious.
-
The rising of birds in their flight is the sign of an ambuscade. Startled beasts indicate that a sudden attack is coming.
-
When there is dust rising in a high column, it is the sign of chariots advancing; when the dust is low, but spread over a wide area, it betokens the approach of infantry. When it branches out in different directions, it shows that parties have been sent to collect firewood. A few clouds of dust moving to and fro signify that the army is encamping.
-
Humble words and increased preparations are signs that the enemy is about to advance. Violent language and driving forward as if to the attack are signs that he will retreat.
-
When the light chariots come out first and take up a position on the wings, it is a sign that the enemy is forming for battle.
-
Peace proposals unaccompanied by a sworn covenant indicate a plot.
-
When there is much running about and the soldiers fall into rank, it means that the critical moment has come.
-
When some are seen advancing and some retreating, it is a lure.
-
When the soldiers stand leaning on their spears, they are faint from want of food.
-
If those who are sent to draw water begin by drinking themselves, the army is suffering from thirst.
-
If the enemy sees an advantage to be gained and makes no effort to secure it, the soldiers are exhausted.
-
If birds gather on any spot, it is unoccupied. Clamor by night betokens nervousness.
-
If there is disturbance in the camp, the general's authority is weak. If the banners and flags are shifted about, sedition is afoot. If the officers are angry, it means that the men are weary.
-
When an army feeds its horses with grain and kills its cattle for food, and when the men do not hang their cooking-pots over the camp fires, showing that they will not return to their tents, you may know that they are determined to fight to the death.
-
The sight of men whispering together in small knots or speaking in subdued tones points to disaffection amongst the rank and file.
-
Too frequent rewards signify that the enemy is at the end of his resources; too many punishments betray a condition of dire distress.
-
To begin by bluster, but afterwards to take fright at the enemy's numbers, shows a supreme lack of intelligence.
-
When envoys are sent with compliments in their mouths, it is a sign that the enemy wishes for a truce.
-
If the enemy's troops march up angrily and remain facing ours for a long time without either joining battle or taking themselves off again, the situation is one that demands great vigilance and circumspection.
-
If our troops are no more in number than the enemy, that is amply sufficient; it only means that no direct attack can be made. What we can do is simply to concentrate all our available strength, keep a close watch on the enemy, and obtain reinforcements.
-
He who exercises no forethought but makes light of his opponents is sure to be captured by them.

-
Therefore soldiers must be treated in the first instance with humanity, but kept under control by means of iron discipline. This is a certain road to victory.
-
If in training soldiers commands are habitually enforced, the army will be well-disciplined; if not, its discipline will be bad.
-
If a general shows confidence in his men but always insists on his orders being obeyed, the gain will be mutual.
Chapter 10 - Terrain
-
Sun Tzu said: We may distinguish six kinds of terrain, to wit: (1) Accessible ground; (2) entangling ground; (3) temporizing ground; (4) narrow passes; (5) precipitous heights; (6) positions at a great distance from the enemy.
-
Ground which can be freely traversed by both sides is called ACCESSIBLE.
-
With regard to ground of this nature, be before the enemy in occupying the raised and sunny spots, and carefully guard your line of supplies. Then you will be able to fight with advantage.
-
Ground which can be abandoned but is hard to re-occupy is called ENTANGLING.
-
From a position of this sort, if the enemy is unprepared, you may sally forth and defeat him. But if the enemy is prepared for your coming, and you fail to defeat him, then, return being impossible, disaster will ensue.
-
When the position is such that neither side will gain by making the first move, it is called TEMPORIZING ground.
-
In a position of this sort, even though the enemy should offer us an attractive bait, it will be advisable not to stir forth, but rather to retreat, thus enticing the enemy in his turn; then, when part of his army has come out, we may deliver our attack with advantage.
-
With regard to NARROW PASSES, if you can occupy them first, let them be strongly garrisoned and await the advent of the enemy.
-
Should the army forestall you in occupying a pass, do not go after him if the pass is fully garrisoned, but only if it is weakly garrisoned.
-
With regard to PRECIPITOUS HEIGHTS, if you are beforehand with your adversary, you should occupy the raised and sunny spots, and there wait for him to come up.
-
If the enemy has occupied them before you, do not follow him, but retreat and try to entice him away.
-
If you are situated at a great distance from the enemy, and the strength of the two armies is equal, it is not easy to provoke a battle, and fighting will be to your disadvantage.
-
These six are the principles connected with Earth. The general who has attained a responsible post must be careful to study them.
-
Now an army is exposed to six several calamities, not arising from natural causes, but from faults for which the general is responsible. These are: (1) Flight; (2) insubordination; (3) collapse; (4) ruin; (5) disorganization; (6) rout.
-
Other conditions being equal, if one force is hurled against another ten times its size, the result will be the FLIGHT of the former.
-
When the common soldiers are too strong and their officers too weak, the result is INSUBORDINATION. When the officers are too strong and the common soldiers too weak, the result is COLLAPSE.
-
When the higher officers are angry and insubordinate, and on meeting the enemy give battle on their own account from a feeling of resentment, before the commander-in-chief can tell whether or no he is in a position to fight, the result is RUIN.
-
When the general is weak and without authority; when his orders are not clear and distinct; when there are no fixes duties assigned to officers and men, and the ranks are formed in a slovenly haphazard manner, the result is utter DISORGANIZATION.
-
When a general, unable to estimate the enemy's strength, allows an inferior force to engage a larger one, or hurls a weak detachment against a powerful one, and neglects to place picked soldiers in the front rank, the result must be ROUT.
-
These are six ways of courting defeat, which must be carefully noted by the general who has attained a responsible post.
-
The natural formation of the country is the soldier's best ally; but a power of estimating the adversary, of controlling the forces of victory, and of shrewdly calculating difficulties, dangers and distances, constitutes the test of a great general.
-
He who knows these things, and in fighting puts his knowledge into practice, will win his battles. He who knows them not, nor practices them, will surely be defeated.
-
If fighting is sure to result in victory, then you must fight, even though the ruler forbid it; if fighting will not result in victory, then you must not fight even at the ruler's bidding.
-
The general who advances without coveting fame and retreats without fearing disgrace, whose only thought is to protect his country and do good service for his sovereign, is the jewel of the kingdom.

-
If, however, you are indulgent, but unable to make your authority felt; kind-hearted, but unable to enforce your commands; and incapable, moreover, of quelling disorder: then your soldiers must be likened to spoilt children; they are useless for any practical purpose.
-
If we know that our own men are in a condition to attack, but are unaware that the enemy is not open to attack, we have gone only halfway towards victory.
-
If we know that the enemy is open to attack, but are unaware that our own men are not in a condition to attack, we have gone only halfway towards victory.
-
If we know that the enemy is open to attack, and also know that our men are in a condition to attack, but are unaware that the nature of the ground makes fighting impracticable, we have still gone only halfway towards victory.
-
Hence the experienced soldier, once in motion, is never bewildered; once he has broken camp, he is never at a loss.
-
Hence the saying: If you know the enemy and know yourself, your victory will not stand in doubt; if you know Heaven and know Earth, you may make your victory complete.
Chapter 11 - The Nine Situations
-
Sun Tzu said: The art of war recognizes nine varieties of ground: (1) Dispersive ground; (2) facile ground; (3) contentious ground; (4) open ground; (5) ground of intersecting highways; (6) serious ground; (7) difficult ground; (8) hemmed-in ground; (9) desperate ground.
-
When a chieftain is fighting in his own territory, it is dispersive ground.
-
When he has penetrated into hostile territory, but to no great distance, it is facile ground.
-
Ground the possession of which imports great advantage to either side, is contentious ground.
-
Ground on which each side has liberty of movement is open ground.
-
Ground which forms the key to three contiguous states, so that he who occupies it first has most of the Empire at his command, is a ground of intersecting highways.
-
When an army has penetrated into the heart of a hostile country, leaving a number of fortified cities in its rear, it is serious ground.
-
Mountain forests, rugged steeps, marshes and fens---all country that is hard to traverse: this is difficult ground.
-
Ground which is reached through narrow gorges, and from which we can only retire by tortuous paths, so that a small number of the enemy would suffice to crush a large body of our men: this is hemmed in ground.
-
Ground on which we can only be saved from destruction by fighting without delay, is desperate ground.
-
On dispersive ground, therefore, fight not. On facile ground, halt not. On contentious ground, attack not.
-
On open ground, do not try to block the enemy's way. On the ground of intersecting highways, join hands with your allies.
-
On serious ground, gather in plunder. In difficult ground, keep steadily on the march.
-
On hemmed-in ground, resort to stratagem. On desperate ground, fight.
-
Those who were called skillful leaders of old knew how to drive a wedge between the enemy's front and rear; to prevent co-operation between his large and small divisions; to hinder the good troops from rescuing the bad, the officers from rallying their men.
-
When the enemy's men were united, they managed to keep them in disorder.
-
When it was to their advantage, they made a forward move; when otherwise, they stopped still.
-
If asked how to cope with a great host of the enemy in orderly array and on the point of marching to the attack, I should say: "Begin by seizing something which your opponent holds dear; then he will be amenable to your will."
-
Rapidity is the essence of war: take advantage of the enemy's unreadiness, make your way by unexpected routes, and attack unguarded spots.
-
The following are the principles to be observed by an invading force: The further you penetrate into a country, the greater will be the solidarity of your troops, and thus the defenders will not prevail against you.
-
Make forays in fertile country in order to supply your army with food.
-
Carefully study the well-being of your men, and do not overtax them. Concentrate your energy and hoard your strength. Keep your army continually on the move, and devise unfathomable plans.
-
Throw your soldiers into positions whence there is no escape, and they will prefer death to flight. If they will face death, there is nothing they may not achieve. Officers and men alike will put forth their uttermost strength.
-
Soldiers when in desperate straits lose the sense of fear. If there is no place of refuge, they will stand firm. If they are in hostile country, they will show a stubborn front. If there is no help for it, they will fight hard.
-
Thus, without waiting to be marshaled, the soldiers will be constantly on the qui vive; without waiting to be asked, they will do your will; without restrictions, they will be faithful; without giving orders, they can be trusted.
-
Prohibit the taking of omens, and do away with superstitious doubts. Then, until death itself comes, no calamity need be feared.
-
If our soldiers are not overburdened with money, it is not because they have a distaste for riches; if their lives are not unduly long, it is not because they are disinclined to longevity.
-
On the day they are ordered out to battle, your soldiers may weep, those sitting up bedewing their garments, and those lying down letting the tears run down their cheeks. But let them once be brought to bay, and they will display the courage of a Chu or a Kuei.
-
The skillful tactician may be likened to the SHUAI-JAN. Now the SHUAI-JAN is a snake that is found in the Ch`ang mountains. Strike at its head, and you will be attacked by its tail; strike at its tail, and you will be attacked by its head; strike at its middle, and you will be attacked by head and tail both.
-
Asked if an army can be made to imitate the SHUAI-JAN, I should answer, Yes. For the men of Wu and the men of Yueh are enemies; yet if they are crossing a river in the same boat and are caught by a storm, they will come to each other's assistance just as the left hand helps the right.
-
Hence it is not enough to put one's trust in the tethering of horses, and the burying of chariot wheels in the ground
-
The principle on which to manage an army is to set up one standard of courage which all must reach.
-
How to make the best of both strong and weak---that is a question involving the proper use of ground.
-
Thus the skillful general conducts his army just as though he were leading a single man, willy-nilly, by the hand.
-
It is the business of a general to be quiet and thus ensure secrecy; upright and just, and thus maintain order.
-
He must be able to mystify his officers and men by false reports and appearances, and thus keep them in total ignorance.
-
By altering his arrangements and changing his plans, he keeps the enemy without definite knowledge. By shifting his camp and taking circuitous routes, he prevents the enemy from anticipating his purpose.
-
At the critical moment, the leader of an army acts like one who has climbed up a height and then kicks away the ladder behind him. He carries his men deep into hostile territory before he shows his hand.
-
He burns his boats and breaks his cooking-pots; like a shepherd driving a flock of sheep, he drives his men this way and that, and nothing knows whither he is going.
-
To muster his host and bring it into danger:---this may be termed the business of the general.
-
The different measures suited to the nine varieties of ground; the expediency of aggressive or defensive tactics; and the fundamental laws of human nature: these are things that must most certainly be studied.
-
When invading hostile territory, the general principle is, that penetrating deeply brings cohesion; penetrating but a short way means dispersion.
-
When you leave your own country behind, and take your army across neighborhood territory, you find yourself on critical ground. When there are means of communication on all four sides, the ground is one of intersecting highways.
-
When you penetrate deeply into a country, it is serious ground. When you penetrate but a little way, it is facile ground.
-
When you have the enemy's strongholds on your rear, and narrow passes in front, it is hemmed-in ground. When there is no place of refuge at all, it is desperate ground.
-
Therefore, on dispersive ground, I would inspire my men with unity of purpose. On facile ground, I would see that there is close connection between all parts of my army.
-
On contentious ground, I would hurry up my rear.
-
On open ground, I would keep a vigilant eye on my defenses. On ground of intersecting highways, I would consolidate my alliances.
-
On serious ground, I would try to ensure a continuous stream of supplies. On difficult ground, I would keep pushing on along the road.
-
On hemmed-in ground, I would block any way of retreat. On desperate ground, I would proclaim to my soldiers the hopelessness of saving their lives.
-
For it is the soldier's disposition to offer an obstinate resistance when surrounded, to fight hard when he cannot help himself, and to obey promptly when he has fallen into danger.
-
We cannot enter into alliance with neighboring princes until we are acquainted with their designs. We are not fit to lead an army on the march unless we are familiar with the face of the country---its mountains and forests, its pitfalls and precipices, its marshes and swamps. We shall be unable to turn natural advantages to account unless we make use of local guides.
-
To be ignored of any one of the following four or five principles does not befit a warlike prince.
-
When a warlike prince attacks a powerful state, his generalship shows itself in preventing the concentration of the enemy's forces. He overawes his opponents, and their allies are prevented from joining against him.
-
Hence he does not strive to ally himself with all and sundry, nor does he foster the power of other states. He carries out his own secret designs, keeping his antagonists in awe. Thus he is able to capture their cities and overthrow their kingdoms.
-
Bestow rewards without regard to rule, issue orders without regard to previous arrangements; and you will be able to handle a whole army as though you had to do with but a single man.
-
Confront your soldiers with the deed itself; never let them know your design. When the outlook is bright, bring it before their eyes; but tell them nothing when the situation is gloomy.
-
Place your army in deadly peril, and it will survive; plunge it into desperate straits, and it will come off in safety.
-
For it is precisely when a force has fallen into harm's way that is capable of striking a blow for victory.
-
Success in warfare is gained by carefully accommodating ourselves to the enemy's purpose.
-
By persistently hanging on the enemy's flank, we shall succeed in the long run in killing the commander-in-chief.
-
This is called ability to accomplish a thing by sheer cunning.
-
On the day that you take up your command, block the frontier passes, destroy the official tallies, and stop the passage of all emissaries.
-
Be stern in the council-chamber, so that you may control the situation.
-
If the enemy leaves a door open, you must rush in.
-
Forestall your opponent by seizing what he holds dear, and subtly contrive to time his arrival on the ground.
-
Walk in the path defined by rule, and accommodate yourself to the enemy until you can fight a decisive battle.
-
At first, then, exhibit the coyness of a maiden, until the enemy gives you an opening; afterwards emulate the rapidity of a running hare, and it will be too late for the enemy to oppose you.
Chapter 12 - The Attack by Fire
-
Sun Tzu said: There are five ways of attacking with fire. The first is to burn soldiers in their camp; the second is to burn stores; the third is to burn baggage trains; the fourth is to burn arsenals and magazines; the fifth is to hurl dropping fire amongst the enemy.
-
In order to carry out an attack, we must have means available. the material for raising fire should always be kept in readiness.
-
There is a proper season for making attacks with fire, and special days for starting a conflagration.
-
The proper season is when the weather is very dry; the special days are those when the moon is in the constellations of the Sieve, the Wall, the Wing or the Cross-bar; for these four are all days of rising wind.
-
In attacking with fire, one should be prepared to meet five possible developments:
-
(1) When fire breaks out inside to enemy's camp, respond at once with an attack from without.
-
(2) If there is an outbreak of fire, but the enemy's soldiers remain quiet, bide your time and do not attack.
-
(3) When the force of the flames has reached its height, follow it up with an attack, if that is practicable; if not, stay where you are.
-
(4) If it is possible to make an assault with fire from without, do not wait for it to break out within, but deliver your attack at a favorable moment.
-
(5) When you start a fire, be to windward of it. Do not attack from the leeward.
-
A wind that rises in the daytime lasts long, but a night breeze soon falls.
-
In every army, the five developments connected with fire must be known, the movements of the stars calculated, and a watch kept for the proper days.
-
Hence those who use fire as an aid to the attack show intelligence; those who use water as an aid to the attack gain an accession of strength.
-
By means of water, an enemy may be intercepted, but not robbed of all his belongings.
-
Unhappy is the fate of one who tries to win his battles and succeed in his attacks without cultivating the spirit of enterprise; for the result is waste of time and general stagnation.
-
Hence the saying: The enlightened ruler lays his plans well ahead; the good general cultivates his resources.
-
Move not unless you see an advantage; use not your troops unless there is something to be gained; fight not unless the position is critical.
-
No ruler should put troops into the field merely to gratify his own spleen; no general should fight a battle simply out of pique.
-
If it is to your advantage, make a forward move; if not, stay where you are.
-
Anger may in time change to gladness; vexation may be succeeded by content.
-
But a kingdom that has once been destroyed can never come again into being; nor can the dead ever be brought back to life.
-
Hence the enlightened ruler is heedful, and the good general full of caution. This is the way to keep a country at peace and an army intact.
Chapter 13 - The Use of Spies
-
Sun Tzu said: Raising a host of a hundred thousand men and marching them great distances entails heavy loss on the people and a drain on the resources of the State. The daily expenditure will amount to a thousand ounces of silver. There will be commotion at home and abroad, and men will drop down exhausted on the highways. As many as seven hundred thousand families will be impeded in their labor.
-
Hostile armies may face each other for years, striving for the victory which is decided in a single day. This being so, to remain in ignorance of the enemy's condition simply because one grudges the outlay of a hundred ounces of silver in honors and emoluments, is the height of inhumanity.
-
One who acts thus is no leader of men, no present help to his sovereign, no master of victory.
-
Thus, what enables the wise sovereign and the good general to strike and conquer, and achieve things beyond the reach of ordinary men, is FOREKNOWLEDGE.
-
Now this foreknowledge cannot be elicited from spirits; it cannot be obtained inductively from experience, nor by any deductive calculation.
-
Knowledge of the enemy's dispositions can only be obtained from other men.
-
Hence the use of spies, of whom there are five classes: (1) Local spies; (2) inward spies; (3) converted spies; (4) doomed spies; (5) surviving spies.
-
When these five kinds of spy are all at work, none can discover the secret system. This is called "divine manipulation of the threads." It is the sovereign's most precious faculty.
-
Having LOCAL SPIES means employing the services of the inhabitants of a district.
-
Having INWARD SPIES, making use of officials of the enemy.
-
Having CONVERTED SPIES, getting hold of the enemy's spies and using them for our own purposes.
-
Having DOOMED SPIES, doing certain things openly for purposes of deception, and allowing our spies to know of them and report them to the enemy.
-
SURVIVING SPIES, finally, are those who bring back news from the enemy's camp.
-
Hence it is that which none in the whole army are more intimate relations to be maintained than with spies. None should be more liberally rewarded. In no other business should greater secrecy be preserved.
-
Spies cannot be usefully employed without a certain intuitive sagacity.
-
They cannot be properly managed without benevolence and straightforwardness.
-
Without subtle ingenuity of mind, one cannot make certain of the truth of their reports.
-
Be subtle! be subtle! and use your spies for every kind of business.

-
Whether the object be to crush an army, to storm a city, or to assassinate an individual, it is always necessary to begin by finding out the names of the attendants, the aides-de-camp, and door-keepers and sentries of the general in command. Our spies must be commissioned to ascertain these.
-
The enemy's spies who have come to spy on us must be sought out, tempted with bribes, led away and comfortably housed. Thus they will become converted spies and available for our service.
-
It is through the information brought by the converted spy that we are able to acquire and employ local and inward spies.
-
It is owing to his information, again, that we can cause the doomed spy to carry false tidings to the enemy.
-
Lastly, it is by his information that the surviving spy can be used on appointed occasions.
-
The end and aim of spying in all its five varieties is knowledge of the enemy; and this knowledge can only be derived, in the first instance, from the converted spy. Hence it is essential that the converted spy be treated with the utmost liberality.
-
Of old, the rise of the Yin dynasty was due to I Chih who had served under the Hsia. Likewise, the rise of the Chou dynasty was due to Lu Ya who had served under the Yin.
-
Hence it is only the enlightened ruler and the wise general who will use the highest intelligence of the army for purposes of spying and thereby they achieve great results. Spies are a most important element in water, because on them depends an army's ability to move.


[gecode-users] gecode-3.7.1 on NetBSD
Christian Schulte
cschulte at kth.se
Thu Feb 9 10:36:54 CET 2012
Hi Adam,
As I do not have access to a box running NetBSD, I offer you a deal: if you
test and confirm that the attached patch works for NetBSD, I'll add NetBSD
as a platform to Gecode for future releases.
Best
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Adam Russell
Sent: Thursday, February 09, 2012 4:10 AM
To: users at gecode.org
Subject: [gecode-users] gecode-3.7.1 on NetBSD
For whatever it's worth I'd like to note that I was able to build
gecode-3.7.1 on NetBSD 5.1 without a problem. Aside from needed dependencies
all I had to do was lie to ./configure with the --with-host-os=FreeBSD
option. I am not sure why this is not considered to be a supported platform?
Anyway, I just thought I'd mention it.
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NetBSD.patch
Type: application/octet-stream
Size: 2151 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20120209/02909748/attachment.obj>
More information about the users
mailing list


We and our business partners collect information about your use of our website through cookies. Cookies are information files stored on your computer, tablet or smartphone that help websites remember who you are and information about your visit. Cookies can help to display the information on a website in a way that matches your interests. Most major websites use cookies.
The cookies we and our business partners use on this website are broadly grouped into the following categories:
Some of the cookies on our website are essential for us to be able to provide you with a service you have requested. An example of this would be a cookie used to enable you to log into your account on the website, place items in your shopping basket or which allows communication between your browser and the website.
We use analytics cookies to help us understand how users engage with our website. An example is counting the number of different people coming to our website or using a particular feature, rather than the total number of times the site or feature is used. Without this cookie, if you visited the website once each week for three weeks we would count you as three separate users. We would find it difficult to analyse how well our website was performing and improve it without these cookies.
We use cookies to improve your experience by remembering your preferences so we know how you like to use our website. Examples of this would be remembering you so that you are served with the same content, to remember you when you come back to the site or to remember that you like logging in via Facebook or other social media sites.
We use cookies to allow you to share content directly on the social networking/sharing sites, like Facebook, Twitter or Google+. Examples would be if you wanted to ?like? or ?tweet? about a business or product advertised on our website.
You will have noticed that when you visit websites you will be shown adverts for products and services you may wish to buy. The money made by website owners for showing third party adverts on their websites often pays for the cost of running the website and therefore usually allows you to use the website without having to pay a registration or usage fee. Hibu like many businesses place adverts for itself and its customers on a range of its partners websites. However, to try and ensure that the adverts you see are relevant to you we use cookies to collect information about the types of things that interest you, for example websites you visit and the geography that you are based in. Having these cookies does not increase the number of adverts you will be shown, but simply makes the adverts you see more relevant.
Please note that we can?t always control third party cookies stored on your machine from our website and setting your cookie preferences with us will not stop those third party cookies from being stored on your machine, you must manage these cookies directly with the relevant third party, please see our ?Third Party Cookies? section below for more information.
If you wish to reject or opt-out of cookies, you can do the following:
delete the cookies from your browser. Most browsers also allow you to prevent all or some cookies being stored on your machine in the future. For more information on how to delete or disable cookies from your browser please use the ?help? function within your browser or alternatively visit www.allaboutcookies.org.
if you only want to reject some or all of the third party cookies you will need to visit the relevant third party?s website directly to manage cookies stored on your machine by them. Please see our ?Third Party Cookies? section below.
Please be aware that disabling cookies may impact the functionality of this website.
Some of the cookies falling within the cookie categories described above are stored on your machine by third parties when you use our website. We have no control over these cookies or how the third parties use them. They are used to allow that third party to provide a service to us, for example analytics. For more information on these cookies and how to disable them, please see the third party?s individual privacy policy listed below:
Third Party
Type of cookies (excluding essential cookies)
More information and how to opt-out
Bazaarvoice
Cookies are used to collect non-personally identifiable data about when users who interact with the ratings/review/question/answer service within the Website go on to make a purchase or take other specified actions within the site.
Cookies are used by Bazaarvoice to:
Customise the display of the website based on what items users have submitted reviews, comments or other feedback against;
Remember when you were last asked a question, to avoid asking you the same question too many times;
Remember whether you have made a preference as to how you would like to view parts of the website (i.e. mobile/full desktop); and
identify anonymous users who rank content as ?helpful? or who report ?inappropriate content?.
http://www.bazaarvoice.com/privacy-policy/#optout_section
Cookies are used to collect non-personally identifiable data about your use of the Website including mouse clicks, mouse movements, scrolling activity as well as text you type in the Website. We use this information to optimise your experience and the Website.
https://www.clicktale.com/privacy-service
Omniture provide anonymised data about the visits made to our website and allows us to test and evaluate the best ways to present our website to our users.
http://www.adobe.com/privacy/analytics.html
Google provide anonymised data about the visits made to our website.
Google also store cookies which allow the ?Google +? social sharing functionality.
Google cookies may also collect data for the purpose of interest-based advertising.
http://www.google.co.uk/intl/en/policies/privacy/
ShareThis store cookies which allow the social sharing functionality on social networks such as Facebook, Twitter or Google+.
http://www.sharethis.com/legal/privacy/#sthash.S6ayS221.dpbs
iPromote cookies also collect data for the purpose of interest-based advertising.
http://www.ipromote.com/privacy-policy/
Qualaroo cookies also collect data for the purpose of interest-based advertising.
https://qualaroo.com/privacy-policy/
Infectious Media
Infectious Media cookies also collect data for the purpose of interest-based advertising.
http://www.infectiousmedia.com/index.php?page=cookie-policy
QuantCast cookies also collect data for the purpose of interest-based advertising.
https://www.quantcast.com/privacy/
Linked In cookies also collect data for the purpose of interest-based advertising.
http://www.linkedin.com/legal/cookie_policy
If you want to know more about how cookies work and how to manage or delete them, visit the .
World Wide Web Consortium's website
We may update this policy from time to time so you may want to check it each time you visit our website. We last changed this policy on 18 November 2013.


We took the hike to Summit Lake which is the closets lake on the south side of Three Finger Jack. The trails follows the Pacific Crest Trail for about four miles, and then splits off for last half a mile on an unimproved trail which was a little hard for us to find. We ended up passing the turn and trail blazed to a cliff that over looks Summit Lake, but with some perseverance and back tracking we found a route to Summit Lake. Overall, the hike was a nice short trek with some spectacular views.
This is a image of Summit Lake looking southwest. The cliff we found that overlooks summit lake is to the right but out the image.
The trail head is an access point to the Pacific Crest trail off highway 20. We were thinking of bring our drone but apparently the wilderness area is a no drone fly area. The parking lot was full of horse trailers so expect to encounter horses on the trail. This trail head has the usual parking fee and wilderness pass that is on site self issue.
To our surprise we we found fields lavender in bloom.
The image above is looking southeast.
The trail begins to level out where the forest of burnt trees meets with current tree line. The burnt trees allow for an awesome view of the surrounding terrain. One reason I like back-packing the Cascades, Volcanoes. They are good at blowing up and make the horizon more interesting.
Facing south the image above gives a great view of Mt. Washington and the Sisters.
Finn the dog is always on the look out for squeaker.
About four miles is a flat section that cuts across a steep side of the bottom of Three Finger Jack. A little ways up the trail from here is where the trail splits so keep your eyes peeled for trails on the right side. If your bearing after this point on the Pacific Crest becomes West you have gone to far and missed the turn. We found several different trail fragments that seem like a part of broken network of trails to the lake.
The steep slope gives the best view of the trek showing once again, Mt Washington, the Sisters, and Mt. Bachelor may be back there somewhere with Black butte on the far left. The Two lake below Black Butte in the image are Martin and Booth Lakes which are accessed by the second intersection at the beginning of the trail.
After four and half miles, along with a few detours, we made it to Summit Lake. The lake was cold as expected, sadly no fish. But due to the aloofness of the trail no other hikers were there.


This extension lets you view people's interactions on Venmo to discover which users are spending money together, when they're spending money together, and what they're spending money on. Read about finding and following a user's money trail or watch the demonstration video.
If you feel ready go ahead and open the trail to see how far it can lead you.
Just remember to...
This extension was written in conjuction with this blog post and this paper to demonstrate how much information Venmo exposes by making users publically share transactions by default.
The Money Trail consists of a bubble graph showing which people a user interacts the most with on Venmo, and a chart showing when the user interacts with them.
To have the Trail appear you must be logged into Venmo with this the extension enabled. If the extension is running you should see a tool bar appear at the top of venmo.com
To view a users' Money Trail, regardless of whether you are friends with them or not, simply navigate to their Venmo profile page and select their Feed. The bubble graph should load in by default above the tool bar if the user has any data in their Feed.
Keep in mind the amount of data in a user's Trail is limited by the amount of data in their Feed. To view your own Trail go to https://venmo.com/#yours
The two vizualizations in the Trail are good for determining the timing, content and frequency of transactions on Venmo. You can switch between these vizualizations by hitting the "Bubble Graph" or the "Transaction Chart" buttons in the tool bar.
You can change the Trail to show only transactions that happened between two given dates by setting that date range in the tool bar.
In the bubble graph the size of a circle corresponds to the number of Venmo transactions with that user (which can be seen by hovering over the circle).
The size of the link connecting to that circle to the user corresponds to the number of times the user paid or was paid by that current user (the green links correspond to payments to the current user, and red links are payment from the current user). This can also be seen by hovering over the links.
In the chart every user the current user interacted with is displayed as a seperate colored line. Interactions with each user are aggregated for every time range on the bottom axis and are displayed as a set of points in that user's line color. Clicking a data point brings up a scrollable popup box showing all the transactions with that user in that time range, along with the corresponding messages and times ($+ indicates a payment to the current user and $- indicates a payment from the current user).
To activate an individual user's line series you have to click on the grayed out dot by their name in the legend. Clicking the select all button in the tool bar will activate all series on the chart and clicking the deselect all button will deactivate all series on the chart (if there are a lot of series these actions could take a while to complete so please be patient).
Note that nither visualization can tell how much money was exchanged, only who paid whom.
This extension was developed as a demonstration of how much data Venmo defaults users into sharing. It is not meant to be used as a tool to creep on people, hence this app is not optimized to gather or display large amounts of data on users. Read this Medium post and this paper for more a detailed discussion about what motivated the creation of this extension as well as what the implications of this project are.


Parameters¶
This explains in more detail how and when to use each keyword in the config file. For readability, the minimum required parameters are listed for each step. If more than one step will be run (>1 out of 5 possible pipeline logic keywords is set to true), the minimum parameters required is the sum of the minimum required parameters for all true keywords.
Minimum Required Parameters for Each Step¶
Full List of User Input Data Parameters¶
Parameter |
Type |
Default |
Description |
Relevance |
ChromosomeLengthFile |
string |
This is a tab-delimited text file that contains the same names as the chromosomes in your dataset followed by the chromosome length. This file can generally be pulled down from the NCBI website under the build you are using (hg19 or hg38). This is used for chunking the imputed data. |
if |
|
Build |
option: hg19 or hg38 |
hg38 |
This determines whether the software needs to be searching for a “chr” before the chomosome name or not |
|
Chromosomes |
string |
1-22 |
This lets the software know which chromosomes you want to use for association analysis. It must be a range. If you want to only run analysis on a single chromsome, the start and end will be the same value. For example: running chromome 2 only will look like 2-2. |
if |
ImputeSuffix |
string |
The full suffix for the software to determine which files in the directory are impuation files. Important, it is assuming the prefix is either a chromosome number (hg19) or the string chr followed by the chromosome number (hg38) |
if |
|
ImputeDir |
string |
Full path to directory where imputed results are located |
if |
|
OutDir |
string |
Full path to directory where final results should be transferred |
all |
|
OutPrefix |
string |
string (no whitespace or special characters) to prefix to the output files generated |
all |
|
PhenoFile |
string |
Full path to tab-delimted phenotype file containing sample IDs, phenotypes, and covariates, with whatever string of headers you choose. NO WHITESPACES in header names. |
If : |
|
Plink |
string |
Full path to the directory and plink file prefix (dropping the suffix .bed,.bim,.fam) to an LD-pruned set of data to be used to generate GRM relatedness and to select random markers from for the variance ratio value |
If |
|
Trait |
option: binary or quantitative |
Based upon your association phenotype. If binary, all values will be 0/1/NA, if quantitivate all phenotype traits to be analyzed will be continuous or have numeric quantitative meaning |
if |
|
Pheno |
string |
The exact name (case-sensitive) of the phenotype to be analyzed in your PhenoFile. Must be present in PhenoFile. |
if |
|
InvNorm |
boolean |
FALSE |
This applies to the phenotype of interest to be analzyed and whether to perform an inverse normalization. For binary traits, this should be set to FALSE and for quantitative traits, set this to TRUE. |
if |
Covars |
comma-separated list |
A comma-separated list (no whitespaces) of all the covariate names to regress out in the model. These variables need to be in your PhenoFile. |
if |
|
SampleID |
string |
A string (no whitespaces) that is contained in the header of your PhenoFile. This is the sampleID names and they must be the same names as listed in the PhenoFile, Imputation Files, and Plink Files. |
if |
|
Nthreads |
int |
Strongly Recommned to leave this blank! If left blank, it will auto-decect available resources and scale steps automatically on the back-end. By specifiying the threads it tells the program to use max Nthreads for parallelization and concurrency. |
all |
|
SparseKin |
boolean |
TRUE |
If set to true, takes advantage of the sparsity of the GRM, otherwise will not use the sparsity to make assessments |
if |
Markers |
int |
30 |
The number of random markers selected from the LD-pruned plink file to estimate the variance ratio component in the null model. Warning! This number increases time linearly |
if |
Rel |
float |
0.0625 |
A float between 0.0-1.0. This is the threshold in kinship estimate to consider someone related. Anything below this value will be treated as an unrelated individual in the pairwise comparison and calculation for the sparse GRM. |
if |
Loco |
boolean |
TRUE |
Leave-One-Chromosome-Out method. Warning – Setting this to true, increases the time complexity of the algorithm. |
if |
CovTransform |
boolean |
TRUE |
Recommended to set to true. It is a QR decomposition that aids in the covergence of the null model. |
if |
VcfField |
option: DS or GT |
DS |
This determines what metric to base association upon. DS = dosages and GT = genotypes. If you have genotypes only, i.e. chip data withouth dosage calculations, DS cannot be used! |
if |
MAF |
float |
0.05 |
Float between 0.0-0.50 that specifies the cutoff to be considered a common snp or a rare snp. For example, keeping this to the default of 0.05 will assume common snps are defined as those with a minor allele frequency >5% and that rare snps are defined as those with a minor allele frequency ≤ 5%. THIS IS NOT A FILTER! |
if |
MAC |
int |
10 |
A filter applied to the cleaned association results to remove snps that have low minor allele counts. Default recommendation is to set this to 10. |
if |
IsDropMissingDosages |
boolean |
FALSE |
if |
|
InfoFile |
string |
Path to the info file. This file contains snps information pertaining to chromosome, positions, genotype/imputation status, R2, ER2 values. For formatting of this file please refer to <-----------------→ |
if |
|
SaveChunks |
boolean |
TRUE |
Specifies whether to save the chunked files and the queue list for future use. |
if |
GrmMAF |
float |
0.01 |
The minor allele frequency threshold for a snp to be included in the GRM calculation based on the LD-pruned plink file. For example, if set to 0.01 this means any snp with a MAF > 0.01 wil be used to calculate relatedness in the GRM. |
if |
ChunkVariants |
int |
1000000 |
The window of base pairs to chunk imputation files. It is recommended to keep this at the default of 1000000. |
if |
SaveAsTar |
boolean |
FALSE |
all |
|
ImputationFileList |
string |
Ends in _chunkedImputationQueue.txt |
if |
|
SparseGRM |
string |
Ends in .sparseGRM.mtx |
if |
|
SampleIDFile |
string |
Ends in sparseGRM.mtx.sampleIDs.txt |
if |
|
NullModelFile |
string |
Ends in .rda |
if |
|
VarianceRatioFile |
string |
Ends in .varianceRatio.txt |
if |
|
AssociationFile |
string |
Ends in _SNPassociationAnalysis.txt |
If |


Maryland man, 28, was fatally stabbed after cutting line at Popeyes for chicken sandwich, police say
by Talia KaplanA man who was stabbed to death outside a Maryland Popeyes Monday night had cut to the front of a line to get dibs on the chain's popular chicken sandwich, police said on Tuesday.
Prince George's County Police Chief Hank Stawinski told reporters that 28-year-old Kevin Davis entered the restaurant in Oxon Hill and started “methodically” cutting a line reserved for the menu item. Stawinski said that Davis was confronted by another man when he cut to the front of the line.
“Over the course of fifteen minutes this individual works his way methodically ahead of everybody else in that line, is confronted by this individual and then from the moment of that confrontation, 15 seconds later, the two of them are out in front of the store, a stabbing occurs and an individual’s life is lost,” Stawinski told reporters.
MAN DIES AFTER STABBING IN MARYLAND POPEYES; FIGHT OVER CHICKEN SANDWICH, SOURCES SAY
He added, “The question my detectives have to answer is: how does a confrontation lead to a homicide in 15 seconds?”
Police said the preliminary investigation revealed Davis and the suspect got into a brief verbal argument. They both then got out of the line and walked out the front door together before the suspect stabbed Davis, investigators said.
Police said Davis was rushed to a local hospital where he was pronounced dead.
Police are asking the public for help identifying the suspect and a woman he was with, who they said is a person of interest.
The suspect and the woman fled the parking lot in a vehicle immediately following the stabbing. Police said a vehicle description was not available and that it did not appear that the suspect and Davis were associated with each other before Monday’s fight.
Police added that they do not have information that “this was a longstanding dispute or that it is anything outside of what had occurred.”
Stawinski told reporters the restaurant was packed with at least three dozen people, including children, when the fight and stabbing occurred.
“What bothers me about this ... is that there are families and children in this restaurant as this is unfolding and they’ve been exposed to this now as well,” Stawinski said. “This is pointless, this is disrespectful.”
He said he reviewed the surveillance video and there were several children in the restaurant who were “obviously shocked” about what was unfolding in front of them.
Police said a knife was recovered from the scene.
Popeyes resumed selling its chicken sandwich on Sunday. The menu item was initially released on Aug. 12, but popular demand caused the chain’s supply to sell out by the end of that month.
POPEYES CHICKEN SANDWICH RETURNS TO HIGH DEMAND, SPARKS 'HOURS-LONG' LINES
In a statement sent to Fox News on Monday night, a Popeyes spokesperson said, “We are very sad to hear about the tragedy in Maryland tonight. We do not yet know whether this was the result of a dispute over one of our products or something unrelated, but there is no reason for someone to lose their life on a Monday night in a parking lot.”
“Our thoughts are with the victim’s family and friends and we are fully cooperating with local authorities,” the statement went on to say.
CLICK HERE TO GET THE FOX NEWS APP
Oxon Hill is about 20 minutes from Washington, D.C.
The Associated Press contributed to this report.


public class VeryLargeNumber extends java.lang.Object implements java.lang.Comparable<VeryLargeNumber>, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
BASE |
| Constructor and Description |
|---|
VeryLargeNumber(int number) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(VeryLargeNumber addThis)
add addThis to this instance.
|
VeryLargeNumber |
clone()
make a copy of this instance with a different identity but same
values in the member variables.
|
int |
compareTo(VeryLargeNumber other)
compare the number within this instance to the number within other and
return -1 if this is smaller, 0 if this is equal to other, and +1 if this
is larger than other.
|
static VeryLargeNumber |
createMaxLong()
convenience method to create an instance with the value of Long.MAX_VALUE,
((1<<63)-1)
|
java.lang.String |
divideByAndPrint(VeryLargeNumber divisor)
divide internal number by the divisor and return a string.
|
boolean |
equals(java.lang.Object other)
compare the number value of this instance to another and return true
if they are the same.
|
protected int[] |
getInternalArray()
get a copy of the internal array a
|
protected int |
getInternalArraySize()
return the size of the internal array a
|
int |
hashCode() |
void |
increment()
increment this number value
|
void |
incrementNegative()
an increment specifically for use when this number is a negative number
|
void |
incrementPositive()
an increment specifically for use when this number is a positive number.
|
boolean |
isPositive()
whether this is a positive number
|
boolean |
isZero()
whether this number value is 0
|
void |
resetTo(VeryLargeNumber copyThis)
reset the content of this instance to be the same as the copied content of
copyThis.
|
void |
reversePolarity()
reverse the sign of this number.
|
protected void |
setInternalArray(int[] b,
int newNLen,
boolean sign)
method purely for testing.
|
void |
subtract(VeryLargeNumber subtractThis)
subtract subtractThis from this instance.
|
java.lang.String |
toString()
return the number value of this instance as a string.
|
public static final int BASE
public void add(VeryLargeNumber addThis)
addThis
- number to add to thispublic void subtract(VeryLargeNumber subtractThis)
subtractThis
- public java.lang.String divideByAndPrint(VeryLargeNumber divisor)
divisor
- public boolean isZero()
public boolean isPositive()
public void reversePolarity()
public static VeryLargeNumber createMaxLong()
public int compareTo(VeryLargeNumber other)
compareTo
in interface java.lang.Comparable<VeryLargeNumber>
other
- public void increment()
public void incrementNegative()
public void incrementPositive()
public VeryLargeNumber clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- public int hashCode()
hashCode
in class java.lang.Object
public void resetTo(VeryLargeNumber copyThis)
copyThis
- protected void setInternalArray(int[] b, int newNLen, boolean sign)
b
- array of numbers composing the large number. note that no
checks are done to assert that the numbers are positive as this is a
method meant to be used in testing only.newNLen
- sign
- the number array is positive or negativeprotected int getInternalArraySize()
protected int[] getInternalArray()
public java.lang.String toString()
toString
in class java.lang.Object


These section contains my travel diaries, please click to read more.
These section contains my gardening stories.
These section contains my Professional bio.
These section contains my sports logs.
These section contains my views on next gen technology.
These section contains my attempt towards go green initiatives.


Convert PowerShell HashTable to CSV File
Unfortunately you can’t use the Export-CSV
cmdlet to export a custom HashTable
to a CSV file (Not directly) I found you could convert it to a PSObject
which can be directly piped to Export-CSV
...
Unfortunately you can’t use the Export-CSV
cmdlet to export a custom HashTable
to a CSV file (Not directly) I found you could convert it to a PSObject
which can be directly piped to Export-CSV
...
After writing a debugging / dev SMTP server as a Windows Service in Python using pywin32, I decided to figure out how to wrap the Python Windows Service into an EXE so you wouldn’t have to install Python to get it running
I had first attempted to do this in PyInstaller but upon starting the service, Windows would report failure, but the server would still be working. I gave up on PyInstaller and found a solution in py2exe ...
The other day, for debugging purposes, I needed to deploy a dummy SMTP server that would receive, log and NOT send emails. There’s actually a cool little Python one-liner that does something similar to this:
Bam. A basic SMTP server that will output messages to stdout. Note that since it’s a port less than 1024, we need to run this command as sudo or in an administrative command prompt in order to bind to port 25
Before I continue, I wan’t to make you aware that I’ve never scripted in Python before. This was my first application (Yeah, screw you, “Hello World”) So I lack experience, and some of my solutions may be inefficient and bad practice. (Please let me know if so!)
For my application, the downside of the previous command is that it only outputs to stdout and does not run as a service (I was looking for more of a permanent solution for debugging / dev purposes… a lot of debugging.)
As a “solution” I wrapped a derivative of this command into a Windows Service using a Python extension called pywin32 ...
I discovered something interesting the other day when I was trying to export an Exchange 2010 journaling mailbox to a PST file through the Exchange Management Shell. The -ContentFilter
flag for the New-MailboxExportRequest
cmdlet does not act the same as the -SearchQuery
flag for the Search-Mailbox
cmdlet
I would specify the date range of the New-MailboxExportRequest using the ContentFilter flag:
And then I would delete that date range from the journaling mailbox:
You’d think that I did nothing wrong but I just lost a days worth of my journal ...


Home
About
Projects
Food
Menu
My favorite dishes from the past year ^.^
Appetizers
Pate
Cheesecurds
Egg Yolk Bun
Chicken Karaage
Entrees
Squid Ink Ramen
Braised Pork Belly
Samgyeopsal
All Thai food.
Dessert
Bubble Waffle
Toffee Cake
Baklava
Matcha Crepe Cake
Chef's Choice
Sliders
IYKYK
Ice Cream
Brown Sugar Milk Tea. Yeah I'm basic.
×


Do the barrel roll.
Basic JQuery Example. Manipulate the HTML element with data from potentiometers.