id
stringlengths 50
55
| text
stringlengths 54
694k
|
---|---|
global_05_local_5_shard_00000035_processed.jsonl/30336
|
Alternate title: historical particularism
particularism, also called historical particularism, school of anthropological thought associated with the work of Franz Boas and his students (among them A.L. Kroeber, Ruth Benedict, and Margaret Mead), whose studies of culture emphasized the integrated and distinctive way of life of a given people. Particularism stood in opposition to theories such as cultural evolution, Kulturkreis, and geographical or environmental determinism, all of which sought to discover for the social sciences a series of general laws analogous to those in the physical sciences (such as the laws of thermodynamics or gravity).
Boas’s own work emphasized studies of individual cultures, each based on its unique history. He held that the anthropologist’s primary assignment was to describe the particular characteristics of a given culture with a view toward reconstructing the historical events that led to its present structure. Implicit in this approach was the notion that resolving hypotheses regarding evolutionary development and the influence of one culture on another should be secondary to the careful and exhaustive study of particular societies. Boas urged that the historical method, based on the description of particular culture traits and elements, supplant the comparative method of the evolutionists, who used their data to rank cultures in an artificial hierarchy of achievement. He rejected the assumption of a single standard of achievement to which all cultures could be compared, instead advocating cultural relativism, the position that all cultures are equally able to meet the needs of their members.
Under Boas’s influence, the particularist approach dominated American anthropology for the first half of the 20th century. From World War II through the 1970s, it was eclipsed by neoevolutionism and a variety of other theories. However, the particularist approach, if not the term itself, reemerged in the 1980s as scholars began to recognize that distinctive historical processes differentiate peoples even in the era of globalization.
What made you want to look up particularism?
(Please limit to 900 characters)
MLA style:
"particularism". Encyclopædia Britannica. Encyclopædia Britannica Online.
APA style:
particularism. (2015). In Encyclopædia Britannica. Retrieved from
Harvard style:
particularism. 2015. Encyclopædia Britannica Online. Retrieved 03 June, 2015, from
Chicago Manual of Style:
Encyclopædia Britannica Online, s. v. "particularism", accessed June 03, 2015,
Editing Tools:
We welcome suggested improvements to any of our articles.
• MLA
• APA
• Harvard
• Chicago
You have successfully emailed this.
Error when sending the email. Try again later.
Or click Continue to submit anonymously:
|
global_05_local_5_shard_00000035_processed.jsonl/30338
|
skandha, ( Sanskrit: “aggregates”) Pāli Khandha, according to Buddhist thought, the five elements that sum up the whole of an individual’s mental and physical existence. The self (or soul) cannot be identified with any one of the parts, nor is it the total of the parts. They are: (1) matter, or body (rūpa), the manifest form of the four elements—earth, air, fire, and water; (2) sensations, or feelings (vedanā); (3) perceptions of sense objects (Sanskrit: saṃjñā; Pāli: saññā); (4) mental formations (saṃskāras/sankhāras); and (5) awareness, or consciousness, of the other three mental aggregates (vijñāna/viññāṇa). All individuals are subject to constant change, as the elements of consciousness are never the same, and man may be compared to a river, which retains an identity, though the drops of water that make it up are different from one moment to the next.
|
global_05_local_5_shard_00000035_processed.jsonl/30339
|
House of Lords Journal Volume 5: 13 June 1642
Pages 127-130
Page 127
Page 128
Page 129
Page 130
Table of contents
DIE Lunæ, videlicet, 13 die Junii.
The Lord North was appointed to sit as Speaker this Day.
Letter from Lord Willoughby of Parham to the E. of Essex, desiring to know if the Lord Keeper voted against the Ordinance for the Militia.
The Earl of Essex produced a Letter, written to him from the Lord Willoughby of Parham:
"He desires to be informed certainly, whether the Lord Keeper gave his Vote for the Passing of the Ordinance concerning the Militia; His Majesty laying it upon his Lordship's Ignorance: He hopes to give a good Account for the putting the Militia into Execution."
Next, a Copy of the King's Letter to his Lordship was read.
The King's Letter to Lord Willoughby of Parham, to desist putting the Militia in Execution.
"Right Trusty and Well-beloved, We Greet you well. Though We could not but rest much unsatisfied that Our last Gracious Letter could work no better Effects in you, but that you remain still obstinate in pursuing those illegal Commands you have received from both Houses; yet, since We perceive that you have some colourable Excuse for this your great Error, upon the mistaking of what was the Opinion of the Lord Keeper and the Lord Chief Justice Banks upon this Particular, the One having voted clearly against it, and the other having never declared his Opinion therein, it having never been sought, and to this Hour having done nothing in the Prosecution thereof, as by their several Letters will most clearly appear unto you: Therefore We are pleased once again to lay Our Commands upon you, that, seeing the Grounds whereon you build your Error hath been thus mistaken by you, We cannot doubt of your Obedience in retiring from these unlawful Ways you have suffered yourself to run into by this Mistaking: As likewise We cannot but observe unto you the strange exorbitant Power which the Two Houses at this Time, misled by a few factious malicious Spirits, pretend to arrogate to themselves, and by which the Militia (as they call it) is put in Execution; it being so supreme and absolute, that Our Consent is not thought necessary for the Execution of any Thing they judge to be convenient for the Welfare of the Kingdom, of which as We hope you are ignorant, so doubt not but, it being made known unto you by Us, it will be more than a sufficient Ground to make you desist from those illegal, undutiful, upon so much Knowledge by Warning, and (therefore) unsafe Ways.
"Given at Our Court at Yorke, the 7th of June, 1642.
"To the Lord Willoughby of Parham."
Ordered, To be referred to the Consideration of the Committee of both Houses, to draw up the Declaration concerning Beckwith.
Message to the H. C. for a Conference on these Letters, and about the Lord Lieutenans going to Ireland.
A Message was sent to the House of Commons, by Serjeant Ayliff and Serjeant Fynch:
To desire a Conference concerning Letters received from the Lord Willo. of Parham.
Secondly, Concerning the Lord Lieutenant's going for Ireland.
Letters and Papers relative to Lord Willoughby in Lincolnshire, read.
Next, the Copy of the Lord Keeper's Letter, written to the Lord Willoughby, was read; and divers other Letters written to his Lordship: One from Sir Wm. Terwitt, who denied to deliver the Magazine of the County of Lyncolne, which was under his Custody, to the Lord Willoughby, though he was served with the Order of Parliament. Wm. Booth, the King's Warrant to him.
Message from the H. C. with Instructions for their Committee going to Lincolnshire;
1. To represent to their Lordships some Instructions to be given to a Committee of their House, to be sent into Lyncolneshire, and desire their Lordships Concurrence therein.
with Names of Deputy Lieutenants;
2. Desire their Lordships Concurrence, to approve of
Sir Edw. Boyce,
Mr. Ricd. Browne,
Agreed to.
(fn. 1) To be Deputy Lieutenants for the County of Kent.
Sir Edw. Peto,
Godfry Bosevile,
Anth. Stoughto,
Agreed to.
To be Deputy Lieutenants for the County of Warwicke.
and for a Conference about the Lincolnshire and Leicestershire Militia.
3. To desire a Conference, concerning some Informations received touching Proceedings in the Execution of the Militia in Lyncolneshire and Leycestershire.
The Instructions were read. (Here enter them.)
Agreed to.
The Answer returned was:
Answer to the H. C.
That this House agrees to all the Particulars of this Message.
The Effect of what should be delivered at this Conference touching the Earl of Leycester's going for Ireland, was read, and approved of by this House.
(Here enter it.)
Message to the H. C. for Information about the Somersetshire Petition against the Proceedings of Parliament.
A Message was brought from the House of Commons, by Mr. Strode:
To desire that, at this Conference, the House of Commons may impart to their Lordships the Particulars concerning a Petition which is now in framing in Som'settshire, against the Proceedings of Parliament.
Ordered, That this be a Part of this Conference.
Report from the Committee in London.
The Lords Committees that went into London on Saturday last reported, "That they gave the City Thanks for their chearful lending of the One Hundred Thousand Pounds to the Parliament, for the Occasions of Ireland; and likewise have communicated to them the Propositions, which (fn. 2) they received with much Readiness; and also they acquainted them with the Informations from Amsterdam, concerning the Warlike Preparations prepared there for the King."
Lord Willoughby to take Possession of the Magazine at Lincoln. Sir P. Tirwit and Sir W. Pelham sent for as Delinquents.
Ordered, That the Lord Willoughby of Parham shall take into his Custody the Magazine of the County of Lyncolne, in the Hands of Sir Phillip Terwitt and Sir Wm. Pelham, according to the former Order of this House; and Sir Phil. Terwitt and Sir Wm. Pelham to be sent for, as Delinquents.
E. of Essex to answer Lord Willoughby's Letter.
The Earl of Essex is to write to the Lord Willoughby, That the House hath Ordered, That he shall send for the Magazine of the County, according to the Order; that the House is satisfied that the Lord Keeper accepted his Deputation, and nominated his Deputy Lieutenants; and for further Satisfaction, a Committee is appointed to search the Book, concerning his Vote to the Legality of the Militia."
City of London to present Names of Persons who oppose the Militia.
Information was given to this House, "That the City of London do intend to draw out a Regiment to train once in Two or Three Days, but they find in some Wards some that do oppose the Militia; therefore it was desired that they might have Liberty to Present the Names of such as they shall discover to be Opposers to the Militia;" which was Ordered accordingly.
Heads for the Conference.
All the Letters read this Day, concerning the Lord Willoughby and that Business, shall be read now at this Conference; and to let them know, that this House resolves, That the Lord Willoughby shall send for, and take into his Custody, the Magazine of Lyncolneshire; and the Paper concerning the Lord Lieutenant of Ireland, to be communicated to the House of Commons.
Lenthall and Bruton in Error.
Ordered, That the Writ of Error between Lenthall and Breuton shall be argued To-morrow.
House adjourned during Pleasure, and the Lords went to the Conference. House resumed.
This Report to be made To-morrow.
Committee to receive the Answers of absent Lords, about the Propositions for raising Money and Horse.
Ordered, That the Lords Committees appointed to take the Answers of those Lords that are absent, how far they will declare themselves concerning the Propositions for bringing in Money and Plate, &c. shall have Power to meet when they please; and that the First of July shall be the Day to bring in Horse and muster them.
Ordered, That the Militia in Cambridgeshire shall be put into Execution on Thursday come Fortnight.
Poxton sent for, for printing a false Paper about L. Wharton.
Ordered, That Edmond Poxton, Printer, for printing of a false Paper, making the Lord Wharton General for Ireland, shall be summoned to appear here To-morrow.
Treaty with the Scots Commissioners.
Ordered, That this House agrees to the Result of the Treaty of the Scotts Commissioners, as they were brought up from the House of Commons; and that an Article be drawn, that such Castles and Towns that the English take in Ulster, may not be taken from them by the Scotts.
Committee to examine how the Lord Keeper voted about the Ordinance for the Militia.
The Lord Admiral, and the Lord Robartes, and the Lord Mandevil, are to meet this Afternoon, to peruse what hath been (fn. 3) formerly voted touching the Militia, whereby to send an Answer concerning the Lord Keeper voting the Ordinance.
"My Lord,
Lord Keeper's Letter to Lord Willoughby, that he voted against the Ordinance for the Militia.
"His Majesty was this Day pleased to shew me a Letter of your Lordship's unto Him, wherein you have expressed, that I gave my Voice in the House of Peers for the Ordinance touching the Militia; which He questioning, in regard He had heard it otherwise related, I thereupon informed Him the Truth; which is this, That I was absent from the House at the making of the First Ordinance, which was presented unto Him for His Assent; and being present when the second was in Agitation, I gave my Vote against it, which His Majesty hath commanded me to let your Lordship (fn. 4) know, and is the Occasion of this Letter from
"Your Lordship's humble Servant,
Yorke, 7th June 1642.
"Edward Littleton."
"My Lord,
Sir Phillip Turwhitt's Letter to Lord Willoughby, refusing to deliver up the Magazine to him
"Yesterday I received your Lordship's Letter, wherein you were pleased to demand that Part of the Magazine I am trusted with, and have in my Hands, which I should be very willing to deliver to your Lordship, had I not received express Command to the contrary, by a Letter from His Majesty, which I think your Lordship is not ignorant of; by reason of which, His Majesty's Proclamation, and, as I think, One or Two Letters directed from His Majesty to your Lordship, wonders me why you should make such a Demand of me; and as you were pleased to give Answer to the Execution of an Order directed to you from the Parliament, for the settling the Country's Possession in the Fens to some who presented it to you, "That the Times were dangerous, and therefore you could do nothing in the Execution of it," so I hope you will please to accept of the same Answer from me; not doubting but that a little Time may produce so good Effects betwixt His Majesty and His Parliament, that I may be enabled, with the Liking of them both, and my own Safety, to give you a clear Resolve; till when, I hope you will please to accept of this, from him who shall ever be ready to serve your Lordship in what he may,
Stamefeild; June 8, 1642.
"Phillip Turwhitt.
"To the Right Honourable the Lord Francis Willoughby of Parham, at his House at Roth, with my Service. This, present."
"Right Honourable,
Sir Wm. Pelham's ditto.
"I have this Morning received your Commands, by Mr. Marshall, for the Delivery of such Ammunition unto him as belongeth to this Sessions, and resteth in my Hands. I should gladly have obeyed your Lordship, if I had not lately received a Letter from His Majesty, directed to the High Sheriff and the Deputy Lieutenants of this County, commanding each Man who hath any such Ammunition in his Custody, not to part with it upon any Order, except by Directions from His Majesty, or the Earl of Lindsey; and these His Majesty's Commands we are strictly charged to obey, upon our Allegiance; and, therefore, I hope your Lordship will please to excuse me, that I do not obey your Direction. But to give Assurance that all is safe which I have received, without any Diminution through my Default, I shave shewed Mr. Marshall all the Store which was brought unto me, and shall be glad still to be esteemed, my Lord,
"Your Honour's humble Servant,
Brockelesby, this 4th of June, 1642.
"Wm. Pelham.
"To the Right Honourable his very good Lord, the Lord Francis Willoughby. These."
King's Letter to Mr. Booth, of Killingline, not to leave Lincolnshire.
"Our express Will and Command is, That you fail not to attend Us Personally forthwith, upon Signification made unto you, and Receipt of Our Pleasure on that Behalf, during our Abode in these Parts; and therefore We strictly require you, upon your Allegiance, that you depart not out of Our County of Lincolne, or suffer yourself to be any Ways engaged or kept from giving your ready Attendance accordingly, being thereunto called by Us, whilst We shall continue here, upon any Pretence or Order whatsoever, without Our Special Leave and Licence first obtained, as you tender Our highest Displeasure, and will answer the contrary at your Peril; for which this shall be your Warrant.
"Given at Our Court at Yorke, the 24th May, 1642.
"To our Trusty and Well-beloved William Booth, of Killingline."
Instructions for the Committees going into Lancashire.
"Instructions for Mr. Ashton, Mr. Shuttleworth, Mr. Rigby, and Mr. Moore, Members of the House of Commons, now assembled in Parliament, and Committees to be sent into Lancashire, and for the rest of the Deputy Lieutenants of that County, for the Preservation of the Peace of that County.
"Whereas it doth appear to the Lords and Commons now assembled in Parliament, that the King, seduced by wicked Counsels, intends to make a War against His Parliament; and for that it is not improbable that, under Colour of raising a Guard for His Majesty's Person, or some other Pretence, the Knights, Gentlemen, Freeholders, and Inhabitants, of the County of Lancaster, may be drawn together; therefore you, and every of you, shall take special Care, that the Ordinance concerning the Militia be forthwith put in Execution through the County; and the Sheriff and all other Officers and Subjects are hereby enjoined to assist you, and every of you, therein: And, if any Person whatsoever shall levy, or endeavour to levy, any Soldiers, or to draw or keep together the Trained Bands, or other armed Forces, of the said County, or any other Forces, by Colour or Pretence of any Commissions or Warrant from His Majesty, under the Great Seal, or otherwise, without Order or Consent of both Houses of Parliament; you, and every of you, shall, in the Name and by the Authority of both the said Houses, require and command all Persons to forbear the Execution of such Commission or Warrant; and the same to be delivered up unto you, or any of you, to be sent to the Speaker of the House of Commons: And you, and every of you, shall require and command all His Majesty's Subjects to forbear to obey any such Warrant or Commission; and you, and every of you, and all other the said Deputy Lieutenants, are hereby required to draw together such of the Trained Bands, and other Forces, of the said County, as shall be expedient, for the suppressing of all such Assemblies, and for the apprehending of all or any Person or Persons as shall, after Admonition and Command by you, or any of you, made to them, to forbear the Execution of any such Commission or Warrant, or the calling or gathering or keeping together of any such Forces or Assemblies, still persist in doing the same, as likewise such disaffected Persons as shall be found raising any Parties or Factions against the Parliament, to be sent up hither, to answer such their Offences, as to Law and Justice shall appertain.
"And you the abovesaid Members of the House of Commons, and every of you, shall, in the Name of the Lords and Commons, require and command the Sheriff of the County of Lancaster, and the Justices of Peace, and every of them, to Publish throughout the said County the Declarations formerly published by both Houses of Parliament.
"You, and every of you, shall further take Care, that such Resolutions and Orders of both Houses as have been, or shall be, delivered or sent down unto you, or any of you, be put in Execution; and shall require the Sheriffs, Justices of the Peace, and all other His Majesty's Officers and Subjects, to be aiding and assisting unto you for that Purpose.
"You shall declare unto all Men, that it hath ever been, and still shall be, the Care and Endeavour of the Parliament, to provide for His Majesty's Safety; and that they do not, nor never did, know of any Evil intended to His Majesty's Person; which might move Him to require any extraordinary armed Guard; that His greatest Safety is in the Affection and Fidelity of His Subjects, in the Advice and Counsel of His Parliament; and His greatest Danger in withdrawing Himself from them; so that, under Colour of doing Him Service, disaffected and malignant Persons, obnoxious for their bad Counsels to the Justice of the Law, labour to raise a Faction and a Party against the Parliament, which at the last may break out into open Rebellion and Civil War, to the Destruction both of King and Kingdom.
"You the said Members of the House of Commons, and every of you, shall endeavour to clear the Proceedings of Parliament from all Imputations and Aspersions; and shall, from Time to Time, certify us of all Things which you conceive necessary for the present Service: And that we may have a speedy Account of it, and that our Directions to you, as well as your Advertisements to us, may have a clear and ready Passage, you, and every of you, shall lay a strict Charge upon all Post-masters, that they do not suffer any Letters, or other Dispatches, to or from the Parliament, to be intercepted or stayed; and if any shall presume to make such Stay of those Dispatches, you, and every of you, shall direct the Post-masters to repair to the Justices of Peace, Constables, and all other Officers, for their Aids and Assistance, who are hereby required to take special Care that there may be no such Interruption.
"You, and every of you, shall take Care that none of the Recusants Arms, or other Ammunition of the said County, shall be carried or taken out of the County, upon any Pretence or Command whatsoever, without Warrant from both Houses of Parliament; and you, and every of you, shall give Order and Direction to the Sheriff, Justices of Peace, and other Officers, to require and command all the Popish Recusants in that County to confine themselves to their Dwellings, according to the Statutes in that Case provided; and, if any such Recusant shall be found to transgress therein, you, and every of you, shall cause the Justices of Peace forthwith to bind them to their good Behaviour, and, upon Refusal or Neglect to give Security, accordingly to commit them to Prison, and further to proceed against them according to the Law.
"And you, and every of you, are likewise to give Charge from both Houses of Parliament, to all Captains, Lieutenants, and other Officers of the Militia, that they be observant to such Directions as they shall from Time to Time receive from the Lieutenant of the County, or his Deputies, or any of them, for due Performance of any the Commands of the said Houses.
"And the Lords and Commons do hereby declare, That they will protect, defend, and assist, all Manner of Persons, for such Actions as they shall perform in Pursuance of these Instructions, and other Orders and Commands of the said Houses of Parliament.
"And you, and every of you, shall resist and repel, and are hereby authorized to resist and repel, by the Power of the said County, and by all other Ways and Means, all such Force and Violence as shall be raised or brought, by any Person or Persons, to the Hindrance or Disturbance of this present Service, or for the arresting or seizing of the Persons of you, or any of you, or of any other which shall be employed in the Performance of the Ordinances, Instructions, and Commands of both Houses of Parliament, for any Thing done in Execution thereof; and the Sheriff and Justices of Peace of the said County, and all other Officers and Subjects, are hereby enjoined to be aiding and assisting to you, and every of you, for the better and more speedy Execution of the Premises."
Subject of the Conference, concerning the Lord Lieutenant of Ireland's Departure.
"The Lord Lieutenant of Ireland hath represented unto my Lords, That he conceiveth it conducing to the Good of the Affairs of Ireland, that he (nominated so long since to the Government of that Kingdom) should be dispatched thither; for the so long detaining of him cannot but be liable to several Constructions; either that there is some Coldness or Slackness in those Businesses, or that his Lordship useth not fitting Diligence in soliciting his Dispatch; which cannot but much reflect upon his Honour, that, in Times of Action and Danger, he should be absent by any Default of his.
"His Lordship hath acquainted the House with his former Diligence in this Kind, and fully informed my Lords that there hath been nothing wanting on his Part; and hath been now a Suitor unto my Lords, for their Assistance in procuring his speedy Dispatch.
"My Lords, knowing that the chief Means of dispatching his Lordship must arise from that House, which is, by providing Money to pay the Soldiers, and Provisions necessary to the Train of Artillery, shall leave that wholly to them, to whom it belongeth; but likewise do desire that House to join with them, that, from both Houses, His Majesty may be moved, that the Lord Lieutenant's Instructions may be drawn up, and put in a Readiness, that Monies, and all other Things necessary for his Lordship's Dispatch, being provided, there may be no Stay or Retardment for Want of them."
Order concerning the Militia of London.
"It is this Day Ordered, by the Lords in Parliament, That the several Captains for the Militia of the City of London shall return the Names of such to this House as have, do, or shall refuse to furnish such Arms as they are charged withall, as also all such as find their own Arms, or are appointed to wear other Men's Arms, and either refuse or do not attend the Parliament Houses, or the several Trainings, when and as often as they have been, or shall be, required thereunto or by the Beating of the Drum summoned, that thereby such further Directions may be given therein, for the punishing of the said Offenders, as the Wisdom of this House shall think fit.
"To the several Captains for
the Militia of the City of
Order concerning the Fens. Delinquents sent for.
Ordered, That Nic. Todd, Wm. Farrowe, Ric. Gyles, John Buttrice, and George Howard, shall be attached, for Contempt of an Order of this House, made in John Vanesdall's Cause, for Possession of the Fens.
• 1. Origin. may.
• 2. Origin. the.
• 3. Origin. and formerly.
• 4. Origin. known.
|
global_05_local_5_shard_00000035_processed.jsonl/30340
|
Introduction chapter I: manuscripts
Pages 1-8
Table of contents
I. Exchequer, K. R., Subsidy Roll, 144/2.
The roll consists of six membranes of various size, the text being written in two columns, with one exception on the recto side.
Mem. 1 begins with Bridge ward, which occupies col. 1 and part of col. 2. The remainder of col. 2 is filled by Queenhithe ward, which is continued on the verso side, col. 1.
Mem. 2: Cripplegate Infra (col. 1) and Cripplegate Extra (col. 2).
Mem. 3: Dowgate (col. 1) and Walbrook (col. 2).
Mem. 4: Cordwainer (col. 1) and Vintry (col. 2).
Mem. 5: Bishopsgate Infra (col. 1, upper half) and Extra (col. 2, upper half). Bassishaw (col. 1, lower half) and Portsoken (col. 2, lower half).
Mem. 6: Billingsgate (col. 1) and Broad St (col. 2).
Before the names of most of the wards and of each taxpayer and also before the sum total at the end of wards is placed a paragraph mark in the form of two long s's, which has not been reproduced in the reprint.
Two main hands can be distinguished. Hand 1 wrote the greater part of the text, viz. Mem.s 1, 2, 3, and 6 entire, Mem. 4, col. 2, and of Mem. 5 the last 11 entries and the sum total under Bas and the last 12 entries and the sum total under Ports. Hand 2 wrote Mem. 4, col. 1 (Cordw) and of Mem. 5 the upper part of both columns (Bish and the first three entries under Bas and the first 11 entries under Ports, also the headings of these two wards).
There seems to be no reason to doubt that the sums total at the end of wards are in the same hand as the preceding text. The S of Summa is of one type in the parts written by hand 1, of another type in those written by hand 2.
Only one more hand can be distinguished in the roll. The original sum total in Cripplegate ward has been cancelled as erroneous and a fresh sum added, apparently in a third hand. The abbreviation for solidus (s.) is formed by a flourish going from the top of the s towards the left in this entry, while hands 1 and 2 place a small semicircle on top of the s.
Below the sums total the number of "heads" (taxpayers (fn. 1)) of some wards is indicated in the form "Capit' Cj" or "Cap' Liiij" (presumably Capita). Under Queenhithe the "heads" are given separately at the bottom of Mem. 1 r., col. 2, and at the end of the ward on Mem. 1 v., col. 1. The number of "heads" is not given for BroadSt, Dowg, Vintry, Walbr. The number of heads under Bridge is given as 101, but is really 100. That for Crip (127) is one short. Doubtless Gilbert de Pelham [CripI 40], inserted between the lines, was overlooked or had not been added when the calculation was made. These entries appear to be all in hand 2, since the C of Capita agrees with that used by hand 2, not so well with that of hand 1.
Hand 1 is fluent and rather careless. Small letters are frequently used as initials in names, even font-names, and there are not a few obvious errors. (fn. 2) The scribe uses a peculiar sort of a, which may often be mistaken for an o at first sight, though it is generally distinct from it. His C has the form of a C with a flourish inside. Hand 2 is more careful, more pointed, even elegant. Capital letters are used more regularly and are generally well executed. The a is often pointed at the top and can never be mistaken for an o. The C has the form of a C with one or two vertical strokes inside. The portions found on Mem. 5 are in a smaller hand than those on Mem. 4, doubtless owing to exigencies of space.
It is curious that there is a change of hands in Bas and Ports. The fresh hand (hand 1) sets in higher up in col. 1 than in col. 2. But there can be no doubt that there is a change of hand at the places indicated. The forms of the paragraph-mark in front of entries used by the two scribes are not identical, and the last 11 (12) entries in both columns have the form used by hand 1 and also have it placed slightly farther left than in the preceding entries. Under Ports Billirica [no. 11] has the typical form of a used by hand 2, while Walter [no. 12] has the a of hand 1.
The extant roll is a copy of the original returns, which we may suppose to have been drawn up by different scribes for the various wards. In this way it differs from the roll for the subsidy of 1319. There are some indications that the various original returns had certain characteristics of their own.
The Anglo-Saxon letter p (wynn) is found only in the returns for BroadSt, Crip, Ports, Vintry and Walbr, th, y being solely used in the other wards. The p usually denotes p (pwrgode BroadSt 22, in pe hyrne Ports 23, reperhepe Vintry 59, pele Walbr 63). In brimperd BroadSt 14, 15 it stands for y. pork CripI 17 probably denotes York. Further Walbr has z, Z for p in mareworze 33, Zindene 68.
The return for Crip is characterized by frequent loss of initial h and addition of an inorganic h: Al(l)ingbery, -biry CripI 15, 61, hodiam 29, harnald 37, handreu le hirreys 38, Akonnby CripE 31. Inorganic h is found also in Bridge (helis 16, heure 59, hivn 67) and once in Walbr (heynesham 5), loss of h in affeld Walbr 34.
In the return for Bridge there is a predilection for Rec' instead of Ric' (Richard), Rec' being found under nos. 3, 11, 14, 26, 42, while Ric' occurs under nos. 71, 89. It is possible that the original return had a form of i that could be mistaken for e.
In the return for Vintry whole French phrases or sentences, such as ke maint en sa shope "who lives in his workshop", form a prominent feature, which has no parallel in the other returns.
In the return for Dowgate the e of the preposition de is regularly elided before names beginning in a vowel: darraz (bis), darmenters, dabindone, doffintone. In the returns for other wards only such forms as de Arras (Arraz, Araz), de orlyenes are found.
In the font-names various wards show differences as regards the use of Latinized and French forms.
The roll is on the whole in a fair state of preservation, though the writing is sometimes a little faint. The upper right-hand corner of Mem. 5 has been torn away, the assessments for the first five taxpayers of BishE being lost, apart from the d. of no. 4 and the s. of no. 5. There are a few holes in Mem. 2, but the readings can be supplied with practical certainty. M . . . . burne [CripI 57] is obviously for Meldeburne. The tax of Thomas de Oxon' [Walbr 3] may be xl d. or xl s. The writing is so blurred that it is impossible to be certain which is right, though s. seems the more probable. However, since the sum total of the ward obtained agrees exactly with that of the return, if the assessment was 40s., the correct reading is obviously xl s.
II. Exchequer, K. R., Subsidy Roll, 144/3.
The roll consists of 24 membranes of various size. One membrane is generally set aside for each ward, and those used for the smaller wards are naturally small, while those used for the larger wards are of considerable size. Farringdon Infra and Extra occupy one membrane each, both the recto and the verso side being used. Cripplegate Extra is on the verso side of the membrane for Cripplegate Infra. The last 19 entries for BreadSt are on the verso side, and the return for Cheap fills the greater part of both sides of the skin. The return for Vintry is missing.
The roll is indented, the skins being cut vertically. The extant Exchequer copy is the left-hand half of the original membranes.
The membranes are ruled in the returns for BreadSt, Cand, ColemSt, CripI, FarrI (the recto side), and Tower. On vertical rules found in some returns, see p. 13. A line is regularly drawn from the name of the taxpayer to his assessment. The same is the case in the earlier roll.
A great number of different hands can be distinguished. The main text of the returns for the various wards, comprising the headings and the names of the taxpayers, was doubtless written by the clerks of the sub-taxers, presumably the clerk of the respective ward. Since the return for Vintry is missing, 23 different hands can probably be distinguished for this part of the roll, supposing the same scribe for FarrI and FarrE; these may be called the main hands. Though some of these main hands show a certain similarity to each other, there is hardly anything to suggest that any scribe wrote more than one return. (fn. 1) Some of these hands are very characteristic, while others are of a more conventional type. Some of the returns are very fine specimens of penmanship, as those for Dowgate and Candlewick, which show very similar hands. It is clear that the hands are those of professional scribes. It would be improfitable to discuss the characteristics of these hands in detail. In the main hands are occasional notes such as "Respice in tergo" or the like. It is doubtful if these hands can be traced anywhere else in the returns.
Besides the 23 main hands, several other hands can be distinguished, but in this place it will be enough to say that the Ingress, found on the membrane for Walbrook, the "Colophon" at the end of CripE, the assessments, the sums total (often detailed) at the end of wards, and the marginalia are not in the main hands, and it will hardly be possible to establish with certainty how many different persons took part in finishing the roll. This question will be dealt with in some detail in the next chapter. An analysis of the various subsidiary hands may throw some light on the way in which the roll reached its actual form.
The roll is on the whole in a good state of preservation, but the upper part of the return for Billingsgate is badly damaged by damp. Also the last few entries under Queenhithe are very faint, and there is a hole in the skin just here. Holes in some other skins have made a name or an assessment or two illegible or partly so. Minor defects are not gone into here.
The roll must be the exemplar sent in to the chief taxers and used by them for the final assessment. The other half of the indenture, which was kept by the City authorities, is not preserved, but on it may have been founded the "Schedule of the amount levied in each ward" in connection with the Subsidy, which is printed in LBE, p. 124 f. The amounts in the Schedule show some interesting differences from the definitive ones in the Roll; see further Chap. VI, iv, (e).
• 1. Or rather persons in the lists, since the figures for Bas and Bish include persons without assessments.
• 2. For instance blung for blund or lung Bridge 11, Kisaundr' for Lisaundr' CripI 2, saharp for scharp CripI 5, cheuelmong' CripE 23 (cf. cheuerel- 37), Strerteford CripE 30, knarerborg Dowg 11, bysser (for kysser) BroadSt 48.
• 3. The editor has taken it for granted that the lists of taxpayers were written by the clerks of the sub-taxers, but a few remarks had perhaps better be added in support of this view. It is impossible, without a very detailed special investigation, to establish how many hands are represented in these lists. But even a more cursory examination permits us to distinguish at least a dozen different characteristic hands. It is pretty obvious that the lists of names in the 12 wards of Walbr, Bridge, Dowg, BroadSt, Bish, Ports, ColemSt, BreadSt, Cheap, Farr, Queenh, Tower were written by as many different scribes. Those for Cand, Aldg and Langb are in hands similar to that of Dowg, but it is doubtful if any two of these hands can be identified. The hand of Cordw is similar to that of ColemSt, but less careful and elegant. It is significant, for instance. that in the return for ColemSt (58 taxpayers) font-names are written in full 28 times (Johanne 12 times, as against one Joh'e), while in that for Cordw (74 taxpayers) font-names are written in full 19 times (Johanne twice, Joh'e, Joh'ne 18 times). The hands in the remaining lists do not seem to be very characteristic, but there is hardly any reason to identify any two among them. If the chief taxers had had the returns of the sub-taxers copied into the extant roll, we should expect this work to have been done by a limited number of scribes, say three or four. The natural explanation of the great variety of hands is that the lists were written by the clerks of the sub-taxers. If so, the probability is that there were as many scribes as there were wards. But it is, of course, theoretically possible that the sub-taxers of two smaller wards might have employed the same scribe. It should be noticed, however, that the lists of the three neighbouring wards of Aldg, Bish and LimeSt are in different hands, as are those of, for instance, Bas and ColemSt. In this connection it may be noted that in several returns one or more taxpayers were evidently added after the main list of names had been drawn up, and in some cases after the sub-taxers' names had been entered. These entries generally appear to be in another hand than the main list. They are at any rate in a very similar hand, and it may well be the same scribe entered most of these additional names. If so, the scribe may have been one of the clerks of the chief taxers. In all these entries, except for Bill 57, BroadSt 70 and 74, the De before the names has the form regular only in the return for Walbr, in the reprint rendered by "De". The taxpayers are the last one in BreadSt, Castle, Cornh, Dowg, the last two in Cand and Walbr, the last five in Bish, the last six in BroadSt. The name of Bill 57, placed after the subtaxers, may be in the main hand of the ward. The names of taxpayers inserted between the lines (cf. p. 24) are apparently in hands different from those in the main text, certainly CripI 84 and 100, probably CripI 63, BroadSt 3, FarrE 7, and ColemSt 28. In the last-mentioned case the De before the name has the form "De".
|
global_05_local_5_shard_00000035_processed.jsonl/30351
|
kim il-sung kim jong-ilWikipediaStatues commemorate Kim Il-sung and Kim Jong-il.
Brainwashing the next generation is a big deal in North Korea, where two former supreme leaders authored propaganda-filled children's books, as uncovered by Sydney University researcher Christopher Richardson.
Kim Jong-il, father of current supreme leader Jong-un, is credited with writing "Boys Wipe Out Bandits," a story about the "redemptive power of ultra-violence," Richardson wrote in "Still Quite Fun To Read: An Introduction to North Korean Children's Literature."
Kim Il-sung, founder of the dynasty, is acknowledged as the author of the anti-American fable "The Butterfly and the Cock," which depicts an angry rooster outwitted by a virtuous butterfly, in an "unsubtle analogy for North Korea’s existential struggle with the United States of America."
As far as Richardson can tell, Jong-un has not yet written a children's book but anticipates a title soon, The Guardian reports.
It's funny until you remember that North Korea is committing human rights violations on par with Nazi Germany, according to a U.N. report that pressed for international action.
Below are screen shots of a recent state television animated adaptation of "The Butterfly and the Cock."
A bunch of butterflies are working to pollinate the world, when all of a sudden ...
butterfly and cock cartoon nkYouTube
A bully arrives and begins to harass the butterflies. It is about to hurt one of them but stops ...
butterfly and cock cartoonYouTube
... because another butterfly starts hurling insults and pollen at him.
butterfly and cock cartoonYouTube
The angry cock ruins the butterflies' garden by stomping on all the plants.
butterfly and cock cartoonYouTube
The heroic butterfly pesters the cock and leads him on a chase ...
butterfly cock cartoonYouTube
... that ends when the cock stumbles off a cliff ...
Screen Shot 2014 03 20 at 2.13.57 PMYouTube
... and falls into a pool of water and drowns.
Screen Shot 2014 03 20 at 2.07.31 PMYouTube
Everyone celebrates.
butterfly and cock cartoonYouTube
Below is the full video:
|
global_05_local_5_shard_00000035_processed.jsonl/30352
|
kris humphries best tweet ever@KrisHumphries
New Jersey Nets forward Kris Humphries tweeted this a week ago, but somehow we only just discovered it this afternoon.
This is the best tweet an athlete has ever tweeted. Here's why:
1. Plot twists. This tweet is a series of bait and switches.
"Just offered a homeless person money" (Oh wow, Kris Humphries is so nice.)
"but got rejected" (What! I hate homeless people.)
"because it turns out they weren't homeless." (OMG Kris Humphries you idiot just because people aren't wearing the Kardashian Kollection doesn't mean they're homeless. He's the worst.)
"Only in NY." (Wait, does he REALLY think this is some sort of honest mistake?)
Hack writers and artists have been trying and failing to construct 140-character "stories" since the dawn of Twitter. But it was Humphries, the has-been reality star, who was able to craft a truly compelling narrative in an impossibly small space.
2. Ambiguity. It seems like he's making a joke about something here. But what is it? Is he referencing hipster fashion? Is he poking fun at himself? What is happening?
The tweet is undeniably funny. But at the same time, we aren't really sure what it's about, or if it's meant to be about anything at all.
3. Immediacy. Twitter is a real-time medium, and this is seemingly a real-time tweet. Humphries shot this out as he was walking away from the non-homeless person, ostensibly while the person was still within sight.
And in that way, the tweet is authentic. It's true to the medium.
|
global_05_local_5_shard_00000035_processed.jsonl/30354
|
Paul Krugman wrote a good piece today that got me thinking about my favorite monetary contradiction. Have you ever heard someone complain about the size of the national debt as well as the zero interest rate policy currently enacted by the Fed? Yeah, we hear it all the time. Usually from conservative pundits who are making an argument against the Fed and/or the size of the national debt. But these pundits don’t seem to have connected the dots on the ways our monetary system works or the clear contradiction in their thinking. Now, I am a pretty fiscally conservative guy. I tend to be skeptical of the Fed’s various manipulations and guesses at monetary policy and I also tend to be fairly skeptical about government spending. But this contradiction is one that makes no sense to me….
The obvious thing about the national debt is that it’s the non-government’s saving. So grandma’s saving bonds in the form of US Treasuries are the Federal Government’s liabilities. That’s just the simple reality of how this arrangement works. The government issues debt and the non-government holds it. You can’t “pay off” the national debt without taking away grandma’s saving bonds. But the weird part is that these same pundits always seem to complain about the way the Fed’s policies are hurting savers like grandma. But low rates reduce Federal interest outlays directly reducing the size of the Federal deficit so you would think that this is something that conservative pundits would love. But they don’t. They want grandma to earn more on her saving (thereby increasing government spending through interest outlays), but they also want to “pay back” the national debt thereby taking grandma’s saving away.
What gives?
Read the original article on Pragmatic Capitalism. Copyright 2012.
|
global_05_local_5_shard_00000035_processed.jsonl/30362
|
Edward Malloy
c. April 2, 1992 - Present President, University of Notre Dame
Videos: 6
Recent Appearances
• [alt text]
Faith and Values in America
Senator Lieberman spoke to students and faculty about the role of religion in public discourse, saying that American culture…
• [alt text]
Congressional Gold Medal Ceremony
President Clinton presented Father Hesburgh with the Congressional Gold Medal. Father Hesburgh was honored for his…
• [alt text]
Teen Drug Use Survey
Mr. Califano released a new survey on teen drug use throughout the United States. Rev. Malloy also talked…
• [alt text]
Presidential Education Proposal
President Clinton focused on American higher education during his remarks to the American Council on Education at the…
See all appearances
Appearance Stats
|
global_05_local_5_shard_00000035_processed.jsonl/30363
|
Michael Tackett
c. August 18, 2008 - Present Editor, Politics
Videos: 1 c. January 1, 2008 - Present Associate Managing Editor, Washington Bureau
Videos: 1 c. October 10, 2002 - Present Senior Correspondent, [Chicago Tribune]
Videos: 2 c. February 24, 1998 - Present Correspondent, Washington Bureau
Videos: 7
c. October 29, 1996 - c. February 24, 1998 Bureau Chief, Washington Bureau, [Chicago Tribune] Videos: 5 c. May 19, 1995 - c. October 29, 1996 Bureau Chief, Washington, DC, [Chicago Tribune] Videos: 3 c. November 19, 1988 - c. May 19, 1995 Correspondent, [Chicago Tribune] Videos: 3
Recent Appearances
• [alt text]
Key Players in Washington
A panel discussion was held on who would be the new leaders and important people in Washington under the Obama…
• [alt text]
Primary Elections Preview
Michael Tackett and Andrew Taylor talked about the primary elections being held in Indiana and North Carolina the next…
• [alt text]
After Words with Rahm Emanuel
Rep. Rahm Emanuel was interviewed about his book, The Plan: Big Ideas for America, published by PublicAffairs. The…
• [alt text]
Miers Supreme Court Nomination
Mr. Tackett talked about turmoil in the Republican Party and possibilities in the 2008 elections. He spoke about…
See all appearances
Appearance Stats
|
global_05_local_5_shard_00000035_processed.jsonl/30399
|
Chimera of Global Warming
Ten years ago the Alps endured a virtually snowless winter. Environmentalists blamed global warming. A Swiss lobbying group, Alp Action, wrote in 1991 that global warming would put an end to winter sports in the Alps by 2025.
This year the Alps have had their greatest snowfall in 40 years, according to very preliminary data. Greenpeace has blamed global warming.
How in the world can that be? Is it possible to blame global warming for every weather anomaly, even if two consecutive events are of opposite sign? Can such a claim have “scientific” justification?
If one regards the United Nations as an authority on such things, the answer, unfortunately, is yes. Global warmers, thanks to the good offices of the U.N. Intergovernmental Panel on Climate Change, can blame any weather event on pernicious economic prosperity and resultant greenhouse gas emissions.
The most recent IPCC summary on climate change was published three years ago. IPCC purports to be the “consensus of scientists” but in fact is a group of individuals hand-picked by their respective governments. Does anyone really expect Al Gore to send me to represent the United States at one of those meetings? (Thank you, no, I have been to one and that was enough.)
Absent my sage advice, here’s what the United Nations wrote in 1995: “Warmer temperatures will lead to … prospects for more severe droughts and/or floods in some places and less severe droughts and/or floods in others.”
As a punishment for not cleaning out the cat box, you might ask your kid to diagram this sentence. Rather than strain the graphics of this word processor, we’ll simply parse it. What the IPCC is saying is that global warming will cause in “some places” and/or “others”:
• More intense wet periods.
• More intense dry periods.
• More intense wet and dry periods.
• Less intense wet periods.
• Less intense dry periods.
• And less intense wet and dry periods.
So, according to the “consensus of scientists,” it’s OK to blame a flood, or, if you’re in the mountains, a flood of snow, on global warming. It’s also OK to blame a drought or a snowless Alp on global warming.
It’s even OK to blame weather that is more normal than normal (“less intense wet and dry periods”) on global warming.
The IPCC statement, which cannot be proved wrong, is a cynical attempt to allow anyone to blame anything on global warming. As Julius Wroblewski of Vancouver, Canada, wrote to me, this logic “represents a descent into the swamp of the non-falsifiable hypothesis. This is not a term of praise. Falsifiability is the internal logic in a theory that allows a logical test to see if it is right or wrong.”
A non-falsifiable theory is one for which no test can be devised, and the U.N. statement fits the bill perfectly. There is simply no observable weather or climate that does not meet its criteria, except one: absolutely no change in the climate, meaning no change in the average weather or the variability around that average.
Every climatologist on the planet knows that is impossible. Climate has to change because the sun is an inconstant star and the Earth is a nonuniform medium whose primary surface constituent, water, is very near its freezing point. Freezing (or unfreezing) water makes the planet whiter (or darker), which affects the degree to which it reflects the sun’s warming rays. A flicker of the sun, therefore, ensures climate change.
A hot young climatologist named Robert Mann, writing in Geophysical Research Letters, recently provided a powerful demonstration of this phenomenon. Using long-term records from tree rings and ice cores, he concluded that the planet was on a 900-year cooling streak between 1000 and 1900. Then we warmed up almost twice as much as we had cooled, but at least half of that warming was caused by our inconsistent sun. Two NASA scientists recently demonstrated that the sun has been warming throughout the last 400 years. As a result, if the last decade weren’t among the warmest in the last millennium, something would have been wrong with the basic theory of climate: The sun warms the Earth.
That doesn’t mean we haven’t supplied a bit of greenhouse warming, too. But greenhouse warming behaves differently than pure solar warming: It occurs largely in the coldest air masses of winter.
That’s a far cry from the United Nation’s nonsense about “some places” and “others” experiencing more unusual, less unusual or unusually usual weather. And it has nothing to do with avalanches or snowless winters, either.
Patrick J. Michaels is a senior fellow in environmental studies at the Cato Institute and science adviser to the Greening Earth Society in Arlington.
|
global_05_local_5_shard_00000035_processed.jsonl/30408
|
« Prev Again, on the Lord’s Prayer, Matt. vi. To the… Next »
Sermon IX.
[LIX. Ben.]
Again, on the Lord’s Prayer, Matt. vi. To the Competentes.
1. You have rehearsed what you believe, hear now what you are to pray for. Forasmuch as you would not be able to call on Him, in whom you should not first have believed; as saith the Apostle, “How shall they call on Him, in whom they have not believed?”20832083 Rom. x. 14. Therefore have you first learned the Creed, where is a brief and sublime rule of your faith; brief in the number of its words, sublime in the weight of its contents.20842084 Sententiarum. But the prayer which you receive to-day to be learned by heart, and to be repeated eight days hence, was dictated (as you heard when the Gospel was being read) by the Lord Himself to His disciples, and came from them unto us, since “their sound went into all the earth.”20852085 Ps. xviii. 5, Sept. (xix. 4, English version).
2. Ye then who have found a Father in heaven, be loth to cleave to the things of earth. For ye are about to say, “Our Father, which art in heaven.”20862086 Matt. vi. 9. You have begun to belong to a great family. Under this Father the lord and the slave are brethren; under this Father the general and the common soldier are brethren; under this Father the rich man and the poor are brethren. All Christian believers have divers fathers in earth, some noble, some obscure; but they all call upon one Father which is in heaven. If our Father be there, there is the inheritance prepared for us. But He is such a Father, that we can possess with Him what He giveth. For He giveth an inheritance; but He doth not leave it to us by dying. For He doth not depart Himself, but He abideth ever, that we may come to Him. Seeing then we have heard of Whom we are to ask, let us 289know also what to ask for, lest haply we offend such a Father by asking amiss.
3. What then hath the Lord Jesus Christ taught us to ask of the Father which is in heaven? “Hallowed be Thy Name.”20872087 Matt. vi. 9. What kind of blessing is this that we ask of God, that His Name may be hallowed? The Name of God is always Holy; why then do we pray that it may be hallowed, except that we may be hallowed by it? We pray then that that which is Holy always, may be hallowed in us. The Name of God is hallowed in you when ye are baptized. Why will ye offer this prayer after ye have been baptized, but that that which ye shall then receive may abide ever in you?
4. Another petition follows, “Thy kingdom come.”20882088 Matt. vi. 10. God’s kingdom will come, whether we ask it or not. Why then do we ask it, but that that which will come to all saints may also come to us; that God may count us also in the number of His saints, to whom His kingdom is to come?
5. We say in the third petition, “Thy will be done as in heaven, so in earth.”20892089 Matt. vi. 10. What is this? That as the Angels serve Thee in heaven, so we may serve Thee in earth. For His holy Angels obey Him; they do not offend Him; they do His commands through the love of Him. This we pray for then, that we too may do the commands of God in love. Again, these words are understood in another way, “Thy will be done as in heaven, so in earth.” Heaven in us is the soul, earth in us is the body. What then is, “Thy will be done as in heaven, so in earth”? As we hear Thy precepts, so may our flesh consent unto us; lest, whilst flesh and spirit strive together, we be not able to fulfil the commands of God.
6. “Give us this day our daily bread,”20902090 Matt. vi. 11. comes next in the Prayer. Whether we ask here of the Father support20912091 Exhibitionem. necessary for the body, by “bread” signifying whatever is needful for us; or whether we understand that daily Bread, which ye are soon to receive from the Altar; well it is that we pray that He would give it us. For what is it we pray for, but that we may commit no evil, for which we should be separated from that holy Bread. And the word of God which is preached daily is daily bread. For because it is not bread for the body, it is not on that account not bread for the soul. But when this life shall have passed away, we shall neither seek that bread which hunger seeks; nor shall we have to receive the Sacrament of the Altar, because we shall be there with Christ, whose Body we do now receive; nor will those words which we are now speaking, need to be said to you, nor the sacred volume to be read, when we shall see Him who is Himself the Word of God, by whom all things were made, by whom the Angels are fed, by whom the Angels are enlightened, by whom the Angels become wise; not requiring words of circuitous discourse; but drinking in the Only Word, filled with whom they burst forth20922092 Ructuant. and never fail in praise. For, “Blessed,” saith the Psalm, “are they who dwell in Thy house; they will be always praising Thee.”20932093 Ps. lxxxiv. 4.
7. Therefore in this present life, do we ask what comes next, “Forgive us our debts, as we also forgive our debtors.”20942094 Matt. vi. 12. In Baptism, all debts, that is, all sins, are entirely forgiven us. But because no one can live without sin here below, and if without any great crime which entails separation from the Altar, yet altogether without sins can no one live on this earth, and we can only receive the one Baptism once for all; in this Prayer we hear how we may day by day be washed, that our sins may day by day be forgiven us; but only if we do what follows, “As we also forgive our debtors.” Accordingly, my Brethren, I advise you, who are in the grace of God my sons, yet my Brethren under that heavenly Father; I advise you, whenever any one offends and sins against you, and comes, and confesses, and asks your pardon, that ye do pardon him, and forthwith from the heart forgive him; lest ye keep off from your own selves that pardon, which comes from God. For if ye forgive not, neither will He forgive you. Therefore it is in this life that we make this petition, for that it is in this life that sins can be forgiven, where they can be done. But in the life to come they are not forgiven, because they are not done.
8. Next after this we pray, saying, “Lead us not into temptation, but deliver us from evil.”20952095 Matt. vi. 13. This also, that we be not led into temptation, it is necessary for us to ask in this life, because in this life there are temptations; and that “we may be delivered from evil,” because there is evil here. And thus of all these seven petitions, three have respect to the life eternal, and four to the present life. “Hallowed be Thy name.” This will be for ever. “Thy kingdom come.” This kingdom will be for ever. “Thy will be done as in heaven, so in earth.” This will be for ever. “Give us this day our daily bread.” This will not be for ever. “Forgive us our debts.” This will not be for ever. “Lead us not into temptation.” This will not be for ever. “But deliver us from evil.” This will not be for ever: but where there is temptation, and where there is evil, there is it necessary that we make this petition.
Please login or register to save highlights and make annotations
Corrections disabled for this book
Proofing disabled for this book
Printer-friendly version
|
global_05_local_5_shard_00000035_processed.jsonl/30409
|
CDC Home
Report of Expert Consultations on Rapid Molecular Testing to Detect Drug-Resistant Tuberculosis in the United States
Panel Members and CDC participants
Edward P. Desmond, PhD, Chief, Mycobacteriology and Mycology Section, Microbial Diseases Laboratory, California Dept. of Public Health
Kimberly Field, RN, MSN, Director, TB Control Services, Washington Department of Health
Phil Griffin, BBA, Director, Kansas TB Control and Prevention, Kansas Department of Health and Environment
Denise Ingman, BS, MT DPHHS, Project Director, Montana Department of Public Health and Human Services
Kimberlee A. Musser, PhD, Director of Bacteriology, Wadsworth Center, New York State Department of Health
Margaret J. Oxtoby, MD, Director, Bureau of Tuberculosis Control, New York State Department of Health
Virginia A. Pruitt, Acting Director, Respiratory Diseases Division, Bureau of Clinical Laboratories, Alabama Department of Public Health
Jafar H. Razeq, PhD, Division Chief, Public Health Microbiology Laboratories Administration, Maryland Department of Health
Max Salfinger, MD, Chief, Bureau of Laboratories, Florida Department of Health
Barbara Seaworth, MD, Medical Director, Heartland National TB Training and Education Center
James P. Watt, MD, MPH, Chief, Tuberculosis Control Branch, California Department of Public Health
Kelly E. Wroblewski, MPH, MT (ASCP), HIV, STD, TB, Hepatitis Program Manager, Association of Public Health Laboratories
Suzanne Zanto, CLS(NCA) SM(NRM), Microbiology and Molecular Laboratory Manager, Montana Public Health Laboratory
Division of TB Elimination, National Center for HIV/AIDS, Viral Hepatitis, STD, and TB Prevention
Kashef Ijaz MD, Chief, Field Services and Evaluation Branch
Beverly Metchock DrPH, Chief, Reference Laboratory Team, Mycobacteriology Laboratory Branch
James Posey PhD, Chief, Applied Research Team, Mycobacteriology Laboratory Branch
Thomas M. Shinnick PhD, Associate Director for Global Laboratory Activities.
Angela Starks PhD, Mycobacteriology Laboratory Branch
Contact Us:
• Centers for Disease Control and Prevention
Division of Tuberculosis Elimination (DTBE)
1600 Clifton Rd., NE
MS E10
Atlanta, GA 30329
• 800-CDC-INFO
TTY: (888) 232-6348
• Contact CDC–INFO
• Page last reviewed: September 1, 2012
|
global_05_local_5_shard_00000035_processed.jsonl/30435
|
CenterPoint Energy
Natural Gas > Business
What to do if you smell gas. If you smell gas, leave the area immediately. Do not use your phone, electric switches, your computer, or anything that could cause a spark. Go directly to a safe location, then call CenterPoint Energy and 911. 24-hour Gas Leak Hotline -Minneapolis/St. Paul Area: 612-372-5050 or toll-free: 1-800-722-9326
|
global_05_local_5_shard_00000035_processed.jsonl/30446
|
Annual Editions: Global Issues 12/13 28th Edition
Chapter Problem
Chapter: Problem:
As noted in “Seven Myths about Alternative Energy,” “second-generation” biofuels, such as those derived from switchgrass, are a promising new development for controlling global warming.
What is Chegg Study?
With Chegg Study, you get step-by-step solutions to the odd and even problems in your textbooks, including Annual Editions: Global Issues 12/13 - 28th Edition and 9,000+ others. You can also ask subject matter experts your toughest questions 24/7.
Textbook authors: Robert Jackson
ISBN: 0078051185
ISBN-13: 9780078051180
View all editions
81% of students said using Chegg better prepared them for exams
2013 Chegg Homework Help Survey
• Where do solutions come from?
• What comes with membership?
• What subjects are covered?
Sample Textbook Solution
Engineering Mechanics Dynamics, 2nd Edition, Chapter 6, Problem 15
Get Study Help from Chegg
|
global_05_local_5_shard_00000035_processed.jsonl/30460
|
""; ?> Edge guitar chords, guitar tabs and lyrics - chordie
Filter the songs:
Show all songs
Show only songs that are easy to play
Show only songs with formatted chord grids
Show only songs with tabs
Chordie needs editors!
Improve this page
Edge may refer to:
==Computer science=
• In processing, an edge is a position in a digital image where the luminous intensity changes sharply. See edge detection
==Computer software=
• Enhanced Data Rates for GSM Evolution, a technology that allows wireless devices to connect at data rates up to four times faster than existing GSM and GPRS wireless devices
• The Edge Software, a software label from Softek Software International Ltd
• In the sport of cricket, an edge is a slight deviation of the ball off the edge of the bat. See the list of cricket terms#E
• The EDGE, a brand of pizza produced by Pizza Hut, with toppings all the way up to the edge
• EDGE is a brand of snack products introduced by Frito Lay. These included Cheetos, Doritos, and Tostitos. These products are all recuded carbohydrate foods
Edge is a colloquial adjective to describe escarpments in England e.g.:
• Alderley Edge
• Edge, Cheshire is a small village and civil parish i...
license: GNU FDL
source: Wikipedia
5 popular songs
|
global_05_local_5_shard_00000035_processed.jsonl/30472
|
Skip Navigation
3.0: Testers Ask Questions
Difficulty Level: At Grade Created by: CK-12
Understanding the difference between an unhelpful and vague question, and asking questions that are targeted and specific.
How to Ask Questions the Right Way
I think it’s impossible to ask "what is Software Testing?" without also focusing on "how to ask the right questions". It’s entirely possible to push buttons and "ham fist" our way to problems, but are those problems significant? Do they really matter to the end user or the stakeholders? They may, they may not. The problem is that, if we report a lot of "unimportant bugs", or if we ask "insubstantial questions" regularly, our knowledge and efforts will often be dismissed, or at the least given lower priority.
Because we are asking the wrong questions. More accurately, we are asking questions in an ineffective way.
The recommendations listed below come from a site that is dedicated to helping answer questions on various hacker forums.
Note: Hacker in this case means anyone that works with code and tries to make changes, modifications and enhancements to see what those changes do. This is not to be confused with a "Cracker" who works to disrupt services, steal information or break into systems for fun or dishonest profit. From the site:
Testers need to approach problems or issues in the same way.
Before You Ask
Let’s approach this from the aspect of "before you start testing". What are some things you might want to make sure that you know?
You may want to make sure you are aware of industry standards or what other organizations who make similar software are doing.
You may want to understand alternative ways of doing things that makes sense in that particular world. Testing a photo editor will be much more focused and understandable if you understand actual photographic techniques. In testing, we refer to this as having "domain knowledge", or at least an understanding of where the area we are going to test exist.
How can we be sure we are asking the right questions?
1. Try to find an answer by searching (internal) the existing documents, specs, issue tracking system, or (external) forums that deal with this kind of application(s).
2. Try to find an answer by searching the Web.
3. Try to find an answer by reading the product manual (if there is one).
4. Try to find an answer by reading a FAQ (if one exists).
5. Try to find an answer by inspection or experimentation.
7. Try to find an answer by reading the source code (if you have that skill and have access to it).
When you ask your question (whether it be a product or a person), display the fact that you have done these things first. Better yet, display what you have learned from doing these things. Include things like "I searched google and could not find an answer based on [words used]. . . " This helps set the parameters that others will understand.
Take your time.
Do not expect to be able to solve a complicated problem with a few seconds of searching.
Read and understand. Give the problem some thought before approaching experts (or before testing or reporting bugs). Trust us, they will be able to tell from your questions how much reading and thinking you did, and will be more willing to help if you come prepared.
Beware of asking the wrong question or one based on faulty assumptions. You will earn an answer (from a product under test or from an expert), if you earn it, by asking a substantial, interesting, and thought-provoking question.
When asking individuals for clarification, make it clear you are able and willing to help in the process of developing the solution.
“Would someone provide a pointer?”
“What is my example missing?”
“What should I have checked?”
Are more likely to get answered than
“Please post the exact procedure I should use.”
By doing the former, you are making it clear that you’re truly willing to complete the process if someone can just point you in the right direction.
Examples of Good/Bad Questions (from previous site)
Good and Bad Questions
The following text is almost verbatim from the above referenced site. Let’s discuss if we want to change them or present them as is. I think with proper attribution, we can present them as is, as I think the tone of the questions and responses are good.
These are questions about the same problem, one asked in a stupid way and one in a smart way.
This question just begs for a response of "RTFM" or "STFW" as a reply. These stand for "Read the [Expletive Deleted] Manual" or "Search the [Expletive Deleted] Web". For this course, I’ll instead use the much kinder, albeit still slightly sarcastic acronym "LMGT". This stands for "Let Me Google That", which gets the same message across. Developers help those who help themselves, and you will get a variation on these types of responses if you ask a question based on something you could have easily looked up yourself.
This one has already done the LMGT step, and has come up empty handed. This simple step alone will change the responses the tester gets, because they have invested some of their time and energy to learn about the product.
Stupid: I can’t get the code from project foo to compile. Why is it broken?
This question is placing the blame on someone else. While that may be the case, it’s bad form to automatically assume that someone else has done something wrong. It also shows a lack of humility, and the developers in question will respond in kind.
Smart: The code from project foo doesn’t compile under Nulix version 6.2. I’ve read the FAQ, but it doesn’t have anything in it about Nulix-related problems. Here’s a transcript of my compilation attempt; is it something I did?
Notice the difference in tone. The first thing to see is that they have specified the steps they have already taken, their experience with looking at the FAQ, and most importantly, not assuming that the problem is external to them (i.e. they are not blaming other people, but asking if they have missed something).
Stupid: I’m having problems with my motherboard. Can anybody help?
The first thing to notice about this question is. . . what? More like a lot of whats. What type of motherboard? How is it installed? What CPU or RAM are you using? What CMOS? And a bunch of other questions that we would have to ask just to get to the point of being able to answer even a small part of the possibilities. Most won’t even bother, and will likely just ignore the question.
Smart: I tried X, Y, and Z on the S2464 motherboard. When that didn’t work, I tried A, B, and C. Note the curious symptom when I tried C. Obviously the florbish is grommicking, but the results aren’t what one might expect. What are the usual causes of grommicking on Athlon MP motherboards? Anybody got ideas for more tests I can run to pin down the problem?
This is good overall protocol whenever dealing with an issue of any kind. In fact, the above question would make for a good bug entry all by itself (more on bug reporting later).
The reason this set of questions will likely get attention is that the tester has applied a problem-solving approach to the issues they are seeing. They have reported what they tried to do to make it work, and has also made a guess as to what the problem might be. They may be wrong, but it shows the programmer that they are working towards isolating the issues and understanding the problem.
Additionally, instead of saying “Give me an answer”, the tester is asking “Please help me figure out what additional diagnostics I can run to understand the problem”
Excerpted from:
How To Ask Questions The Smart Way
Copyright © 2001, 2006 Eric S. Raymond, Rick Moen
Image Attributions
Difficulty Level:
At Grade
Date Created:
Dec 26, 2012
Last Modified:
Apr 29, 2014
We need you!
At the moment, we do not have exercises for Testers Ask Questions.
You can only attach files to Modality which belong to you
100 % of people thought this content was helpful.
( 0 )
Most Helpful Reviews:
Loading reviews...
Please wait...
Please wait...
Image Detail
Sizes: Medium | Original
Original text
|
global_05_local_5_shard_00000035_processed.jsonl/30517
|
Click here to Skip to main content
11,505,486 members (63,308 online)
Click here to Skip to main content
Using authentication certificates to connect to web services with Windows form applications
, 8 May 2007 Ms-PL 99.1K 1.8K 57
Rate this:
Please Sign up or sign in to vote.
How to use a certification to connect to an SSL channel and use a web service
This article explains how to use a certificate to connect to, for example, a web service. Do you know the floppies or USB Pens that some banks and IT Companies give to their employees or customers that permit them to connect to services via the internet using a security file and channel? Well, we will learn how to use a similar file in this article, which is divided into six parts:
1. Environment Preparation
2. Server Certificate Request
3. Generate the Certificate
4. Activate the SSL Security Channel Communication on the IIS Web Server
5. Request and Obtain a User Certificate
6. Use Certificate with Windows Form
For this article I used three different machines:
• A Windows 2000 Server with Certification Authority
• Two Windows XP Professional Edition machines, one with IIS Web Server
You can use only one Windows XP Professional machine; I use the second machine to ensure that the certification file and the software that I develop are the only two things that I must take away to connect to the web service. Good luck!
Environment Preparation
In this section we create the two projects that we will use to try our certification program. I won't explain the two projects in detail; I presume that you are expert enough to create two standard projects with Visual Studio 2005.
All right, start creating a new website project. Choose the ASP.NET Web Service template. Attention! It is important that you use a real web server and not the emulator. Therefore, if you don't have IIS Web Server or something similar installed, install it and then choose the HTTP option from the combo location of the VS Project. For the name of the application, I chose http://localhost/WebServSSL. Visual Studio takes care of most of what you need; you only have to configure the website appropriately. If you build the project you'll have just one method in the service, the classic "hello word" example. I suggest we use this for our test, but if you don't like it you can create another function that you prefer. The second project that you must now create is a Windows Application. Create it in the same solution as the Web Service; I called mine testSSLWebServ. In the new project, add a Web Reference from the solution explorer and choose your web service. I called the namespace for the service remoteWebServSSL. All right, the last pass is to add a button on the form and call the unique method of the Web Service that we have. Here 's some code:
remoteWebServSSL.Service srv = new remoteWebServSSL.Service();
MessageBox.Show("The Web Service say: " + srv.HelloWorld());
Important: Some problems can arise from the firewall settings of the machine. Be sure to turn off the firewall; you can configure it in a second time.
Now we can start.
Server certificate request
Next, to activate the secure channel on our web site, we must go to the properties of the root Web Server and set the Server Certificate. There's more than one mode to do this; you can choose ones you prefer. I chose to connect to the CA Web Server to ask for the Certificate. Therefore I must create a Certification Request and ask the CA a second time. Click on the Server Certificate button. The certificate wizard will then appear; click Next. In this dialog choose Create a New Certificate and click Next. The only option that you can choose now is "Prepare the request now, but send it later;" again click Next. In this form you must choose the name of the certificate that you will install on your web server. Leave the other parameter as it is and go on. Now write something for the organization and organization unit. Go on. This next step is important: the Common Name required is the name of your machine and is, therefore, the name of the web server that responds to your web server. For example, my machine name is WorkStatio23 and the http address that I write when I navigate on my web server is http://WorkStatio23/WebServSSL. The Common Name that I must choose is WorkStatio23. Also insert the State/province and City/locality data and then go on. As a last step, save your Certification Request; choose a location and click Next. Read the Request File Summary, click Next and Finish. The Certification Request has now been created.
Generate the certificate
Open the generated Text file on your computer from the directory where you chose to save it. Select all the text in the file and copy it. Now it's time to use Windows 2000 Server with the CA. Ensure that your CA is configured to accept the request by the Web Server and that it releases the certificate immediately, without user participation. Connect to the CA Web Server using the related address. For example, my Windows 2000 Server machine is named w2ksrw. Therefore the address to request the certification is http://w2ksrw/CertSrv. Next, choose the second option "Request a certificate" and click Next. Choose the "Advanced request" option and click Next again. Choose the second available option: "Submit a certificate request using a base64 encoded PKCS #10 file or a renewal request using a base64 encoded PKCS #7 file." Click Next. Since we already have the Text file code copied to memory, just paste it in the relevant textbox control (the first) and click Next. Now you are ready to download the certificate. Download the two certificates on the result page: "Download CA certificate" and "Download CA certification path."
Activate the SSL security channel communication on the IIS Web Server
Select the certificate file with the .p7b extension. For me, this is certnew.p7b. Double click on your file once you find it. Note that the certificate is not valid. Click the "Install certificate" button and then click Next until Finish; confirm the last message and the certificate is now installed. Now finish the activation of the SSL channel on the Web Server. Launch your IIS configuration tool, go on the root Web Server (Default Web Site), right click and select Properties. Return to the Directory Security and re-click the Server Certificate button. Click Next. Note that the options have changed. Choose the "Process the pending request and install the certificate" option and click Next. Browse for the other certificate that you obtain from the CA. Click Next two times and then Finish. Well, you are ready to use your https connection. Try your web server in https and enjoy. For this example, we must enforce the use of the SSL channel on our Web Services. Therefore, on the IIS, go to the properties of WebServSSL, choose the Directory Security tab and click the Edit button. Check the "Require secure channel (SSL)" checkbox and the "Require client certificates" option in the Client Certificates group. Close all windows and try your web services now using your browser.
Request and obtain a user certificate
This step will be fast and simple. Using your browser, go to the Web Server of the CA using the same address (http://w2ksrw/CertSrv). Choose the "Request a certificate" option and click Next. Choose the "Advanced request" option and then Next. Leave the "Submit a certificate request to this CA using a form" option selected and click Next. Fill in the Name and the E-Mail fields under Identifying Information with whatever you want and leave the other field as is. For the Intended Purpose field, choose Client Authentication Certificate. For the last setting, set the "Mark keys as exportable" option. Bypass the other field and click Submit. Answer "yes" to the question and finally install the certificate.
Note: In this step, I have encountered problems using the Certification Authority website. The "Downloading ActiveX Control" message did not disappear. If you have the same problem, you can resolve it by installing a fix for the Windows 2000 Advanced Server. Refer to KB323172 of the Microsoft site and find the relative fix q323172_W2K_SP4_X86_EN.exe.
Use certificate with Windows form
You can try more tests with your example, if you'd like, before continuing with my instructions here. After you're satisfied, launch the Internet Explorer browser. Select Tools and go to Internet Options. Select the Content tab and click on the Certificates button. You can immediately see the Personal tab selected and, in the list control, you can see your personal certificate (Andy74 for me). Select the specified certificate and click on the Export button. In the wizard panel choose Next, choose the "Yes, export the private key" option and click Next again. Here you can export only in the PFX format; leave the default option and click Next. Insert a password. For simplicity, I chose a very simple password, "password." Then click Next. Choose where to export the certificate and click Next again. Click Finish and OK in the message box. Now, return to your project in Visual Studio and add this line after the creation of the web reference instance:
new System.Security.Cryptography.X509Certificates.X509Certificate2(
@"c:\Andy74cert.pfx", "password"));
Obviously, change the path of the certificate where you have saved it. Now on the machine where you have the web services, go to the administrative tools section of the control panel and launch the Server Extensions Administrator. Select File -> Add/Remove Snap-in. On the next window click the Add button, select Certificates and finally click the Add button. Select the Computer Account option and click Next. Leave the "local computer" (the computer this console is running on) option selected and click Finish. Close the active window and finally the OK button. Open the Certificates (Local Computer) node in the tree view, then Trusted Root Certification Authorities and the Certificates node. Right click on the node: All Tasks -> Imports to import another wizard. Click Next. Remember the .p7b certificate that we download from the certification authority in the fourth step. Browse to that file and select it; then click Next. Choose "Place all certificates in the following store" and then the "Trusted Root Certification Authorities" folder; click Next and then Finish. All right, you are ready to try your final application. To really test your application, you can use other machines never used up to now. Copy your application and your .pfx file (certificate) to where you want, but remember to place the certification file in the same folder where you load from the application, or use a parameter to load it from whichever you'd prefer.
• May 8, 2007 - Original version posted
About the Author
--==## Andy74 ##==--
Team Leader
Italy Italy
No Biography provided
Comments and Discussions
QuestionNeed Detailed Explanation Pin
Maria Norbert31-Mar-14 20:05
memberMaria Norbert31-Mar-14 20:05
Questionbuen post Pin
Member 787794817-Oct-13 11:22
memberMember 787794817-Oct-13 11:22
GeneralNice Article Pin
pruthvi_m28-Oct-10 10:27
memberpruthvi_m28-Oct-10 10:27
Generalcan't find certificate in web service Pin
sebstoria7-Aug-07 3:55
membersebstoria7-Aug-07 3:55
Generalweb service in Windows service Pin
abhinav18-Jul-07 20:41
memberabhinav18-Jul-07 20:41
GeneralRe: web service in Windows service Pin
--==## Andy74 ##==--9-Jul-07 8:25
Generalquestion... regarding using cert from file vs store Pin
uramisten29-May-07 22:25
memberuramisten29-May-07 22:25
We are using certificates to authenticate against a 3rd party webserivce (c#/.NET), and have run into a strange problem .. maybe you could shed some light on it?
// get cert from store
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
X509Certificate2Collection col = store.Certificates.Find(X509FindType.FindBySubjectName,"XXXX", true);
// load cert from file
X509Certificate2 cert = new X509Certificate2(@"C:\{fullpath}","YYYY");
now.. if I check equality, col[0].Equals(cert) = true. So .. they should be the same. right? now however, if I set "webservice.ClientCertificates.Add(col[0])" it works fine, while if I use "cert", the Trace shows that the whole thing fails with the following trace error:
System.Net Information: 0 : [2228] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent = Outbound, scc = System.Net.SecureCredential)
System.Net Error: 0 : [2228] AcquireCredentialsHandle() failed with error 0X8009030D.
.. any ideas? What could be the difference between the 2 certs? Problems creating the trust path or something for certificates from files... anything? any idea at all how to resolve this?????
GeneralRe: question... regarding using cert from file vs store Pin
--==## Andy74 ##==--30-May-07 5:42
GeneralGood work Pin
Dr.Luiji11-May-07 1:08
memberDr.Luiji11-May-07 1:08
GeneralRe: Good work Pin
--==## Andy74 ##==--13-May-07 23:22
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 8 May 2007
Article Copyright 2007 by --==## Andy74 ##==--
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid
|
global_05_local_5_shard_00000035_processed.jsonl/30518
|
Click here to Skip to main content
11,505,486 members (58,935 online)
Click here to Skip to main content
Gone With The Wind
, 17 Jun 2007 CPOL 29.4K 20
Rate this:
Please Sign up or sign in to vote.
Dealing with the designer when everything disappears
It's amazing how your work suddenly vanishes into the air after spending the weekend coloring, resizing and moving around your well polished controls.
Q: Can you prevent that from ever happening?
A: Can't promise, however, here are a couple of tips to follow that helped me many times in overcoming this drama.
If you are a regular user of the V1.x VS.NET design-time environment (in C# at least, I don't do much by way of VB, so I can't comment) then you will no doubt be well aware of the effects of the amazing self-destructive design-time environment. If you are one of the lucky few who hasn't, I'll explain the symptoms.
In the office, we call it "the woe", and it has happened to us...a lot.. Working out why it happens is rather tricky. Finding a reliable repro is nearly impossible; but we have found some of the contributing factors, reliable ways to avoid the problem - and how to mitigate it when it does occur.
The first thing to understand is that the problem is a defect in the round-tripping of the code that the designer generates in the InitializeComponent() method. Basically, when things go awry, it sometimes panics and just leaves some of it out. It doesn't affect the members inserted at the top of the file (the fields that hold the references to the child controls stay put), only the initialization code. That's why, when the problem occurs, you can't just add controls with the same names as the ones that vanished. They conflict with these disembodied fields. This leads me to tip number 1, for people who have already suffered the woe. (See Tip 5 for how to mitigate the woe as it occurs).
Missing resource
One of the most common reasons of the woe is deleting a resource while some control in your application it is still referring to that resource. If it does happen, you will see the above picture in which we are still referring somewhere in the code to a bitmap resource with the name "download_linux"
Dealing with such kind of woes is easy, all you have to do is to go to the form designer class..
Find the missing resource named in the error message as displayed in the first snapshot of this article.
Now replace the missing resource reference with a valid one. I would always comment the old reference and set the container control to null.
this.pictureBox1.Image = null;
Clean & Clear
Another form of the woe is what I would call "clean and clear" in which the designer is restarting your work as if you've just created a new form.
Dealing with this kind of woe can be quite tricky, however, the first thing you should try is to simply restart the IDE without panicking and saving before restarting.
If it's still Clean & Clear, try the following:
1. Close the Clean & Cleared designer tab
2. Close the IDE
3. Go to the solution's folder and move the Clean & Cleared designer class "usually suffixed by (.Designer.cs)" to another folder
4. Open the IDE again and delete the moved class node from the solution explorer Window
5. From Project go to 'Add Existing Item' and browse for the previously moved designer class and you are done
Still Can't deal with it
A couple of tips to follow to overcome/cut down the woe occurrence number are listed below…
Tip 1
But ideally we would avoid the woe completely! What we want is a procedure for working with WinForms projects in the IDE that won't break. How might we go about this?
Well, the problem usually occurs because you don't have a clean, working build of the solution including all the dependencies of your designable control. Now - most of the time, this isn't an issue. After all, you can use the designer right out of the box, without having built the solution at all. But if you have a control from another assembly (or even this assembly!) on your design surface, and it is not built 100% successfully and copied somewhere, it can be referenced by the design time environment (the project directories will do), then you invite the possibility of the woe. Therefore, you should follow tip 2.
Tip 2
Always do a complete solution build before attempting to open any designers
Unfortunately, by default, the VS.NET IDE will reopen the views you had open when you last closed the solution; which is not that great if the solution is not cleanly built when you open it again. Therefore, you should also apply tip 3.
Tip 3
Always close all of the designer windows before closing the solution
OK, so now we do a build. If it doesn't build cleanly, refer to Tip 2, and then use the code editors only to clean up until it builds successfully.
When it does build cleanly, we can open a designer, do our layout, add code etc. All should be well. When we are ready to try a build and test, apply Tip 4.
Tip 4
Close all designer Windows before doing a build
I can't say this often enough. Never, never build the solution without closing all designers. In fact, it is probably a good idea to write a macro to do this for you, and replace the build/run/debug shortcuts, buttons and menus with calls to this instead. Or be very disciplined. You will get away with it 9 times out of 10, and the tenth time...kaboom.
OK, we've closed the designer Windows and kicked off the build. If the build fails - refer to Tip 2. Don't forget - you have to clean everything up so that it builds using only the code editors. Don't accidentally open a designer... When it builds clean, you can rinse and repeat.
If you follow those guidelines, you'll avoid 99% of all the cases of the woe. But there are a couple more categories of misfortune that can befall us...
The first occurs when we reference controls from an external assembly that is pre-built (i.e. we reference the assembly itself, rather than a project in the solution). You open up the designer, and either the controls have vanished from the surface, or you get a design-time exception (the block of misery-inducing text that indicates the designer has had a panic with your control). Firstly, apply Tip 5. Tip 5 is very useful!
Tip 5
In Case of Woe, Don't Panic. Don't press save. Don't press undo. Just close the designer Window (and any applicable code Windows) and say "no - I don't want to save the changes".
If you do this, then the messed-up code won't be saved. It will revert to the version prior to the designer being opened. Tip 5 is also useful if you accidentally break any of the guidelines in Tips 2-4.
So - what causes this particular issue? It seems to be something to do with the design time environment failing to find references that it had no issue with a moment ago. The files haven't moved, no-one has recompiled them. The designer has just taken against them. You can close the IDE and reload it, and it still doesn't work. So, apply Tip 6.
Tip 6
You can then reopen the designer and all should be well...
Finally, there's the nastiest of the problems. You can build a control that has an implementation bug that causes an exception at design time. Everything will build fine, but when you reopen the designer you'll see the exception text. As usual, the designer can recover from this 9 times out of ten, but the tenth time induces the Woe.
Recovery is simple - you should first apply Tip 5 and then fix the problem using the code editor only. Fixing it can be tricky. If inspection doesn't work, a handy tip is to open a second IDE, and attach to the original instance of VS.NET. You can then set some breakpoints in your control and watch what happens as you open the designer.
Some of these tips are a bit tedious, and require some discipline, but if you follow the guidelines, you should avoid the woe almost completely, and easily be able to recover if it does occur.
Some of the contents of this article belongs to some bloger. I couldn't even find his name on the offline page I'm keeping, neither the URL of that page, so please if you're the guy, post your name here because I personally owe you a lot for sharing your experience dealing with "the woe".
Also thanks to our friend Martin for suggesting me to post this article.
About the Author
Retired QSoft
Yemen Yemen
Biography?! I'm not dead yet!
Comments and Discussions
GeneralNice Job Pin
Mike Hankey20-Jun-07 18:40
memberMike Hankey20-Jun-07 18:40
GeneralAnd another Tip Pin
John Whitmire19-Jun-07 8:52
memberJohn Whitmire19-Jun-07 8:52
GeneralRe: And another Tip Pin
Muammar©19-Jun-07 21:00
memberMuammar©19-Jun-07 21:00
Thanks John, searching the solution directory for this pattern and then delete it will do as well
The pattern is:
ps. Sometimes you even have to delete the .sln file.
Smile: A curve that can set a lot of things straight!
(\ /)
GeneralRe: And another Tip Pin
Martin#20-Jun-07 3:25
memberMartin#20-Jun-07 3:25
GeneralBeen there... Pin
hannahb19-Jun-07 3:28
memberhannahb19-Jun-07 3:28
GeneralRe: Been there... Pin
davos19-Jun-07 7:33
memberdavos19-Jun-07 7:33
Generalthanks + more reasons & workaround for 'woe' Pin
gus_himself18-Jun-07 22:29
membergus_himself18-Jun-07 22:29
GeneralRe: thanks + more reasons & workaround for 'woe' Pin
Muammar©3-Jul-07 22:09
memberMuammar©3-Jul-07 22:09
GeneralFun? I don't think so! Pin
Chamadness18-Jun-07 22:00
memberChamadness18-Jun-07 22:00
GeneralRe: Fun? I don't think so! Pin
Muammar©19-Jun-07 20:57
memberMuammar©19-Jun-07 20:57
GeneralPossible Add In Pin
Martin#17-Jun-07 20:11
memberMartin#17-Jun-07 20:11
GeneralGood work! Pin
Martin#17-Jun-07 20:01
memberMartin#17-Jun-07 20:01
GeneralRe: Good work! Pin
Muammar©18-Jun-07 0:16
memberMuammar©18-Jun-07 0:16
GeneralRe: Good work! Pin
Martin#18-Jun-07 0:51
memberMartin#18-Jun-07 0:51
GeneralFun Pin
Shog917-Jun-07 11:30
sitebuilderShog917-Jun-07 11:30
GeneralRe: Fun Pin
Muammar©17-Jun-07 19:43
memberMuammar©17-Jun-07 19:43
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 17 Jun 2007
Article Copyright 2007 by Muammar©
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid
|
global_05_local_5_shard_00000035_processed.jsonl/30520
|
Click here to Skip to main content
11,505,486 members (60,266 online)
Click here to Skip to main content
Re-entrant C++/MFC programming
, 15 Aug 2004 34.4K 984 14
Rate this:
Please Sign up or sign in to vote.
An article on a re-entrant program for factoring the product of two prime numbers.
Sample Image
This program demonstrates a re-entrant algorithm implemented in C++/MFC. The algorithm is deterministic, and so is effectively useless for large numbers (RSA Challenge), but does demonstrate re-entrant techniques.
The RSA Challenge (see their web page) involves factoring a large number, which is the product of two large prime numbers. There is a cash award, so I started looking at the problem. I came up with this algorithm, which effectively gets the possible values for the solution numbers (or one of them, which is enough) based on the input number (the challenge). The program/algorithm works fine, and is very fast for numbers up to 20 digits (base ten) but is not suitable for fast factoring of larger numbers. The time of computation goes up by a factor of ten for each additional digit, so the RSA Challenge is safe from this algorithm.
The Algorithm
The algorithm is deterministic, which means it searches every possible combination of numbers for the factors (well, not all - there are constraints). For a number A as the product of two primes greater than 11, B and C, the expansion in terms of the individual digits of B and C is like:
order n
n = 5 n = 4 n = 3 n = 2 n = 1 n = 0
a(5) a(4) a(3) a(2) a(1) a(0)
nCarry(4) nCarry(3) nCarry(2) nCarry(1) nCarry (0) no nCarry
b(5)*c(0) b(4)*c(0) b(3)*c(0) b(2)*c(0) b(1)*c(0) b(0)*c(0)
b(4)*c(1) b(3)*c(1) b(2)*c(1) b(1)*c(1) b(0)*c(1) ---------
b(3)*c(2) b(2)*c(2) b(1)*c(2) b(0)*c(2) ---------- sum (0)
b(2)*c(3) b(1)*c(3) b(0)*c(3) --------- sum (1)
b(1)*c(4) b(0)*c(4) --------- sum (2) sum(0) mod 10
b(0)*c(5) --------- sum (3) = a(0)
--------- sum (4) sum(1) mod 10
sum (5) = a(1)
sum(2) mod 10
= a(2)
sum(3) mod 10
= a(3)
mod 10
= a(4)
mod 10
= a(5)
Starting at the lowest digit, only the lowest digit of the factors contribute. So, if the lowest digit of A is 1, then the only possibilities for the lowest digits of B and C are: 9,9; 7,3; 3,7; and 1,1 with carries of 8, 2, 2 and 0, respectively. Only 4 possible combinations. This is good. However, for the higher order digits of A, the number of combinations is 10 each. Better than trying all 100 combinations (0-9 for B and C, separately), but still a lot of possibilities when the order of A is large...
For the first order digit of A, a(1), the previous possible values of b(0) and c(0) contribute, and the combinations of b(1) and c(1) are determined, for one set of the four from order zero. For a(2), the combinations of the values of b(2) and c(2) are determined, for one set of the values of the first order, for one of the values of the zero order, and so on...
When there are no possible combinations, the algorithm is to back up to the last order, move to the next in the list of combinations for that order, and proceed again.
Assume the order of C is less than the order of B. When the order of calculation is higher than the order of C, then only five possible values are found for b(n), the c(n) being zero.
When the order of the calculation is above the order of both B and C, then there are no possible values to manipulate. The calculation can only go above the order of B if the lower numbers have a product very close to A. When the order of calculation reaches the order of A, the carry is tested (it must be zero) as well as the digit.
There is one detail of prime numbers above 10 that makes the algorithm 60% faster: all primes greater than 11 have a zero-order digit of 1, 3, 7 or 9. Only four possible values instead of ten. For a number A of order 100, B of order 75, and C of order 25, there are still 4*10E24 possible combinations up to the order of C. This is why I say that the RSA Challenge numbers are safe from this algorithm. The number of returns on the stack for this algorithm is also the number of digits of A (order plus 1).
The problem with re-entrant programs are the inherent difficulty of interrupting the execution. This program uses a class-scope variable to test for interruption, but the execution is so intensive that the menu item Stop Execution does not respond. A solution to this would be to have a worker thread doing the calculation and the main thread interacting with the GUI (not done here, that would be more appropriate for a sample for Threads).
The Succinct Summary of Re-Entrant Programming
1. The basic idea of a re-entrant routine is a routine that calls itself.
2. The best use is when an algorithm has the same set of actions for any position in a list of actions, and the result of the actions causes a BACK_UP in the control flow. The search traversal of trees (B-Trees, etc.) is a perfect example.
3. The back-up means that the algorithm returns to the last action taken, and is re-evaluated there. So, a re-entrant routine must always return a value to be tested.
4. A re-entrant routine calls itself, and so is stack-oriented.
5. Each call puts a set of values on the stack, and can quickly cause a stack overflow.
6. The cause of problems with re-entrant routines is typically a lack in the limiting test for returning: in other words: when does it stop?
7. The case demonstrated here is simple in that the limit is the size of the input number and the test is performed at the start of the re-entrant routine. (Note: LISP is totally re-entrant!)
Using the code
A brief description of re-entrant programming is nearly impossible, and this code is probably useless except as a guide and example. Comments in the code are sufficient for understanding the principle. The algorithm is also described in comments.
Points of Interest
While writing the program, I decided to allow for alternate-base number systems such as base 2, base 16, or base 12 (for old IBM people...). I use MAPLE to convert to an alternate base (like base 47, or base 60), and input the numbers through a file. However, the sample code does not implement this. If you want to, it can be set by changing the define COMPBASE in StdAfx.h. There are a couple of other interesting things in the sample code, like disabling the ENTER key (it closes down a Dialog), and using *.SetFocus() for the input edit box. I did feel free to mix bool and BOOL types, mix straight C-code and C++/MFC, and name the variables for what they do.
• 2002 - started the program, got it to work.
• 2003 - tried various mutations of the program, including multithreading, different bases, and constraints on the numbers to get a fast answer to RSA Challenge. Figured out that it was too slow.
• 2004 - Submit to Code Project as an example of re-entrant programming in C/C++/MFC.
1. A web site: The RSA Challenge.
2. A book: “Factorization and Primality Testing”, by David Broussard, Springer-Verlag, 1989, ISBN: 0-387-97040-1.
3. LISP: check out the web, or take a course in programming languages.
A list of licenses authors might use can be found here
About the Author
Web Developer
United States United States
A scientist, mathematician, engineer, educator,
and now a programmer specializing in telecom
projects and servers. I enjoy a wealth of
knowlege, and occasionally use some of it at
Comments and Discussions
GeneralDisagree with your definition of re-entrant Pin
Bamaco216-Aug-04 9:56
memberBamaco216-Aug-04 9:56
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 16 Aug 2004
Article Copyright 2004 by CygnusatHOME
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid
|
global_05_local_5_shard_00000035_processed.jsonl/30584
|
[sword-devel] Web Interface - Customization
Chris Little [email protected]
Fri, 28 Feb 2003 16:19:24 -0700 (MST)
On Sat, 1 Mar 2003, Rev. Michael Paul Johnson wrote:
> >What diatheke currently does (and what would be my recommendation) is just
> >set cookies on the client. Nothing is required of the server maintainer.
> >If people disable cookies, the have to live without these features. The
> >only real drawback is that it doesn't work if you switch computers or do
> >most of your work from different (e.g. public) computers.
> If it is quick & easy to change preference settings, this isn't a major
> problem.
There are potentially a lot of preferences to set & save, h means it can't
be quick & easy. At the very least it is an inconvenience that we should
attempt to avoid imposing on users.
> >A third possiblity, if we want to deal with it, might be to set up a
> >single central preferences database, hosted by CrossWire. This relieves
> >3rd party server admins of the need to set up the database and provides
> >the added bonus that, regardless of which server or which client you use,
> >your server will always request and receive the same settings from
> >CrossWire's server. We can set it up as a web service that the 3rd party
> >servers could query.
> This is bad for scalability and fault tolerance. It would be better if
> all other sites using the same engine kept running with no degradation
> in service even if CrossWire's server were to go down for any reason.
Nonetheless, a central database is the only reasonable way to store the
data long-term in a way that minimizes the difficulty of running a site.
Some hosting services may provide DBMS to their users, but most do not.
And we probably don't want to deal with connecting to different databases
that might be provided by different hosting services. A single XML-RPC
or similar call to CrossWire in order to retrieve settings won't be that
expensive as part of the login process. And it exists as the only way I
know of to allow different hosts to share settings (unless there has been
some laxing of cookie security lately).
That data should ALSO be stored in a cookie on the client side. When that
fails (e.g. because a public computer is being used or the user just wiped
his cookies) a login may be supplied to the host, when passes this on to
CrossWire to request the settings (that are then stored in a cookie again
on the user machine as well as retained by the host for the duration of
the session). If CrossWire is down, oh well. It's not a life & death
situation if you can't turn of verse numbers or set your favorite default
|
global_05_local_5_shard_00000035_processed.jsonl/30589
|
Thread: Mosquito
View Single Post
#7 (permalink)
Old January 4th, 2005, 01:17 PM
Posts: n/a
Default Re: Mosquito
Thank you for your replies which are most helpful.
We have booked the landtour followed by the cruise.
We actually travel in the first two weeks in August (2005) so what sort of problem do the bugs present then?
Reply With Quote
|
global_05_local_5_shard_00000035_processed.jsonl/30602
|
For food, for friendship, and for the opportunity of service We thank you, Lord. Amen.
God of goodness, bless our food Keep us in a pleasant mood Bless the cook and all who serve us From indigestion, Lord, preserve us
From an American place mat
Come Lord Jesus, be our guest And may our meal by you be blessed. Amen.
Lord, bless this food upon these dishes, As thou didst bless the loaves and fishes, And like the sugar in the tea May all of us be stirred by Thee
Crick (Northampton) Jubilee Dinner 1975
Lord, as you shared food with your friends in Galilee, may this meal make us all grow in friendship. May God bless this food, and this day, And keep us safe in every way.
Rev S.J.Riggs
Accept the praise of miserable sinners As we prepare to eat our dinners.
Bishop Howell Witt
Heavenly Father, bless us, And keep us all alive There's ten of us to dinner And just enough for five. Amen.
This food comes to us by courtesy of Almight God
A commercial grace
Lord Jesus, be with us in this, as in all things, for your Name's sake. Amen
God bless this bunch As we munch our lunch. Amen
For the company we keep, and the food we are about to eat, we thank you, Lord.
Devon Women's Institute Grace
Us and this, God bless.
A Quaker Grace
Robert Burns (attrib)
Lord, your praise, we all exude; Now in us your love imbued, As we come, to eat our food. So from us our sins exclude, And we pray, your grace include.
John Hurst (2004)
|
global_05_local_5_shard_00000035_processed.jsonl/30605
|
For more about the book and Andy Crouch, please visit
embed The book of love is long and boring…
The Book of Love,” performed by Peter Gabriel, from the soundtrack to Shall We Dance?, 2004 :: via Stereogum and Very Short List
|
global_05_local_5_shard_00000035_processed.jsonl/30688
|
Get unlimited digital access. $0.99 for 5 weeks.
Selena Gomez talks Justin(s)
Selena Gomez is finally talking about Justin... Guarini. (Like, really??). Apparently, there was a little mishap when Guarini guest starred on "Wizards of Waverly Place." "We did kind of fog him with a fog machine and he kept coughing. Sorry about that," she says. As for that other Justin, Gomez is STILL saying that "of course" it's annoying for people to link her and Biebs romantically, despite their very public hand-holding recently. "I love him very much, though," she adds. --Carina Adly MacKenzie, Zap2it Getty Images
|
global_05_local_5_shard_00000035_processed.jsonl/30690
|
Print 30 comment(s) - last by Gondor.. on Feb 24 at 2:42 AM
Encouraging teamwork is key
Microsoft's new CEO Satya Nadella said encouraging teamwork and communication would be key to leading Microsoft and its new restructuring plan.
Nadella recently gave The New York Times his first interview as CEO, where he discussed the influence both Microsoft co-founder Bill Gates and former Microsoft CEO Steve Ballmer have had on him over the years, and said that the goal is to make Microsoft one of the few 100-year-old+ companies.
Ballmer was known as an energetic and passionate figure at Microsoft, but Nadella said that he learned the importance of staying grounded from Ballmer.
"I went on to ask him, 'How do I compare to the people who had my role before me?' And Steve said: 'Who cares? The context is so different. The only thing that matters to me is what you do with the cards you’ve been dealt now. I want you to stay focused on that, versus trying to do this comparative benchmark,'" said Nadella. "The lesson was that you have to stay grounded, and to be brutally honest with yourself on where you stand."
From Gates, who will be devoting more time to Microsoft to work closely with Nadella, the new CEO said he learned to stand his ground thanks to pressure testing from Gates.
He’ll argue with you vigorously for a couple of minutes, and then he’ll be the first person to say, Oh, you’re right,'" said Nadella. "Both Bill and Steve share this. They pressure-test you. They test your conviction."
While part of the big news of Nadella's new CEO position was that Gates was going to spend more time at the company, Nadella said the two of them working together is nothing new. He added that Gates would be spending more time on campus and helping to get the team motivated to create new and exciting products.
While Gates and Ballmer will continue to be big names in Microsoft history, Nadella is looking to create a name for himself with his own leadership techniques. After sharing that participating in a cricket team as a youngster has helped shape his ideas of leadership today, Nadella said that pumping up his team and encouraging individuals to effectively communicate ideas will be his main priority.
"The thing I’m most focused on today is, how am I maximizing the effectiveness of the leadership team, and what am I doing to nurture it?" said Nadella. "A lot of people on the team were my peers, and I worked for some of them in the past. The framing for me is all about getting people to commit and engage in an authentic way, and for us to feel that energy as a team.
Nadella added that the restructuring process and unification of Xbox, PC and Windows Phone would heavily depend on the effectiveness of the team, and the ability to identify a successful product from a dud.
"One of the things that I’m fascinated about generally is the rise and fall of everything, from civilizations to families to companies," said Nadella. "We all know the mortality of companies is less than human beings. There are very few examples of even 100-year old companies. For us to be a 100-year old company where people find deep meaning at work, that’s the quest."
He was named Microsoft CEO earlier this month after Ballmer announced his retirement in August 2013.
Source: The New York Times
Comments Threshold
100 years...
By HoosierEngineer5 on 2/21/2014 11:16:19 AM , Rating: 5
Think they will have their operating system finished by then?
RE: 100 years...
By purerice on 2/21/2014 11:18:27 AM , Rating: 2
I was going to say they already act like a hundred year old person, but that would be insulting to my 103 year old neighbor.
RE: 100 years...
By HoosierEngineer5 on 2/21/2014 11:35:15 AM , Rating: 2
Might eventually give them a shot at second-millenium edition. Or will they call that millenium-edition one?
RE: 100 years...
By inighthawki on 2/21/2014 9:21:38 PM , Rating: 2
You realize a millennium is 1000 years, right? 100 years is a century.
RE: 100 years...
By HoosierEngineer5 on 2/22/2014 10:41:18 AM , Rating: 2
Thus, the 'eventually'.
RE: 100 years...
By Souka on 2/22/2014 8:23:15 PM , Rating: 2
Their browser is already 100 years old....
RE: 100 years...
By HoosierEngineer5 on 2/22/2014 10:43:41 AM , Rating: 2
I was commenting on the fact that Microsoft seems to believe their current-generation gaming console is something of a 'prequel'. Or, they might be numerically challenged.
RE: 100 years...
By someguy743 on 2/21/2014 11:58:01 AM , Rating: 1
If Nadella can make "Windows 9" a well thought out masterpiece that nearly everyone likes and he can help Microsoft catch up to Google and Apple in tablets and smartphones that will certainly help them become a 100+ year company. I guess they'd be working on "Windows 65" by 2075.
Maybe Microsoft should consider moving the headquarters from Redmond, Washington down to the San Francisco area. There's a heck of a lot of brainpower and creative people there who like the Silicon Valley lifestyle, the weather, and all the other things to do in Cali when they aren't working like crazy.
RE: 100 years...
By CaedenV on 2/21/2014 2:04:45 PM , Rating: 2
While Windows is important, I think that it's success or failure will have little bearing on their ability to last another 100 years.
Patent leasing, and corporate deals are what will keep MS going in the future. Windows, Office, xbox, and WP are just there to keep a public face, and partly as a throwback to what made MS who they are today. I am sure that these products will continue to be important... just not make-or-break important. This is how MS managed a record year in spite of launching a new console (which is very expensive indeed), having a lack-luster OS, and completely tanking a tablet product line.
RE: 100 years...
By ClownPuncher on 2/21/2014 3:32:51 PM , Rating: 5
Move to California? Yea, so they can start paying huge corporate tax and have to deal with the mindless idiots from areas like UC Berkley. No, your state sucks and your parents think you're fat.
RE: 100 years...
By wordsworm on 2/21/2014 11:24:49 PM , Rating: 1
Windows 8 was their best operating system to date. So, I don't see how making a great OS automatically makes it a best seller.
RE: 100 years...
By retrospooty on 2/22/2014 9:07:51 AM , Rating: 2
LOL... Good one.
RE: 100 years...
By fteoath64 on 2/22/2014 12:41:25 PM , Rating: 1
MS people needed focus and direction and is looking to him to provide that!. So for Windows 9, if MS can start a second team to look into Windows on Linux (yes, based on Linux kernel, just like Android) but put a Windows framework apps layer on top, then they might have a very compelling new Windows version. Forget compatibility of legacy, just all new apps of old ones re-compiled and tested. Hopefully with HSA support to handle the new AMD chips that could really do parallel heterogeneous computing!. Tat would be strong progress. Can be done in 1.5 years with the resources they have.
RE: 100 years...
By coburn_c on 2/23/2014 1:06:20 AM , Rating: 2
Hah, the NT kernel is far superior to linux and has a thousand times the hardware compatibility. I don't know what gave you the impression linux is better, but it's just flat wrong. Linux is open, that's its claim to fame, making it closed by adding on DRM and proprietary code will make it a bloated, pointless mess.
RE: 100 years...
By Gondor on 2/24/2014 2:42:35 AM , Rating: 1
... thousand times the hardware compatibility
Yes, that must be why it runs only on three architectures nowadays.
wrong birth year
By Gungel on 2/21/2014 11:24:55 AM , Rating: 3
Nadella was not born in 1969, he was born in 1967.
RE: wrong birth year
By amanojaku on 2/21/14, Rating: 0
Its not all software fault
By KOOLTIME on 2/21/2014 2:20:13 PM , Rating: 2
Thats due to collaboration grid lock. How many pieces of hardware and software from how many companies are in a single
workstation - thousands of companies.
Getting all those companies to play ball under a single format, just so someone can get a PC at home to surf the internet, when its thousands of companies responsible to get all those parts delivered to a persons door step.
Its humanly impossible to QA 100% perfection on such devices, when you have thousands of companies involved in its make up.
Get rid of BOB 2.0!
By jnemesh on 2/21/2014 11:59:17 AM , Rating: 1
They need to get rid of "metro" and focus on what their customers actually want. Obviously they haven't learned ANYTHING from their failure with "Windows Bob", the last time they tried to engage "casual" users. No, they try it again, and FAIL again, with "Metro", yet refuse to back down, even when sales numbers make it obvious to everyone (except the people who make the decisions) that no one wants it! If they keep acting deaf to their customers, if they insist on a "Windows everywhere" plan for the future, they are DONE.
By Shadowmaster625 on 2/21/14, Rating: -1
RE: ekk
By NellyFromMA on 2/21/2014 1:05:30 PM , Rating: 5
Yeah, their software is so awful that they contributed to revolutionizing essentially every industry possible and birthed several new ones in the passed 2 decades at least.
It's so terrible that without Microsoft's terrible software, our lives would literally be NOTHING like they are today thanks to their terrible contributions.
It's especially terrible how they gave Google any relevance as a company by being the by-far primary client used to do web searches before and after Google's rise.
Yeah, how truly terrible -_-
RE: ekk
By ven1ger on 2/21/14, Rating: 0
RE: ekk
By amanojaku on 2/21/2014 3:07:44 PM , Rating: 2
Or it could be said that because of MS it became an obstacle to progress and Google was able to succeed in spite of MS.
This argument is tired. There are MANY alternatives to the products and services MS offers. Few have gained traction because the majority just aren't that good. That doesn't means everything MS makes is good; I'll pull a number out of my ass and say 70% of what MS makes is either crap or just OK. It's just that the alternatives aren't compelling, either.
I agree that MS has come a long way in creating better software but other companies prospered in spite of MS, while others went under because of MS and its interference.
The first part of this statement is true, the second part needs some qualification. Which companies? My biggest complaint was that MS had a habit of buying companies and killing off their software. Blame the business owners for selling when they didn't have to.
There were better operating systems long before MS-DOS and Windows 3.1 and several Windows iterations after that.
Truth, and there are better operating systems today, depending on the use case. However, many great products fail for various reasons. I was a longtime champion of UNIX, and thought UNIX would eventually dominate the world. Now, I won't touch a UNIX release other than AIX. All the other companies have gone out of business for the same reason that I generally wouldn't recommend AIX over Windows: high prices for hardware and software. UNIX companies priced themselves out of existence. MacOS was never an alternative to Windows in the server space, and Apple's desktops were too expensive, as well. You could get a PC for half the cost of a Mac, and it ran the same software. Apple finally got the message and started lowering its desktop prices after OS X was released. Linux? It's still not an OS that granny can use. "You can't install the software? Did you check the dependencies? Did you try compiling from source?"
Netscape was a better browser than IE
Yes, it was, but it wasn't included in the OS. The average person didn't have the patience to ftp to Netscape, navigate the directory structure, and download the latest Navigator release for his/her system. If Netscape wanted to stay relevant, it should have negotiated with MS to include Navigator on the Windows CDs. Netscape also stopped improving Navigator, and IE eventually became the better of the two. We started calling it Nutscrape, because that's what it felt like to use the last versions. This is what led me to use Opera for a while, since I hated IE.
Even Jean-Louis Gassée recognized the need to bundle a browser with the OS.
or many Word Perfect was better than Word.
For a while. I don't remember when, but Word just blew Word Perfect out of the water, and nothing has touched it since. And I was using Word Perfect on DOS 5.x.
But we now have MS to thank for being anti-competitive and removed competition that had good products but could not survive the juggernaut that MS was becoming.
Proof? There are many people who look back at the antitrust cases and wonder if the rulings would make any sense today.
Apple may have gain dominance because at the time they did have a better operating system back then and extremely good software.
I can't remember a time when the MacOS was better than Windows, or even good. I saw so many bombs (the MacOS version of a BSOD) that I could have started an air force! Even current versions of OS X are crap. A $600 Mac Mini with two GiBs of RAM barely even runs a web browser properly, with significant performance problems. A $400 Windows machine with 2GiB of RAM doesn't have that problem, whether it's running XP, Vista, 7 or 8.
As to the software, Apple became popular because of its initially exclusive software, namely Visicalc, WordStar and dBase, which were produced by 3rd parties. When Lotus 1-2-3, WordPerfect, and SQL came out, they destroyed Visicalc, WordStar, and dBase. And Apple sales.
RE: ekk
By drycrust3 on 2/21/2014 3:43:34 PM , Rating: 2
When I first started using a PC at work, I tried out all the different types of word processors, graphics packages, spreadsheets, etc on the file server. The one thing that stood out time and time again, was that Microsoft products did pretty much exactly what they were designed to do. If they weren't expected to do something, then they probably didn't do it. If something wasn't on the menu, or if something wasn't mentioned in the Help section, then it was 99% certain that that product didn't do it. However, if it was on the menu and it was in the Help section, then that feature would work, and it would work well.
the second part needs some qualification. Which companies?
Microsoft has a long history of aggressive treatment towards competitors. Whether that is right or wrong isn't the point, that is the way Microsoft decided to be. One day there will be no more Microsoft, and then how history judges Microsoft will be up to those who write their history.
RE: ekk
By w8gaming on 2/22/2014 2:36:32 AM , Rating: 3
Apple failed to compete with IBM and Microsoft in the 80s has nothing to do with MS being anti-competitive. Apple had failed to compete with the various PC vendors with their lower prices and choices of configurations. Sounds familiar?
RE: ekk
By Reclaimer77 on 2/21/2014 7:19:52 PM , Rating: 1
Google only thrived because Microsoft was way late with Bing. Had Microsoft known how to make a viable search engine and entrench themselves, they would have probably bullied bribed and crushed Google out of the market like they have every other competitor. Bing would have been the default Windows IE search, virtually guaranteeing a monopoly.
If you look at the market today, the only competition Microsoft has is in areas where they just flat out dropped the ball (mobile, web search, devices).
I agree that Microsoft has done some things that have translated into a positive, but to portray their behavior as something a bit too much to swallow.
RE: ekk
By atechfan on 2/22/2014 6:08:58 AM , Rating: 2
Bully? Google is king when it comes to bullying. They take what they want and use the threat of delisting from searches as a hammer to crush complaints about the theft.
RE: ekk
By Reclaimer77 on 2/22/2014 6:16:27 AM , Rating: 2
Yeah cause Google was the company nailed in Federal court because of anti-trust violations and almost broken in half. Due to using their market position to harm competition and a score of other shady sh*t.
Oh wait, my bad, THAT WAS MICROSOFT!
You should read up on Microsoft's rise to power and get some perspective. Don't worry about checking their closet for skeletons, that ran out of room long ago, they're stored in a warehouse now.
RE: ekk
By atechfan on 2/23/2014 6:38:07 AM , Rating: 2
I was around during the rise of MS to power and the anti-trust accusations. So I think I know a little more about it than someone getting info from Wikipedia, or whatever.
Some of this history lesson will seem por-MS and some anti-MS. I know that surprises you, but it is possible to have a balanced view.
The ONLY reason that MS even had a chance to become big was that IBM picked them. IBM had no real interest in the new home computer market. Their bread an butter was big iron, and they thought the personal computer would never amount to anything. But someone within the company convinced the brass to give it a try. But they didn't want to put any effort into it, so, unlike their mainframe and mini-computer businesses, they didn't develop their own OS and processors, but instead outsourced it.
Bill Gates managed to sell IBM on an operating system that they didn't even have yet, then went out and bought one. Anyone who has seen "Pirates of Silicon Valley" knows that much, I suppose. Both Intel and MS benefitted from IBM's seal of approval. While the IBM PC was inferior in many ways to the competition at the time, it was IBM, and "No one ever lost their job buying IBM."
The PC managed to sell to businesses for the mere fact it was IBM. But IBM made another decision that cemented the place of the PC. They allowed clones, which made the PC and PC compatible rule the business world, and made MS-DOS the de-facto OS.
On the home front, there were many systems more successful than the PC, because they were cheaper. But home PCs were little more than a hobbyist industry at the time, and the numbers were small compared to PCs in business. Ironically, these home systems soon progressed to be more powerful and have better OS's than the PC. AmigaOS was way better than MS-DOS, having true multitasking and better memory management.
The PC started to have a surge in the home market in the early 90s. By then, between prices coming down, and the fact people were getting used to PCs at work, the PC was starting to push Commodore, Tandy, Atari, and the others out of the home market. This started to get what was before considered "business software", like the word processor, used in the home. Sure, there were attempts to make them on Commodore 64s, and the like, but they didn't have the needed usability to make them popular.
Ok, step back over to the PC world. Wordperfect was the clear winner at the time for word processing on DOS. MS was just getting started at the time with Word, and it kinda sucked at the time. Windows was in its' infancy then as well, with 3.1 being the first that saw any real use, and even then, it was just something that launched on top of DOS.
WordPerfect's case against MS was that when Windows 95 was launched, Word had access to hidden API calls that Wordperfect did not. This was true, and MS was ordered to publish those API calls. It should have stopped there, but Wordperfect, by then, had stopped improving, while Word was passing it easily. Especially after Corel bought them.
Wordperfect started complaining that an unfair monopoly in OS was the reason. But at the time, the business world was still ruled by DOS, not Windows, so any unfair advantage that the Windows API calls gave Word didn't matter. Businesses thought that Win 95 was not stable enough and was just a toy for home users. Plus, it was hardly a monopoly. IBM was using OS/2 by then, which was superior to Windows 95 in most ways, and was gaining traction in enterprise.
IBM tried to make a consumer version of OS/2 with Warp, but MS trounced them on marketing. The Start Me Up ad campaign was hugely successful and cemented Windows 95 as the home OS of choice. In the mean time, MS was quickly improving NT for enterprise. NT grew out of a failed collaboration with IBM. For one reason or another, they went separate ways, with IBM going with OS/2 and MS going with NT, but they both grew out of the same project.
NT was a far superior kernel to the 95/98 line, which were basically hacked on to DOS, with many of the limitations of DOS still present. NT started to pick up a lot of enterprise use. During this transition, Wordperfect floundered. They like to place the blame on MS, but they really just stopped improving.
The other anti-trust cases were even weaker. At least with the Wordperfect case, MS did do what they were accused doing. Just calling Windows a monopoly at the time is questionable. This was also the era where many professional uses of PCs were dominated by Digital, Sun, or SGI as well. MS had plenty of competition at the time.
Step forward to the browser and media player wars. MS faced multi-million dollar fines for the "crime" of including a browser and media player with their OS. By this time, people expected their computers to access the internet and play videos and music. It was unreasonable to expect MS to ship an OS that had no browser or media player. The average person was not going to FTP Netscape or Opera. The fines for just giving users what they wanted were ludicrous.
Now to address your accusation that MS used bribes. I sure that if they were bribing people, neither the threat of breakup, nor the enormous fines, would have happened. MS gets accused of being anti-competitive in both US and EU, and gets severe penalties. Google gets accused of being anti-competitive in both US and EU, and they get told "Promise not to do it again". Who sound more likely to have bribed their way out?
RE: ekk
By Reclaimer77 on 2/23/14, Rating: 0
Related Articles
|
global_05_local_5_shard_00000035_processed.jsonl/30693
|
Comments Threshold
RE: Yeah right
By StevoLincolnite on 5/23/2008 1:19:07 AM , Rating: 3
There are 3 CPU Companies in the x86 arena, Intel, AMD and Via.
There are also 4 Graphics card company's for the Desktop, they are Matrox, nVidia, ATI/AMD and S3, with Intel soon to jump on board the Discreet Graphics card market.
Sound Card Producers are:
Creative, C-Media, Via and Realtek.
I kind of feel each one of the consoles serves a certain demographic instead of being an end all be all specific winner. To each thier own and Game On.
I agree, I have all 3 consoles, but because of my mature age, I find myself playing on the Xbox 360 rather than the Wii more often than not, unless I have friends over.
So far, the games I have on the 360 are GTA IV, Naruto: Rise of the Ninja, Assassins Creed, Gears of War, Halo 3, Turok, Perfect Dark Zero, CoD4 and a few others, where as the Wii I have party games like Mario Kart, Wii Sports, and the PS3 is just a great HTPC, but I will be picking up games like Final Fantasy for it in the future.
The thing is, the Wii is selling rather quickly, the PS3 is gaining momentum, and the Xbox 360 has a larger game attachment rate than the other consoles.
Personally it's a win/win situation for the consumers, as we get more choice, and thats always a good thing, and because of the fierce competition between the company's they are constantly adding firmware updates to enable new features, something that never happened in the previous generations.
RE: Yeah right
By TheOneStorm on 5/23/2008 8:18:40 AM , Rating: 2
Don't forget Razer sound cards... :)
RE: Yeah right
By Rouke on 5/23/2008 10:00:02 AM , Rating: 3
I don't agree with you concerning Hardware producing:
AMD & Intel are indeed CPU companies. But Via can't be taken seriously anymore. Take IBM instead (all consoles have one) Supercomputers as well.
And in the Graphics Arena contemplating power and market-ratio: Intel is the biggest allready: office on-chip units.
Matrox & S3 chips can't be taken seriously there either.
concerning your story on the console race I think your partilly right..
|
global_05_local_5_shard_00000035_processed.jsonl/30694
|
AMD struggles in a number of markets
Comments Threshold
RE: With the Wii chip
By mmntech on 7/14/2008 10:47:05 AM , Rating: 1
AMD also makes the graphics chip for the 360 so they've got a cushy business in that arena. The problem is that AMD is still mainly a CPU company, and that's where they're loosing business right now. The Core 2 is hammering them right now since it offers the best performance per dollar. The market needs a strong AMD since the competition forces innovation from the other manufacturers. Without the Athlon64, it's unlikely Intel would have progressed to the Core 2 so quickly, if at all. It benefits us as consumers.
RE: With the Wii chip
By maverick85wd on 7/14/2008 11:14:37 AM , Rating: 3
Early reviews for Nehalem make the picture even grimmer for AMD if they can't get Shanghai out soon. Obviously the market is better off with two fierce competitors battling it out on the price AND performance fronts (as evident in the NVIDIA/ATI GPU battle) I just hope AMD gets their act together and successfully shrinks to 45nm before it's too late.
RE: With the Wii chip
By NullSubroutine on 7/14/2008 11:38:30 PM , Rating: 2
Nehalem is only going to be an extreme enthusiast or high end server chip for a good 6 months after release. You won't see 250-500 Nehalem based chips until 2H 2009, late 2Q at the earliest.
RE: With the Wii chip
By Phynaz on 7/14/2008 11:58:55 AM , Rating: 2
The 360 gpu was designed by ATI but is not supplied bt ATI. AMD gets no revenue from 360 sales.
RE: With the Wii chip
By HrilL on 7/14/2008 12:20:35 PM , Rating: 2
I'm sure they do. It is called royalties. They probably get something for every chip made.
RE: With the Wii chip
RE: With the Wii chip
RE: With the Wii chip
|
global_05_local_5_shard_00000035_processed.jsonl/30699
|
Google looks to lay a dinosaur of a browser to rest
or support Internet Explorer 6. Writes Google:
Comments Threshold
RE: Microsoft's mistake costs everyone else
By ICBM on 2/2/2010 5:43:44 PM , Rating: 2
Had it not been for IE being "stuffed" down out throats, we could never have downloaded Firefox,Opera, etc..
I am tired of people claiming Microsoft was/is pushing IE on people. So what if Microsoft includes a browser with the OS, you aren't forced to use it. Last time I checked you can download any browser you want.
By porkpie on 2/3/2010 1:13:13 AM , Rating: 2
Very true. People seem to forget that before MS started distributing a free browser, you actually had to PAY to buy one. Would that fly today? Not hardly.
Had MS started developing Windows today, they'd be sued by the EU for "stuffing a GUI down our throats", since prior to Windows/OS2, our notion of an operating system didn't include a graphic shell. Microsoft should be praised for continually expanding our concept of what an OS is. God knows none of want to go back to the days of having to buy and install separate products such as networking, disk defragger, browsers and ftp clients, and a bazillion other things that we now take for granted because they were "crammed down our throats" by MS.
|
global_05_local_5_shard_00000035_processed.jsonl/30701
|
"Red Faction: Armageddon" (Source:
Company sees PC as "the most variable"
Comments Threshold
RE: All hail misleading info
By Connoisseur on 3/21/2011 12:02:04 PM , Rating: 2
OMG I logged in just to reply to this comment. FreeSpace 1 and 2 were amongst the greatest games ever created and they were the pinnacle of space combat games. No other game comes close. WTF happened to the genre? :(
Long live FreeSpace.
RE: All hail misleading info
By Jcollector1 on 3/23/2011 1:43:04 PM , Rating: 2
Freespace 2 was the absolute most complete gaming experience ever.
As a SciFi fan NOTHING can touch the storyline, the gameplay, and the overall experience. I still remember the goosebumps I had on the final mission when the 6 Shivan dreadnaughts came pouring through hyperspace while you stayed back fighting off hoards of fighters so the fleet could get into the jumpgate. I think that mission literally was 1 hour of pure gaming adrenaline the likes that I have never felt before.
Seriously Volition why the hell haven't you started on Freespace 3??? I couldn't imagine what it would be like playing on a 30" widescreen with dual 6xxx radeons or 5xx Nvidia's. I mean fresspace 2 looked great on a geforce 4200ti.....
There is so much left to the storyline!!!
|
global_05_local_5_shard_00000035_processed.jsonl/30702
|
Sony VAIO Z with Power Media Dock
Sony VAIO Z and its "sheet battery"
Back end of VAIO Z Power Media Dock
The Power Media Dock adds 1.51 pounds to the overall package.
Comments Threshold
'Slimness' claims another victim
By Johnmcl7 on 6/28/2011 5:00:29 PM , Rating: 2
Against the previous Z series I think this machine is disappointing as it's not longer an all in one machine. One of the reasons I've chosen several Sony machines is because each of them didn't need extra docks or connectors as was typical for rival machines particularly no optical drives on sub 13in machines. I'm not keen on carrying bits and pieces around with the laptop to make it 'whole' and when I get home and need performance I'll be using a desktop.
Also I'm not that convinced there's that much need to slim the machine down so much, I have the older Z5 which is slightly heavier but it's still a very portable machine and far more useful to me to have discrete graphics and a blu-ray writer onboard.
|
global_05_local_5_shard_00000035_processed.jsonl/30704
|
(Source: HTC)
RIM CEO Thorsten Heins [Image Source: RIMarkable]
Kanye baking cookies
Source: CrackBerry
Comments Threshold
RE: Android Fanboy Article?
By retrospooty on 1/27/2012 11:01:40 AM , Rating: 3
"Do you remember the BB Storm? That was a joke of a phone. Then they managed to make it worse with the second release. What you are seeing now is RIM tailspinning out of control. Instead of trying to "insult" another major OS, maybe they should be focusing on making something developers want to develop for and release phones that consumers want. "
Exactly. Everything they do lately appears totally inept. From crappy phones like the storm, to horribly received and horribly reviewed products like the playbook, to the simplest of tasks like choosing a name for thier next gen OS. As was noted here at Anandtech/Dailytech, a simple 10 second Google search would show them that hte name BBX is already in use. Now a company the size of RIM with all their lawyers couldnt figure out that BBX was a nogo on the name? Its just retarded for a company to go that far and not notice something like that.
Even thier once strong IT dept. hold outs are giving in and using IOS and Android because their end users are screaming to not get "another blackberry" They simply dont want to use Blackberries. Every phone they have looks old and dated, and people just dont want them, other than a few eccentric holdouts like Martello and Pirks that are an extremely tiny minority.
|
global_05_local_5_shard_00000035_processed.jsonl/30714
|
EntertainmentEntertainment Restaurants Restaurant Photos
Restaurant Photos
Photo: Ben Torres/Special Contributor
THE FRONT ROOM: A PARK CITIES DINER -- Here, the classic Benedict, topped with luscious slices of Benton's Smoky Mountain Country Ham, is one of chef Nick Amoriello's best dishes. Lapped in a lemony hollandaise, it comes with potato pancake-like hash browns.
|
global_05_local_5_shard_00000035_processed.jsonl/30788
|
Building Expert Systems in Prolog by ad_iem
VIEWS: 5,404 PAGES: 150
More Info
Building Expert Systems in Prolog Index Preface & Acknowledgements Preface Acknowledgements 1 Introduction 1.1 Expert Systems 1.2 Expert System Features Goal-Driven Reasoning Uncertainty Data Driven Reasoning Data Representation User Interface Explanations 1.3 Sample Applications 1.4 Prolog 1.5 Assumptions 2 Using Prolog's Inference Engine 2.1 The Bird Identification System Rule formats Rules about birds Rules for hierarchical relationships Rules for other relationships 2.2 User Interface Attribute Value pairs Asking the user Remembering the answer Multi-valued answers Menus for the user Other enhancements 2.3 A Simple Shell Command loop A tool for non-programmers 2.4 Summary Exercises 3 Backward Chaining with Uncertainty 3.1 Certainty Factors An Example Rule Uncertainty User Uncertainty Combining Certainties Properties of Certainty Factors 3.2 MYCINs Certainty Factors Determining Premise CF Combining Premise CF and Conclusion CF Premise Threshold CF Combining CFs 3.3 Rule Format 3.4 The Inference Engine Working Storage -1-
Find a Value for an Attribute Attribute Value Already Known Ask User for Attribute Value Deduce Attribute Value from Rules 3.5 Making the Shell Starting the Inference 3.6 English-like Rules Exercises 4 Explanation Value of Explanations to the User Value of Explanations to the Developer Types of Explanation 4.1 Explanation in Clam Tracing How Explanations Why Questions 4.2 Native Prolog Systems Exercises 5 Forward Chaining 5.1 Production Systems 5.2 Using Oops 5.3 Implementation 5.4 Explanations for Oops 5.5 Enhancements 5.6 Rule Selection Generating the conflict set Time stamps 5.7 LEX Changes in the Rules Implementing LEX 5.8 MEA Exercises 6 Frames 6.1 The Code 6.2 Data Structure 6.3 The Manipulation Predicates 6.4 Using Frames 6.5 Summary Exercises 7 Integration 7.1 Foops (Frames and Oops) Instances Rules for frinsts Adding Prolog to Foops 7.2 Room Configuration Furniture frames Frame Demons Initial Data Input Data The Rules Output Data -2-
7.3 A Sample Run 7.4 Summary Exercises 8 Performance 8.1 Backward Chaining Indexes 8.2 Rete Match Algorithm Network Nodes Network Propagation Example of Network Propagation Performance Improvements 8.3 The Rete Graph Data Structures 8.4 Propagating Tokens 8.5 The Rule Compiler 8.6 Integration with Foops 8.7 Design Tradeoffs Exercises 9 User Interface 9.1 Object Oriented Window Interface 9.2 Developer's Interface to Windows 9.3 High-Level Window Implementation Message Passing Inheritance 9.4 Low-Level Window Implementation Exercises 10 Two Hybrids 10.1 CVGEN 10.2 The Knowledge Base Rule for parameters Rules for derived information Questions for the user Default rules Rules for edits Static information 10.3 Inference Engine 10.4 Explanations 10.5 Environment 10.6 AIJMP 10.7 Summary Exercises 11 Prototyping 11.1 The Problem 11.2 The Sales Advisor Knowledge Base Qualifying Objectives - Benefits - Features Situation Analysis Competitive Analysis Miscellaneous Advice User Queries 11.3 The Inference Engine 11.4 User Interface 11.5 Summary -3-
Exercises 12 Rubik's Cube 12.1 The Problem 12.2 The Cube 12.3 Rotation 12.4 High Level Rules 12.5 Improving the State 12.6 The Search 12.7 More Heuristics 12.8 User Interface 12.9 On the Limits of Machines Exercises Appendix - Full Source Code Native Clam Oops Foops Rete-Foops Windows Rubik Taxes (Bonus Code)
1 Introduction
Over the past several years there have been many implementations of expert systems using various tools and various hardware platforms, from powerful LISP machine workstations to smaller personal computers. The technology has left the confines of the academic world and has spread through many commercial institutions. People wanting to explore the technology and experiment with it have a bewildering selection of tools from which to choose. There continues to be a debate as to whether or not it is best to write expert systems using a high-level shell, an AI language such as LISP or Prolog, or a conventional language such as C. This book is designed to teach you how to build expert systems from the inside out. It presents the various features used in expert systems, shows how to implement them in Prolog, and how to use them to solve problems. The code presented in this book is a foundation from which many types of expert systems can be built. It can be modified and tuned for particular applications. It can be used for rapid prototyping. It can be used as an educational laboratory for experimenting with expert system concepts.
1.1 Expert Systems
Expert systems are computer applications which embody some non-algorithmic expertise for solving certain types of problems. For example, expert systems are used in diagnostic applications servicing both people and machinery. They also play chess, make financial planning decisions, configure computers, monitor real time systems, underwrite insurance policies, and perform many other services which previously required human expertise.
Figure 1.1 Expert system components and human interfaces
Expert systems have a number of major system components and interface with individuals in various roles. These are illustrated in figure 1.1. The major components are: • Knowledge base - a declarative representation of the expertise, often in IF THEN rules; • Working storage - the data which is specific to a problem being solved; • Inference engine - the code at the core of the system which derives recommendations from the knowledge base and problem-specific data in working storage;
• User interface - the code that controls the dialog between the user and the system. To understand expert system design, it is also necessary to understand the major roles of individuals who interact with the system. These are: • Domain expert - the individual or individuals who currently are experts solving the problems the system is intended to solve; • Knowledge engineer - the individual who encodes the expert's knowledge in a declarative form that can be used by the expert system; • User - the individual who will be consulting with the system to get advice which would have been provided by the expert. Many expert systems are built with products called expert system shells. The shell is a piece of software which contains the user interface, a format for declarative knowledge in the knowledge base, and an inference engine. The knowledge engineer uses the shell to build a system for a particular problem domain. Expert systems are also built with shells that are custom developed for particular applications. In this case there is another key individual: • System engineer - the individual who builds the user interface, designs the declarative format of the knowledge base, and implements the inference engine. Depending on the size of the project, the knowledge engineer and the system engineer might be the same person. For a custom built system, the design of the format of the knowledge base, and the coding of the domain knowledge are closely related. The format has a significant effect on the coding of the knowledge. One of the major bottlenecks in building expert systems is the knowledge engineering process. The coding of the expertise into the declarative rule format can be a difficult and tedious task. One major advantage of a customized shell is that the format of the knowledge base can be designed to facilitate the knowledge engineering process. The objective of this design process is to reduce the semantic gap. Semantic gap refers to the difference between the natural representation of some knowledge and the programmatic representation of that knowledge. For example, compare the semantic gap between a mathematical formula and its representation in both assembler and FORTRAN. FORTRAN code (for formulas) has a smaller semantic gap and is therefor easier to work with. Since the major bottleneck in expert system development is the building of the knowledge base, it stands to reason that the semantic gap between the expert's representation of the knowledge and the representation in the knowledge base should be minimized. With a customized system, the system engineer can implement a knowledge base whose structures are as close as possible to those used by the domain expert. This book concentrates primarily on the techniques used by the system engineer and knowledge engineer to design customized systems. It explains the various types of inference engines and knowledge bases that can be designed, and how to build and use them. It tells how they can be mixed together for some problems, and customized to meet the needs of a given application.
1.2 Expert System Features
There are a number of features which are commonly used in expert systems. Some shells provide most of these features, and others just a few. Customized shells provide the features which are best suited for the particular problem. The major features covered in this book are: • Goal driven reasoning or backward chaining - an inference technique which uses IF THEN rules to repetitively break a goal into smaller sub-goals which are easier to prove;
• Coping with uncertainty - the ability of the system to reason with rules and data which are not precisely known; • Data driven reasoning or forward chaining - an inference technique which uses IF THEN rules to deduce a problem solution from initial data; • Data representation - the way in which the problem specific data in the system is stored and accessed; • User interface - that portion of the code which creates an easy to use system; • Explanations - the ability of the system to explain the reasoning process that it used to reach a recommendation.
Goal-Driven Reasoning
Goal-driven reasoning, or backward chaining, is an efficient way to solve problems that can be modelled as "structured selection" problems. That is, the aim of the system is to pick the best choice from many enumerated possibilities. For example, an identification problem falls in this category. Diagnostic systems also fit this model, since the aim of the system is to pick the correct diagnosis. The knowledge is structured in rules which describe how each of the possibilities might be selected. The rule breaks the problem into sub-problems. For example, the following top level rules are in a system which identifies birds. IF family is albatross and color is white THEN bird is laysan albatross. IF family is albatross and color is dark THEN bird is black footed albatross. The system would try all of the rules which gave information satisfying the goal of identifying the bird. Each would trigger sub-goals. In the case of these two rules, the sub-goals of determining the family and the color would be pursued. The following rule is one that satisfies the family sub-goal: IF order is tubenose and size large and wings long narrow THEN family is albatross. The sub-goals of determining color, size, and wings would be satisfied by asking the user. By having the lowest level sub-goal satisfied or denied by the user, the system effectively carries on a dialog with the user. The user sees the system asking questions and responding to answers as it attempts to find the rule which correctly identifies the bird.
Figure 1.2. Difference between forward and backward chaining
Often times in structured selection problems the final answer is not known with complete certainty. The expert's rules might be vague, and the user might be unsure of answers to questions. This can be easily seen in medical diagnostic systems where the expert is not able to be definite about the relationship between symptoms and diseases. In fact, the doctor might offer multiple possible diagnoses. For expert systems to work in the real world they must also be able to deal with uncertainty. One of the simplest schemes is to associate a numeric value with each piece of information in the system. The numeric value represents the certainty with which the information is known. There are numerous ways in which these numbers can be defined, and how they are combined during the inference process.
Data Driven Reasoning
For many problems it is not possible to enumerate all of the possible answers before hand and have the system select the correct one. For example, configuration problems fall in this category. These systems might put components in a computer, design circuit boards, or lay out office space. Since the inputs vary and can be combined in an almost infinite number of ways, the goal driven approach will not work. The data driven approach, or forward chaining, uses rules similar to those used for backward chaining, however, the inference process is different. The system keeps track of the current state of problem solution and looks for rules which will move that state closer to a final solution. A system to layout living room furniture would begin with a problem state consisting of a number of unplaced pieces of furniture. Various rules would be responsible for placing the furniture in the room, thus changing the problem state. When all of the furniture was placed, the system would be finished, and the output would be the final state. Here is a rule from such a system which places the television opposite the couch. IF unplaced tv and couch on wall(X) and wall(Y) opposite wall(X)
- 10 -
THEN place tv on wall(Y). This rule would take a problem state with an unplaced television and transform it to a state that had the television placed on the opposite wall from the couch. Since the television is now placed, this rule will not fire again. Other rules for other furniture will fire until the furniture arrangement task is finished. Note that for a data driven system, the system must be initially populated with data, in contrast to the goal driven system which gathers data as it needs it. Figure 1.2 illustrates the difference between forward and backward chaining systems for two simplified rules. The forward chaining system starts with the data of a=1 and b=2 and uses the rules to derive d=4. The backward chaining system starts with the goal of finding a value for d and uses the two rules to reduce that to the problem of finding values for a and b.
Figure 1.3. Four levels of data representation
Data Representation
For all rule based systems, the rules refer to data. The data representation can be simple or complex, depending on the problem. The four levels described in this section are illustrated in figure 1.3. The most fundamental scheme uses attribute-value pairs as seen in the rules for identifying birds. Examples are color-white, and size-large. When a system is reasoning about multiple objects, it is necessary to include the object as well as the attributevalue. For example the furniture placement system might be dealing with multiple chairs with different attributes, such as size. The data representation in this case must include the object.
- 11 -
Once there are objects in the system, they each might have multiple attributes. This leads to a record-based structure where a single data item in working storage contains an object name and all of its associated attributevalue pairs. Frames are a more complex way of storing objects and their attribute-values. Frames add intelligence to the data representation, and allow objects to inherit values from other objects. Furthermore, each of the attributes can have associated with it procedures (called demons) which are executed when the attribute is asked for, or updated. In a furniture placement system each piece of furniture can inherit default values for length. When the piece is placed, demons are activated which automatically adjust the available space where the item was placed.
User Interface
The acceptability of an expert system depends to a great extent on the quality of the user interface. The easiest to implement interfaces communicate with the user through a scrolling dialog as illustrated in figure 1.4. The user can enter commands, and respond to questions. The system responds to commands, and asks questions during the inferencing process. More advanced interfaces make heavy use of pop-up menus, windows, mice, and similar techniques as shown in figure 1.5. If the machine supports it, graphics can also be a powerful tool for communicating with the user. This is especially true for the development interface which is used by the knowledge engineer in building the system.
Figure 1.4. Scrolling dialog user interface
Figure 1.5. Window and menu user interface
- 12 -
One of the more interesting features of expert systems is their ability to explain themselves. Given that the system knows which rules were used during the inference process, it is possible for the system to provide those rules to the user as a means for explaining the results. This type of explanation can be very dramatic for some systems such as the bird identification system. It could report that it knew the bird was a black footed albatross because it knew it was dark colored and an albatross. It could similarly justify how it knew it was an albatross. At other times, however, the explanations are relatively useless to the user. This is because the rules of an expert system typically represent empirical knowledge, and not a deep understanding of the problem domain. For example a car diagnostic system has rules which relate symptoms to problems, but no rules which describe why those symptoms are related to those problems. Explanations are always of extreme value to the knowledge engineer. They are the program traces for knowledge bases. By looking at explanations the knowledge engineer can see how the system is behaving, and how the rules and data are interacting. This is an invaluable diagnostic tool during development.
1.3 Sample Applications
In chapters 2 through 9, some simple expert systems are used as examples to illustrate the features and how they apply to different problems. These include a bird identification system, a car diagnostic system, and a system which places furniture in a living room. Chapters 10 and 11 focus on some actual systems used in commercial environments. These were based on the principles in the book, and use some of the code from the book. The final chapter describes a specialized expert system which solves Rubik's cube and does not use any of the formalized techniques presented earlier in the book. It illustrates how to customize a system for a highly specialized problem domain.
1.4 Prolog
The details of building expert systems are illustrated in this book through the use of Prolog code. There is a small semantic gap between Prolog code and the logical specification of a program. This means the description of a section of code, and the code are relatively similar. Because of the small semantic gap, the code examples are shorter and more concise than they might be with another language. The expressiveness of Prolog is due to three major features of the language: rule-based programming, built-in pattern matching, and backtracking execution. The rule-based programming allows the program code to be written in a form which is more declarative than procedural. This is made possible by the built-in pattern matching and backtracking which automatically provide for the flow of control in the program. Together these features make it possible to elegantly implement many types of expert systems. There are also arguments in favor of using conventional languages, such as C, for building expert system shells. Usually these arguments center around issues of portability, performance, and developer experience. As newer versions of commercial Prologs have increased sophistication, portability, and performance, the advantages of C over Prolog decrease. However, there will always be a need for expert system tools in other languages. (One mainframe expert system shell is written entirely in COBOL.) For those seeking to build systems in other languages, this book is still of value. Since the Prolog code is close to the logical specification of a program, it can be used as the basis for implementation in another language.
1.5 Assumptions
- 13 -
This book is written with the assumption that the reader understands Prolog programming. If not, Programming in Prolog by Clocksin and Mellish from Springer-Verlag is the classic Prolog text. APT - The Active Prolog Tutor by the author and published by Solution Systems in South Weymouth, Massachusetts is an interactive PC based tutorial that includes a practice Prolog interpreter. An in depth understanding of expert systems is not required, but the reader will probably find it useful to explore other texts. In particular since this book focuses on system engineering, readings in knowledge engineering would provide complementary information. Some good books in this area are: Building Expert Systems by Hayes-Roth, Waterman, and Lenat; Rule-Based Expert Systems by Buchanan and Shortliffe; and Programming Expert Systems in OPS5 by Brownston, Kant, Farrell, and Martin.
- 14 -
2 Using Prolog's Inference Engine
Prolog has a built-in backward chaining inference engine which can be used to partially implement some expert systems. Prolog rules are used for the knowledge representation, and the Prolog inference engine is used to derive conclusions. Other portions of the system, such as the user interface, must be coded using Prolog as a programming language. The Prolog inference engine does simple backward chaining. Each rule has a goal and a number of sub-goals. The Prolog inference engine either proves or disproves each goal. There is no uncertainty associated with the results. This rule structure and inference strategy is adequate for many expert system applications. Only the dialog with the user needs to be improved to create a simple expert system. These features are used in this chapter to build a sample application called, "Birds, " which identifies birds. In the later portion of this chapter the Birds system is split into two modules. One contains the knowledge for bird identification, and the other becomes "Native, " the first expert system shell developed in the book. Native can then be used to implement other similar expert systems.
2.1 The Bird Identification System
A system which identifies birds will be used to illustrate a native Prolog expert system. The expertise in the system is a small subset of that contained in Birds of North America by Robbins, Bruum, Zim, and Singer. The rules of the system were designed to illustrate how to represent various types of knowledge, rather than to provide accurate identification.
Rule formats
The rules for expert systems are usually written in the form: IF first premise, and second premise, and ... THEN conclusion The IF side of the rule is referred to as the left hand side (LHS), and the THEN side is referred to as the right hand side (RHS). This is semantically the same as a Prolog rule: conclusion :first_premise, second_premise, ... Note that this is a bit confusing since the syntax of Prolog is really THEN IF, and the normal RHS and LHS appear on opposite sides.
Rules about birds
The most fundamental rules in the system identify the various species of birds. We can begin to build the system immediately by writing some rules. Using the normal IF THEN format, a rule for identifying a particular albatross is:
- 15 -
IF family is albatross and color is white THEN bird is laysan_albatross In Prolog the same rule is: bird(laysan_albatross) :family(albatross), color(white). The following rules distinguish between two types of albatross and swan. They are clauses of the predicate bird/1: bird(laysan_albatross):family(albatross), color(white). bird(black_footed_albatross):family(albatross), color(dark). bird(whistling_swan) :family(swan), voice(muffled_musical_whistle). bird(trumpeter_swan) :family(swan), voice(loud_trumpeting). In order for these rules to succeed in distinguishing the two birds, we would have to store facts about a particular bird that needed identification in the program. For example if we added the following facts to the program: family(albatross). color(dark). then the following query could be used to identify the bird: ?- bird(X). X = black_footed_albatross Note that at this very early stage there is a complete working Prolog program which functions as an expert system to distinguish between these four birds. The user interface is the Prolog interpreter's interface, and the input data is stored directly in the program.
Rules for hierarchical relationships
The next step in building the system would be to represent the natural hierarchy of a bird classification system. These would include rules for identifying the family and the order of a bird. Continuing with the albatross and swan lines, the predicates for order and family are: order(tubenose) :nostrils(external_tubular),
- 16 -
live(at_sea), bill(hooked). order(waterfowl) :feet(webbed), bill(flat). family(albatross) :order(tubenose), size(large), wings(long_narrow). family(swan) :order(waterfowl), neck(long), color(white), flight(ponderous). Now the expert system will identify an albatross from more fundamental observations about the bird. In the first version, the predicate for family was implemented as a simple fact. Now family is implemented as a rule. The facts in the system can now reflect more primitive data: nostrils(external_tubular). live(at_sea). bill(hooked). size(large). wings(long_narrow). color(dark). The same query still identifies the bird: ?- bird(X). X = black_footed_albatross So far the rules for birds just reflect the attributes of various birds, and the hierarchical classification system. This type of organization could also be handled in more conventional languages as well as in Prolog or some other rule-based language. Expert systems begin to give advantages over other approaches when there is no clear hierarchy, and the organization of the information is more chaotic.
- 17 -
Figure 2.1. Relationships between some of the rules in the Bird identification system
Rules for other relationships
The Canada goose can be used to add some complexity to the system. Since it spends its summers in Canada, and its winters in the United States, its identification includes where it was seen and in what season. Two different rules would be needed to cover these two situations: bird(canada_goose):family(goose), season(winter), country(united_states), head(black), cheek(white). bird(canada_goose):family(goose), season(summer), country(canada), head(black), cheek(white). These goals can refer to other predicates in a different hierarchy: country(united_states):- region(mid_west). country(united_states):- region(south_west). country(united_states):- region(north_west). country(united_states):- region(mid_atlantic). country(canada):- province(ontario). country(canada):- province(quebec). region(new_england):state(X), member(X, [massachusetts, vermont, ....]).
- 18 -
region(south_east):state(X), member(X, [florida, mississippi, ....]). There are other birds that require multiple rules for the different characteristics of the male and female. For example the male mallard has a green head, and the female is mottled brown. bird(mallard):family(duck), voice(quack), head(green). bird(mallard):family(duck), voice(quack), color(mottled_brown). Figure 2.1 shows some of the relationships between the rules to identify birds. Basically, any kind of identification situation from a bird book can be easily expressed in Prolog rules. These rules form the knowledge base of an expert system. The only drawback to the program is the user interface, which requires the data to be entered into the system as facts.
2.2 User Interface
The system can be dramatically improved by providing a user interface which prompts for information when it is needed, rather than forcing the user to enter it beforehand. The predicate ask will provide this function.
Attribute Value pairs
Before looking at ask, it is necessary to understand the structure of the data which will be asked about. All of the data has been of the form: "attribute-value". For example, a bird is a mallard if it has the following values for these selected bird attributes: Attribute Value family duck voice quack head green This is one of the simplest forms of representing data in an expert system, but is sufficient for many applications. More complex representations can have "object-attribute-value" triples, where the attribute-values are tied to various objects in the system. Still more complex information can be associated with an object and this will be covered in the chapter on frames. For now the simple attribute-value data model will suffice. This data structure has been represented in Prolog by predicates which use the predicate name to represent the attribute, and a single argument to represent the value. The rules refer to attribute-value pairs as conditions to be tested in the normal Prolog fashion. For example, the rule for mallard had the condition head(green) in the rule. Of course since we are using Prolog, the full richness of Prolog's data structures could be used, as in fact list membership was used in the rules for region. The final chapter discusses a system which makes full use of Prolog throughout the system. However, the basic attribute-value concept goes a long way for many expert systems, and using it consistantly makes the implementation of features such as the user interface easier.
- 19 -
Asking the user
The ask predicate will have to determine from the user whether or not a given attribute-value pair is true. The program needs to be modified to specify which attributes are askable. This is easily done by making rules for those attributes which call ask. eats(X):- ask(eats, X). feet(X):- ask(feet, X). wings(X):- ask(wings, X). neck(X):- ask(neck, X). color(X):- ask(color, X). Now if the system has the goal of finding color(white) it will call ask, rather than look in the program. If ask(color, white) succeeds, color(white) succeeds. The simplest version of ask prompts the user with the requested attribute and value and seeks confirmation or denial of the proposed information. The code is: ask(Attr, Val):write(Attr:Val), write('? '), read(yes). The read will succeed if the user answers "yes", and fail if the user types anything else. Now the program can be run without having the data built into the program. The same query to bird starts the program, but now the user is responsible for determining whether some of the attribute-values are true. The following dialog shows how the system runs: ?- bird(X). nostrils : external_tubular? yes. live : at_sea? yes. bill : hooked? yes. size : large? yes. wings : long_narrow? yes. color : white? yes. X = laysan_albatross There is a problem with this approach. If the user answered "no" to the last question, then the rule for bird(laysan_albatross) would have failed and backtracking would have caused the next rule for bird(black_footed_albatross) to be tried. The first subgoal of the new rule causes Prolog to try to prove family(albatross) again, and ask the same questions it already asked. It would be better if the system remembered the answers to questions and did not ask again.
Remembering the answer
A new predicate, known/3 is used to remember the user's answers to questions. It is not specified directly in the program, but rather is dynamically asserted whenever ask gets new information from the user.
- 20 -
Every time ask is called it first checks to see if the answer is already known to be yes or no. If it is not already known, then ask will assert it after it gets a response from the user. The three arguments to known are: yes/no, attribute, and value. The new version of ask looks like: ask(A, V):known(yes, A, V), % succeed if true !. % stop looking ask(A, V):known(_, A, V), % fail if false !, fail. ask(A, V):write(A:V), % ask user write('? : '), read(Y), % get the answer asserta(known(Y, A, V)), % remember it Y == yes. % succeed or fail The cuts in the first two rules prevent ask from backtracking after it has already determined the answer.
Multi-valued answers
There is another level of subtlety in the approach to known. The ask predicate now assumes that each particular attribute value pair is either true or false. This means that the user could respond with a "yes" to both color:white and color:black. In effect, we are letting the attributes be multi-valued. This might make sense for some attributes such as voice but not others such as bill, which only take a single value. The best way to handle this is to add an additional predicate to the program which specifies which attributes are multi-valued: multivalued(voice). multivalued(feed). A new clause is now added to ask to cover the case where the attribute is not multi-valued (therefor singlevalued) and already has a different value from the one asked for. In this case ask should fail. For example, if the user has already answered yes to size - large then ask should automatically fail a request for size - small without asking the user. The new clause goes before the clause which actually asks the user: ask(A, V):not multivalued(A), known(yes, A, V2), V \== V2, !, fail.
Menus for the user
The user interface can further be improved by adding a menu capability which gives the user a list of possible values for an attribute. It can further enforce that the user enter a value on the menu. This can be implemented with a new predicate, menuask. It is similar to ask, but has an additional argument which contains a list of possible values for the attribute. It would be used in the program in an analogous fashion to ask: size(X):- menuask(size, X, [large, plump, medium, small]). flight(X):- menuask(flight, X, [ponderous, agile, flap_glide]).
- 21 -
The menuask predicate can be implemented using either a sophisticated windowing interface, or by simply listing the menu choices on the screen for the user. When the user returns a value it can be verified, and the user reprompted if it is not a legal value. A simple implementation would have initial clauses as in ask, and have a slightly different clause for actually asking the user. That last clause of menuask might look like: menuask(A, V, MenuList) :write('What is the value for'), write(A), write('?'), nl, write(MenuList), nl, read(X), check_val(X, A, V, MenuList), asserta( known(yes, A, X) ), X == V. check_val(X, A, V, MenuList) :member(X, MenuList), !. check_val(X, A, V, MenuList) :write(X), write(' is not a legal value, try again.'), nl, menuask(A, V, MenuList). The check_val predicate validates the user's input. In this case the test ensures the user entered a value on the list. If not, it retries the menuask predicate.
Other enhancements
Other enhancements can also be made to allow for more detailed prompts to the user, and other types of input validation. These can be included as other arguments to ask, or embodied in other versions of the ask predicate. Chapter 10 gives other examples along these lines.
2.3 A Simple Shell
The bird identification program has two distinct parts: the knowledge base, which contains the specific information about bird identification; and the predicates which control the user interface. By separating the two parts, a shell can be created which can be used with any other knowledge base. For example, a new expert system could be written which identified fish. It could be used with the same user interface code developed for the bird identification system. The minimal change needed to break the two parts into two modules is a high level predicate which starts the identification process. Since in general it is not known what is being identified, the shell will seek to solve a generic predicate called top_goal. Each knowledge base will have to have a top_goal which calls the goal to be satisfied. For example: top_goal(X) :- bird(X). This is now the first predicate in the knowledge base about birds. The shell has a predicate called solve, which does some housekeeping and then solves for the top_goal. It looks like: solve :abolish(known, 3), define(known, 3), top_goal(X), write('The answer is '), write(X), nl.
- 22 -
solve :write('No answer found.'), nl. The built-in abolish predicate is used to remove any previous knowns from the system when a new consultation is started. This allows the user to call solve multiple times in a single session. The abolish and define predicates are built-in predicates which respectively remove previous knowns for a new consultation, and ensure that known is defined to the system so no error condition is raised the first time it is referenced. Different dialects of Prolog might require different built-in predicate calls. In summary, the predicates of the bird identification system have been divided into two modules. The predicates which are in the shell called Native, are: solve - starts the consultation; ask - poses simple questions to the users and remembers the answers; menuask - presents the user with a menu of choices; supporting predicates for the above three predicates. The predicates which are in the knowledge base are: top_goal - specifies the top goal in the knowledge base; rules for identifying or selecting whatever it is the knowledge base was built for (for example bird, order, family, and region); rules for attributes which must be user supplied (for example size, color, eats, and wings); multivalued - defines which attributes might have multiple values. To use this shell with a Prolog interpreter, both the shell and the birds knowledge base must be consulted. Then the query for solve is started. ?- consult(native). yes ?- consult('birds.kb'). yes ?- solve. nostrils : external_tubular? ...
Command loop
The shell can be further enhanced to have a top level command loop called go. To begin with, go should recognize three commands: load - Load a knowledge base. consult - Consult the knowledge base by satisfying the top goal of the knowledge base.
- 23 -
quit - Exit from the shell. The go predicate will also display a greeting and give the user a prompt for a command. After reading a command, do is called to execute the command. This allows the command names to be different from the actual Prolog predicates which execute the command. For example, the common command for starting an inference is consult, however consult is the name of a built-in predicate in Prolog. This is the code: go :greeting, repeat, write('> '), read(X), do(X), X == quit. greeting :write('This is the Native Prolog shell.'), nl, write('Enter load, consult, or quit at the prompt.'), nl. do(load) :- load_kb, !. do(consult) :- solve, !. do(quit). do(X) :write(X), write('is not a legal command.'), nl, fail. The go predicate uses a repeat fail loop to continue until the user enters the command quit. The do predicate provides an easy mechanism for linking the user's commands to the predicates which do the work in the program. The only new predicate is load_kb which reconsults a knowledge base. It looks like: load_kb :write('Enter file name: '), read(F), reconsult(F). Two other commands which could be added at this point are: help - provide a list of legal commands; list - list all of the knowns derived during the consultation (useful for debugging).
- 24 -
Figure 2.2. Major predicates of Native Prolog shell
This new version of the shell can either be run from the interpreter as before, or compiled and executed. The load command is used to load the knowledge base for use with the compiled shell. The exact interaction between compiled and interpreted Prolog varies from implementation to implementation. Figure 2.2 shows the architecture of the Native shell. Using an interpreter the system would run as follows: ?- consult(native). yes ?- go. This is the native Prolog shell. Enter load, consult, or quit at the prompt. >load. Enter file name: 'birds.kb'. >consult. nostrils : external_tubular ? yes. ... The answer is black_footed_albatross >quit.
- 25 -
A tool for non-programmers
There are really two levels of Prolog, one which is very easy to work with, and one which is a little more complex. The first level is Prolog as a purely declarative rule based language. This level of Prolog is easy to learn and use. The rules for bird identification are all formulated with this simple level of understanding of Prolog. The second level of Prolog requires a deeper understanding of backtracking, unification, and built-in predicates. This level of understanding is needed for the shell. By breaking the shell apart from the knowledge base, the code has also been divided along these two levels. Even though the knowledge base is in Prolog, it only requires the high level understanding of Prolog. The more difficult parts are hidden in the shell. This means the knowledge base can be understood with only a little training by an individual who is not a Prolog programmer. In other words, once the shell is hidden from the user, this becomes an expert system tool that can be used with very little training.
2.4 Summary
The example shows that Prolog's native syntax can be used as a declarative language for the knowledge representation of an expert system. The rules lend themselves to solving identification and other types of selection problems that do not require dealing with uncertainty. The example has also shown that Prolog can be used as a development language for building the user interface of an expert system shell. In this case Prolog is being used as a full programming language.
2.1 - In Native, implement commands to provide help and to list the current "known"s. 2.2 - Have menuask print a numbered list of items and let the user just enter the number of the chosen item. 2.3 - Modify both ask and menuask to recognize input from the user which is a command, execute the command, and then re-ask the question. 2.4 - Add a prompt field to ask which allows for a longer question for an attribute. 2.5 - Modify the system to handle attribute-object-value triples as well as attribute-value pairs. For example, rules might have goals such as color(head, green), color(body, green), length(wings, long), and length(tail, short). Now ask will prompt with both the object and the attribute as in "head color?". This change will lead to a more natural representation of some of the knowledge in a system as well as reducing the number of attributes. 2.6 - Use the Native shell to build a different expert system. Note any difficulties in implementing the system and features which would have made it easier.
- 26 -
3 Backward Chaining with Uncertainty
3.1 Certainty Factors
An Example
Let's first look at an example using Clam. The certainty factors (preceded by cf) are integers from -100 for definitely false, to +100 for definitely true. The following is a small knowledge base in Clam which is designed to diagnose a car which will not start. It illustrates some of the behavior of one scheme for handling uncertainty. goal problem. rule 1 if not turn_over and battery_bad then problem is battery. rule 2 if lights_weak then battery_bad cf 50. rule 3 if radio_weak then battery_bad cf 50.
- 27 -
rule 4 if turn_over and smell_gas then problem is flooded cf 80. rule 5 if turn_over and gas_gauge is empty then problem is out_of_gas cf 90. rule 6 if turn_over and gas_gauge is low then problem is out_of_gas cf 30.
ask turn_over menu (yes no) prompt 'Does the engine turn over?'. ask lights_weak menu (yes no) prompt 'Are the lights weak?'. ask radio_weak menu (yes no) prompt 'Is the radio weak?'. ask smell_gas menu (yes no) prompt 'Do you smell gas?'. ask gas_gauge menu (empty low full) prompt 'What does the gas gauge say?'. The inference uses backward chaining similar to pure Prolog. The goal states that a value for the attribute problem is to be found. Rule 1 will cause the sub-goal of bad_battery to be pursued, just as in Prolog. The rule format also allows for the addition of certainty factors. For example rules 5 and 6 reflect the varying degrees of certainty with which one can conclude that the car is out of gas. The uncertainty arises from the
- 28 -
Rule Uncertainty
What follows is a sample dialog of a consultation with the Car expert system. consult, restart, load, list, trace, how, exit :consult Does the engine turn over? : yes Do you smell gas? : yes What does the gas gauge say? empty low full : empty problem-out_of_gas-cf-90 problem-flooded-cf-80 done with problem Notice, that unlike Prolog, the inference does not stop after having found one possible value for problem. It finds all of the reasonable problems and reports the certainty to which they are known. As can be seen, these certainty factors are not probability values, but simply give some degree of weight to each answer.
User Uncertainty
The following dialog shows how the user's uncertainty might be entered into the system. The differences from the previous dialog are shown in bold. :consult Does the engine turn over? : yes Do you smell gas? : yes cf 50 What does the gas gauge say? empty
- 29 -
low full : empty problem-out_of_gas-cf-90 problem-flooded-cf-40 done with problem Notice in this case that the user was only certain to a degree of 50 that there was a gas smell. This results in the system only being half as sure that the problem is flooded.
Combining Certainties
Finally consider the following consultation which shows how the system combines evidence for a bad battery. Remember that there were two rules which both concluded the battery was weak with a certainty factor of 50. :consult Does the engine turn over? : no Are the lights weak? : yes Is the radio weak? : yes problem-battery-cf-75 done with problem In this case the system combined the two rules to determine that the battery was weak with certainty factor 75. This propagated straight through rule 1 and became the certainty factor for problem battery.
Properties of Certainty Factors
There are various ways in which the certainty factors can be implemented, and how they are propagated through the system, but they all have to deal with the same basic situations: • rules whose conclusions are uncertain; • rules whose premises are uncertain; • user entered data which is uncertain; • combining uncertain premises with uncertain conclusions; • updating uncertain working storage data with new, also uncertain information; • establishing a threshold of uncertainty for when a premise is considered known.
- 30 -
3.2 MYCINs Certainty Factors
The basic MYCIN certainty factors (CFs) were designed to produce results that seemed intuitively correct to the experts. Others have argued for factors that are based more on probability theory and still others have experimented with more complex schemes designed to better model the real world. The MYCIN factors, however, do a reasonable job of modeling for many applications with uncertain information. We have seen from the example how certainty information is added to the rules in the then clause. We have also seen how the user can specify CFs with input data. These are the only two ways uncertainty gets into the system. Uncertainty associated with a particular run of the system is kept in working storage. Every time a value for an attribute is determined by a rule or a user interaction, the system saves that attribute value pair and associated CF in working storage. The CFs in the conclusion of the rule are based on the assumption that the premise is known with a CF of 100. That is, if the conclusion has a CF of 80 and the premise is known to CF 100, then the fact which is stored in working storage has a CF of 80. For example, if working storage contained: turn_over cf 100 smell_gas cf 100 then a firing of rule 4 rule 4 if turn_over and smell_gas then problem is flooded cf 80 would result in the following fact being added to working storage: problem flooded cf 80
Determining Premise CF
However, it is unlikely that a premise is perfectly known. The system needs a means for determining the CF of the premise. The algorithm used is a simple one. The CF for the premise is equal to the minimum CF of the individual sub goals in the premise. If working storage contained: turn_over cf 80 smell_gas cf 50 then the premise of rule 4 would be known with CF 50, the minimum of the two.
Combining Premise CF and Conclusion CF
- 31 -
CF = RuleCF * PremiseCF / 100. Given the above working storage and this formula, the result of a firing of rule 4 would be: problem is flooded cf 40 The resulting CF has been appropriately reduced by the uncertain premise. The premise had a certainty factor of 50, and the conclusion a certainty factor of 80, thus yielding an adjusted conclusion CF of 40.
Premise Threshold CF
A threshold value for a premise is needed to prevent all of the rules from firing. The number 20 is used as a minimum CF necessary to consider a rule for firing. This means if working storage had: turn_over cf 80 smell_gas cf 15 Then rule 4 would not fire due to the low CF associated with the premise.
Combining CFs
Next consider the case where there is more than one rule which supports a given conclusion. In this case each of the rules might fire and contribute to the CF of the resulting fact. If a rule fires supporting a conclusion, and that conclusion is already represented in working memory by a fact, then the following formulae are used to compute the new CF associated with the fact. X and Y are the CFs of the existing fact and rule conclusion. CF(X, Y) = X + Y(100 - X)/100. X, Y both > 0 CF(X, Y) = X + Y/1 - min(|X|, |Y|). one of X, Y < 0 CF(X, Y) = -CF(-X, -Y). X, Y both < 0 For example, both rules 2 and 3 provide evidence for battery_bad. rule 2 if lights_weak then battery_bad cf 50. rule 3 if radio_weak then battery_bad cf 50. Assume the following facts are in working storage: lights_weak cf 100 radio_weak cf 100 A firing of rule 2 would then add the following fact: battery_bad cf 50
- 32 -
3.3 Rule Format
Since we are writing our own inference engine, we can design our own internal rule format as well. (We will use something easier to read for the user.) It has at least two arguments, one for the IF or left hand side (LHS) which contains the premises, and one for the THEN or right hand side (RHS) which contains the conclusion. It is also useful to keep a third argument for a rule number or name. The overall structure looks like: rule(Name, LHS, RHS). The name will be a simple atom identifying the rule. The LHS and RHS must hold the rest of the rule. Typically in expert systems, a rule is read LHS implies RHS. This is backwards from a Prolog rule which can be thought of as being written RHS :- LHS, or RHS is implied by LHS. That is the RHS (conclusion) is written on the left of the rule, and the LHS (premises) is written on the right. Since we will be backward chaining, and each rule will be used to prove or disprove some bit of information, the RHS contains one goal pattern, and its associated CF. This is: rhs(Goal, CF) The LHS can have many sub-goals which are used to prove or disprove the RHS : lhs(GoalList) where GoalList is a list of goals. The next bit of design has to do with the actual format of the goals themselves. Various levels of sophistication can be added to these goals, but for now we will use the simplest form, which is attribute-value pairs. For example, gas_gauge is an attribute, and low is a value. Other attributes have simple yes-no values, such as smell_gas. An attribute-value pair will look like: av(Attribute, Value) where Attribute and Value are simple atoms. The entire rule structure looks like: rule(Name, lhs( [av(A1, V1), av(A2, V2), ....] ), rhs( av(Attr, Val), CF) ). Internally, rule 5 looks like: rule(5, lhs( [av(turns_over, yes), av(gas_gauge, empty)] ), rhs( av(problem, flooded), 80) ). This rule format is certainly not easy to read, but it makes the structure clear for programming the inference engine. There are two ways to generate more readable rules for the user. One is to use operator definitions. The other is to use Prolog's language handling ability to parse our own rule format. The built-in definite clause
- 33 -
3.4 The Inference Engine
Now that we have a format for rules, we can write our own inference engine to deal with those rules. Let's summarize the desired behavior: • combine certainty factors as indicated previously; • maintain working storage information that is updated as new evidence is acquired; • find all information about a particular attribute when it is asked for, and put that information in working storage. The major predicates of the inference engine are shown in figure 3.1. They are described in detail in the rest of this section.
Figure 3.1 Major predicates of Clam inference engine
Working Storage
Let's first decide on the working storage format. It will simply contain the known facts about attribute-value pairs. We will use the Prolog database for them and store them as: fact (av(A, V), CF).
Find a Value for an Attribute
We want to start the inference by asking for the value of a goal. In the case of the Car expert system we want to find the value of the attribute problem. The main predicate that does inferencing will be findgoal/2. In the Car expert system it could be called from an interpreter with the following query: ?- findgoal( av(problem, X), CF). The findgoal/2 predicate has to deal with three distinct cases: • the attribute -value is already known; • there are rules to deduce the attribute -value;
- 34 -
• we must ask the user. The system can be designed to automatically ask the user if there are no rules, or it can be designed to force the knowledge engineer to declare which attribute values will be supplied by the user. The latter approach makes the knowledge base for the expert system more explicit, and also provides the opportunity to add more information controlling the dialog with the user. This might be in the form of clearer prompts, and/or input validation criteria. We can define a new predicate askable/2 that tells which attributes should be retrieved from the user, and the prompt to use. For example: askable(live, 'Where does it live?'). With this new information we can now write findgoal.
Attribute Value Already Known
The first rule covers the case where the information is in working storage. It was asserted so we know all known values of the attribute have been found. Therefor we cut so no other clauses are tried. findgoal( av(Attr, Val), CF) :fact( av(Attr, Val), CF), !.
Ask User for Attribute Value
The next rule covers the case where there is no known information, and the attribute is askable. In this case we simply ask. findgoal(av(Attr, Val), CF) :not fact(av(Attr, _), _), askable(Attr, Prompt), query_user(Attr, Prompt), !, findgoal(av(Attr, Val), CF). The query_user predicate prompts the user for a value and CF and then asserts it as a fact. The recursive call to findgoal will now pick up this fact. query_user(Attr, Prompt) :write(Prompt), read(Val), read(CF), asserta( fact(av(Attr, Val), CF)).
Deduce Attribute Value from Rules
The final rule of findgoal covers the interesting case of using other rules. Remember that the inferencing is going to require looking for all rules which provide support for values for the sought attribute, and combining the CFs from them. This is done by calling fg, which uses a repeat fail loop to continue to find rules whose RHS conclude a value for the attribute. The process stops when the attribute is known with a CF of 100, or all the rules have been tried. findgoal(Goal, CurCF) :fg(Goal, CurCF). fg(Goal, CurCF) :rule(N, lhs(IfList), rhs(Goal, CF)), prove(IfList, Tally),
- 35 -
adjust(CF, Tally, NewCF), update(Goal, NewCF, CurCF), CurCF == 100, !. fg(Goal, CF) :- fact(Goal, CF). The three new predicates called in fg are as follows: prove - prove the LHS premise and find its CF; adjust - combine the LHS CF with the RHS CF; update - update existing working storage values with the new conclusion. This is the guts of the inferencing process for the new inference engine. First it finds a rule whose RHS matches the pattern of the goal. It then feeds the LHS of that rule into prove which succeeds if the LHS can be proved. The prove predicate returns the combined CF from the LHS. If prove fails, backtracking is initiated causing the next rule which might match the goal pattern to be tried. prove(IfList, Tally) :prov(IfList, 100, Tally). prov([], Tally, Tally). prov([H|T], CurTal, Tally) :findgoal(H, CF), min(CurTal, CF, Tal), Tal >= 20, prov(T, Tal, Tally). min(X, Y, X) :- X =< Y, !. min(X, Y, Y) :- Y =< X. The input argument to prove is the list of premises for the rule, and the output is the Tally, or combined CF from the premises. The prove predicate calls prov with an extra argument to keep track of Tally. At each recursion the Tally is reset to the minimum up to that point. Of course, prov recursively calls findgoal for each of the premises. Notice the check to make sure the Tally stays above 20. This is the threshold value for considering an attribute - value pair to be true. After prove succeeds, adjust computes the combined CF based on the RHS CF and the Tally from the LHS. adjust(CF1, CF2, CF) :X is CF1 * CF2 / 100, int_round(X, CF). int_round(X, I) :X >= 0, I is integer(X + 0.5). int_round(X, I) :X < 0, I is integer(X - 0.5). Then update combines the new evidence for this attribute-value pair with any existing known evidence. The first argument is the attribute - value pair just deduced, and the second is its CF. The third argument is the returned value for the CF when it is combined with existing facts for the attribute-value pair.
- 36 -
update(Goal, NewCF, CF) :fact(Goal, OldCF), combine(NewCF, OldCF, CF), retract( fact(Goal, OldCF) ), asserta( fact(Goal, CF) ), !. update(Goal, CF, CF) :asserta( fact(Goal, CF) ). combine(CF1, CF2, CF) :CF1 >= 0, CF2 >= 0, X is CF1 + CF2*(100 - CF1)/100, int_round(X, CF). combine(CF1, CF2, CF) :CF1 < 0, CF2 < 0, X is - ( -CF1 -CF2 * (100 + CF1)/100), int_round(X, CF). combine(CF1, CF2, CF) :(CF1 < 0; CF2 < 0), (CF1 > 0; CF2 > 0), abs_minimum(CF1, CF2, MCF), X is 100 * (CF1 + CF2) / (100 - MCF), int_round(X, CF). The abs_minimum predicate finds the minimum in terms of absolute value. The code can be seen in the appendix.
One last point is to deal with negation. The premises might also be of the form not goal. In this case we call findgoal for the goal, and complement the CF to find the degree of certainty of its negation. For example if a fact has a CF of 70, then not fact has a certainty of -70. findgoal(not Goal, NCF) :findgoal(Goal, CF), NCF is - CF, !. This rule should become the first clause for findgoal.
3.5 Making the Shell
Now that the inference engine is built, it can become part of a shell. The code to build this first version of the Clam shell is the same as that used to build the Native shell. It consists of a command loop with the commands load, consult, and exit. Figure 3.2 shows the architecture of Clam. super :repeat, write('consult, load, exit'), nl, write(':'), read_line(X), doit(X), X == exit. doit(consult) :- top_goals, !.
- 37 -
doit(load) :- load_rules, !. doit(exit).
Figure 3.2 Major predicates of the Clam shell
Starting the Inference
The consult command does a little more than just call findgoal. It calls top_goals which uses the top_goal facts to start the inference. The system might have more than one top_goal to allow sequencing of the consultation. For example a diagnostic system might have two goals, the first diagnoses the problem, and the second recommends a solution. After top_goals satisfies a goal, it prints the values for the goal as seen in the early examples of Car. top_goals :top_goal(Attr), top(Attr), print_goal(Attr), fail. top_goals. top(Attr) :findgoal(av(Attr, Val), CF), !. top(_) :- true. print_goal(Attr) :nl, fact(av(Attr, X), CF), CF >= 20, outp(av(Attr, X), CF), nl, fail.
- 38 -
print_goal(Attr) :-write('done with '), write(Attr), nl, nl. outp(av(A, V), CF) :output(A, V, PrintList), write(A-'cf'-CF), printlist(PrintList), !. outp(av(A, V), CF) :write(A-V-'cf'-CF). printlist([]). printlist([H|T]) :write(H), printlist(T).
3.6 English-like Rules
The load command for Clam does not simply read in Prolog terms as in Native, but instead uses DCG to read in a knowledge base in the format shown earlier in the chapter for the Car system. You might notice that the askable items have the additional syntax to allow menu choices which was not included in the implementation details above. It is coded similarly to the menu feature in Native. The load_kb predicate in the shell gets a file name as in Native, and then calls load_rules with the file name. load_rules(F) :clear_db, see(F), lod_ruls, write('rules loaded'), nl, seen, !. lod_ruls :repeat, read_sentence(L), process(L), L == eof. process(eof) :- !. process(L) :trans(R, L, []), assertz(R), !. process(L) :write('translate error on:'), nl, write(L), nl. clear_db :abolish(top_goal, 1), abolish(askable, 4), abolish(rule, 3). This section of code basically calls read_sentence to tokenize a sentence (up to a ".") into a list. The token list is then processed by the DCG predicate trans, and the resulting Prolog term, R, is asserted in the knowledge base. For a good description of DCG, see Clocksin & Mellish chapter 9, Using Grammar Rules. The clear_db predicate removes all earlier top_goal, askable, and rule predicates so that a new knowledge base can be loaded over an existing one.
- 39 -
The tokenizing predicate, read_sentence, varies from Prolog to Prolog based on the implementation. If the implementation has built-in predicates which can read tokens, then read_sentence is trivial. If not, it has to read the input character by character and build the tokens. An example of this type of sentence read predicate can be found in Clocksin & Mellish section 5.3, Reading English Sentences. The top level DCG predicate, trans, looks for the three types of statements allowed in the knowledge base: trans(top_goal(X))-->[goal, is, X]. trans(top_goal(X))-->[goal, X]. trans(askable(A, M, P))--> [ask, A], menux(M), prompt(A, P). trans(rule(N, lhs(IF), rhs(THEN, CF)))--> id(N), if(IF), then(THEN, CF). The following predicates recognize the menu and prompt fields in the ask statement. menux(M)--> [menu, '('], menuxlist(M). menuxlist([Item])--> [Item, ')']. menuxlist([Item|T])--> [Item], menuxlist(T). prompt(_, P)--> [prompt, P]. prompt(P, P)--> []. Next are the predicates used to parse the basic rule structure. Note the flexibility that can be added into the system with DCG. Both and and ", " can be used as LHS separators. The attribute-value phrases can be expressed in many different ways to allow the most natural expression in the rules. id(N)-->[rule, N]. if(IF)-->[if], iflist(IF). iflist([IF])-->phrase(IF), [then]. iflist([Hif|Tif])-->phrase(Hif), [and], iflist(Tif). iflist([Hif|Tif])-->phrase(Hif), [', '], iflist(Tif). then(THEN, CF)-->phrase(THEN), [cf], [CF]. then(THEN, 100)-->phrase(THEN). phrase(not av(Attr, yes))-->[not, Attr]. phrase(not av(Attr, yes))-->[not, a, Attr]. phrase(not av(Attr, yes))-->[not, an, Attr]. phrase(not av(Attr, Val))-->[not, Attr, is, Val]. phrase(not av(Attr, Val))-->[not, Attr, are, Val]. phrase(av(Attr, Val))-->[Attr, is, Val].
- 40 -
phrase(av(Attr, Val))-->[Attr, are, Val]. phrase(av(Attr, yes))-->[Attr]. Using DCG in this fashion, it is easy to implement as friendly a syntax for the knowledge base as desired. The same approach could also be used for the Native system, with DCG that translated English-like rules into Prolog syntax. Now that we have a customized knowledge base and inference engine, it is possible to add other features to the system. The next chapter shows how to add explanations.
3.1 - Add attribute object value triples to the knowledge representation of Clam. 3.2 - There are other ways of dealing with uncertainty in the literature which could be used with Clam. A simple one would just use a few text modifiers such as weak, very weak, or strong and have rules for combining them. Implement this or some other scheme in Clam. 3.3 - Isolate the predicates which are used for calculating certainty factors so it is easy to add additional methods. Implement them so the calling predicates do not need to know the syntax of the certainty factor, since they might be text, numbers, or more complex data structures. 3.4 - Allow rules to have optional threshold values associated with them which override the default of 20. This would be an addition to the rule syntax as well as the code. 3.5 - Have the inference engine automatically generate a prompt to the user when there is no askable or rule which finds a value for an attribute. 3.6 - Add menus to the query user facility. 3.7 - Implement another diagnostic application using Clam. Note any difficulties and features which could be added to alleviate those difficulties.
- 41 -
4 Explanation
It is often claimed that an important aspect of expert systems is the ability to explain their behavior. This means the user can ask the system for justification of conclusions or questions at any point in a consultation with an expert system. The system usually responds with the rules that were used for the conclusion, or the rules being considered which led to a question to the user.
Value of Explanations to the User
The importance of this feature is probably overestimated for the user. Typically the user just wants the answer. Furthermore, when the user does want an explanation, the explanation is not always useful. This is due to the nature of the "intelligence" in an expert system. The rules typically reflect empirical, or "compiled" knowledge. They are codifications of an expert's rules of thumb, not the expert's deeper understanding which led to the rules of thumb. For example, consider the following dialog with an expert system designed to give advice on car problems: Does the car start? no. Does the engine turn over? yes. Do you smell gas? yes. Recommendation - Wait 5 minutes and try again. why? I used the rule: If not start, and engine_turn_over, and smell_gas Then recommend is 'Wait 5 minutes and try again.'. The rule gives the correct advice for a flooded car, and knows the questions to ask to determine if the car is flooded, but it does not contain the knowledge of what a flooded car is and why waiting will help. If the user really wanted to understand what was happening, he/she would need a short dissertation on carburetors, how they behave, and their relationship to the gas pedal. For a system such as this to have useful explanations, it would need to do more than parrot the rules used. One approach is to annotate the rules with deeper explanations. This is illustrated in chapter 10. Another approach being actively researched is to encode the deeper knowledge into the system and use it to drive both the inference and the explanations. On the other hand, there are some systems in which the expert's knowledge is just empirical knowledge. In this case, the system's explanation is useful to the user. Classification systems such as the bird identification system fall in this category. The Bird system would explain an identification of a laysan albatross with the rule used to identify it. There is no underlying theory as to why a white albatross is a laysan albatross and a dark one is a black footed albatross. That is simply the rule used to classify them.
Value of Explanations to the Developer
While an explanation feature might be of questionable value to the user of the system, it is invaluable to the developer of the system. It serves the same diagnostic purpose as program tracing for conventional programs. When the system is not behaving correctly, the expert can use the explanations to find the rules which are in error. The knowledge engineer uses the explanations to better tune the knowledge base to have more realistic dialogs with the user.
- 42 -
Types of Explanation
There are four types of explanations commonly used in expert systems. We will implement most of these in both the Clam shell and the Native shell: • a rule trace which reports on the progress of a consultation; • explanation of how the system reached a given conclusion; • explanation of why the system is asking a question; • explanation of why not a given conclusion. Since we wrote the inference engine for Clam it will not be difficult to modify it to include these features. The Native system currently uses Prolog's inference engine. In order to add explanation it will be necessary to write our own Prolog inference engine. Fortunately it is not difficult to write Prolog in Prolog.
4.1 Explanation in Clam
First, let's look at some examples of the explanation features of Clam using the Car system. Here is how the user turns on tracing for the consultation, and the results. The new trace information is in bold. It shows the sequence of rule firings as they are expected. Notice in particular that it reports correctly on the nesting of rules 2 and 3 within rule 1. consult, restart, load, list, trace, how, exit :trace on consult, restart, load, list, trace, how, exit :consult call rule 1 Does the engine turn over? : no call rule 2 Are the lights weak? : yes exit rule 2 call rule 3 Is the radio weak? : yes exit rule 3 exit rule 1
- 43 -
call rule 4 fail rule 4 call rule 5 fail rule 5 call rule 6 fail rule 6 problem-battery-cf-75 done with problem Next we can look at the use of why explanations. The user would ask why and get the inference chain that led to the question. For example: ... Is the radio weak? : why rule 3 If radio_weak Then battery_bad 50 rule 1 If not turn_over battery_bad Then problem is battery 100 goal problem ... Notice that the why explanation gives the chain of rules, in reverse order, that led to the question. In this case the goal problem led to rule 1 which led to rule 3. The how explanations start with answers. For example, the system has just reported that the problem is the battery. The user wants to know how this result was derived. ...
- 44 -
problem-battery-cf-75 done with problem consult, restart, load, list, trace, how, exit :how Goal? problem is battery problem is battery was derived from rules: 1 rule 1 If not turn_over battery_bad Then problem is battery 100 In this case the rule(s) which directly supported the result are listed. Next the user wants to know how battery_bad was derived. consult, restart, load, list, trace, how, exit :how Goal? battery_bad battery_bad was derived from rules: 3 2 rule 3 If radio_weak Then battery_bad 50 rule 2 If lights_weak Then battery_bad 50 In this case there were two rules which supported the goal, and the system lists them both.
- 45 -
Figure 4.1 shows the difference between how and why questions. The why questions occur at the bottom of an inference chain, and the how questions occur at the top.
Figure 4.1. Difference between how and why questions
The first explanation addition to Clam will be the rule tracing facility. It will behave similarly to the Prolog box model traces, and inform the user when a rule is "call"ed, "exit"ed, or "fail"ed. It will use a special predicate bugdisp to communicate trace information with the user. It will take as an argument a list of terms to be written on a line. To make it a user option, bugdisp will only write if ruletrace is true. The user will have a new high level command to turn tracing on or off which will assert or retract ruletrace. We can then use bugdisp to add any diagnostics printout we like to the program. bugdisp(L) :ruletrace, write_line(L), !. bugdisp(_). write_line([]) :- nl. write_line([H|T]) :write(H), tab(1), write_line(T). Here is the new command added to the do predicate called by the command loop predicate, go. It allows the user to turn tracing on or off by issuing the command trace(on) or trace(off). do( trace(X) ) :- set_trace(X), !. set_trace(off) :ruletrace, retract( ruletrace ). set_trace(on) :not ruletrace, asserta( ruletrace ).
- 46 -
set_trace(_). Now that we have the tools for displaying trace information, we need to add bugdisp calls in the predicate which recursively tries rules, fg. It is easy to determine in fg when a rule is called and when it has been successful. After the call to rule succeeds, the rule has been called. After the call to prove, the rule has been successfully fired. The new code for the predicate is added in bold. fg(Goal, CurCF) :rule(N, lhs(IfList), rhs(Goal, CF)), bugdisp(['call rule', N]), prove(N, IfList, Tally), bugdisp(['exit rule', N]), adjust(CF, Tally, NewCF), update(Goal, NewCF, CurCF, N), CurCF == 100, !. fg(Goal, CF) :- fact(Goal, CF). All that remains is to capture rules that fail after being called. The place to do this is in a second clause to prove, which is called when the first clause fails. The second clause informs the user of the failure, and continues to fail. prove(N, IfList, Tally) :prov(IfList, 100, Tally), !. prove(N, _, _) :bugdisp(['fail rule', N]), fail.
How Explanations
The next explanation feature to implement is how. The how question is asked by the user to see the proof of some conclusion the system has reached. The proof can be generated by either rederiving the result with extra tracing, or by having the original derivation stored in working storage. Clam uses the second option and stores derivation information with the fact in working storage. Each fact might have been derived from multiple rules, all concluding the same attribute value pair and combining certainty factors. For this reason, a list of rule numbers is stored as the third argument to fact. This is not the entire proof tree, but just those rules which conclude the fact directly. fact(AV, CF, RuleList) A fact is updated by update, so this is where the derivation is captured. A new argument is added to update which is the rule number that caused the update. Note that the first clause of update adds the new rule number to the list of existing derivation rule numbers for the fact. The second clause merely creates a new list with a single element. update(Goal, NewCF, CF, RuleN) :fact(Goal, OldCF, _), combine(NewCF, OldCF, CF), retract( fact(Goal, OldCF, OldRules) ), asserta( fact(Goal, CF, [RuleN | OldRules]) ), !. update(Goal, CF, CF, RuleN) :asserta( fact(Goal, CF, [RuleN]) ). The call to update from fg is modified to fill in the new argument with a rule number: fg(Goal, CurCF) :rule(N, lhs(IfList), rhs(Goal, CF)), ...
- 47 -
update(Goal, NewCF, CurCF, N), ... Now that the supporting rules for each derived fact are in working storage we can answer a user's question about how a fact was derived. The simplest thing to do is to have how simply write the list of rules used. It is probably of more interest to the user to actually display the rules as well. The predicate list_rules does that. how(Goal) :fact(Goal, CF, Rules), CF > 20, pretty(Goal, PG), write_line([PG, was, derived, from, 'rules: '|Rules]), nl, list_rules(Rules), fail. how(_). The how predicate for negated goals is similar and uses the fact that negation is represented by a negative CF. how(not Goal) :fact(Goal, CF, Rules), CF < -20, pretty(not Goal, PG), write_line([PG, was, derived, from, 'rules: '|Rules]), nl, list_rules(Rules), fail. The pretty predicate is used to convert av structures into a more readable list and visa versa. pretty(av(A, yes), [A]) :- !. pretty(not av(A, yes), [not, A]) :- !. pretty(av(A, no), [not, A]) :- !. pretty(not av(A, V), [not, A, is, V]). pretty(av(A, V), [A, is, V]). The list_rules predicate writes a formatted listing of each rule used in deriving a given fact. list_rules([]). list_rules([R|X]) :list_rule(R), list_rules(X). list_rule(N) :rule(N, lhs(Iflist), rhs(Goal, CF)), write_line(['rule ', N]), write_line(['If']), write_ifs(Iflist), write_line(['Then']), pretty(Goal, PG), write_line([' ', PG, CF]), nl. write_ifs([]).
- 48 -
write_ifs([H|T]) :pretty(H, HP), tab(5), write_line(HP), write_ifs(T). We can use pretty in reverse, along with a predicate that reads a list of tokens from a line to provide a nicer interface to the user for how questions. In this way the user doesn't have to specify the internal form of the fact. how :write('Goal? '), read_line(X), nl, pretty(Goal, X), how(Goal). The how command can now be added as part of the top level user interface: do(how) :- how, !. The full how command as coded above just displays for the user the rules directly responsible for a fact. These rules themselves are likely based on other facts which were derived as well. There are two ways of presenting this information: • let the user ask further hows of the various rules' left hand side goals to delve deeper into the proof tree; • have how automatically display the entire proof tree. So far we have chosen the first. In order to implement the second choice, a predicate how_lhs needs to be written which will trace the full tree by recursively calling how for each of the goals in the Iflist of the rule. list_rules([]). list_rules([R|X]) :list_rule(R), how_lhs(R), list_rules(X). how_lhs(N) :rule(N, lhs(Iflist), _), !, how_ifs(Iflist). how_ifs([]). how_ifs([Goal|X]) :how(Goal), how_ifs(X). The three choices of user interface for hows (just rule numbers, listings of direct rules, list of full proof tree) shows some of the problems with shells and the advantages of a toolbox approach. In a customized expert system, the options which makes the most sense for the application can be used. In a generalized system the designer is faced with two unpleasant choices. One is to keep the system easy to use and pick one option for all users. The other is to give the flexibility to the user and provide all three, thus making the product more complex for the user to learn.
Why Questions
The how question is asked from the top level of an inference, after the inference has been completed. The why question is asked at the bottom of a chain of rules when there are no more rules and it is time to ask the user. The user wants to know why the question is being asked.
- 49 -
In order to be able to answer this type of question, we must keep track of the inference chain that led to the question to the user. One way to do this is to keep an extra argument in the inference predicates that contains the chain of rules above it in the inference. This is done in findgoal and prove. Each keeps a separate argument Hist which is the desired list of rules. The list is initially the empty list at the top call to findgoal. findgoal(Goal, CurCF, Hist) :fg(Goal, CurCF, Hist). fg(Goal, CurCF, Hist) :... prove(N, IfList, Tally, Hist), ... The prove predicate maintains the list by adding the current rule number on the head of the list before a recursive call to findgoal. The calls further down the recursion have this new rule number available for answers to why questions. Notice that both Prolog's recursive behavior and backtracking assure that the history is correct at any level of call. prove(N, IfList, Tally, Hist) :prov(IfList, 100, Tally, [N|Hist]), !. prove(N, _, _) :bugdisp(['fail rule', N]), fail. prov([], Tally, Tally, Hist). prov([H|T], CurTal, Tally, Hist) :findgoal(H, CF, Hist), min(CurTal, CF, Tal), Tal >= 20, prov(T, Tal, Tally, Hist). Finally, we need to give the user the ability to ask the why question without disturbing the dialog. This means replacing the old reads of user input with a new predicate, get_user which gets an answer from the user and processes it as a why command if necessary. Hist is of course passed down as an argument and is available for get_user to process. Also, rather than just displaying rule numbers, we can list the rules for the user as well. The process_ans predicate first looks for command patterns and behaves accordingly. If it is a command, the command is executed and then failure is invoked causing the system to backtrack and reask the user for an answer. Note that now that we are capturing and interpreting the user's response with more intelligence, we can give the user more options. For example, at the question level he/she can turn tracing on or off for the duration of the session, ask a how question, or request help. These are all easily added options for the implementer. get_user(X, Hist) :repeat, write(': '), read_line(X), process_ans(X, Hist). process_ans([why], Hist) :- nl, write_hist(Hist), !, fail. process_ans([trace, X], _) :- set_trace(X), !, fail. process_ans([help], _) :- help, !, fail.
- 50 -
process_ans(X, _). % just return user's answer write_hist([]) :- nl. write_hist([goal(X)|T]) :write_line([goal, X]), !, write_hist(T). write_hist([N|T]) :list_rule(N), !, write_hist(T).
4.2 Native Prolog Systems
Since we wrote the inference engine for Clam, it was easy to modify it to add the code for explanations. However, when we use pure Prolog, we don't have access to the inference engine. This problem is easily solved. We simply write a Prolog inference engine in Prolog. Then, having written the inference engine, we can modify it to handle explanations. An inference engine has to have access to the rules. In Prolog, the clauses are themselves just Prolog terms. The built-in predicate clause gives us access to the rules. It has two arguments which unify with the head of a clause and its body. A fact has a body with just the goal true. Predicates which manipulate Prolog clauses are confusing to read due to the ambiguous use of the comma in Prolog. It can be either: an operator used to separate the subgoals in a clause; or a syntactic separator of functor arguments. Prolog clauses are just Prolog terms with functors of ":-" and ",". Just for now, pretend Prolog used an "&" operator to separate goals rather than a "," operator. Then a clause would look like: a :- b & c & d. Without the operator definitions it would look like: :-(a, &(b, &(c, d))). The clause built-in predicate picks up the first and second arguments of the ":-" functor. It will find the entire Prolog database on backtracking. If patterns are specified in either argument, then only clauses which unify with the patterns are found. For the above clause: ?- clause(Head, Body). Head = a Body = b & c & d A recursive predicate working through the goals in Body would look like: recurse(FirstGoal & RemainingGoals) :process(FirstGoal), recurse(RemainingGoals). recurse(SingleGoal) :process(SingleGoal). The use of "&" was just to distinguish between the two commas in Prolog. To resolve ambiguous references to commas as in the first line of the above code, parenthesis are used. The first line should really be written:
- 51 -
recurse( (FirstGoal, RemainingGoals) ) :... See Clocksin & Mellish Section 2.3, Operators for a full discussion of operators. Given the means to access and manipulate the Prolog database of facts and rules, a simple Prolog interpreter that proves a list of goals (goals separated by the "," operator) would look like: prove(true) :- !. prove((Goal, Rest)) :clause(Goal, Body), prove(Body), prove(Rest). prove(Goal) :clause(Goal, Body), prove(Body). Notice that prove mimics precisely Prolog's behavior. First it finds a clause whose head matches the first goal. Then it proves the list of goals in the Body of the clause. Notice that unification automatically occurs between the Goal for the head of the clause and the Body. This is because the Prolog clause is just a Prolog term. If it succeeds, it continues with the rest of the goals in the list. It it fails, it backtracks and finds the next clause whose head unifies with the Goal. This interpreter will only handle pure Prolog whose clauses are asserted in the database. It has no provisions for built-in predicates. These could be included by adding a final catchall clause: prove(X) :- call(X). For Native we do not intend to have Prolog built-in predicates, but we do intend to call ask and menuask. For the Native shell these are our own built-in predicates. We will make some basic modifications to our Prolog interpreter to allow it to handle our own built-in predicates and record information for explanations. First, we write an intermediate predicate prov that calls clause. It can also check for built-in predicates such as ask and menuask in the system. If the goal is either of these, they are just called with real Prolog. Next we add an extra argument, just as we did for Clam. The extra argument keeps track of the level of nesting of a particular goal. By passing this history along to the ask predicates, the ask predicates can now respond to why questions. prove(true, _) :- !. prove((Goal, Rest), Hist) :prov(Goal, (Goal, Rest)), prove(Rest, Hist). prov(true, _) :- !. prov(menuask(X, Y, Z), Hist) :- menuask(X, Y, Z, Hist), !. prov(ask(X, Y), Hist) :- ask(X, Y, Hist), !. prov(Goal, Hist) :clause(Goal, List), prove(List, [Goal|Hist]). Notice that the history is a list of goals, and not the full rules as saved in Clam.
- 52 -
The next step is to modify the top level predicate which looks for birds. First add an empty history list as an argument to the top call of prove: solve :abolish(known, 3), define(known, 3), prove(top_goal(X), []), write('The answer is '), write(X), nl. solve :write('No answer found'), nl. The processing of why questions is the same as in Clam. get_user(X, Hist) :repeat, read(X), process_ans(X, Hist), !. process_ans(why, Hist) :write(Hist), !, fail. process_ans(X, _). The dialog with the user would look like: ?- identify. nostrils : external_tubular? why. [nostrils(external_tubular), order(tubenose), family(albatross), bird(laysan_albatross)] nostrils : external_tubular? We can further use clause to answer how questions. In Clam we chose to save the derivations in the database. For native Prolog it is easier just to rederive the answer. how(Goal) :clause(Goal, List), prove(List, []), write(List). It is also possible to ask whynot questions which determine why an expected result was not reached. This also uses clause to find the clauses which might have proved the goals, and goes through the list of goals looking for the first one that failed. It is reported, and then backtracking causes any other clauses which might have helped to be explained as well. whynot(Goal) :clause(Goal, List), write_line([Goal, 'fails because: ']), explain(List). whynot(_). explain( (H, T) ) :check(H), explain(T).
- 53 -
explain(H) :check(H). check(H) :- prove(H, _), write_line([H, succeeds]), !. check(H) :- write_line([H, fails]), fail. The whynot predicate has the same design problems as how. Do we automatically recurse through a whole failure tree, or do we let the user ask successive whynot's to delve deeper into the mystery. This version just gives the first level. By adding a recursive call to whynot in the second clause of check, it would print the whole story.
4.1 - Implement whynot for Clam. 4.2 - Have whynot give a full failure history. 4.3 - Make sure the explanation facility can handle attribute object value triples in both Clam and Native. 4.4 - Decide whether you like the full rules presented in answer to why questions as in Clam, or just the goals as in Native. Make both systems behave the same way. 4.5 - Enhance the trace function so it displays the goals currently being sought by the system. Have various levels of trace information that can be controlled by the trace command. 4.6 - Using prove, implement a Prolog trace function. 4.7 - Add a pretty printing predicate for Native to use when displaying Prolog rules.
- 54 -
5 Forward Chaining
This chapter discusses a forward chaining rule based system and its expert system applications. It shows how the forward chaining system works, how to use it, and how to implement it quickly and easily using Prolog. A large number of expert systems require the use of forward chaining, or data driven inference. The most famous of these is Digital Equipment Corporation's XCON system. It configures computers. It starts with the data about the customer order and works forward toward a configuration based on that data. The XCON system was written in the OPS5 (forward chaining rule based) language. Data driven expert systems are different from the goal driven, or backward chaining systems seen in the previous chapters. The goal driven approach is practical when there are a reasonable number of possible final answers, as in the case of a diagnostic or identification system. The system methodically tries to prove or disprove each possible answer, gathering the needed information as it goes. The data driven approach is practical when combinatorial explosion creates a seemingly infinite number of possible right answers, such as possible configurations of a machine.
5.1 Production Systems
Forward chaining systems are often called "production" systems. Each of the rules is actually a miniature procedure called a production. When the patterns in the left hand side match working storage elements, then the actions on the right hand side are taken. This chapter concentrates on building a production system called Oops. Production systems are composed of three components. These are: • the rule set; • a working storage area which contains the current state of the system; • an inference engine which knows how to apply the rules. The rules are of the form: left hand side (LHS) ==> right hand side (RHS). The LHS is a collection of conditions which must be matched in working storage for the rule to be executed. The RHS contains the actions to be taken if the LHS conditions are met. The execution cycle is: 1. Select a rule whose left hand side conditions match the current state as stored in the working storage. 2. Execute the right hand side of that rule, thus somehow changing the current state. 3. Repeat until there are no rules which apply. Production systems differ in the sophistication of the algorithm used to select a rule (step 1). The first version of Oops will use the simplest algorithm of just selecting the first rule whose conditions match working storage. The knowledge engineer programs in Oops by creating rules for the particular application. The syntax of the rules is:
- 55 -
rule <rule id>: [<N>: <condition>, .......] ==> [<action>, ....]. where: rule id - a unique identifier for the rule; N - optional identification for the condition; condition - a pattern to match against working storage; action - an action to take. Each condition is a legal Prolog data structure, including variables. Variables are identified, as in Prolog, by an initial upper case letter, or underscore. In general, the condition pattern is matched against those stored in working storage. The comparison operators (>, =<, etc.) are also defined for comparing variables which are bound during the pattern matching. Note that the data representation of Oops is richer than that used in Clam. In Clam there were only attribute value pairs, or object - attribute - value triples. In Oops the data can be represented by any legal Prolog term including variables. The following RHS actions are supported: assert(X) - adds the term X to working storage; retract(all) - retracts all of the working storage terms which were matched in the LHS of the rule being executed; retract(N) - retracts LHS condition number N from working storage; X = <arithmetic expression> - sets X to the value of the expression; X # Y - unifies the structures X and Y; write(X) - writes the term X to the terminal; nl - writes a new line at the terminal; read(X) - reads a term and unifies it to X; prompt(X, Y) - writes X and reads Y;
5.2 Using Oops
In the Winston & Horn LISP book there is an example of a forward chaining animal identification system. Some of those rules would be expressed in Oops like this: rule id6: [1: has(X, pointed_teeth), 2: has(X, claws), 3: has(X, forward_eyes)] ==> [retract(all), assert(isa(X, carnivore))].
- 56 -
This rule would fire if working storage contained the Prolog terms: has(robie, pointed_teeth) has(robie, claws) has(robie, forward_eyes) When the rule fired, these three terms would be removed by the retract(all) action on the RHS, and would be replaced with the term: isa(robie, carnivore) Since the working storage elements which matched the conditions were removed, this rule would not fire again. Instead, another rule such as this might fire next: rule id10: [1: isa(X, mammal), 2: isa(X, carnivore), 3: has(X, black_stripes)] ==> [retract(all), assert(isa(X, tiger))]. Rules about relationships are also easily coded. Again from Winston & Horn's example the rule which says children are the same type of animal as their parents is expressed as follows: rule id16: [1: isa(Animal, Type), 2: parent(Animal, Child)] ==> [retract(2), assert(isa(Child, Type))]. This would transform working storage terms like: isa(robie, tiger) parent(robie, suzie) to: isa(robie, tiger) isa(suzie, tiger) The working storage is initialized with a statement of the form: initial_data([<term>, .......]). Each term is a legal Prolog term which is asserted in working storage. For example: initial_data([gives(robie, milk), eats_meat(robie), has(robie, tawny_color), has(robie, dark_spots), parent(robie, suzie)].
- 57 -
It would be better if we could set up the system to ask the user for the initial terms. In a conventional programming language we might set up a loop which repeatedly asked for data until the user typed in "end". To do the same thing in a production system requires a bit of trickery, which goes against the grain of rule based systems. Theoretically, the rules are independent and don't communicate with each other, but by setting flags in working storage the programmer can force a specific order of rule firings. Here is how to code the input loop in Oops. It violates another tenet of production systems by making use of the known rule selection strategy. In the case of Oops, it is known that rule 1 will be tried before rule 2. initial_data([read_facts]). rule 1: % This is the end condition of [1: end, % the loop. If "end" and 2: read_facts] % "read_facts" are both % in working storage, ==> [retract(all)]. % then remove them both. rule 2: % This is the body of the loop. [1: read_facts] % If "read_facts" is in WS, ==> % then prompt for an attribute [prompt('Attribute? ', X), % and assert it. If X assert(X)]. % is "end", rule 1 will fire next. The animal identification problem is one that can be solved either in a data driven (forward chaining) approach as illustrated here and in Winston & Horn, or in a goal driven (backward chaining) approach. In fact, where the list of possible animals is known the backward chaining approach is probably a more natural one for this problem. A more suitable problem for a forward chaining system is configuration. The Oops sample program in the appendix shows such a system. It lays out furniture in a living room. The program includes a number of rules for laying out furniture. For example: • The couch goes on the longer wall of the room, and is not on the same side as the door. • The television goes opposite the couch. • If there is a lamp or television on a wall without a plug, buy an extension cord. Here are those rules in Oops. They are more complex due to the need to work with the amount of wall space available. % f1 - the couch goes opposite the door rule f1: [1: furniture(couch, LenC), % an unplaced couch position(door, DoorWall), % find the wall with the door opposite(DoorWall, OW), % the wall opposite the door right(DoorWall, RW), % the wall right of the door 2: wall(OW, LenOW), % available space opposite wall(RW, LenRW), % available space to the right LenOW >= LenRW, % if opposite bigger than right LenC =< LenOW] % length of couch less than % wall space ==> [retract(1), % remove the furniture term assert(position(couch, OW)), % assert new position
- 58 -
retract(2), % remove the old wall, length NewSpace = LenOW - LenC, % calculate the space left assert(wall(OW, NewSpace))]. % assert new space % f3 - the tv should be opposite the couch rule f3: [1: furniture(tv, LenTV), 2: position(couch, CW), 3: opposite(CW, W), 4: wall(W, LenW), LenW >= LenTV] ==> [retract(1), assert(position(tv, W)), retract(4), NewSpace = LenW - LenTV, assert(wall(W, NewSpace))]. % get extension cords if needed rule f12: [1: position(tv, W), 2: not(position(plug, W))] ==> [assert(buy(extension_cord, W)), assert(position(plug, W))]. rule f13: [1: position(table_lamp, W), 2: not(position(plug, W))] ==> [assert(buy(extension_cord, W)), assert(position(plug, W))]. The program also uses rules to control a dialog with the user to gather initial data. It needs to know about room dimensions, furniture to be placed, plug locations, etc. It does this by setting various data gathering goals. For example the initial goal of the system is to place_furniture. It gives directions to the user and sets up the goal read_furniture. Once read_furniture is done (signified by the user entering end : end), it sets up the next goal of read_walls. Here is the beginning code. rule 1: [1: goal(place_furniture), % The initial goal causes a 2: legal_furniture(LF)] % rule to fire with % introductory info. ==> % It will set a new goal. [retract(1), cls, nl, write('Enter a single item of furniture at each prompt.'), nl, write('Include the width (in feet) of each item.'), nl, write('The format is Item:Length.'), nl, nl, write('The legal values are:'), nl, write(LF), nl, nl, write('When there is no more furniture, enter "end:end".'), nl, assert(goal(read_furniture))].
- 59 -
rule 2: [1: furniture(end, end), % When the furniture is read 2: goal(read_furniture)] % set the new goal of reading ==> % wall sizes [retract(all), assert(goal(read_walls))]. rule 3: [1: goal(read_furniture), % Loop to read furniture. 2: legal_furniture(LF)] ==> [prompt('furniture> ', F:L), member(F, LF), assert(furniture(F, L))]. rule 4: % If rule 3 matched and failed [1: goal(read_furniture), % the action, then member 2: legal_furniture(LF)] % must have failed. ==> [write('Unknown piece of furniture, must be one of:'), nl, write(LF), nl]. The room configurer illustrates both the strengths and weaknesses of a pure production system. The rules for laying out the furniture are very clear. New rules can be added, and old ones deleted without affecting the system. It is much easier to work with this program structure than it would be to understand procedural code which attempted to do the same thing. On the other hand, the rules which interact with the user to collect data are difficult to read and have interdependencies which make them hard to maintain. The flow of control is obscured. This code would be better written procedurally, but it is done using Oops to illustrate how these kinds of problems can be solved with a production architecture. An ideal architecture would integrate the two approaches. It would be very simple to let Oops drop back down to Prolog for those cases where Oops is inappropriate. This architecture is covered in chapter 7.
5.3 Implementation
The implementation of Oops is both compact and readable due to the following features of Prolog: • Each rule is represented as a single Prolog term (a relatively complex structure). • The functors of the rule structure are defined as operators to allow the easy-to-read syntax of the rule. • Prolog's built-in backtracking search makes rule selection easy. • Prolog's built-in pattern matching (unification) makes comparison with working storage easy. • Since each rule is a single term, unification causes variables to be automatically bound between LHS conditions and RHS actions. • The Prolog database provides an easy representation of working storage.
- 60 -
Each rule is a single Prolog term, composed primarily of two lists: the right hand side (RHS), and the left hand side (LHS). These are stored using Prolog's normal data structures, with rule being the predicate and the various arguments being lists. In Clam, DCG was used to allow a friendly, flexible rule format. In Oops, Prolog operators are used. The operators allow for a syntax which is formal, but readable. The operator syntax can also be used directly in the code. Without operator definitions, the rules would look like normal hierarchical Prolog data structures: rule(==>(:(id4, [:(1, flies(X)), :(2, lays_eggs(X))], [retract(all), assert(isa(X, bird))])). The following operator definitions allow for the more readable format of the rules: op(230, xfx, ==>). op(32, xfy, :). op(250, fx, rule). Working storage is stored in the database under the key fact. So to add a term to working storage: asserta( fact(isa(robie, carnivore)) ), and to look for a term in working storage: fact( isa(X, carnivore) ). Figure 5.1 shows the major predicates in the Oops inference engine. The inference cycle of recognize - act is coded in the predicate go. It searches for the first rule which matches working storage, and executes it. Then it repeats the process. If no rules match, then the second clause of go is executed and the inference ends. Then the second clause prints out the current state showing what was determined during the run. (Note that LHS and RHS are bound to lists.)
Figure 5.1. Major predicates in Oops inference engine
go:call(rule ID: LHS ==> RHS), try(LHS, RHS), write('Rule fired '), write(ID), nl, !, go. go:nl, write(done), nl, print_state. This code illustrates the tremendous expressiveness of Prolog. The code is very tight due to the built-in pattern matching and backtracking search. Especially note that since the entire rule is a single Prolog term, the
- 61 -
unification between variables in the conditions and actions happens automatically. This leads to a use of variables which is, in some senses, cleaner and more powerful than that found in OPS5. The try/2 predicate is very simple. If match/2 fails, it forces go to backtrack and find the next rule. The LHS is passed to process so retract statements can find the facts to retract. try(LHS, RHS):match(LHS), process(RHS, LHS). The match/2 predicate recursively goes through the list of conditions, locating them in working storage. If the condition is a comparison test, then the test is tried, rather than searched for in the database. match([]) :- !. match([N:Prem|Rest]) :!, (fact(Prem); test(Prem)), % a comparison test rather than a fact match(Rest). match([Prem|Rest]) :(fact(Prem); % condition number not specified test(Prem)), match(Rest). The test/1 predicate can be expanded to include any kind of test. Oops uses most of the basic tests provided with Prolog, plus a few. For example: test(X >= Y):- X >= Y, !. test(X = Y):- X is Y, !. % use = for arithmetic test(X # Y):- X = Y, !. % use # for unification test(member(X, Y)):- member(X, Y), !. test(not(X)):fact(X), !, fail. If match/2 succeeds, then process/2 is called. It executes the RHS list of actions. It is equally straightforward. process([], _) :- !. process([Action|Rest], LHS) :take(Action, LHS), process(Rest, LHS). Only the action retract needs the LHS. The take/2 predicate does a retract if that is what's called for, or else passes control to take/1 which enumerates the simpler actions. Some examples are given here. take(retract(N), LHS) :(N == all; integer(N)), retr(N, LHS), !. take(A, _) :-take(A), !. take(retract(X)) :- retract(fact(X)), !.
- 62 -
take(assert(X)) :- asserta(fact(X)), write(adding-X), nl, !. take(X # Y) :- X=Y, !. take(X = Y) :- X is Y, !. take(write(X)) :- write(X), !. take(nl) :- nl, !. take(read(X)) :- read(X), !. The retr predicate searches for LHS conditions with the same identification (N) and retracts them. If all was indicated, then it retracts all of the LHS conditions. retr(all, LHS) :-retrall(LHS), !. retr(N, []) :-write('retract error, no '-N), nl, !. retr(N, [N:Prem|_]) :- retract(fact(Prem)), !. retr(N, [_|Rest]) :- !, retr(N, Rest). retrall([]). retrall([N:Prem|Rest]) :retract(fact(Prem)), !, retrall(Rest). retrall([Prem|Rest]) :retract(fact(Prem)), !, retrall(Rest). retrall([_|Rest]) :- % must have been a test retrall(Rest). Oops can be made to look like the other shells by the addition of a command loop predicate with commands similar to those in Clam and Native. Figure 5.2 shows the architecture of Oops.
5.4 Explanations for Oops
Explanations for forward chaining systems are more difficult to implement. This is because each rule modifies working storage, thus covering its tracks. The most useful information in debugging a forward chaining system is a trace facility. That is, you want to know each rule that is fired and the effects it has on working storage. Each fact can have associated with it the rule which posted it, and this would give the immediate explanation of a fact. However, the facts which supported the rules which led up to that fact might have been erased from working memory. To give a full explanation, the system would have to keep time stamped copies of old versions of facts.
- 63 -
Figure 5.2. Major predicates of the Oops shell
The trace option is added in Oops in a similar fashion to which it was added in Clam. The inference engine informs the user of the rules which are firing as they fire.
5.5 Enhancements
Oops in its current state is a simple forward chaining system. More advanced forward chaining systems differ in two main aspects. • more sophisticated rule selection when many rules match the current working storage; • performance. The current rule selection strategy of Oops is simply to pick the first rule which matches. If many rules match, there might be other optimal choosing strategies. For example, we could pick the rule that matched the most recently asserted facts, or the rule which had the most specific match. Either of these would change the inference pattern of the system to give effects which might be more natural. Oops is also inefficient in its pattern matching, since at each cycle of the system it tries all of the rules against working memory. There are various indexing schemes which can be used to allow for much faster picking of rules which match working memory. These will be discussed in the chapter 8.
5.6 Rule Selection
OPS5, which is probably the most well known example of a forward chaining, or production, system offers two different means of selecting rules. One is called LEX and the other is MEA. Both make use of time stamped data to determine the best rule to fire next. They differ slightly in the way in which they use the data. Both of these strategies can be added to Oops as options.
- 64 -
Generating the conflict set
For both, the first step is to collect all of the rules whose LHS match working memory at a given cycle. This set of rules is called the conflict set. It is not actually the rules, but rather instantiations of the rules. This means that the same rule might have multiple instantiations if there are multiple facts which match a LHS premise. This will often happen when there are variables in the rules which are bound differently for different instantiations. For example, an expert system to identify animals might have the following condition on the LHS: rule 12: [... eats(X, meat), ...] ==> ... In working memory there might be the following two facts: ... eats(robie, meat). eats(suzie, meat). ... Assuming the other conditions on the LHS matched, this would lead to two different instantiations of the same rule. One for robie and one for suzie. The simplest way to get the conflict set is to use findall or its equivalent. (If your system does not have a findall, a description of how to write your own can be found in Clocksin and Mellish section 7.8, Assert and Retract: Random, Gensym, Findall.) It collects all of the instantiations of a term in a list. The three arguments to findall are: • a term which is used as a pattern to collect instantiations of variables; • a list of goals used as a query; • an output list whose elements match the pattern of the first argument, and for which there is one element for each successful execution of the query in the second argument. The instantiations of the conflict set will be stored in a structure, r/4. The last three arguments of r/4 will be the ID, LHS, and RHS of the rule which will be used later. The first argument of r/4 is the LHS with the variables instantiated with the working storage elements that were matched. Each match of a LHS premise and working storage element is also accompanied by a time stamp indicating when the working storage element was last updated. The query to be executed repeatedly by findall will be similar to the one currently used to find just the first matching rule: ?- rule ID : LHS ==> RHS, match(LHS, Inst) Note that match now has a second argument to store the instantiation of the rule which will be the first argument to r/4. The following predicate puts the above pieces together and uses findall to build a list (CS) of r/4s representing all of the rules which currently match working storage.
- 65 -
conflict_set(CS) :findall(r(Inst, ID, LHS, RHS), [rule ID: LHS ==> RHS, match(LHS, Inst)], CS). The match predicate just needs to be changed to capture the instantiation of the conditions. Notice there is an additional argument, Time, in the fact predicate. This is a time stamp that will be used in the selection process. match([], []) :- !. match([N:Prem|Rest], [Prem/Time|IRest]) :!, (fact(Prem, Time); test(Prem), Time = 0), %comparison, not a fact match(Rest, IRest). match([Prem|Rest], [Prem/Time|IRest]) :(fact(Prem, Time); % no condition number test(Prem), Time = 0), match(Rest, IRest).
Time stamps
The timestamp is just a chronological counter that numbers the facts in working memory as they are added. All assertions of facts are now handled by the assert_ws predicate as follows: assert_ws(fact(X, T)) :getchron(T), asserta(fact(X, T)). The getchron predicate simply keeps adding to a counter. getchron(N) :retract( chron(N) ), NN is N + 1, asserta( chron(NN) ), !.
5.7 LEX
Now that we have a list of possible rules and instantiations in the conflict set, it is necessary to select one. First we will look at the OPS5 LEX method of rule selection. It uses three criteria to select a rule. The first is refraction. This discards any instantiations which have already been fired. Two instantiations are the same if the variable bindings and the time stamps are the same. This prevents the same rule from firing over and over, unless the programmer has caused working memory to be repeatedly updated with the same fact. The second is recency. This choses the rules which use the most recent elements in working memory. The conflict set rules are ordered with those rules with the highest time stamps first. This is useful to give the system a sense of focus as it works on a problem. Facts which are just asserted will most likely be used next in a rule. The third is specificity. If there are still multiple rules in contention, the most specific is used. The more conditions there are that apply in the LHS of the rule, the more specific it is. For example, a rule with 4 conditions is more specific than one with 3 conditions. This criteria ensures that general case rules will fire after more specific case rules. If after these tests there are still multiple rules which apply, then one is chosen at random.
- 66 -
Changes in the Rules
The LEX strategy changes the way in which Oops rules are programmed. In the first version of Oops, the knowledge engineer had to make sure that the working storage elements which caused the rule to fire are changed. It was the knowledge engineer's responsibility to ensure that a rule did not repeatedly fire. The opposite is also true. Where looping is required, the facts matching the LHS must be continually reasserted. In the original version of Oops the knowledge engineer knew the order in which rules would fire, and could use that information to control the inference. Using LEX he/she can still control the inference, but it requires more work. For example, if it is desirable to have the couch placed first by the system, then that rule must be structured to fire first. This can be done by adding a goal to place the couch first and asserting it after the data is gathered. For example: rule gather_data ... ==> [... assert( goal(couch_first) ) ]. rule couch [ goal(couch_first), ... The gather_data rule will assert the couch_first goal after all other assertions. This means it is the most recent addition to working storage. The Lex recency criteria will then ensure that the couch rule is fired next. The rule which is supposed to fire last in the system also needs to be handled specially. The easiest way to ensure a rule will fire last is to give it an empty list for the LHS. The specificity check will keep it from firing until all others have fired.
Implementing LEX
To implement the LEX strategy, we modify the go predicate to first get the conflict set and then pass it to the predicate select_rule which picks the rule to execute. After processing the rule, the instantiation associated with the rule is saved to be used as a check that it is not reexecuted. go :conflict_set(CS), select_rule(CS, r(Inst, ID, LHS, RHS)), process(RHS, LHS), asserta( instantiation(Inst) ), write('Rule fired '), write(ID), nl, !, go. go. The select_rule predicate applies the three criteria above to select the appropriate rule. The refract predicate applies refraction, and lex_sort applies both recency and specificity through a sorting mechanism.
- 67 -
select_rule(CS, R) :refract(CS, CS1), lex_sort(CSR, [R|_]). First let's look at refract, which removes those rules which duplicate existing instantiations. It relies on the fact that after each successful rule firing, the instantiation is saved in the database. refract([], []). refract([r(Inst, _, _, _)|T], TR) :instantiation(Inst), !, refract(T, TR). refract([H|T], [H|TR]) :refract(T, TR). Once refract is done processing the list, only those rules with new instantiations are left on the list. The implementation of lex_sort doesn't filter the remaining rules, but sorts them so that the first rule on the list is the desired rule. This is done by creating a key for each rule which is used to sort the rules. The key is designed to sort by recency and specificity. The sorting is done with a common built-in predicate, keysort, which sorts a list by keys where the elements are in the form: key - term. (If your Prolog does not have a keysort, see Clocksin and Mellish section 7.7, Sorting.) lex_sort(L, R) :build_keys(L, LK), keysort(LK, X), reverse(X, Y), strip_keys(Y, R). The build_keys predicate adds the keys to each term. The keyed list is then sorted by keysort. It comes out backwards, so it is reversed, and finally the keys are stripped from the list. In order for this to work, the right key needs to be chosen. The key which gives the desired results is itself a list. The elements are the time stamps of the various matched conditions in the instantiation of the rule. The key (a list) is sorted so that the most recent (highest number) time stamps are at the head of the list. These complex keys can themselves be sorted to give the correct ordering of the rules. For example, consider the following two rules, and working storage: rule t1: [flies(X), lays_eggs(X)] ==> [assert(bird(X))]. rule t2: [mammal(X), long_ears(X), eats_carrots(X)] ==> [assert(animal(X, rabbit))]. fact( flies(lara), 9). fact( flies(zach), 6). fact( lays_eggs(lara), 7). fact( lays_eggs(zach), 8).
- 68 -
fact( mammal(bonbon), 3). fact( long_ears(bonbon), 4). fact( eats_carrots(bonbon), 5). There would be two instantiations of the first rule, one each for lara and zach, and one instantiation of the second rule for bonbon. The highest numbers are the most recent time stamps. The keys (in order) for these three instantiations would be: [9, 7] [8, 6] [5, 4, 3] In order to get the desired sort, lists must be compared element by element starting from the head of the list. This gives the recency sort. The sort must also distinguish between two lists of different lengths with the same common elements. This gives the specificity sort. For AAIS prolog the sort works as desired with recency being more important than specificity. It should be checked for other Prologs. Here is the code to build the keys: build_keys([], []). build_keys([r(Inst, A, B, C)|T], [Key-r(Inst, A, B, C)|TR]) :build_chlist(Inst, ChL), sort(ChL, X), reverse(X, Key), build_keys(T, TR). build_chlist([], []). build_chlist([_/Chron|T], [Chron|TC]) :build_chlist(T, TC). The build_keys predicate uses build_chlist to create a list of the time stamps associated with the LHS instantiation. It then sorts those, and reverses the result, so that the most recent time stamps are first in the list. The final predicate, strip_keys, simply removes the keys from the resulting list. strip_keys([], []). strip_keys([Key-X|Y], [X|Z]) :strip_keys(Y, Z).
5.8 MEA
The other strategy offered with OPS5 is MEA. This is identical to LEX with one additional filter added. After refraction, it finds the time stamp associated with the first condition of the rule and picks the rule with the highest time stamp on the first condition. If there is more than one, then the normal LEX algorithm is used to pick which of them to use. At first this might seem like an arbitrary decision; however, it was designed to make goal directed programming easier in OPS5. The flow of control of a forward chaining system is often controlled by setting goal facts in working storage. Rules might have goals in the conditions thus ensuring the rule will only fire when that goal is being pursued.
- 69 -
By making the goal condition the first condition on the LHS of each rule, and by using MEA, the programmer can force the system to pursue goals in a specified manor. In fact, using this technique it is possible to build backward chaining systems using a forward chaining tool. The test for MEA is simply added to the system. First, the filter is added to the select_rule predicate. It will simply return the same conflict set if the current strategy is not MEA. select_rule(R, CS) :refract(CS, CS1), mea_filter(0, CS1, [], CSR), lex_sort(CSR, [R|_]). The actual filter predicates build the new list in an accumulator variable, Temp. If the first time stamp for a given rule is less than the current maximum, it is not included. If it equals the current maximum, it is added to the list of rules. If it is greater than the maximum, that timestamp becomes the new maximum, and the list is reinitialized to have just that single rule. mea_filter(_, X, _, X) :- not strategy(mea), !. mea_filter(_, [], X, X). mea_filter(Max, [r([A/T|Z], B, C, D)|X], Temp, ML) :T < Max, !, mea_filter(Max, X, Temp, ML). mea_filter(Max, [r([A/T|Z], B, C, D)|X], Temp, ML) :T = Max, !, mea_filter(Max, X, [r([A/T|Z], B, C, D)|Temp], ML). mea_filter(Max, [r([A/T|Z], B, C, D)|X], Temp, ML) :T > Max, !, mea_filter(T, X, [r([A/T|Z], B, C, D)], ML). These examples illustrate some of the difficulties with expert systems in general. The OPS5 programmer must be intimately familiar with the nature of the inferencing in order to get the performance desired from the system. He is only free to use the tools available to him. On the other hand, if the programmer has access to the selection strategy code, and knows the type of inferencing that will be required, the appropriate strategy can be built into the system. Given the accessibility of the above code, it is easy to experiment with different selection strategies.
5.1 - Add full rule tracing to OOPS. 5.2 - Add a command loop which turns on and off tracing, MEA/LEX strategies, loads rule files, consults the rules, lists working storage, etc. 5.3 - Add a feature that allows for the saving of test case data which can then be run against the system. The test data and the results are used to debug the system as it undergoes change. 5.4 - Allow each rule to optionally have a priority associated with it. Use the user defined rule priorities as the first criteria for selecting rule instantiations from the conflict set. 5.5 - Add features on the LHS and RHS that allow rules to be written which can access the conflict set and dynamically change the rule priorities. Figure out an application for this.
- 70 -
5.6 - Add new syntax to the knowledge base that allows rules to be clustered into rule sets. Maintain separate conflict sets for each rule set and have the inference engine process each rule set to completion. Have higher level rules which can be used to decide which rule sets to execute. Alternatively, each rule set can have an enabling pattern associated with it that allows it to fire just as individual rules are fired. 5.7 - Each fact in working storage can be thought of as being dependent on other facts. The other facts are those which instantiated the LHS of a rule which udpated the fact. By keeping track of these dependencies, a form of truth maintenance can be added to the system. When a fact is then removed from working storage, the system can find other facts which were dependent on it and remove them as well.
- 71 -
6 Frames
Up until this point in the book, we have worked with data structures that are simply that, data structures. It is often times desirable to add some "intelligence" to the data structures, such as default values, calculated values, and relationships between data. Of the various schemes which evolved over the years, the frame based approach has been one of the more popular. Information about an object in the system is stored in a frame. The frame has multiple slots used to define the various attributes of the object. The slots can have multiple facets for holding the value for the attributes, or defaults, or procedures which are called to calculate the value. The various frames are linked together in a hierarchy with a-kind-of (ako) links that allow for inheritance. For example, rabbits and hamsters might be stored in frames that have ako(mammal). In the frame for mammal are all of the standard attribute-values for mammals, such as skin-fur and birth-live. These are inherited by rabbits and hamsters and do not have to be specified in their frames. There can also be defaults for attributes which might be overwritten by specific species. Legs-4 applies to most mammals but monkeys would have legs-2 specified. Another feature of a frame based system is demons. These are procedures which are activated by various updating procedures. For example a financial application might have demons on various account balances that are triggered when the value is too low. These could also have editing capabilities that made sure the data being entered is consistent with existing data. Figure 6.1 shows some samples of frames for animals.
- 72 -
Figure 6.1. Examples of animal frames
6.1 The Code
In order to implement a frame system in Prolog, there are two initial decisions to be made. The first is the design of the user interface, and the second is the design of the internal data structure used to hold the frame information. The access to data in the frame system will be through three predicates. get_frame - retrieves attribute values for a frame; add_frame - adds or updates attribute values for a frame; del_frame - deletes attribute values from a frame. From the user's perspective, these operations will appear to be acting on structures that are very similar to database records. Each frame is like a record, and the slots in the frame correspond to the fields in the record. The intelligence in the frame system, such as inheritance, defaults, and demons, happens automatically for the user. The first argument of each of these predicates is the name of the frame. The second argument has a list of the slots requested. Each slot is represented by a term of the form attribute - value. For example to retrieve values for the height and weight slots in the frame dennis the following query would be used: ?- get_frame(dennis, [weight-W, height-H]). W = 155 H = 5-10 To add a new sport for mary: ?- add_frame(mary, [sport-rugby]). To delete a slot's value for mynorca's computer: ?- del_frame(mynorca, [computer-'PC AT']). These three primitive frame access predicates can be used to build more complex frame applications. For example the following query would find all of the women in the frame database who are rugby players: ?- get_frame(X, [ako-woman, sport-rugby]). X = mary ; X = kelly; A match-making system might have a predicate that looks for men and women who have a hobby in common: in_common(M, W, H) :get_frame(M, [ako-man, hobby-H]), get_frame(W, [ako-woman, hobby-H]).
- 73 -
6.2 Data Structure
The next decision is to chose a type of data structure for the frames. The frame is a relatively complex structure. It has a name, and multiple slots. Each slot, which corresponds to an attribute of the frame, can have a value. This is the same as in a normal database. However in a frame system, the value is just one possible facet for the slot. There might also be default values, predicates which are used to calculate values, and demons which fire when the value in the slot is updated. Furthermore, the frames can be organized in a hierarchy, where each frame has an a-kind-of slot which has a list of the types of frames from which this frame inherits values. The data structure chosen for this implementation has the predicate name frame with two arguments. The first is the name of the frame, and the second is a list of slots separated by a hyphen operator from their respective facet lists. The facet list is composed of prefix operator facet names. The ones defined in the system are: val - the simple value of the slot; def - the default if no value is given; calc - the predicate to call to calculate a value for the slot; add - the predicate to call when a value is added for the slot; del - the predicate to call when the slot's value is deleted. Here is the format of a frame data structure: frame(name, [ slotname1 - [ facet1 val11, facet2 val12, ...], slotname2 - [ facet1 val21, facet2 val 22, ...], ...]). For example: frame(man, [ ako-[val [person]], hair-[def short, del bald], weight-[calc male_weight] ]). frame(woman, [ ako-[val [person]], hair-[def long], weight-[calc female_weight] ]). In this case both man and woman have ako slots with the value of person. The hair slot has default values of long and short hair for women and men, but this would be overridden by the values in individual frames. Both have facets that point to predicates that are to be used to calculate weight, if none is given. The man's hair slot has a facet which points to a demon, bald, to be called if the value for hair is deleted. One additional feature permits values to be either single-valued or multi-valued. Single values are represented by terms, multiple values are stored in lists. The add_frame and del_frame predicates take this into account when updating the frame. For example hair has a single value but hobbies and ako can have multiple values.
- 74 -
Figure 6.2. Major predicates of get_frame
6.3 The Manipulation Predicates
The first predicate to look at is get_frame. It takes as input a query pattern, which is a list of slots and requested values. This request list (ReqList) is then compared against the SlotList associated with the frame. As each request is compared against the slot list, Prolog's unification instantiates the variables in the list. Figure 6.2 shows the major predicates used with get_frame. get_frame(Thing, ReqList) :frame(Thing, SlotList), slot_vals(Thing, ReqList, SlotList). The slot_vals predicate takes care of matching the request list against the slot list. It is a standard recursive list predicate, dealing with one item from the request list at a time. That item is first converted from the more free form style allowed in the input list to a more formal structure describing the request. That structure is req/4 where the arguments are: • name of the frame; • the requested slot; • the requested facet; • the requested value. The code for slot_vals recognizes request lists, and also single slot requests not in list form. This means both of the following frame queries are legal: ?- get_frame( dennis, hair-X ). ... ?- get_frame( dennis, [hair-X, height-Y] ). ... The slot_vals predicate is a standard list recursion predicate that fulfills each request on the list in turn. The real work is done by find_slot which fulfills the request from the frame's slot list.
- 75 -
slot_vals(_, [], _). slot_vals(T, [Req|Rest], SlotList) :prep_req(Req, req(T, S, F, V)), find_slot(req(T, S, F, V), SlotList), !, slot_vals(T, Rest, SlotList). slot_vals(T, Req, SlotList) :prep_req(Req, req(T, S, F, V)), find_slot(req(T, S, F, V), SlotList). The request list is composed of items of the form Slot - X. The prep_req predicate, which builds the formal query structure, must recognize three cases: • X is a variable, in which case the value of the slot is being sought. • X is of the form Facet(Val), in which case a particular facet is being sought. • X is a non-variable in which case the slot value is being sought for comparison with the given value. Here is the code which prepares the formal query structure: prep_req(Slot-X, req(T, Slot, val, X)) :- var(X), !. prep_req(Slot-X, req(T, Slot, Facet, Val)) :nonvar(X), X =.. [Facet, Val], facet_list(FL), member(Facet, FL), !. prep_req(Slot-X, req(T, Slot, val, X)). facet_list([val, def, calc, add, del, edit]). For example, the query ?- get_frame(dennis, [hair-X]). would generate the more formal request for: req(dennis, hair, val, X) Having now prepared a more formal request, and a slot list to fulfill it, find_slot attempts to satisfy the request. The first clause handles the case where the request is not for a variable, but really just a test to see if a certain value exists. In this case another request with a different variable (Val) is started, and the results compared with the original request. Two cases are recognized: either the value was a single value, or the value was a member of a list of values. find_slot(req(T, S, F, V), SlotList) :nonvar(V), find_slot(req(T, S, F, Val), SlotList), !, (Val == V; member(V, Val)). The next clause covers the most common case, in which the value is a variable, and the slot is a member of the slot list. Notice that the call to member both verifies that there is a structure of the form Slot-FacetList and unifies FacetList with the list of facets associated with the slot. This is because S is bound at the start of the call to member, and FacetList is not. Next, facet_val is called which gets the value from the facet list.
- 76 -
find_slot(req(T, S, F, V), SlotList) :member(S-FacetList, SlotList), !, facet_val(req(T, S, F, V), FacetList). If the requested slot was not in the given slot list for the frame, then the next clause uses the values in the ako (a-kind-of) slot to see if there is a super class from which to inherit a value. The value in the ako slot might be a list, or a single value. The higher frame's slot list is then used in an attempt to satisfy the request. Note that this recurses up through the hierarchy. Note also that a frame may have multiple values in the ako slot, allowing for a more complex structure than a pure hierarchy. The system works through the list in order, trying to satisfy a request from the first ako value first. find_slot(req(T, S, F, V), SlotList) :member(ako-FacetList, SlotList), facet_val(req(T, ako, val, Ako), FacetList), (member(X, Ako); X = Ako), frame(X, HigherSlots), find_slot(req(T, S, F, V), HigherSlots), !. The final clause in find_slot calls the error handling routine. The error handling routine should probably be set not to put up error messages in general, since many times quiet failure is what is required. During debugging it is useful to have it turned on. find_slot(Req, _) :error(['frame error looking for:', Req]). The facet_val predicate is responsible for getting the value for the facet. It deals with four possible cases: • The requested facet and value are on the facet list. This covers the val facet as well as specific requests for other facets. • The requested facet is val, it is on the facet list, and its value is a list. In this case member is used to get a value. • There is a default (def) facet which is used to get the value. • There is a predicate to call (calc) to get the value. It expects the formal request as an argument. If the facet has a direct value in the facet list, then there is no problem. If there is not a direct value, and the facet being asked for is the val facet, then, alternate ways of getting the value are used. First the default is tried, and if there is no default, then a calc predicate is used to compute the value. If a calc predicate is needed, then the call to it is built using the univ (=..) built-in predicate, with the request pattern as the first argument, and other arguments included in the calc predicate following. facet_val(req(T, S, F, V), FacetList) :FV =.. [F, V], member(FV, FacetList), !. facet_val(req(T, S, val, V), FacetList) :member(val ValList, FacetList), member(V, ValList), !. facet_val(req(T, S, val, V), FacetList) :member(def V, FacetList), !. facet_val(req(T, S, val, V), FacetList) :member(calc Pred, FacetList), Pred =.. [Functor | Args], CalcPred =.. [Functor, req(T, S, val, V) | Args], call(CalcPred).
- 77 -
An example of a predicate used to calculate values is the female_weight predicate. It computes a default weight equal to twice the height of the individual. female_weight(req(T, S, F, V)) :get_frame(T, [height-H]), V is H * 2. We have now seen the code which gets values from a frame. It first sets up a list of requested slot values and then processes them one at a time. For each slot which is not defined for the frame, inheritance is used to find a parent frame that defines the slot. For the slots that are defined, each of the facets is tried in order to determine a value. The next major predicate in the frame system adds values to slots. For single valued slots, this is a replace. For multi-valued slots, the new value is added to the list of values. The add_frame predicate uses the same basic form as get_frame. For updates, first the old slot list is retrieved from the existing frame. Then the predicate add_slots is called with the old list (SlotList) and the update list (UList). It returns the new list (NewList). add_frame(Thing, UList) :old_slots(Thing, SlotList), add_slots(Thing, UList, SlotList, NewList), retract(frame(Thing, _)), asserta(frame(Thing, NewList)), !. The old_slots predicate usually just retrieves the slot list, however if the frame doesn't exist it creates a new frame with an empty slot list. old_slots(Thing, SlotList) :frame(Thing, SlotList), !. old_slots(Thing, []) :asserta(frame(Thing, [])). Next, comes add_slots which does analogous list matching to slot_vals called by get_frame. add_slots(_, [], X, X). add_slots(T, [U|Rest], SlotList, NewList) :prep_req(U, req(T, S, F, V)), add_slot(req(T, S, F, V), SlotList, Z), add_slots(T, Rest, Z, NewList). add_slots(T, X, SlotList, NewList) :prep_req(X, req(T, S, F, V)), add_slot(req(T, S, F, V), SlotList, NewList). The add_slot predicate deletes the old slot and associated facet list from the old slot list. It then adds the new facet and value to that facet list and rebuilds the slot list. Note that delete unifies FacetList with the old facet list. FL2 is the new facet list returned from add_facet. The new slot and facet list, S-FL2 is then made the head of the add_slot output list, with SL2, the slot list after deleting the old slot as the tail. add_slot(req(T, S, F, V), SlotList, [S-FL2|SL2]) :delete(S-FacetList, SlotList, SL2), add_facet(req(T, S, F, V), FacetList, FL2). The add_facet predicate takes the request and deletes the old facet from the list, builds a new facet and adds it to the facet list in the same manner as add_slot. The main trickiness is add_facet makes a distinction between a facet whose value is a list, and one whose value is a term. In the case of a list, the new value is added to the
- 78 -
list, whereas in the case of a term, the old value is replaced. The add_newval predicate does this work, taking the OldVal, the new value V and coming up with the NewVal. add_facet(req(T, S, F, V), FacetList, [FNew|FL2]) :FX =.. [F, OldVal], delete(FX, FacetList, FL2), add_newval(OldVal, V, NewVal), !, check_add_demons(req(T, S, F, V), FacetList), FNew =.. [F, NewVal]. add_newval(X, Val, Val) :- var(X), !. add_newval(OldList, ValList, NewList) :list(OldList), list(ValList), append(ValList, OldList, NewList), !. add_newval([H|T], Val, [Val, H|T]). add_newval(Val, [H|T], [Val, H|T]). add_newval(_, Val, Val). The intelligence in the frame comes after the cut in add_facet. If a new value has been successfully added, then check_add_demons looks for any demon procedures which must be run before the update is completed. In check_add_demons, get_frame is called to retrieve any demon predicates in the facet add. Note that since get_frame uses inheritance, demons can be put in higher level frames that apply to all sub frames. check_add_demons(req(T, S, F, V), FacetList) :get_frame(T, S-add(Add)), !, Add =.. [Functor | Args], AddFunc =.. [Functor, req(T, S, F, V) | Args], call(AddFunc). check_add_demons(_, _). The delete predicate used in the add routines must simply return a list that does not have the item to be deleted in it. If there was no item, then returning the same list is the right thing to do. Therefor delete looks like: delete(X, [], []). delete(X, [X|Y], Y) :- !. delete(X, [Y|Z], [Y|W]) :- delete(X, Z, W). The del_frame predicate is similar to both get_frame and add_frame. However, one major difference is in the way items are deleted from lists. When add_frame was deleting things from lists (for later replacements with updated values), the behavior of delete above was appropriate. For del_frame, a failure should occur if there is nothing to delete from the list. For this function we use remove which is similar to delete, but fails if there was nothing to delete. remove(X, [X|Y], Y) :- !. remove(X, [Y|Z], [Y|W]) :- remove(X, Z, W). The rest of del_frame looks like:
- 79 -
del_frame(Thing) :retract(frame(Thing, _)). del_frame(Thing) :error(['No frame', Thing, 'to delete']). del_frame(Thing, UList) :old_slots(Thing, SlotList), del_slots(Thing, UList, SlotList, NewList), retract(frame(Thing, _)), asserta(frame(Thing, NewList)). del_slots([], X, X, _). del_slots(T, [U|Rest], SlotList, NewList) :prep_req(U, req(T, S, F, V)), del_slot(req(T, S, F, V), SlotList, Z), del_slots(T, Rest, Z, NewList). del_slots(T, X, SlotList, NewList) :prep_req(X, req(T, S, F, V)), del_slot(req(T, S, F, V), SlotList, NewList). del_slot(req(T, S, F, V), SlotList, [S-FL2|SL2]) :remove(S-FacetList, SlotList, SL2), del_facet(req(T, S, F, V), FacetList, FL2). del_slot(Req, _, _) :error(['del_slot - unable to remove', Req]). del_facet(req(T, S, F, V), FacetList, FL) :FV =.. [F, V], remove(FV, FacetList, FL), !, check_del_demons(req(T, S, F, V), FacetList). del_facet(req(T, S, F, V), FacetList, [FNew|FL]) :FX =.. [F, OldVal], remove(FX, FacetList, FL), remove(V, OldVal, NewValList), FNew =.. [F, NewValList], !, check_del_demons(req(T, S, F, V), FacetList). del_facet(Req, _, _) :error(['del_facet - unable to remove', Req]). check_del_demons(req(T, S, F, V), FacetList) :get_frame(T, S-del(Del)), !, Del =.. [Functor|Args], DelFunc =.. [Functor, req(T, S, F, V)|Args], call(DelFunc). check_del_demons(_, _). This code is essentially the same as for the add function, except the new facet values have elements deleted instead of replaced. Also, the del facet is checked for demons instead of the add facet. Here is an example of a demon called when a man's hair is deleted. It checks with the user before proceeding.
- 80 -
bald(req(T, S, F, V)) :write_line([T, 'will be bald, ok to proceed?']), read(yes).
6.4 Using Frames
The use of inheritance makes the frame based system an intelligent way of storing data. For many expert systems, a large portion of the intelligence can be stored in frames instead of in rules. Let's consider, for example, the bird identification expert system. In the bird system there is a hierarchy of information about birds. The rules about the order tubenose, family albatross, and particular albatrosses can all be expressed in frames as follows: frame(tubenose, [ level-[val order], nostrils-[val external_tubular], live-[val at_sea], bill-[val hooked] ]). frame(albatross, [ ako-[val tubenose], level-[val family], size-[val large], wings-[val long-narrow] ]). frame(laysan_albatross, [ ako-[val albatross], level-[val species], color-[val white] ]). frame(black_footed_albatross, [ ako-[val albatross], level-[val species], color-[val dark] ]). In a forward chaining system, we would feed some facts to the system and the system would identify the bird based on those facts. We can get the same behavior with the frame system and the predicate get_frame. For example, if we know a bird has a dark color, and long narrow wings, we can ask the query: ?- get_frame(X, [color-dark, wings-long_narrow]). X = black_footed_albatross ; no Notice that this will find all of the birds that have the asked for property. The ako slots and inheritance will automatically apply the various slots from wherever in the hierarchy they appear. In the above example the color attribute was filled from the black footed albatross frame, and the wings attribute was filled from the albatross frame. This feature can be used to find all birds with long narrow wings: ?- get_frame(X, [wings-long_narrow]). X = albatross ; X = black_footed_albatross ; X = laysan_albatross ;
- 81 -
no The queries in this case are more general than in the various expert systems used so far. The query finds all frames that fit the given facts. The query could specify a level, but the query can also be used to bind variables for various fits. For example, to get the level in the hierarchy of the frames which have long narrow wings: ?- get_frame(X, [wings-long_narrow, level-L]). X = albatross, L = family ; X = black_footed_albatross, L = species; X = laysan_albatross, L = species ; no
6.5 Summary
For the expert systems we have seen already, we have used the Prolog database to store information. That database has been relatively simple. By writing special access predicates it is possible to create a much more sophisticated database using frame technology. These frames can then be used to store knowledge about the particular environment.
6.1 - Add other facets to the slots to allow for specification of things like explanation of the slot, certainty factors, and constraints. 6.2 - Add an automatic query-the-user facility that is called whenever a slot value is sought and there is no other frame to provide the answer. This will allow the frame system to be used as a backward chaining expert system.
- 82 -
7 Integration
Many real problems cannot be solved by the simple application of a single expert system technique. Problems often require multiple knowledge representation techniques as well as conventional programming techniques. Often times it is necessary to either have the expert system embedded in a conventional application, or to have other applications callable from the expert system. For example, a financial expert system might need a tight integration with a spread sheet, or an engineering expert system might need access to programs which perform engineering calculations. The degree to which the systems in this book can be integrated with other environments depends on the flexibility of the Prolog used, and the application which needs to be accessed. The systems can be designed with the hooks in place for this integration. In the examples presented in this chapter, the knowledge base tools will have hooks to Prolog. Often times the Prolog code can be used to implement features of the system that do not fit neatly in the knowledge tools. This is often the case in the area of user interface, but applies to other portions as well. In the example in this chapter, we will see Prolog used to smooth over a number of the rough edges of the application. The degree of integration needed between knowledge tools also depends somewhat on the application. In this chapter, the forward chaining system and frame based knowledge representation will be tightly integrated. By having control over the tools, the degree of integration can be implemented to suit the individual application. The example used in this chapter is the same room furniture placement used in the chapter on forward chaining. While the application was developed with the pure Oops system, a much more elegant solution can be implemented by integrating frames, Oops, and Prolog. In particular, there is a lot of knowledge about the types of furniture which could be better stored in a frame system. Also the awkward input and output sections of the system could be better written in Prolog.
7.1 Foops (Frames and Oops)
The first step is to integrate the frame based knowledge representation with the Oops forward chaining inference engine. The integration occurs in two places: • The concept of a frame instance needs to be implemented. • The rules must be able to reference the frame instances. The instances are needed for an integrated system to distinguish between the frame data definition in the knowledge base, and the instances of frames in working storage. The rules will be matching and manipulating instances of frames, rather than the frame definitions themselves. For example, there will be a frame describing the attributes of chairs, but there might be multiple instances of chairs in working storage.
In the frame system as it is currently written, the frames are the data. Particular instances of a frame, such as person, are just additional frames. For use in the expert system it is cleaner to distinguish between frame definitions and instances of frames. The definitions specify the slots for a frame, and the instances provide specific values for the slots. The frame instances will be updated in working storage and accessed by the rules. For example, person would be a frame definition, and mary would be an instance of person. The inheritance still works as before. That is, a person frame could be defined as well as man and woman frames which inherit from person. In this case then mary would be an instance of woman, inheriting from both the woman frame and the person frame.
- 83 -
The frame definitions will be considered to define classes of things. So, person, man, and woman are classes defined in frame relations. Individuals, such as mary, dennis, michael, and diana are stored as instances of these classes. To implement the instances, we need a data structure, and predicates to manipulate the data structure. An instance of a frame looks a lot like a frame, and will be stored in the relation frinst/4. The four arguments will be: • the class name; • the instance name; • the list of slot attribute-value pairs associated with the instance; • a time stamp indicating when the instance was last updated. For example: frinst(woman, mary, [ako-woman, hair-brown, hobby-rugby], 32). frinst(man, dennis, [ako-man, hair-blond, hobby-go], 33). The predicates which manipulate frinsts are: • getf - retrieve attribute values for a frinst; • addf - add a new frinst; • uptf - update an existing frinst; • delf - delete a frinst, or attribute values for a frinst; • printf - print information about a frinst. The code for getf is almost identical for that of get_frame. It just uses the frinst structure to get data rather than the frame structure. The ako slot of a frinst is automatically set to the class name, so if it is necessary to inherit values, the appropriate frames will be called just as they were for get_frame. The only other change is the additional argument for retrieving the time stamp as well. getf(Class, Name, ReqList) :getf(Class, Name, ReqList, _). getf(Class, Name, ReqList, TimeStamp) :frinst(Class, Name, SlotList, TimeStamp), slot_vals(Class, Name, ReqList, SlotList). The addf predicate is similar to add_frame, however it has two new features. First, it will generate a unique name for the frinst if none was given, and second it adds a time stamp. The generated name is simply a number in sequence. The time stamp is generated the same way, and uses the predicate getchron which was already implemented for Oops. Note that addf also sets the ako slot to the value of the Class. addf(Class, Nm, UList) :(var(Nm), genid(Name);Name=Nm), add_slots(Class, Name, [ako-Class|UList], SlotList, NewList), getchron(TimeStamp), asserta( frinst(Class, Name, NewList, TimeStamp) ), !.
- 84 -
The uptf predicate is distinct from addf in that it only updates existing frinsts and does not create new ones. It puts a new time stamp on the frinst as part of the update. uptf(Class, Name, UList) :frinst(Class, Name, SlotList, _), add_slots(Class, Name, UList, SlotList, NewList), retract( frinst(Class, Name, _, _) ), getchron(TimeStamp), asserta( frinst(Class, Name, NewList, TimeStamp) ), !. The delf and printf predicates are similarly based on del_frame and print_frame. Both offer options for accessing large numbers of instances. For example delf(Class) deletes all frinsts in Class, whereas delf(Class, Name, DList) deletes the attribute values in DList from the specified instance.
Rules for frinsts
Now that there is a mechanism for handling instances of frames, the next step is to revise the Oops rule structure to use those instances. In Oops, each of the LHS conditions was a Prolog term held in a fact relation. For Foops, the LHS conditions will be frinsts. In keeping with the Oops design of using operators to make the rules more readable, the frinsts will be presented differently in the rules. The form will be: Class - Name with [Attr - Val, ...] For example, the rule in the furniture configuration which puts table lamps on end tables is: rule f11: [table_lamp - TL with [position-none], end_table - ET with [position-wall/W]] ==> [update( table_lamp - TL with [position-end_table/ET] )]. Note that the RHS actions also use the same syntax for the instance. The change is easy to implement due to the interchangeability of facts and rules in Prolog. Oops refers to facts, expecting to find data. Foops uses the same code, but implements the relation fact as a rule which calls getf. Following is the code which matches the premises from the LHS. It is the the same as in the previous version except that the definition of fact has been changed to reflect the new nature of each individual premise. match([], []). match([Prem|Rest], [Prem/Time|InstRest]) :mat(Prem, Time), match(Rest, InstRest). mat(N:Prem, Time) :!, fact(Prem, Time). mat(Prem, Time) :fact(Prem, Time). mat(Test, 0) :test(Test).
- 85 -
fact(Prem, Time) :conv(Prem, Class, Name, ReqList), getf(Class, Name, ReqList, Time). conv(Class-Name with List, Class, Name, List). conv(Class-Name, Class, Name, []). The conv relation is used to allow the user to specify instances in an abbreviated form if there is no attribute value list. For example, the following rule uses an instance of the class goal where the name is the only important bit of information: rule f1: [goal - couch_first, couch - C with [position-none, length-LenC], door - D with [position-wall/W], ... The only other change which has to be made is in the implementation of the action commands which manipulate working storage. These now manipulate frinst structures instead of the pure facts as they did in Oops. They simply call the appropriate frame instance predicates. assert_ws( fact(Prem, Time) ) :conv(Prem, Class, Name, UList), addf(Class, Name, UList). update_ws( fact(Prem, Time) ) :conv(Prem, Class, Name, UList), uptf(Class, Name, UList). retract_ws( fact(Prem, Time) ) :conv(Prem, Class, Name, UList), delf(Class, Name, UList).
Adding Prolog to Foops
Now that frames and Oops have been integrated into a new system, Foops, the next step is to integrate Prolog as well. This has already been done for the frame based system with the various demons that can be associated with frame slots. The Prolog predicates referred to in the demon slots can simply be added directly to the knowledge base. Adding Prolog to the rules is done by simply adding support for a call statement in both the test (for the LHS) and take (for the RHS) predicates. ... test(call(X)) :- call(X). ... ... take(call(X)) :- call(X). ... Calls to Prolog predicates can now be added on either side of a rule. The Prolog can be simple predicates performing some function right in the knowledge base, or they can initiate more complex processing, including accessing other applications.
- 86 -
Figure 7.1 shows the major components of the Foops shell. Frames and Prolog code have been added to the knowledge base. Working storage is composed of frame instances, and the inference engine includes the frame manipulation predicates.
7.2 Room Configuration
Now that Foops is built, let's use it to attack the room configuration problem again. Many of the aspects of the original system were handled clumsily in the original version. In particular: • The initial data gathering was awkward using rules which triggered other data gathering rules. • The wall space calculations were done in the rules. • Each rule was responsible for maintaining the consistency of the wall space and the furniture against the wall. The new system will allow for a much cleaner expression of most of the system, and use Prolog to keep the rough edges out of the rule and frame knowledge structures. Much of the knowledge about the furniture in the room is better stored in frames. This knowledge is then automatically applied by the rules accessing instances of furniture. The rules then become simpler, and just deal with the IF THEN situations and not data relationships.
Figure 7.1. Major predicates of Foops shell
Furniture frames
The knowledge base contains the basic frame definitions, which will be used by the instances of furniture. The frames act as sophisticated data definition statements for the system. The highest frame defines the class furniture. It establishes defaults and demons that apply to all furniture.
- 87 -
frame(furniture, [ legal_types [val [couch, chair, coffee_table, end_table, standing_lamp, table_lamp, tv, knickknack]], position - [def none, add pos_add], length - [def 3], place_on - [def floor]]). The most interesting slot is position. Each piece of furniture has the default of having the position none, meaning it has not been placed in the room. This means the programmer need not add this value for each piece of furniture initially. As it is positioned, the instance acquires a value which is used instead of the inherited default. Also note that there is a demon which is called when a position is added for a piece of furniture. This is the demon which will automatically maintain the relation between wall space and furniture position. It will be described in detail a little later. Next in the knowledge base are some classes of furniture. Note that the default length for a couch will override the general default length of 3 for any piece of furniture without a length specified. frame(couch, [ ako - [val furniture], length - [def 6]]). frame(chair, [ ako - [val furniture]]). A table is another class of furniture which is a bit different from other furniture in that things can be placed on a table. It has additional slots for available space, the list of items it is holding (things placed on the table), and the slot indicating that it can support other items. frame(table, [ ako - [val furniture], space - [def 4], length - [def 4], can_support - [def yes], holding - [def []]]). There are two types of tables which are recognized in the system: frame(end_table, [ ako - [val table], length - [def 2]]). frame(coffee_table, [ ako - [val table], length - [def 4]]). Remember that frames can have multiple inheritance paths. This feature can be used to establish other classes which define attributes shared by certain types of furniture. For example the class electric is defined which describes the properties of items which require electricity. frame(electric, [ needs_outlet - [def yes]]). Lamps are electric items included in the knowledge base. Note that lamps are further divided between two types of lamps. A table lamp is different because it must be placed on a table. frame(lamp, [ ako - [val [furniture, electric]]]).
- 88 -
frame(standing_lamp, [ ako - [val lamp]]). frame(table_lamp, [ ako - [val lamp], place_on - [def table]]). A knickknack is another item which should be placed on a table. frame(knickknack, [ ako - [val furniture], length - [def 1], place_on - [def table]]). The television frame shows another use of calculated values. A television might be free standing or it might have to be placed on a table. This ambiguity is resolved by a calculate routine which asks the user for a value. When a rule needs to know what to place the television on, the user will be asked. This creates the same kind of dialog effect seen in the backward chaining systems earlier in the book. Note also that the television uses multiple inheritance, both as a piece of furniture and an electrical item. frame(tv, [ ako - [val [furniture, electric]], place_on - [calc tv_support]]). Another frame defines walls. There is a slot for the number of outlets on the wall, and the available space. If no space is defined, it is calculated. The holding slot is used to list the furniture placed against the wall. frame(wall, [ length - [def 10], outlets - [def 0], space - [calc space_calc], holding - [def []]]). Doors, goals, and recommendations are other types of data that are used in the system. frame(door, [ ako - [val furniture], length - [def 4]]). frame(goal, []). frame(recommend, []).
Frame Demons
Next in the knowledge base are the Prolog predicates used in the various frame demons. Here is the predicate which is called to calculate a value for the place_on slot for a television. It asks the user, and uses the answer to update the television frinst so that the user will not be asked again. tv_support(tv, N, place_on-table) :nl, write('Should the TV go on a table? '), read(yes), uptf(tv, N, [place_on-table]). tv_support(tv, N, place_on-floor) :uptf(tv, N, [place_on-floor]).
- 89 -
The pos_add demon is called whenever the position of a piece of furniture is updated. It illustrates how demons and frames can be used to create a database which maintains its own semantic integrity. In this case, whenever the position of a piece of furniture is changed, the available space of the wall it is placed next to, or the table it is placed on, is automatically updated. Also the holding list of the wall or table is also updated. This means that the single update of a furniture position results in the simultaneous update of the wall or table space and wall or table holding list. Note the use of variables for the class and name make it possible to use the same predicate for both tables and walls. pos_add(C, N, position-CP/P) :getf(CP, P, [space-OldS]), getf(C, N, [length-L]), NewS is OldS - L, NewS >= 0, uptf(CP, P, [holding-[C/N], space-NewS]). pos_add(C, N, position-CP/P) :nl, write_line(['Not enough room on', CP, P, for, C, N]), !, fail. This predicate also holds the pure arithmetic needed to maintain the available space. This used to be included in the bodies of the rules in Oops. Now it is only specified once, and is part of a demon defined in the highest frame, furniture. It never has to be worried about in any other frame definition or rules. The pos_add demon also is designed to fail and report an error if something doesn't fit. The original uptf predicate which was called to update the position also fails, and no part of the update takes place. This insures the integrity of the database. Initially, there is no space included in the wall and table frinsts. The following demon will calculate it based on the holding list. This could also have been used instead of the above predicate, but it is more efficient to calculate and store the number than to recalculate it each time. space_calc(C, N, space-S) :getf(C, N, [length-L, holding-HList]), sum_lengths(HList, 0, HLen), S is L - HLen. sum_lengths([], L, L). sum_lengths([C/N|T], X, L) :getf(C, N, [length-HL]), XX is X + HL, sum_lengths(T, XX, L).
Initial Data
Now let's look at the data initialization for the system. It establishes other slots for the wall frames giving spatial relationships between them, and establishes the goal gather_data. initial_data([goal - gather_data, wall - north with [opposite-south, right-west, left-east], wall - south with [opposite-north, right-east, left-west], wall - east with [opposite-west, right-north, left-south], wall - west with [opposite-east, right-south, left-north] ]).
Input Data
The first rule uses the call feature to call a Prolog predicate to perform the data gathering operations which used to be done with rules in Oops. Foops uses the Lex rule selection, but this rule will fire first because no other rules
- 90 -
have any furniture to work with. It then asserts the goal couch_first after gathering the other data. Because Lex gives priority to rules accessing recently updated elements in working storage, the rules which have as a goal couch_first will fire next. rule 1: [goal - gather_data] ==> [call(gather_data), assert( goal - couch_first )]. The Prolog predicate proceeds with prompts to the user, and calls to frame predicates to populate working storage. gather_data :read_furniture, read_walls. read_furniture :get_frame(furniture, [legal_types-LT]), write('Enter name of furniture at the prompt. It must be one of:'), nl, write(LT), nl, write('Enter end to stop input.'), nl, write('At the length prompt enter y or a new number.'), nl, repeat, write('>'), read(X), process_furn(X), !. Note that this predicate has the additional intelligence of finding the default value for the length of a piece of furniture and allowing the user to accept the default, or choose a new value. process_furn(end). process_furn(X) :get_frame(X, [length-DL]), write(length-DL), write('>'), read(NL), get_length(NL, DL, L), addf(X, _, [length-L]), fail. get_length(y, L, L) :- !. get_length(L, _, L). The dialog to get the empty room layout is straight-forward Prolog. read_walls :nl, write('Enter data for the walls.'), nl, write('What is the length of the north & south walls? '), read(NSL), uptf(wall, north, [length-NSL]), uptf(wall, south, [length-NSL]), write('What is the length of the east & west walls? '), read(EWL), uptf(wall, east, [length-EWL]), uptf(wall, west, [length-EWL]), write('Which wall has the door? '), read(DoorWall), write('What is its length? '), read(DoorLength), addf(door, D, [length-DoorLength]), uptf(door, D, [position-wall/DoorWall]),
- 91 -
write('Which walls have outlets? (a list)'), read(PlugWalls), process_plugs(PlugWalls). process_plugs([]) :- !. process_plugs([H|T]) :uptf(wall, H, [outlets-1]), !, process_plugs(T). process_plugs(X) :uptf(wall, X, [outlets-1]).
The Rules
With the data definition, initial data, and input taken care of, we can proceed to the body of rules. They are much simpler than the original versions. The first rules place the couch either opposite the door or to its right, depending on which wall has more space. Note that the update of the couch position is done with a single action. The frame demons take care of the rest of the update. rule f1: [goal - couch_first, couch - C with [position-none, length-LenC], door - D with [position-wall/W], wall - W with [opposite-OW, right-RW], wall - OW with [space-SpOW], wall - RW with [space-SpRW], SpOW >= SpRW, LenC =< SpOW] ==> [update(couch - C with [position-wall/OW])]. rule f2: [goal - couch_first, couch - C with [position-none, length-LenC], door - D with [position-wall/W], wall - W with [opposite-OW, right-RW], wall - OW with [space-SpOW], wall - RW with [space-SpRW], SpRW >= SpOW, LenC =< SpRW] ==> [update(couch - C with [position-wall/RW])]. The next rules position the television opposite the couch. They cover the two cases of a free standing television and one which must be placed on a table. If the television needs to be placed on a table, and there is no table big enough, then a recommendation to buy an end table for the television is added. Because of specificity in Lex (the more specific rule has priority), rule f4 will fire before f4a. If f4 was successful, then f4a will no longer apply. If f4 failed, then f4a will fire the next time. The rule to position the television puts the end table on the wall opposite the couch, and the television on the end table. rule f3: [couch - C with [position-wall/W], wall - W with [opposite-OW], tv - TV with [position-none, place_on-floor]]
- 92 -
==> [update(tv - TV with [position-wall/OW])]. rule f4: [couch - C with [position-wall/W], wall - W with [opposite-OW], tv - TV with [position-none, place_on-table], end_table - T with [position-none]] ==> [update(end_table - T with [position-wall/OW]), update(tv - TV with [position-end_table/T])]. rule f4a: [tv - TV with [position-none, place_on-table]] ==> [assert(recommend - R with [buy-['table for tv']])]. The coffee table should be placed in front of the couch, no matter where it is. rule f5: [coffee_table - CT with [position-none], couch - C] ==> [update(coffee_table - CT with [position-frontof(couch/C)])]. The chairs go on adjacent walls to the couch. rule f6: [chair - Ch with [position-none], couch - C with [position-wall/W], wall - W with [right-RW, left-LW], wall - RW with [space-SpR], wall - LW with [space-SpL], SpR > SpL] ==> [update(chair - Ch with [position-wall/RW])]. rule f7: [chair - Ch with [position-none], couch - C with [position-wall/W], wall - W with [right-RW, left-LW], wall - RW with [space-SpR], wall - LW with [space-SpL], SpL > SpR] ==> [update(chair - Ch with [position-wall/LW])]. The end tables go next to the couch if there are no other end tables there. Otherwise they go next to the chairs. Note that the rule first checks to make sure there isn't an unplaced television that needs an end table for support. The television rule will position the end table for holding the television. rule f9: [end_table - ET with [position-none], not tv - TV with [position-none, place_on-table], couch - C with [position-wall/W], not end_table - ET2 with [position-wall/W]] ==> [update(end_table - ET with [position-wall/W])]. rule f10: [end_table - ET with [position-none],
- 93 -
not tv - TV with [position-none, place_on-table], chair - C with [position-wall/W], not end_table - ET2 with [position-wall/W]] ==> [update(end_table - ET with [position-wall/W])]. Table lamps go on end tables. rule f11: [table_lamp - TL with [position-none], end_table - ET with [position-wall/W]] ==> [update( table_lamp - TL with [position-end_table/ET] )]. Knickknacks go on anything which will hold them. Note the use of variables in the class and name positions. The query to the slot can_support will cause this rule to find anything which has the attribute value can_support yes. This slot is set in the table frame, so both end tables and coffee tables will be available to hold the knickknack. rule f11a: [knickknack - KK with [position-none], Table - T with [can_support-yes, position-wall/W]] ==> [update( knickknack - KK with [position-Table/T] )]. The rules for determining if extensions cords are necessary are simplified by the use of variables and frame inheritance. The rule looks for anything which needs an outlet. This will be true of any items which need an outlet, which is a property inherited from frame electric. It is not necessary to write separate rules for each case. It is necessary to write a separate rule to cover those things which are positioned on other things. The wall can only be found from the supporting item. This is the case where a television or table lamp is placed on a table. While this is handled in rules here, it would also have been possible to use frame demons to cover this case instead. rule f12: [Thing - X with [needs_outlet-yes, position-wall/W], wall - W with [outlets-0]] ==> [assert(recommend - R with [buy-['extension cord'-W]])]. rule f13: [Thing - X with [needs_outlet-yes, position-C/N], C - N with [position-wall/W], wall - W with [outlets-0]] ==> [assert(recommend - R with [buy-['extension cord'-Thing/W]])]. Due to specificity priorities in Lex, the following rule will fire last. It calls a Prolog predicate to output the results of the session. rule f14: [] ==> [call(output_data)].
Output Data
The output_data predicate is again straight forward Prolog which gets the relevant information and displays it.
- 94 -
output_data :write('The final results are:'), nl, output_walls, output_tables, output_recommends, output_unplaced. output_walls :getf(wall, W, [holding-HL]), write_line([W, wall, holding|HL]), fail. output_walls. output_tables :getf(C, N, [holding-HL]), not C = wall, write_line([C, N, holding|HL]), fail. output_tables. output_recommends :getf(recommend, _, [buy-BL]), write_line([purchase|BL]), fail. output_recommends. output_unplaced :write('Unplaced furniture:'), nl, getf(T, N, [position-none]), write(T-N), nl, fail. output_unplaced. Figure 7.2 summarizes how the tools in Foops are applied to the furniture layout program. Frames are used for objects and relationships, rules are used to define situations and responses, and Prolog is used for odds and ends like I/O and calculations.
Figure 7.2. Summary of knowledge representation tools used in Foops
7.3 A Sample Run
- 95 -
Here is a portion of a sample run of the furniture placement system. The system starts in the Foops command loop, and then begins the initial data gathering. =>go. Enter name of furniture at the prompt. It must be one of: [couch, chair, coffee_table, end_table, standing_lamp, table_lamp, tv, knickknack] Enter end to stop input. At the length prompt enter y or a new number. >couch. length-6>y. >chair. length-3>5. ... >end. Enter data for the walls. What is the length of the north & south walls? 12. What is the length of the east & west walls? 9. Which wall has the door? east. What is its length? 3. Which walls have outlets? (a list)[east]. adding-(goal-couch_first) Rule fired 1 One of the rules accessing the television causes this prompt to appear. Should the TV go on a table? yes. The system has informational messages regarding which rules are firing and what data is being updated. updating-(couch-110 with [position-wall/north]) Rule fired f2 updating-(end_table-116 with [position-wall/south]) updating-(tv-117 with [position-end_table/116]) Rule fired f4
- 96 -
... Here is a message that appeared when a knickknack was unsuccessfully placed on an end table. A different knickknack was then found to fit on the same table. Not enough room on end_table 116 for knickknack 121 Rule fired f11a updating-(knickknack-120 with [position-end_table/116]) Rule fired f11a Here is one of the extension cord recommendations: adding-(recommend-_3888 with [buy-[extension cord-table_lamp/north]]) Rule fired f13 The last rule to fire provides the final results. The final results are: north wall holding end_table/114 couch/110 east wall holding chair/112 door/122 west wall holding end_table/115 chair/113 south wall holding end_table/116 end_table 114 holding table_lamp/119 end_table 115 holding knickknack/121 end_table 116 holding knickknack/120 tv/117 purchase extension cord-table_lamp/north purchase extension cord-tv/south Unplaced furniture: table_lamp-118 chair-111
7.4 Summary
A combination of techniques can lead to a much cleaner representation of knowledge for a particular problem. The Prolog code for each of the techniques can be integrated relatively easily to provide a more complex system.
7.1 - Integrate Clam with frames.
- 97 -
7.2 - Implement multiple rule sets as described in the chapter five exercises. Let each rule set be either forward or backward chaining, and use the appropriate inference engine for both. 7.3 - Build another expert system using Foops.
- 98 -
8 Performance
As the size of a knowledge base grows, performance becomes more problematic. The inference engines we have looked at so far use a simple pattern matching algorithm to find the rules to fire. Various indexing schemes can be used to speed up that pattern matching process. The indexing problem is different for forward and backward chaining systems. Backward chaining systems need to be accessed by the goal pattern in the right hand side of the rule. Forward chaining systems need to be indexed by the more complex patterns on the left hand side. Backward chaining issues will be discussed briefly in this chapter, followed by more in depth treatment of a simplified Rete match algorithm for the Foops forward chaining system.
8.1 Backward Chaining Indexes
For performance in backward chaining systems, the rules are indexed by goal patterns on the right hand side. In particular, if the goal is to find a value for a given attribute, then the rules should be indexed by the attribute set in the RHS of the rule. This happens automatically for the pure Prolog rules in the bird identification program since the attributes are Prolog predicate names which are generally accessed through hashing algorithms. The indices, if desired, must be built into the backward chaining engine used in Clam. Some Prologs provide automatic indexing on the first argument of a predicate. This feature could be used to provide the required performance. Given indexing by the first argument, the rules in Clam would be represented: rule(Attribute, Val, CF, Name, LHS). This way, a search for rules providing values for a given attribute would quickly find the appropriate rules. Without this, each rule could be represented with a functor based on the goal pattern and accessed using the univ (=..) predicate rather than the pattern matching currently used in Clam. The predicates which initially read the rules can store them using this scheme. For example, the internal format of the Clam rules would be: Attribute(Val, CF, Name, LHS). In particular, some rules from the car diagnostic system would be: problem(battery, 100, 'rule 1', [av(turn_over, no), av(battery_bad, yes)]). problem(flooded, 80, 'rule 4', [av(turn_over, yes), av(smell_gas, yes)]). battery_bad(yes, 50, 'rule 3', [av(radio_weak, yes)]). When the inference is looking for rules to establish values for an attribute - value pattern, av(A, V), the following code would be used: Rule =.. [A, V, CF, ID, LHS], call(Rule), ... This structure would allow Clam to take advantage of the hashing algorithms built into Prolog for accessing predicates.
- 99 -
8.2 Rete Match Algorithm
OPS5 and some high-end expert system shells use the Rete match algorithm to optimize performance. It is an indexing scheme which allows for rapid matching of changes in working memory with the rules. Previous match information is saved on each cycle, so the system avoids redundant calculations. We will implement a simplified version of the Rete algorithm for Foops. The Rete algorithm is designed for matching left hand side rule patterns against working storage elements. Let's look at two similar rules from the room placement expert system. rule f3# [couch - C with [position-wall/W], wall - W with [opposite-OW], tv - TV with [position-none, place_on-floor]] ==> [update(tv - TV with [position-wall/OW])]. rule f4# [couch - C with [position-wall/W], wall - W with [opposite-OW], tv - TV with [position-none, place_on-table], end_table - T with [position-none]] ==> [update(end_table - T with [position-wall/OW]), update(tv - TV with [position-end_table/T])]. First let's define some terms. Each LHS is composed of one or more frame patterns. An example of a frame pattern is: tv-TV with [position-none, place_on-table] The frame pattern will be the basic unit of indexing in the simplified Rete match algorithm. In a full implementation, indexing is carried down to the individual attribute-value pairs within the frame pattern, such as place_on-table. The match algorithm used in the first implementation of Foops takes every rule and compares it to all the frame instances on each cycle. In particular, both of the example rules above would be compared against working storage on each cycle. Not only is redundant matching being done on each cycle, within each cycle the same frame patterns are being matched twice, once for each rule. Since working memory generally has few changes on each cycle, and since many of the rules have redundant patterns, this approach is very inefficient. With the Rete algorithm, the status of the match information from one cycle is remembered for the next. The indexing allows the algorithm to update only that match information which is changed due to working memory changes. The rules are compiled into a network structure where the nodes correspond to the frame patterns in the LHS of the rules. There are three basic types of node which serve as: the entry to the network; the internals of the network; and the exit from the network. These are called root nodes, two-input nodes, and rule nodes respectively.
- 100 -
Figure 8.1. The nodes of the Rete network for two sample rules
The network has links which run from single frame patterns in the root nodes, through the two-input nodes, to full LHS patterns in the rule nodes. Figure 8.1 shows the nodes and links generated from the two sample rules.
Network Nodes
The root nodes serve as entry points to the Rete network. They are the simplest patterns recognized by the network, in this case the frame patterns that appear in the various rules. A frame pattern only appears once in a root node even if it is referenced in multiple rules. Each root node has pointers to two-input nodes which are used to combine the patterns into full LHS patterns. Two-input nodes represent partially completed LHS patterns. The left input has a pattern which has one or more frame patterns as they appear in one or more rules. The right input has a single frame pattern, which when appended to the left input pattern completes more of a full LHS pattern. The two-input node is linked to other two-input or rule nodes whose left input matches the larger pattern. The rule nodes are the exit points of the Rete network. They have full LHS patterns and RHS patterns.
- 101 -
Network Propagation
Associated with each two-input node, are copies of working storage elements which have already matched either side of the node. These are called the left and right memories of the node. In effect, this means working memory is stored in the network itself. Whenever a frame instance is added, deleted, or updated it is converted to a "token". A token is formed by comparing the frame instance to the root patterns. A root pattern which is unified with the frame instance is a token. The token has an additional element which indicates whether it is to be added to or deleted from the network.
Figure 8.2. The relationship between frame patterns, instances, tokens, and nodes
The token is sent from the root node to its successor nodes. If the token matches a left or right pattern of a twoinput successor node, it is added (or deleted) from the the appropriate memory for that node. The token is then combined with each token from the memory on the other side (right or left) and compared with the pattern formed by combining the left and right patterns of the two input node. If there is a match, the new combined token is sent to the successor nodes. This process continues until either a rule is instantiated or there are no more matches.
- 102 -
Figure 8.2 shows the relationships between rules, frame patterns, frame instances, nodes, and tokens. It shows the top portion of the network as shown in Figure 8.1. It assumes that couch-1 with [position-wall/north] already exists in the left memory of two-input node #1. Then the frame instance wall-north with [opposite-south, leftwest, right-east] is added, causing the generation of the token wall-north with [opposite-south]. The token updates the right memory of node #1 as shown, and causes a new token to be generated which is sent to node #2, causing an update to its left memory.
Example of Network Propagation
Lets trace what happens in the network during selected phases of a run of the room configuration system. First the walls are placed during initialization. There are four wall frame instances asserted which define opposites and are therefor recognized by the portion of the system we are looking at. They are used to build addtokens which are sent to the network. wall-north with [opposite-south]. wall-south with [opposite-north]. wall-east with [opposite-west]. wall-west with [opposite-east]. Each of these tokens matches the following root pattern, binding OW to the various directions: wall-W with [opposite-OW].
Figure 8.3. The sample network after initialization
- 103 -
Therefore, each token is passed on to the right side of two-input node #1 as indicated by the list of links associated with that root pattern. Each of these terms is stored in the right memory of node #1. Since there is nothing in the left memory of node #1, network processing stops until the next input is received. Next, the furniture is initialized, with the couch, tv, and end_table placed with position-none. They will be internally numbered 1, 2, and 3. Since the root pattern for couch in the segment we are looking at has a position-wall/W, the couch does not show up in it at this time. However, node #2 and node #4 have their right memories updated respectively with the tokens: tv-2 with [position-none, place_on-floor]. end_table-3 with [position-none]. At this point the system looks like figure 8.3. The shaded boxes correspond to the two-input nodes of figure 8.1. After initialization, the system starts to fire rules. One of the early rules in the system will lead to the placing of the couch against a wall, for example the north wall. This update will cause the removal of the token couch-1 with [position-none] from parts of the network not shown in the diagrams, and the addition of the token couch-1 with [position-wall/north] to the left memory of node #1 as shown in figure 8.4. This causes a cascading update of various left memories as shown in the rest of figure 8.4 and described below. Node #1 now has both left and right memories filled in, so the system tries to combine the one new memory term with the four right memory terms. There is one successful combination with the wall-north token, so a new token is built from the two and passed to the two successor nodes of node #1. The new token is: [couch-1 with [position-wall/north], wall-north with [opposite-south] ] This token is stored in the left memories of both successors, node #2 and node #3. There is no right memory in node #3, so nothing more happens there, but there is right memory in node #2 which does match the input token. Therefor a new token is constructed and sent to the successor of node #2. The new token is: [couch-1 with [position-wall/north], wall-north with [opposite-south], tv-2 with [position-none, place_on-floor] ] The token is sent to the successor which is rule #f3. The token is the binding of the left side of the rule, and leads to variable bindings on the right side of the rule. This is a full instantiation of the rule and is added to the conflict set. When the rule is fired, the action on the right side causes the position of the tv to be updated. update ( tv-2 with [position-wall/south] )
- 104 -
Figure 8.4. The cascading effect of positioning the couch
This update causes two tokens to be sent through the network. One is a delete token for tv-2 with [positionnone], and the other is an add token for tv-2 with [position-wall/south]. The delete causes the removal of the token from the right memory of node#2. The add would not match any patterns in this segment of the network.
Performance Improvements
The Rete network provides a number of performance improvements over a simple matching of rules to working memory: • The root nodes act as indices into the network. Only those nodes which are affected by an update to working memory are processed. • The patterns which have been successfully matched are saved in the node left and right memories. They do not have to be reprocessed. • When rules share common sequences of patterns, that information is stored only once in the network, meaning it only has to be processed once.
- 105 -
• The output of the network is full rule instantiations. Once an instantiation is removed from the conflict set (due to a rule firing) it will not reappear on the conflict set, thus preventing multiple firings of the rule. Next, let's look at the code to build a Rete pattern matcher. First we will look at the data structures used to define the Rete network, then the pattern matcher which propagates tokens through the network, and finally the rule compiler which builds the network from the rules.
8.3 The Rete Graph Data Structures
The roots of the network are based on the frame patterns from the rules. The root nodes are represented as: root(NID, Pattern, NextList). NID is a generated identification for the node, Pattern is the frame pattern, and NextList is the list of succesor nodes which use the Pattern. NextList serves as the pointers connecting the network together. For example: root(2, wall-W with [opposite-OW], [1-r]). The two-input nodes of the network have terms representing the patterns which are matched from the left and right inputs to the node. Together they form the template which determines if particular tokens will be successfully combined into rule instantiations. The format of this structure is: bi(NID, LeftPattern, RightPattern, NextList).
Figure 8.5 Major predicates which propagate a token through the network
NID again is an identification. LeftPattern is the list of frame patterns that have been matched in nodes previous to this one. RightPattern is the new frame pattern which will be appended to the LeftPattern. NextList contains a list of successor nodes. For example: bi(1, [couch-C with [position-wall/W]], [wall-W with [opposite-OW], [2-l, 3-l]).
- 106 -
bi(2, [couch-C with [position-wall/W], wall-W with [opposite-OW]], [tv-TV with [position-none, place_on-floor]], [rule(f3)]). The end of the network is rules. The rules are stored as: rul(N, LHS, RHS). N is the identification of the rule. LHS is the list of frame patterns which represent the full left hand side of the rule. RHS is the actions to be taken when the rule is instantiated.
8.4 Propagating Tokens
Tokens are generated from the updates to frame instances. There are only two update predicates for the network, addrete which adds tokens, and delrete which deletes them. Both take as input the Class, Name, and TimeStamp of the frame instance. Both are called from the Foops predicates which update working memory: assert_ws, retract_ws, and update_ws. The major predicates of addrete are shown in figure 8.5. The addrete predicate uses a simple repeat - fail loop to match the frame instance against each of the root nodes. It looks like: addrete(Class, Name, TimeStamp) :root(ID, Class-Name with ReqList, NextList), ffsend(Class, Name, ReqList, TimeStamp, NextList), fail. addrete(_, _, _). The ffsend predicate fullfills the request pattern in the root by a call to the frame system predicate, getf. This fills in the values for the pattern thus creating a token. Next, send is called with an add token. ffsend(Class, Name, ReqList, TimeStamp, NextList) :getf(Class, Name, ReqList), send(tok(add, [(Class-Name with ReqList)/TimeStamp]), NextList), !. The delrete predicate is analagous, the only difference being it sends a delete token through the network. delrete(Class, Name, TimeStamp) :root(ID, Class-Name with ReqList, NextList), delr(Class, Name, ReqList, TimeStamp), fail. delrete(_, _, _). delr(Class, Name, ReqList, TimeStamp) :getf(Class, Name, ReqList), !, send(tok(del, [(Class-Name with ReqList)/TimeStamp]), NextList). delr(Class, Name, ReqList, TimeStamp). Predicate send passes the token to each of the successor nodes in the list: send(_, []).
- 107 -
send(Token, [Node|Rest]) :sen(Node, Token), send(Token, Rest). The real work is done by sen. It has to recognize three cases: • The token is being sent to a rule. In this case, the rule must be added to or deleted from the conflict set. • The token is being sent to the left side of a two-input node. In this case, the token is added to or deleted from the left memory of the node. The list is then matched against the right memory elements to see if a larger token can be built and passed through the network. • The token is being sent to the right side of a node. In this case, the token is added to or deleted from the right memory of the node. It is then compared against the left memory elements to see if a larger token can be built and passed through the network. In Prolog: sen(rule-N, tok(AD, Token)) :rul(N, Token, Actions), (AD = add, add_conflict_set(N, Token, Actions); AD = del, del_conflict_set(N, Token, Actions)), !. sen(Node-l, tok(AD, Token)) :bi(Node, Token, Right, NextList), (AD = add, asserta( memory(Node-l, Token) ); AD = del, retract( memory(Node-l, Token) )), !, matchRight(Node, AD, Token, Right, NextList). sen(Node-r, tok(AD, Token)) :bi(Node, Left, Token, NextList), (AD = add, asserta( memory(Node-r, Token) ); AD = del, retract( memory(Node-r, Token) )), !, matchLeft(Node, AD, Token, Left, NextList). Note how Prolog's unification automatically takes care of variable bindings between the patterns in the node memory, and the instance in the token. In sen, the instance in Token is unified with one of the right or left patterns in bi, automatically causing the opposite pattern to become instantiated as well (or else the call to bi fails and the next bi is tried). This instantiated Right or Left is then sent to matchRight or matchLeft respectively. Both matchRight and matchLeft take the instantiated Right or Left and compare it with the tokens stored in the right or left working memory associated with that node. If unification is successful, a new token is built by appending the right or left from the memory with the original token. The new token is then passed further with another call to send. matchRight(Node, AD, Token, Right, NextList) :memory(Node-r, Right), append(Token, Right, NewTok), send(tok(AD, NewTok), NextList), fail. matchRight(_, _, _, _, _). matchLeft(Node, AD, Token, Left, NextList) :memory(Node-l, Left), append(Left, Token, NewTok),
- 108 -
send(tok(AD, NewTok), NextList), fail. matchLeft(_, _, _, _, _). Another type of node which is useful for the system handles the cases where the condition on the LHS of the rule is a test such as L > R, or member(X, Y), rather than a pattern to be matched against working memory. The test nodes just perform the test and pass the tokens through if they succeed. There is no memory associated with them. A final node to make the system more useful is one to handle negated patterns in rules. It works as a normal node, keeping instances in its memory which match the pattern in the rule, however it only passes on tokens which do not match.
8.5 The Rule Compiler
The rule compiler builds the Rete network from the rules. The compiler predicates are not as straight forward as the predicates which propagate tokens through the network. This is one of the rare cases where the power of Prolog's pattern matching actually gets in the way, and code needs to be written to overcome it. The very unification which makes the pattern matching propagation predicates easy to code gets in the way of the rule compiler. We allow variables in the rules, which behave as normal Prolog variables, but when the network is built, we need to know which rules are matching variables and which are matching atoms. For example, one rule might have the pattern wall/W and another might have wall/east. These should generate two different indices when building the network, but Prolog would not distinguish between them since they unify with each other. In order to distinguish between the variables and atoms in the frame patterns, we must pick the pattern apart first, binding the variables to special atoms as we go. Once all of the variables have been instantiated in this fashion, the patterns can be compared. But first, let's look at the bigger picture. Each rule is compared, frame pattern by frame pattern, against the network which has been developed from the rules previously processed. The frame patterns of the rule are sent through the network in a similar fashion to the propagation of tokens. If the frame patterns in the rule are accounted for in the network, nothing is done. If a pattern is not in the network, then the network is updated to include it. The top level predicate for compiling rules into a Rete net, reads each rule and compiles it. The major predicates involved in compiling rules into a Rete network are shown in figure 8.6. rete_compil :rule N# LHS ==> RHS, rete_comp(N, LHS, RHS), fail. rete_compil.
- 109 -
Figure 8.6 The major predicates for compiling rules into a Rete network
The next predicate, rete_comp, looks at the first frame pattern in the rule and determines if it should build a new root node or if one already exists. It then passes the information from the root node and the rest of the rule left hand side to retcom which continues traversing and/or building the network. rete_comp(N, [H|T], RHS) :term(H, Hw), check_root(RN, Hw, HList), retcom(root(RN), [Hw/_], HList, T, N, RHS), !. rete_comp(N, _, _) . The term predicate merely checks for shorthand terms of the form Class-Name and replaces them with the full form Class-Name with []. Terms already in full form are left unchanged. term(Class-Name, Class-Name with []). term(Class-Name with List, Class-Name with List). The check_root predicate determines if there is already a root node for the term, and if not creates one. It will be described in detail a little later. The third argument from check_root is the current list of nodes linked to this root. The last goal is to call retcom, which is the main recursive predicate of the compilation process. It has six arguments, as follows: PNID the id of the previous node OutPat pattern from previous node PrevList successor list from previous node [H|T] list of remaining frame patterns in rule N rule ID, for building the rule at the end RHS RHS of the rule, for building the rule at the end There are two cases recognized by retcom: • All of the frame patterns in the rule have been compiled into the network, and all that is left is to link the full form of the rule to the network. • The rule frame patterns processed so far match an existing two-input node, or a new one is created. In Prolog, the first case is recognized by having the empty list as the list of remaining frame patterns. The rule is built, and update_node is called to link the previous node to the rule. retcom(PNID, OutPat, PrevList, [], N, RHS) :build_rule(OutPat, PrevList, N, RHS), update_node(PNID, PrevList, rule-N), !. In the second case, the frame pattern being worked on (H) is first checked to see if it has a root node. Then the network is checked to see if a two-input node exists whose left input pattern matches the rule patterns processed so far (PrevNode). Either node might have been found or added, and then linked to the rest of the network.
- 110 -
retcom(PNID, PrevNode, PrevList, [H|T], N, RHS) :term(H, Hw), check_root(RN, Hw, HList), check_node(PrevNode, PrevList, [Hw/_], HList, NID, OutPat, NList), update_node(PNID, PrevList, NID-l), update_root(RN, HList, NID-r), !, retcom(NID, OutPat, NList, T, N, RHS). Building rules is simply accomplished by writing a new rule structure: build_rule(OutPat, PrevList, N, RHS) :assertz( rul(N, OutPat, RHS) ). The check_root predicate is the first one that must deal with the pattern matching problem mentioned earlier. It covers three cases: • There is no existing root which matches the term using Prolog's pattern matching. In this case a new root is added. • There is an existing root which matches the term, atom for atom, variable for variable. In this case no new root is needed. • There is no precise match and a new root is created. In Prolog: check_root(NID, Pattern, []) :not(root(_, Pattern, _)), gen_nid(NID), assertz( root(NID, Pattern, []) ), !. check_root(N, Pattern, List) :asserta(temp(Pattern)), retract(temp(T1)), root(N, Pattern, List), root(N, T2, _), comp_devar(T1, T2), !. check_root(NID, Pattern, []) :gen_nid(NID), assertz( root(NID, Pattern, []) ). The first clause is straight forward. The gen_nid predicate is used to generate unique numbers for identifying nodes in the Rete network. The second clause is the difficult one. The first problem is to make a copy of Pattern which Prolog will not unify with the original term. The easiest way is to assert the term and then retract it using a different variable name, as the first two goals of the second clause do. We now have both Pattern and T1 as identical terms, but Prolog doesn't know they are the same and will not bind the variables in one when they are bound in the other. We can now use Pattern to find the root which matches it, using Prolog's match. Again, not wishing to unify the variables, we call the root again using just the root identification. This gives us T2, the exact pattern in the root before unification with Pattern. Now we have T1 and T2, two terms which we know will unify in Prolog. The problem is to see if they are also identical in their placement of variables. For this we call comp_devar which compares two terms after unifying all of the variables with generated strings.
- 111 -
A very similar procedure is used for check_node. It is a little more complex in that it needs to build and return the tokens that are the two inputs to a node. The arguments to check_node are: PNode token list from previous node PList list of successor nodes from previous node H new token being added HList successor nodes from root for token H NID returned ID of the node OutPat returned tokenlist from the node NList returned list of successor nodes from the node The clauses for check_node are: check_node(PNode, PList, H, HList, NID, OutPat, []) :not (bi(_, PNode, H, _)), append(PNode, H, OutPat), gen_nid(NID), assertz( bi(NID, PNode, H, []) ), !. check_node(PNode, PList, H, HList, NID, OutPat, NList) :append(PNode, H, OutPat), asserta(temp(OutPat)), retract(temp(Tot1)), bi(NID, PNode, H, NList), bi(NID, T2, T3, _), append(T2, T3, Tot2), comp_devar(Tot1, Tot2), check_node(PNode, PList, H, HList, NID, OutPat, []) :append(PNode, H, OutPat), gen_nid(NID), assertz( bi(NID, PNode, H, []) ). The update predicates check to see if the new node is on the list of links from the old node. If so, nothing is done. Otherwise a new link is added by putting the new node id on the list. update_root(RN, HList, NID) :member(NID, HList), !. update_root(RN, HList, NID) :retract( root(RN, H, HList) ), asserta( root(RN, H, [NID|HList]) ). update_node(root(RN), HList, NID) :update_root(RN, HList, NID), !. update_node(X, PrevList, NID) :member(NID, PrevList), !. update_node(PNID, PrevList, NID) :retract( bi(PNID, L, R, _) ), asserta( bi(PNID, L, R, [NID|PrevList]) ).
- 112 -
The comp_devar predicate takes each term it is comparing, and binds all the variables to generated terms. comp_devar(T1, T2) :del_variables(T1), del_variables(T2), T1=T2. The del_variables predicate is used to bind the variables. The function which generates atoms to replace the variables is initialized the same way each time it is called, so if T1 and T2 have the same pattern of variables, they will be replaced with the same generated atoms and the terms will be identical. del_variables(T) :init_vargen, de_vari(T). The basic strategy is to recognize the various types of structures and break them into smaller components. When a component is identified as a variable, it is unified with a generated atom. First, de_vari looks at the case where the terms are lists. This is used for comparing token lists in check_node. It is a standard recursive predicate which removes the variables from the head of the list, and recursively calls itself with the tail. Note that unification will cause all occurances of a variable in the head of the list to be bound to the same generated atom. The third clause covers the case where the term was not a list. de_vari([]). de_vari([H|T]) :de_var(H), de_vari(T). de_vari(X) :- de_var(X). The first clause of de_var removes the time stamps from consideration. The next two clauses recognize the full frame pattern structure, and the attribute-value pair structure respectively. de_var(X/_) :- de_var(X). de_var(X-Y with List) :de_v(X-Y), de_vl(List), !. de_var(X-Y) :de_v(X-Y), !. The next predicates continue to break the structures apart until finally d_v is given an elementary term as an argument. If the term is a variable, an atom is generated to replace it. Otherwise the term is left alone. Due to Prolog's unification, once one instance of a variable is unified to a generated term, all other instances of that variable are automatically unified to the same generated term. Thus, the generated atoms follow the same pattern as the variables in the full term. de_vl([]). de_vl([H|T]) :de_v(H), de_vl(T). de_v(X-Y) :d_v(X), d_v(Y).
- 113 -
d_v(V) :var(V), var_gen(V), !. d_v(_). The next two predicates are used to generate the variable replacements. They are of the form '#VAR_N', where N is a generated integer. In this case two built-in predicates of AAIS Prolog are used to convert the integer to a string and concatenate it to the rest of the form of the variable. The same effect could be achieved with the standard built-in, name, and a list of ASCII characters representing the string. init_vargen :abolish(varg, 1), asserta(varg(1)). var_gen(V) :retract(varg(N)), NN is N+1, asserta(varg(NN)), int2string(N, NS), stringconcat("#VAR_", NS, X), name(V, X). The system only handles simple rules so far, and does not take into account either negations or terms which are tests, such as comparing variables or other Prolog predicate calls. Nodes to cover tests are easily added. They are very similar to the normal two-input nodes, but do not have memory associated with them. The left side is a token list just as in the two-input nodes. The right side has the test pattern. If a token passes the test, a new token with the test added is passed through the network. The negated patterns store a count with each pattern in the left memory. That count reflects the number of right memory terms which match the left memory term. Only when the count is zero, is a token allowed to pass through the node.
8.6 Integration with Foops
Only a few changes have to be to Foops to incorporate the Rete network developed here. A compile command is added to the main menu that builds the Rete network. It is called after the load command. The commands to update working memory are modified to propagate tokens through the Rete network. This means calls to addrete and delrete as appropriate. The refraction logic, which ensured the same instantiation would not be fired twice, is removed since it is no longer necessary. The predicate which builds the conflict set is removed since the conflict set is maintained by the predicates which process the network. The predicates which sort the conflict set are still used to select a rule to fire.
8.7 Design Tradeoffs
There are a number of design tradeoffs made in this version. The first is the classic space versus speed tradeoff. At each Rete memory, a full copy of each token is saved. This allows it to be retrieved and matched quickly during execution. Much space could be saved by only storing pointers to the working memory elements. These would have to be retrieved and the token reconstructed when needed.
- 114 -
The other tradeoff is with the flexibility of the frame system. With the frames in the original Foops, the frame patterns in the rules could take advantage of inheritance and general classes as in the rules which determined a need for electrical plugs in a room. Since Rete-Foops instantiates the patterns before propagating tokens through the network, this does not work. This feature could be incorporated but would add to the burden and complexity of maintaining the network.
8.1 - Implement nodes which support rules which have tests such as X > Y, and negated frame patterns. 8.2 - The implementation described in this chapter makes heavy use of memory by storing the full tokens in left and right memories. Build a new system in which space is saved by storing a single copy of the token and having pointers to it in left and right memory. The stored tokens just match single frame patterns. The complex tokens in the middle of the network contain lists of pointers to the simple tokens. 8.3 - Experiment with various size systems to see the performance gains of the Rete version of Foops. 8.4 - Figure out a way to allow Rete-Foops to use inheritance in frame patterns. That is, fix it so the rule which finds electric plugs works. 8.5 - Build an indexed version of Clam and make performance experiments with it.
- 115 -
9 User Interface
The user interface issues for expert system shells can be divided between two classes of users and two different levels. The two users are the developer and the end-user of the application. The levels are the external interface and the internal function. For the developer, the internal function must be adequate before the external interface becomes a factor. To build a configuration application, an easy-to-use backward chaining system is not as good as a hard-to-use forward chaining system. To build a large configuration system, an easy-to-use, low performance forward chaining system is not as good as a hard-to-use, high performance forward chaining system. The same is true for the end-user. While there is increasing awareness of the need for good external interfaces, it should not be forgotten that the internal function is still the heart of an application. If a doctor wants a diagnostic system to act as an intelligent assistant and instead it acts as an all knowing guru, then it doesn't matter how well the external interface is designed. The system will be a failure. If a system can save a company millions of dollars by more accurately configuring computers, then the system will be used no matter how poor the external interface is. Given a system meets the needs of both the developer and the end-user, then the external interface becomes an essential ingredient in the satisfaction with the system. The systems developed so far have used a command driven, dialog type user interface. Increasingly windows, menus, and forms are being used to make interfaces easier to understand and work with. This chapter describes how to build the tools necessary for developing good user interfaces.
9.1 Object Oriented Window Interface
One of the major difficulties with computer languages in general, and Prolog in particular, is the lack of standards for user interface features. There are emerging standards, but there is still a long way to go. The windowing system described here includes a high-level, object oriented interface for performing common window, menu, and form operations which can be used with any Prolog or computer. The low level implementation will vary from Prolog to Prolog, and computer to computer. The interface is object oriented in that each window, menu, and form in the system is considered to be a "window-object" which responds to messages requesting various behaviors. For example, a display window would respond to "write" messages, and both a menu and prompt window would respond to a "read" message. The developer using the system defines window-objects to be used in an application and then uses a single predicate, window, to send messages to them. The system can be easily extended to include new messages, and window-objects. For example, graphics can be included for systems which support it.
9.2 Developer's Interface to Windows
The windows module provides for overlapping windows of four basic flavors. display An output only window. The user may scroll the window up and down using the cursor keys. menu A pop-up vertical menu. form A fill in the blanks form. prompt A one line input window. The programmer creates the various windows by specifying their attributes with a create message. Other window messages are used to open, close, read, or write the window.
- 116 -
All of the window operations are performed with the predicate window. It can either be specified with two or three arguments depending on whether the message requires an argument list. The arguments are: the window-object name or description, the operation to be performed (message), the arguments for the operation (optional). For example, the following Prolog goals cause: a value to be selected from a main menu, a value to be written to a display window, and a useless window to be closed: window(main_menu, read, X). window(listing, write, 'Hello'). window(useless, close). A window description is a list of terms. The functors describe the attribute, and the arguments are the value(s). Some of the attributes used to define a window are: type(T) - type of window (display, prompt, menu, or form), coord(R1, C1, R2, C2) - the upper left and lower right coordinates of useable window space, border(Color) - the border color, contents(Color) - the color of the contents of the window. The following two attributes are used to initialize menus and forms: menu(List) - List is a list of menu items. form(Field_List) - Field_List defines the fields in the form. The field may be either a literal or a variable. The two formats are: lit(Row:Col, Literal), var(FieldName, Row:Col, Length, InitialValue). Some examples of window descriptions are: [type(display), coord(2, 3, 10, 42), border(white:blue), contents(white:blue)] [type(menu), coord(10, 50, 12, 70), border(bright:green), menu(['first choice', 'second choice', 'third choice', 'fourth choice'])] [type(form), coord(15, 34, 22, 76), border(blue), form([lit(2:2, 'Field One'), var(one, 2:12, 5, ''), lit(4:2, 'Field Two'), var(two, 4:12, 5, 'init')])] The first argument of each window command refers to a window-object. It may either be the name of a created window, or a window description. If a description is used, the window is created and used only for the duration of the command. This is useful for pop up menus, prompts and forms. Created windows are more permanent.
- 117 -
Some of the messages which can be sent to windows are: window(W, create, Description) - stores the Description with the name W; window(W, open) - opens a window by displaying it as the current top window (usually not necessary since most messages open a window first); window(W, close) - closes the window by removing the viewport from the screen while preserving the contents (for later re-opening); window(W, erase) - closes the window, and erases the contents as well; window(W, display, X) - writes the term X to the window. To use the windows to improve the user interface of a simple expert system shell, the main menu can be made a pop-up menu. The text for questions to the user can appear in one window, and the user can respond using popup menus or prompt windows. The advice from the system can appear in another window.
Figure 9.1. Main menu
First, the permanent windows are created during the initialization phase. The descriptions are stored in Prolog's database with the window name for use when the window is referenced. The windows for a simple interface include the main menu, the window for advice, and the window for questions to the user: window_init:window(wmain, create, [type(menu), coord(14, 25, 21, 40), border(blue), contents(yellow), menu(['Load', 'Consult', 'Explain', 'Trace', 'Quit'])]), window(advice, create, [type(display), coord(1, 1, 10, 78), border(blue:white), contents(blue:white)]), window(quest, create, [type(display), coord(13, 10, 13, 70), border(blue:white), contents(blue:white)]). The main loop then uses the main menu: go :repeat, window(wmain, read, X),
- 118 -
do(X), fail. The user sees a menu as in figure 9.1. The cursor keys move the highlighting bar, and the enter key selects a menu item. The ask and menuask predicates in the system use the windows to get information from the user. First ask writes the text of the question to the quest window, and then generates a pop-up prompt: ask(A, V) :window(quest, write, A), window([type(prompt), coord(16, 10, 16, 70), border(white:blue), contents(white:blue)], read, ['', Y]), asserta(known(A, Y)), ... The menuask predicate also writes the text of the question to the quest window, but then dynamically builds a pop-up menu, computing the size of the menu from the length of the menu list: menuask(Attribute, AskValue, Menu):length(Menu, L), R1 = 16, R2 is R1 + L - 1, window(quest, write, Attribute), window([type(menu), coord(R1, 10, R2, 40), border(white:blue), contents(white:blue), menu(Menu)], read, Value), asserta(known(Attribute, Value)), ... Figure 9.2 shows how a simple window interface would look with the Birds expert system.
Figure 9.2. Window interface for dialog with Birds system
9.3 High-Level Window Implementation
The window module is constructed in layers. The top layer can be used with any Prolog. The lower layers have the actual implementations of the windows and vary from system to system. The detailed examples will come from a Macintosh based Prolog (AAIS) using a rich user interface toolbox, and a PC based Prolog (Arity) using simple screen primitives.
- 119 -
Message Passing
At the top level, the interface is object oriented. This means messages are sent to the individual windows. One feature of object oriented systems is messages are dispatched at run time based on the class of object. For example, the read message applies to both the prompt windows and the menu windows, but the implementation is different in each case. The implementations are called methods. The window predicate must determine what type of window is receiving the message, and what the correct method to call is: window(W, Op, Args):get_type(W, T), find_proc(T, Op, Proc), P =.. [Proc, W, Args], call(P), !. The get_type predicate finds the type of the window, find_proc gets the correct method to call, and univ (=..) is used to call it. When window is called with a window description as the first argument, it creates a temporary window, sends the message to it, and then deletes it. A two argument version of window is used to capture calls with no arguments. window([H|T], Op, Args):window(temp_w, create, [H|T]), window(temp_w, Op, Args), window(temp_w, delete), !. window(W, Op) :- window(W, Op, []). The get_type predicate uses select_parm to find the value for the type attribute of the window. It uses the stored window definition. get_type(W, X):- select_parm(W, [type(X)]), !. Window definitions are stored in structures of the form: wd(W, AttributeList).
Another feature of object oriented systems is inheritance of methods. The objects are arranged in a class hierarchy, and lower level objects only have methods defined for them which are different from the higher level methods. In the window program, type(window) is the highest class, and the other types are subclasses of it. A predicate such as close is only defined for the window superclass and not redefined for the subclasses. This makes it easy to add new window types to the system. The new types can inherit many of the methods of the existing types. The classes are represented in Prolog using a subclass predicate: subclass(window, display). subclass(window, menu). subclass(window, form). subclass(window, prompt). The methods are associated with classes by a method predicate. Some of the defined methods are:
- 120 -
method(window, open, open_w). method(window, close, close_w). method(window, create, create_w). method(window, display, display_w). method(window, delete, delete_w). method(display, write, write_d). method(display, writeline, writeline_d). method(menu, read, read_m). method(form, read, read_f). method(prompt, read, read_p). The find_proc predicate is the one that looks for the correct method to call for a given message and a given window type. find_proc(T, Op, Proc):- find_p(T, Op, Proc), !. find_proc(T, Op, Proc):error([Op, 'is illegal operation for a window of type', T]). find_p(T, Op, Proc):- method(T, Op, Proc), !. find_p(T, Op, Proc):subclass(Super, T), !, find_p(Super, Op, Proc). This completes the definition of the high level interface, with the exception of the one utility predicate, select_parm. It is used by get_type to find the value of the type attribute, but is also heavily used by the rest of the system to find attributes of windows, such as coordinates. It has the logic built into it to allow for calculated attributes, such as height, and attribute defaults. It is called with a request list of the desired attributes. For example, to get a window's coordinates, height, and color: select_parm(W, [coord(R1, C1, R2, C2), height(H), color(C)]). The select_parm predicate gets the windows attribute list, and calls the fulfill predicate to unify the variables in the request list with the values of the same attributes in the window definition. select_parm(W, RequestList):wd(W, AttrList), fulfill(RequestList, AttrList), !. The fulfill predicate recurses through the request list, calling w_attr each time to get the value for a particular attribute. fulfill([], _):-!. fulfill([Req|T], AttrList):w_attr(Req, AttrList), !, fulfill(T, AttrList).
- 121 -
The w_attr predicate deals with three cases. The first is the simple case that the requested attribute is on the list of defined attributes. The second is for attributes that are calculated from defined attributes. The third sets defaults when the first two fail. Here are some of the w_attr clauses: w_attr(A, AttrList):member(A, AttrList), !. % calculated attributes w_attr(height(H), AttrList):w_attr(coord(R1, _, R2, _), AttrList), H is R2 - R1 + 1, !. w_attr(width(W), AttrList):w_attr(coord(_, C1, _, C2), AttrList), W is C2 - C1 + 1, !. % default attributes w_attr(title(''), _). w_attr(border(white), _). w_attr(contents(white), _). w_attr(type(display), _).
9.4 Low-Level Window Implementation
In addition to being a powerful language for artificial intelligence applications, Prolog is good at implementing more standard types of programs as well. Since most programs can be specified logically, Prolog is a very efficient tool. While we will not look at all the details in this chapter, a few samples from the low-level implementation should demonstrate this point. An entire overlapping window system with reasonable response time was implemented 100% in Prolog using just low-level screen manipulation predicates. The first example shows predicates which give the user control over a menu. They follow very closely the logical specification of a menu driver. A main loop, menu_select, captures keystrokes, and then there are a number of rules, m_cur, governing what to do when various keys are hit. Here is the main loop for the Arity Prolog PC implementation: menu_select(W, X):select_parm(W, [coord(R1, C1, R2, _), width(L), attr(A)]), tmove(R1, C1), % move the cursor to first item revideo(L, A), % reverse video first item repeat, keyb(_, S), % read the keyboard m_cur(S, Z, w(W, R1, R2, C1, L, A)), %usually fails !, Z = X. Here are four of the menu rules covering the cases where: the down arrow (scan code of 80) is hit (highlight the next selection); the down arrow is hit at the bottom of the menu (scroll the menu); the home key (scan code of 71) is hit (go to the top); and the enter key (scan code of 28) is hit (finally succeed and select the item). m_cur(80, _, w(W, R1, R2, C1, L, A)):- % down arrow tget(R, _), R < R2, normvideo(L, A), RR is R + 1, tmove(RR, C1),
- 122 -
revideo(L, A), !, fail. m_cur(80, _, w(W, R1, R2, C1, L, A)):- % bottom down arrow tget(R, _), R >= R2, normvideo(L, A), scroll_window(W, 1), tmove(R2, C1), revideo(L, A), !, fail. m_cur(71, _, w(W, R1, R2, C1, L, A)):- % home key normvideo(L, A), scroll_window(W, top), tmove(R1, C1), revideo(L, A), !, fail. m_cur(28, X, w(W, R1, R2, C1, L, A)):- % enter key tget(R, _), select_stat(W, curline, Line), % current line Nth is Line + R - R1, getnth(W, Nth, X), normvideo(L, A), !. Here is some of the code that deals with overlapping windows. When a window is opened, the viewport, which is the section of the screen it appears in, is initialized. The system maintains a list of active windows, where the list is ordered from the top window to the bottom. In the case covered here, the window to be opened is already on the active list, but not on the top. make_viewport(W):retract(active([H|T])), save_image(H), split(W, [H|T], L1, L2), w_chkover(W, L1, _), append([W|L1], L2, NL), assert(active(NL)). The save_image predicate stores the image of the top window for redisplay if necessary. The split predicate is a list utility which splits the active list at the desired window name. Next, w_chkover decides if the window needs to be redrawn due to overlapping windows on top of it, and then a new active list is constructed with the requested window on top. The w_chkover predicate recurses through the list of windows on top of the requested window, checking each one for the overlap condition. If any window is overlapping, then the requested window is redrawn. Otherwise nothing needs to be done. w_chkover(W, [], no). w_chkover(W, [H|T], Stat):w_nooverlap(W, H), w_chkover(W, T, Stat). w_chkover(W, _, yes):restore_image(W), !. An overlap is detected by simply comparing the coordinates of the two windows.
- 123 -
w_nooverlap(Wa, Wb):select_parm(Wa, [coord(R1a, C1a, R2a, C2a)]), select_parm(Wb, [coord(R1b, C1b, R2b, C2b)]), (R1a > R2b + 2; R2a < R1b - 2; C1a > C2b + 2; C2a < C1b - 2), !. As opposed to the PC implementation which requires coding to the detail level, the Macintosh implementation uses a rich toolbox of primitive building blocks. However, the complexity of the toolbox sometimes makes it more difficult to perform simple operations. For example, the make a new window in the PC version, all that is necessary is to save the window definition: make_window(W, Def):asserta( wd(W, Def)). In the Macintosh version, a number of parameters and attributes must be set up to interface with the Macintosh environment. The code to create a new window draws heavily on a number of built-in AAIS Prolog predicates which access the Macintosh toolbox. make_window(W, L) :define(wd, 2), include([window, quickdraw, types, memory]), fulfill([coord(R1, C1, R2, C2), title(T), visible(V), procid(Pid), behind(B), goaway(G), refcon(RC)], L), new_record(rect, R), new_record(windowptr, WP), setrect(R, C1, R1, C2, R2), pname(T, Tp), newwindow(WP, R, Tp, V, Pid, B, G, RC, WPtr), asserta( wd(W, [wptr(WPtr)|L]) ). Notice that the special Macintosh window parameters are easily represented using the window attribute lists of the generic windows. The example above has attributes for goaway, a box the user can click to make a window go away, and refcon for attaching more sophisticated functions to windows. The select_parm predicate has intelligent defaults set for each of these parameters so the user does not have to worry about specifying them. w_attr(goaway(false), _). w_attr(refcon(0), _). The generic window interface we developed recognizes a few fundamental types of window. The Macintosh also has numerous window types. The w_attr predicate is used to calculate values for the Macintosh parameters based on the generic parameters. The user only sees the generic parameters. Internally, the Macintosh parameters are used. Here is how the internal routines get a value for the Macintosh based parameter wproc which controls the type of box the window is drawn in: w_attr(wproc(documentproc), L) :akindof(text, L), !. w_attr(wproc(dboxproc), L) :akindof(dialog, L), !. w_attr(wproc(plaindbox), L) :akindof(graph, L), !.
- 124 -
The akindof predicate checks type against the inheritance specified by the subclass predicate defined earlier. akindof(ST, L) :w_attr(type(T), L), subsub(ST, T), !. subsub(X, X). subsub(Y, X) :subclass(C, X), subsub(Y, C). As more toolboxes for user interface functions become available, such as Presentation Manager, the low level portions of this window package can be modified to take advantage of them. At the same time the simple object oriented high level interface described earlier can be maintained for easy application development and portability.
9.1 - Implement object oriented windows on the Prolog system you use. 9.2 - Add windowing interfaces to all of the expert system shells developed so far. 9.3 - Add controls as a window type. These are display windows that use a graphical image to represent a number. The easiest graphical control to implement is a thermometer in a text based system (such as the IBM PC in text mode). The controls can also contain digital readouts which is of course even easier to implement. 9.4 - Active images are controls which automatically display the contents of some variable in a system. For example, in the furniture placement system it would be interesting to have four controls which indicate the available space on each of the four walls. They can be elegantly implemented using the attached procedure in the add slot of the frames. Whenever a new value is added, the procedure sends it to the control window. (Note that add is called during update of the slot in this implementation.) 9.5 - In the windowing interface for the various shells, have trace information appear in a separate window. 9.6 - Add graphics windows to the system if your version of Prolog can support it. 9.7 - In the main control loop, recognize certain user actions as a desire to manipulate the windows. For example function keys might allow the user to pop various windows to the top. This would enable the system to keep trace information in one window which is overlapped by the main window. The user could access the other windows by taking the appropriate actions.
- 125 -
10 Two Hybrids
This chapter describes two similar expert systems which were developed at Cullinet Software, a large software vendor for IBM mainframes, VAXes, and PCs. The systems illustrate some of the difficulties in knowledge base design and show the different features needed in two seemingly very similar systems. Both expert systems were designed to set parameters for the mainframe database, IDMS/R, at a new user site. The parameters varied from installation to installation, and it was necessary to have an experienced field support person set them at the site. Since field support people are expensive, the expert systems were written to allow the customer to set the parameters, thus freeing the support person for more demanding tasks. The first, CVGEN, set the system generation (sysgen) parameters for the run time behavior of the system. This included such parameters as storage pool sizes, logging behavior, and restart procedures. These parameters had a serious effect on the performance of the system, and needed to be set correctly based on each site's machine configuration and application mix. The second, AIJMP, set all of the parameters which ran an automated installation procedure. This included parameters which determined which modules to include and how to build installation libraries. These parameters determined how the software would reside at the customer's site. The systems were built using a variation of the pure Prolog approach described earlier in the book. The inferencing parts of the system were separated from the knowledge base. It was surprising to find that even with two systems as similar as these, they both set parameters, the shell for one was not completely adequate for the other.
10.1 CVGEN
Various shells available on the PC were examined when CVGEN was built, yet none seemed particularly well suited for this application. The main difficulty centered around the nature of the dialog with the user. To a large degree, the expertise a field support person brought to a site was the ability to ask the right questions to get information from the systems programmers at the site, and the ability to judge whether the answers were realistic. To capture this expertise, the knowledge base had to be rich in its ability to represent the dialog with the user. In particular: • The system was designed to be used by systems programmers who were technically sophisticated, but not necessarily familiar with the parameters for IDMS/R. This meant fairly lengthy prompts were needed in the dialog with the user. • The input data had to be subjected to fairly complex validation criteria, which was often best expressed in additional sets of rules. A large portion of the field person's expertise was knowing what values made sense in a particular situation. • The output of the system had to be statements which were syntactically correct for IDMS/R. This meant the rules not only found values for parameters but built the statements as well. The first objective of the system was to gather the data necessary to set the parameters by asking meaningful questions of the systems programmer. This meant providing prompts with a fair amount of text. The next objective of the system was to validate the user's input data. The answers to the questions needed to be checked for realistic values. For example when asking for the desired number of simultaneous batch users, the answer had to be checked for reasonableness based on the size of machine. A similar objective was to provide reasonable default answers for most of the questions. As were the edit checks, the defaults were often based on the particular situation and required calculation using rules.
- 126 -
Given these objectives, the questioning facility needs to have the ability to call rule sets to compute the default before asking a question, and another rule set to validate the user's response. It also needs to be able to store questions which are up to a full paragraph of text. The knowledge base needs to be designed to make it easy for the experts to view the dialog, and the edit and default rules. The knowledge base also needs some pure factual information. The actual rules for inferencing were relatively simple. The system had a large number of shallow rules (the inference chains were not very deep) which were best expressed in backward chaining rules. The backward chaining was natural since the experts also tackled the problem by working backward from the goals of setting individual parameter values. Also, since the system was setting parameters, uncertainty was not an issue. The parameter was either set to a value or it wasn't. For this reason pure Prolog was used for the main rule base. Pure Prolog had the additional advantage of making it easy for the rules to generate IDMS/R syntax. The arguments to the parameter setting rules were lists of words in the correct syntax, with variables in the positions where the actual value of the parameter was placed. The rules then sought those values and plugged them into the correct syntax.
10.2 The Knowledge Base
The knowledge base is divided into six parts, designed to make it easy for the expert to examine and maintain it. These are: • main rules for the parameters; • rules for derived information; • questions for the user; • rules for complex validation; • rules for complex default calculations; • static information.
Rule for parameters
The rules for each parameter are stored in the knowledge base with the parameter name as the functor. Thus each parameter is represented by a predicate. The argument to the predicate is a list with the actual IDMS/R syntax used to set the parameter. Variables in the list are set by the body of the predicate. A separate predicate, parm, is used to hold the predicate names which represent parameters. Most knowledge bases are designed with askable information listed separately from the rules, as in the earlier examples in the book. In this case however, the experts wanted the relationship between user dialog and rules to be more explicit. Therefor the ask predicate is embedded in the body of a rule whenever it is appropriate. In the following example the parameter is ina which when set will result in a text string of the form INACTIVE INTERVAL IS X, where X is some time value. Some of the sub-goals which are derived from other rules are online_components and small_shop, whereas int_time_out_problems is obtained from the user. parm(ina). ina( ['INACTIVE INTERVAL IS', 60]):online_components, small_shop.
- 127 -
ina( ['INACTIVE INTERVAL IS', 60]):online_components, heavily_loaded. ina( ['INACTIVE INTERVAL IS', 60]):ask(initial_install, no), online_components, ask(int_time_out_problems, yes). ina( ['INACTIVE INTERVAL IS', 30]):online_components. Some parameters also have subparameters which must be set. The structure of the knowledge base reflects this situation: parm(sys). sys( ['SYSCTL IS', 'NO']):never. sys( ['SYSCTL IS', 'SYSCTL']):os_class(os). subprm(sys, dbn, [' DBNAME IS', 'NULL']):ask(initial_install, no), ask(multiple_dictionaries, yes), ask(db_name, null). subprm(sys, dbn, [' DBNAME IS', V1]):ask(initial_install, no), ask(multiple_dictionaries, yes), ask(db_name, V1), V1 \== null.
Rules for derived information
The next part of the knowledge base contains the level of rules below the parameter / subparameter level. These rules represent derived information. They read as standard Prolog. Here are a few examples: heavily_loaded:ask(heavy_cpu_utilization, yes), !. heavily_loaded:ask(heavy_channel_utilization, yes), !. mvs_xa:ask(operating_system, mvs), ask(xa_installed, yes), !. online_components:dc_ucf, !. online_components:ask(cv_online_components, yes), !.
- 128 -
Questions for the user
The next portion of the knowledge base describes the user interaction. Standard Prolog rules do not cover this case, so special structures are used to hold the information. Operator definitions are used to make it easy to work with the structure. The first two examples show some of the default and edit rules which are simple enough to keep directly in the question definition. quest abend_storage_size default 200 edit between( 0, 32767) prompt ['Enter the amount of storage, in fullwords, available', 'to the system for processing abends in the event', 'of a task control element (TCE) stack overflow.', 'Note that this resource is single threaded.']. quest abru_value default no edit member( [yes, no]) prompt ['Do you want the system to write a snap dump to the', 'log file when an external run unit terminates', 'abnormally?']. The next two rules require more complex edit and default rule sets to be called. The square brackets in the default field indicate there is a rule set to be consulted. In these examples, ed_batch_user will be called to check the answer to allowed_batch_users, and def_storage_cushion is used to calculate a default value for storage_cushion_size. quest allowed_batch_users default 0 edit ed_batch_user prompt ['How many concurrent batch jobs may access', 'the CV at one time?']. quest storage_cushion_size default [def_storage_cushion] edit between( 0, 16384) prompt ['How many bytes of storage cushion would', 'you like? When available storage is less than the', 'cushion no new tasks are started. A recommended', 'value has been calculated for you.'].
- 129 -
Default rules
The next two sections contain the rules which are used for edit and default calculations. For example, the following rules are used to calculate a default value for the storage cushion parameter. Notice that it in turn asks other questions and refers to the settings of another parameter, in this case the storage pool (stopoo). def_storage_cushion(CUS):ask(initial_install, yes), stopoo([_, SP]), PSP is SP / 10, min(PSP, 100, CUS), !. def_storage_cushion(V1):ask(total_buffer_pools, V2), stopoo([_, V3]), ask(maximum_tasks, V4), V1 is (V2 + V3 + 3) / (3 * V4), !.
Rules for edits
Here are the rules which are used to edit the response to the number of batch users. The user's response is passed as the argument and rules succeed or fail in standard Prolog fashion depending on the user's response. ed_batch_user(V1):V1 =< 2, !. ed_batch_user(V1):machine_size(large), V1 =< 10, !. ed_batch_user(V1):machine_size(medium), V1 =< 5, !. ed_batch_user(V1):machine_size(small), V1 =< 3, !.
Static information
The final section contains factual information. For example, here is a table of the MIPS ratings for various machines, and the rules used to broadly classify machines into sizes. mac_mips('4381-1', 1.7). mac_mips('4381-2', 2.3). mac_mips('3083EX', 3.7). mac_mips('3083BX', 6.0). mac_mips('3081GX', 12.2). mac_mips('3081KX', 15.5). mac_mips('3084QX', 28.5).
- 130 -
mips_size(M, tiny):M < 0.5, !. mips_size(M, small):M >= 0.5, M < 1.5, !. mips_size(M, medium):M >= 1.5, M < 10, !. mips_size(M, large):M >= 10. The knowledge base is designed to reduce the semantic gap between it and the way in which the experts view the knowledge. The main parameter setting rules are organized by parameter and subparameter as the expert expects. The secondary rules for deriving information, and the queries to the user are kept in separate sections. The dialog with the user is defined by data structures which act as specialized frames with slots for default routines and edit routines. Their definition is relatively simple since the frames are not general purpose, but designed specifically to represent knowledge as the expert describes it. The standard Prolog rule format is used to define the edit and default rules. In the knowledge base the rules are simple, so Prolog's native syntax is not unreasonable to use. It would of course be possible to utilize a different syntax, but the Prolog syntax captures the semantics of these rules exactly. The experts working with the knowledge base are technically oriented and easily understand the Prolog syntax. Finally, supporting data used by the system is stored directly in the knowledge base. It is up to the inference engine to make sense of this knowledge base.
10.3 Inference Engine
The inference is organized around the specialized knowledge base. The highest level predicates are set up to look for values for all of the parameters. The basic predicate set_parms accomplishes this. It uses the parm predicate to get parameter names and then uses the univ (=..) built-in function to build a call to a parameter setting predicate. set_parms:parm(Parm), set_parm(Parm), fail. set_parms:write('no more parms'), nl. set_parm(Parm):get_parm(Parm, Syntax), write(Parm), write(': '), print_line(Syntax), nl, subs(Parm). get_parm(Parm, Syntax):PS =.. [Parm, Syntax], call(PS), !. subs(Parm):subprm(Parm, Sub, Syntax), write(Parm), write('/'), write(Sub), write(':'), print_line(Syntax), nl,
- 131 -
subs(Sub), fail. subs(Parm):-true. The next portion of the inference engine deals with the questions to the user. The following operator definitions are used to define the data structure for questions. :-op(250, fx, quest). :-op(240, yfx, default). :-op(240, yfx, edit). :-op(240, yfx, prompt). The basic ask predicate follows the patterns used earlier, but is more complex due to the fact that it handles both attribute-value pairs and object-attribute-value triples. The implementation of triples is relatively straightforward and not worth repeating. The interesting portions of ask have to do with handling defaults and edits. The following code is used by the ask predicate to perform edits on a user response. It is called after the user enters a value. If the edit fails, the user is presented with an explanation for why the edit failed, and is reprompted for the answer. The third argument to edit is the edit criterion. It could be a simple edit such as member or less_than, or one of the more complex edit rules. The built-in univ (=..) is used to construct the goal which is called for the edit process. The actual code is slightly more complex due to additional arguments holding trace information for explanations. edit(X, X, none):-!. % passes, no edit criteria. edit(X, X, Ed) :Ed =.. [Pred | Args], Edx =.. [Pred, X | Args], call(Edx), !. edit(X, X, not(Ed)):Ed =.. [Pred | Args], Edx =.. [Pred, X | Args], notcall(Edx), !. The default is handled in a similar fashion. It is calculated before the prompt to the user, and is displayed in the answer window. Just hitting enter allows the user to take the default rather than entering a new value. default([], []):-!. default(D, D):atomic(D), !. default([D], X):P =.. [D, X], call(P).
10.4 Explanations
- 132 -
Explanations become a bit more difficult with the ask predicate. The how questions are handled pretty much as in the Clam and Native systems described earlier in the book. Since why traces require overhead during the inference process, and performance is a key issue for a system with a long dialog such as this one, the why trace implementation is different from that in Native. The basic strategy is to use pure Prolog as indicated for most of the inferencing, but to redo the inference using a Prolog in Prolog inference engine to answer why questions. In order to do this the system must in fact restart the inference, but since the parameters are all basically independent, the why trace need only restart from the last call to set a parameter. For this reason, the set_parm predicate writes a record to the database indicating which parameter is currently being set. Once the why trace gets into ask, the Prolog in Prolog must stop. In fact, the question might have arisen from setting a parameter, or calculating a default value, or specifying an edit criteria. Again, for these cases a flag is kept in the database so that trace knows the current situation. The why trace then starts at the beginning, traces pure Prolog inferencing until it encounters ask. The why explanation then notes that it is in ask, and finds out from the database if ask has gone into either default or edit. If so it proceeds to trace the default or edit code. The final explanation to the user has the Prolog traces interspersed with the various junctions caused by edit and default in ask. This system is a perfect example of one in which the explanations are of more use in diagnosing the system than in shedding light on an answer for the user. Many of the rules are based solely on empirical evidence, and reflect no understanding of underlying principles. For this reason a separate explanation facility was added to the knowledge base that would explain in English the rationale behind the setting of a particular parameter. For example, the setting of the maxeru parameter is relatively complex. The rule, while correct in figuring a value for the parameter, does not give much insight into it. The separate exp predicate in the knowledge base is displayed in addition to the rule if the user asks how a value of maxeru was derived. parm(maxeru). maxeru( ['MAXIMUM ERUS IS', MAXERU]):maxeru_potential(PMERU), max_eru_tas(F), MAXERUF is PMERU * F, MAXERU is integer(MAXERUF), explain(maxerutas01). exp(maxerutas01, ['MAXERUS and MAXTASKS are set together. They are ', 'both potentially set to values which are dictated by the size ', 'of the terminal network. The total tasks for both is then ', 'compared to the maximum realistic number for the ', 'machine size. If the total tasks is too high, both ', 'MAXERUS and MAXTASKS are scaled down ', 'accordingly.']).
10.5 Environment
CVGEN is also designed to handle many of the details necessary in a commercially deployed system. These details include the ability to change an answer to a question, save a consultation session and restore it, build and save test runs of the system, and the ability to list and examine the cache and the knowledge base from within a consultation. The system also includes a tutorial which teaches how to use the system. Most of these features are straight-forward to implement, however changing a response is a bit tricky. When the user changes an answer to a question, it is almost impossible to predict what effects that will have on the results. Whole new chains of inferencing might be triggered. The safest way to incorporate the change is to rerun the inference. By saving the user's responses to questions, the system avoids asking any questions previously asked. New questions might be asked due to the new sequence of rules fired after the change.
- 133 -
The facts which are stored are not necessarily the same as the user's response. In particular, the user response of "take the default" is different from the actual answer which is the default value itself. For this reason, both the facts and the user responses to questions are cached. Thus when the user asks to change a response, the response can be edited and the inference rerun without reprompting for all of the answers. This list of responses can also be used for building test cases which are rerun as the knowledge base is modified.
10.6 AIJMP
The AIJMP system seemed on the surface to be identical to the CVGEN system. Both set parameters. It was initially assumed that the shell used for CVGEN could be applied to AIJMP as well. While this was in general true, there were still key areas which needed to be changed. The differences have much to do with the nature of the user interaction. The CVGEN system fits very nicely into the classic expert system dialog as first defined in the MYCIN system. The system tries to reach goals and asks questions as it goes. However for AIJMP there is often the need for large amounts of tabular data on various pieces of hardware and software. For these cases a question and answer format becomes very tedious for the user and a form-based front end to gather information is much more appropriate. AIJMP uses forms to capture some data, and dialogs to ask for other data as needed. This led to the need to expand the basic inferencing to handle these cases. Another difficulty became evident in the nature of the expertise. Much of what was needed was purely algorithmic expertise. For example, part of the system uses formulas to compute library sizes based on different storage media. Many of the parameters required both rules of thumb and algorithmic calculations. The best solution to the problem, for the knowledge engineer, was to build into the inference engine the various predicates which performed calculations. This way they could be referred to easily from within the rules. Some of the declarative knowledge required for AIJMP could not be easily represented in rules. For example, many products depend on the existence of co-requisite products. When the user enters a list of products to be installed, it must be checked to make sure all product dependencies are satisfied. The clearest way to represent this knowledge was with specialized data structures. Operators are used to make the structures easy to work with. product 'ads batch 10.1' psw [adsb] coreqs ['idms db', 'i data dict']. product 'ads batch 10.2' psw [adsb] coreqs ['idms db', 'i data dict']. product 'ads online' psw [adso, nlin] coreqs ['idms db', 'idms cv', 'i data dict', 'idms dc' / 'idms ucf']. product auditor psw [audi, culp] coreqs []. product autofile psw [auto] coreqs []. The inference engine was enhanced to use this structure for co-requisite checking. The design goal is to make the knowledge base look as familiar as possible to the experts. With Prolog, it is not difficult to define specialized structures that minimize semantic gap and to modify the inference engine to use them.
- 134 -
One simple example of how the custom approach makes life easier for the expert and knowledge engineer is in the syntax for default specifications in the questions for the user. The manual on setting these parameters used the "@" symbol to indicate that a parameter had as its default the value of another parameter. This was a shorthand syntax well understood by the experts. In many cases the same value (for example a volume id on a disk) would be used for many parameters by default. Only a slight modification to the code allowed the knowledge to be expressed using this familiar syntax: quest loadunit default @ diskunit edit none prompt ['What is the unit for the load library?']. One of the major bottlenecks in expert system development is knowledge engineering. By customizing the knowledge base so it more closely matches the expert's view of the knowledge domain, the task becomes that much simpler. A simple change such as this one makes it easier for the expert and the knowledge base to interact.
10.7 Summary
These two systems show how some of the techniques in this book can be used to build real systems. The examples also show some of the difficulties with shells, and the advantages of customized systems in reducing semantic gap.
10.1 - Incorporate data structures for user queries with edits and defaults for the Clam shell. 10.2 - The CVGEN user query behavior can be built into Foops when a value is sought from the frame instances. If there is no other way to get the value, the user should be queried. Additional facets can be used for prompt, default, and edit criteria which the inference engine uses just like in CVGEN. 10.3 - Add features of CVGEN to the shells which are needed for real world applications. These include the ability to save user responses, allow editting of responses, saving a consultation, and rerunning a consultation. The last feature is essential for testing and debugging systems. Old test runs can be saved and rerun as the knowledge base changes. Hopefully the changes will not adversely affect the old runs.
- 135 -
11 Prototyping
Whether or not one is going to use Prolog to build a finished application, Prolog is still a powerful tool for prototyping the application. The problem might fit nicely into Clam or Foops in which case those systems should be used for the prototype, otherwise pure Prolog can be used to model the application. In an expert system prototype it is important to model all of the different types of knowledge that will be used in the application. Initial knowledge engineering should be focused on what types of information the expert uses and how it is used. The full range of expertise should be modelled, but not to the depth required for a real system. The Prolog rules used in a prototype can be quickly molded to get the desired effects in the application. The clean break between the inference engine and the knowledge base can be somewhat ignored to allow more rapid development of the prototype. Explanations, traces, and many of the other features of an expert system are left out of the prototype. The I/O is implemented simply to just give a feeling for the user interaction with the system. The full system can be more elegantly designed once the prototype has been reviewed by the potential users.
11.1 The Problem
This section describes the building of a prototype system which acts as an advisor for a mainframe software salesperson. A good sales person must not only be congenial and buy lunches, but must also have good product knowledge and know how to map that knowledge onto a potential customer's needs. The type of knowledge needed by the sales person is different from that typically held by a technical person. The technical person thinks of a product in terms of its features, and implementation details. The sales person must think of the prospect's real and perceived needs and be able to map those to benefits provided by the features in the product. That is, the sales person must understand the prospect's objectives and be able to present the benefits and features of the product that help meet those objectives. The salesperson must also have similar product knowledge about the competitor's products and know which benefits to stress that will show up the weaknesses in the competitor's product for the particular prospect. In addition to this product knowledge, the sales person also has rules for deciding whether or not the prospect is likely to buy, and recognizing various typical sales situations. With a large workload, it is often difficult for a sales person to keep up on product knowledge. An expert system which helps the sales person position the products for the prospect would be a big asset for a high tech sales person. The Sales Advisor system is a prototype of such a system, designed to help in the early stages of the sales cycle.
11.2 The Sales Advisor Knowledge Base
The ways in which sales people mentally organize product knowledge are fairly consistent. The knowledge base for the sales advisor should be organized in a format which is as close to the sales person's organization of the knowledge as possible. This way the semantic gap will be reduced and the knowledge base will be more easily maintained by a domain expert. The main types of knowledge used by the salesperson fall into the following categories: • Qualification - the way in which the salesperson determines if the prospect is a good potential customer and worth pursuing; • Objective Benefit Feature (OBF) analysis - the way a salesperson matches the customer's objectives with the benefits and features of the product;
- 136 -
• Competitive analysis - the way a salesperson decides which benefits and features to stress based on the competitor's weaknesses; • Situation analysis - the way a salesperson determines if the products will run in the prospect's shop. • Miscellaneous advice - various rules covering different situations which do not fall neatly in the above categories. Having this overall organization, we can now begin to prototype the system. The first step is to design the knowledge base. Simple Prolog rules can be used wherever possible. The knowledge for each area will be considered separately. The example uses the products sold for mainframe computers by Cullinet Software.
First we implement the knowledge for qualifying the prospect. This type of knowledge falls easily into a rule format. The final version will probably need some uncertainty handling as in Clam, but it is also important for this system to provide more text output than Clam provides. The quickest way to build the prototype is to use pure Prolog syntax rules with I/O statements included directly in the body of the rule. Clam can be used later with modifications for better text display. Two examples of qualifying rules are: the prospect must have an IBM mainframe, and the prospect's revenues must be at least $30 million. They are written as unqualified since if the prospect fails a test then it is unqualified. unqualified:not computer('IBM'), advise('Prospect must have an IBM computer'), nl. unqualified:revenues(X), X < 30, advise('Prospect is unlikely to buy IDMS with revenues under $30 million'), nl.
Objectives - Benefits - Features
Sales people typically store product knowledge in a tabular form called an objective-benefit-feature chart, or OBF chart. It categorizes product knowledge so that for each objective of the customer, the benefits of the product for meeting that objective, and the features of the product are detailed. For the prototype we can simplify the prospect objectives by considering three main ones: development of applications, building an information center, and building efficient production systems. Each prospect might have a different one of these objectives. The benefits of each product in the product line varies for each of these objectives. This information is stored in Prolog structures of three arguments called obf. The first argument is the feature (or product), the second is the customer objective, and the third is the benefit which is stressed to the prospect. obf('IDMS/R', development, 'IDMS/R separates programs from data, simplifying development.'). obf('IDMS/R', information, 'IDMS/R maintains corporate information for shared access.').
- 137 -
obf('IDMS/R', production, 'IDMS/R allows finely tuned data access for optimal performance.'). obf('ADS', development, 'ADS automates many programming tasks thus increasing productivity.'). obf('ADS', production, 'ADS generates high performance compiled code.'). obf('OLQ', development, 'OLQ allows easy validation of the database during development.'). obf('OLQ', information, 'OLQ lets end users access corporate data easily.'). obf('OLE', information, 'OLE lets users get information with English language queries.'). By using a chart such as this, the salesperson can stress only those features and benefits which meet the prospect's objectives. For example, OLE (OnLine English - a natural language query) would only be mentioned for an information center. OLQ (OnLine Query - a structured query language) would be presented as a data validation tool to a development shop, and as an end user query tool to an information center. This knowledge could have been stored as rules of the form: obf( 'OLE', 'OLE lets users get information in English') :objective(information). This type of rule is further away from the way in which the expert's understand the knowledge. The structures are more natural to deal with, and the inference engine can be easily modified to deal with what is really just a different format of a rule.
Situation Analysis
The next key area is making sure that the products are compatible with the customer's configuration. We wouldn't want to sell something that doesn't work. For example, OLE would not run at the time on a small machine or under a DOS operating system. unsuitable('OLE'):operating_system(dos). unsuitable('OLE'):machine_size(small).
Competitive Analysis
A good sales person will not directly attack the competition, but will use the competition's weakness to advantage. This is done by stressing those aspects of a product which highlight the competitor's weakness. That is, how can our product be differentiated from the competitor's. For example, two of Cullinet's main competitors were IBM and ADR. Both IBM and Cullinet provided systems that performed well, but Cullinet's was easy to use, so ease of use was stressed when the competitor was IBM. ADR's system was also easy to use, but did not perform as well as Cullinet's, so against ADR performance was stressed.
- 138 -
prod_dif('IDMS/R', 'ADR', 'IDMS/R allows specification of linked lists for high performance.'). prod_dif('IDMS/R', 'IBM', 'IDMS/R allows specification of indexed lists for easy access.'). prod_dif('ADS', 'ADR', 'ADS generates high performance code.'). prod_dif('ADS', 'IBM', 'ADS is very easy to use.').
Miscellaneous Advice
Besides this tabular data, there are also collections of miscellaneous rules for different situations. For example, there were two TP monitors, UCF, and DC. One allowed the user to use CICS for terminal networks, and the other provided direct control of terminals. The recommendation would depend on the situation. Another example is dealing with federal government prospects, which required help with the Washington office as well. Another rule recommends a technical sales approach, rather than the business oriented sell, for small shops that are not responding well. advice:not objective(production), tp_monitor('CICS'), online_applications(many), nl, advise( 'Since there are many existing online applications and'), nl, advise( 'performance isn''t an issue suggest UCF instead of DC'), nl. advice:industry(government), government(federal), nl, advise( 'If it's the federal government, make sure you work'),nl, advise( ' with our federal government office on the account'),nl. advice:competition('ADR'), revenues(X), X < 100, friendly_account(no), nl, advise(' Market database technical issues'),nl, advise(' Show simple solutions in shirt sleeve sessions' ), nl.
User Queries
Finally, the knowledge base contains a list of those items which will be obtained from the user. competition(X):menuask('Who is the competition?', X, ['ADR', 'IBM', 'other']). computer(X):menuask('What type of computer are they using?', X, ['IBM', 'other']).
- 139 -
friendly_account(X):menuask('Has the account been friendly?', X, [yes, no]). government(X):menuask('What type of government account is it?', X, [federal, state, local]). industry(X):menuask('What industry segment?', X, ['manufacturing', 'government', 'other']). machine_size(X):menuask('What size machine are they using?', X, [small, medium, large]). objective(X):menuask('What is the main objective for looking at DBMS?', X, ['development', 'information', 'production']). online_applications(X):menuask('Are there many existing online applications?', X, [many, few]). operating_system(X):menuask('What operation system are they using?', X, ['OS', 'DOS']). revenues(X):ask('What are their revenues (in millions)?',X). tp_monitor(X):menuask('What is their current TP monitor?', X, ['CICS', 'other']).
11.3 The Inference Engine
Now that a knowledge base has been designed, which has a reasonably small semantic gap with the expert's knowledge, the inference engine can be written. For the prototype, some of the knowledge is more easily stored in the inference engine. The high level order of goals to seek is stored in the main predicate, recommend. recommend:qualify, objective_products, product_differentiation, other_advice, !. recommend. First, the prospect is qualified. The qualify predicate checks to make sure there are no unqualified rules which fire. qualify:unqualified, !, fail. qualify.
- 140 -
The objective_products predicate uses the user's objectives and the OBF chart to recommend which products to sell and which benefits to present. It makes use of the unsuitable rules to ensure no products are recommended which will not work in the customer's shop. objective_products:objective(X), advise('The following products meet objective'), advise(X),nl,nl, obf(Product, X, Benefit), not unsuitable(Product), advise(Product:Benefit),nl, fail. objective_products. Next, the product differentiation table is used in a similar fashion. product_differentiation:competition(X), prod_dif(_,X,_), advise('Since the competition is '), advise(X), advise(', stress:'),nl,nl, product_diff(X), !. product_differentiation. product_diff(X):prod_dif(Prod, X, Advice), tab(5), advise(Advice), nl, fail. product_diff(_). Finally, the other advice rules are all tried. other_advice:advice, fail. other_advice.
11.4 User Interface
For a prototype, the user interface is still a key point. The system will be looking for supporters inside an organization, and it must be easy for people to understand the system. The windowing environment makes it relatively easy to put together a reasonable interface.
- 141 -
Figure 11.1. User interface of sales advisor prototype
For this example, one display window is used for advice near the top of the screen, and a smaller window near the bottom is used for questions to the user. Pop-up menus and prompter windows are used to gather information from the user. Figure 11.1 shows the user interface. The two display windows are defined at the beginning of the session. window_init:window(advice, create, [type(display), coord(1,1,10,78), border(blue:white), contents(blue:white)]), window(quest, create, [type(display), coord(13,10,13,70), border(blue:white), contents(blue:white)]). The prompt and pop-up menu windows are defined dynamically as they are needed. The ask and menuask predicates work as in other examples. Here are the clauses that interface with the user. ask(A,V):window(quest,write,A), window([type(prompt),coord(16,10,16,70),border(white:blue), contents(white:blue)], read, ['', Y]), asserta(known(A,Y)), Y = V. menuask(Attribute,AskValue,Menu):length(Menu,L), R1 = 16, R2 is R1 + L - 1, window(quest,write,Attribute), window([type(menu),coord(R1,10,R2,40),border(white:blue), contents(white:blue),menu(Menu)], read, AnswerValue), asserta(known(Attribute,AnswerValue)), AskValue = AnswerValue. The advise predicate uses the predefined display window, advice. advise([H|T]):- window(advice,writeline,[H|T]),!. advise(X):- window(advice,write,X).
- 142 -
11.5 Summary
One can model a fairly complex domain relatively quickly in Prolog, using the tools available. A small semantic gap on the knowledge base, and good user interface are two very important points in the prototype.
11.1 - Prototype an expert system which plays poker or some similar game. It will need to be specialized to understand the particular knowledge of the game. Experiment with the prototype to find the best type of user interface and dialog with the system.
- 143 -
12 Rubik's Cube
This chapter describes a Prolog program which solves Rubik's cube. The program illustrates many of the knowledge engineering problems in building expert systems. Performance is a key issue and affects most of the design decisions in the program. This program differs from the others in the book in that the knowledge and the reasoning are all intertwined in one system. The system uses Prolog's powerful data structures to map the expertise for solving a cube into working code. It illustrates how to build a system in a problem domain that does not fit easily into the attributevalue types on data representation used for the rest of the book. Like most expert systems, the program can perform at a level comparable to a human expert, but does not have an "understanding" of the problem domain. It is simply a collection of the rules, based on Unscrambling the Cube by Black & Taylor, that an expert uses to solve the cube . Depending on the machine, it unscrambles cubes as fast or faster than a human expert. It does not, however, have the intelligence to discover the rules for solving Rubik's cube from a description of the problem. A Rubik's cube program illustrates many of the trade-offs in AI programs. The design is influenced heavily by the language in which the program is written. The representation of the problem is key, but each language provides different capabilities for knowledge representation and tools for manipulating the knowledge. Performance has always been the issue with expert systems. A blind search strategy for the cube simply would not work. Heuristics programming was invented to solve problems such as this. Using various rules (intelligence), the search space can be drastically reduced so that the problem can be solved in a reasonable amount of time. This is exactly what happens in the Rubik's cube program. As with the basic knowledge representation, the representation of the rules and how they are applied also figure heavily in the program design. Through this example we will see both the tremendous power and expressiveness of Prolog as well as the obfuscation it sometimes brings as well.
12.1 The Problem
Rubik's cube is a simple looking puzzle. It is a cube with nine tiles on each face. In its solved state each of the sides is made up of tiles of the same color, with a different color for each side. Each of the tiles is actually part of a small cube, or cubie. Each face of the cube (made up of nine cubies) can be rotated. The mechanical genius of the puzzle is that the same cubie can be rotated from multiple sides. A corner cubie can move with three sides, and edge cubie moves with two sides. Figure 12.1 shows a cube in the initial solved state, and after the right side was rotated 90 degrees clockwise.
Figure 12.1. A Rubik's Cube before and after the right side is rotated
The problem is to take a cube whose sides have been randomly rotated and figure out how to get it back to the initial solved state. The scrambled cube might look like that of figure 12.2.
- 144 -
Figure12.2. A scrambled Rubik's Cube
The problem is, there are an astronomical number of possible ways to try to unscramble the cube, not very many of which lead to the solved state. To reach a solution using a blind search algorithm is not feasible, even on the largest machines. A human expert can unscramble the cube in well less than a minute. The difficulty with solving the cube revolves around the fact that if you move one cubie, you have to move seven other cubies as well (the center one doesn't really go anywhere). This is not a big problem in the early stages of unscrambling the cube, but once a number of tiles are positioned correctly, new rotations tend to destroy the solved parts of the cube. The experienced cube solver knows of complex sequences of moves which can be used to manipulate a small portion of the cube without disturbing the other portions of the cube. For example a 14 move sequence can be used to twist two corner pieces without disturbing any other pieces. It is important to realize there are actually two different senses of solving the cube. One assumes the problem solver has no previous knowledge of the cube. The other assumes the individual is an expert familiar with all of the intricacies of the cube. In the first case, the person solving the cube must be able to discover the need for complex sequences of moves and then discover the actual sequences. The program does not have anywhere near the level of "intelligence" necessary to solve the cube in this sense. In the second case the person is armed with full knowledge of many complex sequences of moves which can be brought to bear on rearranging various parts of the cube. The problem here is to be able to quickly determine which sequences to apply given a particular scrambled cube. This is the type of "expertise" which is contained in the Rubik's cube program. In the following sections we will look at how the cube is represented, what is done by searching, what is done with heuristics, how the heuristics are coded, how the cube is manipulated, and how it is displayed.
12.2 The Cube
The core of the program has to be the knowledge representation of the cube and its fundamental rotations. The cube lends itself to two obvious representation strategies. It can either be viewed simply as 54 tiles, or as 20 cubies (or pieces) each with either two or three tiles. Since much of the intelligence in the program is based on locating pieces and their positions on the cube, a representation which preserves the piece identity is preferred. However there are also brute force search predicates which need a representation which can be manipulated fast. For these predicates a simple flat structure of tiles is best. The next decision is whether to use flat Prolog data structures (terms) with each tile represented as an argument of the term, or lists with each element a tile. Lists are much better for any predicates which might want to search for specific pieces, but they are slower to manipulate as a single entity. Data structures are more difficult to tear apart argument by argument, but are much more efficient to handle as a whole. (The above statements are true for most Prologs which implement terms using fixed length records. Some Prologs however use lists internally thus changing the performance trade-offs mentioned above.)
- 145 -
Based on the conflicting design constraints of speed and accessibility, the program actually uses two different notations. One is designed for speed using flat data structures and tiles, the other is a list of cubies designed for use by the analysis predicates. The cube is then represented by either the structure: cube(X1, X2, X3, X4, .........., X53, X54) where each X represents a tile, or by the list: [p(X1), p(X2), ...p(X7, X8, X9), ...p(X31, X32), p(X33, X34), ...] where each p(..) represents a piece. A piece might have one, two, or three arguments depending on whether or not it is a center piece, edge piece, or corner piece. The tiles are each represented by an uppercase letter representing the side of the cube the tile should reside on. These are front, back, top, bottom, right, and left. (The display routine maps the sides to colors.) Quotes are used to indicate the tiles are constants, not variables. Using the constants, the solved state (or goal state of the program) is stored as the Prolog fact goalstate/1 : goalstate( cube('F', 'R', 'U', 'B', ............)). The ordering of the tiles is not important as long as it is used consistently. The particular ordering chosen starts with the center tiles and then works systematically through the various cubies. Having decided on two representations, it is necessary to quickly change from one to the other. Unification has exactly the power we need to easily transform between one notation of the cube and the other. A predicate pieces takes the flat structure and converts it to a list, or visa versa. pieces( cube(X1, X2, ....... X54), [p(X1), ......p(X7, X8, X9), .....]). If Z is a variable containing a cube in structure notation, then the query ?- pieces(Z, Y). Will bind the variable Y to the same cube in list notation. It can also be used the other way. The following query can be used to get the goal state in list notation in the variable PieceState: ?- goalstate(FlatState), pieces(FlatState, PieceState). FlatState = cube('F', 'R', 'U', 'B', ......). PieceState = [p('F'), p('R'), ....p('R', 'U'), ....p('B', 'R', 'F'), ....]. The first goal unifies FlatState with the initial cube we saw earlier. pieces/2 is then used to generate PieceState from FlatState.
12.3 Rotation
Unification also gives us the most efficient way to rotate a cube. Each rotation is represented by a predicate which maps one arrangement of tiles, to another. The first argument is the name of the rotation, while the second and third arguments represent a clockwise turn of the side. For example, the rotation of the upper side is represented by: mov(u, cube(X1, ...X6, X7, X8, X9, ...), cube(X1, ...X6, X20, X19, X21, ...)) We can apply this rotation to the top of the goal cube:
- 146 -
?- goalstate(State), mov(u, State, NewState). The variable NewState would now have a solved cube with the upper side rotated clockwise. Since these can be used in either direction, we can write a higher level predicate that will make either type of move based on a sign attached to the move. move(+M, OldState, NewState):mov(M, OldState, NewState). move(-M, OldState, NewState):mov(M, NewState, OldState). Having now built the basic rotations, it is necessary to represent the complex sequences of moves necessary to unscramble the cube. In this case the list notation is the best way to go. For example, a sequence which rotates three corner pieces is represented by: seq(tc3, [+r, -u, -l, +u, -r, -u, +l, +u]). The sequence can be applied to a cube using a recursive list predicate, move_list/3: move_list([], X, X). move_list( [Move|T], X, Z):move(Move, X, Y), move_list(T, Y, Z). At this point we have a very efficient representation of the cube and a means of rotating it. We next need to apply some expertise to the search for a solution.
12.4 High Level Rules
The most obvious rule for solving Rubik's cube is to attack it one piece at a time. The placing of pieces in the solved cube is done in stages. In Black & Taylor's book they recognize six different stages which build the cube up from the left side to the right. Some examples of stages are: put the left side edge pieces in place, and put the right side corner pieces in place. Each stage has from one to four pieces that need placement. One of the advantages of writing expert systems directly in a programming language such as Prolog, is that it is possible to structure the heuristics in an efficient, customized fashion. That is what is done in this program. The particular knowledge necessary to solve each stage is stored in predicates, which are then used by another predicate, stage/1, to set up and solve each stage. Each stage has a plan of pieces it tries to solve for. These are stored in the predicate pln/2. It contains the stage number and a list of pieces. For example, stage 5 looks for the four edge pieces on the right side: pln(5, [p('R', 'U'), p('F', 'R'), p('R', 'D'), p('B', 'R')]). Each stage will also use a search routine which tries various combinations of rotations to position a particular target piece. Different rotations are useful for different stages, and these too are stored in predicates similar to pln/2. The predicate is cnd/2 which contains the candidate rotations for the stage. For example, the first stage (left edge pieces) can be solved using just the simple rotations of the right, upper, and front faces. The last stage (right corner pieces) requires the use of powerful sequences which exchange and twist corner pieces without disturbing the rest of the cube. These have names such as corner-twister 3 and tricorner 1. They are selected from Black and Taylor's book. These two examples are represented: cnd(1, [r, u, f]).
- 147 -
cnd(6, [u, tc1, tc3, ct1, ct3]). The stage/1 predicate drives each of the stages. It basically initializes the stage, and then calls a general purpose routine to improve the cube's state. The initialization of the stage includes setting up the data structures that hold the plan for the stage and the candidate moves. Stage also reorients the cube for the stage to take advantage of symmetries and/or make for better displays.
12.5 Improving the State
The stage/1 predicate calls the main working predicates which search for the rotations to put a given piece in place, and update all of the appropriate data structures. The representation of the partially solved cube is a key design issue for this portion of the program. There are predicates in the program which search through a cube in list-piece notation (rather than tile notation) and determine where a piece is, or conversely, which piece is in a given position. These predicates are useful for many portions of the program but are too slow to be used for testing whether a given search has been successful or not. This is true since they not only have to check for the new piece being placed, but they would also have to insure that none of the previously placed pieces have moved. Unification is again the answer. So far, there are two cube/54 terms used in the program. One represents the final solved state of the cube, and the other represents the current state of the cube. We introduce a third cube/54, referred to as the criteria, which is used to denote which tiles are currently in place, and the tiles of the cubie which is currently being positioned. Initially all of the arguments of this third cube are variables. This structure will unify with any cube. As pieces are put in place, the variables representing tiles of the criteria cube are unified with the corresponding tiles of the solved cube. In this case, the criteria cube will only unify with a cube that has those corresponding tiles in place. As the program attempts to place each piece, it binds another piece in the criteria. For example, as the program attempts to position the sixth piece, the improve/2 predicate first binds the sixth piece in the criteria with the solved state. At this point then, the first six pieces will have bound values the same as the solved state. The remaining tiles will be represented by unbound variables which unify with anything. The criteria cube will then successfully unify with any cube that has the first six pieces in place.
12.6 The Search
Now that we have a plan of attack on the cube, and a means of representing the current state, and the criteria for testing if a given piece is in place, we can institute a very fast search routine. The core routine to the Rubik's cube program is a predicate rotate/3. It is called: rotate(Moves, State, Crit). The variable Moves is unbound at calling, and contains the list of moves necessary to position the piece after the search has succeeded. State is the current state of the cube, and Crit is the criteria for this stage of the solution. Crit has all of the pieces found so far bound, as well as the one additional piece for this search. rotate/3 searches for a sequence of moves which will put the new piece in place without disturbing the existing pieces. The rotate/3 predicate illustrates the tremendous power and compactness of Prolog code. At the same time it illustrates the difficulty of understanding some Prolog code. Prolog's power derives from the built in backtracking execution and unification. Both of these features help to eliminate many of the standard programming structures normally used. Thus, a predicate like rotate/3 has a fraction of the code it would take in another language (and executes fast as well), but it requires a good understanding of the underlying execution behavior of Prolog to understand it. rotate([], State, State).
- 148 -
rotate(Moves, State, Crit):rotate(PriorMoves, State, NextState), get_move(ThisMove, NextState, Crit), append(PriorMoves, [ThisMove], Moves). The rotate/3 predicate does a breadth first search as can be seen by the fact that it calls itself recursively before it calls the move generation predicate get_move/3. Since the application of moves and testing is so fast, and the depth of search is never great, intermediate results are not saved as in a normal breadth first search. Instead, they are just recalculated each time. The append/3 predicate can be used to build lists. In this case it takes ThisMove and appends it to the end of the list PriorMoves, generating a new list, Moves. The candidate moves for a given stage are stored in a predicate cand/1 (the actual program is a little more complex) which is maintained by the stage/1 predicate. For stage one, it would look like: cand(r). cand(u). cand(f). The get_move/3 predicate is called with Move unbound, and the second and third arguments bound to the current state and criteria respectively. If the call to move/3 fails (because it does not rotate the cube into a position which unifies with the criteria), then cand/1 backtracks generating another possible move. When all of the positive moves fail, then get_move/3 tries again with negative moves. get_move(+Move, State, Crit):cand(Move), mov(Move, State, Crit). get_move(-Move, State, Crit):cand(Move), mov(Move, Crit, State). The efficiencies in rotate/3 show the rational behind the early design decisions of cube representation. The get_move/3 predicate is called with State and Crit. If it generates a move which unifies with Crit, it succeeds, otherwise it fails and backtracks. All of this testing and analysis is done automatically by Prolog's pattern matching call mechanism (unification). The entire logic of the breadth first search also happens automatically due to the backtracking behavior of Prolog. If get_move fails to find a move which reaches the criteria, rotate/3 backtracks into the recursive call to rotate/3. Since the recursive call to rotate/3 uses NextState as the criteria, and NextState is unbound, the recursive call will succeed in generating PriorMoves and a modified state. Now get_move/3 tries again with this new state to see if a single move will reach the criteria. This process repeats through as many levels of depth as is necessary to find a sequence of moves which reach the criteria. In practice, any more than a three deep search begins to get tedious. The design of the program is such, that it does not require more than a three deep search to find and position any given piece.
12.7 More Heuristics
The program as described so far almost works. However it turns out there are a few situations that will cause the search routines to dig too deep for a solution. These situations drastically affect the performance. It was necessary to add more intelligence to the program to recognize situations that will not be easily unscrambled by the search routine, and to correct them before calling rotate/3.
- 149 -
One of the problems occurs when positioning pieces on the left side. If the piece to be positioned is currently on the right side, then a few simple moves will put it in place on the left side. However, if the piece is already on the left side, but in the wrong position, then it will have to be moved to the right and back to the left. This longer sequence of moves takes longer to search for, so one of the extra heuristics looks for this situation. The heuristics analyze the cube, test for this condition, and blindly move the piece to the right if it occurs. Then the normal search routine gets it back into its proper place. There are a couple of situations like this which are covered by the heuristics. It is tempting to think of adding more and more of these heuristics to straighten out the cube with less searching. There is a trade-off however, and that is it takes time to apply the heuristics, and the search routine is relatively fast. So a heuristic is only worthwhile when the search is slow. The program may be improved by additional heuristics, but the search will still be the core of the program.
12.8 User Interface
A graphical representation of the cube is used to display the progress of the program. A window is kept for recording all of the moves used so far. In addition the program contains a cube editor that allows you to describe that scrambled cube that has been on your shelf all these years. Just carefully apply the moves step by step and you will get it back to its original state.
12.9 On the Limits of Machines
I don't mind saying that I was pretty proud of myself for writing this program. It was one of my better hacks. At the time, I had a neighbor who was 12 years old and who had just gotten a computer. He loved it and used to come over to my house to hang out with someone who actually got paid for playing with these things. I had finished an early version of the cube program and decided to knock his socks off. I said, look at this and ran the program. On my PC-XT it solved a randomly scrambled cube in about three minutes. I looked at him and waited for his awed response. There was nothing. I asked him what he thought. He said he wasn't impressed. His best time was 45 seconds.
12.1 - Improve the speed of the program by experimenting with more heuristics and more canned move sequences. Try to find the optimal balance between the powerful heuristics and sequences and the time it takes to search for them. 12.2 - Experiment with a version of the cube program which when given the goal of replacing two pieces without disturbing the others, can "discover" a sequence and remember it for future use.
- 150 -
To top
|
global_05_local_5_shard_00000035_processed.jsonl/30790
|
teacher_20111118_0949 by wuzhengqin
Deadlines are closer than
they appear… Yours
is Friday.
EDIT #2
Research Paper –Short Story Analysis
Before we start…
You will need your Typed Copy #2
with works cited page.
You will need 2 (different colors)
highlighters (markers or colored
pencils are ok).
A pencil or a pen ,other than black.
Maturity ( I know this is hard for
some of you )
Step 1
Highlight every sentence (Not
lines!) in your essay using
alternating colors.
For example: If you use yellow for the first
sentence, use orange for the second;
alternating sentences following that pattern-
yellow, orange, yellow,etc.
This allows you to look for variation in your sentence
lengths, as well as run-on sentences and fragments.
If you notice that your sentences are mostly the same
length, try combining some of them to create complex
sentences. Fix any run-ons or fragments that you
Step 2
Put brackets [ ] around the first
word in every sentence.
This shows you whether or not
you’re beginning too many sentences
the same way. Unless it’s for effect,
try not to start several consecutive
sentences the same way.
If you discover that you’ve begun
several sentences the same way, find
ways to change some of them.
Also check and make sure your
sentences do not start with AND,
Step 3
Circle all “Be Verbs” in your essay
(am, is, are, was,
were, be, being, been).
“Be Verbs” are passive and can
make your writing sound weak. As
often as possible, use action
verbs to make your writing more
Add up the total # of “Be Verbs” in
your essay. Find a way to change
1/3 of them into action verbs.
Again, this may mean re-wording
some sentences or completely
rewriting them.
Step 4
switch with someone or keep
At the top of the page
write “spelling-your name”
Read the paper
Underline any words
,that you think are
misspelled, twice
Step 6
switch with someone else or keep
At the top of the page write
- “first person-your name”
First-I, me, my, mine, we,
us, our, ours.
Read the paper backwards
Put brackets [ ] around all first
person words
If first person words are in quotes
that is ok. If they are NOT they need
to be changed.
Step 7
At the top of the page write
- “2nd person-your name”
2nd- you, your, you’re .
Read the paper backwards
Put brackets [ ] around all 2nd
person pronouns.
Get rid of second person words
if they are NOT in quotes.
Step 8
Read the paper backwards
Look for commas
Circle every comma that you find in
the paper with a marker or pen.
You need to make sure that your
commas are serving their purpose.
Refer to the hand out that I gave
The 5 comma rules handout will help
you ensure that your commas are
placed in the correct spots.
Step 9
Turn to the works cited page
Highlight the first letter of each
Make sure they are in
alphabetical order.
Step 10
Look at each citation, on the
works cited page, and make
sure that each one has a
hanging indent. Should look like
Lee, Harper. To Kill a Mocking-
bird. New York: Warner
Books, Inc., 1961.
Step 11-
Works Cited Continued
Make sure the title, Works Cited,
is NOT underlined or bolded.
Make sure the title is at the
center of the page.
Make sure it is on its own page
and does not continue directly
after your conclusion.
Make sure your last name and
page number are at the top right
Step 12-Contractions
Circle all of your contractions
Don’t, can’t, didn’t etc…
You must type them out
Do not, cannot, did not
This is a formal essay.
Step 13
Remember, Literature NEVER dies.
It must be written in PRESENT
Highlight all of your words that are
past tense.
Some past tense verbs end in “Ed”.
Common past tense words include,
but are not limited to: was, had,
Step 14
Go home and FIX the items that you
have identified that need a change.
This does you no good if you do not
take the time to change these things.
Organize your folder according to the
last slide of this power point.
You will not get class time to
organize your folder.
If I see you organizing in class it will
be considered late and therefore a 0.
On the back on Typed Copy #2
Write the following statement:
“The final draft of this paper has
been read out loud by
________________ and
_______________ listened.
“Reader’s printed
Reader’s
Listener’s printed name:____
Listener’s signature: _____
Folder Order for Paper
1. Left Pocket- Final Draft with Pink rubric
stapled to the front.
The following should be in this order and in
the brads:
1. Short Story
2. Questions over your short story.
3. Sources used in paper.
4. Literary Journal
5. Literary Planning Guide
6. Detailed Plan
7. Bibliography Page.
8. Rough Draft #1
9. Rough Draft #2
10. All of your sources that you did not use.
11. Turnitin.com receipt.
To top
|
global_05_local_5_shard_00000035_processed.jsonl/30791
|
The Berlin Blockade - New Schoolnotes by xuyuzhu
The Berlin Blockade
Case Study 1.1
The Berlin Blockade
The Yalta agreement of 1945 gave the
Soviet Union, France, Great Britain and
the United States the right to govern
Germany on a temporary basis. In 1949,
France, Great Britain, and the United
States set up the German Federal
Republic, or West Germany. Konrad
Adenaur was the first chancellor of the
German Federal Republic, and Bonn was
named the capital of this new state.
East Germany officially known as the
German Democratic Republic was
controlled by the Soviet Union. Berlin, the
capital of pre-war Germany, was a special
problem. Located entirely within East
Germany, Berlin was divided among the
allies, with the western powers in control
of West Berlin in time, East Berlin Became
the capitol of the German Federal
Republic. Ever Since, relations between
the Soviet Union and the West have been
troubled over the division of Berlin.
In June 1948, in Berlin, the Cold War
became dangerously heated. The Soviets
strongly objected to the formation of the
German Federal Republic, fearing that
Germany might become strong enough to
reunify and threaten Soviet power. In an
attempt to force the Western powers to
turn Berlin over to them, The Soviets
blockaded the city. They stopped the
transportation of goods and people
between West Berlin and East Germany.
President Truman immediately ordered an
American airlift of large cargo planes
carrying food and other supplies into West
Berlin. Throughout the following winter
bundles of coal were also air lifted to West
Berlin to be used for heating. The Soviets
finally stopped their blockade in May
1949. All though the threat of actual
fighting was avoided, The Berlin airlift was
not forgotten. The Stage had been set for
many more years of Cold War
The Berlin Blockade
Background page 43
1. When the fighting was over in Europe
after World War II, what did the allies
decide to do with Germany?
2. What was the Potsdam Conference?
What plan was developed there?
3. What was the Allied Control Council?
Discuss it’s purpose.
4. Explain how and why Berlin the German capital
was granted separate and distinct status.
5. Why was the joint occupation of Germany an
ill-considered plan?
6. Explain the different agendas each conquering
nation had in regards to Germany.
7. Explain how demobilization began to cause
8. What steps did the United States take to
influence what happened in Eastern Europe
after 1945?
9. How did the Soviet Union view these steps?
What was their response?
The Blockade Begins page 48 and
Reaction to the Blockade and page 55
1. What was the London Conference? How
did the Soviets react to it?
2. How did the Soviets justify their
restriction of access to Berlin?
3. Explain how the Berlin situation became
more volatile over the issue of currency
4. When did the complete blockade begin? Why
was the timing of the blockade “well planned”?
5. What three alternatives were open to the allied
powers in regards to dealing with the blockade
in July of 1948? Which did they choose?
6. Describe the condition of West Berlin during
the Fall of 1948.
7. Describe the status of the blockade in March of
8. List and briefly describe the key people
involved in the Berlin Blockade.
A military defense alliance is an alliance of
nations based on the belief that security is
best maintained by a balance of power.
Throughout the period of the Cold War
the Warsaw Pact aligned Soviet bloc
countries against the Western alliance of
In 1949,Western European leaders were
successful in forming an organization that united
their countries for military protection.
This was the North Atlantic Treaty Organization
or N.A.T.O.
Its original members were Great Britain, France,
Belgium, Luxembourg, the Netherlands,
Denmark, Iceland, Italy, Norway, Portugal, and
two non-European nations, Canada, and the
United States. Later West Germany, Greece,
Spain, and Turkey joined N.A.T.O.
Each member of the group promises to
come to the aid of the others in case of
military attack, originally from the threat
of Soviet aggression. With the end of the
Cold War, N.A.T.O. members agreed to
the use of its forces as peacekeepers in
countries outside the alliance.
On May 14, 1955 Albania, Bulgaria,
Czechoslovakia, East Germany, Hungary, Poland,
Romania, and the Soviet Union signed the
Warsaw Pact,
a defensive military treaty that guaranteed the
member countries would come to the aid of
each other in the event of a western attack.
This pact was known as the Soviet Unions
answer to N.A.T.O. Its forces were used to
suppress democratic movements, e.g., in1968 in
Czechoslovakia. Albania withdrew in1961, and
East Germany ceased to be a member prior to
German reunification (1990).
The alliance dissolved in 1991 after the collapse
of the Soviet Union.
These two military alliances, N.A.T.O. and the
Warsaw Pact, clearly drew the lines between the
Soviet Union and the United States. They
demonstrated that each side intended to back
up its members with military force if necessary.
In 1954 The Southeast Asia Treaty Organization
brought together European and Asian nations,
as the United States, Britain, France, Australia,
New Zealand, Pakistan, the Republic of the
Philippines, and Thailand agreed to mutual
Questions page 63
An End to the Crisis
1. What was the solution reached to bring
an end to the blockade?
2. Explain what N.A.T.O. is and why it was
3. What was the Soviet response to
Using page 64 of your text, your notes,
the library, and the internet identify the
countries that belong to NATO and the
former Warsaw Pact. Make sure to
include a title and a legend on your map.
You will use one color for NATO countries
and another for Warsaw pact countries.
To top
|
global_05_local_5_shard_00000035_processed.jsonl/30799
|
Nonqualified Defined Contribution Plan - DIXIE GROUP INC - 8-16-1994 by DXYN-Agreements
EXHIBIT (10a) DIXIE YARNS, INC. NONQUALIFIED DEFINED CONTRIBUTION PLAN (As Restated November 18, 1993) DIXIE YARNS, INC. NONQUALIFIED DEFINED CONTRIBUTION PLAN (as Restated on November 18, 1993) ARTICLE I ESTABLISHMENT AND PURPOSE Establishment. Except as otherwise stated, effective as of December 31, 1989, Dixie Yarns, Inc. ("Company") hereby adopts an unfunded deferred compensation plan to be known as the "Dixie Yarns, Inc. Nonqualified Defined Contribution Plan" (the "Plan"). Purpose. The Plan is intended to provide unfunded deferred compensation benefits to certain individuals who are highly compensated employees of the Employer, and it is the intention of the parties that this Plan be unfunded for tax purposes and for the purposes of ERISA. ARTICLE II DEFINITIONS As used herein, the following words and phrases have the meanings ascribed to them in this Article unless a different meaning is plainly required by the context. Words in the masculine gender shall be deemed to include the feminine gender and words in the feminine gender shall be deemed to include the masculine gender. Any headings used herein are included for ease of reference only, and are not to be construed so as to alter any of the terms of the Plan. 2.1 "Account" means the balance the balance, as determined by the Committee posted to the record of each Participant as of each Valuation Date, consisting of the Employer's contributions, forfeitures, and his allocated share of earnings, less any payments (including expenses) therefrom. 2.2 "Beneficiary" means the person or persons designated by the Participant under the rules and forms prescribed by the Committee. 2.3 "Board" or "Board of Directors" means the Board of Directors of the Company. 2.4 "Change of Control" means any event which results in a "person" (as such term is defined in Sections 3(a)(9) and 13(d)(3) of the Securities Exchange Act of 1934, as amended, and the rules and regulations promulgated thereunder) acquiring directly or indirectly, whether by sale, transfer, assignment, pledge, hypothecation, gift, or other disposition, in one or more transactions, a majority controlling interest in the voting capital stock of the Company, or the entering into of any agreement with the Company to do any of the foregoing. Except, a Change of Control shall not include any transaction in which one or more members of the Frierson family (which shall include all current members of the family of J. Burton Frierson, including descendants and spouses, and trusts for the benefit of same, who presently own capital stock) have a majority controlling interest in the Company.
2.5 "Code" means the Internal Revenue Code of 1986. Reference to a section of the Code include that section and any comparable section or sections of any future legislation that amends, supplements or supersedes such section. "Committee" means the Retirement Committee designated by the Board.
"Compensation" means the remuneration paid to an Eligible Employee for services rendered to the Employer, as reported or reportable on Form W-2 for Federal Income Tax withholding purposes (or similar form required for such purposes), excluding extra year-end pay, vacation allowances, severance pay, cash profit-sharing, payment for incidental benefits and non-recurring compensation. Compensation shall include any contribution made under the Dixie Yarns, Inc. Nonqualified Employee Savings Plan and any amounts excluded from income of an Eligible Employee under Sections 125 or 401(k) of the Code; however, Compensation shall not include amounts contributed by the Employee under any other benefit plan. For the purposes of this Plan, it shall be presumed that no Compensation is paid on December 31. "DC Plan" means the Dixie Yarns, Inc. Defined Contribution Plan, as amended from time to time, or if terminated by the Company prior to the termination of this Plan, the provisions of the DC Plan as in existence as of the date of its termination. "Effective Date" means December 31, 1989, unless otherwise specified herein. "Eligible Employee" means an Employee as determined by the Board or Committee (or in the case of initial Participants, by the Vice President - Human Resources) to be eligible to participate in this Plan and shall be limited to employees who are in a select group of management or highly compensated employees of the Employer, provided, however, that no person may be an Eligible Employee until he has been employed by the Company for six months. "Eligible Retirement" means the date of termination of employment (other than on account of death or Total and Permanent Disability) after a Participant reaches age 60 and has received credit for five (5) Years of Service. "Employee" means all employees of the Employer whose wages are exempt from the provisions of the Fair Labor Standards Act of 1947, as amended. "Employer" means Dixie Yarns, Inc., and all of its subsidiaries.
"Employer Contribution Account" means the account established for each Participant to which contributions described in Section 4.1, forfeitures, and the earnings thereon are credited. "Participant" means any Eligible Employee who has agreed to be bound by the terms and conditions of the Plan by signing a Participation Agreement. "Participation Agreement" means the form designated by the Committee to be signed by each Participant. "Plan Year" means the period commencing on the Effective Date and ending on December 30, 1990, and thereafter each 12-month period beginning each December 31 and ending on the following December 30th. "Totally and Permanently Disabled" means the condition of a Participant suffering from a physical or mental condition arising after the date on which he is first employed by the Employer which, in the opinion of the Committee based upon appropriate medical advice and examination by two physicians, one of whom shall be selected by the Company and one of whom must be a member of a generally recognized Medical Association, and in accordance with uniform rules applied uniformly to all Participants, totally and permanently prevents the Participant from engaging in any occupation or employment for remuneration or profit (except for the purpose of rehabilitation which is not incompatible
with such finding of total and permanent disability). definition shall exclude a disability arising from: (a) Chronic or excessive use of intoxicants, drugs or narcotics; Self-inflicted injury or sickness;
(b) (c)
Incapacity incurred while or as a result of engaging in an unlawful enterprise; and Disability incurred as a result of military service.
(d) 2.19
"Valuation Date" means the last day of the Plan Year and any other date designated by the Committee. "Year of Service" shall have the same meaning given such term in the DC Plan and shall be determined in the sole discretion of the Committee, in accordance with the rules and/or procedures utilized under the DC Plan for such purpose. All Years of Service credited with respect to any Participant prior to the Effective Date shall also be counted for purposes of this Plan.
ARTICLE III ELIGIBILITY 3.1 Eligibility to Participate. Each Employee of the Employer who is selected for participation in the Plan will become a Participant in this Plan as of the first day of the first calendar month which begins after he has signed a Participation Agreement. 3.2 Participation. A Participant shall remain a Participant so long as he remains an Employee but shall cease to be a Participant if he terminates employment with the Employer prior to the date on which he becomes eligible for payment of benefits under Article VII of the Plan. Should a Participant cease to be an Employee, but later become re- employed by the Employer, he shall again become a Participant if such individual is selected for participation in the Plan after his re-employment. ARTICLE IV CONTRIBUTIONS 4.1 Employer Contributions. The Employer contribution for any Plan Year shall be determined as follows: (a) For each Plan Year, the Employer shall contribute out of combined net profits a percentage of the Compensation of each Participant for such Plan Year related to the percentage of "combined net profits of the Employer" for such Plan Year to the "combined net worth" of the Employer as of the first day of such Plan Year in accordance with the Schedule attached hereto as Exhibit A. For the purposes of such computation, "combined net profits of the Employer" shall mean the current combined earnings and profits of the Employer computed in accordance with generally accepted accounting practices, including as a deduction all contributions to any employee benefit plans maintained by the Employer for the benefit of its employees and all state, federal and local income taxes, adjusted however, for capital gains and losses, all as determined by the auditors of the Company for each Plan Year, and any changes or adjustments by reason of an Internal Revenue Service audit shall be disregarded; and "combined net worth" shall mean the sum of the net worth of the Company and all of its subsidiaries, including capital, surplus, accumulated earnings, and profits and tax-paid reserves. (b) In addition, the Employer may in any Plan Year in the discretion of the Board of Directors of the Company, make an additional contribution out of net profits in such amount as the Board of Directors of the Company may determine but such amount shall be applied as a uniform percentage of the Compensation of all Participants; and in no event shall the total contributions for any Plan Year exceed the maximum amount that would otherwise be deductible from the Employer's income for the purposes of Federal income taxation as provided under Section 404 of the Code if this Plan were treated as the DC Plan for such purpose. The determination of such additional amount for each Plan Year shall be made by the Board of Directors of the Company prior to the due date (including extensions thereof) for filing the Federal income tax return of the Company for the fiscal year of the Company coinciding with, immediately preceding, or ending on the December 31 immediately after such Plan
Year and shall be recorded in the minute book of the Company. The Employer's contribution shall be made in cash, on or before the date specified by the Committee, in its sole discretion, for making such contribution. 4.2 Participant Contributions. Participant contributions shall neither be permitted nor required under the terms of this Plan. ARTICLE V ACCOUNTS 5.1 Establishment of Accounts. The Committee shall establish an Employer Contribution Account for each Participant, to which Employer contributions described in Section 4.1, if any, and the earnings thereon will be credited. 5.2 Allocation of Employer Contributions and Forfeitures. As of the Valuation Date coinciding with the end of each Plan Year, the aggregate Employer contribution for such Plan Year and the sum of all forfeitures occurring during such Plan Year, as determined in accordance with Article VI, shall be allocated among all Participants' Accounts in the proportion that the Compensation of each such Participant for such Plan Year bears to the total Compensation of all such Participants for such Plan Year. In the event any portion of a Participant's Employer Contribution Account is forfeited and allocated and such Employee later completes a Year of Service (regardless of whether such person has again become a Participant), then notwithstanding the foregoing, Employer contributions shall first restore the Participant's Employer Contribution Account to its value as of the day it was allocated to other Participants; provided the terms of the DC Plan would require the value of such account to be restored if such account were held pursuant to that Plan. 5.3 Adjustments to Account Balances. (a) Regular Valuation Dates. As of each Valuation Date, the Committee will determine the value of each Participant's Account. The Account balance of each Participant will be adjusted to reflect the following events since the preceding Valuation Date: (1) Payments from his Account (as if made on the first day following the preceding Valuation Date regardless of when paid); (2) Earnings credited to the Participant's Account which shall be the overall rate of gross earnings of all assets (other than life insurance policies) held in trust, for life insurance policies in which investments are held in a separate account, such rate shall be gross earnings reduced by the fees of investment managers of investment funds held in such account, and for life insurance policies which have no separate account, such rate shall be the rate of interest credited to the cash value of the policy by the insurance company; proceeds from death benefits from life insurance shall not be considered earnings; (3) The Account's pro rata share of expenses (as if made on the first day following the preceding Valuation Date regardless of when paid); and (4) The allocation of contributions and forfeitures (as if made on the day before the Valuation Date). (b) Valuations Binding. In determining values, the Committee will exercise its best judgment, and all determinations of value will be binding upon all Participants and their Beneficiaries. (c) Statement of Account Balances. As soon as practicable after the end of each Plan Year, the Committee will provide to each Participant and Beneficiary for whom an Account is maintained, a statement showing all allocations to and payments from his Account, and the current value of his Account. For any Plan Year, the Committee may provide statements more frequently. (d) Correction of Errors. As soon as practicable after it discovers any error in any Participant's Account balance, the Committee will correct the error. If possible, the error will be corrected as if it had never been made. Otherwise, any necessary addition to the Account will be treated as an expense of the Plan, and any necessary subtraction from the Account will be used to reduce the Employer's contribution for the same or the next Plan Year.
ARTICLE VI VESTING A Participant shall become one hundred percent (100%) vested in the amounts credited to his Employer Contribution Account upon death, Total and Permanent Disability, the completion of five (5) Years of Service, or such action as may be taken in accordance with Section 7.2 of this Plan. If a Participant terminates employment with the Employer before completing five (5) Years of Service, then he shall forfeit all amounts then credited to his Employer Contribution Account; and such forfeited amounts will be reallocated in accordance with Section 5.2 of this Plan. ARTICLE VII PAYMENT OF BENEFITS 7.1 Timing of Distributions. Except as otherwise provided herein, benefits under this Plan shall be paid in a single lump sum as soon as practicable after the Committee has received satisfactory evidence that the Participant is Totally and Permanently Disabled, has died, has terminated employment, or as otherwise provided in Sections 7.2 and/or 7.3, provided, however, that if any part of such distribution is not deductible for Federal income tax purposes, the Committee may postpone payment of any nondeductible part until such time as it determines the distribution (or the part thereof to be distributed) will be deductible. A Participant may make an election to have all amounts paid on account of Eligible Retirement paid in 180 monthly payments. Such election must be made on the later of June 30, 1994, or at the end of the first six months following the date the Participant first became eligible to participate in the Plan. The Participant may change his election but only with the approval of the Committee if such request is made not more than 15 months nor less than 12 months prior to the Participant's Eligible Retirement. Monthly payments shall begin as soon as practicable after the Committee has received satisfactory evidence of Eligible Retirement and continue each month thereafter until 180 payments are made. Payments shall be made by assuming that the Account as of the first day of the month in which payments commence has been invested in an annuity for such 180 months earning a rate of interest on the unpaid balance equal to the prime rate as established by the American National Bank and Trust Company of Chattanooga, Chattanooga, Tennessee, as of that date. Notwithstanding the above, if upon Eligible Retirement the value of Participant's Account does not exceed $10,000, this amount shall be distributed in a lump sum. 7.2 Unusual Events. In the event of an impending Change of Control or the probable occurrence of any other extraordinary or unusual event, if the Committee determines that such change equitably requires an adjustment in the rate at which amounts credited to a Participant's Employer Contribution Account become vested, or the terms of distribution of any benefit under this Plan, then such adjustment may be made immediately by the Committee and without notice to the Participants. Any action taken by the Committee pursuant to this Article is void if it has the effect of divesting the Participants of their benefits. Such adjustment made by the Committee shall be final, conclusive and binding for all purposes of the Plan. 7.3 Liquidation or Dissolution. In the event of any liquidation or dissolution of the Company (or of any successor), or in the event of the winding up of business of the Company (or of any successor), the balance of the Employer Contribution Accounts shall be distributed within sixty (60) days of the date of such event; provided such liquidation or dissolution is not part of a plan of reorganization of the corporate structure of the Company. 7.4 Income and Payroll Tax Withholding. To the extent required by the laws in effect at the time any amounts are deferred or deferred compensation payments are made under this Plan, the Company shall withhold from such amounts that are deferred or from deferred compensation payments, as the case may be, any taxes required to be withheld for federal, state or local government purposes. ARTICLE VIII SOURCES OF PAYMENTS The Company has established a trust fund ("Trust") which may be used to provide for its benefit obligations hereunder and which the Company will to the extent necessary conform to the terms of the model trust as described in Rev. Proc. 92-64. Benefits payable under this Plan to a Participant may be paid directly by the Company from the Trust in such proportions as the Company determines. To the extent that such benefits are not paid from the Trust, the benefits shall be paid from the general assets of the Company. The Trust is an irrevocable grantor trust, the assets of which are subject to the claims of the creditors of the Company in the event of its insolvency. If so directed by the Committee, expenses of administering the Plan (including reimbursement to the
Company of any payment of benefits or expenses paid by the Company) may be paid from the Trust assets. The assets of the Trust are considered general assets of the Company in the event of bankruptcy or insolvency of the Company. The Board shall have an express obligation to notify the trustee of the Trust in the event of bankruptcy or insolvency or impending insolvency or bankruptcy of the Company. Upon receipt of such notice, the trustee of the Trust shall be obligated to suspend payments from the Trust and hold the Trust assets for the benefit of general creditors or to satisfy the claims of such creditors as directed by a court of competent jurisdiction. The trustee may resume payments to Participants and/or their designated Beneficiaries only after determining that the Company is not bankrupt or insolvent. The Company's obligation to pay benefits pursuant to this Plan shall constitute only a general contractual liability of the Company; and the Company shall not be obligated to set aside, earmark or escrow any funds or other assets to satisfy its obligations under this Plan. Participants and/or their designated Beneficiaries shall not have any property interest in any specific assets of the Company other than the unsecured right to receive payments from the Company as provided herein. ARTICLE IX PLAN ADMINISTRATION The Plan shall be administered by the Committee, which shall have full power and authority to do all things necessary or appropriate for the proper administration hereof. Such power and authority shall include full power and discretionary authority to construe the Plan and Participation Agreement (including the power to interpret all ambiguities) and to determine all questions which may arise thereunder, including questions relating to the status and rights of Participants, Beneficiaries and other persons hereunder. The Committee shall be responsible for resolving any dispute or controversy relating to the Plan or benefits due thereunder. The decision of the Committee shall be final and binding on all parties hereto, and judgment may be entered on the Committee's award in any court having jurisdiction thereof. The Committee may delegate such aspects of the administration to such individuals as the Committee determines. ARTICLE X NON-ALIENATION OF BENEFITS The interests of Participants and their Beneficiaries under this Plan are not subject to the claims of their creditors and may not be voluntarily sold, transferred, alienated, assigned, pledged, anticipated, or encumbered. Any attempt by a Participant, his beneficiary, or any other person to sell, transfer, alienate, assign, pledge, anticipate, encumber, charge or otherwise dispose of any right to benefits payable hereunder shall be void. The Company may cancel and refuse to pay any portion of a benefit which is sold, transferred, alienated, assigned, pledged, anticipated or encumbered. Additionally, the benefits which a Participant may accrue under this Plan are not subject to the terms of any Qualified Domestic Relations Order (as that term is defined in Section 414(q) of the Code) with respect to any Participant, nor shall the Committee, the Company, or any subsidiary of the Company be required to comply with the terms of such order in connection with this Plan. ARTICLE XI AMENDMENT AND TERMINATION The Company hereby reserves the right, by action of the Board, to amend or terminate this Plan at any time, provided that the Board may specifically delegate to the Committee or to the President the right to amend the Plan. Notwithstanding the foregoing, the Company shall not amend or terminate the Plan in any manner that would diminish or otherwise reduce the benefits Eligible Employees had accumulated prior to such amendment or termination. Furthermore the Company shall not amend or terminate the Plan, or take any other action that would otherwise result in a reversion of any assets held pursuant to the Plan of the Company, except as otherwise provided in Article VIII of this Plan. ARTICLE XII GENERAL PROVISIONS
12.1 Benefits to Whom Paid; Facility of Payment. Payments for a deceased Participant shall be made to the Participant's Beneficiary; and, in the sole discretion of the Committee whenever a Participant has terminated employment and is entitled to receive future payments in the form of an
annuity, such payments may be made in a lump sum. All other payments shall be made to the Participant. Notwithstanding the foregoing, when any person entitled to a distribution under this Plan is under a legal disability, or, in the opinion of the Committee, is in any way incapacitated so as to be unable to manage his financial affairs, the Committee may direct that the distribution to which such person otherwise would be entitled shall be made to such person's legal representative(s) or to a relative or friend of such person for such person's benefit, or the Committee may direct the application of such distribution for the benefit of such person in such manner as the Committee considers advisable. Any payment made in good faith in accordance with provisions of this Section shall be a complete discharge of any liability for the making of such payment under the provisions of this Plan. Any property, whether principal or income, distributable to any person (adult or minor) entitled to payment of benefits under the terms of this Plan may be applied for the benefit of such person, and in the case of a minor, may be paid or delivered directly to the minor, to a guardian or parent of the minor, to a person with whom the minor resides, to a custodian for the minor under any Uniform Gifts to Minors Act or similar statute or to the trustee of a trust created by the Participant by will or otherwise for the benefit of such minor. 12.2 No Guarantee of Employment. This Plan is not a contract of employment, and nothing in this Plan shall be construed as guaranteeing future employment to Eligible Employees. An Eligible Employee continues to be an Employee of the Employer solely at the will of the Employer. Successors. The provisions of this Plan shall be binding upon the Company and all of its subsidiaries and their successors and assigns and upon every Participant and his heirs, Beneficiaries, estate and legal representatives. Required Information to Committee. Each Participant will furnish to the Committee such information as the Committee considers necessary or desirable for purposes of administering the Plan; and the provisions of the Plan respecting any payments thereunder are conditional upon that Participant furnishing promptly such true, full and complete information as the Committee may request. Each Participant will submit proof of his age to the Committee at such time as required by the Committee. The Committee will, if such proof of age is not submitted as required, use as conclusive evidence thereof such information as is deemed by it to be reliable, regardless of the lack of proof. Any notice or information which, according to the terms of the Plan or the rules of the Committee, must be filed with the Committee, shall be deemed so filed if delivered in person to the Committee or mailed to and received by the Committee at the following address: Retirement Committee c/o Dixie Yarns, Inc. P.O. Box 751 Chattanooga, Tennessee 37401 12.5 Indemnification. The Company will indemnify and hold harmless the Committee and each member and each person to whom the Committee has delegated responsibility under Article IX from all joint and several liability for their acts and omissions and for the acts and omissions of their duly appointed agents in the administration of the Plan, except for their own willful misconduct; provided that any person who is insured against losses arising from the administration of the Plan will be entitled to indemnification only to the extent that the amount of his liability exceeds the amount payable through insurance. Designation of a Beneficiary. Each Participant shall
specifically designate, by name, on forms provided by the Committee, the Beneficiary(ies) who shall receive any benefits which might be payable after his death. Such designation may be made at any time satisfactory to the Committee. If a Participant has not designated a Beneficiary in the manner provided above, the Participant's estate shall be the Beneficiary. A designation of a Beneficiary may be changed or revoked without the consent of the Beneficiary at any time or from time to time in such manner as may be provided by the Committee; and the Committee shall have no duty to notify any person designated as a Beneficiary of any change in any such designation which might affect such person's present or future rights hereunder. Except as provided in Section 12.1, any payment under this Plan which may be made to a Beneficiary after the death of a Participant shall be made only to the person(s) or trust(s) designated pursuant to this Section by the Participant. 12.7 Claims Submission and Review Procedure. Any claim for benefits must initially be submitted in writing to the Committee. If such claim is denied (in whole or in part), the claimant shall receive from the Committee notice in writing, written in a manner calculated to be understood by the claimant, setting forth the specific reasons for denial, with specific reference to pertinent provisions of this Plan. Such notice shall be provided within 90 days of the date the claim for benefits is received. Any disagreements about such interpretations and construction may be appealed within 60 days to the Company, or any committee of the Board designated for this purpose. The Company shall respond to such appeal within 60 days with a notice in writing fully disclosing its decision and the reasons therefore. No member of the Board of Directors, or any committee thereof, shall be liable to any person for any action taken hereunder except those actions undertaken with lack of good faith. Income and Payroll Tax Withholding. To the extent required by the laws in effect at the time deferred compensation payments are made under this Plan, the Company shall withhold from such deferred compensation payments any taxes required to be withheld for federal, state or local government purposes. Official Actions. Any action required to be taken by the Board pursuant to the Plan may be performed by any person or persons, including a committee, to which the Board delegates the authority to take actions of that kind. Whenever under the terms of this Plan a corporation is permitted or required to take some action, such action may be taken by an officer of the corporation who has been duly authorized by the board of directors of such corporation to take actions of that kind. Unclaimed Benefits. In the event the Committee cannot locate any person entitled to receive any Participant's Account balance, with reasonable effort and after a period of five years, such Participant's interest will be canceled but will be reinstated within 60 days after the Participant or, if he is dead, his Beneficiary is located. Controlling State Law. To the extent not superseded by the laws of the United States, the Plan will be construed and enforced according to the laws of the State of Tennessee. Severability. In case any provision of this Plan shall be held illegal or invalid for any reason, such illegality or invalidity shall not affect the remaining provisions of the Plan; and the Plan shall be construed and enforced as if such illegal and invalid provisions had never been set forth.
IN WITNESS WHEREOF, the Dixie Yarns, Inc. Nonqualified Defined Contribution Plan, as amended, is
executed on behalf of the Company as of November 18, 1993. DIXIE YARNS, INC.
By: \s\ W. Derek Davis Title: V.P., Human Resources ATTEST: \s\ Jeffery Laseter
Less than 4% 4 5 6 7 8 9 10 and over
OMITTED ITEM ____________ DESCRIPTION ___________
Schedule A Schedule B
Beneficiary Designation Election of Form of Benefit Payment at Eligible Retirement
Form of Participation Agreement
To top
|
global_05_local_5_shard_00000035_processed.jsonl/30806
|
Mastering Phpmyadmin for Effective Mysql Management - PDF by kub58367
More Info
Mastering phpMyAdmin 2.11 for
Effective MySQL Management
Marc Delisle
Chapter No. 10
"Table and Database Operations"
In this package, you will find:
A Biography of the author of the book
A preview chapter from the book, Chapter NO.10 "Table and Database Operations"
A synopsis of the book’s content
Information on where to buy this book
About the Author
Marc Delisle is a member of the MySQL Developers Guild—which regroups
community developers—because of his involvement with phpMyAdmin. He started to
contribute to this popular MySQL web interface in December 1998, when he made the
first multi-language version. He has been actively involved with this software project
since May 2001 as a developer and project administrator.
Marc has worked since 1980 at Collège de Sherbrooke, Québec, Canada, as an
application programmer and network manager. He has also been teaching networking,
security, and PHP/MySQL application development. In one of his classes, he was pleased
to meet a phpMyAdmin user from Argentina.
four children.
This book is Marc's first one, and was followed by "Creating your MySQL Database:
Practical Design Tips and Techniques", also with Packt Publishing.
I am truly grateful to Louay Fatoohi who approached me for this book
project, and to the Packt team whose sound comments were greatly
appreciated during the production. My thanks also go to Garvin Hicking,
Alexander Marcus Turek, and Kai 'Oswald' Seidler, the reviewers for the
successive editions of this book. Their sharp eyes helped in making this
book clearer and more complete.
Finally, I wish to thank all contributors to phpMyAdmin's source code,
translations, and documentation; the time they gave to this project still
inspires me and continues to push me forward.
For More Information:
Mastering phpMyAdmin 2.11 for
Effective MySQL Management
Providing a powerful graphical interface for managing MySQL, phpMyAdmin is one of
the most popular open source applications. While most MySQL developers use routine
phpMyAdmin before walking you through every facet of this legendary tool.
Used by millions of developers, MySQL is the most popular open source database,
supporting numerous large dynamic websites and applications. MySQL has acquired this
wide popularity by virtue of its open source nature, performance, reliability, robustness,
and support for various platforms. However, this popularity has also been helped by the
existence of phpMyAdmin, the industry standard administration tool that makes database
management easy for both the experienced developer and their novice.
from unlocking the full potential of this powerful application.
What This Book Covers
Chapter 1 will take a look at how the Web has evolved as a means to deliver applications
and why we should use PHP/MySQL to develop these applications. We'll also take a look
at how phpMyAdmin is recognized as a leading application to interface MySQL from the
Web, the history of phpMyAdmin, and a brief list of its features.
Chapter 2 will take a look at the common reasons for installing phpMyAdmin, the steps
for downloading it from the main site, the basic configuration, and uploading it to our
web server. We will also learn how to use a single copy of phpMyAdmin to manage
multiple servers, and the usage of authentication types to fulfill the needs of a users'
group while protecting authentication credentials.
Chapter 3 will take a look at the phpMyAdmin interface in detail.
Chapter 4 will cover how to create a database and tables, and how to enter data,
manually, in the tables. We'll also see how to confirm the presence of data by using
the browse mode; including the SQL query links, navigation bar, sorting options, and
row marking.
For More Information:
Chapter 5 will examine concepts like editing data, including the null field and using the
Tab key, applying a function to a value, duplicating rows of data, and deleting data,
tables, and databases.
Chapter 6 will cover how to add fields, including special field types like TEXT, BLOB,
ENUM, and SET, how to use a calendar popup for DATE, DATETIME, and
TIMESTAMP fields, and how to upload binary data into a BLOB field. We'll also see
how to manage indexes (multi-field and full-text) and get feedback from MySQL about
which indexes are used in a specific query.
Chapter 7 will examine the various ways to trigger an export: from the Database view,
the Table view, or a results page. We'll also take a look at the various available export
formats, their options, the possibility of compressing the export file, and the various
places where it might be sent.
Chapter 8 will look at the various options in phpMyAdmin that allow us to import data,
the different mechanisms involved in importing SQL and CSV files, the limits that we
might hit when trying a transfer, and ways to bypass these limits.
Chapter 9 will cover single-table searches with query by example criteria and additional
criteria specification, selecting displayed values, and ordering results. We'll also look at
wildcard searches and full database search.
Chapter 10 will cover the operations we can perform on whole tables or databases. We'll
take a look at table maintenance operations for table repair and optimization, changing
various table attributes, table movements, including renaming and moving to another
database, and multi-table operations.
Chapter 11 will take a look at the installation of the necessary infrastructure for keeping
special metadata (data about tables), and we'll learn how to define relations between both
InnoDB and non-InnoDB tables. We'll also examine the modified behavior of
phpMyAdmin when relations are present, foreign keys, getting information from the
table, the Designer feature, and column-commenting.
Chapter 12 will take a look at the purpose of query boxes and where they can be found.
We'll also look at query window options, multi-statement queries, how to use the field
selector, how to use the SQL Validator, and how to get a history of the typed commands.
For More Information:
Chapter 13 will cover various aspects such as opening the query generator, choosing
tables, entering column criteria, sorting and showing columns, and altering the number of
criteria rows or columns. We'll also see how to use the AND and OR operators to define
relations between rows and columns, and how to use automatic joins between tables.
Chapter 14 will take a look at how to record bookmarks (after or before sending a query),
how to manipulate them, and how some bookmarks can be made public. We'll learn
about the default initial query for Browse mode. We'll also see passing parameters to
bookmarks and executing bookmarks directly from the pma_bookmark table.
Chapter 15 will cover the documentation features offered by phpMyAdmin—the print
view for a database or a table, and the data dictionary for a complete column list. We'll
also see PDF relational schemas.
Chapter 16 will examine how we can improve the browsing experience by transforming
data using various methods. We'll see thumbnail and full-size images of .jpeg and .png
BLOB fields, generate links, format dates, display only parts of texts, and execute
external programs to reformat each cell's contents.
Chapter 17 will cover the use of language files in phpMyAdmin. We'll look at UTF-8
and the impact of switching from one character set to another. We also see how
phpMyAdmin has to recode data when the version of MySQL is earlier than 4.1.x, and
take a look at the character set and collation features of MySQL version 4.1.x and later.
Chapter 18 will cover how phpMyAdmin permits to manage the main features of
MySQL 5.0.
Chapter 19 will discuss how a system administrator can use the phpMyAdmin server
server protection.
Chapter 20 proposes guidelines for solving some common problems, and gives hints on
how to avoid them. It also explains how to interact with the development team for
support, bug reports, and contributions.
For More Information:
Table and Database
In the previous chapters, we dealt mostly with table fields. In this chapter, we
will learn how to perform some operations that influence tables or databases as a
whole. We will cover table attributes and how to modify them, and also discuss
multi-table operations.
Various links that enable table operations have been put together on one sub-page of
the Table view: Operations. Here is an overview of this sub-page:
For More Information:
Table and Database Operations
Table Maintenance
During the lifetime of a table, it repeatedly gets modified, and so grows and shrinks.
Outages may occur on the server, leaving some tables in a damaged state.
Using the Operations sub-page, we can perform various operations, but not every
operation is available for every table type:
• Check table: Scans all rows to verify that deleted links are correct. Also, a
checksum is calculated to verify the integrity of the keys; we should get an
'OK' message if everything is all right.
• Analyze table: Analyzes and stores the key distribution; this will be used
on subsequent JOIN operations to determine the order in which the tables
should be joined.
• Repair table: Repairs any corrupted data for tables in the MyISAM and
ARCHIVE engines. Note that the table might be so corrupted that we cannot
even go into Table view for it! In such a case, refer to the Multi-Table
Operations section for the procedure to repair it.
• Optimize table: This is useful when the table contains overheads. After
massive deletions of rows or length changes for VARCHAR fields, lost bytes
remain in the table. phpMyAdmin warns us in various places (for example,
in the Structure view) if it feels the table should be optimized. This operation
is a kind of defragmentation for the table. In MySQL 4.x, this operation
works only on tables in the MyISAM, Berkeley (BDB), and InnoDB engines.
In MySQL 5.x, it works only on tables in the MyISAM, InnoDB, and
ARCHIVE engines.
• Flush table: This must be done when there have been lots of connection
errors and the MySQL server blocks further connections. Flushing will clear
some internal caches and allow normal operations to resume.
• Defragment table: Random insertions or deletions in an InnoDB table
fragment its index. The table should be periodically defragmented for faster
data retrieval.
The operations are based on the underlying MySQL queries
available—phpMyAdmin is only calling those queries.
Changing Table Attributes
Table attributes are the various properties of a table. This section discusses the
settings for some of them.
[ 162 ]
For More Information:
Chapter 10
Table Type
The first attribute we can change is called Table storage engine:
This controls the whole behavior of the table: its location (on-disk or in-memory),
the index structure, and whether it supports transactions and foreign keys. The
drop-down list may vary depending on the table types supported by our
MySQL server.
Changing the table type may be a long operation if the number of rows
is large.
Table Comments
This allows us to enter comments for the table.
[ 163 ]
For More Information:
Table and Database Operations
These comments will be shown at appropriate places (for example, in the left panel,
next to the table name in the Table view and in the export file). Here is what the left
panel looks like when the $cfg['ShowTooltip'] parameter is set to its default
value of TRUE:
The default value of $cfg['ShowTooltipAliasDB'] and $cfg['ShowTooltipAlias
TB'] (FALSE) produces the behavior we have seen earlier: the true database and table
names are displayed in the left panel and in the Database view for the Structure
sub-page. Comments appear when the mouse pointer is moved over a table name. If
one of these parameters is set to TRUE, the corresponding item (database names for
DB and table names for TB) will be shown as the tooltip instead of the names. This
time, the mouse-over shows the true name for the item. This is convenient when the
real table names are not meaningful.
There is another possibility for $cfg['ShowTooltipAliasTB']: the 'nested' value.
Here is what happens if we use this feature:
• The true table name is displayed in the left panel.
• The table comment (for example project__) is interpreted as the project
name and is displayed as such. (See the Nested Display of Tables Within a
Database section in Chapter 3).
Table Order
When we Browse a table or execute a statement such as SELECT * from book,
without specifying a sort order, MySQL uses the order in which the rows are
physically stored. This table order can be changed with the Alter table order by
dialog. We can choose any field, and the table will be reordered once on this field.
We choose author_id in the example, and after we click Go, the table gets sorted on
this field.
Reordering is convenient if we know that we will be retrieving rows in this order
most of the time. Moreover, if later we use an ORDER BY clause and the table is
already physically sorted on this field, the performance should be higher.
[ 164 ]
For More Information:
Chapter 10
This default ordering will last as long as there are no changes in the table
(no insertions, deletions, or updates). This is why phpMyAdmin shows the
(singly) warning.
After the sort has been done on author_id, books for author 1 will be displayed
first, followed by the books for author 2, and so on. (We are talking about a default
browsing of the table without explicit sorting.) We can also specify the sort order:
Ascending or Descending.
If we insert another row, describing a new book from author 1, and then click
Browse, the book will not be displayed along with the other books for this author
because the sort was done before the insertion.
Table Options
Other attributes that influence the table's behavior may be specified using the Table
options dialog:
The options are:
• pack_keys: Setting this attribute results in a smaller index; this can be read
faster but takes more time to update. Available for the MyISAM storage engine.
• checksum: This makes MySQL compute a checksum for each row. This
results in slower updates, but easier finding of corrupted tables. Available for
MyISAM only.
[ 165 ]
For More Information:
Table and Database Operations
• delay_key_write: This instructs MySQL not to write the index updates
immediately but to queue them for later, which improves performance.
Available for MyISAM only.
• auto-increment: This changes the auto-increment value. It is shown only if
the table's primary key has the auto-increment attribute.
Renaming, Moving, and Copying Tables
The Rename operation is the easiest to understand: the table simply changes its
name and stays in the same database.
The Move operation (shown in the following screen) can manipulate a table in two
ways: change its name and also the database in which it is stored:
Moving a table is not directly supported by MySQL, so phpMyAdmin has to create
the table in the target database, copy the data, and then finally drop the source table.
The Copy operation leaves the original table intact and copies its structure or data
(or both) to another table, possibly in another database. Here, the book-copy table
will be an exact copy of the book source table. After the copy, we will stay in the
Table view for the book table unless we selected Switch to copied table.
The Structure only copy is done to create a test table with the same structure.
[ 166 ]
For More Information:
Chapter 10
Appending Data to a Table
The Copy dialog may also be used to append (add) data from one table to another.
Both tables must have the same structure. This operation is achieved by entering the
table to which we want to copy the data of the current table and choosing Data only.
For example, we would want to append data when book data comes from various
sources (various publishers), is stored in more than one table, and we want to
aggregate all the data to one place. For MyISAM, a similar result can be obtained by
using the MERGE storage engine (which is a collection of identical MyISAM tables) but
if the table is InnoDB, we need to rely on phpMyAdmin's Copy feature.
Multi-Table Operations
In the Database view, there is a checkbox next to each table name and a drop-down
menu under the table list. This enables us to quickly choose some tables and perform
an operation on all those tables at once. Here we select the book-copy and the book
tables, and choose the Check operation for these tables.
We could also quickly select or deselect all the checkboxes with
Check All / Uncheck All.
[ 167 ]
For More Information:
Table and Database Operations
Repairing an "in use" Table
The multi-table mode is the only method (unless we know the exact SQL query to
type) for repairing a corrupted table. Such tables may be shown with the in use flag
in the database list. Users seeking help in the support forums for phpMyAdmin often
receive this tip from experienced phpMyAdmin users.
Database Operations
The Operations tab in the Database view gives access to a panel that enables us to
perform operations on a database taken as a whole.
[ 168 ]
For More Information:
Chapter 10
Renaming a Database
Starting with phpMyAdmin 2.6.0, a Rename database dialog is available. Although
this operation is not directly supported by MySQL, phpMyAdmin does it indirectly
by creating a new database, renaming each table (thus sending it to the new
database), and dropping the original database.
Copying a Database
Since phpMyAdmin 2.6.1, it is possible to do a complete copy of a database, even if
MySQL itself does not support this operation natively.
In this chapter, we covered the operations we can perform on whole tables or
databases. We also took a look at table maintenance operations for table repair
and optimization, changing various table attributes, table movements, including
renaming and moving to another database, and multi-table operations.
[ 169 ]
For More Information:
Where to buy this book
You can buy Mastering phpMyAdmin 2.11 for Effective MySQL Management from the
Packt Publishing website:
read our shipping policy.
most internet book retailers.
For More Information:
To top
|
global_05_local_5_shard_00000035_processed.jsonl/30820
|
Don't call 135 format "FF" ANY MORE!!!
Started May 25, 2012 | Discussions thread
Veteran MemberPosts: 3,095
FF means 36x24mm
In reply to dark goob, May 26, 2012
While you could argue a m43 system is "full frame", because it in fact uses the full frame of the lens, most don't call it "full frame", because it already has a commonly defined moniker, which is "four thirds" The term "four thirds" defines a sensor about 18x13mm, and the term "full frame" commonly defines a sensor 36x24mm. And of course there are sizes inbetween, ACP-H, APS-C, etc etc.
So, you can call a m43 sensor "full frame" if you like, but to most in the digital world you would be referring to a sensor that once again is 36x24mm. You could more clearly use the term "four thirds" as opposed to "full frame", so the rest of the world, not just an odd minority of m43fanboys, would know which sensor you're referring to.
And if you mistakenly think I'mknocking the format, I'm not. I shoot with a full frame Nikon D800 and a m43 OM-D. Love them both!
And to simply support this fact, literally every digital camera knowledge source on the net supports this common naming convention. This is a LONG list of respected references you're going to have to convince they're wrong. If you'd be wise enough to do a little research here you'll see every one of these sourses refers to a full frame sensor as being 36x24mm in size, and a four thirds sensor being 18x13 in size. Pretty simple really:
-- hide signature --
Reply Reply with quote Complain
Post (hide subjects)Posted by
Keyboard shortcuts:
Color scheme? Blue / Yellow
|
global_05_local_5_shard_00000035_processed.jsonl/30824
|
4K Video for $400
Started Oct 23, 2012 | Discussions thread
Contributing MemberPosts: 522
Re: 4K Video for $400 + $25,000 + $5,000 + Time + Perspiration
In reply to Cy Cheze, Oct 30, 2012
Cy Cheze wrote:
Any 4k video will be worthless without a large 4k display, without a PC with sufficient spec to edit 4k video, or without the time and effort to make something that makes worthy use of 4k resolution. Of course, all is for naught if there is no audience with the bandwidth, displays, or players necessary to see it.
27" ultra def displays sell for under $1k, but they do justice to 4k only if the viewer is a few inches from the screen, which is not the usual viewing distance for video.
Use of large 4k screens will be limited to theaters, other commercial venues, or mega-McMansions until the prices come down from $25k to perhaps $2.5k, perhaps by 2016. Actual 4k content will lag too, so long as the requisite bandwidth is too expensive or there is no 4k Blu-ray. Upscaling of 1920x1080 video is not a good reason to get a 4k screen.
I have to repeat this every time 4k cameras are mentioned... 4k footage resized to 1080p will look a lot better than native 1080p, as most cameras that record 1080p only use one colour sample per pixel (bayer interpolation). It's like comparing a 2 megapixel Bayer sensor to a 2 megapixel Foveon. That's why the Canon C300 uses a 4k sensor to produce 1080p video.
You don't need a PC capable of editing 4k to benefit either, just recode the video to 1080p offline (you can set it going overnight if it's really slow).
The potential audience with the bandwidth/display/players necessary to watch 1080p (and thus benefit from full colour 1080p footage from 4k Bayer capture) is huge (HD streaming is all over the web).
No need for 4k displays to benefit from 4k capture.
A DSLR or SLT camera that shoots 4k video will be a problem for several reasons:
1. High bitrate will entail tremendous heat generation and limited shooting duration, since sensors and memory cards may melt unless specially cooled.
2. Narrow DOF and higher resolution will make satisfactory AF almost impossible, and manual focus pulling will be very tricky.
3. Moiré and aliasing, aggravated by sensors with too many megapixels, will require filters that undo much of the added resolution.
4. Any 4k video shot hand-held will look pretty bad, even on a high-end camera, making extra expenditure for a large 4k camera somewhat dubious.
5. Hardly any clients of people who shoot commercial video and buy expensive cameras will pay them to shoot and edit 4k video, since they would have no way to use it at present.
1. 1. The Canon 5D mkIII can shoot full resolution JPEGs at 6fps until the card is full, that means reading 5760 x 3840 x 14 x 6 = 1.9 gbps (gigabits per second) from the sensor, continually. Recording 4K at 24fps requires reading 4096 x 2048 x 14 x 24 = 2.8 gbps. So 1.9 gbps is absolutely fine with a no pro DSLR, but 2.8 gbps entails tremendous heat generation? At most I'd expect 50% more heat.
2. You can always stop down, the larger sensor gives you better noise performance so you can stop down and up the ISO. Or use a wide lens for adequate DOF.
3. Aliasing is much worse the more you skip lines/pixels, and worst when the [spatial] sampling frequency is low. More megapixels means less moire!
4. 4k gives you more data to work with and more opportunity to apply software anti-shake, for example.
5. Again, no need to be able to display 4k to benefit from 4k capture.
All these arguments are the same ones levelled against the D800, e.g. you'll suddenly need a tripod where you wouldn't need one before, nonsense. Aside from processing and storage requirements there is no disadvantage to increased resolution, even if it's harder to realise the full benefit.
Reply Reply with quote Complain
Keyboard shortcuts:
Color scheme? Blue / Yellow
|
global_05_local_5_shard_00000035_processed.jsonl/30856
|
GB Contacts Set-up Questions
Discussion in 'Droid X Tech Support' started by ckball52, Jun 28, 2011.
1. ckball52
ckball52 New Member
Feb 11, 2011
Likes Received:
Trophy Points:
Updated to GB, found out it could sort and search Contacts!!! Spent hours getting it all the way I wanted it (but didn't know to backup to the SD card.) Then GB "fried" my X (per VZ rep!)
So am now reinstalling on the "new" one they just sent. Before I go through what I went through in May(thanks to HookBill for at least saving my sanity), with 356 Contacts in one place and 34 in another (I only own 160 total!?!), I want to get this set up right--and already I am in trouble.
Chose not to use BUA this time around because it links contacts and duplicates data, doesn't sort, etc. Set up GMail account to sync calendar and contacts only. Calendar is syncing fine. Contacts are not. My GMail contacts (140) are all already in groups. My DX contacts (15) are not even recognizable as being from any contact list I own: while most of them are the VZ Account #BAL, #MIN, etc., 3 of my own number, 1 my husband, and 1 our family email!
Went to VZ store for help (LOL), where she promptly synced to BUA. When I looked at it, tried not to freak, and pointed out that I needed to have GMail synced, not BUA, she did a Factory Reset (thanks, Kyla--you're a brick!), then told me she couldn't help. (Should have guessed that and saved the trip!!!)
What settings do I look for to get GMail to sync Contact groups? It did it on the one it fried (hmmmm.)
Last edited: Jun 28, 2011
Search tags for this page
droidforums setting up contacts
|
global_05_local_5_shard_00000035_processed.jsonl/30858
|
The Moto Defy
Discussion in 'Android Hacks and Help' started by Lythos, Feb 19, 2012.
1. Lythos
Lythos New Member
Feb 19, 2012
Likes Received:
Trophy Points:
Hey guys, I'm pretty new when it comes to androids,just got my first one in October last year...and I went with the Motorola Defy.
Since then I've been hearing that my device wont be getting a gingerbread upgrade...ever. So i was kinda taken aback seeing as how phones with 600mz processors have been given 2.3.6 upgrades and stuff
Could you guys please help me out here?
As I said I'm new to droids and was reading about this whole rooting scenario, and was wondering if I should do it. I was looking over at the z4Root app, since it seems to be the most convenient way to root,do you guys know if it would work on my Defy? And if it does could you gimme the link to download the latest one?
One more thing, if i do root it will i be able to get the gingerbread and maybe even ICS?
Thanks in advance guys.
Search tags for this page
motorola defy touch screen calibration
|
global_05_local_5_shard_00000035_processed.jsonl/30881
|
@inproceedings{Rohling2010Prices, abstract = {Regulating inter-country externalities, like climate change, raises various enforcement problems. It is often argued that international pricebased regulations (e.g. emission taxes) are more difficult to enforce than quantity-based regulations (e.g. tradable pollution permits). In this paper, we analyze the relative performance of price-based and quantity-based instruments for cases where costs and benefits are uncertain and enforcement of quantity regimes is stricter than for price-based regimes. We show that under these conditions, instrument choice solely based on the relative slopes of the marginal costs can be inefficient. If enforcement probabilities differ, rational policy choice should also take into account the level of the marginal benefit curve, as well as institutional parameters. In contrast to earlier analyses on Prices vs. Quantities, we find that the difference in welfare for both policy instruments also depends on the variance of the marginal abatement costs. Furthermore, numerical simulations of our stylized model suggest that, for climate policies, quantity-regulations might well be preferable to price-based approaches after all.}, address = {G\"{o}ttingen}, author = {Moritz Rohling}, copyright = {http://www.econstor.eu/dspace/Nutzungsbedingungen}, keywords = {D8; L51; K42; Q58; 330; market-based instruments; incomplete enforcement; environmental regulation; uncertainty}, language = {eng}, number = {24}, publisher = {Verein f\"{u}r Socialpolitik, Ausschuss f\"{u}r Entwicklungsl\"{a}nder}, series = {Proceedings of the German Development Economics Conference, Hannover 2010}, title = {Prices vs. Quantities with incomplete enforcement and different enforcement probabilities}, url = {http://hdl.handle.net/10419/39999}, year = {2010} }
|
global_05_local_5_shard_00000035_processed.jsonl/30886
|
Warsi was right to link UKIP with the BNP
Warsi was right to link UKIP with the BNP
Sayeeda Warsi, co-chair of the Conservative Party, was last night (3 May 2012) brave enough to note a link between the BNP and UKIP. She pointed out that UKIP candidates are standing in areas where the BNP had previously stood, implying that they can draw on the same sort of support.
She triggered a storm of anger, including an abusive Twitter message from a leading member of UKIP (who thus made himself sound more like a far-right thug, rather than less), for which he later apologised.
Warsi was right to make the point. I hope she will not back down. All she has done is to state the obvious: two parties on the same end of the British political spectrum may well attract sympathy from the same voters.
She could go further. Two years ago, ahead of the last general election, I wrote an article comparing the stated policies of the BNP and UKIP (see http://www.ekklesia.co.uk/node/11611). I found even more similarities than I had expected.
It is true that UKIP do not share the BNP's obsession with ethnicity, and this is important. It is also true that the BNP are more statist and that UKIP are basically ultra-Thatcherite in economic terms. In other areas, their policies are very, very similar.
They are both strongly anti-immigration, anti-European, anti-multicultural and pro-military spending. They both deny the reality of climate change. Like totalitarian regimes, they both want to make laws about what people are allowed to wear in public (by banning niqabs). They both make comments on the niqab and on multiculturalism that whip up fear and prejudice against Muslims. They both want biased history teaching that portrays the British Empire in a positive light (this is explicit in their policies). They both support 'workfare'. And they both want extreme, punitive approaches to law and order.
It's not that Warsi went too far. She didn't go far enough. Because one far-right party includes middle class ex-Tories with a polite manner, that doesn't make it any more acceptable than the other one.
(c) Symon Hill is associate director of Ekklesia and author of The No-Nonsense Guide to Religion. For links to more of his writing, please visit http://www.symonhill.wordpress.com.
Symon's 2010 article comparing the polices of UKIP and the BNP can be found at http://www.ekklesia.co.uk/node/11611.
|
global_05_local_5_shard_00000035_processed.jsonl/30896
|
Economics & Social Science
Q&A: when a theoretical article is misinterpreted
Before a paper on the HANDY model was published, findings were taken out of context in some press accounts; here, the authors explain their research
Print Friendly and PDF
Share story:
Recently, a research paper was written about in the media before it was published. The coverage spread around the world with some misinterpreting the article's findings as a doomsday prediction of the collapse of society.
The paper – "Human and nature dynamics (HANDY): Modeling inequality and use of resources in the collapse or sustainability of societies" – was published this month in the journal Ecological Economics.
The authors – Safa Motesharrei, Jorge Rivas and Dr. Eugenia Kalnay – have described their study as "a thought experiment," explaining that it is not intended to make specific predictions about a particular current society. They build upon an existing model: the predator-prey model. A similar approach was taken in the 1998 article by Drs. James A. Brander and M. Scott Taylor for The American Economics Review, "The Simple Economics of Easter Island," which attempts to solve for the equilibrium of renewable resources and population, indicating that once off balance, a society may collapse.
However, for this new paper, the authors introduce inequality and accumulated wealth into the equations to signal how unequal wealth distribution could lead to different outcomes, running the model to reflect different situations.
To put their research in perspective, we emailed the authors questions. Here they are with the authors' written response:[divider]
Q: Can you summarize the main findings of your research?
In this paper, we show that two factors can independently lead to collapse: Ecological Strain and Economic Stratification. We also show that there are two routes to such collapses, which we call Type-L and Type-N collapses. Type-N starts with exhaustion of Nature but Type-L results from the disappearance of Labor because Elite consumption does not leave sufficient resources to meet the needs of Commoners. These two distinct routes to a collapse show over-exploitation of Labor, not just of Nature, can cause a societal collapse.
The Authors
Safa MotesharreiSafa Motesharrei is a Research Assistant at the National Socio-Environmental Synthesis Center and a PhD candidate in Applied Mathematics/Public Policy at the University of Maryland (UMD), College Park. He has bachelor's degrees in electrical engineering and physics and master's degrees in physics and mathematics from UMD. The focus of his work is on integration of the Human System and Population into the Earth System Models.
Eugenia Kalnay, PhDDr. Eugenia Kalnay is Distinguished University Professor in the Department of Atmospheric & Oceanic Science at the University of Maryland. Prior to her coming to UMD, she was Branch Head at NASA Goddard, and later the Director of the Environmental Modeling Center of the National Centers for Environmental Prediction of the National Weather Service from 1987 to 1997. During those 10 years, there were major improvements in the National Weather Service's models' forecast skill. Current research interests are in data assimilation, numerical weather prediction, data assimilation, predictability and ensemble forecasting, coupled ocean-atmosphere modeling and climate change.
Jorge RivasCurrently at the Institute of Global Environment and Society (IGES), Jorge Rivas got his BA in Political Science at McGill University in Montreal and is working on his PhD at the University of Minnesota, Minneapolis. The focus of his work is on the application of philosophy of science to the social sciences, and his specific interests are the use of the scientific realist philosophy of science to make social and economic theories more scientific. His research fields are environmental sustainability, political economy and international relations.
We also show that a sustainable steady state, with the population equal to the Carrying Capacity, is reachable in different types of societies. This requires making rational choices for population, depletion, consumption, and stratification. Very importantly, the experiments show that if population does not overshoot carrying capacity by too much, it would still be possible to eventually converge to it. However, if the overshoot is too large, a full collapse would be hard to avoid.
The HANDY model shows us that Carrying Capacity (the long-term sustainable level of population at a given level of consumption) is the level of population at the time Accumulated Wealth starts to decline, which makes it easy to estimate it in the model. This is because, if the population at a given level of consumption is below the Carrying Capacity, the total consumption is lower than the level of depletion that Nature can maintain, and therefore Wealth can continue accumulating. However, if the population (at a given level of consumption) is above the Carrying Capacity, the total consumption is not covered by the level of depletion that Nature can maintain, and the Accumulated Wealth decreases.
Since we live in an era where we are primarily relying on non-renewable resources, which are by definition unsustainable, the population and its consumption can grow beyond the Carrying Capacity level while still being able to accumulate wealth, because we are rapidly drawing down the natural resources accumulated by Nature over hundreds of millions of years (i.e., fossil fuels).
In further modeling we have done, where we model the use of non-renewables, we find that these non-renewables allow population to rise by an order of magnitude higher than with renewables alone. Thus, the use of non-renewables postpones the collapse, but then when the collapse happens, it is much deeper. (Rivas, Motesharrei and Kalnay, 2014, in preparation).
Furthermore, as we point out in the article, the consumption of natural resources has both depletion and pollution effects, both of which have to be taken into account on the carrying capacity of the natural system, as the HANDY model does. When non-renewable resources (e.g., fossil fuels) are consumed rapidly over just a short time, as we are doing now, this can introduce a quantity of pollution (e.g., the stored carbon accumulated over hundreds of millions of years) large enough to affect the entire global system (e.g., causing climate change). Thus, the rapid release of vast quantities of previously stored carbon is creating changes in the world's climate system that are in turn impacting back on the human system. In addition, these changes to the global climate can create additional positive feedbacks leading to greater climate change, such as the release of previously stored methane in the now melting permafrost, or the decreasing albedo due to the melting of polar sea ice. So the consumption of non-renewables does not occur without significant effects on the entire system.
Carrying Capacity depends on two sets of parameters encompassing properties of both the human system and the natural system. On the socio-economic side, depletion rate, consumption rate, rate of change of population, and degree of inequality can influence the Carrying Capacity. All of these factors can be adjusted by various policies that societies may choose to implement. On the natural system side, Nature Capacity (maximum size of a natural resource) and Nature regeneration rate (rate at which a renewable natural resource can be replenished) can influence the Carrying Capacity. Although these parameters are properties of the natural system, humans can, and do, change them. For example, by replacing parts of a forest with a city, or by over-depleting rivers flowing into a lake and subsequently drying out the lake, we reduce the Nature Capacity.
A few media outlets interpreted the article as a prediction for the collapse of society. Did you envision any of the outcomes to be likely in reality?
In the introduction of our article, we give a brief empirical description of the repeated recurrence of the real historical phenomenon of rise and collapse throughout the world. We built a mathematical model and investigated two of the potential mechanisms that can explain this cycle of real historical rises and collapses. While this paper focuses on variations in depletion and inequality, the HANDY model can also simulate the effects of other factors that can affect sustainability, such as birth rates, consumption rates, and variations of nature's capacity and regeneration rate. The model is not intended to describe actual individual cases, but rather to provide a general framework that allows carrying out "thought experiments" for the phenomenon of collapse and, importantly, to test changes that could avoid it.
Of course we recognize that, as with any complex system, many mechanisms were involved in the real historical cases, but the model is meant to represent the dynamics of two of these mechanisms (depletion and inequality). The model can have implications for the reality of the modern world. Thus our model structure is supported by both theoretical and empirical arguments.
The paper introduces a new method of studying coupled human-nature systems. We build a minimal mathematical model that can capture repeated historical patterns. We test our model by comparing the behavior we find in our experiment results to the general trends seen many times in the past societies.
Our article does not make a "doomsday prediction of the collapse of society." In fact, we state in multiple locations in the article that our model shows that a sustainable outcome is possible, including right in the abstract, where we state that the model shows that "collapse can be avoided, and population can reach a steady state."
You have described this study as a "thought experiment." Can you please explain what you meant by this?
This question brings up the subject of why we chose to do a minimal model. There might be hundreds of variables involved in a complex system. To model many of those variables is not only tedious (if not impossible) but also makes it very difficult to understand the role of interactions between major variables of the system. It would be very difficult to collect accurate quantitative data for such studies that look into the past several thousand years. With a minimal model, one can more easily find and explore the most influential parameters in the system. Most importantly, one can understand the role that the feedbacks (especially bidirectional feedbacks) play in the dynamics of the system. So in essence, minimal models can help us think more clearly about a complex system and understand the most important mechanisms that govern the system, without being confused with the many less significant elements of the full system. A minimal model of a complex system is not meant to capture all the variables and parameters of the full system.
A minimal model like HANDY can give us insights about what would happen in a complex system if we change some parameters, i.e., if we perform "a thought experiment." Using HANDY to respond to questions like these – "What would happen if we reduce inequality?" or "if we reduce birth rates by half?", "if we reduce the depletion by half?", "if we reduce the working hours of the Commoners?", "if climate change reduces the services provided by nature?" — is akin to performing thought experiments.
In HANDY, for example, we put together populations of all ages and genders into a single stock. In order to understand inequality, we break this stock into two separate stocks of Elites and Commoners. We also introduce a single parameter that determines the extent of inequality. Moreover, we assume a single stock represents all of the natural resources. Of course, one could make this a lot more detailed by adding thousands of age/gender/income-specific population stocks and hundreds of specific resource stocks. However, the value that would be added by a much more detailed model for studying historical (or even current and future) trends is low for two reasons. First, the detailed historical data is very difficult to collect. Second, and more importantly, doing meaningful experiments and making sensible, insightful interpretations becomes difficult when dealing with hundreds (or thousands) of variables.
Can it be used to make predictions about our society?
We need to first distinguish between "forecast" and "prediction." For example, using the laws of physics and millions of atmospheric observations, many national weather services use mathematical models to forecast the weather for tomorrow, the day after tomorrow, and up to about a week. But we cannot forecast the weather for a given day next month or next year because of chaos (the "butterfly effect"). On the other hand, the characteristics of climate (usually defined as the weather averaged over many years) can be predicted. For example, we can predict that in 25 years, summer will be warmer than winter, and that if we continue dumping greenhouse gases into the atmosphere and the ocean like we are doing now, the mean global temperature will increase by at least 4 degrees Celsius.
With a physical system with known laws and well-defined, measurable variables, we can build a mathematical model that captures the dynamics of that system and it can be validated by comparing model "forecasts" with the measurements from the real system, as is the case for weather. On the other hand, when we are dealing with a human system where many of the variables and quantities are not (or cannot be) sharply defined and measured, we can only make qualitative, long-term predictions about the future behavior of the system, as we do now with climate change. This can be done through developing measures (for example, Carrying Capacity in HANDY) and proxies that can be observed in the complex, real system.
And lastly, there is fundamental difference between a Coupled Human-Nature System and a purely natural (physical) system. In the latter, the evolution of the system and the interactions among the elements of the system are set by physical laws, properties, and parameters. On the other hand, with humans present in a system, the evolution, to a large extent, is determined by the parameters that can be changed based on human decisions, such as the implementation of policies. This is why the path of evolution heavily depends on how we set those parameters, and this is why one cannot make a single "forecast" for a human system, but rather predict a set of potential "scenarios" based on parameter choices.
So in a nutshell, we can make general predictions about the behavior of a certain coupled human-nature system in the long term. But it would not be possible to make any specific "forecast" with high certainty for the future of the real system.
Why is this research interesting for scientists now?
There is a great interest in the scientific community to understand how to couple human and earth systems bidirectionally so that the feedback to changes introduced by the human economy are included. "Bidirectional" means that the feedbacks go in both directions between the human systems and natural systems. For example, if humans create deforestation, the impacts of deforestation (erosion, loss of soil, etc.) have a feedback on the humans that is accounted for within the model. One cannot understand the dynamics of the system or make long-term predictions without these two-way feedbacks. There is also a new science of the mathematical modeling of historical human system dynamics (called Cliodynamics) that is very much related to the modeling used in HANDY.
The HANDY model is interesting for scientists working with these kinds of models, because our model is a substantial development beyond the previously existing ones, such as Brander and Taylor (1998) and many follow-up models that have appeared in Ecological Economics. There are two important new features in the structure of the HANDY model: the introduction of Accumulated Wealth as a separate stock from Natural Resources, and the introduction of economic inequality in the consumption of resources. This resulted into many interesting behaviors and properties that have not been captured by previous models.
First, economic inequality, can independently lead to a societal collapse. This is shown in the Type-L collapse scenario in the paper, where an otherwise sustainable society that even seems to be on a sustainable path for a long time can collapse due to introducing a small seed of Elite population into the system with a high level of inequality. Another interesting feature of this scenario is that population and wealth collapse even though Nature recovers to the level of its full capacity.
Second, accumulation of wealth allows full collapses to take place, as opposed to animal populations, such as foxes and rabbits, that undergo cyclical variations (as in the predator-prey system) basically because animals cannot save their physical resources. This is an essential dynamical feature that other similar models could not achieve. It was pointed out to us by one of the Peer-Reviewers of our paper and took us a while to fully understand.
Third, HANDY shows that Carrying Capacity is dynamic, and adjusts to changes in the parameters and properties of both the human system and the natural system, and both of these two sets of parameters can be adjusted based on decisions, either directly or indirectly. This is another reason why human decision-making is so important. If we make the right choices, we can not only reach an equilibrium, but we can do so at an optimal Carrying Capacity level.
Why is this research interesting to the general public?
A value for the general public rises from another very important characteristic of a minimal model: accessibility. Ease of understanding a model shrinks with its growing complexity. A minimal model can be understood by virtually anyone who has a general grasp of mathematics and the modeled system. This is the reason why minimal models are ideal tools for education.
The isolation of the key mechanisms and the highlighting of bidirectional feedbacks allow one to focus on the effects of changing the parameters on the interactions of the key variables. This means that minimal models can also help decision-makers understand the effects of a range of policy choices on the possible behaviors of the system.
There are frequent reports and news about sustainability challenges that the world faces if we continue on the same path without making changes. An example of such news are the comments made recently by the President of the World Bank who discussed inequality and climate change as the two primary causes of forthcoming crises (e.g., water scarcity and high food prices). He predicted, "Fights over water and food are going to be the most significant direct impacts of climate change in the next five to 10 years. There's just no question about it." The public can use a minimal model like HANDY to better understand why such factors could be keys to sustainability.
Another example is the news of the recently published fifth assessment report of IPCC, which was discussed all over the media. Based on this report, the IPCC Chairman stated that unless proper policies are put into effect, "social stability of the human systems could be at stake." While experimenting with and understanding the complex models used to prepare this comprehensive assessment is very difficult for the general public, they can understand and experiment with a minimal model like HANDY to understand the impact of different factors that can risk the social stability of the human systems.[divider]
Read the article
The article is open access. You can view it here: Human and nature dynamics (HANDY): Modeling inequality and use of resources in the collapse or sustainability of societies, Ecological Economics, May 2014, Vol. 101.
Elsevier Connect Contributor
Kitty van HensbergenKitty van Hensbergen is the Marketing Communications Manager for Environmental Science and Ecology Journals (@ELSenviron) at Elsevier. She has an MSc degree in Economics and Business, specializing in Marketing, from the Erasmus University Rotterdam. She is based in Amsterdam.
comments powered by Disqus
Share story:
|
global_05_local_5_shard_00000035_processed.jsonl/30899
|
Mr. Cleaner
A robovac is all fine and good if you're one of those high rollers who can actually afford carpeting (we can only dream), but if you have to satisfy yourself with hardwood or tile floors—or if you're tired of sweeping the vinyl flooring in your kitchen—you might want to introduce yourself to Mr. Cleaner, a new roboduster from imoyo that uses an electrostatic pad and the barest amount of artificial intelligence (translation: it just keeps going until it bumps into a wall) to keep your floors clean. Sounds like this bad boy falls somewhere between the Roomba and the RoboMaid. Sells in South Korea for around a hundred bucks.
Public Access
The Bangarama
|
global_05_local_5_shard_00000035_processed.jsonl/30901
|
EuroGamer discusses Microsoft's dominance at the Leipzig Game Convention. Choice quotes:
"The PR victory scored by Microsoft here cannot be underestimated. The power of the company's spin machine continues to leave the rest of the games industry in awe even after an entire console generation of experience"
..."There is a very clear winner, and a very clear loser, in the Leipziger Messe this week, as 150,000 consumers are currently finding out - and hundreds of press types have already discovered. The winner is Microsoft."
Being European, these guys make a big deal out of Microsoft cornering the soccer market. However, 1up reports that MS may have..gulp..exaggerated (normally a Sony trademark) the extent of that coup (It looks like Pro Evo/Winning 11 and FIFA are "exclusive" only until the Konami and EA can finish developing them for the PS3). Was Sony's lack of a response due to calm knowledge that MS was over-selling its football shut out, or just their usual "Riiiiidge Racer" corporate buffoonery?
[Thanks Charch & Lorul2]
This article was originally published on Joystiq.
|
global_05_local_5_shard_00000035_processed.jsonl/30904
|
This week, the lone WiiWare release is a deer hunting game from Arc System Works. We would have expected such a game to come from an American publisher first, so we're a bit surprised to see ASW premiere it in Japan. Not surprised enough to pay that much attention.
Our attention is fixed, instead, firmly on the Virtual Console. Between the proto-strategy game Famicom Wars and Namco's arcade arena combat game Cyber Sled, it's a pretty awesome week to have a Wii in Japan. Even if we're pretty sure the Virtual Console Arcade version of Cyber Sled can't have multiplayer (since the arcade game used separate cabinets for each player).
Virtual Console:
• Shikagari (Hunting) (1-4 players, 500 Wii Points)
[Image via The Arcade Flyer Archive]
This article was originally published on Joystiq.
Bizarre Creations' Blur to trade paint this fall
|
global_05_local_5_shard_00000035_processed.jsonl/30907
|
Adobe Edge swells to include Tools & Services, streamlines the designer web
Adobe really wants web designers to kick things up a notch. Not satisfied with where Edge has gone so far, it just released a full-fledged Edge Tools & Services suite to cover the bases for polished desktop and mobile pages on most any modern platform. Motion tool Edge Animate (formerly Edge Preview), automated previewing tool Edge Inspect (formerly Shadow) and mobile app packager PhoneGap Build have all arrived in the suite as version 1.0 releases, and come with both Edge Web Fonts as well as TypeKit to spruce up text. A pair of pre-release utilities, Edge Code (Brackets) and Edge Reflow, are also joining the group to tackle the nitty-gritty of editing web code and layouts. Any of the apps will readily cooperate with third-party software, although they won't always be cheap: while most of the Edge suite is free to use in at least a basic form as long as you have a Creative Cloud membership at any level, Edge Animate is only free during its initial run and should eventually cost either $15 per month or $499 in a one-time sale. For pros that want to burnish their corner of the web to a shine, the result just might be worth the expense.
Show full PR text
Adobe Unveils Edge Tools & Services for Creating Beautiful Web Experiences
SAN JOSE, Calif. - Sept. 24, 2012 - At its Create the Web event, Adobe Systems Incorporated (Nasdaq:ADBE) today unveiled an innovative set of tools and services to help designers and developers more easily create beautiful websites, digital content and mobile apps using the latest Web technologies, including HTML5, CSS3, and JavaScript. During the keynote session, hosted by chief technology officer Kevin Lynch, Adobe introduced Edge Tools & Services and announced immediate availability of Adobe Edge Animate 1.0, Adobe Edge Inspect 1.0 (formerly codenamed "Shadow"), Adobe PhoneGap Build 1.0, Adobe Edge Web Fonts and a preview of Adobe Edge Code. Adobe also demonstrated a sneak peek of Adobe Edge Reflow in anticipation of a preview release expected by the end of the year.
"We are excited to put a powerful new set of HTML5 tools into the hands of Web designers and developers and can't wait to experience the beautiful websites, digital content and mobile apps they'll create," said Danny Winokur, vice president and general manager, interactive development at Adobe. "We are passionate about enabling creative people to do anything they can imagine with Web technologies, which is why we're contributing to the Web platform and making the Edge Tools & Services available for free, including the first release of Edge Animate."
Edge Tools & Services include:
Pricing and Availability
Public Access
|
global_05_local_5_shard_00000035_processed.jsonl/30908
|
Handson with eFun's Nextbook 7GP and 8GP budgetfriendly tablets
Not content with showing off its handy aPen Touch8 for those Windows 8 laptops which lack touch capabilities, eFun also let us play around a bit with two of its newest Nextbook tablets here at CES 2013. For starters, the 7GP, as its moniker would indicate, is a 7-inch (1024 x 600) slate that's sporting Android 4.1, a 1.5GHz dual-core CPU alongside 1GB of RAM and 8GB of built-in storage. The 8GP, on the other hand, is a tad bit larger than its sibling with an 8-inch, 1024 X 768 IPS display but boasts pretty identical internals, so essentially you'd be spending 40 more bucks for a little more screen real estate. Speaking of which, while one of the tablets biggest features could be their relatively small price tag, eFun kept emphasizing to us how it believes the fact that they are Google-certified is perhaps the most important thing -- and yes, the ability to have Mountain View's Play store is definitely worth mentioning.
Much to our disappointment, however, we weren't able to download any applications from Google Play or, for that matter, even browse the web, though that's not the company's fault, since having thousands of souls packed in a room makes for some very unreliable WiFi connectivity. Internet issues aside, both the 7GP and 8GP were rather smooth and quick when doing every-day tasks such as opening up apps and swiping between pages -- which is likely due to the pair feeding off of Google's Project Butter. Furthermore, were quite happy to find how thin-and-light the tablets are, with both Nextbooks being slightly thinner than something like, say, the Nexus 7 or the 7-inch Kindle Fire. All in all, eFun's 7GP and 8GP aren't too bad a choice for those looking to keep spending to a minimum, but at $130 and $170, respectively, there's no doubt that shelling out some extra cash can still get you much, much more bang for your buck elsewhere.
Gallery | 17 Photos
eFun's Nextbook 7GP and 8GP
Public Access
|
global_05_local_5_shard_00000035_processed.jsonl/30909
|
Steam weekly deals Rochard, L4D2, Arcana, Jet Set Radio
Steam has announced its latest round of weekly deals, with physics-focused platformer Rochard dropping to $2.49, along with Jet Set Radio. Left 4 Dead 2 and Arcania are both available for $4.99, and the Emperor Special Edition of Endless Space (which includes the soundtrack and a number of other in-game goodies) is $17.49.
All of these deals last through March 18 at 10am PST, so you've got one week to look under as many couch cushions as possible for the right amount of pocket change. And why stop at your own couch?
This article was originally published on Joystiq.
Select Sony stores selling PS Vita 3G for $200
|
global_05_local_5_shard_00000035_processed.jsonl/30910
|
The dungeons of Capcom's Deep Down may as well have a sign above them reading "No girls allowed." According to a DualShockers translation of a Niconico livestream presentation of the game, Deep Down will not feature playable female characters. It's not clear why this would be the case, but DualShockers claims it has something to do with the game's story.
Additional details were also revealed during the stream, such as how the game's difficulty will be fixed, though changes can be made server-side by Capcom if necessary. DualShocker's translation also claims that Deep Down will only have four weapon styles available at launch, with more to be added in later.
Three weapon styles have been revealed thus far: sword and shield, spear and greatsword. Wait ... you don't think ... no playable female characters plus one more weapon style to be revealed ... what if a female character is the fourth weapon? Hey, it's happened before.
[Image: Capcom]
This article was originally published on Joystiq.
|
global_05_local_5_shard_00000035_processed.jsonl/30921
|
Jump to main content or area navigation.
Contact Us
General Conformity Training Module
Module I - The Basics
This Module is designed for those new to general conformity and who may have little to no experience with the General Conformity Regulations. This session provides an overview of the “what, where, who and how ” of general conformity. Some general background information is provided in section 1.3 and links to more information are contained in section 1.4. More detailed and complex information is covered in Modules II-IV.
Jump to main content.
|
global_05_local_5_shard_00000035_processed.jsonl/30953
|
Skip to main content
Report this ad
See also:
Efrem Zimbalist Jr., actor and Bible narrator, dead at 95
Acting icon, Efrem Zimbalist, Jr., who became a household name in the late fifties is dead at the age of 95 on Friday, May 2. Zimbalist died at his Solvang ranch according ABCNews.
Efrem Zimbalist, Jr., icon, actor, and narrator, dies at 95.
Photo by Vince Bucci/Getty Images
We are saddened at the passing of this mogul of a man who became a Christian after watching Trinity Broadcasting Network (TBN).
Although Zimbalist is widely known for his acting as a detective and G-Man on "The FBI," and "77 Sunset Strip," his fame also rests with his narration of the King James Version Bible (KJV 1611), said to be the most popular version ever produced.
His debonair looks and regal voice made him fit for any public appearance or representation of high officials.
We looked forward to his TBN commentaries, just to hear his voice, and his reading of the Bible made the words come off the page with much grace and grandeur.
Efrem Zimbalist Jr., will be remembered as an icon of our time.
R.I.P. Efrem Zimbalist Jr.
Report this ad
|
global_05_local_5_shard_00000035_processed.jsonl/31015
|
You are here
Is Your Diet Making You Mad?
1 of 3
How Your Diet Affects Your Mood
I'm not the only one who gets "hangry" (so hungry that you're angry). According to a recent study published in the Journal of Consumer Research, people who ate an apple instead of chocolate for dietary reasons were more likely to choose violent movies over milder ones and were more irritated by a marketer's message urging them to exercise. I can relate: I rolled my eyes — and may have uttered an audible "Take this jog and shove it!" — at the trainer on my workout DVD as he encouraged me to run in place.
Mood buster: Running on empty
Mood buster: Fudging the fats
Mood buster: Going against the grains
Eat, Exercise, and Lose Weight Without Mood Swings
Mood buster: Nixing treats
It's torture for me to watch others indulge in things that I've deemed off-limits. When my husband uncorked the Cabernet, I felt my blood boiling right along with the water for the herbal tea I would be having instead. According to a study published in the Journal of Personality and Social Psychology, it's not the forgoing of food or drink itself but the act of resisting it that's so upsetting. In fact, the researchers found that exerting even a single act of self-control causes a significant drop in blood glucose levels. When blood sugar sinks, it can result in hypoglycemia, which can lead to symptoms that include feeling cranky and acting aggressive. Other studies found that deprivation ultimately backfires, leading us to binge on the very things we are trying to resist.
A simple way to prevent this, of course, is to steer clear of temptation in the first place. "Arrange your environment so that sticking to your eating plan requires as little willpower as possible," advises Sandra Aamodt, PhD, a neuroscientist and coauthor of Welcome to Your Brain. If ice cream is your weakness, don't keep it in the house. And if the office vending machine calls your name every day at 3 p.m., stock your desk drawer with good-for-you munchies like nuts and whole-grain pretzels.
Somer also suggests finding healthy replacements. Clearly, tea didn't quite cut it for me, but the good news is that in moderation treats like chocolate can qualify. In fact, recent research found that consuming 20 grams of dark chocolate twice a day for two weeks resulted in reductions in metabolic signs of stress, including levels of cortisol. "Dark chocolate is quite good for the brain," Dr. Ramsey says. "It is full of compounds that boost mood and concentration." I've also come up with calorie-free substitutions, like climbing into bed with a good book or a trashy magazine and replacing wine with an impromptu couples massage with my husband.
Mood buster: Overdoing exercise
Working out is key to losing weight and staying upbeat — no surprise there. Exercise prompts a change in brain chemicals that lifts your mood. And the effects are almost immediate, says Michael W. Otto, PhD, professor of psychology at Boston University and coauthor of Exercise for Mood and Anxiety. The pick-me-up can happen within just five minutes of completing a moderate workout.
Why, then, wasn't I euphoric after six consecutive days of tough sweat sessions? Because when it comes to the way exercise affects mood, more isn't necessarily better. "A workout that is too rigorous or lasts longer than 60 minutes can dramatically decrease blood sugar, which can affect mood and the ability to think clearly for days," says Michele S. Olson, PhD, a FITNESS advisory board member and professor of exercise science at Auburn University in Montgomery, Alabama.
To ensure that my activities take me to a happier place, Otto recommends being more mindful — paying attention to how my body is feeling and not pushing too hard. "Ratings of mood during exercise can plummet as people get to the point at which it's hard to breathe comfortably," he explains, suggesting that I use the talk test. "If you can talk but not sing during an activity, you're doing moderate-intensity exercise. If you're not able to say more than a few words without pausing for a breath, you are doing vigorous-intensity exercise and should scale it back to maximize your mood." And Olson gives the A-OK to interval training as a way to boost the calorie-torching benefits of exercise without compromising mood. She suggests alternating 30 seconds of high-intensity cardio with 90 seconds of low-intensity. "In my research, interval training improved mood the most," Olson says.
Happily Ever After
All these new strategies have made a huge difference in my disposition. My husband comments on how cheery and resilient — even freakishly enthusiastic — I've become in the face of things that once stressed me out (like a.m. workouts), and my son is literally embracing the new me (no more mad Mommy equals a lot more hugs!). As if that weren't enough, the little guy supports my efforts by offering me healthy alternatives to gummy bears: "Here, Mommy, have some dark chocolate," he says, holding out a few squares. "It's good for you!" Indeed, as I'm sure he now realizes, sharing a treat like that isn't just good for me, it's good for the whole family.
Originally published in FITNESS magazine, March 2012.
Love it? Share now!
Loading comments...
|
global_05_local_5_shard_00000035_processed.jsonl/31057
|
Avatar lucy199308
Lucy199308 On 26/10/2012
I want some US cool guy tonight,join http://bit.ly/P519TH be my partner,my ID is salahlucy. kiss!
Avatar oneforlove
Oneforlove On 17/07/2012
My name is pamela i saw your profile today and became interested in you,i will also like to know you more,and if you can send an email to my email address,i will give you my pictures here is my email ([email protected]) i believe we can move from here! waiting for your mail to my email address above
Tag - Cinema
Loading ...
|
global_05_local_5_shard_00000035_processed.jsonl/31095
|
Biostar11211 (me you idiot)
Biostar11211's avatar
Last Login: 07/29/2010 9:00 pm
Registered: 02/24/2006
Gender: Male
View All Comments
Biostar1121 Report | 07/09/2010 12:19 pm
sorry no but gaia decided to ban me so i dont hav them any more.....
Eberation Report | 05/02/2009 5:28 pm
If you want to quit can i have your sword and dragon
Sand_Beauty Report | 06/19/2008 7:45 pm
>_< Can I tell you how much I don't like posting one comment after another!? Get friends! Heh.
My avi is no basically the complete opposite of your's, with the rainbow and my children and such! And of course User Image WATERMEAT! He's adorable. User Image Thank you, Seance(Moses)-nii!
Sand_Beauty Report | 06/11/2008 9:35 pm
Er... *looks at last comment date* You don't have very loyal friends... do you? Ah ha ha, kidding. I have finally mastered the art of the marketplace (I almost want my Christmas stuff back)! They say buy low sell high? No one wants high prices! So I sell low, way lower than any competitors! And then I go thank my patrons! It makes them so happy, them come back for more! *recovers from dirty thought* User Image Well, it's fun. And it doesn't matter how much money I'm making from something I got for free off Jigsaw. The gold's all goin to slutty clothing, adorable animals, and shoes anyway! Ah ha ha. (I forgot to pay back for lunch! User Image I'll get to that soon.)
Sand_Beauty Report | 04/08/2008 5:33 pm
Zuri-chan's in the way of Amante-kun's avi. User Image I'm sorry! But she's so cute!
monkeybro94 Report | 03/25/2008 3:34 pm
Bump!!!! jk yo will u get my gaia dude on a refresher thing sometime i have no money....(it sucks cause u know how slowly i make money)
Sand_Beauty Report | 03/23/2008 6:27 pm
Double post. User Image CONGRATULATIONS! *whisper* And I didn't tell Amante-kun, so you can!! Yay! User Image Ohhh, Seance-nii, it's too wonderful!
Sand_Beauty Report | 03/22/2008 5:30 am
How's the flaming eyes thing coming? (Still sounds painful to me.) Tell me if I can help, donation-wise or anything!
brazilcat Report | 03/06/2008 3:30 pm
hey whatzup???? havent tlked 2 u in a long time?????/
Sand_Beauty Report | 02/24/2008 5:10 am
Seance-nii, OMG! I went into the marketplace yesterday, and that's where I got my parasol! I love the marketplace, because if you don't want to bid, just buy it! It's wonderful! *faints* Ah, my parasol blocks Amante-kun, though...^-^'
The Crew
|
global_05_local_5_shard_00000035_processed.jsonl/31103
|
Jump to content
• Log In with Google Sign In
• Create Account
Banner advertising on our site currently available from just $5!
City growth AI
Old topic!
• You cannot reply to this topic
3 replies to this topic
#1 Novalis Members - Reputation: 122
Posted 01 March 2000 - 07:03 AM
OK, here''s the setup... I''m trying to model the growth of a fantasy city. Essentially it starts off with a castle in the middle of nowhere, and over time peasants move to the city and build houses outside the castle. Some peasants are skilled workers who also build shops/farms/mines so on and so forth. Also, as peasants travel back and forth between buildings (generally where they work and where they live) roads "appear" along those routes. Here''s the question... I need some thoughts on how to decide where newcomers build. I know what I want to use as criteria, but the programing/data structures seem to be eluding me. For instance, I would like to take into account factors like "Have a lot of people been building nearby lately?", "Are there a wide variety of interesting businesses nearby?", "Is the income/standard of living high in this area?". Currently I have a set of functions that will evaluate a specific location based on these factors, and I just sample random locations on the map until one of them gets a high enough score. There must be a more "directed" approach though... Any ideas?
#2 PsYcHoPrOg Members - Reputation: 115
Posted 01 March 2000 - 08:03 AM
You could always just keep track of what/how each person is doing in the city through structures or classes. You could keep a bool to keep track of their working. After a certain amount of time of not working, the bool becomes FALSE. This way, you could create a function that searches through everyone''s BOOL. This, however, may be slow because every person in the city would need a timer. But computers these days are pretty good at handling things like this. Good luck on your game.
"Remember, I'm the monkey, and you're the cheese grater. So no fooling around."
-Grand Theft Auto, London
#3 Spellbound Members - Reputation: 122
Posted 01 March 2000 - 08:34 AM
You could divide your map into a grid. Each of the squares holds a value for how much a farmer wants to build there. Whenever a new building is built it affects the surrounding squares. For example if a school is built more people would want to settle down around it, but whenever a farm is built it decreases the surrounding area, effectively preventing over crowding.
When the farmer wants to build a home it searches the grid for the best place and then starts to build there.
If different people have different needs you could divide have more than one value at each position. The values are then summed together with weights to tailor the need for the person looking for a place to build.
(Am I making any sense?)
#4 Veldrik Members - Reputation: 122
Posted 01 March 2000 - 12:13 PM
Reminds me off a few game engines I was writing a while ago.
My ones used real locations (if I ever use an array it is only for ease of making terrain, but preferably no array based map at all). What this means is that all of the locations are in either long or floating points.
This makes the game look better, play better (use more processing unfortunately) and a hell of alot easier to program certain aspects.
If you ever need to calculate the distance in the real location, just use Pythagoreus'' theorum (don''t bother to sqare root numbers unless necessary in comparisions, just leave them as square as it is a bit faster). If you are using an array, just use the x offset of the two points of the array (how many blocks between them) and multiply it my lets say 50 (if each block in the array is too represent 50 meters., then do the same for the y and again use Pythagerous.
Now that the techinical bit is over with, this is my method (simplified as I also had many other biological, mental physical and environmental effects.
This is the basic theory behind the method.
Firstly, you have your castle. You would also have your resources such as rivers, flat areas, forests, big smegging cliffs, and oceans.
You may also designate where certain things go (like maybe armouries, prefaetures and guard houses.
Now lets say you have fishermen in your supply.
Since they are civilians, they would probably want to be rather close to the castle, but on the other hand, they also need to be near the sea or rivers. So you would use a range on them to the targets. Most likely the location of water is best, so just a simple distance of probably <100 meters is sufficient, and in a buildable place.
Now your farmers will require a certain amount of flat land, and a supply of water.
So they will need a large space, and proximity to rivers (not salt water).
They can be placed close to forests, although the phsycology of a farmer is to build in the flat areas first, and near a forest only when necessary (as they can just chop down the trees). The river should preferably be passing through the farm.
The buthcher the baker the candlestick maker would want to be located within a close proximity to the castle, and preferably the praefactures or guard houses, but not too close to them as it migth be a bit of a turn down to the people. They would probably also develope near existing houses and shoppes.
The shoppes (the butcher the baker the candlestick maker) would then inturn develope around the houses if new ones cropped up and so on.
Woodcutters/tree fellers would develop near forests.
Armourers would appear in towns, in more densely populated areas (count how many houses in an area of lets say <250m) and so on.
Houses should also be allowed to change into shoppes.
(gee, I haven''t spelt shops as shoppes for a long time)
Old topic!
|
global_05_local_5_shard_00000035_processed.jsonl/31104
|
Jump to content
• Log In with Google Sign In
• Create Account
Banner advertising on our site currently available from just $5!
Member Since 13 Jul 2012
Offline Last Active Apr 13 2013 11:55 PM
Posts I've Made
In Topic: Jump point search(jps) algorithm is slow than classic AStar?
22 March 2013 - 12:30 AM
o, you did write some code to test JPS and find out is is slower than ASTAR or you just think it is slower?
Yes, I wrote a demo to test the two algorithms, refer to the open source:
I found a thread here that people discuss jps performance:
In Topic: Collision avoidance in RTS game
25 September 2012 - 08:25 PM
Uh... why are steering behaviors not good for stationary unit avoidance?
I don't want to use steering behavior because it can cause jitter and oscillation. StarCraft2 use steering behavior, but it push the stationary units away in physical simulation.
In Topic: Navigation Mesh Generation
16 September 2012 - 07:49 AM
I am developing a RTS game, and replaced the grid pathfing with navmesh for the performance reason. But the new problems comes, handling dynamic obstacle is not so effecient in navmesh.
In Topic: Papers on RVO/HRVO?
08 August 2012 - 08:24 AM
RVO work well in collision avoidance between moved agents, but when moved agents avoid stationary agents, it will get stuck sometimes.
In Topic: How to calculate Velocity Obstacle?
03 August 2012 - 08:40 PM
Thank you! I'm trying to understand RVO solution.
|
global_05_local_5_shard_00000035_processed.jsonl/31106
|
Your 3 favorite games of all time.
• Topic Archived
1. Boards
2. Final Fantasy XV
3. Your 3 favorite games of all time.
2 years ago#11
1: Kingdom Hearts 2
2: Final Fantasy 10
3: Dark Souls
"There are many worlds, but they all share the same sky-- one sky, one destiny."
2 years ago#12
FF 7
Metal Gear Solid
2 years ago#13
Assassin's Creed II
Dark Cloud
Music Resonates The Individual Soul.
Once I Get Up, I Will Rock. Never Stop.
2 years ago#14
1: Legend of Dragoon
2: Kingdom Hearts 2
3: Dragon Quest 8 or Dark Souls
"Fools set the rules in this world. Just take a look around. It's undeniable." - Noctis Lucis Caelum
PSN: Riku994
2 years ago#15
LoZ Wind waker
Lost Odyssey
Jak & Daxter: the precursor legacy
2 years ago#16
Kingdom Hearts 2
Paper Mario TTYD
SMT: Devil Survivor Overclocked
- Me, being horribly mistaken about the Sticker Star Boards
2 years ago#17
1. Persona 2 duology
2. Xenogears
3. Xenoblade Chronicles
"When you come at the king you best not miss"
2 years ago#18
Damn! I need to try this Persona series then.
Veni, Vidi, Dormivi.
2 years ago#19
1. Final Fantasy X
2. Mortal Kombat 4
3.Kingdom Hearts 2
Waiting for: The Last Guardian, Tales of Xillia, Ni no Kuni, Monster Hunter 3 Ultimate, LR: FFXIII, FF Versus XIII, FF Type-0, FFX HD and Injustice!!
2 years ago#20
Kingdom Hearts II Final Mix
Kingdom Hearts 3D: Dream Drop Distance
Assassin's Creed III
"You're gonna get shown the door, old man."
1. Boards
2. Final Fantasy XV
3. Your 3 favorite games of all time.
Report Message
Terms of Use Violations:
Etiquette Issues:
Notes (optional; required for "Other"):
Add user to Ignore List after reporting
Topic Sticky
You are not allowed to request a sticky.
• Topic Archived
|
global_05_local_5_shard_00000035_processed.jsonl/31109
|
Mini-Game Guide by HMKing
Version: 1.0.8 | Updated: 02/20/05 | Printable Version
| ___________ /
|/ / / THE LEGEND OF
/ / ________ _____ _______ _____
/ / | ____ |\ / \ _ \ \ \
/ / | | \ | | | | | \ \ | |\ \
/ / | | \| | | | | | || |_\ \
/ / | |/| | | | | | || \
/ / | |\| | | | | | || | \ \
/ / | | /| | | | | | || | \ \
/ / | |____/ | | |_/|| |_/ / | | \ \
/ / ,________|/_____|/_____/ /____\ /____\
/ /___________/|
/_________________| The Windwaker Mini-Game Guide
By: Jeremy Duenas AKA HMKing (
Guide Version (As of 1/16/04): 1.0.8
File Size: 12KB
| Table Of Contents |
|Section 1: Guide Info |
| -Important Information |
| -Version History |
| -Legal Information |
| |
|Section 2: Mini-Games |
| -Reference Map of The Ocean |
| -Mail Sorter |
| -Merman Shooter |
| -Picture Puzzle |
| -Find The Piggy |
| -Battle Ship Zelda Style |
| -A Night At The Auction House |
| -Barrel Shooting |
| -Bird-Man Contest |
| -Boating Course |
|Section 3: Contact Info/Credits |
| -Contact Info |
| -Credits |
Section 1: Guide Info
(Important Information)
This guide has only been approved to be on ONLY. NO OTHER SITES!
If you see this guide anywhere else but, email me at saying that you saw the Mini-Game Guide on a site it
shouldn't be on. Oh and it might show up on If it does, no biggy
they are allowed to use the guides on gamefaqs. Its cool.
(Version History)
Version 1.0.0
*Started the guide
Version 1.0.1-1.1.0
*Fixed a spelling error
*Added Fun Level to the mini-games descriptions
*Centered the table of contents
*Added the Reference Map of the Ocean
*Added more information to the Location of mini-games
*Added Bird-Man Contest Mini-Game
*Added Boating Mini-Game
*Added Hide-And-Go-Seek Mini-Game
(Legal Information)
Nothing from this guide may be reproduced under any circumstances
site or otherwise distributed publicly without the permission of the
author (HMKing AKA Jeremy Duenas). Use of this guide on any other
and a violation of copyright. To receive permission, email me at or IM me at Duenos14. All trademarks and copyrights
contained in this document are owned by their respective trademark and
copyright holders.
Note: I hold the right to change the above information as I please.
Copyright 2005 Jeremy D. (HMKing)
*Thanks to for help on this section!*
Section 2: Mini-Games
Throughout the decriptions, I'll mention islands. Since some people do not
know where these islands are, I have made an ASCII map of the ocean below.
When you see something like "Dragon Roost Island (F2)", go to the square
on the map where F and 2 meet.
A B C D E F G
| | | | | | | |
1 | | | | | | | | 1
| | | | | | | |
2 | | | | | | | | 2
| | | | | | | |
3 | | | | | | | | 3
| | | | | | | |
4 | | | | | | | | 4
| | | | | | | |
5 | | | | | | | | 5
| | | | | | | |
6 | | | | | | | | 6
| | | | | | | |
7 | | | | | | | | 7
A B C D E F G
Official Mini-Games:
Name: Mail Sorter
Location: Dragon Roost Island (F2)
Required: NOTHING
Fun Level: 3/5
On the second floor of the big mail center on the island, talk
to the guy behind the counter. You will be given the opportunity to help him
work. If you accept, you will be required to sort letters you are given. To
do this, highlight the box that matches the symbol of the letter. Then toss
it in. The faster you sort, the more you get payed. Keep going and going
until the post guy asks you to mail a letter for him. Do so and a day later,
you will get a letter from the mail guy.
Name: Merman Shooter
Location: Anywhere on the ocean (A1-G7)
Required: Bait and Hero's Bows (no need for arrows)
Fun Level: 3/5
After getting the Hero's Bowq, call up Merman (the talking fish)
and agree to play his game. What you have to do is shoot him with the bow as he
jumps in the air and back into the water. Everytime you hit him (using only 10
arrows), you get 10 rupees. If you hit him everytime (with all 10 arrows) you
will win 200 rupees.
Name: Picture Puzzle
Location: Private Oasis (E5)
Required: Cabana Deed and 10 Joy Pendants (Butterfly necklaces)
Fun Level: 4/5
Before you can do this game, you must get the Cabana Deed. To do
this: Talk to the pink haired teacher lady on Windfall Island. She will say
something about five kids. Exit the school and talk to the kids until they want
to play hide and go seek. Play it with them. After finding all five, talk to
the teacher again. Then come out of the school. After a talk with the kids
again, go back in the school and give 20 Joy Pendants (The Butterfly necklaces)
to get the Cabana Deed.
Now sail to the square south of the Tower of The Gods. Now walk
up to the house and show the Cabana Deed to the door. That's right, show a
piece of paper to a wooden door. You will now be allowed to enter the house.
Walk to the wall with a picture on it. Now go to the wall opposite of it.
There should be a messed up looking panting. Press A in front of it and try
to make the puzzle look like the picture on the opposite wall. Everytime you
complete a puzzle, you get 50 rupees. It's a good money maker and its
pretty fun, but the puzzles are pretty hard.
Name: Find The Piggy
Location: Windfall Island (D2)
Required: 3 Skull Necklaces
Fun Level: 3/5
Give the pirate looking guy that gives financial advice (he's
by the pigs) 3 skull necklaces. He will ask you to get his three pigs back
to him in 2 minutes. If you can do it, you will be given 50 rupees.
Name: Battle Ship, Zelda Style
Location: Windfall Island (D2)
Fun Level: 5/5
Required: 10 Rupees
Go to the building across from the school and talk to the
guy to play a game. If you've ever played the game Battle Ship, its
exactly what you do here. You shoot at different squares until you hit
the hidden ship. Once you've run out of bombs or hit all ships, the game
is over.
Name: A Night At The Auction House
Location: Windall Island (D2)
Required: Rupees to bid with
Fun Level: 4/5
Enter the house with a red door. If you end up on a top level,
hop down to the lower level. Talk to the guy that looks like an eskimo and
agree to take part in the auction. Here's what you can find and the starting
Treasure Chart 38 (60 rupees)
Joy Pendant (40 rupees)
Heart Piece (80 rupees)
Treasure Chart 18 (60 rupees)
Name: Barrel Shooting
Location: Spectacle Island (C2)
Required: NOTHING
Fun Level: 5/5
Using the cannon, shoot at the barrels using the A button. if
you win you get Heart Piece, Treasure Chart 17, and 100 rupees.
Name: Bird-Man Contest
Location: Flight Control Platform (G2)
Required: Deku Leaf, big magic meter, 10 Rupees, have learned Wind's Req.
Fun Rating: 4/5
After you have the Deku leaf and big magic meter, head over to
The Flight Control Platform (G2). By playing Wind's Requiem (^ < >) make the
wind blow northwest. Then talk to the guy on the top platform and pay him
10 Rupees to enter the contest.
The object of this mini game is to fly across the ocen to the big banner.
In order to do this though, you must fly into the little air spirals, to give
you more lift. More lift=more distance covered faster.
If you can get to the banner, you will be given a heart piece. And doesn't
want that?!
Name: Boating
Location: Boating Course (F7)
Required: NOTHING (Not even the Wind Waker because wind auto sets itself)
Fun Rating: 5/5 (Not really fun itself, but getting all the Rupees is)
Description: Go to the Boating Course (F7). Here you can race against the
clock to collect a bunch of Rupees (which you can keep). The Rupees appear
on barrels floating in the water. For some of the barrels you have to jump over
them to reach the Rupees (Just hit R to jump). The rest you just run over to
collect the Rupees.
Everytime you complete it (collect all the rupees) the time limit you are
given is reduced by 10 seconds. As long as you are fast, you can keep on
going for a long time collecting a ton of Rupees.
Name: Hide-And-Go-Seek
Location: Windfall Island (D2)
Required: NOTHING
Fun Rating: 3/5
Description: This is really part of getting the Cabana Deed, but its really
a mini-game on its own. Go to the school house (more like room, but whatever)
and talk to the teacher (Pink haired lady). She will mention five racals that
have been skipping school and other bad stuff. So head outside of the school
house and talk to the boys. They wil challange you to a nice game of
hide-and-go-seek. Fun! By the way, these boys are known as the Killer Bees.
Scary huh? Anyway, look all around the island for the boys. Look in trees,
hidden paths, behind the bomb shop, and other odd places.
Did I miss a mini-game? If so, drop me an email ( with
the subject "Wind Waker" listing the name, location, whats required, and a
helpful description of it. You will be given full credit for your contribution
in the below section.
Section 3: Contact Info/Credits
(Contact Information)
AIM: Duenos14
Yahoo: Toxicity88
Information for the guide gathered from game play and the offcial BradyGames
Wind Waker guide.
My legal information was found at (I slightly modified it)
Also thanks to Dallas and AstroBlue's guide FAQ, which after reading it, made
me want to write another guide, so I wrote this! Thanks guys!
|
global_05_local_5_shard_00000035_processed.jsonl/31110
|
Review by funky1
"You wanna know what I think?"
I've known of the Harvest Moon series for a while now. I've read about them in Nintendo Power, and heard people saying how great the series is. So I finally decided maybe I'll try this game out. As soon as I started, I was stunned. It was nothing like I've ever played before. I was amazed that some one could take a concept, like farming, and make it into something so addictive!
Gameplay: 10/ 10
I know this may sound odd, but basically, you farm. It's a lot more fun than it may sound, trust me. If you've ever played a simulation game, such as Animal Crossing, for GameCube, it's almost similar, but minus the getting furniture for your house part, and with farming. In this game, you make money, farm, fish, mine, chop wood to expand your house, care for animals, get a girlfriend, even watch TV! There's just so much to do in this game, it's amazing.
I can't really rate the story, because, well... there is no real story, in my opinion. The game is just a simulation of farming and living. There are events in the game, but no story. You just do the stuff I listed above. Believe me, it's more fun than it sounds.
Graphics: 8/ 10
Now, this one's hard to judge, that's why it's only an 8. People are always using these technological terms on the kind of graphics the GBA can handle, and I don't understand a thing. I do know, though, that this game looks very beautiful. If you want a preview, then take a look at the screenshots. That's the only way you can decide on the graphics. But trust me, the graphics look great.
Sound: ?/ 10
Usually, I don't listen to the sound. There is no difference here. See, I like to conserve battery power, plus, I usually listen to music or TV when I play GBA, so it's not like I'd pay attention to the sound, anyway. However, there was one point in this game during an event when I did turn on the sound (I won't spoil it for you, though, even though it wasn't anything big), and from what I did hear, it was pretty good. I mean, obviously you're not gonna hear the kind of music as you would on a PS2/ GameCube/ X-Box game, but for what it can handle, the sound is quite nice.
Replay: 10/ 10
This game goes on forever. Got that? FOREVER. This game has a little timer (you're not timed, but the days are. Like five seconds in real time or ten minutes in Harvest Moon time. The game has months and years, too.), and you could play for 50 years, 100 years, whatever (I mean that in game time. Though, maybe you will be playing this 50 years from now, who knows?), and the game will still go on. I heard that there is some way to end it, but that may have been just rumor, but I'm kinda new, too.
Final Rating: 12/ 10
This game is just too good to get a 10/ 10. I mean, I've had this game since Christmas, and I've had to recharge my SP five times since then, just from playing Harvest Moon alone! I hope you make the right choice and buy this, because it's outstanding. You might want to rent it (although I recommend buying) because there are just some people that won't like this, and I don't want you to waste your money. However, this game is also pretty hard to find, so you may not be able to go out and buy it right away. Also, a GCN counterpart is coming out in January, and it can link up with this game. I suggest playing this one, first, especially to determine if you even want the GCN game. I know I do!
Reviewer's Score: 10/10 | Originally Posted: 12/30/03
Would you recommend this
Recommend this
Review? Yes No
Got Your Own Opinion?
|
global_05_local_5_shard_00000035_processed.jsonl/31112
|
Ask a Question
Search Questions
Most Popular Open Questions Answers
What I can do to resolve the sound problem? 0
Will it install onto Vista? 0
Where is the Direct link to download the game not the patch? 0
Will Scarface run on windows 7? 4
• Total Open Questions: 4
|
global_05_local_5_shard_00000035_processed.jsonl/31136
|
GEN Exclusives
More »
Assay Tutorials
More »
Supporting Cells with Scaffold Technology
Polystyrene Platform Designed to Facilitate Routine 3-D Cell Culture
• Click Image To Enlarge +
Figure 1. Scanning electron micrographs of alvetex polystyrene scaffold: The structure of the material is clearly visualized in high magnification (A) and is composed of a uniform set of voids and interconnecting pores with dimensions of approximately 35–40 µm and 11–13 µm, respectively. The material has greater than 90% porosity and enables free passage of cells into its structure. Alvetex is manufactured as a 200 µm thick membrane (B), which is thick enough to have good mechanical integrity and thin enough to promote adequate exchange of gases and solutes by passive diffusion.
Cell-based in vitro assays are a key component of research into basic cellular mechanisms, disease modeling, compound screening, and safety assessment. Cultured mammalian cells are particularly important tools for providing predictions of drug activity, metabolism, and toxicity in vivo. Conventional cell culture methods, however, provide a growth environment that is far removed from what cells experience in real-life tissues.
In vivo, cells grow naturally in three dimensions (3-D) and are supported by a complex extracellular matrix that facilitates cell-cell communication via direct contact and through the secretion of paracrine factors. These features change dramatically when cells are grown in the laboratory. When forced to grow on a flat two-dimensional (2-D) substrate, cells adapt and radically change their shape, which, in turn, influences their internal cytoskeleton and can subsequently effect gene and protein expression and, ultimately, cell function.
In addition, almost 50% of the cell rests against the flat plastic substrate and a similar area is exposed to the culture medium above. The opportunity for cell-cell interaction is minimal and is significantly reduced when cells grow as monolayer cultures.
These disadvantages are widely recognized in the scientific literature, and technologies are under development to improve the environment in which cultured cells grow. Demands for improvement include the obvious need to enhance cell function but also to improve the predictive accuracy of in vitro assays as a means to reducing subsequent development costs, advancing basic research, developing more relevant human models of cell function, and adapting to changes in policy concerning the reduction of animals in research.
Published research has clearly demonstrated that culturing cells in 3-D radically enhances cell growth, differentiation, and function. Authentic 3-D cell cultures provide greater insight into how cells behave in the body in response to external challenges than is currently possible with existing 2-D culture technologies.
The development of scaffolds and their use in cell culture is a proven approach that provides the additional vertical axis or third dimension into which cells can grow. However, there is currently no scaffold platform technology that supports genuine 3-D cell culture for routine use alongside conventional cell culture methods.
Ideally, such scaffold technology should satisfy several criteria for it to be successfully adopted by the scientific community. The scaffold itself should have a uniform and consistent structure and be manufactured with tight reproducible tolerances such that batches of the material are equivalent. This is an important factor since cells respond to their environment and will behave differently if the material is changed.
The scaffold must be highly porous to enable cells to enter and migrate freely throughout the material. However, the internal dimensions of the material should not be such that cells are unable to bridge gaps, fill the space, and develop 3-D cellular structures. In a way, the scaffold merely acts as a catalyst to initiate the process and enable cells to build up on one another creating the natural 3-D structure of a tissue.
Reinnervate’s alvetex® is a highly porous polystyrene scaffold. It is composed of voids and interconnecting pores and has a consistent structure (Figure 1). The scaffold is engineered into a thin membrane to aid cell entry and exchange of materials by passive diffusion.
Polystyrene is inert and will not degrade during an experiment. This is advantageous since biodegradability may introduce variability and cause local release of degraded material that may influence cell function. In addition, the fabric of a polystyrene scaffold is consistent with the material used for the majority of conventional 2-D cultures and users need not be concerned how their cells react to the material itself.
The advantages of growing cells in 3-D culture over existing 2-D methods are self evident in the literature and on dedicated websites. However, it is also recognized that some investigators are reluctant to change and it is the pioneers who will first work with such new technologies.
It is essential, therefore, that any radical changes to cell culture practice first result in technology and methods that are easy to use routinely, are readily adaptable to existing analytical procedures, and are well exemplified. Multiwell plates and well inserts are considered industrial formats for 2-D culture and a scaffold must be compatible with these existing types of product.
Related content
More »
Be sure to take the GEN Poll
Using CRISPRs to Tame GMOs
More »
|
global_05_local_5_shard_00000035_processed.jsonl/31165
|
#1 Edited by NoCookiesForYou (820 posts) -
Can anyone remember the episode where Brad(?) talked about being on a game dev showing. Might have been for Witcher 3, can't remember for sure.
Room temperature was really hot and he was positioned next to the air conditioner when it suddenly died down.
#2 Posted by mosespippy (4746 posts) -
I've been listening to all the podcasts where they mention The Witcher. Still haven't found it. I do think it was an eastern european developer though. Maybe Metro 2033/2034?
#3 Posted by ThunderSlash (2312 posts) -
@nocookiesforyou: Pretty sure that event happened around the time of E3 last year. It could be one of the E3 podcasts they did.
#4 Edited by mak_wikus (637 posts) -
It was on the last E3 2013 podcast.
#5 Posted by NoCookiesForYou (820 posts) -
Huge, thank you guys for your dedication!
|
global_05_local_5_shard_00000035_processed.jsonl/31173
|
There's so much great TV on these days, we've all got clogged DVRs and guilt over missing something. But there will never be another Seinfeld. And there will never be another Elaine Benes.
The varied curly hairstyles, the ankle-grazing skirts--she was like none other. And everyone's got their favorite Elaine moments--so if I've left out yours, don't yell at me, just post a link to it in the comments! (See how I'm making this so that you have to do the work for me to have a laugh at my desk? I'm tricky like that.)
The dance
How does one even script something like this, with the tiny kicks and the hitchhiker thumbs? One doesn't. It's a dance floor miracle.
"Maybe the dingo ate your baby"
Self-explanatory. All-wonderful. For some reason NBC has every video clip of this on YouTube embedding lockdown, but click here to watch.
"It. Out."
This is one Elaine scene I find myself lingering in front of the TV for even though it's a rerun, for crying out loud, and I have a million things to do. The cleaning of the glasses? Priceless.
Just in general, her pushing Jerry
I love it so much. Not sure why.
And my personal number-one favorite: the Suzy episode!
"We don't have to name names, or point fingers, or... name names!" My friend Stephanie and I text this back and forth to each other several times annually and it cracks us up every time.
What's your favorite Elaine moment? And will you be watching Veep on Sunday?
More on funny ladies we love...
Are You a Camilla Belle or a Julia Louis-Dreyfus? Let Me Explain.
Meet Kate McKinnon, SNL's Brand-New Female Castmember!
Photo: YouTube
|
global_05_local_5_shard_00000035_processed.jsonl/31176
|
Senior SQA Engineer Interview Questions
Sort: Popular Date
Sort: Popular Date
Did you mean companies matching "Senior SQA Engineer"?See Companies
“What are some of the test cases for copy - paste functionality in a text editor?”
“What's the UNIX command for changing file permissions?”
“I was asked some questions about my perl knowledge.”
“I was asked a problem involving assembler and binary arithmetic that essentially came down to "What is 01 AND 10"?”
“Difference between 32 and 64 bit OSs.”
“How to write a testplan. Other questions were pretty basic. The hiring manager didn't have a clue about the job.”
“Where do you see yourself in five years.”
“The question in this case were about working with creative types which the job at the time was going to involve. The technical interviews can get technical especially if you are being hire to work…”
“what is mpls, openflow, openstack, layer2 and layer3 protocol, basic unix command line, python dictionary, list, set”
19 of 9 Interview Questions
|
global_05_local_5_shard_00000035_processed.jsonl/31194
|
Search Images Maps Play YouTube News Gmail Drive More »
Sign in
1. Advanced Patent Search
Publication numberUS5460012 A
Publication typeGrant
Application numberUS 08/290,365
Publication dateOct 24, 1995
Filing dateAug 12, 1994
Priority dateOct 26, 1993
Fee statusLapsed
Also published asCN2235594Y
Publication number08290365, 290365, US 5460012 A, US 5460012A, US-A-5460012, US5460012 A, US5460012A
InventorsStanley K. M. Kwok
Original AssigneeKwok; Stanley K. M.
Export CitationBiBTeX, EndNote, RefMan
External Links: USPTO, USPTO Assignment, Espacenet
Cooling apparatus
US 5460012 A
Cooling apparatus is disclosed which comprises a reservoir for compressed, preferably liquified, gas, the reservoir being connected to tubing 130 arranged to be disposed in an article of clothing adjacent to the skin of a user. A solenoid 230 is provided for opening a valve 240 between the reservoir 100 and the tubing 130 to allow pressurized gas to evaporate and escape from the reservoir along tube 130. As the gas evaporates it cools due to latent heat of evaporation thus providing a cooling effect to the user due to heat transfer through the walls of tubing. A control device 200 is provided for regulating the output of cooling gas in dependence on temperature.
Previous page
Next page
I claim:
1. Cooling apparatus comprising:
a portable reservoir for containing a gas under pressure;
temperature controlled valve means for releasing the gas from the reservoir, said temperature controlled valve means including a valve member adapted to seat against an outlet of the reservoir and a solenoid connected to a temperature controller including a temperature sensor for actuating the solenoid to open the valve once the sensed temperature increases beyond a predetermined threshold; and
means for contacting a user or an article of clothing having a thermally conductive wall and connected to the valve means and into which gas is released, for conducting the cooling effect of the released gas through said wall to a region to be cooled.
2. Apparatus as claimed in claim 1 wherein the reservoir is for containing a liquified gas.
3. Apparatus as claimed in claim 2 wherein when the liquified gas is nitrogen.
4. Apparatus as claimed in claim 1 wherein the conducting means is adapted to be disposed in an article of clothing, footwear or head gear.
5. Cooling apparatus as claimed in claim 4 wherein the conducting means is formed from tubing.
6. Apparatus as claimed in claim 1 wherein the apparatus is disposed within an article of headgear.
7. Apparatus as claimed in claim 1 wherein the apparatus is disposed within an article of footwear.
8. Apparatus as claimed in claim 1 wherein the valve is closed once the temperature descends beyond a further threshold lower than the predetermined threshold.
9. Apparatus as claimed in claim 1 or claim 8 wherein the temperature sensor comprises a thermistor.
10. Apparatus as claimed in claim 1 wherein the temperature sensor is disposed adjacent to the conducting means.
11. Apparatus as claimed in claim 1 wherein the apparatus is portable.
This invention relates to cooling apparatus more specifically but not exclusively, to apparatus to cooling articles of clothing.
It is often necessary for the individual, particularly in a hot climate, to employ external means to keep cool, for example by using a portable fan. It is an object of the invention to provide an improved apparatus for cooling the individual.
According to the invention there is provided cooling apparatus comprising a reservoir for containing gas under pressure, temperature controlled valve means for releasing the gas from the reservoir; and means connected to the valve means for conducting the released gas to a region to be cooled thereby.
In the described embodiment as gas is released from the reservoir, the gas will expand to ambient pressure and as the gas expands it cools due to latent heat of evaporation thus providing a cooling effect to the user due to heat transfer through the conducting means.
Preferably the cooling apparatus of the invention is portable and is of sufficiently small size to be concealed within or attached to the user's clothing, with the conducting means preferably being in the form of a heat conductive tube which may be applied the body, for example in the neck region or may be threaded or otherwise engaged with clothing, for example in pockets formed in the material of a shirt or embedded on the inner surface of the sole of a shoe. Preferably, the compressed gas is in liquified form such as liquid nitrogen and means are provided for refilling the gas reservoir from a replenishment canister in similar manner to the way a gas cigarette lighter is recharged with butane.
An embodiment of the invention will now be described by way of example with reference to the accompanying drawings in which:
FIG. 1 is a schematic "transparent" perspective view
showing an embodiment of the invention.
FIG. 2A is a side view in the direction of arrow A of FIG. 1 showing a valve open, and FIG. 2B is a view similar to FIG. 2A showing the valve closed.
FIG. 3 is a schematic diagram of the temperature control circuitry of the embodiment of FIGS. 1 and 2.
FIGS. 4a and 4b show front and back views respectively of an embodiment of the present invention mounted in an article of clothing.
FIGS. 5a-5c show side, top and perspective views respectively of an embodiment of the invention mounted in an article of headgear.
FIGS. 6a-6c show side, underneath and perspective views respectively of an embodiment of the invention mounted in an article of footwear.
With reference to the drawings an embodiment of the invention is shown which comprises a reservoir 100 for containing a compressed, preferably liquified gas e.g. nitrogen, the reservoir 100 having a filling/refilling inlet 110 which includes a one-way inlet valve of conventional construction and, an outlet 120 connected to a tube 130 open at its free end (not shown).
The reservoir 100 is connected to a control unit 200 which houses a temperature and regulation circuit 210, a battery power supply 220 and valve actuating solenoid 230. The solenoid 230 is connected to a neoprene rubber valve member 240 via an actuator 250 which in response to actuation of the solenoid moves from the position shown in FIG. 2A in which the valve member is distant from a hollow bush 125 forming part of outlet 120 and which forms a valve seat to a position shown in FIG. 2B in which the valve member 240 effects a seal against bush 125. The actuator 250 passes through the wall of the reservoir 100 via a neoprene seal 260 and actuator 250 is biased in the sealing position shown in FIG. 2B by means of a spring 270 disposed between the solenoid 230 and a reaction member 275 connected to the actuator 250.
The temperature control circuit 210 shown in more detail in FIG. 3. The circuit is connected to a temperature sensor, for example a thermos couple wire 300 which may be wound around a part of tube 130 as shown or disposed inside or on the surface of the control unit 200. A signal from the temperature sensor 300 is fed to a temperature voltage converter 310 and then to a comparator circuit 320. The comparator circuit 320 is biased by resistors R1-R4 and includes two variable resistors R2 and R3 which set upper and lower temperature threshold levels for the comparator 320 which will provide a high, ON signal when the upper threshold temperature is reached and provide a low OFF signal when the lower threshold temperature is reached. The signal from the comparator is fed via a diode D1 to a solenoid driving transistor T1 which when receiving the high ON signal from the comparator 320 actuates the solenoid 230.
The circuit 210 includes a display 350 for displaying current temperature or upper/lower threshold temperatures and keys for 352-356 for switching the device on and off and for adjusting the threshold temperatures.
The tube 130 may be initially of heat insulating material protected by metal braid leading to a tube of plastics material such as PVC which is positioned in an item of clothing so as to lie adjacent to the skin. For example, the tube may be placed within the collar of a shirt, the lining of a jacket adjacent the shoulders or torso (see FIGS. 4a and 4b), in the inside sole of a shoe at the surface (see FIGS. 6a-6c) or in articles of underwear.
The reservoir 100 and control unit 200 can be of a size depending on the application. For example they could be the size of a personal stereo/cassette player and clipped to the belt, connected to the tubes in the clothing by means of a detachable connecter or, for applications for use in footwear the reservoir and control circuit could be implanted in the heel of a shoe. In some applications, for example in sports clothing, in which excess heat is usually present, leading to problems such as athletes foot, the device may be arranged to be permanently on once actuated thus eliminating the need for temperature control circuitry. The invention is equally applicable for use in headgear, (see FIGS. 5a-5c).
Preferably, the reservoir may be replenished by use of a master cylinder engaging with the reservoir through the refilling nipple 110, one-way valve being engageable by the cylinder in a similar manner to the way in which a cigarette lighter may be refilled with LPG from such a cylinder.
In use, when a temperature above the upper temperature threshold is sensed by the temperature control circuitry, the solenoid 230 acts to move the valve member 240 away from bush 125 thus opening the valve. As the gas in the reservoir is held in liquid form under pressure, this will expand through the open valve and be transported through tubing 300. As the gas expands, it gives of latent heat of evaporation cooling itself considerably. As the cool gas circulates through tube 300, heat is transferred through the walls of the tube to the user thus providing a cooling effect.
The invention has described above with reference to one embodiment. However, this is not to be construed as limitative. For example, although the thermos couple and temperature control circuit has been shown, this may be omitted in order to reduce weight and cost, with the user switching the device on and off as required. Furthermore, although the power supply has been shown as two cylindrical "pen lite" batteries, other power supplies may be used and, in particular, button-shaped nickel cadmium or lithium batteries may be used.
Patent Citations
Cited PatentFiling datePublication dateApplicantTitle
US3295594 *Sep 3, 1964Jan 3, 1967United Aircraft CorpThermal garment
US4129432 *May 4, 1977Dec 12, 1978Garwall Cooling LimitedExpendable refrigeration system
US4736530 *Feb 17, 1987Apr 12, 1988Nikola LakicShoe with heat engine and reversible heat engine
US4744100 *Jul 10, 1986May 10, 1988Agfa-Gevaert AgX-ray sheet film cassette
*DE250863C Title not available
GB469753A * Title not available
GB1003769A * Title not available
GB1531647A * Title not available
GB2005000A * Title not available
GB2017287A * Title not available
WO1983002562A1 *Feb 1, 1982Aug 4, 1983Elkins, WilliamPersonal temperature control system
Referenced by
Citing PatentFiling datePublication dateApplicantTitle
US6109338 *May 1, 1997Aug 29, 2000Oceaneering International, Inc.Article comprising a garment or other textile structure for use in controlling body temperature
US6865825May 10, 2001Mar 15, 2005Promdx Technology, Inc.Ergonomic systems and methods providing intelligent adaptive surfaces and temperature control
US6942015 *Oct 5, 2000Sep 13, 2005Jenkins Comfort Systems, LlcBody heating/cooling apparatus
US20130166079 *Dec 23, 2011Jun 27, 2013Kurt R. WilhelmMobile, personal, open-loop cooling systems and methods
U.S. Classification62/224, 606/22, 62/259.3, 165/46
International ClassificationA42C5/04, F25D29/00
Cooperative ClassificationA42C5/04, F25D29/001
European ClassificationF25D29/00B, A42C5/04
Legal Events
Dec 11, 2007FPExpired due to failure to pay maintenance fee
Effective date: 20071024
Oct 24, 2007LAPSLapse for failure to pay maintenance fees
May 9, 2007REMIMaintenance fee reminder mailed
Apr 23, 2003FPAYFee payment
Year of fee payment: 8
Apr 15, 1999FPAYFee payment
Year of fee payment: 4
|
global_05_local_5_shard_00000035_processed.jsonl/31216
|
Chocolate Cherry Cake Recipes
159 recipes to browse.
Filtered by
• cinnamon
Narrow your search
Use the filters in this column to find the perfect recipe.
Ingredient Filters
vegetables fruits dairy flours chocolate nuts uncategorized seasonings & flavorings
Maybe List
When you're ready, we'll help you decide between similar recipes.
Holding 0 recipes
|
global_05_local_5_shard_00000035_processed.jsonl/31221
|
Main Dish Recipes
406 recipes to browse.
Filtered by
• paprika
• cayenne pepper
Narrow your search
Use the filters in this column to find the perfect recipe.
Ingredient Filters
meats vegetables dairy hot & spicy uncategorized seasonings & flavorings
Maybe List
When you're ready, we'll help you decide between similar recipes.
Holding 0 recipes
|
global_05_local_5_shard_00000035_processed.jsonl/31222
|
Main Dish Recipes
598 recipes to browse.
Filtered by
• vegetable oil
• eggs
Narrow your search
Use the filters in this column to find the perfect recipe.
Ingredient Filters
meats vegetables cheeses dairy flours hot & spicy uncategorized seasonings & flavorings
Maybe List
When you're ready, we'll help you decide between similar recipes.
Holding 0 recipes
|
global_05_local_5_shard_00000035_processed.jsonl/31236
|
In association with heise online
07 June 2012, 10:29
LinkedIn confirms that user passwords were compromised
• Twitter
• Facebook
• submit to slashdot
• StumbleUpon
• submit to reddit
LinkedIn logo LinkedIn has confirmed that some of the more than six million password hashes which were stolen and published online correspond to accounts belonging to its members. The professional social networking web site has now disabled the passwords for affected accounts.
Affected users should receive an email from LinkedIn with instructions explaining how to reset their passwords. LinkedIn Director Vicente Silveira says that these initial password reset emails will not contain any links. This is most likely being done to protect users against possible phishing attacks in which attackers could, for example, send emails with instructions to reset passwords and links to web sites constructed to impersonate LinkedIn, in order to trick people into providing private information.
Once users follow the instructions in the LinkedIn email to request a password re-set, they should then receive an email from the company containing a password reset link. Anyone who uses the same password for other services should ensure that they change those passwords as well.
Silveira goes on to note that the newly reset passwords will be stored more securely using a salted hashed format; the company's password databases have "recently" switched to using this more secure format. The company has yet to confirm exactly how many accounts were compromised or how the databases were accessed, but says that it is continuing to investigate the situation.
Print Version | Send by email | Permalink:
• July's Community Calendar
The H Open
The H Security
The H Developer
The H Internet Toolkit
|
global_05_local_5_shard_00000035_processed.jsonl/31250
|
Printer Friendly Version ] [ Report Abuse ]
Back Next
My Name Is Andromeda Black by Nessa Elendil
Chapter 6 : Kelpie
Rating: MatureChapter Reviews: 1
Background: Font color:
A/N: Sorry the chapter took so long. I'll try to get the next one up sooner.
As I walked into the Great Hall, I could feel them trying to catch my eye, but I pretended not to notice. I immediately sat at the Slytherin table, and didn't look up during the Sorting; I barely touched my food, and the moment Professor Dumbledore allow us to go to our Common Rooms, I bolted out the door. I was angry at myself, again. I had let them control me, again.
That night, my eyes were tearful as I fell into a fitful sleep. I think I dreamt about something regarding that day, but I didn't remember what.
Transfiguration was my first class, double block, Slytherins and Gryffindors. I took my usual seat in the far corner of the room and waited for Professor McGonagall to arrive and begin the lesson. I'd always enjoyed Transfiguration, even though I spent the class in the back completely focused on my notes and in-class work. But before the day's lesson could begin, something happened that I was not expecting: Ted and Shrouder came in and sat with me. Shrouder was next to me, and Ted in front.
My shock must have shown on my face, for both boys asked "What?"
"Well, I-- I just thought--"
"So you felt tired after the feast. Happens to the best of us," Ted said with a wink, turning around as Professor McGonagall entered her classroom.
I smiled, opening my notes to a new page as the lesson began.
Ted, Shrouder, and I all had a free block the class before last that day, because our rather. . . unbalanced Divination teacher, Professor Mallory, had a "vision" that anyone who went to class that day would end up drowning in the lake or something, and absolutely refused to hold any classes that day.
Ted and I were sitting beside the lake - not in any danger of drowning - and it would have been a pleasant view of the landscape around Hogwarts had Shrouder not been standing in the lake, pretending to drown.
"You know," Ted called out, "one time you really are going to be drowning, and we won't know you scrawny butt needs saving until we see it floating with the current."
Shrouder stopped his splashing and stood up (the water only reached his midriff). "Well won't you feel bad," he said, and resumed his act of Professor Mallory's "vision" come true.
"At least we'll still be feeling; I hear you lose that ability once you're dead," Ted shot back, but Shrouder either didn't hear him or chose to ignore him. "Impossible," Ted whispered to me.
"I know the feeling," I said aloud, and without meaning to.
Ted looked at me oddly, like he hadn't expected me to say what I did either.
"What?" I asked quietly.
"Nothing," he answered. At least he hadn't responded as though I had sounded defensive.
It was then that I realized who was sitting so close to me, who was looking right at me. I could feel my pulse rise, and I tried not to show it as I mentally forced my face to stay its usual color. Unfortunately, I was so enamored by the situation I was in that I failed to notice the large sum of water over our heads, until it was let down on top of us.
"Shrouder!" Ted yelled.
Ted and I were soaked to the bone, just as wet as Shrouder - who was laughing in the water - was.
"What the heck was that for?!" Ted was on his feet, wiping water out of his eyes.
"The opportunity was just so perfect," Shrouder said through his laughter.
But Merlin, I hadn't realized how cold the water would be.
Ted offered me his hand and pulled me to my feet. I took out my wand and muttered a quick drying spell on myself, and when Ted pulled out his wand, I expected him to dry himself. Instead, he turned his wand on Shrouder. A flash of light later, and a large piece of seagrass was - semi-effectively - trying to strangle Shrouder.
"Ted! That's not funny!" Shrouder called as the aquatic plant wrapped around him.
I had to fight to suppress a smile, the sight was rather amusing to watch, but Ted looked as though nothing more had happened than him sending an owl as he dried himself off.
"C'mon, we're going to be late!" Ted called when the bell rang.
I went to Charms, and my two friends were in Potions. After this lesson was the end of classes and supper though, so sitting for an hour in a room full of Slytherins didn't look nearly as bad as it usually did.
Supper, however, was. . . interesting. I met Ted and Shrouder outside of the Great Hall, and Shrouder was still soaked with the seagrass wrapped around him.
To my questioning look, he said, "You don't really expect me to let Kelpie dry out, do you?"
" 'Kelpie'?"
"He named it," Ted answered in a voice suggesting lost hope. "Now he won't let go of it."
"He even knows his name; watch! Come here, Kelpie, give Daddy a kiss!"
"And he charmed it."
I had to bite my lip to keep from bursting out laughing when I saw "Kelpie" place what Shrouder only could have interpreted as the seagrass's head against his lips.
"You don't even know where that thing's been!" Ted said disgustedly.
Shrouder put his hands around Kelpie's ears (or where they would be if Kelpie had ears) and said, "Don't listen to him, Kelpie, he doesn't mean it; he's just in denial."
"Of losing my best mate to a weed? Yeah, I'd say that's entirely possible."
Despite my attempts to subdue it, my laughter broke out in a small chuckle, which caused Shrouder to round on me.
"Oh, so you agree with him, do you?"
"Well, I don't disagree," I said cautiously, realizing that Ted and Shrouder were standing by the Gryffindor table, and I had somehow followed them.
"Fine then, Kelpie and I don't need this. . . this jaundice! You stay here and we'll take your seat!" Shrouder said defiantly, and, before I could even begin to process what he had said, he marched off, his wet shoes squeaking loudly on the floor, to the Slytherin table.
"What's he doing?" I asked Ted, afraid that I had caused this.
Whatever was in my voice, Ted seemed to catch, because he said, "Don't worry, he's just being Shrouder. Just sit down; if you go over there now, he'll probably start running all over the school screaming about how his weed has feelings too. I already got an earful of that in Potions when Slughorn said it'd be best to brew the thing, and I really don't want to have to run around after him."
I didn't quite know how to respond to that, so I just nodded and sat next to Ted. No one raised any objection to my sitting there, but then again, I don't think anyone noticed a Slytherin eating at their table. Out of curiosity, I looked over at the Slytherin table, and saw Shrouder had seated himself next to my sister (who had a look of disgust plastered on her face) and was chatting animately with her - probably about Kelpie.
"Actually, I think he was doing something similar to then when he decided no one would use his real name and we'd all have to start calling him 'Shrouder', " Ted added as an afterthought.
That reminded me of something I was almost surprised I didn't know. "What is Shrouder's real name?"
Ted shook his head, swallowing the bit of mashed potatoes he was eating before using words to answer. "He'd kill me if I told, and I promised I wouldn't."
I didn't to answer, though, because at that moment a loud shriek was heard over at the Slytherin table. Apparently, Shrouder had Kelpie kiss Bellatrix, and she hadn't responded too positively to that.
"Mr. Phamet!" Shrouder's Head of House yelled.
Ted and I watched - Ted with amusement - as Professors McGonagall and Slughorn made their way to where the commotion was. Slughorn sent Bella out of the Great Hall, probably to the Common Room, and returned to his seat at the Head Table. Ted said this was because he was done dealing with Kelpie. McGonagall, however, threatened Shrouder - or "Mr. Phamet" - with a detention the next time he tried something like that, took a point from Gryffindor for dragging Kelpie all around Hogwarts, and walked him back to the Gryffindor table.
She quietly said, "Miss Black, you are welcome to sit here so long as you do not cause any disturbances as Phamet has been doing." She then produced her wand and Shrouder visibly flinched. McGonagall ignored this and dried Shrouder with a flick of her wand.
When she left, Shrouder opened his eyes and looked all around himself.
Ted turned away. Anyone who hadn't been sitting as close as I may have thought it was because he didn't want to witness Shrouder's reaction, but I saw that it was to hide his laughter. Kelpie was gone.
"KELPIE!" Shrouder howled, throwing himself, crying, on both Ted and me. "Oh, Kelpie, he's gone!"
"Well, he's. . . at a. . . better. . . place. . .," I said unconvincingly, awkwardly patting the wailing Shrouder on the back. That, however, just made him cry harder.
Ted just handed him a cracker soaked in cheese, dipped in ketchup, and sprinkled with relish. To my shock, and slight disgust, that immediately quieted him, even if he still looked heartbroken over losing Kelpie.
Not a minute later, though, Ted caught my eye and we both snickered as Shrouder hummed a soft funeral march while he walked the cracker into his mouth.
"I only hope he agrees that that Kelpie thing is in a better place once he finishes that cracker," Ted whispered to me.
I only hoped Ted didn't notice that I blushed when his warm breath tickled my ear. His distance may have only been so close so that Shrouder wouldn't hear, but I really didn't care.
Previous Chapter Next Chapter
Favorite |Reading List |Currently Reading
Back Next
Review Write a Review
My Name Is Andromeda Black: Kelpie
(6000 characters max.) 6000 remaining
Your Name:
Prove you are Human:
Submit this review and continue reading next chapter.
Other Similar Stories
Her Whisper ...
by stargazer
by 11whimsy
Until You
by angelchaser13
|
global_05_local_5_shard_00000035_processed.jsonl/31260
|
What causes earache? 20 possible conditions
Viewing 20 of 20 results
What Are Earaches?
Earaches occur most often in children. However, they can occur in adults as well. An earache may affect one or both ears. It may be constant or come and go, and the pain may be dull, sharp, or burning.
If you have an ear infection, fever and temporary hearing loss may occur. Young children who have ear infections tend to be fussy and irritable. They may also tug or rub their ears.
What Are the Common Causes of Earaches?
Earaches may be caused by injury, infection, or irritation in the ear. Earaches may also be caused by referred pain. Referred pain is pain that is felt somewhere other than the site of the infection or injury. Pain originating in the jaw or teeth may be felt in the ear.
Common causes of earaches include:
• ear infection
• changes in pressure
• ear wax buildup
• a foreign object in ear
• sore throat
• sinus infection
• shampoo or water in the ear
• use of cotton swabs in the ear
Less common causes of earaches include:
• temporomandibular joint (TMJ) syndrome
• perforated eardrum
• arthritis affecting the jaw
• tooth infection
• impacted tooth
• eczema in the ear canal
• trigeminal neuralgia (chronic facial nerve pain)
When to See a Doctor
If you or your child has a persistent fever of 104 degrees F or higher, seek medical attention. For an infant, seek help immediately for a fever higher than 101 degrees F. You should also seek immediate medical attention if severe pain stops suddenly. This can be a sign of the eardrum rupturing.
There are other symptoms you should also watch for. If these symptoms appear, make an appointment with your doctor:
• severe ear pain
• dizziness
• bad headache
• swelling around the ear
• drooping of the facial muscles
• blood or pus draining from ear
If an earache gets worse or does not improve in 24 to 48 hours, make an appointment with your doctor.
Treating Earaches at Home
There are several steps you can take at home to reduce earache pain. They include:
• applying a cold washcloth to the ear
• avoiding getting the ear wet
• sitting upright to help relieve ear pressure
• using over-the-counter ear drops (not if the eardrum has ruptured)
• taking over-the-counter pain relievers
• chewing gum to help relieve pressure
• feeding an infant to help relieve pressure
Medical Treatment for Earaches
If you have an ear infection, your doctor will prescribe antibiotic tablets or eardrops. It is important that you finish your prescription. This ensures that the infection will clear up completely. Do not just stop taking medication once your symptoms improve.
If wax buildup is causing your ear pain, you may be given wax-softening eardrops. This may cause the wax to fall out on its own. Your doctor may also flush it out of your ear.
TMJ, sinus infections, and other causes of earaches will be treated directly. This should improve your ear pain.
Preventing Earaches
Some earaches may be preventable. Preventive measures include:
• avoiding smoking and exposure to secondhand smoke
• keeping foreign objects out of the ear
• drying the ears after swimming or bathing
• avoiding allergy triggers, such as dust and pollen
Article Sources:
Read More
Earwax Blockage
Earwax blockage can occur as a result of too much
Read more »
Otitis Externa
Read more »
Foreign Body in Ear
Read more »
Middle Ear Infection
Read more »
Sinus Infections (Sinusitis)
Read more »
Sore Throat
A sore throat refers to pain, itchiness, or irritation of the throat. It may cause difficulty and pain when swallowing. Throat pain is the primary symptom of a sore throat. Other symptoms include dry throat, swolle...
Read more »
Read more »
One of the most important structures in your inner ear is the mastoid bone. Although it's called a bone, the mastoid does not have the typical structure associated with bones in the human body. Rather than being soli...
Read more »
TMJ (Temporomandibular Joint) Disorders
Read more »
Ear Barotrauma
Ear barotrauma causes ear discomfort due to pressure changes. Occasional ear barotrauma is common, especially in changing altitudes when flying in an airplane. It is generally not harmful, but frequent cases can caus...
Read more »
Chronic Ear Infection
Swollen lymph nodes behind and below the ears can indicate an infection.
Read more »
Malignant Otitis Externa
Otitis externa is a common ear infection that is also known as "swimmer's ear." It develops in the inner ear. In some cases, otitis externa can spread to the outer ear and surrounding tissue, including the bones of th...
Read more »
Eardrum Rupture
Read more »
Teeth Grinding
Bruxism is the technical name for teeth grinding or jaw clenching. Learn why people grind their teeth (stress, misaligned teeth, posture) and explore information about the symptoms and treatments for bruxism now.
Read more »
Menieres Disease
Meniere's disease is a disorder of the inner ear that causes vertigo, hearing problems, and a ringing sound. It's thought to be caused by changes in the fluid of the inner ear, and usually only affects one ear.
Read more »
Trigeminal Neuralgia
Trigeminal neuralgia (TN) is a chronic, painful condition involving the nerve responsible for carrying the sensation of pain and other sensations from the face to the brain. The condition causes intense pain in part o...
Read more »
Bell’s Palsy
Read more »
Subacute Thyroiditis
Read more »
Chlorine Poisoning
Read more »
Acoustic Neuroma
Read more »
Please consult a healthcare professional if you have health concerns.
Add another symptom to narrow down the possibilities
I'm experiencing:
Choose from list of symptoms:
|
global_05_local_5_shard_00000035_processed.jsonl/31266
|
8. Scyphophorus pyxidatus, Hook.—Cup-Moss.
Botanical name:
Fig. 162. Scyphophorus pyxidatus. Scyphophorus pyxidatus, Hook, Engl. Fl. vi. p. 238; Cenomyce pyxidata, Ach. Syn.; Cladonia pyxidata, Schaer. Lich. Helv. Spicil. p. 26; Lichen Pyxidatus, Linn.; Muscus pyxidatus, Dale, Pharm.; Cup-moss.—This species (frequently mixed with S. fimbriatus, Hook., and sometimes with S. cocciferus, Hook.) is the Cup-moss of the shops. It was recommended by Dr. Willis [Pharmaceutice Rationalis, pars 2da, p. 49, 1678.] as a remedy for whooping-cough [See, also Dillenii, Dissertatio de Lichene Pyxidato, in Schlegel's Thesaurus Materia Medica, t.i.p. 307, Lipsiae, 1793.]. He gave it in drachm doses, in the form of powder, decoction, and syrup.
|
global_05_local_5_shard_00000035_processed.jsonl/31277
|
Table 3: Side effects of L-Carnitine treatment.
GIT symptoms2 (8%)
Stuffy nose1 (4%)
Hyperactivity1 (4%)
Headache2 (8%)
The table showed that, the most encountered side effects of L-Carnitine were the gastrointestinal disorders and headache. Blocked nose and hyperactivity; both were recorded in one child. Insomnia, palpitation or hypertension was not reported. None of these side effects enforced the patients to stop the intake of the oral L-Carnitine.
|
global_05_local_5_shard_00000035_processed.jsonl/31301
|
Dr Robert Jay Lifton THE NAZI DOCTORS:
Medical Killing and the
Psychology of Genocide ©
Page 161
Previous Page
Home Page
Home Page
Next Page
The Auschwitz Institution
especially if the rooms were kept dry and gastight and closely packed with people, and provided they were fitted with as large a number of intake vents as possible.”34
Mass killing of Jews began either in late 1941 or early 1942. The Auschwitz administration had procured Zyklon-B indirectly from the manufacturer, DEGESCH, an acronym for German Corporation for Pest Control. DEGESCH, largely controlled by I. G. Farben, distributed the gas through two other firms — in Auschwitz’s territory, through TESTA.35 In 1942, its distribution within the SS became centrally regulated by the SS Hygienic Institute in Berlin under Dr. Joachim Mrugowsky. Given its extensive prior use against rodent and insect spreaders of disease, we might say that Zyklon-B was always considered a form of medical equipment. Yet it was placed under stricter medical supervision only as the prime chemical of extermination, and was even stored in the Auschwitz pharmacy for a period of time.*
Another change took place as well. In the past, Zyklon-B had by law been combined with a small amount of an irritant gas designed to warn of the presence of the dangerous substance when premises had not been sufficiently ventilated after fumigation. Sometime in 1943, the gas began to be distributed to Auschwitz without the irritant, and bore the warning: “Attention! No irritant!” Removing the irritant clearly expedited the killing process, but that step itself presented a greater danger for those handling this lethal gas. Special training had always been required for that purpose. The group handling the gas had originally been drawn from personnel associated with the manufacturer, but the responsibility was transferred to a special group of “disinfectors” from among the SS medical corpsmen These Desinfektoren became a noncommissioned élite, and part of the duty of the doctor on the Auschwitz ramp was to take necessary measures to protect them from exposure to Zyklon-B and to be prepared to treat them should such exposure occur. We can say, then, that Zyklon-B became a dangerous “killing medicine,” to be handled only by medical personnel.36
* One doctor I interviewed, who held a senior advisory position within Nazi civilian and military structures, told me of serving as chairman of a high-level committee on allocating scarce medical equipment to civilian and medical groups, including the SS. After the war, he claimed to be horrified and chagrined to learn what the SS had used Zyklon-B for. The story tends to confirm the medical status of the gas. Concerning the doctor’s claim of ignorance, I would say that he had demonstrated in a variety of ways an extreme capacity for invoking the psychological defenses of denial and numbing, of the will not to know. In his case, those defense mechanisms would have to have been extreme — one suspects that in at least part of his mind, he knew — given the increasingly large amounts of gas the SS required for Auschwitz for example, for fumigation, camps got delivery about every six months; Auschwitz got one every six weeks.
† The manufacturer opposed the removal of the irritant because its patent had been on this irritant addition, rather than on the gas itself. Involved in this change was Kurt Gerstein, then chief disinfection officer in the SS, who worked under Mrugowsky in Berlin. Gerstein had an engineering background as well as a certain amount of medical training. Few figures have been as confusing to historians and biographers, given his intense SS involvement at the center of mass murder, along with his fanatical SS demeanor; yet also his Protestant evangelical anti-Nazi connections and desperate efforts (including a dangerous conversation with a Swedish diplomat) to inform the outside world about the Final Solution. Gerstein later claimed — and was believed by one biographer — that he had proposed that the irritant be discontinued on the grounds that, without it, death was more humane, and that by rendering the gas undetectable, he could find a pretext for destroying consignments with the claim of dangerous leakage. Most observers — notably Rolf Hochhuth in his 1964 play The Deputy — have emphasized Gerstein’s extraordinary acts of resistance; others, such as Hilberg, are primarily impressed with his role in the mass murder process. There is a sense in which both groups are correct: I believe Gerstein to have been the most extreme example of the doubling process encountered in this study.37
Medical Killing and the
Psychology of Genocide
Robert J. Lifton
ISBN 0-465-09094
© 1986
Previous Page Back Page 161 Forward Next Page
|
global_05_local_5_shard_00000035_processed.jsonl/31354
|
Faisal J. Abbas Headshot
Why I Oppose the Saudi Cleric's 'Kill Bill'
Posted: Updated:
A recent edict (fatwa) by a Saudi cleric calling for opponents of strict segregation of men and women to be put to death if they refuse to abandon their ideas has, un-surprisingly, created a storm of negative reactions in the past few days.
Shaikh Abdul-Rahman al-Barrak has decided that the mixing of genders at the workplace or in education "as advocated by modernizers" is prohibited because "Whoever allows this mixing ... allows forbidden things, and whoever allows them is an infidel and this means defection from Islam ... Either he retracts or he must be killed ... because he disavows and does not observe the Sharia," Barrak said, according to the Reuters news agency.
However, al-Barrak's 'fatwa' was criticized by a huge number of Muslim clerics in Saudi Arabia and other countries; perhaps most prominently by the likes of Abdul Hamid al-Atrash, the former leading authority at Cairo's Al-Azhar University, who reportedly labeled the edict as an 'extremist's interpretation of Islam'.
Obviously, there was much worry that this 'fatwa' could be taken seriously and thus be understood as a 'Kill Bill': a 'carte-blanche' for extremists to start slaughtering people of both genders who dare attend 'mixed' schools or work-places.
The questions is: has shaikh al-Barrak considered what impact such a 'fatwa' could have?
I say this because I would have thought men of such authority should always predict what outcome could result of their actions or words.
Shaikh al-Barrak doesn't hold a government position in Saudi Arabia, yet as a cleric he has significant influence over people; who would be to blame if one of his followers decided to implement the fatwa literally?
There certainly will be blood - but what then?
Do we say a class of 6th graders deserved to die because they shared a biology lab together? Do we allow nurses, doctors and owners of hospitals to be killed because they dared to work under the same roof?
Scary questions, no doubt! But the most important question is: what are we doing about these 'un-carefully thought-through' (to say the least) fatwas?
Someone might say: 'ah... but Al-Azhar has criticized al-Barrak'.
Hold on! wasn't it Al-Azhar itself who had to discipline one of its own clerics back in 2007? Just a reminder: this was after he issued a decree allowing women to breastfeed their male colleagues, labeling it as a way around the imposing of segregation of the sexes at work as it (breastfeeding) is believed to establish a degree of maternal relation.
I have tremendous respect to al-Barrak and Al Azhar as religious authorities, however in recent years the 'fatwa industry' has banned everything from selling/buying roses on Valentine's Day to emoticons in internet chatting (and let us not forget the call for the death of Mickey Mouse)... this was all done in the sake of authority, I believe.
I am in no position nor do I claim to have enough religious knowledge to say what makes a good cleric and what doesn't, but logically religions were not (or shouldn't be believed to be)set in stone, as everything else... it is only fair to expect them to evolve.
Having said that, despite the little I know about Sharia I still think al-Barrak is wrong: apart from the many references to gender-mixing in Islamic history, I have one question to ask: if Muslims, males and females, go to pilgramage together and they are allowed to 'mix' at the Holy Mosque in Mecca - how could it possibly be religiously required for them to be seperated in class rooms or work-places?
I say this because I truly believe the problem isn't in the religion itself, the problem is that many of us forget that 'fatwas' are man-made ultimatums which 'Muftis' come up with in the absence of a clear position on the matter in the Quran or in the teachings of Prophet Mohammad (PBUH).
Many fatwas are useful, however we seem to forget that to err is to human and that shaikhs should be accountable at all times, perhaps more than anyone else.
All I can say is: think before you preach, my shaikh!
|
global_05_local_5_shard_00000035_processed.jsonl/31355
|
Huffpost Politics
Jason Stanford Headshot
When Romney Talks, Mitt Happens
Posted: Updated:
Republican consultants are trying to figure out what's wrong with little Willard, and their latest diagnosis is that their frontrunner has an "authenticity problem."
"His authentic inauthenticity problem isn't going away. And it's sapping enthusiasm from the rank and file," wrote Jonah Goldberg in the National Review.
Mitt Romney has the opposite problem that Al Gore Jr. had. When Gore was whipping America into a stupor long in 2000, the vice president's aides assured us that behind closed doors he was one funny dude.
But with Mitt, what we see is what we get. When he's not robotically reciting patriotic texts or doing his laundry in a motel in front of TV cameras, Mitt tends to open his mouth and let a whole lot of awkward pour out.
Let's roll tape:
Remember last July when he sat around a table with jobless Floridians and joked, "I'm also unemployed"? Or the time at the Iowa State Fair last August, when he said, "Corporations are people, my friend" to people who weren't his friends? I don't even say "my friends" to my real friends, but Romney can't get through a stump speech without that rhetorical crutch.
Then there was the time last fall when Romney tried to bet Rick Perry $10,000 that he never supported individual health care mandates in his book. One of Romney's top consultants defended his man by calling the bet "a very human thing to do." You've got a real problem when the guys on your payroll resort to calling you "human" to explain your awkwardness, but Mitt happens.
It happened recently at a NASCAR event when Romney mocked spectators to their faces over their transparent plastic ponchos. "I like those fancy raincoats," he said. "You really sprang for big bucks."
A horrifying inability to make benign small talk is one of Romney's indelible birthmarks. This is the kind of guy who tried to make small talk with a married couple sitting together in a booth, "You know each other?" He'll chat you up as he did one man: "What's happened to your financials the last couple of years?" If you're an older lady leaving a gym, Mitt will ask, "Are your knees, hips doing okay?" To a group of seniors at a town hall, he'll ask, "Anyone here over 100 years old?" Over a fried chicken lunch in Iowa, Romney might try to make small talk with the restaurant owner by referring to his meal as a "product."
This guy puts the "man" in "mannequin." Every time Mitt Romney tries to talk to regular people -- that is, those of us who don't make $20 million a year without knowing how to hit a curveball -- a senior Romney staffer gets a gray hair. Romney's awkward attempts at casual banter were one reason that Republicans thought Rick Perry would solve their problems. Romney's inability to act normal is why his handlers constantly dress him up like a J.C. Penney catalog model.
But when it comes to the Romney campaign, when the going gets tough, the candidate gets weird. There's a saying in campaigns and comedy that you can't fix stupid. The Romney corollary to that is that you can't fake this kind of strange.
Like Darrell Royal, the former football coach at the University of Texas liked to say, "You got to dance with them what brung you." For all their dreaming of a late entrance by Chris Christie or Jeb Bush, Republicans are stuck with Romney. And no amount of wishing will change him from what he really seems to be: a deeply weird, horribly awkward plutocrat who's not quite sure how to relate to the countrymen whom he so desperately wants to lead.
|
global_05_local_5_shard_00000035_processed.jsonl/31357
|
Huffpost Fifty
Kathy Caprino Headshot
Why Midlife Rocks Your World
Posted: Updated:
In my career and executive coaching, I work with hundreds of women each year going through major transitions. Recently, I was speaking with a fascinating client of mine -- let's call her "Carol" -- who shared with me her views about midlife BEFORE she had arrived there, and then what happened when her 40s came.
She explained:
It's funny -- when I was my early 30s and I'd hear about someone having a 'midlife crisis,' I'd think to myself, "Wow, I don't really get that. I'm focused, doing what I need to, experiencing success, the kids are good, things are moving along well. I can't imagine waking up to wanting a whole new life or finding out that what I have I don't want.
But when I turned 43, something happened. I awakened somehow -- after a series of very tough events and challenges -- to wanting more, wanting something different. It's like I suddenly saw my whole life differently through the eyes of a middle-ager. The career I spent years rising to the top of somehow lost its hold on me -- it felt empty and unimportant, silly almost. My relationship with my husband had some serious problems over the years that took a terrible toll on me, but I never allowed myself to stop and look at that -- I just powered through it all.
Now that my kids are older and I'm not needed in the same, day-to-day way, I find that I truly want a different life -- a life that's mine -- based on what I value and what I love. I don't want to just push down what isn't working. I want to bring it out and resolve it, or let it go.
I get it now -- a "midlife crisis" isn't a cliché. It's real and it's powerful.
Carol speaks for thousands of women who've awakened in midlife to realizing that what they've created in their 20s and 30s just doesn't fit who they've become. (For more about my own midlife breakdown/breakthrough and others' midlife transformations, check out my book Breakdown Breakthrough).
Why is midlife a time of major transition?
1) A time of reckoning and re-evaluation -- Realizing that your life is potentially more than half over is a jarring experience, and brings with it a sense of urgency to live more authentically and more joyfully. At 50, we just want different things than we did at 30.
2) Kids are launching - Without the pressing daily parenting responsibilities that can be all-consuming when children are little, now there's more room to think, room to breathe and quiet space to hear yourself dream.
3) Parents and friends begin to die - My friend and I discussed this just yesterday, that a number of our 50+-year-old friends have died -- from sudden illness, cancer, heart attack, etc. In caring for our elderly parents and watching their lives draw to a close, it gets us thinking about what it all means. When your loved ones begin to die, you think hard about life.
4) Longings won't be suppressed - After working so hard to craft a "successful" life, we get tired of the race to nowhere. Instead of some outward version of "success," we long to pursue what gives us joy, excitement, passion, peace -- we want to live life more fully, on our terms.
5) We know how to speak up - We won't be talked down to anymore. We've lived through that, and we've learned how to stand up, speak up and power up. We won't tolerate put-downs, manipulation or pressure like we used to.
6) We've finally earned it - Finally, after all you've strived for, accomplished, created and endured, you know what you're capable of. You won't stand for less. You have the confidence and the courage to embrace the idea that's been skulking around in your mind for years. You're ready to admit, "This can't be all there is. I know there's more for me and I'm ready and committed to creating it."
If you're in midlife and wondering why everything looks and feels different, don't be alarmed. It's a natural, normal life progression -- a stage that doesn't have to represent chaos and anxiety.
The key is to not resist or break yourself against it like a rock but embrace it -- walk directly into it. Look deep into the deep recesses of your heart, mind, and soul to find clues of who you want to become now, and what you want to build in this next thrilling chapter. And get some empowering outside support to help you be accountable for achieving what you want. It's a new time, inviting you to create a new, more expansive you.
Midlife can pave the way to an exciting reclamation of your passion, power and purpose in life and work. It's time for your breakthrough -- are you open to it?
|
global_05_local_5_shard_00000035_processed.jsonl/31358
|
Marcelo Giugale Headshot
Give Africans a Stake in Their Own Wealth
Posted: Updated:
When your government announces a big oil discovery, should you celebrate? A lot of sensible people will tell you that you shouldn't. For them, natural resource wealth -- large quantities of things like petroleum, gas or minerals -- is actually a "curse," not a blessing. How come? Well, "extractive industries" can flood your economy with foreign currency, make all your other industries uncompetitive, spoil your environment, and corrupt your politicians. The evidence is pretty suggestive: very few "commodities-rich" countries have done well, most have not.
If that's true, Africa has a problem. Not only is the continent rich in natural resources, but by some estimates it has only found a tenth of its riches. (Believe it or not, comprehensive geological maps of Africa do not exist). To make matters "worse," commodity prices are projected to stay sky-high until at least 2015. The feeling of an imminent bonanza is already permeating the Congos, Gabon, Ghana, Guinea, Nigeria, Uganda and many others. Is there a way to avoid the curse? It will be easier on the economic and environmental sides -- today's central banks and NGOs know how to intervene quickly if local currencies appreciate too much or if large corporations pollute too much. The trickier issue is how to avoid the corruption usually associated with giving out licenses to explore and exploit, and with using the huge royalties that all this brings to governments.
Fortunately, technology can help Africa avoid graft. Some 35 African countries already transfer cash directly to their poor -- whether through smart-cards, debit cards, cellphones, or in person. This is getting cheaper and safer. The coverage of banking and cellular telephony services is expanding -- the latter at viral speed. And biometric identification of individuals through mobile devices is rapidly catching up (Kenya is a good example). Logistically, there is nothing that prevents governments from transferring a part of the income coming from natural resources directly to each and every citizen, not just the poor. This kind of "direct dividend transfer" is of course not new -- Alaska has been practicing it since the early 1980s. They will soon be possible in Africa too.
Would putting money in Africans' pockets, rather than in their governments' treasuries, really reduce corruption? It probably will, for three reasons. First, it would intensify social monitoring. If you know your government is giving you ten percent of its new oil revenue, you will surely be interested in what it does with the other ninety percent. You will also want the company that explores, exploits and exports your natural resources to be managed competently -- if it fails to find, extract and sell, you lose money. You will be less patient with the public monopolies that usually control those resources and behave as self-serving, unaccountable, states-within-the-state. In fact, you will begin to wonder whether your country should get rid of those public monopolies all together, and hire experienced, private operators to work for you.
Second, direct dividend transfers would make politics more contestable. There is no question that the transfers would be popular. Social programs that deliver cash to the poor have survived presidential transitions everywhere -- for example, in Chile, where the recent political alternation went from left to right, and in El Salvador, where it went from right to left. But incumbent governments may be reluctant to give up part of the easy revenue that comes from commodities -- less money, less power. Democracy would take care of that, as politicians in opposition can only gain by proposing to give people real access to their nation's wealth -- "Vote for me and the oil is yours."
And third, alternative ways of transferring natural resource wealth are worse. Governments in resource-rich countries are always under political pressure to be seen as passing some of the "dividends" to the population. The usual means have been to give out tax breaks, sell fuel or food below their cost, or give away jobs in the civil service. All this has in practice been captured by the rich and the connected. (Rule of thumb: the average developing country spends more on subsidizing public college education for the rich than on primary schools for the poor). If anything, giving people a direct stake in their country's riches can be an opportunity for -- and can be funded by -- the abolition of other inefficient, inequitable and morally-questionable transfers. You get a dividend, but you accept to pay full price for what you consume.
Would transferring the same -- probably small -- amount of cash to all citizens be fair? Optimally, one would want to means-test the transfer, that is, to give more to those who have less. However, trying to decide who is how rich in a developing country may prove politically impossible. But a uniform universal dividend would still be "progressive," that is, it would be of more help to those who need help the most. Imagine: if the average African government decided to pass on a tenth of its resource revenues directly to its citizens, the dividend could be about $100 dollars per person per year. That may be peanuts for the better-off -- they may not even bother to collect it -- but it would be a huge game-changer for the two-thirds of Africans that live on two dollars a day or less. And if you are not just poor but also female, the transfer would carry a welcome dose of personal independence as well.
More subtly, direct dividend transfers could help national unity. In countries where regional, racial or religious differences make it difficult to agree on how to share natural wealth -- a problem that is all too common in Africa -- the idea that everyone gets a cut of the riches, personally and individually, regardless of location, skin color or faith, just for being a citizen of the country, may be a useful source of national identity. (Yes, new biometric tools can take care of misidentification and fraud.)
By now you are thinking: "If the institutions of government cannot be trusted with commodity revenue, should we not try to fix them instead of bypassing them?" True, and good progress is being made in getting civil society to participate in the management of public funds -- Ghana is an African leader in that. But building institutions takes time and the new resources have started to come in. By sharing a portion of those resources with people early on, we may buy the time, and the political goodwill, necessary to construct more permanent tools for better governance.
|
global_05_local_5_shard_00000035_processed.jsonl/31361
|
Huffpost Books
Victoria Costello Headshot
Ten Steps a Parent Can Take to Safeguard a Child's Mental Health
Posted: Updated:
Courtesy of Jason Good
Courtesy of Jason Good
After helping my sons, Alex and Sammy, recover from two different mental disorders that hit them in their teens, I spent a decade looking into what is known about preventing mental illness in babies and young children for my book, A Lethal Inheritance, A Mother Uncovers the Science Behind Three Generations of Mental Illness.
Here's the best advice I got from leading psychological researchers around the world for protecting your children (and yourself) from mental disorders. If symptoms of psychological distress are already present in a child, there are things you can do to stop them from getting worse.
In recognition of National Children's Mental Health Awareness Week from May 6-13, 2012, take a few minutes now to review these ten steps. You'll be making a solid investment in your child's future and your own peace of mind.
1. Chart a "tree" of your family's mental health history, including both sides of the family, going back three generations.
Include all known or suspected mental disorders and addictions. If relatives balk at your digging into the family's possibly murky past, point out that it's for the good of your children and grandchildren. Use the U.S. Surgeon General's online form for recording and storing your family's mental (and medical) history and make it a shared ongoing family project to maintain. Take a print out with you to any mental health evaluation and insist that it be a part of your own or the child's diagnostic process.
2. Plan your pregnancies! Begin a strict physical fitness and mental wellness regime three months before you start trying to conceive. In addition to practicing optimal nutrition and staying physically healthy, strongly consider your mental and emotional health before and during pregnancy. If you are currently on an antidepressant, talk to a mental health professional before making a decision about whether to stay on it during pregnancy. Medication may pose fewer risks to your child than would your severe depression -- especially during the first trimester. Studies have tied a mother's prenatal emotional trauma and extreme stress to a higher risk for childhood depression and anxiety, even to schizophrenia.
3 Learn about environmental and infectious agents that may cause miscarriages, birth defects or raise a child's risk for mental disorders later in childhood. The source may be a disease such as chickenpox, a prescription drug or a chemical -- including oil-based paints, mercury and, recent research suggests, certain chemicals in plastics (phthalate and bisphenol A or BPA), used in a variety of products including toys, cosmetics and water bottles. Sensitivity is highest during periods of intense brain growth; as an embryo (between two and eight weeks) and during the second trimester. A good web resource for the latest information is the March of Dimes.
4. Take paternal risk factors into account. Studies show that older fathers are associated with higher rates of schizophrenia and autism in their offspring. A variety of occupations with prolonged exposure to radiation, anesthetic gases and other toxic chemicals can alter a father's chromosomes, increasing the risk of miscarriage or genetic defects. A man's alcohol intake and drug use is also associated with higher miscarriage rates. As is the case for the higher risk mother, age, lifestyle and occupational risks should be weighed along with other factors, such as family history, to consider when and whether to father a child.
5. Treat yourself first. You may have put off getting a diagnosis but now is the time to make an appointment with a mental health professional and seek treatment if you have symptoms of a common adult mental disorder such as depression, anxiety or addiction. Think of your actions as an act of prevention for your child's mental health. If your child already has similar symptoms, research has shown that by treating the mother, a depressed or anxious child will get better too -- without direct treatment.
6. Monitor your child's behavior for early symptoms. If there is a high density of any single mental illness among your relatives in your family, learn about the early signs for that disorder. Some examples include social withdrawal for depression, irritability or anxiety or ADHD. If you see early signs like these, closely monitor your child's behaviors. If symptoms are present for a month or more keep a daily log to document them. Then, if the problem behaviors continue or worsen, bring this log to your pediatrician or mental health professional that treats children.
7. Talk about thoughts and feelings. As soon as your child begins to recognize and name her own thoughts and feelings and those of others, start an age-appropriate conversation about how our human emotions and minds work. Explain that feelings and thoughts exist on a broad spectrum (compare it to a rainbow). Within reason (which excludes tantrums or aggression against others), make it clear that unusual thoughts and strong feelings are not right or wrong; more often, they simply represent individual differences. This "normalization" of differences makes it more likely that your child will confide any future psychological problems to you and be less inclined to stigmatize others.
8. Have zero tolerance towards bullying. Whether your child is the victim or the bully, do whatever it takes to stop it. This is not a "wait and see" option. Even if your child begs you not to make a fuss, understand that the potential psychological damage (including suicide) for him or her if the abuse continues is far worse than any temporary embarrassment.
9. Make self-esteem a family priority. Self-esteem has gotten a bad rap because it's been confused with having an outsized and incorrect sense of one's positive qualities and abilities. Self-esteem in a child comes from parents who model empathy, honor individuality and reward real effort, not false achievement, in their children. True self-esteem is the basis of emotional resiliency, which gets severely tested at several points in childhood -- especially around early parent-child separations. As a resilience building strategy, bring back family dinners as many nights as possible, divide up chores and use the time to communicate.
10. Build up your family, community and online support system. Social isolation isn't good for mother or baby. Before giving birth, take stock of who you can call on for emotional and practical support among physically close-by friends, neighbors and family. Then check out any of the hundreds of web-based communities of new mothers from whom you can count on finding a friendly ear and a good laugh at virtually any time of the day or night. Find the right fit for you.
Ten Steps Parents Can Take to Safeguard a Child's Mental Health
Share this
Current Slide
Victoria Costello blogs on mental health and parenting on MentalHealthMomBlog.
|
global_05_local_5_shard_00000035_processed.jsonl/31389
|
Stretched Canvas
Modern Lines
Contemporary White
Classical Baroque
Unframed print
Clay Lancaster, San Francisco, CA
Member Since April 2011
Artist Statement Hi! I am a wedding and event photographer based in the Seattle, WA and San Francisco, CA areas. Although I make my living on weddings, I have been shooting bands and events for years. You can see my work at www.claylancaster.com, or just my wedding work at www.lancasterphoto.net.
Product No 3930518
Subjects Alternative, Music
Style Editorial/Documentary
Tags Clay, Lancaster, San Francisco, ballroom, clay, cut copy, lancaster, regency
|
global_05_local_5_shard_00000035_processed.jsonl/31442
|
Home > Articles > Programming > C/C++
• Print
• + Share This
• 💬 Discuss
This chapter is from the book
This chapter is from the book
4.7 Sentinel-Controlled Repetition
Clearly, the sentinel value must be chosen so that it cannot be confused with an acceptable input value. Grades on a quiz are normally nonnegative integers, so –1 is an acceptable sentinel value for this problem. Thus, a run of the class average program might process a stream of inputs such as 95, 96, 75, 74, 89 and –1. The program would then compute and print the class average for the grades 95, 96, 75, 74 and 89. Since –1 is the sentinel value, it should not enter into the averaging calculation.
Implementing Sentinel-Controlled Repetition in Class GradeBook
Figures 4.9 and 4.10 show the C++ class GradeBook containing member function deter-mineClassAverage that implements the class average algorithm with sentinel-controlled repetition. Although each grade entered is an integer, the averaging calculation is likely to produce a number with a decimal point. The type int cannot represent such a number, so this class must use another type to do so. C++ provides several data types for storing floating-point numbers, including float and double. The primary difference between these types is that, compared to float variables, double variables can typically store numbers with larger magnitude and finer detail (i.e., more digits to the right of the decimal point—also known as the number's precision). This program introduces a special operator called a cast operator to force the averaging calculation to produce a floating-point numeric result. These features are explained in detail as we discuss the program.
Fig. 4.9 Class average problem using sentinel-controlled repetition: GradeBook header file.
1 // Fig. 4.9: GradeBook.h
3 // Member functions are defined in GradeBook.cpp
5 using std::string;
7 // GradeBook class definition
8 class GradeBook
9 {
10 public:
11 GradeBook( string ); // constructor initializes course name
14 void displayMessage(); // display a welcome message
16 private:
17 string courseName; // course name for this GradeBook
18 }; // end class GradeBook
Fig. 4.10 Class average problem using sentinel-controlled repetition: GradeBook source code file.
1 // Fig. 4.10: GradeBook.cpp
3 // class average program with sentinel-controlled repetition.
4 #include <iostream>
5 using std::cout;
6 using std::cin;
7 using std::endl;
10 #include <iomanip> // parameterized stream manipulators
13 // include definition of class GradeBook from GradeBook.h
14 #include "GradeBook.h"
16 // constructor initializes courseName with string supplied as argument
17 GradeBook::GradeBook( string name )
18 {
19 setCourseName( name ); // validate and store courseName
20 } // end GradeBook constructor
22 // function to set the course name;
24 void GradeBook::setCourseName( string name )
25 {
28 else // if name is longer than 25 characters
33 } // end if...else
34 } // end function setCourseName
36 // function to retrieve the course name
37 string GradeBook::getCourseName()
38 {
39 return courseName;
40 } // end function getCourseName
42 // display a welcome message to the GradeBook user
43 void GradeBook::displayMessage()
44 {
46 << endl;
47 } // end function displayMessage
50 void GradeBook::determineClassAverage()
51 {
52 int total; // sum of grades entered by user
53 int gradeCounter; // number of grades entered
54 int grade; // grade value
55 double average; // number with decimal point for average
57 // initialization phase
58 total = 0; // initialize total
59 gradeCounter = 0; // initialize loop counter
61 // processing phase
62 // prompt for input and read grade from user
66 // loop until sentinel value read from user
68 {
70 gradeCounter = gradeCounter + 1; // increment counter
72 // prompt for input and read next grade from user
75 } // end while
77 // termination phase
79 {
80 // calculate average of all grades entered
85 << total << endl;
87 << endl;
88 } // end if
91 } // end function determineClassAverage
Fig. 4.11 Class average problem using sentinel-controlled repetition: Creating an object of class GradeBook (Fig. 4.9–Fig. 4.10) and invoking its determineClassAverage member function.
1 // Fig. 4.11: fig04_14.cpp
2 // Create GradeBook object and invoke its determineClassAverage function.
4 // include definition of class GradeBook from GradeBook.h
5 #include "GradeBook.h"
7 int main()
8 {
9 // create GradeBook object myGradeBook and
10 // pass course name to constructor
13 myGradeBook.displayMessage(); // display welcome message
14 myGradeBook.determineClassAverage(); // find average of 10 grades
15 return 0; // indicate successful termination
16 } // end main
Welcome to the grade book for
CS101 C++ Programming
Enter grade or -1 to quit: 97
Enter grade or -1 to quit: 88
Enter grade or -1 to quit: 72
Enter grade or -1 to quit: -1
Total of all 3 grades entered is 257
Class average is 85.67
In this example, we see that control statements can be stacked. The while statement (lines 67–75 of Fig. 4.10) is immediately followed by an if...else statement (lines 78– 90) in sequence. Much of the code in this program is identical to the code in Fig. 4.7, so we concentrate on the new features and issues.
Floating-Point Number Precision and Memory Requirements
Variables of type float represent single-precision floating-point numbers and have seven significant digits on most 32-bit systems. Variables of type double represent double-precision floating-point numbers. These require twice as much memory as floats and provide 15 significant digits on most 32-bit systems—approximately double the precision of floats. For the range of values required by most programs, float variables should suffice, but you can use double to "play it safe." In some programs, even variables of type double will be inadequate—such programs are beyond the scope of this book. Most programmers represent floating-point numbers with type double. In fact, C++ treats all floating-point numbers you type in a program's source code (such as 7.33 and 0.0975) as double values by default. Such values in the source code are known as floating-point constants. See Appendix C, Fundamental Types, for the ranges of values for floats and doubles.
Converting Between Fundamental Types Explicitly and Implicitly
The variable average is declared to be of type double (line 55 of Fig. 4.10) to capture the fractional result of our calculation. However, total and gradeCounter are both integer variables. Recall that dividing two integers results in integer division, in which any fractional part of the calculation is lost (i.e., truncated). In the following statement:
average = total / gradeCounter;
Cast operators are available for use with every data type and with class types as well. The static_cast operator is formed by following keyword static_cast with angle brackets (< and >) around a data-type name. The cast operator is a unary operator—an operator that takes only one operand. In Chapter 2, we studied the binary arithmetic operators. C++ also supports unary versions of the plus (+) and minus (-) operators, so that you can write such expressions as -7 or +5. Cast operators have higher precedence than other unary operators, such as unary + and unary -. This precedence is higher than that of the multiplicative operators *, / and %, and lower than that of parentheses. We indicate the cast operator with the notation static_cast< type >() in our precedence charts (see, for example, Fig. 4.18).
Formatting for Floating-Point Numbers
#include <iomanip>
Line 11 specifies the name from the <iomanip> header file that is used in this program. Note that endl is a nonparameterized stream manipulator (because it is not followed by a value or expression in parentheses) and does not require the <iomanip> header file. If the precision is not specified, floating-point values are normally output with six digits of precision (i.e., the default precision on most 32-bit systems today), although we'll see an exception to this in a moment.
Lines 86 and 87 of Fig. 4.10 output the class average. In this example, we display the class average rounded to the nearest hundredth and output it with exactly two digits to the right of the decimal point. The parameterized stream manipulator (line 86) indicates that variable average's value should be displayed with two digits of precision to the right of the decimal point—indicated by setprecision( 2 ). The three grades entered during the sample execution of the program in Fig. 4.11 total 257, which yields the average 85.666666.... The parameterized stream manipulator setprecision causes the value to be rounded to the specified number of digits. In this program, the average is rounded to the hundredths position and displayed as 85.67.
• + Share This
• 🔖 Save To Your Account
comments powered by Disqus
|
global_05_local_5_shard_00000035_processed.jsonl/31444
|
Skip to main content
The Synammia Enigma: Evidence for a Temperate Lineage of Polygrammoid Ferns (Polypodiaceae, Polypodiidae) in Southern South America
Buy Article:
$23.00 plus tax (Refund Policy)
Evidence for a southern South American lineage of polygrammoid ferns was inferred from analyses using four cpDNA markers. The lineage corresponds to the genus Synammia, which has usually been treated as a synonym of the polyphyletic genus Polypodium. Seven specimens of two of the three recognized species were sampled to infer the phylogenetic relationships of this lineage to other polygrammoid ferns and the diversity within this lineage. All approaches found Synammia clearly separated from other polygrammoid ferns, but the exact relationships are still unclear. Model-based methods recovered Synammia as sister to a mainly Neotropical clade of polygrammoid ferns, but support for this hypothesis was provided only by Bayesian inference of phylogeny. The deletion of nearly the whole rps4-trnS IGS is a synapomorphy of Synammia. The lineage is separated from other extant polygrammoid ferns, but very low to zero sequence diversity was found among the seven samples of Synammia. The results strongly support an independent lineage of polygrammoid ferns in southern South America.
Document Type: Regular Paper
Publication date: January 1, 2006
More about this publication?
Access Key
Free Content
Free content
New Content
New content
Open Access Content
Open access content
Subscribed Content
Subscribed content
Free Trial Content
Free trial content
Cookie Policy
Cookie Policy
|
global_05_local_5_shard_00000035_processed.jsonl/31477
|
What is Web Beans?
1.Introduction This article introduces new unified framework for the Java EE environment, called Web Beans.This article is written based on the specification available at the time of writing this article. The specification for this framework is still under the public review, so there may be few changes before the final release. You can read the […]
|
global_05_local_5_shard_00000035_processed.jsonl/31478
|
Email updates
Open Access Highly Accessed Commentary
Chemistry publication – making the revolution
Steven M Bachrach
Author Affiliations
Department of Chemistry, Trinity University, One Trinity Place, San Antonio, Texas 78209 USA
Journal of Cheminformatics 2009, 1:2 doi:10.1186/1758-2946-1-2
Published: 17 March 2009
The advent of the Internet has been the impetus for the Open Access movement, a movement focused on expanding access to information principally by reducing the costs of journals. I argue here that the Open Access movement has had little impact on the chemistry community and has taken our attention away from the real opportunity to revolutionize scientific communication. I propose a plan that both reduces the total cost of publishing chemistry and enriches the literature through incorporation of Open Data. By publishing lots of data, available for ready re-use by all scientists, we can radically change the way science is communicated and ultimately performed.
|
global_05_local_5_shard_00000035_processed.jsonl/31498
|
Jewish Journal
Gifts Galore From Bubbe to Baby
by Sarah Price Brown
December 2, 2004 | 7:00 pm
When it's time to celebrate Chanukah, nobody should be left out of the fun. We've scoured the holiday gift scene to find the perfect presents for Mom, Dad and the whole family. Count on any of these "candles" to light up the face of someone you love during this year's Festival of Lights.
Candle No. 1.
Who says a baby is too young to light a menorah? As they say, practice makes perfect. So start with the huggable, colorful "My First Plush Menorah" ($13.95, oytoys.com). The best part: It comes with a special pouch holding nine candles that fit right into the menorah's holders.
Candle No. 2.
Any young child would want to cuddle with the bright blue Mazel teddy bear by Russ Berrie & Co. ($12.99, amazon.com). But if you're having trouble peeling a kid away from the computer, slip in the CD-ROM, "Who Stole Hanukkah?" ($19.95, davka.com). The interactive mystery game teaches the story of the Maccabees in five languages.
Candle No. 3.
When it comes to teenagers away at college, first thing's first: send a menorah. A classic Chanukiah will do the job ($24.95, crateandbarrel.com). Then, it's about what a teenage girl wants. A trendy T-shirt makes a statement. The "Famous Challah Bread" tee takes its cue from rap and hip-hop, sporting the words "Challah Bread" on the front and "Challah Back" on the back -- as in, when someone gives a shout, you "challah" right back. The saucy "Kabballywood Tee" pokes fun at Hollywood stars like Madonna who can't get enough of kabbalah. ($30-$40, chosencouture.com).
For an aspiring superhero teenage boy, pick up a copy of the "Jewish Super Hero Corps Comic Book" featuring Menorah Man and Dreidel Maidel ($3.95, jewcy.com). Throw in some classic, kosher Hebrew Bazooka Gum, which has comics inside its wrappers ($10.95 for 100 pieces, jewishsource.com). Another Jewish superhero, "The Hebrew Hammer," saves Chanukah, this year out on DVD. ($16.99, thehebrewhammer.com)
Candle No. 4.
If Mom has all the menorahs she needs, give her an elegant dreidel she can display. Waterford makes a beautiful, crystal dreidel etched with Hebrew letters ($49, bloomingdales.com). If you want to splurge, buy a handcrafted, porcelain, Lladró dreidel. The detail makes these pieces unique. ($105-$130, macys.com).
Candle No. 5.
Nudge Dad into the miracle mood with music. The group, Safam, has a lively "Chanukah Collection" and "Passover Collection" two-CD set ($25, safam.com). Original and upbeat tunes like "Eight Little Candles," "Maoz Tsur" and "Judah Maccabee" will get Dad -- and the whole family -- hopping. You can listen to some songs on the Web site before you buy, but you won't go wrong with this one.
Candle No. 6.
Grandparents will love a gift they can share with their grandchildren. Those who speak a bissel of Yiddish are sure to get nachas from reading their grandchildren Dr. Seuss' "Cat in the Hat" -- in Yiddish ($15, jewcy.com). But if the language of the Old World prompts an "oy vey," go with a modern classic like "A Blue's Clues Chanukah" by Jessica Lissy for preschoolers ($11.80, amazon.com) or "Festival of Lights: The Story of Hanukkah" by Maida Silverman, for children 4-8 years old ($5.99, amazon.com).
Candle No. 7.
There's always the family friend or baby sitter who deserves some love. In this case, your best bet is an edible treat. For a cookie "monster," get some chocolate-covered Oreo cookies topped with Chanukah decorations. Nine cookies come in a gold box, tied with a blue ribbon ($16.99, macys.com). Make a chocolate lover's day with See's Candies' Star-of-David box. It's filled with kosher goodies like milk chocolate coins, blue-and-white sugar sticks and lollipops that will satisfy any sweet tooth ($8, seescandy.com).
Candle No. 8.
Worried your pet will feel left out? Chanukah's no time for ordinary ol' bones. Throw a dog the blue and yellow "Squeaky Dreidel Dog Toy" ($8, jewishsource.com) and a give your cat some silver and blue "Chanukah Mice" ($7.99, petco.com).
Tracker Pixel for Entry
We welcome your feedback.
Privacy Policy
Terms of Service
JewishJournal.com has rules for its commenting community.Get all the details.
|
global_05_local_5_shard_00000035_processed.jsonl/31501
|
Has anyone parsed an XML dtd to create a DOM object? I don't know if that is possible or not, if it isn't how could I get an object containing all the attributes allowed for a given element?
Christoph Krüger
You might want to have a look at the Oracle XML class generator. This neat little Java API allows you to load a DTD and have each element generated as .java class files. In a second step you can use these class files to build an application which generates DOM-objects according to the DTD. It's all pretty well documented in the included samples, so I'm leaving that to you.
0 Comments (click to add your comment)
Comment and Contribute
About | Sitemap | Contact
|
global_05_local_5_shard_00000035_processed.jsonl/31537
|
Kellogg Team and Group Research CenterKellogg School of Management
Center InfoResourcesParticipationContactKellogg Homepage
Cases & Exercises
Books & Articles
Working Papers
Journal of Organizational Behavior (KJOB)
Teaching Innovation Resources
Internal Site
Northwestern University
General Info
Previous Awards
Previous Awards
The following is a summary of grants awarded by year and amount:
P.I. Name Date Project Title Amount
Keith Murnighan
May 2008 KTAG Conference on Social Psychology and Organizations $5,000.00
Susan Crotty May 2007 Multicultural Teams Laboratory Study $1,200.00
Nick Pearce July 2007 Summer Research $750.00
Robert Lount October 2005 Trusting the In-group, Distrusting the Out-Group: The impact of Happiness on Trust $2,270.00
Kathy Phillips May 2004 Who’s Listening? The Impact of Status on Expert Behavior and Audio Response in Groups $5,670.00
Cynthia Wang May 2004 Directive versus Transformational Leaderships: Consequences for Group Processes $1,500.00
Geoffrey Leonardelli Dec 2003 Optimal Distinctiveness and Nested Groups $1,850.00
Daniel Diermeier July 2003 Decision Making in Groups with Diverse Preferences: The Proposer-Pivot Model $1,500.00
Robert Lount May 2003 Deciding When to Work Hard… $2,610.00
Tracy Dumas Nov 2002 Identity and Multiple Group Membership $1,200.00
Adam Galinsky August 2002 Power: Effects on Social Inference and Social Interaction $3,080.00
Ashleigh Rosette July 2002 Privilege and Unaware: A Recipe for Discrimination and Prejudice $1,100.00
Cameron Anderson May 2002 Emotional Convergence in Teams and Across Cultures $1,700.00
Cameron Anderson May 2002 The Social Function of Emotions: Cohesion, Communication, and Commitment $1,300.00
Brian Uzzi May 2002 Emergence: The Study of the Formation of Network Structures $2,000.00
Gail Ann Berger Oct 2001 Confirmation Bias in Panel vs. Dyadic Interviews (Study #2 only) $1,832.00
Hoon-Seok Choi Oct 2001 Idea Generation in Groups: Effects of Change in Group Composition $4,452.50
Elizabeth Durkin Oct 2001 Knowledge Sharing in an Interdisciplinary Human Service Team $6,697.00
Gillian Ku Oct 2001 Minority Groups in the U.S. and Singapore: The Effects of Cultural Differences on Majority and Minority Influence $2,550.00
Denise Lewin Loyd May 2001 The Risk of Categorization: Perceptions of the Normative, Category-Based Expectations of Others $1,320.00
Victoria Medvec May 2001 Is Our Absence as Conspicuous as We Think?: Overestimating the Noticeability and Impact of One’s Absence from a Group $8,132.50
Amin Panjwani May 2001 Boundary Objects, Intergroup Dynamics, and Organizational Meaning-Making: Evidence from the Business Model Construct $2,695.00
Shannon Dyer Oct 2000 Jury Focus Group Project $1,750.00
Victoria Medvec May 2000 Who Wants to Be A Millionaire?: Counterfactual Cutoffs and Egocentric Biases $6,400.00
David Messick May 2000 New Thinking about the Psychology of Leadership (conference with KTAG / MORS) $5,000.00
Kathy Phillips May 2000 Implicit Theories of Groups and Their Impacts on Group Communication, Biases, Motivations, and Performance $3,940.00
Lyn Van Swol May 2000 The Effects of Non-Verbal Imitation in Groups $940.00
Judith White May 2000 We Have One, But She’s Not Working Out: Solo Status, Self-Awareness, and Performance $5,120.00
Keith Murnighan Dec 1999 The Dynamics of Repeated Social Dilemmas $3,200.00
Nancy Rothbard Dec 1999 Emotion and Engagement in Multiple Tasks $2,650.00
James Phills Sep 1999 Conflict and Learning in Creative and Artistic Teams $3,700.00
Terri Kurtzberg Jun 1999 Creativity in Negotiating Teams (Hierarchical Linear Modeling) $5,190.00
Deb Gruenfeld Nov 1998 Customer Driven or Avant Garde?: Group Dynamics, Influence, and Performance in the Recording Industry $1,750.00
Charles Naquin Mar 1998 Trust in Heterogeneous Teams: Temps and Tempwork – at Odds or Not? $437.50
Victoria Medvec Feb 1998 Emotional Contagion in Social Interaction $5,950.00
Leigh Thompson Feb 1998 Making the Team (book) $4,200.00
Marc Ventresca Feb 1998 Research visit to Stanford University $895.00
Grand Totals by Year
Total Number of Grants Awarded Total Amount Awarded
2008 1 $5,000.00
2007 2 $1,950.00
2005 1 $2,270.00
2004 2 $7,170.00
2003 3 $5,960.00
2002 6 $10,380.00
2001 7 $27,679.00
2000 6 $23,150.00
1999 4 $14,740.00
1998 5 $13,232.50
©2001 Kellogg School of Management, Northwestern University
|
global_05_local_5_shard_00000035_processed.jsonl/31573
|
Kirksville Daily Express - Kirksville, MO
• Christian beliefs are rooted in reliable early records
• Written materials eventually wear out, fall apart and are discarded in our modern economy of disposable and replaceable abundance. But in the ancient world, papyrus scrolls and parchments were expensive and more durable than modern books.
• email print
• If they're used very much at all, written materials nowadays eventually wear out and fall apart and must be discarded. Our modern economy of disposable and replaceable abundance - including cheap paperbacks and, now, e-books - makes this "waste" inconsequential.
The same seems to be true of biblical texts. When the Romans destroyed the community at Qumran around A.D. 68, for example, all of the famous Dead Sea Scrolls there seem to have still been in use. Roughly 40 of the scrolls - most of them scriptural texts - were already two to three centuries old when the community buried them during the Roman wars. This suggests that, under ordinary peaceful conditions, they could almost certainly have been used even longer.
Why is this significant?
Papyrus 45, part of the Chester Beatty collection in Dublin, dates to approximately A.D. 220 and contains large portions of all four New Testament Gospels. It's extremely unlikely that a modern museum just happens, by sheer dumb luck, to possess the earliest copy of those Gospels ever made. It's much more likely that others once existed but haven't been found or have long since perished - indeed, we actually have older fragments of Gospels.
Still, for purposes of argument, let's arbitrarily declare Papyrus 45 the first and oldest copy of the Gospels ever made. Even on that assumption, if the first-century originals or "autographs" of the Gospels remained in use for at least 150 years, this means that it's possible, even probable, that the original Gospels were still in circulation when Papyrus 45 was created.
Page 2 of 2 - Moreover, ancient writers and record keepers knew full well the risk of losing what they had so laboriously written. Evidence from antiquity shows that very commonly duplicates were prepared of significant documents before the originals were given out. Sometimes, in fact, multiple copies were made from the original, especially if - as in the case of the New Testament epistles of James and Peter, the epistle to the Hebrews and perhaps a couple of Paul's letters - these documents were intended for wide circulation.
This column is dedicated to the memory of Galen S. Woolley, dedicated physician, missionary and father.%3Cimg%20src%3D%22http%3A//beacon.deseretconnect.com/beacon.gif%3Fcid%3D68180%26pid%3D46%22%20/%3E
|
global_05_local_5_shard_00000035_processed.jsonl/31673
|
Lightroom Top 10 Gotcha’s
If you’re just starting out with Lightroom, there are a few CRUCIAL bits of information which will save you hours of headaches and untangling. They’re the kind of thing that just make you say “I’d wish I’d known that before….” These are my top ten gotchas, direct from the forums.
9. Lightroom has 3 different levels of selection, not 2. Notice the difference, otherwise you could accidently apply a setting to multiple different images.
Any more gotchas or blinding flashes of the obvious that you wish to add? You know, the things that make you go ‘Duh!’
1. Wow, I didn’t know about #10! Thanks a lot, that’s great to know (and explains a lot…)
I got one more: In some input fields (like in the web module), you cannot simply use the return/enter key to create a new line/paragraph. However, you can simply copy & paste text that has multiple lines from other applications.
[That’s a nice little tip Peter! – VB]
• How about this one: everything about a photo is immediately and
permanently removed from Lightroom catalog when photo is deleted or
removed from catalog. But, if you save (xmp) metadata, then develop
settings and metadata will not be lost, should you inadvertently remove a
photo from your catalog, and have to re-import. Moral of the story:
save (xmp) metadata after every round of milestone edits, or enable
auto-save, and you won’t be solely dependent on catalog backups for recovering from human or machine error, plus you can recover from “between backup” goofs.
2. I didn’t know about number 10, either. And I’m not certain that I understand #9. I’m going to have go back to LR to figure that one out. But this is a great list. I think #’s 4 and 5 hit quite a few people. Thanks a lot for publishing this list.
[#9 – You have most-selected, which are the lightest shade of grey, also-selected, which are medium-grey, and not-selected, which are dark-grey. It trips people up on a regular basis, but it’s necessary in order to be able to sync images (you have to have a source image and target images). – VB]
3. A result of #10: deleting items flagged as rejects inside of a collection does not delete them from the folder they’re stored in, they’re only removed from the collection.
Behaviour I don’t like by the way. If I flag my images as rejects, it’s because I want to delete them. A way around it is to select all the items marked as rejects inside the collection and switch to the folder the images are in. They should still be selected. I then mark them as rejects (using ‘x’) and delete the rejects (using apple-backspace).
A tad convoluted, but apparently it’s by design.
[You can always use the wonderfully named ‘splat-delete’ – Ctrl-Alt-Shift-Delete or Cmd-Opt-Shift-Delete to delete the images from the disc whilst still viewing the collection, rather than having to switch back to the folder. – VB]
4. Good stuff!
5. #10… Now I know why the pics I flagged in a Quick Collection were unflagged after clearing the QC.
#9 is unclear– What are you referring to when you say “levels of selection”? I see you explained it in a later comment– most-selected, etc… maybe it’s some part of the program I don’t use…
[When you look at the files in Grid view, and then select more than 1 file, you’ll see there is more than one shade of grey used. You probably do use it, but the difference in shades isn’t that noticeable, so you may not have noticed – which is exactly the problem that trips people up – they press delete thinking they’ve only got one file selected (the most-selected lightest grey) and then realise that all of the files were also selected (mid-grey) and they’ve deleted them by accident. It’s one to watch out for! – VB]
6. Ah… ‘most-selected’… who’d have guessed it means the one I happened to click first?
7. #10 seems the closest to the problem I’m having, so I’ll ask the question here? How do I make the star ratings stay with the file? Other apps are interchangeable, but Lightroom’s stars don’t show up anywhere else.
[Turn on ‘automatically write to xmp’ in preferences, or select all in Grid view and hit Ctrl-S/Cmd-S every so often to write to xmp. That’ll allow other programs to read the star rating data. – VB]
8. I disagree with #9. There are two levels of selected. Most selected, and also selected. That’s it. But definition, not-selected is NOT selected. So that’s not a level of selection. If you “select” a file in Windows Explorer, that’s one level of selection….it’s selected. Windows Explorer only has one level…”selected”. Lightroom has an additonal level.
If you had a light in your room, and it has an on/off switch, then it has one level of on….which is, “on”. But if it had an intermediate level which is half-power, that would be a second level. So it would have a two-level choice of on….half-on, and completely on. Two levels. Off is not a level of on…cause, it’s off not on.
Two levels. Because there’s only two of them to choose from.
[Oooooooh, who’s being fussy with words then. ;-) Ok, there are 2 levels of selection in addition to deselected then. Better?- VB]
9. …But if only one is selected it turns mid-grey – so that can mean ‘selected’ OR ‘also selected’ if there is more than one. Light-grey is only the first or priority selection of more than one. So, there are still three levels… Confused? Well, to me, if something that should be simple is tripping people up, then change it. That said, I personally think it’s pretty obvious.
10. Thanks Victoria,
I have been destroying my files with Elements 7 adjustments and have just purchased lr & cs4. Is there any comparsion to E-7 and CS-4?
Billy Andrews
[Hi Billy. I don’t have any links to hand comparing between the Elements and CS4. CS4 is Elements on steroids. There is a big difference between Elements and Lightroom though – everything Lightroom does is non-destructive. – VB]
11. Jack Varney says:
Regarding #9, my first thought was that by not selecting an item it is not a mamber of the set of selections. Further thought leads me to the conclusion that by not selecting items they are placed in the set of selected items by default! Three levels, indeed.
12. Theodore Nugent says:
Hands up, who thinks Chad is a niggling twit?
Great info Victoria, I link this post every chance I get.
13. One gotcha I would add is that Lightroom’s plugins and presets are used by all catalogs (databases) under your login name. This is true for Windows – I don’t know about the Mac.
This means if you are developing your own plugin and want to test it before unleashing it on your production catalog you need to do it as a different Windows user. Setting up a new catalog for Test isn’t sufficient. I have a Windows user on my PC called LRDev for that purpose.
Similarly if you change a preset in one catalog it affacts all the others for your user name – which may or may not be what you wanted.
[Good points Ian. Developing plugins probably isn’t the first thing on new users minds, but it’s still useful information. It works the same for Mac too.
As to your presets, there’s a checkbox in Preferences called ‘Store Presets with Catalog’ which will make any presets catalog-specific (but then confuses people when all their presets have disappeared because they’ve switched to the different catalog….. ;-) – VB]
14. Go ahead and call me dense, but I’m still not understanding #9 (and I’m not referring to the 2 vs. 3 debate).
I do see two level of gray, but what is meant by “most selected” and “also selected”??
[Jon, select 2 files – one will be lighter grey that the other, and the unselected ones will be dark grey. That lightest grey one is the ‘most-selected’ and that’s the one that would be used as the source for syncing settings, changing capture times, that sort of thing. As an example, if the ‘most-selected’ image had grayscale settings applied, and you used Sync to copy those settings to the other images, the grayscale settings from that ‘most-selected’ or active image would be applied to the other selected (mid-grey) images. – VB]
15. re #9, Lightroom uses the term “active” to differentiate between “selected” and “really totally selected to the max.”
For the still-befuddled: Any number of images can be selected. Only one can be active. However, all selected images in Grid view are basically active. Think of Grid as “Batch.”
My gotcha, to which I have no answer: When entering metadata, why does the cursor lose focus (data entry stops) and suddenly I’m typing hot keys? Happens all the time, can’t figure out what I’m doing to change focus.
[Hmmm, I’ve heard a couple of reports of that one. Have you updated to the 2.4 update? – VB]
16. re: annoying metadata entry behaviors, I did some prowling last night. Turns out a lot of people have this trouble and no one can determine where LR’s spasms come from. Bottom line: the standard type-tab-type-tab routine we all know and love for database entry stumps LR. (I do have 2.4)
However, I found a simpler, faster workaround: Use the Sync Metadata window instead of direct entry, for one image or 1,000. LR doesn’t record the typing until you close the window, and the interface is more concise.
[Well done for finding a solution. It’d be worth putting in a Official Feature Request/Bug Report Form too. – VB]
17. Lars Clausen says:
I knew the other ones, but #10 was new to me, too, and I’ve even started teaching classes on LR. Makes both collections and flags more useful. Thank you!
18. Regarding #10: If you flag images in the collection sets then the flags carry over to the catalog> all photographs… strange but it works. If you flag in the catalog they do not carry over into collection sets, but not the collections within the sets. The same is true with folders.
19. So if I delete images outside of lightroom (say in bridge), that have been cataloged previously in lightroom, there is no way to globally update that lightroom catalog to get rid of the previews of those deleted files?
[You could use ‘find missing files’ under the Library menu from memory, and then remove those from the catalog. – VB]
20. Im very confused (in #6) how to get lightroom to match my cameras rendering
[Max, which camera do you shoot? – VB]
21. #9 is that you can have selected and unselected images, but within the selected images, one will be the ‘most’ selected – hence three levels.
There is one exception to this – if you’re in the Develop module and you have ‘Autosync’ turned on, any Develop changes made will be automatically applied to all selected images.
[Quite right – and there’s an AutoSync option in Library module in LR3 now too. – VB]
22. I just discovered this blog the other day and wish I’d found it earlier :-) Some great stuff here and I know how much effort it must take to compile it and put it all together.
#9 got me several times before I finally figured out what was happening!
23. djkaraok says:
Cannot believe I just stumbled onto this site. Been reading some posts and felt comfortable with the quality and quantity of knowledge in the posts. Although an old timer I continue to keep learning and took on LR4 several months back for organizing my 46,000+ photos. Then I received additional video training for LR and have come to love the editing power. Even downloaded LR5 beta and am enjoying some new improvements.
Been using PSE 6-11 which keeps getting more powerful every year. Owning OnOne Perfect 7 bundle along with Topaz Labs Bundle and the stand alone Photofx.
Keeping my ear to the ground I have come to hear that CC for Photoshop only will be $9.99 if you do not need the other programs at $19.99. Also the ability to work on a tablet plus a suggestion to combine LR with PSE and name it LightShop.
• djkaraok says:
By the way I have no idea where to post. Sorry! Remember we really have been renting software yearly for a while. How long have purchased anti-virus and continue to buy it every year. Please I understand there are free ones but apples to apples.
• Thanks djkaraok. The $9.99 deal for Photoshop is for people who already own an earlier version of full Photoshop, and just lasts a year. Then it reverts to $19.99 for those who only need Photoshop, or $49.99 for those who want the whole suite. And I love the idea of creating a Photoshop version for Lightroom users.
Leave a Reply
|
global_05_local_5_shard_00000035_processed.jsonl/31677
|
The Latest
So, What About Rubinius
Rubinius is important. A whole lot of folks agree. Ola Bini wrote up a whole post about how important he thinks it is. In it, he writes: more>>
Text flow in Writer
Most people are content to let their word processor determine hyphenation and text breaks for them. And, most of the time, the result is acceptable if they do. However, just as the default justification can be improved if you want to take the time, so can the text flow. more>>
Looking for the next Net business
The Internet most of us experience is not the World of Ends suggested by the end-to-end system design concepts around which the Net was originally architected and built.
Instead we have something that is faster-than-dialup, and faster-than-it-used-to-be; but is not The Net. Instead it is the part of the Net that's left in a pipe that's optimized for television, for one-way few-to-many "content delivery" and for locking users into client roles, while servers labor somewhere else.
I just had FTTH (fiber to the home) installed. And, while it's way cool in some ways, it's also uncool in the way it prevents far more business than it generates for itself. It would be great if the carriers made it easy for businesses to grow on the Net, and then suppoted those businesses with services that helped those businesses thrive and grow. But the carriers would rather serve "content" to mass quantities of "consumers" while chaging prohibitive prices for "business-class" services. Hey, it's a mass media mentality, and they have every right to it.
But... more>>
Looking for Algae--the Next Voyage
The Brazilian winter was almost over, and while the mild winters in Florianopolis allowed me to work on the Agape, the coming of spring meant that it was time to set sail for new adventures.
Grayson, the youngest of the Pollywogs, showed up early in the morning at the dock, as I got ready to sail. "What are you doing?", he asked. "I am getting ready to study algae", I answered. "Algae!", he exclaimed, "why are you looking for that?" more>>
Defending Openness
Wanted: OPML editor on Linux
In How to sponsor an open source project?, Dave Winer says, I want the OPML Editor to run on Linux... and floats the idea of a bounty for the job.
He's taking comments here. Guidance: I'm looking for ideas, established practices, do's and don'ts for sponsoring an open source project, Dave says. more>>
Thanking our own heaven on OneWebDay
This coming Saturday (22 September) is OneWebDay, a project I'm proud to have been a part of since Susan Crawford thought it up many months before the first one last year. OneWebDay is meant as a day on which we celebrate the Web and what it does for each of us.* So I want to celebrate what the Web does, and continues to do, for me as a journalist.
The arc of my writing career is something of a parabola: a broad U-shaped valley between the time when I worked as a newspaper and magazine writer and editor and the time when I started writing on — and about — the Web, and everything that makes it good, including (and especially) Linux. more>>
Loop-based Music Composition With Linux, Pt. 1
Loop-based music composition is the practice of sequencing audio samples to create the various parts of a musical work. A sample may contain only a single event such as a bass note or cymbal crash or it may contain a measured pattern of events such as a drum beat, a guitar chord progression, or even an entire piece of music. The former type is sometimes referred to as a "one-shot" sample, while a longer sampled pattern is often simply called a loop.
A loop is usually created at a specific tempo in a precise time period (musical beats and measures) for exact concatenation with other loops. Sequencing a series of timed loops creates realistic tracks that can convince a listener that he or she is listening to a part specifically performed for the piece.
Confessions of an unjustified sinner: Using justification in OOo Writer
When typewriters ruled the desktop, all paragraphs had a ragged right justification, with each line starting at the same position on the left, but with a variable right margin. Full justification -- lines whose left and right sides all ended in the same positions -- were the mark of professional typography, and beyond the means of the average user. more>>
I was looking at what my friend Stephen Lewis wrote in HakPakSak a few days ago — specifically "...newspapers’ roles as public trusts and cornerstones of our informational infrastructure — i.e. sources of solid information and independent commentary essential to informed citizenry, democratic government, effective public policy, and well-functioning economies".. What this brought up for me is the notion that human beings are themselves infrastructural; especially when they are constuctive contributors to the structure we call civilization. more>>
Adding contents automatically in Calc
Spreadsheets are labor-intensive documents. Usually, their contents is entered carefully, one sheet at a time, at an input rate far below a text document. However, like most spreadsheets, has several tools for removing some of the drudgery from input. more>>
Troubleshooting Linux Audio, Part 3b
The Joy of OOXML
Documentation Coverage Testing With dcov
How often have you thrown up your hands in disgust at the poor quality of documentation for an open source project? Wouldn’t it be nice if someone put together a documentation coverage tool that worked like test coverage too ls? Well, you’re in luck—dcov is here (at least for Ruby code). more>>
Point of Attack
Recently, as in last week, I learned a new Texas idiom. A senior executive at a client explained what he meant when he said that I was beating his dog. I didn't have a reference for the comment until he said that if he invited me over for a barbecue and I beat his dog that was inappropriate. "How would you like it if you invited me to your house for dinner and I beat your dog?" he asked. more>>
Time to Write About Something Besides Redmond
I plead guilty to past transgressions. So, call me a hypocrite if you will. I don't care anymore. I refuse to get stuck in the past because the present and the near future is fun.
Indulge if you will in recurrent and persistent thoughts, impulses, or images experienced as intrusive and distressing. The obsession with Microsoft in Open Software communities is excessive and unreasonable and a product of the mind. My only hope is that such thoughts, impulses, and, or images can be expunged by logic or reasoning, which is contrary to the notions in the psychiatric community. more>>
On valuing freedom more than cushy jail cells
The problem isn't just silos and walled gardens — our names for choiceless dependency on one company's goods and services. The problem is the defaulted belief system that gives us silos and walled gardens in the first place.
In that system suppliers believe that the best customers and users are captive ones. Customers and users believe that a free market naturally restricts choices to silos. It's a value sytem in which VCs like to ask "What's your lock-in?". Even in 2007, long after the Net has become established as an everyday necessity, we still take for granted the assumption that living in a "free market" is to choose among jail cells. May the best prison win. more>>
Did Microsoft Buy Netcraft?
rubinius, JRuby, and Ruby.NET plans
In my last blog post, I mentioned the work on rubinius (then at a 0.7 release and now at 0.8) and JRuby. I also promised I’d follow up on them. Here’s what’s been going on so far. more>>
Troubleshooting Linux Audio, Part 3a
Geek Guide
The DevOps Toolbox
Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers
Get your free copy today
Sponsored by IBM
8 Signs You're Beyond Cron
Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl
Sign up and watch now
Sponsored by Skybot
|
global_05_local_5_shard_00000035_processed.jsonl/31699
|
View Single Post
Old 03-17-2003, 04:06 PM #3
Kray San Gin
Kray San Gin's Avatar
Join Date: Mar 2003
Posts: 11
While I agree...
with the idea that manual blocking would be a nice addition, I have to say that removing sabre toss might be a mistake.
Remember when I mentioned that a Jedi Master would have certain perks? Well, sabre toss might be more respected if the person using it were a Master.
Many people don't like toss because it is abused. Personally, I use toss as part of my strategy BUT 99% of the time it is used to counter DFA.
I still catch flack for that but I think it's fair.
~ Kray San Gin
Kray San Gin is offline you may: quote & reply,
|
global_05_local_5_shard_00000035_processed.jsonl/31701
|
View Single Post
Old 04-23-2004, 11:36 PM #5
Noxrepere's Avatar
Join Date: Apr 2003
Posts: 147
You can just stick the pk3 in JA's base folder and the model will show up and work in-game.
The sounds won't work and you will have to fix that seperately. Information about the fixing the sounds can be found over here:
I'd recommend using Hekx's seperate pk3 method if you'll want to play online, or just for the ease of not repacking every pk3.
You'll need to look in the pk3's to find the name of the sound folder and model folder, and then just create text files with the sound directory and put them in folders with the model directory names. Zip that up and the sounds will work.
I hope that was clear enough. If not, just ask and I'll clarify as best as I can.
EDIT: There are a lot more models and things for JO that will work in JA. Here are some sites with those files (you might already know about them, but I thought I'd post them anyways.). There's a lot of really good work, so if you don't mind searching around you can get a lot more good stuff.
JK2 Files
PC Gamemods
Noxrepere is offline you may: quote & reply,
|
global_05_local_5_shard_00000035_processed.jsonl/31727
|
Soil 9
Page 1 -
Soil Manga
+ Larger Image
Soil 9 - Page 1
+ Larger Image
Tip: Click on the Soil 9 manga image to go to the next page. You can use left and right keyboard keys to browse between pages.
Soil 9 Chapter Navigation:
Next Chapter: Soil 10: 10
Previous Chapter: Soil 8: 8
Soil 9 - Read Soil Chapter 9
Soil 9 released! You are now reading Soil 9 online. If you are bored from Soil manga, you can try surprise me link at top of page or select another manga like Soil 9 from our huge manga list.
Soil 9 released in manga panda fastest, recommend your friends to read Soil 9 now!
Tags: read Soil 9 english, Soil 9 raw manga, Soil 9 online, Soil 9 chap, Soil 9 chapter, Soil 9 high quality, Soil 9 manga scan
|
global_05_local_5_shard_00000035_processed.jsonl/31732
|
The brands that say U.S.A. (but aren't based here)
A customer walks by Dodge cars on the sales lot at Hilltop Chrysler Jeep Dodge in Richmond, California.
July Fourth. The most American of holidays. The day when being an American means firing off mortar devices near neighborhood children.
According to a survey of 4,500 consumers from research firm Brand Keys, if you want to think red-white-and-blue this year, you also need to think about driving a Jeep. The truck company rolled to the top of the list: It's the most patriotric brand in the country. (Check out the full ranking at the bottom of this post.)
That's despite the fact that Jeep is owned by an Italian firm. Fiat bought part of Chrysler during the financial crisis and now owns a majority stake in the company. Chrysler is Jeep’s parent company.
And Jeep isn't the only example of this.
Fizzy, yellow beverage Budweiser comes in at No. 14. Bud -- a beer brand that's as American as Corsendonk! (Except that’s a Belgian beer brand. And so is Budweiser.)
Budweiser's Anheuser-Busch merged with Belgian-Brazilian beverage maker InBev in 2008. The company’s now based in Leuven, Belgium.
And to round out the list, Wilson Sporting Goods (producer of round things) comes in at No. 24 on the list of most patriotic brands. But Wilson was bought by the Finnish company Amer Sports in the 1980s, which kicked off a number of international and exotic travels by the brand and its associated products:
If you want to stay 'Made in the U.S.A.' on Independence Day, here's one way to do it:
Wake up. Drink a Coke (No. 3), then brush your teeth with Colgate (No. 6), but not before eating a Hershey’s bar (No. 2), in your Levi’s jeans (No. 4), and Wrangler shirt (No. 25), while smoking a Marlboro (No. 15), that you lit with your Zippo (No. 7), on your John Deere tractor (No. 20).
Then light some fireworks.
The most patriotric brands in America, according to a survey from Brand Keys:
1. Jeep
2. Hershey's
3. Coca-Cola
4. Levi Strauss
5. Walt Disney
6. Colgate
7. Zippo
8. Wrigley's
9. Ralph Lauren
10. Kodak
11. Gillette
12. New Balance
13. Harley-Davidson
14. Budweiser
15. Marlboro
16. Ford
17. Louisville Slugger
18. Smith & Wesson
19. General Electric
20. John Deere
21. L.L. Bean
22. Walmart
23. Craftsman Tools
24. Wilson Sporting Goods
25. Wrangler apparel
About the author
I agree to American Public Media's Terms and Conditions.
With Generous Support From...
|
global_05_local_5_shard_00000035_processed.jsonl/31737
|
Pumpkin Seed Necklace
What to do with leftover pumpkin seeds? String them into a pretty necklace.
Pumpkin Seed Necklace
Source: Martha Stewart Kids, 2002
• Pumpkin
• String
• Cookie sheet
1. Scoop out a pumpkin and place the seeds and pulp in a bowl of water. The seeds will quickly separate from the fibers and float to the top.
2. Remove seeds and rinse them, then place them, in a single layer, on a paper towel or cookie sheet.
3. Let dry at room temperature 6 to 8 hours. Do not let seeds dry too long before stringing them, as they will become brittle and hard to work with. Thread a sewing needle with silk beading cord, and pierce seeds, stringing them in the patterns shown at top (tie knots in between for spaces) or your own. Knot cord
Be the first to comment!
Related Topics
|
global_05_local_5_shard_00000035_processed.jsonl/31744
|
View Single Post
Old 07-21-2010, 09:56 PM #4
2nd Gear Member
MylesPenney's Avatar
Join Date: Apr 2010
Location: Bowmanville
Posts: 68
i want those so bad! lol. i've got a race seat in my car...from previous owner, the rest is cloth. Would u be interested in some kind of trade + some cash? Let me know if ur open to anything like that, thanks
MylesPenney is offline Reply With Quote
|
global_05_local_5_shard_00000035_processed.jsonl/31750
|
Most adolescents and adults receive much of their necessary vitamin D from exposure to sunlight. Infants and young children, however, need to avoid direct sun entirely or be especially careful by always wearing sunscreen.
Make sure your child is eating foods that contain vitamin D naturally — fatty fish, fish oil and egg yolks — or that have been fortified with vitamin D, such as:
• Infant formula
• Cereals
• Milk
• Orange juice
June 01, 2013
You Are ... The Campaign for Mayo Clinic
|
global_05_local_5_shard_00000035_processed.jsonl/31751
|
Treatments and drugs
By Mayo Clinic Staff
You can usually leave a cyst alone if it doesn't cause discomfort or cosmetic problems. If you seek treatment, talk with your doctor about these options:
• Injection. This treatment involves injecting the cyst with a medicine that reduces swelling and inflammation.
• Incision and drainage. With this method, your doctor makes a small cut in the cyst and gently squeezes out the contents. This is a fairly quick and easy method, but cysts often recur after this treatment.
• Minor surgery. Your doctor can remove the entire cyst. You may need to return to the doctor's office to have stitches removed. Minor surgery is safe and effective and usually prevents cysts from recurring.
• If your cyst is inflamed, your doctor may delay the surgery.
• Lasers. This method involves using a carbon dioxide laser to vaporize the cyst. It results in minimal scarring.
May 29, 2014
You Are ... The Campaign for Mayo Clinic
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.