Thursday, February 29, 2024

BodyB2

 Cleaned up my body builder. All the interpolations are now constant,

which means going neatly from one imge to the next...


                                                         


*     *     *

The definitive version of the Aspen Shooter Game is up from Codemy. 

There are now 8 blues and no reds; and one still looses a life by not hitting

a target when one shoots!

                                                             




import pygame
import random

# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 900
WINDOW_HEIGHT = 600
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, bone_group):
self.bone_group = bone_group
self.aspen_group = aspen_group
self.food_group = food_group
self.score = 0
self.lives = 5
# Define Fonts
self.small_font = pygame.font.SysFont("impact", 24)
self.big_font = pygame.font.SysFont("impact", 60)

# Define our food images
self.blue_food = pygame.image.load("images/Enemy1.png")
# self.red_food = pygame.image.load("images/En2.png")

# Add food to our food group
# Food Type: 0=blue, 1=red
# self.food_group.add(Food((random.randint(0,800)),(random.randint(100,200)), self.red_food, 1))
for i in range(8):
self.food_group.add(Food(i * 100, 200, self.blue_food, 0))

# Define our sounds
self.score_sound = pygame.mixer.Sound('sounds/dog.mp3')
self.die_sound = pygame.mixer.Sound('sounds/aww.mp3')
self.game_over_sound = pygame.mixer.Sound('sounds/game_over.mp3')

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

keys = pygame.key.get_pressed()
if keys[pygame.K_p]:
self.pause_game()

def draw(self):
pygame.draw.rect(screen, "#003660", (0, 100, WINDOW_WIDTH, WINDOW_HEIGHT - 200), 4)

# Text
title_text = self.big_font.render("FEED ASPEN!", True, "#003660")
title_rect = title_text.get_rect()
title_rect.centerx = WINDOW_WIDTH / 2
title_rect.top = 5

win_text = self.big_font.render("YOU WIN!", True, "red")
win_rect = win_text.get_rect()
win_rect.centerx = WINDOW_WIDTH / 2
win_rect.centery = WINDOW_HEIGHT / 2 - 100

lose_text = self.big_font.render("YOU LOSE!", True, "red")
lose_rect = lose_text.get_rect()
lose_rect.centerx = WINDOW_WIDTH / 2
lose_rect.centery = WINDOW_HEIGHT / 2 - 100

restart_text = self.big_font.render("Press Enter To Play Again", True, "red")
restart_rect = restart_text.get_rect()
restart_rect.centerx = WINDOW_WIDTH / 2
restart_rect.centery = WINDOW_HEIGHT / 2

score_text = self.small_font.render("Score: " + str(self.score), True, "#003660")
score_rect = score_text.get_rect()
score_rect.topleft = (5, 5)

lives_text = self.small_font.render("Lives: " + str(self.lives), True, "#003660")
lives_rect = lives_text.get_rect()
lives_rect.topright = (WINDOW_WIDTH - 5, 5)

# Blit The Text
screen.blit(title_text, title_rect)
screen.blit(score_text, score_rect)
screen.blit(lives_text, lives_rect)

if self.score == 8:
# Add Game over Text
screen.blit(win_text, win_rect)
screen.blit(restart_text, restart_rect)
# Restart Game
self.game_over()

if self.lives == 0:
# Add Game over Text
screen.blit(lose_text, lose_rect)
screen.blit(restart_text, restart_rect)
# Remove Any remaining Food
self.food_group.remove(food_group)
# Restart Game
self.game_over()

def game_over(self):
self.aspen_group.reset()
# Check For Restart Enter
keys = pygame.key.get_pressed()
if keys[pygame.K_RETURN]:
# Reset numbers
self.score = 0
self.lives = 5
# Add new food to the screen
# self.food_group.add(Food((random.randint(0,800)),(random.randint(100,200)), self.red_food, 1))
for i in range(8):
self.food_group.add(Food(i * 100, 200, self.blue_food, 0))

def pause_game(self):
global running

is_paused = True
# Create pause loop
while is_paused:
# Account For Hitting Enter to unPause
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
is_paused = False
# Account for clicking the X to quit
if event.type == pygame.QUIT:
is_paused = False
running = False
# pygame.quit()

def check_collisions(self):
if pygame.sprite.groupcollide(self.bone_group, self.food_group, True, True):
# Increase the score
self.score += 1
# Play the score sound
self.score_sound.play()



# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y, bone_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/PlayerS.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
# Define the bone group
self.bone_group = bone_group

# Fire the bones
def fire(self):
# Restrict number of shots fired
# if len(self.bone_group) < 2:

# Fire the bone
AspenBone(self.rect.centerx, self.rect.top, self.bone_group)

def update(self):
self.move()

# self.check_collisions()

def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and self.rect.x >= 10:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT] and self.rect.x <= WINDOW_WIDTH - 95:
self.rect.x += self.velocity
'''
if keys[pygame.K_UP] and self.rect.y >= 110:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN] and self.rect.y <= WINDOW_HEIGHT - 95:
self.rect.y += self.velocity
'''

# Reset Aspen back below the box
def reset(self):
self.rect.topleft = (200, 510)


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

# Create Aspen Bone Class
class AspenBone(pygame.sprite.Sprite):
def __init__(self, x, y, bone_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/Gren.png")
# Create Rect
self.rect = self.image.get_rect()
# X Y coordinates
self.rect.centerx = x
self.rect.centery = y
# velocity of moving bone
self.velocity = 10
bone_group.add(self)

def update(self):
# Move the bone after shooting
self.rect.y -= self.velocity
# Delete the bone when it reaches the top of the blue box
if self.rect.top < 100:
self.kill()
# Lose a life
our_game.lives -= 1
# Die sound
our_game.die_sound.play()


# Define an Food Class
class Food(pygame.sprite.Sprite):
def __init__(self, x, y, image, food_type):
super().__init__()
# Define our image
self.image = image
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 5)

# Food Type: 0=blue, 1=red
self.type = food_type

# Create Random Motion
self.dx = random.choice([-1, 1])
self.dy = random.choice([-1, 1])

def update(self):
# self.rect.y += self.velocity
self.rect.x += self.dx * self.velocity
self.rect.y += self.dy * self.velocity

# Keep from leaving the screen
if self.rect.left <= 0 or self.rect.right >= WINDOW_WIDTH:
self.dx = -1 * self.dx
if self.rect.top <= 100 or self.rect.bottom >= 500:
self.dy = -1 * self.dy


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

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

# Create bone group
bone_group = pygame.sprite.Group()

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

# Create Game Object
our_game = Game(aspen, food_group, bone_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
# Fire the bone with space bar
if our_game.lives > 0:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
aspen.fire()

# 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 and bone group
food_group.update()
food_group.draw(screen)

aspen_group.update()
aspen_group.draw(screen)

bone_group.update()
bone_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()


DSAC

 You

What is the Deep Space Atomic Clock?

Copilot

The Deep Space Atomic Clock (DSAC) is a remarkable piece of technology developed by NASA. Let me break it down for you:


Purpose and Significance:

DSAC is designed to improve spacecraft navigation and communication in deep space.

It enables more precise and autonomous navigation, reducing reliance on Earth-based tracking and communication.

Imagine a spacecraft traveling far from Earth—DSAC ensures it knows its position accurately without constant updates from mission control.

Atomic Clock Basics:

DSAC is an atomic clock, which means it measures time using the vibrations of atoms.

Specifically, it relies on cesium atoms. When cesium atoms transition between energy levels, they emit microwave radiation at a very stable frequency.

This frequency serves as the “tick” of the clock.

Why Atomic Clocks Matter:

Atomic clocks are incredibly precise. DSAC’s accuracy is within 1 microsecond over 10 days!

In deep space, where distances are vast, even tiny errors in navigation calculations can lead to significant deviations.

DSAC ensures that spacecraft can pinpoint their location with exceptional accuracy.

Challenges of Deep Space Navigation:

Traditional navigation relies on signals from Earth-based antennas. These signals take time to travel to the spacecraft and back.

In deep space, this delay can be minutes or even hours.

DSAC allows spacecraft to calculate their position based on atomic time, reducing the need for constant communication with Earth.

Applications:

DSAC is crucial for upcoming missions, including those to the Moon, Mars, and beyond.

It will be part of the Orion spacecraft, which will carry astronauts to the Moon and beyond.

DSAC’s precision also benefits scientific missions, such as studying distant asteroids or exploring the outer planets.

Takeaway:

DSAC represents a leap forward in space navigation technology.

It’s like having an ultra-accurate cosmic wristwatch for our spacecraft, ensuring they stay on course in the vastness of the cosmos! ⏱️🚀




                                                                     *     *     *

Leap!!

 You

When was the Gregorian Calendar first adopted.

Copilot

The Gregorian calendar, which is now widely used around the world, was first adopted in 1582. This significant change from the traditional dating system to the modern one was decreed by Pope Gregory XIII through the papal bull “Inter gravissimas”. The primary motivation behind this reform was to correct an error in the Julian calendar, which had caused inaccuracies in calculating the date of Easter. The Julian calendar was based on a year lasting 365.25 days, but in reality, it’s approximately 365.2422 days, leading to a gradual misalignment with the Earth’s orbit. Gregory’s scientific advisers determined that the calendar had accumulated ten excess leap days since the First Council of Nicaea in AD 325. To restore the correct alignment, ten days were skipped in Catholic countries in 1582. Other countries adopted the Gregorian calendar at various dates, with some not transitioning until the 18th or 19th century. The Gregorian calendar became the world’s civil calendar universally, although some places still use an old style calendar for religious or traditional purposes12.


Interestingly, England and the rest of the British Empire, including what is now the US and Canada, adopted the Gregorian calendar much later, in 1752. The Republic of China (ROC) also made the switch to the Gregorian calendar when it was founded on January 1, 1912. Despite these changes, the public sometimes resisted, continuing to observe traditional holidays according to the old calendar.


In summary, the Gregorian calendar’s adoption marked a significant shift in how dates are reckoned, and it remains the standard civil calendar worldwide today.


You

When will the Gregorian Calendar be off by one day

Copilot

The Gregorian Calendar will be off by one day in the year 4909. This discrepancy occurs because the Gregorian calendar, despite its accuracy, still approximates the solar year. Over time, the accumulated difference between the calendar year and the actual solar year results in a one-day shift. By the year 4909, this discrepancy will lead to a misalignment of one day. However, it’s essential to note that this is a long-term prediction, and for practical purposes, the Gregorian calendar remains highly accurate for everyday use. 📅

                                                         *     *     *

So here we go, kicking it down the road, again...

Nah, let's just enjoy the day. Things are getting wayyyy too serious. Let the folks

in 4909 deal with it!! We might be living in all kinds of weird places by then ✨

                                                         *     *     *

You
Is there a special clock for spacecraft, satellites and so on.

Copilot

               Certainly! 🚀 NASA has developed a remarkable timekeeping technology specifically for spacecraft and satellites: the Deep Space Atomic Clock (DSAC). Let me share some fascinating details about it:

  1. What is the Deep Space Atomic Clock?

  2. How Does It Work?

    • The DSAC operates similarly to the atomic clocks we encounter daily, such as those in our smartphones.
    • On Earth, atomic clocks aboard satellites help GPS applications determine our location by calculating signal travel time.
    • However, in deep space, where spacecraft lack GPS, navigation teams rely on atomic clocks on Earth to determine location data.
    • As we venture farther from Earth, communication delays increase. The DSAC is the first atomic clock designed to fly onboard a spacecraft beyond Earth’s orbit, significantly improving navigation processes.
    • It allows our spacecraft to navigate autonomously, reducing reliance on Earth-based signals2.
  3. Why Is It Important?

In summary, the Deep Space Atomic Clock represents a leap forward in space navigation technology, enabling self-driving spacecraft and accurate positioning beyond our planet. 🌌🛰️



Wednesday, February 28, 2024

BodyB

 Here, I'm alternating between two mirror images, curently

in Ease In/Out mode. Not sure if this is the best setting

because there is timing to take into consideration as well.

The opacity in one is 1.000 in one and 0.000 in the other, until

they get switched around...


                              


Understanding

Came across an unexpected YouTube video last night, one that

actually helped me understand the eventual prominence of Adolph Hitler in 

Germany. In part, a story of tech. He developed a harsh stacatto speaking style

to use the microphones of the era. He was also something of a performance

artist, having attended Opera and Theater performances and worked with

a photographer to deliver his speeches as drama. That mustache: as a young

man he was fashion-conscious and tried for a look that had distance from the

19th century...


Asked Bing/Chat about the rumour that Hitler might have had a Jewish grandfather.

Alois' mother did work as a maid in a Jewish family but she eventually married

someone from the community, so there is no hard evidence. Interestingly, more recent

genetic analysis of Hitler's surviving relatives shows they were not actually Nordic but

more likely, of North African descent, an area with many Jewish people. 


 https://youtu.be/unN7e---Mbg?si=ymzwlYhy5u86o10N

Tuesday, February 27, 2024

Wheelie

 Did this the hard way, multiplying the radius by pi/2 and counting little squares 

to move the wheel. Might there be an easier way??


                                                                 


That's a No!

 It's official, Emmamuel Macron has lost his mind, hinting that

sending troops to Ukraine was not off the table. Yes, it is. Yes.

Yes. OFF...THE...TABLE!!!


It appears we are dealing with, don't let Putin think he can win this war.

I have tried to talk about this before. Putin doesn't think anything, not in

this sense of the expression. He is President of the Russian Federation and

the current constitution mandates him to express himself for Russia.

I might add he is also Commander-in-Chief of the Armed Forces. Voilà!

Other than that, he gets to visit factories and High Schools...


It just so happens that, at the moment, the same party is holding the Presidency 

and the government, but that is not necessarily the case for the Federation.

In Poland, the government is Progressive and the Presidency Conservative. 

Navalny was trying to break through and de-couple the two, and needed to

convince people this could be made to work. Russia still needs to go forward

on this.


Is this Putin's War. When American media accuse a President of eying his

place in history, it is an exageration meant to snap the discussion back to reality.

Media attacks on V. Putin's delusions of grandeur need to be seen as silly, before

anything else. Either that, or it is a case of Putin's Wars, because the Federation

is always involvd in military interventions somewhere somehow.


There might be mercenaries on the ground in Ukraine; hard to find any reliable

numbers on this. I doubt it will ever become a cause like the Spanish Civil War was.

It is a very dirty, dangerous, high tech war in a country normally the breadbasket

of Europe. So everyone is interested, many have a vital interest. It is also, for

Russia, a bit of beach and I would find it hard to deny them the hope of a Florida

moment.


Maybe, fighting in Ukraine is absolving the Federation from having to fight elsewhere.

Asia is a complex place...

Monday, February 26, 2024

Transitions

 Trying to work up a little animation.My transitions are all wrong...

                                                                      


Aid to Ukraine

 Canada's aid to Ukraine for the coming year will take the form of 320 million$

for the military, and a loan of 2.4 billion for rebuilding, salaries...to be administered

by the International Monetary Fund.


Visite de Justin Trudeau à Kyiv | Le Canada signe un accord bilatéral de sécurité, augmente son aide de 2,7 milliards | La Presse

Sunday, February 25, 2024

What!?

 https://www.skyatnightmagazine.com/space-science/does-universe-expand-faster-than-light


So what, precisely, is going on when we see a redshifted galaxy. As Chat/Bing

so eloquently put it to me, a far galaxy will move away by one light-year in one year

(and thus appear more red-shifted). I might add, the galaxy we see in year two is also 

younger. There is what wee see, and there is what is going on.


The underlying situation is that graviatationally unbound areas of space will be

present in this manner. The primeordial expansion of the universe was extremely rapid!!

Saturday, February 24, 2024

Snow Moon

 Just took out the garbage and got to see the Snow Moon; a full moon

at the peak of winter cold. It is currently -8C, and the sky is very dark

as befits a winter evening.


It was -15C this morning, but we should experience 15C by next Wdnesday. 

It's been really odd to have so little snow all winter. I wore jeans and leggings 

through the whole season. It  gets cold enough to snow, but there is  nothing

on the ground so none of that 'it feels like inside the refrigerator' feeling.


Could get used to this...👩‍🦰


To my Saturday 7:30pm, it is currently Sunday 3:30am in Moscow. And 2C. They seem

to be getting a bit of a break from winter as well!


                                                      *     *     *

"Said Succintly' it is:

Health

 It is the second anniversary of the military confrontation in Ukraine. We will

no doubt hear a lot about Ukraine's need for more weapons, going into 2025 and

beyond. Not an area of expertise, for me. Allow me to comment, instead, on the

demographic situation within the Russian Federation.


A stiking fact: Russia lost 27 million people during World War 2. The entire

population of Canada at the time was perhaps 11 million. It was a staggering

loss, and rebuilding after that war a monumental task. The current population

is perhaps 147 million, rather then the 185 million one might expect today.


.86 males to female is perhaps the worst imbalance anywhere.

                                                            


For Canada: .98 males to female

                                                                               


From Bing/ChatGPT:

You

Demography, why is  gender inequality in older age groups more pronounced in Russia.

Copilot

Demography, particularly the gender inequality observed in older age groups, is a multifaceted phenomenon. Let’s explore why this disparity is more pronounced in Russia:

Historical Context:

World War II (known as the Great Patriotic War in Russia) had a profound impact.

High male mortality: Millions of men died during the war, leading to a significant gender imbalance.

The war’s aftermath influenced population dynamics for decades.

Life Expectancy:

Russian women have consistently enjoyed longer life expectancy than men.

Factors contributing to this disparity include:

Health behaviors: Men tend to engage in riskier behaviors (smoking, alcohol consumption, etc.).

Occupational hazards: Male-dominated industries often involve dangerous work.

Healthcare access: Women are more likely to seek medical care.

Healthcare System:

The Soviet healthcare system prioritized women’s health.

Maternal and child health received significant attention.

This legacy continues, benefiting older women.

Social Roles and Family Structure:

Traditional gender roles persist.

Women often take on caregiving responsibilities for children and elderly family members.

Men face stress related to work and societal expectations.

Economic Transition:

After the collapse of the Soviet Union, economic instability affected men disproportionately.

Unemployment, alcoholism, and other challenges impacted men’s health.

Migration Patterns:

Male migration for work or military service affects gender ratios.

Men leaving rural areas for cities or abroad contribute to the imbalance.

Low Birth Rates:

Russia faces low fertility rates.

Fewer births mean fewer young men entering the population.

Social Isolation:

Older women often outlive their male partners.

Widowhood leads to social isolation for women.

Policy Implications:

Addressing gender inequality requires comprehensive policies:

Health promotion: Target men’s health behaviors.

Social support: Combat isolation among elderly women.

Family-friendly policies: Encourage childbirth and shared caregiving.

In summary, Russia’s gender inequality in older age groups results from a complex interplay of historical events, cultural norms, health disparities, and socioeconomic factors. Understanding these dynamics is crucial for informed policy decisions. 👵👴🇷🇺

                                                                   *     *     *

Thus, on this difficult day; how about healthier men for the Russian Federation!!


                                                                  *     *     *

Copilot
The rise of the Bolsheviks to power in Russia was a pivotal moment in history. Let’s explore how they achieved this:

Party Split:
In 1903, during the Second Party Congress of the Russian Social Democratic Labour Party, a vote split the party into two factions:
Mensheviks (meaning “minority”).
Bolsheviks (meaning “majority”).
Despite their name, the Bolsheviks were initially a minority led by Vladimir Lenin 1.

Bloody Sunday:
On January 22, 1905, a peaceful protest in St. Petersburg led by a priest resulted in unarmed demonstrators being fired upon by the Tsar’s troops.
This event, known as Bloody Sunday, shattered trust in the Tsar.
Riding the wave of anger, the Social Revolutionary Party gained prominence and established the October Manifesto.
Lenin urged the Bolsheviks to take violent action, but the Mensheviks rejected this approach 1.

Early 1910s:
The Bolsheviks remained a minority within the party.
Lenin was in exile in Europe, and they boycotted the Duma elections.
There was little demand for revolutionary politics during this period of relative peace.
The Tsar’s moderate reforms discouraged support for extremists 1.

World War I:
Initially, the Bolsheviks faded into the background due to the rallying cry of national unity at the outbreak of the war.
However, after crushing defeats of the Russian army, sentiments changed.
By the end of 1916, Russia had suffered 5.3 million deaths, desertions, and prisoners of war 1.


The October Revolution (1917):
Amid widespread dissatisfaction and economic hardship, the Bolsheviks seized power.
Their appeal to the people’s desire for peace, bread, and land led to the overthrow of the Tsar.
The establishment of the Soviet government marked a turning point in Russian history 23.
In summary, the Bolsheviks capitalized on social discontent, wartime losses, and their revolutionary message to take control of Russia, ultimately shaping the course of the 20th century. 🇷🇺🔴🌟


                                                                   *     *     *

Copilot
Certainly! The events in Russia played a significant role in triggering World War I. Let’s explore how:

Austria-Hungary’s Declaration of War on Serbia:
The sequence began with Austria-Hungary declaring war on Serbia, a Russian ally.
In response, Russia issued an ultimatum to Vienna via Saint Petersburg, warning Austria-Hungary against attacking Serbia.

Russia’s Interest in the Balkans:
Although Russia had no formal treaty obligation to Serbia, it emphasized its interest in controlling the Balkans.
Russia viewed this as a long-term strategic goal to gain a military advantage over Germany and Austria-Hungary.

Tsar Nicholas II’s Decision to Mobilize:
Tsar Nicholas II ordered the mobilization of Russian forces on July 30, 1914, to deter Austria-Hungary from invading Serbia.
Historian Christopher Clark considers this Russian general mobilization a critical decision during the August crisis.

Germany’s Declaration of War on Russia:
When Russia did not comply with Germany’s demand to demobilize, Germany declared war on Russia on August 1, 1914.
Germany prioritized its offensive against France, leading to further escalation.

Impact on World History:
World War I had far-reaching consequences, including the fall of imperial dynasties (including Russia’s), the Bolshevik Revolution in Russia, and the destabilization of European society.
In summary, Russia’s involvement in World War I was intertwined with its strategic interests, alliances, and the broader geopolitical context. 🇷🇺🌍🔥

Friday, February 23, 2024

The Text

 I was curious about how the Russian Federation Constitution(1993) might

be amended and asked Bing/Chat about it. I was give a reference to the actual

text. Below:

http://www.constitution.ru/en/10003000-01.htm


                                      *     *     *

UPPER HOUSE__FEDERATION COUNCIL:

The federal subjects of Russia, also known as the subjects of the Russian Federation, are the top-level political divisions according to the Constitution of Russia. These entities form the building blocks of the country’s administrative structure. Here are the main types of federal subjects:


Republics: These regions have a significant ethnic population and often have their own official languages alongside Russian. For example, the Republic of Tatarstan and the Republic of Bashkortostan1.

Krais (Territories): Krais are large territorial units that cover vast areas. Examples include the Krasnoyarsk Krai and the Primorsky Krai1.

Oblasts (Regions): Oblasts are similar to krais but are usually smaller in size. They are the most common type of federal subject. Examples include the Moscow Oblast and the Leningrad Oblast1.

Cities of Federal Importance: These are major cities with special status. The three cities falling into this category are Moscow, Saint Petersburg, and Sevastopol. Each of these cities also comprises other towns and districts within its boundaries1.

Autonomous Oblast: The Jewish Autonomous Oblast is an example of this type. It has a distinct ethnic minority population and a degree of autonomy1.

Autonomous Okrugs (Areas): These regions are also associated with specific ethnic groups. The Yamalo-Nenets Autonomous Okrug and the Chukotka Autonomous Okrug are examples1.

Additionally, Russia is divided into eight federal districts, each overseeing a group of federal subjects. These districts are the Central, Northwestern, Southern, North Caucasian, Volga, Ural, Siberian, and Far Eastern districts2.


Keep in mind that Kaliningrad Oblast is geographically separated from the rest of Russia by other countries, as it lies between Poland and Lithuania1. Overall, Russia’s diverse federal subjects contribute to its rich cultural and geographical tapestry.


In the Federation of Russia, the governance of each federal subject is structured as follows:


Head of the Federal Subject (Governor):

The highest official of a federal subject is known as the Governor (Russian: губернатор).

The Governor serves as the chief executive and the political head of the federal subject.

They are not directly subordinate to federal authorities but hold significant authority within their region.

The Governor represents the federal subject both politically and ceremonially1.

Parliament:

Each federal subject has its own parliament (legislative body).

The parliament plays a crucial role in local governance, passing laws, and representing the interests of the region’s residents.

Constitution or Charter:

Every federal subject has its own constitution or charter.

These legal documents outline the rights, responsibilities, and governance structure specific to that region.

The authority of these organs (parliament, constitutional court, etc.) may vary among federal subjects23.

Constitutional Court:

Each federal subject has its own constitutional court.

The court ensures that regional laws comply with the federal constitution and resolves legal disputes within the subject.

Equal Representation in the Federation Council:

The federal subjects have equal representation in the Federation Council, which is the upper house of the Federal Assembly.

Each subject sends two delegates to the Federation Council2.

Regional Autonomy:

While all federal subjects are equal, some, such as republics, enjoy more cultural autonomy.

Republics often have their own official languages alongside Russian and have a degree of self-governance2.

In summary, the governance of each federal subject in Russia involves a combination of local leadership (Governor), legislative bodies (parliaments), legal frameworks (constitutions), and representation at the federal level.

LOWER HOUSE__DUMA:

In the Federation of Russia, the electoral districts for the lower house, known as the State Duma, are defined as follows:

  1. Federal Subjects: Russia is divided into federal subjects, which include republics, krais (territories), oblasts (regions), cities of federal importance, autonomous oblasts, and autonomous okrugs1. Each federal subject corresponds to one or more electoral districts.

  2. Representation: Citizens within each electoral district cast their votes to elect one or more representatives (deputies) to the State Duma. The number of deputies per district varies based on population and other factors.

  3. Population-Based Allocation: The allocation of deputies is based on population size. Some larger federal subjects have multiple electoral districts, while smaller ones may have only one1.

  4. Redistricting: The boundaries of electoral districts can change due to redistricting, population shifts, and other considerations. Redistricting aims to ensure fair representation and equal voting power for citizens across the country.

  5. Electoral Commissions: Electoral commissions at various levels oversee the delimitation and organization of electoral districts. They work to maintain transparency and fairness in the process.

  6. Urban and Rural Districts: Electoral districts can encompass both urban and rural areas. Urban districts may have higher population density, while rural districts cover larger geographical areas.

  7. Constitutional Framework: The Constitution of Russia provides the legal framework for electoral districts and the election process. It outlines the rights and responsibilities of citizens, candidates, and electoral bodies.

In summary, Russia’s electoral districts are determined by a combination of geographical boundaries, population size, and administrative divisions. These districts play a crucial role in representing citizens’ interests in the State Duma.

                                                               *     *     *Southern Federal District, Russia Guide (russiatrek.org)






Aspen22

 The new Codemy pygame tutorial is out: we are turning the game into

a shooter. Aspen hits her targets with a bone; I found a cute grenade rendering

as an alternative. Either way, the game is rough. If I fire a grenade - with

the space bar - and don't down anything, I loose a life. Still, the player remains

below the playing field so there is no panic to remove oneself...






It is interesting how the capacity to shoot is integrated in the OOP model. The

bone group becomes a necessary element of the player(Aspen) class.

                                                            
                                        


                                                      





                                                                     

                                                                                 




import pygame
import random

# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 900
WINDOW_HEIGHT = 600
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, bone_group):
self.bone_group = bone_group
self.aspen_group = aspen_group
self.food_group = food_group
self.score = 0
self.lives = 5
# Define Fonts
self.small_font = pygame.font.SysFont("impact", 24)
self.big_font = pygame.font.SysFont("impact", 60)

# Define our food images
self.blue_food = pygame.image.load("images/En2.png")
self.red_food = pygame.image.load("images/Enemy1.png")

# Add food to our food group
# Food Type: 0=blue, 1=red
# self.food_group.add(Food((random.randint(0,800)),(random.randint(100,200)), self.red_food, 1))
for i in range(8):
self.food_group.add(Food(i * 100, 200, self.blue_food, 0))

# Define our sounds
self.score_sound = pygame.mixer.Sound('sounds/dog.mp3')
self.die_sound = pygame.mixer.Sound('sounds/aww.mp3')
self.game_over_sound = pygame.mixer.Sound('sounds/game_over.mp3')

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

keys = pygame.key.get_pressed()
if keys[pygame.K_p]:
self.pause_game()

def draw(self):
pygame.draw.rect(screen, "#003660", (0, 100, WINDOW_WIDTH, WINDOW_HEIGHT - 200), 4)

# Text
title_text = self.big_font.render("FEED ASPEN!", True, "#003660")
title_rect = title_text.get_rect()
title_rect.centerx = WINDOW_WIDTH / 2
title_rect.top = 5

win_text = self.big_font.render("YOU WIN!", True, "red")
win_rect = win_text.get_rect()
win_rect.centerx = WINDOW_WIDTH / 2
win_rect.centery = WINDOW_HEIGHT / 2 - 100

lose_text = self.big_font.render("YOU LOSE!", True, "red")
lose_rect = lose_text.get_rect()
lose_rect.centerx = WINDOW_WIDTH / 2
lose_rect.centery = WINDOW_HEIGHT / 2 - 100

restart_text = self.big_font.render("Press Enter To Play Again", True, "red")
restart_rect = restart_text.get_rect()
restart_rect.centerx = WINDOW_WIDTH / 2
restart_rect.centery = WINDOW_HEIGHT / 2

score_text = self.small_font.render("Score: " + str(self.score), True, "#003660")
score_rect = score_text.get_rect()
score_rect.topleft = (5, 5)

lives_text = self.small_font.render("Lives: " + str(self.lives), True, "#003660")
lives_rect = lives_text.get_rect()
lives_rect.topright = (WINDOW_WIDTH - 5, 5)

# Blit The Text
screen.blit(title_text, title_rect)
screen.blit(score_text, score_rect)
screen.blit(lives_text, lives_rect)

if self.score == 8:
# Add Game over Text
screen.blit(win_text, win_rect)
screen.blit(restart_text, restart_rect)
# Restart Game
self.game_over()

if self.lives == 0:
# Add Game over Text
screen.blit(lose_text, lose_rect)
screen.blit(restart_text, restart_rect)
# Remove Any remaining Food
self.food_group.remove(food_group)
# Restart Game
self.game_over()

def game_over(self):
self.aspen_group.reset()
# Check For Restart Enter
keys = pygame.key.get_pressed()
if keys[pygame.K_RETURN]:
# Reset numbers
self.score = 0
self.lives = 5
# Add new food to the screen
# self.food_group.add(Food((random.randint(0,800)),(random.randint(100,200)), self.red_food, 1))
for i in range(8):
self.food_group.add(Food(i * 100, 200, self.blue_food, 0))

def pause_game(self):
global running

is_paused = True
# Create pause loop
while is_paused:
# Account For Hitting Enter to unPause
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
is_paused = False
# Account for clicking the X to quit
if event.type == pygame.QUIT:
is_paused = False
running = False
# pygame.quit()

def check_collisions(self):
if pygame.sprite.groupcollide(self.bone_group, self.food_group, True, True):
# Increase the score
self.score += 1
# Play the score sound
self.score_sound.play()

'''
caught_food = pygame.sprite.spritecollideany(self.aspen_group, self.food_group)
if caught_food:
# Check type of food, red/blue
if caught_food.type == 0:
# Blue
# Play Die Sound
self.die_sound.play()
# Lose a life
self.lives -= 1
# Move Aspen Back Under Box
self.aspen_group.reset()
# Play Game Over Sound
if self.lives == 0:
# Play sound
self.game_over_sound.play()
else:

# Play Score sound
self.score_sound.play()
caught_food.remove(self.food_group)
# Increase the score
self.score += 1

# Logic to remove blue and add red
if len(self.food_group) > 0:
# Randomly Remove Blue Food From Sprites in Food Group
random.choice(self.food_group.sprites()).kill()

if len(self.food_group) >=1:
# Add a new red food
self.food_group.add(Food((random.randint(0,800)),(random.randint(100,200)), self.red_food, 1))
else:
self.aspen_group.reset()
self.game_over_sound.play()
'''


# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y, bone_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/PlayerS.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
# Define the bone group
self.bone_group = bone_group

# Fire the bones
def fire(self):
# Restrict number of shots fired
# if len(self.bone_group) < 2:

# Fire the bone
AspenBone(self.rect.centerx, self.rect.top, self.bone_group)

def update(self):
self.move()

# self.check_collisions()

def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and self.rect.x >= 10:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT] and self.rect.x <= WINDOW_WIDTH - 95:
self.rect.x += self.velocity
'''
if keys[pygame.K_UP] and self.rect.y >= 110:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN] and self.rect.y <= WINDOW_HEIGHT - 95:
self.rect.y += self.velocity
'''

# Reset Aspen back below the box
def reset(self):
self.rect.topleft = (200, 510)


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

# Create Aspen Bone Class
class AspenBone(pygame.sprite.Sprite):
def __init__(self, x, y, bone_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/Gren.png")
# Create Rect
self.rect = self.image.get_rect()
# X Y coordinates
self.rect.centerx = x
self.rect.centery = y
# velocity of moving bone
self.velocity = 10
bone_group.add(self)

def update(self):
# Move the bone after shooting
self.rect.y -= self.velocity
# Delete the bone when it reaches the top of the blue box
if self.rect.top < 100:
self.kill()
# Lose a life
our_game.lives -= 1
# Die sound
our_game.die_sound.play()


# Define an Food Class
class Food(pygame.sprite.Sprite):
def __init__(self, x, y, image, food_type):
super().__init__()
# Define our image
self.image = image
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 5)

# Food Type: 0=blue, 1=red
self.type = food_type

# Create Random Motion
self.dx = random.choice([-1, 1])
self.dy = random.choice([-1, 1])

def update(self):
# self.rect.y += self.velocity
self.rect.x += self.dx * self.velocity
self.rect.y += self.dy * self.velocity

# Keep from leaving the screen
if self.rect.left <= 0 or self.rect.right >= WINDOW_WIDTH:
self.dx = -1 * self.dx
if self.rect.top <= 100 or self.rect.bottom >= 500:
self.dy = -1 * self.dy


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

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

# Create bone group
bone_group = pygame.sprite.Group()

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

# Create Game Object
our_game = Game(aspen, food_group, bone_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
# Fire the bone with space bar
if our_game.lives > 0:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
aspen.fire()

# 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 and bone group
food_group.update()
food_group.draw(screen)

aspen_group.update()
aspen_group.draw(screen)

bone_group.update()
bone_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()