Sunday, December 31, 2023

The_Hittites

 Stumbled upon a very interesting documentary. Gives a nice account

of what life might have been like in the Bronze Age.



Saturday, December 30, 2023

Audacious

 Trying different looks for my vid. Here, with the Champlain

bridge as background. One uses the blit() function to show the image.

                                                                 




Not so sure Jamaican Dub is the music that goes here. I did 'get' how

to record anything I can hear on my computer with Audacity...

                                                                  




Thursday, December 28, 2023

Character_W

 After many trials, managed to wire my character. Next lesson will

be a walk cycle. (There are other tutorials with less realistic characters;

if this proves impossible...)



*     *     *

In this week's pygame lesson, nothing about the game changes, but its

internal orgqnization evolves so that game events are all grouped on a Game class.

This should make things simpler to code, and easier to maintain. It's all OOP now.



import pygame
import random

# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 500
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption('Codemy.com - Aspen Classes')
clock = pygame.time.Clock()
running = True

dt = 0
player_pos = pygame.Vector2(screen.get_width() / 2, screen.get_height() / 2)


# Define a Game Class
class Game():
def __init__(self, aspen_group, food_group):
self.aspen_group = aspen_group
self.food_group = food_group

def update(self):
self.check_collisions()

def check_collisions(self):
if pygame.sprite.groupcollide(self.aspen_group, self.food_group, False, True):
print(len(self.food_group))


# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/aspen2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = 5

# Add food group to aspen class
# self.food_group = food_group

def update(self):
self.move()

# self.check_collisions()

def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT]:
self.rect.x += self.velocity
if keys[pygame.K_UP]:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN]:
self.rect.y += self.velocity


# def check_collisions(self):
# if pygame.sprite.spritecollide(self, self.food_group, True):
# print(len(self.food_group))


# Define an Food Class
class Food(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/food2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 2)

def update(self):
self.rect.y += self.velocity


# Create an food group
food_group = pygame.sprite.Group()

# Create 5 aspens
for i in range(8):
food = Food(i * 100, 10)
food_group.add(food)

# Create aspen group
aspen_group = pygame.sprite.Group()
# Create and position aspen
aspen = Aspen(200, 400)
# Add aspen to the group
aspen_group.add(aspen)

# Create Game Object
our_game = Game(aspen_group, food_group)

while running:
# poll for events
# pygame.QUIT event means that the user clicked the X to close the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False

# Pick the screen color
screen.fill("silver")

# Blit (copy) screen object at a given coordinates
# screen.blit(aspen, aspen_rect)

# Draw and Move Food and Aspen sprite
food_group.update()
food_group.draw(screen)

aspen_group.update()
aspen_group.draw(screen)

# Update Game Instance
our_game.update()

# flip the display to output our work to the screen
pygame.display.flip()

# Set the clock stuff / delta time in seconds since the last frame
# used for framerate independent physics
dt = clock.tick(60) / 1000

pygame.quit()

Wednesday, December 27, 2023

Peregrine

 


*     *     *

Found the trick. One needs to choose the bone that is active, and any bone bone 

one creates next will a child to it. Choose using the skeleton tool, that is!!

                                                                     


Tuesday, December 26, 2023

Found

source: La Presse, AGENCE FRANCE-PRESSE

translation: BingTranslate/doxa-louise

Imprisoned in the Arctic Russian opposition leader Alexei Navalny says he is "fine"

A charismatic anti-corruption activist and Vladimir Putin's number one enemy, Alexei Navalny, 47, is serving a 19-year prison sentence for "extremism".


(Moscow) Imprisoned Russian opposition leader Alexei Navalny, whose fate is worrying in the West, said on Tuesday that he was "fine" after a long and "tiring" transfer to a remote Arctic penal colony.


His relatives, who had not heard from him for nearly three weeks, announced on Monday that they had found him in a penal colony in Kharp, located in Yamalo-Nenetsia, beyond the Arctic Circle.


They say the Russian authorities are seeking to isolate him even further, three months before the March 2024 presidential election in which Vladimir Putin's victory seems assured.


In his first social media post since his disappearance, Navalny said the 20-day journey to his new place of detention had been "quite tiring".


"But I'm in a good frame of mind, like Santa Claus," he added, referring to his "beard" that grew during the long journey as well as his new winter clothes adapted to the polar temperatures.


"Anyway, don't worry about me. I am good. I'm relieved to have finally arrived," said the opposition leader, who was able to see his lawyer on Monday, according to his aides.


A charismatic anti-corruption activist and Vladimir Putin's number one enemy, Alexei Navalny, 47, is serving a 19-year prison sentence for "extremism". He was arrested in January 2021 after returning from Russia from convalescing in Germany for a poisoning he blames on the Kremlin.


He disappeared in early December from the penal colony in the Vladimir region, 250 kilometres east of Moscow, where he had been held until then, which meant that he would likely be transferred to another facility.


In Russia, such journeys often take weeks by train and in several stages, with relatives of detainees remaining without news during this period.


"Polar Wolf"

According to the "extremism" verdict against Navalny, the opponent must serve his sentence in a "special regime" colony, the category of facilities with the harshest conditions and usually reserved for lifetime sentence and the most dangerous prisoners.


The colony where Navalny is currently detained, nicknamed "Polar Wolf", is a legacy of the Soviet Gulag. The inmates work there, among other things, tanning and sewing reindeer skins, which are used by the local indigenous people.


He said he arrived at his new place of detention on Saturday evening, after a discreet journey with "such a strange itinerary" that he did not expect to be found by his relatives until mid-January.


"That's why I was surprised when the cell door opened yesterday and I was told, 'A lawyer is here for you,'" he said, expressing gratitude for the "support" expressed.


One of his close aides, Ivan Zhdanov, accused the Russian authorities of trying to "isolate" him in the run-up to the presidential election.


According to him, Alexei Navalny is being held in "one of the northernmost and most remote settlements" in Russia, where conditions are "difficult".


In the West, his disappearance had caused concern, not quite appeased by his reappearance in a very remote region.


The United States said on Monday it was "deeply concerned" about the "conditions of detention" of Alexei Navalny, demanding his release.


Navalny's movement has been methodically eradicated by the government in recent years, pushing his collaborators and allies into exile or prison.


In early December, Russian authorities filed a new case for "vandalism" against the anti-corruption activist, which could add three years to his sentence.


Vladimir Putin is aiming for another six-year term in the Kremlin in the March presidential election, a term that would take him until 2030, the year he turns 78.  


                                                               *     *     *

Getting clear on the skeleton functions in Synfig:


One gets an independent skeleton by creating a new layer from the properties panel

before creating it.

                                                                                       


                                                                             


To link the skeleton to the object, chosse the object holding down control and linking

with the skeleton element on a right click 'Link to bone' command.                                                                                         






Monday, December 25, 2023

Sunday, December 24, 2023

The Trek

 It is ironical: my father used to joke to me to 'put on my

Pennman' s' when heading on particularly cold days. Pennman's is

a Canadian brand of clothing, known in the early 20th century for

its longjohns.


Well today, the first Christmas Eve with no snow in memory, I am about

to go out in a brand new pair of Pennman's jeggings, size four which I

picked up at Walmart's the other day. A bit loose, but after I wash them I

know they will fit great. Hoorah for Pennman's!!


I also watched a movie on the internet, last night, a Star Trek Movie from 2013

with a whole new set of actors playing Kirk, Spock, Scotty...It was great,

but clearly cinematic where the original was a black and white television event.

I think it might have been made with a wink to us original fans of the product.

At one point, Spock asks for advice to the elder Spock - played by Leonard

Nimoy - with no backstory covering the rest of the modernized characters. Who

cares, this was a ripper. the link below:


https://youtu.be/Wzs6f5G7I-o?si=qW5LZij3zSkU2LJh

Will be going back to Synfig later today. I know I can do this!!

Saturday, December 23, 2023

Synfig_Bones

 I just knew I would be having trouble with this, and I did. I'm on

Sybfig Lesson 7, Bones where I am trying to rig a character together 

from it's parts. spent a long time trying to create a child bone to a skeleton one. 

The interface has changed in the latest version, and I just discovered

the new tool. It is in the tool box, and meant to add a skeleton and child bones

easypeasy.

                                                               


*     *     *

So far:

                                                                                      




                                                                                   
                                                                                                                            ...

Friday, December 22, 2023

Aspen_Collisions

 Worked through a new Aspen tutorial illustrating collision detection. We now have 

both the dog sprite and the food sprites defined in OOP ie with classes and '.self' reference. 

This game consists of the pooch scoring the food bowls. The scoring has yet to be 

worked through...

                                                                         




import pygame
import random

# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 500
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption('Codemy.com - Aspen Classes')
clock = pygame.time.Clock()
running = True

dt = 0
player_pos = pygame.Vector2(screen.get_width() / 2, screen.get_height() / 2)


# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y, food_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/aspen2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = 5
# Add food group to aspen class
self.food_group = food_group

def update(self):
self.move()
self.check_collisions()

def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT]:
self.rect.x += self.velocity
if keys[pygame.K_UP]:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN]:
self.rect.y += self.velocity

def check_collisions(self):
if pygame.sprite.spritecollide(self, self.food_group, True):
print(len(self.food_group))


# Define an Food Class

class Food(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/food2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 2)



def update(self):
self.rect.y += self.velocity


# Create an food group
food_group = pygame.sprite.Group()

# Create 5 aspens
for i in range(8):
food = Food(i * 100, 10)
food_group.add(food)

# Create aspen group
aspen_group = pygame.sprite.Group()
# Create and position aspen
aspen = Aspen(200, 400, food_group)
# Add aspen to the group
aspen_group.add(aspen)

while running:
# poll for events
# pygame.QUIT event means that the user clicked the X to close the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False

# Pick the screen color
screen.fill("silver")

# Blit (copy) screen object at a given coordinates
# screen.blit(aspen, aspen_rect)

# Draw and Move Food and Aspen sprite
food_group.update()
food_group.draw(screen)
aspen_group.update()
aspen_group.draw(screen)

# flip the display to output our work to the screen
pygame.display.flip()

# Set the clock stuff / delta time in seconds since the last frame
# used for framerate independent physics
dt = clock.tick(60) / 1000

pygame.quit()

Thursday, December 21, 2023

Wintertime

 First day of winter, but things feel odd. It is cold but there is no snow,

and we are headed for a green Christmas in the Montreal region. Still,

good to turn the corner on long nights.


Asked Bing Create for an image from Finland. Yo, wintertime...

                                                     


                                                                           *     *     *

source: Slate Fr

translation: GoogleTranslate/doxa-louise

How is the concept of quantum entanglement used?

Quora — February 4, 2023 at 9:58 a.m.
If the concept seems obscure, the phenomenon can have real applications, still studied by scientists.
Quantum entanglement has potential applications in areas of quantum information, such as quantum cryptography, quantum teleportation, or quantum computing.

Question of the day : “What is quantum entanglement used for?”

Jules Ruest 's (Montreal) response :

Excellent question, which is why I am happy to answer it by being as clear as possible in my explanations. First of all, before answering this question directly, I would like to explain what quantum entanglement is .

It must be said that this phenomenon defies belief. Quantum entanglement refers to the existence of an invisible link between two particles that were emitted at the same time, regardless of the distance separating them. In this way, if the state of one of them changes, that of its twin changes instantly, as if it were a single system.

“When we “touch” one of a pair of entangled objects, the second one flinches, despite the distance , ” summarizes Nicolas Gisin , Swiss physicist and professor of physics at the University of Geneva. This phenomenon has been verified many times in the laboratory since the 1970s. Don't ask me how it's possible, scientists themselves have been tearing their hair out for decades to explain this phenomenon .

For the moment, nothing is understood about this invisible link. But despite everything, understanding its mechanism, much research has been undertaken to exploit this fabulous property in the fields of quantum information, such as quantum cryptography, quantum teleportation and quantum computer .

Quantum cryptography
It exploits the principles of quantum entanglement to make a message incomprehensible to anyone who intercepts it, except the person for whom it is intended.

To the extent that it is impossible to clone entangled information without it being destroyed, or to measure a quantum state without modifying it, the reading of the information by an intruder would be immediately detected by the recipients of the message.

Quantum teleportation
It is not a question here of actually teleporting objects or people as in Star Trek , but rather of setting up a communication protocol consisting of transferring the quantum state of a system to another similar system spatially separated from the first by taking advantage of quantum entanglement.

Quantum computer
A quantum computer is the equivalent of a classical computer, except that its calculations are carried out at the atomic scale. It is based on the laws of quantum physics , which focuses on the behavior of matter and light at the microscopic level.

At this scale, strange, totally counterintuitive phenomena occur. An object can be in several states as long as it has not been measured: this is the principle of quantum superposition . And two objects can influence each other even when separated by a great distance: this is the principle of quantum entanglement.

Quantum entanglement is a fascinating area of ​​research that never ceases to amaze and for which new fields of research will certainly emerge in the future.

                                                             *     *     *


                                                                              




Wednesday, December 20, 2023

SynfigL6

 Synfig lesson 6, the talking boy, is done. The synchro is pretty bad. I need

to work on this!!


                                                       

  

                                                                   *     *     *
I've also been trying to up my drawing skills. Digital drawing opens new challenges and

possibilities. In viewing a few videos, did get the notion that the pros do as they always

did, this time using layers. rough outline, sketch, color, blend and shade...Am using Krita:

Chose a high resolution, but smallish size canvas. My tablet should work fine.

                                                              

As with all graphics program, the first layer is immutable. Chose a raster in a

bluish white. It can be made to not show in the final design.
                                                            

Krita is known for its 'brushes', that is, what I can call on to create effects. it assigned me

me some favorites, but I need to find my own... 


Go on one of your drawing layers, and enable drawing.




Neat feature: If you hold down shift while drawing, and drag on the screen, you change

the size of the brush!!


                                                             

Tuesday, December 19, 2023

Biggie

 Dreaming Big, this morning. I will soon be able to animate...


                                                           


*     *     *

Coding a keylogger in Python is not without its perils. Below:


Monday, December 18, 2023

AstraL

 I've become fascinated by an aspect of the Synfig interface which the course

seems to enjoy. It is a keyboard overlay, a  set-up often used by gamers to show

what they are doing while streaming their gameplay. This one doesn't show the whole

keyboard at once, but only Mouse, Ctrl, Alt and the key. Enter also appears on

the right now and then. Nice.



I've been looking high and low but cannot seem to find the program. The course

was originally recorded on a Russian keyboard. 

                                                                         


*     *     *
I did find that - as of last spring - Russia has been replacing Windows with Astra Linux.

It is the operating system used by the Military, more 'secure'...

                                                                       

                                                                         *     *     *
Still working on Synfig Lesson 6, getting the character to speak. It's tricky to

synchronize the face sequence with the spoken words in the sound file... tomorrow.

On the up side, managed to run the Stickman figurine, which is a python plug-in.

The process of adding a plug-in is easy enough. One just needs to place the Python file

in the right folder.

                                                            

The code itself is a long take on vectors. For Windows, it can be found below, in the

program files:

                                                               

It is called as follows:

                                                                             

I am not too discouraged: the code uses codecs, which are translators from one programming

language to another.                                                                              


Sunday, December 17, 2023

Syn_Lesson4

 Character 1 is now assembled, and wired. The assembly involves a group of all

parts that are scaled as a group. The wiring uses the control function to assign

a pivot to each moving part, and groups the body parts as a sub-group that can

move as one...(Yes, I had to go through it more than once :-])







Saturday, December 16, 2023

Syn_Lesson3

 Lesson 3 of Synfig tutorials contains really invaluable information about

the settings needed to render one's work. 


1- To create a standard .avi, one needs to specify where the rendered animation will go

but also the rendering codec, here ffmpeg, under Target.

                                                                        


2- To create a gif - that keeps looping - the Target is magik++

                                                                               

3- To export 1 or many images(120, by default) as .png, one uses auto:

                                                                          



                                                                                        


This can be used to run a sequence one has created in Synfig on a clear background, 

in another video:

                                                                          


Creating an empty folder to receive these images is crucial, or one ends up with 120

images appearing on the desktop...😕

                                                                        *     *     *
The Workshop file with all the items to reproduce the lessons:



Friday, December 15, 2023

Unique

 Worked through the Codemy tuto for this week. Learning how

to generate multiple Sprites. These use the draw(0 function to go

to the screen.

                                                       


Asked Chatgpt for unique sprite positions; got the following code:

import random
import pygame

class Sprite(pygame.sprite.Sprite):
    def __init__(self, x, y, width, height, color):
        super().__init__()
        self.x = x
        self.y = y
        self.width = width
        self.height = height
        self.color = color
        self.rect = pygame.Rect(x, y, width, height)

    def update(self):
        pass

sprite_group = pygame.sprite.Group()
used_positions = set()

for i in range(5):
    while True:
        x = random.randrange(0, 800, 30)
        y = random.randrange(0, 600, 30)
        if (x, y) not in used_positions:
            used_positions.add((x, y))
            break
    sprite = Sprite(x, y, 30, 30, (255, 0, 0))
    sprite_group.add(sprite)

# Example usage
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    sprite_group.update()
    sprite_group.draw(window)
    pygame.display.flip()

It's actually very clever. A set can never have any repeats!!

                                                 *     *     *

Not sure about this approach...


                                                                                     


                                                                          *     *     *
Do I believe in magic?? A little checking showed me that my code - above - was

only doing half the job ie adding a new value to the set. My new code - yo Chatgpt - 

does it all:

                                                                                

                                                                               

Thursday, December 14, 2023

Feathering

 I'm happy; I've found a series of fourteen tutorials on Synfig (translated from the Russian,

no less) that are a great help. From the first, which introduces the interface, I've cleared up

some things for myself.


The big find, 'feathering'. Could never understand what this was about... It is the capacity

to more or less blur the edges of objects. Synfig is not meant for frame by frame drawing

like traditional animation, but relies on machine function. That is why, at first anyway, it seems

impossibly fastiduous. I'm starting to get it...

                                                                  

My circles have 5pt, 10 and 15 feathering settings:


It is set in the object parameters, bottom left.

Here, I am getting a circle with no border; I need to ask for it with the features I choose.


Everything is layer. It can be removed easily as one works along from the bottom right.

And layers can be moved up or down, grouped...




                                                            *     *     *

For Lesson 2, we are given a boy image, and a background with places the boy goes

to: school, cinema, store, home. If I want to see what I have done, I use the preview

feature. 
                                                             

Otherwise, my work area looks like this:  

                                                                         

The losanges are called way pointys. They are created automatically if I move on

the timeline.

As always, the little green man at the bottom of the screen needs to go to orange

sothat I can go to animate mode and advance the project.

                                                                     

Saves are in the .sifz format, a zip file on the native format.