Search This Blog

Thursday, November 24, 2022

Python Weather app - current conditions from the national weather service

 So, I was reading through a course on XML from W3 schools and in there, it mentioned that current conditions are available as an XML file for various locations.  So I investigated it.  After a bit, I thought I should make a Python program to pull the information from the National Weather Service in XML format and then display this information to the user.

It took some time to refamiliarize myself on the use of the urllib functions in Python to make an http request and download the text of the response.  Then, I needed to learn how to use the XML functions to parse the XML to retrieve the values for each of the tags.  My solution is quite fragile in that any changes to the file format by the National Weather Service will break the code.  Nonetheless, I was quite pleased with myself when I had finally got this working!  So I thought I would share it with the world.

While I don't think that this is going to revolutionize anything, maybe you can re-use some of the code.  Probably the list of the different Oregon locations is the most useful thing.

Here's what the user sees after hitting Fetch:


Wednesday, November 23, 2022

Shopping list and recipe app development plan

 So this is going to be the first of a series of posts that are going to follow along developing a desktop application (mostly cause I don't have an IDE in which I can create a mobile app) that will store recipes, allow the user to make meal plans, and then based on those meal plans create shopping lists for all the ingredients.

The overall plan is going to include:'

  • Defining the requirements that the software has to fulfill from a user perspective.  This would be the functionality that the user expects the software to perform.
  • Defining the technical approach that is going to be used to fulfill the user's requirements defined in the previous bullet.
  • Create a test script to be used to ensure that the software is functioning adequately.  Each of the tests will check that one or more of the requirements have been fulfilled.
  • Perform the testing and then do any required remediation to correct any discovered test failures.
  • At this point, I may end up discussing what additional or changed user requirements could be used for the next version of the software.  But let's not get ahead of myself.
So what are the user requirements?  While I'd like to use a table here, I'd have to create it by writing raw HTML as the blog's UI isn't accommodating of tables so you will have to bear with me as I present it as a numbered list.  While the numbered list will not allow me to, within the list, add a prefix, for any cross-references, pretend that Recipe requirements are prefixed with an R, Ingredient requirements are prefixed with an I, Meal Plan requirements are prefixed with an M, Shopping list requirements are prefixed with an S, and general requirements with a G.

Recipe module

  1. The user will enter for each recipe:
    1. A title
    2. A category for the recipe
    3. The number of servings the recipe makes
    4. One or more ingredients
    5. One or more cooking steps
  2. Recipe categories can be created, edited, and deleted.
  3. Recipe categories will be pre-populated with:
    1. Entrée
    2. Side
    3. Appetizer
    4. Dessert
    5. Snack
  4. Do not allow Recipe Category to be deleted if it is used in an existing dish.  Advise the user of at least one recipe title that they need to address if they try to delete in this case.
  5. For each ingredient, the user will specify:
    1. Quantity to be used
    2. Unit of Measurement of consumption quantity
  6. For each cooking step, the user will specify:
    1. Step number
    2. Text of the step instructions
  7. Recipes can be exported.
  8. Recipes can be imported.

Ingredient Module

  1. For each ingredient, the user will enter:
    1. Ingredient name
    2. Purchase Quantity
    3. Purchase Unit of measurement
    4. Zero or more unit of measurement conversions
  2. Ingredients can be exported.
  3. Ingredients can be imported.
  4. Ingredients can be created, edited, and deleted.
  5. Ingredients cannot be deleted if they are used in a Recipe.

Meal Plan Module

  1. The user can populate the meal plan module with a meal record consisting of:
    1. A Recipe
    2. The number of people dining
    3. The date of the planned meal
  2. An export can be created for a date range showing all the meals planned within that date range.  The export will be a table modeled to simulate a calendar.  Also a multi-level list format will be available.
  3. Meal records can be created, edited, and deleted.

Shopping list Module

  1. The user can create a shopping list for a user-selected date range.  This will produce a shopping list for all the ingredients that will be consumed in the preparation of all the meals in the selected date range for the indicated number of diners and indicate to the next whole purchase Unit of measurement.

General requirements

  1. The user can create different databases.
  2. The user can open a specific database.
  3. There are no security requirements.
In writing this, I've had some thoughts already about other behaviours I'd like the program to have, but I think this is already enough to get on with.  The next post, hopefully within the coming week will discuss the technical approach I will take to providing the functionality defined above.

Friday, May 6, 2022

Articles of the Communal Charter of Amiens

I ran across this page.  Although I suspect I would disagree with those behind the website, it seems to be a well curated collection of texts and for the efforts made to make texts available for free to the public, I am ok with it.  In any case, they have included the articles of the communal charter of Amiens as a document but lamentably, only include a Latin version complaining that an English translation is not available.  As such, I have taken the time to use Google translate as well as a bit of clean up to come up with the following text.  However, it is clear that the translation from Latin is a bit clunky at best and the resulting text is hard to understand.  Had I a better understanding of the history and context of this document, I might be able to sort out questions like whether the resultant "commons" and "common" from Google translate meant "commoner", "commune" or "community" or if indeed there was a commons (either a pasture or city square) that is being referenced within this charter.

In the name of the holy and undivided Trinity. Amen. Philip, king of the Franks, by the grace of God, since our friends and faithful fellow citizens of Ambianenses have often faithfully exhibited to us their service, we have given them a common observance of their love and fidelity to us, at their request; an oath.

1. Each one, under his oath, will justly watch for his faith, assistance, and counsel in all things.

2. Whoever commits theft will be caught within the boundaries of the community, or will be known to have committed it, he will be handed over to our provost, and whatever will be done about him will be judged and done by the judge of communion. To the protestant, our provost shall restore what was stolen, if it can be found; the rest will be converted into our uses.

3. Let no one presume to disturb any one residing among the common stock itself, or with merchants coming to the city with their wares, to disturb the peace of the city below the Banleucam (1). And if any one does this, let him do it in common with him, that he may do justice to the violator of the common law, if he can apprehend him, or anything of his own, to do justice.

4. If anyone has taken away his property from communion with someone under his oath, then, having been summoned by our provost, he will pursue justice; but if the provost of justice should have failed, having been summoned by a major or a [leader], he will come into the presence of communion, and will do there, as far as the [leader] shall judge from it, without prejudice to our right.

5. But he who is least of all from communion, has taken away his property from any one of the commons, and has denied that he will execute justice within Banleucam, after he has made it known to the men of the fort, where he remains; our provost will retain them until he has our own and our generals in like manner.

6. If he strikes with a fist or palm any one of the commons, apart from the customary agitator or lecturer, unless he has acted in self-defense, he will be able to prove it before our provost, before striking two or three witnesses, to give twenty shillings, fifteen shillings for the general justice and five for the justice of the lords.

7. But whoever wounds his oath with arms, unless he will be able to prove himself by the lawful testimony and assertion of the oath by defending himself against the wounded, shall lose his fist, or shall pay nine pounds, six to the firmness of the city and common, and three to the justice of the lords, shall pay the fist as ransom; or if he will not be able to pay, he will deliver the fist in the mercy of the common people, saving the principal of the masters.

8. But if the proud man is so wounded, that he does not wish to receive an amendment at the discretion of the provost and mayor and of a postage, or to provide security, his house, if he has a house, shall be destroyed, and his chattels shall be taken; if he does not have a house, his body will be taken until he has received either an amendment or a security.

9. But he who, by no means existing in communion, has smitten or wound any one of the commons, unless he wishes to execute justice before our provost by the judgment of the common, and, if he may be able, throw to the commons his house, and they will be our capital. And if he will be able to arrest him, he will be taken revenge on him by the district provost before the mayor and scabbards, and our chattels will be.

10. If any man has violated his oath with indecent and disgraceful reproaches, and if two or three have heard him, we have determined to be convicted by them, and shall give five shillings, two to one who is abused, and three to the common.

11. Who would say that it would be dishonorable for anyone in the audience of some common people, if it was made public, and that he would not be willing to defend himself by the judgment of common judges, if he were able to throw to the commons his house, and to stay in common until he amended it? he will suffer, and if he will not make amends, his chattels will be in the hand of the lord king and common.

12. If any one who has taken an oath to his oath, or has lied in good faith, shall be approved before the provost and mayor, he shall be punished by a common judgment.

13. If any man knowingly buys or sells spoils of the common stock, if it shall be proved, he shall lose the spoil, and shall restore it to the spoils, unless any thing be committed against the lords of the common, or from the plunderers themselves.

14. He who cannot prosecute justice after making a claim against his adversary through the provost and major and judges of the common law, if he afterwards shall do anything against him, it will be reasonably common to him, and, having heard of it, he shall judge by reason of what ought to be done afterwards.

15. He who, having been summoned by the mayors and judges and deans, to wit, those who serve the commonwealth, having been prompted to evade justice and common judgment, will knock down his house if they can; but they will not permit him to remain among them until he has satisfied them.

16. Whoever knowingly receives the common enemy in his house, and has communicated to him by selling and buying and eating and drinking, or by providing some solace, or giving counsel or assistance against the common, shall be made guilty of the common; he will be able to lay low the common stock, and the chattels of the king shall be.

17. Within the common limits, a hired champion will not be received against the common man.

18. If any man knowingly violate the constitutions of the commons without a shout, and shall be convicted of it, he shall soon lay the ground for that common house, if possible, and shall not suffer him to remain among them until he has satisfied himself.

19. It is also established that the general should not admit of lands or feudal lords.

20. He who wishes to test the general judges of the falsehood of the judgment, unless he has been able to prove it, is in the mercy of the king, and of the greatest, and of the scabbard, of all that he has.

21. The woman will not be able to sell the dowry which she holds, nor will she be able to send bail except to the nearest heir and from year to year. But if the heir is unable or unwilling to buy it, he must retain the woman for his entire life, and be able to lease it for a year.

22. If any man and his wife have infants, and it happens that their infants die, which of them survives, whether man or woman, whatever they possessed or chosen in like manner. the lieutenant was then made. But if before they have come together, or the husband or wife have had children, after the death of their father or mother, the inheritance of their children will be returned to them, unless there is a fee.

23. If the wife survives after her husband's death, and her children remain alive, the woman will not answer for all the possessions which her husband had in peace, so long as the children will be in custody until she has an attorney, unless he has bail, he will not answer.

24. If any one should seek money from any widow, she will defend herself by oath against one witness, not against many, and will remain in peace; but if she shall seek from her any possession of her as a bail, she will defend herself in war.

25. If any man buy the land or any inheritance from any one, and before it has been purchased, it will be offered to the nearest heir, and the heir will not buy it, he will never again answer to that heir in cause of it. But if it is not offered to the nearest heir, and the one who buys it, the heir seeing and knowing, will keep it in peace for a year, never will he answer it any more of it.

26. If any one has held any possession of his property in peace for seven years, he shall never answer it again concerning it with the present adversary.

27. If any foreign merchant sells anything, and at the same hour could not have his money, he shall first make a noise to the owner of the purchaser, or to the provost of the lord; whatever day it may be.

28. Whoever makes a cry of promise will recover nothing.

29. If any major, or a scabinus, or any of the major justice, has received or inquired of a premium, and he who gives, or by whom the premium has been asked, shall call to the greater, or has a witness concerning this, the accused shall pay twenty shillings; and if he receives a premium, he shall pay it.

30. But if the accuser does not have a witness, he who will be accused by the oath will defend himself.

31. If any one shall bring a shout to the provost, and the provost will not do justice to him, the crier shall bring a louder shout, and the major shall send the provost to the account to do him justice; and if he refuses to do so, the major, without prejudice to the country's law, will do justice according to the rules of the image.

32. If a man has slain any thing that is his own, and he who is accused will answer that he has not knowingly bought it from a robber, he for whom he will be accused will lose, and will defend himself before justice by oath, if the provost or justice will ; And this garanus will do the same, if he shall say the same, both the first, and the second, and the third; but the accuser will confirm by oath what he has cried out, if he who wishes will, who will obtain justice.

33. In every case, both the prosecutor, the accused, and the witness will speak through an attorney if they wish.

34. Let no one presume to make a case outside the city concerning possessions pertaining to the city.

35. If the husband and wife acquire some possession during their lifetime, and one of them dies, the one who survives will have only half of them and the other children. If the husband dies, or the wife dies, and the children remain alive, the possessions, whether on land or in rent, and which part shall come from the dead the relatives of the parents have died, or until their infants have been imprisoned.

36. If any one provokes the king's provost, in a plea or without a plea, with disgraceful and disgraceful words, he shall be in the mercy of the provost, at the discretion of the major and the scabbard.

37. If anyone provokes a major in a plea to disgraceful and disgraceful words, his house shall be thrown down; or according to the price, the house may be redeemed in the mercy of the judges.

38. If any one strike or wound his oath, and he who is struck shall make a cry that he was struck by the old hatred, the striker shall do the right, according to the statutes of the image, for the blow; he will make the common, and he will give nine pounds, namely, six pounds common and sixty shillings for the justice of the lords, and he will pay half of the right within eight days, or the whole, if they wish. For no one will perform the oath for him who kills, whoever he is, either a man, a woman, or a boy.

39. If the mayor sits in the case with the generals and juries, and there someone strikes his oath; his house, against which several witnesses came out, who was the first to strike the blow, was thrown to the ground.

40. But he who is convicted in his case under oath shall pay twenty shillings of the common stock, there the justice of the lords will receive nothing.

41. Whoever casts his oath into the water or into a marsh, if the outcry bears one witness and has seen greater uncleanness, the criminal shall pay sixty shillings, and from these the justice of the lords shall have 20 shillings. If an unclean man has no witness against blood or uncleanness, he will defend himself by oath, and will depart free.

42 But whoever has called his oath, a disobedient servant, a traitor, a wissot (2), that is, a coup, shall pay twenty shillings.

43. If the son of a burgess has committed any forfeiture, his father will execute common justice for his son. But if he shall not be in the custody of his father, and be warned, and evade justice, he must be a stranger to the state for one year. If, however, he wishes to return in the past year, he will do the right thing according to the statutes of the image file provost and mayor.

44. If any agreement has been made before two or more scabies, there will no longer be a battleground or a duel in respect of that agreement, if the scabini, who were present at the convention, shall testify to this.

45. All those major and common laws and precepts we have mentioned above are only among the jurors. There is no horse judgment between a sworn and an uninjured.

46. It was the custom of the Amiens, that, on the feasts of the Apostles, when entering into the country of each of the four chariots through one of the four gates of the city, Guarino archdeacon of Amiens received a penny. The elder and the scabini, who existed at that time, by the advice of Theodoric, then bishop of Amiens, purchased from the archdeacon the aforesaid custom, at five shillings and four capons; and the archdeacon takes that tribute at the furnace of Firmin's Cloister, situated outside the gate of Saint Firmin in a valley.

47. On all the tenements of the town justice will be shown by our provost, three times a year in the general plea: namely, on Christmas, Easter, and Pentecost.

48. Moreover, the major and the scabini shall judge all forfeitures which shall be made within the banleugam of the state, and shall do justice to them, as they ought, in the presence of our bailiff, if he will be present there; but if he will not be present, or will not be able to do justice for his absence, they will not cease to do justice, but will do justice to him, with the exception of many and many rape, which we retain for ourselves and our successors forever, without the other's side.

49. Our chattels of murderers, arsonists, and traitors are absolutely, without regard to the other. In the chattels of other criminals, we retain to ourselves and to our successors what we have and ought to have.

50. No one can make a ban in the country except through the king and the bishop.

51. If anyone is banned for any forfeiture, except for the many, murder, arson, treachery, rape, the king, the steward, or the king's provost, bishop or major, each of them will be able to hire him once a year in a villa.

52. We will also, and we will perpetuate the commonwealth, and grant that it may be lawful for us, and our successors, to send the city of Ambiaan or the common stock without our hand, but that it always clings to the crown royally.

To ensure that all these things remain permanently ratified and stable, we confirm the present page of our seal with the authority and stylus of the royal name annotated below, without prejudice to the right of bishops and churches and nobles of the country and of foreign law. Act of Lorriacus in the year of the incarnation of the Word in the twelfth year of our reign. Those standing in our palace whose names and signs have been placed: S. Count Theobald, our waiter; St. Guy, buticular St. Matthew, chamberlain S. Ralph, constable. Chancery vacancy date.

(1) This appears to be a reference to a geographic place within Amiens.  "banlieu" is French for suburb and thus it may be intended to refer to the surrounding areas to Amiens that are still within the jurisdiction.

(2) The original marks this as "alias wisloth" which is well, not insightful either, but from the context, it is clearly a pejorative term.