The Philosophy of War

Any philosophical examination of war will center on four general questions: What is war? What causes war? What is the relationship between human nature and war? Can war ever be morally justifiable?

Defining what war is requires determining the entities that are allowed to begin and engage in war. And a person's definition of war often expresses the person's broader political philosophy, such as limiting war to a conflict between nations or state. Alternative definitions of war can include conflict not just between nations but between schools of thought or ideologies.

Answers to the question "What causes war?" largely depend on the philosopher's views on determinism and free will. If a human's actions are beyond his or her control, then the cause of war is irrelevant and inescapable. On the other hand, if war is a product of human choice, then three general groupings of causation can be identified: biological, cultural, and reason. While exploring the root cause of conflict, this article investigates the relationship between human nature and war.

Finally, the question remains as to whether war is ever morally justified. Just war theory is a useful structure within which the discourse of war may be ethically examined. In the evolving context of modern warfare, a moral calculus of war will require the philosopher of war to account not only for military personnel and civilians, but also for justifiable targets, strategies, and use of weapons.

The answers to all these questions lead on to more specific and applied ethical and political questions. Overall, the philosophy of war is complex and requires one to articulate consistent thought across the fields of metaphysics, epistemology, philosophy of mind, political philosophy, and ethics.

Table of Contents

1. What is War?

The first issue to be considered is what is war and what is its definition. The student of war needs to be careful in examining definitions of war, for like any social phenomena, definitions are varied, and often the proposed definition masks a particular political or philosophical stance paraded by the author. This is as true of dictionary definitions as well as of articles on military or political history.

Cicero defines war broadly as "a contention by force"; Hugo Grotius adds that "war is the state of contending parties, considered as such"; Thomas Hobbes notes that war is also an attitude: "By war is meant a state of affairs, which may exist even while its operations are not continued;" Denis Diderot comments that war is "a convulsive and violent disease of the body politic;" for Karl von Clausewitz, "war is the continuation of politics by other means", and so on. Each definition has its strengths and weaknesses, but often is the culmination of the writer's broader philosophical positions.

For example, the notion that wars only involve states-as Clausewitz implies-belies a strong political theory that assumes politics can only involve states and that war is in some manner or form a reflection of political activity. 'War' defined by Webster's Dictionary is a state of open and declared, hostile armed conflict between states or nations, or a period of such conflict. This captures a particularly political-rationalistic account of war and warfare, i.e., that war needs to be explicitly declared and to be between states to be a war. We find Rousseau arguing this position: "War is constituted by a relation between things, and not between persons…War then is a relation, not between man and man, but between State and State…" (The Social Contract).

The military historian, John Keegan offers a useful characterization of the political-rationalist theory of war in his A History of War. It is assumed to be an orderly affair in which states are involved, in which there are declared beginnings and expected ends, easily identifiable combatants, and high levels of obedience by subordinates. The form of rational war is narrowly defined, as distinguished by the expectation of sieges, pitched battles, skirmishes, raids, reconnaissance, patrol and outpost duties, with each possessing their own conventions. As such, Keegan notes the rationalist theory does not deal well with pre-state or non-state peoples and their warfare.

There are other schools of thought on war's nature other than the political-rationalist account, and the student of war must be careful, as noted above, not to incorporate a too narrow or normative account of war. If war is defined as something that occurs only between states, then wars between nomadic groups should not be mentioned, nor would hostilities on the part of a displaced, non-state group against a state be considered war.

An alternative definition of war is that it is an all-pervasive phenomenon of the universe. Accordingly, battles are mere symptoms of the underlying belligerent nature of the universe; such a description corresponds with a Heraclitean or Hegelian philosophy in which change (physical, social, political, economical, etc) can only arise out of war or violent conflict. Heraclitus decries that "war is the father of all things," and Hegel echoes his sentiments. Interestingly, even Voltaire, the embodiment of the Enlightenment, followed this line: "Famine, plague, and war are the three most famous ingredients of this wretched world...All animals are perpetually at war with each other...Air, earth and water are arenas of destruction." (From Pocket Philosophical Dictionary).

Alternatively, the Oxford Dictionary expands the definition to include "any active hostility or struggle between living beings; a conflict between opposing forces or principles." This avoids the narrowness of a political-rationalist conception by admitting the possibility of metaphorical, non-violent clashes between systems of thought, such as of religious doctrines or of trading companies. This perhaps indicates a too broad definition, for trade is certainly a different kind of activity than war, although trade occurs in war, and trade often motivates wars. The OED definition also seems to echo a Heraclitean metaphysics, in which opposing forces act on each other to generate change and in which war is the product of such a metaphysics. So from two popular and influential dictionaries, we have definitions that connote particular philosophical positions.

The plasticity and history of the English language also mean that commonly used definitions of war may incorporate and subsume meanings borrowed and derived from other, older languages: the relevant root systems being Germanic, Latin, Greek, and Sanskrit. Such descriptions may linger in oral and literary depictions of war, for we read of war in poems, stories, anecdotes and histories that may encompass older conceptions of war. Nonetheless, war's descriptions residing in the literature left by various writers and orators often possess similarities to modern conceptions. The differences arise from the writer's, poet's, or orator's judgement of war, which would suggest that an Ancient Greek conception of war is not so different from our own. Both could recognize the presence or absence of war. However, etymologically war's definition does refer to conceptions of war that have either been discarded or been imputed to the present definition, and a cursory review of the roots of the word war provides the philosopher with a glimpse into its conceptual status within communities and over time.

For example, the root of the English word 'war', werra, is Frankish-German, meaning confusion, discord, or strife, and the verb werran meaning to confuse or perplex. War certainly generates confusion, as Clausewitz noted calling it the "fog of war", but that does not discredit the notion that war is organized to begin with. The Latin root of bellum gives us the word belligerent, and duel, an archaic form of bellum; the Greek root of war is polemos, which gives us polemical, implying an aggressive controversy. The Frankish-Germanic definition hints at a vague enterprise, a confusion or strife, which could equally apply to many social problems besetting a group; arguably it is of a lower order sociological concept than the Greek, which draws the mind's attention to suggestions of violence and conflict, or the Latin, which captures the possibility of two sides doing the fighting.

The present employment of 'war' may imply the clash and confusion embedded in early definitions and roots, but it may also, as we have noted, unwittingly incorporate conceptions derived from particular political schools. An alternative definition that the author has worked on is that war is a state of organized, open-ended collective conflict or hostility. This is derived from contextual common denominators, that is elements that are common to all wars, and which provide a useful and robust definition of the concept. This working definition has the benefit of permitting more flexibility than the OED version, a flexibility that is crucial if we are to examine war not just as a conflict between states (that is, the rationalist position), but also a conflict between non-state peoples, non-declared actions, and highly organized, politically controlled wars as well as culturally evolved, ritualistic wars and guerrilla uprisings, that appear to have no centrally controlling body and may perhaps be described as emerging spontaneously.

The political issue of defining war poses the first philosophical problem, but once that is acknowledged, a definition that captures the clash of arms, the state of mutual tension and threat of violence between groups, the authorized declaration by a sovereign body, and so on can be drawn upon to distinguish wars from riots and rebellions, collective violence from personal violence, metaphorical clashes of values from actual or threatened clashes of arms.

2. What causes war?

Various sub-disciplines have grappled with war's etiology, but each in turn, as with definitions of war, often reflects a tacit or explicit acceptance of broader philosophical issues on the nature of determinism and freedom.

For example, if it is claimed that man is not free to choose his actions (strong determinism) then war becomes a fated fact of the universe, one that humanity has no power to challenge. Again, the range of opinions under this banner is broad, from those who claim war to be a necessary and ineluctable event, one that man can never shirk from, to those who, while accepting war's inevitability, claim that man has the power to minimize its ravages, just as prescriptive medicines may minimize the risk of disease or lightning rods the risk of storm damage. The implication is that man is not responsible for his actions and hence not responsible for war. Wherein lies its cause then becomes the intellectual quest: in the medieval understanding of the universe, the stars, planets and combinations of the four substances (earth, air, water, fire) were understood as providing the key to examining human acts and dispositions. While the modern mind has increased the complexity of the nature of the university, many still refer to the universe's material nature or its laws for examining why war arises. Some seek more complicated versions of the astrological vision of the medieval mind (e.g., Kondratieff cycle theories), whereas others delve into the newer sciences of molecular and genetic biology for explanations.

In a weaker form of determinism, theorists claim that man is a product of his environment-however that is defined-but he also possesses the power to change that environment. Arguments from this perspective become quite intricate, for they often presume that 'mankind' as a whole is subject to inexorable forces that prompt him to wage war, but that some people's acts-those of the observers, philosophers, scientists-are not as determined, for they possess the intellectual ability to perceive what changes are required to alter man's martial predispositions. Again, the paradoxes and intricacies of opinions here are curiously intriguing, for it may be asked what permits some to stand outside the laws that everybody else is subject to?

Others, who emphasize man's freedom to choose, claim that war is a product of his choice and hence is completely his responsibility. But thinkers here spread out into various schools of thought on the nature of choice and responsibility. By its very collective nature, considerations of war's causation must encroach into political philosophy and into discussions on a citizen's and a government's responsibility for a war. Such concerns obviously trip into moral issues (to what extent is the citizen morally responsible for war?), but with regards war's causation, if man is responsible for the actual initiation of war it must be asked on whose authority is war enacted? Descriptive and normative problems arise here, for one may inquire who is the legal authority to declare war, then move to issues of whether that authority has or should have legitimacy. For example, one may consider whether that authority reflects what 'the people' want (or should want), or whether the authority informs them of what they want (or should want). Are the masses easily swayed by the ideas of the élite, or do the élite ultimately pursue what the majority seeks? Here, some blame aristocracies for war (e.g., Nietzsche, who actually extols their virtues in this regard) and others blame the masses for inciting a reluctant aristocracy to fight (cf. Vico, New Science, sect. 87).

Those who thus emphasize war as a product of man's choices bring to the fore his political and ethical nature, but once the broad philosophical territory of metaphysics has been addressed other particular causes of war can be noted. These may be divided into three main groupings: those who seek war's causation in man's biology, those that seek it in his culture, and those who seek it in his faculty of reason.

Some claim war to be a product of man's inherited biology, with disagreements raging on the ensuing determinist implications. Example theories include those that claim man to be naturally aggressive or naturally territorial, more complex analyses incorporate game theory and genetic evolution to explain the occurrence of violence and war (cf. Richard Dawkins for interesting comments on this area). Within this broad school of thought, some accept that man's belligerent drives can be channeled into more peaceful pursuits (William James), some worry about man's lack of inherited inhibitions to fight with increasingly dangerous weapons (Konrad Lorenz), and others claim the natural process of evolution will sustain peaceful modes of behavior over violent (Richard Dawkins).

Rejecting biological determinism, culturalists seek to explain war's causation in terms of particular cultural institutions. Again determinism is implied when proponents claim that war is solely a product of man's culture or society, with different opinions arising as to the nature or possibility of cultural change. For example, can the 'soft morality' of trade that engages increasing numbers in peaceful intercourse counteract and even abolish bellicose cultural tendencies (as Kant believes), or are cultures subject to an inertia, in which the imposition of external penalties or a supra-national state may be the only means to peace? The problem leads to questions of an empirical and a normative nature on the manner in which some societies have foregone war and on the extent to which similar programs may be deployed in other communities. For example, what generated peace between the warring tribes of England and what denies the people of Northern Ireland or Yugoslavia that same peace?

Rationalists are those who emphasize the efficacy of man's reason in human affairs, and accordingly proclaim war to be a product of reason (or lack of). To some this is a lament-if man did not possess reason, he might not seek the advantages he does in war and he would be a more peaceful beast. To others reason is the means to transcend culturally relative differences and concomitant sources of friction, and its abandonment is the primary cause of war (cf. John Locke, Second Treatise, sect. 172). Proponents of the mutual benefits of universal reason have a long and distinguished lineage reaching back to the Stoics and echoing throughout the Natural Law philosophies of the medieval and later scholars and jurists. It finds its best advocate in Immanuel Kant and his famous pamphlet on Perpetual Peace.

Many who explain war's origins in man's abandonment of reason also derive their thoughts from Plato, who argues that "wars and revolutions and battles are due simply and solely to the body and its desires." That is, man's appetite sometimes or perpetually overwhelms his reasoning capacity, which results in moral and political degeneration. Echoes of Plato's theories abound in Western thought, resurfacing for example, in Freud's cogitation on war ("Why War") in which he sees war's origins in the death instinct, or in Dostoyevsky's comments on man's inherent barbarity: "It's just their defenselessness that tempts the tormentor, just the angelic confidence of the child who has no refuge and no appeal, that sets his vile blood on fire. In every man, of course, a beast lies hidden-the beast of rage, the beast of lustful heat at the screams of the tortured victim, the beast of lawlessness let off the chain, the beast of diseases that follow on vice, gout, kidney disease, and so on." (Brothers Karamazov, ii.V.4, "Rebellion")

The problem with focusing on one single aspect of man's nature is that while the explanation of war's causation may be simplified, the simplification ignores cogent explanations put forward by competing theories. For example, an emphasis on man's reason as the cause of war is apt to ignore deep cultural structures that may perpetuate war in the face of the universal appeal to peace, and similarly may ignore inherited pugnacity in some individuals or even in some groups. Similarly, an emphasis on the biological etiology of war can ignore man's intellectual capacity to control, or his will to go against, his predispositions. In other words, human biology can affect thinking (what is thought, how, for what duration and intensity), and can accordingly affect cultural developments, and in turn cultural institutions can affect biological and rational developments (e.g., how strangers are welcomed affects a group's isolation or integration and hence its reproductive gene pool).

The examination of war's causation triggers the need for elaboration on many sub-topics, regardless of the internal logical validity of a proposed explanation. Students of war thus need to explore beyond proffered definitions and explanations to consider the broader philosophical problems that they often conceal.

3. Human Nature and War

A setting to explore the relationship between human nature and war is provided by Thomas Hobbes, who presents a state of nature in which the 'true' or 'underlying' nature of man is likely to come to the fore of our attention. Hobbes is adamant that without an external power to impose laws, the state of nature would be one of immanent warfare. That is, "during the time men live without a common Power to keep them all in awe, they are in that condition which is called Warre; and such a warre, as is of every man, against every man." (Leviathan, 1.13) Hobbes's construction is a useful starting point for discussions on man's natural inclinations and many of the great philosophers who followed him, including Locke, Rousseau, and Kant, agree to some extent or other with his description. Locke rejects Hobbes's complete anarchic and total warlike state but accepts that there will always be people who will take advantage of the lack of legislation and enforcement. Rousseau inverts Hobbes's image to argue that in the state of nature man is naturally peaceful and not belligerent, however when Rousseau elaborates on international politics he is of a similar mind, arguing that states must be active (aggressive) otherwise they decline and founder; war is inevitable and any attempts at peaceful federations are futile. (From Rousseau's notes on L'état de guerre criticizing the earlier pamphlet of the Abbé Saint-Pierre entitled Perpetual Peace, a title Kant later usurps).

Kant's position is that the innate conflict between men and later between states prompts humanity to seek peace and federation. It is not that man's reason alone teaches him the benefits of a pacifistic concord, but that war, which is inevitable when overarching structures are absent, induces men to consider and realize more peaceful arrangements of their affairs, yet even Kant retained a pessimistic conception of mankind: "War...seems to be ingrained in human nature, and even to be regarded as something noble to which man is inspired by his love of honor, without selfish motives." (Perpetual Peace)

Hobbes presents an atomistic conception of humanity, which many disagree with. Communitarians of various hues reject the notion of an isolated individual pitted against others and prompted to seek a contract between themselves for peace. Some critics prefer an organic conception of the community in which the individual's ability to negotiate for peace (through a social contract) or to wage war is embedded in the social structures that form him. Reverting to John Donne's "no man is an island" and to Aristotle's "man is a political animal", proponents seek to emphasize the social connections that are endemic to human affairs, and hence any theoretical construction of human nature, and thus of war, requires an examination of the relevant society man lives in. Since the governing elements of man's nature are thereby relative to time and place, so too is war's nature and ethic, although proponents of this viewpoint can accept the persistence of cultural forms over time. For instance, the communitarian view of war implies that Homeric war is different from war in the Sixteenth Century, but historians might draw upon evidence that the study of Greek warfare in the Iliad may influence later generations in how they conceive themselves and warfare.

Others reject any theorizing on human nature. Kenneth Waltz, for example argues: "While human nature no doubt plays a role in bringing about war, it cannot by itself explain both war and peace, except by the simple statement that sometimes he fights and sometimes he does not." (Man, War, and State), and existentialists deny such an entity is compatible with complete freedom of will (cf. Sartre). This danger here is that this absolves any need to search for commonalties in warriors of different periods and areas, which could be of great benefit both to military historians and peace activists.

4. War and Political and Moral Philosophy

The first port of call for investigating war's morality is the just war theory, which is well discussed and explained in many text books and dictionaries and can also be viewed on the IEP.

However, once the student has considered, or is at least aware of the broader philosophical theories that may relate to war, an analysis of its ethics begins with the question: is war morally justifiable? Again, due notice must be given to conceptions of justice and morality that involve both individuals and groups. War as a collective endeavor engages a co-ordinated activity in which not only the ethical questions of agent responsibility, obedience and delegation are ever present but so too are questions concerning the nature of agency. Can nations be morally responsible for the war's they are involved in, or should only those with the power to declare war be held responsible? Similarly, should individual Field Marshalls be considered the appropriate moral agent or the army as a corporate body? What guilt, if any, should the Private bear for his army's aggression, and likewise what guilt, if any, should a citizen, or even a descendant, bear for his country's war crimes? (And is there such a thing as a 'war crime'?)

Just war theory begins with an assessment of the moral and political criteria for justifying the initiation of war (defensive or aggressive), but critics note that the justice of warfare is already presumed in just war theory: all that is being outlined are the legal, political, and moral criteria for its justice. Thus the initial justice of war requires reflection. Pacifists deny that war, or even any kind of violence, can be morally permissible, but, as with the other positions noted above, a variety of opinions exists here, some admitting the use of war only in defense and as a last resort (defencists) whereas others absolutely do not admit violence or war of any sort (absolutist pacifists). Moving from the pacifist position, other moralists admit the use of war as a means to support, defend, or secure peace, but such positions may permit wars of defense, deterrence, aggression, and intervention for that goal.

Beyond what has been called the pacificistic morality (in which peace is the end goal as distinct from pacifism and its rejection of war as a means), are those theories that establish an ethical value in war. Few consider war should be fought for war's sake, but many writers have supported war as a means to various ends other than peace. For example, as a vehicle to forge national identity, to pursue territorial aggrandizement, or to uphold and strive for a variety of virtues such as glory and honor. In this vein of thought, those who are now characterized as social darwinists and their intellectual kin may be heard extolling the evolutionary benefits of warfare, either for invigorating individuals or groups to pursue the best of their abilities, or to remove weaker members or groups from political ascendancy.

The morality of war traipses into the related area of political philosophy in which conceptions of political responsibility and sovereignty, as well as notions of collective identity and individuality, should be acknowledged and investigated. Connections back to war's causation can also be noted. For example, if the moral code of war concerns the corporate entity of the state, then it is to the existence or behavior of the state that we turn to explain how war's originate. This raises problems concerning the examination of the moral and political responsibility for war's initiation and procedure: if states are war's harbingers, then does it follow that only the state's leaders are morally and politically responsible, or if we accept some element of Humean democracy (namely that governments are always subject to the sanction of the people they rule or represent) then moral and political responsibility extends to the citizenry.

Once war commences, whatever its merits, philosophers disagree on the role, if any, of morality within war. Many have claimed morality is necessarily discarded by the very nature of war including Christian thinkers such as Augustine, whereas others have sought to remind warriors both of the existence of moral relations in war and of various strictures to remain sensitive to moral ends. Sociologically, those going to and coming back from war often go through rites and rituals that symbolize their stepping out of, or back into, civil society, as if their transition is to a different level of morality and agency. War typically involves killing and the threat of being killed, which existentialist writers have drawn on in their examination of war's phenomenology.

For the ethicist, questions begin with identifying morally permissible or justifiable targets, strategies, and weapons-that is, of the principles of discrimination and proportionality. Writers disagree on whether all is fair in war, or whether certain modes of conflict ought to be avoided. The reasons for maintaining some moral dimensions include: the preponderance or expectation of peaceful intercourse on other levels; the mutual benefits of refraining from certain acts and the fear of retaliation in kind; and the existence of treatises and covenants that nations may seek to abide by to maintain international status.

A useful distinction here is between absolute war and total war. Absolute war describes the deployment of all of a society's resources and citizens into working for the war machine. Total war, on the other hand, describes the absence of any restraint in warfare. Moral and political responsibility becomes problematic for proponents of both absolute and total war, for they have to justify the incorporation of civilians who do not work for the war effort as well as the infirm, children, and the handicapped and wounded who cannot fight. Supporters of absolute warfare may argue that membership of a society involves responsibilities for its protection, and if some members are literally unable to assist then all other able-bodied civilians have an absolute duty to do their part. The literature of war propaganda relates well here, as does the penal morality for those who refuse and the definitional politics of the wide range of people who may not wish to fight from conscientious objectors to traitors.

Similar issues dog those who support total warfare in which the military target traditionally sacrosanct people and entities: from non-combatants, women and children, to works of art and heritage buildings. Supporters may evoke the sliding scale that Michael Walzer describes in Just and Unjust Wars, in which graver threats to the body politic may permit the gradual weakening of moral constraints. Curiously, considering his strong emphasis on social virtues, David Hume accepts the abandonment of all notions of justice in war or when the agent's plight is so dire that recourse to any action becomes permissible (cf. Enquiry Concerning the Principles of Morals, sect.3). Others merely state that war and morality do not mix.

5. Summary

The nature of the philosophy of war is complex and this article has sought to establish a broad vision of its landscape and the connections that are endemic to any philosophical analysis of the topic. The subject matter lends itself to metaphysical and epistemological considerations, to the philosophy of mind and of human nature, as well as to the more traditional areas of moral and political philosophy. In many respects the philosophy of war demands a thorough investigation of all aspects of a thinker's beliefs, as well as presenting an indication of a philosopher's position on connected topics. To begin a philosophical discussion of war draws one onto a long and complex intellectual path of study and continual analysis; whereas a cursory announcement of what one thinks on war can be, or points to, the culmination of thoughts on related topics and a deduction from one to the other can and should always be made.


93*s for s.
106
Solve 0 = 238*o + 135*o - 28*o - 89*o - 11520 for o.
45
Solve -2182*q + 57377 = -21175 for q.
36
Solve 86204 = -107*n - 1767*n for n.
-46
Solve 4*d + 5293 - 5121 = 0 for d.
-43
Solve 73*u + 321 + 2815 = 508 for u.
-36
Solve 0 = 1183*l - 48379 - 7222 for l.
47
Solve -7629*q + 7499*q + 1073 = -943 - 584 for q.
20
Solve 0 = 72*k - 2771 - 253 for k.
42
Solve 425*v + 428*v = 259*v - 206*v - 64800 for v.
-81
Solve -4871*q - 2961*q = 1188*q - 604340 for q.
67
Solve 16445*g = 3372*g + 264548 - 22826 + 294271 for g.
41
Solve -17*c + 49*c - 180*c + 17727 - 5443 = 0 for c.
83
Solve 181*k + 3 + 73 + 30 + 75 = 0 for k.
-1
Solve -5892 - 6876 - 3493 + 3907 = -174*i for i.
71
Solve 3979712 = -3*j + 3979637 for j.
-25
Solve 0 = -1032*t - 1503 + 4599 for t.
3
Solve -3476 = 785*j - 3893 - 15283 for j.
20
Solve -10637*i - 1251 = -10220*i for i.
-3
Solve 94*c - 255*c - 585 = -87*c - 89*c for c.
39
Solve -3*r + 78*r + 1941 = -16*r - 3974 for r.
-65
Solve 1739*q + 32991 + 6968 = -30187 + 7542 for q.
-36
Solve -380352*u + 380509*u - 1256 = 0 for u.
8
Solve 225*d - 1214*d - 6179 - 17557 = 0 for d.
-24
Solve 12326*k = 12297*k + 1305 for k.
45
Solve 21446 = -3286*i + 5016 for i.
-5
Solve -111*l + 145*l - 15683 = -255*l - 4701 for l.
38
Solve 0 = -6368*c + 6745*c + 14703 for c.
-39
Solve -444*j - 429*j = -1014*j - 18471 for j.
-131
Solve -9616*n - 285581 + 15067 - 107773 = 150593 for n.
-55
Solve -27148 - 33689 + 23973 = -768*n for n.
48
Solve 1238 - 2708 - 1712 = 74*q for q.
-43
Solve -183*m - 44*m + 12466 = -7841 + 1693 for m.
82
Solve -100*j - 2429 = -3429 for j.
10
Solve 73*d - 3630 = -1137*d for d.
3
Solve 3615*i - 3791*i + 1807 - 5327 = 0 for i.
-20
Solve 0 = 84*t + 935*t - 25475 for t.
25
Solve 0 = 51*d - 42757 - 40915 + 85661 for d.
-39
Solve 114 + 103 = 6*p - 66 - 59 for p.
57
Solve 908*l - 394*l = -7035*l for l.
0
Solve 14681 + 5245 = -1019*x + 1388*x for x.
54
Solve -887*v - 1445*v - 6795 = 23*v + 270 for v.
-3
Solve 877*m - 21018 = 42*m + 151*m + 17286 for m.
56
Solve 316592 = 12138*t - 456292 + 8190 for t.
63
Solve -41*f - 10278 = 117*f + 1414 for f.
-74
Solve 0 = 184*y - 83611 + 61899 for y.
118
Solve 40286 = 522*s - 3562 for s.
84
Solve 0 = 1212*o + 218*o + 45991 + 58399 for o.
-73
Solve -10785 = -2407*w - 51704 for w.
-17
Solve 0 = 1313*b - 6973 - 42921 for b.
38
Solve -297551 = -70*p - 307981 for p.
-149
Solve 28*j - 758 = 655*j + 19933 for j.
-33
Solve 2*o - 8 + 206 = -17*o - 144 for o.
-18
Solve 2435677*y + 2502 = 2435816*y for y.
18
Solve 26 - 345 = 28*v + 465 for v.
-28
Solve 1082*g - 1366*g + 80457 = 1779*g for g.
39
Solve 4455*k + 446 - 1976 = 4506*k for k.
-30
Solve 79*g + 129*g - 99*g = 2943 for g.
27
Solve 1487*i - 15990 = -1120 for i.
10
Solve -125*s - 2816 = 2789 - 14 - 1466 for s.
-33
Solve -45533*z = -46118*z - 7605 for z.
-13
Solve -10498*g + 10449*g - 1867 + 348 = 0 for g.
-31
Solve 698*a - 63*a + 1972 = 98*a - 713 for a.
-5
Solve -11936*c + 903228 - 8028 = 0 for c.
75
Solve 1358*k - 466*k - 1601*k - 77484 = 2813*k for k.
-22
Solve -40*g + 36*g - 75*g = 132*g + 6330 for g.
-30
Solve 0 = -1446*p + 84*p - 23154 for p.
-17
Solve -730*p = 665*p - 1340*p + 385 for p.
-7
Solve 928*l - 40664 = 1526*l for l.
-68
Solve 120 = 18*n - 365 + 35 for n.
25
Solve 26411 = 279*c - 174*c + 268*c + 4777 for c.
58
Solve 4546724 = 80*o + 4543364 for o.
42
Solve 0*n = n - 12510 + 12449 for n.
61
Solve 93044 = -4052*w + 135861 + 232719 for w.
68
Solve -a - 14379 - 17752 = 199*a + 53*a for a.
-127
Solve 35939 = -141*p + 41438 for p.
39
Solve 7*x - 191*x + 7*x = 183*x + 360 for x.
-1
Solve 11136387 - 11134905 = -57*i for i.
-26
Solve -213*t = 128 + 7540 for t.
-36
Solve 901663*b = 901690*b + 162 for b.
-6
Solve 368 + 1467 + 1397 = 99*z + 361 for z.
29
Solve -801*f - 81740 = -120989 for f.
49
Solve -1129*s - 550 = -1118*s for s.
-50
Solve 14468*l - 14612*l + 9360 = 0 for l.
65
Solve 12*f - 344*f = -59*f - 546 for f.
2
Solve 5458*u + 3555*u = -333481 for u.
-37
Solve 3*w + 2*w + 2950 = 56*w + 67*w for w.
25
Solve 749*a + 7181 = -714*a + 1630*a for a.
43
Solve 613*k + 613*k + 451*k + 491*k + 10840 = 0 for k.
-5
Solve -2748*b - 64092 = 86000 + 117391 - 83367 for b.
-67
Solve -7*k + 446121 = 446233 for k.
-16
Solve -140426 = -16553*b - 1558726 - 385977 for b.
-109
Solve -3622*b + 3633*b = 715 for b.
65
Solve 34*f - 1218701 = -1217715 for f.
29
Solve -81*z + 84 = 61*z - 130*z for z.
7
Solve -291*j - 93 = -294*j for j.
31
Solve -20*i + 101 = 351 - 174 - 196 for i.
6
Solve 1020 = -4090780*d + 4090814*d for d.
30
Solve 1219*z - 6860 + 81172 = -1041*z - 104228 for z.
-79
Solve -3220*s - 11017 + 87200 + 33297 = 0 for s.
34
Solve 2264*x + 78848 = -1440*x + 39014 - 108326 for x.
-40
Solve -143*g + 3203 = -3371 - 147 for g.
47
Solve 4609*x - 4600*x = -321 + 33 for x.
-32
Solve -2117*f - 695*f = -95608 for f.
34
Solve 3465 = 628*s - 424*s - 435*s for s.
-15
Solve -610*d - 801815 + 803645 = 0 for d.
3
Solve 0 = 265*u - 162*u - 69*u + 612 for u.
-18
Solve 231609 = 6887*v - 1238*v for v.
41
Solve -528*i - 5073*i + 869*i - 255702 = 8726*i for i.
-19
Solve 150*h + 6*h - 6642 = 15*h - 105*h for h.
27
Solve -277 + 77 = -62950*b + 62975*b for b.
-8
Solve 78*j + 35*j - 2391 = -37*j + 2259 for j.
31
Solve -2089*f = -35482 + 160822 for f.
-60
Solve 63480 = 1075*t - 27227 - 20018 for t.
103
Solve -541672 + 18196 = 9694*q for q.
-54
Solve -2324*o + 136793 + 35498 + 8981 = 0 for o.
78
Solve -7763*x + 7812*x - 1584 + 595 = 1657 for x.
54
Solve -148619*q - 11680 = -148765*q for q.
80
Solve -12453*n + 13576*n - 67380 = 0 for n.
60
Solve 860*x + 29555 + 51689 = 30923 - 52019 for x.
-119
Solve 0 = 878*t + 72*t + 36855 + 29645 for t.
-70
Solve 27*q = 429*q + 8051 + 239 + 22262 for q.
-76
Solve 45*y - 20591 = 394*y for y.
-59
Solve 0 = -2891*r - 10261*r + 960096 for r.
73
Solve 67134 = -481*u + 42603 for u.
-51
Solve 10581 - 1043 + 2357 = 305*x for x.
39
Solve 261223*k + 27193 = 260840*k for k.
-71
Solve 1640*y - 859*y - 69509 = 0 for y.
89
Solve 11500*m - 911148 = 100852 for m.
88
Solve 99*t + 12219 = 8160 for t.
-41
Solve -239*x = -15*x + 12096 for x.
-54
Solve 1754593 = -87*h + 1753897 for h.
-8
Solve -172*b - 210*b = 248*b - 345*b - 4275 for b.
15
Solve -40*w + 6940 = -6*w + 7824 for w.
-26
Solve -116*o - 59*o = 53*o + 10260 for o.
-45
Solve -776*p = 51292 + 60797 - 33713 for p.
-101
Solve 105*u + 73051 - 73366 = 0 for u.
3
Solve -2053*u - 1215*u = 428*u + 166320 for u.
-45
Solve 45401 = -6999*z + 7546*z for z.
83
Solve 3036*v - 57*v + 192880 = -1843*v for v.
-40
Solve -488*m - 19609 = -4813 + 12132 - 4480 for m.
-46
Solve -408*w - 9784 = -46912 for w.
91
Solve -7365*a = 1523 - 56696 - 45930 + 27453 for a.
10
Solve 12130*f - 18059*f = 29645 for f.
-5
Solve 137*b + 4378 + 3517 = 634 for b.
-53
Solve 21*g = -12*g + 59*g + 858 for g.
-33
Solve -1502*v + 3331*v = -6577*v - 327834 for v.
-39
Solve -778*s + 200*s + 26588 = 0 for s.
46
Solve 211*d + 16762 = -281*d - d for d.
-34
Solve 2607*h + 3203*h + 4192*h - 284445 = -533*h for h.
27
Solve 120756 + 88310 = 4862*l for l.
43
Solve -7775*m + 2506*m - 1844*m = 4409*m + 276528 for m.
-24
Solve 12*u = -60*u + 4994 + 3430 for u.
117
Solve 0 = -31913*c + 31921*c + 816 for c.
-102
Solve -169137*p + 169153*p - 1802 = -362 for p.
90
Solve 193*q - 1238 - 1977 = 4373 - 447 for q.
37
Solve -181258*y = -180686*y - 50336 for y.
88
Solve 191*b + 377*b - 647 = 112*b - 191*b for b.
1
Solve -107840 + 193772 = 1023*f for f.
84
Solve 188*h + 6349 + 9477 = -16*h - 182*h for h.
-41
Solve -22404 + 24448 - 33405 = 3983*n + 76180 for n.
-27
Solve -26914 - 39706 = 887*u + 2698 - 10776 for u.
-66
Solve -537*o - 378 = 9*o - 2259 - 303 for o.
4
Solve -3401*l = -68783 - 135277 for l.
60
Solve 5*p + 11 + 173 = -23*p - 852 for p.
-37
Solve 532256 = 184*l + 519744 for l.
68
Solve -252*u + 879*u - 218*u = 313*u - 11808 for u.
-123
Solve 24*i + 27 - 90 = 921 for i.
41
Solve -71 = 7*l - 18 + 59 for l.
-16
Solve 54998*d - 52668 = 55691*d for d.
-76
Solve 760 - 495 + 1499 = -74*k + 32*k for k.
-42
Solve -5711*c + 5483*c + 11856 = 0 for c.
52
Solve 4729*p = 4492*p - 15879 for p.
-67
Solve 22656 = -294*i - 8508 for i.
-106
Solve -523*s = -156*s - 209*s + 7742 for s.
-49
Solve -8*j - 38*j + 43 + 923 = 0 for j.
21
Solve -400344*j = -394994*j - 74900 for j.
14
Solve -309*k


Stats

Mickey picked up her props and examined herself in the mirror with some satisfaction. It was the perfect costume for the evening’s activities –all of them. As she finished adjusting the hem of her skirt Ruth arrived.

“Oh Starr, its perfect!” Ruth gushed as she came into the dressing room eyes wide and smiling. “Turn around for me girl.” Mickey dutifully spun slowly on her toes showing off her costume. “Yes Perfect,” continued Ruth, “The boss will love it! The audience will love it! I love it! Strike a pose for me girl.”

Mickey immediately stared dramatically at the dance director and gracefully adopted a wide fighting stance. She saw Ruth’s breath quicken as the older woman’s eyes feasted on the young dancer. Mickey had no problem balancing in the black mary jane style heels. Though a full four inches high, the thick heel was shorter and much easier to balance on than her normal five inch stilettos. Still, they were of sufficient height to tense her calf muscles nicely, and perfectly formed her smooth toned thighs in their jet black stockings. Mickey could feel the cool air teasing her skin where the stocking tops stopped several inches below the hem of the short grey skirt of her Japanese school costume. Compared to what she had been wearing recently the scandalously short skirt and sailor style top was very conservative.

Ruth stepped forward and gently adjusted Mickey’s hair. Normally Mickey distained pigtails and thought they looked silly, especially on anyone over the age of six, but in this outfit she knew her wild red hair pulled into long pigtails and tied by two black ribbons perfectly complemented the grey sailor-moon type outfit.

But tonight, despite the outfit and hair, Mickey was not portraying the cliché innocent schoolgirl. No. With her black heels, black stockings, and grey suit, Mickey represented the dark and deadly innocent “Babydoll” from the movie Sucker Punch, and if her costume didn’t make that clear her props did. Mickey balanced two deadly realistic swords in her hands. In her left hand she brandished a Wakizashi –the traditional short sword of the Samauri. In her right hand she held its companion, the Katana –the long sword that ancient Japanese law permitted only the warrior class to carry. Together the matched pair, the Daisho, were a deadly combination in the hands of one trained in the deadly martial art of Kenjutsu –traditional Japanese swordsmanship. Holding the swords in a ready position, it was all that Mickey could do to act sultry and sexy and hide the quivering excitement that began burning inside her when she first saw the weapons.

When Mickey had opened the garment bag and saw her costume for the night, it was not the sailor outfit that had made her smile. It was the swords. Of Mickey’s four years in the US Marine Corps, she spent three years stationed at US Marine Air Station Iwakuni in southern Japan. There she had studied Japanese martial arts. Though Mickey was primarily interested in Karate, which she continued to practice as a fifth degree black belt because of its practical value to her career as a cop, she also practiced nitoryu –two sword swordsmanship. While in Japan she became fascinated by the artistry of the samauri swords themselves, and then as she learned karate she was introduced to the martial art of swordsmanship. Over the course of her three years of study she became proficient enough to master the major techniques and combinations of the sword. Now, finding the replica blades, merely intended as props for her dance, was nothing short of divine intervention. Though they did not have a cutting edge, in the hands of the someone who knew how to wield them, the movie reproductions could still be quite useful and dangerous –and Mickey had that knowledge.

All of Mickey’s considerable knowledge and skill was masked by the pleasing smile and somewhat vacant stare she gave Ruth as the dance director beamed happily over the Sucker Punch themed costume. She then had Mickey quickly demonstrate the major moves of the sword dance that was the basis of her stage act.

Satisfied with the dance knowledge implanted through the mind-control programing, Ruth took hold of Mickey’s arms and looked deep into her eyes. Mickey stood submissively, keeping her eyes somewhat glazed and her expression neutral. “You are very special Starr,” Ruth stated softly, her voice hinting at more emotion that the director normally displayed. “After you have finished entertaining Mr. Cardone I’m going to make sure we take special care of you.”

Ruth then leaned in and pressed her lips softly against Mickey’s. She meant it as a good luck kiss, but ever since being teased by the alluring redhead’s lap dance routine she had been tortured by images of the girl kneeling between her knees, and as she kissed her she felt a small flame burst into heat deep inside her. Without thinking, Ruth’s tongue quickly slipped past Mickey’s unresisting lips and she hugged the petite redhead close as the two shared a deep soulful kiss. Mickey’s eyes closed and she moaned softly into the kiss as she let her implanted programing guide her response. For several long monments the two were locked together, Ruth pressing her body tight against Mickey’s curves as her hands cupped the young patrol officer’s face.

Finally, Ruth broke the kiss. She couldn’t believe the effect this girl had on her. She took a deep breath to calm the fire that the innocent kiss started inside her. She had to be careful she reminded herself. “Good luck sister –break a leg! Now get out there, you have ten minutes!”

Ruth left the dressing room and Mickey realized all the other girls had also departed. She was by herself. She set the two swords down and looked in the mirror. For a few seconds she studied the glamorous redheaded vamp who stared back at her and marveled at the contrast with the short-haired brunette tomboy that was her just a few days ago. Then she smiled, twisted the ring on her finger that contained the tiny police radio beacon, picked up her swords and strutted confidently out the door. The sound of her heels clicking loudly in the empty room and following her down the hallway.

-----------------------------------------The 15th in the "Vice" series. Click below to see the start of the series or the previous installment:

Begining of the Story: Chapter 1:

Previous Chapter 14:

See the folder in my gallery for the complete story so far, in order.

(Let me know if you'd like to read and see more of Patrol Officer Mickey's adventures )

Minor point, not that anyone else is likely to care now. A katana is a hand and half sword (meaning that someone about Mickey's size or larger lime myself could wield it one or 2 handed), the nodashi is the full 2-handed Japanese sword.

DAMN DONNA!!! I was expecting something big for the last few images but...DAMN!! Love the Sucker Punch theme to this and the Mary Jane's and stockings are sexy! I really love that look, it is a combination of sultry and "Take one step closer and I will kick your ass!" The pigtails are an interesting look for her, but I like it. I like that Mickey has reasserted herself but still has all of Stars training and a lot of her traits that she falls back into rather quickly. I still want to see how she and the Doctor end up. Would be nice to see her get the girl after all of this is over!


How much money do movies make from aeroplane in-flight entertainment?

One of the great things about flying is the chance to catch up on movies you might have missed at the cinema. But can in-flight entertainment save a theatrical flop?

For while Hollywood studios might not be specifically making films that play well in economy from London to Kuala Lumpur, producers are increasingly realising how easy money from an airline deal can be.

“The numbers are not very high,” admits Stephen Follows, a movie data expert who has studied the figures. “But $2million to sign a deal [putting your film onto an airline’s in-flight entertainment] which doesn’t give you any problems, is as close to free money as you’re going to get.”

None of the costs or risks associated with a normal release apply – no marketing, no schmoozing cinema owners. You just sign a licensing deal and cash the cheque.

“The cost of doing an airline deal is negligible,” adds Follows. “The sales agent will take a percentage and you may need a legal department run through it.”

Neal Rothman is the president of Entertainment in Motion, an independent distributor to the worldwide airline market, who work with companies like Lionsgate (who produced La La Land) and STX Entertainment (known for movies like Bad Moms and Their Finest).

All the entertainment you can choose from as you head to your next destination.

“There’s very little standardisation in terms of how you sell films to airlines,” he says. “It’s a function of negotiation. One of the benchmarks one would use to licence content to airlines would be how many flights they actually have. You use the flight count as a yardstick, or barometer of how you could approach pricing.”

While everyone knows that Hollywood accounting can be opaque, Follows studied dozens of film revenue stream reports to arrive at some conclusions. The difficulty was compounded by the fact that airline revenues are often lumped in with soundtrack sales in a category the studios call Airline & Music. According to his data, a film costing $100m and above, on average, earns $2.7m from its airline deal.

The numbers become potentially higher for films below that budget. With movies costing between $30 and $100m, he found that adventure films earned back 5% of their budget from airline deals, while another genre such as animation, earned back 2.5%. It doesn’t sound big, but if you’re a thirty million dollar picture which has had a small theatrical release, that’s almost a million bucks – nothing to be sniffed at. What’s more, if you have something high quality, it can bring added benefits.

“You could argue that if you’ve got a great film, you want as many people as possible to see it to improve worth-of mouth,” says Follows. “Because if you really enjoyed it, you might go out and buy it on-demand or on DVD.”

But while Ryan Gosling will likely be getting a cheque when La La Land sells to British Airways, it’s not like a Spotify-esque pay-per-view deal.

In-flight entertainment just got so much more entertaining.

“Most airlines will provide content for free to passengers, so there’s no money to share,” says Neal Rothman. “They’ll pay a licence fee for the rights to have the film on board their planes. Most airlines don’t pay based on consumption. It’s not necessarily a blanket deal, many times it’s based on number of flights, but not on viewership.”

“[The airlines] don’t care how many people watch it,” adds Follows.

Nevertheless, airlines continue to spend big on their in-flight entertainment. While it may constitute one of the smaller ancillary markets for the overall box office, in 2012, they spent almost $3billion (the global box office is worth around $30-40bn a year). By 2030, that’s expected to reach $10billion.

This is potentially good news for producers. “There are certain movies that might not work theatrically, but might work very well on airlines,” admits Rothman.

As Rouzie Hassanova, an airline deal specialist at sales agent Mister Smith Entertainment told Screen International, “If you have a good relationship with the airline-rights company, you can see very good returns if they have good relationships with the airlines.”

Still, Follows adds a caveat.

“Take Justice League for an example,” he says. “It’s a brand-new movie and the reviews are not good. But it’s still going to have an airline deal without a problem. But to have an airline deal when you’ve got a small film without many famous people in it that’s not particularly good, why would they go for that? There’s a big drop-off. When you go down the blockbuster scale to medium [budget] films, you start seeing fewer and fewer of them getting to airlines and paying less money.”

“Because no-one flies for the movies,” he continues, “[the airlines] don’t care whether [a film] is good or not. They care whether it’s new and fresh and big.”

So what does work on a tiny screen embedded in the back of someone else’s chair 35,000 feet over the Atlantic?

“Good airline films tend to be fairly safe, not incredibly violent,” says Rothman. “Family-friendly, but airlines tend to think of animated films as films for kids. Films that involve elements of terrorism can be very challenging, because some airlines in some parts of the world want to avoid controversy. Nudity is something that some airlines don’t mind, but the bulk of the airline market does not want to show films with nudity. If you’re designing a film to work for the airline market, it would be something that’s relatively non-controversial.”

All of us though, have sat through any old rubbish in order to make the hours go faster. It’s just unlikely to have been Passenger 57 or Sully. Even airplane peanuts are better than watching them at altitude.


Friday, 25 September 2009

It was someone’s tenth birthday today, and she wanted to go to Le Balmoral Milk Bar the local American 50s diner to celebrate her reaching double digits. Much fun was had by all, particularly when they brought out the cake with a sparking firework spitting out of it.

I saw Betchard blonde on the menu, and decided to go for that with a salade au chèvre chaud. Not exactly diner fare, but it was a good combination.

This bière de terroir hails from Tubize, a small town south of Brussels, and it’s lovely. A very straightforward 5.5% ABV bottle fermented ale, Betchard blonde is crisp on the palate and just a little sweet, but not unpleasantly so. Easy to drink and not demanding, yet full of flavour. I would write more, but it wasn’t a time for making tasting notes. It was a time to celebrate! Hard to believe it’s been a decade.

Wednesday, 23 September 2009

A Phoenician passed by our place at the weekend. Having just arrived from the homeland, he came bearing some tasty gifts, including a few kilos of fantastic fish kebbeh (not the deep-fried ball style, but the flat, baked loaf variety -- extremely rare, I’m told) and four Beirut beers. It seemed an ideal opportunity to invite some other friends over to sample them.

The first two we tried came from the 961 brewery, born during the July 2006 siege of Lebanon, which says a lot about local resourcefulness and entrepreneurial drive, if not an admirable craziness. (961 is the telephone country code for Lebanon, by the way.)

The first was 961 Witbier, which is “inspired by Belgian Witbier”, but I’m afraid it didn’t quite meet that high standard. Comments on this 5.3% brew included, “Hoegaarden gone bad” (Bie), “very bland” (JC), “no taste” (Kostas) and “is this a beer?” (The Phoenician).

“Well, it’s not Nesquick”, said Fi, referring to his regular tipple.

To me, it was over sour, with notes of waterlogged sticks and wet cardboard. To be fair to the beer and the brewery, I honestly think Bie called it right: this beer was probably damaged in transport somehow, either by radical temperature changes or something else.

I had the same thought with the evening’s second offering, 961 Traditional Lager. Like the first, it comes in a lovely bottle with a smart label, but something was off with the taste. The initial aroma was peanut oil -- flashback to the nutty French La Choulette Blonde. Though it had some worthwhile bitter notes and good colour, it tasted mouldy and was suspiciously flat. To me anyway...

Others had different ideas about this one, ranging from, “like Sam Adams, yummy” (Fiona), to, “ugh, sewage and cauliflower” (JC). Bie thought it “smells like pils”. The Beirut taster said it was, “sweeter”, but the one headed to Beirut to join him felt its aftertaste lasted too long. (Happy Anniversary, by the way, you two!)

Beer number three, Almaza Pure Malt, was much more impressive, easily my favourite of the evening. This dark 6% beer showed good fizz, with a simple maltiness and light caramel, gently burnt. Some cola nut notes. I think it strongly resembles Ciney brune. Katka called it, “dark and light at the same time”, which seemed a good description. Everyone agreed it was tasty, the best of the night without question. We're now working on getting some more over here, which may not be as hard as it sounds...

The fourth and final beer of the tasting evening was Almaza Pilsner. I think it is the first canned beer to appear in the 40b40, but I have had it in a bottle many time at a Lebanese restaurant near the office, where I occasionally go for lunch. (OK, maybe a bit more than occasionally...) It’s what I’d call a standard hot-country pilsner. Nothing special. Maybe a bit more yeasty than you’d expect, but in any case, it’s one of those beers that tastes just fine drunk from the bottle on a hot sunny day, like they frequently get in Lebanon.
.
.
.

Tuesday, 22 September 2009

And so we come to the third of three official tastings of northern French bières de garde, which we enjoyed with some friends a few days ago here at 40b40 headquarters in Brussels. Hellemus Blonde des Flandres -- like the brilliant 3 Monts, the acceptable La Goudale, and the nutty La Choulette Blonde -- is a strong blonde ale, this time of 8% ABV.

Continuing with Northern France season here at 40b40 -- after the outstanding 3 Monts and the passable La Goudale -- we move to our third beer in the series, La Choulette Blonde. It’s another strong blonde ale, a bière de garde brewed in the small town of Hordain. For those counting, it weighs in at 7.5% ABV.

The first aroma you get when you pop the cork is peanut butter or peanut brittle -- deep, earthy, oily, warm and sweet. “Fantastic”, said the expert, followed by, “ah, cashew”.

“Gesundheit.”

“Very clear in the bottle and sour to the taste”, said the blond. (Not the beer, obviously, though a few of these, and you might believe the bottle was talking to you.)

To me, it was like peanut oil in the mouth, and almost overpoweringly so. Almost. Not a crazy drink. Just nuts.

The other evening, we had some friends over, and together we sampled a few beers Fiona and I had picked up while in Lille the weekend before. Despite being a bunch of New Yorkers, these guys know a lot about European beers, so we wanted to get their opinions on what northern France has to offer.

After whetting our pallets with 3 Monts, which was very well received, we opened up a 750ml bottle of La Goudale, la bière blonde à l'ancienne. It’s a top-fermented strong blonde ale with 7.2% ABV from Les Brasseurs de Gayant in Douai, France.

The taste is immediately bitter, then slightly syrupy sweet. A bit longer in the mouth and I got a whiff of citrus, and when I mentioned this to the others, the groupthink landed on, “lemon -- the peel or zest, not the acidic part of the lemon, more the long-lasting lemony”.

Still, for me the carbonation level seemed somehow a bit low, and the aroma had not entirely pleasing elements of empty pasta box or a sack of grain. Maybe even burlap or wood glue.

My friend scribbled out “spacious writing” on the common scrap-of-paper tasting notes, a curious thought the depth of which I am only now beginning to consider. He assured me at the time that it actually reads, “spiciness - nutmeg”, which could be, I suppose. They write differently in the big city, after all.

Thursday, 17 September 2009

This is not a tasting entry, sadly, but a short bit of simple news. And good news at that.

Chotěboř, the small town in eastern Bohemia where I lived for a few years and where I met my wife among many other friends, has finally opened up a brewery again. It’s hard to imagine a town in Bohemia without a brewery, and Chotěboř had one from the 13th to, I think, the 20th century, but either the war or the Communists or something forced its closure well before I arrived there in 1992.

But now, the Chotěboř Brewery has opened, producing a variety of beers, and not a bad website either. I am told by my old friends and beer experts in the town that their beer is excellent, and now I am trying to figure out a way to get back there on a tasting weekend.

I see Evan Rail has mentioned it in July post about a newly published beer map for the Czech Republic. Maybe it’s one we can try together when I get out there.

Sunday, 13 September 2009

Just returned from a fantastic weekend in Lille, France, where -- among other things -- we explored the local bières de Garde. These are traditional beers of northern France, and you can easily see the overlap with Belgian beer. It’s part of a cultural continuum of brewing that has been disregarding formal frontiers since long before Schengen.

I bought a number of various brands, all in 750ml bottles as seems to be the custom, but the first one we tried was 3 Monts. It’s brewed just up the road at Saint Sylvestre Cappel, also in the Nord-Pas-de-Calais region, of which Lille is the capital. I was feeling pretty ill in the afternoon, but a good beer and some starch at the baked potato restaurant near our hotel seemed to do the trick.

3 Monts is an outstanding beer. It is basically a strong ale, but it’s drier than average. There’s no syrupy taste like you get with some ales. Instead, it is sharp and clean, with a nice bitter hop finish. Tiny bubble carbonation with some lavender notes that remind me of Deus. But at two or three euros a bottle at the hypermarket, 3 Monts trumps it. 8.5% alcohol, by the way.

And, 3 Monts gets the thumbs up from Fiona as well. 750ml between two rounds off a day nicely.

I’d add 3 Monts to my top ten list, but my list is for Belgian beers. Dare I include it?


Diagnosis of spontaneous bacterial peritonitis: Role of tween 80 and triton X in ascitic fluid cultures.
A patient with alcoholic cirrhosis of the liver, portal hypertension with hepatic encephalopathy and spontaneous bacterial peritonitis (SBP) was admitted in an obtunded condition. Attempts at delineating the aetiology of the SBP using conventional cultures as well as automated systems were not successful. The use of non-anionic surfactant agents such as Tween 80-incorporated blood agar and Triton X treatment of the specimens facilitated the growth of Klebsiella pneumoniae from the ascitic fluid, which otherwise would have been concluded to represent culture-negative neutrocytic ascites. Thus, the use of the aforementioned agents could be explored in elucidating the aetiology of body cavity infections when conventional methods fail.


2010 Morocco Tennis Tour – Tanger – Doubles

Augustin Gensse and Éric Prodon were the defending champions, but they chose to not participate.
Steve Darcis and Dominik Meffert won in the final 5–7, 7–5, [10–7], against Uladzimir Ignatik and Martin Kližan.

Seeds

Draw

Draw

External links
 Main Draw

Morocco Tennis Tour - Tanger - Doubles
Category:Morocco Tennis Tour – Tanger
Category:2010 Morocco Tennis Tour


Master's of Social work student and excellent editor. I suffer from adrenal insufficiency following thirty years of prednisone and want to research how many asthmatics in my generation are undiagnosed or misdiagnosed. I'm also a professional editor.

I recently read about ultra luxury psychiatric retreats that cost over a thousand dollars a day and treat people with anxiety and depressive disorders for longer than a few days. One opinion in the post was that anyone who could be trusted with a phone cord in their room should not be inpatient, let alone staying for a week or two. People staying there were characterized as the "worried well", not people whose genuine psychiatric problems we should take seriously. The argument implied was that this is beyond the standard of care in public hospitals billing insurance, and that was a bad thing. As a mental health professional and a psychiatric patient who needs inpatient care at times, I'm not so sure.

Surely these "retreats" are private pay, profit based organizations of the most obvious kind. But at least they deliver quality care to those who can afford it. Full hour sessions with psychiatrists. Occupational therapy. Group therapy. Relaxation exercises based on Eastern practices (which I take to mean yoga and meditation). Time to form therapeutic rapport with staff treating you. Time for medications to start working. Reasonable assurance that your roommate is not a former murderer who will attempt or carry out murder on you during your stay. (Based on a True Story from my years as a social worker.) Adequate staffing at all, for that matter. Finally, time to stay while you sort out your immediate crisis and transition from crisis to a period when you can plan your life with clarity.

That's an excellent standard of care, compared to the typical level paid for by insurance at the average psychiatric unit. There, you may see your psychiatrist five minutes a day. Nurse staffing is skeletal, and there is nobody to interact meaningfully with as the need arises. Except other patients, which has some benefit but also evident drawbacks, such as other patients not being psychiatric professionals most of the time. Stays limited to two or three days if you are not psychotic, although antipsychotic medications kick in weeks faster than depression and anxiety medications. No real treatment on weekends. And that potentially deadly roommate who does not get one on one staffing.

And where did that low standard of care come from? For-profit hospitals and insurance carriers, of course. They don't pay or charge as much as the retreats, but managed care and profit seeking hospitals have sheared the quality of care away. This happens on medical units too. Just consider the isolated frail elderly person getting outpatient surgery when it is known that there will be nobody to care for them at home. Insurers do not even provide parity coverage for mental health treatment, which increases the problem. So the standard step down units of fifteen years ago that provided separate levels of care for critically ill/dangerous patients and patients transitioning from crisis to outpatient care are gone. Staffing is pared to a minimum to cut costs. Psychiatrist time is deemed too expensive for patients to do any meaningful work or understand their medications. Admission criteria ban the seriously but not dangerously mentally ill from inpatient care entirely, as if there can be no benefit to inpatient treatment beyond incarceration. Since the for profit health care trend began twenty years ago, the quality of all patient care has taken a nosedive. Due to non-parity, psychiatric patients are hit hardest of all.


Q:

Save all Jenkins jobs to a repository

I have 15 Jenkins jobs configured in order to implement a specific flow. I am improving and editing these jobs as time goes by.
Is there a way to save all these jobs and its configurations to a repository or at least in the form of export jobs, save it and import when needed?

A:

There are two plugins that will help you save Jenkins jobs, "SCM Sync configuration" and "JobConfigHistory" defined at the wiki.jenkins-ci.org website.
SCM Sync Configuration Plugin (which keeps the config in a SCM repository)
or
Job Config History Plugin (Saves copies of all job and system configurations)


/*
 * Copyright 2013 (C) James Dempsey <jdempsey@users.sourceforge.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
/**
 * The pcgen.gui2.equip package contains the classes used to populate the equipment
 * customizer dialog.
 *
 *
 */
package pcgen.gui2.equip;


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.druid.server.http;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.net.HostAndPort;
import com.google.inject.Inject;
import com.sun.jersey.spi.container.ResourceFilters;
import org.apache.druid.audit.AuditInfo;
import org.apache.druid.audit.AuditManager;
import org.apache.druid.common.utils.ServletResourceUtils;
import org.apache.druid.guice.annotations.Json;
import org.apache.druid.guice.annotations.Smile;
import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.RE;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.query.lookup.LookupsState;
import org.apache.druid.server.http.security.ConfigResourceFilter;
import org.apache.druid.server.lookup.cache.LookupCoordinatorManager;
import org.apache.druid.server.lookup.cache.LookupExtractorFactoryMapContainer;

import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * Contains information about lookups exposed through the coordinator
 */
@Path("/druid/coordinator/v1/lookups")
@ResourceFilters(ConfigResourceFilter.class)
public class LookupCoordinatorResource
{
  private static final Logger LOG = new Logger(LookupCoordinatorResource.class);
  private final LookupCoordinatorManager lookupCoordinatorManager;
  private final ObjectMapper smileMapper;
  private final ObjectMapper jsonMapper;

  @Inject
  public LookupCoordinatorResource(
      final LookupCoordinatorManager lookupCoordinatorManager,
      final @Smile ObjectMapper smileMapper,
      final @Json ObjectMapper jsonMapper
  )
  {
    this.smileMapper = smileMapper;
    this.jsonMapper = jsonMapper;
    this.lookupCoordinatorManager = lookupCoordinatorManager;
  }

  @GET
  @Path("/config")
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  public Response getTiers(
      @DefaultValue("false") @QueryParam("discover") boolean discover
  )
  {
    try {
      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> knownLookups =
          lookupCoordinatorManager.getKnownLookups();
      if (discover) {
        final Set<String> discovered = new HashSet<>(lookupCoordinatorManager.discoverTiers());
        if (knownLookups != null) {
          discovered.addAll(knownLookups.keySet());
        }
        return Response.ok().entity(discovered).build();
      }

      if (knownLookups == null) {
        return Response.status(Response.Status.NOT_FOUND).build();
      } else {
        return Response.ok().entity(knownLookups.keySet()).build();
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error getting list of lookups");
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/config/all")
  public Response getAllLookupSpecs()
  {
    try {
      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> knownLookups = lookupCoordinatorManager
          .getKnownLookups();
      if (knownLookups == null) {
        return Response.status(Response.Status.NOT_FOUND).build();
      } else {
        return Response.ok().entity(knownLookups).build();
      }
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting lookups status");
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @POST
  @Path("/config")
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Consumes({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  public Response updateAllLookups(
      InputStream in,
      @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author,
      @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment,
      @Context HttpServletRequest req
  )
  {
    try {
      final boolean isSmile = SmileMediaTypes.APPLICATION_JACKSON_SMILE.equals(req.getContentType());
      final ObjectMapper mapper = isSmile ? smileMapper : jsonMapper;
      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> map;
      try {
        map = mapper.readValue(in, new TypeReference<Map<String, Map<String, LookupExtractorFactoryMapContainer>>>()
        {
        });
      }
      catch (IOException e) {
        return Response.status(Response.Status.BAD_REQUEST).entity(ServletResourceUtils.sanitizeException(e)).build();
      }
      if (lookupCoordinatorManager.updateLookups(map, new AuditInfo(author, comment, req.getRemoteAddr()))) {
        return Response.status(Response.Status.ACCEPTED).entity(map).build();
      } else {
        throw new RuntimeException("Unknown error updating configuration");
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error creating new lookups");
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @DELETE
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Path("/config/{tier}")
  public Response deleteTier(
      @PathParam("tier") String tier,
      @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author,
      @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment,
      @Context HttpServletRequest req
  )
  {
    try {
      if (Strings.isNullOrEmpty(tier)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`tier` required")))
                       .build();
      }

      if (lookupCoordinatorManager.deleteTier(tier, new AuditInfo(author, comment, req.getRemoteAddr()))) {
        return Response.status(Response.Status.ACCEPTED).build();
      } else {
        return Response.status(Response.Status.NOT_FOUND).build();
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error deleting tier [%s]", tier);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @DELETE
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Path("/config/{tier}/{lookup}")
  public Response deleteLookup(
      @PathParam("tier") String tier,
      @PathParam("lookup") String lookup,
      @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author,
      @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment,
      @Context HttpServletRequest req
  )
  {
    try {
      if (Strings.isNullOrEmpty(tier)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`tier` required")))
                       .build();
      }

      if (Strings.isNullOrEmpty(lookup)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new IAE("`lookup` required")))
                       .build();
      }

      if (lookupCoordinatorManager.deleteLookup(tier, lookup, new AuditInfo(author, comment, req.getRemoteAddr()))) {
        return Response.status(Response.Status.ACCEPTED).build();
      } else {
        return Response.status(Response.Status.NOT_FOUND).build();
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error deleting lookup [%s]", lookup);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @POST
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Path("/config/{tier}/{lookup}")
  public Response createOrUpdateLookup(
      @PathParam("tier") String tier,
      @PathParam("lookup") String lookup,
      @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author,
      @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment,
      InputStream in,
      @Context HttpServletRequest req
  )
  {
    try {
      if (Strings.isNullOrEmpty(tier)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`tier` required")))
                       .build();
      }

      if (Strings.isNullOrEmpty(lookup)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new IAE("`lookup` required")))
                       .build();
      }
      final boolean isSmile = SmileMediaTypes.APPLICATION_JACKSON_SMILE.equals(req.getContentType());
      final ObjectMapper mapper = isSmile ? smileMapper : jsonMapper;
      final LookupExtractorFactoryMapContainer lookupSpec;
      try {
        lookupSpec = mapper.readValue(in, LookupExtractorFactoryMapContainer.class);
      }
      catch (IOException e) {
        return Response.status(Response.Status.BAD_REQUEST).entity(ServletResourceUtils.sanitizeException(e)).build();
      }
      if (lookupCoordinatorManager.updateLookup(
          tier,
          lookup,
          lookupSpec,
          new AuditInfo(author, comment, req.getRemoteAddr())
      )) {
        return Response.status(Response.Status.ACCEPTED).build();
      } else {
        throw new RuntimeException("Unknown error updating configuration");
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error updating tier [%s] lookup [%s]", tier, lookup);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Path("/config/{tier}/{lookup}")
  public Response getSpecificLookup(
      @PathParam("tier") String tier,
      @PathParam("lookup") String lookup
  )
  {
    try {
      if (Strings.isNullOrEmpty(tier)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`tier` required")))
                       .build();
      }
      if (Strings.isNullOrEmpty(lookup)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`lookup` required")))
                       .build();
      }
      final LookupExtractorFactoryMapContainer map = lookupCoordinatorManager.getLookup(tier, lookup);
      if (map == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.sanitizeException(new RE("lookup [%s] not found", lookup)))
                       .build();
      }
      return Response.ok().entity(map).build();
    }
    catch (Exception e) {
      LOG.error(e, "Error getting lookup [%s]", lookup);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
  @Path("/config/{tier}")
  public Response getSpecificTier(
      @PathParam("tier") String tier,
      @DefaultValue("false") @QueryParam("detailed") boolean detailed

  )
  {
    try {
      if (Strings.isNullOrEmpty(tier)) {
        return Response.status(Response.Status.BAD_REQUEST)
                       .entity(ServletResourceUtils.sanitizeException(new NullPointerException("`tier` required")))
                       .build();
      }
      final Map<String, Map<String, LookupExtractorFactoryMapContainer>> map = lookupCoordinatorManager.getKnownLookups();
      if (map == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.sanitizeException(new RE("No lookups found")))
                       .build();
      }
      final Map<String, LookupExtractorFactoryMapContainer> tierLookups = map.get(tier);
      if (tierLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.sanitizeException(new RE("Tier [%s] not found", tier)))
                       .build();
      }
      if (detailed) {
        return Response.ok().entity(tierLookups).build();
      } else {
        return Response.ok().entity(tierLookups.keySet()).build();
      }
    }
    catch (Exception e) {
      LOG.error(e, "Error getting tier [%s]", tier);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(e)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/status")
  public Response getAllLookupsStatus(
      @QueryParam("detailed") boolean detailed
  )
  {
    try {
      Map<String, Map<String, LookupExtractorFactoryMapContainer>> configuredLookups = lookupCoordinatorManager
          .getKnownLookups();
      if (configuredLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("No lookups found"))
                       .build();
      }

      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnNodes = lookupCoordinatorManager
          .getLastKnownLookupsStateOnNodes();

      Map<String, Map<String, LookupStatus>> result = new HashMap<>();

      for (Map.Entry<String, Map<String, LookupExtractorFactoryMapContainer>> tierEntry : configuredLookups.entrySet()) {
        String tier = tierEntry.getKey();
        Map<String, LookupStatus> lookupStatusMap = new HashMap<>();
        result.put(tier, lookupStatusMap);
        Collection<HostAndPort> hosts = lookupCoordinatorManager.discoverNodesInTier(tier);

        for (Map.Entry<String, LookupExtractorFactoryMapContainer> lookupsEntry : tierEntry.getValue().entrySet()) {
          lookupStatusMap.put(
              lookupsEntry.getKey(),
              getLookupStatus(
                  lookupsEntry.getKey(),
                  lookupsEntry.getValue(),
                  hosts,
                  lookupsStateOnNodes,
                  detailed
              )
          );
        }
      }

      return Response.ok(result).build();
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting lookups status");
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/status/{tier}")
  public Response getLookupStatusForTier(
      @PathParam("tier") String tier,
      @QueryParam("detailed") boolean detailed
  )
  {
    try {
      Map<String, Map<String, LookupExtractorFactoryMapContainer>> configuredLookups = lookupCoordinatorManager
          .getKnownLookups();
      if (configuredLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("No lookups found"))
                       .build();
      }

      Map<String, LookupExtractorFactoryMapContainer> tierLookups = configuredLookups.get(tier);
      if (tierLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("No lookups found for tier [%s].", tier))
                       .build();
      }

      Map<String, LookupStatus> lookupStatusMap = new HashMap<>();
      Collection<HostAndPort> hosts = lookupCoordinatorManager.discoverNodesInTier(tier);

      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnNodes = lookupCoordinatorManager
          .getLastKnownLookupsStateOnNodes();

      for (Map.Entry<String, LookupExtractorFactoryMapContainer> lookupsEntry : tierLookups.entrySet()) {
        lookupStatusMap.put(
            lookupsEntry.getKey(),
            getLookupStatus(lookupsEntry.getKey(), lookupsEntry.getValue(), hosts, lookupsStateOnNodes, detailed)
        );
      }

      return Response.ok(lookupStatusMap).build();
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting lookups status for tier [%s].", tier);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/status/{tier}/{lookup}")
  public Response getSpecificLookupStatus(
      @PathParam("tier") String tier,
      @PathParam("lookup") String lookup,
      @QueryParam("detailed") boolean detailed
  )
  {
    try {
      Map<String, Map<String, LookupExtractorFactoryMapContainer>> configuredLookups = lookupCoordinatorManager
          .getKnownLookups();
      if (configuredLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("No lookups found"))
                       .build();
      }

      Map<String, LookupExtractorFactoryMapContainer> tierLookups = configuredLookups.get(tier);
      if (tierLookups == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("No lookups found for tier [%s].", tier))
                       .build();
      }

      LookupExtractorFactoryMapContainer lookupDef = tierLookups.get(lookup);
      if (lookupDef == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("Lookup [%s] not found for tier [%s].", lookup, tier))
                       .build();
      }

      return Response.ok(
          getLookupStatus(
              lookup,
              lookupDef,
              lookupCoordinatorManager.discoverNodesInTier(tier),
              lookupCoordinatorManager.getLastKnownLookupsStateOnNodes(),
              detailed
          )
      ).build();
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting lookups status for tier [%s] and lookup [%s].", tier, lookup);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @VisibleForTesting
  LookupStatus getLookupStatus(
      String lookupName,
      LookupExtractorFactoryMapContainer lookupDef,
      Collection<HostAndPort> nodes,
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lastKnownLookupsState,
      boolean detailed
  )
  {
    boolean isReady = true;
    List<HostAndPort> pendingHosts = detailed ? new ArrayList<>() : null;

    for (HostAndPort node : nodes) {
      LookupsState<LookupExtractorFactoryMapContainer> hostState = lastKnownLookupsState.get(node);
      LookupExtractorFactoryMapContainer loadedOnHost = hostState != null
                                                        ? hostState.getCurrent().get(lookupName)
                                                        : null;
      if (loadedOnHost == null || lookupDef.replaces(loadedOnHost)) {
        isReady = false;
        if (detailed) {
          pendingHosts.add(node);
        } else {
          break;
        }
      }
    }

    return new LookupStatus(isReady, pendingHosts);
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/nodeStatus")
  public Response getAllNodesStatus(
      @QueryParam("discover") boolean discover,
      @QueryParam("detailed") @Nullable Boolean detailed
  )
  {
    boolean full = detailed == null || detailed;

    try {
      Collection<String> tiers;
      if (discover) {
        tiers = lookupCoordinatorManager.discoverTiers();
      } else {
        Map<String, Map<String, LookupExtractorFactoryMapContainer>> configuredLookups = lookupCoordinatorManager
            .getKnownLookups();
        if (configuredLookups == null) {
          return Response.status(Response.Status.NOT_FOUND)
                         .entity(ServletResourceUtils.jsonize("No lookups configured."))
                         .build();
        }
        tiers = configuredLookups.keySet();
      }

      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnHosts =
          lookupCoordinatorManager.getLastKnownLookupsStateOnNodes();

      final Map result;
      if (full) {
        result = getDetailedAllNodeStatus(lookupsStateOnHosts, tiers);
      } else {
        // lookups to load per host by version
        result = getSimpleAllNodeStatus(lookupsStateOnHosts, tiers);
      }
      return Response.ok(result).build();
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting node status.");
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/nodeStatus/{tier}")
  public Response getNodesStatusInTier(
      @PathParam("tier") String tier
  )
  {
    try {
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnHosts = lookupCoordinatorManager
          .getLastKnownLookupsStateOnNodes();

      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> tierNodesStatus = new HashMap<>();

      Collection<HostAndPort> nodes = lookupCoordinatorManager.discoverNodesInTier(tier);

      for (HostAndPort node : nodes) {
        LookupsState<LookupExtractorFactoryMapContainer> lookupsState = lookupsStateOnHosts.get(node);
        if (lookupsState == null) {
          tierNodesStatus.put(node, new LookupsState<>(null, null, null));
        } else {
          tierNodesStatus.put(node, lookupsState);
        }
      }

      return Response.ok(tierNodesStatus).build();
    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting node status for tier [%s].", tier);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  @GET
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/nodeStatus/{tier}/{hostAndPort}")
  public Response getSpecificNodeStatus(
      @PathParam("tier") String tier,
      @PathParam("hostAndPort") HostAndPort hostAndPort
  )
  {
    try {
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnHosts = lookupCoordinatorManager
          .getLastKnownLookupsStateOnNodes();

      LookupsState<LookupExtractorFactoryMapContainer> lookupsState = lookupsStateOnHosts.get(hostAndPort);
      if (lookupsState == null) {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(ServletResourceUtils.jsonize("Node [%s] status is unknown.", hostAndPort))
                       .build();
      } else {
        return Response.ok(lookupsState).build();
      }

    }
    catch (Exception ex) {
      LOG.error(ex, "Error getting node status for [%s].", hostAndPort);
      return Response.serverError().entity(ServletResourceUtils.sanitizeException(ex)).build();
    }
  }

  /**
   * Build 'simple' lookup cluster status, broken down by tier, host, and then the {@link LookupsState} with
   * the lookup name and version ({@link LookupExtractorFactoryMapContainer#version})
   */
  private Map<String, Map<HostAndPort, LookupsState<String>>> getSimpleAllNodeStatus(
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnHosts,
      Collection<String> tiers
  )
  {
    Map<String, Map<HostAndPort, LookupsState<String>>> results = new HashMap<>();
    for (String tier : tiers) {
      Map<HostAndPort, LookupsState<String>> tierNodesStatus = new HashMap<>();
      results.put(tier, tierNodesStatus);

      Collection<HostAndPort> nodes = lookupCoordinatorManager.discoverNodesInTier(tier);

      for (HostAndPort node : nodes) {
        LookupsState<LookupExtractorFactoryMapContainer> lookupsState = lookupsStateOnHosts.get(node);
        if (lookupsState == null) {
          tierNodesStatus.put(node, new LookupsState<>(null, null, null));
        } else {
          Map<String, String> current = lookupsState.getCurrent()
                                                    .entrySet()
                                                    .stream()
                                                    .collect(
                                                        Collectors.toMap(
                                                            Map.Entry::getKey,
                                                            e -> e.getValue().getVersion()
                                                        )
                                                    );
          Map<String, String> toLoad = lookupsState.getToLoad()
                                                   .entrySet()
                                                   .stream()
                                                   .collect(
                                                       Collectors.toMap(
                                                           Map.Entry::getKey,
                                                           e -> e.getValue().getVersion()
                                                       )
                                                   );
          tierNodesStatus.put(node, new LookupsState<>(current, toLoad, lookupsState.getToDrop()));
        }
      }
    }
    return results;
  }

  /**
   * Build 'detailed' lookup cluster status, broken down by tier, host, and then the full {@link LookupsState} with
   * complete {@link LookupExtractorFactoryMapContainer} information.
   */
  private Map<String, Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>>> getDetailedAllNodeStatus(
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> lookupsStateOnHosts,
      Collection<String> tiers
  )
  {
    Map<String, Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>>> result = new HashMap<>();
    for (String tier : tiers) {
      Map<HostAndPort, LookupsState<LookupExtractorFactoryMapContainer>> tierNodesStatus = new HashMap<>();
      result.put(tier, tierNodesStatus);

      Collection<HostAndPort> nodes = lookupCoordinatorManager.discoverNodesInTier(tier);

      for (HostAndPort node : nodes) {
        LookupsState<LookupExtractorFactoryMapContainer> lookupsState = lookupsStateOnHosts.get(node);
        if (lookupsState == null) {
          tierNodesStatus.put(node, new LookupsState<>(null, null, null));
        } else {
          tierNodesStatus.put(node, lookupsState);
        }
      }
    }
    return result;
  }

  @VisibleForTesting
  static class LookupStatus
  {
    @JsonProperty
    private boolean loaded;

    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<HostAndPort> pendingNodes;

    public LookupStatus(boolean loaded, List<HostAndPort> pendingHosts)
    {
      this.loaded = loaded;
      this.pendingNodes = pendingHosts;
    }

    @Override
    public boolean equals(Object o)
    {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      LookupStatus that = (LookupStatus) o;
      return Objects.equals(loaded, that.loaded) &&
             Objects.equals(pendingNodes, that.pendingNodes);
    }

    @Override
    public int hashCode()
    {
      return Objects.hash(loaded, pendingNodes);
    }
  }
}


What a racket!

The United States Tennis Association cheated the city out of more than $300,000 in rent by under-reporting its revenues by at least $31 million, according to a blistering report by the City Comptroller released as the organization holds its famed US Open event.

The undercount from 2014-2017 means that the USTA owes the city at least $311,000 from its operation of the sprawling Billie Jean King National Tennis Center at the Flushing Meadows Park in Corona.

Additionally, the Comptroller’s Office said its review found additional evidence that USTA potentially failed to report an additional $8 million in revenue, which could bring the undercount up to $39 million.

“An organization as revenue rich as the USTA should not be fudging its finances and should not be nickel and diming New York City,” said Comptroller Scott Stringer at a Thursday press conference. “But they are, and it’s at New York City’s expense.”

The watchdog discovered the undercounting during a routine audit of the deal, officials said.

Stringer’s office released the report during the opening week of the US Open, the USTA’s premier annual tournament at the Tennis Center.

Under its deal with the city, USTA must pay $400,000 in annual rent plus 1% of revenues when the Tennis Center complex generates more than $20 million in receipts.

“When you underreport income and you don’t give the money that’s owed to the city, who are you hurting here,” asked Stringer. “You’re hurting the children, you’re hurting people in communities.”

The Comptroller’s Office also scalded the Parks Department for failing to properly oversee the 99-year lease that allows the USTA to operate the tennis center, finding the agency often accepted UTSA’s financial statements at “face value.”

“While we will be taking the recommendations from the report under advisement, we continue to maintain a positive relationship with [the tennis center],” Parks spokeswoman Meghan Lalor said.

Parks officials also said that the USTA has paid back half of the owed revenue, $143,297.

“We were incredibly cooperative,” said Danny Zausner, a top USTA official at the Tennis Center, when asked for comment. “That he chose the US Open period to grandstand about miscellaneous things is disappointing.”

He said the organization disputes the Comptroller’s findings and only believes they owe roughly half of the money — which the Parks Department confirmed it received a check for.

“They’re entitled to their opinion, but we don’t necessarily agree with it,” Zausner said.

But, he added: “When we’re wrong, we’re wrong and to some of these things we’ve agreed to make changes.”


Q:

Partial fraction of $\frac{s}{(s^2+2s+2)(s^2-2s+2)}$

I am trying to find the partial fraction of:
$$\frac{s}{(s^2+2s+2)(s^2-2s+2)}$$
I started off with:
$$\frac{A(s^2-2s+2)}{s^2+2s+2} + \frac{B(s^2+2s+2)}{s^2-2s+2}$$
After that I get the following equations:
$A+B = 0$; $-2A+2B =1$
Giving: $A=-B$, and secondly $4B=1$, Hence:
$A=-\frac{1}{4}$ and $B=\frac{1}{4}$
But is this correct?

A:

Let $$\frac{s}{(s^2+2s+2)(s^2-2s+2)}=\frac{A(s^2+2s+2)+B(s^2-2s+2)}{(s^2+2s+2)(s^2-2s+2)}$$
The solutions to $$s^2+2s+2=0\space\text{are}\space s=-1\pm i$$
Using $s=-1+i$, we find $-1+i=B(4-4i)$, yielding $B=-\frac 14$.
Moreover, the solutions to$$s^2-2s+2=0\space\text{are}\space s=1\pm i$$
Using $s=1+i$, we get $1+i=A(4+4i)$, yielding $A=\frac 14$. Hence we can say that:
$$\frac{s}{(s^2+2s+2)(s^2-2s+2)}=\frac{1}{4(s^2-2s+2)}-\frac{1}{4(s^2+2s+2)}$$
Both graphed here