Wednesday, November 30, 2022

Security

 Fine, I am a bit annoyed but at least I solved it. Imagine my consternation

when, on opening Pycharm, I get a message to the effect that Windows Defender

is actually blocking some aspects of this app and that I should set permissions.

How long has this been going on.

                                              

Long story short, both windows 10 and 11 need to be set to allow apps to run

without interference:

                                                                      

Ask for Powershell and click Allow...                                                    

tkcalendar now works flawlessly on both of my surface tablets!!

On my older Surface:

                                                                             





  

update_idletasks() is necessary!

                                                                    *     *     *
Actually found someone with a working backend from StackOverload. Just

added the update_idletasks function and it works...

                                         


Tuesday, November 29, 2022

Severe

                         That yellow dot is where I live...

                                            


                                                                                        


Testing

 Been testing things by running the same code on two different

computers: an older one, with 2 cores; and a recent one with 4.

Apart from minor speed differences, both behave the same way

with my python code. 


In principle, a quad core processor is capable of parallel computing,

while a dual core processor isn't; but it didn't seem to make a difference

in what is possible. Not for this scale of effort, in any event.


                                                       



In effect, both complained if I tried to run a mix of a function call and two threads.

Error: main isn't running in mainloop ie I am trying to change the look of things

from threads, and this is not recommended.


Did use both time.perf_counter and time.process_time to track how lomg.

The first takes sleep time into account, the second one doesn't. Intriguingly,

my newer computer reportedit took 0.0 seconds to run the above code with

processing time. (Both need to be used as finish - start!).


          
      

Monday, November 28, 2022

Threading

 Python runs as a single thread, and the time module

gives access to time information about the length of 

different processes. but once engaged ina time consuming task,

threading allows us to push off the time consuming task

to a separate task, and keep an app goinmg.Below:


                                                           




                                                                                




                                                                          

                                                                      *     *     *

                                                                                

With importing threading:

                                                                             





Spark

 Was there a spark that created life on earth. The truth of the

matter is probably more mundane. But the real breakthrough

was probably the appearance of a cell(s) ie something structured

with an inside and an outside,  which needed to replicate and 

eventually repair itself, in effect eat and get rid of garabage.

But my understanding is that all took a terribly long time, with many

reversals along the way. From the minute molecular structure to the 

notion of cell we know today.



                                                  *     *     *

An interesting piece on one of my favorite foods, lettuce:





Sunday, November 27, 2022

There!!

 This is annoying. My first web scrap, yesterday, would not show the author

of the article, when it is clearly in the metadata on the site...


                                                                    


...

                                                                      



Would have to singularize authors!!??:


*     *     *
Got a working example of finding the author with Pycharm:

                                                                           


One has to make sure it is there in an html tag (and not in javascript...)


                                                                       



And the author's name should come before the top picture...

Saturday, November 26, 2022

Scraping

 Did something strange and new this afternoon: went on Google Colab

and did some Web Scraping ie got some python modules to download and summarize text

for me. The win here: it all happens on Google Servers, so there is no strain

on my home computer's memory reserves.

                                                                              



                                                                       

                                                                      



*     *     *

One writes and runs code cells one at a time (+code). The whole, below:


                                                               

*     *     *

      




MSoft_Whiteboard

 Cool!


                                                           








Friday, November 25, 2022

The Weather

 Found a very interesting piece in The Economist on global weather patterns.

We are apparently due to leave El Nina, which has been - quite exceptionally -

dominant for the last three years.


https://www.economist.com/interactive/the-world-ahead/2022/11/18/the-weather-system-that-influences-the-world

Below, an overview of Atmospheric Pressure, form the French Wikipedia; followed

by the English approach to Archimedes' Principle (la poussée d 'Archimède). Helped me

make sense of things...

                                                                        

                                                                

                                                                         


                                                                              


*     *     *


*     *     *
Whiteboarding:

                                                                            






Thursday, November 24, 2022

Thanksgiving 2022

 One of the great aspects of being neighbor to the United States is

the opportunity to join in as they celebrate various holidays. Thanksgiving,

all about family and food, is particularly festive. So even alone at home, I

fully intend to mark the day American style.


I bought some Velveeta, and look forward to making the recipe on the box,

a pasta in cheese sauce dish. I will be using tuna fish instead of chicken, but

will otherwise be going for it. Should post a photo late afternoon.


And to mark the day, below, a translation from  French Wikipedia from the article

on Sociology of the Body.


                                                 *     *     *

source: Wikipedia

translation: BingTranslate/doxa-louise

The sociology of the body is a recent branch of sociology which aims to study the representations and social implications of the human body .

 Origins and foundations 

The body between biology and culture 

The philosopher René Descartes considered in the early seventeenth century that it was easier to talk about the mind than to deal with the body of human beings. The Christian culture of the time forbade scholars to carry out the internal study of bodies. Only early surgeons, and butchers, had a good idea of what the structure of living bodies was. At the time, the modern idea of biology did not exist in the theological debates that permeated philosophy. The human body is considered in Christian Europe as a receptacle for the soul, the divine spark that Descartes himself located in the pineal gland. The Earth is considered central to the European universe of Christianity and human beings are all indebted to a hierarchy that guides them to Rome. The centralization of souls is much more of concern than that of bodies. This Catholic construction was called into question by the religious wars which were then the main cause, along with epidemics, of the destruction of bodies in Europe. At that time, the body envelope was considered secondary in relation to the souls whose migration to Paradise was to be ensured. These beliefs then gradually fades as does the influence of the churches. The modern individual is born as a result of his identification with his body rather than his soul. Legal ownership of one's own body often escapes him in law, especially among slaves who have the status of alienable object. The body becomes social with the individual, and therefore malleable, at the moment when freedom of action makes it the place of exercise of its presence in society. The family tradition studied by anthropologists (Franz Boas) in early societies shows that this moment (Renaissance in Europe) is when institutions begin to control bodies more than to worry about the future of souls. The control of bodies is exercised first over that of women, whose social acceptance derives from immediately visible physical constraints. Sociology, a product of modernity, merely repeats the work of anthropologists on bodies, in particular, in France, that ofMarcel Mauss. The modification of bodies was previously mainly studied by doctors who, in combating diseases, carried out the first investigations into their social condition (hygienism). Medicine opens an accepted scientific study of the body for therapeutic purposes that gives social control powerful instruments to discriminate against individuals but also, to them, means to increase their autonomy. The body that became human hundreds of thousands of years ago gradually acquires a status of receptacle of the individual who manifests his will to dispose of it fully.

                                                                                                                                                     ...

HAPPY THANKSGIVING TO ALL!


Couldn't resist this clever bit of coding. Looks like the screen is moving both right and 

down at the same time. (The code gets cleared on the sine and cosine function at every turn).


Needed to reduce the screen size to 600x600 for my computer. Upped the turtle speed to 7!


                                                                       



My Velveeta casserole turned out quite tasty:

                                                                              



Wednesday, November 23, 2022

Changing Up

 Live and Learn: this morning, changing the shape of turtle. 

With the help of Geeks For Geeks.


                                                                




                                                                            

The flowery gif is 50x50 pixels.

Below, after turning left by 45°:

                                                                          

Added tilt at 90°:


*     *     *





Tuesday, November 22, 2022

Gaming_One

 Found a turtle racing game on YouTube; been playing with the code:

                                                                    


                                                                        


                                                                         


                                                                        


                                                                             


https://youtu.be/0nGwqUT43TA

                                                                    *     *     *

It is, of course, impossible to start the two turtles at precisely the same moment.

One just run the two turtles with the same multiplier to notice this; turtle1 wins 

everytime. This should not make a difference given the scale of the game, but it 

is annoying.


Ran time.time(), from the Python time module - which gives the number of seconds 

that have passed since epoch ie January 1,  1970 ... Turtle2 starts in the hundredth 

of a second later every time. Below: